ocearo-ui 2.1.2 → 2.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/404.html +1 -1
- package/CHANGELOG.md +364 -0
- package/README.fr.md +28 -31
- package/README.md +28 -31
- package/__next.__PAGE__.txt +3 -3
- package/__next._full.txt +3 -3
- package/__next._tree.txt +2 -2
- package/_next/static/chunks/01ij-cuy61l35.js +1 -0
- package/_next/static/chunks/047e3x_ahxnrl.js +1 -0
- package/_next/static/chunks/0ath9h2eo-m4-.js +1 -0
- package/_next/static/chunks/0bxzs0khjn1uj.js +1 -0
- package/_next/static/chunks/0ejjon45nq_-h.js +9 -0
- package/_next/static/chunks/{1quvj-861o57h.js → 0kdc_niwgmx_8.js} +1 -1
- package/_next/static/chunks/{1bvrvkcwf3ge-.js → 0ngl63fz0a-bo.js} +1 -1
- package/_next/static/chunks/0ucob1nu_x8bl.js +1 -0
- package/_next/static/chunks/0wi5jop1ihbm6.js +2 -0
- package/_next/static/chunks/18e6nw0w7akkb.js +180 -0
- package/_next/static/chunks/18vlmqe7txbmt.js +1 -0
- package/_next/static/chunks/{3utjjgdhnlx86.js → 192c42s2wc7qe.js} +1 -1
- package/_next/static/chunks/1_twx50ejqan5.js +1 -0
- package/_next/static/chunks/1na56snuhu-pc.js +346 -0
- package/_next/static/chunks/1vchkqgn-xw-o.js +1 -0
- package/_next/static/chunks/20p1hr--2grl8.js +9 -0
- package/_next/static/chunks/2393lwi8kee3m.js +48 -0
- package/_next/static/chunks/25v2cwta2fy-7.js +393 -0
- package/_next/static/chunks/28wfa6j-9g_qc.js +1 -0
- package/_next/static/chunks/290k3k__vbum2.js +121 -0
- package/_next/static/chunks/2cecf_xnd_9em.js +1 -0
- package/_next/static/chunks/2die6btm3_mhq.js +1 -0
- package/_next/static/chunks/2hm43avzk8_jb.js +503 -0
- package/_next/static/chunks/2ijx7rln4jshb.css +3 -0
- package/_next/static/chunks/2q_bl16zedyyo.js +503 -0
- package/_next/static/chunks/2xntuu6mzh41s.js +1 -0
- package/_next/static/chunks/30p1dpgmonstj.js +1 -0
- package/_next/static/chunks/31p7nz0hfuym7.js +1 -0
- package/_next/static/chunks/{1e-w_-usen7fy.js → 34nhy77liurum.js} +2 -2
- package/_next/static/chunks/37g-wmrgbgd6h.js +739 -0
- package/_next/static/chunks/{18_i6mf6hb_c7.js → 395ffa6t18601.js} +1 -1
- package/_next/static/chunks/3bai186_bv3i_.js +1 -0
- package/_next/static/chunks/3h_m2s30sr9mt.js +430 -0
- package/_next/static/chunks/3j453-2u58qbv.js +1 -0
- package/_next/static/chunks/3k-r-4veivdjr.js +1 -0
- package/_next/static/chunks/3yz0mxxv4vrfg.js +1 -0
- package/_not-found/__next._full.txt +2 -2
- package/_not-found/__next._not-found.__PAGE__.txt +2 -2
- package/_not-found/__next._tree.txt +2 -2
- package/_not-found.html +1 -1
- package/_not-found.txt +2 -2
- package/boats/boats.json +11 -19
- package/boats/windsurf/assets/license.txt +6 -8
- package/boats/windsurf/assets/rider.glb +0 -0
- package/boats/wingfoil/assets/license.txt +9 -0
- package/boats/wingfoil/assets/rider.glb +0 -0
- package/guide/bathymetry.jpg +0 -0
- package/guide/weather.jpg +0 -0
- package/index.html +1 -1
- package/index.txt +3 -3
- package/package.json +27 -5
- package/settings/__next._full.txt +3 -3
- package/settings/__next._tree.txt +2 -2
- package/settings/__next.settings.__PAGE__.txt +3 -3
- package/settings.html +1 -1
- package/settings.txt +3 -3
- package/_next/static/chunks/0-19-ljntm5ig.js +0 -1
- package/_next/static/chunks/0-g-ujyrfgutp.js +0 -2
- package/_next/static/chunks/0-jqvc-r0kh0c.js +0 -1
- package/_next/static/chunks/05do10p9ldt1p.js +0 -409
- package/_next/static/chunks/0c91q-13wh8hk.js +0 -1
- package/_next/static/chunks/0fv1wwxeyagln.js +0 -446
- package/_next/static/chunks/0jucaltuccn03.js +0 -1
- package/_next/static/chunks/0m7wbuocx-b4_.js +0 -9
- package/_next/static/chunks/0o7hu-sypv2u9.js +0 -1
- package/_next/static/chunks/0ujzg6ofy2r73.js +0 -1
- package/_next/static/chunks/162bfkgcudvew.js +0 -9
- package/_next/static/chunks/1bo0ke8gjc1c2.js +0 -1
- package/_next/static/chunks/1do-2zwq3ws0f.js +0 -346
- package/_next/static/chunks/1ho2ekxa9io1_.js +0 -1
- package/_next/static/chunks/1m3-nchdgcxy1.css +0 -3
- package/_next/static/chunks/271ys-u920uqd.js +0 -564
- package/_next/static/chunks/2_iau6x7s0vil.js +0 -1131
- package/_next/static/chunks/2ab6q6u6uo_bf.js +0 -1
- package/_next/static/chunks/2pt-apz8_pa4j.js +0 -1
- package/_next/static/chunks/2rnpgrmuyhpkd.js +0 -119
- package/_next/static/chunks/2w71oj1brox5z.js +0 -1
- package/_next/static/chunks/3e5jmzthktu9w.js +0 -1
- package/_next/static/chunks/3r8nellt-dsed.js +0 -1
- package/_next/static/chunks/3wwn1rti8oc_r.js +0 -1
- package/_next/static/chunks/41odv061mfm6t.js +0 -1
- package/boats/optimist/Scene.jsx +0 -28
- package/boats/optimist/assets/license.txt +0 -11
- package/boats/optimist/assets/scene-transformed.glb +0 -0
- package/boats/sailboat/Scene.jsx +0 -21
- package/boats/sailboat/assets/license.txt +0 -10
- package/boats/sailboat/assets/scene-transformed.glb +0 -0
- package/boats/windsurf/Scene.jsx +0 -22
- package/boats/windsurf/assets/scene-transformed.glb +0 -0
- /package/_next/static/{m52l9mE01yTljNwbWjYQ7 → 0nycI4RUzRHiehQwdbDCp}/_buildManifest.js +0 -0
- /package/_next/static/{m52l9mE01yTljNwbWjYQ7 → 0nycI4RUzRHiehQwdbDCp}/_clientMiddlewareManifest.js +0 -0
- /package/_next/static/{m52l9mE01yTljNwbWjYQ7 → 0nycI4RUzRHiehQwdbDCp}/_ssgManifest.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,14922,37917,e=>{"use strict";var t=e.i(43476),i=e.i(71645);e.s(["default",0,({title:e,right:i,className:s="",children:l})=>(0,t.jsxs)("div",{className:`hud-halo px-1 py-1 select-none ${s}`,children:[(e||i)&&(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-caption font-semibold uppercase tracking-widest text-hud-muted",children:e}),i]}),l]})],14922);let s=({values:e,width:i=240,height:s=60,color:l="var(--color-oBlue)",marker:n=null,endDot:r=!1,invert:a=!1})=>{let o=e.filter(Number.isFinite);if(o.length<2)return(0,t.jsx)("svg",{width:i,height:s});let h=Math.min(...o),d=Math.max(...o)-h||1,m=i/(e.length-1),u=e=>(a?(e-h)/d:1-(e-h)/d)*(s-8)+4,c="";e.forEach((e,t)=>{Number.isFinite(e)&&(c+=`${c?"L":"M"}${(t*m).toFixed(1)},${u(e).toFixed(1)}`)});let x=`${c}L${i},${a?0:s}L0,${a?0:s}Z`,g=null;if(null!==n){let t=n*(e.length-1),s=Math.min(e.length-2,Math.floor(t)),l=e[s],r=e[s+1];Number.isFinite(l)&&Number.isFinite(r)&&(g={x:n*i,y:u(l+(r-l)*(t-s))})}let f=e[e.length-1];return(0,t.jsxs)("svg",{width:i,height:s,className:"block overflow-visible",children:[(0,t.jsx)("path",{d:x,fill:l,opacity:"0.12"}),(0,t.jsx)("path",{d:c,fill:"none",stroke:l,strokeWidth:"2",strokeLinejoin:"round"}),null!==n&&(0,t.jsx)("line",{x1:n*i,x2:n*i,y1:"0",y2:s,stroke:"var(--hud-text-main)",strokeWidth:"1.5"}),g&&(0,t.jsx)("circle",{cx:g.x,cy:g.y,r:"4",fill:l,stroke:"var(--hud-text-main)",strokeWidth:"1.5"}),r&&Number.isFinite(f)&&(0,t.jsx)("circle",{cx:i,cy:u(f),r:"3.5",fill:l})]})},l=e=>{let l=(0,i.useRef)(null),[n,r]=(0,i.useState)(0);return(0,i.useEffect)(()=>{let e=l.current;if(!e)return;let t=new ResizeObserver(([e])=>r(Math.floor(e.contentRect.width)));return t.observe(e),()=>t.disconnect()},[]),(0,t.jsx)("div",{ref:l,className:"w-full",style:{height:e.height},children:n>0&&(0,t.jsx)(s,{...e,width:n})})};e.s(["default",0,({fluid:e=!1,...i})=>e?(0,t.jsx)(l,{...i}):(0,t.jsx)(s,{...i})],37917)},13239,e=>{"use strict";var t=e.i(43476);e.i(71645),e.i(85269);var i=e.i(22831),s=e.i(78954),l=e.i(95430),n=e.i(14922),r=e.i(37917);e.s(["default",0,({compact:e=!1})=>{let{t:a}=(0,i.useTranslation)(),{hasData:o,level:h,high:d,low:m,timeHigh:u,timeLow:c,coefficient:x,isRising:g,chartData:f}=(0,s.default)();if(!o||f.length<2)return e?null:(0,t.jsx)(n.default,{title:a("hud.tide"),className:"w-[19rem]",children:(0,t.jsx)("span",{className:"text-value font-semibold text-hud-muted",children:"--"})});let p=f[0].ms,w=f[f.length-1].ms,N=Math.min(1,Math.max(0,((0,l.vesselNow)().getTime()-p)/(w-p))),v=N*(f.length-1),b=Math.min(f.length-2,Math.floor(v)),j=f[b].height+(f[b+1].height-f[b].height)*(v-b),T=Number.isFinite(h)?h:j,y=(0,t.jsx)("span",{className:`text-caption font-semibold uppercase tracking-wide whitespace-nowrap ${g?"text-oGreen":"text-oBlue"}`,children:a(g?"widgets.rising":"widgets.ebb")});if(e){let e=g?{label:a("widgets.high"),time:(0,s.formatTideTime)(u)}:{label:a("widgets.low"),time:(0,s.formatTideTime)(c)};return(0,t.jsxs)("div",{className:"tesla-card !p-3 !rounded-2xl select-none",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsxs)("span",{className:"text-caption font-semibold uppercase tracking-widest text-hud-muted truncate",children:[a("hud.tide"),x?` \xb7 C${Math.round(x)}`:""]}),e.time&&(0,t.jsxs)("span",{className:"text-caption text-hud-muted whitespace-nowrap",children:[e.label," ",(0,t.jsx)("span",{className:"font-semibold text-hud-main",children:e.time})]})]}),(0,t.jsxs)("div",{className:"flex items-baseline gap-1 min-w-0",children:[(0,t.jsx)("span",{className:"text-value font-semibold leading-tight text-hud-main",children:Number.isFinite(T)?T.toFixed(1):"--"}),(0,t.jsx)("span",{className:"text-caption text-hud-secondary mr-1",children:"m"}),y]}),(0,t.jsx)(r.default,{fluid:!0,values:f.map(e=>e.height),height:22,color:g?"var(--color-oGreen)":"var(--color-oBlue)",marker:N})]})}return(0,t.jsxs)(n.default,{title:a("hud.tide"),right:x?(0,t.jsxs)("span",{className:"text-caption font-semibold text-hud-secondary",children:["C",Math.round(x)]}):null,className:"w-[19rem]",children:[(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:"text-value font-semibold text-hud-main",children:Number.isFinite(T)?T.toFixed(1):"--"}),(0,t.jsx)("span",{className:"text-caption text-hud-secondary",children:"m"}),(0,t.jsx)("span",{className:`text-caption font-semibold uppercase tracking-widest ${g?"text-oGreen":"text-oBlue"}`,children:a(g?"widgets.rising":"widgets.ebb")})]}),(0,t.jsx)("div",{className:"my-2",children:(0,t.jsx)(r.default,{values:f.map(e=>e.height),width:272,height:56,color:g?"var(--color-oGreen)":"var(--color-oBlue)",marker:N})}),(0,t.jsxs)("div",{className:"flex justify-between text-caption",children:[(0,t.jsxs)("span",{className:"text-hud-muted",children:[a("widgets.high")," ",(0,t.jsx)("span",{className:"text-hud-main font-semibold",children:(0,s.formatTideTime)(u)||"--:--"})," ",Number.isFinite(d)?`${d.toFixed(1)} m`:""]}),(0,t.jsxs)("span",{className:"text-hud-muted",children:[a("widgets.low")," ",(0,t.jsx)("span",{className:"text-hud-main font-semibold",children:(0,s.formatTideTime)(c)||"--:--"})," ",Number.isFinite(m)?`${m.toFixed(1)} m`:""]})]})]})}])},91999,function(e){e.n(e.i(13239))},78954,e=>{"use strict";var t=e.i(71645),i=e.i(11426),s=e.i(85709),l=e.i(83402),n=e.i(83646),r=e.i(95430);let a=(e,t,i,s,l)=>{let n=i.getTime(),r=((e,t,i,s)=>{let l=i.getTime(),n=s.getTime(),r=i=>"high"===i?e:t,a=e=>"high"===e?"low":"high",o=l<n?{time:l,type:"high"}:{time:n,type:"low"},h=l<n?{time:n,type:"low"}:{time:l,type:"high"},d=[];for(let e=5;e>=1;e--){let t=e%2?a(o.type):o.type;d.push({time:o.time-22356e3*e,height:r(t),type:t})}d.push({...o,height:r(o.type)},{...h,height:r(h.type)});for(let e=1;e<=5;e++){let t=e%2?a(h.type):h.type;d.push({time:h.time+22356e3*e,height:r(t),type:t})}return d})(e,t,s,l);for(let i=0;i<r.length-1;i++)if(n>=r[i].time&&n<=r[i+1].time){let s=r[i].height,l=r[i+1].height,a=r[i+1].time-r[i].time;if(a<=0)return(e+t)/2;return parseFloat((s+(l-s)*((1-Math.cos((n-r[i].time)/a*Math.PI))/2)).toFixed(2))}return(e+t)/2},o=e=>{if(!e)return null;if(e.includes("T")||e.includes("-")){let t=new Date(e);return isNaN(t.getTime())?null:t}let t=e.split(":").map(Number);if(t.length<2)return null;let i=(0,r.vesselNow)();return i.setHours(t[0],t[1],0,0),i};e.s(["default",0,()=>{let e=(0,n.default)(),h=l.default.get("debugMode"),d=(0,t.useMemo)(()=>["environment.tide.heightNow","environment.tide.heightHigh","environment.tide.heightLow","environment.tide.timeLow","environment.tide.timeHigh","environment.tide.coeffNow"],[]),m=(0,s.useSignalKPaths)(d),{tideData:u}=(0,i.useTide)(),c=m["environment.tide.heightNow"]??u?.level??null,x=m["environment.tide.heightHigh"]??u?.high??null,g=m["environment.tide.heightLow"]??u?.low??null,f=m["environment.tide.timeLow"]??u?.timeLow??null,p=m["environment.tide.timeHigh"]??u?.timeHigh??null,w=m["environment.tide.coeffNow"]??u?.coefficient??null,N=null!==c||null!==x||null!==g||h,v=(0,t.useMemo)(()=>o(p),[p]),b=(0,t.useMemo)(()=>o(f),[f]),j=(0,t.useMemo)(()=>{let e,t,i=x||4.2,s=g||.8,l=v||((e=(0,r.vesselNow)()).setHours(14,0,0,0),e),n=b||((t=(0,r.vesselNow)()).setHours(8,0,0,0),t),o=[],h=(0,r.vesselNow)(),d=new Date(h);d.setHours(0,0,0,0);for(let e=0;e<=48;e++){let t=new Date(d.getTime()+30*e*6e4),r=a(i,s,t,l,n);o.push({time:t.toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1}),height:r,ms:t.getTime(),isNow:9e5>Math.abs(t.getTime()-h.getTime())})}return o},[x,g,v,b]),T=(0,t.useMemo)(()=>{if(v&&b)return v.getTime()<b.getTime();let e=(0,r.vesselNow)().getTime(),t=j.findIndex(t=>t.ms>e);return!(t<=0)&&j[t].height>j[t-1].height},[v,b,j]),y=T?e.ok:e.accent;return{hasData:N,level:c,high:x,low:g,timeHigh:p,timeLow:f,coefficient:w,isRising:T,tideColor:y,chartData:j}},"formatTideTime",0,e=>{if(!e)return null;if(e.includes("T")||e.includes("-")){let t=new Date(e);if(!isNaN(t.getTime()))return t.toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1})}return e}])},83646,e=>{"use strict";var t=e.i(67561);e.s(["default",0,()=>(0,t.useOcearoContext)().tokens])}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,44651,e=>{"use strict";var t=e.i(43476),s=e.i(71645);e.i(85269);var i=e.i(22831),l=e.i(85709),n=e.i(46991),a=e.i(14922),r=e.i(37917);let d=["environment.depth.belowKeel","environment.depth.belowTransducer","environment.depth.belowSurface"];e.s(["default",0,({compact:e=!1})=>{let{t:c}=(0,i.useTranslation)(),o=(0,l.useSignalKPaths)(d),h=o["environment.depth.belowKeel"]??o["environment.depth.belowTransducer"]??o["environment.depth.belowSurface"],u=(0,s.useRef)(h),[x,m]=(0,s.useState)([]);if((0,s.useEffect)(()=>{u.current=h},[h]),(0,s.useEffect)(()=>{let e=setInterval(()=>{let e=u.current;Number.isFinite(e)&&m(t=>[...t.slice(-119),e])},5e3);return()=>clearInterval(e)},[]),!Number.isFinite(h))return e?null:(0,t.jsx)(a.default,{title:c("hud.depth"),className:"w-[17rem]",children:(0,t.jsx)("span",{className:"text-value font-semibold text-hud-muted",children:"--"})});let f=x.slice(-12),p=f.length>=2?(f[f.length-1]-f[0])/((f.length-1)*5e3/6e4):null,v=h<3,b=Number.isFinite(p)&&Math.abs(p)>=.05&&(0,t.jsxs)("span",{className:`text-caption font-semibold whitespace-nowrap ${p<0?"text-oYellow":"text-hud-secondary"}`,children:[p<0?"▲":"▼"," ",Math.abs(p).toFixed(1)," m/min"]}),j=v?"var(--color-oRed)":"var(--color-oBlue)";return e?(0,t.jsxs)("div",{className:"tesla-card !p-3 !rounded-2xl select-none",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,t.jsx)("span",{className:"text-caption font-semibold uppercase tracking-widest text-hud-muted truncate",children:c("hud.depth")}),b]}),(0,t.jsxs)("div",{className:"flex items-baseline gap-1",children:[(0,t.jsx)("span",{className:`text-value font-semibold leading-tight ${v?"text-oRed":"text-hud-main"}`,children:(0,n.convertDepthUnit)(h)?.toFixed(1)}),(0,t.jsx)("span",{className:"text-caption text-hud-secondary",children:(0,n.getDepthUnitLabel)()})]}),(0,t.jsx)(r.default,{fluid:!0,values:x,height:22,invert:!0,endDot:!0,color:j})]}):(0,t.jsxs)(a.default,{title:c("hud.depth"),className:"w-[17rem]",children:[(0,t.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,t.jsx)("span",{className:`text-value font-semibold ${v?"text-oRed":"text-hud-main"}`,children:(0,n.convertDepthUnit)(h)?.toFixed(1)}),(0,t.jsx)("span",{className:"text-caption text-hud-secondary",children:(0,n.getDepthUnitLabel)()}),b]}),(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(r.default,{values:x,width:240,height:48,invert:!0,endDot:!0,color:j})}),(0,t.jsx)("div",{className:"text-caption text-hud-muted mt-1",children:c("hud.depthHistory")})]})}])},41994,function(e){e.n(e.i(44651))},14922,37917,e=>{"use strict";var t=e.i(43476),s=e.i(71645);e.s(["default",0,({title:e,right:s,className:i="",children:l})=>(0,t.jsxs)("div",{className:`hud-halo px-1 py-1 select-none ${i}`,children:[(e||s)&&(0,t.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,t.jsx)("span",{className:"text-caption font-semibold uppercase tracking-widest text-hud-muted",children:e}),s]}),l]})],14922);let i=({values:e,width:s=240,height:i=60,color:l="var(--color-oBlue)",marker:n=null,endDot:a=!1,invert:r=!1})=>{let d=e.filter(Number.isFinite);if(d.length<2)return(0,t.jsx)("svg",{width:s,height:i});let c=Math.min(...d),o=Math.max(...d)-c||1,h=s/(e.length-1),u=e=>(r?(e-c)/o:1-(e-c)/o)*(i-8)+4,x="";e.forEach((e,t)=>{Number.isFinite(e)&&(x+=`${x?"L":"M"}${(t*h).toFixed(1)},${u(e).toFixed(1)}`)});let m=`${x}L${s},${r?0:i}L0,${r?0:i}Z`,f=null;if(null!==n){let t=n*(e.length-1),i=Math.min(e.length-2,Math.floor(t)),l=e[i],a=e[i+1];Number.isFinite(l)&&Number.isFinite(a)&&(f={x:n*s,y:u(l+(a-l)*(t-i))})}let p=e[e.length-1];return(0,t.jsxs)("svg",{width:s,height:i,className:"block overflow-visible",children:[(0,t.jsx)("path",{d:m,fill:l,opacity:"0.12"}),(0,t.jsx)("path",{d:x,fill:"none",stroke:l,strokeWidth:"2",strokeLinejoin:"round"}),null!==n&&(0,t.jsx)("line",{x1:n*s,x2:n*s,y1:"0",y2:i,stroke:"var(--hud-text-main)",strokeWidth:"1.5"}),f&&(0,t.jsx)("circle",{cx:f.x,cy:f.y,r:"4",fill:l,stroke:"var(--hud-text-main)",strokeWidth:"1.5"}),a&&Number.isFinite(p)&&(0,t.jsx)("circle",{cx:s,cy:u(p),r:"3.5",fill:l})]})},l=e=>{let l=(0,s.useRef)(null),[n,a]=(0,s.useState)(0);return(0,s.useEffect)(()=>{let e=l.current;if(!e)return;let t=new ResizeObserver(([e])=>a(Math.floor(e.contentRect.width)));return t.observe(e),()=>t.disconnect()},[]),(0,t.jsx)("div",{ref:l,className:"w-full",style:{height:e.height},children:n>0&&(0,t.jsx)(i,{...e,width:n})})};e.s(["default",0,({fluid:e=!1,...s})=>e?(0,t.jsx)(l,{...s}):(0,t.jsx)(i,{...s})],37917)}]);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,2936,e=>{"use strict";var t=e.i(43476);e.i(71645);var n=e.i(46932),o=e.i(88653),i=e.i(49721),r=e.i(68757),l=e.i(83402),s=e.i(48390);e.i(85269);var a=e.i(22831);let u=({icon:e,label:n,onClick:o,onClose:r})=>(0,t.jsxs)("button",{onClick:()=>{o(),r()},className:"flex items-center min-w-0 text-hud-main px-2 py-2 sm:px-4 sm:py-3 rounded-xl tesla-hover transition-all duration-200 group bg-hud-bg shadow-soft border border-hud",children:[(0,t.jsx)("div",{className:"w-7 h-7 sm:w-8 sm:h-8 flex items-center justify-center bg-hud-elevated rounded-lg mr-2 sm:mr-3 group-hover:scale-110 transition-transform shrink-0",children:(0,t.jsx)(i.FontAwesomeIcon,{icon:e,className:"text-sm sm:text-base text-hud-muted group-hover:text-hud-main transition-colors"})}),(0,t.jsx)("span",{className:"block min-w-0 text-caption sm:text-label font-bold uppercase tracking-wide sm:tracking-widest truncate",children:n})]});e.s(["default",0,({handleSetRightView:e,toggleSettings:i,toggleFullscreen:c,setShowAppMenu:d})=>{let{t:m}=(0,a.useTranslation)(),f=(0,s.isOcearoCoreEnabled)(),p=l.default.get("debugMode"),h=()=>d(!1);return(0,t.jsx)(o.AnimatePresence,{children:(0,t.jsx)(n.motion.div,{initial:{y:20,x:"-50%",opacity:0,scale:.95},animate:{y:0,x:"-50%",opacity:1,scale:1},exit:{y:20,x:"-50%",opacity:0,scale:.95},transition:{duration:.3,ease:[.16,1,.3,1]},className:"fixed bottom-[calc(5rem+env(safe-area-inset-bottom))] left-1/2 bg-hud-menu p-3 sm:p-6 rounded-3xl shadow-2xl z-50 w-[95vw] sm:w-full max-w-lg border border-hud ocearo-appmenu-scroll",children:(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-3 sm:gap-4",children:[(0,t.jsx)(u,{onClose:h,icon:r.faCogs,label:m("menu.settings"),onClick:i}),(0,t.jsx)(u,{onClose:h,icon:r.faChartLine,label:m("menu.dashboard"),onClick:()=>e("dashboard")}),f&&(0,t.jsx)(u,{onClose:h,icon:r.faBook,label:m("menu.logbook"),onClick:()=>e("logbook")}),(0,t.jsx)(u,{onClose:h,icon:r.faCompass,label:m("menu.autopilot"),onClick:()=>e("autopilot")}),(0,t.jsx)(u,{onClose:h,icon:r.faHandsHelping,label:m("menu.manual"),onClick:()=>e("manual")}),(0,t.jsx)(u,{onClose:h,icon:r.faTachometerAlt,label:m("menu.instruments"),onClick:()=>e("instrument")}),(0,t.jsx)(u,{onClose:h,icon:r.faVideo,label:m("menu.webcam"),onClick:()=>e("webcam1")}),(0,t.jsx)(u,{onClose:h,icon:r.faMapMarkedAlt,label:m("menu.navigation"),onClick:()=>e("navigation")}),(0,t.jsx)(u,{onClose:h,icon:r.faCloudSun,label:m("menu.weather"),onClick:()=>e("weather")}),(0,t.jsx)(u,{onClose:h,icon:r.faBatteryFull,label:m("menu.battery"),onClick:()=>e("battery")}),(0,t.jsx)(u,{onClose:h,icon:r.faExclamationTriangle,label:m("menu.engine"),onClick:()=>e("motor")}),(0,t.jsx)(u,{onClose:h,icon:r.faHeadphones,label:m("menu.mediaPlayer"),onClick:()=>e("mediaplayer")}),(0,t.jsx)(u,{onClose:h,icon:r.faExpand,label:m("menu.toggleFullscreen"),onClick:c}),p&&(0,t.jsx)(u,{onClose:h,icon:r.faBug,label:m("menu.debug"),onClick:()=>e("debug")}),(0,t.jsx)(u,{onClose:h,icon:r.faSyncAlt,label:m("menu.refresh"),onClick:()=>{window.location.reload()}})]})})})}])},85626,function(e){e.n(e.i(2936))},88653,e=>{"use strict";var t=e.i(43476),n=e.i(71645),o=e.i(31178),i=e.i(47414),r=e.i(74008),l=e.i(21476),s=e.i(72846),a=n,u=e.i(37806);function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}class d extends a.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if((0,s.isHTMLElement)(t)&&e.isPresent&&!this.props.isPresent&&!1!==this.props.pop){let e=t.offsetParent,n=(0,s.isHTMLElement)(e)&&e.offsetWidth||0,o=(0,s.isHTMLElement)(e)&&e.offsetHeight||0,i=getComputedStyle(t),r=this.props.sizeRef.current;r.height=parseFloat(i.height),r.width=parseFloat(i.width),r.top=t.offsetTop,r.left=t.offsetLeft,r.right=n-r.width-r.left,r.bottom=o-r.height-r.top,r.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function m({children:e,isPresent:o,anchorX:i,anchorY:r,root:l,pop:s}){let f=(0,a.useId)(),p=(0,a.useRef)(null),h=(0,a.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:x}=(0,a.useContext)(u.MotionConfigContext),g=function(...e){return n.useCallback(function(...e){return t=>{let n=!1,o=e.map(e=>{let o=c(e,t);return n||"function"!=typeof o||(n=!0),o});if(n)return()=>{for(let t=0;t<o.length;t++){let n=o[t];"function"==typeof n?n():c(e[t],null)}}}}(...e),e)}(p,!1!==s?e.props?.ref??e?.ref:void 0);return(0,a.useInsertionEffect)(()=>{let{width:e,height:t,top:n,left:a,right:u,bottom:c,direction:d}=h.current;if(o||!1===s||!p.current||!e||!t)return;let m="rtl"===d,g="left"===i?m?`right: ${u}`:`left: ${a}`:m?`left: ${a}`:`right: ${u}`,C="bottom"===r?`bottom: ${c}`:`top: ${n}`;p.current.dataset.motionPopId=f;let b=document.createElement("style");x&&(b.nonce=x);let j=l??document.head;return j.appendChild(b),b.sheet&&b.sheet.insertRule(`
|
|
2
|
+
[data-motion-pop-id="${f}"] {
|
|
3
|
+
position: absolute !important;
|
|
4
|
+
width: ${e}px !important;
|
|
5
|
+
height: ${t}px !important;
|
|
6
|
+
${g}px !important;
|
|
7
|
+
${C}px !important;
|
|
8
|
+
}
|
|
9
|
+
`),()=>{p.current?.removeAttribute("data-motion-pop-id"),j.contains(b)&&j.removeChild(b)}},[o]),(0,t.jsx)(d,{isPresent:o,childRef:p,sizeRef:h,pop:s,children:!1===s?e:a.cloneElement(e,{ref:g})})}let f=({children:e,initial:o,isPresent:s,onExitComplete:a,custom:u,presenceAffectsLayout:c,mode:d,anchorX:f,anchorY:h,root:x})=>{let g=(0,i.useConstant)(p),C=(0,n.useId)(),b=(0,n.useRef)(s),j=(0,n.useRef)(a);(0,r.useIsomorphicLayoutEffect)(()=>{b.current=s,j.current=a});let y=!0,w=(0,n.useMemo)(()=>(y=!1,{id:C,initial:o,isPresent:s,custom:u,onExitComplete:e=>{for(let t of(g.set(e,!0),g.values()))if(!t)return;a&&a()},register:e=>(g.set(e,!1),()=>{g.delete(e),b.current||g.size||j.current?.()})}),[s,g,a]);return c&&y&&(w={...w}),(0,n.useMemo)(()=>{g.forEach((e,t)=>g.set(t,!1))},[s]),n.useEffect(()=>{s||g.size||!a||a()},[s]),e=(0,t.jsx)(m,{pop:"popLayout"===d,isPresent:s,anchorX:f,anchorY:h,root:x,children:e}),(0,t.jsx)(l.PresenceContext.Provider,{value:w,children:e})};function p(){return new Map}var h=e.i(64978);let x=e=>e.key||"";function g(e){let t=[];return n.Children.forEach(e,e=>{(0,n.isValidElement)(e)&&t.push(e)}),t}e.s(["AnimatePresence",0,({children:e,custom:l,initial:s=!0,onExitComplete:a,presenceAffectsLayout:u=!0,mode:c="sync",propagate:d=!1,anchorX:m="left",anchorY:p="top",root:C})=>{let[b,j]=(0,h.usePresence)(d),y=(0,n.useMemo)(()=>g(e),[e]),w=d&&!b?[]:y.map(x),k=(0,n.useRef)(!0),v=(0,i.useConstant)(()=>new Map),E=(0,n.useRef)(new Set),[P,R]=(0,n.useState)(y),[M,L]=(0,n.useState)(y);(0,r.useIsomorphicLayoutEffect)(()=>{!d||b||M.length||j?.()},[b,d,M.length,j]),(0,r.useIsomorphicLayoutEffect)(()=>{k.current=!1;for(let e=0;e<M.length;e++){let t=x(M[e]);w.includes(t)?(v.delete(t),E.current.delete(t)):!0!==v.get(t)&&v.set(t,!1)}},[M,w.length,w.join("-")]);let T=[];if(y!==P){let e=[...y],t=0;for(let n of M){let o=w.indexOf(x(n));-1===o?(e.splice(t++,0,n),T.push(n)):t=o+T.length+1}return T.every(e=>v.get(x(e)))?e=y:"wait"===c&&(e=T),L(g(e)),R(y),null}let{forceRender:$}=(0,n.useContext)(o.LayoutGroupContext);return(0,t.jsx)(t.Fragment,{children:M.map(e=>{let n=x(e),o=(!d||!!b)&&(y===M||w.includes(n));return(0,t.jsx)(f,{isPresent:o,initial:(!k.current||!!s)&&void 0,custom:l,presenceAffectsLayout:u,mode:c,root:C,onExitComplete:o?void 0:()=>{if(E.current.has(n)||!v.has(n))return;E.current.add(n),v.set(n,!0);let e=!0;v.forEach(t=>{t||(e=!1)}),e&&($?.(),R([]),d&&j?.(),a&&a())},anchorX:m,anchorY:p,children:e},n)})})}],88653)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,54784,e=>{"use strict";var t=e.i(43476),a=e.i(71645),s=e.i(46932),n=e.i(49721),i=e.i(68757);e.i(85269);var l=e.i(62588),r=e.i(77291),o=e.i(83646),c=e.i(85709),d=e.i(83402);let u=({title:e,icon:s,iconClass:i="text-oBlue",action:l,className:r="",children:o,...c})=>(0,t.jsxs)("div",{className:`tesla-card flex flex-col min-w-0 ${r}`,...c,children:[(e||s||l)&&(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3 shrink-0",children:[s&&(a.default.isValidElement(s)?(0,t.jsx)("span",{className:`${i} flex items-center`,children:s}):(0,t.jsx)(n.FontAwesomeIcon,{icon:s,className:`${i} text-sm opacity-80`})),e&&(0,t.jsx)("span",{className:"text-caption font-semibold uppercase tracking-widest text-hud-secondary truncate",children:e}),l&&(0,t.jsx)("div",{className:"ml-auto flex items-center gap-2",children:l})]}),o]}),m=({title:e,icon:a,iconColorClass:s="text-oBlue",hasData:n=!0,noDataMessage:i="No data available",children:l,className:r=""})=>{let o="function"==typeof a?a():a;return n?(0,t.jsx)(u,{title:e,icon:o,iconClass:s,className:`h-full overflow-hidden ${r}`,children:(0,t.jsx)("div",{className:"flex-1 flex flex-col justify-center min-h-0 overflow-hidden",children:l})}):(0,t.jsx)(u,{title:e,icon:o,iconClass:s,className:`h-full overflow-hidden ${r}`,children:(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center min-h-0",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-hero font-medium text-hud-dim mb-2",children:"N/A"}),(0,t.jsx)("div",{className:"text-caption font-semibold uppercase text-hud-muted",children:i})]})})})};var x=e.i(22831),h=e.i(20705);let p=[1,2,5,10,20],g={cardinal:"#f2c200",isolated_danger:"#e0483a",safe_water:"#f0f0f0",special_purpose:"#f2c200",station:"#8a9097"},f=a.default.memo(()=>{let e,{t:s}=(0,x.useTranslation)(),{targets:u,atons:f}=(0,l.useAIS)(),{statuses:v}=(0,r.default)({always:!0}),{scene:y,id:w}=(0,o.default)(),[b,N]=(0,a.useState)(5),j=d.default.get("debugMode"),k=(0,a.useCallback)(e=>{e.preventDefault(),N(t=>{let a=p.indexOf(t);return -1===a?t:e.deltaY<0&&a>0?p[a-1]:e.deltaY>0&&a<p.length-1?p[a+1]:t})},[]),C=(0,c.useSignalKPath)("navigation.position"),M=(0,c.useSignalKPath)("navigation.headingTrue"),S=(0,c.useSignalKPath)("navigation.headingMagnetic"),W=(0,c.useSignalKPath)("navigation.courseOverGroundTrue"),$=M??S??W??0,F=(0,a.useMemo)(()=>u.length&&C?u.filter(e=>e.distanceMeters&&e.distanceMeters<=1852*b).map(e=>{let t=e.distanceMeters/1852,a=((180*Math.atan2(e.sceneX,-e.sceneZ)/Math.PI+360)%360-180*$/Math.PI+360)%360,s=null===e.cpaMeters?null:e.cpaMeters/1852;return{id:e.mmsi,name:e.name||`MMSI ${e.mmsi}`,distance:Math.round(10*t)/10,bearing:Math.round(a),type:e.shipType||"unknown",cpa:null===s?null:Math.round(10*s)/10}}).sort((e,t)=>e.distance-t.distance).slice(0,10):[],[u,b,C,$]),T=(0,a.useMemo)(()=>f.length&&C?f.filter(e=>null!==e.distanceMeters&&e.distanceMeters<=1852*b).slice(0,40).map(e=>{let t=(180*Math.atan2(e.east,e.north)/Math.PI+360)%360;return{id:e.id,name:e.name||`MMSI ${e.mmsi||""}`,distance:e.distanceMeters/1852,bearing:(t-180*$/Math.PI+360)%360,colour:"night"===w?y.compass:(e=>{let{kind:t,category:a=""}=(0,h.atonKind)(e);return"lateral"===t?a.endsWith("starboard")?"#1fae5b":"#e0483a":g[t]||g.station})(e.atonType),virtual:e.virtual}}):[],[f,b,C,$,w,y.compass]),I={giveWay:y.vesselDanger,yields:y.vesselYields,close:y.vesselClose},D=e=>I[v[e.id]]||"var(--hud-text-secondary, #8a9097)",A=e=>"giveWay"===v[e.id]||"yields"===v[e.id],R=j||F.length>0||T.length>0;return(0,t.jsxs)(m,{title:s("widgets.aisTacticalRadar"),icon:i.faTowerBroadcast,hasData:R,noDataMessage:s("widgets.signalLossAIS"),children:[(0,t.jsx)("div",{className:"absolute top-4 right-4 z-10",children:(0,t.jsxs)("select",{value:b,onChange:e=>N(Number(e.target.value)),className:"bg-hud-elevated text-hud-secondary text-caption font-semibold uppercase tracking-widest rounded-sm px-3 py-1 border border-hud shadow-soft focus:outline-none focus:ring-1 focus:ring-oBlue/50 hover:bg-hud-bg hover:text-hud-main transition-all duration-500",children:[(0,t.jsx)("option",{value:1,children:"1 NM"}),(0,t.jsx)("option",{value:2,children:"2 NM"}),(0,t.jsx)("option",{value:5,children:"5 NM"}),(0,t.jsx)("option",{value:10,children:"10 NM"}),(0,t.jsx)("option",{value:20,children:"20 NM"})]})}),(0,t.jsxs)("div",{className:"flex-1 relative min-h-0 bg-hud-bg rounded-sm overflow-hidden border border-hud shadow-inner group mt-2",onWheel:k,children:[(0,t.jsxs)("svg",{className:"w-full h-full p-2 transition-transform duration-700 group-hover:scale-[1.02]",viewBox:"0 0 200 200",children:[[1,2,3,4].map(e=>(0,t.jsx)("circle",{cx:"100",cy:"100",r:20*e,fill:"none",stroke:"var(--color-oBlue)",strokeOpacity:"0.28",strokeWidth:"0.5"},e)),(0,t.jsx)("line",{x1:"100",y1:"20",x2:"100",y2:"180",stroke:"var(--color-oBlue)",strokeOpacity:"0.16",strokeWidth:"0.5"}),(0,t.jsx)("line",{x1:"20",y1:"100",x2:"180",y2:"100",stroke:"var(--color-oBlue)",strokeOpacity:"0.16",strokeWidth:"0.5"}),(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:"100",y1:"100",x2:"100",y2:"20",stroke:"var(--color-oGreen)",strokeWidth:"1",strokeOpacity:"0.4"}),(0,t.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 100 100",to:"360 100 100",dur:"3s",repeatCount:"indefinite"})]}),T.map(e=>{let a=e.distance/b*80,s=100+a*Math.cos((e.bearing-90)*Math.PI/180),n=100+a*Math.sin((e.bearing-90)*Math.PI/180);return(0,t.jsx)("polygon",{points:`${s},${n-2.6} ${s+2},${n} ${s},${n+2.6} ${s-2},${n}`,fill:e.virtual?"none":e.colour,stroke:e.colour,strokeWidth:e.virtual?.7:.4,strokeDasharray:e.virtual?"1 0.6":void 0,opacity:"0.9",children:(0,t.jsx)("title",{children:e.virtual?`${e.name} (V-AIS)`:e.name})},e.id)}),(e=[],F.map(t=>{let a=t.distance/b*80,s=100+a*Math.cos((t.bearing-90)*Math.PI/180),n=100+a*Math.sin((t.bearing-90)*Math.PI/180),i=n-5;for(;e.some(e=>26>Math.abs(e.x-s)&&6>Math.abs(e.y-i));)i+=6;return e.push({x:s,y:i}),{target:t,x:s,y:n,ly:i}})).map(({target:e,x:a,y:s,ly:n})=>{let i=A(e);return(0,t.jsxs)("g",{className:i?"animate-soft-pulse":"",children:[(0,t.jsx)("circle",{cx:a,cy:s,r:i?"3":"2",fill:D(e),className:"transition-all duration-1000"}),(0,t.jsx)("text",{x:a+5,y:n,fill:"currentColor",fontSize:"5",className:"font-black pointer-events-none uppercase tracking-tighter opacity-60 text-hud-main",children:e.name.substring(0,8)})]},e.id)}),(0,t.jsx)("polygon",{points:"100,95 105,105 100,102 95,105",fill:"var(--color-oBlue)",stroke:"currentColor",strokeWidth:"0.5",opacity:"0.8",className:"text-hud-main"})]}),(0,t.jsxs)("div",{className:"absolute top-2 left-2 text-caption text-hud-muted font-semibold pointer-events-none uppercase tracking-widest space-y-1",children:[(0,t.jsxs)("div",{className:"bg-hud-bg/40 px-1.5 py-0.5 rounded-sm",children:[s("widgets.range")," ",b," NM"]}),(0,t.jsxs)("div",{className:"bg-hud-bg/40 px-1.5 py-0.5 rounded-sm",children:[s("widgets.targets")," ",F.length]})]})]}),F.length>0&&(0,t.jsxs)("div",{className:"mt-4 space-y-2",children:[(0,t.jsx)("div",{className:"text-caption text-hud-muted font-semibold uppercase tracking-[0.2em] px-1",children:s("widgets.tacticalAnalysis")}),F.slice(0,2).map(e=>{let a;return(0,t.jsxs)("div",{className:"flex items-center justify-between text-caption tesla-card px-3 py-2 tesla-hover",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3 min-w-0",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:30===(a=Number(e.type))||a>=70&&a<=89?i.faShip:i.faLocationDot,style:{color:D(e)},className:`text-xs opacity-80 ${A(e)?"animate-soft-pulse":""}`}),(0,t.jsx)("span",{className:"text-hud-main truncate font-black uppercase tracking-tight",children:e.name})]}),(0,t.jsxs)("div",{className:"flex space-x-4 text-hud-secondary font-black tracking-tighter",children:[(0,t.jsxs)("span",{className:"gliding-value",children:[e.distance.toFixed(1)," NM"]}),(0,t.jsxs)("span",{className:"gliding-value",style:{color:D(e)},children:["CPA: ",null===e.cpa?"--":e.cpa.toFixed(1)]})]})]},e.id)})]})]})});function v(){let{t:e}=(0,x.useTranslation)(),s=(0,c.useSignalKPaths)(["tanks.fuel.0.currentLevel","tanks.fuel.0.capacity","tanks.fuel.0.name","tanks.fuel.0.type","tanks.fuel.0.temperature","tanks.freshWater.0.currentLevel","tanks.freshWater.0.capacity","tanks.freshWater.0.name","tanks.freshWater.0.type","tanks.freshWater.0.temperature","tanks.wasteWater.0.currentLevel","tanks.wasteWater.0.capacity","tanks.wasteWater.0.name","tanks.wasteWater.0.type","tanks.wasteWater.0.temperature","tanks.blackWater.0.currentLevel","tanks.blackWater.0.capacity","tanks.blackWater.0.name","tanks.blackWater.0.type","tanks.blackWater.0.temperature","tanks.oil.0.currentLevel","tanks.oil.0.capacity","tanks.oil.0.name","tanks.oil.0.type","tanks.oil.0.temperature"]),l=(0,a.useMemo)(()=>{let t=(e,t,a,n,i)=>({level:s[`tanks.${e}.0.currentLevel`]??null,capacity:s[`tanks.${e}.0.capacity`]??null,tankName:s[`tanks.${e}.0.name`],tankType:s[`tanks.${e}.0.type`],temperature:s[`tanks.${e}.0.temperature`],icon:a,color:n,bgColor:i,displayName:t}),a={fuel:t("fuel",e("widgets.tankFuel"),i.faGasPump,"text-oYellow","bg-oYellow"),freshWater:t("freshWater",e("widgets.tankFreshWater"),i.faTint,"text-oBlue","bg-oBlue"),wasteWater:t("wasteWater",e("widgets.tankWasteWater"),i.faToilet,"text-hud-secondary","bg-hud-elevated"),blackWater:t("blackWater",e("widgets.tankBlackWater"),i.faToilet,"text-hud-secondary","bg-hud-elevated"),oil:t("oil",e("widgets.tankEngineOil"),i.faOilCan,"text-oYellow","bg-oYellow")};return{hasData:Object.values(a).some(e=>null!==e.level),...a}},[s,e]);return(0,t.jsx)(m,{title:e("widgets.storageSystems"),icon:i.faGasPump,hasData:l.hasData,noDataMessage:e("widgets.signalLossLevelSensors"),children:(0,t.jsx)("div",{className:"flex-1 flex flex-col justify-center min-h-0 space-y-4",children:Object.entries(l).filter(([e])=>"hasData"!==e).map(([e,a])=>{if(null===a.level)return null;let s=Math.round(100*a.level),i=Number.isFinite(a.capacity)?Math.round(1e3*a.capacity):null,l=null!==i?Math.round(a.level*i):null,r="wasteWater"===e||"blackWater"===e,o=r?a.level>.8:a.level<.1;return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,t.jsx)("div",{className:"flex items-center justify-center w-6 h-6 bg-hud-elevated rounded-full",children:(0,t.jsx)(n.FontAwesomeIcon,{icon:a.icon,className:`${a.color} text-xs opacity-80`})}),(0,t.jsx)("span",{className:"text-hud-main text-caption font-semibold uppercase tracking-widest whitespace-nowrap",children:a.displayName})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-4",children:[null!==i&&(0,t.jsxs)("span",{className:"text-hud-secondary text-caption font-semibold opacity-60 tabular-nums whitespace-nowrap",children:[l,"/",i," L"]}),(0,t.jsxs)("span",{className:`text-label font-semibold ${((e,t=!1)=>t?e>.8?"text-oRed":e>.6?"text-oYellow":"text-oGreen":e<.1?"text-oRed":e<.25?"text-oYellow":"text-oGreen")(a.level,r)} ${o?"animate-soft-pulse":""}`,children:[s,"%"]})]})]}),(0,t.jsx)("div",{className:"bg-hud-elevated rounded-full h-1.5 overflow-hidden shadow-inner",children:(0,t.jsx)("div",{className:`h-full transition-all duration-1000 ${r?a.level>.8?"bg-oRed":a.level>.6?"bg-oYellow":"bg-oGreen":a.level<.1?"bg-oRed":a.level<.25?"bg-oYellow":"bg-oGreen"}`,style:{width:`${s}%`}})})]},e)})})})}f.displayName="AISRadarWidget";var y=e.i(46991),w=e.i(83934),b=e.i(95430);function N(){let{t:e}=(0,x.useTranslation)(),s=d.default.get("debugMode"),{forecasts:l,isLoading:r,weatherApiAvailable:o,fetchWeatherForecast:c,getCurrentWeather:u}=(0,w.useWeather)(),h=(0,a.useMemo)(()=>{let e=u(),t=(0,y.convertTemperatureUnit)(e.temperature),a=null!==(0,y.finite)(e.humidity)?Math.round(100*e.humidity):null,n=null!==(0,y.convertPressure)(e.pressure)?Math.round(e.pressure/100):null,i=(0,y.convertSpeedUnit)(e.windSpeed),r=(0,y.toDegrees)(e.windDirection),o=e.description,c=e.source,d=null!==t||null!==a||null!==n||null!==i;if(!d&&!s)return{hasData:!1,dataSource:null};let m=t,x=a,h=n,p=i,g=r;!d&&s&&(m=15,x=65,h=1013,p=5.2,g=120,c="debug");let f="sunny";if(o){let e=o.toLowerCase();e.includes("rain")||e.includes("shower")?f="rainy":e.includes("snow")?f="snow":e.includes("partly")||e.includes("few clouds")||e.includes("scattered")?f="partly-cloudy":e.includes("cloud")||e.includes("overcast")?f="cloudy":(e.includes("clear")||e.includes("sun"))&&(f="sunny")}else h&&(f=h<1e3?x&&x>80?"rainy":"cloudy":h>1020?"sunny":"partly-cloudy");return{hasData:!0,dataSource:c,description:o,temperature:m,humidity:x,pressure:h,windSpeed:p,windDirection:g,condition:f,forecast:l}},[u,l,s]),p=e=>{switch(e){case"sunny":return i.faSun;case"partly-cloudy":default:return i.faCloudSun;case"cloudy":return i.faCloud;case"rainy":return i.faCloudRain;case"heavy-rain":return i.faCloudShowersHeavy;case"snow":return i.faSnowflake}},g=e=>{switch(e){case"sunny":return"text-oYellow";case"partly-cloudy":case"rainy":case"heavy-rain":default:return"text-oBlue";case"cloudy":return"text-hud-muted";case"snow":return"text-hud-main"}},f=e=>null===(0,y.finite)(e)?"":["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][(Math.round(e/22.5)%16+16)%16];return(0,t.jsxs)(m,{title:e("widgets.meteorologicalData"),icon:p(h.condition),hasData:h.hasData,noDataMessage:r?e("widgets.acquiringSatellite"):e("widgets.signalLossWeather"),children:[(0,t.jsxs)("div",{className:"absolute top-4 right-4 z-10 flex items-center space-x-3",children:[h.dataSource&&(0,t.jsx)("span",{className:`text-caption px-2 py-0.5 rounded-sm uppercase font-semibold tracking-widest text-hud-main shadow-soft ${"sensors"===h.dataSource?"bg-oGreen/40 border border-oGreen/30":"forecast"===h.dataSource?"bg-oBlue/40 border border-oBlue/30":"bg-hud-elevated border border-hud"}`,children:(()=>{switch(h.dataSource){case"sensors":return e("widgets.dataSourceLive");case"forecast":return e("widgets.dataSourceForecast");case"debug":return e("widgets.dataSourceDemo");default:return""}})()}),!1!==o&&(0,t.jsx)("button",{onClick:c,disabled:r,className:"w-7 h-7 rounded-full bg-hud-elevated flex items-center justify-center text-hud-secondary hover:text-hud-main transition-all duration-500 tesla-hover",title:e("widgets.updateForecast"),children:(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faSync,className:`text-xs ${r?"animate-spin":""}`})})]}),(0,t.jsxs)("div",{className:"flex-1 flex flex-col min-h-0",children:[(0,t.jsx)("div",{className:"flex-1 flex flex-col justify-center",children:(0,t.jsxs)("div",{className:"text-center mb-6 group",children:[(0,t.jsx)("div",{className:`text-hero mb-4 transition-transform duration-700 group-hover:scale-110 ${g(h.condition)}`,children:(0,t.jsx)(n.FontAwesomeIcon,{icon:p(h.condition),className:"sunny"!==h.condition?"animate-soft-pulse":""})}),(0,t.jsx)("div",{className:"text-hero font-medium text-hud-main leading-none gliding-value tracking-tight",children:null!==h.temperature?`${h.temperature}${(0,y.getTemperatureUnitLabel)()}`:e("common.na")}),(0,t.jsx)("div",{className:"text-caption font-semibold text-hud-secondary uppercase tracking-[0.3em] mt-3 opacity-60",children:h.description||(t=>{switch(t){case"sunny":return e("widgets.clearSkies");case"partly-cloudy":return e("widgets.partlyCloudy");case"cloudy":return e("widgets.overcast");case"rainy":return e("widgets.lightRain");case"heavy-rain":return e("widgets.heavyRain");case"snow":return e("widgets.snow");default:return e("widgets.variable")}})(h.condition)})]})}),h.forecast&&h.forecast.length>1&&(0,t.jsx)("div",{className:"space-y-2 shrink-0",children:h.forecast.slice(1,4).map((e,a)=>{let s=new Date(e.date?e.date:(0,b.vesselNow)().getTime()+(a+1)*864e5),l=isNaN(s.getTime())?e.time||`+${a+1}d`:s.toLocaleDateString("en-GB",{weekday:"short"}),r=e.description?e.description.toLowerCase().includes("rain")?"rainy":e.description.toLowerCase().includes("cloud")?"cloudy":e.description.toLowerCase().includes("snow")?"snow":"sunny":"partly-cloudy",o=null!==(0,y.finite)(e.wind?.speed)?Math.round(10*e.wind.speed)/10:null,c=f(e.wind?.direction)||null;return(0,t.jsxs)("div",{className:"flex items-center justify-between py-1.5 border-b border-hud/30 last:border-0",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,t.jsx)("span",{className:"text-hud-muted text-caption font-semibold uppercase tracking-widest w-8",children:l}),(0,t.jsx)(n.FontAwesomeIcon,{icon:p(r),className:`text-sm w-5 ${g(r)}`}),(0,t.jsx)("span",{className:"text-hud-main text-label font-semibold gliding-value w-8",children:null!==e.temperature?`${Math.round(e.temperature)}\xb0`:"--"})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faWind,className:"text-oBlue text-xs opacity-50"}),(0,t.jsx)("span",{className:"text-hud-main text-caption font-semibold gliding-value",children:null!==o?`${o} ${(0,y.getSpeedUnitLabel)()}`:"--"}),c&&(0,t.jsx)("span",{className:"text-hud-muted text-caption font-semibold tracking-widest opacity-60",children:c})]})]},a)})}),(0,t.jsxs)("div",{className:"flex items-center justify-between shrink-0 mt-2",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faWind,className:"text-oBlue text-sm opacity-50"}),(0,t.jsx)("span",{className:"text-hud-secondary text-caption uppercase font-semibold tracking-widest",children:e("widgets.now")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("span",{className:"text-hud-main text-label font-semibold gliding-value tracking-tight",children:null!==h.windSpeed?`${h.windSpeed} ${(0,y.getSpeedUnitLabel)()}`:e("common.na")}),(0,t.jsx)("span",{className:"text-hud-muted text-caption uppercase font-semibold tracking-widest ml-2 opacity-60",children:null!==h.windDirection?f(h.windDirection):""})]})]})]})]})}var j=e.i(66799);let k=(0,a.createContext)(),C=({children:e})=>{let[s,n]=(0,a.useState)({}),[i,l]=(0,a.useState)({}),[r,o]=(0,a.useState)({}),[c,d]=(0,a.useState)(!1),[u,m]=(0,a.useState)(null),[x,h]=(0,a.useState)(null),[p,g]=(0,a.useState)(null),[f,v]=(0,a.useState)(!1),[y,w]=(0,a.useState)(null),b=(0,a.useRef)(null),N=(0,a.useRef)(null),C=(0,a.useCallback)(async()=>{d(!0),m(null);try{let[e,t,a]=await Promise.all([j.default.getRoutes().catch(e=>("NetworkError"!==e.name&&console.error("NavigationContext: Failed to fetch routes:",e),{})),j.default.getWaypoints().catch(e=>("NetworkError"!==e.name&&console.error("NavigationContext: Failed to fetch waypoints:",e),{})),j.default.getCharts().catch(e=>("NetworkError"!==e.name&&console.error("NavigationContext: Failed to fetch charts:",e),{}))]);n(e||{}),l(t||{}),o(a||{})}catch(e){"NetworkError"!==e.name&&(console.error("NavigationContext: Failed to fetch resources:",e),m(e.message))}finally{d(!1)}},[]),M=(0,a.useCallback)(async()=>{try{let e=await j.default.getRoutes();return n(e||{}),e}catch(e){throw console.error("NavigationContext: Failed to fetch routes:",e),e}},[]),S=(0,a.useCallback)(async()=>{try{let e=await j.default.getWaypoints();return l(e||{}),e}catch(e){throw console.error("NavigationContext: Failed to fetch waypoints:",e),e}},[]),W=(0,a.useCallback)(async()=>{try{let[e,t]=await Promise.all([j.default.getCourse().catch(()=>null),j.default.getCourseCalculations().catch(()=>null)]);h(e),g(t)}catch(e){console.error("NavigationContext: Failed to fetch course:",e),w(e.message)}},[]),$=(0,a.useCallback)(async e=>{v(!0),w(null);try{await j.default.setDestinationWaypoint(e),await W()}catch(e){throw console.error("NavigationContext: Failed to set waypoint destination:",e),w(e.message),e}finally{v(!1)}},[W]),F=(0,a.useCallback)(async(e,t)=>{v(!0),w(null);try{await j.default.setDestinationPosition(e,t),await W()}catch(e){throw console.error("NavigationContext: Failed to set position destination:",e),w(e.message),e}finally{v(!1)}},[W]),T=(0,a.useCallback)(async(e,t=0,a=!1)=>{v(!0),w(null);try{await j.default.activateRoute(e,t,a),await W()}catch(e){throw console.error("NavigationContext: Failed to activate route:",e),w(e.message),e}finally{v(!1)}},[W]),I=(0,a.useCallback)(async()=>{v(!0),w(null);try{await j.default.clearCourse(),h(null),g(null)}catch(e){throw console.error("NavigationContext: Failed to clear course:",e),w(e.message),e}finally{v(!1)}},[]),D=(0,a.useCallback)(async()=>{try{await j.default.nextWaypoint(),await W()}catch(e){throw console.error("NavigationContext: Failed to go to next waypoint:",e),e}},[W]),A=(0,a.useCallback)(async()=>{try{await j.default.previousWaypoint(),await W()}catch(e){throw console.error("NavigationContext: Failed to go to previous waypoint:",e),e}},[W]),R=(0,a.useCallback)(async(e,t,a,s="")=>{try{let n=j.default.generateUUID(),i=j.default.createWaypointFeature(t,e,a,s);return await j.default.saveWaypoint(n,i),await S(),n}catch(e){throw console.error("NavigationContext: Failed to create waypoint:",e),e}},[S]),P=(0,a.useCallback)(async e=>{try{await j.default.deleteWaypoint(e),await S()}catch(e){throw console.error("NavigationContext: Failed to delete waypoint:",e),e}},[S]),G=(0,a.useCallback)(async(e,t,a="")=>{try{let s=j.default.generateUUID(),n=e.map(e=>[e.longitude,e.latitude]),i=j.default.createRouteFeature(n,t,a);return await j.default.saveRoute(s,i),await M(),s}catch(e){throw console.error("NavigationContext: Failed to create route:",e),e}},[M]),L=(0,a.useCallback)(async e=>{try{await j.default.deleteRoute(e),await M()}catch(e){throw console.error("NavigationContext: Failed to delete route:",e),e}},[M]),E=(0,a.useCallback)(e=>{let t=s[e];return t?j.default.parseRouteCoordinates(t):[]},[s]),B=(0,a.useCallback)(e=>{let t=i[e];return t?j.default.parseWaypointPosition(t):null},[i]),O=(0,a.useCallback)(()=>Object.entries(s).map(([e,t])=>({id:e,name:t.name||"Unnamed Route",description:t.description||"",pointCount:t.feature?.geometry?.coordinates?.length||0})),[s]),Y=(0,a.useCallback)(()=>Object.entries(i).map(([e,t])=>{let a=j.default.parseWaypointPosition(t);return{id:e,name:t.name||"Unnamed Waypoint",description:t.description||"",latitude:a?.latitude,longitude:a?.longitude}}),[i]),U=(0,a.useCallback)(()=>x?.nextPoint?.position!=null||x?.activeRoute?.href!=null,[x]),K=(0,a.useCallback)(()=>x?{position:x.nextPoint?.position,waypointHref:x.nextPoint?.href,routeHref:x.activeRoute?.href,pointIndex:x.activeRoute?.pointIndex,isRoute:!!x.activeRoute?.href,arrivalCircle:x.arrivalCircle}:null,[x]);(0,a.useEffect)(()=>(C(),W(),b.current=setInterval(()=>{W()},5e3),N.current=setInterval(()=>{C()},3e5),()=>{b.current&&clearInterval(b.current),N.current&&clearInterval(N.current)}),[C,W]);let z=(0,a.useMemo)(()=>({routes:s,waypoints:i,charts:r,isLoadingResources:c,resourcesError:u,activeCourse:x,courseCalculations:p,isLoadingCourse:f,courseError:y,fetchResources:C,fetchRoutes:M,fetchWaypoints:S,fetchCourse:W,navigateToWaypoint:$,navigateToPosition:F,activateRoute:T,clearCourse:I,goToNextWaypoint:D,goToPreviousWaypoint:A,createWaypoint:R,deleteWaypoint:P,createRoute:G,deleteRoute:L,getRouteCoordinates:E,getWaypointPosition:B,getRoutesList:O,getWaypointsList:Y,hasActiveDestination:U,getDestinationInfo:K}),[s,i,r,c,u,x,p,f,y,C,M,S,W,$,F,T,I,D,A,R,P,G,L,E,B,O,Y,U,K]);return(0,t.jsx)(k.Provider,{value:z,children:e})};e.i(67561);var M=e.i(37256);let S=(0,M.coursePaths)("distance","bearingTrue","crossTrackError","velocityMadeGood");function W(){var e,s;let{t:l}=(0,x.useTranslation)(),{activeCourse:r,courseCalculations:o,waypoints:u,routes:h,isLoadingCourse:p,navigateToWaypoint:g,activateRoute:f,clearCourse:v,goToNextWaypoint:w,goToPreviousWaypoint:b,getWaypointsList:N,getRoutesList:j,hasActiveDestination:C}=(()=>{let e=(0,a.useContext)(k);if(!e)throw Error("useNavigation must be used within a NavigationContextProvider");return e})(),W=d.default.get("debugMode"),$=(0,c.useSignalKPaths)(S),F=(0,M.courseValue)($,"distance"),T=(0,M.courseValue)($,"bearingTrue"),I=(0,M.courseValue)($,"crossTrackError"),D=(0,M.courseValue)($,"velocityMadeGood"),A=(0,c.useSignalKPath)("steering.autopilot.state"),R=(0,c.useSignalKPath)("steering.autopilot.mode"),P=(0,c.useSignalKPath)("steering.autopilot.target.headingTrue"),[G,L]=(0,a.useState)(!1),[E,B]=(0,a.useState)(!1),O=a.default.useMemo(()=>{let e=o||{},t=F??e.distance??null,a=T??e.bearingTrue??null;return null!==t||null!==a||W?{hasData:!0,distance:t??(W?5e3:null),bearingTrue:a??(W?.52:null),bearingMagnetic:e.bearingMagnetic??null,crossTrackError:I??e.crossTrackError??(W?50:null),velocityMadeGood:D??e.velocityMadeGood??(W?5.5:null),timeToGo:e.timeToGo??null,estimatedTimeOfArrival:e.estimatedTimeOfArrival??null,calcMethod:e.calcMethod}:{hasData:!1}},[o,F,T,I,D,W]),Y=async e=>{try{await g(e),L(!1)}catch(e){console.error("Failed to navigate to waypoint:",e)}},U=async e=>{try{await f(e),B(!1)}catch(e){console.error("Failed to activate route:",e)}},K=N(),z=j(),V=C();return(0,t.jsxs)(m,{title:l("widgets.course"),icon:i.faRoute,iconColorClass:"text-oGreen",hasData:O.hasData||V||K.length>0||z.length>0,noDataMessage:l("widgets.noCourseData"),children:[(0,t.jsxs)("div",{className:"absolute top-4 right-4 z-10 flex space-x-2",children:[(0,t.jsx)("button",{onClick:()=>{L(!G),B(!1)},className:`w-8 h-8 rounded-full flex items-center justify-center transition-all duration-500 shadow-soft ${G?"bg-oGreen text-hud-main":"bg-hud-elevated text-hud-secondary tesla-hover"}`,title:l("widgets.waypoints"),children:(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faLocationDot,className:"text-xs"})}),(0,t.jsx)("button",{onClick:()=>{B(!E),L(!1)},className:`w-8 h-8 rounded-full flex items-center justify-center transition-all duration-500 shadow-soft ${E?"bg-oGreen text-hud-main":"bg-hud-elevated text-hud-secondary tesla-hover"}`,title:l("widgets.routes"),children:(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faList,className:"text-xs"})})]}),(0,t.jsxs)("div",{className:"flex-1 flex flex-col min-h-0",children:[G&&(0,t.jsxs)("div",{className:"mb-4 max-h-40 overflow-y-auto tesla-card space-y-1",children:[(0,t.jsx)("div",{className:"text-caption text-hud-muted mb-2 uppercase font-semibold tracking-[0.2em] px-2 pt-1",children:l("widgets.storedWaypoints")}),0===K.length?(0,t.jsx)("div",{className:"text-caption text-hud-secondary italic px-2 py-4 text-center font-semibold uppercase",children:l("widgets.noActiveNodes")}):K.map(e=>(0,t.jsxs)("button",{onClick:()=>Y(e.id),className:"w-full text-left p-2 tesla-hover rounded-sm text-caption text-hud-main flex items-center group font-semibold uppercase tracking-tight",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faLocationDot,className:"text-oYellow mr-3 text-xs opacity-50 group-hover:opacity-100"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]},e.id))]}),E&&(0,t.jsxs)("div",{className:"mb-4 max-h-40 overflow-y-auto tesla-card space-y-1",children:[(0,t.jsx)("div",{className:"text-caption text-hud-muted mb-2 uppercase font-semibold tracking-[0.2em] px-2 pt-1",children:l("widgets.missionRoutes")}),0===z.length?(0,t.jsx)("div",{className:"text-caption text-hud-secondary italic px-2 py-4 text-center font-semibold uppercase",children:l("widgets.noRoutesLoaded")}):z.map(e=>(0,t.jsxs)("button",{onClick:()=>U(e.id),className:"w-full text-left p-2 tesla-hover rounded-sm text-caption text-hud-main flex items-center justify-between group font-semibold uppercase tracking-tight",children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faRoute,className:"text-oGreen mr-3 text-xs opacity-50 group-hover:opacity-100"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]}),(0,t.jsxs)("span",{className:"text-caption text-hud-muted font-semibold",children:[e.pointCount," pts"]})]},e.id))]}),V&&(0,t.jsxs)("div",{className:"tesla-card bg-oYellow/5 mb-6 border-l-2 border-oYellow/30 animate-soft-pulse",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faCrosshairs,className:"text-oYellow text-sm"}),(0,t.jsx)("span",{className:"text-hud-main text-caption font-semibold uppercase tracking-widest truncate",children:(()=>{if(!r)return l("widgets.noDestination");if(r.activeRoute?.href){let e=h[r.activeRoute.href.split("/").pop()],t=r.activeRoute.pointIndex||0;return e?.name?`${e.name} (${t+1})`:l("widgets.activeRoute")}if(r.nextPoint?.href){let e=u[r.nextPoint.href.split("/").pop()];return e?.name||l("widgets.waypoint")}if(r.nextPoint?.position){let e=r.nextPoint.position;return`${e.latitude?.toFixed(4)}\xb0, ${e.longitude?.toFixed(4)}\xb0`}return l("widgets.noDestination")})()})]}),(0,t.jsx)("button",{onClick:v,className:"text-hud-secondary hover:text-oRed transition-colors p-1",title:l("widgets.abortNavigation"),children:(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faTimes,className:"text-sm"})})]}),r?.activeRoute?.href&&(0,t.jsxs)("div",{className:"flex justify-center space-x-3 mt-4",children:[(0,t.jsxs)("button",{onClick:b,className:"bg-hud-elevated hover:bg-hud-bg text-hud-main px-4 py-1.5 rounded text-caption font-semibold uppercase tracking-widest transition-all shadow-soft",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faArrowLeft,className:"mr-2"}),l("widgets.previous")]}),(0,t.jsxs)("button",{onClick:w,className:"bg-oBlue hover:bg-oBlue/80 text-hud-main px-4 py-1.5 rounded text-caption font-semibold uppercase tracking-widest transition-all shadow-lg shadow-oBlue/20",children:[l("widgets.proceed"),(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faArrowRight,className:"ml-2"})]})]})]}),A&&(0,t.jsxs)("div",{className:`tesla-card px-3 py-2 mb-3 flex items-center justify-between ${"enabled"===A?"border-l-2 border-oGreen/30":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faRobot,className:`text-xs ${"enabled"===A?"text-oGreen":"text-hud-muted"}`}),(0,t.jsx)("span",{className:`text-caption font-semibold uppercase capitalize gliding-value ${"enabled"===A?"text-oGreen":"text-hud-secondary"}`,children:A})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-4 text-caption font-semibold uppercase",children:[(0,t.jsx)("span",{className:"text-hud-main capitalize gliding-value",children:R||"—"}),(0,t.jsx)("span",{className:"text-oYellow gliding-value",children:null!==P?`${Math.round((0,y.toDegrees)(P))}\xb0`:"—"})]})]}),O.hasData&&(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"tesla-card text-center tesla-hover ",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faRuler,className:"text-oGreen text-xs mb-2 opacity-50"}),(0,t.jsx)("div",{className:"text-hud-main text-value font-semibold gliding-value tracking-tight",children:null==(e=O.distance)?l("common.na"):e<1e3?`${Math.round(e)} m`:`${(0,y.convertDistanceUnit)(e)} ${(0,y.getDistanceUnitLabel)()}`}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption uppercase font-semibold mt-2 tracking-[0.2em]",children:l("widgets.distance")})]}),(0,t.jsxs)("div",{className:"tesla-card text-center tesla-hover ",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faCompass,className:"text-oBlue text-xs mb-2 opacity-50"}),(0,t.jsx)("div",{className:"text-hud-main text-value font-semibold gliding-value tracking-tight",children:null!==O.bearingTrue?`${Math.round((0,y.toDegrees)(O.bearingTrue))}\xb0`:l("common.na")}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption uppercase font-semibold mt-2 tracking-[0.2em]",children:l("widgets.bearing")})]}),(0,t.jsxs)("div",{className:"tesla-card text-center tesla-hover ",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faArrowRight,className:`${O.crossTrackError>50||O.crossTrackError<-50?"text-oRed animate-soft-pulse":"text-oGreen opacity-50"} text-xs mb-2`}),(0,t.jsx)("div",{className:"text-hud-main text-value font-semibold gliding-value tracking-tight",children:null!==O.crossTrackError?`${Math.abs(Math.round(O.crossTrackError))}m`:l("common.na")}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption uppercase font-semibold mt-2 tracking-[0.2em]",children:"XTE"})]}),(0,t.jsxs)("div",{className:"tesla-card text-center tesla-hover ",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faPlay,className:"text-oGreen text-xs mb-2 opacity-50"}),(0,t.jsxs)("div",{className:"text-hud-main text-value font-semibold gliding-value tracking-tight",children:[null!==O.velocityMadeGood?`${(0,y.convertSpeedUnit)(O.velocityMadeGood)}`:l("common.na"),(0,t.jsx)("span",{className:"text-caption text-hud-secondary ml-1",children:(0,y.getSpeedUnitLabel)()})]}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption uppercase font-semibold mt-2 tracking-[0.2em]",children:"VMG"})]}),null!==O.timeToGo&&(0,t.jsxs)("div",{className:"tesla-card text-center tesla-hover ",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faClock,className:"text-oGreen text-xs mb-2 opacity-50"}),(0,t.jsx)("div",{className:"text-hud-main text-value font-semibold gliding-value tracking-tight",children:(e=>{if(null==e)return l("common.na");let t=Math.floor(e/3600),a=Math.floor(e%3600/60);return t>0?`${t}h ${a}m`:`${a}m`})(O.timeToGo)}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption uppercase font-semibold mt-2 tracking-[0.2em]",children:"TTG"})]}),O.estimatedTimeOfArrival&&(0,t.jsxs)("div",{className:"tesla-card text-center tesla-hover ",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faClock,className:"text-oYellow text-xs mb-2 opacity-50"}),(0,t.jsx)("div",{className:"text-hud-main text-value font-semibold gliding-value tracking-tight",children:(s=O.estimatedTimeOfArrival)?new Date(s).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):l("common.na")}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption uppercase font-semibold mt-2 tracking-[0.2em]",children:"ETA"})]})]})]})]})}let $=a.default.memo(({children:e,widgetName:a,className:l="",fullscreenWidget:r,toggleFullscreen:o})=>(0,t.jsxs)(s.motion.div,{layout:!0,variants:{hidden:{opacity:0,y:20},show:{opacity:1,y:0}},transition:{duration:.5,ease:[.4,0,.2,1]},className:`relative group ${l}`,children:[e,(0,t.jsx)("button",{onClick:()=>o(a),className:"absolute top-3 right-3 opacity-0 group-hover:opacity-100 transition-all duration-500 bg-hud-bg backdrop-blur-md hover:bg-hud-elevated rounded-full w-8 h-8 flex items-center justify-center text-hud-muted hover:text-hud-main z-10 shadow-soft",title:r===a?"Exit fullscreen":"Fullscreen",children:(0,t.jsx)(n.FontAwesomeIcon,{icon:r===a?i.faCompress:i.faExpand,className:"text-xs"})})]}));$.displayName="WidgetWrapper";let F={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}};e.s(["default",0,function(){let[e,n]=(0,a.useState)(null),i=a.default.useCallback(e=>{n(t=>t===e?null:e)},[]),l=(a,s,n="")=>(0,t.jsx)($,{widgetName:a,fullscreenWidget:e,toggleFullscreen:i,className:e&&e!==a?"hidden":e===a?"w-full h-full":n,children:s});return(0,t.jsx)("div",{className:"flex flex-col h-full bg-rightPaneBg overflow-hidden",children:(0,t.jsx)("div",{className:"flex-1 p-4 min-h-0 overflow-auto scrollbar-hide",children:(0,t.jsxs)(s.motion.div,{variants:F,initial:"hidden",animate:"show",className:e?"flex h-full":"card-grid",children:[l("aisradar",(0,t.jsx)(f,{}),"sm:col-span-2 sm:row-span-2"),l("weather",(0,t.jsx)(N,{})),l("course",(0,t.jsx)(C,{children:(0,t.jsx)(W,{})})),l("tanks",(0,t.jsx)(v,{}))]})})})}],54784)},25294,function(e){e.n(e.i(54784))}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,54784,e=>{"use strict";var t=e.i(43476),a=e.i(71645),s=e.i(46932),n=e.i(49721),i=e.i(68757);e.i(85269);var l=e.i(62588),r=e.i(77291),o=e.i(83646),c=e.i(85709),d=e.i(83402);let u=({title:e,icon:s,iconClass:i="text-oBlue",action:l,className:r="",children:o,...c})=>(0,t.jsxs)("div",{className:`tesla-card flex flex-col min-w-0 ${r}`,...c,children:[(e||s||l)&&(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-3 shrink-0",children:[s&&(a.default.isValidElement(s)?(0,t.jsx)("span",{className:`${i} flex items-center`,children:s}):(0,t.jsx)(n.FontAwesomeIcon,{icon:s,className:`${i} text-sm opacity-80`})),e&&(0,t.jsx)("span",{className:"text-caption font-semibold uppercase tracking-widest text-hud-secondary truncate",children:e}),l&&(0,t.jsx)("div",{className:"ml-auto flex items-center gap-2",children:l})]}),o]}),m=({title:e,icon:a,iconColorClass:s="text-oBlue",hasData:n=!0,noDataMessage:i="No data available",children:l,className:r=""})=>{let o="function"==typeof a?a():a;return n?(0,t.jsx)(u,{title:e,icon:o,iconClass:s,className:`h-full overflow-hidden ${r}`,children:(0,t.jsx)("div",{className:"flex-1 flex flex-col justify-center min-h-0 overflow-hidden",children:l})}):(0,t.jsx)(u,{title:e,icon:o,iconClass:s,className:`h-full overflow-hidden ${r}`,children:(0,t.jsx)("div",{className:"flex-1 flex items-center justify-center min-h-0",children:(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("div",{className:"text-hero font-medium text-hud-dim mb-2",children:"N/A"}),(0,t.jsx)("div",{className:"text-caption font-semibold uppercase text-hud-muted",children:i})]})})})};var x=e.i(22831),h=e.i(20705);let p=[1,2,5,10,20],g={cardinal:"#f2c200",isolated_danger:"#e0483a",safe_water:"#f0f0f0",special_purpose:"#f2c200",station:"#8a9097"},f=a.default.memo(()=>{let e,{t:s}=(0,x.useTranslation)(),{targets:u,atons:f}=(0,l.useAIS)(),{statuses:v}=(0,r.default)({always:!0}),{scene:y,id:w}=(0,o.default)(),[b,N]=(0,a.useState)(5),j=d.default.get("debugMode"),k=(0,a.useCallback)(e=>{e.preventDefault(),N(t=>{let a=p.indexOf(t);return -1===a?t:e.deltaY<0&&a>0?p[a-1]:e.deltaY>0&&a<p.length-1?p[a+1]:t})},[]),C=(0,c.useSignalKPath)("navigation.position"),M=(0,c.useSignalKPath)("navigation.headingTrue"),S=(0,c.useSignalKPath)("navigation.headingMagnetic"),W=(0,c.useSignalKPath)("navigation.courseOverGroundTrue"),$=M??S??W??0,F=(0,a.useMemo)(()=>u.length&&C?u.filter(e=>e.distanceMeters&&e.distanceMeters<=1852*b).map(e=>{let t=e.distanceMeters/1852,a=((180*Math.atan2(e.sceneX,-e.sceneZ)/Math.PI+360)%360-180*$/Math.PI+360)%360,s=null===e.cpaMeters?null:e.cpaMeters/1852;return{id:e.mmsi,name:e.name||`MMSI ${e.mmsi}`,distance:Math.round(10*t)/10,bearing:Math.round(a),type:e.shipType||"unknown",cpa:null===s?null:Math.round(10*s)/10}}).sort((e,t)=>e.distance-t.distance).slice(0,10):[],[u,b,C,$]),T=(0,a.useMemo)(()=>f.length&&C?f.filter(e=>null!==e.distanceMeters&&e.distanceMeters<=1852*b).slice(0,40).map(e=>{let t=(180*Math.atan2(e.east,e.north)/Math.PI+360)%360;return{id:e.id,name:e.name||`MMSI ${e.mmsi||""}`,distance:e.distanceMeters/1852,bearing:(t-180*$/Math.PI+360)%360,colour:"night"===w?y.compass:(e=>{let{kind:t,category:a=""}=(0,h.atonKind)(e);return"lateral"===t?a.endsWith("starboard")?"#1fae5b":"#e0483a":g[t]||g.station})(e.atonType),virtual:e.virtual}}):[],[f,b,C,$,w,y.compass]),I={giveWay:y.vesselDanger,yields:y.vesselYields,close:y.vesselClose},D=e=>I[v[e.id]]||"var(--hud-text-secondary, #8a9097)",A=e=>"giveWay"===v[e.id]||"yields"===v[e.id],R=j||F.length>0||T.length>0;return(0,t.jsxs)(m,{title:s("widgets.aisTacticalRadar"),icon:i.faTowerBroadcast,hasData:R,noDataMessage:s("widgets.signalLossAIS"),children:[(0,t.jsx)("div",{className:"absolute top-4 right-4 z-10",children:(0,t.jsxs)("select",{value:b,onChange:e=>N(Number(e.target.value)),className:"bg-hud-elevated text-hud-secondary text-caption font-semibold uppercase tracking-widest rounded-sm px-3 py-1 border border-hud shadow-soft focus:outline-none focus:ring-1 focus:ring-oBlue/50 hover:bg-hud-bg hover:text-hud-main transition-all duration-500",children:[(0,t.jsx)("option",{value:1,children:"1 NM"}),(0,t.jsx)("option",{value:2,children:"2 NM"}),(0,t.jsx)("option",{value:5,children:"5 NM"}),(0,t.jsx)("option",{value:10,children:"10 NM"}),(0,t.jsx)("option",{value:20,children:"20 NM"})]})}),(0,t.jsxs)("div",{className:"flex-1 relative min-h-0 bg-hud-bg rounded-sm overflow-hidden border border-hud shadow-inner group mt-2",onWheel:k,children:[(0,t.jsxs)("svg",{className:"w-full h-full p-2 transition-transform duration-700 group-hover:scale-[1.02]",viewBox:"0 0 200 200",children:[[1,2,3,4].map(e=>(0,t.jsx)("circle",{cx:"100",cy:"100",r:20*e,fill:"none",stroke:"var(--color-oBlue)",strokeOpacity:"0.28",strokeWidth:"0.5"},e)),(0,t.jsx)("line",{x1:"100",y1:"20",x2:"100",y2:"180",stroke:"var(--color-oBlue)",strokeOpacity:"0.16",strokeWidth:"0.5"}),(0,t.jsx)("line",{x1:"20",y1:"100",x2:"180",y2:"100",stroke:"var(--color-oBlue)",strokeOpacity:"0.16",strokeWidth:"0.5"}),(0,t.jsxs)("g",{children:[(0,t.jsx)("line",{x1:"100",y1:"100",x2:"100",y2:"20",stroke:"var(--color-oGreen)",strokeWidth:"1",strokeOpacity:"0.4"}),(0,t.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 100 100",to:"360 100 100",dur:"3s",repeatCount:"indefinite"})]}),T.map(e=>{let a=e.distance/b*80,s=100+a*Math.cos((e.bearing-90)*Math.PI/180),n=100+a*Math.sin((e.bearing-90)*Math.PI/180);return(0,t.jsx)("polygon",{points:`${s},${n-2.6} ${s+2},${n} ${s},${n+2.6} ${s-2},${n}`,fill:e.virtual?"none":e.colour,stroke:e.colour,strokeWidth:e.virtual?.7:.4,strokeDasharray:e.virtual?"1 0.6":void 0,opacity:"0.9",children:(0,t.jsx)("title",{children:e.virtual?`${e.name} (V-AIS)`:e.name})},e.id)}),(e=[],F.map(t=>{let a=t.distance/b*80,s=100+a*Math.cos((t.bearing-90)*Math.PI/180),n=100+a*Math.sin((t.bearing-90)*Math.PI/180),i=n-5;for(;e.some(e=>26>Math.abs(e.x-s)&&6>Math.abs(e.y-i));)i+=6;return e.push({x:s,y:i}),{target:t,x:s,y:n,ly:i}})).map(({target:e,x:a,y:s,ly:n})=>{let i=A(e);return(0,t.jsxs)("g",{className:i?"animate-soft-pulse":"",children:[(0,t.jsx)("circle",{cx:a,cy:s,r:i?"3":"2",fill:D(e),className:"transition-all duration-1000"}),(0,t.jsx)("text",{x:a+5,y:n,fill:"currentColor",fontSize:"5",className:"font-black pointer-events-none uppercase tracking-tighter opacity-60 text-hud-main",children:e.name.substring(0,8)})]},e.id)}),(0,t.jsx)("polygon",{points:"100,95 105,105 100,102 95,105",fill:"var(--color-oBlue)",stroke:"currentColor",strokeWidth:"0.5",opacity:"0.8",className:"text-hud-main"})]}),(0,t.jsxs)("div",{className:"absolute top-2 left-2 text-caption text-hud-muted font-semibold pointer-events-none uppercase tracking-widest space-y-1",children:[(0,t.jsxs)("div",{className:"bg-hud-bg/40 px-1.5 py-0.5 rounded-sm",children:[s("widgets.range")," ",b," NM"]}),(0,t.jsxs)("div",{className:"bg-hud-bg/40 px-1.5 py-0.5 rounded-sm",children:[s("widgets.targets")," ",F.length]})]})]}),F.length>0&&(0,t.jsxs)("div",{className:"mt-4 space-y-2",children:[(0,t.jsx)("div",{className:"text-caption text-hud-muted font-semibold uppercase tracking-[0.2em] px-1",children:s("widgets.tacticalAnalysis")}),F.slice(0,2).map(e=>{let a;return(0,t.jsxs)("div",{className:"flex items-center justify-between text-caption tesla-card px-3 py-2 tesla-hover",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3 min-w-0",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:30===(a=Number(e.type))||a>=70&&a<=89?i.faShip:i.faLocationDot,style:{color:D(e)},className:`text-xs opacity-80 ${A(e)?"animate-soft-pulse":""}`}),(0,t.jsx)("span",{className:"text-hud-main truncate font-black uppercase tracking-tight",children:e.name})]}),(0,t.jsxs)("div",{className:"flex space-x-4 text-hud-secondary font-black tracking-tighter",children:[(0,t.jsxs)("span",{className:"gliding-value",children:[e.distance.toFixed(1)," NM"]}),(0,t.jsxs)("span",{className:"gliding-value",style:{color:D(e)},children:["CPA: ",null===e.cpa?"--":e.cpa.toFixed(1)]})]})]},e.id)})]})]})});function v(){let{t:e}=(0,x.useTranslation)(),s=(0,c.useSignalKPaths)(["tanks.fuel.0.currentLevel","tanks.fuel.0.capacity","tanks.fuel.0.name","tanks.fuel.0.type","tanks.fuel.0.temperature","tanks.freshWater.0.currentLevel","tanks.freshWater.0.capacity","tanks.freshWater.0.name","tanks.freshWater.0.type","tanks.freshWater.0.temperature","tanks.wasteWater.0.currentLevel","tanks.wasteWater.0.capacity","tanks.wasteWater.0.name","tanks.wasteWater.0.type","tanks.wasteWater.0.temperature","tanks.blackWater.0.currentLevel","tanks.blackWater.0.capacity","tanks.blackWater.0.name","tanks.blackWater.0.type","tanks.blackWater.0.temperature","tanks.oil.0.currentLevel","tanks.oil.0.capacity","tanks.oil.0.name","tanks.oil.0.type","tanks.oil.0.temperature"]),l=(0,a.useMemo)(()=>{let t=(e,t,a,n,i)=>({level:s[`tanks.${e}.0.currentLevel`]??null,capacity:s[`tanks.${e}.0.capacity`]??null,tankName:s[`tanks.${e}.0.name`],tankType:s[`tanks.${e}.0.type`],temperature:s[`tanks.${e}.0.temperature`],icon:a,color:n,bgColor:i,displayName:t}),a={fuel:t("fuel",e("widgets.tankFuel"),i.faGasPump,"text-oYellow","bg-oYellow"),freshWater:t("freshWater",e("widgets.tankFreshWater"),i.faTint,"text-oBlue","bg-oBlue"),wasteWater:t("wasteWater",e("widgets.tankWasteWater"),i.faToilet,"text-hud-secondary","bg-hud-elevated"),blackWater:t("blackWater",e("widgets.tankBlackWater"),i.faToilet,"text-hud-secondary","bg-hud-elevated"),oil:t("oil",e("widgets.tankEngineOil"),i.faOilCan,"text-oYellow","bg-oYellow")};return{hasData:Object.values(a).some(e=>null!==e.level),...a}},[s,e]);return(0,t.jsx)(m,{title:e("widgets.storageSystems"),icon:i.faGasPump,hasData:l.hasData,noDataMessage:e("widgets.signalLossLevelSensors"),children:(0,t.jsx)("div",{className:"flex-1 flex flex-col justify-center min-h-0 space-y-4",children:Object.entries(l).filter(([e])=>"hasData"!==e).map(([e,a])=>{if(null===a.level)return null;let s=Math.round(100*a.level),i=Number.isFinite(a.capacity)?Math.round(1e3*a.capacity):null,l=null!==i?Math.round(a.level*i):null,r="wasteWater"===e||"blackWater"===e,o=r?a.level>.8:a.level<.1;return(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,t.jsx)("div",{className:"flex items-center justify-center w-6 h-6 bg-hud-elevated rounded-full",children:(0,t.jsx)(n.FontAwesomeIcon,{icon:a.icon,className:`${a.color} text-xs opacity-80`})}),(0,t.jsx)("span",{className:"text-hud-main text-caption font-semibold uppercase tracking-widest whitespace-nowrap",children:a.displayName})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-4",children:[null!==i&&(0,t.jsxs)("span",{className:"text-hud-secondary text-caption font-semibold opacity-60 tabular-nums whitespace-nowrap",children:[l,"/",i," L"]}),(0,t.jsxs)("span",{className:`text-label font-semibold ${((e,t=!1)=>t?e>.8?"text-oRed":e>.6?"text-oYellow":"text-oGreen":e<.1?"text-oRed":e<.25?"text-oYellow":"text-oGreen")(a.level,r)} ${o?"animate-soft-pulse":""}`,children:[s,"%"]})]})]}),(0,t.jsx)("div",{className:"bg-hud-elevated rounded-full h-1.5 overflow-hidden shadow-inner",children:(0,t.jsx)("div",{className:`h-full transition-all duration-1000 ${r?a.level>.8?"bg-oRed":a.level>.6?"bg-oYellow":"bg-oGreen":a.level<.1?"bg-oRed":a.level<.25?"bg-oYellow":"bg-oGreen"}`,style:{width:`${s}%`}})})]},e)})})})}f.displayName="AISRadarWidget";var y=e.i(46991),w=e.i(83934),b=e.i(95430);function N(){let{t:e}=(0,x.useTranslation)(),s=d.default.get("debugMode"),{forecasts:l,isLoading:r,weatherApiAvailable:o,fetchWeatherForecast:c,getCurrentWeather:u}=(0,w.useWeather)(),h=(0,a.useMemo)(()=>{let e=u(),t=(0,y.convertTemperatureUnit)(e.temperature),a=null!==(0,y.finite)(e.humidity)?Math.round(100*e.humidity):null,n=null!==(0,y.convertPressure)(e.pressure)?Math.round(e.pressure/100):null,i=(0,y.convertSpeedUnit)(e.windSpeed),r=(0,y.toDegrees)(e.windDirection),o=e.description,c=e.source,d=null!==t||null!==a||null!==n||null!==i;if(!d&&!s)return{hasData:!1,dataSource:null};let m=t,x=a,h=n,p=i,g=r;!d&&s&&(m=15,x=65,h=1013,p=5.2,g=120,c="debug");let f="sunny";if(o){let e=o.toLowerCase();e.includes("rain")||e.includes("shower")?f="rainy":e.includes("snow")?f="snow":e.includes("partly")||e.includes("few clouds")||e.includes("scattered")?f="partly-cloudy":e.includes("cloud")||e.includes("overcast")?f="cloudy":(e.includes("clear")||e.includes("sun"))&&(f="sunny")}else h&&(f=h<1e3?x&&x>80?"rainy":"cloudy":h>1020?"sunny":"partly-cloudy");return{hasData:!0,dataSource:c,description:o,temperature:m,humidity:x,pressure:h,windSpeed:p,windDirection:g,condition:f,forecast:l}},[u,l,s]),p=e=>{switch(e){case"sunny":return i.faSun;case"partly-cloudy":default:return i.faCloudSun;case"cloudy":return i.faCloud;case"rainy":return i.faCloudRain;case"heavy-rain":return i.faCloudShowersHeavy;case"snow":return i.faSnowflake}},g=e=>{switch(e){case"sunny":return"text-oYellow";case"partly-cloudy":case"rainy":case"heavy-rain":default:return"text-oBlue";case"cloudy":return"text-hud-muted";case"snow":return"text-hud-main"}},f=e=>null===(0,y.finite)(e)?"":["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][(Math.round(e/22.5)%16+16)%16];return(0,t.jsxs)(m,{title:e("widgets.meteorologicalData"),icon:p(h.condition),hasData:h.hasData,noDataMessage:r?e("widgets.acquiringSatellite"):e("widgets.signalLossWeather"),children:[(0,t.jsxs)("div",{className:"absolute top-4 right-4 z-10 flex items-center space-x-3",children:[h.dataSource&&(0,t.jsx)("span",{className:`text-caption px-2 py-0.5 rounded-sm uppercase font-semibold tracking-widest text-hud-main shadow-soft ${"sensors"===h.dataSource?"bg-oGreen/40 border border-oGreen/30":"forecast"===h.dataSource?"bg-oBlue/40 border border-oBlue/30":"bg-hud-elevated border border-hud"}`,children:(()=>{switch(h.dataSource){case"sensors":return e("widgets.dataSourceLive");case"forecast":return e("widgets.dataSourceForecast");case"debug":return e("widgets.dataSourceDemo");default:return""}})()}),!1!==o&&(0,t.jsx)("button",{onClick:c,disabled:r,className:"w-7 h-7 rounded-full bg-hud-elevated flex items-center justify-center text-hud-secondary hover:text-hud-main transition-all duration-500 tesla-hover",title:e("widgets.updateForecast"),children:(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faSync,className:`text-xs ${r?"animate-spin":""}`})})]}),(0,t.jsxs)("div",{className:"flex-1 flex flex-col min-h-0",children:[(0,t.jsx)("div",{className:"flex-1 flex flex-col justify-center",children:(0,t.jsxs)("div",{className:"text-center mb-6 group",children:[(0,t.jsx)("div",{className:`text-hero mb-4 transition-transform duration-700 group-hover:scale-110 ${g(h.condition)}`,children:(0,t.jsx)(n.FontAwesomeIcon,{icon:p(h.condition),className:"sunny"!==h.condition?"animate-soft-pulse":""})}),(0,t.jsx)("div",{className:"text-hero font-medium text-hud-main leading-none gliding-value tracking-tight",children:null!==h.temperature?`${h.temperature}${(0,y.getTemperatureUnitLabel)()}`:e("common.na")}),(0,t.jsx)("div",{className:"text-caption font-semibold text-hud-secondary uppercase tracking-[0.3em] mt-3 opacity-60",children:h.description||(t=>{switch(t){case"sunny":return e("widgets.clearSkies");case"partly-cloudy":return e("widgets.partlyCloudy");case"cloudy":return e("widgets.overcast");case"rainy":return e("widgets.lightRain");case"heavy-rain":return e("widgets.heavyRain");case"snow":return e("widgets.snow");default:return e("widgets.variable")}})(h.condition)})]})}),h.forecast&&h.forecast.length>1&&(0,t.jsx)("div",{className:"space-y-2 shrink-0",children:h.forecast.slice(1,4).map((e,a)=>{let s=new Date(e.date?e.date:(0,b.vesselNow)().getTime()+(a+1)*864e5),l=isNaN(s.getTime())?e.time||`+${a+1}d`:s.toLocaleDateString("en-GB",{weekday:"short"}),r=e.description?e.description.toLowerCase().includes("rain")?"rainy":e.description.toLowerCase().includes("cloud")?"cloudy":e.description.toLowerCase().includes("snow")?"snow":"sunny":"partly-cloudy",o=null!==(0,y.finite)(e.wind?.speed)?Math.round(10*e.wind.speed)/10:null,c=f(e.wind?.direction)||null;return(0,t.jsxs)("div",{className:"flex items-center justify-between py-1.5 border-b border-hud/30 last:border-0",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,t.jsx)("span",{className:"text-hud-muted text-caption font-semibold uppercase tracking-widest w-8",children:l}),(0,t.jsx)(n.FontAwesomeIcon,{icon:p(r),className:`text-sm w-5 ${g(r)}`}),(0,t.jsx)("span",{className:"text-hud-main text-label font-semibold gliding-value w-8",children:null!==e.temperature?`${Math.round(e.temperature)}\xb0`:"--"})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faWind,className:"text-oBlue text-xs opacity-50"}),(0,t.jsx)("span",{className:"text-hud-main text-caption font-semibold gliding-value",children:null!==o?`${o} ${(0,y.getSpeedUnitLabel)()}`:"--"}),c&&(0,t.jsx)("span",{className:"text-hud-muted text-caption font-semibold tracking-widest opacity-60",children:c})]})]},a)})}),(0,t.jsxs)("div",{className:"flex items-center justify-between shrink-0 mt-2",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faWind,className:"text-oBlue text-sm opacity-50"}),(0,t.jsx)("span",{className:"text-hud-secondary text-caption uppercase font-semibold tracking-widest",children:e("widgets.now")})]}),(0,t.jsxs)("div",{className:"text-right",children:[(0,t.jsx)("span",{className:"text-hud-main text-label font-semibold gliding-value tracking-tight",children:null!==h.windSpeed?`${h.windSpeed} ${(0,y.getSpeedUnitLabel)()}`:e("common.na")}),(0,t.jsx)("span",{className:"text-hud-muted text-caption uppercase font-semibold tracking-widest ml-2 opacity-60",children:null!==h.windDirection?f(h.windDirection):""})]})]})]})]})}var j=e.i(66799);let k=(0,a.createContext)(),C=({children:e})=>{let[s,n]=(0,a.useState)({}),[i,l]=(0,a.useState)({}),[r,o]=(0,a.useState)({}),[c,d]=(0,a.useState)(!1),[u,m]=(0,a.useState)(null),[x,h]=(0,a.useState)(null),[p,g]=(0,a.useState)(null),[f,v]=(0,a.useState)(!1),[y,w]=(0,a.useState)(null),b=(0,a.useRef)(null),N=(0,a.useRef)(null),C=(0,a.useCallback)(async()=>{d(!0),m(null);try{let[e,t,a]=await Promise.all([j.default.getRoutes().catch(e=>("NetworkError"!==e.name&&console.error("NavigationContext: Failed to fetch routes:",e),{})),j.default.getWaypoints().catch(e=>("NetworkError"!==e.name&&console.error("NavigationContext: Failed to fetch waypoints:",e),{})),j.default.getCharts().catch(e=>("NetworkError"!==e.name&&console.error("NavigationContext: Failed to fetch charts:",e),{}))]);n(e||{}),l(t||{}),o(a||{})}catch(e){"NetworkError"!==e.name&&(console.error("NavigationContext: Failed to fetch resources:",e),m(e.message))}finally{d(!1)}},[]),M=(0,a.useCallback)(async()=>{try{let e=await j.default.getRoutes();return n(e||{}),e}catch(e){throw console.error("NavigationContext: Failed to fetch routes:",e),e}},[]),S=(0,a.useCallback)(async()=>{try{let e=await j.default.getWaypoints();return l(e||{}),e}catch(e){throw console.error("NavigationContext: Failed to fetch waypoints:",e),e}},[]),W=(0,a.useCallback)(async()=>{try{let e=await j.default.getCourse().catch(()=>null),t=e?.nextPoint||e?.activeRoute?await j.default.getCourseCalculations().catch(()=>null):null;h(e),g(t)}catch(e){console.error("NavigationContext: Failed to fetch course:",e),w(e.message)}},[]),$=(0,a.useCallback)(async e=>{v(!0),w(null);try{await j.default.setDestinationWaypoint(e),await W()}catch(e){throw console.error("NavigationContext: Failed to set waypoint destination:",e),w(e.message),e}finally{v(!1)}},[W]),F=(0,a.useCallback)(async(e,t)=>{v(!0),w(null);try{await j.default.setDestinationPosition(e,t),await W()}catch(e){throw console.error("NavigationContext: Failed to set position destination:",e),w(e.message),e}finally{v(!1)}},[W]),T=(0,a.useCallback)(async(e,t=0,a=!1)=>{v(!0),w(null);try{await j.default.activateRoute(e,t,a),await W()}catch(e){throw console.error("NavigationContext: Failed to activate route:",e),w(e.message),e}finally{v(!1)}},[W]),I=(0,a.useCallback)(async()=>{v(!0),w(null);try{await j.default.clearCourse(),h(null),g(null)}catch(e){throw console.error("NavigationContext: Failed to clear course:",e),w(e.message),e}finally{v(!1)}},[]),D=(0,a.useCallback)(async()=>{try{await j.default.nextWaypoint(),await W()}catch(e){throw console.error("NavigationContext: Failed to go to next waypoint:",e),e}},[W]),A=(0,a.useCallback)(async()=>{try{await j.default.previousWaypoint(),await W()}catch(e){throw console.error("NavigationContext: Failed to go to previous waypoint:",e),e}},[W]),R=(0,a.useCallback)(async(e,t,a,s="")=>{try{let n=j.default.generateUUID(),i=j.default.createWaypointFeature(t,e,a,s);return await j.default.saveWaypoint(n,i),await S(),n}catch(e){throw console.error("NavigationContext: Failed to create waypoint:",e),e}},[S]),P=(0,a.useCallback)(async e=>{try{await j.default.deleteWaypoint(e),await S()}catch(e){throw console.error("NavigationContext: Failed to delete waypoint:",e),e}},[S]),G=(0,a.useCallback)(async(e,t,a="")=>{try{let s=j.default.generateUUID(),n=e.map(e=>[e.longitude,e.latitude]),i=j.default.createRouteFeature(n,t,a);return await j.default.saveRoute(s,i),await M(),s}catch(e){throw console.error("NavigationContext: Failed to create route:",e),e}},[M]),L=(0,a.useCallback)(async e=>{try{await j.default.deleteRoute(e),await M()}catch(e){throw console.error("NavigationContext: Failed to delete route:",e),e}},[M]),E=(0,a.useCallback)(e=>{let t=s[e];return t?j.default.parseRouteCoordinates(t):[]},[s]),B=(0,a.useCallback)(e=>{let t=i[e];return t?j.default.parseWaypointPosition(t):null},[i]),O=(0,a.useCallback)(()=>Object.entries(s).map(([e,t])=>({id:e,name:t.name||"Unnamed Route",description:t.description||"",pointCount:t.feature?.geometry?.coordinates?.length||0})),[s]),Y=(0,a.useCallback)(()=>Object.entries(i).map(([e,t])=>{let a=j.default.parseWaypointPosition(t);return{id:e,name:t.name||"Unnamed Waypoint",description:t.description||"",latitude:a?.latitude,longitude:a?.longitude}}),[i]),U=(0,a.useCallback)(()=>x?.nextPoint?.position!=null||x?.activeRoute?.href!=null,[x]),K=(0,a.useCallback)(()=>x?{position:x.nextPoint?.position,waypointHref:x.nextPoint?.href,routeHref:x.activeRoute?.href,pointIndex:x.activeRoute?.pointIndex,isRoute:!!x.activeRoute?.href,arrivalCircle:x.arrivalCircle}:null,[x]);(0,a.useEffect)(()=>(C(),W(),b.current=setInterval(()=>{W()},5e3),N.current=setInterval(()=>{C()},3e5),()=>{b.current&&clearInterval(b.current),N.current&&clearInterval(N.current)}),[C,W]);let z=(0,a.useMemo)(()=>({routes:s,waypoints:i,charts:r,isLoadingResources:c,resourcesError:u,activeCourse:x,courseCalculations:p,isLoadingCourse:f,courseError:y,fetchResources:C,fetchRoutes:M,fetchWaypoints:S,fetchCourse:W,navigateToWaypoint:$,navigateToPosition:F,activateRoute:T,clearCourse:I,goToNextWaypoint:D,goToPreviousWaypoint:A,createWaypoint:R,deleteWaypoint:P,createRoute:G,deleteRoute:L,getRouteCoordinates:E,getWaypointPosition:B,getRoutesList:O,getWaypointsList:Y,hasActiveDestination:U,getDestinationInfo:K}),[s,i,r,c,u,x,p,f,y,C,M,S,W,$,F,T,I,D,A,R,P,G,L,E,B,O,Y,U,K]);return(0,t.jsx)(k.Provider,{value:z,children:e})};e.i(67561);var M=e.i(37256);let S=(0,M.coursePaths)("distance","bearingTrue","crossTrackError","velocityMadeGood");function W(){var e,s;let{t:l}=(0,x.useTranslation)(),{activeCourse:r,courseCalculations:o,waypoints:u,routes:h,isLoadingCourse:p,navigateToWaypoint:g,activateRoute:f,clearCourse:v,goToNextWaypoint:w,goToPreviousWaypoint:b,getWaypointsList:N,getRoutesList:j,hasActiveDestination:C}=(()=>{let e=(0,a.useContext)(k);if(!e)throw Error("useNavigation must be used within a NavigationContextProvider");return e})(),W=d.default.get("debugMode"),$=(0,c.useSignalKPaths)(S),F=(0,M.courseValue)($,"distance"),T=(0,M.courseValue)($,"bearingTrue"),I=(0,M.courseValue)($,"crossTrackError"),D=(0,M.courseValue)($,"velocityMadeGood"),A=(0,c.useSignalKPath)("steering.autopilot.state"),R=(0,c.useSignalKPath)("steering.autopilot.mode"),P=(0,c.useSignalKPath)("steering.autopilot.target.headingTrue"),[G,L]=(0,a.useState)(!1),[E,B]=(0,a.useState)(!1),O=a.default.useMemo(()=>{let e=o||{},t=F??e.distance??null,a=T??e.bearingTrue??null;return null!==t||null!==a||W?{hasData:!0,distance:t??(W?5e3:null),bearingTrue:a??(W?.52:null),bearingMagnetic:e.bearingMagnetic??null,crossTrackError:I??e.crossTrackError??(W?50:null),velocityMadeGood:D??e.velocityMadeGood??(W?5.5:null),timeToGo:e.timeToGo??null,estimatedTimeOfArrival:e.estimatedTimeOfArrival??null,calcMethod:e.calcMethod}:{hasData:!1}},[o,F,T,I,D,W]),Y=async e=>{try{await g(e),L(!1)}catch(e){console.error("Failed to navigate to waypoint:",e)}},U=async e=>{try{await f(e),B(!1)}catch(e){console.error("Failed to activate route:",e)}},K=N(),z=j(),V=C();return(0,t.jsxs)(m,{title:l("widgets.course"),icon:i.faRoute,iconColorClass:"text-oGreen",hasData:O.hasData||V||K.length>0||z.length>0,noDataMessage:l("widgets.noCourseData"),children:[(0,t.jsxs)("div",{className:"absolute top-4 right-4 z-10 flex space-x-2",children:[(0,t.jsx)("button",{onClick:()=>{L(!G),B(!1)},className:`w-8 h-8 rounded-full flex items-center justify-center transition-all duration-500 shadow-soft ${G?"bg-oGreen text-hud-main":"bg-hud-elevated text-hud-secondary tesla-hover"}`,title:l("widgets.waypoints"),children:(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faLocationDot,className:"text-xs"})}),(0,t.jsx)("button",{onClick:()=>{B(!E),L(!1)},className:`w-8 h-8 rounded-full flex items-center justify-center transition-all duration-500 shadow-soft ${E?"bg-oGreen text-hud-main":"bg-hud-elevated text-hud-secondary tesla-hover"}`,title:l("widgets.routes"),children:(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faList,className:"text-xs"})})]}),(0,t.jsxs)("div",{className:"flex-1 flex flex-col min-h-0",children:[G&&(0,t.jsxs)("div",{className:"mb-4 max-h-40 overflow-y-auto tesla-card space-y-1",children:[(0,t.jsx)("div",{className:"text-caption text-hud-muted mb-2 uppercase font-semibold tracking-[0.2em] px-2 pt-1",children:l("widgets.storedWaypoints")}),0===K.length?(0,t.jsx)("div",{className:"text-caption text-hud-secondary italic px-2 py-4 text-center font-semibold uppercase",children:l("widgets.noActiveNodes")}):K.map(e=>(0,t.jsxs)("button",{onClick:()=>Y(e.id),className:"w-full text-left p-2 tesla-hover rounded-sm text-caption text-hud-main flex items-center group font-semibold uppercase tracking-tight",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faLocationDot,className:"text-oYellow mr-3 text-xs opacity-50 group-hover:opacity-100"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]},e.id))]}),E&&(0,t.jsxs)("div",{className:"mb-4 max-h-40 overflow-y-auto tesla-card space-y-1",children:[(0,t.jsx)("div",{className:"text-caption text-hud-muted mb-2 uppercase font-semibold tracking-[0.2em] px-2 pt-1",children:l("widgets.missionRoutes")}),0===z.length?(0,t.jsx)("div",{className:"text-caption text-hud-secondary italic px-2 py-4 text-center font-semibold uppercase",children:l("widgets.noRoutesLoaded")}):z.map(e=>(0,t.jsxs)("button",{onClick:()=>U(e.id),className:"w-full text-left p-2 tesla-hover rounded-sm text-caption text-hud-main flex items-center justify-between group font-semibold uppercase tracking-tight",children:[(0,t.jsxs)("div",{className:"flex items-center",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faRoute,className:"text-oGreen mr-3 text-xs opacity-50 group-hover:opacity-100"}),(0,t.jsx)("span",{className:"truncate",children:e.name})]}),(0,t.jsxs)("span",{className:"text-caption text-hud-muted font-semibold",children:[e.pointCount," pts"]})]},e.id))]}),V&&(0,t.jsxs)("div",{className:"tesla-card bg-oYellow/5 mb-6 border-l-2 border-oYellow/30 animate-soft-pulse",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,t.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faCrosshairs,className:"text-oYellow text-sm"}),(0,t.jsx)("span",{className:"text-hud-main text-caption font-semibold uppercase tracking-widest truncate",children:(()=>{if(!r)return l("widgets.noDestination");if(r.activeRoute?.href){let e=h[r.activeRoute.href.split("/").pop()],t=r.activeRoute.pointIndex||0;return e?.name?`${e.name} (${t+1})`:l("widgets.activeRoute")}if(r.nextPoint?.href){let e=u[r.nextPoint.href.split("/").pop()];return e?.name||l("widgets.waypoint")}if(r.nextPoint?.position){let e=r.nextPoint.position;return`${e.latitude?.toFixed(4)}\xb0, ${e.longitude?.toFixed(4)}\xb0`}return l("widgets.noDestination")})()})]}),(0,t.jsx)("button",{onClick:v,className:"text-hud-secondary hover:text-oRed transition-colors p-1",title:l("widgets.abortNavigation"),children:(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faTimes,className:"text-sm"})})]}),r?.activeRoute?.href&&(0,t.jsxs)("div",{className:"flex justify-center space-x-3 mt-4",children:[(0,t.jsxs)("button",{onClick:b,className:"bg-hud-elevated hover:bg-hud-bg text-hud-main px-4 py-1.5 rounded text-caption font-semibold uppercase tracking-widest transition-all shadow-soft",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faArrowLeft,className:"mr-2"}),l("widgets.previous")]}),(0,t.jsxs)("button",{onClick:w,className:"bg-oBlue hover:bg-oBlue/80 text-hud-main px-4 py-1.5 rounded text-caption font-semibold uppercase tracking-widest transition-all shadow-lg shadow-oBlue/20",children:[l("widgets.proceed"),(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faArrowRight,className:"ml-2"})]})]})]}),A&&(0,t.jsxs)("div",{className:`tesla-card px-3 py-2 mb-3 flex items-center justify-between ${"enabled"===A?"border-l-2 border-oGreen/30":""}`,children:[(0,t.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faRobot,className:`text-xs ${"enabled"===A?"text-oGreen":"text-hud-muted"}`}),(0,t.jsx)("span",{className:`text-caption font-semibold uppercase capitalize gliding-value ${"enabled"===A?"text-oGreen":"text-hud-secondary"}`,children:A})]}),(0,t.jsxs)("div",{className:"flex items-center space-x-4 text-caption font-semibold uppercase",children:[(0,t.jsx)("span",{className:"text-hud-main capitalize gliding-value",children:R||"—"}),(0,t.jsx)("span",{className:"text-oYellow gliding-value",children:null!==P?`${Math.round((0,y.toDegrees)(P))}\xb0`:"—"})]})]}),O.hasData&&(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{className:"tesla-card text-center tesla-hover ",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faRuler,className:"text-oGreen text-xs mb-2 opacity-50"}),(0,t.jsx)("div",{className:"text-hud-main text-value font-semibold gliding-value tracking-tight",children:null==(e=O.distance)?l("common.na"):e<1e3?`${Math.round(e)} m`:`${(0,y.convertDistanceUnit)(e)} ${(0,y.getDistanceUnitLabel)()}`}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption uppercase font-semibold mt-2 tracking-[0.2em]",children:l("widgets.distance")})]}),(0,t.jsxs)("div",{className:"tesla-card text-center tesla-hover ",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faCompass,className:"text-oBlue text-xs mb-2 opacity-50"}),(0,t.jsx)("div",{className:"text-hud-main text-value font-semibold gliding-value tracking-tight",children:null!==O.bearingTrue?`${Math.round((0,y.toDegrees)(O.bearingTrue))}\xb0`:l("common.na")}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption uppercase font-semibold mt-2 tracking-[0.2em]",children:l("widgets.bearing")})]}),(0,t.jsxs)("div",{className:"tesla-card text-center tesla-hover ",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faArrowRight,className:`${O.crossTrackError>50||O.crossTrackError<-50?"text-oRed animate-soft-pulse":"text-oGreen opacity-50"} text-xs mb-2`}),(0,t.jsx)("div",{className:"text-hud-main text-value font-semibold gliding-value tracking-tight",children:null!==O.crossTrackError?`${Math.abs(Math.round(O.crossTrackError))}m`:l("common.na")}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption uppercase font-semibold mt-2 tracking-[0.2em]",children:"XTE"})]}),(0,t.jsxs)("div",{className:"tesla-card text-center tesla-hover ",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faPlay,className:"text-oGreen text-xs mb-2 opacity-50"}),(0,t.jsxs)("div",{className:"text-hud-main text-value font-semibold gliding-value tracking-tight",children:[null!==O.velocityMadeGood?`${(0,y.convertSpeedUnit)(O.velocityMadeGood)}`:l("common.na"),(0,t.jsx)("span",{className:"text-caption text-hud-secondary ml-1",children:(0,y.getSpeedUnitLabel)()})]}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption uppercase font-semibold mt-2 tracking-[0.2em]",children:"VMG"})]}),null!==O.timeToGo&&(0,t.jsxs)("div",{className:"tesla-card text-center tesla-hover ",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faClock,className:"text-oGreen text-xs mb-2 opacity-50"}),(0,t.jsx)("div",{className:"text-hud-main text-value font-semibold gliding-value tracking-tight",children:(e=>{if(null==e)return l("common.na");let t=Math.floor(e/3600),a=Math.floor(e%3600/60);return t>0?`${t}h ${a}m`:`${a}m`})(O.timeToGo)}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption uppercase font-semibold mt-2 tracking-[0.2em]",children:"TTG"})]}),O.estimatedTimeOfArrival&&(0,t.jsxs)("div",{className:"tesla-card text-center tesla-hover ",children:[(0,t.jsx)(n.FontAwesomeIcon,{icon:i.faClock,className:"text-oYellow text-xs mb-2 opacity-50"}),(0,t.jsx)("div",{className:"text-hud-main text-value font-semibold gliding-value tracking-tight",children:(s=O.estimatedTimeOfArrival)?new Date(s).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):l("common.na")}),(0,t.jsx)("div",{className:"text-hud-secondary text-caption uppercase font-semibold mt-2 tracking-[0.2em]",children:"ETA"})]})]})]})]})}let $=a.default.memo(({children:e,widgetName:a,className:l="",fullscreenWidget:r,toggleFullscreen:o})=>(0,t.jsxs)(s.motion.div,{layout:!0,variants:{hidden:{opacity:0,y:20},show:{opacity:1,y:0}},transition:{duration:.5,ease:[.4,0,.2,1]},className:`relative group ${l}`,children:[e,(0,t.jsx)("button",{onClick:()=>o(a),className:"absolute top-3 right-3 opacity-0 group-hover:opacity-100 transition-all duration-500 bg-hud-bg backdrop-blur-md hover:bg-hud-elevated rounded-full w-8 h-8 flex items-center justify-center text-hud-muted hover:text-hud-main z-10 shadow-soft",title:r===a?"Exit fullscreen":"Fullscreen",children:(0,t.jsx)(n.FontAwesomeIcon,{icon:r===a?i.faCompress:i.faExpand,className:"text-xs"})})]}));$.displayName="WidgetWrapper";let F={hidden:{opacity:0},show:{opacity:1,transition:{staggerChildren:.05}}};e.s(["default",0,function(){let[e,n]=(0,a.useState)(null),i=a.default.useCallback(e=>{n(t=>t===e?null:e)},[]),l=(a,s,n="")=>(0,t.jsx)($,{widgetName:a,fullscreenWidget:e,toggleFullscreen:i,className:e&&e!==a?"hidden":e===a?"w-full h-full":n,children:s});return(0,t.jsx)("div",{className:"flex flex-col h-full bg-rightPaneBg overflow-hidden",children:(0,t.jsx)("div",{className:"flex-1 p-4 min-h-0 overflow-auto scrollbar-hide",children:(0,t.jsxs)(s.motion.div,{variants:F,initial:"hidden",animate:"show",className:e?"flex h-full":"card-grid",children:[l("aisradar",(0,t.jsx)(f,{}),"sm:col-span-2 sm:row-span-2"),l("weather",(0,t.jsx)(N,{})),l("course",(0,t.jsx)(C,{children:(0,t.jsx)(W,{})})),l("tanks",(0,t.jsx)(v,{}))]})})})}],54784)},25294,function(e){e.n(e.i(54784))}]);
|
|
@@ -27,4 +27,4 @@
|
|
|
27
27
|
gl_FragColor = vec4(color, alpha);
|
|
28
28
|
#include <colorspace_fragment>
|
|
29
29
|
}
|
|
30
|
-
`,y=({points:e,width:n=2,color:o,glow:i,y:a=.05,opacity:s=1})=>{let u=(0,r.useMemo)(()=>new f.ShaderMaterial({uniforms:{uColor:{value:new f.Color},uGlow:{value:new f.Color},uTime:{value:0},uOpacity:{value:1}},vertexShader:M,fragmentShader:w,transparent:!0,depthWrite:!1,side:f.DoubleSide}),[]);(0,r.useEffect)(()=>{u.uniforms.uColor.value.set(o),u.uniforms.uGlow.value.set(i||o),u.uniforms.uOpacity.value=s},[u,o,i,s]),(0,r.useEffect)(()=>()=>u.dispose(),[u]),(0,x.useFrame)((e,t)=>{u.uniforms.uTime.value+=t});let l=(0,r.useMemo)(()=>{let t=e.length,r=new Float32Array(2*t*3),o=new Float32Array(2*t*2),i=new Float32Array(2*t),s=0,u=e.reduce((t,r,n)=>n?t+Math.hypot(r[0]-e[n-1][0],r[1]-e[n-1][1]):0,0)||1;for(let l=0;l<t;l++){let d=e[Math.max(0,l-1)],p=e[Math.min(t-1,l+1)],c=p[0]-d[0],h=p[1]-d[1],f=Math.hypot(c,h)||1;c/=f,h/=f,l>0&&(s+=Math.hypot(e[l][0]-e[l-1][0],e[l][1]-e[l-1][1]));let m=-h*n/2,g=c*n/2;r.set([e[l][0]+m,a,e[l][1]+g,e[l][0]-m,a,e[l][1]-g],6*l),o.set([0,s/u,1,s/u],4*l),i.set([s,s],2*l)}let l=[];for(let e=0;e<t-1;e++){let t=2*e;l.push(t,t+1,t+2,t+1,t+3,t+2)}let d=new f.BufferGeometry;return d.setAttribute("position",new f.BufferAttribute(r,3)),d.setAttribute("uv",new f.BufferAttribute(o,2)),d.setAttribute("aAlong",new f.BufferAttribute(i,1)),d.setIndex(l),d},[e,n,a]);return((0,r.useEffect)(()=>()=>l.dispose(),[l]),e.length<2)?null:(0,t.jsx)("mesh",{geometry:l,material:u,renderOrder:2})};var b=e.i(76247),T=e.i(
|
|
30
|
+
`,y=({points:e,width:n=2,color:o,glow:i,y:a=.05,opacity:s=1})=>{let u=(0,r.useMemo)(()=>new f.ShaderMaterial({uniforms:{uColor:{value:new f.Color},uGlow:{value:new f.Color},uTime:{value:0},uOpacity:{value:1}},vertexShader:M,fragmentShader:w,transparent:!0,depthWrite:!1,side:f.DoubleSide}),[]);(0,r.useEffect)(()=>{u.uniforms.uColor.value.set(o),u.uniforms.uGlow.value.set(i||o),u.uniforms.uOpacity.value=s},[u,o,i,s]),(0,r.useEffect)(()=>()=>u.dispose(),[u]),(0,x.useFrame)((e,t)=>{u.uniforms.uTime.value+=t});let l=(0,r.useMemo)(()=>{let t=e.length,r=new Float32Array(2*t*3),o=new Float32Array(2*t*2),i=new Float32Array(2*t),s=0,u=e.reduce((t,r,n)=>n?t+Math.hypot(r[0]-e[n-1][0],r[1]-e[n-1][1]):0,0)||1;for(let l=0;l<t;l++){let d=e[Math.max(0,l-1)],p=e[Math.min(t-1,l+1)],c=p[0]-d[0],h=p[1]-d[1],f=Math.hypot(c,h)||1;c/=f,h/=f,l>0&&(s+=Math.hypot(e[l][0]-e[l-1][0],e[l][1]-e[l-1][1]));let m=-h*n/2,g=c*n/2;r.set([e[l][0]+m,a,e[l][1]+g,e[l][0]-m,a,e[l][1]-g],6*l),o.set([0,s/u,1,s/u],4*l),i.set([s,s],2*l)}let l=[];for(let e=0;e<t-1;e++){let t=2*e;l.push(t,t+1,t+2,t+1,t+3,t+2)}let d=new f.BufferGeometry;return d.setAttribute("position",new f.BufferAttribute(r,3)),d.setAttribute("uv",new f.BufferAttribute(o,2)),d.setAttribute("aAlong",new f.BufferAttribute(i,1)),d.setIndex(l),d},[e,n,a]);return((0,r.useEffect)(()=>()=>l.dispose(),[l]),e.length<2)?null:(0,t.jsx)("mesh",{geometry:l,material:u,renderOrder:2})};var b=e.i(76247),T=e.i(43758);let j=35*Math.PI/180,P=({rudder:e=0,speed:t=0,seconds:r=20,current:n=null,wind:o=null,steps:i=48})=>{let a=Math.tan(Math.max(-j,Math.min(j,e||0)))/4.2,s=0,u=0;if(n&&Number.isFinite(n.set)&&Number.isFinite(n.drift)&&(s+=n.drift*Math.sin(n.set),u-=n.drift*Math.cos(n.set)),o&&Number.isFinite(o.angle)&&Number.isFinite(o.speed)){let e=.035*o.speed;s-=e*Math.sin(o.angle),u+=e*Math.cos(o.angle)}let l=r/i,d=0,p=0,c=0,h=[[0,0]];for(let e=0;e<i;e++)d+=(t*Math.sin(c)+s)*l,p+=(-t*Math.cos(c)+u)*l,c+=t*a*l,h.push([d,p]);return h};var S=e.i(539);let O=[0,30,12],I=[0,-3,-2],A=["steering.rudderAngle","navigation.speedThroughWater","navigation.speedOverGround","propulsion.0.transmission.gear","propulsion.main.transmission.gear","propulsion.port.transmission.gear","environment.current","environment.wind.speedTrue","environment.wind.angleTrueWater","navigation.headingTrue","navigation.courseOverGroundTrue"];e.s(["default",0,({onUpdateInfoPanel:e})=>{let{scene:c,accent:h}=(0,d.default)(),f=(0,r.useRef)(),m=(0,l.useSignalKPaths)(A),g=m["steering.rudderAngle"]??0,x=Math.abs(m["navigation.speedThroughWater"]??m["navigation.speedOverGround"]??0),M=m["propulsion.0.transmission.gear"]??m["propulsion.main.transmission.gear"]??m["propulsion.port.transmission.gear"],w=-1===M||"string"==typeof M&&M.trim().toLowerCase().startsWith("rev"),j=m["navigation.headingTrue"]??m["navigation.courseOverGroundTrue"],G=m["environment.current"],R=m["environment.wind.speedTrue"],W=m["environment.wind.angleTrueWater"],{path:z,noDrift:B}=(0,r.useMemo)(()=>{let e=w?-x:x,t=G&&Number.isFinite(j)?{set:(0,S.wrapPi)((G.setTrue??0)-j),drift:G.drift??0}:null,r=Number.isFinite(R)&&Number.isFinite(W)?{angle:W,speed:R}:null,n=(w?1:-1)*5.4,o=([e,t])=>[.5*e,(t+n)*.5];return{path:P({rudder:g,speed:e,seconds:20,current:t,wind:r}).map(o),noDrift:P({rudder:g,speed:e,seconds:20}).map(o)}},[g,x,w,j,G,R,W]);return(0,t.jsxs)(r.Suspense,{fallback:(0,t.jsx)(o.Html,{center:!0,children:"Loading..."}),children:[(0,t.jsx)(n.PerspectiveCamera,{makeDefault:!0,fov:50,near:1,far:1e3,position:O}),(0,t.jsx)(i.default,{home:O,homeTarget:I,enableZoom:!0,enableRotate:!0,maxPolarAngle:Math.PI/2.4,minPolarAngle:0}),(0,t.jsx)(s.default,{fogNear:120,fogFar:400}),(0,t.jsxs)("group",{position:[0,-3,0],children:[(0,t.jsx)(u.default,{}),(0,t.jsx)(b.default,{scale:.5}),(0,t.jsx)(a.default,{position:[0,0,0],scale:[.5,.5,.5],ref:f,showSail:!1,onUpdateInfoPanel:e}),(0,t.jsx)(y,{points:z,width:1.95,color:h,glow:c.routeGlow}),(0,t.jsx)(T.default,{points:B.map(([e,t])=>[e,.06,t]),color:c.compassDim,lineWidth:1.5,dashed:!0,dashSize:.6,gapSize:.5}),(0,t.jsx)(p.default,{outerRadius:5}),(0,t.jsx)(v,{outerRadius:5})]})]})}],35235)},27404,function(e){e.n(e.i(35235))},76247,37369,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(43758),o=e.i(83646),i=e.i(78461);let a={type:"bow",side:"starboard",pose:null,source:"virtual"},s=new Set,u=()=>a,l=e=>{a={...a,...e},s.forEach(e=>e())},d=e=>(s.add(e),()=>s.delete(e)),p=()=>(0,r.useSyncExternalStore)(d,u,u),c=(e,t,r=a.type,n=22)=>{l({type:r,pose:{x:e.x+Math.sin(t)*n,y:e.y+Math.cos(t)*n,heading:"stern"===r?t+Math.PI:t},source:"virtual"})};e.s(["BERTH_TYPES",0,["bow","stern","side","buoy"],"getBerth",0,u,"placeVirtualBerth",0,c,"setBerth",0,l,"useBerth",0,p],37369);let h={length:10.8,beam:3.9},f=h.length/2,m=h.beam/2,g=({size:e,position:r,color:n,opacity:o=1})=>(0,t.jsxs)("mesh",{position:r,children:[(0,t.jsx)("boxGeometry",{args:e}),(0,t.jsx)("meshLambertMaterial",{color:n,transparent:o<1,opacity:o})]}),v=({position:e,rotation:r=0,color:n,length:o=4})=>(0,t.jsxs)("group",{position:e,rotation:[0,r,0],children:[(0,t.jsxs)("mesh",{rotation:[-Math.PI/2,0,0],position:[0,.07,o/2-.6],children:[(0,t.jsx)("planeGeometry",{args:[.7,o-1.2]}),(0,t.jsx)("meshBasicMaterial",{color:n,transparent:!0,opacity:.85,depthWrite:!1})]}),(0,t.jsxs)("mesh",{rotation:[-Math.PI/2,0,0],position:[0,.07,-.6],children:[(0,t.jsx)("circleGeometry",{args:[1.2,3,Math.PI/2]}),(0,t.jsx)("meshBasicMaterial",{color:n,transparent:!0,opacity:.85,depthWrite:!1})]})]}),x=({type:e,side:o,colors:i})=>{let a,s=(0,r.useMemo)(()=>(()=>{let e=-f+3.5,t=[[-m,f],[m,f],[m,e]];for(let r=1;r<=8;r++){let n=r/8;t.push([m*(1-n)**1.6,e-(e+f)*Math.sin(n*Math.PI/2)])}for(let r=7;r>=0;r--){let n=r/8;t.push([-m*(1-n)**1.6,e-(e+f)*Math.sin(n*Math.PI/2)])}return t.push([-m,f]),t.map(([e,t])=>[e,.06,t])})(),[]),u="port"===o?-1:1;return(0,t.jsxs)("group",{children:[(0,t.jsx)(n.default,{points:s,color:i.target,lineWidth:2.5,dashed:!0,dashSize:.8,gapSize:.5}),(0,t.jsxs)("mesh",{rotation:[-Math.PI/2,0,0],position:[0,.04,.3],children:[(0,t.jsx)("planeGeometry",{args:[.9*h.beam,h.length-1.6]}),(0,t.jsx)("meshBasicMaterial",{color:i.target,transparent:!0,opacity:.12,depthWrite:!1})]}),("bow"===e||"stern"===e)&&(a="bow"===e?-1:1,(0,t.jsxs)("group",{children:[(0,t.jsx)(g,{size:[32,.35,2.2],position:[0,.17,a*(f+.45+1.1)],color:i.pontoon}),(0,t.jsx)(g,{size:[.8,.3,9],position:[m+.45+.4,.15,a*(f-4.5+.45)],color:i.pontoon}),(0,t.jsx)(g,{size:[.95*h.beam,1,.95*h.length],position:[-(h.beam+.9),.5,0],color:i.neighbour,opacity:.45}),(0,t.jsx)(v,{position:[0,0,-a*(f+7)],rotation:"bow"===e?0:Math.PI,color:i.target})]})),"side"===e&&(0,t.jsxs)("group",{children:[(0,t.jsx)(g,{size:[2.4,.35,26],position:[u*(m+.45+1.2),.17,0],color:i.pontoon}),(0,t.jsx)(v,{position:[-(2.5*u),0,f+6],rotation:.25*u,color:i.target})]}),"buoy"===e&&(0,t.jsxs)("group",{children:[(0,t.jsxs)("mesh",{position:[0,.5,-(f+2.5)],children:[(0,t.jsx)("sphereGeometry",{args:[.6,20,14]}),(0,t.jsx)("meshLambertMaterial",{color:i.buoy})]}),(0,t.jsx)(n.default,{points:[[0,.3,-(f+2.5)],[0,.3,-f]],color:i.pontoon,lineWidth:2}),(0,t.jsx)(v,{position:[0,0,f+6],color:i.target})]})]})};e.s(["BOAT",0,h,"default",0,({scale:e=.5})=>{let{scene:n,accent:a}=(0,o.default)(),{heading:s,offset:l,hasFix:d,hasHeading:h}=(0,i.default)(),f=p();(0,r.useEffect)(()=>{d&&h&&!u().pose&&c(l,s)},[l,s,d,h]);let m=(0,r.useMemo)(()=>({target:a,pontoon:n.rigging,neighbour:n.vessel,buoy:n.target}),[n,a]);if(!f.pose)return null;let{x:g,y:v,heading:M}=f.pose;return(0,t.jsx)("group",{rotation:[0,s,0],children:(0,t.jsx)("group",{position:[(g-l.x)*e,0,-(v-l.y)*e],rotation:[0,-M,0],scale:[e,e,e],children:(0,t.jsx)(x,{type:f.type,side:f.side,colors:m})})})}],76247)},32189,(e,t,r)=>{"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},65156,(e,t,r)=>{"use strict";var n=e.r(32189);function o(){}function i(){}i.resetWarningCache=o,t.exports=function(){function e(e,t,r,o,i,a){if(a!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return r.PropTypes=r,r}},57384,(e,t,r)=>{e.i(47167),t.exports=e.r(65156)()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,13181,e=>{e.v(t=>Promise.all(["static/chunks/01ij-cuy61l35.js","static/chunks/0wi5jop1ihbm6.js","static/chunks/0ohleay4roayh.js","static/chunks/192c42s2wc7qe.js"].map(t=>e.l(t))).then(()=>t(23595)))},62588,90669,e=>{"use strict";var t=e.i(43476),n=e.i(71645),a=e.i(83402),r=e.i(66799),i=e.i(67561),l=e.i(85709);let s=()=>({cpaMeters:1852*(Number(a.default.get("cpaAlarmNM"))||.5),tcpaSeconds:60*(Number(a.default.get("tcpaAlarmMinutes"))||20)}),u=(e,t)=>({x:e*Math.sin(t),y:e*Math.cos(t)}),o=({rx:e,ry:t,ownSog:n,ownCog:a,targetSog:r,targetCog:i})=>{if(![e,t,n,a,r,i].every(Number.isFinite))return null;let l=u(n,a),s=u(r,i),o=s.x-l.x,c=s.y-l.y,d=o*o+c*c,g=d<1e-9?0:-(e*o+t*c)/d,f=Math.max(0,g);return{cpa:Math.hypot(e+o*f,t+c*f),tcpa:g,own:{x:l.x*f,y:l.y*f},target:{x:e+s.x*f,y:t+s.y*f}}},c=(e,t,n=s())=>{let a=!e||e.tcpa>0;return e&&e.tcpa>0&&e.tcpa<=n.tcpaSeconds&&e.cpa<n.cpaMeters||Number.isFinite(t)&&t<100&&a?"danger":Number.isFinite(t)&&t<Math.max(200,.3*n.cpaMeters)?"close":"none"};e.s(["closestApproach",0,o,"collisionRisk",0,c,"getCollisionThresholds",0,s],90669);let d=(0,n.createContext)(null),g=[],f=[...["navigation.position","navigation.speedOverGround","navigation.courseOverGroundTrue","navigation.courseOverGroundMagnetic","navigation.headingTrue","navigation.headingMagnetic"].map(e=>({path:e,policy:"instant"})),...["name","design.aisShipType","design.length","design.beam","communication.callsignVhf","navigation.state"].map(e=>({path:e}))],p=["navigation.position","atonType","name","virtual","offPosition"].map(e=>({path:e})),v=(e,t)=>t.split(".").reduce((e,t)=>e?.[t],e),m=e=>"string"==typeof e?e:"string"==typeof e?.value?e.value:null,h=e=>(e||"").replace(/^vessels\./,""),b=e=>/mmsi:(\d{9})$/.exec(e||"")?.[1]||null,y=e=>{let t=b(e);return!t||!t.startsWith("99")&&!t.startsWith("00")&&!t.startsWith("111")},w=e=>b(e)?.startsWith("99")??!1,M=e=>({id:e,mmsi:b(e),name:"",latitude:null,longitude:null,atonType:null,virtual:!1,offPosition:!1,distanceMeters:null,lastUpdate:0}),S=(e,t,n)=>{switch(t){case"navigation.position":n&&Number.isFinite(n.latitude)&&(e.latitude=n.latitude,e.longitude=n.longitude);break;case"atonType":e.atonType=n?.id??n??null;break;case"name":e.name=m(n)??e.name;break;case"virtual":e.virtual=!0===n;break;case"offPosition":e.offPosition=!0===n;break;case"":n?.name&&(e.name=m(n.name)??e.name)}},j=e=>({mmsi:e,name:"unknown",latitude:null,longitude:null,sog:null,cog:null,cogMagnetic:null,heading:null,headingMagnetic:null,length:null,beam:null,shipType:null,callsign:null,navState:null,distanceMeters:null,sceneX:null,sceneZ:null,cpaMeters:null,tcpaSeconds:null,risk:"none",cpaScene:null,rotationAngleY:0,visible:!1,lastUpdate:0,positionAt:0}),x=(e,t,n)=>{switch(t){case"name":return e.name=m(n)??e.name,!1;case"navigation.position":if(!n)return!1;return e.latitude=n.latitude,e.longitude=n.longitude,e.positionAt=Date.now(),!0;case"navigation.speedOverGround":return e.sog=n,!0;case"navigation.courseOverGroundTrue":return e.cog=n,!0;case"navigation.courseOverGroundMagnetic":return e.cogMagnetic=n,!0;case"navigation.headingTrue":return e.heading=n,!0;case"navigation.headingMagnetic":return e.headingMagnetic=n,!0;case"design.aisShipType":return e.shipType=n?.id??n,!1;case"design.length":return e.length=n?.overall??n,!1;case"design.beam":return e.beam=n,!1;case"communication.callsignVhf":return e.callsign=n,!1;case"navigation.state":return e.navState=n,!1;default:return!1}};e.s(["AISProvider",0,({children:e})=>{let{convertLatLonToXY:u}=(0,i.useOcearoContext)(),b=(0,l.useSignalKPath)("navigation.position"),P=(0,l.useSignalKPath)("navigation.speedOverGround"),T=(0,l.useSignalKPath)("navigation.courseOverGroundTrue"),O=(0,l.useSignalKPath)("navigation.headingTrue"),k=(0,n.useRef)({sog:null,cog:null}),R=(0,n.useRef)({vx:0,vy:0,fixAt:0,scale:.7}),[A]=(0,n.useState)(s),F=(0,n.useRef)({}),N=(0,n.useRef)({}),C=(0,n.useRef)(null),_=(0,n.useRef)(b),I=(0,n.useRef)(!1),E=(0,n.useRef)(""),[D,W]=(0,n.useState)(0),[G,K]=(0,n.useState)({aisData:{},vesselIds:g,targets:g,atons:g}),U=(0,n.useCallback)(()=>(W(e=>e+1),()=>W(e=>e-1)),[]),L=(0,n.useCallback)(e=>{let t=_.current;if(!Number.isFinite(e.latitude)||!Number.isFinite(e.longitude)||!Number.isFinite(t?.latitude)||!Number.isFinite(t?.longitude)){e.visible=!1,e.distanceMeters=null;return}let n=a.default.get("aisLengthScalingFactor")||.7,{x:r,y:i}=u({lat:e.latitude,lon:e.longitude},{lat:t.latitude,lon:t.longitude});e.sceneX=r*n,e.sceneZ=-i*n,e.rotationAngleY=e.heading??e.headingMagnetic??e.cog??e.cogMagnetic??0,e.distanceMeters=Math.hypot(r,i),e.visible=e.distanceMeters>10&&e.distanceMeters<=5e3;let l=k.current,s=o({rx:r,ry:i,ownSog:l.sog,ownCog:l.cog,targetSog:e.sog,targetCog:e.cog??e.cogMagnetic});e.cpaMeters=s?s.cpa:null,e.tcpaSeconds=s?s.tcpa:null,e.risk=c(s,e.distanceMeters,A),e.cpaScene=s&&s.tcpa>0?{targetX:s.target.x*n,targetZ:-s.target.y*n,ownX:s.own.x*n,ownZ:-s.own.y*n}:null},[u,A]),B=(0,n.useCallback)(e=>{let t=_.current;if(!Number.isFinite(e.latitude)||!Number.isFinite(t?.latitude)){e.distanceMeters=null;return}let{x:n,y:a}=u({lat:e.latitude,lon:e.longitude},{lat:t.latitude,lon:t.longitude});e.east=n,e.north=a,e.distanceMeters=Math.hypot(n,a)},[u]);(0,n.useEffect)(()=>{_.current=b,k.current={sog:P,cog:T??O};let e=T??O;R.current={vx:Number.isFinite(P)&&Number.isFinite(e)?P*Math.sin(e):0,vy:Number.isFinite(P)&&Number.isFinite(e)?P*Math.cos(e):0,fixAt:Date.now(),scale:a.default.get("aisLengthScalingFactor")||.7},Object.values(F.current).forEach(L),Object.values(N.current).forEach(B),I.current=!0},[b,P,T,O,L,B]),(0,n.useEffect)(()=>{if(0===D)return;let e=()=>{let e=Date.now(),t=F.current;for(let[n,a]of Object.entries(t))e-a.lastUpdate>6e5&&(delete t[n],I.current=!0);for(let[t,n]of Object.entries(N.current))e-n.lastUpdate>24e5&&(delete N.current[t],I.current=!0);if(!I.current)return;I.current=!1;let n=Object.values(t).filter(e=>null!==e.distanceMeters).sort((e,t)=>e.distanceMeters-t.distanceMeters),a=n.filter(e=>e.visible),r=a.map(e=>`${e.mmsi}|${e.shipType}|${e.length}|${e.beam}`).join(","),i=r!==E.current;E.current=r;let l=Object.values(N.current).filter(e=>null!==e.distanceMeters).sort((e,t)=>e.distanceMeters-t.distanceMeters).map(e=>({...e}));K(e=>({aisData:{...t},targets:n,vesselIds:i?a:e.vesselIds,atons:l}))};e();let t=setInterval(e,250);return()=>clearInterval(t)},[D]),(0,n.useEffect)(()=>{if(0===D)return;let e=!1,t=null,n=e=>"self"===e||C.current&&e===C.current,a=(e,t)=>{let n=N.current[e]||(N.current[e]=M(e));for(let e of(n.lastUpdate=Date.now(),t))for(let{path:t,value:a}of e.values||[])S(n,t,a);B(n),I.current=!0},i=e=>{let t;if(!e?.updates)return;if(t=e.context,/^atons\./.test(t||""))return void a(e.context.replace(/^atons\./,""),e.updates);let r=h(e?.context);if(r&&w(r))return void a(r,e.updates);if(!r||n(r)||!y(r)||!e.updates)return;let i=F.current,l=i[r]||(i[r]=j(r));l.lastUpdate=Date.now();let s=!1;for(let t of e.updates)if(t.values)for(let{path:e,value:n}of t.values)x(l,e,n)&&(s=!0);s&&L(l),I.current=!0},l=async t=>{let n=await t.get("/atons").catch(()=>null);if(e||!n)return;let a=Date.now();for(let[e,t]of Object.entries(n)){let n=N.current[e]||(N.current[e]=M(e)),r=v(t,"navigation.position.value");Number.isFinite(r?.latitude)&&(n.latitude=r.latitude,n.longitude=r.longitude),n.atonType=v(t,"atonType.value.id")??n.atonType,n.name=m(t.name)??n.name,n.virtual=!0===v(t,"virtual.value")||!0===t.virtual,n.offPosition=!0===v(t,"offPosition.value")||!0===t.offPosition,n.lastUpdate=a,B(n)}I.current=!0},s=async()=>{let r=await t.API();l(r);let i=await r.vessels();if(e||!i)return;let s=F.current,u=Date.now();for(let[e,t]of Object.entries(i)){if(n(e))continue;if(w(e)){let n=v(t,"navigation.position.value"),r=[{path:"name",value:t.name}];n&&r.push({path:"navigation.position",value:n}),a(e,[{values:r}]);continue}if(!y(e))continue;let r=s[e]||(s[e]=j(e)),i=(e,n)=>{let a=v(t,n);void 0!==a&&(r[e]=a)},l=m(t.name);l&&(r.name=l),i("latitude","navigation.position.value.latitude"),i("longitude","navigation.position.value.longitude"),i("sog","navigation.speedOverGround.value"),i("cog","navigation.courseOverGroundTrue.value"),i("cogMagnetic","navigation.courseOverGroundMagnetic.value"),i("heading","navigation.headingTrue.value"),i("headingMagnetic","navigation.headingMagnetic.value"),i("length","design.length.value.overall"),i("beam","design.beam.value"),i("callsign","communication.callsignVhf"),i("navState","navigation.state.value"),i("shipType","design.aisShipType.value.id"),r.lastUpdate=u,L(r)}I.current=!0};return(async()=>{try{if((t=r.default.createClient({deltaStreamBehaviour:"none",sendMeta:null,subscriptions:[{context:"vessels.*",subscribe:f},{context:"atons.*",subscribe:p}]})).on("self",e=>{C.current=h(e)}),t.on("delta",i),await t.connect(),e)return;C.current=h(t.self)||C.current,await s()}catch(t){e||console.warn("AIS: SignalK connection failed:",t?.message||t)}})(),()=>{e=!0,t?.removeAllListeners?.("delta"),t?.disconnect()}},[D>0,L,B]);let $=(0,n.useMemo)(()=>({...G,targetsRef:F,motionRef:R,register:U}),[G,U]);return(0,t.jsx)(d.Provider,{value:$,children:e})},"predictScenePosition",0,(e,t,n)=>{let a=e.cog??e.cogMagnetic??e.heading,r=Number.isFinite(e.sog)?e.sog:0,i=Math.min(180,Math.max(0,(n-(e.positionAt||n))/1e3)),l=Math.min(180,Math.max(0,(n-t.fixAt)/1e3)),s=-(t.vx*l),u=-(t.vy*l);return Number.isFinite(a)&&r>.05&&(s+=r*Math.sin(a)*i,u+=r*Math.cos(a)*i),{x:e.sceneX+s*t.scale,z:e.sceneZ-u*t.scale}},"useAIS",0,({passive:e=!1}={})=>{let t=(0,n.useContext)(d),a=e?null:t?.register;return(0,n.useEffect)(()=>a?.(),[a]),t||{aisData:{},vesselIds:g,targets:g,atons:g,targetsRef:{current:{}},motionRef:{current:{vx:0,vy:0,fixAt:0,scale:.7}}}}],62588)},49063,e=>{e.v(t=>Promise.all(["static/chunks/0ejjon45nq_-h.js","static/chunks/192c42s2wc7qe.js","static/chunks/11awvgcou7v4r.js"].map(t=>e.l(t))).then(()=>t(85626)))},10520,e=>{e.v(t=>Promise.all(["static/chunks/3k-r-4veivdjr.js","static/chunks/192c42s2wc7qe.js"].map(t=>e.l(t))).then(()=>t(61891)))},45344,e=>{e.v(t=>Promise.all(["static/chunks/20p1hr--2grl8.js","static/chunks/11awvgcou7v4r.js"].map(t=>e.l(t))).then(()=>t(42602)))},83934,e=>{"use strict";var t=e.i(43476),n=e.i(71645),a=e.i(66799),r=e.i(85709),i=e.i(46991);let l=(0,n.createContext)();e.s(["WeatherContextProvider",0,({children:e})=>{let s=(0,r.useSignalKPath)("navigation.position"),u=(0,n.useMemo)(()=>["environment.outside.temperature","environment.outside.relativeHumidity","environment.outside.pressure","environment.wind.speedTrue","environment.wind.directionTrue","environment.wind.gust"],[]),o=(0,r.useSignalKPaths)(u),[c,d]=(0,n.useState)(o),g=(0,n.useRef)(o);g.current=o;let f=(0,n.useRef)(null);(0,n.useEffect)(()=>{f.current||(f.current=setTimeout(()=>{f.current=null,d(g.current)},2e3))},[o]),(0,n.useEffect)(()=>()=>clearTimeout(f.current),[]);let[p,v]=(0,n.useState)([]),[m,h]=(0,n.useState)(!1),[b,y]=(0,n.useState)(null),[w,M]=(0,n.useState)(null),[S,j]=(0,n.useState)(null),x=(0,n.useRef)(null),P=(0,n.useRef)(null),T=(0,n.useRef)(s);T.current=s;let O=(0,n.useRef)(!1),k=Number.isFinite(s?.latitude)&&Number.isFinite(s?.longitude),R=(0,n.useCallback)(async()=>{let e=T.current;if(Number.isFinite(e?.latitude)&&Number.isFinite(e?.longitude)){O.current=!0,h(!0),y(null);try{let t=a.default.isWeatherApiAvailable();if(null===t&&(t=await a.default.checkWeatherApiAvailability()),M(t),!t)return void y("Weather API not available on SignalK server");let n=await a.default.getWeatherForecast(e.latitude,e.longitude),r=a.default.parseWeatherForecast(n);v(r),j(new Date)}catch(e){e.message&&e.message.includes("400")?(console.warn("WeatherContext: Weather forecast not supported by this server"),M(!1)):console.warn("WeatherContext: Failed to fetch forecast:",e.message),y(e.message)}finally{h(!1)}}},[]),A=(0,n.useCallback)(e=>{if(!p||0===p.length)return null;let t=Math.min(Math.floor(e),p.length-1);return p[t]||null},[p]),F=(0,n.useCallback)(()=>{let e=p.length>0?p[0]:null,t=c["environment.outside.temperature"]??(e?.temperature!=null?e.temperature+273.15:null),n=c["environment.outside.relativeHumidity"]??e?.humidity??null,a=c["environment.outside.pressure"]??e?.pressure??null,r=(0,i.finite)(c["environment.wind.speedTrue"])??(0,i.finite)((0,i.knotsToMs)(e?.wind?.speed)),l=(0,i.finite)(c["environment.wind.directionTrue"])??(0,i.finite)((0,i.degToRad)(e?.wind?.direction)),s=Object.values(c).some(e=>null!==(0,i.finite)(e)),u=e?.clouds;return{source:null!==t||null!==n||null!==a||null!==r?s?"sensors":"forecast":null,temperature:t,humidity:n,pressure:a,windSpeed:r,windDirection:l,cloudCover:null!=u?u>1?u/100:u:null,rain:e?.rain??null,description:e?.description||null}},[c,p]),N=(0,n.useCallback)(()=>{let e=p.length>0?p[0]:null,t=(0,i.finite)(c["environment.wind.speedTrue"])??(0,i.finite)((0,i.knotsToMs)(e?.wind?.speed)),n=(0,i.finite)(c["environment.wind.directionTrue"])??(0,i.finite)((0,i.degToRad)(e?.wind?.direction)),a=(0,i.finite)(c["environment.wind.gust"])??(0,i.finite)((0,i.knotsToMs)(e?.wind?.gust)),r=null!==(0,i.finite)(c["environment.wind.speedTrue"])||null!==(0,i.finite)(c["environment.wind.directionTrue"]);return{source:null!==t||null!==n?r?"sensors":"forecast":null,speed:t,direction:n,gust:a}},[c,p]);(0,n.useEffect)(()=>(x.current=setTimeout(()=>{R()},5e3),P.current=setInterval(()=>{R()},18e5),()=>{x.current&&clearTimeout(x.current),P.current&&clearInterval(P.current)}),[R]),(0,n.useEffect)(()=>{k&&!O.current&&R()},[k,R]);let C=(0,n.useMemo)(()=>({forecasts:p,isLoading:m,error:b,weatherApiAvailable:w,lastFetchTime:S,fetchWeatherForecast:R,getForecastForTime:A,getCurrentWeather:F,getWindData:N}),[p,m,b,w,S,R,A,F,N]);return(0,t.jsx)(l.Provider,{value:C,children:e})},"useWeather",0,()=>{let e=(0,n.useContext)(l);if(!e)throw Error("useWeather must be used within a WeatherContextProvider");return e}])},23e3,e=>{e.v(t=>Promise.all(["static/chunks/15imr2-f_8n-x.js","static/chunks/192c42s2wc7qe.js"].map(t=>e.l(t))).then(()=>t(50637)))},30206,e=>{"use strict";let t=new Set,n={active:!1,playing:!1,speed:30,time:0,start:0,end:0,voyage:null},a=[],r=null,i=0,l=null,s=()=>t.forEach(e=>e(n)),u=e=>{n={...n,...e},s()},o=(e,t,n)=>e+(t-e)*n,c=(e,t,n)=>{let a=Math.atan2(Math.sin(t-e),Math.cos(t-e));return e+a*n},d=new Set(["hdg","cog","twa","twd","awa","rud","roll"]),g=e=>{if(!a.length)return null;let t=0,n=a.length-1;if(e<=a[0].t)return a[0];if(e>=a[n].t)return a[n];for(;n-t>1;){let r=t+n>>1;a[r].t<=e?t=r:n=r}let r=a[t],i=a[n],l=(e-r.t)/Math.max(1,i.t-r.t),s={t:e};for(let e of Object.keys(r)){if("t"===e)continue;let t=r[e],n=i[e];if(!Number.isFinite(t)||!Number.isFinite(n)){s[e]=t??n;continue}s[e]=d.has(e)?c(t,n,l):o(t,n,l)}return s},f=e=>{let t={},n=(e,n)=>{null!=n&&("number"!=typeof n||Number.isFinite(n))&&(t[e]=n)};return Number.isFinite(e.lat)&&Number.isFinite(e.lon)&&(t["navigation.position"]={latitude:e.lat,longitude:e.lon}),n("navigation.headingTrue",e.hdg),n("navigation.courseOverGroundTrue",e.cog??e.hdg),n("navigation.speedOverGround",e.sog),n("navigation.speedThroughWater",e.stw??e.sog),n("environment.wind.speedTrue",e.tws),n("environment.wind.angleTrueWater",e.twa),n("environment.wind.directionTrue",e.twd),n("environment.wind.speedApparent",e.aws),n("environment.wind.angleApparent",e.awa),n("steering.rudderAngle",e.rud),n("environment.depth.belowKeel",e.depth),Number.isFinite(e.roll)&&(t["navigation.attitude"]={roll:e.roll,pitch:0,yaw:e.hdg??0}),t},p=()=>{let e=Date.now(),t=e-i;if(i=e,!n.playing)return;let a=n.time+t*n.speed;a>=n.end&&(a=n.end,u({playing:!1})),n={...n,time:a};let r=g(a);r&&l&&l(f(r)),s()},v=()=>{r&&clearInterval(r),r=null,a=[],u({active:!1,playing:!1,voyage:null})};e.s(["getReplayState",0,()=>n,"isReplaying",0,()=>n.active,"seekReplay",0,e=>{if(!n.active)return;let t=Math.max(n.start,Math.min(n.end,e));u({time:t});let a=g(t);a&&l&&l(f(a))},"setReplaySink",0,e=>{l=e},"setReplaySpeed",0,e=>u({speed:e}),"startReplay",0,(e,t)=>{v(),a=t,u({active:!0,playing:!0,time:e.start,start:e.start,end:e.end,voyage:e});let n=g(e.start);n&&l&&l(f(n)),i=Date.now(),r=setInterval(p,100)},"stopReplay",0,v,"subscribeReplay",0,e=>(t.add(e),()=>t.delete(e)),"togglePlay",0,()=>{n.active&&(i=Date.now(),u({playing:!n.playing,time:n.time>=n.end?n.start:n.time}))}])},44485,e=>{"use strict";let t="samples",n=null,a=async(e,a)=>{let r=await ("u"<typeof indexedDB?Promise.reject(Error("IndexedDB unavailable")):(!n&&(n=new Promise((e,a)=>{let r=indexedDB.open("ocearo-voyages",1);r.onupgradeneeded=()=>{let e=r.result;e.objectStoreNames.contains(t)||e.createObjectStore(t,{keyPath:"t"})},r.onsuccess=()=>e(r.result),r.onerror=()=>{n=null,a(r.error)}})),n));return new Promise((n,i)=>{let l,s=r.transaction(t,e);Promise.resolve(a(s.objectStore(t))).then(e=>{l=e}),s.oncomplete=()=>n(l),s.onerror=()=>i(s.error),s.onabort=()=>i(s.error)})},r=e=>new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error)}),i=e=>e*Math.PI/180,l=(e,t)=>6371e3*Math.hypot(i(t.lat-e.lat),i(t.lon-e.lon)*Math.cos(i((e.lat+t.lat)/2))),s=async()=>{let e=await a("readonly",e=>r(e.getAll())),t=[],n=null;for(let a of e)!n||a.t-n.end>18e5?(n={id:a.t,start:a.t,end:a.t,distanceM:0,maxSog:0,samples:0,last:a},t.push(n)):n.distanceM+=l(n.last,a),n.end=a.t,n.samples+=1,n.maxSog=Math.max(n.maxSog,a.sog||0),n.last=a;return t.filter(e=>e.end-e.start>=3e5&&e.distanceM>100).map(({last:e,...t})=>t).reverse()};e.s(["addSample",0,e=>a("readwrite",t=>{t.put(e)}),"getSamples",0,(e,t)=>a("readonly",n=>r(n.getAll(IDBKeyRange.bound(e,t)))),"listVoyages",0,s,"trimSamples",0,()=>a("readwrite",async e=>{let t=await r(e.count());t<=4e5||(await r(e.getAllKeys(null,t-4e5))).forEach(t=>e.delete(t))})])},90317,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0});var a={bindSnapshot:function(){return o},createAsyncLocalStorage:function(){return u},createSnapshot:function(){return c}};for(var r in a)Object.defineProperty(n,r,{enumerable:!0,get:a[r]});let i=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class l{disable(){throw i}getStore(){}run(){throw i}exit(){throw i}enterWith(){throw i}static bind(e){return e}}let s="u">typeof globalThis&&globalThis.AsyncLocalStorage;function u(){return s?new s:new l}function o(e){return s?s.bind(e):l.bind(e)}function c(){return s?s.snapshot():function(e,...t){return e(...t)}}},42344,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"workAsyncStorageInstance",{enumerable:!0,get:function(){return a}});let a=(0,e.r(90317).createAsyncLocalStorage)()},63599,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"workAsyncStorage",{enumerable:!0,get:function(){return a.workAsyncStorageInstance}});let a=e.r(42344)},9885,(e,t,n)=>{"use strict";function a(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"encodeURIPath",{enumerable:!0,get:function(){return a}})},67585,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"BailoutToCSR",{enumerable:!0,get:function(){return r}});let a=e.r(32061);function r({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new a.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},52157,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"PreloadChunks",{enumerable:!0,get:function(){return u}});let a=e.r(43476),r=e.r(74080),i=e.r(63599),l=e.r(9885),s=e.r(43369);function u({moduleIds:e}){if("u">typeof window)return null;let t=i.workAsyncStorage.getStore();if(void 0===t)return null;let n=[];if(t.reactLoadableManifest&&e){let a=t.reactLoadableManifest;for(let t of e){if(!a[t])continue;let e=a[t].files;n.push(...e)}}if(0===n.length)return null;let o=(0,s.getAssetTokenQuery)();return(0,a.jsx)(a.Fragment,{children:n.map(e=>{let n=`${t.assetPrefix}/_next/${(0,l.encodeURIPath)(e)}${o}`;return e.endsWith(".css")?(0,a.jsx)("link",{precedence:"dynamic",href:n,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,r.preload)(n,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},69093,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return o}});let a=e.r(43476),r=e.r(71645),i=e.r(67585),l=e.r(52157);function s(e){return{default:e&&"default"in e?e.default:e}}let u={loader:()=>Promise.resolve(s(()=>null)),loading:null,ssr:!0},o=function(e){let t={...u,...e},n=(0,r.lazy)(()=>t.loader().then(s)),o=t.loading;function c(e){let s=o?(0,a.jsx)(o,{isLoading:!0,pastDelay:!0,error:null}):null,u=!t.ssr||!!t.loading,c=u?r.Suspense:r.Fragment,d=t.ssr?(0,a.jsxs)(a.Fragment,{children:["u"<typeof window?(0,a.jsx)(l.PreloadChunks,{moduleIds:t.modules}):null,(0,a.jsx)(n,{...e})]}):(0,a.jsx)(i.BailoutToCSR,{reason:"next/dynamic",children:(0,a.jsx)(n,{...e})});return(0,a.jsx)(c,{...u?{fallback:s}:{},children:d})}return c.displayName="LoadableComponent",c}},70703,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return r}});let a=e.r(55682)._(e.r(69093));function r(e,t){let n={};"function"==typeof e&&(n.loader=e);let r={...n,...t};return(0,a.default)({...r,modules:r.loadableGenerated?.modules})}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)}]);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,47141,e=>{"use strict";var t=e.i(43476),a=e.i(61949),r=e.i(71645),n=e.i(8560),o=e.i(90072);e.s(["ACESFilmicToneMapping",()=>o.ACESFilmicToneMapping,"AddEquation",()=>o.AddEquation,"AddOperation",()=>o.AddOperation,"AdditiveAnimationBlendMode",()=>o.AdditiveAnimationBlendMode,"AdditiveBlending",()=>o.AdditiveBlending,"AgXToneMapping",()=>o.AgXToneMapping,"AlphaFormat",()=>o.AlphaFormat,"AlwaysCompare",()=>o.AlwaysCompare,"AlwaysDepth",()=>o.AlwaysDepth,"AlwaysStencilFunc",()=>o.AlwaysStencilFunc,"AmbientLight",()=>o.AmbientLight,"AnimationAction",()=>o.AnimationAction,"AnimationClip",()=>o.AnimationClip,"AnimationLoader",()=>o.AnimationLoader,"AnimationMixer",()=>o.AnimationMixer,"AnimationObjectGroup",()=>o.AnimationObjectGroup,"AnimationUtils",()=>o.AnimationUtils,"ArcCurve",()=>o.ArcCurve,"ArrayCamera",()=>o.ArrayCamera,"ArrowHelper",()=>o.ArrowHelper,"AttachedBindMode",()=>o.AttachedBindMode,"Audio",()=>o.Audio,"AudioAnalyser",()=>o.AudioAnalyser,"AudioContext",()=>o.AudioContext,"AudioListener",()=>o.AudioListener,"AudioLoader",()=>o.AudioLoader,"AxesHelper",()=>o.AxesHelper,"BackSide",()=>o.BackSide,"BasicDepthPacking",()=>o.BasicDepthPacking,"BasicShadowMap",()=>o.BasicShadowMap,"BatchedMesh",()=>o.BatchedMesh,"BezierInterpolant",()=>o.BezierInterpolant,"Bone",()=>o.Bone,"BooleanKeyframeTrack",()=>o.BooleanKeyframeTrack,"Box2",()=>o.Box2,"Box3",()=>o.Box3,"Box3Helper",()=>o.Box3Helper,"BoxGeometry",()=>o.BoxGeometry,"BoxHelper",()=>o.BoxHelper,"BufferAttribute",()=>o.BufferAttribute,"BufferGeometry",()=>o.BufferGeometry,"BufferGeometryLoader",()=>o.BufferGeometryLoader,"ByteType",()=>o.ByteType,"Cache",()=>o.Cache,"Camera",()=>o.Camera,"CameraHelper",()=>o.CameraHelper,"CanvasTexture",()=>o.CanvasTexture,"CapsuleGeometry",()=>o.CapsuleGeometry,"CatmullRomCurve3",()=>o.CatmullRomCurve3,"CineonToneMapping",()=>o.CineonToneMapping,"CircleGeometry",()=>o.CircleGeometry,"ClampToEdgeWrapping",()=>o.ClampToEdgeWrapping,"Clock",()=>o.Clock,"Color",()=>o.Color,"ColorKeyframeTrack",()=>o.ColorKeyframeTrack,"ColorManagement",()=>o.ColorManagement,"Compatibility",()=>o.Compatibility,"CompressedArrayTexture",()=>o.CompressedArrayTexture,"CompressedCubeTexture",()=>o.CompressedCubeTexture,"CompressedTexture",()=>o.CompressedTexture,"CompressedTextureLoader",()=>o.CompressedTextureLoader,"ConeGeometry",()=>o.ConeGeometry,"ConstantAlphaFactor",()=>o.ConstantAlphaFactor,"ConstantColorFactor",()=>o.ConstantColorFactor,"Controls",()=>o.Controls,"CubeCamera",()=>o.CubeCamera,"CubeDepthTexture",()=>o.CubeDepthTexture,"CubeReflectionMapping",()=>o.CubeReflectionMapping,"CubeRefractionMapping",()=>o.CubeRefractionMapping,"CubeTexture",()=>o.CubeTexture,"CubeTextureLoader",()=>o.CubeTextureLoader,"CubeUVReflectionMapping",()=>o.CubeUVReflectionMapping,"CubicBezierCurve",()=>o.CubicBezierCurve,"CubicBezierCurve3",()=>o.CubicBezierCurve3,"CubicInterpolant",()=>o.CubicInterpolant,"CullFaceBack",()=>o.CullFaceBack,"CullFaceFront",()=>o.CullFaceFront,"CullFaceFrontBack",()=>o.CullFaceFrontBack,"CullFaceNone",()=>o.CullFaceNone,"Curve",()=>o.Curve,"CurvePath",()=>o.CurvePath,"CustomBlending",()=>o.CustomBlending,"CustomToneMapping",()=>o.CustomToneMapping,"CylinderGeometry",()=>o.CylinderGeometry,"Cylindrical",()=>o.Cylindrical,"Data3DTexture",()=>o.Data3DTexture,"DataArrayTexture",()=>o.DataArrayTexture,"DataTexture",()=>o.DataTexture,"DataTextureLoader",()=>o.DataTextureLoader,"DataUtils",()=>o.DataUtils,"DecrementStencilOp",()=>o.DecrementStencilOp,"DecrementWrapStencilOp",()=>o.DecrementWrapStencilOp,"DefaultLoadingManager",()=>o.DefaultLoadingManager,"DepthFormat",()=>o.DepthFormat,"DepthStencilFormat",()=>o.DepthStencilFormat,"DepthTexture",()=>o.DepthTexture,"DetachedBindMode",()=>o.DetachedBindMode,"DirectionalLight",()=>o.DirectionalLight,"DirectionalLightHelper",()=>o.DirectionalLightHelper,"DiscreteInterpolant",()=>o.DiscreteInterpolant,"DodecahedronGeometry",()=>o.DodecahedronGeometry,"DoubleSide",()=>o.DoubleSide,"DstAlphaFactor",()=>o.DstAlphaFactor,"DstColorFactor",()=>o.DstColorFactor,"DynamicCopyUsage",()=>o.DynamicCopyUsage,"DynamicDrawUsage",()=>o.DynamicDrawUsage,"DynamicReadUsage",()=>o.DynamicReadUsage,"EdgesGeometry",()=>o.EdgesGeometry,"EllipseCurve",()=>o.EllipseCurve,"EqualCompare",()=>o.EqualCompare,"EqualDepth",()=>o.EqualDepth,"EqualStencilFunc",()=>o.EqualStencilFunc,"EquirectangularReflectionMapping",()=>o.EquirectangularReflectionMapping,"EquirectangularRefractionMapping",()=>o.EquirectangularRefractionMapping,"Euler",()=>o.Euler,"EventDispatcher",()=>o.EventDispatcher,"ExternalTexture",()=>o.ExternalTexture,"ExtrudeGeometry",()=>o.ExtrudeGeometry,"FileLoader",()=>o.FileLoader,"Float16BufferAttribute",()=>o.Float16BufferAttribute,"Float32BufferAttribute",()=>o.Float32BufferAttribute,"FloatType",()=>o.FloatType,"Fog",()=>o.Fog,"FogExp2",()=>o.FogExp2,"FramebufferTexture",()=>o.FramebufferTexture,"FrontSide",()=>o.FrontSide,"Frustum",()=>o.Frustum,"FrustumArray",()=>o.FrustumArray,"GLBufferAttribute",()=>o.GLBufferAttribute,"GLSL1",()=>o.GLSL1,"GLSL3",()=>o.GLSL3,"GreaterCompare",()=>o.GreaterCompare,"GreaterDepth",()=>o.GreaterDepth,"GreaterEqualCompare",()=>o.GreaterEqualCompare,"GreaterEqualDepth",()=>o.GreaterEqualDepth,"GreaterEqualStencilFunc",()=>o.GreaterEqualStencilFunc,"GreaterStencilFunc",()=>o.GreaterStencilFunc,"GridHelper",()=>o.GridHelper,"Group",()=>o.Group,"HTMLTexture",()=>o.HTMLTexture,"HalfFloatType",()=>o.HalfFloatType,"HemisphereLight",()=>o.HemisphereLight,"HemisphereLightHelper",()=>o.HemisphereLightHelper,"IcosahedronGeometry",()=>o.IcosahedronGeometry,"ImageBitmapLoader",()=>o.ImageBitmapLoader,"ImageLoader",()=>o.ImageLoader,"ImageUtils",()=>o.ImageUtils,"IncrementStencilOp",()=>o.IncrementStencilOp,"IncrementWrapStencilOp",()=>o.IncrementWrapStencilOp,"InstancedBufferAttribute",()=>o.InstancedBufferAttribute,"InstancedBufferGeometry",()=>o.InstancedBufferGeometry,"InstancedInterleavedBuffer",()=>o.InstancedInterleavedBuffer,"InstancedMesh",()=>o.InstancedMesh,"Int16BufferAttribute",()=>o.Int16BufferAttribute,"Int32BufferAttribute",()=>o.Int32BufferAttribute,"Int8BufferAttribute",()=>o.Int8BufferAttribute,"IntType",()=>o.IntType,"InterleavedBuffer",()=>o.InterleavedBuffer,"InterleavedBufferAttribute",()=>o.InterleavedBufferAttribute,"Interpolant",()=>o.Interpolant,"InterpolateBezier",()=>o.InterpolateBezier,"InterpolateDiscrete",()=>o.InterpolateDiscrete,"InterpolateLinear",()=>o.InterpolateLinear,"InterpolateSmooth",()=>o.InterpolateSmooth,"InterpolationSamplingMode",()=>o.InterpolationSamplingMode,"InterpolationSamplingType",()=>o.InterpolationSamplingType,"InvertStencilOp",()=>o.InvertStencilOp,"KeepStencilOp",()=>o.KeepStencilOp,"KeyframeTrack",()=>o.KeyframeTrack,"LOD",()=>o.LOD,"LatheGeometry",()=>o.LatheGeometry,"Layers",()=>o.Layers,"LessCompare",()=>o.LessCompare,"LessDepth",()=>o.LessDepth,"LessEqualCompare",()=>o.LessEqualCompare,"LessEqualDepth",()=>o.LessEqualDepth,"LessEqualStencilFunc",()=>o.LessEqualStencilFunc,"LessStencilFunc",()=>o.LessStencilFunc,"Light",()=>o.Light,"LightProbe",()=>o.LightProbe,"LightShadow",()=>o.LightShadow,"Line",()=>o.Line,"Line3",()=>o.Line3,"LineBasicMaterial",()=>o.LineBasicMaterial,"LineCurve",()=>o.LineCurve,"LineCurve3",()=>o.LineCurve3,"LineDashedMaterial",()=>o.LineDashedMaterial,"LineLoop",()=>o.LineLoop,"LineSegments",()=>o.LineSegments,"LinearFilter",()=>o.LinearFilter,"LinearInterpolant",()=>o.LinearInterpolant,"LinearMipMapLinearFilter",()=>o.LinearMipMapLinearFilter,"LinearMipMapNearestFilter",()=>o.LinearMipMapNearestFilter,"LinearMipmapLinearFilter",()=>o.LinearMipmapLinearFilter,"LinearMipmapNearestFilter",()=>o.LinearMipmapNearestFilter,"LinearSRGBColorSpace",()=>o.LinearSRGBColorSpace,"LinearToneMapping",()=>o.LinearToneMapping,"LinearTransfer",()=>o.LinearTransfer,"Loader",()=>o.Loader,"LoaderUtils",()=>o.LoaderUtils,"LoadingManager",()=>o.LoadingManager,"LoopOnce",()=>o.LoopOnce,"LoopPingPong",()=>o.LoopPingPong,"LoopRepeat",()=>o.LoopRepeat,"MOUSE",()=>o.MOUSE,"Material",()=>o.Material,"MaterialBlending",()=>o.MaterialBlending,"MaterialLoader",()=>o.MaterialLoader,"MathUtils",()=>o.MathUtils,"Matrix2",()=>o.Matrix2,"Matrix3",()=>o.Matrix3,"Matrix4",()=>o.Matrix4,"MaxEquation",()=>o.MaxEquation,"Mesh",()=>o.Mesh,"MeshBasicMaterial",()=>o.MeshBasicMaterial,"MeshDepthMaterial",()=>o.MeshDepthMaterial,"MeshDistanceMaterial",()=>o.MeshDistanceMaterial,"MeshLambertMaterial",()=>o.MeshLambertMaterial,"MeshMatcapMaterial",()=>o.MeshMatcapMaterial,"MeshNormalMaterial",()=>o.MeshNormalMaterial,"MeshPhongMaterial",()=>o.MeshPhongMaterial,"MeshPhysicalMaterial",()=>o.MeshPhysicalMaterial,"MeshStandardMaterial",()=>o.MeshStandardMaterial,"MeshToonMaterial",()=>o.MeshToonMaterial,"MinEquation",()=>o.MinEquation,"MirroredRepeatWrapping",()=>o.MirroredRepeatWrapping,"MixOperation",()=>o.MixOperation,"MultiplyBlending",()=>o.MultiplyBlending,"MultiplyOperation",()=>o.MultiplyOperation,"NearestFilter",()=>o.NearestFilter,"NearestMipMapLinearFilter",()=>o.NearestMipMapLinearFilter,"NearestMipMapNearestFilter",()=>o.NearestMipMapNearestFilter,"NearestMipmapLinearFilter",()=>o.NearestMipmapLinearFilter,"NearestMipmapNearestFilter",()=>o.NearestMipmapNearestFilter,"NeutralToneMapping",()=>o.NeutralToneMapping,"NeverCompare",()=>o.NeverCompare,"NeverDepth",()=>o.NeverDepth,"NeverStencilFunc",()=>o.NeverStencilFunc,"NoBlending",()=>o.NoBlending,"NoColorSpace",()=>o.NoColorSpace,"NoNormalPacking",()=>o.NoNormalPacking,"NoToneMapping",()=>o.NoToneMapping,"NormalAnimationBlendMode",()=>o.NormalAnimationBlendMode,"NormalBlending",()=>o.NormalBlending,"NormalGAPacking",()=>o.NormalGAPacking,"NormalRGPacking",()=>o.NormalRGPacking,"NotEqualCompare",()=>o.NotEqualCompare,"NotEqualDepth",()=>o.NotEqualDepth,"NotEqualStencilFunc",()=>o.NotEqualStencilFunc,"NumberKeyframeTrack",()=>o.NumberKeyframeTrack,"Object3D",()=>o.Object3D,"ObjectLoader",()=>o.ObjectLoader,"ObjectSpaceNormalMap",()=>o.ObjectSpaceNormalMap,"OctahedronGeometry",()=>o.OctahedronGeometry,"OneFactor",()=>o.OneFactor,"OneMinusConstantAlphaFactor",()=>o.OneMinusConstantAlphaFactor,"OneMinusConstantColorFactor",()=>o.OneMinusConstantColorFactor,"OneMinusDstAlphaFactor",()=>o.OneMinusDstAlphaFactor,"OneMinusDstColorFactor",()=>o.OneMinusDstColorFactor,"OneMinusSrcAlphaFactor",()=>o.OneMinusSrcAlphaFactor,"OneMinusSrcColorFactor",()=>o.OneMinusSrcColorFactor,"OrthographicCamera",()=>o.OrthographicCamera,"PCFShadowMap",()=>o.PCFShadowMap,"PCFSoftShadowMap",()=>o.PCFSoftShadowMap,"PMREMGenerator",()=>n.PMREMGenerator,"Path",()=>o.Path,"PerspectiveCamera",()=>o.PerspectiveCamera,"Plane",()=>o.Plane,"PlaneGeometry",()=>o.PlaneGeometry,"PlaneHelper",()=>o.PlaneHelper,"PointLight",()=>o.PointLight,"PointLightHelper",()=>o.PointLightHelper,"Points",()=>o.Points,"PointsMaterial",()=>o.PointsMaterial,"PolarGridHelper",()=>o.PolarGridHelper,"PolyhedronGeometry",()=>o.PolyhedronGeometry,"PositionalAudio",()=>o.PositionalAudio,"PropertyBinding",()=>o.PropertyBinding,"PropertyMixer",()=>o.PropertyMixer,"QuadraticBezierCurve",()=>o.QuadraticBezierCurve,"QuadraticBezierCurve3",()=>o.QuadraticBezierCurve3,"Quaternion",()=>o.Quaternion,"QuaternionKeyframeTrack",()=>o.QuaternionKeyframeTrack,"QuaternionLinearInterpolant",()=>o.QuaternionLinearInterpolant,"R11_EAC_Format",()=>o.R11_EAC_Format,"RED_GREEN_RGTC2_Format",()=>o.RED_GREEN_RGTC2_Format,"RED_RGTC1_Format",()=>o.RED_RGTC1_Format,"REVISION",()=>o.REVISION,"RG11_EAC_Format",()=>o.RG11_EAC_Format,"RGBADepthPacking",()=>o.RGBADepthPacking,"RGBAFormat",()=>o.RGBAFormat,"RGBAIntegerFormat",()=>o.RGBAIntegerFormat,"RGBA_ASTC_10x10_Format",()=>o.RGBA_ASTC_10x10_Format,"RGBA_ASTC_10x5_Format",()=>o.RGBA_ASTC_10x5_Format,"RGBA_ASTC_10x6_Format",()=>o.RGBA_ASTC_10x6_Format,"RGBA_ASTC_10x8_Format",()=>o.RGBA_ASTC_10x8_Format,"RGBA_ASTC_12x10_Format",()=>o.RGBA_ASTC_12x10_Format,"RGBA_ASTC_12x12_Format",()=>o.RGBA_ASTC_12x12_Format,"RGBA_ASTC_4x4_Format",()=>o.RGBA_ASTC_4x4_Format,"RGBA_ASTC_5x4_Format",()=>o.RGBA_ASTC_5x4_Format,"RGBA_ASTC_5x5_Format",()=>o.RGBA_ASTC_5x5_Format,"RGBA_ASTC_6x5_Format",()=>o.RGBA_ASTC_6x5_Format,"RGBA_ASTC_6x6_Format",()=>o.RGBA_ASTC_6x6_Format,"RGBA_ASTC_8x5_Format",()=>o.RGBA_ASTC_8x5_Format,"RGBA_ASTC_8x6_Format",()=>o.RGBA_ASTC_8x6_Format,"RGBA_ASTC_8x8_Format",()=>o.RGBA_ASTC_8x8_Format,"RGBA_BPTC_Format",()=>o.RGBA_BPTC_Format,"RGBA_ETC2_EAC_Format",()=>o.RGBA_ETC2_EAC_Format,"RGBA_PVRTC_2BPPV1_Format",()=>o.RGBA_PVRTC_2BPPV1_Format,"RGBA_PVRTC_4BPPV1_Format",()=>o.RGBA_PVRTC_4BPPV1_Format,"RGBA_S3TC_DXT1_Format",()=>o.RGBA_S3TC_DXT1_Format,"RGBA_S3TC_DXT3_Format",()=>o.RGBA_S3TC_DXT3_Format,"RGBA_S3TC_DXT5_Format",()=>o.RGBA_S3TC_DXT5_Format,"RGBDepthPacking",()=>o.RGBDepthPacking,"RGBFormat",()=>o.RGBFormat,"RGBIntegerFormat",()=>o.RGBIntegerFormat,"RGB_BPTC_SIGNED_Format",()=>o.RGB_BPTC_SIGNED_Format,"RGB_BPTC_UNSIGNED_Format",()=>o.RGB_BPTC_UNSIGNED_Format,"RGB_ETC1_Format",()=>o.RGB_ETC1_Format,"RGB_ETC2_Format",()=>o.RGB_ETC2_Format,"RGB_PVRTC_2BPPV1_Format",()=>o.RGB_PVRTC_2BPPV1_Format,"RGB_PVRTC_4BPPV1_Format",()=>o.RGB_PVRTC_4BPPV1_Format,"RGB_S3TC_DXT1_Format",()=>o.RGB_S3TC_DXT1_Format,"RGDepthPacking",()=>o.RGDepthPacking,"RGFormat",()=>o.RGFormat,"RGIntegerFormat",()=>o.RGIntegerFormat,"RawShaderMaterial",()=>o.RawShaderMaterial,"Ray",()=>o.Ray,"Raycaster",()=>o.Raycaster,"RectAreaLight",()=>o.RectAreaLight,"RedFormat",()=>o.RedFormat,"RedIntegerFormat",()=>o.RedIntegerFormat,"ReinhardToneMapping",()=>o.ReinhardToneMapping,"RenderObjectRefreshType",()=>o.RenderObjectRefreshType,"RenderTarget",()=>o.RenderTarget,"RenderTarget3D",()=>o.RenderTarget3D,"RepeatWrapping",()=>o.RepeatWrapping,"ReplaceStencilOp",()=>o.ReplaceStencilOp,"ReverseSubtractEquation",()=>o.ReverseSubtractEquation,"RingGeometry",()=>o.RingGeometry,"SIGNED_R11_EAC_Format",()=>o.SIGNED_R11_EAC_Format,"SIGNED_RED_GREEN_RGTC2_Format",()=>o.SIGNED_RED_GREEN_RGTC2_Format,"SIGNED_RED_RGTC1_Format",()=>o.SIGNED_RED_RGTC1_Format,"SIGNED_RG11_EAC_Format",()=>o.SIGNED_RG11_EAC_Format,"SRGBColorSpace",()=>o.SRGBColorSpace,"SRGBTransfer",()=>o.SRGBTransfer,"Scene",()=>o.Scene,"ShaderChunk",()=>n.ShaderChunk,"ShaderLib",()=>n.ShaderLib,"ShaderMaterial",()=>o.ShaderMaterial,"ShadowMaterial",()=>o.ShadowMaterial,"Shape",()=>o.Shape,"ShapeGeometry",()=>o.ShapeGeometry,"ShapePath",()=>o.ShapePath,"ShapeUtils",()=>o.ShapeUtils,"ShortType",()=>o.ShortType,"Skeleton",()=>o.Skeleton,"SkeletonHelper",()=>o.SkeletonHelper,"SkinnedMesh",()=>o.SkinnedMesh,"Source",()=>o.Source,"Sphere",()=>o.Sphere,"SphereGeometry",()=>o.SphereGeometry,"Spherical",()=>o.Spherical,"SphericalHarmonics3",()=>o.SphericalHarmonics3,"SplineCurve",()=>o.SplineCurve,"SpotLight",()=>o.SpotLight,"SpotLightHelper",()=>o.SpotLightHelper,"Sprite",()=>o.Sprite,"SpriteMaterial",()=>o.SpriteMaterial,"SrcAlphaFactor",()=>o.SrcAlphaFactor,"SrcAlphaSaturateFactor",()=>o.SrcAlphaSaturateFactor,"SrcColorFactor",()=>o.SrcColorFactor,"StaticCopyUsage",()=>o.StaticCopyUsage,"StaticDrawUsage",()=>o.StaticDrawUsage,"StaticReadUsage",()=>o.StaticReadUsage,"StereoCamera",()=>o.StereoCamera,"StreamCopyUsage",()=>o.StreamCopyUsage,"StreamDrawUsage",()=>o.StreamDrawUsage,"StreamReadUsage",()=>o.StreamReadUsage,"StringKeyframeTrack",()=>o.StringKeyframeTrack,"SubtractEquation",()=>o.SubtractEquation,"SubtractiveBlending",()=>o.SubtractiveBlending,"TOUCH",()=>o.TOUCH,"TangentSpaceNormalMap",()=>o.TangentSpaceNormalMap,"TetrahedronGeometry",()=>o.TetrahedronGeometry,"Texture",()=>o.Texture,"TextureLoader",()=>o.TextureLoader,"TextureSource",()=>o.TextureSource,"TextureUtils",()=>o.TextureUtils,"Timer",()=>o.Timer,"TimestampQuery",()=>o.TimestampQuery,"TorusGeometry",()=>o.TorusGeometry,"TorusKnotGeometry",()=>o.TorusKnotGeometry,"Triangle",()=>o.Triangle,"TriangleFanDrawMode",()=>o.TriangleFanDrawMode,"TriangleStripDrawMode",()=>o.TriangleStripDrawMode,"TrianglesDrawMode",()=>o.TrianglesDrawMode,"TubeGeometry",()=>o.TubeGeometry,"UVMapping",()=>o.UVMapping,"Uint16BufferAttribute",()=>o.Uint16BufferAttribute,"Uint32BufferAttribute",()=>o.Uint32BufferAttribute,"Uint8BufferAttribute",()=>o.Uint8BufferAttribute,"Uint8ClampedBufferAttribute",()=>o.Uint8ClampedBufferAttribute,"Uniform",()=>o.Uniform,"UniformsGroup",()=>o.UniformsGroup,"UniformsLib",()=>n.UniformsLib,"UniformsUtils",()=>o.UniformsUtils,"UnsignedByteType",()=>o.UnsignedByteType,"UnsignedInt101111Type",()=>o.UnsignedInt101111Type,"UnsignedInt248Type",()=>o.UnsignedInt248Type,"UnsignedInt5999Type",()=>o.UnsignedInt5999Type,"UnsignedIntType",()=>o.UnsignedIntType,"UnsignedShort4444Type",()=>o.UnsignedShort4444Type,"UnsignedShort5551Type",()=>o.UnsignedShort5551Type,"UnsignedShortType",()=>o.UnsignedShortType,"VSMShadowMap",()=>o.VSMShadowMap,"Vector2",()=>o.Vector2,"Vector3",()=>o.Vector3,"Vector4",()=>o.Vector4,"VectorKeyframeTrack",()=>o.VectorKeyframeTrack,"VideoFrameTexture",()=>o.VideoFrameTexture,"VideoTexture",()=>o.VideoTexture,"WebGL3DRenderTarget",()=>o.WebGL3DRenderTarget,"WebGLArrayRenderTarget",()=>o.WebGLArrayRenderTarget,"WebGLCoordinateSystem",()=>o.WebGLCoordinateSystem,"WebGLCubeRenderTarget",()=>n.WebGLCubeRenderTarget,"WebGLRenderTarget",()=>o.WebGLRenderTarget,"WebGLRenderer",()=>n.WebGLRenderer,"WebGLUtils",()=>n.WebGLUtils,"WebGPUCoordinateSystem",()=>o.WebGPUCoordinateSystem,"WebXRController",()=>o.WebXRController,"WireframeGeometry",()=>o.WireframeGeometry,"WrapAroundEnding",()=>o.WrapAroundEnding,"ZeroCurvatureEnding",()=>o.ZeroCurvatureEnding,"ZeroFactor",()=>o.ZeroFactor,"ZeroSlopeEnding",()=>o.ZeroSlopeEnding,"ZeroStencilOp",()=>o.ZeroStencilOp,"createCanvasElement",()=>o.createCanvasElement,"error",()=>o.error,"getConsoleFunction",()=>o.getConsoleFunction,"log",()=>o.log,"setConsoleFunction",()=>o.setConsoleFunction,"warn",()=>o.warn,"warnOnce",()=>o.warnOnce],32009);var l=e.i(32009);function i(e,t){let a;return(...r)=>{window.clearTimeout(a),a=window.setTimeout(()=>e(...r),t)}}let s=["x","y","top","bottom","left","right","width","height"];var c=e.i(46791);function u({ref:e,children:n,fallback:o,resize:c,style:d,gl:m,events:p=a.f,eventSource:h,eventPrefix:f,shadows:x,linear:g,flat:b,legacy:C,orthographic:S,frameloop:y,dpr:A,performance:T,raycaster:M,camera:v,scene:F,onPointerMissed:G,onCreated:_,...R}){r.useMemo(()=>(0,a.e)(l),[]);let B=(0,a.u)(),[w,L]=function({debounce:e,scroll:t,polyfill:a,offsetSize:n}={debounce:0,scroll:!1,offsetSize:!1}){var o,l,c;let u=a||("u"<typeof window?class{}:window.ResizeObserver);if(!u)throw Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");let[d,m]=(0,r.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),p=(0,r.useRef)({element:null,scrollContainers:null,resizeObserver:null,lastBounds:d,orientationHandler:null}),h=e?"number"==typeof e?e:e.scroll:null,f=e?"number"==typeof e?e:e.resize:null,x=(0,r.useRef)(!1);(0,r.useEffect)(()=>(x.current=!0,()=>void(x.current=!1)));let[g,b,C]=(0,r.useMemo)(()=>{let e=()=>{let e,t;if(!p.current.element)return;let{left:a,top:r,width:o,height:l,bottom:i,right:c,x:u,y:d}=p.current.element.getBoundingClientRect(),h={left:a,top:r,width:o,height:l,bottom:i,right:c,x:u,y:d};p.current.element instanceof HTMLElement&&n&&(h.height=p.current.element.offsetHeight,h.width=p.current.element.offsetWidth),Object.freeze(h),x.current&&(e=p.current.lastBounds,t=h,!s.every(a=>e[a]===t[a]))&&m(p.current.lastBounds=h)};return[e,f?i(e,f):e,h?i(e,h):e]},[m,n,h,f]);function S(){p.current.scrollContainers&&(p.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",C,!0)),p.current.scrollContainers=null),p.current.resizeObserver&&(p.current.resizeObserver.disconnect(),p.current.resizeObserver=null),p.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",p.current.orientationHandler))}function y(){p.current.element&&(p.current.resizeObserver=new u(C),p.current.resizeObserver.observe(p.current.element),t&&p.current.scrollContainers&&p.current.scrollContainers.forEach(e=>e.addEventListener("scroll",C,{capture:!0,passive:!0})),p.current.orientationHandler=()=>{C()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",p.current.orientationHandler))}return o=C,l=!!t,(0,r.useEffect)(()=>{if(l)return window.addEventListener("scroll",o,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",o,!0)},[o,l]),c=b,(0,r.useEffect)(()=>(window.addEventListener("resize",c),()=>void window.removeEventListener("resize",c)),[c]),(0,r.useEffect)(()=>{S(),y()},[t,C,b]),(0,r.useEffect)(()=>S,[]),[e=>{e&&e!==p.current.element&&(S(),p.current.element=e,p.current.scrollContainers=function e(t){let a=[];if(!t||t===document.body)return a;let{overflow:r,overflowX:n,overflowY:o}=window.getComputedStyle(t);return[r,n,o].some(e=>"auto"===e||"scroll"===e)&&a.push(t),[...a,...e(t.parentElement)]}(e),y())},d,g]}({scroll:!0,debounce:{scroll:50,resize:0},...c}),E=r.useRef(null),N=r.useRef(null);r.useImperativeHandle(e,()=>E.current);let D=(0,a.a)(G),j=r.useCallback(e=>null==D.current?void 0:D.current(e),[D]),[k,P]=r.useState(!1),[I,O]=r.useState(!1);if(k)throw k;if(I)throw I;let U=r.useRef(null),[W,H]=(0,a.b)(),z=r.useRef(null),V=()=>h?(0,a.i)(h)?h.current:h:N.current;r.useInsertionEffect(()=>()=>{let e=U.current;U.current=null,null==e||e.unmount()},[]),(0,a.c)(()=>{let e=E.current;L.width>0&&L.height>0&&e&&(U.current||(U.current=(0,a.d)(e)),U.current.configure({gl:m,scene:F,events:p,shadows:x,linear:g,flat:b,legacy:C,orthographic:S,frameloop:y,dpr:A,performance:T,raycaster:M,camera:v,size:L,onPointerMissed:j,onCreated:e=>{var t;z.current=e,null==e.events.connect||e.events.connect(null!=(t=V())?t:N.current),f&&e.setEvents({compute:(e,t)=>{let a=e[f+"X"],r=e[f+"Y"];t.pointer.set(a/t.size.width*2-1,-(2*(r/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==_||_(e)}}).catch(O),"fulfilled"===U.current.ready.status?U.current.render((0,t.jsx)(B,{children:(0,t.jsx)(a.E,{set:O,children:(0,t.jsx)(r.Suspense,{fallback:(0,t.jsx)(a.B,{set:P}),children:null!=n?n:null})})})):"pending"===U.current.ready.status&&H(U.current.ready))}),r.useEffect(()=>{var e;let t=null==(e=z.current)?void 0:e.get(),a=V();t&&a&&t.events.connected!==a&&(null==t.events.connect||t.events.connect(a))}),r.useEffect(()=>{let e=E.current;return()=>{var t;e.isConnected||null==(t=U.current)||t.unmount()}},[]);let q=h?"none":"auto";return(0,t.jsxs)("div",{ref:N,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:q,...d},...R,children:[(0,t.jsx)("div",{ref:w,style:{width:"100%",height:"100%"},children:(0,t.jsx)("canvas",{ref:E,style:{display:"block"},children:o})}),W]})}function d(e){return(0,t.jsx)(c.FiberProvider,{children:(0,t.jsx)(u,{...e})})}e.i(89499);var m=e.i(90874),p=e.i(58567),h=e.i(70703),f=e.i(67561),x=e.i(83402),g=e.i(49721),b=e.i(68757),C=e.i(18638);e.i(85269);var S=e.i(22831);let y=({onClick:e,icon:a,isActive:r,activeClass:n,label:o})=>(0,t.jsxs)("button",{onClick:e,className:`p-2 rounded-xl tesla-hover transition-all duration-300 group relative ${r?"bg-hud-elevated shadow-soft":""}`,title:o,children:[(0,t.jsx)(g.FontAwesomeIcon,{icon:a,className:`text-xl transition-all duration-300 ${r?n+" scale-110":"text-hud-muted group-hover:text-hud-main"}`}),r&&(0,t.jsx)("span",{className:`absolute -bottom-1 left-1/2 -translate-x-1/2 w-1 h-1 rounded-full ${n.replace("text-","bg-")} animate-soft-pulse`})]}),A=({layers:e,onToggle:a,label:n})=>{let[o,l]=(0,r.useState)(!1),i=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!o)return;let e=e=>{i.current&&!i.current.contains(e.target)&&l(!1)},t=e=>{"Escape"===e.key&&l(!1)};return document.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}},[o]);let s=e.some(e=>e.on);return(0,t.jsxs)("div",{ref:i,className:"relative",children:[(0,t.jsx)(y,{onClick:()=>l(e=>!e),icon:b.faLayerGroup,isActive:o||s,activeClass:"text-oBlue",label:n}),o&&(0,t.jsx)("div",{role:"menu","aria-label":n,className:"bg-hud-menu absolute right-0 [@media(max-height:500px)]:right-auto [@media(max-height:500px)]:left-0 top-full mt-2 z-50 w-[13rem] [@media(max-height:500px)]:w-[26rem] max-w-[calc(100vw-1rem)] max-h-[calc(100dvh-8rem)] overflow-y-auto p-2 rounded-2xl border border-hud shadow-2xl grid grid-cols-1 [@media(max-height:500px)]:grid-cols-2 gap-1",children:e.map(e=>(0,t.jsxs)("button",{role:"menuitemcheckbox","aria-checked":e.on,onClick:()=>a(e.key),className:`flex items-center gap-3 px-3 py-2.5 [@media(max-height:500px)]:py-2 rounded-xl text-left text-label tesla-hover ${e.on?"text-hud-main":"text-hud-muted"}`,children:[(0,t.jsx)(g.FontAwesomeIcon,{icon:e.icon,className:`w-4 ${e.on?e.color:""}`}),(0,t.jsx)("span",{className:"flex-1",children:e.label}),(0,t.jsx)(g.FontAwesomeIcon,{icon:b.faCheck,className:`w-3 ${e.on?"text-oBlue":"opacity-0"}`})]},e.key))})]})},T=()=>{let{t:e}=(0,S.useTranslation)(),{theme:a,themeMode:r,setTheme:n,states:o,toggleState:l,toggleExclusiveMode:i,cycleOceanMode:s}=(0,f.useOcearoContext)(),c={water:{icon:b.faWater,color:"text-oBlue",label:e("toolbar.oceanWater")},black:{icon:b.faBorderAll,color:"text-hud-main",label:e("toolbar.oceanBlack")},depth:{icon:b.faCube,color:"text-oGreen",label:e("toolbar.oceanDepth")}},u={auto:{icon:b.faCircleHalfStroke,label:e("toolbar.themeAuto",{theme:e(`toolbar.theme_${a}`)})},day:{icon:b.faSun,label:e("toolbar.theme_day")},dark:{icon:b.faMoon,label:e("toolbar.theme_dark")},night:{icon:b.faEye,label:e("toolbar.theme_night")}},d=u[r]||u.dark,m=c[o.oceanMode]?o.oceanMode:"black",p=c[m],h=[{key:"ais",on:!!o.ais,icon:b.faSatellite,color:"text-oGreen",label:e("toolbar.aisRadar")},{key:"showWind",on:!!o.showWind,icon:b.faWind,color:"text-oYellow",label:e("toolbar.layerWind")},{key:"showCurrent",on:!!o.showCurrent,icon:b.faWater,color:"text-oBlue",label:e("toolbar.layerCurrent")},{key:"showLaylines3D",on:!!o.showLaylines3D,icon:b.faRulerCombined,color:"text-oGreen",label:e("toolbar.laylines3D")},{key:"showPolar",on:!!o.showPolar,icon:b.faCompass,color:"text-oBlue",label:e("toolbar.polarView")},{key:"showSeamarks",on:!!o.showSeamarks,icon:b.faLifeRing,color:"text-oYellow",label:e("toolbar.layerSeamarks")}];return(0,t.jsxs)("div",{className:"flex items-center space-x-1 p-1.5 rounded-2xl",children:[(0,t.jsx)(y,{onClick:()=>i("autopilot"),icon:b.faShip,isActive:o.autopilot,activeClass:"text-oBlue",label:e("toolbar.autopilot")}),(0,t.jsx)(y,{onClick:()=>i("anchorWatch"),icon:b.faAnchor,isActive:o.anchorWatch,activeClass:"text-oYellow",label:e("toolbar.anchorWatch")}),(0,t.jsx)(y,{onClick:()=>i("parkingMode"),icon:b.faParking,isActive:o.parkingMode,activeClass:"text-oGreen",label:e("toolbar.parkingMode")}),(0,t.jsx)("div",{className:"h-6 w-[1px] bg-hud-border mx-0.5"}),(0,t.jsx)(y,{onClick:()=>{n(C.THEME_MODES[(C.THEME_MODES.indexOf(r)+1)%C.THEME_MODES.length])},icon:d.icon,isActive:"dark"!==r,activeClass:"text-hud-main",label:d.label}),(0,t.jsx)(y,{onClick:s,icon:p.icon,isActive:!0,activeClass:p.color,label:p.label}),(0,t.jsx)(A,{layers:h,onToggle:e=>l(e),label:e("toolbar.layers")})]})};var M=e.i(72466),v=e.i(85709);let F="batteries",G={FRESH_WATER:{id:"freshWater",labelKey:"tanks.freshWater",path:"tanks.freshWater.0.currentLevel",icon:b.faDroplet,color:"bg-oBlue"},FUEL:{id:"fuel",labelKey:"tanks.fuel",path:"tanks.fuel.0.currentLevel",icon:b.faGasPump,color:"bg-oYellow"},BLACK_WATER:{id:"blackWater",labelKey:"tanks.blackWater",path:"tanks.blackWater.0.currentLevel",icon:b.faToilet,color:"bg-hud-muted"}},_=({level:e,type:a})=>{let{t:r}=(0,S.useTranslation)(),n=Math.max(0,Math.min(100,e)),{labelKey:o,icon:l,color:i}=G[a],s=n<=20,c=i.replace("bg-","text-");return(0,t.jsxs)("div",{className:"flex items-center space-x-2",title:r(o),children:[(0,t.jsx)(g.FontAwesomeIcon,{icon:l,className:`text-xs ${c} opacity-60`}),(0,t.jsx)("div",{className:"relative w-14 h-[8px] rounded-full bg-hud-elevated/60 overflow-hidden",children:(0,t.jsx)("div",{className:`absolute left-0 top-0 h-full rounded-full ${s?"bg-oRed":i} transition-all duration-1000 ease-out`,style:{width:`${n}%`}})}),(0,t.jsxs)("span",{className:`text-caption font-semibold tabular-nums min-w-[28px] text-right ${s?"text-oRed animate-soft-pulse":"text-hud-main"}`,children:[n,"%"]})]})},R=({batteryLevel:e,batteryNumber:a,voltage:r})=>{let{t:n}=(0,S.useTranslation)(),o=Math.max(0,Math.min(100,e)),l=(0,M.isBatteryCharging)(r),i=o<=M.BATTERY_CONFIG.DANGER_THRESHOLD;return(0,t.jsxs)("div",{className:"flex items-center space-x-2",title:`${o}% — ${r?.toFixed(1)}V${l?" "+n("common.charging"):""}`,children:[(0,t.jsx)(g.FontAwesomeIcon,{icon:b.faBolt,className:`text-xs ${l?"text-oYellow animate-pulse":"text-oGreen opacity-60"}`}),(0,t.jsx)("div",{className:"relative w-14 h-[8px] rounded-full bg-hud-elevated/60 overflow-hidden",children:(0,t.jsx)("div",{className:`absolute left-0 top-0 h-full rounded-full ${i?"bg-oRed":l?"bg-oGreen":"bg-oBlue"} transition-all duration-1000 ease-out ${l?"shadow-[0_0_6px_var(--color-oGreen)]":""}`,style:{width:`${o}%`}})})]})},B=()=>{let[e,a]=(0,r.useState)(F),n=(0,r.useMemo)(()=>["electrical.batteries.1.capacity.stateOfCharge","electrical.batteries.1.voltage"],[]),o=(0,r.useMemo)(()=>["tanks.freshWater.0.currentLevel","tanks.fuel.0.currentLevel","tanks.blackWater.0.currentLevel"],[]),l=(0,v.useSignalKPaths)([...n,...o]),i=(0,r.useMemo)(()=>{let e=l["electrical.batteries.1.capacity.stateOfCharge"],t=l["electrical.batteries.1.voltage"];return[{level:null==e?(0,M.estimateStateOfCharge)(t):e,number:1,voltage:t}].filter(e=>null!=e.level&&!Number.isNaN(e.level))},[l]),s=(0,r.useMemo)(()=>{let e=l["tanks.freshWater.0.currentLevel"],t=l["tanks.fuel.0.currentLevel"],a=l["tanks.blackWater.0.currentLevel"];return{FRESH_WATER:null!=e?100*e:0,FUEL:null!=t?100*t:0,BLACK_WATER:null!=a?100*a:0}},[l]),c=()=>{a(e=>e===F?"tanks":F)},u=e===F;return(0,t.jsx)("div",{className:"p-1.5 rounded-2xl transition-all duration-300 cursor-pointer select-none",onClick:c,role:"button",tabIndex:0,"aria-label":`Toggle between ${u?"tanks":"batteries"} display`,onKeyDown:e=>"Enter"===e.key&&c(),children:(0,t.jsx)("div",{className:"flex flex-col space-y-1",children:u?(0,t.jsx)(t.Fragment,{children:i.map(e=>(0,t.jsx)(R,{batteryLevel:e.level,batteryNumber:e.number,voltage:e.voltage},e.number))}):(0,t.jsx)(t.Fragment,{children:Object.keys(G).map(e=>(0,t.jsx)(_,{type:e,level:s[e]},e))})})})},w=[.25,.35,.5,.7,1,1.4,2],L=({value:e,onChange:a})=>{let r,{t:n}=(0,S.useTranslation)(),o=(r=0,w.forEach((t,a)=>{Math.abs(t-e)<Math.abs(w[r]-e)&&(r=a)}),r),l=w[o]/.7,i=l>=1?`\xd7${Number(l.toFixed(1))}`:`\xf7${Number((1/l).toFixed(1))}`,s=e=>{let t=w[Math.max(0,Math.min(w.length-1,o+e))];t!==w[o]&&a(t)},c="w-9 h-9 flex items-center justify-center rounded-lg text-hud-main hover:bg-hud-elevated/60 disabled:opacity-30";return(0,t.jsxs)("div",{className:"flex items-center gap-1 rounded-xl bg-hud-bg/70 backdrop-blur-sm px-1 py-1",title:n("sceneScale.help"),children:[(0,t.jsx)("button",{type:"button",className:c,onClick:()=>s(-1),disabled:0===o,"aria-label":n("sceneScale.closer"),children:(0,t.jsx)(g.FontAwesomeIcon,{icon:b.faMinus})}),(0,t.jsx)("span",{className:"min-w-[3rem] text-center text-caption font-semibold tabular-nums text-hud-main",onDoubleClick:()=>a(.7),children:o===w.indexOf(.7)?"1:1":i}),(0,t.jsx)("button",{type:"button",className:c,onClick:()=>s(1),disabled:o===w.length-1,"aria-label":n("sceneScale.wider"),children:(0,t.jsx)(g.FontAwesomeIcon,{icon:b.faPlus})})]})},E=({side:e,panels:a,defaults:r,shown:n,onChange:o})=>{let{t:l}=(0,S.useTranslation)(),i=Object.keys(a),s=n["left"===e?"right":"left"],c=n[e],u=a[c]?c:r[e],d=(()=>{let e=i.indexOf(c);for(let t=1;t<=i.length;t++){let a=i[(e+t)%i.length];if(a!==s)return a}return c})();return(0,t.jsxs)("button",{type:"button",onClick:()=>o(e,d),"aria-label":l("hud.switchTo",{name:l(`hud.panel_${d}`)}),className:`flex flex-col gap-1 text-left cursor-pointer rounded-2xl focus-visible:outline focus-visible:outline-2 focus-visible:outline-oBlue ${"right"===e?"items-end":"items-start"}`,children:[i.map(e=>{let r=a[e];return(0,t.jsx)("div",{hidden:e!==u,children:(0,t.jsx)(r,{})},e)}),(0,t.jsx)("span",{className:"flex gap-1.5 px-1","aria-hidden":"true",children:i.map(e=>(0,t.jsx)("span",{className:`h-1.5 rounded-full transition-all ${e===u?"w-4 bg-hud-main":e===s?"w-1.5 bg-hud-muted opacity-30":"w-1.5 bg-hud-muted opacity-60"}`},e))})]})};var N=e.i(66799),D=e.i(37256),j=e.i(81574),k=e.i(38507),P=e.i(9617);let I=(0,D.coursePaths)("distance"),O=new Set([j.default.waypointPicker.description,k.default.waypointPicker.description]),U=async()=>{let e=await N.default.getCourse().catch(()=>null);await N.default.clearCourse();let t=(e?.nextPoint?.href||"").match(/^\/resources\/waypoints\/(.+)$/);if(!t)return;let a=await N.default.apiCall("/signalk/v2/api/resources/waypoints").catch(()=>null),r=a?.[t[1]];r&&O.has(r.description)&&await N.default.deleteResource("waypoints",t[1])},W=({canPlace:e})=>{let{t:a}=(0,S.useTranslation)(),{moved:n,placingWaypoint:o,message:l}=(0,r.useSyncExternalStore)(P.subscribeView,P.getViewState,P.getViewState),i=(0,v.useSignalKPaths)(I),s=(0,D.courseValue)(i,"distance"),[c,u]=(0,r.useState)(null),d=Number.isFinite(s)&&s!==c,[m,p]=(0,r.useState)(!1),h=async()=>{p(!0);try{await U(),u(s),(0,P.setViewMessage)(a("waypointPicker.cleared"))}catch(e){(0,P.setViewMessage)(a("waypointPicker.clearFailed",{error:e.message}))}finally{p(!1)}};(0,r.useEffect)(()=>{if(!l)return;let e=setTimeout(()=>(0,P.setViewMessage)(null),6e3);return()=>clearTimeout(e)},[l]),(0,r.useEffect)(()=>{!e&&o&&(0,P.setPlacingWaypoint)(!1)},[e,o]);let f="w-11 h-11 flex items-center justify-center rounded-xl bg-hud-bg/70 backdrop-blur-sm text-hud-main hover:bg-hud-elevated/60";return(0,t.jsxs)("div",{className:"flex flex-col items-end gap-2",children:[e&&(0,t.jsx)("button",{type:"button",onClick:()=>(0,P.setPlacingWaypoint)(!o),className:`${f} ${o?"!bg-oBlue text-white":""}`,title:a("waypointPicker.button"),"aria-label":a("waypointPicker.button"),"aria-pressed":o,children:(0,t.jsx)(g.FontAwesomeIcon,{icon:b.faLocationDot})}),d&&(0,t.jsx)("button",{type:"button",onClick:h,disabled:m,className:`${f} disabled:opacity-40`,title:a("waypointPicker.clear"),"aria-label":a("waypointPicker.clear"),children:(0,t.jsx)(g.FontAwesomeIcon,{icon:b.faTrashCan})}),n&&(0,t.jsx)("button",{type:"button",onClick:P.requestRecenter,className:f,title:a("viewButtons.recenter"),"aria-label":a("viewButtons.recenter"),children:(0,t.jsx)(g.FontAwesomeIcon,{icon:b.faCrosshairs})}),(o||l)&&(0,t.jsx)("div",{className:"max-w-[16rem] rounded-xl bg-hud-bg/80 backdrop-blur-sm px-3 py-2 text-caption text-hud-main text-right",children:l||a("waypointPicker.hint")})]})};var H=e.i(39271);let z=e=>{let[t,a]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let t=window.matchMedia(e),r=()=>a(t.matches);return r(),t.addEventListener("change",r),()=>t.removeEventListener("change",r)},[e]),t},V=(0,h.default)(()=>e.A(36258),{loadableGenerated:{modules:[59465]},ssr:!1}),q=(0,h.default)(()=>e.A(11220),{loadableGenerated:{modules:[27404]},ssr:!1}),$=(0,h.default)(()=>e.A(97820),{loadableGenerated:{modules:[69675]},ssr:!1}),K=(0,h.default)(()=>e.A(29882),{loadableGenerated:{modules:[56665]}}),X=(0,h.default)(()=>e.A(93170),{loadableGenerated:{modules:[50226]}}),Q=(0,h.default)(()=>e.A(93889),{loadableGenerated:{modules:[58166]}}),Y=(0,h.default)(()=>e.A(64390),{loadableGenerated:{modules:[39554]}}),Z=(0,h.default)(()=>e.A(48217),{loadableGenerated:{modules:[14774]}}),J=(0,h.default)(()=>e.A(30150),{loadableGenerated:{modules:[84237]}}),ee=(0,h.default)(()=>e.A(34882),{loadableGenerated:{modules:[77021]}}),et=(0,h.default)(()=>e.A(59499),{loadableGenerated:{modules:[85003]}}),ea=(0,h.default)(()=>e.A(43322),{loadableGenerated:{modules:[56101]}}),er=(0,h.default)(()=>e.A(32673),{loadableGenerated:{modules:[36540]}}),en=(0,h.default)(()=>e.A(66984),{loadableGenerated:{modules:[79261]}}),eo=(0,h.default)(()=>e.A(32598),{loadableGenerated:{modules:[79224]}}),el=(0,h.default)(()=>e.A(73321),{loadableGenerated:{modules:[78938]}}),ei=(0,h.default)(()=>e.A(82041),{loadableGenerated:{modules:[41994]}}),es=(0,h.default)(()=>e.A(71762),{loadableGenerated:{modules:[91999]}}),ec=(0,h.default)(()=>e.A(31987),{loadableGenerated:{modules:[81788]}}),eu=(0,h.default)(()=>e.A(77324),{loadableGenerated:{modules:[64587]}}),ed=(0,h.default)(()=>e.A(93540),{loadableGenerated:{modules:[84809]}}),em=(0,h.default)(()=>e.A(11657),{loadableGenerated:{modules:[75058]}}),ep=()=>{let{gl:e,scene:t}=(0,m.useThree)();return(0,r.useEffect)(()=>{if(window&&e){window.__OCEARO_RENDERER=e;let t=setInterval(()=>{e&&e.info&&(window.__OCEARO_RENDER_INFO=e.info)},1e3);return()=>{delete window.__OCEARO_RENDERER,delete window.__OCEARO_RENDER_INFO,clearInterval(t)}}},[e,t]),null},eh=({fps:e})=>{let t=(0,m.useThree)(e=>e.invalidate);return(0,r.useEffect)(()=>{let a=setInterval(()=>t(),1e3/e);return()=>clearInterval(a)},[e,t]),null},ef={depth:ei,wind:ec,speed:eu,tide:es},ex={left:"depth",right:"tide"};e.s(["default",0,({active:e=!0,fullscreen:a=!1})=>{let[n,l]=(e=>{let[t,a]=(0,r.useState)(()=>({...e,...x.default.get("hudPanels")||{}}));return[t,(e,t)=>{a(a=>{let r={...a,[e]:t};return x.default.set("hudPanels",r),r})}]})(ex),[i]=(0,r.useState)(p.getRenderProfile);(0,r.useEffect)(()=>{document.documentElement.dataset.renderProfile=i.id},[i.id]);let s=i.fps<60,{states:c,theme:u}=(0,f.useOcearoContext)(),m=(0,H.useReplay)().active,[h,g]=(0,r.useState)(null),[b,C]=(0,r.useState)(()=>x.default.get("aisLengthScalingFactor")||.7),[S,y]=(0,r.useState)(!0),[A]=(0,r.useState)(()=>x.default.get("hudStyle")||"minimal"),M="classic"===A,v=z("(min-width: 1024px) and (min-height: 600px)"),F=a&&!M&&v,G=z("(max-height: 500px)"),_=z("(max-width: 639px)"),R=!F&&!M,w=!c.anchorWatch&&!c.parkingMode&&!c.moored&&!m;(0,r.useEffect)(()=>{y(!1!==x.default.getAll().showAttitudeIndicator)},[]);let N="day"===u&&"depth"===c.oceanMode;return(0,t.jsxs)("div",{className:"w-full h-full relative overflow-hidden","data-scene":N?"light":void 0,children:[(0,t.jsxs)("div",{className:"absolute top-2 left-2 right-2 z-40 flex items-center justify-between","data-hud-solid":!0,children:[(0,t.jsx)(T,{}),(0,t.jsxs)("div",{className:"hidden sm:flex items-center space-x-4 min-w-0 shrink-0",children:[(0,t.jsx)(ed,{compact:!a}),(0,t.jsx)(B,{})]})]}),(0,t.jsxs)("div",{className:"absolute top-14 right-2 z-30 hidden sm:flex flex-col items-end gap-2","data-hud-solid":!0,children:[(0,t.jsx)(L,{value:b,onChange:e=>{x.default.set("aisLengthScalingFactor",e),C(e)}}),(0,t.jsx)(W,{canPlace:!c.parkingMode&&!c.anchorWatch})]}),(0,t.jsxs)("div",{className:"absolute top-14 left-2 z-30","data-hud-solid":!0,children:[!c.anchorWatch&&(0,t.jsx)(K,{}),c.anchorWatch&&(0,t.jsx)(Y,{}),!M&&(0,t.jsx)(et,{omitDepth:!0,maxItems:F?4:3}),!c.parkingMode&&(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(em,{})})]}),M&&S&&(0,t.jsx)("div",{className:"absolute top-14 right-2 z-20",children:(0,t.jsx)(J,{})}),h&&!R&&(0,t.jsx)("div",{"data-hud-solid":!0,className:`hud-stack absolute z-30 w-96 max-h-[calc(100%-5rem)] flex flex-col ${M?"top-28 left-2":"top-14 right-3"}`,children:(0,t.jsx)(ee,{content:h,onClose:()=>g(null)})}),F&&(0,t.jsx)("div",{className:"absolute left-3 bottom-3 z-20","data-hud-solid":!0,children:(0,t.jsx)(E,{side:"left",panels:ef,defaults:ex,shown:n,onChange:l})}),F&&(0,t.jsx)("div",{className:"absolute right-3 bottom-3 z-20","data-hud-solid":!0,children:(0,t.jsx)(E,{side:"right",panels:ef,defaults:ex,shown:n,onChange:l})}),!m&&(0,t.jsx)("div",{"data-hud-solid":!0,className:"absolute right-2 top-14 z-30 max-w-[calc(100%-10rem)] sm:right-auto sm:left-1/2 sm:-translate-x-1/2 sm:max-w-[calc(100%-12rem)]",children:(0,t.jsx)(el,{})}),(c.showWind||c.showCurrent)&&(0,t.jsx)("div",{"data-hud-solid":!0,className:`absolute top-14 z-30 ${_?"left-36 right-2":"left-1/2 -translate-x-1/2 w-[30rem] max-w-[calc(100%-12rem)]"}`,children:(0,t.jsx)(eo,{compact:G||_,wind:!!c.showWind,current:!!c.showCurrent})}),R?(0,t.jsxs)("div",{"data-hud-solid":!0,className:`hud-stack absolute bottom-2 z-30 flex flex-col gap-2 min-h-0 max-h-[calc(100%-4.5rem)] pointer-events-none [&>*]:pointer-events-auto
|
|
2
|
+
${G?"right-40 w-[min(24rem,calc(100%-21rem))]":"left-16 right-16 sm:left-auto sm:w-[26rem]"}`,children:[h&&(0,t.jsx)("div",{className:"min-h-0 flex flex-col",children:(0,t.jsx)(ee,{content:h,onClose:()=>g(null)})}),!(G&&h)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"empty:hidden shrink-0 flex justify-center",children:(0,t.jsx)(en,{})}),c.parkingMode&&(0,t.jsx)("div",{className:"empty:hidden shrink-0 tesla-card !p-3 !rounded-2xl",children:(0,t.jsx)(er,{})}),w&&(0,t.jsx)("div",{className:"empty:hidden shrink-0 [&>*]:max-w-none",children:(0,t.jsx)(ea,{})})]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"absolute left-1/2 -translate-x-1/2 bottom-3 z-30 max-w-[calc(100%-1rem)]",children:(0,t.jsx)(en,{})}),c.parkingMode&&(0,t.jsx)("div",{className:"absolute left-1/2 -translate-x-1/2 bottom-3 z-20 max-w-[calc(100%-9rem)]",children:(0,t.jsx)(er,{})}),w&&(0,t.jsx)("div",{"data-hud-solid":!0,className:`hud-stack absolute left-1/2 -translate-x-1/2 z-20 ${M?"bottom-24 max-w-[calc(100%-9rem)]":"bottom-3 max-w-[calc(100%-41rem)]"}`,children:(0,t.jsx)(ea,{})})]}),(M||R)&&(G&&!M?(0,t.jsxs)("div",{className:"absolute right-2 bottom-2 z-20 flex items-end","data-hud-solid":!0,children:[(0,t.jsx)(Z,{}),(0,t.jsx)(Q,{})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"absolute left-2 bottom-2 z-20 flex flex-col items-center","data-hud-solid":!0,children:(0,t.jsx)(Z,{})}),(0,t.jsx)("div",{className:"absolute right-2 bottom-2 z-20 flex flex-col items-center","data-hud-solid":!0,children:(0,t.jsx)(Q,{})})]})),M&&!c.anchorWatch&&(0,t.jsx)("div",{className:"absolute bottom-2 left-1/2 transform -translate-x-1/2 z-10",children:(0,t.jsx)(X,{})}),(0,t.jsx)("div",{className:"absolute left-1/2 transform -translate-x-1/2 w-full h-full",children:(0,t.jsxs)(d,{style:{width:"100%",height:"100%"},shadows:!1,frameloop:e?s?"demand":"always":"never",dpr:i.dpr,performance:{min:.5},gl:{antialias:i.antialias,powerPreference:"low-power",physicallyCorrectLights:!1,toneMapping:o.NoToneMapping,toneMappingExposure:1,shadowMap:{enabled:!1},precision:"lowp"},children:[(0,t.jsx)(ep,{}),e&&s&&(0,t.jsx)(eh,{fps:i.fps}),c.parkingMode?(0,t.jsx)(q,{onUpdateInfoPanel:g},b):c.anchorWatch?(0,t.jsx)($,{onUpdateInfoPanel:g},b):(0,t.jsx)(V,{onUpdateInfoPanel:g,selection:h},b)]})})]})}],47141)},23595,function(e){e.n(e.i(47141))}]);
|