ocearo-ui 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/404.html +1 -1
  2. package/README.md +5 -0
  3. package/_next/static/chunks/{117-13c5dd4a0d014140.js → 117-ddf36b6a7b427a7b.js} +2 -2
  4. package/_next/static/chunks/154.5a4b1f874e4dc912.js +1 -0
  5. package/_next/static/chunks/221.fb1adcbb0ffffbef.js +1 -0
  6. package/_next/static/chunks/274.9f7e7656569e62ca.js +1 -0
  7. package/_next/static/chunks/875-34a16d45b233a109.js +680 -0
  8. package/_next/static/chunks/967.0888f88af5e1e286.js +1 -0
  9. package/_next/static/chunks/975.d6c51a6ff00d0466.js +1 -0
  10. package/_next/static/chunks/app/page-732898e6bc4f7502.js +1 -0
  11. package/_next/static/chunks/b536a0f1-7c94f39427c6b177.js +197 -0
  12. package/_next/static/chunks/bd904a5c-cda56ad9f008ceb3.js +36 -0
  13. package/_next/static/chunks/{fd9d1056-cea23896a4e51c9f.js → fd9d1056-5fd12b742601fe8c.js} +1 -1
  14. package/_next/static/chunks/main-3fc5e29932a06222.js +1 -0
  15. package/_next/static/chunks/webpack-6ba3ee57ba412e0f.js +1 -0
  16. package/_next/static/css/c20c87eb42004889.css +3 -0
  17. package/boats/boats.json +1 -1
  18. package/boats/default/Scene.jsx +31 -3
  19. package/boats/optimist/Scene.jsx +5 -5
  20. package/boats/optimist/assets/scene-transformed.glb +0 -0
  21. package/boats/sailboat/Scene.jsx +2 -1
  22. package/boats/ship/Scene.jsx +3 -3
  23. package/boats/ship/assets/scene-transformed.glb +0 -0
  24. package/boats/windsurf/Scene.jsx +3 -3
  25. package/boats/windsurf/assets/scene-transformed.glb +0 -0
  26. package/index.html +1 -1
  27. package/index.txt +2 -2
  28. package/ocearo-ui-0.1.2.tgz +0 -0
  29. package/package.json +2 -2
  30. package/_next/static/chunks/154.e59cfd7ab28b22f3.js +0 -1
  31. package/_next/static/chunks/221.c556ed3958a01555.js +0 -1
  32. package/_next/static/chunks/274.6221f97fc72b40bf.js +0 -1
  33. package/_next/static/chunks/40-b8c70536a139d7d9.js +0 -680
  34. package/_next/static/chunks/967.7790c46728e72d8c.js +0 -1
  35. package/_next/static/chunks/975.9cec8f9ccded8eb3.js +0 -1
  36. package/_next/static/chunks/app/page-7e7661c2756491f8.js +0 -1
  37. package/_next/static/chunks/b536a0f1-302f79f7db7fee1d.js +0 -197
  38. package/_next/static/chunks/bd904a5c-c2e9cd00941cf03a.js +0 -36
  39. package/_next/static/chunks/main-724f5359f23c43fc.js +0 -1
  40. package/_next/static/chunks/webpack-a0fb0ccf52a3e8c0.js +0 -1
  41. package/_next/static/css/e46a5fe684411565.css +0 -3
  42. package/boats/default/assets/ahsap_baseColor.png +0 -0
  43. package/boats/default/assets/ahsap_emissive.png +0 -0
  44. package/boats/default/assets/ahsap_metallicRoughness.png +0 -0
  45. package/boats/default/assets/fiberglass2_baseColor.png +0 -0
  46. package/boats/default/assets/fiberglass2_metallicRoughness.png +0 -0
  47. package/boats/default/assets/fiberglass_baseColor.png +0 -0
  48. package/boats/default/assets/fiberglass_emissive.png +0 -0
  49. package/boats/default/assets/fiberglass_metallicRoughness.png +0 -0
  50. package/boats/default/assets/material_5_baseColor.png +0 -0
  51. package/boats/default/assets/material_5_emissive.png +0 -0
  52. package/boats/default/assets/material_5_metallicRoughness.png +0 -0
  53. package/boats/default/assets/material_baseColor.png +0 -0
  54. package/boats/default/assets/material_emissive.png +0 -0
  55. package/boats/default/assets/material_metallicRoughness.png +0 -0
  56. package/boats/default/assets/metal_baseColor.png +0 -0
  57. package/boats/default/assets/metal_emissive.png +0 -0
  58. package/boats/default/assets/metal_metallicRoughness.png +0 -0
  59. package/boats/default/assets/scene.bin +0 -0
  60. package/boats/default/assets/scene.gltf +0 -3670
  61. package/boats/default/assets/textures/ahsap_baseColor.png +0 -0
  62. package/boats/default/assets/textures/ahsap_emissive.png +0 -0
  63. package/boats/default/assets/textures/ahsap_metallicRoughness.png +0 -0
  64. package/boats/default/assets/textures/fiberglass2_baseColor.png +0 -0
  65. package/boats/default/assets/textures/fiberglass2_metallicRoughness.png +0 -0
  66. package/boats/default/assets/textures/fiberglass_baseColor.png +0 -0
  67. package/boats/default/assets/textures/fiberglass_emissive.png +0 -0
  68. package/boats/default/assets/textures/fiberglass_metallicRoughness.png +0 -0
  69. package/boats/default/assets/textures/material_5_baseColor.png +0 -0
  70. package/boats/default/assets/textures/material_5_emissive.png +0 -0
  71. package/boats/default/assets/textures/material_5_metallicRoughness.png +0 -0
  72. package/boats/default/assets/textures/material_baseColor.png +0 -0
  73. package/boats/default/assets/textures/material_emissive.png +0 -0
  74. package/boats/default/assets/textures/material_metallicRoughness.png +0 -0
  75. package/boats/default/assets/textures/metal_baseColor.png +0 -0
  76. package/boats/default/assets/textures/metal_emissive.png +0 -0
  77. package/boats/default/assets/textures/metal_metallicRoughness.png +0 -0
  78. package/boats/optimist/assets/scene-transformed.bin +0 -0
  79. package/boats/optimist/assets/scene-transformed.gltf +0 -929
  80. package/boats/optimist/assets/scene.bin +0 -0
  81. package/boats/optimist/assets/scene.gltf +0 -983
  82. package/boats/sailboat/assets/metal_baseColor.png +0 -0
  83. package/boats/sailboat/assets/scene.bin +0 -0
  84. package/boats/sailboat/assets/scene.gltf +0 -153
  85. package/boats/ship/assets/scene.bin +0 -0
  86. package/boats/ship/assets/scene.gltf +0 -973
  87. package/boats/windsurf/assets/scene.bin +0 -0
  88. package/boats/windsurf/assets/scene.gltf +0 -1393
  89. package/ocearo-ui-0.1.1.tgz +0 -0
  90. /package/_next/static/{g0W0Js96ojkQDSwCAndKp → 7lwSkApRgo2DU2ao1IjeG}/_buildManifest.js +0 -0
  91. /package/_next/static/{g0W0Js96ojkQDSwCAndKp → 7lwSkApRgo2DU2ao1IjeG}/_ssgManifest.js +0 -0
  92. /package/_next/static/chunks/{0f8af13e-5f64d2851243c648.js → 0f8af13e-59794c1587e7a41d.js} +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[967],{2967:function(e,a,t){t.r(a),t.d(a,{Model:function(){return m}});var o=t(7437);t(2265);var s=t(1106);let r=t(257).env.ASSET_PREFIX||"",i="".concat(r,"/boats/default/assets/scene-transformed.glb");function m(e){let{nodes:a,materials:t}=(0,s.L)(i,"".concat(r,"/draco/"));return(0,o.jsxs)("group",{...e,dispose:null,children:[(0,o.jsx)("mesh",{geometry:a.baba_metal_0.geometry,material:t.metal,position:[.24,.895,-5.546],rotation:[-Math.PI/2,0,1.968],scale:.027}),(0,o.jsx)("mesh",{geometry:a.camadadirek_fiberglass_0.geometry,material:t.fiberglass,position:[0,5.267,-3.711],rotation:[2.054,0,Math.PI],scale:[-.042,.042,4.707]}),(0,o.jsx)("mesh",{geometry:a.camadanyelkeni_bez_0.geometry,material:t.material,position:[0,5.267,-3.711],rotation:[2.054,0,Math.PI],scale:[-.042,.042,4.707]}),(0,o.jsx)("mesh",{geometry:a.camadaonbaglay_metal_0.geometry,material:t.metal,position:[0,.891,-5.958],rotation:[-Math.PI/2,0,0],scale:.02}),(0,o.jsx)("mesh",{geometry:a.capa_metal_0.geometry,material:t.metal,position:[0,.671,-6.173],rotation:[-Math.PI/2,0,0],scale:.348}),(0,o.jsx)("mesh",{geometry:a.direk_fiberglass_0.geometry,material:t.fiberglass,position:[0,4.315,-1.056],rotation:[Math.PI/2,0,Math.PI],scale:[-.113,.113,5.203]}),(0,o.jsx)("mesh",{geometry:a.duman_ahsap_0.geometry,material:t.ahsap,position:[-.011,.854,3.487],rotation:[Math.PI,0,Math.PI/2],scale:[.045,.045,.011]}),(0,o.jsx)("mesh",{geometry:a.dumenyuvasi_ahsap_0.geometry,material:t.ahsap,position:[-.011,.299,3.441],rotation:[-Math.PI/2,0,1.571],scale:.094}),(0,o.jsx)("mesh",{geometry:a.dumenyuvasi_cam_0.geometry,material:t.material_5,position:[-.011,.299,3.441],rotation:[-Math.PI/2,0,1.571],scale:.094}),(0,o.jsx)("mesh",{geometry:a.dumenyuvasi_fiberglass_0.geometry,material:t.fiberglass,position:[-.011,.299,3.441],rotation:[-Math.PI/2,0,1.571],scale:.094}),(0,o.jsx)("mesh",{geometry:a.govde_fiberglass2_0.geometry,material:t.fiberglass2,position:[0,.32,-.897],rotation:[0,Math.PI/2,0],scale:[5.11,.454,1.212]}),(0,o.jsx)("mesh",{geometry:a.govde_fiberglass_0.geometry,material:t.fiberglass,position:[0,.32,-.897],rotation:[0,Math.PI/2,0],scale:[5.11,.454,1.212]}),(0,o.jsx)("mesh",{geometry:a.govde_metal_0.geometry,material:t.metal,position:[0,.32,-.897],rotation:[0,Math.PI/2,0],scale:[5.11,.454,1.212]}),(0,o.jsx)("mesh",{geometry:a.halattutucu_fiberglass2_0.geometry,material:t.fiberglass2,position:[-1.044,.939,1.809],rotation:[-Math.PI/2,0,0],scale:[.016,.059,.016]}),(0,o.jsx)("mesh",{geometry:a.ip001_metal_0.geometry,material:t.metal,position:[-.231,7.608,-.621],rotation:[-2.322,.222,-1.556],scale:[.007,.007,.011]}),(0,o.jsx)("mesh",{geometry:a.pervan_fiberglass_0.geometry,material:t.fiberglass,position:[0,-1.005,1.561],rotation:[-Math.PI/2,Math.PI/2,0],scale:[.154,.094,.104]}),(0,o.jsx)("mesh",{geometry:a.pervane_metal_0.geometry,material:t.metal,position:[0,-1.122,1.75],scale:.034}),(0,o.jsx)("mesh",{geometry:a.rudder_fiberglass_0.geometry,material:t.fiberglass,position:[0,-1.153,3.486],rotation:[-Math.PI/2,Math.PI/2,0],scale:[.573,.262,.262]}),(0,o.jsx)("mesh",{geometry:a.salma_fiberglass_0.geometry,material:t.fiberglass,position:[0,-1.953,-.739],scale:[.149,.108,.756]}),(0,o.jsx)("mesh",{geometry:a.ustcam_cam_0.geometry,material:t.material_5,position:[-.337,.974,-3.127],rotation:[-Math.PI/2,0,0],scale:[-.183,.133,.025]}),(0,o.jsx)("mesh",{geometry:a.ustcam_fiberglass_0.geometry,material:t.fiberglass,position:[-.337,.974,-3.127],rotation:[-Math.PI/2,0,0],scale:[-.183,.133,.025]}),(0,o.jsx)("mesh",{geometry:a.ustgovde_fiberglass_0.geometry,material:t.fiberglass,position:[0,.832,-2.741],rotation:[-Math.PI/2,0,0],scale:[.566,.7,1.212]}),(0,o.jsx)("mesh",{geometry:a.ustgovdekzak_ahsap_0.geometry,material:t.ahsap,position:[0,.862,-2.741],rotation:[-Math.PI/2,0,0],scale:[.566,.7,1.212]}),(0,o.jsx)("mesh",{geometry:a.vinc_metal_0.geometry,material:t.metal,position:[-1.07,.977,2.02],rotation:[-Math.PI/2,0,0],scale:.065}),(0,o.jsx)("mesh",{geometry:a.yancam002_cam_0.geometry,material:t.material_5,position:[-.984,.591,-3.772],rotation:[Math.PI,-1.241,-Math.PI/2],scale:[.095,.28,.014]}),(0,o.jsx)("mesh",{geometry:a.yancam002_fiberglass_0.geometry,material:t.fiberglass,position:[-.984,.591,-3.772],rotation:[Math.PI,-1.241,-Math.PI/2],scale:[.095,.28,.014]}),(0,o.jsx)("mesh",{geometry:a.yankoruma_metal_0.geometry,material:t.metal,position:[-1.641,.946,2.868],rotation:[-Math.PI/2,0,0],scale:[.01,.01,.159]}),(0,o.jsx)("mesh",{geometry:a.yankoruma_metal_0001.geometry,material:t.metal,position:[-1.641,.946,2.868],rotation:[-Math.PI/2,0,0],scale:[.01,.01,.159]}),(0,o.jsx)("mesh",{geometry:a.yankoruma_metal_0002.geometry,material:t.metal,position:[-1.641,.946,2.868],rotation:[-Math.PI/2,0,0],scale:[.01,.01,.159]}),(0,o.jsx)("mesh",{geometry:a.zincir_metal_0.geometry,material:t.metal,position:[-.001,.88,-6.258],rotation:[-1.56,-.031,-.149],scale:.004}),(0,o.jsx)("mesh",{geometry:a.zincir_metal_0001.geometry,material:t.metal,position:[-.001,.88,-6.258],rotation:[-1.56,-.031,-.149],scale:.004}),(0,o.jsx)("mesh",{geometry:a.zincirdeposu_fiberglass2_0.geometry,material:t.fiberglass2,position:[0,.863,-5.779],rotation:[-Math.PI/2,0,0],scale:[.103,.088,.009]}),(0,o.jsx)("mesh",{geometry:a.zincirmakara_metal_0.geometry,material:t.metal,position:[0,.869,-6.305],rotation:[-2.159,1.564,.59],scale:[.01,.01,.016]}),(0,o.jsx)("mesh",{geometry:a.zincirray_ahsap_0.geometry,material:t.ahsap,position:[0,.864,-6.113],rotation:[-Math.PI/2,0,0],scale:[.017,.181,.003]})]})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[975],{2975:function(e,t,n){n.r(t),n.d(t,{Model:function(){return o}});var r=n(7437);n(2265);var a=n(1106);let s=n(257).env.ASSET_PREFIX||"./";function o(e){let{nodes:t,materials:n}=(0,a.L)("".concat(s,"/boats/windsurf/assets/scene-transformed.glb"),"".concat(s,"/draco/"));return(0,r.jsx)("group",{...e,dispose:null,children:(0,r.jsx)("mesh",{geometry:t["body_Material_#30_0"].geometry,material:n.Material_30,position:[-.007,0,-.071],rotation:[-Math.PI/2,0,0],scale:.002})})}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{9927:function(e,t,a){var n={"./default/Scene.jsx":[2967,967],"./optimist/Scene.jsx":[6154,154],"./sailboat/Scene.jsx":[2274,274],"./ship/Scene.jsx":[5221,221],"./windsurf/Scene.jsx":[2975,975]};function r(e){if(!a.o(n,e))return Promise.resolve().then(function(){var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=n[e],r=t[0];return a.e(t[1]).then(function(){return a(r)})}r.keys=function(){return Object.keys(n)},r.id=9927,e.exports=r},7343:function(e,t,a){Promise.resolve().then(a.bind(a,1725))},1725:function(e,t,a){"use strict";a.r(t),a.d(t,{VIEW_MODES:function(){return ts},default:function(){return tc}});var n=a(7437),r=a(2265),i=a(376),o=a.n(i),l=e=>{let{path:t}=e,[a,i]=(0,r.useState)([]),[o,l]=(0,r.useState)(null),s=(0,r.useRef)(null);return(0,r.useEffect)(()=>{(async()=>{try{let e=await fetch("".concat(t,"/index.json"));if(!e.ok)throw Error("Network response was not ok");let a=await e.json();i(a),a.length>0&&l(a[0])}catch(e){console.error("Error fetching PDF files:",e)}})()},[t]),(0,n.jsxs)("div",{className:"flex flex-col h-full",ref:s,children:[(0,n.jsx)("div",{className:"bg-oGray2 text-white p-4 flex space-x-4",children:a.map((e,t)=>(0,n.jsx)("button",{className:"px-4 py-2 rounded-t ".concat((null==o?void 0:o.file)===e.file?"bg-oGray font-bold":"hover:bg-oGray"),onClick:()=>l(e),children:e.title},t))}),(0,n.jsx)("div",{className:"flex-grow bg-oGray2 text-white p-4 flex items-center justify-center",children:o&&(0,n.jsx)("iframe",{src:"".concat(t,"/").concat(o.file),title:"PDF Viewer",width:"100%",height:"100%",style:{border:"none"}})})]})};class s{isLocalStorageAvailable(){try{return"undefined"!=typeof localStorage}catch(e){return!1}}loadConfig(){if(this.isLocalStorageAvailable()){let e=localStorage.getItem(this.configKey);if(!e)return this.saveConfig(this.defaultConfig),{...this.defaultConfig};try{return JSON.parse(e)}catch(e){return console.error("Failed to parse stored configuration:",e),{...this.defaultConfig}}}return{...this.inMemoryConfig}}saveConfig(e){this.config={...this.config,...e},this.isLocalStorageAvailable()?localStorage.setItem(this.configKey,JSON.stringify(this.config)):this.inMemoryConfig={...this.config}}get(e){return this.config[e]}set(e,t){this.config[e]=t,this.saveConfig(this.config)}resetConfig(){this.config={...this.defaultConfig},this.isLocalStorageAvailable()?localStorage.setItem(this.configKey,JSON.stringify(this.config)):this.inMemoryConfig={...this.defaultConfig}}getAll(){return{...this.config}}getDefaultConfig(){return{...this.defaultConfig}}getSelectedBoat(){let e=this.config.selectedBoat;return e&&this.boats.find(t=>t.name===e)||null}getComputedSignalKUrl(){return this.config.debugMode?"https://demo.signalk.org:443":"".concat(window.location.protocol,"//").concat(window.location.hostname).concat(window.location.port?":"+window.location.port:"")}async fetchBoats(){try{let e=await fetch("boats/boats.json"),t=await e.json();return this.boats=t.boats||[],this.boats}catch(e){return console.error("Error fetching boats:",e),[]}}constructor(){this.defaultConfig={signalkUrl:"https://demo.signalk.org:443",username:"",password:"",debugMode:!1,selectedBoat:"Default",primaryColor:null,metallicEffect:!1},this.configKey="ocearoConfig",this.inMemoryConfig={...this.defaultConfig},this.config=this.loadConfig()}}let c=new s;var u=e=>{var t;let{onSave:a}=e,i=c.getAll(),o=c.getComputedSignalKUrl(),[l,s]=(0,r.useState)(i),[u,d]=(0,r.useState)(!!i.username||!!i.password),[h,m]=(0,r.useState)(!1),[g,f]=(0,r.useState)([]),[x,p]=(0,r.useState)(null),[v,b]=(0,r.useState)(!1),j=(0,r.useCallback)(e=>{b(JSON.stringify(e)!==JSON.stringify(i))},[i]);(0,r.useEffect)(()=>{(async()=>{let e=c.getAll();s(e);let t=await c.fetchBoats();f(t),e.selectedBoat&&p(t.find(t=>t.name===e.selectedBoat)||null)})()},[]);let y=e=>{let t={...l,...e};s(t),j(t)},w=()=>{let e={...l};h?u||(e.username="",e.password=""):(e.signalkUrl=o,e.username="",e.password=""),c.saveConfig(e),null==a||a(e),b(!1)};return(0,n.jsxs)("div",{className:"p-4 text-white",children:[v&&(0,n.jsxs)("div",{className:"bg-oBlue text-white px-4 py-2 rounded mb-4 flex justify-between items-center",children:[(0,n.jsx)("span",{children:"You have unsaved changes"}),(0,n.jsx)("button",{onClick:w,className:"bg-white text-black px-3 py-1 rounded text-sm hover:bg-gray-100",children:"Save Now"})]}),(0,n.jsx)("h1",{className:"text-2xl font-bold mb-4",children:"Ocearo Configuration"}),(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)("h2",{className:"text-xl font-semibold",children:"Connection Settings"}),(0,n.jsx)("div",{children:(0,n.jsxs)("label",{className:"flex items-center",children:[(0,n.jsx)("input",{type:"checkbox",className:"mr-2",checked:h,onChange:e=>{m(e.target.checked),j(l)}}),"Set SignalK URL",!h&&(0,n.jsxs)("span",{className:"ml-2",children:["(",o,")"]})]})}),h&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block font-medium mb-1",children:"SignalK Server URL:"}),(0,n.jsx)("input",{type:"text",className:"border p-2 w-full text-black rounded",value:l.signalkUrl||"",onChange:e=>y({signalkUrl:e.target.value})})]}),(0,n.jsx)("div",{children:(0,n.jsxs)("label",{className:"flex items-center",children:[(0,n.jsx)("input",{type:"checkbox",className:"mr-2",checked:u,onChange:e=>{d(e.target.checked),j(l)}}),"Use Authentication"]})}),u&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block font-medium mb-1",children:"Username:"}),(0,n.jsx)("input",{type:"text",className:"border p-2 w-full text-black rounded",value:l.username||"",onChange:e=>y({username:e.target.value})})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block font-medium mb-1",children:"Password:"}),(0,n.jsx)("input",{type:"password",className:"border p-2 w-full text-black rounded",value:l.password||"",onChange:e=>y({password:e.target.value})})]})]})]})]}),(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)("h2",{className:"text-xl font-semibold",children:"Vessel Settings"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block font-medium mb-1",children:"Select Vessel:"}),(0,n.jsxs)("select",{className:"border p-2 w-full text-black rounded",value:l.selectedBoat||"",onChange:e=>{let t=e.target.value;p(g.find(e=>e.name===t)||null),y({selectedBoat:t})},children:[(0,n.jsx)("option",{value:"",children:"-- Select a Vessel --"}),g.map(e=>(0,n.jsx)("option",{value:e.name,children:e.name},e.name))]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"block font-medium mb-1",children:"Vessel Color:"}),(0,n.jsx)("input",{type:"color",className:"w-full h-10 rounded",value:l.primaryColor||"#000000",onChange:e=>y({primaryColor:e.target.value})})]}),(0,n.jsx)("div",{children:(0,n.jsxs)("label",{className:"flex items-center",children:[(0,n.jsx)("input",{type:"checkbox",className:"mr-2",checked:l.metallicEffect||!1,onChange:e=>y({metallicEffect:e.target.checked})}),"Enable Metallic Effect"]})})]}),(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)("h2",{className:"text-xl font-semibold",children:"Advanced Settings"}),(0,n.jsx)("div",{children:(0,n.jsxs)("label",{className:"flex items-center",children:[(0,n.jsx)("input",{type:"checkbox",className:"mr-2",checked:l.debugMode||!1,onChange:e=>y({debugMode:e.target.checked,signalkUrl:o})}),"Debug Mode"]})}),x&&l.debugMode&&(0,n.jsxs)("div",{className:"space-y-2 text-sm text-gray-400",children:[(0,n.jsxs)("div",{children:["3D Model: ",x.modelPath]}),(0,n.jsxs)("div",{children:["Features: ",null===(t=x.capabilities)||void 0===t?void 0:t.join(", ")]})]})]}),(0,n.jsxs)("div",{className:"flex space-x-4 pt-4",children:[(0,n.jsx)("button",{onClick:w,className:"bg-oBlue text-white px-4 py-2 rounded hover:bg-blue-600",children:"Save Configuration"}),(0,n.jsx)("button",{onClick:()=>{let e=c.getDefaultConfig();s(e),d(!1),m(!1),c.saveConfig(e),b(!1)},className:"bg-oRed text-white px-4 py-2 rounded hover:bg-red-600",children:"Reset Configuration"})]})]})]})},d=a(4578),h=a(2079);let m=(0,r.createContext)(),g="#09bfff",f="#cc000c",x="#0fcd4f",p=e=>null!=e?Math.round((e-273.15)*10)/10:null,v=e=>null!=e?Math.round(19.4384*e)/10:null,b={wind:{"environment.wind.angleTrueWater":h.M8C.degToRad(25),"environment.wind.speedTrue":20,"environment.wind.angleApparent":h.M8C.degToRad(23),"environment.wind.speedApparent":25},temperature:{"environment.water.temperature":290.15,"environment.outside.temperature":294.15,"propulsion.main.exhaustTemperature":368.15,"environment.inside.fridge.temperature":277.15},environment:{"environment.outside.pressure":102300,"environment.inside.relativeHumidity":.74,"environment.inside.voc":.03},performance:{"performance.beatAngle":h.M8C.degToRad(45),"performance.gybeAngle":h.M8C.degToRad(135),"performance.beatAngleVelocityMadeGood":6,"performance.gybeAngleVelocityMadeGood":5,"performance.targetAngle":h.M8C.degToRad(45),"performance.polarSpeed":8,"performance.polarSpeedRatio":.95,"performance.velocityMadeGood":5,"performance.polarVelocityMadeGood":6,"performance.polarVelocityMadeGoodRatio":.9},navigation:{"navigation.speedThroughWater":7,"navigation.headingTrue":h.M8C.degToRad(0),"navigation.courseOverGround":h.M8C.degToRad(20),"navigation.courseGreatCircle.nextPoint.bearingTrue":h.M8C.degToRad(30),"navigation.attitude.roll":h.M8C.degToRad(5)},racing:{"navigation.racing.layline":h.M8C.degToRad(10),"navigation.racing.layline.distance":100,"navigation.racing.layline.time":180,"navigation.racing.oppositeLayline":h.M8C.degToRad(45),"navigation.racing.oppositeLayline.distance":80,"navigation.racing.oppositeLayline.time":180,"navigation.racing.startLineStb":{latitude:0,longitude:0,altitude:0},"navigation.racing.startLinePort":{latitude:0,longitude:0,altitude:0},"navigation.racing.distanceStartline":50,"navigation.racing.timeToStart":120,"navigation.racing.timePortDown":60,"navigation.racing.timePortUp":70,"navigation.racing.timeStbdDown":65,"navigation.racing.timeStbdUp":75}},j=e=>{let{children:t}=e,[a,i]=(0,r.useState)({}),[o,l]=(0,r.useState)(!1),[s,u]=(0,r.useState)({autopilot:!0,anchorWatch:!1,parkingMode:!1,mob:!1,showOcean:!1,ais:!1}),g=(0,r.useRef)(null),f=(0,r.useRef)(null);return(0,r.useEffect)(()=>{let e=async()=>{let e=new Date,t=e.getFullYear(),a=(e.getMonth()+1).toString().padStart(2,"0"),n="tides/larochelle/".concat(a,"_").concat(t,".json"),r=await fetch(n);if(r.ok){let t=await r.json(),a=e.toISOString().split("T")[0];if(t[a]){let e=null,n=null,r=new Date,o=60*r.getHours()+r.getMinutes();if(t[a].forEach(t=>{let[a,r,i,l]=t,[s,c]=r.split(":").map(Number),u=60*s+c;"tide.high"===a&&(!e||Math.abs(o-u)<Math.abs(o-e.timeInMinutes))?e={height:parseFloat(i),time:r,timeInMinutes:u,coef:l}:"tide.low"===a&&(!n||Math.abs(o-u)<Math.abs(o-n.timeInMinutes))&&(n={height:parseFloat(i),time:r,timeInMinutes:u})}),e&&n){let t="".concat(r.getHours().toString().padStart(2,"0"),":").concat(r.getMinutes().toString().padStart(2,"0")),a=w(e.height,n.height,t,e.time,n.time);i(t=>({...t,"environment.tide.heightNow":a,"environment.tide.heightHigh":e.height,"environment.tide.heightLow":n.height,"environment.tide.timeLow":n.time,"environment.tide.timeHigh":e.time,"environment.tide.coeffNow":e.coef}))}else throw Error("Tide data for today is incomplete.")}}else console.warn("No tide data found")};return(async()=>{let e=c.getAll(),{signalkUrl:t,debugMode:a}=e;try{let[a,n]=t.replace(/https?:\/\//,"").split(":"),r=new d.default({hostname:a||"localhost",port:parseInt(n)||3e3,useTLS:t.startsWith("https"),reconnect:!0,autoConnect:!1,notifications:!1,deltaStreamBehaviour:"self",sendMeta:"all",wsKeepaliveInterval:10});g.current=r,await r.connect(),r.on("delta",e=>{e.updates.forEach(e=>{e.values&&e.values.forEach(e=>{i(t=>({...t,[e.path]:e.value}))})})}),e.debugMode&&(f.current=setInterval(()=>{let e=Math.floor(91*Math.random())-45;i(t=>({...t,"steering.rudderAngle":h.M8C.degToRad(e),...b.wind,...b.temperature,...b.environment,...b.performance,...b.navigation,...b.racing}))},5e3))}catch(e){console.error("Failed to connect to SignalK:",e)}})(),e(),()=>{g.current&&g.current.disconnect(),f.current&&clearInterval(f.current)}},[]),(0,n.jsx)(m.Provider,{value:{getSignalKValue:e=>a[e]||null,nightMode:o,setNightMode:l,states:s,toggleState:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;u(a=>({...a,[e]:void 0!==t?t:!a[e]}))}},children:t})},y=()=>(0,r.useContext)(m),w=function(e,t,a,n,r){let i,o,l,s;let c=e=>{let[t,a]=e.split(":").map(Number);return 60*t+a},u=c(n),d=c(r),h=c(a),m=!1;d<=h&&h<=u?(m=!0,i=t,o=e,l=d,s=u):(i=e,o=t,l=u,s=d+(d<u?1440:0));let g=Math.abs(s-l),f=Math.abs(o-i),x=h-l;x<0&&(x+=1440);let p=f/12,v=0;return v=x<=g/6?p*Math.ceil(x/(g/12)):x<=2*g/6?2*p+p*Math.ceil((x-g/6)/(g/12)):x<=3*g/6?5*p:x<=4*g/6?8*p:x<=5*g/6?10*p:f,m?i+v:i-v},M={latitude:46.1591,longitude:-1.1522},N={navigation:e=>"".concat(e,"/@signalk/freeboard-sk/"),instrument:e=>"".concat(e,"/@mxtommy/kip/"),netflix:()=>"https://www.netflix.com",battery:e=>e.replace(":3000",":3001")+"/grafana",webcam1:()=>"https://pv.viewsurf.com/2080/Chatelaillon-Port?i=NzU4Mjp1bmRlZmluZWQ",webcam2:()=>"https://pv.viewsurf.com/1478/Chatelaillon-Plage&lt?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=".concat(t.latitude,"&lon=").concat(t.longitude,"&message=true")};var S=e=>{let{view:t}=e,{getSignalKValue:a}=y(),[i,o]=(0,r.useState)(null),[s,d]=(0,r.useState)(null),{signalkUrl:h}=c.getAll();(0,r.useEffect)(()=>{let e=()=>{try{let e=a("navigation.position")||M;o(t=>t?Math.abs(t.latitude-e.latitude)>.01||Math.abs(t.longitude-e.longitude)>.01?e:t:e),d(null)}catch(e){d("Error fetching position data"),console.error("Position fetch error:",e)}};e();let t=setInterval(e,1e4);return()=>clearInterval(t)},[a]);let m=(0,r.useMemo)(()=>{let e=N[t];if(!e)return null;try{return e(h,i)}catch(e){return console.error("Error generating URL:",e),d("Error generating application URL"),null}},[t,i,h]);return(0,n.jsx)("div",{className:"flex flex-col w-full h-full",children:(()=>{if(s)return(0,n.jsx)("div",{className:"text-red-500 p-4",children:s});switch(t){case"manual":return(0,n.jsx)(l,{path:"boats/default/docs"});case"settings":return(0,n.jsx)(u,{});default:return m&&(0,n.jsx)("iframe",{className:"flex-grow border-none",src:m,title:"External Application",onError:()=>d("Failed to load external content")})}})()})},C=a(1268),P=a(5217);let k={waterTemp:{key:"waterTemp",path:"environment.water.temperature",icon:P.L02,label:"Water Temperature",format:e=>"".concat(e,"\xb0C"),transform:p},airTemp:{key:"airTemp",path:"environment.outside.temperature",icon:P.whq,label:"Air Temperature",format:e=>"".concat(e,"\xb0C"),transform:p},exhaustTemp:{key:"exhaustTemp",path:"propulsion.main.exhaustTemperature",icon:P.Rpv,label:"Exhaust Temperature",format:e=>"".concat(e,"\xb0C"),transform:p},fridgeTemp:{key:"fridgeTemp",path:"environment.inside.fridge.temperature",icon:P.jOV,label:"Fridge Temperature",format:e=>"".concat(e,"\xb0C"),transform:p}},R=e=>{let{mode:t,value:a,icon:r,nightMode:i}=e;return a||0===a?(0,n.jsxs)("div",{className:"flex items-center text-2xl ".concat(i?"text-red-500":"text-white"),children:[(0,n.jsx)(C.G,{icon:r,className:"mr-2"}),(0,n.jsx)("span",{children:k[t].format(a)})]}):null};var I=()=>{let{nightMode:e,getSignalKValue:t}=y(),[a,i]=(0,r.useState)([]),[o,l]=(0,r.useState)(null),s=(0,r.useMemo)(()=>Object.entries(k).reduce((e,a)=>{let[n,r]=a,i=t(r.path);return e[n]=null!==i?r.transform(i):null,e},{}),[t]);(0,r.useEffect)(()=>{let e=Object.entries(s).filter(e=>{let[t,a]=e;return null!==a}).map(e=>{let[t]=e;return t});i(e),e.length>0&&!e.includes(o)&&l(e[0])},[s,o]);let c=()=>{if(a.length<=1)return;let e=(a.indexOf(o)+1)%a.length;l(a[e])};return 0===a.length?(0,n.jsx)("div",{className:"text-2xl ".concat(e?"text-red-500":"text-white"),children:(0,n.jsx)("span",{children:"NA"})}):(0,n.jsx)("div",{className:"cursor-pointer flex items-center space-x-2",onClick:c,title:"Toggle Temperature Display (".concat(a.length," sensors available)"),role:"button",tabIndex:0,onKeyPress:e=>"Enter"===e.key&&c(),"aria-label":o?k[o].label:"No temperature data available",children:o&&(0,n.jsx)(R,{mode:o,value:s[o],icon:k[o].icon,nightMode:e})})};let _={pressure:{key:"pressure",path:"environment.outside.pressure",icon:P.uM9,format:e=>"".concat(e," hPa"),transform:e=>null!=e?Math.round(e/100*10)/10:null},humidity:{key:"humidity",path:"environment.inside.relativeHumidity",icon:P.Zkk,format:e=>"".concat(e.toFixed(1),"%"),transform:e=>100*e},voc:{key:"voc",path:"environment.inside.voc",icon:P.DSs,format:e=>"".concat(e," ppm"),transform:e=>e}},T=e=>{let{mode:t,value:a,icon:r,nightMode:i}=e;return a||0===a?(0,n.jsxs)("div",{className:"flex items-center text-2xl ".concat(i?"text-red-500":"text-white"),children:[(0,n.jsx)(C.G,{icon:r,className:"mr-2"}),(0,n.jsx)("span",{children:_[t].format(a)})]}):null};var E=()=>{let{nightMode:e,getSignalKValue:t}=y(),[a,i]=(0,r.useState)([]),[o,l]=(0,r.useState)(null),s=(0,r.useMemo)(()=>Object.entries(_).reduce((e,a)=>{let[n,r]=a,i=t(r.path);return e[n]=null!==i?r.transform(i):null,e},{}),[t]);(0,r.useEffect)(()=>{let e=Object.entries(s).filter(e=>{let[t,a]=e;return null!==a}).map(e=>{let[t]=e;return t});i(e),e.length>0&&!e.includes(o)&&l(e[0])},[s,o]);let c=()=>{if(a.length<=1)return;let e=(a.indexOf(o)+1)%a.length;l(a[e])};return 0===a.length?(0,n.jsx)("div",{className:"text-2xl ".concat(e?"text-red-500":"text-white"),children:(0,n.jsx)("span",{children:"NA"})}):(0,n.jsx)("div",{className:"cursor-pointer flex items-center space-x-2",onClick:c,title:"Toggle Environmental Display (".concat(a.length," modes available)"),role:"button",tabIndex:0,onKeyPress:e=>"Enter"===e.key&&c(),children:o&&(0,n.jsx)(T,{mode:o,value:s[o],icon:_[o].icon,nightMode:e})})};let A=e=>{let{icon:t,onClick:a,label:r,textColor:i}=e;return(0,n.jsx)("button",{onClick:a,className:"".concat(i," text-2xl flex items-center justify-center hover:text-gray-300 transition-colors duration-200"),"aria-label":r,children:(0,n.jsx)(C.G,{icon:t})})};var G=e=>{let{setRightView:t,toggleSettings:a,toggleAppMenu:r}=e,{nightMode:i}=y(),o=i?"text-oNight":"text-white",l=[{section:"left",items:[{icon:P.lnS,onClick:()=>a(),label:"Settings"}]},{section:"center",items:[{icon:P.tLL,onClick:()=>t("navigation"),label:"Navigation"},{icon:P.S9Y,onClick:()=>t("weather"),label:"Weather"},{icon:P.szN,onClick:r,label:"App Menu"},{icon:P.iGi,onClick:()=>t("manual"),label:"Manual"},{icon:P.HLz,onClick:()=>t("instrument"),label:"Instrument"}]}],s=e=>{let t=l.find(t=>t.section===e);return t?t.items.map((t,a)=>(0,n.jsx)(A,{icon:t.icon,onClick:t.onClick,label:t.label,textColor:o},"".concat(e,"-").concat(a))):null};return(0,n.jsxs)("div",{className:"flex items-center justify-between w-full h-full bg-black px-4",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-10",children:[s("left"),(0,n.jsx)(I,{})]}),(0,n.jsx)("div",{className:"flex items-center justify-center space-x-10",children:s("center")}),(0,n.jsx)("div",{className:"flex items-center space-x-10",children:(0,n.jsx)(E,{})})]})},O=e=>{let{currentViewMode:t,toggleViewMode:a,handleSetRightView:r,toggleFullscreen:i,setShowAppMenu:o}=e,l=e=>{let{icon:t,label:a,onClick:r}=e;return(0,n.jsxs)("button",{onClick:()=>{r(),o(!1)},className:"flex items-center text-white p-2 rounded-md hover:bg-gray-700 transition",children:[(0,n.jsx)(C.G,{icon:t,className:"mr-2"})," ",a]})};return(0,n.jsx)("div",{className:"fixed bottom-20 left-1/2 transform -translate-x-1/2 bg-black p-6 rounded-lg shadow-lg z-50 w-200",children:(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[t!==ts.SPLIT&&(0,n.jsx)(l,{icon:P.TL5,label:"Split View",onClick:()=>a(ts.SPLIT)}),t!==ts.APP&&(0,n.jsx)(l,{icon:P.TL5,label:"Full View",onClick:()=>a(ts.APP)}),t!==ts.BOAT&&(0,n.jsx)(l,{icon:P.lnS,label:"Boat View",onClick:()=>a(ts.BOAT)}),(0,n.jsx)(l,{icon:P.iGi,label:"Manual",onClick:()=>r("manual")}),(0,n.jsx)(l,{icon:P.HLz,label:"Instruments",onClick:()=>r("instrument")}),(0,n.jsx)(l,{icon:P.IyC,label:"Webcam",onClick:()=>r("webcam1")}),(0,n.jsx)(l,{icon:P.tLL,label:"Navigation",onClick:()=>r("navigation")}),(0,n.jsx)(l,{icon:P.Kb6,label:"Settings",onClick:()=>r("settings")}),(0,n.jsx)(l,{icon:P.S9Y,label:"Weather",onClick:()=>r("weather")}),(0,n.jsx)(l,{icon:P.RoX,label:"Battery",onClick:()=>r("battery")}),(0,n.jsx)(l,{icon:P.TL5,label:"Toggle Fullscreen",onClick:i}),(0,n.jsx)(l,{icon:P.d8e,label:"Refresh Page",onClick:()=>{window.location.reload()}})]})})},L=a(6496),F=a(8328),D=a(4725),z=a(5903),W=a(5550),B=a(8124),U=a(1106);function H(e,t,a){return e/1.9438444924574*Math.pow(t/10,a)*1.9438444924574}var V=a(3359),K=a(1378),Y=a(262),q=new WeakMap,X=new WeakMap;class Z{calcShape(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;(0,Y._)(this,X,[]);let t=this.chordTackLevel/((0,V._)(this,q)[(0,V._)(this,q).length-1].x-(0,V._)(this,q)[0].x);for(let a of(0,V._)(this,q)){let n=a.clone().multiplyScalar(t);1!==e&&(n.y*=e),(0,V._)(this,X).push(n)}let a=new h.FM8(0,0);for(let e of(0,V._)(this,X))e.y>a.y&&(a=e);this.draftDepth=a.y,this.draftPosition=a.x,this.girth=0;let n=null;for(let e of(0,V._)(this,X))null!==n&&(this.girth+=e.distanceTo(n)),n=e;this.sag=this.chordTackLevel-this.girth,this.entryAngleRad=(0,V._)(this,X)[1].clone().sub((0,V._)(this,X)[0]).angle(),this.exitAngleRad=(0,V._)(this,X)[(0,V._)(this,X).length-1].clone().sub((0,V._)(this,X)[(0,V._)(this,X).length-2]).angle()-2*Math.PI,this.mastAngleRad=this.calcMastAngle(),this.forceAngleRad=(this.entryAngleRad+this.exitAngleRad)/2,this.draftDepthRatio=this.draftDepth/this.chordTackLevel,this.draftPositionRatio=this.draftPosition/this.chordTackLevel}calcMastAngle(){let e=0,t=null,a=this.mastWidth*this.chordTackLevel/this.chordMastTop;for(let n of(0,V._)(this,X)){if(null!==t&&(e+=n.distanceTo(t))>=a)return n.angle();t=n}return NaN}getVerticesAngles(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=(this.girth-t)/(e-1),r=0,i=0,o=[],l=null;for(let s of(0,V._)(this,X)){if(null!==l&&(((i+=s.distanceTo(l))>=r*n+t||a&&i>a)&&(r++,o.push(s.angle())),r>=e))break;l=s}return o}pointAtGirthDistance(e){let t=0,a=null;for(let n of(0,V._)(this,X))if(null!==a&&(t+=n.distanceTo(a)),a=n,t>=e)return a.clone()}constructor(e,t,a,n=1){(0,K._)(this,q,{writable:!0,value:void 0}),(0,K._)(this,X,{writable:!0,value:void 0}),(0,Y._)(this,q,[]),(0,Y._)(this,X,[]),this.chordMastTop=t,this.chordTackLevel=e,this.mastWidth=a;let r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new h.FM8(t*e**2,2*t*e)},i=1.001+.95*(n-1)/10,o=(i-.001)/1e3,l=r(.001),s=r(i).clone().sub(l).angle(),c=new h.FM8(0,0);for(let e=.001;e<=i;e+=o){let t=r(e);t.sub(l),t.rotateAround(c,-s),(0,V._)(this,q).push(t)}this.calcShape(1-.25*(n-1)/10)}}let J=Math.floor(20),Q=Math.ceil(160),$={waterlineToMastFootHeight:.45,maxMastRotation:Math.PI/2,maxChordRotationPerSailLevel:Math.PI/3*2};var ee=e=>{let{windParams:t={speed:5,hellman:.27},boatParams:a={mastrotation:0,heading:130,speed:5},sailParams:i={mastArea:0,sailArea:0,cunningham:1,angleOfAttack:20}}=e,{getSignalKValue:o}=y(),l=(0,r.useRef)(),s=(0,r.useRef)(null),c=(0,r.useRef)(0),u=(0,r.useRef)(null),d=(0,r.useRef)(null),m=(0,r.useRef)(),f=(0,r.useRef)({}),x=(0,r.useMemo)(()=>{let e=new h.ZAu,t=new h.b_z(.1,.2,12),a=new h.Wid({color:g,opacity:.5,transparent:!0}),n=new h.Kj0(t,a);return n.position.set(0,-.1,0),e.add(n),e},[]);(0,r.useEffect)(()=>{let e=new h.ZAu,t={};for(let a=0;a<8;a+=.5){let n=x.clone();n.position.set(0,a,0),t[2*a]=n,e.add(n)}return e.position.set(0,0,0),m.current&&m.current.add(e),f.current=t,()=>{e.clear()}},[x]);let p=(e,t)=>{let a=f.current;if(!a){console.error("apparentWindField is not initialized.");return}for(let n=0;n<8;n+=.5){let r=H(e,n,t),i=a[2*n];if(!i){console.warn("Apparent wind field cone at height ".concat(n," is not defined."));continue}i.scale.set(.1*r,r,.1*r),i.rotation.set(0,-Math.PI,Math.PI/2)}},{geometry:v,sailClipWidthPerLevel:b}=(0,r.useMemo)(()=>{let e=new h.u9r,t=[],a=[],n=[];for(let e=0;e<=Q;e++){let r,i;let o=Math.min(50*e,8e3);o<900?(r=3600,i=3800+-200*o/900):i=r=3600-3210*(o-900)/7100+600*Math.sin((o-900)/7100*Math.PI);let l=0;for(let n=0;n<J;n++){let s=r/(J-1),c=s*n-i,u=s;c>.1&&(u=c>s?0:s-c),t.push(0===n?0:(l+u)/1e3,o/1e3,0),l=0===n?0:l+u;let d=Math.floor(Q/10);a.push(...e%d==0?[.8,0,.047]:[.596,.596,.596])}n.push(i===r?null:i)}let r=[];for(let e=0;e<Q;e++)for(let t=1;t<J;t++){let a=e*J+t;r.push(a-1,a,a+J-1,a,a+J,a+J-1)}return e.setAttribute("position",new h.a$l(t,3)),e.setAttribute("color",new h.a$l(a,3)),e.setIndex(r),e.computeVertexNormals(),{geometry:e,sailClipWidthPerLevel:n}},[]),j=(0,r.useMemo)(()=>o("environment.wind.angleApparent")||0,[o]),w=(0,r.useMemo)(()=>o("environment.wind.speedApparent")||0,[o]);return(0,r.useEffect)(()=>{if(!l.current)return;p(w,t.hellman);let e=j>Math.PI&&j<=2*Math.PI,n=l.current.geometry,r=n.attributes.position.array;i.cunningham!==u.current&&(d.current=new Z(3600,390,200,i.cunningham),u.current=i.cunningham),s.current||(s.current=n.clone());let o=1e3*$.waterlineToMastFootHeight,m=e?-1:1,g=h.M8C.degToRad(i.angleOfAttack),f=Math.abs(j),x=d.current.mastAngleRad;f<.01&&(g=0);let v=Math.min(f-g+x,$.maxMastRotation),y=new h.Pa4(0,1,0),M=null;for(let e=0;e<=Q;e++){let a=Math.abs({awa:j,aws:H(w,(50*e+o)/1e3,t.hellman)}.awa)-g;a<0?a=0:a>Math.PI/2&&(a=Math.PI/2);let n=a-v;M&&n-M>$.maxChordRotationPerSailLevel&&(n=M+$.maxChordRotationPerSailLevel),M=n;let i=b[e],l=d.current.getVerticesAngles(J,200,i);for(let t=1;t<J;t++){let a=(e*J+t)*3,i=new h.Pa4(s.current.attributes.position.array[a],s.current.attributes.position.array[a+1],s.current.attributes.position.array[a+2]);i.applyAxisAngle(y,-(n+l[t])*m),r[a]=i.x,r[a+1]=i.y,r[a+2]=i.z}}n.attributes.position.needsUpdate=!0;let N={...a,mastrotation:v*m};l.current&&l.current.rotateY(c.current-N.mastrotation),c.current=N.mastrotation},[w,j,t.hellman,i.cunningham,i.angleOfAttack,a,b]),(0,n.jsxs)("mesh",{ref:l,position:[0,2,-1],rotation:[0,-Math.PI/2,0],children:[(0,n.jsx)("bufferGeometry",{...v}),(0,n.jsx)("group",{ref:m}),(0,n.jsx)("meshBasicMaterial",{vertexColors:!0,transparent:!0,opacity:.7,side:h.ehD})]})};let et=a(257).env.ASSET_PREFIX||"./",ea=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return"".concat(et,"/boats/").concat(e,"/assets/scene-transformed.glb")},en=(0,r.forwardRef)((e,t)=>{let{showSail:a=!1,...i}=e,o=(0,r.useRef)(),l=(0,r.useRef)(),{getSignalKValue:s}=y(),u=(0,r.useMemo)(()=>c.getAll(),[]),d=(0,r.useMemo)(()=>{let e=c.getSelectedBoat();return null!=e?e:{name:"Default",modelPath:"default",capabilities:["navigation","rudder","sail","color"]}},[]),m=(0,r.useMemo)(()=>ea(d.modelPath),[d]),g=(null==d?void 0:d.capabilities)||[],{nodes:f,materials:x}=(0,U.L)(m,"".concat(et,"/draco/")),p=(0,r.useMemo)(()=>({primaryColor:u.primaryColor,metallicEffect:u.metallicEffect||!1}),[u.primaryColor,u.metallicEffect]);(0,r.useEffect)(()=>{(null==x?void 0:x.fiberglass)&&(x.fiberglass.color.set(p.primaryColor),x.fiberglass.metalness=p.metallicEffect?1:0,x.fiberglass.roughness=p.metallicEffect?.2:1,Object.values(x).forEach(e=>{e.map&&(e.map.minFilter=h.wem,e.map.magFilter=h.wem,e.map.anisotropy=1)}))},[x,p]);let v=(0,r.useMemo)(()=>new h.yGw,[]),b=(0,r.useMemo)(()=>new h.Pa4(1,0,0),[]);(0,B.F)(()=>{if(!o.current)return;let e=s("navigation.attitude.roll")||0,t=s("steering.rudderAngle")||0;o.current.rotation.z!==e&&(o.current.rotation.z=e),l.current&&(v.makeRotationFromEuler(new h.USm(-Math.PI/2,Math.PI/2,0)),l.current.setRotationFromMatrix(v),l.current.rotateOnAxis(b,-h.M8C.degToRad(180*t/Math.PI)))});let j=(0,r.useMemo)(()=>{let e={Default:()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("mesh",{geometry:f.baba_metal_0.geometry,material:x.metal,position:[.24,.895,-5.546],rotation:[-Math.PI/2,0,1.968],scale:.027}),(0,n.jsx)("mesh",{geometry:f.camadadirek_fiberglass_0.geometry,material:x.fiberglass,position:[0,5.267,-3.711],rotation:[2.054,0,Math.PI],scale:[-.042,.042,4.707]}),(0,n.jsx)("mesh",{geometry:f.camadanyelkeni_bez_0.geometry,material:x.mcaterial,position:[0,5.267,-3.711],rotation:[2.054,0,Math.PI],scale:[-.042,.042,4.707]}),(0,n.jsx)("mesh",{geometry:f.camadaonbaglay_metal_0.geometry,material:x.metal,position:[0,.891,-5.958],rotation:[-Math.PI/2,0,0],scale:.02}),(0,n.jsx)("mesh",{geometry:f.capa_metal_0.geometry,material:x.metal,position:[0,.671,-6.173],rotation:[-Math.PI/2,0,0],scale:.348}),(0,n.jsx)("mesh",{geometry:f.direk_fiberglass_0.geometry,material:x.fiberglass,position:[0,4.315,-1.056],rotation:[Math.PI/2,0,Math.PI],scale:[-.113,.113,5.203]}),(0,n.jsx)("mesh",{geometry:f.duman_ahsap_0.geometry,material:x.ahsap,position:[-.011,.854,3.487],rotation:[Math.PI,0,Math.PI/2],scale:[.045,.045,.011]}),(0,n.jsx)("mesh",{geometry:f.dumenyuvasi_ahsap_0.geometry,material:x.ahsap,position:[-.011,.299,3.441],rotation:[-Math.PI/2,0,1.571],scale:.094}),(0,n.jsx)("mesh",{geometry:f.dumenyuvasi_cam_0.geometry,material:x.material_5,position:[-.011,.299,3.441],rotation:[-Math.PI/2,0,1.571],scale:.094}),(0,n.jsx)("mesh",{geometry:f.dumenyuvasi_fiberglass_0.geometry,material:x.fiberglass,position:[-.011,.299,3.441],rotation:[-Math.PI/2,0,1.571],scale:.094}),(0,n.jsx)("mesh",{geometry:f.govde_fiberglass2_0.geometry,material:x.fiberglass2,position:[0,.32,-.897],rotation:[0,Math.PI/2,0],scale:[5.11,.454,1.212]}),(0,n.jsx)("mesh",{geometry:f.govde_fiberglass_0.geometry,material:x.fiberglass,position:[0,.32,-.897],rotation:[0,Math.PI/2,0],scale:[5.11,.454,1.212]}),(0,n.jsx)("mesh",{geometry:f.govde_metal_0.geometry,material:x.metal,position:[0,.32,-.897],rotation:[0,Math.PI/2,0],scale:[5.11,.454,1.212]}),(0,n.jsx)("mesh",{geometry:f.halattutucu_fiberglass2_0.geometry,material:x.fiberglass2,position:[-1.044,.939,1.809],rotation:[-Math.PI/2,0,0],scale:[.016,.059,.016]}),(0,n.jsx)("mesh",{geometry:f.ip001_metal_0.geometry,material:x.metal,position:[-.231,7.608,-.621],rotation:[-2.322,.222,-1.556],scale:[.007,.007,.011]}),(0,n.jsx)("mesh",{geometry:f.pervan_fiberglass_0.geometry,material:x.fiberglass,position:[0,-1.005,1.561],rotation:[-Math.PI/2,Math.PI/2,0],scale:[.154,.094,.104]}),(0,n.jsx)("mesh",{geometry:f.pervane_metal_0.geometry,material:x.metal,position:[0,-1.122,1.75],scale:.034}),(0,n.jsx)("mesh",{ref:l,geometry:f.rudder_fiberglass_0.geometry,material:x.fiberglass,position:[0,-1.153,3.486],rotation:[-Math.PI/2,Math.PI/2,0],scale:[.573,.262,.262]}),(0,n.jsx)("mesh",{geometry:f.salma_fiberglass_0.geometry,material:x.fiberglass,position:[0,-1.953,-.739],scale:[.149,.108,.756]}),(0,n.jsx)("mesh",{geometry:f.ustcam_cam_0.geometry,material:x.material_5,position:[-.337,.974,-3.127],rotation:[-Math.PI/2,0,0],scale:[-.183,.133,.025]}),(0,n.jsx)("mesh",{geometry:f.ustcam_fiberglass_0.geometry,material:x.fiberglass,position:[-.337,.974,-3.127],rotation:[-Math.PI/2,0,0],scale:[-.183,.133,.025]}),(0,n.jsx)("mesh",{geometry:f.ustgovde_fiberglass_0.geometry,material:x.fiberglass,position:[0,.832,-2.741],rotation:[-Math.PI/2,0,0],scale:[.566,.7,1.212]}),(0,n.jsx)("mesh",{geometry:f.ustgovdekzak_ahsap_0.geometry,material:x.ahsap,position:[0,.862,-2.741],rotation:[-Math.PI/2,0,0],scale:[.566,.7,1.212]}),(0,n.jsx)("mesh",{geometry:f.vinc_metal_0.geometry,material:x.metal,position:[-1.07,.977,2.02],rotation:[-Math.PI/2,0,0],scale:.065}),(0,n.jsx)("mesh",{geometry:f.yancam002_cam_0.geometry,material:x.material_5,position:[-.984,.591,-3.772],rotation:[Math.PI,-1.241,-Math.PI/2],scale:[.095,.28,.014]}),(0,n.jsx)("mesh",{geometry:f.yancam002_fiberglass_0.geometry,material:x.fiberglass,position:[-.984,.591,-3.772],rotation:[Math.PI,-1.241,-Math.PI/2],scale:[.095,.28,.014]}),(0,n.jsx)("mesh",{geometry:f.yankoruma_metal_0.geometry,material:x.metal,position:[-1.641,.946,2.868],rotation:[-Math.PI/2,0,0],scale:[.01,.01,.159]}),(0,n.jsx)("mesh",{geometry:f.yankoruma_metal_0001.geometry,material:x.metal,position:[-1.641,.946,2.868],rotation:[-Math.PI/2,0,0],scale:[.01,.01,.159]}),(0,n.jsx)("mesh",{geometry:f.yankoruma_metal_0002.geometry,material:x.metal,position:[-1.641,.946,2.868],rotation:[-Math.PI/2,0,0],scale:[.01,.01,.159]}),(0,n.jsx)("mesh",{geometry:f.zincir_metal_0.geometry,material:x.metal,position:[-.001,.88,-6.258],rotation:[-1.56,-.031,-.149],scale:.004}),(0,n.jsx)("mesh",{geometry:f.zincir_metal_0001.geometry,material:x.metal,position:[-.001,.88,-6.258],rotation:[-1.56,-.031,-.149],scale:.004}),(0,n.jsx)("mesh",{geometry:f.zincirdeposu_fiberglass2_0.geometry,material:x.fiberglass2,position:[0,.863,-5.779],rotation:[-Math.PI/2,0,0],scale:[.103,.088,.009]}),(0,n.jsx)("mesh",{geometry:f.zincirmakara_metal_0.geometry,material:x.metal,position:[0,.869,-6.305],rotation:[-2.159,1.564,.59],scale:[.01,.01,.016]}),(0,n.jsx)("mesh",{geometry:f.zincirray_ahsap_0.geometry,material:x.ahsap,position:[0,.864,-6.113],rotation:[-Math.PI/2,0,0],scale:[.017,.181,.003]})]}),Optimist:()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("mesh",{geometry:f.body_body_0.geometry,material:x.body,position:[-.054,.272,-.022],rotation:[-1.571,.01,.01],scale:[1,5.242,1]}),(0,n.jsx)("mesh",{geometry:f.boom_aluminium_0.geometry,material:x.aluminium,position:[-.019,2.771,.964],rotation:[0,.01,-.01],scale:[.15,.15,4.609]}),(0,n.jsx)("mesh",{geometry:f.rubber_joint__0.geometry,material:x.rubber_joint__0,position:[-.008,1.407,3.453],rotation:[1.571,-.01,-.01],scale:[-.037,.056,.079]}),(0,n.jsx)("mesh",{geometry:f.sail_sail_0.geometry,material:x.sail,position:[.038,8.739,.698],rotation:[2.356,1.557,2.356],scale:[-5.728,4.361,4.361]})]}),Ship:()=>(0,n.jsx)("mesh",{geometry:f.Object_10.geometry,material:x.material_0,position:[0,-.55,0],rotation:[-1.558,.002,3.139],scale:.004}),Windsurf:()=>(0,n.jsx)("mesh",{geometry:f["body_Material_#30_0"].geometry,material:x.Material_30,position:[-.007,0,-.071],rotation:[-Math.PI/2,0,0],scale:.002}),Sailboat:()=>(0,n.jsx)("mesh",{geometry:f.sailboat.geometry,material:x.texture,position:[0,-1.5,0],rotation:[-Math.PI,.011,-Math.PI],scale:.219})};return e[d.name]||e.Default},[d.name,f,x]);return(0,n.jsxs)("group",{...i,ref:o,dispose:null,children:[g.includes("sail")&&a&&(0,n.jsx)(ee,{}),(0,n.jsx)(j,{})]})});U.L.preload(ea(),"".concat(et,"/draco/")),en.displayName="SailBoat3D";let er=(0,a(8345).g)({time:0,speed:1,scale:3,opacity:.5,color:new h.Ilk(7895160),foamColor:new h.Ilk(16777215),waterColor:new h.Ilk(26367)},"\n varying vec2 vUv;\n varying float vElevation;\n \n void main() {\n vUv = uv;\n \n // Add subtle vertex displacement for wave effect\n float elevation = sin(position.x * 0.2 + position.y * 0.3) * 0.1;\n vElevation = elevation;\n vec3 newPosition = position + normal * elevation;\n \n gl_Position = projectionMatrix * modelViewMatrix * vec4(newPosition, 1.0);\n }\n ","\n uniform float time;\n uniform float speed;\n uniform float scale;\n uniform float opacity;\n uniform vec3 color;\n uniform vec3 foamColor;\n uniform vec3 waterColor;\n\n varying vec2 vUv;\n varying float vElevation;\n\n // Improved noise functions\n vec4 permute(vec4 x) {\n return mod(((x*34.0)+1.0)*x, 289.0);\n }\n\n vec2 fade(vec2 t) {\n return t*t*t*(t*(t*6.0-15.0)+10.0);\n }\n\n float cnoise(vec2 P) {\n vec4 Pi = floor(P.xyxy) + vec4(0.0, 0.0, 1.0, 1.0);\n vec4 Pf = fract(P.xyxy) - vec4(0.0, 0.0, 1.0, 1.0);\n Pi = mod(Pi, 289.0);\n vec4 ix = Pi.xzxz;\n vec4 iy = Pi.yyww;\n vec4 fx = Pf.xzxz;\n vec4 fy = Pf.yyww;\n vec4 i = permute(permute(ix) + iy);\n vec4 gx = 2.0 * fract(i * 0.0243902439) - 1.0;\n vec4 gy = abs(gx) - 0.5;\n vec4 tx = floor(gx + 0.5);\n gx = gx - tx;\n vec2 g00 = vec2(gx.x,gy.x);\n vec2 g10 = vec2(gx.y,gy.y);\n vec2 g01 = vec2(gx.z,gy.z);\n vec2 g11 = vec2(gx.w,gy.w);\n vec4 norm = 1.79284291400159 - 0.85373472095314 * vec4(dot(g00,g00), dot(g10,g10), dot(g01,g01), dot(g11,g11));\n g00 *= norm.x;\n g10 *= norm.y;\n g01 *= norm.z;\n g11 *= norm.w;\n float n00 = dot(g00, vec2(fx.x, fy.x));\n float n10 = dot(g10, vec2(fx.y, fy.y));\n float n01 = dot(g01, vec2(fx.z, fy.z));\n float n11 = dot(g11, vec2(fx.w, fy.w));\n vec2 fade_xy = fade(Pf.xy);\n vec2 n_x = mix(vec2(n00, n01), vec2(n10, n11), fade_xy.x);\n float n_xy = mix(n_x.x, n_x.y, fade_xy.y);\n return 2.3 * n_xy;\n }\n\n void main() {\n // Create multiple layers of noise for more complex water pattern\n float baseNoise = cnoise(vUv * scale + vec2(time * speed, 0.0));\n float detailNoise = cnoise(vUv * scale * 2.0 + vec2(time * speed * 1.5, 0.0)) * 0.5;\n float turbulence = cnoise(vUv * scale * 4.0 + vec2(time * speed * 2.0, 0.0)) * 0.25;\n \n // Combine noise layers\n float noise = baseNoise + detailNoise + turbulence;\n \n // Create wake pattern\n float wake = smoothstep(0.3, 0.7, 1.0 - abs(vUv.x - 0.5) * 2.0);\n \n // Create foam effect\n float foam = smoothstep(0.4, 0.6, noise + wake);\n \n // Combine colors for water effect\n vec3 finalColor = mix(waterColor, foamColor, foam);\n finalColor = mix(finalColor, color, wake * 0.5);\n \n // Dynamic opacity with wake and foam\n float alpha = opacity * (wake + foam * 0.5) * (1.0 - vUv.y);\n \n // Add wave highlights\n float highlight = smoothstep(0.2, 0.4, noise + wake) * (1.0 - smoothstep(0.4, 0.6, noise + wake));\n finalColor += highlight * foamColor * 0.5;\n \n gl_FragColor = vec4(finalColor, alpha);\n }\n ");(0,B.e)({TrailShaderMaterial:er});let ei=e=>{let{color:t="#787878",waterColor:a="#0066ff",foamColor:i="#ffffff",speed:o=1,scale:l=3,opacity:s=.5}=e,c=(0,r.useRef)();return(0,B.F)((e,t)=>{c.current&&(c.current.uniforms.time.value+=t)}),(0,n.jsxs)("mesh",{rotation:[-Math.PI/2,0,Math.PI/2],position:[0,0,22.5],children:[(0,n.jsx)("planeGeometry",{args:[40,2.2,128,32]}),(0,n.jsx)("trailShaderMaterial",{ref:c,color:new h.Ilk(t),waterColor:new h.Ilk(a),foamColor:new h.Ilk(i),speed:o,scale:l,opacity:s,transparent:!0,depthWrite:!1,blending:h.WMw})]})};var eo=a(4752);(0,B.e)({Water:eo.B});var el=function(){let e=(0,r.useRef)(),t=(0,B.D)(e=>e.gl),a=(0,B.D)(e=>e.scene),i=(0,B.H)(h.dpR,"assets/waternormals.jpg");(0,r.useMemo)(()=>{i.wrapS=i.wrapT=h.rpg},[i]);let o=(0,r.useMemo)(()=>new h._12(1e4,1e4),[]),l=(0,r.useMemo)(()=>({textureWidth:600,textureHeight:450,waterNormals:i,sunDirection:new h.Pa4(0,1,0),sunColor:16777215,waterColor:30654,distortionScale:5,format:t.encoding,reflectivity:0}),[i,t.encoding]);(0,r.useMemo)(()=>{a.environment=null,a.background=null},[a]);let s=0;return(0,B.F)((t,a)=>{(s+=a)>.05&&(e.current&&(e.current.material.uniforms.time.value+=s),s=0)}),(0,n.jsx)("water",{ref:e,args:[o,l],"rotation-x":-Math.PI/2,position:[0,-.1,0]})};let es=(0,r.createContext)(),ec=()=>(0,r.useContext)(es),eu=(e,t,a,n)=>{let r=a.split(".").reduce((e,t)=>null==e?void 0:e[t],n);void 0!==r&&(e[t]=r)},ed=e=>{let{children:t}=e,[a,i]=(0,r.useState)({}),[o,l]=(0,r.useState)([]),s=(0,r.useRef)(null);return(0,r.useEffect)(()=>{let e=async e=>{console.log("Fetching static vessel information...");try{let t=await e.API().then(e=>e.vessels()),a=Object.entries(t).map(e=>{let[t,a]=e,n={mmsi:t};return eu(n,"name","name",a),eu(n,"latitude","navigation.position.value.latitude",a),eu(n,"longitude","navigation.position.value.longitude",a),eu(n,"cog","navigation.courseOverGroundTrue.value",a),eu(n,"heading","navigation.headingTrue.value",a),eu(n,"length","design.length.value.overall",a),eu(n,"beam","design.beam.value",a),eu(n,"callsign","communication.callsignVhf",a),eu(n,"shipType","design.aisShipType.value.id",a),n});console.log("Fetched ".concat(a.length," vessels.")),l(a)}catch(e){console.error("Error fetching static vessel info:",e)}},t=e=>{if(!(null==e?void 0:e.updates)){console.warn("Delta is missing or does not contain updates:",e);return}let t=e=>({mmsi:e,name:"unknown",latitude:null,longitude:null,sog:null,cog:null,heading:null}),a=e.context.replace("vessels.","");if(!a){console.warn("Update missing MMSI context:",e);return}i(n=>{let r=n[a]||t(a);return e.updates.forEach(e=>{e.values.forEach(e=>{switch(e.path){case"name":r.name=e.value;break;case"navigation.position":r.latitude=e.value.latitude,r.longitude=e.value.longitude;break;case"navigation.speedOverGround":r.sog=e.value;break;case"navigation.courseOverGroundTrue":r.cog=e.value;break;case"navigation.headingTrue":r.heading=e.value}})}),{...n,[a]:r}})};return(async()=>{try{let{signalkUrl:a}=c.getAll();if(console.log("SignalK URL:",a),!a)throw Error("SignalK URL is undefined or invalid.");let[n,r]=a.replace(/https?:\/\//,"").split(":");console.log("Connecting to SignalK at hostname: ".concat(n,", port: ").concat(r));let i=new d.default({hostname:n||"localhost",port:parseInt(r)||3e3,useTLS:a.startsWith("https"),reconnect:!0,autoConnect:!1,notifications:!1,subscriptions:[{context:"vessels.*",subscribe:[{path:"navigation.position"},{path:"navigation.speedOverGround"},{path:"navigation.courseOverGroundTrue"},{path:"navigation.headingTrue"}]}]});s.current=i,await i.connect(),console.log("SignalK client connected."),await e(i),i.on("delta",t)}catch(e){console.error("Error connecting to SignalK:",e)}})(),()=>{var e;console.log("Disconnecting SignalK client..."),null===(e=s.current)||void 0===e||e.disconnect()}},[]),(0,n.jsx)(es.Provider,{value:{aisData:a,vesselIds:o},children:t})};var eh=a(5476);let em=async e=>{try{let t=await a(9927)("./".concat(e,"/Scene.jsx"));return t.default?t.default:t.Model}catch(t){throw console.error("Error loading ".concat(e," component:"),t),t}},eg=e=>0===e?"windsurf":30===e?"optimist":36===e?"sailboat":"ship",ef=(0,r.forwardRef)((e,t)=>{let{position:a,visible:i,boatData:o}=e,[l,s]=(0,r.useState)(null),c=eg(o.shipType);if((0,r.useEffect)(()=>{let e=!0;return em(c).then(t=>{e&&s(()=>t)}).catch(e=>console.error("Failed to load ".concat(c,":"),e)),()=>{e=!1}},[c]),!l)return null;let u=(e,t)=>"".concat(e,": ").concat(t||"N/A","\n"),d=[u("Name",o.name||"Unknown"),u("Length",o.length?"".concat(o.length,"m"):"N/A"),u("Type",o.shipType)].join(""),h=(o.length||10)/10;return(0,n.jsxs)("group",{ref:t,position:a,visible:i,children:[(0,n.jsx)(l,{scale:[h,h,h]}),(0,n.jsx)(eh.x,{position:[3,9,0],fontSize:.5,maxWidth:3,lineHeight:1,textAlign:"left",color:"white",anchorX:"center",anchorY:"top",font:"fonts/Roboto-Bold.ttf",children:d})]})});ef.displayName="AISBoat";let ex=e=>{if(e.material)return e;for(let t of e.children){let e=ex(t);if(e)return e}return null},ep=(e,t,a,n)=>({x:Math.PI/180*(t-n)*6371e3*Math.cos(Math.PI/180*a),y:Math.PI/180*(e-a)*6371e3}),ev=(e,t)=>{if(null!=e.sog&&null!=e.cog){let a=.51444*e.sog;return{deltaX:a*t*Math.sin(e.cog*Math.PI/180)*.2,deltaY:a*t*Math.cos(e.cog*Math.PI/180)*.2}}return{deltaX:0,deltaY:0}},eb=function(e,t,a){let n=!(arguments.length>3)||void 0===arguments[3]||arguments[3],r=-(.2*t),i=.2*a;n?(e.position.x+=(r-e.position.x)*.1,e.position.z+=(i-e.position.z)*.1):e.position.set(r,0,i)},ej=function(e,t){let a=!(arguments.length>2)||void 0===arguments[2]||arguments[2],n=t*Math.PI/180;a?e.children[0].rotation.y+=(n-e.children[0].rotation.y)*.1:e.children[0].rotation.y=n};var ey=()=>{let{aisData:e,vesselIds:t}=ec(),a=(0,r.useRef)({}),{getSignalKValue:i}=y();(0,B.F)(()=>{let n=i("navigation.position"),r=i("navigation.speedOverGround");if(!(null==n?void 0:n.latitude)||!(null==n?void 0:n.longitude)||!Object.keys(a.current).length)return;let o=performance.now(),l=t.length&&!Object.keys(e).length;Object.values(l?t:e).forEach(e=>{if(null==e.latitude||null==e.longitude||!a.current[e.mmsi])return;let t=a.current[e.mmsi],i=e.lastUpdate||o,{x:s,y:c}=ep(e.latitude,e.longitude,n.latitude,n.longitude),u=0,d=0;!l&&null!=r&&r>0&&o-i>1e3&&({deltaX:u,deltaY:d}=ev(e,(o-i)/1e3));let h=s+u,m=c+d,g=Math.sqrt((.2*h)**2+(.2*m)**2);if(g>0&&g<=600){t.visible=!0,t.currentColor||(t.currentColor=g<100?"red":"white");let a=t.currentColor;"red"===t.currentColor&&g>110?a="white":"white"===t.currentColor&&g<100&&(a="red"),console.log("Boat ".concat(e.mmsi,": Displayed Distance = ").concat(g.toFixed(2),", Target Color = ").concat(a)),eb(t,h,m,!l),null!=e.cog?ej(t,e.cog,!l):null!=e.heading&&ej(t,e.heading,!l);let n=ex(t.children[0]);n?(t.redMaterial||(t.redMaterial=n.material.clone(),t.redMaterial.color.set("red")),t.whiteMaterial||(t.whiteMaterial=n.material.clone(),t.whiteMaterial.color.set("white")),"red"===a&&"red"!==t.currentMaterial?(n.material=t.redMaterial,t.currentMaterial="red",console.log("Swapped material to red for boat ".concat(e.mmsi))):"white"===a&&"white"!==t.currentMaterial&&(n.material=t.whiteMaterial,t.currentMaterial="white",console.log("Swapped material to white for boat ".concat(e.mmsi))),t.currentColor=a):console.warn("Material not found for boat ".concat(e.mmsi))}else t.visible=!1})});let o=(0,r.useMemo)(()=>t.filter(e=>e.mmsi&&!e.mmsi.startsWith("urn:mrn:signalk:uuid:")&&!e.mmsi.startsWith("227925790")&&!e.mmsi.startsWith("urn:mrn:imo:mmsi:230035780")).map(e=>(0,n.jsx)(ef,{ref:t=>a.current[e.mmsi]=t,position:[0,0,0],visible:!1,boatData:e},e.mmsi)),[t]);return(0,n.jsx)(n.Fragment,{children:o})},ew=a(1);let eM=r.memo(e=>{let{radius:t,isOuter:a,markerColorPrimary:i,markerColorGreen:o,markerColorRed:l}=e,s=(0,r.useMemo)(()=>{let e=[];for(let r=0;r<360;r+=10){let s=h.M8C.degToRad(r-90),c=r%30==0,u=a?c?.4:.2:c?.3:.15,d=(t+.5*u+.2)*Math.cos(s),m=(t+.5*u+.2)*Math.sin(s),g=a&&r>0&&r<61,f=a&&r>=300&&r<360,x=g?o:f?l:i;if(!a&&c){let t=0===r?"N":r.toString();e.push((0,n.jsx)(eh.x,{characters:"N0123456789",position:[d,.01,m],color:i,fontSize:.5,rotation:[-Math.PI/2,0,Math.PI/2-s],font:"fonts/Roboto-Bold.ttf",anchorY:"middle",children:t},"text-".concat(r)))}else e.push((0,n.jsx)(ew.aL,{args:[u/2,16,16],position:[d,0,m],children:(0,n.jsx)("meshBasicMaterial",{color:x})},"marker-".concat(a?"outer":"inner","-").concat(r)))}return e},[t,a,i,o,l]);return(0,n.jsx)(n.Fragment,{children:s})});eM.displayName="StaticMarkers";let eN=r.memo(e=>{let{innerRadius:t,outerRadius:a,dialColor:r,opacity:i=1,transparent:o=!1}=e;return(0,n.jsx)(ew.FM,{args:[t,a,64],rotation:[Math.PI/2,0,0],children:(0,n.jsx)("meshBasicMaterial",{color:r,side:h.ehD,transparent:o,opacity:i})})});eN.displayName="StaticRing";let eS=e=>{let{outerRadius:t,innerRadius:a}=e,{nightMode:i,getSignalKValue:o}=y(),l=i?"#ef4444":16777215,s=o("navigation.courseOverGroundTrue")||10,c=(0,r.useMemo)(()=>({innerRadius:a,outerRadius:t,dialColor:l,markerColorPrimary:0,markerColorGreen:x,markerColorRed:f}),[a,t,l,0,x,f]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("group",{rotation:[0,Math.PI-s,0],children:[(0,n.jsx)(eN,{innerRadius:c.innerRadius,outerRadius:c.outerRadius,dialColor:c.dialColor}),(0,n.jsx)(eM,{radius:c.innerRadius,isOuter:!1,markerColorPrimary:c.markerColorPrimary,markerColorGreen:c.markerColorGreen,markerColorRed:c.markerColorRed})]}),(0,n.jsxs)("group",{children:[(0,n.jsx)(eN,{innerRadius:c.innerRadius+1,outerRadius:c.outerRadius+1,dialColor:c.dialColor,transparent:!0,opacity:.5}),(0,n.jsx)(eM,{radius:c.innerRadius+1,isOuter:!0,markerColorPrimary:c.markerColorPrimary,markerColorGreen:c.markerColorGreen,markerColorRed:c.markerColorRed})]})]})};eS.displayName="CompassDial";var eC=a(718),eP=a.n(eC);let ek={TRUE_WIND:1,APP_WIND:1},eR=e=>{let{position:t=[0,0,0],rotation:a=[0,0,0],speed:r,color:i="#ffffff",fontSize:o=.5,textPosition:l=[0,.8,0],arrowSize:s=1}=e;return(0,n.jsxs)("group",{position:t,rotation:a,children:[(0,n.jsx)(eh.x,{characters:".0123456789",color:i,fontSize:o*s,position:l,font:"fonts/Roboto-Bold.ttf",children:r.toFixed(1)}),(0,n.jsxs)("mesh",{children:[(0,n.jsx)("shapeGeometry",{args:[new h.bnF([new h.FM8(0,0),new h.FM8(.5*s*Math.cos(5*Math.PI/6),.5*s*Math.sin(5*Math.PI/6)),new h.FM8(0,-.577*s),new h.FM8(-.5*s*Math.cos(5*Math.PI/6),.5*s*Math.sin(5*Math.PI/6)),new h.FM8(0,0)])]}),(0,n.jsx)("meshStandardMaterial",{color:i,side:h.ehD})]})]})};eR.propTypes={position:eP().instanceOf(h.Pa4).isRequired,rotation:eP().arrayOf(eP().number).isRequired,speed:eP().number.isRequired,color:eP().string.isRequired,fontSize:eP().number.isRequired,textPosition:eP().arrayOf(eP().number).isRequired};let eI=e=>{let{outerRadius:t}=e,{getSignalKValue:a}=y(),i=Math.PI/2-a("environment.wind.angleTrueGround")||0,o=v(a("environment.wind.speedOverGround"))||0,l=Math.PI/2-a("environment.wind.angleApparent")||0,s=v(a("environment.wind.speedApparent"))||0,c=(0,r.useMemo)(()=>new h.Pa4((t+.7)*Math.cos(i),0,-(t+.7)*Math.sin(i)),[t,i]),u=(0,r.useMemo)(()=>new h.Pa4((t+.7)*Math.cos(l),0,-(t+.7)*Math.sin(l)),[t,l]);return(0,n.jsxs)("group",{children:[o>0&&(0,n.jsx)(eR,{position:c,rotation:[-Math.PI/2,0,-(Math.PI/2-i)],speed:o,color:"blue",fontSize:ek.TRUE_WIND}),s>0&&(0,n.jsx)(eR,{position:u,rotation:[-Math.PI/2,0,-(Math.PI/2-l)],speed:s,color:g,fontSize:ek.APP_WIND})]})};eI.propTypes={outerRadius:eP().number.isRequired};var e_=()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(eS,{outerRadius:5.6,innerRadius:5}),(0,n.jsx)(eI,{outerRadius:5.6+1.1})]}),eT=a(8181),eE=JSON.parse('{"N":{"52":[4.98,5.86,6.31,6.45,6.51,6.52,6.41],"60":[5.25,6.11,6.56,6.73,6.79,6.82,6.79],"75":[5.45,6.33,6.77,7.01,7.13,7.2,7.24],"90":[5.66,6.55,7,7.25,7.38,7.53,7.7],"110":[5.49,6.49,7.04,7.4,7.69,7.97,8.38],"120":[5.32,6.36,6.97,7.39,7.77,8.1,8.6],"135":[4.81,5.92,6.68,7.15,7.55,7.95,8.85],"150":[4.09,5.17,6.04,6.61,6.99,7.31,7.93],"angles":[52,60,75,90,110,120,135,150],"speeds":[6,8,10,12,14,16,20],"beat_angle":[43.6,42,41.2,41.2,41.7,42.1,44.2],"beat_vmg":[3.26,3.91,4.24,4.34,4.36,4.34,4.16],"run_angle":[144.8,147.8,148.5,149.6,171.8,175.4,177.2],"run_vmg":[3.54,4.48,5.23,5.73,6.17,6.67,7.36]}}');let eA={DEG2RAD:Math.PI/180,ROTATION_INTERPOLATION_FACTOR:.05,SOG_SMOOTHING_FACTOR:.1,DEFAULT_SOG:3,ANGLE_INCREMENT:10,SPHERE_SIZE:.4,SPHERE_SEGMENTS:32,DEFAULT_LINE_WIDTH:1,PLOTS_COUNT:10,FRAME_TO_MINUTE_RATIO:3600},eG=(e,t)=>26.8224*e*t*.1,eO=(e,t,a)=>{if(!e||!t)return new h.Pa4(0,0,0);let n=e*eA.DEG2RAD,r=eG(t,a);return new h.Pa4(r*Math.sin(n),0,-r*Math.cos(n))},eL=(e,t)=>{if(!(null==e?void 0:e.length))return 0;let a=0,n=e.length-1;for(;a<n;){let r=Math.floor((a+n)/2);e[r]<t?a=r+1:n=r}return a},eF=e=>{let{position:t,color:a}=e;return t?(0,n.jsxs)("mesh",{position:t,children:[(0,n.jsx)("sphereGeometry",{args:[eA.SPHERE_SIZE,eA.SPHERE_SEGMENTS,eA.SPHERE_SEGMENTS]}),(0,n.jsx)("meshStandardMaterial",{color:a})]}):null},eD=e=>{let{points:t,color:a}=e;return(null==t?void 0:t.length)?(0,n.jsx)(eT.x,{points:t,color:a,lineWidth:eA.DEFAULT_LINE_WIDTH}):null},ez=r.memo(e=>{let{timeInMinute:t,windSpeed:a}=e,i=(0,r.useRef)(eE.N),o=(0,r.useCallback)((e,t,a,n)=>(null==e?void 0:e.length)&&(null==t?void 0:t.length)&&!(e.length<=a)&&!(t.length<=a)?eO(e[a],t[a],n):(console.warn("Invalid angle or VMG data"),null),[]),l=(0,r.useCallback)((e,t)=>{let{speeds:a,angles:n,beat_angle:r,beat_vmg:o,run_angle:l,run_vmg:s}=i.current;if(!(null==a?void 0:a.length)||!(null==n?void 0:n.length))return console.warn("Invalid polar data"),null;let c=(e,t,a)=>e+a*(t-e),u=[],d=(e,a,n)=>{for(let r=e;r<=a;r+=eA.ANGLE_INCREMENT)u.push(eO(r,n(r),t))};return d(0,r[e],t=>c(0,o[e],t/r[e])),n.forEach(a=>{if(a>r[e]&&a<l[e]){var n;let r=(null===(n=i.current[Math.floor(a)])||void 0===n?void 0:n[e])||0;u.push(eO(a,r,t))}}),d(l[e],180,()=>s[e]),new h.YT8(u,!0)},[]),s=(0,r.useMemo)(()=>{var e;let n=i.current;if(!(null==n?void 0:null===(e=n.speeds)||void 0===e?void 0:e.length))return console.warn("Invalid polar data structure"),{curve:null,beat:null,run:null};let r=eL(n.speeds,a);return{curve:l(r,t),beat:o(n.beat_angle,n.beat_vmg,r,t),run:o(n.run_angle,n.run_vmg,r,t)}},[t,a,o,l]);return(0,n.jsx)(n.Fragment,{children:[0,-Math.PI].map((e,t)=>(0,n.jsxs)("group",{rotation:[0,0,e],children:[s.curve&&(0,n.jsx)(eD,{points:s.curve.getPoints(100),color:g}),(0,n.jsx)(eF,{position:s.beat,color:x}),(0,n.jsx)(eF,{position:s.run,color:f})]},t))})});ez.displayName="PolarPlot";var eW=function(){let e=(0,r.useRef)([]),[t,a]=(0,r.useState)([]),i=(0,r.useRef)(0),o=(0,r.useRef)([]),l=(0,r.useRef)(eA.DEFAULT_SOG),{getSignalKValue:s}=y(),c=s("environment.wind.angleApparent"),u=v(s("environment.wind.speedOverGround"))||0,d=s("navigation.speedOverGround")||eA.DEFAULT_SOG;return(0,r.useEffect)(()=>{let t=Array.from({length:eA.PLOTS_COUNT},(e,t)=>({id:t,timeInMinute:5*(t+1)}));a(t),e.current=t.map(()=>new h.ZAu),o.current=Array(eA.PLOTS_COUNT).fill(0)},[]),(0,B.F)((a,n)=>{i.current+=1,l.current=h.M8C.lerp(l.current,d,eA.SOG_SMOOTHING_FACTOR),t.forEach((t,a)=>{let n=e.current[a];if(n&&t.timeInMinute-i.current/eA.FRAME_TO_MINUTE_RATIO>0){let e=o.current[a],t=h.M8C.lerp(e,c,eA.ROTATION_INTERPOLATION_FACTOR);n.rotation.set(0,t,0),o.current[a]=t}})}),(0,n.jsx)(n.Fragment,{children:t.map((t,a)=>(0,n.jsx)("group",{ref:t=>{t&&(e.current[a]=t)},children:(0,n.jsx)(ez,{timeInMinute:t.timeInMinute,windSpeed:u})},t.id))})},eB=()=>{let{states:e}=y(),t=(0,r.useRef)();return(0,n.jsxs)(r.Suspense,{fallback:(0,n.jsx)(F.V,{children:"Loading..."}),children:[(0,n.jsx)(D.c,{makeDefault:!0,fov:60,near:1,far:1e3,position:[0,5,20]}),(0,n.jsx)(z.z,{enableZoom:!0,enableRotate:!0,maxPolarAngle:Math.PI/2,minPolarAngle:Math.PI/4}),(0,n.jsx)(W.qA,{files:"./assets/ocearo_env.hdr",background:!1,intensity:.8}),(0,n.jsx)("ambientLight",{intensity:.6}),(0,n.jsx)("spotLight",{position:[15,30,20],intensity:2,angle:Math.PI/6,penumbra:.5,castShadow:!0,"shadow-mapSize-width":1024,"shadow-mapSize-height":1024,"shadow-camera-near":.5,"shadow-camera-far":50,"shadow-bias":-.0001}),(0,n.jsx)("directionalLight",{position:[-10,20,10],intensity:1.5,castShadow:!0,"shadow-mapSize-width":1024,"shadow-mapSize-height":1024,"shadow-camera-near":.5,"shadow-camera-far":50,"shadow-bias":-.0001,color:"#ffd1a6"}),(0,n.jsx)("directionalLight",{position:[10,10,-10],intensity:.3}),(0,n.jsx)("pointLight",{position:[-10,10,-10],intensity:.7}),(0,n.jsxs)("group",{position:[0,-3,0],children:[(0,n.jsx)(en,{position:[0,0,.7],scale:[.7,.7,.7],ref:t,showSail:!0}),e.showOcean&&(0,n.jsx)(el,{}),(0,n.jsx)(ei,{}),(0,n.jsx)(eW,{}),e.ais&&(0,n.jsx)(ed,{children:(0,n.jsx)(ey,{})}),(0,n.jsx)(e_,{visible:!1})]})]})},eU=()=>{let{nightMode:e,setNightMode:t,states:a,toggleState:r}=y(),i=e?"text-oNight":"text-oGray",o=e=>{let t={autopilot:"autopilot"===e,anchorWatch:"anchorWatch"===e,parkingMode:"parkingMode"===e};Object.keys(t).forEach(e=>{r(e,t[e])})};return(0,n.jsxs)("div",{className:"text-lg",children:[(0,n.jsx)("button",{onClick:()=>o("autopilot"),className:"p-1",children:(0,n.jsx)(C.G,{icon:P.lnS,className:a.autopilot?"text-oBlue":i})}),(0,n.jsx)("button",{onClick:()=>o("anchorWatch"),className:"p-1",children:(0,n.jsx)(C.G,{icon:P.SJR,className:a.anchorWatch?"text-oYellow":i})}),(0,n.jsx)("button",{onClick:()=>o("parkingMode"),className:"p-1",children:(0,n.jsx)(C.G,{icon:P.BQ9,className:a.parkingMode?"text-oGreen":i})}),(0,n.jsx)("button",{onClick:()=>r("mob"),className:"p-1",children:(0,n.jsx)(C.G,{icon:P.i4I,className:a.mob?"text-oRed":i})}),(0,n.jsx)("button",{onClick:()=>t(!e),className:"p-1",children:(0,n.jsx)(C.G,{icon:P.DBF,className:e?"text-oNight":i})}),(0,n.jsx)("button",{onClick:()=>r("showOcean"),className:"p-1",children:(0,n.jsx)(C.G,{icon:P.L02,className:a.showOcean?"text-oBlue":i})}),(0,n.jsx)("button",{onClick:()=>r("ais"),className:"p-1",children:(0,n.jsx)(C.G,{icon:P.mDh,className:a.ais?"text-oGreen":i})})]})};let eH={SOG:"navigation.speedOverGround",VMG:"performance.velocityMadeGood",STW:"navigation.speedThroughWater",POL:"performance.polarSpeedRatio"};var eV=()=>{let{nightMode:e,getSignalKValue:t}=y(),[a,i]=(0,r.useState)("SOG"),o=(0,r.useMemo)(()=>{let e={};for(let[a,n]of Object.entries(eH)){let r=t(n);null!=r&&(e[a]=v(r))}return e},[t]),l=Object.keys(o),s=void 0!==o[a]?a:l[0],c=o[s],u=(0,r.useCallback)(()=>{if(0===l.length)return;let e=(l.indexOf(s)+1)%l.length;i(l[e])},[l,s]),d=e?"text-oNight":"text-oGray";return 0===l.length?(0,n.jsxs)("div",{className:"mt-4",children:[(0,n.jsx)("div",{className:"text-6xl font-bold text-gray-400",children:"--"}),(0,n.jsx)("div",{className:"text-lg ".concat(d),children:"NO DATA"})]}):(0,n.jsxs)("div",{className:"mt-4",children:[(0,n.jsx)("div",{className:"text-6xl font-bold cursor-pointer ".concat(e?"text-oNight":"text-white"),onClick:u,role:"button",tabIndex:0,"aria-label":"Current speed: ".concat(c," ").concat(s,". Click to change speed type."),children:(null==c?void 0:c.toFixed(1))||"--"}),(0,n.jsx)("div",{className:"text-lg ".concat(d),children:s})]})};let eK={BATTERIES:"batteries",TANKS:"tanks"},eY={FRESH_WATER:{id:"freshWater",label:"Fresh Water",path:"tanks.freshWater.0.currentLevel",icon:"\uD83D\uDCA7",color:"bg-oBlue"},FUEL:{id:"fuel",label:"Fuel",path:"tanks.fuel.0.currentLevel",icon:"⛽",color:"bg-oYellow"},BLACK_WATER:{id:"blackWater",label:"Black Water",path:"tanks.blackWater.0.currentLevel",icon:"\uD83D\uDEB0",color:"bg-oGray"}},eq={WARNING_THRESHOLD:50,DANGER_THRESHOLD:20,CHARGING_THRESHOLD:13},eX=e=>e>=12.7?100:e>=12.5?75:e>=12.3?50:e>=12.1?25:0,eZ=e=>{let{level:t,type:a}=e,r=Math.max(0,Math.min(100,t)),{label:i,icon:o,color:l}=eY[a];return(0,n.jsxs)("div",{className:"flex items-center space-x-3 my-2",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,n.jsx)("span",{className:"text-sm",children:o}),(0,n.jsx)("div",{className:"relative w-20 h-4 bg-oGray rounded-lg overflow-hidden",children:(0,n.jsx)("div",{className:"absolute left-0 top-0 h-full ".concat(l," transition-all duration-300"),style:{width:"".concat(r,"%")}})})]}),(0,n.jsxs)("span",{className:"text-sm font-medium",children:[i,": ",r,"%"]})]})},eJ=e=>{let{batteryLevel:t,batteryNumber:a,voltage:i}=e,[o,l]=(0,r.useState)(!1),s=Math.max(0,Math.min(100,t)),c=i>eq.CHARGING_THRESHOLD,u=(0,r.useMemo)(()=>s>eq.WARNING_THRESHOLD?"bg-oGreen":s>eq.DANGER_THRESHOLD?"bg-oYellow":"bg-oRed",[s]);return(0,n.jsxs)("div",{className:"flex items-center space-x-3 my-2 relative",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),children:[(0,n.jsxs)("div",{className:"relative w-8 h-4 bg-oGray rounded-sm border border-oGray flex items-center justify-center",children:[(0,n.jsx)("div",{className:"absolute -right-1 w-1 h-3 bg-oGray rounded-sm"}),(0,n.jsx)("div",{className:"absolute left-0 top-0 h-full ".concat(u," transition-all duration-300 rounded-sm"),style:{width:"".concat(s,"%")}}),(0,n.jsx)("span",{className:"relative z-10 text-xs text-black font-bold",children:a})]}),(0,n.jsxs)("span",{className:"text-sm font-medium ".concat(s<=eq.DANGER_THRESHOLD?"text-oRed animate-pulse":""),children:[s,"%"]}),c&&(0,n.jsx)("span",{className:"text-oGreen ml-1",children:"⚡"}),o&&(0,n.jsxs)("div",{className:"absolute -left-20 top-10 bg-gray-800 text-white px-2 py-1 rounded text-xs whitespace-nowrap",children:["Voltage: ",null==i?void 0:i.toFixed(1),"V ",c&&"(Charging)"]})]})};var eQ=()=>{let{nightMode:e,getSignalKValue:t}=y(),[a,i]=(0,r.useState)(eK.BATTERIES),o=(0,r.useMemo)(()=>{let e=t("electrical.batteries.1.capacity.stateOfCharge"),a=t("electrical.batteries.1.voltage");return[{level:null===e?eX(a):e,number:1,voltage:a}].filter(e=>null!==e.level)},[t]),l=(0,r.useMemo)(()=>({FRESH_WATER:t(eY.FRESH_WATER.path)||40,FUEL:t(eY.FUEL.path)||75,BLACK_WATER:t(eY.BLACK_WATER.path)||20}),[t]),s=()=>{i(e=>e===eK.BATTERIES?eK.TANKS:eK.BATTERIES)};return(0,n.jsx)("div",{className:"".concat(e?"text-oNight":"text-oGray"," rounded-lg transition-all duration-300 hover:bg-gray-800/10 cursor-pointer"),onClick:s,role:"button",tabIndex:0,"aria-label":"Toggle between ".concat(a===eK.BATTERIES?"tanks":"batteries"," display"),onKeyPress:e=>"Enter"===e.key&&s(),children:a===eK.BATTERIES?(0,n.jsx)("div",{className:"space-y-2",children:o.map(e=>(0,n.jsx)(eJ,{batteryLevel:e.level,batteryNumber:e.number,voltage:e.voltage},e.number))}):(0,n.jsx)("div",{className:"space-y-2",children:Object.entries(eY).map(e=>{let[t,a]=e;return(0,n.jsx)(eZ,{type:t,level:l[t]},t)})})})},e$=()=>{let{nightMode:e}=y(),{getSignalKValue:t}=y(),a=180*(t("steering.rudderAngle")||0)/Math.PI;return(0,n.jsx)("div",{style:{width:"480px",paddingBottom:"25px"},className:"mx-auto",children:(0,n.jsxs)("div",{className:"w-full bg-oGray h-1 rounded-full relative mt-2",children:[(()=>{let t=[];for(let a=-60;a<=60;a+=10){let r=a/120*100;t.push((0,n.jsx)("div",{className:"absolute h-2 w-px bg-oGray",style:{left:"".concat(50+r,"%"),transform:"translateX(-20%)"},children:(0,n.jsx)("span",{className:"text-xs ".concat(e?"text-oNight":"text-oGray"),style:{transform:"translateY(-50%)"},children:a})},a))}return t})()," ",(0,n.jsx)("div",{className:"absolute top-0 h-1 rounded-full transition-all duration-300 ease-in-out ".concat(a<0?"bg-oRed":"bg-oGreen"),style:{width:"".concat(Math.abs(a)/120*100,"%"),left:"50%",transform:a<0?"translateX(-100%)":"translateX(0)"}})]})})};let e0={DANGER:3,WARNING:5,MAX_DEPTH:50},e1={DANGER:"bg-oRed",WARNING:"bg-oYellow",SAFE:"bg-oBlue"},e2={NIGHT:"text-oNight",DAY:"text-white"};var e5=()=>{let{nightMode:e,getSignalKValue:t}=y(),[a,i]=(0,r.useState)(null),[o,l]=(0,r.useState)(240);(0,r.useEffect)(()=>{let e=()=>{let e=window.innerHeight;l(e<640?Math.min(.25*e,240):Math.min(.35*e,240))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,r.useEffect)(()=>{let e=t("environment.depth.belowTransducer");i(null!=e?Number(e.toFixed(1)):null)},[t]);let s=(0,r.useMemo)(()=>null===a?0:Math.min(a/e0.MAX_DEPTH*100,100),[a]),c=(0,r.useMemo)(()=>null===a?e1.SAFE:a<e0.DANGER?e1.DANGER:a<e0.WARNING?e1.WARNING:e1.SAFE,[a]),u=e?e2.NIGHT:e2.DAY,d=(0,r.useCallback)(e=>null===e?"--":"".concat(e," m"),[]);return(0,n.jsxs)("div",{className:"flex flex-col items-center",children:[(0,n.jsx)("div",{className:"text-sm mb-2 ".concat(u),children:"Depth"}),(0,n.jsx)(()=>(0,n.jsx)("div",{className:"w-2 ".concat(c," rounded-lg overflow-hidden mb-4"),style:{height:o},role:"progressbar","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":e0.MAX_DEPTH,"aria-label":"Water depth: ".concat(d(a)),children:(0,n.jsx)("div",{className:"bg-oGray transition-all duration-500 ease-in-out",style:{height:"".concat(100-s,"%")}})}),{}),(0,n.jsx)("div",{className:"text-sm mt-2 ".concat(u," ").concat(a<e0.DANGER?"animate-pulse":""),children:d(a)})]})};let e4={MIN:10,MAX:90},e3={RISING:{BACKGROUND:"bg-oGreen",TEXT:"text-oGreen"},FALLING:{BACKGROUND:"bg-oYellow",TEXT:"text-oYellow"}},e6={NIGHT:"text-oNight",DAY:"text-white"};var e7=()=>{let{nightMode:e,getSignalKValue:t}=y(),[a,i]=(0,r.useState)(240),[o,l]=(0,r.useState)({level:null,high:null,low:null,timeLow:null,timeHigh:null,coefficient:null,isRising:null}),s=(0,r.useCallback)(e=>{if(!e)return null;let[t,a]=e.split(":").map(Number);return 60*t+a},[]),c=(0,r.useCallback)((e,t,a)=>{let n=s(e),r=s(t),i=s(a);return!!n&&!!r&&!!i&&(r<i?n>=r&&n<=i:n>=r||n<=i)},[s]),u=(0,r.useCallback)((e,t,a)=>a<=t||!e?0:Math.min(100,Math.max(0,(e-t)/(a-t)*100)),[]);(0,r.useEffect)(()=>{let e=()=>{let e=window.innerHeight;i(e<640?Math.min(.25*e,240):Math.min(.35*e,240))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,r.useEffect)(()=>{let e=new Date().toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit",hour12:!1}),a={level:t("environment.tide.heightNow"),high:t("environment.tide.heightHigh"),low:t("environment.tide.heightLow"),timeLow:t("environment.tide.timeLow"),timeHigh:t("environment.tide.timeHigh"),coefficient:t("environment.tide.coeffNow")};Object.values(a).every(e=>null!=e)&&l({...a,isRising:c(e,a.timeLow,a.timeHigh)})},[t,c]);let{level:d,high:h,low:m,timeLow:g,timeHigh:f,coefficient:x,isRising:p}=o,v=e?e6.NIGHT:e6.DAY,b=p?e3.RISING:e3.FALLING,j=(0,r.useMemo)(()=>u(d,m,h),[d,m,h,u]);if(Object.values(o).some(e=>null===e))return null;let w=j>e4.MIN&&j<e4.MAX;return(0,n.jsxs)("div",{className:"flex flex-col items-center",children:[(0,n.jsx)("div",{className:"text-sm ".concat(v),children:"La Rochelle"}),(0,n.jsxs)("div",{className:"text-sm mb-2 ".concat(v," flex items-center gap-1"),children:[f,(0,n.jsx)("span",{className:"inline-block transform ".concat(!p&&"rotate-180"," ").concat(b.TEXT),children:"▲"}),(0,n.jsx)("span",{children:x})]}),(0,n.jsxs)("div",{className:"relative flex flex-col w-8",style:{height:a},children:[(0,n.jsxs)("span",{className:"absolute ".concat(v," text-sm font-medium"),style:{top:"0%",left:"60%"},children:[h,"m"]}),w&&(0,n.jsxs)("span",{className:"absolute ".concat(v," text-sm font-medium transition-opacity duration-300"),style:{bottom:"".concat(j,"%"),left:"60%"},children:[d.toFixed(2),"m"]}),(0,n.jsxs)("span",{className:"absolute ".concat(v," text-sm font-medium"),style:{bottom:"0%",left:"60%"},children:[m,"m"]}),(0,n.jsx)("div",{className:"flex flex-col justify-end bg-oGray rounded-3xl w-2 overflow-hidden",style:{height:a},children:(0,n.jsx)("div",{role:"progressbar",className:"".concat(b.BACKGROUND," w-2 rounded-3xl transition-all duration-500"),"aria-valuenow":j,"aria-valuemin":"0","aria-valuemax":"100","aria-label":"Tide level: ".concat(d.toFixed(2)," meters"),style:{height:"".concat(j,"%")}})})]}),(0,n.jsx)("div",{className:"text-sm mt-2 ".concat(v),children:g})]})},e8=e=>{let{rudderAngle:t,sog:a,windSpeed:i=0,windDirection:o=0,currentSpeed:l=0,currentDirection:s=0,boatWidth:c=2,color:u="white",maxCurvePoints:d=100}=e,m=(0,r.useRef)(),g=(0,r.useCallback)(()=>{let e=h.M8C.degToRad(o),t=h.M8C.degToRad(s);return{x:Math.cos(e)*i*.1+Math.cos(t)*l*.2,z:Math.sin(e)*i*.1+Math.sin(t)*l*.2}},[i,o,l,s]),f=(0,r.useCallback)(()=>{let e=g(),t=[];for(let a=0;a<d;a++){let n;let r=a/d*50,i=-r,o=(r/50)**2;n=0+e.x*o*50,i+=e.z*o*50,t.push(new h.Pa4(n,0,i))}return t},[g,d]),x=(0,r.useCallback)(()=>{if(.1>Math.abs(t))return f();let e=h.M8C.degToRad(t),n=Math.min(Math.max(Math.abs(0!==a?a/Math.tan(e||.01):1e3),2*c),500),r=g(),i=[];for(let e=0;e<d;e++){let t=e/d,a=t*Math.PI,o=n*(1-Math.cos(a))*.1,l=n*Math.sin(a)*.1;o+=r.x*t*t;let s=1.5*c,u=Math.sqrt(o*o+(l+=r.z*t*t)*l);if(u<s){let e=s/u;o*=e,l*=e}i.push(new h.Pa4(o,0,l))}return i},[t,a,c,d,g,f]);return(0,r.useEffect)(()=>{if(!m.current)return;let e=x();m.current.geometry.setFromPoints(e)},[x]),(0,n.jsxs)("line",{ref:m,children:[(0,n.jsx)("bufferGeometry",{}),(0,n.jsx)("lineBasicMaterial",{color:u,linewidth:4})]})};let e9=e=>{let{position:t,rotation:a,speed:r,color:i="#ffffff",fontSize:o=.5,textPosition:l=[0,.8,0],arrowSize:s=1}=e;return(0,n.jsxs)("group",{position:t,rotation:a,children:[(0,n.jsx)(eh.x,{characters:"0123456789.",color:i,fontSize:o*s,position:l,font:"/fonts/Roboto-Bold.ttf",anchorX:"center",anchorY:"middle",children:r.toFixed(1)}),(0,n.jsxs)("mesh",{children:[(0,n.jsx)("shapeGeometry",{args:[new h.bnF([new h.FM8(0,0),new h.FM8(.5*s*Math.cos(5*Math.PI/6),.5*s*Math.sin(5*Math.PI/6)),new h.FM8(0,-.577*s),new h.FM8(-.5*s*Math.cos(5*Math.PI/6),.5*s*Math.sin(5*Math.PI/6)),new h.FM8(0,0)])]}),(0,n.jsx)("meshStandardMaterial",{color:i,side:h.ehD})]})]})};e9.propTypes={position:eP().arrayOf(eP().number),rotation:eP().arrayOf(eP().number),speed:eP().number.isRequired,color:eP().string,fontSize:eP().number,textPosition:eP().arrayOf(eP().number),arrowSize:eP().number},e9.defaultProps={position:[0,0,0],rotation:[0,0,0],color:"#ffffff",fontSize:.5,textPosition:[0,.8,0],arrowSize:1};let te=e=>{let{outerRadius:t}=e,{getSignalKValue:a}=y(),i=a("environment.current")||{setTrue:0,drift:0},o=(0,r.useMemo)(()=>{let e=i.setTrue||0;return[(t+.7)*Math.cos(e),0,-(t+.7)*Math.sin(e)]},[t,i.setTrue]);return!i.drift||i.drift<=0?null:(0,n.jsx)("group",{children:(0,n.jsx)(e9,{position:o,rotation:[-Math.PI/2,0,-(Math.PI/2-(i.setTrue||0))],speed:i.drift,color:x,arrowSize:1.2})})};te.propTypes={outerRadius:eP().number.isRequired};var tt=()=>{let e=(0,r.useRef)(),{getSignalKValue:t}=y(),a=t("steering.rudderAngle")||0,i=t("navigation.speedOverGround")||0,o=t("environment.wind.angleApparent")||0,l=v(t("environment.wind.speedApparent"))||0,s=t("environment.current")||{setTrue:0,drift:0};return(0,n.jsxs)(r.Suspense,{fallback:(0,n.jsx)(F.V,{center:!0,children:"Loading..."}),children:[(0,n.jsx)(D.c,{makeDefault:!0,fov:60,near:1,far:1e3,position:[0,5,10]}),(0,n.jsx)(z.z,{enableZoom:!0,enableRotate:!0,maxPolarAngle:Math.PI/2,minPolarAngle:Math.PI/4}),(0,n.jsx)(W.qA,{files:"./assets/ocearo_env.hdr",background:!1,intensity:.8}),(0,n.jsx)("ambientLight",{intensity:.6}),(0,n.jsx)("spotLight",{position:[15,30,20],intensity:1.8,angle:Math.PI/6,penumbra:.5,castShadow:!0,"shadow-mapSize-width":1024,"shadow-mapSize-height":1024,"shadow-camera-near":.5,"shadow-camera-far":50,"shadow-bias":-.0001}),(0,n.jsx)("directionalLight",{position:[-10,20,10],intensity:1.5,color:"#ffd1a6",castShadow:!0}),(0,n.jsx)("pointLight",{position:[-10,10,-10],intensity:.7}),(0,n.jsxs)("group",{position:[0,-3,0],children:[(0,n.jsx)(en,{position:[0,0,.7],scale:[.7,.7,.7],ref:e,showSail:!1}),(0,n.jsx)(eI,{outerRadius:5}),(0,n.jsx)(te,{outerRadius:5}),(0,n.jsx)("group",{position:[0,0,-5],"rotation-y":Math.PI,children:(0,n.jsx)(e8,{rudderAngle:a,sog:i,windSpeed:l,windDirection:o,currentSpeed:s.drift,currentDirection:s.setTrue,boatWidth:2,color:x,maxCurvePoints:100})})]})]})};let ta=(e,t,a,n)=>{let r=(a-e)*Math.PI/180,i=(n-t)*Math.PI/180,o=Math.sin(r/2)*Math.sin(r/2)+Math.cos(e*Math.PI/180)*Math.cos(a*Math.PI/180)*Math.sin(i/2)*Math.sin(i/2);return 2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o))*6371e3};var tn=()=>{let e=(0,r.useRef)(),[t,a]=(0,r.useState)(null),{getSignalKValue:i}=y();return(0,r.useEffect)(()=>{let e=i("navigation.position");e&&!t&&a({latitude:e.latitude,longitude:e.longitude})},[i,t]),(0,r.useEffect)(()=>{if(e.current){let t=new h.u9r,a=[];for(let e=0;e<=64;e++){let t=e/64*Math.PI*2;a.push(50*Math.cos(t),0,50*Math.sin(t))}t.setAttribute("position",new h.a$l(a,3)),e.current.geometry=t}},[]),(0,B.F)(()=>{if(e.current&&t){let a=i("navigation.position");if(a){let n=ta(t.latitude,t.longitude,t.latitude,a.longitude),r=ta(t.latitude,t.longitude,a.latitude,t.longitude),i=a.longitude>t.longitude?n:-n,o=a.latitude>t.latitude?r:-r;e.current.position.set(i,-6.9,o)}}}),(0,n.jsx)("line",{ref:e,children:(0,n.jsx)("lineBasicMaterial",{attach:"material",color:"green",linewidth:2})})},tr=()=>{let e=(0,r.useRef)(),{size:t}=(0,B.D)(),a=t.width/t.height;return(0,n.jsxs)(r.Suspense,{fallback:(0,n.jsx)(F.V,{children:"Loading..."}),children:[(0,n.jsx)(D.c,{makeDefault:!0,fov:25,aspect:a,near:1,far:1e3,position:[32,10,-32]}),(0,n.jsx)(z.z,{enableZoom:!0,enableRotate:!0,maxPolarAngle:Math.PI/2,minPolarAngle:Math.PI/4}),(0,n.jsx)(W.qA,{files:"./assets/ocearo_env.hdr",background:!1}),(0,n.jsx)("ambientLight",{intensity:.6}),(0,n.jsx)("spotLight",{position:[15,30,20],intensity:2,angle:Math.PI/6,penumbra:.5,castShadow:!0,"shadow-mapSize-width":2048,"shadow-mapSize-height":2048}),(0,n.jsx)("directionalLight",{position:[-10,20,10],intensity:1.5,castShadow:!0,"shadow-mapSize-width":2048,"shadow-mapSize-height":2048}),(0,n.jsx)("pointLight",{position:[-10,10,-10],intensity:.7}),(0,n.jsx)(en,{ref:e,scale:[1.3,1.3,1.3],position:[0,-6,0]}),(0,n.jsx)(tn,{}),(0,n.jsxs)("mesh",{rotation:[-Math.PI/2,0,0],position:[0,-7,0],receiveShadow:!0,children:[(0,n.jsx)("planeGeometry",{args:[100,100]}),(0,n.jsx)("shaderMaterial",{uniforms:{uColor:{value:new h.Ilk("#111111")},uBlurRadius:{value:.1}},vertexShader:"\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }\n ",fragmentShader:"\n uniform vec3 uColor;\n uniform float uBlurRadius;\n varying vec2 vUv;\n\n void main() {\n float distanceToCenter = length(vUv - vec2(0.5));\n float alpha = smoothstep(0.5 - uBlurRadius, 0.5 + uBlurRadius, distanceToCenter);\n gl_FragColor = vec4(uColor, 1.0 - alpha);\n }\n "})]})]})},ti=()=>{let{nightMode:e,getSignalKValue:t}=y(),a=t("navigation.position"),r=(e,t)=>{if(null==e)return"--";let a=Math.abs(e),n=Math.floor(a),r=((a-n)*60).toFixed(3);return"".concat(n,"\xb0").concat(r,"'").concat(t?e>=0?"N":"S":e>=0?"E":"W")};return(0,n.jsxs)("div",{className:"mt-4",children:[(0,n.jsxs)("div",{className:"text-3xl font-bold cursor-pointer flex gap-2 ".concat(e?"text-oNight":"text-white"),children:[(0,n.jsx)("span",{children:r(a.latitude,!0)}),(0,n.jsx)("span",{children:r(a.longitude,!1)})]}),(0,n.jsx)("div",{className:"text-lg ".concat(e?"text-oNight":"text-oGray"),children:(()=>{let e=new Date;try{let t=navigator.language||"en-US";return e.toLocaleString(t,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:void 0})}catch(t){return console.warn("Error formatting date with user locale, falling back to en-US",t),e.toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",hour12:!0})}})()})]})},to=e=>{let{setFullScreen:t}=e,{states:a}=y();return(0,r.useEffect)(()=>{t(a.anchorWatch)},[a.anchorWatch,t]),(0,n.jsxs)("div",{className:"w-full h-full relative ",children:[(0,n.jsxs)("div",{className:"absolute top-2 left-2 z-10 space-y-0",children:[(0,n.jsx)(eU,{}),!a.anchorWatch&&(0,n.jsx)(eV,{}),a.anchorWatch&&(0,n.jsx)(ti,{})]}),(0,n.jsx)("div",{className:"absolute top-2 z-10 right-2",children:(0,n.jsx)(eQ,{})}),(0,n.jsx)("div",{className:"absolute left-2 bottom-2 z-20 flex flex-col items-center",children:(0,n.jsx)(e5,{})}),(0,n.jsx)("div",{className:"absolute right-2 bottom-2 z-20 flex flex-col items-center",children:(0,n.jsx)(e7,{})}),!a.anchorWatch&&(0,n.jsx)("div",{className:"absolute bottom-2 left-1/2 transform -translate-x-1/2 z-10",children:(0,n.jsx)(e$,{})}),(0,n.jsx)("div",{className:"absolute left-1/2 transform -translate-x-1/2 w-full h-full",children:(0,n.jsx)(L.Xz,{style:{width:"100%",height:"100%"},shadows:!0,dpr:[1,2],gl:{antialias:!0,physicallyCorrectLights:!0,toneMapping:h.LY2,toneMappingExposure:1},children:a.parkingMode?(0,n.jsx)(tt,{}):a.anchorWatch?(0,n.jsx)(tr,{}):(0,n.jsx)(eB,{})})})]})};class tl extends r.Component{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)}render(){if(this.state.hasError){let{error:e,errorInfo:t}=this.state;return(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center min-h-screen bg-gray-100 text-gray-900",children:[(0,n.jsx)("h1",{className:"text-3xl font-bold text-red-600 mb-4",children:"Something went wrong."}),(0,n.jsxs)("p",{className:"text-lg mb-2",children:[(0,n.jsx)("strong",{children:"Error:"})," ",e?e.toString():"Unknown error"]}),t&&(0,n.jsxs)("details",{className:"whitespace-pre-wrap bg-gray-200 p-4 rounded-lg mb-4",children:[(0,n.jsx)("summary",{className:"cursor-pointer text-blue-500 underline",children:"Stack Trace"}),(0,n.jsx)("pre",{className:"mt-2",children:t.componentStack})]}),(0,n.jsxs)("div",{className:"flex space-x-4",children:[(0,n.jsx)("button",{onClick:this.handleRefresh,className:"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-600",children:"Refresh Page"}),(0,n.jsx)("button",{onClick:this.handleExitFullscreen,className:"px-4 py-2 bg-green-500 text-white rounded hover:bg-green-600",children:"Exit Fullscreen"})]})]})}return this.props.children}constructor(e){super(e),this.handleRefresh=()=>{window.location.reload()},this.handleExitFullscreen=()=>{document.fullscreenElement&&(window.close(),document.exitFullscreen().catch(e=>{console.error("Failed to exit fullscreen:",e)}))},this.state={hasError:!1,error:null,errorInfo:null}}}let ts={BOAT:"boat",APP:"app",SPLIT:"split"};function tc(){let[e,t]=(0,r.useState)("settings"),[a,i]=(0,r.useState)(!1),[l,s]=(0,r.useState)(ts.BOAT),[c,u]=(0,r.useState)(!1),d=(0,r.useCallback)(()=>{i(e=>!e)},[]),h=(0,r.useCallback)(e=>{s(e)},[]),m=(0,r.useCallback)((e,t)=>{let a=window.innerWidth/5;t.x>a?h(ts.BOAT):t.x<-a?h(ts.APP):h(ts.SPLIT)},[h]),g=(0,r.useCallback)(()=>{document.fullscreenElement?document.exitFullscreen():document.documentElement.requestFullscreen().catch(e=>{console.error("Fullscreen error:",e.message)})},[]),f=(0,r.useCallback)(e=>{l===ts.BOAT&&h(ts.APP),t(e)},[l,h]),x=(0,r.useCallback)(()=>{c?(h(ts.BOAT),u(!1)):(f("settings"),u(!0))},[c,h,f]),p=(0,r.useMemo)(()=>({leftPane:"transition-all duration-300 ".concat(l===ts.BOAT?"w-full":l===ts.APP?"hidden":"w-2/5"," bg-leftPaneBg h-full relative"),rightPane:"transition-all duration-300 ".concat(l===ts.APP?"w-full":l===ts.BOAT?"hidden":"w-3/5"," h-full bg-rightPaneBg p-4")}),[l]);return(0,n.jsx)(tl,{children:(0,n.jsx)(j,{children:(0,n.jsxs)("div",{className:"h-screen flex flex-col bg-black relative",children:[(0,n.jsxs)("div",{className:"flex flex-1",children:[(0,n.jsx)("div",{className:p.leftPane,children:(0,n.jsx)(to,{setFullScreen:()=>{}})}),(0,n.jsx)(o(),{axis:"x",onDrag:m,position:{x:0,y:0},handle:".handle",children:(0,n.jsx)("div",{className:"handle w-1 bg-leftPaneBg h-full cursor-col-resize transition-all duration-200 flex items-center justify-center",children:(0,n.jsx)("div",{className:"rounded-full w-3 bg-gray-600 h-40 transition-all duration-200 hover:bg-gray-500"})})}),(0,n.jsx)("div",{className:p.rightPane,children:(0,n.jsx)(S,{view:e})})]}),(0,n.jsx)("div",{className:"w-full h-16 bg-black flex items-center justify-center",children:(0,n.jsx)(G,{setRightView:f,toggleAppMenu:d,toggleSettings:x})}),a&&(0,n.jsx)(O,{currentViewMode:l,toggleViewMode:h,handleSetRightView:f,toggleFullscreen:g,setShowAppMenu:i})]})})})}}},function(e){e.O(0,[689,870,676,918,875,971,117,744],function(){return e(e.s=7343)}),_N_E=e.O()}]);