ocearo-ui 2.1.2 → 2.1.3

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.
Files changed (97) hide show
  1. package/404.html +1 -1
  2. package/README.fr.md +9 -7
  3. package/README.md +9 -7
  4. package/__next.__PAGE__.txt +3 -3
  5. package/__next._full.txt +3 -3
  6. package/__next._tree.txt +2 -2
  7. package/_next/static/chunks/0ath9h2eo-m4-.js +1 -0
  8. package/_next/static/chunks/0bxzs0khjn1uj.js +1 -0
  9. package/_next/static/chunks/0ejjon45nq_-h.js +9 -0
  10. package/_next/static/chunks/0glm63vhzbxk5.js +9 -0
  11. package/_next/static/chunks/0n5v9mjln3x9c.js +121 -0
  12. package/_next/static/chunks/{1bvrvkcwf3ge-.js → 0ngl63fz0a-bo.js} +1 -1
  13. package/_next/static/chunks/0vhk5q54me91_.js +1 -0
  14. package/_next/static/chunks/0wi5jop1ihbm6.js +2 -0
  15. package/_next/static/chunks/1442uc2w4y1ve.js +503 -0
  16. package/_next/static/chunks/18vlmqe7txbmt.js +1 -0
  17. package/_next/static/chunks/{3utjjgdhnlx86.js → 192c42s2wc7qe.js} +1 -1
  18. package/_next/static/chunks/1_twx50ejqan5.js +1 -0
  19. package/_next/static/chunks/1na56snuhu-pc.js +346 -0
  20. package/_next/static/chunks/1vchkqgn-xw-o.js +1 -0
  21. package/_next/static/chunks/21408p9d6c0sg.js +1 -0
  22. package/_next/static/chunks/2393lwi8kee3m.js +48 -0
  23. package/_next/static/chunks/25v2cwta2fy-7.js +393 -0
  24. package/_next/static/chunks/28wfa6j-9g_qc.js +1 -0
  25. package/_next/static/chunks/2cecf_xnd_9em.js +1 -0
  26. package/_next/static/chunks/2die6btm3_mhq.js +1 -0
  27. package/_next/static/chunks/{18_i6mf6hb_c7.js → 2gsiwp60towtx.js} +1 -1
  28. package/_next/static/chunks/2ijx7rln4jshb.css +3 -0
  29. package/_next/static/chunks/2qch0at4eelx8.js +1 -0
  30. package/_next/static/chunks/2qylgmdj-32um.js +503 -0
  31. package/_next/static/chunks/2xntuu6mzh41s.js +1 -0
  32. package/_next/static/chunks/30p1dpgmonstj.js +1 -0
  33. package/_next/static/chunks/31p7nz0hfuym7.js +1 -0
  34. package/_next/static/chunks/{1e-w_-usen7fy.js → 34nhy77liurum.js} +2 -2
  35. package/_next/static/chunks/3h_m2s30sr9mt.js +430 -0
  36. package/_next/static/chunks/3j453-2u58qbv.js +1 -0
  37. package/_next/static/chunks/3k-r-4veivdjr.js +1 -0
  38. package/_next/static/chunks/3nv6p6vvu2zlg.js +1 -0
  39. package/_next/static/chunks/3yz0mxxv4vrfg.js +1 -0
  40. package/_next/static/chunks/3z29h80ysf4f1.js +739 -0
  41. package/_next/static/chunks/40b8ooaw6x7my.js +180 -0
  42. package/_not-found/__next._full.txt +2 -2
  43. package/_not-found/__next._not-found.__PAGE__.txt +2 -2
  44. package/_not-found/__next._tree.txt +2 -2
  45. package/_not-found.html +1 -1
  46. package/_not-found.txt +2 -2
  47. package/boats/boats.json +11 -19
  48. package/boats/windsurf/assets/license.txt +6 -8
  49. package/boats/windsurf/assets/rider.glb +0 -0
  50. package/boats/wingfoil/assets/license.txt +9 -0
  51. package/boats/wingfoil/assets/rider.glb +0 -0
  52. package/guide/bathymetry.jpg +0 -0
  53. package/guide/weather.jpg +0 -0
  54. package/index.html +1 -1
  55. package/index.txt +3 -3
  56. package/package.json +2 -2
  57. package/settings/__next._full.txt +3 -3
  58. package/settings/__next._tree.txt +2 -2
  59. package/settings/__next.settings.__PAGE__.txt +3 -3
  60. package/settings.html +1 -1
  61. package/settings.txt +3 -3
  62. package/_next/static/chunks/0-19-ljntm5ig.js +0 -1
  63. package/_next/static/chunks/0-g-ujyrfgutp.js +0 -2
  64. package/_next/static/chunks/0-jqvc-r0kh0c.js +0 -1
  65. package/_next/static/chunks/05do10p9ldt1p.js +0 -409
  66. package/_next/static/chunks/0c91q-13wh8hk.js +0 -1
  67. package/_next/static/chunks/0fv1wwxeyagln.js +0 -446
  68. package/_next/static/chunks/0jucaltuccn03.js +0 -1
  69. package/_next/static/chunks/0m7wbuocx-b4_.js +0 -9
  70. package/_next/static/chunks/0o7hu-sypv2u9.js +0 -1
  71. package/_next/static/chunks/0ujzg6ofy2r73.js +0 -1
  72. package/_next/static/chunks/162bfkgcudvew.js +0 -9
  73. package/_next/static/chunks/1bo0ke8gjc1c2.js +0 -1
  74. package/_next/static/chunks/1do-2zwq3ws0f.js +0 -346
  75. package/_next/static/chunks/1ho2ekxa9io1_.js +0 -1
  76. package/_next/static/chunks/1m3-nchdgcxy1.css +0 -3
  77. package/_next/static/chunks/271ys-u920uqd.js +0 -564
  78. package/_next/static/chunks/2_iau6x7s0vil.js +0 -1131
  79. package/_next/static/chunks/2ab6q6u6uo_bf.js +0 -1
  80. package/_next/static/chunks/2pt-apz8_pa4j.js +0 -1
  81. package/_next/static/chunks/2rnpgrmuyhpkd.js +0 -119
  82. package/_next/static/chunks/2w71oj1brox5z.js +0 -1
  83. package/_next/static/chunks/3e5jmzthktu9w.js +0 -1
  84. package/_next/static/chunks/3r8nellt-dsed.js +0 -1
  85. package/_next/static/chunks/3wwn1rti8oc_r.js +0 -1
  86. package/_next/static/chunks/41odv061mfm6t.js +0 -1
  87. package/boats/optimist/Scene.jsx +0 -28
  88. package/boats/optimist/assets/license.txt +0 -11
  89. package/boats/optimist/assets/scene-transformed.glb +0 -0
  90. package/boats/sailboat/Scene.jsx +0 -21
  91. package/boats/sailboat/assets/license.txt +0 -10
  92. package/boats/sailboat/assets/scene-transformed.glb +0 -0
  93. package/boats/windsurf/Scene.jsx +0 -22
  94. package/boats/windsurf/assets/scene-transformed.glb +0 -0
  95. /package/_next/static/{m52l9mE01yTljNwbWjYQ7 → RbyYYNpJGkiHnU7YTHoaU}/_buildManifest.js +0 -0
  96. /package/_next/static/{m52l9mE01yTljNwbWjYQ7 → RbyYYNpJGkiHnU7YTHoaU}/_clientMiddlewareManifest.js +0 -0
  97. /package/_next/static/{m52l9mE01yTljNwbWjYQ7 → RbyYYNpJGkiHnU7YTHoaU}/_ssgManifest.js +0 -0
@@ -0,0 +1,121 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,30997,e=>{"use strict";var t=e.i(71645);e.s(["default",0,e=>{(0,t.useEffect)(()=>{let t=()=>{let t=e.current;if(!t)return;let a=t.getBoundingClientRect(),r=[...document.querySelectorAll("[data-hud-solid]")].some(e=>{let t;return null!==e.offsetParent&&(t=e.getBoundingClientRect(),a.left<t.right&&a.right>t.left&&a.top<t.bottom&&a.bottom>t.top)});t.style.visibility=r?"hidden":"visible"};t();let a=setInterval(t,250);return()=>clearInterval(a)},[e])}])},93116,e=>{"use strict";var t=e.i(43476),a=e.i(71645),r=e.i(95393),i=e.i(90072);let o=`
2
+ attribute vec3 aBase;
3
+ attribute vec2 aDir;
4
+ attribute vec3 aColor;
5
+ attribute vec2 aLenSpeed;
6
+ attribute float aSeed;
7
+ uniform vec3 uCam;
8
+ uniform float uTime;
9
+ uniform float uWidth;
10
+ uniform float uTravel;
11
+ uniform float uPace;
12
+ uniform float uFadeNear;
13
+ uniform float uStill;
14
+ uniform float uScreen;
15
+ varying vec3 vColor;
16
+ varying float vAlpha;
17
+ void main() {
18
+ vec3 d = normalize(vec3(aDir, 0.0));
19
+ // Still arrows stay put at full strength (a chart plotter's current arrows)
20
+ float phase = uStill > 0.5 ? 0.5 : fract(uTime * aLenSpeed.y * uPace / max(uTravel, 1e-3) + aSeed);
21
+ vec3 base = aBase + d * (phase - 0.5) * uTravel;
22
+ // Turn the arrow about its axis towards the camera
23
+ vec3 toCam = normalize(uCam - base);
24
+ vec3 side = cross(toCam, d);
25
+ side = length(side) < 1e-3 ? vec3(-d.y, d.x, 0.0) : normalize(side);
26
+ // Screen-sized: lengths and width are shares of the distance to the
27
+ // camera, so a far arrow reads as well as a near one
28
+ float k = uScreen > 0.0 ? length(uCam - aBase) * uScreen : 1.0;
29
+ vec3 p = base + side * position.x * uWidth * k + d * position.y * aLenSpeed.x * k;
30
+ vColor = aColor;
31
+ // Faded close to the camera, where an arrow would fill the view
32
+ vAlpha = (uStill > 0.5 ? 1.0 : pow(sin(3.14159 * phase), 0.6)) * (uFadeNear > 0.0 ? smoothstep(uFadeNear * 0.5, uFadeNear, length(uCam - base)) : 1.0);
33
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(p, 1.0);
34
+ }
35
+ `,n=`
36
+ uniform float uOpacity;
37
+ varying vec3 vColor;
38
+ varying float vAlpha;
39
+ void main() {
40
+ gl_FragColor = vec4(vColor, vAlpha * uOpacity);
41
+ #include <colorspace_fragment>
42
+ }
43
+ `;e.s(["default",0,({items:e,width:l,travel:u=0,pace:s=0,opacity:c=.9,fadeNear:d=0,still:f=!1,screen:h=0,renderOrder:m=3})=>{let{geometry:p,material:v}=(0,a.useMemo)(()=>{let e,t=((e=new i.Shape).moveTo(-.16,-.5),e.lineTo(.16,-.5),e.lineTo(.16,.08),e.lineTo(.5,.08),e.lineTo(0,.5),e.lineTo(-.5,.08),e.lineTo(-.16,.08),e.closePath(),new i.ShapeGeometry(e)),a=new i.InstancedBufferGeometry;a.index=t.index,a.setAttribute("position",t.attributes.position),a.setAttribute("aBase",new i.InstancedBufferAttribute(new Float32Array(1200),3)),a.setAttribute("aDir",new i.InstancedBufferAttribute(new Float32Array(800),2)),a.setAttribute("aColor",new i.InstancedBufferAttribute(new Float32Array(1200),3)),a.setAttribute("aLenSpeed",new i.InstancedBufferAttribute(new Float32Array(800),2));let r=new Float32Array(400);for(let e=0;e<400;e++)r[e]=.618034*e%1;return a.setAttribute("aSeed",new i.InstancedBufferAttribute(r,1)),a.instanceCount=0,{geometry:a,material:new i.ShaderMaterial({uniforms:{uCam:{value:new i.Vector3},uTime:{value:0},uWidth:{value:1},uTravel:{value:1},uPace:{value:1},uOpacity:{value:c},uFadeNear:{value:0},uStill:{value:0},uScreen:{value:0}},vertexShader:o,fragmentShader:n,transparent:!0,depthWrite:!1,side:i.DoubleSide})}},[]);(0,a.useEffect)(()=>()=>{p.dispose(),v.dispose()},[p,v]),(0,a.useEffect)(()=>{let t=Math.min(e.length,400),a=p.attributes;for(let r=0;r<t;r++){let t=e[r];a.aBase.array.set([t.x,t.y,t.z],3*r),a.aDir.array.set([t.u,t.v],2*r),a.aColor.array.set(t.color,3*r),a.aLenSpeed.array.set([t.len,t.speed],2*r)}["aBase","aDir","aColor","aLenSpeed"].forEach(e=>{a[e].needsUpdate=!0}),p.instanceCount=t},[p,e]),(0,a.useEffect)(()=>{let e=v.uniforms;e.uWidth.value=l,e.uTravel.value=u,e.uPace.value=s,e.uOpacity.value=c,e.uFadeNear.value=d,e.uStill.value=+!!f,e.uScreen.value=h},[v,l,u,s,c,d,f,h]);let M=(0,a.useRef)(),g=(0,a.useMemo)(()=>new i.Vector3,[]);return(0,r.useFrame)(({camera:e,clock:t})=>{M.current&&(M.current.updateWorldMatrix(!0,!1),v.uniforms.uCam.value.copy(M.current.worldToLocal(g.copy(e.position))),v.uniforms.uTime.value=t.elapsedTime)}),(0,t.jsx)("mesh",{ref:M,geometry:p,material:v,frustumCulled:!1,renderOrder:m})}])},78311,e=>{"use strict";var t=e.i(43476),a=e.i(71645),r=e.i(60099);e.i(85269);var i=e.i(22831),o=e.i(93116),n=e.i(30997);let l=[.86,.22,.2],u=[.16,.48,.86],s=({children:e})=>{let r=(0,a.useRef)(null);return(0,n.default)(r),(0,t.jsx)("div",{ref:r,style:{transform:"translateY(-1.1rem)"},children:e})};e.s(["default",0,({items:e,width:n,screen:c=0,fadeNear:d=0,format:f=e=>e.toFixed(1),slackLabel:h="slack",maxLabels:m=12,renderOrder:p=3})=>{let{t:v}=(0,i.useTranslation)(),{borders:M,fills:g}=(0,a.useMemo)(()=>{let t=e.filter(e=>e.speed>=.051444457477040344);return{borders:t.map(e=>({...e,len:e.len+.5*n,color:e.trend>.05?l:e.trend<-.05?u:[.06,.09,.12]})),fills:t}},[e,n]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.default,{items:M,width:1.35*n,screen:c,still:!0,fadeNear:d,opacity:.95,renderOrder:p}),(0,t.jsx)(o.default,{items:g,width:n,screen:c,still:!0,fadeNear:d,opacity:.95,renderOrder:p+1}),e.slice(0,m).map(e=>{let a=e.speed<.051444457477040344;return(0,t.jsx)(r.Html,{position:[e.x,e.y,e.z],center:!0,zIndexRange:[4,0],style:{pointerEvents:"none"},children:(0,t.jsx)(s,{children:a?(0,t.jsx)("div",{className:"rounded-md border-2 border-oBlue bg-hud-bg/80 px-1.5 text-caption font-semibold uppercase tracking-wide text-hud-main whitespace-nowrap",children:v(`meteo.${h}`)}):(0,t.jsx)("div",{className:"rounded px-1 text-caption font-bold tabular-nums leading-tight whitespace-nowrap",style:{color:"#fff",background:"rgba(10, 16, 22, 0.72)"},children:f(1.943844*e.speed)})})},e.key)})]})}])},15126,e=>{"use strict";var t=e.i(43476),a=e.i(71645),r=e.i(95393),i=e.i(90072),o=e.i(92923),n=e.i(30728),l=e.i(27530),u=e.i(83402),s=e.i(85709),c=e.i(78461),d=e.i(3666),f=e.i(54983),h=e.i(69435),m=e.i(88608),p=e.i(78311),v=e.i(18032),M=e.i(83646);let g=["navigation.position","environment.wind.speedTrue","environment.wind.directionTrue"],y=(e,t)=>e&&"windy"!==e?(0,f.colorAt)(e,t/20):(0,d.windColor)(t),w=`
44
+ uniform float uScale;
45
+ varying vec2 vGround;
46
+ varying vec3 vWorld;
47
+ void main() {
48
+ vGround = position.xy / uScale;
49
+ vec4 w = modelMatrix * vec4(position, 1.0);
50
+ vWorld = w.xyz;
51
+ gl_Position = projectionMatrix * viewMatrix * w;
52
+ }
53
+ `,b=`
54
+ uniform float uScale;
55
+ uniform float uTop; // top of the air layer, world y
56
+ uniform float uTime;
57
+ uniform float uMaxSpeed; // top of the colour scale, m/s
58
+ uniform float uOpacity;
59
+ uniform float uLength; // metres of air for ~63 % of the opacity
60
+ uniform float uFlow;
61
+ uniform sampler2D uMap;
62
+ varying vec2 vGround;
63
+ varying vec3 vWorld;
64
+ ${h.NOISE_GLSL}
65
+ ${h.FIELD_GLSL}
66
+ void main() {
67
+ // Air the view ray crosses from the top of the layer down to the water
68
+ vec3 P = vWorld;
69
+ vec3 C = cameraPosition;
70
+ vec3 E = C.y > uTop ? C + (P - C) * ((C.y - uTop) / max(C.y - P.y, 1e-3)) : C;
71
+ float L = length(P - E) / uScale;
72
+ vec2 flow = flowAt(vGround);
73
+ float speed = length(flow);
74
+ float t = clamp(speed / uMaxSpeed, 0.0, 1.0);
75
+ vec3 col = texture2D(uMap, vec2(t, 0.5)).rgb;
76
+ // Gusty wisps carried by the wind, stretched along it
77
+ vec2 dir = speed > 1e-3 ? flow / speed : vec2(0.0, 1.0);
78
+ vec2 drift = vGround - flow * uTime * uFlow;
79
+ vec2 q = vec2(dot(drift, dir) / 1400.0, dot(drift, vec2(-dir.y, dir.x)) / 220.0);
80
+ float n = fbm(vec3(q, uTime * 0.05));
81
+ col *= 0.88 + 0.28 * n;
82
+ // A floor so the air right around the boat shows its colour, more
83
+ // with the depth of air crossed towards the horizon
84
+ float alpha = uOpacity * (0.3 + 0.7 * (1.0 - exp(-L / uLength))) * (0.25 + 1.5 * n * n);
85
+ alpha *= fieldMask(vGround);
86
+ if (alpha < 0.004) discard;
87
+ gl_FragColor = vec4(col, clamp(alpha, 0.0, 1.0));
88
+ #include <colorspace_fragment>
89
+ }
90
+ `,x=(e,t)=>({east:(t.longitude-e.lon)*Math.PI/180*6371e3*Math.cos(e.lat*Math.PI/180),north:(t.latitude-e.lat)*Math.PI/180*6371e3});e.s(["WIND_MAP_TOP",0,20,"default",0,({y:e=.05,sheet:F=!0})=>{let S=u.default.get("windStyle")||"volume",T=F&&"volume"===S,A="volume"===S?150:1100,C=u.default.get("windColorMap")||"windy",E=(0,s.useSignalKPaths)(g),_=E["navigation.position"],{heading:L}=(0,c.default)(),P=(0,a.useSyncExternalStore)(m.subscribeForecast,m.getForecastHour,m.getForecastHour),[I,N]=(0,a.useState)(null),{id:j}=(0,M.default)(),W="day"===j?-.6:.45,k=(0,a.useRef)(),R=u.default.get("aisLengthScalingFactor")||.7,$=_?.latitude,B=_?.longitude,D=Number.isFinite($)?`${$.toFixed(1)},${B.toFixed(1)}`:null,G=E["environment.wind.speedTrue"],O=E["environment.wind.directionTrue"];(0,a.useEffect)(()=>{if(!D)return;let e=!1,[t,a]=D.split(",").map(Number);return(0,d.fetchWindField)(t,a).then(t=>{e||N(t)}).catch(()=>{!e&&Number.isFinite(G)&&Number.isFinite(O)&&N((0,d.uniformField)(t,a,G,O))}),()=>{e=!0}},[D]);let U=(0,a.useMemo)(()=>{let e=new Uint8Array(65536),t=new i.DataTexture(e,128,128,i.RGBAFormat);return t.magFilter=i.LinearFilter,t.minFilter=i.LinearFilter,t.colorSpace=i.SRGBColorSpace,t},[]);(0,a.useEffect)(()=>{if(!I||!F||T)return;let e=U.image.data;for(let t=0;t<128;t++)for(let a=0;a<128;a++){let r=(a/127*2-1)*d.HALF_EXTENT_M,i=(t/127*2-1)*d.HALF_EXTENT_M,o=(0,d.sampleWind)(I,r,i,P),[n,l,u]=y(C,Math.hypot(o.u,o.v)),s=(128*t+a)*4,c=Math.max(Math.abs(a/127*2-1),Math.abs(t/127*2-1));e[s]=n,e[s+1]=l,e[s+2]=u,e[s+3]=Math.round(255*Math.min(1,(1-c)*8))}U.needsUpdate=!0},[U,I,P,F,T,C]),(0,a.useEffect)(()=>()=>U.dispose(),[U]);let z=(0,a.useMemo)(()=>{let e=new n.LineSegmentsGeometry;e.setPositions(new Float32Array(46200)),e.setColors(new Float32Array(46200));let t=new l.LineMaterial({linewidth:3,vertexColors:!0,transparent:!0,opacity:.9,depthWrite:!1}),a=new o.LineSegments2(e,t);return a.frustumCulled=!1,a.renderOrder=2,{geo:e,material:t,object:a,state:Array.from({length:1100},()=>({x:0,y:0,age:4*Math.random(),life:2+3*Math.random()}))}},[]);(0,a.useEffect)(()=>()=>{z.geo.dispose(),z.material.dispose()},[z]);let H=(0,h.useFieldTexture)(T?I:null,P),X=(0,a.useMemo)(()=>new i.ShaderMaterial({uniforms:{uScale:{value:R},uTop:{value:0},uTime:{value:0},uMaxSpeed:{value:20},uOpacity:{value:Number(u.default.get("windOpacity"))||.7},uLength:{value:600},uFlow:{value:25},uMap:{value:null},uField:{value:null},uFieldHalf:{value:d.HALF_EXTENT_M},uFieldRange:{value:40}},vertexShader:w,fragmentShader:b,transparent:!0,depthWrite:!1}),[R]),V=(0,a.useMemo)(()=>"windy"===C?(()=>{let e=new Uint8Array(1024);for(let t=0;t<256;t++){let[a,r,i]=(0,d.windColor)(t/255*20);e.set([Math.round(a),Math.round(r),Math.round(i),255],4*t)}let t=new i.DataTexture(e,256,1,i.RGBAFormat);return t.magFilter=i.LinearFilter,t.colorSpace=i.SRGBColorSpace,t.needsUpdate=!0,t})():(0,f.colorMapTexture)(C),[C]);(0,a.useEffect)(()=>{X.uniforms.uMap.value=V,X.uniforms.uField.value=H},[X,V,H]),(0,a.useEffect)(()=>()=>{X.dispose(),V.dispose()},[X,V]),(0,a.useEffect)(()=>{z.geo.instanceCount=7*A},[z,A]);let[q,K]=(0,a.useState)([]),Y=(0,a.useRef)(0);(0,a.useEffect)(()=>{if(!I||!Number.isFinite($))return;let e=x(I.origin,{latitude:$,longitude:B}),t=Array.from({length:I.hours},(t,a)=>{let r=(0,d.sampleWind)(I,e.east,e.north,a);return Math.hypot(r.u,r.v)});return(0,m.setSeries)("wind",{start:I.start,values:t,top:Math.max(...t)}),()=>(0,m.setSeries)("wind",null)},[I,Math.round(100*$),Math.round(100*B)]);let Z=(0,a.useRef)({east:0,north:0});(0,a.useEffect)(()=>{I&&Number.isFinite($)&&(Z.current=x(I.origin,{latitude:$,longitude:B}))},[I,$,B]);let J=(0,a.useRef)();if((0,r.useFrame)(({camera:t,size:a,clock:r,gl:o},n)=>{if(!I)return;if(T&&(X.uniforms.uTime.value=r.elapsedTime,X.uniforms.uTop.value=e+150*R),J.current){let e=t.position.length()/R;J.current&&(J.current.opacity=i.MathUtils.clamp(.3+(e-300)/3e3*.3,.3,.6))}let l=Math.min(n,.1),u=Math.min(d.HALF_EXTENT_M,Math.max(800,t.position.length()/R*2.5)),s=u/120,c=u/140,{east:f,north:h}=Z.current;z.material.resolution.set(a.width,a.height);let m=z.geo.attributes.instanceStart.data.array,p=z.geo.attributes.instanceColorStart.data.array;if(z.state.forEach((e,t)=>{if(t>=A)return;e.age+=l,(e.age>e.life||Math.abs(e.x)>u||Math.abs(e.y)>u)&&(e.x=(2*Math.random()-1)*u,e.y=(2*Math.random()-1)*u,e.age=0,e.life=2+3*Math.random());let a=(0,d.sampleWind)(I,f+e.x,h+e.y,P),r=Math.hypot(a.u,a.v);e.x+=a.u*s*l/10,e.y+=a.v*s*l/10;let i=Math.min(1,e.age/.5,(e.life-e.age)/.7),[o,n,v]=y(C,r),M=e=>W>=0?e/255*(1-W)+W:e/255*(1+W),g=M(o),w=M(n),b=M(v),x=o/255,F=n/255,S=v/255,T=c*Math.min(1.6,.5+r/10),E=e.x,_=e.y;for(let e=0;e<7;e++){let r=0===e?a:(0,d.sampleWind)(I,f+E,h+_,P),o=Math.hypot(r.u,r.v)||1,n=E-r.u/o*T,l=_-r.v/o*T,u=(7*t+e)*6;m[u]=E*R,m[u+1]=_*R,m[u+2]=.2,m[u+3]=n*R,m[u+4]=l*R,m[u+5]=.2;let s=i*(1-e/7)**1.6,c=i*(1-(e+1)/7)**1.6,v=(7*t+e)*6;p[v]=x+(g-x)*s,p[v+1]=F+(w-F)*s,p[v+2]=S+(b-S)*s,p[v+3]=x+(g-x)*c,p[v+4]=F+(w-F)*c,p[v+5]=S+(b-S)*c,E=n,_=l}}),z.geo.attributes.instanceStart.data.needsUpdate=!0,z.geo.attributes.instanceColorStart.data.needsUpdate=!0,Y.current+=n,Y.current<1)return;Y.current=0;let M=k.current;if(!M)return;let g=M.worldToLocal(new i.Vector3().copy(t.position)),w=f+g.x/R,b=h+g.y/R,x=Math.max(5,g.z/R),F=i.MathUtils.clamp(10*Math.round(3*x/10),60,4e3),S=Math.min(.9*u,Math.max(800,60*x)),E=(0,v.markerLattice)({cx:w,cy:b,radius:S,step:F,near:3*F,originE:w,originN:b,max:400}),_=[],L=(0,v.onScreenTest)(M,t,o.domElement);E.forEach(({e,n:t,d:a})=>{if(_.length>=10||20>Math.hypot(e-f,t-h)||!L((e-f)*R,(t-h)*R,4*R))return;let r=(0,d.sampleWind)(I,e,t,P),i=(0,d.sampleWind)(I,e,t,P+1),o=Math.hypot(r.u,r.v),[n,l,u]=y(C,o),s=e=>W>=0?e/255*(1-W)+W:e/255*(1+W);_.push({key:`${e},${t}`,x:(e-f)*R,y:(t-h)*R,z:4*R,u:r.u,v:r.v,speed:o,trend:Math.hypot(i.u,i.v)-o,color:[s(n),s(l),s(u)],len:.14*(.4+.6*Math.min(1,o/15)),d:a})}),_.sort((e,t)=>e.d-t.d).splice(10),K(e=>(0,v.sameMarkers)(e,_)?e:_)}),!I)return null;let{east:Q,north:ee}=Z.current,et=2*d.HALF_EXTENT_M*R;return(0,t.jsx)("group",{rotation:[0,L,0],position:[0,e,0],children:(0,t.jsxs)("group",{ref:k,rotation:[-Math.PI/2,0,0],children:[F&&(0,t.jsxs)("mesh",{position:[-Q*R,-ee*R,0],renderOrder:1,children:[(0,t.jsx)("planeGeometry",{args:[et,et]}),T?(0,t.jsx)("primitive",{object:X,attach:"material"}):(0,t.jsx)("meshBasicMaterial",{ref:J,map:U,transparent:!0,opacity:.6,depthWrite:!1,toneMapped:!1})]}),(0,t.jsx)("primitive",{object:z.object}),(0,t.jsx)(p.default,{items:q,width:.025,screen:1,format:e=>String(Math.round(e)),slackLabel:"calm",maxLabels:6})]})})}])},54983,e=>{"use strict";var t=e.i(90072);let a={thermal:.28,magma:.3,dense:.15,deep:0,haline:.1,turbo:.08},r=e=>[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)],i=Object.fromEntries(Object.entries({speed:["#fffdcd","#f4eaab","#e9d889","#dbc866","#c9ba45","#b2af28","#98a512","#7c9c06","#5f920c","#448818","#287c23","#126e2a","#0b602d","#11512c","#174127","#19321e","#172313"],thermal:["#042333","#082e54","#19337c","#39339e","#563b9c","#6d4694","#83508f","#995889","#b15f82","#c76676","#de7065","#ef7e52","#f99242","#fcaa3c","#f9c441","#f3df4c","#e8fa5b"],haline:["#2a186c","#2e1d93","#2034a2","#0f4a98","#0f5b90","#1c6a8c","#297789","#338588","#3c9387","#44a184","#4faf7e","#5fbe75","#78cb68","#9bd55c","#c1dd64","#e1e57c","#fdef9a"],deep:["#fdfecc","#ddf2ba","#bbe6ac","#98daa4","#78cea3","#62bfa4","#55aea3","#4e9ea1","#488e9e","#437f9a","#3f6f97","#3e5f93","#404d8c","#413e76","#3b325c","#322643","#281a2c"],ice:["#040613","#13132a","#212041","#2e2c5a","#383975","#3e478f","#3f57a3","#3e69b0","#427bb7","#4b8bbd","#579cc3","#67adc9","#79bed0","#92ced7","#afdde1","#cdecef","#eafdfd"],dense:["#e6f1f1","#cbe4e8","#b1d6e3","#9ac8e2","#86b9e3","#79a9e4","#7397e4","#7584df","#7871d5","#7960c7","#784eb3","#753d9d","#6f2e85","#66216c","#5a1851","#491238","#360e24"],magma:["#000004","#0a0822","#1d1147","#36106b","#51127c","#6a1c81","#832681","#9c2e7f","#b73779","#cf4070","#e55064","#f4695c","#fb8761","#fea571","#fec287","#fde0a1","#fcfdbf"],viridis:["#440154","#48186a","#472d7b","#424086","#3b528b","#33638d","#2c728e","#26828e","#21918c","#1f9f88","#27ad81","#3dbc74","#5cc863","#81d34d","#aadc32","#d5e21a","#fde725"],turbo:["#30123b","#4040a2","#466be3","#4294ff","#28bceb","#18ddc2","#32f298","#6dfe62","#a4fc3c","#cbed34","#ecd13a","#fdae35","#fb8122","#ec530f","#d23105","#ac1701","#7a0403"]}).map(([e,t])=>[e,t.map(r)])),o=(e,t)=>{let a=i[e]||i.speed,r=Math.min(1,Math.max(0,Number.isFinite(t)?t:0))*(a.length-1),o=Math.min(a.length-2,Math.floor(r)),n=r-o;return a[o].map((e,t)=>e+(a[o+1][t]-e)*n)};e.s(["colorAt",0,o,"colorMapTexture",0,e=>{let r=new Uint8Array(1024),i=a[e]||0;for(let t=0;t<256;t++){let[a,n,l]=o(e,i+(1-i)*t/255);r.set([Math.round(a),Math.round(n),Math.round(l),255],4*t)}let n=new t.DataTexture(r,256,1,t.RGBAFormat);return n.magFilter=t.LinearFilter,n.minFilter=t.LinearFilter,n.colorSpace=t.SRGBColorSpace,n.needsUpdate=!0,n},"cssGradient",0,e=>{let t=a[e]||0,r=Array.from({length:9},(a,r)=>{let[i,n,l]=o(e,t+(1-t)*r/8);return`rgb(${Math.round(i)},${Math.round(n)},${Math.round(l)})`});return`linear-gradient(to right, ${r.join(", ")})`}])},33227,e=>{"use strict";var t=e.i(3950);let a={key:null,at:0,field:null},r=.5/1.943844,i=null,o=new Set,n=(e,t,a,r)=>({lat:e+(r/8*2-1)*12e3/6371e3*180/Math.PI,lon:t+(a/8*2-1)*12e3/(6371e3*Math.cos(e*Math.PI/180))*180/Math.PI}),l=(e,t)=>{let a=[],r=[];for(let i=0;i<9;i++)for(let o=0;o<9;o++){let l=n(e,t,o,i);a.push(l.lat.toFixed(4)),r.push(l.lon.toFixed(4))}return`https://marine-api.open-meteo.com/v1/marine?latitude=${a.join(",")}&longitude=${r.join(",")}&hourly=ocean_current_velocity,ocean_current_direction&forecast_hours=48&timezone=GMT`},u=async(e,r)=>{let i=`${e.toFixed(1)},${r.toFixed(1)}`;if(a.field&&a.key===i&&Date.now()-a.at<18e5)return a.field;let o=await (0,t.cachedFetch)(l(e,r),{kind:"forecast"});if(!o.ok)throw Error(`Open-Meteo marine ${o.status}`);let n=await o.json(),u=Array.isArray(n)?n:[n],s=u[0]?.hourly?.time||[],c=s.length,d=[],f=[];for(let e=0;e<c;e++){let t=new Float32Array(81),a=new Float32Array(81);u.forEach((r,i)=>{let o=(r.hourly.ocean_current_velocity[e]??0)/3.6,n=(r.hourly.ocean_current_direction[e]??0)*Math.PI/180;t[i]=o*Math.sin(n),a[i]=o*Math.cos(n)}),d.push(t),f.push(a)}let h=0;d.forEach((e,t)=>e.forEach((e,a)=>{h=Math.max(h,Math.hypot(e,f[t][a]))}));let m={origin:{lat:e,lon:r},start:Date.parse(`${s[0]}Z`),hours:c,grid:9,half:12e3,u:d,v:f,max:h,source:"open-meteo"};return a={key:i,at:Date.now(),field:m},m};e.s(["currentFieldUrl",0,l,"fetchCurrentField",0,u,"getCurrentScale",0,()=>i,"setCurrentScale",0,e=>{let t=1.943844*Math.max(r,e?.max||0);return i=e?Math.ceil(4*t)/4/1.943844:null,o.forEach(e=>e(i)),i},"subscribeCurrentScale",0,e=>(o.add(e),()=>o.delete(e)),"uniformCurrent",0,(e,t,a,r)=>{let i=new Float32Array(81).fill(a*Math.sin(r)),o=new Float32Array(81).fill(a*Math.cos(r));return{origin:{lat:e,lon:t},start:Date.now(),hours:1,grid:9,half:12e3,u:[i],v:[o],max:a,source:"boat"}}])},69435,e=>{"use strict";var t=e.i(71645),a=e.i(90072),r=e.i(3666);let i=40,o=`
91
+ float hash13(vec3 p) {
92
+ p = fract(p * 0.1031);
93
+ p += dot(p, p.zyx + 31.32);
94
+ return fract((p.x + p.y) * p.z);
95
+ }
96
+ float vnoise(vec3 p) {
97
+ vec3 i = floor(p);
98
+ vec3 f = fract(p);
99
+ f = f * f * (3.0 - 2.0 * f);
100
+ return mix(mix(mix(hash13(i), hash13(i + vec3(1, 0, 0)), f.x),
101
+ mix(hash13(i + vec3(0, 1, 0)), hash13(i + vec3(1, 1, 0)), f.x), f.y),
102
+ mix(mix(hash13(i + vec3(0, 0, 1)), hash13(i + vec3(1, 0, 1)), f.x),
103
+ mix(hash13(i + vec3(0, 1, 1)), hash13(i + vec3(1, 1, 1)), f.x), f.y), f.z);
104
+ }
105
+ float fbm(vec3 p) {
106
+ return 0.6 * vnoise(p) + 0.3 * vnoise(p * 2.03 + 17.0) + 0.1 * vnoise(p * 4.1 + 41.0);
107
+ }
108
+ `,n=`
109
+ uniform sampler2D uField;
110
+ uniform float uFieldHalf;
111
+ uniform float uFieldRange;
112
+ vec2 flowAt(vec2 g) {
113
+ vec2 t = g / (2.0 * uFieldHalf) + 0.5;
114
+ return (texture2D(uField, t).rg - 0.5) * 2.0 * uFieldRange;
115
+ }
116
+ // 1 inside the field, fading to 0 over its outer tenth
117
+ float fieldMask(vec2 g) {
118
+ vec2 a = abs(g) / uFieldHalf;
119
+ return 1.0 - smoothstep(0.85, 1.0, max(a.x, a.y));
120
+ }
121
+ `;e.s(["FIELD_GLSL",0,n,"NOISE_GLSL",0,o,"useFieldTexture",0,(e,o,n=i)=>{let l=(0,t.useMemo)(()=>{let e=new a.DataTexture(new Uint8Array(16384),64,64,a.RGBAFormat);return e.magFilter=a.LinearFilter,e.minFilter=a.LinearFilter,e.wrapS=a.ClampToEdgeWrapping,e.wrapT=a.ClampToEdgeWrapping,e},[]);return(0,t.useEffect)(()=>{if(!e)return;let t=l.image.data,a=e.half??r.HALF_EXTENT_M;for(let i=0;i<64;i++)for(let l=0;l<64;l++){let u=(0,r.sampleWind)(e,(l/63*2-1)*a,(i/63*2-1)*a,o),s=(64*i+l)*4;t[s]=Math.round(255*Math.min(1,Math.max(0,.5+u.u/(2*n)))),t[s+1]=Math.round(255*Math.min(1,Math.max(0,.5+u.v/(2*n)))),t[s+2]=0,t[s+3]=255}l.needsUpdate=!0},[l,e,o,n]),(0,t.useEffect)(()=>()=>l.dispose(),[l]),l}])},88608,e=>{"use strict";let t=0,a=new Set,r={},i=new Set;e.s(["getForecastHour",0,()=>t,"getSeries",0,()=>r,"setForecastHour",0,e=>{t=Math.max(0,e),a.forEach(e=>e(t))},"setSeries",0,(e,t)=>{r={...r,[e]:t},i.forEach(e=>e(r))},"subscribeForecast",0,e=>(a.add(e),()=>a.delete(e)),"subscribeSeries",0,e=>(i.add(e),()=>i.delete(e))])},18032,e=>{"use strict";var t=e.i(90072);e.s(["markerLattice",0,({cx:e,cy:t,radius:a,step:r,near:i,originE:o=0,originN:n=0,max:l=60})=>{let u=[],s=Math.ceil((o-a)/r),c=Math.floor((o+a)/r),d=Math.ceil((n-a)/r),f=Math.floor((n+a)/r);for(let l=s;l<=c;l++)for(let s=d;s<=f;s++){let c=l*r,d=s*r;if(Math.hypot(c-o,d-n)>a)continue;let f=Math.hypot(c-e,d-t),h=f<=i?0:Math.ceil(Math.log2(f/i)),m=2**h;l%m==0&&s%m==0&&u.push({e:c,n:d,d:f})}return u.sort((e,t)=>e.d-t.d).slice(0,l)},"onScreenTest",0,(e,a,r,i=.9,o=60)=>{let n=new t.Vector3;e.updateWorldMatrix(!0,!1);let l=r.getBoundingClientRect(),u="u"<typeof document?[]:[...document.querySelectorAll("[data-hud-solid]")].filter(e=>null!==e.offsetParent).map(e=>e.getBoundingClientRect()).filter(e=>e.width>0&&e.height>0);return(t,r,s)=>{if(n.set(t,r,s),e.localToWorld(n).project(a),n.z>=1||Math.abs(n.x)>i||Math.abs(n.y)>i)return!1;let c=l.left+(n.x+1)/2*l.width,d=l.top+(1-n.y)/2*l.height;return!u.some(e=>c>e.left-o&&c<e.right+o&&d>e.top-o&&d<e.bottom+o)}},"sameMarkers",0,(e,t)=>e.length===t.length&&e.every((e,a)=>{let r=t[a];return e.key===r.key&&.005>Math.abs(e.speed-r.speed)&&Math.sign(Math.round(20*e.trend))===Math.sign(Math.round(20*r.trend))&&.001>Math.abs(e.len-r.len)&&e.x===r.x&&e.y===r.y})])},54735,e=>{"use strict";var t=e.i(71645),a=e.i(85709),r=e.i(33227),i=e.i(88608),o=e.i(3666),n=e.i(54983),l=e.i(18032),u=e.i(58567);let s=["navigation.position","environment.current"];e.s(["CURRENT_ARROW_WIDTH",0,.028,"DEFAULT_CURRENT_MAP",0,"thermal","currentMarkers",0,({field:e,hour:t,top:a,mapName:r,refE:i,refN:s,cx:c,cy:d,heightM:f,scale:h,radius:m,z:p,isWater:v=()=>!0,onScreen:M=()=>!0})=>{let g=Math.min(400,Math.max(25,5*Math.round(.9*f/5))),y="pi"===(0,u.getRenderProfile)().id?20:40,w=(0,l.markerLattice)({cx:c,cy:d,radius:m,step:g,near:3*g,originE:i,originN:s,max:400}),b=[];return w.forEach(({e:l,n:u})=>{if(b.length>=y||15>Math.hypot(l-i,u-s))return;let c=(l-i)*h,d=(u-s)*h;if(!M(c,d,p)||!v(c,d))return;let f=(0,o.sampleWind)(e,l,u,t),m=Math.hypot(f.u,f.v);if(m<.005)return;let g=(0,o.sampleWind)(e,l,u,t+1),w=Math.min(1,m/a),[x,F,S]=(0,n.colorAt)(r,.28+.72*w);b.push({key:`${l},${u}`,x:c,y:d,z:p,u:f.u,v:f.v,speed:m,trend:Math.hypot(g.u,g.v)-m,color:[x/255,F/255,S/255],len:.16*(.4+.6*w)})}),b},"useCurrentField",0,()=>{let e=(0,a.useSignalKPaths)(s),n=e["navigation.position"],l=e["environment.current"],u=(0,t.useSyncExternalStore)(i.subscribeForecast,i.getForecastHour,i.getForecastHour),[c,d]=(0,t.useState)(null),[f,h]=(0,t.useState)(1),m=n?.latitude,p=n?.longitude,v=Number.isFinite(m)?`${m.toFixed(1)},${p.toFixed(1)}`:null;(0,t.useEffect)(()=>{if(!v)return;let e=!1,[t,a]=v.split(",").map(Number);return(0,r.fetchCurrentField)(t,a).then(t=>{e||d(t)}).catch(()=>{!e&&Number.isFinite(l?.drift)&&Number.isFinite(l?.setTrue)&&d((0,r.uniformCurrent)(t,a,l.drift,l.setTrue))}),()=>{e=!0}},[v]),(0,t.useEffect)(()=>{h((0,r.setCurrentScale)(c)??1)},[c]),(0,t.useEffect)(()=>()=>(0,r.setCurrentScale)(null),[]);let M=Number.isFinite(m)?Math.round(100*m):null,g=Number.isFinite(p)?Math.round(100*p):null;return(0,t.useEffect)(()=>{if(!c||null===M)return;let e=(p-c.origin.lon)*Math.PI/180*6371e3*Math.cos(c.origin.lat*Math.PI/180),t=(m-c.origin.lat)*Math.PI/180*6371e3,a=Array.from({length:c.hours},(a,r)=>{let i=(0,o.sampleWind)(c,e,t,r);return Math.hypot(i.u,i.v)});return(0,i.setSeries)("current",{start:c.start,values:a,top:c.max}),()=>(0,i.setSeries)("current",null)},[c,M,g]),{field:c,hour:u,top:f,lat:m,lon:p}}])},3666,e=>{"use strict";var t=e.i(3950);let a={key:null,at:0,field:null},r=(e,t,a,r)=>({lat:e+(r/8*2-1)*4e4/6371e3*180/Math.PI,lon:t+(a/8*2-1)*4e4/(6371e3*Math.cos(e*Math.PI/180))*180/Math.PI}),i=(e,t)=>{let a=[],i=[];for(let o=0;o<9;o++)for(let n=0;n<9;n++){let l=r(e,t,n,o);a.push(l.lat.toFixed(4)),i.push(l.lon.toFixed(4))}return`https://api.open-meteo.com/v1/forecast?latitude=${a.join(",")}&longitude=${i.join(",")}&hourly=wind_speed_10m,wind_direction_10m&wind_speed_unit=ms&forecast_hours=48&timezone=GMT`},o=async(e,r)=>{let o=`${e.toFixed(1)},${r.toFixed(1)}`;if(a.field&&a.key===o&&Date.now()-a.at<18e5)return a.field;let n=i(e,r),l=await (0,t.cachedFetch)(n,{kind:"forecast"});if(!l.ok)throw Error(`Open-Meteo ${l.status}`);let u=await l.json(),s=Array.isArray(u)?u:[u],c=s[0]?.hourly?.time||[],d=c.length,f=[],h=[];for(let e=0;e<d;e++){let t=new Float32Array(81),a=new Float32Array(81);s.forEach((r,i)=>{let o=r.hourly.wind_speed_10m[e]??0,n=(r.hourly.wind_direction_10m[e]??0)*Math.PI/180;t[i]=-o*Math.sin(n),a[i]=-o*Math.cos(n)}),f.push(t),h.push(a)}let m={origin:{lat:e,lon:r},start:Date.parse(`${c[0]}Z`),hours:d,u:f,v:h,source:"open-meteo"};return a={key:o,at:Date.now(),field:m},m},n=[[0,[98,113,183]],[1,[57,97,159]],[3,[74,148,169]],[5,[77,141,123]],[7,[83,165,83]],[9,[53,159,53]],[11,[167,157,81]],[13,[159,127,58]],[15,[161,108,92]],[17,[129,58,78]],[19,[175,80,136]],[21,[117,74,147]],[24,[109,97,163]],[27,[68,105,141]],[29,[92,144,152]],[36,[125,68,165]]];e.s(["HALF_EXTENT_M",0,4e4,"WINDY_SCALE",0,n,"fetchWindField",0,o,"sampleWind",0,(e,t,a,r=0)=>{let i=e.grid??9,o=e.half??4e4,n=Math.min(i-1.001,Math.max(0,(t/o+1)/2*(i-1))),l=Math.min(i-1.001,Math.max(0,(a/o+1)/2*(i-1))),u=Math.floor(n),s=Math.floor(l),c=n-u,d=l-s,f=Math.min(e.hours-1,Math.max(0,Math.floor(r))),h=Math.min(e.hours-1,f+1),m=Math.min(1,Math.max(0,r-f)),p=(e,t)=>{let a=e[t],r=s*i+u;return(a[r]*(1-c)+a[r+1]*c)*(1-d)+(a[r+i]*(1-c)+a[r+i+1]*c)*d};return{u:p(e.u,f)*(1-m)+p(e.u,h)*m,v:p(e.v,f)*(1-m)+p(e.v,h)*m}},"uniformField",0,(e,t,a,r)=>{let i=new Float32Array(81).fill(-a*Math.sin(r)),o=new Float32Array(81).fill(-a*Math.cos(r));return{origin:{lat:e,lon:t},start:Date.now(),hours:1,u:[i],v:[o],source:"boat"}},"windColor",0,e=>{if(e<=n[0][0])return n[0][1];for(let t=1;t<n.length;t++)if(e<=n[t][0]){let[a,r]=n[t-1],[i,o]=n[t],l=(e-a)/(i-a);return r.map((e,t)=>e+(o[t]-e)*l)}return n[n.length-1][1]},"windFieldUrl",0,i])},3950,e=>{"use strict";let t="ocearo-offline-v2",a=["ocearo-offline-v1"],r=!1,i=async(e,{kind:i="tile"}={})=>{if(!("u">typeof caches))return fetch(e,{referrerPolicy:"strict-origin-when-cross-origin"});r||(r=!0,a.forEach(e=>caches.delete(e).catch(()=>{})));let o=await caches.open(t);if("tile"===i){let t=await o.match(e);if(t)return t}try{let t=await fetch(e,{mode:"cors",referrerPolicy:"strict-origin-when-cross-origin"});if(t.ok)await o.put(e,t.clone());else{let t=await o.match(e);if(t)return t}return t}catch(a){let t=await o.match(e);if(t)return t;throw a}},o=async e=>{let t=await i(e,{kind:"tile"});if(!t.ok)throw Error(`${t.status} ${e}`);return createImageBitmap(await t.blob())},n=(e,t,a,r)=>{if(e.includes("{bbox}")){let i=40075016.68557849/2**t,o=-20037508.342789244+a*i,n=20037508.342789244-r*i,l=[o,n-i,o+i,n].map(e=>e.toFixed(2)).join(",");return e.replace("{bbox}",l)}return e.replace("{z}",t).replace("{x}",a).replace("{y}",r)},l=(e,t,a,r)=>{let i=2**r,o=(e,t)=>({x:Math.floor((t+180)/360*i),y:Math.floor((1-Math.log(Math.tan(e*Math.PI/180)+1/Math.cos(e*Math.PI/180))/Math.PI)/2*i)}),n=a/111320,l=a/(111320*Math.cos(e*Math.PI/180)),u=o(e+n,t-l),s=o(e-n,t+l),c=[];for(let e=u.x;e<=s.x;e++)for(let t=u.y;t<=s.y;t++)c.push({z:r,x:e,y:t});return c},u=async({lat:e,lon:t,radiusM:a,layers:r,urls:o=[],onProgress:u})=>{let s=[];for(let{template:i,zooms:o}of r)for(let r of o)for(let o of l(e,t,a,r))s.push(n(i,o.z,o.x,o.y));s.push(...o);let c=0,d=0,f=[...s],h=async()=>{for(;f.length;){let e=f.shift();try{!(await i(e,{kind:e.includes("forecast")?"forecast":"tile"})).ok&&d++}catch{d++}c++,u?.(c,s.length,d)}};return await Promise.all(Array.from({length:4},h)),{done:c,failed:d,total:s.length}},s=async()=>{if(navigator.storage?.estimate){let{usage:e}=await navigator.storage.estimate();return e}return null},c=async(e,a)=>{if(!("u">typeof caches))return!1;let r=await caches.open(t);return await r.put(e,a),!0},d=async e=>{if(!("u">typeof caches))return null;let a=await caches.open(t);return await a.match(e)||null};e.s(["cachedFetch",0,i,"cachedImage",0,o,"clearOfflineCache",0,()=>"u">typeof caches?caches.delete(t):Promise.resolve(!1),"offlineCacheSize",0,s,"prefetchArea",0,u,"readCached",0,d,"storeCached",0,c,"tileUrl",0,n])}]);
@@ -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(43216);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.Line,{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(43216),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.Line,{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.Line,{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)()}]);
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)()}]);