PageSourceSearch

https://www.seanews.com.tr/assets/IstfixPage-BgMDZrcP.js

js seanews.com.tr collected 2026-10-02 11:18:39 UTC 28,791 bytes, 1 lines download raw bytes

1import{c as ge,r as n,b as y,j as e,az as Ae,k as j,l as f,aq as De,L as $e,m as N,n as b,S as Y,B as S,X as ue,ax as Re}from"./index-DvhEnGG3.js";import{F as Ee}from"./Footer-BselVbtb.js";import{H as Le}from"./Helmet-CcT8-MLC.js";import{S as v,a as w,b as k,c as C,d as i}from"./select-vcTZAPV9.js";import{T as Oe,a as ze,b as R,c as E}from"./tabs-BQ2O5CL_.js";import{T as L}from"./trending-up-CmFiU1GD.js";import{C as Ye}from"./calendar-BTJHFAW8.js";import{C as Pe}from"./chevron-up-bCZKjDmd.js";import{C as se}from"./chart-column-DZJB8hAl.js";import{A as te}from"./archive-f_jgbYvd.js";import{A as Ke}from"./anchor-DHgUDgz1.js";import{R as P,X as K,Y as q,F as V,_ as qe}from"./generateCategoricalChart-DhcQhEax.js";import{A as B,a as H}from"./AreaChart-DuJywiD6.js";import{C as G}from"./CartesianGrid-BPPqpn8j.js";import{F as Ve}from"./funnel-Dp-di7Mp.js";import{T as Be}from"./trending-down-BbvvSHFA.js";import{M as He}from"./minus-DSonWftW.js";import{f as pe}from"./format-CxxDD1Zd.js";import"./useMutation-5Qt1sQt-.js";import"./map-pin-CWEEbUVM.js";import"./index-HPdWC4iQ.js";import"./tiny-invariant-CopsF_GD.js";import"./index-C7yKKq-w.js";import"./en-US-BF8dUB01.js";const Ge=[["path",{d:"M14 13h2a2 2 0 0 1 2 2v2a2 2 0 0 0 4 0v-6.998a2 2 0 0 0-.59-1.42L18 5",key:"1wtuz0"}],["path",{d:"M14 21V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v16",key:"e09ifn"}],["path",{d:"M2 21h13",key:"1x0fut"}],["path",{d:"M3 9h11",key:"1p7c0w"}]],je=ge("fuel",Ge);const Xe=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Ue=ge("package",Xe),Je={STEEL:"#3b82f6",CORN:"#f59e0b",SOYA:"#10b981",UREA:"#ef4444",WHEAT:"#8b5cf6",MINERALS:"#06b6d4",FERTILIZERS:"#84cc16",METALS:"#6366f1",CEMENT:"#9ca3af",COAL:"#374151",GENERAL:"#ec4899",REBARS:"#f97316",SULPHUR:"#eab308",BENTONITE:"#a855f7"},F=o=>Je[o]||"#94a3b8",fe=[{value:"all",label:"All Months"},{value:"1",label:"January"},{value:"2",label:"February"},{value:"3",label:"March"},{value:"4",label:"April"},{value:"5",label:"May"},{value:"6",label:"June"},{value:"7",label:"July"},{value:"8",label:"August"},{value:"9",label:"September"},{value:"10",label:"October"},{value:"11",label:"November"},{value:"12",label:"December"}];function _e(o){return new Date(o).getMonth()+1}function Qe({value:o}){return o>.5?e.jsx(L,{className:"h-4 w-4 text-green-400"}):o<-.5?e.jsx(Be,{className:"h-4 w-4 text-red-400"}):e.jsx(He,{className:"h-4 w-4 text-slate-400"})}function ae({value:o,label:O}){const T=o>=0?"text-green-400":"text-red-400";return e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsxs("span",{className:`text-sm font-medium ${T}`,children:[o>=0?"+":"",o.toFixed(1),"%"]}),e.jsx("span",{className:"text-xs text-slate-500",children:O})]})}function ws(){const[o,O]=n.useState("2-4k"),[T,ye]=n.useState("Istanbul"),[M,re]=n.useState("all"),[I,le]=n.useState("all"),[g,Ne]=n.useState(null),[be,ne]=n.useState("overview"),[m,X]=n.useState("weekly"),[U,ve]=n.useState(!1),[W,ie]=n.useState("all"),[A,ce]=n.useState("all"),[D,oe]=n.useState("all"),[x,J]=n.useState([]),{data:we,isLoading:ke}=y({queryKey:["istfix-latest"],queryFn:async()=>{const s=await fetch("/api/istfix/latest");return s.ok?s.json():null}}),{data:Ce,isLoading:Se}=y({queryKey:["istfix-report",g],queryFn:async()=>{if(!g)return null;const s=await fetch(`/api/istfix/${g}`);return s.ok?s.json():null},enabled:!!g}),l=g?Ce:we,Fe=g?Se:ke,{data:Te=[]}=y({queryKey:["istfix-freight-history",o],queryFn:async()=>{const s=await fetch(`/api/istfix/history/freight-rates?dwtClass=${o}&limit=52`);return s.ok?s.json():[]}}),{data:Me=[]}=y({queryKey:["istfix-bunker-history",T],queryFn:async()=>{const s=await fetch(`/api/istfix/history/bunker-prices?port=${T}&limit=52`);return s.ok?s.json():[]}}),{data:z=[]}=y({queryKey:["istfix-reports"],queryFn:async()=>{const s=await fetch("/api/istfix");return s.ok?s.json():[]}}),{data:$=[]}=y({queryKey:["istfix-composite-history"],queryFn:async()=>{const s=await fetch("/api/istfix/history/composite?limit=156");return s.ok?s.json():[]}}),{data:u}
1=y({queryKey:["istfix-fixture-stats"],queryFn:async()=>{const s=await fetch("/api/istfix/fixtures/stats");if(!s.ok)throw new Error("Failed to fetch fixture stats");return s.json()}}),h=n.useMemo(()=>u?.fixtures?u.fixtures.filter(s=>!(W!=="all"&&s.year!==parseInt(W)||A!=="all"&&s.month!==parseInt(A)||D!=="all"&&s.dwtBracket!==D||x.length>0&&!x.includes(s.normalizedCargo))):[],[u,W,A,D,x]),de=n.useMemo(()=>{if(h.length===0)return[];const s={};return h.forEach(t=>{const r=`W${t.weekNumber}'${String(t.year).slice(-2)}`;s[r]||(s[r]={week:r,year:t.year,weekNum:t.weekNumber});const a=t.normalizedCargo;s[r][a]||(s[r][a]=[]),s[r][a].push(t.freightPerTonne)}),Object.values(s).map(t=>{const r={week:t.week,year:t.year,weekNum:t.weekNum};return Object.keys(t).forEach(a=>{if(a!=="week"&&a!=="year"&&a!=="weekNum"&&Array.isArray(t[a])){const c=t[a];r[a]=c.reduce((d,p)=>d+p,0)/c.length}}),r}).sort((t,r)=>t.year!==r.year?t.year-r.year:t.weekNum-r.weekNum)},[h]),xe=n.useMemo(()=>{const s=new Set;return h.forEach(t=>s.add(t.normalizedCargo)),Array.from(s).sort()},[h]),_=n.useMemo(()=>{const s=[...$].reverse();if(m==="weekly")return s.slice(-52).map(t=>({label:`W${t.weekNumber}'${String(t.year).slice(-2)}`,index:parseFloat(t.compositeIndex||"0")||0,year:t.year,weekNumber:t.weekNumber}));if(m==="monthly"){const t={};return s.forEach(r=>{const a=new Date(r.reportDate),c=`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}`;t[c]||(t[c]={values:[],year:a.getFullYear(),month:a.getMonth()+1});const d=parseFloat(r.compositeIndex||"0");d>0&&t[c].values.push(d)}),Object.entries(t).map(([r,a])=>({label:`${["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a.month-1]}'${String(a.year).slice(-2)}`,index:a.values.length>0?a.values.reduce((c,d)=>c+d,0)/a.values.length:0,year:a.year,month:a.month})).sort((r,a)=>r.year!==a.year?r.year-a.year:r.month-a.month).slice(-24)}else{const t={};return s.forEach(r=>{const a=r.year;t[a]||(t[a]=[]);const c=parseFloat(r.compositeIndex||"0");c>0&&t[a].push(c)}),Object.entries(t).map(([r,a])=>({label:r,index:a.length>0?a.reduce((c,d)=>c+d,0)/a.length:0,year:parseInt(r)})).sort((r,a)=>r.year-a.year)}},[$,m]),Ie=n.useMemo(()=>Array.from(new Set(z.map(t=>t.year))).sort((t,r)=>r-t),[z]),Q=n.useMemo(()=>z.filter(s=>!(M!=="all"&&s.year!==parseInt(M)||I!=="all"&&_e(s.reportDate)!==parseInt(I))),[z,M,I]),We=()=>{re("all"),le("all")},he=[...Te].reverse().map(s=>({week:`W${s.report.weekNumber}`,rate:parseFloat(s.rate.thisWeek)||0})),me=[...Me].reverse().map(s=>({week:`W${s.report.weekNumber}`,price:parseFloat(s.price.thisWeek)||0})),Z=n.useMemo(()=>{if($.length<2)return{wow:0,mom:0,yoy:0};const s=[...$].sort((p,ee)=>p.year!==ee.year?ee.year-p.year:ee.weekNumber-p.weekNumber),t=parseFloat(s[0]?.compositeIndex||"0"),r=parseFloat(s[1]?.compositeIndex||"0"),a=parseFloat(s[4]?.compositeIndex||"0"),c=s.find(p=>p.year===s[0].year-1&&p.weekNumber===s[0].weekNumber),d=parseFloat(c?.compositeIndex||"0");return{wow:r>0?(t-r)/r*100:0,mom:a>0?(t-a)/a*100:0,yoy:d>0?(t-d)/d*100:0}},[$]);return e.jsxs(e.Fragment,{children:[e.jsxs(Le,{children:[e.jsx("title",{children:"ISTFIX - Istanbul Freight Index | SeaNews"}),e.jsx("meta",{name:"description",content:"Weekly Istanbul Freight Index (ISTFIX) data for short-sea shipping in the Mediterranean and Black Sea region. Freight rates, fixtures, and bunker prices."})]}),e.jsx(Ae,{}),e.jsx("main",{className:"min-h-screen bg-gray-50",children:e.jsxs("div",{className:"container mx-auto px-4 py-6",children:[e.jsxs("div",{className:"flex items-center gap-4 mb-6",children:[e.jsx("img",{src:"https://i.ibb.co/RpcrLNw4/seanewslogoyenibeyaz.jpg",alt:"SeaNews",width:120,height:40,style:{height:"40px",width:"120px",display:"block",backgroundColor:"#e2e8f0",borderRadius:"2px"}}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold",children:"ISTFIX"}),e.jsx("p",{className:"text-muted-foreground",children:"Istanbul Freight Index - Short-Sea Shipping"})]})]}),l?.report.marketCommentary&&e.jsxs(j,{className:"mb-6 overflow-hidden border-blue-200 bg-gradient-to-r from-blue-50 to-indigo-50",children:[e.jsxs("div",{className:"bg-gradient-to-r from-blue-600 to-blue-800 text-white px-4 py-2 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(L,{className:"h-4 w-4"}),e.jsx("span",{className:"font-semibold text-sm",children:"MARKET COMMENTARY"}),e.jsxs("span",{className:"bg-white/20 rounded-full px-2 py-0.5 text-xs",children:["Week ",l.report.weekNumber,", ",l.report.year]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-blue-200",children:[e.jsx(Ye,{className:"h-4 w-4"}),pe(new Date(l.report.reportDate),"MMM d, yyyy")]})]}),e.jsxs(f,{className:"p-4",children:[e.jsx("div",{className:`text-gray-700 leading-relaxed ${U?"":"line-clamp-3"}`,children:l.report.marketCommentary}),l.report.marketCommentary.length>200&&e.jsx("button",{onClick:()=>ve(!U),className:"text-blue-600 hover:text-blue-800 text-sm font-medium flex items-center gap-1 mt-2",children:U?e.jsxs(e.Fragment,{children:["Show Less ",e.jsx(Pe,{className:"h-4 w-4"})]}):e.jsxs(e.Fragment,{children:["Read More ",e.jsx(De,{className:"h-4 w-4"})]})})]})]}),e.jsxs(Oe,{value:be,onValueChange:ne,className:"mb-6",children:[e.jsxs(ze,{className:"grid w-full grid-cols-5 max-w-2xl",children:[e.jsxs(R,{value:"overview",className:"flex items-center gap-2",children:[e.jsx(se,{className:"h-4 w-4"}),"Overview"]}),e.jsx(R,{value:"freight",children:"Freight Rates"}
1),e.jsx(R,{value:"bunker",children:"Bunker Prices"}),e.jsx(R,{value:"fixtures",children:"Fixtures"}),e.jsxs(R,{value:"archive",className:"flex items-center gap-2",children:[e.jsx(te,{className:"h-4 w-4"}),"Archive"]})]}),e.jsx(E,{value:"overview",className:"mt-6",children:Fe?e.jsx("div",{className:"flex items-center justify-center py-20",children:e.jsx($e,{className:"h-8 w-8 animate-spin text-blue-500"})}):l?e.jsxs(e.Fragment,{children:[e.jsxs(j,{className:"mb-8 bg-gradient-to-br from-slate-900 to-slate-800 border-slate-700 text-white",children:[e.jsxs(N,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(b,{className:"text-2xl flex items-center gap-2 text-white",children:[e.jsx(Ke,{className:"h-7 w-7 text-blue-400"}),"ISTFIX Composite Index"]}),e.jsxs("span",{className:"text-sm text-slate-300",children:["Week ",l.report.weekNumber,", ",l.report.year]})]}),e.jsx("p",{className:"text-sm text-slate-400",children:"Short-Sea Freight Rate Index (2-12k DWT)"})]}),e.jsxs(f,{children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"bg-slate-800/50 rounded-xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Y,{className:"h-5 w-5 text-blue-400"}),e.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Composite Index"})]}),e.jsx("div",{className:"text-4xl font-bold text-blue-400",children:l.report.compositeIndex||"N/A"}),e.jsx("div",{className:"text-sm text-slate-400 mt-1",children:"points"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 mt-2",children:[e.jsx(ae,{value:Z.wow,label:"WoW"}),e.jsx(ae,{value:Z.mom,label:"MoM"}),e.jsx(ae,{value:Z.yoy,label:"YoY"})]})]}),e.jsxs("div",{className:"bg-slate-800/50 rounded-xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(Y,{className:"h-5 w-5 text-emerald-400"}),e.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Weekly Fixtures"})]}),e.jsx("div",{className:"text-4xl font-bold text-emerald-400",children:l.fixtures.length}),e.jsx("div",{className:"text-sm text-slate-400 mt-1",children:"transactions"}),e.jsxs("div",{className:"text-xs text-slate-500 mt-2",children:["Total: ",l.fixtures.reduce((s,t)=>s+t.tonnage,0).toLocaleString()," DWT"]})]}),e.jsxs("div",{className:"bg-slate-800/50 rounded-xl p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(je,{className:"h-5 w-5 text-orange-400"}),e.jsx("span",{className:"text-sm font-medium text-slate-300",children:"Bunker MGO"})]}),e.jsxs("div",{className:"text-4xl font-bold text-orange-400",children:["$",l.bunkerPrices.find(s=>s.port==="Istanbul")?.thisWeek||"N/A"]}),e.jsx("div",{className:"text-sm text-slate-400 mt-1",children:"Istanbul"}),e.jsxs("div",{className:"text-xs text-slate-500 mt-2",children:[l.bunkerPrices.length," ports tracked"]})]})]}),e.jsxs("div",{className:"pt-4 mt-4 border-t border-slate-700",children:[e.jsx("div",{className:"text-xs text-slate-400 mb-2 uppercase tracking-wide",children:"Freight Rates by DWT Class"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:l.freightRates.map(s=>{const t=parseFloat(s.thisWeek),r=parseFloat(s.lastWeek),a=r>0?(t-r)/r*100:0;return e.jsxs("div",{className:"bg-slate-700/50 rounded-lg p-3",children:[e.jsxs("div",{className:"text-xs text-slate-400",children:[s.dwtClass," DWT"]}),e.jsxs("div",{className:"text-xl font-bold text-white",children:["$",s.thisWeek]}),e.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[e.jsx(Qe,{value:a}),e.jsxs("span",{className:`text-xs ${a>=0?"text-green-400":"text-red-400"}`,children:[a>=0?"+":"",a.toFixed(1),"%"]})]})]},s.id)})})]})]})]}),e.jsxs(j,{className:"mb-6",children:[e.jsx(N,{className:"pb-2",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(b,{className:"flex items-center gap-2",children:[e.jsx(L,{className:"h-5 w-5 text-blue-600"}),"ISTFIX History"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:m==="weekly"?"default":"outline",size:"sm",onClick:()=>X("weekly"),children:"Weekly"}),e.jsx(S,{variant:m==="monthly"?"default":"outline",size:"sm",onClick:()=>X("monthly"),children:"Monthly"}),e.jsx(S,{variant:m==="yearly"?"default":"outline",size:"sm",onClick:()=>X("yearly"),children:"Yearly"})]})]})}),e.jsx(f,{children:_.length>0?e.jsx(P,{width:"100%",height:350,children:e.jsxs(B,{data:_,children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"colorIndex",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",
1stopColor:"#3b82f6",stopOpacity:.3}),e.jsx("stop",{offset:"95%",stopColor:"#3b82f6",stopOpacity:0})]})}),e.jsx(G,{strokeDasharray:"3 3",stroke:"#e5e7eb"}),e.jsx(K,{dataKey:"label",tick:{fontSize:11},interval:m==="yearly"?0:Math.max(0,Math.floor(_.length/12)-1)}),e.jsx(q,{tick:{fontSize:12},domain:["auto","auto"],tickFormatter:s=>s.toFixed(0)}),e.jsx(V,{formatter:s=>[`${s.toFixed(2)} points`,"Index"],contentStyle:{backgroundColor:"#1e293b",border:"none",borderRadius:"8px",color:"white"},labelStyle:{color:"#94a3b8"}}),e.jsx(H,{type:"monotone",dataKey:"index",name:"Composite Index",stroke:"#3b82f6",strokeWidth:2,fill:"url(#colorIndex)",dot:m==="yearly"?{fill:"#3b82f6",strokeWidth:2,r:4}:!1,activeDot:{r:6,fill:"#3b82f6"}})]})}):e.jsx("div",{className:"h-64 flex items-center justify-center text-gray-400",children:e.jsxs("div",{className:"text-center",children:[e.jsx(L,{className:"h-10 w-10 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:"No historical data available yet"})]})})})]})]}):e.jsxs("div",{className:"text-center py-16 bg-white rounded-lg shadow",children:[e.jsx(L,{className:"h-12 w-12 text-gray-300 mx-auto mb-4"}),e.jsx("p",{className:"text-gray-500",children:"No ISTFIX data available yet"})]})}),e.jsx(E,{value:"freight",className:"mt-6",children:e.jsxs(j,{children:[e.jsx(N,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(b,{className:"flex items-center gap-2",children:[e.jsx(Y,{className:"h-5 w-5 text-blue-600"}),"Freight Rates History"]}),e.jsxs(v,{value:o,onValueChange:O,children:[e.jsx(w,{className:"w-32",children:e.jsx(k,{})}),e.jsxs(C,{children:[e.jsx(i,{value:"2-4k",children:"2-4k DWT"}),e.jsx(i,{value:"4-6k",children:"4-6k DWT"}),e.jsx(i,{value:"6-8k",children:"6-8k DWT"}),e.jsx(i,{value:"8-12k",children:"8-12k DWT"})]})]})]})}),e.jsxs(f,{children:[he.length>0?e.jsx(P,{width:"100%",height:350,children:e.jsxs(B,{data:he,children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"colorFreight",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"#2563eb",stopOpacity:.3}),e.jsx("stop",{offset:"95%",stopColor:"#2563eb",stopOpacity:0})]})}),e.jsx(G,{strokeDasharray:"3 3"}),e.jsx(K,{dataKey:"week",tick:{fontSize:11}}),e.jsx(q,{tick:{fontSize:12}}),e.jsx(V,{formatter:s=>[`$${s}/T`,"Rate"],contentStyle:{backgroundColor:"#1e293b",border:"none",borderRadius:"8px",color:"white"}}),e.jsx(H,{type:"monotone",dataKey:"rate",stroke:"#2563eb",strokeWidth:2,fill:"url(#colorFreight)"})]})}):e.jsx("div",{className:"h-64 flex items-center justify-center text-gray-400",children:"No historical data available"}),l&&e.jsxs("table",{className:"w-full text-sm mt-6 border rounded-lg overflow-hidden",children:[e.jsx("thead",{className:"bg-slate-100",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"DWT Class"}),e.jsx("th",{className:"text-right px-4 py-3 font-medium",children:"This Week"}),e.jsx("th",{className:"text-right px-4 py-3 font-medium",children:"Last Week"}),e.jsx("th",{className:"text-right px-4 py-3 font-medium",children:"Last Month"}),e.jsx("th",{className:"text-right px-4 py-3 font-medium",children:"Last Year"})]})}),e.jsx("tbody",{children:l.freightRates.map(s=>{const t=parseFloat(s.thisWeek),r=parseFloat(s.lastWeek),a=r>0?(t-r)/r*100:0;return e.jsxs("tr",{className:"border-t hover:bg-slate-50",children:[e.jsx("td",{className:"px-4 py-3 font-medium",children:s.dwtClass}),e.jsxs("td",{className:"text-right px-4 py-3",children:[e.jsxs("span",{className:"font-bold",children:["$",s.thisWeek]}),e.jsxs("span",{className:`ml-2 text-xs ${a>=0?"text-green-600":"text-red-600"}`,children:[a>=0?"+":"",a.toFixed(1),"%"]})]}),e.jsxs("td",{className:"text-right px-4 py-3 text-gray-500",children:["$",s.lastWeek]}),e.jsxs("td",{className:"text-right px-4 py-3 text-gray-500",children:["$",s.lastMonth]}),e.jsxs("td",{className:"text-right px-4 py-3 text-gray-500",children:["$",s.lastYear]})]},s.id)})})]})]})]})}),e.jsx(E,{value:"bunker",className:"mt-6",children:e.jsxs(j,{children:[e.jsx(N,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(b,{className:"flex items-center gap-2",children:[e.jsx(je,{className:"h-5 w-5 text-orange-600"}
1),"Bunker Prices (MGO)"]}),e.jsxs(v,{value:T,onValueChange:ye,children:[e.jsx(w,{className:"w-32",children:e.jsx(k,{})}),e.jsxs(C,{children:[e.jsx(i,{value:"Rotterdam",children:"Rotterdam"}),e.jsx(i,{value:"Gibraltar",children:"Gibraltar"}),e.jsx(i,{value:"Malta",children:"Malta"}),e.jsx(i,{value:"Istanbul",children:"Istanbul"})]})]})]})}),e.jsxs(f,{children:[me.length>0?e.jsx(P,{width:"100%",height:350,children:e.jsxs(B,{data:me,children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"colorBunker",x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"5%",stopColor:"#ea580c",stopOpacity:.3}),e.jsx("stop",{offset:"95%",stopColor:"#ea580c",stopOpacity:0})]})}),e.jsx(G,{strokeDasharray:"3 3"}),e.jsx(K,{dataKey:"week",tick:{fontSize:11}}),e.jsx(q,{tick:{fontSize:12}}),e.jsx(V,{formatter:s=>[`$${s}/MT`,"Price"],contentStyle:{backgroundColor:"#1e293b",border:"none",borderRadius:"8px",color:"white"}}),e.jsx(H,{type:"monotone",dataKey:"price",stroke:"#ea580c",strokeWidth:2,fill:"url(#colorBunker)"})]})}):e.jsx("div",{className:"h-64 flex items-center justify-center text-gray-400",children:"No historical data available"}),l&&e.jsxs("table",{className:"w-full text-sm mt-6 border rounded-lg overflow-hidden",children:[e.jsx("thead",{className:"bg-slate-100",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Port"}),e.jsx("th",{className:"text-right px-4 py-3 font-medium",children:"This Week"}),e.jsx("th",{className:"text-right px-4 py-3 font-medium",children:"Last Week"}),e.jsx("th",{className:"text-right px-4 py-3 font-medium",children:"Change"})]})}),e.jsx("tbody",{children:l.bunkerPrices.map(s=>e.jsxs("tr",{className:"border-t hover:bg-slate-50",children:[e.jsx("td",{className:"px-4 py-3 font-medium",children:s.port}),e.jsxs("td",{className:"text-right px-4 py-3 font-bold",children:["$",s.thisWeek]}),e.jsxs("td",{className:"text-right px-4 py-3 text-gray-500",children:["$",s.lastWeek]}),e.jsx("td",{className:"text-right px-4 py-3",children:e.jsxs("span",{className:`px-2 py-1 rounded text-xs font-medium ${parseFloat(s.changePercent)>=0?"bg-green-100 text-green-700":"bg-red-100 text-red-700"}`,children:[s.changePercent,"%"]})})]},s.id))})]})]})]})}),e.jsxs(E,{value:"fixtures",className:"mt-6",children:[l&&l.fixtures.length>0&&e.jsxs(j,{className:"mb-6",children:[e.jsx(N,{children:e.jsxs(b,{className:"flex items-center gap-2",children:[e.jsx(Y,{className:"h-5 w-5 text-green-600"}),"Week ",l.report.weekNumber," Fixtures (",l.fixtures.length,")"]})}),e.jsx(f,{children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm border rounded-lg overflow-hidden",children:[e.jsx("thead",{className:"bg-slate-100",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Tonnage"}),e.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Cargo"}),e.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Route"}),e.jsx("th",{className:"text-right px-4 py-3 font-medium",children:"Freight"})]})}),e.jsx("tbody",{children:l.fixtures.map(s=>e.jsxs("tr",{className:"border-t hover:bg-slate-50",children:[e.jsxs("td",{className:"px-4 py-3",children:[s.tonnage.toLocaleString()," DWT"]}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:"px-2 py-1 rounded text-xs font-medium",style:{backgroundColor:F(s.cargo.toUpperCase())+"20",color:F(s.cargo.toUpperCase())},children:s.cargo})}),e.jsx("td",{className:"px-4 py-3 text-gray-600",children:s.loadDischargePort}),e.jsxs("td",{className:"text-right px-4 py-3 font-bold",children:["$",s.freightPerTonne,"/T"]})]},s.id))})]})})})]}),u&&u.fixtures.length>0&&e.jsxs(j,{children:[e.jsx(N,{children:e.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center justify-between gap-4",children:[e.jsxs(b,{className:"flex items-center gap-2",children:[e.jsx(se,{className:"h-5 w-5 text-purple-600"}),"Freight Analytics by Cargo Type"]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsxs(v,{value:W,onValueChange:ie,children:[e.jsx(w,{className:"w-28",children:e.jsx(k,{placeholder:"Year"})}),e.jsxs(C,{children:[e.jsx(i,{value:"all",children:"All Years"}),u.filters.years.map(s=>e.jsx(i,{value:s.toString(),children:s},s))]})]}),e.jsxs(v,{value:A,onValueChange:ce,children:[e.jsx(w,{className:"w-36",children:e.jsx(k,{placeholder:"Month"})}),e.jsx(C,{children:fe.map(s=>e.jsx(i,{value:s.value,children:s.label},s.value))})]}),e.jsxs(v,{value:D,onValueChange:oe,children:[e.jsx(w,{className:"w-28",children:e.jsx(k,{placeholder:"DWT"})}),e.jsxs(C,{children:[e.jsx(i,{value:"all",children:"All DWT"}),u.filters.dwtBrackets.map(s=>e.jsxs(i,{value:s,children:[s," DWT"]},s))]})]}),(W!=="all"||A!=="all"||D!=="all"||x.length>0)&&e.jsxs(S,{variant:"ghost",size:"sm",onClick:()=>{ie("all"),ce("all"),oe("all"),J([])},children:[e.jsx(ue,{className:"h-4 w-4 mr-1"}),"Clear"]})]})]})}),e.jsxs(f,{children:[e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4 mb-6",children:[e.jsxs("div",{className:"bg-purple-50 rounded-lg p-4 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-purple-600",children:h.length}),e.jsx("div",{className:"text-sm text-gray-600",children:"Total Fixtures"})]}),e.jsxs("div",{className:"bg-blue-50 rounded-lg p-4 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-blue-600",children:xe.length}),e.jsx("div",{className:"text-sm text-gray-600",children:"Cargo Types"})]}),e.jsxs("div",{className:"bg-green-50 rounded-lg p-4 text-center",children:[e.jsxs("div",{className:"text-2xl font-bold text-green-600",children:["$",h.length>0?(h.reduce((s,t)=>s+t.freightPerTonne,0)/h.length).toFixed(2):0]}),e.jsx("div",{className:"text-sm text-gray-600",children:"Avg $/Tonne"})]}),e.jsxs("div",{className:"bg-orange-50 rounded-lg p-4 text-center",children:[e.jsx("div",{className:"text-2xl font-bold text-orange-600",children:h.length>0?Math.round(h.reduce((s,t)=>
1s+t.tonnage,0)/1e3).toLocaleString()+"k":0}),e.jsx("div",{className:"text-sm text-gray-600",children:"Total DWT"})]})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Filter by cargo type:"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:u.filters.cargoTypes.slice(0,12).map(s=>e.jsxs("label",{className:`flex items-center gap-2 px-3 py-1.5 rounded-full text-sm cursor-pointer border transition-colors ${x.length===0||x.includes(s)?"border-transparent":"border-gray-200 opacity-50"}`,style:{backgroundColor:x.length===0||x.includes(s)?F(s)+"20":"#f9fafb",color:F(s)},children:[e.jsx(Re,{checked:x.includes(s),onCheckedChange:t=>{J(t?[...x,s]:x.filter(r=>r!==s))},className:"h-3 w-3"}),e.jsx(Ue,{className:"h-3 w-3"}),s]},s))})]}),de.length>0?e.jsx(P,{width:"100%",height:350,children:e.jsxs(B,{data:de,children:[e.jsx(G,{strokeDasharray:"3 3"}),e.jsx(K,{dataKey:"week",tick:{fontSize:11}}),e.jsx(q,{tick:{fontSize:11},label:{value:"$/Tonne",angle:-90,position:"insideLeft",fontSize:11}}),e.jsx(V,{formatter:(s,t)=>[`$${s.toFixed(2)}/T`,t],contentStyle:{backgroundColor:"#1e293b",border:"none",borderRadius:"8px",color:"white"}}),e.jsx(qe,{wrapperStyle:{fontSize:12}}),xe.map(s=>e.jsx(H,{type:"monotone",dataKey:s,stroke:F(s),fill:F(s),fillOpacity:.1,strokeWidth:2,dot:!1,connectNulls:!0},s))]})}):e.jsx("div",{className:"h-64 flex items-center justify-center text-gray-400",children:e.jsxs("div",{className:"text-center",children:[e.jsx(se,{className:"h-12 w-12 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:"No fixture data available for the selected filters"})]})})]})]})]}),e.jsx(E,{value:"archive",className:"mt-6",children:e.jsxs(j,{children:[e.jsx(N,{children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[e.jsxs(b,{className:"flex items-center gap-2",children:[e.jsx(te,{className:"h-5 w-5 text-gray-600"}),"ISTFIX Archive (",Q.length," reports)"]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx(Ve,{className:"h-4 w-4 text-gray-500"}),e.jsxs(v,{value:M,onValueChange:re,children:[e.jsx(w,{className:"w-28",children:e.jsx(k,{placeholder:"Year"})}),e.jsxs(C,{children:[e.jsx(i,{value:"all",children:"All Years"}),Ie.map(s=>e.jsx(i,{value:s.toString(),children:s},s))]})]}),e.jsxs(v,{value:I,onValueChange:le,children:[e.jsx(w,{className:"w-36",children:e.jsx(k,{placeholder:"Month"})}),e.jsx(C,{children:fe.map(s=>e.jsx(i,{value:s.value,children:s.label},s.value))})]}),(M!=="all"||I!=="all")&&e.jsxs(S,{variant:"ghost",size:"sm",onClick:We,children:[e.jsx(ue,{className:"h-4 w-4 mr-1"}),"Clear"]})]})]})}),e.jsx(f,{children:Q.length===0?e.jsxs("div",{className:"text-center py-8 text-gray-500",children:[e.jsx(te,{className:"h-10 w-10 mx-auto mb-2 opacity-50"}),e.jsx("p",{children:"No reports found for the selected filters"})]}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm border rounded-lg overflow-hidden",children:[e.jsx("thead",{className:"bg-slate-100",children:e.jsxs("tr",{children:[e.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Week"}),e.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Year"}),e.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Date"}),e.jsx("th",{className:"text-right px-4 py-3 font-medium",children:"Composite Index"}),e.jsx("th",{className:"text-center px-4 py-3 font-medium",children:"Action"})]})}),e.jsx("tbody",{children:Q.map(s=>e.jsxs("tr",{className:`border-t hover:bg-slate-50 cursor-pointer ${g===s.id?"bg-blue-50":""}`,onClick:()=>{Ne(s.id),ne("overview")},children:[e.jsxs("td",{className:"px-4 py-3 font-medium",children:["Week ",s.weekNumber]}),e.jsx("td",{className:"px-4 py-3",children:s.year}),e.jsx("td",{className:"px-4 py-3 text-gray-600",children:pe(new Date(s.reportDate),"MMM d, yyyy")}),e.jsx("td",{className:"text-right px-4 py-3 font-bold",children:s.compositeIndex?`${s.compositeIndex} pts`:"-"}),e.jsx("td",{className:"text-center px-4 py-3",children:e.jsx(S,{variant:"ghost",size:"sm",children:"View"})})]},s.id))})]})})})]})})]})]})}),e.jsx(Ee,{})]})}
1export{ws as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.