ocearo-ui 0.1.19 → 0.1.22
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 +31 -1
- package/README.md +31 -1
- package/__next.__PAGE__.txt +2 -2
- package/__next._full.txt +3 -3
- package/__next._head.txt +1 -1
- package/__next._index.txt +2 -2
- package/__next._tree.txt +2 -2
- package/_next/static/chunks/0-z15txb4-uhu.js +409 -0
- package/_next/static/chunks/{0s7ev9xt6xz5c.js → 009rlietvsaq2.js} +1 -1
- package/_next/static/chunks/{1g21fvp1vxlol.js → 0jzbiie0nzar2.js} +1 -1
- package/_next/static/chunks/0kinaai2rvd43.js +9 -0
- package/_next/static/chunks/0qj7yy4f6sk8y.js +455 -0
- package/_next/static/chunks/0yf1ifg_o1bq6.js +1 -0
- package/_next/static/chunks/0zbzk2ob0li1n.js +1 -0
- package/_next/static/chunks/17ma1x64d-211.js +1 -0
- package/_next/static/chunks/19xb2y6sgfnza.js +1 -0
- package/_next/static/chunks/1q572rz5m8mb-.js +1 -0
- package/_next/static/chunks/{1v9sx2zvvfu7m.js → 1rkf8qtk5-48h.js} +1 -1
- package/_next/static/chunks/26e1o1as-77nq.js +172 -0
- package/_next/static/chunks/2a0yjir_3mk1m.js +1 -0
- package/_next/static/chunks/2fy4q1c5l3tpj.js +1 -0
- package/_next/static/chunks/2lw7kypuhij1_.css +3 -0
- package/_next/static/chunks/{1i35u7m1a-aq5.js → 2nxsyowmuwpjy.js} +1 -1
- package/_next/static/chunks/2pwmb4pkqygy_.js +1 -0
- package/_next/static/chunks/{1porlo35ga4zu.js → 2q_83f24jeg0e.js} +1 -1
- package/_next/static/chunks/2udirievybq_j.js +1 -0
- package/_next/static/chunks/3myql5zu0rstt.js +425 -0
- package/_next/static/chunks/3rhgquok36e79.js +1 -0
- package/_not-found/__next._full.txt +2 -2
- package/_not-found/__next._head.txt +1 -1
- package/_not-found/__next._index.txt +2 -2
- package/_not-found/__next._not-found.__PAGE__.txt +1 -1
- package/_not-found/__next._not-found.txt +1 -1
- package/_not-found/__next._tree.txt +2 -2
- package/_not-found.html +1 -1
- package/_not-found.txt +2 -2
- package/index.html +1 -1
- package/index.txt +3 -3
- package/package.json +1 -1
- package/settings/__next._full.txt +3 -3
- package/settings/__next._head.txt +1 -1
- package/settings/__next._index.txt +2 -2
- package/settings/__next._tree.txt +2 -2
- package/settings/__next.settings.__PAGE__.txt +2 -2
- package/settings/__next.settings.txt +1 -1
- package/settings.html +1 -1
- package/settings.txt +3 -3
- package/_next/static/chunks/00b24tu3xognr.js +0 -1
- package/_next/static/chunks/04lomm-6r6u_y.js +0 -1
- package/_next/static/chunks/0vwsugj7n9_96.js +0 -135
- package/_next/static/chunks/0wo1zlwo1g8cn.js +0 -1
- package/_next/static/chunks/1g27qus1wjpzi.js +0 -1
- package/_next/static/chunks/1o473gsiw2s6h.js +0 -1
- package/_next/static/chunks/1phpmupk6twat.js +0 -9
- package/_next/static/chunks/1w1ua0-p5lk1e.js +0 -38
- package/_next/static/chunks/20srrp2o3xsog.js +0 -135
- package/_next/static/chunks/29vh6vtwjqpju.js +0 -1
- package/_next/static/chunks/2jrvtsuq91xny.js +0 -1
- package/_next/static/chunks/2uao1hfsz-oy8.js +0 -1
- package/_next/static/chunks/36gcdml-8hccp.js +0 -863
- package/_next/static/chunks/3dt63tw_9r0jt.js +0 -38
- package/_next/static/chunks/3sgrkzk20mxs6.js +0 -54
- package/_next/static/chunks/3v7kbzxs8nq6c.css +0 -3
- /package/_next/static/{lbW36T5aysKW1OT6h1JDF → sct9rcMTcCyBLHTxQQ75-}/_buildManifest.js +0 -0
- /package/_next/static/{lbW36T5aysKW1OT6h1JDF → sct9rcMTcCyBLHTxQQ75-}/_clientMiddlewareManifest.js +0 -0
- /package/_next/static/{lbW36T5aysKW1OT6h1JDF → sct9rcMTcCyBLHTxQQ75-}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,62588,e=>{"use strict";var t=e.i(43476),n=e.i(71645);e.i(49018);var i=e.i(83402),a=e.i(66799),r=e.i(67561),o=e.i(85709);let s=(0,n.createContext)(),l=(e,t,n,i)=>{let a=n.split(".").reduce((e,t)=>e?.[t],i);void 0!==a&&(e[t]=a)};e.s(["AISProvider",0,({children:e})=>{let[u,c]=(0,n.useState)({}),[d,f]=(0,n.useState)([]),p=(0,n.useRef)(null),h=(0,n.useRef)({}),v=(0,n.useRef)(null),{convertLatLonToXY:m}=(0,r.useOcearoContext)(),g=(0,o.useSignalKPath)("navigation.position"),y=(0,n.useRef)(),S=(0,n.useRef)(),b=(0,n.useCallback)(e=>{if(e.latitude&&e.longitude&&g&&g.latitude&&g.longitude&&e.latitude!=g.latitude&&e.longitude!=g.longitude){let t=i.default.get("aisLengthScalingFactor")||.7,{x:n,y:a}=m({lat:e.latitude,lon:e.longitude},{lat:g.latitude,lon:g.longitude});e.sceneX=n*t,e.sceneZ=-a*t,e.rotationAngleY=(e=>{if(!e)return 0;let t=e.heading||e.headingMagnetic;return e.cog||e.cogMagnetic||t||0})(e),e.distanceMeters=Math.sqrt(n**2+a**2);let r=e.visible;return e.visible=e.distanceMeters>10&&e.distanceMeters<=5e3,r!==e.visible}return!1},[g,m]),w=(0,n.useCallback)(()=>{v.current&&(clearTimeout(v.current),v.current=null);let e=Object.values(u).filter(e=>e.visible);((e,t)=>{if(e.length!==t.length)return!0;let n=new Set(e.map(e=>e.mmsi)),i=new Set(t.map(e=>e.mmsi));if(n.size!==i.size)return!0;for(let e of n)if(!i.has(e))return!0;return!1})(d,e)&&(console.log(`Updating visible vessels: ${e.length} vessels`),f(e))},[u,d]),x=(0,n.useCallback)(()=>{v.current&&clearTimeout(v.current),v.current=setTimeout(()=>{w(),v.current=null},100)},[w]);return(0,n.useEffect)(()=>{y.current=b,S.current=x},[b,x]),(0,n.useEffect)(()=>{let e=setInterval(()=>{let e=Date.now();c(t=>{let n=!1,i={...t};return(Object.entries(i).forEach(([t,a])=>{e-a.lastUpdate>6e5&&(delete i[t],n=!0)}),n)?(x(),i):t})},6e4);return()=>clearInterval(e)},[x]),(0,n.useEffect)(()=>{let e=async e=>{console.log("Fetching static vessel info...");try{let t=await e.API().then(e=>e.vessels()),n=Object.entries(t).map(([e,t])=>{let n={mmsi:e};return l(n,"name","name",t),l(n,"latitude","navigation.position.value.latitude",t),l(n,"longitude","navigation.position.value.longitude",t),l(n,"sog","navigation.speedOverGround.value",t),l(n,"cog","navigation.courseOverGroundTrue.value",t),l(n,"cogMagnetic","navigation.courseOverGroundMagnetic.value",t),l(n,"heading","navigation.headingTrue.value",t),l(n,"headingMagnetic","navigation.headingMagnetic.value",t),l(n,"length","design.length.value.overall",t),l(n,"beam","design.beam.value",t),l(n,"callsign","communication.callsignVhf",t),l(n,"shipType","design.aisShipType.value.id",t),n.lastUpdate=Date.now(),n.distanceMeters=null,n.sceneX=null,n.sceneZ=null,n.rotationAngleY=null,n.visible=!1,n}),i={};if(n.forEach(e=>{e.mmsi&&"self"!=e.mmsi&&(null!==e.latitude||null!==e.longitude)&&(y.current(e),i[e.mmsi]=e)}),console.log(`Fetched ${n.length} vessels.`),Object.keys(i).length>0){console.log(`Initializing AIS data with ${Object.keys(i).length} vessels`),c(i);let e=Object.values(i).filter(e=>e.visible);f(e),console.log(`${e.length} vessels initially visible`)}}catch(e){console.error("Error fetching static info:",e)}},t=e=>{if(!e?.updates)return void console.warn("Missing delta or no updates:",e);let t=e.context.replace("vessels.","");t?(h.current[t]=Date.now(),c(n=>{let i=n[t]||{mmsi:t,name:"unknown",latitude:null,longitude:null,sog:null,cog:null,cogMagnetic:null,heading:null,headingMagnetic:null,distanceMeters:null,sceneX:null,sceneZ:null,rotationAngleY:null,visible:!1,length:null,beam:null,shipType:null};i.lastUpdate=h.current[t];let a=!1,r=!1;return e.updates.forEach(e=>{e.values&&e.values.forEach(e=>{switch(e.path){case"name":i.name=e.value;break;case"navigation.position":i.latitude=e.value.latitude,i.longitude=e.value.longitude,a=!0;break;case"navigation.speedOverGround":i.sog=e.value;break;case"navigation.courseOverGroundTrue":i.cog=e.value,r=!0;break;case"navigation.courseOverGroundMagnetic":i.cogMagnetic=e.value,r=!0;break;case"navigation.headingTrue":i.heading=e.value,r=!0;break;case"navigation.headingMagnetic":i.headingMagnetic=e.value,r=!0;break;case"design.aisShipType":i.shipType=e.value?.id??e.value;break;case"design.length":i.length=e.value?.overall??e.value;break;case"design.beam":i.beam=e.value;break;case"communication.callsignVhf":i.callsign=e.value}})}),(y.current(i)||a||r)&&S.current(),{...n,[t]:i}})):console.warn("Update without MMSI context:",e)};return(async()=>{try{let{signalkUrl:n}=i.default.getAll();if(console.log("SignalK URL:",n),!n)throw Error("SignalK URL is undefined or invalid.");console.log(`Connecting to SignalK at: ${n}`);let r=a.default.createClient({subscriptions:[{context:"vessels.*",subscribe:[{path:"navigation.position"},{path:"navigation.speedOverGround"},{path:"navigation.courseOverGroundTrue"},{path:"navigation.courseOverGroundMagnetic"},{path:"navigation.headingTrue"},{path:"navigation.headingMagnetic"},{path:"name"},{path:"design.aisShipType"},{path:"design.length"},{path:"design.beam"},{path:"communication.callsignVhf"}]}]});p.current=r,await r.connect(),console.log("SignalK client connected."),await e(r),r.on("delta",t)}catch(e){console.warn("Error connecting to SignalK:",e)}})(),()=>{console.log("Disconnecting SignalK client..."),v.current&&clearTimeout(v.current),p.current?.disconnect()}},[]),(0,t.jsx)(s.Provider,{value:{aisData:u,vesselIds:d},children:e})},"useAIS",0,()=>(0,n.useContext)(s)])},43216,e=>{"use strict";let t,n;var i=e.i(31067),a=e.i(71645),r=e.i(90072),o=e.i(28600),s=r,l=r;let u=new l.Box3,c=new l.Vector3;class d extends l.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 l.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 l.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,n=this.attributes.instanceEnd;return void 0!==t&&(t.applyMatrix4(e),n.applyMatrix4(e),t.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this}setPositions(e){let t;e instanceof Float32Array?t=e:Array.isArray(e)&&(t=new Float32Array(e));let n=new l.InstancedInterleavedBuffer(t,6,1);return this.setAttribute("instanceStart",new l.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceEnd",new l.InterleavedBufferAttribute(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e,t=3){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));let i=new l.InstancedInterleavedBuffer(n,2*t,1);return this.setAttribute("instanceColorStart",new l.InterleavedBufferAttribute(i,t,0)),this.setAttribute("instanceColorEnd",new l.InterleavedBufferAttribute(i,t,t)),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 l.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 l.Box3);let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;void 0!==e&&void 0!==t&&(this.boundingBox.setFromBufferAttribute(e),u.setFromBufferAttribute(t),this.boundingBox.union(u))}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new l.Sphere),null===this.boundingBox&&this.computeBoundingBox();let e=this.attributes.instanceStart,t=this.attributes.instanceEnd;if(void 0!==e&&void 0!==t){let n=this.boundingSphere.center;this.boundingBox.getCenter(n);let i=0;for(let a=0,r=e.count;a<r;a++)c.fromBufferAttribute(e,a),i=Math.max(i,n.distanceToSquared(c)),c.fromBufferAttribute(t,a),i=Math.max(i,n.distanceToSquared(c));this.boundingSphere.radius=Math.sqrt(i),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)}}var f=r,p=e.i(8560),h=e.i(31497);class v extends f.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:f.UniformsUtils.clone(f.UniformsUtils.merge([p.UniformsLib.common,p.UniformsLib.fog,{worldUnits:{value:1},linewidth:{value:1},resolution:{value:new f.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 <${h.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 m=h.version>=125?"uv1":"uv2",g=new s.Vector4,y=new s.Vector3,S=new s.Vector3,b=new s.Vector4,w=new s.Vector4,x=new s.Vector4,E=new s.Vector3,A=new s.Matrix4,_=new s.Line3,U=new s.Vector3,L=new s.Box3,M=new s.Sphere,O=new s.Vector4;function z(e,t,i){return O.set(0,0,-t,1).applyMatrix4(e.projectionMatrix),O.multiplyScalar(1/O.w),O.x=n/i.width,O.y=n/i.height,O.applyMatrix4(e.projectionMatrixInverse),O.multiplyScalar(1/O.w),Math.abs(Math.max(O.x,O.y))}class B extends s.Mesh{constructor(e=new d,t=new v({color:0xffffff*Math.random()})){super(e,t),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){let e=this.geometry,t=e.attributes.instanceStart,n=e.attributes.instanceEnd,i=new Float32Array(2*t.count);for(let e=0,a=0,r=t.count;e<r;e++,a+=2)y.fromBufferAttribute(t,e),S.fromBufferAttribute(n,e),i[a]=0===a?0:i[a-1],i[a+1]=i[a]+y.distanceTo(S);let a=new s.InstancedInterleavedBuffer(i,2,1);return e.setAttribute("instanceDistanceStart",new s.InterleavedBufferAttribute(a,1,0)),e.setAttribute("instanceDistanceEnd",new s.InterleavedBufferAttribute(a,1,1)),this}raycast(e,i){let a,r,o=this.material.worldUnits,l=e.camera;null!==l||o||console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');let u=void 0!==e.params.Line2&&e.params.Line2.threshold||0;t=e.ray;let c=this.matrixWorld,d=this.geometry,f=this.material;if(n=f.linewidth+u,null===d.boundingSphere&&d.computeBoundingSphere(),M.copy(d.boundingSphere).applyMatrix4(c),o)a=.5*n;else{let e=Math.max(l.near,M.distanceToPoint(t.origin));a=z(l,e,f.resolution)}if(M.radius+=a,!1!==t.intersectsSphere(M)){if(null===d.boundingBox&&d.computeBoundingBox(),L.copy(d.boundingBox).applyMatrix4(c),o)r=.5*n;else{let e=Math.max(l.near,L.distanceToPoint(t.origin));r=z(l,e,f.resolution)}L.expandByScalar(r),!1!==t.intersectsBox(L)&&(o?function(e,i){let a=e.matrixWorld,r=e.geometry,o=r.attributes.instanceStart,l=r.attributes.instanceEnd,u=Math.min(r.instanceCount,o.count);for(let r=0;r<u;r++){_.start.fromBufferAttribute(o,r),_.end.fromBufferAttribute(l,r),_.applyMatrix4(a);let u=new s.Vector3,c=new s.Vector3;t.distanceSqToSegment(_.start,_.end,c,u),c.distanceTo(u)<.5*n&&i.push({point:c,pointOnLine:u,distance:t.origin.distanceTo(c),object:e,face:null,faceIndex:r,uv:null,[m]:null})}}(this,i):function(e,i,a){let r=i.projectionMatrix,o=e.material.resolution,l=e.matrixWorld,u=e.geometry,c=u.attributes.instanceStart,d=u.attributes.instanceEnd,f=Math.min(u.instanceCount,c.count),p=-i.near;t.at(1,x),x.w=1,x.applyMatrix4(i.matrixWorldInverse),x.applyMatrix4(r),x.multiplyScalar(1/x.w),x.x*=o.x/2,x.y*=o.y/2,x.z=0,E.copy(x),A.multiplyMatrices(i.matrixWorldInverse,l);for(let i=0;i<f;i++){if(b.fromBufferAttribute(c,i),w.fromBufferAttribute(d,i),b.w=1,w.w=1,b.applyMatrix4(A),w.applyMatrix4(A),b.z>p&&w.z>p)continue;if(b.z>p){let e=b.z-w.z,t=(b.z-p)/e;b.lerp(w,t)}else if(w.z>p){let e=w.z-b.z,t=(w.z-p)/e;w.lerp(b,t)}b.applyMatrix4(r),w.applyMatrix4(r),b.multiplyScalar(1/b.w),w.multiplyScalar(1/w.w),b.x*=o.x/2,b.y*=o.y/2,w.x*=o.x/2,w.y*=o.y/2,_.start.copy(b),_.start.z=0,_.end.copy(w),_.end.z=0;let u=_.closestPointToPointParameter(E,!0);_.at(u,U);let f=s.MathUtils.lerp(b.z,w.z,u),h=f>=-1&&f<=1,v=E.distanceTo(U)<.5*n;if(h&&v){_.start.fromBufferAttribute(c,i),_.end.fromBufferAttribute(d,i),_.start.applyMatrix4(l),_.end.applyMatrix4(l);let n=new s.Vector3,r=new s.Vector3;t.distanceSqToSegment(_.start,_.end,r,n),a.push({point:r,pointOnLine:n,distance:t.origin.distanceTo(r),object:e,face:null,faceIndex:i,uv:null,[m]:null})}}}(this,l,i))}}onBeforeRender(e){let t=this.material.uniforms;t&&t.resolution&&(e.getViewport(g),this.material.uniforms.resolution.value.set(g.z,g.w))}}class C extends d{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){let t=e.length-3,n=new Float32Array(2*t);for(let i=0;i<t;i+=3)n[2*i]=e[i],n[2*i+1]=e[i+1],n[2*i+2]=e[i+2],n[2*i+3]=e[i+3],n[2*i+4]=e[i+4],n[2*i+5]=e[i+5];return super.setPositions(n),this}setColors(e,t=3){let n=e.length-t,i=new Float32Array(2*n);if(3===t)for(let a=0;a<n;a+=t)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5];else for(let a=0;a<n;a+=t)i[2*a]=e[a],i[2*a+1]=e[a+1],i[2*a+2]=e[a+2],i[2*a+3]=e[a+3],i[2*a+4]=e[a+4],i[2*a+5]=e[a+5],i[2*a+6]=e[a+6],i[2*a+7]=e[a+7];return super.setColors(i,t),this}fromLine(e){let t=e.geometry;return this.setPositions(t.attributes.position.array),this}}class T extends B{constructor(e=new C,t=new v({color:0xffffff*Math.random()})){super(e,t),this.isLine2=!0,this.type="Line2"}}let D=a.forwardRef(function({points:e,color:t=0xffffff,vertexColors:n,linewidth:s,lineWidth:l,segments:u,dashed:c,...f},p){var h,m;let g=(0,o.useThree)(e=>e.size),y=a.useMemo(()=>u?new B:new T,[u]),[S]=a.useState(()=>new v),b=(null==n||null==(h=n[0])?void 0:h.length)===4?4:3,w=a.useMemo(()=>{let i=u?new d:new C,a=e.map(e=>{let t=Array.isArray(e);return e instanceof r.Vector3||e instanceof r.Vector4?[e.x,e.y,e.z]:e instanceof r.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(i.setPositions(a.flat()),n){t=0xffffff;let e=n.map(e=>e instanceof r.Color?e.toArray():e);i.setColors(e.flat(),b)}return i},[e,u,n,b]);return a.useLayoutEffect(()=>{y.computeLineDistances()},[e,y]),a.useLayoutEffect(()=>{c?S.defines.USE_DASH="":delete S.defines.USE_DASH,S.needsUpdate=!0},[c,S]),a.useEffect(()=>()=>{w.dispose(),S.dispose()},[w]),a.createElement("primitive",(0,i.default)({object:y,ref:p},f),a.createElement("primitive",{object:w,attach:"geometry"}),a.createElement("primitive",(0,i.default)({object:S,attach:"material",color:t,vertexColors:!!n,resolution:[g.width,g.height],linewidth:null!=(m=null!=s?s:l)?m:1,dashed:c,transparent:4===b},f)))});e.s(["Line",0,D],43216)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81694,e=>{"use strict";e.i(47167);var t=e.i(43476),i=e.i(71645),r=e.i(70703);let n={toVector:(e,t)=>(void 0===e&&(e=t),Array.isArray(e)?e:[e,e]),add:(e,t)=>[e[0]+t[0],e[1]+t[1]],sub:(e,t)=>[e[0]-t[0],e[1]-t[1]],addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function s(e,t,i){return 0===t||Math.abs(t)===1/0?Math.pow(e,5*i):e*t*i/(t+i*e)}function o(e,t,i,r=.15){return 0===r?Math.max(t,Math.min(e,i)):e<t?-s(t-e,i-t,r)+t:e>i?+s(e-i,i-t,r)+i:e}function a(e,t,i){var r;return(t="symbol"==typeof(r=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?r:String(r))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function l(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,r)}return i}function c(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?l(Object(i),!0).forEach(function(t){a(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):l(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}let u={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function d(e){return e?e[0].toUpperCase()+e.slice(1):""}let h=["enter","leave"],f=["gotpointercapture","lostpointercapture"];function p(e){return"touches"in e}function m(e){return p(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function g(e){return p(e)?("touchend"===e.type||"touchcancel"===e.type?e.changedTouches:e.targetTouches)[0]:e}function v(e){let t=g(e);return p(e)?t.identifier:t.pointerId}function b(e){let t=g(e);return[t.clientX,t.clientY]}function x(e,...t){return"function"==typeof e?e(...t):e}function w(){}function y(e,t){return Object.assign({},t,e||{})}class _{constructor(e,t,i){this.ctrl=e,this.args=t,this.key=i,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){let{state:e,shared:t,ingKey:i,args:r}=this;t[i]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=r,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){let t=this.state,i=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=i.from?x(i.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){let t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){let e=this.state;e._initial=e._values,e.initial=e.values}compute(e){let{state:t,config:i,shared:r}=this;t.args=this.args;let s=0;if(e&&(t.event=e,i.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,r.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,r.locked=!!document.pointerLockElement,Object.assign(r,function(e){let t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){let{shiftKey:i,altKey:r,metaKey:n,ctrlKey:s}=e;Object.assign(t,{shiftKey:i,altKey:r,metaKey:n,ctrlKey:s})}return t}(e)),r.down=r.pressed=r.buttons%2==1||r.touches>0,s=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){let e=t._delta.map(Math.abs);n.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);let[a,l]=t._movement,[c,u]=i.threshold,{_step:d,values:h}=t;if(i.hasCustomTransform?(!1===d[0]&&(d[0]=Math.abs(a)>=c&&h[0]),!1===d[1]&&(d[1]=Math.abs(l)>=u&&h[1])):(!1===d[0]&&(d[0]=Math.abs(a)>=c&&Math.sign(a)*c),!1===d[1]&&(d[1]=Math.abs(l)>=u&&Math.sign(l)*u)),t.intentional=!1!==d[0]||!1!==d[1],!t.intentional)return;let f=[0,0];if(i.hasCustomTransform){let[e,t]=h;f[0]=!1!==d[0]?e-d[0]:0,f[1]=!1!==d[1]?t-d[1]:0}else f[0]=!1!==d[0]?a-d[0]:0,f[1]=!1!==d[1]?l-d[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(f);let p=t.offset,m=t._active&&!t._blocked||t.active;m&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=r[this.ingKey]=t._active,e&&(t.first&&("bounds"in i&&(t._bounds=x(i.bounds,t)),this.setup&&this.setup()),t.movement=f,this.computeOffset()));let[g,v]=t.offset,[[b,w],[y,_]]=t._bounds;t.overflow=[g<b?-1:+(g>w),v<y?-1:+(v>_)],t._movementBound[0]=!!t.overflow[0]&&(!1===t._movementBound[0]?t._movement[0]:t._movementBound[0]),t._movementBound[1]=!!t.overflow[1]&&(!1===t._movementBound[1]?t._movement[1]:t._movementBound[1]);let k=t._active&&i.rubberband||[0,0];if(t.offset=function(e,[t,i],[r,n]){let[[s,a],[l,c]]=e;return[o(t,s,a,r),o(i,l,c,n)]}(t._bounds,t.offset,k),t.delta=n.sub(t.offset,p),this.computeMovement(),m&&(!t.last||s>32)){t.delta=n.sub(t.offset,p);let e=t.delta.map(Math.abs);n.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&s>0&&(t.velocity=[e[0]/s,e[1]/s],t.timeDelta=s)}}emit(){let e=this.state,t=this.shared,i=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!i.triggerAllEvents)return;let r=this.handler(c(c(c({},t),e),{},{[this.aliasKey]:e.values}));void 0!==r&&(e.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class k extends _{constructor(...e){super(...e),a(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=n.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=n.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){let t=this.state,i=this.config;if(!t.axis&&e){let r="object"==typeof i.axisThreshold?i.axisThreshold[m(e)]:i.axisThreshold;t.axis=function([e,t],i){let r=Math.abs(e),n=Math.abs(t);return r>n&&r>i?"x":n>r&&n>i?"y":void 0}(t._movement,r)}t._blocked=(i.lockDirection||!!i.axis)&&!t.axis||!!i.axis&&i.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0}}}let S=e=>e,T={enabled:(e=!0)=>e,eventOptions:(e,t,i)=>c(c({},i.shared.eventOptions),e),preventDefault:(e=!1)=>e,triggerAllEvents:(e=!1)=>e,rubberband(e=0){switch(e){case!0:return[.15,.15];case!1:return[0,0];default:return n.toVector(e)}},from:e=>"function"==typeof e?e:null!=e?n.toVector(e):void 0,transform(e,t,i){let r=e||i.shared.transform;return this.hasCustomTransform=!!r,r||S},threshold:e=>n.toVector(e,0)},j=0,P=c(c({},T),{},{axis(e,t,{axis:i}){if(this.lockDirection="lock"===i,!this.lockDirection)return i},axisThreshold:(e=j)=>e,bounds(e={}){if("function"==typeof e)return t=>P.bounds(e(t));if("current"in e)return()=>e.current;if("function"==typeof HTMLElement&&e instanceof HTMLElement)return e;let{left:t=-1/0,right:i=1/0,top:r=-1/0,bottom:n=1/0}=e;return[[t,i],[r,n]]}}),O={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]},A="u">typeof window&&window.document&&window.document.createElement;function E(){return A&&"ontouchstart"in window}let C={isBrowser:A,gesture:function(){try{return"constructor"in GestureEvent}catch(e){return!1}}(),touch:E(),touchscreen:E()||A&&window.navigator.maxTouchPoints>1,pointer:A&&"onpointerdown"in window,pointerLock:A&&"exitPointerLock"in window.document},D=10,I={mouse:0,touch:0,pen:8},M=c(c({},P),{},{device(e,t,{pointer:{touch:i=!1,lock:r=!1,mouse:n=!1}={}}){return(this.pointerLock=r&&C.pointerLock,C.touch&&i)?"touch":this.pointerLock?"mouse":C.pointer&&!n?"pointer":C.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:i}){if(this.preventScrollDelay="number"==typeof i?i:i||void 0===i&&e?250:void 0,C.touchscreen&&!1!==i)return e||(void 0!==i?"y":void 0)},pointerCapture(e,t,{pointer:{capture:i=!0,buttons:r=1,keys:n=!0}={}}){return this.pointerButtons=r,this.keys=n,!this.pointerLock&&"pointer"===this.device&&i},threshold(e,t,{filterTaps:i=!1,tapsThreshold:r=3,axis:s}){let o=n.toVector(e,i?r:+!!s);return this.filterTaps=i,this.tapsThreshold=r,o},swipe({velocity:e=.5,distance:t=50,duration:i=250}={}){return{velocity:this.transform(n.toVector(e)),distance:this.transform(n.toVector(t)),duration:i}},delay(e=0){switch(e){case!0:return 180;case!1:return 0;default:return e}},axisThreshold:e=>e?c(c({},I),e):I,keyboardDisplacement:(e=D)=>e});c(c({},T),{},{device(e,t,{shared:i,pointer:{touch:r=!1}={}}){if(i.target&&!C.touch&&C.gesture)return"gesture";if(C.touch&&r)return"touch";if(C.touchscreen){if(C.pointer)return"pointer";if(C.touch)return"touch"}},bounds(e,t,{scaleBounds:i={},angleBounds:r={}}){let n=e=>{let t=y(x(i,e),{min:-1/0,max:1/0});return[t.min,t.max]},s=e=>{let t=y(x(r,e),{min:-1/0,max:1/0});return[t.min,t.max]};return"function"!=typeof i&&"function"!=typeof r?[n(),s()]:e=>[n(e),s(e)]},threshold(e,t,i){return this.lockDirection="lock"===i.axis,n.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey:e=>void 0===e?"ctrlKey":e,pinchOnWheel:(e=!0)=>e}),c(c({},P),{},{mouseOnly:(e=!0)=>e}),c(c({},P),{},{mouseOnly:(e=!0)=>e});let B=new Map,L=new Map,N={key:"drag",engine:class extends k{constructor(...e){super(...e),a(this,"ingKey","dragging")}reset(){super.reset();let e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){let e=this.state;if(e._bounds instanceof HTMLElement){let t=e._bounds.getBoundingClientRect(),i=e.currentTarget.getBoundingClientRect(),r={left:t.left-i.left+e.offset[0],right:t.right-i.right+e.offset[0],top:t.top-i.top+e.offset[1],bottom:t.bottom-i.bottom+e.offset[1]};e._bounds=P.bounds(r)}}cancel(){let e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){let t=this.config,i=this.state;if(null!=e.buttons&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):-1!==t.pointerButtons&&t.pointerButtons!==e.buttons))return;let r=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),r&&r.size>1&&i._pointerActive||(this.start(e),this.setupPointer(e),i._pointerId=v(e),i._pointerActive=!0,this.computeValues(b(e)),this.computeInitial(),t.preventScrollAxis&&"mouse"!==m(e)?(i._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){let t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){let t=this.state,i=this.config;if(!t._pointerActive)return;let r=v(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;let s=b(e);if(document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=n.sub(s,t._values),this.computeValues(s)),n.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional){this.timeoutStore.remove("dragDelay"),t.active=!1,this.startPointerDrag(e);return}if(i.preventScrollAxis&&!t._preventScroll)if(!t.axis)return;else if(t.axis===i.preventScrollAxis||"xy"===i.preventScrollAxis){t._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch(e){}let t=this.state,i=this.config;if(!t._active||!t._pointerActive)return;let r=v(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);let[n,s]=t._distance;if(t.tap=n<=i.tapsThreshold&&s<=i.tapsThreshold,t.tap&&i.filterTaps)t._force=!0;else{let[e,r]=t._delta,[n,s]=t._movement,[o,a]=i.swipe.velocity,[l,c]=i.swipe.distance,u=i.swipe.duration;if(t.elapsedTime<u){let i=Math.abs(e/t.timeDelta),u=Math.abs(r/t.timeDelta);i>o&&Math.abs(n)>l&&(t.swipe[0]=Math.sign(e)),u>a&&Math.abs(s)>c&&(t.swipe[1]=Math.sign(r))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){let t=this.config,i=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,i,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){var t;this.state._preventScroll=!1,"persist"in(t=e)&&"function"==typeof t.persist&&t.persist();let i=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",i),this.eventStore.add(this.sharedConfig.window,"touch","cancel",i),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){let t=O[e.key];if(t){let i=this.state,r=e.shiftKey?10:e.altKey?.1:1;this.start(e),i._delta=t(this.config.keyboardDisplacement,r),i._keyboardActive=!0,n.addTo(i._movement,i._delta),this.compute(e),this.emit()}}keyUp(e){e.key in O&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){let t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:M},V={target(e){if(e)return()=>"current"in e?e.current:e},enabled:(e=!0)=>e,window:(e=C.isBrowser?window:void 0)=>e,eventOptions:({passive:e=!0,capture:t=!1}={})=>({passive:e,capture:t}),transform:e=>e},K=["target","eventOptions","window","enabled","transform"];function R(e={},t){let i={};for(let[r,n]of Object.entries(t))switch(typeof n){case"function":i[r]=n.call(i,e[r],r,e);break;case"object":i[r]=R(e[r],n);break;case"boolean":n&&(i[r]=e[r])}return i}class U{constructor(e,t){a(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,i,r,n){let s=this._listeners,o=function(e,t=""){let i=u[e];return e+(i&&i[t]||t)}(t,i),a=c(c({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),n);e.addEventListener(o,r,a);let l=()=>{e.removeEventListener(o,r,a),s.delete(l)};return s.add(l),l}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class F{constructor(){a(this,"_timeouts",new Map)}add(e,t,i=140,...r){this.remove(e),this._timeouts.set(e,window.setTimeout(t,i,...r))}remove(e){let t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class H{constructor(e){a(this,"gestures",new Set),a(this,"_targetEventStore",new U(this)),a(this,"gestureEventStores",{}),a(this,"gestureTimeoutStores",{}),a(this,"handlers",{}),a(this,"config",{}),a(this,"pointerIds",new Set),a(this,"touchIds",new Set),a(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function(e,t){t.drag&&z(e,"drag"),t.wheel&&z(e,"wheel"),t.scroll&&z(e,"scroll"),t.move&&z(e,"move"),t.pinch&&z(e,"pinch"),t.hover&&z(e,"hover")}(this,e)}setEventIds(e){if(p(e))return this.touchIds=new Set(Array.from(e.touches).filter(t=>{var i,r;return t.target===e.currentTarget||(null==(i=e.currentTarget)||null==(r=i.contains)?void 0:r.call(i,t.target))}).map(e=>e.identifier)),this.touchIds;if("pointerId"in e)return"pointerup"===e.type||"pointercancel"===e.type?this.pointerIds.delete(e.pointerId):"pointerdown"===e.type&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=function(e,t,i={}){let{target:r,eventOptions:n,window:s,enabled:o,transform:a}=e,l=function(e,t){if(null==e)return{};var i,r,n=function(e,t){if(null==e)return{};var i,r,n={},s=Object.keys(e);for(r=0;r<s.length;r++)i=s[r],t.indexOf(i)>=0||(n[i]=e[i]);return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)i=s[r],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}(e,K);if(i.shared=R({target:r,eventOptions:n,window:s,enabled:o,transform:a},V),t){let e=L.get(t);i[t]=R(c({shared:i.shared},l),e)}else for(let e in l){let t=L.get(e);t&&(i[e]=R(c({shared:i.shared},l[e]),t))}return i}(e,t,this.config)}clean(){for(let e of(this._targetEventStore.clean(),this.gestures))this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){let t,i=this.config.shared,r={};if(!i.target||(t=i.target())){if(i.enabled){for(let i of this.gestures){let n=this.config[i],s=W(r,n.eventOptions,!!t);n.enabled&&new(B.get(i))(this,e,i).bind(s)}let n=W(r,i.eventOptions,!!t);for(let t in this.nativeHandlers)n(t,"",i=>this.nativeHandlers[t](c(c({},this.state.shared),{},{event:i,args:e})),void 0,!0)}for(let e in r)r[e]=function(...e){return 0===e.length?w:1===e.length?e[0]:function(){let t;for(let i of e)t=i.apply(this,arguments)||t;return t}}(...r[e]);if(!t)return r;for(let e in r){let{device:i,capture:n,passive:s}=function(e){let t=e.substring(2).toLowerCase(),i=!!~t.indexOf("passive");i&&(t=t.replace("passive",""));let r=f.includes(t)?"capturecapture":"capture",n=!!~t.indexOf(r);return n&&(t=t.replace("capture","")),{device:t,capture:n,passive:i}}(e);this._targetEventStore.add(t,i,"",r[e],{capture:n,passive:s})}}}}function z(e,t){e.gestures.add(t),e.gestureEventStores[t]=new U(e,t),e.gestureTimeoutStores[t]=new F}let W=(e,t,i)=>(r,n,s,o={},a=!1)=>{var l,c;let f=null!=(l=o.capture)?l:t.capture,p=null!=(c=o.passive)?c:t.passive,m=a?r:function(e,t="",i=!1){let r=u[e],n=r&&r[t]||t;return"on"+d(e)+d(n)+(!function(e=!1,t){return e&&!h.includes(t)}(i,n)?"":"Capture")}(r,n,f);i&&p&&(m+="Passive"),e[m]=e[m]||[],e[m].push(s)};var G=e.i(67561),q=e.i(83934),X=e.i(11426),Y=i;class $ extends Y.default.Component{constructor(e){super(e),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){this.setState({error:e,errorInfo:t}),console.error("Error caught in Error Boundary:",e,t)}handleRefresh=()=>{window.location.reload()};handleExitFullscreen=()=>{document.fullscreenElement&&(window.close(),document.exitFullscreen().catch(e=>{console.error("Failed to exit fullscreen:",e)}))};render(){if(this.state.hasError){let{error:e,errorInfo:i}=this.state;return(0,t.jsx)("div",{className:"flex flex-col items-center justify-center min-h-screen bg-hud-bg text-hud-main p-6",children:(0,t.jsxs)("div",{className:"tesla-card p-10 max-w-2xl w-full bg-hud-elevated backdrop-blur-xl border border-hud rounded-3xl shadow-2xl flex flex-col items-center text-center",children:[(0,t.jsx)("div",{className:"w-20 h-20 rounded-full bg-oRed/20 flex items-center justify-center mb-8",children:(0,t.jsx)("div",{className:"w-4 h-4 rounded-full bg-oRed animate-soft-pulse"})}),(0,t.jsx)("h1",{className:"text-3xl font-black uppercase tracking-tighter text-oRed mb-6",children:"System Critical Error"}),(0,t.jsxs)("p",{className:"text-lg font-medium text-hud-main/80 mb-8 max-w-md",children:[(0,t.jsx)("span",{className:"text-hud-muted uppercase text-xs font-black tracking-widest block mb-2",children:"Technical Status"}),e?e.toString():"Unknown exception detected in UI thread"]}),i&&(0,t.jsxs)("details",{className:"w-full whitespace-pre-wrap bg-hud-bg/5 p-6 rounded-2xl mb-10 text-left border border-hud group",children:[(0,t.jsxs)("summary",{className:"cursor-pointer text-oBlue text-xs font-black uppercase tracking-widest hover:text-hud-main transition-colors flex items-center justify-between",children:[(0,t.jsx)("span",{children:"Diagnostic Stack Trace"}),(0,t.jsx)("span",{className:"opacity-40 group-open:rotate-180 transition-transform",children:"▼"})]}),(0,t.jsx)("pre",{className:"mt-6 text-xs font-mono text-hud-muted overflow-auto max-h-60 custom-scrollbar leading-relaxed",children:i.componentStack})]}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 w-full justify-center",children:[(0,t.jsx)("button",{onClick:this.handleRefresh,className:"px-8 py-4 bg-oBlue hover:bg-blue-600 text-hud-main rounded-xl text-xs font-black uppercase tracking-[0.2em] transition-all duration-500 shadow-lg shadow-oBlue/20 active:scale-95",children:"Reboot Session"}),(0,t.jsx)("button",{onClick:this.handleExitFullscreen,className:"px-8 py-4 bg-hud-elevated hover:bg-hud-bg text-hud-main border border-hud rounded-xl text-xs font-black uppercase tracking-[0.2em] transition-all duration-500 active:scale-95",children:"Exit Console"})]})]})})}return this.props.children}}e.i(85269);var J=e.i(71),Q=e.i(18850),Z=e.i(83402);function ee({children:e}){return(0,i.useEffect)(()=>{let e=Z.default.get("language");e&&e!==Q.default.language&&Q.default.changeLanguage(e)},[]),(0,t.jsx)(J.I18nextProvider,{i18n:Q.default,children:e})}let et=(0,r.default)(()=>e.A(45344),{loadableGenerated:{modules:[42602]},loading:()=>(0,t.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:"Loading..."})}),ei=(0,r.default)(()=>e.A(10520),{loadableGenerated:{modules:[61891]}}),er=(0,r.default)(()=>e.A(49063),{loadableGenerated:{modules:[85626]}}),en=(0,r.default)(()=>e.A(13181),{loadableGenerated:{modules:[23595]},loading:()=>(0,t.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,t.jsx)("div",{className:"text-hud-main text-2xl",children:"Loading 3D View..."})}),ssr:!1}),es={BOAT:"boat",APP:"app",SPLIT:"split"};e.s(["VIEW_MODES",0,es,"default",0,function(){var e,r;let n=(0,i.useRef)(!1),s=(0,i.useRef)(null),[o,a]=(0,i.useState)(null),[l,c]=(0,i.useState)(()=>Z.default.getCurrentView()||"navigation"),[u,d]=(0,i.useState)(!1),[h,f]=(0,i.useState)(!1),p=(0,i.useRef)(!1);(0,i.useEffect)(()=>{},[]),(0,i.useEffect)(()=>{let e;a(window.innerWidth>=1366?es.SPLIT:es.BOAT),n.current=!0;let t=()=>{clearTimeout(e),e=setTimeout(()=>{p.current||a(window.innerWidth>=1366?es.SPLIT:es.BOAT)},250)};return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t),clearTimeout(e)}},[]);let m=(0,i.useCallback)(()=>{d(e=>!e)},[]),g=(0,i.useCallback)(e=>{a(e)},[]),v=(e=({movement:[e]})=>{let t=window.innerWidth/5;e>t?g(es.BOAT):e<-t?g(es.APP):g(es.SPLIT)},r={axis:"x"},B.set(N.key,N.engine),L.set(N.key,N.resolver),function(e,t={},r){let n=i.default.useMemo(()=>new H(e),[]);if(n.applyHandlers(e,void 0),n.applyConfig(t,r),i.default.useEffect(n.effect.bind(n)),i.default.useEffect(()=>n.clean.bind(n),[]),void 0===t.target)return n.bind.bind(n)}({drag:e},r||{},"drag")),b=(0,i.useCallback)(()=>{document.fullscreenElement?document.exitFullscreen():document.documentElement.requestFullscreen().catch(e=>{console.error("Fullscreen error:",e.message)})},[]),x=(0,i.useCallback)(e=>{o===es.BOAT&&g(es.APP),c(e),Z.default.setCurrentView(e)},[o,g]),w=(0,i.useRef)(null),y=(0,i.useRef)(null),_=(0,i.useCallback)(()=>{if("settings"===l){p.current=!1,f(!1);let e=y.current||"navigation";c(e),Z.default.setCurrentView(e),g(w.current||es.BOAT)}else w.current=o,y.current=l,p.current=!0,f(!0),x("settings"),g(es.APP)},[l,o,g,x]);(0,i.useEffect)(()=>{if("settings"===l){p.current||(p.current=!0,f(!0));return}p.current&&(p.current=!1,f(!1))},[l]);let k=(0,i.useMemo)(()=>null===o?{}:{leftPane:`transition-all duration-300 ${o===es.BOAT?"w-full":o===es.APP?"hidden":"w-2/5"} bg-leftPaneBg h-full relative`,rightPane:`transition-all duration-300 ${o===es.APP?"w-full":o===es.BOAT?"hidden":"w-3/5"} h-full bg-rightPaneBg`},[o]);return n.current?(0,t.jsx)($,{children:(0,t.jsx)(ee,{children:(0,t.jsx)(G.OcearoContextProvider,{children:(0,t.jsx)(q.WeatherContextProvider,{children:(0,t.jsx)(X.TideContextProvider,{children:(0,t.jsxs)("div",{className:"h-[100dvh] flex flex-col bg-hud-bg relative overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex flex-1 min-h-0",children:[(0,t.jsx)("div",{className:k.leftPane,children:(0,t.jsx)(en,{active:o!==es.APP})}),(0,t.jsx)("div",{ref:s,...v(),className:"handle w-1 bg-leftPaneBg h-full cursor-col-resize transition-all duration-200 flex items-center justify-center touch-none",children:(0,t.jsx)("div",{className:"rounded-full w-3 bg-hud-dim h-40 transition-all duration-200 hover:bg-hud-muted border border-hud"})}),(0,t.jsx)("div",{className:k.rightPane,children:(0,t.jsx)(et,{view:l})})]}),(0,t.jsx)("div",{className:"w-full h-16 min-h-16 bg-leftPaneBg border-t border-hud flex items-center justify-center shrink-0",children:(0,t.jsx)(ei,{setRightView:x,toggleAppMenu:m,toggleSettings:_})}),u&&(0,t.jsx)(er,{currentViewMode:o,toggleViewMode:g,handleSetRightView:x,toggleSettings:_,toggleFullscreen:b,setShowAppMenu:d})]})})})})})}):(0,t.jsx)("div",{className:"h-[100dvh] bg-hud-bg flex items-center justify-center",children:(0,t.jsx)("div",{className:"animate-pulse text-hud-main",children:"Loading..."})})}],81694)}]);
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81694,e=>{"use strict";e.i(47167);var t=e.i(43476),i=e.i(71645),r=e.i(70703);let n={toVector:(e,t)=>(void 0===e&&(e=t),Array.isArray(e)?e:[e,e]),add:(e,t)=>[e[0]+t[0],e[1]+t[1]],sub:(e,t)=>[e[0]-t[0],e[1]-t[1]],addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function s(e,t,i){return 0===t||Math.abs(t)===1/0?Math.pow(e,5*i):e*t*i/(t+i*e)}function o(e,t,i,r=.15){return 0===r?Math.max(t,Math.min(e,i)):e<t?-s(t-e,i-t,r)+t:e>i?+s(e-i,i-t,r)+i:e}function a(e,t,i){var r;return(t="symbol"==typeof(r=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?r:String(r))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function l(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,r)}return i}function c(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?l(Object(i),!0).forEach(function(t){a(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):l(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}let u={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function d(e){return e?e[0].toUpperCase()+e.slice(1):""}let h=["enter","leave"],f=["gotpointercapture","lostpointercapture"];function p(e){return"touches"in e}function m(e){return p(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function g(e){return p(e)?("touchend"===e.type||"touchcancel"===e.type?e.changedTouches:e.targetTouches)[0]:e}function v(e){let t=g(e);return p(e)?t.identifier:t.pointerId}function b(e){let t=g(e);return[t.clientX,t.clientY]}function x(e,...t){return"function"==typeof e?e(...t):e}function w(){}function y(e,t){return Object.assign({},t,e||{})}class _{constructor(e,t,i){this.ctrl=e,this.args=t,this.key=i,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){let{state:e,shared:t,ingKey:i,args:r}=this;t[i]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=r,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){let t=this.state,i=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=i.from?x(i.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){let t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){let e=this.state;e._initial=e._values,e.initial=e.values}compute(e){let{state:t,config:i,shared:r}=this;t.args=this.args;let s=0;if(e&&(t.event=e,i.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,r.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,r.locked=!!document.pointerLockElement,Object.assign(r,function(e){let t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){let{shiftKey:i,altKey:r,metaKey:n,ctrlKey:s}=e;Object.assign(t,{shiftKey:i,altKey:r,metaKey:n,ctrlKey:s})}return t}(e)),r.down=r.pressed=r.buttons%2==1||r.touches>0,s=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){let e=t._delta.map(Math.abs);n.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);let[a,l]=t._movement,[c,u]=i.threshold,{_step:d,values:h}=t;if(i.hasCustomTransform?(!1===d[0]&&(d[0]=Math.abs(a)>=c&&h[0]),!1===d[1]&&(d[1]=Math.abs(l)>=u&&h[1])):(!1===d[0]&&(d[0]=Math.abs(a)>=c&&Math.sign(a)*c),!1===d[1]&&(d[1]=Math.abs(l)>=u&&Math.sign(l)*u)),t.intentional=!1!==d[0]||!1!==d[1],!t.intentional)return;let f=[0,0];if(i.hasCustomTransform){let[e,t]=h;f[0]=!1!==d[0]?e-d[0]:0,f[1]=!1!==d[1]?t-d[1]:0}else f[0]=!1!==d[0]?a-d[0]:0,f[1]=!1!==d[1]?l-d[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(f);let p=t.offset,m=t._active&&!t._blocked||t.active;m&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=r[this.ingKey]=t._active,e&&(t.first&&("bounds"in i&&(t._bounds=x(i.bounds,t)),this.setup&&this.setup()),t.movement=f,this.computeOffset()));let[g,v]=t.offset,[[b,w],[y,_]]=t._bounds;t.overflow=[g<b?-1:+(g>w),v<y?-1:+(v>_)],t._movementBound[0]=!!t.overflow[0]&&(!1===t._movementBound[0]?t._movement[0]:t._movementBound[0]),t._movementBound[1]=!!t.overflow[1]&&(!1===t._movementBound[1]?t._movement[1]:t._movementBound[1]);let k=t._active&&i.rubberband||[0,0];if(t.offset=function(e,[t,i],[r,n]){let[[s,a],[l,c]]=e;return[o(t,s,a,r),o(i,l,c,n)]}(t._bounds,t.offset,k),t.delta=n.sub(t.offset,p),this.computeMovement(),m&&(!t.last||s>32)){t.delta=n.sub(t.offset,p);let e=t.delta.map(Math.abs);n.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&s>0&&(t.velocity=[e[0]/s,e[1]/s],t.timeDelta=s)}}emit(){let e=this.state,t=this.shared,i=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!i.triggerAllEvents)return;let r=this.handler(c(c(c({},t),e),{},{[this.aliasKey]:e.values}));void 0!==r&&(e.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class k extends _{constructor(...e){super(...e),a(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=n.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=n.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){let t=this.state,i=this.config;if(!t.axis&&e){let r="object"==typeof i.axisThreshold?i.axisThreshold[m(e)]:i.axisThreshold;t.axis=function([e,t],i){let r=Math.abs(e),n=Math.abs(t);return r>n&&r>i?"x":n>r&&n>i?"y":void 0}(t._movement,r)}t._blocked=(i.lockDirection||!!i.axis)&&!t.axis||!!i.axis&&i.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0}}}let S=e=>e,T={enabled:(e=!0)=>e,eventOptions:(e,t,i)=>c(c({},i.shared.eventOptions),e),preventDefault:(e=!1)=>e,triggerAllEvents:(e=!1)=>e,rubberband(e=0){switch(e){case!0:return[.15,.15];case!1:return[0,0];default:return n.toVector(e)}},from:e=>"function"==typeof e?e:null!=e?n.toVector(e):void 0,transform(e,t,i){let r=e||i.shared.transform;return this.hasCustomTransform=!!r,r||S},threshold:e=>n.toVector(e,0)},j=0,P=c(c({},T),{},{axis(e,t,{axis:i}){if(this.lockDirection="lock"===i,!this.lockDirection)return i},axisThreshold:(e=j)=>e,bounds(e={}){if("function"==typeof e)return t=>P.bounds(e(t));if("current"in e)return()=>e.current;if("function"==typeof HTMLElement&&e instanceof HTMLElement)return e;let{left:t=-1/0,right:i=1/0,top:r=-1/0,bottom:n=1/0}=e;return[[t,i],[r,n]]}}),O={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]},A="u">typeof window&&window.document&&window.document.createElement;function E(){return A&&"ontouchstart"in window}let C={isBrowser:A,gesture:function(){try{return"constructor"in GestureEvent}catch(e){return!1}}(),touch:E(),touchscreen:E()||A&&window.navigator.maxTouchPoints>1,pointer:A&&"onpointerdown"in window,pointerLock:A&&"exitPointerLock"in window.document},D=10,M={mouse:0,touch:0,pen:8},I=c(c({},P),{},{device(e,t,{pointer:{touch:i=!1,lock:r=!1,mouse:n=!1}={}}){return(this.pointerLock=r&&C.pointerLock,C.touch&&i)?"touch":this.pointerLock?"mouse":C.pointer&&!n?"pointer":C.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:i}){if(this.preventScrollDelay="number"==typeof i?i:i||void 0===i&&e?250:void 0,C.touchscreen&&!1!==i)return e||(void 0!==i?"y":void 0)},pointerCapture(e,t,{pointer:{capture:i=!0,buttons:r=1,keys:n=!0}={}}){return this.pointerButtons=r,this.keys=n,!this.pointerLock&&"pointer"===this.device&&i},threshold(e,t,{filterTaps:i=!1,tapsThreshold:r=3,axis:s}){let o=n.toVector(e,i?r:+!!s);return this.filterTaps=i,this.tapsThreshold=r,o},swipe({velocity:e=.5,distance:t=50,duration:i=250}={}){return{velocity:this.transform(n.toVector(e)),distance:this.transform(n.toVector(t)),duration:i}},delay(e=0){switch(e){case!0:return 180;case!1:return 0;default:return e}},axisThreshold:e=>e?c(c({},M),e):M,keyboardDisplacement:(e=D)=>e});c(c({},T),{},{device(e,t,{shared:i,pointer:{touch:r=!1}={}}){if(i.target&&!C.touch&&C.gesture)return"gesture";if(C.touch&&r)return"touch";if(C.touchscreen){if(C.pointer)return"pointer";if(C.touch)return"touch"}},bounds(e,t,{scaleBounds:i={},angleBounds:r={}}){let n=e=>{let t=y(x(i,e),{min:-1/0,max:1/0});return[t.min,t.max]},s=e=>{let t=y(x(r,e),{min:-1/0,max:1/0});return[t.min,t.max]};return"function"!=typeof i&&"function"!=typeof r?[n(),s()]:e=>[n(e),s(e)]},threshold(e,t,i){return this.lockDirection="lock"===i.axis,n.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey:e=>void 0===e?"ctrlKey":e,pinchOnWheel:(e=!0)=>e}),c(c({},P),{},{mouseOnly:(e=!0)=>e}),c(c({},P),{},{mouseOnly:(e=!0)=>e});let B=new Map,L=new Map,N={key:"drag",engine:class extends k{constructor(...e){super(...e),a(this,"ingKey","dragging")}reset(){super.reset();let e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){let e=this.state;if(e._bounds instanceof HTMLElement){let t=e._bounds.getBoundingClientRect(),i=e.currentTarget.getBoundingClientRect(),r={left:t.left-i.left+e.offset[0],right:t.right-i.right+e.offset[0],top:t.top-i.top+e.offset[1],bottom:t.bottom-i.bottom+e.offset[1]};e._bounds=P.bounds(r)}}cancel(){let e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){let t=this.config,i=this.state;if(null!=e.buttons&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):-1!==t.pointerButtons&&t.pointerButtons!==e.buttons))return;let r=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),r&&r.size>1&&i._pointerActive||(this.start(e),this.setupPointer(e),i._pointerId=v(e),i._pointerActive=!0,this.computeValues(b(e)),this.computeInitial(),t.preventScrollAxis&&"mouse"!==m(e)?(i._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){let t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){let t=this.state,i=this.config;if(!t._pointerActive)return;let r=v(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;let s=b(e);if(document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=n.sub(s,t._values),this.computeValues(s)),n.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional){this.timeoutStore.remove("dragDelay"),t.active=!1,this.startPointerDrag(e);return}if(i.preventScrollAxis&&!t._preventScroll)if(!t.axis)return;else if(t.axis===i.preventScrollAxis||"xy"===i.preventScrollAxis){t._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch(e){}let t=this.state,i=this.config;if(!t._active||!t._pointerActive)return;let r=v(e);if(void 0!==t._pointerId&&r!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);let[n,s]=t._distance;if(t.tap=n<=i.tapsThreshold&&s<=i.tapsThreshold,t.tap&&i.filterTaps)t._force=!0;else{let[e,r]=t._delta,[n,s]=t._movement,[o,a]=i.swipe.velocity,[l,c]=i.swipe.distance,u=i.swipe.duration;if(t.elapsedTime<u){let i=Math.abs(e/t.timeDelta),u=Math.abs(r/t.timeDelta);i>o&&Math.abs(n)>l&&(t.swipe[0]=Math.sign(e)),u>a&&Math.abs(s)>c&&(t.swipe[1]=Math.sign(r))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){let t=this.config,i=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,i,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){var t;this.state._preventScroll=!1,"persist"in(t=e)&&"function"==typeof t.persist&&t.persist();let i=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",i),this.eventStore.add(this.sharedConfig.window,"touch","cancel",i),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){let t=O[e.key];if(t){let i=this.state,r=e.shiftKey?10:e.altKey?.1:1;this.start(e),i._delta=t(this.config.keyboardDisplacement,r),i._keyboardActive=!0,n.addTo(i._movement,i._delta),this.compute(e),this.emit()}}keyUp(e){e.key in O&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){let t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:I},V={target(e){if(e)return()=>"current"in e?e.current:e},enabled:(e=!0)=>e,window:(e=C.isBrowser?window:void 0)=>e,eventOptions:({passive:e=!0,capture:t=!1}={})=>({passive:e,capture:t}),transform:e=>e},K=["target","eventOptions","window","enabled","transform"];function R(e={},t){let i={};for(let[r,n]of Object.entries(t))switch(typeof n){case"function":i[r]=n.call(i,e[r],r,e);break;case"object":i[r]=R(e[r],n);break;case"boolean":n&&(i[r]=e[r])}return i}class U{constructor(e,t){a(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,i,r,n){let s=this._listeners,o=function(e,t=""){let i=u[e];return e+(i&&i[t]||t)}(t,i),a=c(c({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),n);e.addEventListener(o,r,a);let l=()=>{e.removeEventListener(o,r,a),s.delete(l)};return s.add(l),l}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class F{constructor(){a(this,"_timeouts",new Map)}add(e,t,i=140,...r){this.remove(e),this._timeouts.set(e,window.setTimeout(t,i,...r))}remove(e){let t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class H{constructor(e){a(this,"gestures",new Set),a(this,"_targetEventStore",new U(this)),a(this,"gestureEventStores",{}),a(this,"gestureTimeoutStores",{}),a(this,"handlers",{}),a(this,"config",{}),a(this,"pointerIds",new Set),a(this,"touchIds",new Set),a(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function(e,t){t.drag&&z(e,"drag"),t.wheel&&z(e,"wheel"),t.scroll&&z(e,"scroll"),t.move&&z(e,"move"),t.pinch&&z(e,"pinch"),t.hover&&z(e,"hover")}(this,e)}setEventIds(e){if(p(e))return this.touchIds=new Set(Array.from(e.touches).filter(t=>{var i,r;return t.target===e.currentTarget||(null==(i=e.currentTarget)||null==(r=i.contains)?void 0:r.call(i,t.target))}).map(e=>e.identifier)),this.touchIds;if("pointerId"in e)return"pointerup"===e.type||"pointercancel"===e.type?this.pointerIds.delete(e.pointerId):"pointerdown"===e.type&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=function(e,t,i={}){let{target:r,eventOptions:n,window:s,enabled:o,transform:a}=e,l=function(e,t){if(null==e)return{};var i,r,n=function(e,t){if(null==e)return{};var i,r,n={},s=Object.keys(e);for(r=0;r<s.length;r++)i=s[r],t.indexOf(i)>=0||(n[i]=e[i]);return n}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)i=s[r],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}(e,K);if(i.shared=R({target:r,eventOptions:n,window:s,enabled:o,transform:a},V),t){let e=L.get(t);i[t]=R(c({shared:i.shared},l),e)}else for(let e in l){let t=L.get(e);t&&(i[e]=R(c({shared:i.shared},l[e]),t))}return i}(e,t,this.config)}clean(){for(let e of(this._targetEventStore.clean(),this.gestures))this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){let t,i=this.config.shared,r={};if(!i.target||(t=i.target())){if(i.enabled){for(let i of this.gestures){let n=this.config[i],s=W(r,n.eventOptions,!!t);n.enabled&&new(B.get(i))(this,e,i).bind(s)}let n=W(r,i.eventOptions,!!t);for(let t in this.nativeHandlers)n(t,"",i=>this.nativeHandlers[t](c(c({},this.state.shared),{},{event:i,args:e})),void 0,!0)}for(let e in r)r[e]=function(...e){return 0===e.length?w:1===e.length?e[0]:function(){let t;for(let i of e)t=i.apply(this,arguments)||t;return t}}(...r[e]);if(!t)return r;for(let e in r){let{device:i,capture:n,passive:s}=function(e){let t=e.substring(2).toLowerCase(),i=!!~t.indexOf("passive");i&&(t=t.replace("passive",""));let r=f.includes(t)?"capturecapture":"capture",n=!!~t.indexOf(r);return n&&(t=t.replace("capture","")),{device:t,capture:n,passive:i}}(e);this._targetEventStore.add(t,i,"",r[e],{capture:n,passive:s})}}}}function z(e,t){e.gestures.add(t),e.gestureEventStores[t]=new U(e,t),e.gestureTimeoutStores[t]=new F}let W=(e,t,i)=>(r,n,s,o={},a=!1)=>{var l,c;let f=null!=(l=o.capture)?l:t.capture,p=null!=(c=o.passive)?c:t.passive,m=a?r:function(e,t="",i=!1){let r=u[e],n=r&&r[t]||t;return"on"+d(e)+d(n)+(!function(e=!1,t){return e&&!h.includes(t)}(i,n)?"":"Capture")}(r,n,f);i&&p&&(m+="Passive"),e[m]=e[m]||[],e[m].push(s)};var G=e.i(67561),q=e.i(83934),X=e.i(11426),Y=i;class $ extends Y.default.Component{constructor(e){super(e),this.state={hasError:!1,error:null,errorInfo:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){this.setState({error:e,errorInfo:t}),console.error("Error caught in Error Boundary:",e,t)}handleRefresh=()=>{window.location.reload()};handleExitFullscreen=()=>{document.fullscreenElement&&(window.close(),document.exitFullscreen().catch(e=>{console.error("Failed to exit fullscreen:",e)}))};render(){if(this.state.hasError){let{error:e,errorInfo:i}=this.state;return(0,t.jsx)("div",{className:"flex flex-col items-center justify-center min-h-screen bg-hud-bg text-hud-main p-6",children:(0,t.jsxs)("div",{className:"tesla-card p-10 max-w-2xl w-full bg-hud-elevated backdrop-blur-xl border border-hud rounded-3xl shadow-2xl flex flex-col items-center text-center",children:[(0,t.jsx)("div",{className:"w-20 h-20 rounded-full bg-oRed/20 flex items-center justify-center mb-8",children:(0,t.jsx)("div",{className:"w-4 h-4 rounded-full bg-oRed animate-soft-pulse"})}),(0,t.jsx)("h1",{className:"text-3xl font-black uppercase tracking-tighter text-oRed mb-6",children:"System Critical Error"}),(0,t.jsxs)("p",{className:"text-lg font-medium text-hud-main/80 mb-8 max-w-md",children:[(0,t.jsx)("span",{className:"text-hud-muted uppercase text-xs font-black tracking-widest block mb-2",children:"Technical Status"}),e?e.toString():"Unknown exception detected in UI thread"]}),i&&(0,t.jsxs)("details",{className:"w-full whitespace-pre-wrap bg-hud-bg/5 p-6 rounded-2xl mb-10 text-left border border-hud group",children:[(0,t.jsxs)("summary",{className:"cursor-pointer text-oBlue text-xs font-black uppercase tracking-widest hover:text-hud-main transition-colors flex items-center justify-between",children:[(0,t.jsx)("span",{children:"Diagnostic Stack Trace"}),(0,t.jsx)("span",{className:"opacity-40 group-open:rotate-180 transition-transform",children:"▼"})]}),(0,t.jsx)("pre",{className:"mt-6 text-xs font-mono text-hud-muted overflow-auto max-h-60 custom-scrollbar leading-relaxed",children:i.componentStack})]}),(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row gap-4 w-full justify-center",children:[(0,t.jsx)("button",{onClick:this.handleRefresh,className:"px-8 py-4 bg-oBlue hover:bg-blue-600 text-hud-main rounded-xl text-xs font-black uppercase tracking-[0.2em] transition-all duration-500 shadow-lg shadow-oBlue/20 active:scale-95",children:"Reboot Session"}),(0,t.jsx)("button",{onClick:this.handleExitFullscreen,className:"px-8 py-4 bg-hud-elevated hover:bg-hud-bg text-hud-main border border-hud rounded-xl text-xs font-black uppercase tracking-[0.2em] transition-all duration-500 active:scale-95",children:"Exit Console"})]})]})})}return this.props.children}}e.i(85269);var J=e.i(71),Q=e.i(18850),Z=e.i(83402);function ee({children:e}){return(0,i.useEffect)(()=>{let e=Z.default.get("language");e&&e!==Q.default.language&&Q.default.changeLanguage(e)},[]),(0,t.jsx)(J.I18nextProvider,{i18n:Q.default,children:e})}let et=(0,r.default)(()=>e.A(45344),{loadableGenerated:{modules:[42602]},loading:()=>(0,t.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:"Loading..."})}),ei=(0,r.default)(()=>e.A(10520),{loadableGenerated:{modules:[61891]}}),er=(0,r.default)(()=>e.A(49063),{loadableGenerated:{modules:[85626]}}),en=(0,r.default)(()=>e.A(13181),{loadableGenerated:{modules:[23595]},loading:()=>(0,t.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,t.jsx)("div",{className:"text-hud-main text-2xl",children:"Loading 3D View..."})}),ssr:!1}),es={BOAT:"boat",APP:"app",SPLIT:"split"};e.s(["VIEW_MODES",0,es,"default",0,function(){var e,r;let n=(0,i.useRef)(!1),s=(0,i.useRef)(null),[o,a]=(0,i.useState)(null),[l,c]=(0,i.useState)(()=>Z.default.getCurrentView()||"navigation"),[u,d]=(0,i.useState)(!1),[h,f]=(0,i.useState)(!1),p=(0,i.useRef)(!1);(0,i.useEffect)(()=>{},[]),(0,i.useEffect)(()=>{let e,t=Z.default.get("viewMode");a(Object.values(es).includes(t)?t:window.innerWidth>=1366?es.SPLIT:es.BOAT),n.current=!0;let i=()=>{clearTimeout(e),e=setTimeout(()=>{p.current||Z.default.get("viewMode")||a(window.innerWidth>=1366?es.SPLIT:es.BOAT)},250)};return window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i),clearTimeout(e)}},[]);let m=(0,i.useCallback)(()=>{d(e=>!e)},[]),g=(0,i.useCallback)(e=>{a(e),Z.default.set("viewMode",e)},[]),v=(e=({movement:[e]})=>{let t=window.innerWidth/5;e>t?g(es.BOAT):e<-t?g(es.APP):g(es.SPLIT)},r={axis:"x"},B.set(N.key,N.engine),L.set(N.key,N.resolver),function(e,t={},r){let n=i.default.useMemo(()=>new H(e),[]);if(n.applyHandlers(e,void 0),n.applyConfig(t,r),i.default.useEffect(n.effect.bind(n)),i.default.useEffect(()=>n.clean.bind(n),[]),void 0===t.target)return n.bind.bind(n)}({drag:e},r||{},"drag")),b=(0,i.useCallback)(()=>{document.fullscreenElement?document.exitFullscreen():document.documentElement.requestFullscreen().catch(e=>{console.error("Fullscreen error:",e.message)})},[]),x=(0,i.useCallback)(e=>{o===es.BOAT&&g(es.APP),c(e),Z.default.setCurrentView(e)},[o,g]),w=(0,i.useRef)(null),y=(0,i.useRef)(null),_=(0,i.useCallback)(()=>{if("settings"===l){p.current=!1,f(!1);let e=y.current||"navigation";c(e),Z.default.setCurrentView(e),g(w.current||es.BOAT)}else w.current=o,y.current=l,p.current=!0,f(!0),x("settings"),a(es.APP)},[l,o,g,x]);(0,i.useEffect)(()=>{if("settings"===l){p.current||(p.current=!0,f(!0));return}p.current&&(p.current=!1,f(!1))},[l]);let k=(0,i.useMemo)(()=>null===o?{}:{leftPane:`transition-all duration-300 ${o===es.BOAT?"w-full":o===es.APP?"hidden":"w-2/5"} bg-leftPaneBg h-full relative`,rightPane:`transition-all duration-300 ${o===es.APP?"w-full":o===es.BOAT?"hidden":"w-3/5"} h-full bg-rightPaneBg`},[o]);return n.current?(0,t.jsx)($,{children:(0,t.jsx)(ee,{children:(0,t.jsx)(G.OcearoContextProvider,{children:(0,t.jsx)(q.WeatherContextProvider,{children:(0,t.jsx)(X.TideContextProvider,{children:(0,t.jsxs)("div",{className:"h-[100dvh] flex flex-col bg-hud-bg relative overflow-hidden",children:[(0,t.jsxs)("div",{className:"flex flex-1 min-h-0",children:[(0,t.jsx)("div",{className:k.leftPane,children:(0,t.jsx)(en,{active:o!==es.APP})}),(0,t.jsx)("div",{ref:s,...v(),className:"handle w-1 bg-leftPaneBg h-full cursor-col-resize transition-all duration-200 flex items-center justify-center touch-none",children:(0,t.jsx)("div",{className:"rounded-full w-3 bg-hud-dim h-40 transition-all duration-200 hover:bg-hud-muted border border-hud"})}),(0,t.jsx)("div",{className:k.rightPane,children:(0,t.jsx)(et,{view:l})})]}),(0,t.jsx)("div",{className:"w-full h-16 min-h-16 bg-leftPaneBg border-t border-hud flex items-center justify-center shrink-0",children:(0,t.jsx)(ei,{setRightView:x,toggleAppMenu:m,toggleSettings:_})}),u&&(0,t.jsx)(er,{currentViewMode:o,toggleViewMode:g,handleSetRightView:x,toggleSettings:_,toggleFullscreen:b,setShowAppMenu:d})]})})})})})}):(0,t.jsx)("div",{className:"h-[100dvh] bg-hud-bg flex items-center justify-center",children:(0,t.jsx)("div",{className:"animate-pulse text-hud-main",children:"Loading..."})})}],81694)}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,4875,e=>{"use strict";var t=e.i(43476),a=e.i(67561),
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,4875,e=>{"use strict";var t=e.i(43476),a=e.i(67561),i=e.i(46991),s=e.i(71645),l=e.i(85709);e.i(85269);var n=e.i(22831);let r={SOG:"navigation.speedOverGround",VMG:"performance.velocityMadeGood",STW:"navigation.speedThroughWater",POL:"performance.polarSpeedRatio"};e.s(["default",0,()=>{let{t:e}=(0,n.useTranslation)(),{nightMode:c}=(0,a.useOcearoContext)(),[o,d]=(0,s.useState)("SOG"),u=(0,s.useMemo)(()=>Object.values(r),[]),x=(0,l.useSignalKPaths)(u),h=(0,s.useMemo)(()=>{let e={};for(let[t,a]of Object.entries(r)){let s=x[a];null!=s&&(e[t]="POL"===t?100*s:(0,i.convertSpeedUnit)(s))}return e},[x]),m=Object.keys(h),p=void 0!==h[o]?o:m[0],g=h[p],v=(0,s.useCallback)(()=>{if(0===m.length)return;let e=(m.indexOf(p)+1)%m.length;d(m[e])},[m,p]);return 0===m.length?(0,t.jsxs)("div",{className:"mt-6 ml-2",children:[(0,t.jsx)("div",{className:"text-7xl font-black text-hud-dim tracking-tighter",children:"--"}),(0,t.jsx)("div",{className:"text-xs font-black uppercase tracking-[0.2em] text-hud-muted ml-1",children:e("common.na")})]}):(0,t.jsxs)("div",{className:"mt-6 ml-2 select-none group",children:[(0,t.jsx)("div",{className:`text-7xl font-black cursor-pointer tracking-tighter drop-shadow-2xl transition-all duration-300 group-hover:scale-105 active:scale-95 ${c?"text-oNight":"text-hud-main"}`,onClick:v,role:"button",tabIndex:0,"aria-label":`Current speed: ${g} ${p}. Click to change speed type.`,children:Number.isFinite(g)?g.toFixed(1):"--"}),(0,t.jsxs)("div",{className:"flex items-center space-x-2 ml-1",children:[(0,t.jsx)("div",{className:`text-xs font-black uppercase tracking-[0.3em] ${c?"text-oNight":"text-hud-secondary"}`,children:p}),(0,t.jsx)("div",{className:"h-[2px] w-4 bg-oBlue/40 rounded-full"}),(0,t.jsx)("div",{className:`text-xs font-bold uppercase tracking-widest ${c?"text-oNight/60":"text-hud-muted"}`,children:"POL"===p?"%":(0,i.getSpeedUnitLabel)()})]})]})}])},56665,e=>{e.n(e.i(4875))}]);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,88653,e=>{"use strict";e.i(47167);var t=e.i(43476),s=e.i(71645),n=e.i(31178),o=e.i(47414),l=e.i(74008),r=e.i(21476),a=e.i(72846),i=s,u=e.i(37806);function c(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}class d extends i.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if((0,a.isHTMLElement)(t)&&e.isPresent&&!this.props.isPresent&&!1!==this.props.pop){let e=t.offsetParent,s=(0,a.isHTMLElement)(e)&&e.offsetWidth||0,n=(0,a.isHTMLElement)(e)&&e.offsetHeight||0,o=getComputedStyle(t),l=this.props.sizeRef.current;l.height=parseFloat(o.height),l.width=parseFloat(o.width),l.top=t.offsetTop,l.left=t.offsetLeft,l.right=s-l.width-l.left,l.bottom=n-l.height-l.top,l.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function m({children:e,isPresent:n,anchorX:o,anchorY:l,root:r,pop:a}){let h=(0,i.useId)(),p=(0,i.useRef)(null),f=(0,i.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:g}=(0,i.useContext)(u.MotionConfigContext),x=function(...e){return s.useCallback(function(...e){return t=>{let s=!1,n=e.map(e=>{let n=c(e,t);return s||"function"!=typeof n||(s=!0),n});if(s)return()=>{for(let t=0;t<n.length;t++){let s=n[t];"function"==typeof s?s():c(e[t],null)}}}}(...e),e)}(p,e.props?.ref??e?.ref);return(0,i.useInsertionEffect)(()=>{let{width:e,height:t,top:s,left:i,right:u,bottom:c,direction:d}=f.current;if(n||!1===a||!p.current||!e||!t)return;let m="rtl"===d,x="left"===o?m?`right: ${u}`:`left: ${i}`:m?`left: ${i}`:`right: ${u}`,j="bottom"===l?`bottom: ${c}`:`top: ${s}`;p.current.dataset.motionPopId=h;let y=document.createElement("style");g&&(y.nonce=g);let b=r??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
|
|
2
|
+
[data-motion-pop-id="${h}"] {
|
|
3
|
+
position: absolute !important;
|
|
4
|
+
width: ${e}px !important;
|
|
5
|
+
height: ${t}px !important;
|
|
6
|
+
${x}px !important;
|
|
7
|
+
${j}px !important;
|
|
8
|
+
}
|
|
9
|
+
`),()=>{p.current?.removeAttribute("data-motion-pop-id"),b.contains(y)&&b.removeChild(y)}},[n]),(0,t.jsx)(d,{isPresent:n,childRef:p,sizeRef:f,pop:a,children:!1===a?e:i.cloneElement(e,{ref:x})})}let h=({children:e,initial:n,isPresent:a,onExitComplete:i,custom:u,presenceAffectsLayout:c,mode:d,anchorX:h,anchorY:f,root:g})=>{let x=(0,o.useConstant)(p),j=(0,s.useId)(),y=(0,s.useRef)(a),b=(0,s.useRef)(i);(0,l.useIsomorphicLayoutEffect)(()=>{y.current=a,b.current=i});let w=!0,v=(0,s.useMemo)(()=>(w=!1,{id:j,initial:n,isPresent:a,custom:u,onExitComplete:e=>{for(let t of(x.set(e,!0),x.values()))if(!t)return;i&&i()},register:e=>(x.set(e,!1),()=>{x.delete(e),y.current||x.size||b.current?.()})}),[a,x,i]);return c&&w&&(v={...v}),(0,s.useMemo)(()=>{x.forEach((e,t)=>x.set(t,!1))},[a]),s.useEffect(()=>{a||x.size||!i||i()},[a]),e=(0,t.jsx)(m,{pop:"popLayout"===d,isPresent:a,anchorX:h,anchorY:f,root:g,children:e}),(0,t.jsx)(r.PresenceContext.Provider,{value:v,children:e})};function p(){return new Map}var f=e.i(64978);let g=e=>e.key||"";function x(e){let t=[];return s.Children.forEach(e,e=>{(0,s.isValidElement)(e)&&t.push(e)}),t}e.s(["AnimatePresence",0,({children:e,custom:r,initial:a=!0,onExitComplete:i,presenceAffectsLayout:u=!0,mode:c="sync",propagate:d=!1,anchorX:m="left",anchorY:p="top",root:j})=>{let[y,b]=(0,f.usePresence)(d),w=(0,s.useMemo)(()=>x(e),[e]),v=d&&!y?[]:w.map(g),k=(0,s.useRef)(!0),P=(0,s.useRef)(w),E=(0,o.useConstant)(()=>new Map),C=(0,s.useRef)(new Set),[R,$]=(0,s.useState)(w),[A,M]=(0,s.useState)(w);(0,l.useIsomorphicLayoutEffect)(()=>{k.current=!1,P.current=w;for(let e=0;e<A.length;e++){let t=g(A[e]);v.includes(t)?(E.delete(t),C.current.delete(t)):!0!==E.get(t)&&E.set(t,!1)}},[A,v.length,v.join("-")]);let L=[];if(w!==R){let e=[...w];for(let t=0;t<A.length;t++){let s=A[t],n=g(s);v.includes(n)||(e.splice(t,0,s),L.push(s))}return"wait"===c&&L.length&&(e=L),M(x(e)),$(w),null}let{forceRender:T}=(0,s.useContext)(n.LayoutGroupContext);return(0,t.jsx)(t.Fragment,{children:A.map(e=>{let s=g(e),n=(!d||!!y)&&(w===A||v.includes(s));return(0,t.jsx)(h,{isPresent:n,initial:(!k.current||!!a)&&void 0,custom:r,presenceAffectsLayout:u,mode:c,root:j,onExitComplete:n?void 0:()=>{if(C.current.has(s)||!E.has(s))return;C.current.add(s),E.set(s,!0);let e=!0;E.forEach(t=>{t||(e=!1)}),e&&(T?.(),M(P.current),d&&b?.(),i&&i())},anchorX:m,anchorY:p,children:e},s)})})}],88653)},68192,e=>{"use strict";var t=e.i(43476),s=e.i(71645),n=e.i(70703),o=e.i(46932),l=e.i(88653),r=e.i(67561);e.i(85269);var a=e.i(22831),i=e.i(85709),u=e.i(83402);let c=({messageKey:e})=>{let{t:s}=(0,a.useTranslation)();return(0,t.jsx)("div",{className:"w-full h-full flex items-center justify-center text-hud-main",children:s(e)})},d=(0,n.default)(()=>e.A(56489),{loadableGenerated:{modules:[92094]},loading:()=>(0,t.jsx)(c,{messageKey:"common.loadingDocuments"})}),m=(0,n.default)(()=>e.A(22155),{loadableGenerated:{modules:[34900]},loading:()=>(0,t.jsx)(c,{messageKey:"common.loadingSettings"})}),h=(0,n.default)(()=>e.A(30455),{loadableGenerated:{modules:[13268]},loading:()=>(0,t.jsx)(c,{messageKey:"common.loadingMediaPlayer"})}),p=(0,n.default)(()=>e.A(71074),{loadableGenerated:{modules:[65862]},loading:()=>(0,t.jsx)(c,{messageKey:"common.loadingBatteryMonitor"})}),f=(0,n.default)(()=>e.A(3523),{loadableGenerated:{modules:[8161]},loading:()=>(0,t.jsx)(c,{messageKey:"common.loadingEngineMonitor"})}),g=(0,n.default)(()=>e.A(88913),{loadableGenerated:{modules:[25294]},loading:()=>(0,t.jsx)(c,{messageKey:"common.loadingDashboard"})}),x=(0,n.default)(()=>e.A(26371),{loadableGenerated:{modules:[70127]},loading:()=>(0,t.jsx)(c,{messageKey:"common.loadingLogbook"})}),j=(0,n.default)(()=>e.A(58293),{loadableGenerated:{modules:[33946]},loading:()=>(0,t.jsx)(c,{messageKey:"common.loadingAutopilot"})}),y=(0,n.default)(()=>e.A(47853),{loadableGenerated:{modules:[58652]},loading:()=>(0,t.jsx)(c,{messageKey:"common.loading"})}),b={latitude:46.1591,longitude:-1.1522},w={navigation:e=>!e||e.includes("localhost:3000")?null:`${e}/@signalk/freeboard-sk/`,instrument:e=>`${e}/@mxtommy/kip/`,dashboard:e=>e.replace(":3000",":3001")+"/grafana",webcam1:()=>"https://pv.viewsurf.com/2080/Chatelaillon-Port?i=NzU4Mjp1bmRlZmluZWQ",webcam2:()=>"https://pv.viewsurf.com/1478/Chatelaillon-Plage?i=NTkyMDp1bmRlZmluZWQ",weather:(e,t)=>t&&`https://embed.windy.com/embed.html?type=map&location=coordinates&metricRain=mm&metricTemp=\xb0C&metricWind=kt&zoom=10&overlay=wind&product=ecmwf&level=surface&lat=${t.latitude}&lon=${t.longitude}&message=true`};e.s(["default",0,({view:e})=>{let{t:n}=(0,a.useTranslation)(),{nightMode:c}=(0,r.useOcearoContext)(),[v,k]=(0,s.useState)(b),[P,E]=(0,s.useState)(null),{signalkUrl:C}=u.default.getAll(),R=(0,i.useSignalKPath)("navigation.position");(0,s.useEffect)(()=>{E(null)},[e]),(0,s.useEffect)(()=>{R&&k(e=>e?Math.abs(e.latitude-R.latitude)>.01||Math.abs(e.longitude-R.longitude)>.01?R:e:R)},[R]);let $=(0,s.useMemo)(()=>{let t=u.default.getAll(),s=t.customExternalUrls||{};if(t.showCustomUrls&&s[e])try{if("string"==typeof s[e]&&s[e].includes("${signalkUrl}"))return s[e].replace("${signalkUrl}",C).replace("${latitude}",v?.latitude||b.latitude).replace("${longitude}",v?.longitude||b.longitude);return s[e]}catch(e){console.error("Error using custom URL:",e)}let n=w[e];if(!n)return null;try{return n(C,v)}catch(e){return console.error("Error generating URL:",e),null}},[e,v,C]),A=["motor","logbook","autopilot","battery","dashboard","debug"].includes(e);return(0,t.jsx)("div",{className:"flex flex-col w-full h-full overflow-hidden bg-hud-bg backdrop-blur-sm relative z-0",children:(0,t.jsx)(l.AnimatePresence,{mode:"wait",children:(0,t.jsx)(o.motion.div,{initial:{opacity:0,x:10,scale:.99},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:-10,scale:.99},transition:{duration:.4,ease:[.16,1,.3,1]},style:{flex:"1 1 0%",minHeight:0},className:`flex flex-col w-full absolute inset-0 ${A?"overflow-hidden":"overflow-auto"}`,children:(()=>{if(P)return(0,t.jsx)("div",{className:"text-oRed p-4 font-black uppercase text-xs",children:P});switch(e){case"manual":return(0,t.jsx)(d,{path:"/docs"});case"settings":return(0,t.jsx)(m,{});case"mediaplayer":return(0,t.jsx)(h,{});case"battery":return(0,t.jsx)(p,{});case"motor":return(0,t.jsx)(f,{});case"dashboard":return(0,t.jsx)(g,{});case"logbook":return(0,t.jsx)(x,{});case"autopilot":return(0,t.jsx)(j,{});case"debug":return(0,t.jsx)(y,{});default:if(!$)return(0,t.jsx)("div",{className:"text-hud-muted p-4 text-sm",children:n("errors.failedToLoadExternal")});return(0,t.jsx)("iframe",{className:"flex-grow border-none",src:$,title:"External Application",onError:()=>E(n("errors.failedToLoadExternal"))})}})()},e)})})}])},42602,e=>{e.n(e.i(68192))},56489,e=>{e.v(t=>Promise.all(["static/chunks/0l9s4rhr00adq.js","static/chunks/2nxsyowmuwpjy.js"].map(t=>e.l(t))).then(()=>t(92094)))},22155,e=>{e.v(t=>Promise.all(["static/chunks/070stlm97b9a2.js"].map(t=>e.l(t))).then(()=>t(34900)))},30455,e=>{e.v(t=>Promise.all(["static/chunks/43ps2cu5ahf8n.js","static/chunks/2nxsyowmuwpjy.js"].map(t=>e.l(t))).then(()=>t(13268)))},71074,e=>{e.v(t=>Promise.all(["static/chunks/3iuz3f0429awx.js","static/chunks/3rhgquok36e79.js","static/chunks/28y-j215vt42m.js","static/chunks/2nxsyowmuwpjy.js"].map(t=>e.l(t))).then(()=>t(65862)))},3523,e=>{e.v(t=>Promise.all(["static/chunks/0ri_um14-5x7u.js","static/chunks/2nxsyowmuwpjy.js"].map(t=>e.l(t))).then(()=>t(8161)))},88913,e=>{e.v(t=>Promise.all(["static/chunks/2udirievybq_j.js","static/chunks/1q572rz5m8mb-.js","static/chunks/2nxsyowmuwpjy.js","static/chunks/0uvr7xkt_5uno.js"].map(t=>e.l(t))).then(()=>t(25294)))},26371,e=>{e.v(t=>Promise.all(["static/chunks/2pwmb4pkqygy_.js","static/chunks/2nxsyowmuwpjy.js"].map(t=>e.l(t))).then(()=>t(70127)))},58293,e=>{e.v(t=>Promise.all(["static/chunks/2a0yjir_3mk1m.js","static/chunks/2nxsyowmuwpjy.js"].map(t=>e.l(t))).then(()=>t(33946)))},47853,e=>{e.v(t=>Promise.all(["static/chunks/1sq_733weprvs.js"].map(t=>e.l(t))).then(()=>t(58652)))}]);
|