ocearo-ui 2.1.1 → 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.
- package/404.html +1 -1
- package/README.fr.md +9 -7
- package/README.md +9 -7
- package/__next.__PAGE__.txt +3 -3
- package/__next._full.txt +3 -3
- package/__next._tree.txt +2 -2
- 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/{0zvzu5fnwh4_a.js → 0glm63vhzbxk5.js} +2 -2
- package/_next/static/chunks/0n5v9mjln3x9c.js +121 -0
- package/_next/static/chunks/{1l-jew0-1-3eq.js → 0ngl63fz0a-bo.js} +2 -2
- package/_next/static/chunks/0nq1o9-m7bhjg.js +1 -0
- package/_next/static/chunks/0vhk5q54me91_.js +1 -0
- package/_next/static/chunks/0wi5jop1ihbm6.js +2 -0
- package/_next/static/chunks/1442uc2w4y1ve.js +503 -0
- package/_next/static/chunks/18vlmqe7txbmt.js +1 -0
- package/_next/static/chunks/{2gr1d26f-ymoh.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/{3qik_nv7zlj4e.js → 1quvj-861o57h.js} +1 -1
- package/_next/static/chunks/1vchkqgn-xw-o.js +1 -0
- package/_next/static/chunks/{0j11dppxb9l0b.js → 1zuex-na8y-w4.js} +1 -1
- package/_next/static/chunks/21408p9d6c0sg.js +1 -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/2cecf_xnd_9em.js +1 -0
- package/_next/static/chunks/2die6btm3_mhq.js +1 -0
- package/_next/static/chunks/{18_i6mf6hb_c7.js → 2gsiwp60towtx.js} +1 -1
- package/_next/static/chunks/2ijx7rln4jshb.css +3 -0
- package/_next/static/chunks/2qch0at4eelx8.js +1 -0
- package/_next/static/chunks/2qylgmdj-32um.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/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/3l25j666ze4c1.js +1 -0
- package/_next/static/chunks/3nv6p6vvu2zlg.js +1 -0
- package/_next/static/chunks/3yz0mxxv4vrfg.js +1 -0
- package/_next/static/chunks/3z29h80ysf4f1.js +739 -0
- package/_next/static/chunks/40b8ooaw6x7my.js +180 -0
- package/_next/static/chunks/44f5hh9caupby.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 +2 -2
- 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-jqvc-r0kh0c.js +0 -1
- package/_next/static/chunks/05do10p9ldt1p.js +0 -409
- package/_next/static/chunks/096zaxs1gf_3q.js +0 -2
- package/_next/static/chunks/0b3cus8izqkmg.js +0 -119
- package/_next/static/chunks/0jucaltuccn03.js +0 -1
- package/_next/static/chunks/0m7wbuocx-b4_.js +0 -9
- package/_next/static/chunks/1_g85m2d7jjpo.css +0 -3
- package/_next/static/chunks/1arvue9o-atui.js +0 -739
- package/_next/static/chunks/1bo0ke8gjc1c2.js +0 -1
- package/_next/static/chunks/1cp1kkarm5gxz.js +0 -1
- package/_next/static/chunks/1hz_mzl8l35j8.js +0 -1
- package/_next/static/chunks/1k72cpd0x8veh.js +0 -1
- package/_next/static/chunks/2aivnrnff0avu.js +0 -446
- package/_next/static/chunks/2fthh9f57zzm2.js +0 -1
- package/_next/static/chunks/2mzecccvvbjr1.js +0 -1
- package/_next/static/chunks/2r98jty3a4wel.js +0 -564
- package/_next/static/chunks/2v6ebsavxlgyw.js +0 -1
- package/_next/static/chunks/2w71oj1brox5z.js +0 -1
- package/_next/static/chunks/2wayx8t5r5fi9.js +0 -1
- package/_next/static/chunks/33u782y6vhw-f.js +0 -346
- package/_next/static/chunks/3qzb9nvvw-b-k.js +0 -1
- package/_next/static/chunks/3r8nellt-dsed.js +0 -1
- package/_next/static/chunks/3td9mnhvcj9cq.js +0 -1
- package/_next/static/chunks/3wwn1rti8oc_r.js +0 -1
- package/_next/static/chunks/41odv061mfm6t.js +0 -1
- package/_next/static/chunks/432vtxrssprta.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/{QMD1VkISjzTIQCzLSHPpB → RbyYYNpJGkiHnU7YTHoaU}/_buildManifest.js +0 -0
- /package/_next/static/{QMD1VkISjzTIQCzLSHPpB → RbyYYNpJGkiHnU7YTHoaU}/_clientMiddlewareManifest.js +0 -0
- /package/_next/static/{QMD1VkISjzTIQCzLSHPpB → RbyYYNpJGkiHnU7YTHoaU}/_ssgManifest.js +0 -0
|
@@ -1,409 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,78461,e=>{"use strict";var t=e.i(71645),i=e.i(85709),n=e.i(67561);let r=["navigation.headingTrue","navigation.headingMagnetic","navigation.courseOverGroundTrue","navigation.courseOverGroundMagnetic","navigation.position"],a=null;e.s(["default",0,()=>{let{convertLatLonToXY:e}=(0,n.useOcearoContext)(),s=(0,i.useSignalKPaths)(r),o=s["navigation.headingTrue"]??s["navigation.headingMagnetic"]??s["navigation.courseOverGroundTrue"]??s["navigation.courseOverGroundMagnetic"],l=Number.isFinite(o),d=s["navigation.position"],u=Number.isFinite(d?.latitude)&&Number.isFinite(d?.longitude);return{heading:l?o:0,offset:(0,t.useMemo)(()=>{if(!u)return{x:0,y:0};let t={lat:d.latitude,lon:d.longitude};return e(t,(a||(a=t),a))},[d,u,e]),hasFix:u,hasHeading:l}},"getSessionOrigin",0,()=>a])},23549,e=>{"use strict";var t=e.i(43476),i=e.i(71645);e.i(85269);var n=e.i(22831),r=e.i(78461),a=e.i(37369),s=e.i(539),o=e.i(76247);let l=180/Math.PI;e.s(["default",0,()=>{let{t:e}=(0,n.useTranslation)(),d=(0,a.useBerth)(),u=(()=>{let{heading:e,offset:t}=(0,r.default)(),n=(0,a.useBerth)();return(0,i.useMemo)(()=>{if(!n.pose)return null;let{x:i,y:r,heading:a}=n.pose,l="stern"===n.type,d=l?1:-1,u={x:i+d*Math.sin(a)*o.BOAT.length*.5,y:r+d*Math.cos(a)*o.BOAT.length*.5},c=u.x-t.x,f=u.y-t.y,p=Math.hypot(c,f),h=(0,s.wrapPi)(Math.atan2(c,f)-e),m=-(c*Math.cos(a)-f*Math.sin(a));return{distance:p,bearing:h,headingError:(0,s.wrapPi)(a-e),lateral:m,astern:l}},[n,e,t])})(),{heading:c,offset:f}=(0,r.default)(),p=e=>`px-3 py-1.5 rounded-full text-caption font-semibold uppercase tracking-wider border transition-colors ${e?"bg-oBlue text-white border-oBlue":"border-hud text-hud-secondary hover:text-hud-main"}`,h=null;if(u){let t=Math.round(u.headingError*l),i=u.lateral,n=t=>e(t>=0?"parking.starboard":"parking.port");h=Math.abs(u.bearing)>.6*Math.PI?e("parking.behind"):Math.abs(i)>.4?e("parking.moveAcross",{metres:Math.abs(i).toFixed(1),side:n(-i)}):Math.abs(t)>4?e("parking.turn",{deg:Math.abs(t),side:n(t)}):e(u.astern?"parking.alignedAstern":"parking.aligned")}return(0,t.jsxs)("div",{className:"hud-halo flex flex-col items-center gap-2 select-none",children:[u&&(0,t.jsxs)("div",{className:"text-center leading-tight",children:[(0,t.jsx)("div",{className:"text-value font-semibold text-hud-main",children:h}),(0,t.jsxs)("div",{className:"text-caption text-hud-secondary",children:[e("parking.entry",{metres:u.distance.toFixed(0)}),u.astern?` \xb7 ${e("parking.astern")}`:"","virtual"===d.source?` \xb7 ${e("parking.virtual")}`:""]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-center gap-2",children:[a.BERTH_TYPES.map(i=>(0,t.jsx)("button",{type:"button",className:p(d.type===i),onClick:()=>"virtual"===d.source?(0,a.placeVirtualBerth)(f,c,i):(0,a.setBerth)({type:i}),children:e(`parking.type_${i}`)},i)),"side"===d.type&&(0,t.jsx)("button",{type:"button",className:p(!1),onClick:()=>(0,a.setBerth)({side:"port"===d.side?"starboard":"port"}),children:e("port"===d.side?"parking.portSide":"parking.starboardSide")}),(0,t.jsx)("button",{type:"button",className:p(!1),onClick:()=>(0,a.placeVirtualBerth)(f,c),children:e("parking.placeAhead")})]})]})}],23549)},36540,function(e){e.n(e.i(23549))},76247,37369,e=>{"use strict";var t=e.i(43476),i=e.i(71645),n=e.i(43216),r=e.i(83646),a=e.i(78461);let s={type:"bow",side:"starboard",pose:null,source:"virtual"},o=new Set,l=()=>s,d=e=>{s={...s,...e},o.forEach(e=>e())},u=e=>(o.add(e),()=>o.delete(e)),c=()=>(0,i.useSyncExternalStore)(u,l,l),f=(e,t,i=s.type,n=22)=>{d({type:i,pose:{x:e.x+Math.sin(t)*n,y:e.y+Math.cos(t)*n,heading:"stern"===i?t+Math.PI:t},source:"virtual"})};e.s(["BERTH_TYPES",0,["bow","stern","side","buoy"],"getBerth",0,l,"placeVirtualBerth",0,f,"setBerth",0,d,"useBerth",0,c],37369);let p={length:10.8,beam:3.9},h=p.length/2,m=p.beam/2,v=({size:e,position:i,color:n,opacity:r=1})=>(0,t.jsxs)("mesh",{position:i,children:[(0,t.jsx)("boxGeometry",{args:e}),(0,t.jsx)("meshLambertMaterial",{color:n,transparent:r<1,opacity:r})]}),g=({position:e,rotation:i=0,color:n,length:r=4})=>(0,t.jsxs)("group",{position:e,rotation:[0,i,0],children:[(0,t.jsxs)("mesh",{rotation:[-Math.PI/2,0,0],position:[0,.07,r/2-.6],children:[(0,t.jsx)("planeGeometry",{args:[.7,r-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})]})]}),y=({type:e,side:r,colors:a})=>{let s,o=(0,i.useMemo)(()=>(()=>{let e=-h+3.5,t=[[-m,h],[m,h],[m,e]];for(let i=1;i<=8;i++){let n=i/8;t.push([m*(1-n)**1.6,e-(e+h)*Math.sin(n*Math.PI/2)])}for(let i=7;i>=0;i--){let n=i/8;t.push([-m*(1-n)**1.6,e-(e+h)*Math.sin(n*Math.PI/2)])}return t.push([-m,h]),t.map(([e,t])=>[e,.06,t])})(),[]),l="port"===r?-1:1;return(0,t.jsxs)("group",{children:[(0,t.jsx)(n.Line,{points:o,color:a.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*p.beam,p.length-1.6]}),(0,t.jsx)("meshBasicMaterial",{color:a.target,transparent:!0,opacity:.12,depthWrite:!1})]}),("bow"===e||"stern"===e)&&(s="bow"===e?-1:1,(0,t.jsxs)("group",{children:[(0,t.jsx)(v,{size:[32,.35,2.2],position:[0,.17,s*(h+.45+1.1)],color:a.pontoon}),(0,t.jsx)(v,{size:[.8,.3,9],position:[m+.45+.4,.15,s*(h-4.5+.45)],color:a.pontoon}),(0,t.jsx)(v,{size:[.95*p.beam,1,.95*p.length],position:[-(p.beam+.9),.5,0],color:a.neighbour,opacity:.45}),(0,t.jsx)(g,{position:[0,0,-s*(h+7)],rotation:"bow"===e?0:Math.PI,color:a.target})]})),"side"===e&&(0,t.jsxs)("group",{children:[(0,t.jsx)(v,{size:[2.4,.35,26],position:[l*(m+.45+1.2),.17,0],color:a.pontoon}),(0,t.jsx)(g,{position:[-(2.5*l),0,h+6],rotation:.25*l,color:a.target})]}),"buoy"===e&&(0,t.jsxs)("group",{children:[(0,t.jsxs)("mesh",{position:[0,.5,-(h+2.5)],children:[(0,t.jsx)("sphereGeometry",{args:[.6,20,14]}),(0,t.jsx)("meshLambertMaterial",{color:a.buoy})]}),(0,t.jsx)(n.Line,{points:[[0,.3,-(h+2.5)],[0,.3,-h]],color:a.pontoon,lineWidth:2}),(0,t.jsx)(g,{position:[0,0,h+6],color:a.target})]})]})};e.s(["BOAT",0,p,"default",0,({scale:e=.5})=>{let{scene:n,accent:s}=(0,r.default)(),{heading:o,offset:d,hasFix:u,hasHeading:p}=(0,a.default)(),h=c();(0,i.useEffect)(()=>{u&&p&&!l().pose&&f(d,o)},[d,o,u,p]);let m=(0,i.useMemo)(()=>({target:s,pontoon:n.rigging,neighbour:n.vessel,buoy:n.target}),[n,s]);if(!h.pose)return null;let{x:v,y:g,heading:x}=h.pose;return(0,t.jsx)("group",{rotation:[0,o,0],children:(0,t.jsx)("group",{position:[(v-d.x)*e,0,-(g-d.y)*e],rotation:[0,-x,0],scale:[e,e,e],children:(0,t.jsx)(y,{type:h.type,side:h.side,colors:m})})})}],76247)},83646,e=>{"use strict";var t=e.i(67561);e.s(["default",0,()=>(0,t.useOcearoContext)().tokens])},31067,e=>{"use strict";function t(){return(t=Object.assign.bind()).apply(null,arguments)}e.s(["default",()=>t])},43216,e=>{"use strict";let t,i;var n=e.i(31067),r=e.i(71645),a=e.i(90072),s=e.i(90874),o=a,l=e.i(32533),d=a,u=e.i(8560),c=e.i(31497);class f extends d.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:d.UniformsUtils.clone(d.UniformsUtils.merge([u.UniformsLib.common,u.UniformsLib.fog,{worldUnits:{value:1},linewidth:{value:1},resolution:{value:new d.Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}}])),vertexShader:`
|
|
2
|
-
#include <common>
|
|
3
|
-
#include <fog_pars_vertex>
|
|
4
|
-
#include <logdepthbuf_pars_vertex>
|
|
5
|
-
#include <clipping_planes_pars_vertex>
|
|
6
|
-
|
|
7
|
-
uniform float linewidth;
|
|
8
|
-
uniform vec2 resolution;
|
|
9
|
-
|
|
10
|
-
attribute vec3 instanceStart;
|
|
11
|
-
attribute vec3 instanceEnd;
|
|
12
|
-
|
|
13
|
-
#ifdef USE_COLOR
|
|
14
|
-
#ifdef USE_LINE_COLOR_ALPHA
|
|
15
|
-
varying vec4 vLineColor;
|
|
16
|
-
attribute vec4 instanceColorStart;
|
|
17
|
-
attribute vec4 instanceColorEnd;
|
|
18
|
-
#else
|
|
19
|
-
varying vec3 vLineColor;
|
|
20
|
-
attribute vec3 instanceColorStart;
|
|
21
|
-
attribute vec3 instanceColorEnd;
|
|
22
|
-
#endif
|
|
23
|
-
#endif
|
|
24
|
-
|
|
25
|
-
#ifdef WORLD_UNITS
|
|
26
|
-
|
|
27
|
-
varying vec4 worldPos;
|
|
28
|
-
varying vec3 worldStart;
|
|
29
|
-
varying vec3 worldEnd;
|
|
30
|
-
|
|
31
|
-
#ifdef USE_DASH
|
|
32
|
-
|
|
33
|
-
varying vec2 vUv;
|
|
34
|
-
|
|
35
|
-
#endif
|
|
36
|
-
|
|
37
|
-
#else
|
|
38
|
-
|
|
39
|
-
varying vec2 vUv;
|
|
40
|
-
|
|
41
|
-
#endif
|
|
42
|
-
|
|
43
|
-
#ifdef USE_DASH
|
|
44
|
-
|
|
45
|
-
uniform float dashScale;
|
|
46
|
-
attribute float instanceDistanceStart;
|
|
47
|
-
attribute float instanceDistanceEnd;
|
|
48
|
-
varying float vLineDistance;
|
|
49
|
-
|
|
50
|
-
#endif
|
|
51
|
-
|
|
52
|
-
void trimSegment( const in vec4 start, inout vec4 end ) {
|
|
53
|
-
|
|
54
|
-
// trim end segment so it terminates between the camera plane and the near plane
|
|
55
|
-
|
|
56
|
-
// conservative estimate of the near plane
|
|
57
|
-
float a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column
|
|
58
|
-
float b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column
|
|
59
|
-
float nearEstimate = - 0.5 * b / a;
|
|
60
|
-
|
|
61
|
-
float alpha = ( nearEstimate - start.z ) / ( end.z - start.z );
|
|
62
|
-
|
|
63
|
-
end.xyz = mix( start.xyz, end.xyz, alpha );
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
void main() {
|
|
68
|
-
|
|
69
|
-
#ifdef USE_COLOR
|
|
70
|
-
|
|
71
|
-
vLineColor = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;
|
|
72
|
-
|
|
73
|
-
#endif
|
|
74
|
-
|
|
75
|
-
#ifdef USE_DASH
|
|
76
|
-
|
|
77
|
-
vLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;
|
|
78
|
-
vUv = uv;
|
|
79
|
-
|
|
80
|
-
#endif
|
|
81
|
-
|
|
82
|
-
float aspect = resolution.x / resolution.y;
|
|
83
|
-
|
|
84
|
-
// camera space
|
|
85
|
-
vec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );
|
|
86
|
-
vec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );
|
|
87
|
-
|
|
88
|
-
#ifdef WORLD_UNITS
|
|
89
|
-
|
|
90
|
-
worldStart = start.xyz;
|
|
91
|
-
worldEnd = end.xyz;
|
|
92
|
-
|
|
93
|
-
#else
|
|
94
|
-
|
|
95
|
-
vUv = uv;
|
|
96
|
-
|
|
97
|
-
#endif
|
|
98
|
-
|
|
99
|
-
// special case for perspective projection, and segments that terminate either in, or behind, the camera plane
|
|
100
|
-
// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space
|
|
101
|
-
// but we need to perform ndc-space calculations in the shader, so we must address this issue directly
|
|
102
|
-
// perhaps there is a more elegant solution -- WestLangley
|
|
103
|
-
|
|
104
|
-
bool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column
|
|
105
|
-
|
|
106
|
-
if ( perspective ) {
|
|
107
|
-
|
|
108
|
-
if ( start.z < 0.0 && end.z >= 0.0 ) {
|
|
109
|
-
|
|
110
|
-
trimSegment( start, end );
|
|
111
|
-
|
|
112
|
-
} else if ( end.z < 0.0 && start.z >= 0.0 ) {
|
|
113
|
-
|
|
114
|
-
trimSegment( end, start );
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// clip space
|
|
121
|
-
vec4 clipStart = projectionMatrix * start;
|
|
122
|
-
vec4 clipEnd = projectionMatrix * end;
|
|
123
|
-
|
|
124
|
-
// ndc space
|
|
125
|
-
vec3 ndcStart = clipStart.xyz / clipStart.w;
|
|
126
|
-
vec3 ndcEnd = clipEnd.xyz / clipEnd.w;
|
|
127
|
-
|
|
128
|
-
// direction
|
|
129
|
-
vec2 dir = ndcEnd.xy - ndcStart.xy;
|
|
130
|
-
|
|
131
|
-
// account for clip-space aspect ratio
|
|
132
|
-
dir.x *= aspect;
|
|
133
|
-
dir = normalize( dir );
|
|
134
|
-
|
|
135
|
-
#ifdef WORLD_UNITS
|
|
136
|
-
|
|
137
|
-
// get the offset direction as perpendicular to the view vector
|
|
138
|
-
vec3 worldDir = normalize( end.xyz - start.xyz );
|
|
139
|
-
vec3 offset;
|
|
140
|
-
if ( position.y < 0.5 ) {
|
|
141
|
-
|
|
142
|
-
offset = normalize( cross( start.xyz, worldDir ) );
|
|
143
|
-
|
|
144
|
-
} else {
|
|
145
|
-
|
|
146
|
-
offset = normalize( cross( end.xyz, worldDir ) );
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// sign flip
|
|
151
|
-
if ( position.x < 0.0 ) offset *= - 1.0;
|
|
152
|
-
|
|
153
|
-
float forwardOffset = dot( worldDir, vec3( 0.0, 0.0, 1.0 ) );
|
|
154
|
-
|
|
155
|
-
// don't extend the line if we're rendering dashes because we
|
|
156
|
-
// won't be rendering the endcaps
|
|
157
|
-
#ifndef USE_DASH
|
|
158
|
-
|
|
159
|
-
// extend the line bounds to encompass endcaps
|
|
160
|
-
start.xyz += - worldDir * linewidth * 0.5;
|
|
161
|
-
end.xyz += worldDir * linewidth * 0.5;
|
|
162
|
-
|
|
163
|
-
// shift the position of the quad so it hugs the forward edge of the line
|
|
164
|
-
offset.xy -= dir * forwardOffset;
|
|
165
|
-
offset.z += 0.5;
|
|
166
|
-
|
|
167
|
-
#endif
|
|
168
|
-
|
|
169
|
-
// endcaps
|
|
170
|
-
if ( position.y > 1.0 || position.y < 0.0 ) {
|
|
171
|
-
|
|
172
|
-
offset.xy += dir * 2.0 * forwardOffset;
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// adjust for linewidth
|
|
177
|
-
offset *= linewidth * 0.5;
|
|
178
|
-
|
|
179
|
-
// set the world position
|
|
180
|
-
worldPos = ( position.y < 0.5 ) ? start : end;
|
|
181
|
-
worldPos.xyz += offset;
|
|
182
|
-
|
|
183
|
-
// project the worldpos
|
|
184
|
-
vec4 clip = projectionMatrix * worldPos;
|
|
185
|
-
|
|
186
|
-
// shift the depth of the projected points so the line
|
|
187
|
-
// segments overlap neatly
|
|
188
|
-
vec3 clipPose = ( position.y < 0.5 ) ? ndcStart : ndcEnd;
|
|
189
|
-
clip.z = clipPose.z * clip.w;
|
|
190
|
-
|
|
191
|
-
#else
|
|
192
|
-
|
|
193
|
-
vec2 offset = vec2( dir.y, - dir.x );
|
|
194
|
-
// undo aspect ratio adjustment
|
|
195
|
-
dir.x /= aspect;
|
|
196
|
-
offset.x /= aspect;
|
|
197
|
-
|
|
198
|
-
// sign flip
|
|
199
|
-
if ( position.x < 0.0 ) offset *= - 1.0;
|
|
200
|
-
|
|
201
|
-
// endcaps
|
|
202
|
-
if ( position.y < 0.0 ) {
|
|
203
|
-
|
|
204
|
-
offset += - dir;
|
|
205
|
-
|
|
206
|
-
} else if ( position.y > 1.0 ) {
|
|
207
|
-
|
|
208
|
-
offset += dir;
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
// adjust for linewidth
|
|
213
|
-
offset *= linewidth;
|
|
214
|
-
|
|
215
|
-
// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...
|
|
216
|
-
offset /= resolution.y;
|
|
217
|
-
|
|
218
|
-
// select end
|
|
219
|
-
vec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;
|
|
220
|
-
|
|
221
|
-
// back to clip space
|
|
222
|
-
offset *= clip.w;
|
|
223
|
-
|
|
224
|
-
clip.xy += offset;
|
|
225
|
-
|
|
226
|
-
#endif
|
|
227
|
-
|
|
228
|
-
gl_Position = clip;
|
|
229
|
-
|
|
230
|
-
vec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation
|
|
231
|
-
|
|
232
|
-
#include <logdepthbuf_vertex>
|
|
233
|
-
#include <clipping_planes_vertex>
|
|
234
|
-
#include <fog_vertex>
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
-
`,fragmentShader:`
|
|
238
|
-
uniform vec3 diffuse;
|
|
239
|
-
uniform float opacity;
|
|
240
|
-
uniform float linewidth;
|
|
241
|
-
|
|
242
|
-
#ifdef USE_DASH
|
|
243
|
-
|
|
244
|
-
uniform float dashOffset;
|
|
245
|
-
uniform float dashSize;
|
|
246
|
-
uniform float gapSize;
|
|
247
|
-
|
|
248
|
-
#endif
|
|
249
|
-
|
|
250
|
-
varying float vLineDistance;
|
|
251
|
-
|
|
252
|
-
#ifdef WORLD_UNITS
|
|
253
|
-
|
|
254
|
-
varying vec4 worldPos;
|
|
255
|
-
varying vec3 worldStart;
|
|
256
|
-
varying vec3 worldEnd;
|
|
257
|
-
|
|
258
|
-
#ifdef USE_DASH
|
|
259
|
-
|
|
260
|
-
varying vec2 vUv;
|
|
261
|
-
|
|
262
|
-
#endif
|
|
263
|
-
|
|
264
|
-
#else
|
|
265
|
-
|
|
266
|
-
varying vec2 vUv;
|
|
267
|
-
|
|
268
|
-
#endif
|
|
269
|
-
|
|
270
|
-
#include <common>
|
|
271
|
-
#include <fog_pars_fragment>
|
|
272
|
-
#include <logdepthbuf_pars_fragment>
|
|
273
|
-
#include <clipping_planes_pars_fragment>
|
|
274
|
-
|
|
275
|
-
#ifdef USE_COLOR
|
|
276
|
-
#ifdef USE_LINE_COLOR_ALPHA
|
|
277
|
-
varying vec4 vLineColor;
|
|
278
|
-
#else
|
|
279
|
-
varying vec3 vLineColor;
|
|
280
|
-
#endif
|
|
281
|
-
#endif
|
|
282
|
-
|
|
283
|
-
vec2 closestLineToLine(vec3 p1, vec3 p2, vec3 p3, vec3 p4) {
|
|
284
|
-
|
|
285
|
-
float mua;
|
|
286
|
-
float mub;
|
|
287
|
-
|
|
288
|
-
vec3 p13 = p1 - p3;
|
|
289
|
-
vec3 p43 = p4 - p3;
|
|
290
|
-
|
|
291
|
-
vec3 p21 = p2 - p1;
|
|
292
|
-
|
|
293
|
-
float d1343 = dot( p13, p43 );
|
|
294
|
-
float d4321 = dot( p43, p21 );
|
|
295
|
-
float d1321 = dot( p13, p21 );
|
|
296
|
-
float d4343 = dot( p43, p43 );
|
|
297
|
-
float d2121 = dot( p21, p21 );
|
|
298
|
-
|
|
299
|
-
float denom = d2121 * d4343 - d4321 * d4321;
|
|
300
|
-
|
|
301
|
-
float numer = d1343 * d4321 - d1321 * d4343;
|
|
302
|
-
|
|
303
|
-
mua = numer / denom;
|
|
304
|
-
mua = clamp( mua, 0.0, 1.0 );
|
|
305
|
-
mub = ( d1343 + d4321 * ( mua ) ) / d4343;
|
|
306
|
-
mub = clamp( mub, 0.0, 1.0 );
|
|
307
|
-
|
|
308
|
-
return vec2( mua, mub );
|
|
309
|
-
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
void main() {
|
|
313
|
-
|
|
314
|
-
#include <clipping_planes_fragment>
|
|
315
|
-
|
|
316
|
-
#ifdef USE_DASH
|
|
317
|
-
|
|
318
|
-
if ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps
|
|
319
|
-
|
|
320
|
-
if ( mod( vLineDistance + dashOffset, dashSize + gapSize ) > dashSize ) discard; // todo - FIX
|
|
321
|
-
|
|
322
|
-
#endif
|
|
323
|
-
|
|
324
|
-
float alpha = opacity;
|
|
325
|
-
|
|
326
|
-
#ifdef WORLD_UNITS
|
|
327
|
-
|
|
328
|
-
// Find the closest points on the view ray and the line segment
|
|
329
|
-
vec3 rayEnd = normalize( worldPos.xyz ) * 1e5;
|
|
330
|
-
vec3 lineDir = worldEnd - worldStart;
|
|
331
|
-
vec2 params = closestLineToLine( worldStart, worldEnd, vec3( 0.0, 0.0, 0.0 ), rayEnd );
|
|
332
|
-
|
|
333
|
-
vec3 p1 = worldStart + lineDir * params.x;
|
|
334
|
-
vec3 p2 = rayEnd * params.y;
|
|
335
|
-
vec3 delta = p1 - p2;
|
|
336
|
-
float len = length( delta );
|
|
337
|
-
float norm = len / linewidth;
|
|
338
|
-
|
|
339
|
-
#ifndef USE_DASH
|
|
340
|
-
|
|
341
|
-
#ifdef USE_ALPHA_TO_COVERAGE
|
|
342
|
-
|
|
343
|
-
float dnorm = fwidth( norm );
|
|
344
|
-
alpha = 1.0 - smoothstep( 0.5 - dnorm, 0.5 + dnorm, norm );
|
|
345
|
-
|
|
346
|
-
#else
|
|
347
|
-
|
|
348
|
-
if ( norm > 0.5 ) {
|
|
349
|
-
|
|
350
|
-
discard;
|
|
351
|
-
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
#endif
|
|
355
|
-
|
|
356
|
-
#endif
|
|
357
|
-
|
|
358
|
-
#else
|
|
359
|
-
|
|
360
|
-
#ifdef USE_ALPHA_TO_COVERAGE
|
|
361
|
-
|
|
362
|
-
// artifacts appear on some hardware if a derivative is taken within a conditional
|
|
363
|
-
float a = vUv.x;
|
|
364
|
-
float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
|
|
365
|
-
float len2 = a * a + b * b;
|
|
366
|
-
float dlen = fwidth( len2 );
|
|
367
|
-
|
|
368
|
-
if ( abs( vUv.y ) > 1.0 ) {
|
|
369
|
-
|
|
370
|
-
alpha = 1.0 - smoothstep( 1.0 - dlen, 1.0 + dlen, len2 );
|
|
371
|
-
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
#else
|
|
375
|
-
|
|
376
|
-
if ( abs( vUv.y ) > 1.0 ) {
|
|
377
|
-
|
|
378
|
-
float a = vUv.x;
|
|
379
|
-
float b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;
|
|
380
|
-
float len2 = a * a + b * b;
|
|
381
|
-
|
|
382
|
-
if ( len2 > 1.0 ) discard;
|
|
383
|
-
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
#endif
|
|
387
|
-
|
|
388
|
-
#endif
|
|
389
|
-
|
|
390
|
-
vec4 diffuseColor = vec4( diffuse, alpha );
|
|
391
|
-
#ifdef USE_COLOR
|
|
392
|
-
#ifdef USE_LINE_COLOR_ALPHA
|
|
393
|
-
diffuseColor *= vLineColor;
|
|
394
|
-
#else
|
|
395
|
-
diffuseColor.rgb *= vLineColor;
|
|
396
|
-
#endif
|
|
397
|
-
#endif
|
|
398
|
-
|
|
399
|
-
#include <logdepthbuf_fragment>
|
|
400
|
-
|
|
401
|
-
gl_FragColor = diffuseColor;
|
|
402
|
-
|
|
403
|
-
#include <tonemapping_fragment>
|
|
404
|
-
#include <${c.version>=154?"colorspace_fragment":"encodings_fragment"}>
|
|
405
|
-
#include <fog_fragment>
|
|
406
|
-
#include <premultiplied_alpha_fragment>
|
|
407
|
-
|
|
408
|
-
}
|
|
409
|
-
`,clipping:!0}),this.isLineMaterial=!0,this.onBeforeCompile=function(){this.transparent?this.defines.USE_LINE_COLOR_ALPHA="1":delete this.defines.USE_LINE_COLOR_ALPHA},Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},worldUnits:{enumerable:!0,get:function(){return"WORLD_UNITS"in this.defines},set:function(e){!0===e?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashed:{enumerable:!0,get:function(){return"USE_DASH"in this.defines},set(e){!!e!="USE_DASH"in this.defines&&(this.needsUpdate=!0),!0===e?this.defines.USE_DASH="":delete this.defines.USE_DASH}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},dashOffset:{enumerable:!0,get:function(){return this.uniforms.dashOffset.value},set:function(e){this.uniforms.dashOffset.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(e){this.uniforms.opacity.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}},alphaToCoverage:{enumerable:!0,get:function(){return"USE_ALPHA_TO_COVERAGE"in this.defines},set:function(e){!!e!="USE_ALPHA_TO_COVERAGE"in this.defines&&(this.needsUpdate=!0),!0===e?(this.defines.USE_ALPHA_TO_COVERAGE="",this.extensions.derivatives=!0):(delete this.defines.USE_ALPHA_TO_COVERAGE,this.extensions.derivatives=!1)}}}),this.setValues(e)}}let p=c.version>=125?"uv1":"uv2",h=new o.Vector4,m=new o.Vector3,v=new o.Vector3,g=new o.Vector4,y=new o.Vector4,x=new o.Vector4,b=new o.Vector3,S=new o.Matrix4,w=new o.Line3,M=new o.Vector3,_=new o.Box3,E=new o.Sphere,A=new o.Vector4;function L(e,t,n){return A.set(0,0,-t,1).applyMatrix4(e.projectionMatrix),A.multiplyScalar(1/A.w),A.x=i/n.width,A.y=i/n.height,A.applyMatrix4(e.projectionMatrixInverse),A.multiplyScalar(1/A.w),Math.abs(Math.max(A.x,A.y))}class B extends o.Mesh{constructor(e=new l.LineSegmentsGeometry,t=new f({color:0xffffff*Math.random()})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){let e=this.geometry,t=e.attributes.instanceStart,i=e.attributes.instanceEnd,n=new Float32Array(2*t.count);for(let e=0,r=0,a=t.count;e<a;e++,r+=2)m.fromBufferAttribute(t,e),v.fromBufferAttribute(i,e),n[r]=0===r?0:n[r-1],n[r+1]=n[r]+m.distanceTo(v);let r=new o.InstancedInterleavedBuffer(n,2,1);return e.setAttribute("instanceDistanceStart",new o.InterleavedBufferAttribute(r,1,0)),e.setAttribute("instanceDistanceEnd",new o.InterleavedBufferAttribute(r,1,1)),this}raycast(e,n){let r,a,s=this.material.worldUnits,l=e.camera;null!==l||s||console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');let d=void 0!==e.params.Line2&&e.params.Line2.threshold||0;t=e.ray;let u=this.matrixWorld,c=this.geometry,f=this.material;if(i=f.linewidth+d,null===c.boundingSphere&&c.computeBoundingSphere(),E.copy(c.boundingSphere).applyMatrix4(u),s)r=.5*i;else{let e=Math.max(l.near,E.distanceToPoint(t.origin));r=L(l,e,f.resolution)}if(E.radius+=r,!1!==t.intersectsSphere(E)){if(null===c.boundingBox&&c.computeBoundingBox(),_.copy(c.boundingBox).applyMatrix4(u),s)a=.5*i;else{let e=Math.max(l.near,_.distanceToPoint(t.origin));a=L(l,e,f.resolution)}_.expandByScalar(a),!1!==t.intersectsBox(_)&&(s?function(e,n){let r=e.matrixWorld,a=e.geometry,s=a.attributes.instanceStart,l=a.attributes.instanceEnd,d=Math.min(a.instanceCount,s.count);for(let a=0;a<d;a++){w.start.fromBufferAttribute(s,a),w.end.fromBufferAttribute(l,a),w.applyMatrix4(r);let d=new o.Vector3,u=new o.Vector3;t.distanceSqToSegment(w.start,w.end,u,d),u.distanceTo(d)<.5*i&&n.push({point:u,pointOnLine:d,distance:t.origin.distanceTo(u),object:e,face:null,faceIndex:a,uv:null,[p]:null})}}(this,n):function(e,n,r){let a=n.projectionMatrix,s=e.material.resolution,l=e.matrixWorld,d=e.geometry,u=d.attributes.instanceStart,c=d.attributes.instanceEnd,f=Math.min(d.instanceCount,u.count),h=-n.near;t.at(1,x),x.w=1,x.applyMatrix4(n.matrixWorldInverse),x.applyMatrix4(a),x.multiplyScalar(1/x.w),x.x*=s.x/2,x.y*=s.y/2,x.z=0,b.copy(x),S.multiplyMatrices(n.matrixWorldInverse,l);for(let n=0;n<f;n++){if(g.fromBufferAttribute(u,n),y.fromBufferAttribute(c,n),g.w=1,y.w=1,g.applyMatrix4(S),y.applyMatrix4(S),g.z>h&&y.z>h)continue;if(g.z>h){let e=g.z-y.z,t=(g.z-h)/e;g.lerp(y,t)}else if(y.z>h){let e=y.z-g.z,t=(y.z-h)/e;y.lerp(g,t)}g.applyMatrix4(a),y.applyMatrix4(a),g.multiplyScalar(1/g.w),y.multiplyScalar(1/y.w),g.x*=s.x/2,g.y*=s.y/2,y.x*=s.x/2,y.y*=s.y/2,w.start.copy(g),w.start.z=0,w.end.copy(y),w.end.z=0;let d=w.closestPointToPointParameter(b,!0);w.at(d,M);let f=o.MathUtils.lerp(g.z,y.z,d),m=f>=-1&&f<=1,v=b.distanceTo(M)<.5*i;if(m&&v){w.start.fromBufferAttribute(u,n),w.end.fromBufferAttribute(c,n),w.start.applyMatrix4(l),w.end.applyMatrix4(l);let i=new o.Vector3,a=new o.Vector3;t.distanceSqToSegment(w.start,w.end,a,i),r.push({point:a,pointOnLine:i,distance:t.origin.distanceTo(a),object:e,face:null,faceIndex:n,uv:null,[p]:null})}}}(this,l,n))}}onBeforeRender(e){let t=this.material.uniforms;t&&t.resolution&&(e.getViewport(h),this.material.uniforms.resolution.value.set(h.z,h.w))}}var U=l;class z extends U.LineSegmentsGeometry{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){let t=e.length-3,i=new Float32Array(2*t);for(let n=0;n<t;n+=3)i[2*n]=e[n],i[2*n+1]=e[n+1],i[2*n+2]=e[n+2],i[2*n+3]=e[n+3],i[2*n+4]=e[n+4],i[2*n+5]=e[n+5];return super.setPositions(i),this}setColors(e,t=3){let i=e.length-t,n=new Float32Array(2*i);if(3===t)for(let r=0;r<i;r+=t)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5];else for(let r=0;r<i;r+=t)n[2*r]=e[r],n[2*r+1]=e[r+1],n[2*r+2]=e[r+2],n[2*r+3]=e[r+3],n[2*r+4]=e[r+4],n[2*r+5]=e[r+5],n[2*r+6]=e[r+6],n[2*r+7]=e[r+7];return super.setColors(n,t),this}fromLine(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class j extends B{constructor(e=new z,t=new f({color:0xffffff*Math.random()})){super(e,t),this.isLine2=!0,this.type="Line2"}}let O=r.forwardRef(function({points:e,color:t=0xffffff,vertexColors:i,linewidth:o,lineWidth:d,segments:u,dashed:c,...p},h){var m,v;let g=(0,s.useThree)(e=>e.size),y=r.useMemo(()=>u?new B:new j,[u]),[x]=r.useState(()=>new f),b=(null==i||null==(m=i[0])?void 0:m.length)===4?4:3,S=r.useMemo(()=>{let n=u?new l.LineSegmentsGeometry:new z,r=e.map(e=>{let t=Array.isArray(e);return e instanceof a.Vector3||e instanceof a.Vector4?[e.x,e.y,e.z]:e instanceof a.Vector2?[e.x,e.y,0]:t&&3===e.length?[e[0],e[1],e[2]]:t&&2===e.length?[e[0],e[1],0]:e});if(n.setPositions(r.flat()),i){t=0xffffff;let e=i.map(e=>e instanceof a.Color?e.toArray():e);n.setColors(e.flat(),b)}return n},[e,u,i,b]);return r.useLayoutEffect(()=>{y.computeLineDistances()},[e,y]),r.useLayoutEffect(()=>{c?x.defines.USE_DASH="":delete x.defines.USE_DASH,x.needsUpdate=!0},[c,x]),r.useEffect(()=>()=>{S.dispose(),x.dispose()},[S]),r.createElement("primitive",(0,n.default)({object:y,ref:h},p),r.createElement("primitive",{object:S,attach:"geometry"}),r.createElement("primitive",(0,n.default)({object:x,attach:"material",color:t,vertexColors:!!i,resolution:[g.width,g.height],linewidth:null!=(v=null!=o?o:d)?v:1,dashed:c,transparent:4===b},p)))});e.s(["Line",0,O],43216)},31497,e=>{"use strict";let t=parseInt(e.i(90072).REVISION.replace(/\D+/g,""));e.s(["version",0,t])},32533,e=>{"use strict";var t=e.i(90072);let i=new t.Box3,n=new t.Vector3;class r extends t.InstancedBufferGeometry{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry",this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new t.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new t.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))}applyMatrix4(e){let t=this.attributes.instanceStart,i=this.attributes.instanceEnd;return void 0!==t&&(t.applyMatrix4(e),i.applyMatrix4(e),t.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(e){let i;e instanceof Float32Array?i=e:Array.isArray(e)&&(i=new Float32Array(e));let n=new t.InstancedInterleavedBuffer(i,6,1);return this.setAttribute("instanceStart",new t.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceEnd",new t.InterleavedBufferAttribute(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e,i=3){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));let r=new t.InstancedInterleavedBuffer(n,2*i,1);return this.setAttribute("instanceColorStart",new t.InterleavedBufferAttribute(r,i,0)),this.setAttribute("instanceColorEnd",new t.InterleavedBufferAttribute(r,i,i)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new t.WireframeGeometry(e.geometry)),this}fromLineSegments(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new t.Box3);let e=this.attributes.instanceStart,n=this.attributes.instanceEnd;void 0!==e&&void 0!==n&&(this.boundingBox.setFromBufferAttribute(e),i.setFromBufferAttribute(n),this.boundingBox.union(i))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new t.Sphere),null===this.boundingBox&&this.computeBoundingBox();let e=this.attributes.instanceStart,i=this.attributes.instanceEnd;if(void 0!==e&&void 0!==i){let t=this.boundingSphere.center;this.boundingBox.getCenter(t);let r=0;for(let a=0,s=e.count;a<s;a++)n.fromBufferAttribute(e,a),r=Math.max(r,t.distanceToSquared(n)),n.fromBufferAttribute(i,a),r=Math.max(r,t.distanceToSquared(n));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}applyMatrix(e){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(e)}}e.s(["LineSegmentsGeometry",0,r])},74452,(e,t,i)=>{t.exports={vpp:{angles:[52,60,75,90,110,120,135,150],speeds:[6,8,10,12,14,16,20],52:[4.98,5.86,6.31,6.45,6.51,6.52,6.41],60:[5.25,6.11,6.56,6.73,6.79,6.82,6.79],75:[5.45,6.33,6.77,7.01,7.13,7.2,7.24],90:[5.66,6.55,7,7.25,7.38,7.53,7.7],110:[5.49,6.49,7.04,7.4,7.69,7.97,8.38],120:[5.32,6.36,6.97,7.39,7.77,8.1,8.6],135:[4.81,5.92,6.68,7.15,7.55,7.95,8.85],150:[4.09,5.17,6.04,6.61,6.99,7.31,7.93],beat_angle:[43.6,42,41.2,41.2,41.7,42.1,44.2],beat_vmg:[3.26,3.91,4.24,4.34,4.36,4.34,4.16],run_angle:[144.8,147.8,148.5,149.6,171.8,175.4,177.2],run_vmg:[3.54,4.48,5.23,5.73,6.17,6.67,7.36]}}},539,e=>{"use strict";var t=e.i(74452);let i=180/Math.PI,n=t.default.vpp,r=(e,t,i)=>e+(t-e)*i,a=(e,t)=>{if(t<=e[0])return[0,0];let i=e.length-1;if(t>=e[i])return[i-1,1];let n=0;for(;t>e[n+1];)n++;return[n,(t-e[n])/(e[n+1]-e[n])]},s=n.speeds.map((e,t)=>(e=>{let t=n.beat_angle[e],r=n.run_angle[e],a=n.beat_vmg[e]/Math.cos(t/i),s=n.run_vmg[e]/Math.abs(Math.cos(r/i)),o=[[0,0],[.7*t,.55*a],[t,a]];for(let i of n.angles)i>t&&i<r&&o.push([i,n[String(i)][e]]);return o.push([r,s]),r<180&&o.push([180,n.run_vmg[e]]),o})(t)),o=(e,t)=>{let[i,n]=a(e.map(e=>e[0]),t);return r(e[i][1],e[i+1][1],n)},l=(e,t)=>{if(!Number.isFinite(e)||!Number.isFinite(t)||e<=0)return null;let i=Math.min(180,Math.abs((t+540)%360-180)),l=n.speeds;if(e<l[0])return o(s[0],i)*(e/l[0]);let[d,u]=a(l,e);return r(o(s[d],i),o(s[d+1],i),u)},d=(e,t)=>{let[i,s]=a(n.speeds,t);return r(e[i],e[i+1],s)},u=(e,t)=>{let n=l(1.943844*e,t*i);return null===n?null:n/1.943844},c=e=>{let t=(e+Math.PI)%(2*Math.PI);return t<0&&(t+=2*Math.PI),t-Math.PI};e.s(["bestVmcHeading",0,({twd:e,tws:t,bearing:n})=>{if(![e,t,n].every(Number.isFinite)||t<=0)return null;let r=null;for(let a=-100;a<=100;a++){let s=n+a/i,o=u(t,c(e-s));if(null===o)continue;let l=o*Math.cos(s-n);(!r||l>r.vmc)&&(r={heading:c(s),speed:o,vmc:l})}return r},"optimalDownwind",0,e=>{if(!Number.isFinite(e)||e<=0)return null;let t=d(n.run_angle,e),r=l(e,t);return{twa:t,speed:r,vmg:-r*Math.cos(t/i)}},"optimalUpwind",0,e=>{if(!Number.isFinite(e)||e<=0)return null;let t=d(n.beat_angle,e),r=l(e,t);return{twa:t,speed:r,vmg:r*Math.cos(t/i)}},"polarSpeed",0,l,"polarSpeedSi",0,u,"vmcForHeading",0,({twd:e,tws:t,bearing:i,heading:n})=>{if(![e,t,i,n].every(Number.isFinite))return null;let r=u(t,c(e-n));return null===r?null:r*Math.cos(n-i)},"wrapPi",0,c])}]);
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,47141,e=>{"use strict";var t=e.i(43476),r=e.i(61949),a=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 i=e.i(32009);function l(e,t){let r;return(...a)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...a),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=r.f,eventSource:h,eventPrefix:f,shadows:C,linear:g,flat:x,legacy:b,orthographic:S,frameloop:A,dpr:T,performance:M,raycaster:G,camera:_,scene:R,onPointerMissed:F,onCreated:v,...y}){a.useMemo(()=>(0,r.e)(i),[]);let B=(0,r.u)(),[L,E]=function({debounce:e,scroll:t,polyfill:r,offsetSize:n}={debounce:0,scroll:!1,offsetSize:!1}){var o,i,c;let u=r||("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,a.useState)({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),p=(0,a.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,C=(0,a.useRef)(!1);(0,a.useEffect)(()=>(C.current=!0,()=>void(C.current=!1)));let[g,x,b]=(0,a.useMemo)(()=>{let e=()=>{let e,t;if(!p.current.element)return;let{left:r,top:a,width:o,height:i,bottom:l,right:c,x:u,y:d}=p.current.element.getBoundingClientRect(),h={left:r,top:a,width:o,height:i,bottom:l,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),C.current&&(e=p.current.lastBounds,t=h,!s.every(r=>e[r]===t[r]))&&m(p.current.lastBounds=h)};return[e,f?l(e,f):e,h?l(e,h):e]},[m,n,h,f]);function S(){p.current.scrollContainers&&(p.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",b,!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 A(){p.current.element&&(p.current.resizeObserver=new u(b),p.current.resizeObserver.observe(p.current.element),t&&p.current.scrollContainers&&p.current.scrollContainers.forEach(e=>e.addEventListener("scroll",b,{capture:!0,passive:!0})),p.current.orientationHandler=()=>{b()},"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=b,i=!!t,(0,a.useEffect)(()=>{if(i)return window.addEventListener("scroll",o,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",o,!0)},[o,i]),c=x,(0,a.useEffect)(()=>(window.addEventListener("resize",c),()=>void window.removeEventListener("resize",c)),[c]),(0,a.useEffect)(()=>{S(),A()},[t,b,x]),(0,a.useEffect)(()=>S,[]),[e=>{e&&e!==p.current.element&&(S(),p.current.element=e,p.current.scrollContainers=function e(t){let r=[];if(!t||t===document.body)return r;let{overflow:a,overflowX:n,overflowY:o}=window.getComputedStyle(t);return[a,n,o].some(e=>"auto"===e||"scroll"===e)&&r.push(t),[...r,...e(t.parentElement)]}(e),A())},d,g]}({scroll:!0,debounce:{scroll:50,resize:0},...c}),D=a.useRef(null),w=a.useRef(null);a.useImperativeHandle(e,()=>D.current);let N=(0,r.a)(F),j=a.useCallback(e=>null==N.current?void 0:N.current(e),[N]),[I,P]=a.useState(!1),[k,O]=a.useState(!1);if(I)throw I;if(k)throw k;let U=a.useRef(null),[W,H]=(0,r.b)(),z=a.useRef(null),q=()=>h?(0,r.i)(h)?h.current:h:w.current;a.useInsertionEffect(()=>()=>{let e=U.current;U.current=null,null==e||e.unmount()},[]),(0,r.c)(()=>{let e=D.current;E.width>0&&E.height>0&&e&&(U.current||(U.current=(0,r.d)(e)),U.current.configure({gl:m,scene:R,events:p,shadows:C,linear:g,flat:x,legacy:b,orthographic:S,frameloop:A,dpr:T,performance:M,raycaster:G,camera:_,size:E,onPointerMissed:j,onCreated:e=>{var t;z.current=e,null==e.events.connect||e.events.connect(null!=(t=q())?t:w.current),f&&e.setEvents({compute:(e,t)=>{let r=e[f+"X"],a=e[f+"Y"];t.pointer.set(r/t.size.width*2-1,-(2*(a/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==v||v(e)}}).catch(O),"fulfilled"===U.current.ready.status?U.current.render((0,t.jsx)(B,{children:(0,t.jsx)(r.E,{set:O,children:(0,t.jsx)(a.Suspense,{fallback:(0,t.jsx)(r.B,{set:P}),children:null!=n?n:null})})})):"pending"===U.current.ready.status&&H(U.current.ready))}),a.useEffect(()=>{var e;let t=null==(e=z.current)?void 0:e.get(),r=q();t&&r&&t.events.connected!==r&&(null==t.events.connect||t.events.connect(r))}),a.useEffect(()=>{let e=D.current;return()=>{var t;e.isConnected||null==(t=U.current)||t.unmount()}},[]);let V=h?"none":"auto";return(0,t.jsxs)("div",{ref:w,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:V,...d},...y,children:[(0,t.jsx)("div",{ref:L,style:{width:"100%",height:"100%"},children:(0,t.jsx)("canvas",{ref:D,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),C=e.i(83402),g=e.i(49721),x=e.i(68757),b=e.i(18638);e.i(85269);var S=e.i(22831);let A=({onClick:e,icon:r,isActive:a,activeClass:n,label:o})=>(0,t.jsxs)("button",{onClick:e,className:`p-2 rounded-xl tesla-hover transition-all duration-300 group relative ${a?"bg-hud-elevated shadow-soft":""}`,title:o,children:[(0,t.jsx)(g.FontAwesomeIcon,{icon:r,className:`text-xl transition-all duration-300 ${a?n+" scale-110":"text-hud-muted group-hover:text-hud-main"}`}),a&&(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`})]}),T=()=>{let{t:e}=(0,S.useTranslation)(),{theme:r,themeMode:a,setTheme:n,states:o,toggleState:i,toggleExclusiveMode:l,cycleOceanMode:s}=(0,f.useOcearoContext)(),c={black:{icon:x.faWater,color:"text-hud-muted",label:e("toolbar.oceanBlack")},water:{icon:x.faWater,color:"text-oBlue",label:e("toolbar.oceanWater")},chart:{icon:x.faMap,color:"text-oGreen",label:e("toolbar.oceanChart")},depth:{icon:x.faLayerGroup,color:"text-oBlue",label:e("toolbar.oceanDepth")},meteo:{icon:x.faCloudSunRain,color:"text-oYellow",label:e("toolbar.oceanMeteo")}},u={auto:{icon:x.faCircleHalfStroke,label:e("toolbar.themeAuto",{theme:e(`toolbar.theme_${r}`)})},day:{icon:x.faSun,label:e("toolbar.theme_day")},dark:{icon:x.faMoon,label:e("toolbar.theme_dark")},night:{icon:x.faEye,label:e("toolbar.theme_night")}},d=u[a]||u.dark,m=o.oceanMode||"black",p=c[m];return(0,t.jsxs)("div",{className:"flex items-center space-x-1 p-1.5 rounded-2xl",children:[(0,t.jsx)(A,{onClick:()=>l("autopilot"),icon:x.faShip,isActive:o.autopilot,activeClass:"text-oBlue",label:e("toolbar.autopilot")}),(0,t.jsx)(A,{onClick:()=>l("anchorWatch"),icon:x.faAnchor,isActive:o.anchorWatch,activeClass:"text-oYellow",label:e("toolbar.anchorWatch")}),(0,t.jsx)(A,{onClick:()=>l("parkingMode"),icon:x.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)(A,{onClick:()=>{n(b.THEME_MODES[(b.THEME_MODES.indexOf(a)+1)%b.THEME_MODES.length])},icon:d.icon,isActive:"dark"!==a,activeClass:"text-hud-main",label:d.label}),(0,t.jsx)(A,{onClick:s,icon:p.icon,isActive:"black"!==m,activeClass:p.color,label:p.label}),o.autopilot&&"black"===m&&(0,t.jsx)(A,{onClick:()=>i("showPolar"),icon:x.faCompass,isActive:o.showPolar,activeClass:"text-oBlue",label:e("toolbar.polarView")}),o.autopilot&&(0,t.jsx)(A,{onClick:()=>i("showLaylines3D"),icon:x.faRulerCombined,isActive:o.showLaylines3D,activeClass:"text-oGreen",label:e("toolbar.laylines3D")}),(0,t.jsx)(A,{onClick:()=>i("ais"),icon:x.faSatellite,isActive:o.ais,activeClass:"text-oGreen",label:e("toolbar.aisRadar")})]})};var M=e.i(72466),G=e.i(85709);let _="batteries",R={FRESH_WATER:{id:"freshWater",labelKey:"tanks.freshWater",path:"tanks.freshWater.0.currentLevel",icon:x.faDroplet,color:"bg-oBlue"},FUEL:{id:"fuel",labelKey:"tanks.fuel",path:"tanks.fuel.0.currentLevel",icon:x.faGasPump,color:"bg-oYellow"},BLACK_WATER:{id:"blackWater",labelKey:"tanks.blackWater",path:"tanks.blackWater.0.currentLevel",icon:x.faToilet,color:"bg-hud-muted"}},F=({level:e,type:r})=>{let{t:a}=(0,S.useTranslation)(),n=Math.max(0,Math.min(100,e)),{labelKey:o,icon:i,color:l}=R[r],s=n<=20,c=l.replace("bg-","text-");return(0,t.jsxs)("div",{className:"flex items-center space-x-2",title:a(o),children:[(0,t.jsx)(g.FontAwesomeIcon,{icon:i,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":l} 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,"%"]})]})},v=({batteryLevel:e,batteryNumber:r,voltage:a})=>{let{t:n}=(0,S.useTranslation)(),o=Math.max(0,Math.min(100,e)),i=(0,M.isBatteryCharging)(a),l=o<=M.BATTERY_CONFIG.DANGER_THRESHOLD;return(0,t.jsxs)("div",{className:"flex items-center space-x-2",title:`${o}% — ${a?.toFixed(1)}V${i?" "+n("common.charging"):""}`,children:[(0,t.jsx)(g.FontAwesomeIcon,{icon:x.faBolt,className:`text-xs ${i?"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 ${l?"bg-oRed":i?"bg-oGreen":"bg-oBlue"} transition-all duration-1000 ease-out ${i?"shadow-[0_0_6px_var(--color-oGreen)]":""}`,style:{width:`${o}%`}})})]})},y=()=>{let[e,r]=(0,a.useState)(_),n=(0,a.useMemo)(()=>["electrical.batteries.1.capacity.stateOfCharge","electrical.batteries.1.voltage"],[]),o=(0,a.useMemo)(()=>["tanks.freshWater.0.currentLevel","tanks.fuel.0.currentLevel","tanks.blackWater.0.currentLevel"],[]),i=(0,G.useSignalKPaths)([...n,...o]),l=(0,a.useMemo)(()=>{let e=i["electrical.batteries.1.capacity.stateOfCharge"],t=i["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))},[i]),s=(0,a.useMemo)(()=>{let e=i["tanks.freshWater.0.currentLevel"],t=i["tanks.fuel.0.currentLevel"],r=i["tanks.blackWater.0.currentLevel"];return{FRESH_WATER:null!=e?100*e:0,FUEL:null!=t?100*t:0,BLACK_WATER:null!=r?100*r:0}},[i]),c=()=>{r(e=>e===_?"tanks":_)},u=e===_;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:l.map(e=>(0,t.jsx)(v,{batteryLevel:e.level,batteryNumber:e.number,voltage:e.voltage},e.number))}):(0,t.jsx)(t.Fragment,{children:Object.keys(R).map(e=>(0,t.jsx)(F,{type:e,level:s[e]},e))})})})};var B=e.i(39271);let L=e=>{let[t,r]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let t=window.matchMedia(e),a=()=>r(t.matches);return a(),t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[e]),t},E=(0,h.default)(()=>e.A(36258),{loadableGenerated:{modules:[59465]},ssr:!1}),D=(0,h.default)(()=>e.A(11220),{loadableGenerated:{modules:[27404]},ssr:!1}),w=(0,h.default)(()=>e.A(97820),{loadableGenerated:{modules:[69675]},ssr:!1}),N=(0,h.default)(()=>e.A(29882),{loadableGenerated:{modules:[56665]}}),j=(0,h.default)(()=>e.A(93170),{loadableGenerated:{modules:[50226]}}),I=(0,h.default)(()=>e.A(93889),{loadableGenerated:{modules:[58166]}}),P=(0,h.default)(()=>e.A(64390),{loadableGenerated:{modules:[39554]}}),k=(0,h.default)(()=>e.A(48217),{loadableGenerated:{modules:[14774]}}),O=(0,h.default)(()=>e.A(30150),{loadableGenerated:{modules:[84237]}}),U=(0,h.default)(()=>e.A(34882),{loadableGenerated:{modules:[77021]}}),W=(0,h.default)(()=>e.A(59499),{loadableGenerated:{modules:[85003]}}),H=(0,h.default)(()=>e.A(43322),{loadableGenerated:{modules:[56101]}}),z=(0,h.default)(()=>e.A(32673),{loadableGenerated:{modules:[36540]}}),q=(0,h.default)(()=>e.A(66984),{loadableGenerated:{modules:[79261]}}),V=(0,h.default)(()=>e.A(32598),{loadableGenerated:{modules:[79224]}}),K=(0,h.default)(()=>e.A(73321),{loadableGenerated:{modules:[78938]}}),$=(0,h.default)(()=>e.A(82041),{loadableGenerated:{modules:[41994]}}),X=(0,h.default)(()=>e.A(71762),{loadableGenerated:{modules:[91999]}}),Q=(0,h.default)(()=>e.A(93540),{loadableGenerated:{modules:[84809]}}),Z=(0,h.default)(()=>e.A(11657),{loadableGenerated:{modules:[75058]}}),Y=()=>{let{gl:e,scene:t}=(0,m.useThree)();return(0,a.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},J=({fps:e})=>{let t=(0,m.useThree)(e=>e.invalidate);return(0,a.useEffect)(()=>{let r=setInterval(()=>t(),1e3/e);return()=>clearInterval(r)},[e,t]),null};e.s(["default",0,({active:e=!0,fullscreen:r=!1})=>{let[n]=(0,a.useState)(p.getRenderProfile),i=n.fps<60,{states:l,theme:s}=(0,f.useOcearoContext)(),c=(0,B.useReplay)().active,[u,m]=(0,a.useState)(null),[h,g]=(0,a.useState)(!0),[x]=(0,a.useState)(()=>C.default.get("hudStyle")||"minimal"),b="classic"===x,S=L("(min-width: 1024px) and (min-height: 600px)"),A=r&&!b&&S,M=L("(max-height: 500px)"),G=!A&&!b,_=!l.anchorWatch&&!l.parkingMode&&!c;(0,a.useEffect)(()=>{g(!1!==C.default.getAll().showAttitudeIndicator)},[]);let R="day"===s&&("chart"===l.oceanMode||"depth"===l.oceanMode||"meteo"===l.oceanMode);return(0,t.jsxs)("div",{className:"w-full h-full relative overflow-hidden","data-scene":R?"light":void 0,children:[(0,t.jsxs)("div",{className:"absolute top-2 left-2 right-2 z-20 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)(Q,{compact:!r}),(0,t.jsx)(y,{})]})]}),(0,t.jsxs)("div",{className:"absolute top-14 left-2 z-30","data-hud-solid":!0,children:[!l.anchorWatch&&(0,t.jsx)(N,{}),l.anchorWatch&&(0,t.jsx)(P,{}),!b&&(0,t.jsx)(W,{omitDepth:!0,maxItems:A?4:3}),!l.parkingMode&&(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)(Z,{})})]}),b&&h&&(0,t.jsx)("div",{className:"absolute top-14 right-2 z-20",children:(0,t.jsx)(O,{})}),u&&!G&&(0,t.jsx)("div",{"data-hud-solid":!0,className:`hud-stack absolute z-30 w-96 max-h-[calc(100%-5rem)] flex flex-col ${b?"top-28 left-2":"top-14 right-3"}`,children:(0,t.jsx)(U,{content:u,onClose:()=>m(null)})}),A&&(0,t.jsx)("div",{className:"absolute left-3 bottom-3 z-20","data-hud-solid":!0,children:(0,t.jsx)($,{})}),A&&(0,t.jsx)("div",{className:"absolute right-3 bottom-3 z-20","data-hud-solid":!0,children:(0,t.jsx)(X,{})}),!c&&(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)(K,{})}),"meteo"===l.oceanMode&&(0,t.jsx)("div",{className:"absolute left-1/2 -translate-x-1/2 top-14 z-30 max-w-[calc(100%-12rem)]",children:(0,t.jsx)(V,{})}),G?(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
|
-
${M?"right-2 w-[min(24rem,58%)]":"inset-x-2 sm:left-auto sm:w-[26rem]"}`,children:[u&&(0,t.jsx)("div",{className:"min-h-0 flex flex-col",children:(0,t.jsx)(U,{content:u,onClose:()=>m(null)})}),!(M&&u)&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"empty:hidden shrink-0 flex justify-center",children:(0,t.jsx)(q,{})}),l.parkingMode&&(0,t.jsx)("div",{className:"empty:hidden shrink-0 tesla-card !p-3 !rounded-2xl",children:(0,t.jsx)(z,{})}),_&&(0,t.jsx)("div",{className:"empty:hidden shrink-0 [&>*]:max-w-none",children:(0,t.jsx)(H,{})}),(0,t.jsxs)("div",{className:"shrink-0 flex gap-2",children:[(0,t.jsx)("div",{className:"empty:hidden flex-1 min-w-0",children:(0,t.jsx)($,{compact:!0})}),(0,t.jsx)("div",{className:"empty:hidden flex-1 min-w-0",children:(0,t.jsx)(X,{compact:!0})})]})]})]}):(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)(q,{})}),l.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)(z,{})}),_&&(0,t.jsx)("div",{"data-hud-solid":!0,className:`hud-stack absolute left-1/2 -translate-x-1/2 z-20 max-w-[calc(100%-9rem)] ${b?"bottom-24":"bottom-3"}`,children:(0,t.jsx)(H,{})})]}),b&&(0,t.jsx)("div",{className:"absolute left-2 bottom-2 z-20 flex flex-col items-center",children:(0,t.jsx)(k,{})}),b&&(0,t.jsx)("div",{className:"absolute right-2 bottom-2 z-20 flex flex-col items-center",children:(0,t.jsx)(I,{})}),b&&!l.anchorWatch&&(0,t.jsx)("div",{className:"absolute bottom-2 left-1/2 transform -translate-x-1/2 z-10",children:(0,t.jsx)(j,{})}),(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?i?"demand":"always":"never",dpr:n.dpr,performance:{min:.5},gl:{antialias:n.antialias,powerPreference:"low-power",physicallyCorrectLights:!1,toneMapping:o.NoToneMapping,toneMappingExposure:1,shadowMap:{enabled:!1},precision:"lowp"},children:[(0,t.jsx)(Y,{}),e&&i&&(0,t.jsx)(J,{fps:n.fps}),l.parkingMode?(0,t.jsx)(D,{onUpdateInfoPanel:m}):l.anchorWatch?(0,t.jsx)(w,{onUpdateInfoPanel:m}):(0,t.jsx)(E,{onUpdateInfoPanel:m,selection:u})]})})]})}],47141)},23595,function(e){e.n(e.i(47141))}]);
|