@idmwx/idmui-gl4 2.9.0 → 2.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -200,7 +200,7 @@
200
200
  <path d="M10 2.5V17.5" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
201
201
  <path d="M5 7.5L10 2.5L15 7.5" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
202
202
  </svg>`;s.src="data:image/svg+xml;base64,"+window.btoa(d);const m=[s];let g=0;m.forEach(u=>{u.onload=()=>{g++,this.map.hasImage("currentDirIcon")||this.map.addImage("currentDirIcon",s),g===1&&this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"currentDirIcon","icon-size":["interpolate",["linear"],["get","spd"],.5,.3,1,.5,1.5,.7,2,.8,3.5,1],"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":this.opacity}},this.beforeLayer)}}),i=new Date().valueOf()-(a+r),console.log("[current] add elapsed: ",i,", total: ",r+=i)}}},handleClear(){this.map.getLayer(this.speedLayer)&&this.map.removeLayer(this.speedLayer),this.map.getLayer(this.speedLabelLayer)&&this.map.removeLayer(this.speedLabelLayer),this.map.getLayer(this.directionLayer)&&this.map.removeLayer(this.directionLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Ws(e,t,a,r,i,l){return null}const Zs=Q(Gs,[["render",Ws]]),cf="",Os={name:"IdmCurrentParticle",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Eo},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Me,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleOptions:{fadeOpacity:.96,speedFactor:4,dropRate:.005,dropRateBump:.01,uvRange:[-2.5,2.6],sRange:[0,3],scale:.3},paused:!1,initial:!0,right:10}},watch:{"factor.version":{async handler(){var e,t;(e=this.factor)!=null&&e.active?await this.handleRender():this.handleClear(),(t=this.factor)!=null&&t.particle||this.handleClearParticle()},immediate:!0},"factor.particle":{async handler(e,t){e!==t&&t!==void 0&&(e?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)},immediate:!0}},methods:{async handleRender(){if(this.factor){const e=new Date().valueOf();let t=0,a=0;await this.handleDraw(),a=new Date().valueOf()-(e+t),console.log("[current-particle] add elapsed: ",a,", total: ",t+=a)}},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const e=[[0/255,"rgba(95, 143, 197,1)"],[5/255,"rgba(64,127,115,1)"],[10/255,"rgb(58,164,58)"],[15/255,"rgb(191,182,67)"],[20/255,"rgb(197,154,68)"],[30/255,"rgb(160,70,94)"],[40/255,"rgb(138,84,166)"],[45/255,"rgb(82,113,165)"],[50/255,"rgb(84,142,152)"],[65/255,"rgb(150,181,184)"],[80/255,"rgb(195,194,194)"],[254/255,"rgb(195,194,194)"],[1,"rgb(195,194,194)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,pe.vertexSchema,pe.uvFragmentSchema);this.program=t,this.aPositionBuffer=a}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const e=[[0,"rgb(183,224,224)"],[1,"rgb(199,202,202)"],[.6,"rgb(199,202,202)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,ze.vertexSchema,ze.fragmentSchema,ze.quadVertSchema,ze.screenFragmentSchema,ze.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,e,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,9e3),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const e=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,e),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,e),this.wrapper.image=e}this.initial&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext)}},handlePause(){this.paused=!0,this.animation&&(cancelAnimationFrame(this.animation),this.viewport.toggleParticle(!1))},handlePlay(){this.paused=!1,this.animation=requestAnimationFrame(()=>{this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay()})},handleClearParticle(){var e,t,a,r,i,l,n;(e=this.viewport)==null||e.toggleParticle(!1),this.particleContext=void 0,this.initial=!0,(a=(t=this.viewport)==null?void 0:t.map)==null||a.off("resize",this.handleResize),(i=(r=this.viewport)==null?void 0:r.map)==null||i.off("movestart",this.handlePause),(n=(l=this.viewport)==null?void 0:l.map)==null||n.off("moveend",this.handlePlay),this.handlePause()},handleClear(){var e;(e=this.viewport)==null||e.toggle(!1),this.context=void 0,this.etime=void 0,this.handleClearParticle()}}},js={key:0};function Xs(e,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",js,[o.createElementVNode("div",{class:"legend-bars-gl4 current",style:o.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[o.createElementVNode("span",null,"kts",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"0.4",-1),o.createElementVNode("span",null,"0.8",-1),o.createElementVNode("span",null,"1.6",-1),o.createElementVNode("span",null,"2",-1),o.createElementVNode("span",null,"3.2",-1)]),4)])):o.createCommentVNode("",!0)}const Hs=Q(Os,[["render",Xs]]),mf="",Ys={name:"IdmSigWave",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Me,etime:void 0,right:10}},watch:{"factor.version":{handler(){var e;(e=this.factor)!=null&&e.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const e=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(e+t),console.log("[sig-wave] add elapsed: ",a,", total: ",t+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const e=[[0,"rgb(50, 158, 186)"],[10/255,"rgb(50, 158, 186)"],[20/255,"rgb(48, 128, 164)"],[30/255,"rgb(48, 99, 142)"],[40/255,"rgb(57, 61, 143)"],[50/255,"rgb(179, 86, 189)"],[60/255,"rgb(154, 45, 123)"],[80/255,"rgb(134, 48, 48)"],[120/255,"rgb(194, 77, 91)"],[150/255,"rgb(192, 118, 105)"],[180/255,"rgb(192, 163, 157)"],[1,"rgb(192, 163, 157)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,pe.vertexSchema,pe.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const e=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,e)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Us={key:0};function Js(e,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",Us,[o.createElementVNode("div",{class:"legend-bars-gl4 sig-wave",style:o.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[o.createElementVNode("span",null,"m",-1),o.createElementVNode("span",null,"0.5",-1),o.createElementVNode("span",null,"1",-1),o.createElementVNode("span",null,"1.5",-1),o.createElementVNode("span",null,"2",-1),o.createElementVNode("span",null,"6",-1),o.createElementVNode("span",null,"9",-1)]),4)])):o.createCommentVNode("",!0)}const $s=Q(Ys,[["render",Js],["__scopeId","data-v-c6137292"]]),Ks={name:"IdmSigWaveHeight",props:{map:{type:Object},sigWaveHeight:{type:Object},beforeLayer:{type:String},menuToggle:{type:Object}},data(){return{right:10,toggle:!1,showCaption:!1,source:"sig-wave-height-source",heightLayer:"sig-wave-height-layer",heightLabelLayer:"sig-wave-height-label-layer",empty:J.featureCollection([])}},watch:{"sigWaveHeight.version":{handler(){var e;(e=this.sigWaveHeight)!=null&&e.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleMenuToggle(){this.toggle=!this.toggle,this.showCaption=!this.showCaption},handleRender(){var e,t;if(this.sigWaveHeight){const a=new Date().valueOf();let r=0,i=0,l=this.empty;this.sigWaveHeight.active&&(l=this.sigWaveHeight.data),(e=this.map)!=null&&e.getSource(this.source)?((t=this.map)==null||t.getSource(this.source).setData(l),i=new Date().valueOf()-(a+r),console.log("[sig-wave-height] update elapsed: ",i,", total: ",r+=i)):(this.map.addSource(this.source,{type:"geojson",data:l}),this.map.addLayer({id:this.heightLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-opacity":.8,"fill-color":["step",["get","val"],"rgba(0,235,156,0)",2,"rgba(0,235,156,0.4)",3,"#ffed00",4,"#ff9800",5,"#f77800",6,"#e4711e",7,"#e06128",8,"#dc5132",9,"#d5453c",10,"#cd3a46",12,"#be2c50",14,"#b41a5a"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","symbol-spacing":100,"text-field":["format",["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":10},paint:{"text-color":["step",["get","val"],"rgba(0, 0, 0, 0.7)",9,"rgba(255,255,255,0.8)"]}},this.beforeLayer),i=new Date().valueOf()-(a+r),console.log("[sig-wave-height] add elapsed: ",i,", total: ",r+=i))}},handleClear(){this.map.getLayer(this.heightLayer)&&this.map.removeLayer(this.heightLayer),this.map.getLayer(this.heightLabelLayer)&&this.map.removeLayer(this.heightLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function qs(e,t,a,r,i,l){return null}const Qs=Q(Ks,[["render",qs]]),df="",ec={name:"IdmSwell",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Me,etime:void 0,right:10}},watch:{"factor.version":{handler(){var e;(e=this.factor)!=null&&e.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const e=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(e+t),console.log("[sig-wave] add elapsed: ",a,", total: ",t+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const e=[[0,"rgb(50, 158, 186)"],[10/255,"rgb(50, 158, 186)"],[20/255,"rgb(48, 128, 164)"],[30/255,"rgb(48, 99, 142)"],[40/255,"rgb(57, 61, 143)"],[50/255,"rgb(179, 86, 189)"],[60/255,"rgb(154, 45, 123)"],[80/255,"rgb(134, 48, 48)"],[120/255,"rgb(194, 77, 91)"],[150/255,"rgb(192, 118, 105)"],[180/255,"rgb(192, 163, 157)"],[1,"rgb(192, 163, 157)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,pe.vertexSchema,pe.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const e=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,e)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},tc={key:0};function oc(e,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",tc,[o.createElementVNode("div",{class:"legend-bars-gl4 swell",style:o.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[o.createElementVNode("span",null,"m",-1),o.createElementVNode("span",null,"0.5",-1),o.createElementVNode("span",null,"1",-1),o.createElementVNode("span",null,"1.5",-1),o.createElementVNode("span",null,"2",-1),o.createElementVNode("span",null,"6",-1),o.createElementVNode("span",null,"9",-1)]),4)])):o.createCommentVNode("",!0)}const ac=Q(ec,[["render",oc],["__scopeId","data-v-3c94b068"]]),ic={name:"IdmPrmsl",props:{map:{type:Object},prmsl:{type:Object},beforeLayer:{type:String},showRampColor:{type:Boolean},activeWeatherLayers:{type:Array},theme:{type:String}},data(){return{right:10,toggle:!1,source:"prmsl-source",layer:"prmsl-layer",labelLayer:"prmsl-label-layer",pointLabelLayer:"prmsl-point-label-layer",empty:J.featureCollection([])}},watch:{"prmsl.version":{handler(){var e;(e=this.prmsl)!=null&&e.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleMenuToggle(){this.toggle=!this.toggle},handleRender(){var e,t,a;if(this.prmsl){const r=new Date().valueOf();let i=0,l=0,n=this.empty;this.prmsl.active&&(n=this.prmsl.data),(e=this.map)!=null&&e.getSource(this.source)?((t=this.map)==null||t.getSource(this.source).setData(n),l=new Date().valueOf()-(r+i),console.log("[prmsl] update elapsed: ",l,", total: ",i+=l)):(this.map.addSource(this.source,{type:"geojson",data:n}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-color":["step",["get","val"],"rgba(162,13,2,1)",920,"rgba(255, 96, 98, 1)",980,"rgba(255, 246, 184, 1)",1100,"rgba(199,171,250,1)"],"line-width":1,"line-opacity":this.theme==="light"?1:.3}},this.beforeLayer),(a=this.map)==null||a.addLayer({id:this.labelLayer,type:"symbol",source:this.source,minzoom:4,filter:["==","$type","LineString"],layout:{"symbol-placement":"line","text-rotation-alignment":"viewport","text-field":"{val}","text-size":10},paint:{"text-color":"black","text-halo-color":"rgba(255,255,255,1)","text-opacity":.7,"text-halo-width":1}},this.beforeLayer),this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-allow-overlap":!0,"text-field":["format",["get","type"],{"font-scale":1.03},`
203
- `,["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":12,"text-font":["DIN Pro Regular","Arial Unicode MS Regular"]},paint:{"text-color":this.theme==="light"?["step",["get","val"],"rgba(0, 0, 0, 0.5)",920,"rgba(0, 0, 0, 0.5)",980,"rgba(0, 0, 0, 0.7)",1100,"rgba(0, 0, 0, 0.7)"]:"rgba(0,0,0,1)","text-halo-color":["step",["get","val"],"rgba(162,13,2,1)",920,"rgba(255, 96, 98, 1)",980,"rgba(255, 246, 184, 1)",1100,"rgba(199,171,250,1)"],"text-halo-width":1}},this.beforeLayer),l=new Date().valueOf()-(r+i),console.log("[prmsl] add elapsed: ",l,", total: ",i+=l))}},handleClear(){this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.labelLayer)&&this.map.removeLayer(this.labelLayer),this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function rc(e,t,a,r,i,l){return null}const lc=Q(ic,[["render",rc]]),hf="",nc={name:"IdmIceEdge",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Me,etime:void 0,right:10}},watch:{"factor.version":{handler(){var e;(e=this.factor)!=null&&e.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const e=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(e+t),console.log("[ice-edge] add elapsed: ",a,", total: ",t+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const e=[[0,"rgba(86, 169, 230, 0)"],[1/255,"rgba(86, 169, 230, 0)"],[25/255,"rgba(86, 169, 230, 1)"],[25/255,"rgba(47, 226, 155, 1)"],[100/255,"rgba(47, 226, 155, 1)"],[100/255,"rgba(213, 253, 37, 1)"],[175/255,"rgba(213, 253, 37, 1)"],[175/255,"rgba(230, 176, 39, 1)"],[225/255,"rgba(230, 176, 39, 1)"],[225/255,"rgba(230, 84, 39, 1)"],[250/255,"rgba(230, 84, 39, 1)"],[1,"rgba(230, 84, 39, 1)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,pe.vertexSchema,pe.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const e=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,e)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},sc={key:0};function cc(e,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",sc,[o.createElementVNode("div",{class:"legend-bars-gl4 ice-edge",style:o.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[o.createElementVNode("span",{style:{color:"rgba(var(--v-theme-black), 0.7)"}},"%",-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,"10",-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,"40",-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,"70",-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,"90",-1),o.createElementVNode("span",null,null,-1)]),4)])):o.createCommentVNode("",!0)}const mc=Q(nc,[["render",cc]]),pf="",dc={name:"IdmCover",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Me,etime:void 0,right:10}},watch:{"factor.version":{handler(){var e;(e=this.factor)!=null&&e.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const e=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(e+t),console.log("[ice-cover] add elapsed: ",a,", total: ",t+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const e=[[0,"rgba(68, 1, 84, 0)"],[1/255,"rgba(63, 72, 137, 0)"],[50/255,"rgba(53, 125, 177, 1)"],[100/255,"rgba(33, 145, 140, 1)"],[150/255,"rgba(45, 178, 125, 1)"],[200/255,"rgba(112, 207, 87, 1)"],[250/255,"rgba(253, 231, 37, 0.8)"],[1,"rgba(253, 231, 37, 1)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,pe.vertexSchema,pe.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const e=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,e)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},hc={key:0};function pc(e,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",hc,[o.createElementVNode("div",{class:"legend-bars-gl4 ice-cover",style:o.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[o.createElementVNode("span",null,"%",-1),o.createElementVNode("span",null,"20",-1),o.createElementVNode("span",null,"40",-1),o.createElementVNode("span",null,"60",-1),o.createElementVNode("span",null,"80",-1),o.createElementVNode("span",null,"100",-1)]),4)])):o.createCommentVNode("",!0)}const gc=Q(dc,[["render",pc],["__scopeId","data-v-916b01eb"]]),gf="",uc={name:"IdmThickness",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},menuToggle:{type:Object},bottom:{type:String,default:"70px"}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Me,etime:void 0,right:10}},watch:{"factor.version":{handler(){var e;(e=this.factor)!=null&&e.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const e=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(e+t),console.log("[ice-thickness] add elapsed: ",a,", total: ",t+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const e=[[0,"rgba(4, 6, 19, 0)"],[1/255,"rgba(4, 6, 19, 0)"],[20/255,"rgba(51, 50, 102, 1)"],[40/255,"rgba(63, 82, 158, 1)"],[50/255,"rgba(66, 123, 183, 1)"],[60/255,"rgba(92, 161, 197, 1)"],[80/255,"rgba(134, 199, 212, 0.7)"],[100/255,"rgba(134, 199, 212, 1)"],[150/255,"rgba(234, 253, 2536, 0.8)"],[250/255,"rgba(234, 253, 2536, 0.9)"],[1,"rgba(234, 253, 2536, 1)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,pe.vertexSchema,pe.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const e=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,e)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},fc={key:0};function yc(e,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",fc,[o.createElementVNode("div",{class:"legend-bars-gl4 ice-thickness",style:o.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[o.createElementVNode("span",null,"m",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"0.6",-1),o.createElementVNode("span",null,"1",-1),o.createElementVNode("span",null,"1.5",-1),o.createElementVNode("span",null,"2",-1),o.createElementVNode("span",null,"3",-1)]),4)])):o.createCommentVNode("",!0)}const bc=Q(uc,[["render",yc]]),uf="",wc={name:"IdmPrecip3h",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Me,etime:void 0,right:10}},watch:{"factor.version":{handler(){var e;(e=this.factor)!=null&&e.active?this.handleRender():this.handleClear()},deeimmediate:!0},"menuToggle.v":{handler(){var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const e=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(e+t),console.log("[precip3h] add elapsed: ",a,", total: ",t+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const e=[[0,"rgba(59, 126, 162, 0)"],[14/255,"rgba(84,170,230, 0)"],[15/255,"rgba(172, 210, 255, 0.8)"],[20/255,"rgba(51,202,248,0.8)"],[30/255,"rgba(3,248,103,0.8)"],[49/255,"rgba(14,201,3,0.8)"],[57/255,"rgba(190,226,2,0.8)"],[73/255,"rgba(248,1,1,0.8)"],[82/255,"rgba(197,5,58,0.8)"],[1,"rgba(197,5,58,0.8)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,pe.vertexSchema,pe.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const e=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,e)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},xc={key:0};function kc(e,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",xc,[o.createElementVNode("div",{class:"legend-bars-gl4 precip3h",style:o.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[o.createElementVNode("span",null,"mm",-1),o.createElementVNode("span",null,"1.5",-1),o.createElementVNode("span",null,"2",-1),o.createElementVNode("span",null,"3",-1),o.createElementVNode("span",null,"7",-1),o.createElementVNode("span",null,"10",-1),o.createElementVNode("span",null,"20",-1),o.createElementVNode("span",null,"30",-1)]),4)])):o.createCommentVNode("",!0)}const _c=Q(wc,[["render",kc]]),ff="",vc={name:"IdmVisibility",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{right:10,program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Me,etime:void 0}},watch:{"factor.version":{handler(){var e;(e=this.factor)!=null&&e.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const e=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(e+t),console.log("[visibility] add elapsed: ",a,", total: ",t+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const e=[[0,"rgba(189,50,160,0.8)"],[8/255,"rgba(208,56,56,0.8)"],[27/255,"rgba(190,226,2,0.8)"],[60/255,"rgba(3,236,118,0.8)"],[160/255,"rgba(172, 210,255,0.8)"],[161/255,"rgba(172, 210,255,0)"],[1,"rgba(144,144,144,0)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,pe.vertexSchema,pe.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const e=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,e)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},zc={key:0};function Lc(e,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",zc,[o.createElementVNode("div",{class:"legend-bars-gl4 visibility",style:o.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[o.createElementVNode("span",null,"nm",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"0.5",-1),o.createElementVNode("span",null,"1.5",-1),o.createElementVNode("span",null,"3",-1),o.createElementVNode("span",null,"9",-1)]),4)])):o.createCommentVNode("",!0)}const Cc=Q(vc,[["render",Lc]]),yf="",Sc={name:"IdmWaterTemp",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Me,etime:void 0,right:10}},watch:{"factor.version":{handler(){var e;(e=this.factor)!=null&&e.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const e=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(e+t),console.log("[water-temp] add elapsed: ",a,", total: ",t+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const e=[[0,"rgba(95, 143, 197)"],[46/255,"rgba(95, 143, 197)"],[69/255,"rgb(80, 140, 62)"],[92/255,"rgb(121, 146, 28)"],[115/255,"rgb(171, 161, 14)"],[138/255,"rgb(223, 177, 69)"],[161/255,"rgb(243, 150, 6)"],[184/255,"rgb(236, 95, 21)"],[207/255,"rgb(190, 65, 18)"],[230/255,"rgb(138, 43, 10)"],[1,"rgb(138, 43, 10)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,pe.vertexSchema,pe.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const e=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,e)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Nc={key:0};function Pc(e,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",Nc,[o.createElementVNode("div",{class:"legend-bars-gl4 water-temp",style:o.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[o.createElementVNode("span",null,"°C",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"10",-1),o.createElementVNode("span",null,"20",-1),o.createElementVNode("span",null,"30",-1),o.createElementVNode("span",null,"40",-1)]),4)])):o.createCommentVNode("",!0)}const Mc=Q(Sc,[["render",Pc]]),bf="",Tc={name:"IdmTemp",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Me,etime:void 0,right:10}},watch:{"factor.version":{handler(){var e;(e=this.factor)!=null&&e.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const e=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(e+t),console.log("[temp] add elapsed: ",a,", total: ",t+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const e=[[0,"rgb(149, 137, 211)"],[100/255,"rgb(149, 137, 211)"],[110/255,"rgb(150, 209, 216)"],[120/255,"rgb(129, 204, 197)"],[130/255,"rgb(103, 180, 186)"],[140/255,"rgb(95, 143, 197)"],[150/255,"rgb(80, 140, 62)"],[160/255,"rgb(121, 146, 28)"],[170/255,"rgb(171, 161, 14)"],[180/255,"rgb(223, 177, 6)"],[190/255,"rgb(243, 150, 6)"],[200/255,"rgb(236, 95, 21)"],[210/255,"rgb(190, 65, 18)"],[220/255,"rgb(138, 43, 10)"],[1,"rgb(138, 43, 10)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,pe.vertexSchema,pe.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const e=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,e)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Vc={key:0};function Ec(e,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",Vc,[o.createElementVNode("div",{class:"legend-bars-gl4 temp",style:o.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[o.createElementVNode("span",null,"°C",-1),o.createElementVNode("span",null,"-20",-1),o.createElementVNode("span",null,"-10",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"10",-1),o.createElementVNode("span",null,"20",-1),o.createElementVNode("span",null,"30",-1),o.createElementVNode("span",null,"40",-1)]),4)])):o.createCommentVNode("",!0)}const Rc=Q(Tc,[["render",Ec]]),wf="",Dc={name:"IdmGlLayer",components:{IdmWindBarb:Ds,IdmWindParticle:Fs,IdmCurrentDirection:Zs,IdmCurrentParticle:Hs,IdmWave:$s,IdmSigWaveHeight:Qs,IdmSwell:ac,IdmPrmsl:lc,IdmIceEdge:mc,IdmIceCover:gc,IdmIceThickness:bc,IdmPrecip3h:_c,IdmVisibility:Cc,IdmWaterTemp:Mc,IdmTemp:Rc},props:{simple:{type:Boolean,default:!1},isLogin:{type:Boolean,default:!1},theme:{type:String},map:{type:Object},mapFeather:{type:String},gateway:{type:String},assistGateway:{type:Array,default:[]},defaultMeteoToken:{type:String},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}},realTime:{type:String},forecastModel:{type:String},beforeLayer:{type:String}},emits:["forecastModel","menuToggle","weatherCheckList","autoActive","weatherRendered"],data(){return{right:10,toggle:!1,autoActive:!0,weatherWeight:0,allLayers:[...je.LayerHelper.WEATHER_LAYERS],tagLayers:[...je.LayerHelper.WEATHER_LAYERS.filter(e=>!e.hide)],checkList:[],renderKey:"",iceToggleValue:void 0,waveToggleValue:void 0,weatherLayers:{},activeWeatherLayers:[],cache:{v:"0.0.1",versionKey:"weatherLayerCacheVersionGL4",autoActiveKey:"autoActiveCacheGL4",checkListKey:"weatherCheckListCacheGL4"},models:{},currentModel:localStorage.getItem("forecastModelCacheGL4")==="GFS"?"GFS":"ECMWF",zoom:6,viewport:void 0,particleFactor:void 0,showWindParticle:!0,showCurrentParticle:!0,legendToggle:!1,legend:{barbs:[2,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,0],current:[{label:"0-0.5 kts",size:.3,color:"rgb(58, 164, 58)"},{label:"0.5-1 kts",size:.4,color:"#ffff00"},{label:"1-1.5 kts",size:.6,color:"#ff9500"},{label:"1.5-2 kts",size:.8,color:"#f44336"},{label:">= 2 kts",size:1,color:"#e4711e"}],sigWaveHeight:[{label:"< 2 m",color:"rgba(0,235,156,0)"},{label:"2-3 m",color:"rgba(0,235,156,0.4)"},{label:"3-4 m",color:"#ffed00"},{label:"4-5 m",color:"#ff9800"},{label:"5-6 m",color:"#f77800"},{label:"6-7 m",color:"#e4711e"},{label:"7-8 m",color:"#e06128"},{label:"8-9 m",color:"#dc5132"},{label:"9-10 m",color:"#d5453c"},{label:"10-12 m",color:"#cd3a46"},{label:"12-14 m",color:"#be2c50"},{label:"> 14 m",color:"#aa1a5a"}]}}},computed:{listStyle(){return this.simple?{top:this.top+"px",left:this.toggle?"0px":"-280px"}:{top:this.top+"px",right:this.toggle?"0px":"-280px"}},computeDateZ(){return function(e){var t;if(e){const a=C(e);return`${(t=a==null?void 0:a.utc())==null?void 0:t.format("MMM-DD/HHmm")}Z`}return"-"}},computeDateUpdate(){return function(e){return e?C(e).fromNow():"-"}},overlaysKeys(){return this.tagLayers.filter(e=>e.overlays).map(e=>e.key)},rendersKeys(){return this.allLayers.filter(e=>!e.overlays&&e.enabled).map(e=>e.key)},showTipMenu(){return this.checkList.includes("wind")||this.checkList.includes("current-direction")||this.checkList.includes("sig-wave-height")},barbsIconName(){var t,a,r;const e=[];for(let i=0;i<((a=(t=this.legend)==null?void 0:t.barbs)==null?void 0:a.length);i++){const l=((r=this.legend)==null?void 0:r.barbs[i])||0,n=l<10?`00${l}kts`:l<100?`0${l}kts`:`${l}kts`;e.push("icon-a-"+n)}return e}},watch:{"menuToggle.v":{handler(){this.toggle=this.menuToggle.weatherLayers,this.$nextTick(()=>{var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)})}},currentModel:{handler(e,t){this.$emit("forecastModel",e),localStorage.setItem("forecastModelCacheGL4",e)},immediate:!0},forecastModel:{handler(e,t){e&&e!==t&&this.handleWeatherLayerChange({sourceChanged:!0})}},map:{handler(){this.map&&(this.fetchCache(),this.map.on("move",this.handleMove4Weather),this.viewport=new Eo(this.map),this.handleRampColorInitial())},immediate:!0},realTime:{handler(e,t){e&&t&&C(e).utc().format("yyyy-MM-DD HH")!==C(t).utc().format("yyyy-MM-DD HH")&&this.$nextTick(()=>{this.fetchWeatherLayers()})},immediate:!0},renderKey:{handler(e,t){e&&e!==t?e==="wave-group"?this.checkList=["wave-group",this.waveToggleValue||"sig-wave"]:e==="ice-forecast"?this.checkList=["ice-forecast",this.iceToggleValue||"ice-cover"]:this.checkList=[e]:!e&&t&&(this.checkList=this.checkList.filter(a=>a!==t))}},checkList:{handler(e,t){var a,r,i,l,n,c;this.handleCheckListChange(e,t),this.$emit("weatherCheckList",e),this.autoActive&&this.checkList.length?(i=(r=(a=this.$parent)==null?void 0:a.$refs)==null?void 0:r.idmBottomBar)==null||i.handleToggle("weather",!0):(c=(n=(l=this.$parent)==null?void 0:l.$refs)==null?void 0:n.idmBottomBar)==null||c.handleToggle("weather",!1)}},autoActive:{handler(e){var t,a,r,i,l,n;localStorage.setItem(this.cache.autoActiveKey,this.autoActive),this.activeWeatherLayers=this.autoActive?this.allLayers.filter(c=>this.checkList.includes(c.key)):[],this.handleWeatherLayerChange(),this.autoActive&&this.checkList.length?(r=(a=(t=this.$parent)==null?void 0:t.$refs)==null?void 0:a.idmBottomBar)==null||r.handleToggle("weather",!0):(n=(l=(i=this.$parent)==null?void 0:i.$refs)==null?void 0:l.idmBottomBar)==null||n.handleToggle("weather",!1),this.$emit("autoActive",this.autoActive)}},iceToggleValue:{handler(e){e&&(this.checkList=["ice-forecast",this.iceToggleValue])}},waveToggleValue:{handler(e){e&&(this.checkList=["wave-group",this.waveToggleValue])}},showWindParticle:{handler(e){let t="wind-particle";this.weatherLayers[t].particle=e,this.weatherLayers[t].version=Math.random()+1}},showCurrentParticle:{handler(e){let t="current-particle";this.weatherLayers[t].particle=e,this.weatherLayers[t].version=Math.random()+1}},isLogin:{handler(e){e?this.fetchModels():this.models={}},immediate:!0}},mounted(){this.fetchModels()},methods:{arraysEqual(e,t){if((e==null?void 0:e.length)!==(t==null?void 0:t.length))return!1;for(let a=0;a<(e==null?void 0:e.length);a++)if((e==null?void 0:e[a])!==(t==null?void 0:t[a]))return!1;return!0},fetchCache(){var a,r;const e=localStorage.getItem(this.cache.versionKey);this.cache.v!==e&&(localStorage.removeItem(this.cache.autoActiveKey),localStorage.removeItem(this.cache.checkListKey),localStorage.setItem(this.cache.versionKey,this.cache.v));let t=localStorage.getItem(this.cache.autoActiveKey);this.autoActive=t!=="false",localStorage.setItem(this.cache.autoActiveKey,this.autoActive),t=localStorage.getItem(this.cache.checkListKey),this.waveToggleValue=(a=JSON.parse(t))!=null&&a.some(i=>i==="swell")?"swell":void 0,this.iceToggleValue=(r=JSON.parse(t))!=null&&r.some(i=>i==="ice-thickness")?"ice-thickness":void 0,this.checkList=JSON.parse(t||JSON.stringify(["wind","sig-wave-height"])),this.checkList.find(i=>this.rendersKeys.includes(i))&&(this.renderKey=this.checkList.find(i=>this.rendersKeys.includes(i))),localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList))},handleMenuToggle(){this.$emit("menuToggle","weatherLayers")},handleFastWeatherToggle(e){let t=[];this.checkList.includes(e)?t=this.checkList.filter(a=>a!==e):t=[...this.checkList,e],this.handleCheckListChange(t,this.checkList)},handleCheckListChange(e,t){if(this.arraysEqual(e,t))return!1;const a=[...new Set(e)],r=a==null?void 0:a.filter(l=>!(t!=null&&t.includes(l)))[0],i=t==null?void 0:t.filter(l=>!(a!=null&&a.includes(l)))[0];r&&(r==="ice-cover"||r==="ice-thickness"||r==="ice-forecast"?(this.checkList=["ice-forecast",this.iceToggleValue||"ice-cover"],this.iceToggleValue=this.iceToggleValue||"ice-cover"):r==="sig-wave"||r==="swell"||r==="wave-group"?(this.checkList=["wave-group",this.waveToggleValue||"sig-wave"],this.waveToggleValue=this.waveToggleValue||"sig-wave"):this.rendersKeys.includes(r)?this.checkList=[r]:(this.checkList=a.filter(l=>!this.rendersKeys.includes(l)),this.renderKey=void 0)),i&&(i==="ice-forecast"?(this.checkList=a.filter(l=>!["ice-cover","ice-thickness","ice-forecast"].includes(l)),this.iceToggleValue=void 0):i==="wave-group"?(this.checkList=a.filter(l=>!["wave-group","sig-wave","swell"].includes(l)),this.waveToggleValue=void 0):this.checkList=a),this.checkList.includes("wind-particle")&&(this.showWindParticle=!0),this.checkList.includes("current-particle")&&(this.showCurrentParticle=!0),localStorage.setItem(this.cache.checkListKey,JSON.stringify(a)),this.activeWeatherLayers=this.autoActive?this.allLayers.filter(l=>a.includes(l.key)):[],this.handleWeatherLayerChange()},async fetchModels(){this.models={};const e=await ge.get(`${this.gateway}/api/arc/meteo2/models2`,{headers:{Authorization:this.defaultMeteoToken}});(e==null?void 0:e.data.code)===0&&(this.models=e==null?void 0:e.data.data)},async fetchWeatherLayers(e={}){var i,l,n,c,s,d,m,g,u;const t=new Date().valueOf();let a=0,r=0;if(this.map){const y=((i=this.map)==null?void 0:i.getZoom())+1,f=(l=this.map)==null?void 0:l.getBounds(),h=`${f._sw.lng},${f._sw.lat},${f._ne.lng},${f._ne.lat}`;if(this.particleFactor&&((n=this.$refs.layer)!=null&&n.autoActive)){const p=je.LayerHelper.WEATHER_LAYERS.find(w=>{var x;return((x=w.peer)==null?void 0:x.weight)===this.particleFactor.weight});this.particleFactor.particle&&(this.showWindParticle||this.showCurrentParticle)?this.weatherWeight=this.weatherWeight&p.weight?this.weatherWeight:this.weatherWeight+p.weight:this.weatherWeight=this.weatherWeight&p.weight?this.weatherWeight-p.weight:this.weatherWeight}if(this.weatherWeight>0){let p=this.weatherWeight;if(p>0){const w=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],x=await ge.get(`${w}/api/arc/weather/layers2/links?l=${p}&v=${this.forecastModel}&z=${y}&bbox=${h}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(r=new Date().valueOf()-(t+a),console.log("weather links elapsed: ",r,", total: ",a+=r),((c=x==null?void 0:x.data)==null?void 0:c.code)===0){const b=(s=x==null?void 0:x.data)==null?void 0:s.data,k=[];for(const _ in b)k.push(ge.get(b[_],{headers:{Authorization:this.defaultMeteoToken,key:_},responseType:/\.(jpg|png)$/.test(b[_])?"blob":"json"}).catch(z=>{console.log(`[${_}] fetch layer error: ${z}`)}));const L=await Promise.all(k);this.weatherLayers={},L.map(_=>{var M,T,E,I;const z=((M=_==null?void 0:_.data)==null?void 0:M.data)||(_==null?void 0:_.data);let S=(E=(T=_==null?void 0:_.config)==null?void 0:T.headers)==null?void 0:E.key;S&&z&&(this.weatherLayers[S]={raw:z,type:((I=_==null?void 0:_.config)==null?void 0:I.responseType)==="blob"?"image":"json",etime:x.data.etime})})}if(r=new Date().valueOf()-(t+a),console.log("weather layers elapsed: ",r,", total: ",a+=r),this.weatherLayers["swell-direction"]||this.weatherLayers["swell-height"]){const b=(d=this.weatherLayers["swell-direction"])==null?void 0:d.raw,k=(m=this.weatherLayers["swell-height"])==null?void 0:m.raw;delete this.weatherLayers["swell-direction"],delete this.weatherLayers["swell-height"],this.weatherLayers.swell={type:"json",direction:b,height:{raw:k},etime:x.data.etime}}if(this.weatherLayers["current-direction"]||this.weatherLayers["current-speed"]){const b=(g=this.weatherLayers["current-direction"])==null?void 0:g.raw,k=(u=this.weatherLayers["current-speed"])==null?void 0:u.raw;delete this.weatherLayers["current-direction"],delete this.weatherLayers["current-speed"],this.weatherLayers.current={type:"json",direction:b,speed:{raw:k},etime:x.data.etime}}}}this.handleWeatherLayerToggle(),this.handleDrawWeather4Json(),this.$nextTick(()=>{var p,w,x,b,k;(k=(b=(x=(w=(p=this.$parent)==null?void 0:p.$refs)==null?void 0:w.idmBottomBar)==null?void 0:x.$refs)==null?void 0:b.capture)==null||k.captureCurrentFrame()})}},handleWeatherLayerToggle(){for(const e in this.weatherLayers)this.weatherLayers[e].active=!1,this.weatherLayers[e].version=Math.random()+1;for(const e of this.activeWeatherLayers){let t=e.key;t==="current-direction"&&(t="current"),this.weatherLayers[t]&&(this.weatherLayers[t].active=!0,this.weatherLayers[t].version=Math.random()+1,t==="wind-particle"&&(this.weatherLayers[t].particle=this.showWindParticle),t==="current-particle"&&(this.weatherLayers[t].particle=this.showCurrentParticle))}},handleWeatherLayerChange(e={sourceChanged:!1}){var a;const t=(a=this.activeWeatherLayers)==null?void 0:a.reduce((r,i)=>r+(r&(i==null?void 0:i.weight)?0:i==null?void 0:i.weight),0);e!=null&&e.sourceChanged||this.weatherWeight!==t?(this.weatherWeight=t,this.fetchWeatherLayers()):this.handleWeatherLayerToggle()},handleRampColorInitial(){var e,t,a,r,i,l,n,c,s,d,m,g;this.viewport.map.getSource((e=this.viewport)==null?void 0:e.rampColorSource)||this.viewport.map.addSource((t=this.viewport)==null?void 0:t.rampColorSource,{type:"canvas",canvas:(a=this.viewport)==null?void 0:a.rampColorCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((r=this.viewport)==null?void 0:r.rampColorLayer)||this.viewport.map.addLayer({type:"raster",id:(i=this.viewport)==null?void 0:i.rampColorLayer,source:(l=this.viewport)==null?void 0:l.rampColorSource,layout:{visibility:"none"}},this.beforeLayer),this.viewport.map.getSource((n=this.viewport)==null?void 0:n.particleSource)||this.viewport.map.addSource((c=this.viewport)==null?void 0:c.particleSource,{type:"canvas",canvas:(s=this.viewport)==null?void 0:s.particleCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((d=this.viewport)==null?void 0:d.particleLayer)||this.viewport.map.addLayer({type:"raster",id:(m=this.viewport)==null?void 0:m.particleLayer,source:(g=this.viewport)==null?void 0:g.particleSource,layout:{visibility:"none"}},this.beforeLayer)},handleDrawWeather4Json(){var l,n,c,s,d,m,g;const e=new Date().valueOf();let t=0,a=0;const r=(l=this.map)==null?void 0:l.getBounds(),i=(n=this.map)==null?void 0:n.getZoom();if(r&&i){const u=X.LngLatHelper.convertToStdLng(r._sw.lng),y=X.LngLatHelper.convertToStdLng(r._ne.lng),f=Math.floor(r._sw.lat),h=Math.ceil(r._ne.lat);for(const p in this.weatherLayers){let w=!1;if(this.weatherLayers[p].active&&this.weatherLayers[p].type==="json"){let x=[];if(p==="swell"){w=!0;const b=((c=this.weatherLayers[p])==null?void 0:c.direction)||{};for(const L in b)if(L>f&&L<h&&(!(i<=this.zoom)||L%(i<2?10:i<4?5:3)===0)){const _=b[L].lng;u>y?_.forEach((z,S)=>{var M,T,E,I,G,j;if(i<2){if((z>=0&&z<=360||z>=-360&&z<=0)&&z%10===0){const H=J.point([z,L],{val:((M=b[L].val)==null?void 0:M[S])||((T=b[L].dir)==null?void 0:T[S]),spd:(E=b[L].spd)==null?void 0:E[S]});x.push(H)}}else if((z>=u&&z<=180||z>=-180&&z<=y)&&(!(i<=this.zoom)||z%(i<2?10:i<4?5:3)===0)){const H=J.point([z,L],{val:((I=b[L].val)==null?void 0:I[S])||((G=b[L].dir)==null?void 0:G[S]),spd:(j=b[L].spd)==null?void 0:j[S]});x.push(H)}}):_.forEach((z,S)=>{var M,T,E,I,G,j;if(u<2){if((z>=0&&z<=360||z>=-360&&z<=0)&&z%10===0){const H=J.point([z,L],{val:((M=b[L].val)==null?void 0:M[S])||((T=b[L].dir)==null?void 0:T[S]),spd:(E=b[L].spd)==null?void 0:E[S]});x.push(H)}}else if(z>=u&&z<=y&&(!(i<=this.zoom)||z%(i<2?10:i<4?5:3)===0)){const H=J.point([z,L],{val:((I=b[L].val)==null?void 0:I[S])||((G=b[L].dir)==null?void 0:G[S]),spd:(j=b[L].spd)==null?void 0:j[S]});x.push(H)}})}a=new Date().valueOf()-(e+t),console.log("swell direction elapsed: ",a,", total: ",t+=a);const k=this.weatherLayers[p].height;if(k){if(!k.data){const L=[];for(const _ in(s=k.raw)==null?void 0:s.LineString){const z=k.raw.LineString[_];for(const S of z)L.push(J.lineString(S,{val:Number(_)}));k.data=J.featureCollection(L)}}if(k.data){const L=this.handleBboxClip(k.data,r);x=x.concat(L)}a=new Date().valueOf()-(e+t),console.log("swell height elapsed: ",a,", total: ",t+=a)}}else if(p==="current"){w=!0;const b=((d=this.weatherLayers[p])==null?void 0:d.direction)||{};for(const L in b)if(L>f&&L<h&&(!(i<=this.zoom)||L%(i<2?10:i<4?5:3)===0)){const _=b[L].lng;u>y?_.forEach((z,S)=>{var M,T,E,I,G,j;if(i<2){if((z>=0&&z<=360||z>=-360&&z<=0)&&z%10===0){const H=J.point([z,L],{val:((M=b[L].val)==null?void 0:M[S])||((T=b[L].dir)==null?void 0:T[S]),spd:(E=b[L].spd)==null?void 0:E[S]});x.push(H)}}else if((z>=u&&z<=180||z>=-180&&z<=y)&&(!(i<=this.zoom)||z%(i<2?10:i<4?5:3)===0)){const H=J.point([z,L],{val:((I=b[L].val)==null?void 0:I[S])||((G=b[L].dir)==null?void 0:G[S]),spd:(j=b[L].spd)==null?void 0:j[S]});x.push(H)}}):_.forEach((z,S)=>{var M,T,E,I,G,j;if(u<2){if((z>=0&&z<=360||z>=-360&&z<=0)&&z%10===0){const H=J.point([z,L],{val:((M=b[L].val)==null?void 0:M[S])||((T=b[L].dir)==null?void 0:T[S]),spd:(E=b[L].spd)==null?void 0:E[S]});x.push(H)}}else if(z>=u&&z<=y&&(!(i<=this.zoom)||z%(i<this.zoom/2?5:3)===0)){const H=J.point([z,L],{val:((I=b[L].val)==null?void 0:I[S])||((G=b[L].dir)==null?void 0:G[S]),spd:(j=b[L].spd)==null?void 0:j[S]});x.push(H)}})}a=new Date().valueOf()-(e+t),console.log("current direction elapsed: ",a,", total: ",t+=a);const k=this.weatherLayers[p].speed;if(k){if(!k.data){const _=[];for(const z in(m=k.raw)==null?void 0:m.Polygon){const S=k.raw.Polygon[z];for(const M of S)_.push(J.polygon(M,{val:Number(z)}))}k.data=J.featureCollection(_)}const L=i<this.zoom?k.data.features.filter(_=>_.properties.val>.5):k.data.features;x=x.concat(L),a=new Date().valueOf()-(e+t),console.log("current speed elapsed: ",a,", total: ",t+=a)}}else if(p==="wind"){w=!0;const b=this.weatherLayers.wind.raw;for(const k in b)if(k>f&&k<h&&(!(i<=this.zoom)||k%(i<2?10:i<4?5:3)===0)){const L=b[k].lng;u>y?L.forEach((_,z)=>{var S,M,T,E;if(i<2){if((_>=0&&_<=360||_>=-360&&_<=0)&&_%10===0){const I=J.point([_,k],{dir:((S=b[k].val)==null?void 0:S[z])||((M=b[k].dir)==null?void 0:M[z]),spd:b[k].spd[z]});x.push(I)}}else if((_>=u&&_<=180||_>=-180&&_<=y)&&(!(i<=this.zoom)||_%(i<2?10:i<4?5:3)===0)){const I=J.point([_,k],{dir:((T=b[k].val)==null?void 0:T[z])||((E=b[k].dir)==null?void 0:E[z]),spd:b[k].spd[z]});x.push(I)}}):L.forEach((_,z)=>{var S,M,T,E;if(i<2){if((_>=0&&_<=360||_>=-360&&_<=0)&&_%10===0){const I=J.point([_,k],{dir:((S=b[k].val)==null?void 0:S[z])||((M=b[k].dir)==null?void 0:M[z]),spd:b[k].spd[z]});x.push(I)}}else if(_>=u&&_<=y&&(!(i<=this.zoom)||_%(i<2?10:i<4?5:3)===0)){const I=J.point([_,k],{dir:((T=b[k].val)==null?void 0:T[z])||((E=b[k].dir)==null?void 0:E[z]),spd:b[k].spd[z]});x.push(I)}})}a=new Date().valueOf()-(e+t),console.log("wind barb elapsed: ",a,", total: ",t+=a)}else if(p==="sig-wave-height"){if(this.weatherLayers[p].data)x=this.weatherLayers[p].data;else{w=!0;const b=this.weatherLayers[p].raw;if(b){const k=[];for(const L in b.Polygon){const _=b.Polygon[L];for(const z of _)k.push(J.polygon(z,{val:Number(L)}))}for(const L in b.MultiPolygon){const _=b.MultiPolygon[L];for(const z of _)k.push(J.multiPolygon(z,{val:Number(L)}))}for(const L in b.Point){const _=b.Point[L];for(let z=0;z<((g=_.lng)==null?void 0:g.length);z++)k.push(J.point([_.lng[z],L],{val:Number(_.val[z])}))}x=x.concat(k)}}a=new Date().valueOf()-(e+t),console.log("sig-wave-height elapsed: ",a,", total: ",t+=a)}else if(p==="prmsl"){if(this.weatherLayers[p].data)x=this.weatherLayers[p].data;else{w=!0;const b=this.weatherLayers[p].raw;if(b){const k=[];for(const L in b.LineString){const _=b.LineString[L];for(const z of _)k.push(J.lineString(z,{val:Number(L)}))}for(const L in b.Point)b.Point[L].lng.forEach((_,z)=>{_=X.LngLatHelper.convertToStdLng(_),k.push(J.point([_,L],{val:b.Point[L].val[z],type:b.Point[L].type[z]}))});x=x.concat(k)}}a=new Date().valueOf()-(e+t),console.log("prmsl elapsed: ",a,", total: ",t+=a)}x.length&&(this.weatherLayers[p].data=J.featureCollection(x)),w&&(this.weatherLayers[p].version=Math.random()+1)}}}},handleMove4Weather(){for(const e in this.weatherLayers)this.weatherLayers[e].active&&this.weatherLayers[e].type==="image"&&(this.weatherLayers[e].active=!0,this.weatherLayers[e].version=Math.random()+1);this.handleDrawWeather4Json()},handleBboxClip(e,t){const a=[],r=X.LngLatHelper.convertToStdLng(t._sw.lng),i=X.LngLatHelper.convertToStdLng(t._ne.lng);return e.features.forEach(l=>{if(l.geometry.type!=="Point")if(r>i){let n=[r,t._sw.lat,180,t._ne.lat],c=J.bboxClip(l,n);c.geometry.coordinates.length&&a.push(c),n=[-180,t._sw.lat,i,t._ne.lat],c=J.bboxClip(l,n),c.geometry.coordinates.length&&a.push(c)}else{const n=[r,t._sw.lat,i,t._ne.lat],c=J.bboxClip(l,n);c.geometry.coordinates.length&&a.push(c)}else a.push(l)}),a}}},Bc={class:"idm-gl4-meteo-layers"},Ic={key:0,class:"legend-tip-btn-gl4"},Ac={class:"d-flex flex-row justify-center align-center"},Fc={class:"text-caption"},Gc={class:"d-flex flex-row justify-center align-center"},Wc={key:0,style:{width:"24px",height:"12px",border:"1px solid rgba(var(--v-border-color), var(--v-border-opacity))"}},Zc={class:"text-caption px-2"},Oc={class:"d-flex flex-row justify-start align-center"},jc={class:"d-flex flex-row justify-center align-center",style:{width:"40px"}},Xc={class:"text-caption"},Hc={class:"d-flex justify-start align-center ga-3"},Yc={class:"text-h5 font-weight-medium"},Uc={key:0,class:"w-100 d-flex justify-space-between align-center ga-1 mb-2 px-3"},Jc={key:0,class:"d-flex justify-start align-center ga-4 pl-6"},$c={key:1,class:"d-flex justify-start align-center ga-4 pl-6"},Kc={class:"text-body-1 py-2"},qc={class:"text-body-1 font-weight-medium"},Qc={class:"text-body-2 text-label"},em={class:"text-body-2 text-label"},tm={class:"text-body-2 text-label mb-3"},om={class:"text-body-1 font-weight-medium"},am={class:"text-body-2 text-label"},im={class:"text-body-2 text-label"},rm={class:"text-body-2 text-label mb-3"},lm={class:"text-body-1 py-2"},nm={class:"text-body-1 font-weight-medium"},sm={class:"text-body-2 text-label"},cm={class:"text-body-2 text-label"},mm={class:"text-body-2 text-label mb-3"},dm={class:"text-body-1 font-weight-medium"},hm={class:"text-body-2 text-label"},pm={class:"text-body-2 text-label"},gm={class:"text-body-2 text-label mb-3"},um={class:"text-body-1 py-2"},fm={class:"text-body-1 font-weight-medium"},ym={class:"text-body-2 text-label"},bm={class:"text-body-2 text-label"},wm={class:"text-body-2 text-label mb-3"};function xm(e,t,a,r,i,l){var A,F,Y,D,R,Z,P,K,re,me,he,ee,le,de,we;const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VTooltip"),s=o.resolveComponent("VCol"),d=o.resolveComponent("VRow"),m=o.resolveComponent("VCardText"),g=o.resolveComponent("VDivider"),u=o.resolveComponent("VCard"),y=o.resolveComponent("VSwitch"),f=o.resolveComponent("VBtnToggle"),h=o.resolveComponent("VCardTitle"),p=o.resolveComponent("VCardItem"),w=o.resolveComponent("VCheckbox"),x=o.resolveComponent("VRadio"),b=o.resolveComponent("IdmWindBarb"),k=o.resolveComponent("IdmSigWaveHeight"),L=o.resolveComponent("IdmCurrentDirection"),_=o.resolveComponent("IdmPrmsl"),z=o.resolveComponent("IdmWindParticle"),S=o.resolveComponent("IdmCurrentParticle"),M=o.resolveComponent("IdmWave"),T=o.resolveComponent("IdmSwell"),E=o.resolveComponent("IdmIceEdge"),I=o.resolveComponent("IdmIceCover"),G=o.resolveComponent("IdmIceThickness"),j=o.resolveComponent("IdmPrecip3h"),H=o.resolveComponent("IdmVisibility"),ae=o.resolveComponent("IdmWaterTemp"),N=o.resolveComponent("IdmTemp");return o.openBlock(),o.createElementBlock("div",Bc,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+46+"px",right:i.right+"px"})},[o.createVNode(c,{text:e.$t("weather.weatherLayers"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:W})=>[o.createVNode(n,o.mergeProps(W,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>t[9]||(t[9]=[o.createElementVNode("i",{class:"iconfont icon-Weather text-h4"},null,-1)])),_:2,__:[9]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4),l.showTipMenu?(o.openBlock(),o.createElementBlock("div",Ic,[o.createElementVNode("div",{class:o.normalizeClass(["menu-bar-box pa-1 rounded",a.simple?"simple":""]),style:o.normalizeStyle({right:i.right+"px",top:a.simple?"354px":"450px"})},[o.createVNode(c,{text:e.$t("weather.legend"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:W})=>[o.createVNode(n,o.mergeProps(W,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.legendToggle?"bg-primary active-border":""],onClick:t[0]||(t[0]=te=>i.legendToggle=!i.legendToggle)}),{default:o.withCtx(()=>t[10]||(t[10]=[o.createElementVNode("i",{class:"iconfont icon-Legend text-h4"},null,-1)])),_:2,__:[10]},1040,["class"])]),_:1},8,["text","open-on-focus","open-on-hover"])],6),i.legendToggle?(o.openBlock(),o.createBlock(u,{key:0,elevation:"16",class:"card-info d-flex justify-center align-start",style:o.normalizeStyle({position:"absolute",top:a.simple?"200px":"340px",right:i.right+50+"px"})},{default:o.withCtx(()=>[o.createVNode(m,{class:"d-flex flex-column justify-center align-start text-label px-2",style:{width:"110px"}},{default:o.withCtx(()=>[t[11]||(t[11]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2"},"Wind Level",-1)),o.createVNode(d,{class:"ma-0 ml-n1 text-body-2"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.barbs,(W,te)=>(o.openBlock(),o.createBlock(s,{key:W,cols:"6",class:"d-flex flex-row justify-start align-center py-1 px-0 ma-0"},{default:o.withCtx(()=>[o.createElementVNode("div",Ac,[o.createElementVNode("i",{class:o.normalizeClass(["iconfont",l.barbsIconName[te]]),style:o.normalizeStyle({color:a.theme==="dark"?"#fff":"#000"})},null,6),o.createElementVNode("span",Fc,o.toDisplayString(Number(W)<10?`00${W}kts`:Number(W)<100?`0${W}kts`:`${W}kts`),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[11]}),o.createVNode(g,{vertical:""}),o.createVNode(m,{class:"d-flex flex-column justify-center align-start text-label px-2",style:{width:"100px"}},{default:o.withCtx(()=>[t[12]||(t[12]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2"},"Wave Height",-1)),o.createVNode(d,{class:"ma-0"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.sigWaveHeight,(W,te)=>(o.openBlock(),o.createBlock(s,{key:te,cols:"12",class:"d-flex flex-row justify-start align-center py-1 px-0 ma-0"},{default:o.withCtx(()=>[o.createElementVNode("div",Gc,[te===0?(o.openBlock(),o.createElementBlock("div",Wc)):(o.openBlock(),o.createElementBlock("div",{key:1,style:o.normalizeStyle({width:"24px",height:"12px",background:W.color})},null,4)),o.createElementVNode("div",Zc,o.toDisplayString(W.label),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[12]}),o.createVNode(g,{vertical:""}),o.createVNode(m,{class:"d-flex flex-column justify-center align-start text-label px-2",style:{width:"90px"}},{default:o.withCtx(()=>[t[13]||(t[13]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2"},"Current",-1)),o.createVNode(d,{class:"ma-0 ml-n4"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.current,(W,te)=>(o.openBlock(),o.createBlock(s,{key:te,cols:"12",class:"d-flex flex-row justify-center align-center py-1 px-0 ma-0"},{default:o.withCtx(()=>[o.createElementVNode("div",Oc,[o.createElementVNode("div",jc,[o.createElementVNode("i",{class:"iconfont icon-a-direction-arrow text-label",style:o.normalizeStyle({fontSize:40*W.size+"px"})},null,4)]),o.createElementVNode("div",Xc,o.toDisplayString(W.label),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[13]})]),_:1},8,["style"])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["available-layers transition d-flex flex-column justify-start align-start",i.toggle?"right-bar":""]),style:o.normalizeStyle(l.listStyle)},[o.createElementVNode("div",{class:o.normalizeClass(["header-box w-100 d-flex justify-space-between align-center",a.simple?"px-3":"px-4"])},[o.createElementVNode("div",Hc,[o.createElementVNode("div",Yc,o.toDisplayString(e.$t("weather.weather")),1),o.createVNode(y,{modelValue:i.autoActive,"onUpdate:modelValue":t[1]||(t[1]=W=>i.autoActive=W),class:"small-switch",color:"primary","base-color":"disabled",inset:"","hide-details":""},null,8,["modelValue"])]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleMenuToggle},{default:o.withCtx(()=>t[14]||(t[14]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[14]},8,["onClick"])],2),a.simple?(o.openBlock(),o.createElementBlock("div",Uc,[o.createElementVNode("div",null,o.toDisplayString(e.$t("weather.forecastModel")),1),o.createVNode(f,{modelValue:i.currentModel,"onUpdate:modelValue":t[2]||(t[2]=W=>i.currentModel=W),rounded:"",height:"28",density:"compact",group:""},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"28",value:"GFS",class:"text-none btn-bg-2 px-1 text-body-1 mt-1",color:i.currentModel==="GFS"?"primary":"","base-color":""},{default:o.withCtx(()=>t[15]||(t[15]=[o.createTextVNode("NOAA",-1)])),_:1,__:[15]},8,["color"]),o.createVNode(n,{density:"compact",height:"28",class:"text-none btn-bg-2 px-1 text-body-1 mt-1",color:i.currentModel==="ECMWF"?"primary":"","base-color":"",value:"ECMWF"},{default:o.withCtx(()=>t[16]||(t[16]=[o.createTextVNode("ECMWF",-1)])),_:1,__:[16]},8,["color"])]),_:1},8,["modelValue"])])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["list-box w-100 scroll overflow-y-auto",[i.autoActive?"":"cursor-not-allowed",a.simple?"px-3":"pl-4 pr-2"]])},[o.createVNode(u,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(p,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(h,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("weather.overlays")),1)]),_:1})]),_:1}),o.createVNode(m,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(W=>W.overlays),W=>(o.openBlock(),o.createBlock(w,{key:W.key,modelValue:i.checkList,"onUpdate:modelValue":t[3]||(t[3]=te=>i.checkList=te),value:W.key,label:e.$t(`weather.${W.locale}`),disabled:!i.autoActive,color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label","disabled"]))),128))]),_:1})]),_:1}),o.createVNode(u,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(p,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(h,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("weather.renders")),1)]),_:1})]),_:1}),o.createVNode(m,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(W=>!W.overlays),W=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:W.key},[o.createVNode(x,{modelValue:i.renderKey,"onUpdate:modelValue":t[4]||(t[4]=te=>i.renderKey=te),label:e.$t(`weather.${W.locale}`),value:W.key,disabled:!i.autoActive,color:"primary",density:"compact",style:{height:"36px"},class:"text-body-2 py-1","hide-details":"",onClick:te=>i.renderKey=i.renderKey===W.key?"":W.key},null,8,["modelValue","label","value","disabled","onClick"]),i.renderKey==="wind-particle"&&W.key==="wind-particle"?(o.openBlock(),o.createElementBlock("div",Jc,[o.createElementVNode("span",null,o.toDisplayString(e.$t("weather.particleAnimatiom")),1),o.createVNode(y,{modelValue:i.showWindParticle,"onUpdate:modelValue":t[5]||(t[5]=te=>i.showWindParticle=te),label:"",class:"small-switch",color:"primary","base-color":"disabled",density:"compact",inset:"",style:{"font-size":"14px"},"hide-details":""},null,8,["modelValue"])])):o.createCommentVNode("",!0),i.renderKey==="current-particle"&&W.key==="current-particle"?(o.openBlock(),o.createElementBlock("div",$c,[o.createElementVNode("span",null,o.toDisplayString(e.$t("weather.particleAnimatiom")),1),o.createVNode(y,{modelValue:i.showCurrentParticle,"onUpdate:modelValue":t[6]||(t[6]=te=>i.showCurrentParticle=te),label:"",class:"small-switch",color:"primary","base-color":"disabled",inset:"",density:"compact",height:"20","hide-details":""},null,8,["modelValue"])])):o.createCommentVNode("",!0),i.renderKey==="wave-group"&&W.key==="wave-group"?(o.openBlock(),o.createBlock(f,{key:2,modelValue:i.waveToggleValue,"onUpdate:modelValue":t[7]||(t[7]=te=>i.waveToggleValue=te),class:"w-100 pl-7 rounded",rounded:"0",height:"30",density:"compact",group:"",disabled:!i.autoActive},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"30",value:"sig-wave",class:"w-50 text-none px-2 text-body-1",color:i.waveToggleValue==="sig-wave"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("weather.significant")),1)]),_:1},8,["color","disabled"]),o.createVNode(n,{density:"compact",height:"30",class:"w-50 text-none px-2 text-body-1",color:i.waveToggleValue==="swell"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive,value:"swell"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("weather.swell")),1)]),_:1},8,["color","disabled"])]),_:1},8,["modelValue","disabled"])):o.createCommentVNode("",!0),i.renderKey==="ice-forecast"&&W.key==="ice-forecast"?(o.openBlock(),o.createBlock(f,{key:3,modelValue:i.iceToggleValue,"onUpdate:modelValue":t[8]||(t[8]=te=>i.iceToggleValue=te),class:"w-100 pl-7 rounded",rounded:"0",height:"30",density:"compact",group:"",disabled:!i.autoActive},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"30",value:"ice-cover",class:"w-50 text-none px-2 text-body-1",color:i.iceToggleValue==="ice-cover"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("weather.coverage")),1)]),_:1},8,["color","disabled"]),o.createVNode(n,{density:"compact",height:"30",class:"w-50 text-none px-2 text-body-1",color:i.iceToggleValue==="ice-thickness"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive,value:"ice-thickness"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("weather.thickness")),1)]),_:1},8,["color","disabled"])]),_:1},8,["modelValue","disabled"])):o.createCommentVNode("",!0)],64))),128))]),_:1})]),_:1}),o.createVNode(u,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(p,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(h,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("weather.forecastModel")),1)]),_:1})]),_:1}),o.createVNode(m,{class:""},{default:o.withCtx(()=>{var W,te,Te,Le,fe,xe,U,ye,ie,ne,Se,Ee,Ve,B,se,ke,Ne,Pe,O,Ce,q,We,Ze,Oe,ve,at,it,rt,lt,nt,st,ct,mt,dt,ht,pt,gt,ut,ft,yt,bt,wt,xt,kt,_t,vt,zt,Lt,Ct,St,Nt,Pt,Mt,Tt,Vt,Et,Rt,Dt,Bt,It,At,Ft,Gt,Wt,Zt,Ot,jt,Xt,Ht,Yt,Ut,Jt,Kt,qt,Qt,eo,to,oo,ao,io,ro,lo,no,so,co,mo,ho,po,go,uo,fo,yo,bo,wo,xo,ko,_o,vo,zo,Lo,Co,So,No,Po,Mo;return[o.createElementVNode("div",Kc,o.toDisplayString(e.$t("weather.atmospheric")),1),o.createElementVNode("div",qc,o.toDisplayString((Te=(te=(W=i.models)==null?void 0:W.weather)==null?void 0:te.NOAA)==null?void 0:Te.source)+" "+o.toDisplayString((xe=(fe=(Le=i.models)==null?void 0:Le.weather)==null?void 0:fe.NOAA)==null?void 0:xe.spatialResolution)+o.toDisplayString(e.$t("units.km"))+" "+o.toDisplayString((ne=(ie=(ye=(U=i.models)==null?void 0:U.weather)==null?void 0:ye.NOAA)==null?void 0:ie.meta)==null?void 0:ne.days)+o.toDisplayString(e.$t("units.days")),1),o.createElementVNode("div",Qc,o.toDisplayString(e.$t("weather.source"))+": NOAA",1),o.createElementVNode("div",em,o.toDisplayString(e.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((B=(Ve=(Ee=(Se=i.models)==null?void 0:Se.weather)==null?void 0:Ee.NOAA)==null?void 0:Ve.meta)==null?void 0:B.availabilityTime)),1),o.createElementVNode("div",tm,o.toDisplayString(e.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((Pe=(Ne=(ke=(se=i.models)==null?void 0:se.weather)==null?void 0:ke.NOAA)==null?void 0:Ne.meta)==null?void 0:Pe.initialisationTime)),1),o.createElementVNode("div",om,o.toDisplayString((q=(Ce=(O=i.models)==null?void 0:O.weather)==null?void 0:Ce.ECMWF)==null?void 0:q.source)+" "+o.toDisplayString((Oe=(Ze=(We=i.models)==null?void 0:We.weather)==null?void 0:Ze.ECMWF)==null?void 0:Oe.spatialResolution)+o.toDisplayString(e.$t("units.km"))+" "+o.toDisplayString((rt=(it=(at=(ve=i.models)==null?void 0:ve.weather)==null?void 0:at.ECMWF)==null?void 0:it.meta)==null?void 0:rt.days)+o.toDisplayString(e.$t("units.days")),1),o.createElementVNode("div",am,o.toDisplayString(e.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",im,o.toDisplayString(e.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((ct=(st=(nt=(lt=i.models)==null?void 0:lt.weather)==null?void 0:nt.ECMWF)==null?void 0:st.meta)==null?void 0:ct.availabilityTime)),1),o.createElementVNode("div",rm,o.toDisplayString(e.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((pt=(ht=(dt=(mt=i.models)==null?void 0:mt.weather)==null?void 0:dt.ECMWF)==null?void 0:ht.meta)==null?void 0:pt.initialisationTime)),1),o.createVNode(g),o.createElementVNode("div",lm,o.toDisplayString(e.$t("weather.wave")),1),o.createElementVNode("div",nm,o.toDisplayString((yt=(ft=(ut=(gt=i.models)==null?void 0:gt.marine)==null?void 0:ut.wave)==null?void 0:ft.NOAA)==null?void 0:yt.source)+" "+o.toDisplayString((kt=(xt=(wt=(bt=i.models)==null?void 0:bt.marine)==null?void 0:wt.wave)==null?void 0:xt.NOAA)==null?void 0:kt.spatialResolution)+o.toDisplayString(e.$t("units.km"))+" "+o.toDisplayString((Ct=(Lt=(zt=(vt=(_t=i.models)==null?void 0:_t.marine)==null?void 0:vt.wave)==null?void 0:zt.NOAA)==null?void 0:Lt.meta)==null?void 0:Ct.days)+o.toDisplayString(e.$t("units.days")),1),o.createElementVNode("div",sm,o.toDisplayString(e.$t("weather.source"))+": NOAA",1),o.createElementVNode("div",cm,o.toDisplayString(e.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((Tt=(Mt=(Pt=(Nt=(St=i.models)==null?void 0:St.marine)==null?void 0:Nt.wave)==null?void 0:Pt.NOAA)==null?void 0:Mt.meta)==null?void 0:Tt.availabilityTime)),1),o.createElementVNode("div",mm,o.toDisplayString(e.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((Bt=(Dt=(Rt=(Et=(Vt=i.models)==null?void 0:Vt.marine)==null?void 0:Et.wave)==null?void 0:Rt.NOAA)==null?void 0:Dt.meta)==null?void 0:Bt.initialisationTime)),1),o.createElementVNode("div",dm,o.toDisplayString((Gt=(Ft=(At=(It=i.models)==null?void 0:It.marine)==null?void 0:At.wave)==null?void 0:Ft.ECMWF)==null?void 0:Gt.source)+" "+o.toDisplayString((jt=(Ot=(Zt=(Wt=i.models)==null?void 0:Wt.marine)==null?void 0:Zt.wave)==null?void 0:Ot.ECMWF)==null?void 0:jt.spatialResolution)+o.toDisplayString(e.$t("units.km"))+" "+o.toDisplayString((Jt=(Ut=(Yt=(Ht=(Xt=i.models)==null?void 0:Xt.marine)==null?void 0:Ht.wave)==null?void 0:Yt.ECMWF)==null?void 0:Ut.meta)==null?void 0:Jt.days)+o.toDisplayString(e.$t("units.days")),1),o.createElementVNode("div",hm,o.toDisplayString(e.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",pm,o.toDisplayString(e.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((to=(eo=(Qt=(qt=(Kt=i.models)==null?void 0:Kt.marine)==null?void 0:qt.wave)==null?void 0:Qt.ECMWF)==null?void 0:eo.meta)==null?void 0:to.availabilityTime)),1),o.createElementVNode("div",gm,o.toDisplayString(e.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((lo=(ro=(io=(ao=(oo=i.models)==null?void 0:oo.marine)==null?void 0:ao.wave)==null?void 0:io.ECMWF)==null?void 0:ro.meta)==null?void 0:lo.initialisationTime)),1),o.createVNode(g),o.createElementVNode("div",um,o.toDisplayString(e.$t("weather.currents")),1),o.createElementVNode("div",fm,o.toDisplayString((mo=(co=(so=(no=i.models)==null?void 0:no.marine)==null?void 0:so.current)==null?void 0:co.ECMWF)==null?void 0:mo.source)+" "+o.toDisplayString((uo=(go=(po=(ho=i.models)==null?void 0:ho.marine)==null?void 0:po.current)==null?void 0:go.ECMWF)==null?void 0:uo.spatialResolution)+o.toDisplayString(e.$t("units.km"))+" "+o.toDisplayString((xo=(wo=(bo=(yo=(fo=i.models)==null?void 0:fo.marine)==null?void 0:yo.current)==null?void 0:bo.ECMWF)==null?void 0:wo.meta)==null?void 0:xo.days)+o.toDisplayString(e.$t("units.days")),1),o.createElementVNode("div",ym,o.toDisplayString(e.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",bm,o.toDisplayString(e.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((Lo=(zo=(vo=(_o=(ko=i.models)==null?void 0:ko.marine)==null?void 0:_o.current)==null?void 0:vo.ECMWF)==null?void 0:zo.meta)==null?void 0:Lo.availabilityTime)),1),o.createElementVNode("div",wm,o.toDisplayString(e.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((Mo=(Po=(No=(So=(Co=i.models)==null?void 0:Co.marine)==null?void 0:So.current)==null?void 0:No.ECMWF)==null?void 0:Po.meta)==null?void 0:Mo.initialisationTime)),1)]}),_:1})]),_:1})],2)],6),a.map?(o.openBlock(),o.createBlock(b,o.mergeProps({key:1,ref:"windBarb",map:a.map,"map-feather":a.mapFeather,"before-layer":"empty-layer-3",wind:(A=i.weatherLayers)==null?void 0:A.wind,"menu-toggle":a.menuToggle},e.$attrs),null,16,["map","map-feather","wind","menu-toggle"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(k,o.mergeProps({key:2,map:a.map,"before-layer":"empty-layer-2","sig-wave-height":(F=i.weatherLayers)==null?void 0:F["sig-wave-height"],"menu-toggle":a.menuToggle,"active-weather-layers":i.activeWeatherLayers},e.$attrs),null,16,["map","sig-wave-height","menu-toggle","active-weather-layers"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(L,o.mergeProps({key:3,map:a.map,"map-feather":a.mapFeather,"before-layer":"empty-layer-2",current:(Y=i.weatherLayers)==null?void 0:Y.current,"menu-toggle":a.menuToggle},e.$attrs),null,16,["map","map-feather","current","menu-toggle"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(_,o.mergeProps({key:4,map:a.map,"before-layer":"empty-layer-3",prmsl:(D=i.weatherLayers)==null?void 0:D.prmsl,"menu-toggle":a.menuToggle,"active-weather-layers":i.activeWeatherLayers},e.$attrs,{theme:a.theme}),null,16,["map","prmsl","menu-toggle","active-weather-layers","theme"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(z,o.mergeProps({key:5,viewport:i.viewport,factor:(R=i.weatherLayers)==null?void 0:R["wind-particle"],"menu-toggle":a.menuToggle,simple:a.simple},e.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(S,o.mergeProps({key:6,viewport:i.viewport,factor:(Z=i.weatherLayers)==null?void 0:Z["current-particle"],"menu-toggle":a.menuToggle,simple:a.simple},e.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(M,o.mergeProps({key:7,viewport:i.viewport,factor:(P=i.weatherLayers)==null?void 0:P["sig-wave"],"menu-toggle":a.menuToggle,simple:a.simple},e.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(T,o.mergeProps({key:8,map:a.map,viewport:i.viewport,factor:(K=i.weatherLayers)==null?void 0:K.swell,"menu-toggle":a.menuToggle,"active-weather-layers":i.activeWeatherLayers,simple:a.simple},e.$attrs),null,16,["map","viewport","factor","menu-toggle","active-weather-layers","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(E,o.mergeProps({key:9,viewport:i.viewport,factor:(re=i.weatherLayers)==null?void 0:re["ice-edge"],"menu-toggle":a.menuToggle,simple:a.simple},e.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(I,o.mergeProps({key:10,viewport:i.viewport,factor:(me=i.weatherLayers)==null?void 0:me["ice-cover"],"menu-toggle":a.menuToggle,simple:a.simple},e.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(G,o.mergeProps({key:11,viewport:i.viewport,factor:(he=i.weatherLayers)==null?void 0:he["ice-thickness"],"menu-toggle":a.menuToggle,simple:a.simple},e.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(j,o.mergeProps({key:12,viewport:i.viewport,factor:(ee=i.weatherLayers)==null?void 0:ee.precip3h,"menu-toggle":a.menuToggle,simple:a.simple},e.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(H,o.mergeProps({key:13,viewport:i.viewport,factor:(le=i.weatherLayers)==null?void 0:le.visibility,"menu-toggle":a.menuToggle,simple:a.simple},e.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(ae,o.mergeProps({key:14,viewport:i.viewport,factor:(de=i.weatherLayers)==null?void 0:de["water-temp"],"menu-toggle":a.menuToggle,simple:a.simple},e.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(N,o.mergeProps({key:15,viewport:i.viewport,factor:(we=i.weatherLayers)==null?void 0:we.temp,"menu-toggle":a.menuToggle,simple:a.simple},e.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0)])}const km=Q(Dc,[["render",xm]]),$e=[{rank:0,name:"Best Match",alias:"BEST MATCH",model:"best_match",models:["best_match"]},{rank:1,name:"GFS",alias:"GFS",model:"gfs_seamless",provider:"NOAA",country:"United States",resolution:25,tips:"3-25km",length:16,frequency:1,models:["gfs_seamless"],categories:"ncep_gfs013,ncep_gfs025,ncep_gfs_graphcast025,ncep_hrrr_conus,ncep_nbm_conus",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:2,name:"ECMWF",alias:"ECMWF",model:"ecmwf_ifs025",provider:"ECMWF",country:"European Union",resolution:25,tips:"25km",length:15,frequency:6,models:["ecmwf_ifs025","ecmwf_aifs025_single"],categories:"ecmwf_ifs025,ecmwf_aifs025_single",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:3,disabled:!0,name:"ICON",alias:"ECMWF",model:"icon_seamless",provider:"Deutscher Wetterdienst (DWD)",country:"Germany",resolution:13,tips:"2-13km",length:7.5,frequency:3,models:["icon_seamless","icon_global","icon_eu","icon_d2"],categories:"dwd_icon,dwd_icon_eps,dwd_icon_d2,dwd_icon_d2_eps,dwd_icon_eu,dwd_icon_eu_eps",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:4,name:"ARPEGE",disabled:!0,alias:"ECMWF",model:"arpege_seamless",provider:"Météo-France",country:"France",resolution:25,tips:"1-25km",length:4,frequency:1,models:["arpege_seamless","arpege_world","arpege_europe"],categories:"meteofrance_arpege_europe,meteofrance_arpege_europe_probabilities,meteofrance_arpege_world025",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:5,name:"UKMO",disabled:!0,alias:"ECMWF",model:"ukmo_seamless",provider:"UK Met Office",country:"United Kingdom",resolution:10,tips:"2-10km",length:7,frequency:1,models:["ukmo_seamless","ukmo_global_deterministic_10km","ukmo_uk_deterministic_2km"],categories:"ukmo_global_deterministic_10km,ukmo_uk_deterministic_2km",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:6,name:"JMA",disabled:!0,alias:"GFS",model:"jma_seamless",provider:"JMA",country:"Japan",resolution:55,tips:"5-55km",length:11,frequency:3,models:["jma_seamless","jma_msm","jma_gsm"],categories:"jma_gsm,jma_msm",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:7,name:"GEM",disabled:!0,alias:"GFS",model:"gem_seamless",provider:"Canadian Weather Service",country:"Canada",resolution:2.5,tips:"2.5km",length:10,frequency:6,models:["gem_seamless","gem_global","gem_regional"],categories:"cmc_gem_gdps,cmc_gem_hrdps,cmc_gem_rdps",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:8,name:"GRAPES",disabled:!0,alias:"GFS",model:"cma_grapes_global",provider:"China Meteorological Administration (CMA)",country:"China",resolution:15,tips:"15km",length:10,frequency:6,models:["cma_grapes_global"],categories:"cma_grapes_global",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:9,name:"ACCESS-G",disabled:!0,alias:"GFS",model:"bom_access_global",provider:"Australian Bureau of Meteorology (BOM)",country:"Australia",resolution:15,tips:"15km",length:10,frequency:6,models:["bom_access_global"],categories:"bom_access_global",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"}],Ke=[{rank:0,name:"Best Match",alias:"BEST MATCH",model:"best_match",models:["best_match"]},{rank:1,name:"MFWAM",alias:"ECMWF",model:"meteofrance_wave",provider:"MeteoFrance",country:"France",resolution:8,tips:"8km",length:10,frequency:12,models:["meteofrance_wave"],categories:"meteofrance_wave",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:2,disabled:!0,name:"SMOC",alias:"ECMWF",model:"meteofrance_currents",provider:"MeteoFrance",country:"France",resolution:8,tips:"8km",length:10,frequency:24,models:["meteofrance_currents"],categories:"meteofrance_currents, meteofrance_sea_surface_temperature",variables:"ocean_u_current,ocean_v_current,invert_barometer_height,sea_level_height_msl,sea_surface_temperature"},{rank:3,disabled:!0,name:"EWAM",alias:"ECMWF",model:"ewam",provider:"DWD",country:"Germany",resolution:5,tips:"5km",length:8,frequency:2,models:["ewam"],categories:"dwd_ewam",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:4,disabled:!0,name:"GWAM",alias:"ECMWF",model:"gwam",provider:"DWD",country:"Germany",resolution:5,tips:"5km",length:4,frequency:2,models:["gwam"],categories:"dwd_gwam",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:5,disabled:!0,name:"ECWAM",alias:"ECMWF",model:"ecmwf_wam025",provider:"ECMWF",country:"Europe",resolution:25,tips:"25km",length:10,frequency:6,models:["ecmwf_wam025"],categories:"ecmwf_wam025",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:6,name:"GFSWave",alias:"GFS",model:"ncep_gfswave025",provider:"NCEP",country:"USA",resolution:25,tips:"25km",length:10,frequency:6,models:["ncep_gfswave025","ncep_gfswave016"],categories:"ncep_gfswave025,ncep_gfswave016",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:7,disabled:!0,name:"ERA5-Ocean",alias:"ECMWF",model:"era5_ocean",provider:"Copernicus",country:"Europe",resolution:50,tips:"50km",length:-5,frequency:1,models:["era5_ocean"],categories:"copernicus_era5_ocean",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"}];let ma=class{static standardWeatherModels(){return $e.filter(t=>!t.disabled&&t.alias)}static standardMarineModels(){return Ke.filter(t=>!t.disabled&&t.alias)}static autoPickLayerModel(t,a="copernicus"){return a=a||"copernicus",a=a==null?void 0:a.toLowerCase(),a=["gfs","ecmwf","copernicus"].includes(a)?a:"copernicus",t=t==null?void 0:t.toLowerCase(),t==="gfs"?"gfs":["ec","ecmwf"].includes(t)?"ecmwf":["copernicus","cmems"].includes(t)?"copernicus":a}static autoPickPeerModel(t,a,r="copernicus"){if(a=this.autoPickLayerModel(a,r),xr.LayerHelper.WEATHER_LAYERS.reduce((i,l)=>l.atmos?i+l.weight:i,0)&t.weight){if(a==="copernicus")return"ecmwf"}else if(a==="ecmwf")return"copernicus";return a}static autoPickMeteoModel(t="best_match"){var a,r;t=t==null?void 0:t.toLowerCase(),t=t==="ec"?"ecmwf":t;const i=t.toLowerCase().split(","),l=[],n=[];for(const c of i){let s=$e.find(m=>{var g,u,y;return((g=m.models)==null?void 0:g.includes(c))||((u=m.alias)==null?void 0:u.toLowerCase())===c||((y=m.name)==null?void 0:y.toLowerCase())===c}),d=Ke.find(m=>{var g,u,y;return((g=m.models)==null?void 0:g.includes(c))||((u=m.alias)==null?void 0:u.toLowerCase())===c||((y=m.name)==null?void 0:y.toLowerCase())===c});s=s||$e.find(m=>{var g,u;return((g=m.alias)==null?void 0:g.toLowerCase())===((u=d==null?void 0:d.alias)==null?void 0:u.toLowerCase())}),d=d||Ke.find(m=>{var g,u;return((g=m.alias)==null?void 0:g.toLowerCase())===((u=s==null?void 0:s.alias)==null?void 0:u.toLowerCase())}),s=s||$e[0],d=d||Ke[0],l.push((a=s.models)!=null&&a.includes(c)?c:s.model),n.push((r=d.models)!=null&&r.includes(c)?c:d.model)}return{weatherModels:l.join(","),marineModels:n.join(",")}}static autoPickSubCategories(t){t=t.toUpperCase();const a=$e.filter(l=>l.alias===t),r=Ke.filter(l=>l.alias===t),i=[];return a.forEach(l=>{l.categories&&i.push(...l.categories.split(","))}),r.forEach(l=>{l.categories&&i.push(...l.categories.split(","))}),i}static pickHourly(t,a){var r,i,l,n,c,s,d,m,g,u,y,f,h,p,w,x,b,k,L,_,z,S,M,T,E,I,G,j,H,ae,N,A,F,Y,D,R,Z,P,K,re,me,he,ee,le,de,we,W,te,Te,Le,fe,xe;const U=typeof a=="string"?C(a):a,ye=t==null?void 0:t.weather,ie=t==null?void 0:t.marine,ne=C((i=(r=ye==null?void 0:ye[0])==null?void 0:r.hourly)==null?void 0:i.date).utc(),Se=ne.clone().add((c=(n=(l=ye==null?void 0:ye[0])==null?void 0:l.hourly)==null?void 0:n.time)==null?void 0:c.at(0),"h"),Ee=ne.clone().add((m=(d=(s=ye==null?void 0:ye[0])==null?void 0:s.hourly)==null?void 0:d.time)==null?void 0:m.at(-1),"h"),Ve=[];if(U.isBetween(Se,Ee,"millisecond","[]")){const B=U.utc().diff(Se,"h",!1);let se,ke;if(ye){let Ne=0,Pe=0,O=0;for(const Ce of ye){const q=Ce==null?void 0:Ce.hourly;for(let ve=B-(B-1)%3;ve<=B;ve++)Ne+=(g=q==null?void 0:q.precipitation)==null?void 0:g.at(ve);for(let ve=B-(B-1)%6;ve<=B;ve++)Pe+=(u=q==null?void 0:q.precipitation)==null?void 0:u.at(ve);for(let ve=B-(B-1)%12;ve<=B;ve++)O+=(y=q==null?void 0:q.precipitation)==null?void 0:y.at(ve);se={temp:(f=q==null?void 0:q.temperature_2m)==null?void 0:f.at(B),apparentTemp:(h=q==null?void 0:q.apparent_temperature)==null?void 0:h.at(B),rh:(p=q==null?void 0:q.relative_humidity_2m)==null?void 0:p.at(B),dp:(w=q==null?void 0:q.dew_point_2m)==null?void 0:w.at(B),precip:{probability:(x=q==null?void 0:q.precipitation_probability)==null?void 0:x.at(B),sum:(b=q==null?void 0:q.precipitation)==null?void 0:b.at(B),sum1Hours:(k=q==null?void 0:q.precipitation)==null?void 0:k.at(B),sum3Hours:Math.round(Ne*100)/100,sum6Hours:Math.round(Pe*100)/100,sum12Hours:Math.round(O*100)/100},pmsl:(L=q==null?void 0:q.pressure_msl)==null?void 0:L.at(B),psurf:(_=q==null?void 0:q.surface_pressure)==null?void 0:_.at(B),code:(z=q==null?void 0:q.weather_code)==null?void 0:z.at(B),visibility:this.m2nm((S=q==null?void 0:q.visibility)==null?void 0:S.at(B)),wind:{speed:(M=q==null?void 0:q.wind_speed_10m)==null?void 0:M.at(B),kts:(T=q==null?void 0:q.wind_speed_10m)==null?void 0:T.at(B),degree:(E=q==null?void 0:q.wind_direction_10m)==null?void 0:E.at(B),bearing:((I=q==null?void 0:q.wind_direction_10m)==null?void 0:I.at(B))!==null?(((G=q==null?void 0:q.wind_direction_10m)==null?void 0:G.at(B))+180)%360:null,gusts:(j=q==null?void 0:q.wind_gusts_10m)==null?void 0:j.at(B)},isDay:(H=q==null?void 0:q.is_day)==null?void 0:H.at(B)};const{name:We,url:Ze,bg:Oe}=this.parseWeatherCode(se.code,se.isDay);se.name=We,se.url=Ze,se.bg=Oe,se.wind.scale=this.beaufort(this.kts2ms(se.wind.kts)),se.wind.direction=this.degree2Direction(se.wind.degree),Ve.push({utc:Se.add(B,"h").format(),model:Ce.model,weather:{...se}})}}if(ie){let Ne=0;for(const Pe of ie){const O=Pe==null?void 0:Pe.hourly;ke={wave:{sig:{height:(ae=O==null?void 0:O.wave_height)==null?void 0:ae.at(B),degree:(N=O==null?void 0:O.wave_direction)==null?void 0:N.at(B),bearing:((A=O==null?void 0:O.wave_direction)==null?void 0:A.at(B))!==null?(((F=O==null?void 0:O.wave_direction)==null?void 0:F.at(B))+180)%360:null,period:(Y=O==null?void 0:O.wave_period)==null?void 0:Y.at(B)},swell:{height:(D=O==null?void 0:O.swell_wave_height)==null?void 0:D.at(B),degree:(R=O==null?void 0:O.swell_wave_direction)==null?void 0:R.at(B),bearing:((Z=O==null?void 0:O.swell_wave_direction)==null?void 0:Z.at(B))!==null?(((P=O==null?void 0:O.swell_wave_direction)==null?void 0:P.at(B))+180)%360:null,period:(K=O==null?void 0:O.swell_wave_period)==null?void 0:K.at(B),peakPeriod:(re=O==null?void 0:O.swell_wave_peak_period)==null?void 0:re.at(B)},wd:{height:(me=O==null?void 0:O.wind_wave_height)==null?void 0:me.at(B),degree:(he=O==null?void 0:O.wind_wave_direction)==null?void 0:he.at(B),bearing:((ee=O==null?void 0:O.wind_wave_direction)==null?void 0:ee.at(B))!==null?(((le=O==null?void 0:O.wind_wave_direction)==null?void 0:le.at(B))+180)%360:null,period:(de=O==null?void 0:O.wind_wave_period)==null?void 0:de.at(B),peakPeriod:(we=O==null?void 0:O.wind_wave_peak_period)==null?void 0:we.at(B)}},current:{speed:(W=O==null?void 0:O.ocean_current_velocity)==null?void 0:W.at(B),kts:(te=O==null?void 0:O.ocean_current_velocity)==null?void 0:te.at(B),degree:(Te=O==null?void 0:O.ocean_current_direction)==null?void 0:Te.at(B),bearing:((Le=O==null?void 0:O.ocean_current_direction)==null?void 0:Le.at(B))??null},sst:(fe=O==null?void 0:O.sea_surface_temperature)==null?void 0:fe.at(B),height:(xe=O==null?void 0:O.sea_level_height_msl)==null?void 0:xe.at(B)},ke.wave=this.parseWave(ke.wave,se==null?void 0:se.wind),ke.current.direction=this.degree2Direction(ke.current.degree),Object.assign(Ve[Ne],ke),Ne++}}}return Ve}static toLegacy(t){var a,r,i,l,n,c,s,d,m,g;return{wind:(a=t==null?void 0:t.weather)==null?void 0:a.wind,visibility:(r=t==null?void 0:t.weather)==null?void 0:r.visibility,temp:(i=t==null?void 0:t.weather)==null?void 0:i.temp,prmsl:(l=t==null?void 0:t.weather)==null?void 0:l.pmsl,gusts:{kts:(c=(n=t==null?void 0:t.weather)==null?void 0:n.wind)==null?void 0:c.gusts},precip:(s=t==null?void 0:t.weather)==null?void 0:s.precip,code:(d=t==null?void 0:t.weather)==null?void 0:d.code,name:(m=t==null?void 0:t.weather)==null?void 0:m.name,url:(g=t==null?void 0:t.weather)==null?void 0:g.url,wave:t==null?void 0:t.wave,current:t==null?void 0:t.current,sst:t==null?void 0:t.sst,height:t==null?void 0:t.height,utc:t==null?void 0:t.utc,source:t==null?void 0:t.model}}static pickDaily(t,a){var r,i,l,n,c,s,d,m,g,u,y,f,h,p,w,x,b,k,L,_,z,S,M,T,E,I,G,j,H,ae,N,A,F,Y,D,R,Z,P,K,re,me,he,ee,le;const de=typeof a=="string"?C(a):a,we=t==null?void 0:t.weather,W=t==null?void 0:t.marine,te=C((l=(i=(r=we==null?void 0:we[0])==null?void 0:r.daily)==null?void 0:i.time)==null?void 0:l.at(0)),Te=C((s=(c=(n=we==null?void 0:we[0])==null?void 0:n.daily)==null?void 0:c.time)==null?void 0:s.at(-1)),Le=[];if(de.isBetween(te,Te,"millisecond","[]")){let fe,xe;const U=de.diff(te,"d",!1);if(we)for(const ye of we){const ie=ye.daily;fe={code:(d=ie.weather_code)==null?void 0:d.at(U),temp:{max:(m=ie.temperature_2m_max)==null?void 0:m.at(U),min:(g=ie.temperature_2m_min)==null?void 0:g.at(U),mean:(u=ie.temperature_2m_mean)==null?void 0:u.at(U)},apparentTemp:{max:(y=ie.apparent_temperature_max)==null?void 0:y.at(U),min:(f=ie.apparent_temperature_min)==null?void 0:f.at(U)},precip:{sum:(h=ie.precipitation_sum)==null?void 0:h.at(U),rainSum:(p=ie.rain_sum)==null?void 0:p.at(U),snowfallSum:(w=ie.snowfall_sum)==null?void 0:w.at(U),showersSum:(x=ie.showers_sum)==null?void 0:x.at(U),hours:(b=ie.precipitation_hours)==null?void 0:b.at(U),probability:(k=ie.precipitation_probability_max)==null?void 0:k.at(U)},rh:{max:(L=ie.relative_humidity_2m_max)==null?void 0:L.at(U),min:(_=ie.relative_humidity_2m_min)==null?void 0:_.at(U),mean:(z=ie.relative_humidity_2m_mean)==null?void 0:z.at(U)},wind:{speed:(S=ie.wind_speed_10m_max)==null?void 0:S.at(U),kts:(M=ie.wind_speed_10m_max)==null?void 0:M.at(U),degree:(T=ie.wind_direction_10m_dominant)==null?void 0:T.at(U),gusts:(E=ie.wind_gusts_10m_max)==null?void 0:E.at(U),bearing:((I=ie.wind_direction_10m_dominant)==null?void 0:I.at(U))!==null?(((G=ie.wind_direction_10m_dominant)==null?void 0:G.at(U))+180)%360:null}};const{name:ne,url:Se,bg:Ee}=this.parseWeatherCode(fe.code,!0);fe.name=ne,fe.url=Se,fe.bg=Ee,fe.wind.scale=this.beaufort(this.kts2ms(fe.wind.kts)),fe.wind.direction=this.degree2Direction(fe.wind.degree),Le.push({utc:te.add(U,"d").utc().format(),model:ye.model,weather:{...fe}})}if(W){let ye=0;for(const ie of W){const ne=ie.daily;xe={wave:{sig:{height:(j=ne.wave_height_max)==null?void 0:j.at(U),degree:(H=ne.wave_direction_dominant)==null?void 0:H.at(U),period:(ae=ne.wave_period_max)==null?void 0:ae.at(U),bearing:((N=ne.wave_direction_dominant)==null?void 0:N.at(U))!==null?(((A=ne.wave_direction_dominant)==null?void 0:A.at(U))+180)%360:null},swell:{height:(F=ne.swell_wave_height_max)==null?void 0:F.at(U),degree:(Y=ne.swell_wave_direction_dominant)==null?void 0:Y.at(U),period:(D=ne.swell_wave_period_max)==null?void 0:D.at(U),peakPeriod:(R=ne.swell_wave_peak_period_max)==null?void 0:R.at(U),bearing:((Z=ne.swell_wave_direction_dominant)==null?void 0:Z.at(U))!==null?((P=ne.swell_wave_direction_dominant)==null?void 0:P.at(U))%360:null},wd:{height:(K=ne.wind_wave_height_max)==null?void 0:K.at(U),degree:(re=ne.wind_wave_direction_dominant)==null?void 0:re.at(U),period:(me=ne.wind_wave_period_max)==null?void 0:me.at(U),peakPeriod:(he=ne.wind_wave_peak_period_max)==null?void 0:he.at(U),bearing:((ee=ne.wind_wave_direction_dominant)==null?void 0:ee.at(U))!==null?(((le=ne.wind_wave_direction_dominant)==null?void 0:le.at(U))+180)%360:null}}},xe.wave=this.parseWave(xe.wave,fe==null?void 0:fe.wind),Object.assign(Le[ye],xe),ye++}}}return Le}static parseWave(t,a){if(t.sig.direction=this.degree2Direction(t.sig.degree),t.swell.direction=this.degree2Direction(t.swell.degree),t.wd.direction=this.degree2Direction(t.wd.degree),t.sig.scale=this.douglas(t.sig.height),t.swell.scale=this.douglas(t.swell.height),t.wd.scale=this.douglas(t.wd.height),t.sig.height===0){const r=Math.sqrt(Math.pow(t.swell.height||0,2)+Math.pow(t.wd.height||0,2));t.sig.height=Math.round(r*100)/100}if(t.swell.height===0)if(t.sig.height>t.wd.height){const r=Math.sqrt(Math.abs(Math.pow(t.sig.height||0,2)-Math.pow(t.wd.height||0,2)));t.swell.height=Math.round(r*100)/100}else{const r=Math.round(.12*this.kts2ms((a==null?void 0:a.kts)||0)*100)/100,i=r>1?r/10:r>.5?r/5:r>.3?r/2:r;t.swell.height=Math.round(i*100)/100}if(t.wd.height===0||t.wd.height>t.sig.height)if(t.sig.height>t.swell.height){const r=Math.sqrt(Math.abs(Math.pow(t.sig.height||0,2)-Math.pow(t.swell.height||0,2))),i=.24*this.kts2ms((a==null?void 0:a.kts)||0);t.wd.height=Math.round(Math.min(r,i)*100)/100}else{const r=.24*this.kts2ms((a==null?void 0:a.kts)||0);t.wd.height=Math.round(r*100)/100}return t.swell.height>t.sig.height&&(t.swell.height=Math.round(t.sig.height*.76*100)/100),t.sig.period||(t.sig.period=Math.round(5*Math.sqrt(t.sig.height))),t.swell.period||(t.swell.period=Math.round(5*Math.sqrt(t.swell.height))),t.wd.period||(t.wd.period=Math.round(5*Math.sqrt(t.wd.height))),t}static parseWeatherCode(t,a){const r=this.weatherCode(t);return(a?r.day:r.night)||{}}static weatherCode(t){const a={code:t};switch(t){case 0:a.day={name:"Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"},a.night={name:"Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"};break;case 1:a.day={name:"Mainly Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"},a.night={name:"Mainly Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"};break;case 2:a.day={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg2.png"},a.night={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg2.png"};break;case 3:a.day={name:"Overcast",url:"https://osshz.idmwx.com/asset/weather/04d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg3.png"},a.night={name:"Overcast",url:"https://osshz.idmwx.com/asset/weather/04n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg3.png"};break;case 45:a.day={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"},a.night={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"};break;case 48:a.day={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"},a.night={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"};break;case 51:a.day={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 53:a.day={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 55:a.day={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/15d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/15n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 56:a.day={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 57:a.day={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 61:a.day={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 63:a.day={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 65:a.day={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 66:a.day={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 67:a.day={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 71:a.day={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 73:a.day={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 75:a.day={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 77:a.day={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 80:a.day={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 81:a.day={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 82:a.day={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 85:a.day={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 86:a.day={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 95:a.day={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 96:a.day={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 99:a.day={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break}return a}static kts2ms(t){return isNaN(t)||t===null?t:Math.round(t*1852/3600*1e4)/1e4}static kts2kmh(t){return isNaN(t)||t===null?t:t*1.852}static m2nm(t){return isNaN(t)||t===null?t:Math.round(t/1e3/1.852*1e4)/1e4}static kmh2kts(t){return isNaN(t)||t===null?t:this.ms2kts(t*1e3/3600)}static ms2kts(t){return isNaN(t)||t===null?t:Math.round(t*3600/1852*1e4)/1e4}static degree2Radian(t){if(isNaN(t)||t===null)return t;let a=t%360/360*2*Math.PI;return a=a<0?a+2*Math.PI:a,a}static degree2Direction(t){const a=this.degree2Radian(t);if(isNaN(a)||a===null)return null;let r="N/A";const i=Math.PI/16;return a<i?r="N":a>=i&&a<3*i?r="NNE":a>=3*i&&a<5*i?r="NE":a>=5*i&&a<7*i?r="ENE":a>=7*i&&a<9*i?r="E":a>=9*i&&a<11*i?r="ESE":a>=11*i&&a<13*i?r="SE":a>=13*i&&a<15*i?r="SSE":a>=15*i&&a<17*i?r="S":a>=17*i&&a<19*i?r="SSW":a>=19*i&&a<21*i?r="SW":a>=21*i&&a<23*i?r="WSW":a>=23*i&&a<25*i?r="W":a>=25*i&&a<27*i?r="WNW":a>=27*i&&a<29*i?r="NW":a>=29*i&&a<31*i?r="NNW":a>=31*i&&a<32*i&&(r="N"),r}static beaufort(t){let a=0;return isNaN(t)||(t=Math.round(t*10)/10,t<=.2?a=0:t<=1.5?a=1:t<=3.3?a=2:t<=5.4?a=3:t<=7.9?a=4:t<=10.7?a=5:t<=13.8?a=6:t<=17.1?a=7:t<=20.7?a=8:t<=22.4?a=9:t<=28.4?a=10:t<=32.6?a=11:t<=36.9?a=12:t<=41.4?a=13:t<=46.1?a=14:t<=50.9?a=15:t<=55.9?a=16:t<=61.2?a=17:t>61.2&&(a=18)),a}static douglas(t){let a="Calm";return isNaN(t)||t<=.1?a="Calm":t<=.5?a="Smooth":t<=1.25?a="Slight":t<=2.5?a="Moderate":t<=4?a="Rough":t<=6?a="VeryRough":t<=9?a="High":t<=14?a="VeryHigh":a="Precipitous",a}};const xf="",_m={name:"IdmTropicals",props:{simple:{type:Boolean,default:!1},permission:{type:Number},locale:{type:String},map:{type:Object},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}},timeZone:{type:Number},token:{type:String},defaultMeteoToken:{type:String},gateway:{type:String,default:"aa"},assistGateway:{type:Array,default:[]},forecastModel:{type:String},realTime:{type:String},beforeLayer:{type:String}},emits:["tropical","tropicalCenterPoints","tropicalProbability","tropicalNotification"],setup(){return{Theme:be.useTheme()}},data(){return{right:10,toggle:!1,helper:je.CompanyHelper,tropicals:void 0,tropicalCacheKey:"tropicalCacheGL4",source:"tropicals-source",clusterSource:"tropicals-cluster-source",historyLayer:"tropicals-history-layer",forecastLayer:"tropicals-forecast-layer",forecastModelLayer:"tropicals-forecast-model-layer",forecastNameLayer:"tropicals-forecast-name-layer",pointCircleLayer:"tropicals-point-circle-layer",pointLabelLayer:"tropicals-point-label-layer",historyPointCircleLayer:"history-tropicals-point-circle-layer",historyPointLabelLayer:"history-tropicals-point-label-layer",interpolateData:[],interpolateMarkers:[],interpolateSource:"tropicals-interpolate-source",interpolateLineLayer:"tropicals-interpolate-line-layer",showTropicalsInfo:!1,activeTropicals:void 0,activeTropicalsMarker:void 0,empty:J.featureCollection([]),showLegend:!1,showHoverPoint:!1,hoverPoint:void 0,hoverMarker:void 0}},computed:{hoverLayers(){return[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.pointCircleLayer,this.pointCircleLayer+"-border",this.historyPointCircleLayer,this.historyPointCircleLayer+"-border",this.historyPointCircleLayer+"-inner"]},clickLayers(){return[this.forecastNameLayer,this.historyLayer]},computeTime(){return(e,t)=>{if(e){const a=C(e).utcOffset(t),r=t<0?t:"+"+t;return`${a==null?void 0:a.format("MMM-DD/HHmm")} (UTC${r}) ${a==null?void 0:a.fromNow()} `}return"-"}},computeTzTime(){return(e,t,a="MM-DD HH:mm")=>{var r,i;if(e){const l=t||0,n=(i=(r=C(e))==null?void 0:r.utcOffset(l))==null?void 0:i.format(a),c=`(UTC ${l>=0?"+":""}${l})`;return n+" "+c}return"-"}},computeTimezone(){return this.timeZone<0?this.timeZone:"+"+this.timeZone},computeBF(){return function(e){const t=ma.kts2ms(e);return ma.beaufort(t)}},computeMovement(){return function(e){var t,a;return(a=(t=e==null?void 0:e.forecasts)==null?void 0:t.find(r=>!r.disabled))==null?void 0:a.movement}},computePosition(){return e=>!e||e.lng===null||e.lng===void 0||isNaN(e.lng)||e.lat===null||e.lat===void 0||isNaN(e.lat)?"-":X.LngLatHelper.lat2pretty(e==null?void 0:e.lat,2).pretty+" / "+X.LngLatHelper.lng2pretty(e==null?void 0:e.lng,2).pretty}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)})},immediate:!0},map:{handler(){this.map?(this.toggle=localStorage.getItem(this.tropicalCacheKey)==="true"||!1,localStorage.setItem(this.tropicalCacheKey,this.toggle),this.toggle&&this.fetchTropicals()):this.handleClear()}},showTropicalsInfo:{handler(){this.$emit("tropical",this.showTropicalsInfo),this.simple&&this.showTropicalsInfo?this.$nextTick(()=>{var e,t;this.$parent.playerBottom=((t=(e=this.$refs.tropicalsInfo)==null?void 0:e.$el)==null?void 0:t.clientHeight)+10}):this.simple&&(this.$parent.playerBottom=30)},immediate:!0},"tropicals.version":{handler(){this.handleRefresh()}},timeZone:{handler(e,t){e!==t&&this.handleRefresh()}},realTime:{handler(e){this.map&&e&&this.toggle&&this.handleRender()}},locale:{handler(e){this.map&&this.toggle&&this.handleRefresh()}}},mounted(){},methods:{handleMenuToggle(){var e,t,a;this.toggle=!this.toggle,localStorage.setItem(this.tropicalCacheKey,this.toggle),this.toggle?this.fetchTropicals():(this.handleClear(),(a=(t=(e=this.$parent)==null?void 0:e.$refs)==null?void 0:t.idmBottomBar)==null||a.handleToggle("tropical",!1))},async fetchTropicals(){var i,l,n;const e=new Date().valueOf();let t=0,a=0,r=(i=je.LayerHelper.WEATHER_LAYERS.find(c=>c.key==="tropicals"))==null?void 0:i.weight;if(r>0){const c=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],s=await ge.get(`${c}/api/arc/weather/layers2/links?l=${r}&v=${this.forecastModel}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(a=new Date().valueOf()-(e+t),console.log("weather links elapsed: ",a,", total: ",t+=a),((l=s==null?void 0:s.data)==null?void 0:l.code)===0){const d=(n=s==null?void 0:s.data)==null?void 0:n.data;await ge.get(d.tropicals,{headers:{Authorization:this.defaultMeteoToken,key:"tropicals"},responseType:/\.(jpg|png)$/.test(d.tropicals)?"blob":"json"}).then(m=>{var y,f,h;const g=X.TropicalHelper.convert2Geojson(((y=m==null?void 0:m.data)==null?void 0:y.data)||(m==null?void 0:m.data));((h=(f=m==null?void 0:m.config)==null?void 0:f.headers)==null?void 0:h.key)&&g&&(this.tropicals={data:g,active:!0,cached:!0,type:"json",etime:s.data.etime,version:Math.random()+1})}).catch(m=>{console.log(`tropicals fetch layer error: ${m}`)})}a=new Date().valueOf()-(e+t),console.log("tropicals elapsed: ",a,", total: ",t+=a)}},handleRefresh(){var t,a;(((a=(t=this.tropicals)==null?void 0:t.data)==null?void 0:a.features)||[]).forEach(r=>{var l,n,c,s,d,m,g,u,y,f,h,p,w,x,b,k,L,_,z;let i="";switch(!0){case(((l=r.properties.wind)==null?void 0:l.kts)<32||((n=r.properties)==null?void 0:n.kts)<32):i="td";break;case(((c=r.properties.wind)==null?void 0:c.kts)<47||((s=r.properties)==null?void 0:s.kts)<47):i="ts";break;case(((d=r.properties.wind)==null?void 0:d.kts)<63||((m=r.properties)==null?void 0:m.kts)<63):i="sts";break;case(((g=r.properties.wind)==null?void 0:g.kts)<79||((u=r.properties)==null?void 0:u.kts)<79):i="ty";break;case(((y=r.properties.wind)==null?void 0:y.kts)<94||((f=r.properties)==null?void 0:f.kts)<94):i="sty";break;case(((h=r.properties.wind)==null?void 0:h.kts)>=94||((p=r.properties)==null?void 0:p.kts)>=94):i="superTy";break;default:i="superTy";break}r.properties.levelI18n=i,((w=r.geometry)==null?void 0:w.type)==="Point"&&((x=r.properties)!=null&&x.important)&&(r.properties.format=(k=(b=C(r.properties.date))==null?void 0:b.utcOffset(this.timeZone))==null?void 0:k.format(`MMM-DD/HHmm [(utc${this.computeTimezone})]`)),((L=r.geometry)==null?void 0:L.type)==="Point"&&(r.properties.Name=((z=(_=r.properties.name)==null?void 0:_.trim())==null?void 0:z.replace(/^./,S=>S.toUpperCase()))||r.properties.nameCn,r.properties.nameCn=r.properties.nameCn||r.properties.Name||"-")}),this.handleInit()},handleInit(){var e,t,a,r,i,l,n,c,s,d,m,g;this.handleClear(),this.tropicals&&this.map&&(this.handleRender(),(e=this.map)==null||e.on("click",this.clickLayers,this.handleClick),(t=this.map)==null||t.on("mousemove",this.hoverLayers,this.handleHover),(a=this.map)==null||a.on("mouseleave",this.hoverLayers,this.handleLeave)),((l=(i=(r=this.tropicals)==null?void 0:r.data)==null?void 0:i.features)==null?void 0:l.length)>0?(s=(c=(n=this.$parent)==null?void 0:n.$refs)==null?void 0:c.idmBottomBar)==null||s.handleToggle("tropical",!0):(g=(m=(d=this.$parent)==null?void 0:d.$refs)==null?void 0:m.idmBottomBar)==null||g.handleToggle("tropical",!1)},handleRender(){var e,t,a,r,i,l,n,c,s,d;if(this.tropicals&&this.map){const m=new Date().valueOf();let g=0,u=0;(e=this.map)!=null&&e.getSource(this.source)?((a=this.map)==null||a.getSource(this.source).setData((t=this.tropicals)!=null&&t.active?this.tropicals.data:this.empty),u=new Date().valueOf()-(m+g),console.log("[tropicals] update elapsed: ",u,", total: ",g+=u)):(this.map.addSource(this.source,{type:"geojson",data:(r=this.tropicals)!=null&&r.active?(i=this.tropicals)==null?void 0:i.data:this.empty}),this.map.addLayer({id:this.historyLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["==","type","history"],["!=","disabled",!0]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.Theme.current.value.colors["on-surface"],"line-width":3,"line-opacity":.7}},this.beforeLayer),this.map.addLayer({id:this.forecastLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["==","type","forecast"],["!=","disabled",!0]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["match",["get","model"],"cma",this.Theme.current.value.colors["tropicals-cma"],"jma",this.Theme.current.value.colors["tropicals-jma"],"ecmwf",this.Theme.current.value.colors["tropicals-ecmwf"],"ukm",this.Theme.current.value.colors["tropicals-ukm"],"noaa-at",this.Theme.current.value.colors["tropicals-noaa-at"],"noaa-ep",this.Theme.current.value.colors["tropicals-noaa-ep"],this.Theme.current.value.colors["tropicals-noaa-other"]],"line-width":2,"line-opacity":1,"line-dasharray":[1,2]}},this.beforeLayer),this.map.addLayer({id:this.forecastModelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","LineString"],["==","type","forecast"],["!=","disabled",!0]],layout:{"symbol-placement":"line","text-field":"{model}","text-rotation-alignment":"viewport","text-size":12},paint:{"text-color":this.Theme.current.value.dark?"#333":"#fff","text-opacity":1,"text-halo-color":["match",["get","model"],"cma",this.Theme.current.value.colors["tropicals-cma"],"jma",this.Theme.current.value.colors["tropicals-jma"],"ecmwf",this.Theme.current.value.colors["tropicals-ecmwf"],"ukm",this.Theme.current.value.colors["tropicals-ukm"],"noaa-at",this.Theme.current.value.colors["tropicals-noaa-at"],"noaa-ep",this.Theme.current.value.colors["tropicals-noaa-ep"],this.Theme.current.value.colors["tropicals-noaa-other"]],"text-halo-width":4}},this.beforeLayer),u=new Date().valueOf()-(m+g),console.log("[tropical] add elapsed: ",u,", total: ",g+=u)),(l=this.map)!=null&&l.getSource(this.clusterSource)?((c=this.map)==null||c.getSource(this.clusterSource).setData((n=this.tropicals)!=null&&n.active?this.tropicals.data:this.empty),u=new Date().valueOf()-(m+g),console.log("[tropical] update elapsed: ",u,", total: ",g+=u)):(this.map.addSource(this.clusterSource,{type:"geojson",data:(s=this.tropicals)!=null&&s.active?(d=this.tropicals)==null?void 0:d.data:this.empty}),this.map.addLayer({id:this.pointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":5,"circle-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.pointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":4,"circle-color":["case",["boolean",["==",["get","kts",["get","wind"]],null]],this.Theme.current.value.colors["tropicals-td"],["boolean",["<",["get","kts",["get","wind"]],32]],this.Theme.current.value.colors["tropicals-td"],["boolean",["<",["get","kts",["get","wind"]],47]],this.Theme.current.value.colors["tropicals-ts"],["boolean",["<",["get","kts",["get","wind"]],63]],this.Theme.current.value.colors["tropicals-sts"],["boolean",["<",["get","kts",["get","wind"]],79]],this.Theme.current.value.colors["tropicals-ty"],["boolean",["<",["get","kts",["get","wind"]],94]],this.Theme.current.value.colors["tropicals-sty"],["boolean",[">=",["get","kts",["get","wind"]],94]],this.Theme.current.value.colors["tropicals-super-ty"],"#fff"]}},this.beforeLayer),this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.clusterSource,minzoom:5,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[1,0],"text-anchor":"left","text-size":10},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.historyPointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],paint:{"circle-radius":6,"circle-color":"#fff"}},this.beforeLayer),this.map.addLayer({id:this.historyPointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],paint:{"circle-radius":5,"circle-color":"rgba(0,0,0,0.7)"}},this.beforeLayer),this.map.addLayer({id:this.historyPointCircleLayer+"-inner",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],paint:{"circle-radius":3,"circle-color":"#fff"}},this.beforeLayer),this.map.addLayer({id:this.historyPointLabelLayer,type:"symbol",source:this.clusterSource,minzoom:5,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[1,0],"text-anchor":"left","text-size":10},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.forecastNameLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["==","important",!0]],layout:{"text-field":["get",this.locale==="en"?"Name":"nameCn"],"text-anchor":"bottom","text-size":16,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-font":["DIN Pro Regular","Arial Unicode MS Regular"],"text-offset":[0,2]},paint:{"text-color":this.Theme.current.value.colors["map-blue"],"text-halo-color":"#ffffff","text-halo-width":2}},this.beforeLayer),u=new Date().valueOf()-(m+g),console.log("[tropical] add elapsed: ",u,", total: ",g+=u));const y=X.TropicalHelper.interpolate(this.tropicals,1);this.interpolateData=JSON.parse(JSON.stringify(y)),this.handleDateChange()}},handleClear(){var e,t,a,r;this.map&&(this.map.getLayer(this.historyLayer)&&this.map.removeLayer(this.historyLayer),this.map.getLayer(this.forecastLayer)&&this.map.removeLayer(this.forecastLayer),this.map.getLayer(this.forecastModelLayer)&&this.map.removeLayer(this.forecastModelLayer),this.map.getLayer(this.forecastNameLayer)&&this.map.removeLayer(this.forecastNameLayer),this.map.getLayer(this.pointCircleLayer)&&this.map.removeLayer(this.pointCircleLayer),this.map.getLayer(this.pointCircleLayer+"-border")&&this.map.removeLayer(this.pointCircleLayer+"-border"),this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.historyPointCircleLayer)&&this.map.removeLayer(this.historyPointCircleLayer),this.map.getLayer(this.historyPointCircleLayer+"-border")&&this.map.removeLayer(this.historyPointCircleLayer+"-border"),this.map.getLayer(this.historyPointCircleLayer+"-inner")&&this.map.removeLayer(this.historyPointCircleLayer+"-inner"),this.map.getLayer(this.historyPointLabelLayer)&&this.map.removeLayer(this.historyPointLabelLayer),this.map.getLayer(this.interpolateLineLayer)&&this.map.removeLayer(this.interpolateLineLayer),(e=this.interpolateMarkers)==null||e.forEach(i=>i==null?void 0:i.remove()),this.map.getSource(this.source)&&this.map.removeSource(this.source),this.map.getSource(this.clusterSource)&&this.map.removeSource(this.clusterSource),this.map.getSource(this.interpolateSource)&&this.map.removeSource(this.interpolateSource)),(t=this.map)==null||t.off("click",this.clickLayers,this.handleClick),(a=this.map)==null||a.off("mousemove",this.hoverLayers,this.handleHover),(r=this.map)==null||r.off("mouseleave",this.hoverLayers,this.handleLeave),this.handleCloseInfoMarker()},handleDateChange(){var e,t,a,r,i,l,n,c,s,d,m,g,u,y,f,h,p,w,x,b,k,L,_,z,S,M,T,E,I,G,j,H,ae,N,A;if((e=this.interpolateMarkers)==null||e.forEach(F=>F==null?void 0:F.remove()),(t=this.interpolateData)!=null&&t.length&&this.tropicals.active){const F=C(this.realTime).utc().set({minute:0,second:0,millisecond:0}),Y=this.interpolateData.filter(P=>P.properties.date===(F==null?void 0:F.format())&&!P.properties.disabled),D=this.handleComputePolygons(Y),R=J.featureCollection([...Y]);D.forEach(P=>{R.features.push(P)}),(a=this.map)!=null&&a.getSource(this.interpolateSource)?(r=this.map)==null||r.getSource(this.interpolateSource).setData(R):((i=this.map)==null||i.addSource(this.interpolateSource,{type:"geojson",data:R}),(l=this.map)==null||l.addLayer({id:this.interpolateLineLayer,type:"line",source:this.interpolateSource,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-opacity":1,"line-color":["match",["get","level"],7,this.Theme.current.value.colors["tropicals-r7"],10,this.Theme.current.value.colors["tropicals-r10"],this.Theme.current.value.colors["tropicals-r10"]],"line-width":1}},"empty-layer-3")),this.interpolateMarkers=[];const Z=[];for(const P of Y)if(!P.properties.disabled){if(!Z.some(ee=>{var le;return ee.properties.name===((le=P.properties)==null?void 0:le.name)})){const ee=((c=(n=this.tropicals.data.features.find(le=>{var de;return le.properties.name===((de=P.properties)==null?void 0:de.name)}))==null?void 0:n.properties)==null?void 0:c.nameCn)||((s=P.properties)==null?void 0:s.Name)||"-";P.properties.nameCn=ee,P.properties.Name=((m=(d=P.properties.name)==null?void 0:d.trim())==null?void 0:m.replace(/^./,le=>le.toUpperCase()))||P.properties.nameCn,Z.push(P)}let K=this.Theme.current.value.colors["tropicals-ty"];((u=(g=P.properties)==null?void 0:g.wind)==null?void 0:u.kts)<32||!((f=(y=P.properties)==null?void 0:y.wind)!=null&&f.kts)?K=this.Theme.current.value.colors["tropicals-td"]:((p=(h=P.properties)==null?void 0:h.wind)==null?void 0:p.kts)>=32&&((x=(w=P.properties)==null?void 0:w.wind)==null?void 0:x.kts)<47?K=this.Theme.current.value.colors["tropicals-ts"]:((k=(b=P.properties)==null?void 0:b.wind)==null?void 0:k.kts)>=47&&((_=(L=P.properties)==null?void 0:L.wind)==null?void 0:_.kts)<63?K=this.Theme.current.value.colors["tropicals-sts"]:((S=(z=P.properties)==null?void 0:z.wind)==null?void 0:S.kts)>=63&&((T=(M=P.properties)==null?void 0:M.wind)==null?void 0:T.kts)<79?K=this.Theme.current.value.colors["tropicals-ty"]:((I=(E=P.properties)==null?void 0:E.wind)==null?void 0:I.kts)>=79&&((j=(G=P.properties)==null?void 0:G.wind)==null?void 0:j.kts)<94?K=this.Theme.current.value.colors["tropicals-sty"]:((ae=(H=P.properties)==null?void 0:H.wind)==null?void 0:ae.kts)>=94?K=this.Theme.current.value.colors["tropicals-super-ty"]:K=this.Theme.current.value.colors["tropicals-ty"];const re=`<svg t="1719918955501"
203
+ `,["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":12,"text-font":["DIN Pro Regular","Arial Unicode MS Regular"]},paint:{"text-color":this.theme==="light"?["step",["get","val"],"rgba(0, 0, 0, 0.5)",920,"rgba(0, 0, 0, 0.5)",980,"rgba(0, 0, 0, 0.7)",1100,"rgba(0, 0, 0, 0.7)"]:"rgba(0,0,0,1)","text-halo-color":["step",["get","val"],"rgba(162,13,2,1)",920,"rgba(255, 96, 98, 1)",980,"rgba(255, 246, 184, 1)",1100,"rgba(199,171,250,1)"],"text-halo-width":1}},this.beforeLayer),l=new Date().valueOf()-(r+i),console.log("[prmsl] add elapsed: ",l,", total: ",i+=l))}},handleClear(){this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.labelLayer)&&this.map.removeLayer(this.labelLayer),this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function rc(e,t,a,r,i,l){return null}const lc=Q(ic,[["render",rc]]),hf="",nc={name:"IdmIceEdge",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Me,etime:void 0,right:10}},watch:{"factor.version":{handler(){var e;(e=this.factor)!=null&&e.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const e=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(e+t),console.log("[ice-edge] add elapsed: ",a,", total: ",t+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const e=[[0,"rgba(86, 169, 230, 0)"],[1/255,"rgba(86, 169, 230, 0)"],[25/255,"rgba(86, 169, 230, 1)"],[25/255,"rgba(47, 226, 155, 1)"],[100/255,"rgba(47, 226, 155, 1)"],[100/255,"rgba(213, 253, 37, 1)"],[175/255,"rgba(213, 253, 37, 1)"],[175/255,"rgba(230, 176, 39, 1)"],[225/255,"rgba(230, 176, 39, 1)"],[225/255,"rgba(230, 84, 39, 1)"],[250/255,"rgba(230, 84, 39, 1)"],[1,"rgba(230, 84, 39, 1)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,pe.vertexSchema,pe.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const e=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,e)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},sc={key:0};function cc(e,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",sc,[o.createElementVNode("div",{class:"legend-bars-gl4 ice-edge",style:o.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[o.createElementVNode("span",{style:{color:"rgba(var(--v-theme-black), 0.7)"}},"%",-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,"10",-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,"40",-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,"70",-1),o.createElementVNode("span",null,null,-1),o.createElementVNode("span",null,"90",-1),o.createElementVNode("span",null,null,-1)]),4)])):o.createCommentVNode("",!0)}const mc=Q(nc,[["render",cc]]),pf="",dc={name:"IdmCover",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Me,etime:void 0,right:10}},watch:{"factor.version":{handler(){var e;(e=this.factor)!=null&&e.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const e=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(e+t),console.log("[ice-cover] add elapsed: ",a,", total: ",t+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const e=[[0,"rgba(68, 1, 84, 0)"],[1/255,"rgba(63, 72, 137, 0)"],[50/255,"rgba(53, 125, 177, 1)"],[100/255,"rgba(33, 145, 140, 1)"],[150/255,"rgba(45, 178, 125, 1)"],[200/255,"rgba(112, 207, 87, 1)"],[250/255,"rgba(253, 231, 37, 0.8)"],[1,"rgba(253, 231, 37, 1)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,pe.vertexSchema,pe.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const e=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,e)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},hc={key:0};function pc(e,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",hc,[o.createElementVNode("div",{class:"legend-bars-gl4 ice-cover",style:o.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[o.createElementVNode("span",null,"%",-1),o.createElementVNode("span",null,"20",-1),o.createElementVNode("span",null,"40",-1),o.createElementVNode("span",null,"60",-1),o.createElementVNode("span",null,"80",-1),o.createElementVNode("span",null,"100",-1)]),4)])):o.createCommentVNode("",!0)}const gc=Q(dc,[["render",pc],["__scopeId","data-v-916b01eb"]]),gf="",uc={name:"IdmThickness",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},menuToggle:{type:Object},bottom:{type:String,default:"70px"}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Me,etime:void 0,right:10}},watch:{"factor.version":{handler(){var e;(e=this.factor)!=null&&e.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const e=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(e+t),console.log("[ice-thickness] add elapsed: ",a,", total: ",t+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const e=[[0,"rgba(4, 6, 19, 0)"],[1/255,"rgba(4, 6, 19, 0)"],[20/255,"rgba(51, 50, 102, 1)"],[40/255,"rgba(63, 82, 158, 1)"],[50/255,"rgba(66, 123, 183, 1)"],[60/255,"rgba(92, 161, 197, 1)"],[80/255,"rgba(134, 199, 212, 0.7)"],[100/255,"rgba(134, 199, 212, 1)"],[150/255,"rgba(234, 253, 2536, 0.8)"],[250/255,"rgba(234, 253, 2536, 0.9)"],[1,"rgba(234, 253, 2536, 1)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,pe.vertexSchema,pe.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const e=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,e)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},fc={key:0};function yc(e,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",fc,[o.createElementVNode("div",{class:"legend-bars-gl4 ice-thickness",style:o.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[o.createElementVNode("span",null,"m",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"0.6",-1),o.createElementVNode("span",null,"1",-1),o.createElementVNode("span",null,"1.5",-1),o.createElementVNode("span",null,"2",-1),o.createElementVNode("span",null,"3",-1)]),4)])):o.createCommentVNode("",!0)}const bc=Q(uc,[["render",yc]]),uf="",wc={name:"IdmPrecip3h",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Me,etime:void 0,right:10}},watch:{"factor.version":{handler(){var e;(e=this.factor)!=null&&e.active?this.handleRender():this.handleClear()},deeimmediate:!0},"menuToggle.v":{handler(){var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const e=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(e+t),console.log("[precip3h] add elapsed: ",a,", total: ",t+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const e=[[0,"rgba(59, 126, 162, 0)"],[14/255,"rgba(84,170,230, 0)"],[15/255,"rgba(172, 210, 255, 0.8)"],[20/255,"rgba(51,202,248,0.8)"],[30/255,"rgba(3,248,103,0.8)"],[49/255,"rgba(14,201,3,0.8)"],[57/255,"rgba(190,226,2,0.8)"],[73/255,"rgba(248,1,1,0.8)"],[82/255,"rgba(197,5,58,0.8)"],[1,"rgba(197,5,58,0.8)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,pe.vertexSchema,pe.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const e=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,e)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},xc={key:0};function kc(e,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",xc,[o.createElementVNode("div",{class:"legend-bars-gl4 precip3h",style:o.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[o.createElementVNode("span",null,"mm",-1),o.createElementVNode("span",null,"1.5",-1),o.createElementVNode("span",null,"2",-1),o.createElementVNode("span",null,"3",-1),o.createElementVNode("span",null,"7",-1),o.createElementVNode("span",null,"10",-1),o.createElementVNode("span",null,"20",-1),o.createElementVNode("span",null,"30",-1)]),4)])):o.createCommentVNode("",!0)}const _c=Q(wc,[["render",kc]]),ff="",vc={name:"IdmVisibility",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{right:10,program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Me,etime:void 0}},watch:{"factor.version":{handler(){var e;(e=this.factor)!=null&&e.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const e=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(e+t),console.log("[visibility] add elapsed: ",a,", total: ",t+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const e=[[0,"rgba(189,50,160,0.8)"],[8/255,"rgba(208,56,56,0.8)"],[27/255,"rgba(190,226,2,0.8)"],[60/255,"rgba(3,236,118,0.8)"],[160/255,"rgba(172, 210,255,0.8)"],[161/255,"rgba(172, 210,255,0)"],[1,"rgba(144,144,144,0)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,pe.vertexSchema,pe.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const e=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,e)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},zc={key:0};function Lc(e,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",zc,[o.createElementVNode("div",{class:"legend-bars-gl4 visibility",style:o.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[o.createElementVNode("span",null,"nm",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"0.5",-1),o.createElementVNode("span",null,"1.5",-1),o.createElementVNode("span",null,"3",-1),o.createElementVNode("span",null,"9",-1)]),4)])):o.createCommentVNode("",!0)}const Cc=Q(vc,[["render",Lc]]),yf="",Sc={name:"IdmWaterTemp",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Me,etime:void 0,right:10}},watch:{"factor.version":{handler(){var e;(e=this.factor)!=null&&e.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const e=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(e+t),console.log("[water-temp] add elapsed: ",a,", total: ",t+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const e=[[0,"rgba(95, 143, 197)"],[46/255,"rgba(95, 143, 197)"],[69/255,"rgb(80, 140, 62)"],[92/255,"rgb(121, 146, 28)"],[115/255,"rgb(171, 161, 14)"],[138/255,"rgb(223, 177, 69)"],[161/255,"rgb(243, 150, 6)"],[184/255,"rgb(236, 95, 21)"],[207/255,"rgb(190, 65, 18)"],[230/255,"rgb(138, 43, 10)"],[1,"rgb(138, 43, 10)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,pe.vertexSchema,pe.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const e=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,e)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Nc={key:0};function Pc(e,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",Nc,[o.createElementVNode("div",{class:"legend-bars-gl4 water-temp",style:o.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[o.createElementVNode("span",null,"°C",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"10",-1),o.createElementVNode("span",null,"20",-1),o.createElementVNode("span",null,"30",-1),o.createElementVNode("span",null,"40",-1)]),4)])):o.createCommentVNode("",!0)}const Mc=Q(Sc,[["render",Pc]]),bf="",Tc={name:"IdmTemp",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Me,etime:void 0,right:10}},watch:{"factor.version":{handler(){var e;(e=this.factor)!=null&&e.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const e=new Date().valueOf();let t=0,a=0;this.handleDraw(),a=new Date().valueOf()-(e+t),console.log("[temp] add elapsed: ",a,", total: ",t+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const e=[[0,"rgb(149, 137, 211)"],[100/255,"rgb(149, 137, 211)"],[110/255,"rgb(150, 209, 216)"],[120/255,"rgb(129, 204, 197)"],[130/255,"rgb(103, 180, 186)"],[140/255,"rgb(95, 143, 197)"],[150/255,"rgb(80, 140, 62)"],[160/255,"rgb(121, 146, 28)"],[170/255,"rgb(171, 161, 14)"],[180/255,"rgb(223, 177, 6)"],[190/255,"rgb(243, 150, 6)"],[200/255,"rgb(236, 95, 21)"],[210/255,"rgb(190, 65, 18)"],[220/255,"rgb(138, 43, 10)"],[1,"rgb(138, 43, 10)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:t,aPositionBuffer:a}=this.webgl.bind(this.context,pe.vertexSchema,pe.fragmentSchema);this.program=t,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const e=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,e)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Vc={key:0};function Ec(e,t,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",Vc,[o.createElementVNode("div",{class:"legend-bars-gl4 temp",style:o.normalizeStyle({right:i.right+"px"})},t[0]||(t[0]=[o.createElementVNode("span",null,"°C",-1),o.createElementVNode("span",null,"-20",-1),o.createElementVNode("span",null,"-10",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"10",-1),o.createElementVNode("span",null,"20",-1),o.createElementVNode("span",null,"30",-1),o.createElementVNode("span",null,"40",-1)]),4)])):o.createCommentVNode("",!0)}const Rc=Q(Tc,[["render",Ec]]),wf="",Dc={name:"IdmGlLayer",components:{IdmWindBarb:Ds,IdmWindParticle:Fs,IdmCurrentDirection:Zs,IdmCurrentParticle:Hs,IdmWave:$s,IdmSigWaveHeight:Qs,IdmSwell:ac,IdmPrmsl:lc,IdmIceEdge:mc,IdmIceCover:gc,IdmIceThickness:bc,IdmPrecip3h:_c,IdmVisibility:Cc,IdmWaterTemp:Mc,IdmTemp:Rc},props:{simple:{type:Boolean,default:!1},isLogin:{type:Boolean,default:!1},theme:{type:String},map:{type:Object},mapFeather:{type:String},gateway:{type:String},assistGateway:{type:Array,default:[]},defaultMeteoToken:{type:String},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}},realTime:{type:String},forecastModel:{type:String},beforeLayer:{type:String}},emits:["forecastModel","menuToggle","weatherCheckList","autoActive","weatherRendered"],data(){return{right:10,toggle:!1,autoActive:!0,weatherWeight:0,allLayers:[...je.LayerHelper.WEATHER_LAYERS],tagLayers:[...je.LayerHelper.WEATHER_LAYERS.filter(e=>!e.hide)],checkList:[],renderKey:"",iceToggleValue:void 0,waveToggleValue:void 0,weatherLayers:{},activeWeatherLayers:[],cache:{v:"0.0.1",versionKey:"weatherLayerCacheVersionGL4",autoActiveKey:"autoActiveCacheGL4",checkListKey:"weatherCheckListCacheGL4"},models:{},currentModel:localStorage.getItem("forecastModelCacheGL4")==="GFS"?"GFS":"ECMWF",zoom:6,viewport:void 0,particleFactor:void 0,showWindParticle:!0,showCurrentParticle:!0,legendToggle:!1,legend:{barbs:[2,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,0],current:[{label:"0-0.5 kts",size:.3,color:"rgb(58, 164, 58)"},{label:"0.5-1 kts",size:.4,color:"#ffff00"},{label:"1-1.5 kts",size:.6,color:"#ff9500"},{label:"1.5-2 kts",size:.8,color:"#f44336"},{label:">= 2 kts",size:1,color:"#e4711e"}],sigWaveHeight:[{label:"< 2 m",color:"rgba(0,235,156,0)"},{label:"2-3 m",color:"rgba(0,235,156,0.4)"},{label:"3-4 m",color:"#ffed00"},{label:"4-5 m",color:"#ff9800"},{label:"5-6 m",color:"#f77800"},{label:"6-7 m",color:"#e4711e"},{label:"7-8 m",color:"#e06128"},{label:"8-9 m",color:"#dc5132"},{label:"9-10 m",color:"#d5453c"},{label:"10-12 m",color:"#cd3a46"},{label:"12-14 m",color:"#be2c50"},{label:"> 14 m",color:"#aa1a5a"}]}}},computed:{listStyle(){return this.simple?{top:this.top+"px",left:this.toggle?"0px":"-280px"}:{top:this.top+"px",right:this.toggle?"0px":"-280px"}},computeDateZ(){return function(e){var t;if(e){const a=C(e);return`${(t=a==null?void 0:a.utc())==null?void 0:t.format("MMM-DD/HHmm")}Z`}return"-"}},computeDateUpdate(){return function(e){return e?C(e).fromNow():"-"}},overlaysKeys(){return this.tagLayers.filter(e=>e.overlays).map(e=>e.key)},rendersKeys(){return this.allLayers.filter(e=>!e.overlays&&e.enabled).map(e=>e.key)},showTipMenu(){return this.checkList.includes("wind")||this.checkList.includes("current-direction")||this.checkList.includes("sig-wave-height")},barbsIconName(){var t,a,r;const e=[];for(let i=0;i<((a=(t=this.legend)==null?void 0:t.barbs)==null?void 0:a.length);i++){const l=((r=this.legend)==null?void 0:r.barbs[i])||0,n=l<10?`00${l}kts`:l<100?`0${l}kts`:`${l}kts`;e.push("icon-a-"+n)}return e}},watch:{"menuToggle.v":{handler(){this.toggle=this.menuToggle.weatherLayers,this.$nextTick(()=>{var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)})}},currentModel:{handler(e,t){this.$emit("forecastModel",e),localStorage.setItem("forecastModelCacheGL4",e)},immediate:!0},forecastModel:{handler(e,t){e&&e!==t&&this.handleWeatherLayerChange({sourceChanged:!0})}},map:{handler(){this.map&&(this.fetchCache(),this.map.on("move",this.handleMove4Weather),this.viewport=new Eo(this.map),this.handleRampColorInitial())},immediate:!0},realTime:{handler(e,t){e&&t&&C(e).utc().format("yyyy-MM-DD HH")!==C(t).utc().format("yyyy-MM-DD HH")&&this.$nextTick(()=>{this.fetchWeatherLayers()})},immediate:!0},renderKey:{handler(e,t){if(e&&e!==t){const a=this.checkList.filter(r=>!this.rendersKeys.some(i=>i===r));e==="wave-group"?(this.waveToggleValue=this.waveToggleValue||"sig-wave",this.checkList=[...a,"wave-group",this.waveToggleValue]):e==="ice-forecast"?(this.iceToggleValue=this.iceToggleValue||"ice-cover",this.checkList=[...a,"ice-forecast",this.iceToggleValue||"ice-cover"]):this.checkList=[...a,e]}else!e&&t&&(this.checkList=this.checkList.filter(a=>a!==t))}},checkList:{handler(e,t){var a,r,i,l,n,c;this.handleCheckListChange(e,t),this.$emit("weatherCheckList",e),this.autoActive&&this.checkList.length?(i=(r=(a=this.$parent)==null?void 0:a.$refs)==null?void 0:r.idmBottomBar)==null||i.handleToggle("weather",!0):(c=(n=(l=this.$parent)==null?void 0:l.$refs)==null?void 0:n.idmBottomBar)==null||c.handleToggle("weather",!1)}},autoActive:{handler(e){var t,a,r,i,l,n;localStorage.setItem(this.cache.autoActiveKey,this.autoActive),this.activeWeatherLayers=this.autoActive?this.allLayers.filter(c=>this.checkList.includes(c.key)):[],this.handleWeatherLayerChange(),this.autoActive&&this.checkList.length?(r=(a=(t=this.$parent)==null?void 0:t.$refs)==null?void 0:a.idmBottomBar)==null||r.handleToggle("weather",!0):(n=(l=(i=this.$parent)==null?void 0:i.$refs)==null?void 0:l.idmBottomBar)==null||n.handleToggle("weather",!1),this.$emit("autoActive",this.autoActive)}},iceToggleValue:{handler(e){if(e){const t=this.checkList.filter(a=>!this.rendersKeys.some(r=>r===a));this.checkList=[...t,"ice-forecast",this.iceToggleValue]}}},waveToggleValue:{handler(e){if(e){const t=this.checkList.filter(a=>!this.rendersKeys.some(r=>r===a));this.checkList=[...t,"wave-group",this.waveToggleValue]}}},showWindParticle:{handler(e){let t="wind-particle";this.weatherLayers[t].particle=e,this.weatherLayers[t].version=Math.random()+1}},showCurrentParticle:{handler(e){let t="current-particle";this.weatherLayers[t].particle=e,this.weatherLayers[t].version=Math.random()+1}},isLogin:{handler(e){e?this.fetchModels():this.models={}},immediate:!0}},mounted(){this.fetchModels()},methods:{arraysEqual(e,t){if((e==null?void 0:e.length)!==(t==null?void 0:t.length))return!1;for(let a=0;a<(e==null?void 0:e.length);a++)if((e==null?void 0:e[a])!==(t==null?void 0:t[a]))return!1;return!0},fetchCache(){var a,r;const e=localStorage.getItem(this.cache.versionKey);this.cache.v!==e&&(localStorage.removeItem(this.cache.autoActiveKey),localStorage.removeItem(this.cache.checkListKey),localStorage.setItem(this.cache.versionKey,this.cache.v));let t=localStorage.getItem(this.cache.autoActiveKey);this.autoActive=t!=="false",localStorage.setItem(this.cache.autoActiveKey,this.autoActive),t=localStorage.getItem(this.cache.checkListKey),this.waveToggleValue=(a=JSON.parse(t))!=null&&a.some(i=>i==="swell")?"swell":void 0,this.iceToggleValue=(r=JSON.parse(t))!=null&&r.some(i=>i==="ice-thickness")?"ice-thickness":void 0,this.checkList=JSON.parse(t||JSON.stringify(["wind","sig-wave-height"])),this.checkList.find(i=>this.rendersKeys.includes(i))&&(this.renderKey=this.checkList.find(i=>this.rendersKeys.includes(i))),localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList))},handleMenuToggle(){this.$emit("menuToggle","weatherLayers")},handleFastWeatherToggle(e){let t=[];this.checkList.includes(e)?t=this.checkList.filter(a=>a!==e):t=[...this.checkList,e],this.handleCheckListChange(t,this.checkList)},handleCheckListChange(e,t){if(this.arraysEqual(e,t))return!1;const a=[...new Set(e)],r=a==null?void 0:a.filter(n=>!(t!=null&&t.includes(n)))[0],i=t==null?void 0:t.filter(n=>!(a!=null&&a.includes(n)))[0],l=this.checkList.filter(n=>!this.rendersKeys.some(c=>c===n));r&&(r==="ice-cover"||r==="ice-thickness"||r==="ice-forecast"?(this.checkList=[...l,"ice-forecast",this.iceToggleValue||"ice-cover"],this.iceToggleValue=this.iceToggleValue||"ice-cover"):r==="sig-wave"||r==="swell"||r==="wave-group"?(this.checkList=[...l,"wave-group",this.waveToggleValue||"sig-wave"],this.waveToggleValue=this.waveToggleValue||"sig-wave"):this.rendersKeys.includes(r)&&(this.checkList=[...l,r])),i&&(i==="ice-forecast"?(this.checkList=a.filter(n=>!["ice-cover","ice-thickness","ice-forecast"].includes(n)),this.iceToggleValue=void 0):i==="wave-group"?(this.checkList=a.filter(n=>!["wave-group","sig-wave","swell"].includes(n)),this.waveToggleValue=void 0):this.checkList=a),this.checkList.includes("wind-particle")&&(this.showWindParticle=!0),this.checkList.includes("current-particle")&&(this.showCurrentParticle=!0),localStorage.setItem(this.cache.checkListKey,JSON.stringify(a)),this.activeWeatherLayers=this.autoActive?this.allLayers.filter(n=>a.includes(n.key)):[],this.handleWeatherLayerChange()},async fetchModels(){this.models={};const e=await ge.get(`${this.gateway}/api/arc/meteo2/models2`,{headers:{Authorization:this.defaultMeteoToken}});(e==null?void 0:e.data.code)===0&&(this.models=e==null?void 0:e.data.data)},async fetchWeatherLayers(e={}){var i,l,n,c,s,d,m,g,u;const t=new Date().valueOf();let a=0,r=0;if(this.map){const y=((i=this.map)==null?void 0:i.getZoom())+1,f=(l=this.map)==null?void 0:l.getBounds(),h=`${f._sw.lng},${f._sw.lat},${f._ne.lng},${f._ne.lat}`;if(this.particleFactor&&((n=this.$refs.layer)!=null&&n.autoActive)){const p=je.LayerHelper.WEATHER_LAYERS.find(w=>{var x;return((x=w.peer)==null?void 0:x.weight)===this.particleFactor.weight});this.particleFactor.particle&&(this.showWindParticle||this.showCurrentParticle)?this.weatherWeight=this.weatherWeight&p.weight?this.weatherWeight:this.weatherWeight+p.weight:this.weatherWeight=this.weatherWeight&p.weight?this.weatherWeight-p.weight:this.weatherWeight}if(this.weatherWeight>0){let p=this.weatherWeight;if(p>0){const w=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],x=await ge.get(`${w}/api/arc/weather/layers2/links?l=${p}&v=${this.forecastModel}&z=${y}&bbox=${h}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(r=new Date().valueOf()-(t+a),console.log("weather links elapsed: ",r,", total: ",a+=r),((c=x==null?void 0:x.data)==null?void 0:c.code)===0){const b=(s=x==null?void 0:x.data)==null?void 0:s.data,k=[];for(const _ in b)k.push(ge.get(b[_],{headers:{Authorization:this.defaultMeteoToken,key:_},responseType:/\.(jpg|png)$/.test(b[_])?"blob":"json"}).catch(z=>{console.log(`[${_}] fetch layer error: ${z}`)}));const L=await Promise.all(k);this.weatherLayers={},L.map(_=>{var M,T,E,I;const z=((M=_==null?void 0:_.data)==null?void 0:M.data)||(_==null?void 0:_.data);let S=(E=(T=_==null?void 0:_.config)==null?void 0:T.headers)==null?void 0:E.key;S&&z&&(this.weatherLayers[S]={raw:z,type:((I=_==null?void 0:_.config)==null?void 0:I.responseType)==="blob"?"image":"json",etime:x.data.etime})})}if(r=new Date().valueOf()-(t+a),console.log("weather layers elapsed: ",r,", total: ",a+=r),this.weatherLayers["swell-direction"]||this.weatherLayers["swell-height"]){const b=(d=this.weatherLayers["swell-direction"])==null?void 0:d.raw,k=(m=this.weatherLayers["swell-height"])==null?void 0:m.raw;delete this.weatherLayers["swell-direction"],delete this.weatherLayers["swell-height"],this.weatherLayers.swell={type:"json",direction:b,height:{raw:k},etime:x.data.etime}}if(this.weatherLayers["current-direction"]||this.weatherLayers["current-speed"]){const b=(g=this.weatherLayers["current-direction"])==null?void 0:g.raw,k=(u=this.weatherLayers["current-speed"])==null?void 0:u.raw;delete this.weatherLayers["current-direction"],delete this.weatherLayers["current-speed"],this.weatherLayers.current={type:"json",direction:b,speed:{raw:k},etime:x.data.etime}}}}this.handleWeatherLayerToggle(),this.handleDrawWeather4Json(),this.$nextTick(()=>{var p,w,x,b,k;(k=(b=(x=(w=(p=this.$parent)==null?void 0:p.$refs)==null?void 0:w.idmBottomBar)==null?void 0:x.$refs)==null?void 0:b.capture)==null||k.captureCurrentFrame()})}},handleWeatherLayerToggle(){for(const e in this.weatherLayers)this.weatherLayers[e].active=!1,this.weatherLayers[e].version=Math.random()+1;for(const e of this.activeWeatherLayers){let t=e.key;t==="current-direction"&&(t="current"),this.weatherLayers[t]&&(this.weatherLayers[t].active=!0,this.weatherLayers[t].version=Math.random()+1,t==="wind-particle"&&(this.weatherLayers[t].particle=this.showWindParticle),t==="current-particle"&&(this.weatherLayers[t].particle=this.showCurrentParticle))}},handleWeatherLayerChange(e={sourceChanged:!1}){var a;const t=(a=this.activeWeatherLayers)==null?void 0:a.reduce((r,i)=>r+(r&(i==null?void 0:i.weight)?0:i==null?void 0:i.weight),0);e!=null&&e.sourceChanged||this.weatherWeight!==t?(this.weatherWeight=t,this.fetchWeatherLayers()):this.handleWeatherLayerToggle()},handleRampColorInitial(){var e,t,a,r,i,l,n,c,s,d,m,g;this.viewport.map.getSource((e=this.viewport)==null?void 0:e.rampColorSource)||this.viewport.map.addSource((t=this.viewport)==null?void 0:t.rampColorSource,{type:"canvas",canvas:(a=this.viewport)==null?void 0:a.rampColorCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((r=this.viewport)==null?void 0:r.rampColorLayer)||this.viewport.map.addLayer({type:"raster",id:(i=this.viewport)==null?void 0:i.rampColorLayer,source:(l=this.viewport)==null?void 0:l.rampColorSource,layout:{visibility:"none"}},this.beforeLayer),this.viewport.map.getSource((n=this.viewport)==null?void 0:n.particleSource)||this.viewport.map.addSource((c=this.viewport)==null?void 0:c.particleSource,{type:"canvas",canvas:(s=this.viewport)==null?void 0:s.particleCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((d=this.viewport)==null?void 0:d.particleLayer)||this.viewport.map.addLayer({type:"raster",id:(m=this.viewport)==null?void 0:m.particleLayer,source:(g=this.viewport)==null?void 0:g.particleSource,layout:{visibility:"none"}},this.beforeLayer)},handleDrawWeather4Json(){var l,n,c,s,d,m,g;const e=new Date().valueOf();let t=0,a=0;const r=(l=this.map)==null?void 0:l.getBounds(),i=(n=this.map)==null?void 0:n.getZoom();if(r&&i){const u=X.LngLatHelper.convertToStdLng(r._sw.lng),y=X.LngLatHelper.convertToStdLng(r._ne.lng),f=Math.floor(r._sw.lat),h=Math.ceil(r._ne.lat);for(const p in this.weatherLayers){let w=!1;if(this.weatherLayers[p].active&&this.weatherLayers[p].type==="json"){let x=[];if(p==="swell"){w=!0;const b=((c=this.weatherLayers[p])==null?void 0:c.direction)||{};for(const L in b)if(L>f&&L<h&&(!(i<=this.zoom)||L%(i<2?10:i<4?5:3)===0)){const _=b[L].lng;u>y?_.forEach((z,S)=>{var M,T,E,I,G,j;if(i<2){if((z>=0&&z<=360||z>=-360&&z<=0)&&z%10===0){const H=J.point([z,L],{val:((M=b[L].val)==null?void 0:M[S])||((T=b[L].dir)==null?void 0:T[S]),spd:(E=b[L].spd)==null?void 0:E[S]});x.push(H)}}else if((z>=u&&z<=180||z>=-180&&z<=y)&&(!(i<=this.zoom)||z%(i<2?10:i<4?5:3)===0)){const H=J.point([z,L],{val:((I=b[L].val)==null?void 0:I[S])||((G=b[L].dir)==null?void 0:G[S]),spd:(j=b[L].spd)==null?void 0:j[S]});x.push(H)}}):_.forEach((z,S)=>{var M,T,E,I,G,j;if(u<2){if((z>=0&&z<=360||z>=-360&&z<=0)&&z%10===0){const H=J.point([z,L],{val:((M=b[L].val)==null?void 0:M[S])||((T=b[L].dir)==null?void 0:T[S]),spd:(E=b[L].spd)==null?void 0:E[S]});x.push(H)}}else if(z>=u&&z<=y&&(!(i<=this.zoom)||z%(i<2?10:i<4?5:3)===0)){const H=J.point([z,L],{val:((I=b[L].val)==null?void 0:I[S])||((G=b[L].dir)==null?void 0:G[S]),spd:(j=b[L].spd)==null?void 0:j[S]});x.push(H)}})}a=new Date().valueOf()-(e+t),console.log("swell direction elapsed: ",a,", total: ",t+=a);const k=this.weatherLayers[p].height;if(k){if(!k.data){const L=[];for(const _ in(s=k.raw)==null?void 0:s.LineString){const z=k.raw.LineString[_];for(const S of z)L.push(J.lineString(S,{val:Number(_)}));k.data=J.featureCollection(L)}}if(k.data){const L=this.handleBboxClip(k.data,r);x=x.concat(L)}a=new Date().valueOf()-(e+t),console.log("swell height elapsed: ",a,", total: ",t+=a)}}else if(p==="current"){w=!0;const b=((d=this.weatherLayers[p])==null?void 0:d.direction)||{};for(const L in b)if(L>f&&L<h&&(!(i<=this.zoom)||L%(i<2?10:i<4?5:3)===0)){const _=b[L].lng;u>y?_.forEach((z,S)=>{var M,T,E,I,G,j;if(i<2){if((z>=0&&z<=360||z>=-360&&z<=0)&&z%10===0){const H=J.point([z,L],{val:((M=b[L].val)==null?void 0:M[S])||((T=b[L].dir)==null?void 0:T[S]),spd:(E=b[L].spd)==null?void 0:E[S]});x.push(H)}}else if((z>=u&&z<=180||z>=-180&&z<=y)&&(!(i<=this.zoom)||z%(i<2?10:i<4?5:3)===0)){const H=J.point([z,L],{val:((I=b[L].val)==null?void 0:I[S])||((G=b[L].dir)==null?void 0:G[S]),spd:(j=b[L].spd)==null?void 0:j[S]});x.push(H)}}):_.forEach((z,S)=>{var M,T,E,I,G,j;if(u<2){if((z>=0&&z<=360||z>=-360&&z<=0)&&z%10===0){const H=J.point([z,L],{val:((M=b[L].val)==null?void 0:M[S])||((T=b[L].dir)==null?void 0:T[S]),spd:(E=b[L].spd)==null?void 0:E[S]});x.push(H)}}else if(z>=u&&z<=y&&(!(i<=this.zoom)||z%(i<this.zoom/2?5:3)===0)){const H=J.point([z,L],{val:((I=b[L].val)==null?void 0:I[S])||((G=b[L].dir)==null?void 0:G[S]),spd:(j=b[L].spd)==null?void 0:j[S]});x.push(H)}})}a=new Date().valueOf()-(e+t),console.log("current direction elapsed: ",a,", total: ",t+=a);const k=this.weatherLayers[p].speed;if(k){if(!k.data){const _=[];for(const z in(m=k.raw)==null?void 0:m.Polygon){const S=k.raw.Polygon[z];for(const M of S)_.push(J.polygon(M,{val:Number(z)}))}k.data=J.featureCollection(_)}const L=i<this.zoom?k.data.features.filter(_=>_.properties.val>.5):k.data.features;x=x.concat(L),a=new Date().valueOf()-(e+t),console.log("current speed elapsed: ",a,", total: ",t+=a)}}else if(p==="wind"){w=!0;const b=this.weatherLayers.wind.raw;for(const k in b)if(k>f&&k<h&&(!(i<=this.zoom)||k%(i<2?10:i<4?5:3)===0)){const L=b[k].lng;u>y?L.forEach((_,z)=>{var S,M,T,E;if(i<2){if((_>=0&&_<=360||_>=-360&&_<=0)&&_%10===0){const I=J.point([_,k],{dir:((S=b[k].val)==null?void 0:S[z])||((M=b[k].dir)==null?void 0:M[z]),spd:b[k].spd[z]});x.push(I)}}else if((_>=u&&_<=180||_>=-180&&_<=y)&&(!(i<=this.zoom)||_%(i<2?10:i<4?5:3)===0)){const I=J.point([_,k],{dir:((T=b[k].val)==null?void 0:T[z])||((E=b[k].dir)==null?void 0:E[z]),spd:b[k].spd[z]});x.push(I)}}):L.forEach((_,z)=>{var S,M,T,E;if(i<2){if((_>=0&&_<=360||_>=-360&&_<=0)&&_%10===0){const I=J.point([_,k],{dir:((S=b[k].val)==null?void 0:S[z])||((M=b[k].dir)==null?void 0:M[z]),spd:b[k].spd[z]});x.push(I)}}else if(_>=u&&_<=y&&(!(i<=this.zoom)||_%(i<2?10:i<4?5:3)===0)){const I=J.point([_,k],{dir:((T=b[k].val)==null?void 0:T[z])||((E=b[k].dir)==null?void 0:E[z]),spd:b[k].spd[z]});x.push(I)}})}a=new Date().valueOf()-(e+t),console.log("wind barb elapsed: ",a,", total: ",t+=a)}else if(p==="sig-wave-height"){if(this.weatherLayers[p].data)x=this.weatherLayers[p].data;else{w=!0;const b=this.weatherLayers[p].raw;if(b){const k=[];for(const L in b.Polygon){const _=b.Polygon[L];for(const z of _)k.push(J.polygon(z,{val:Number(L)}))}for(const L in b.MultiPolygon){const _=b.MultiPolygon[L];for(const z of _)k.push(J.multiPolygon(z,{val:Number(L)}))}for(const L in b.Point){const _=b.Point[L];for(let z=0;z<((g=_.lng)==null?void 0:g.length);z++)k.push(J.point([_.lng[z],L],{val:Number(_.val[z])}))}x=x.concat(k)}}a=new Date().valueOf()-(e+t),console.log("sig-wave-height elapsed: ",a,", total: ",t+=a)}else if(p==="prmsl"){if(this.weatherLayers[p].data)x=this.weatherLayers[p].data;else{w=!0;const b=this.weatherLayers[p].raw;if(b){const k=[];for(const L in b.LineString){const _=b.LineString[L];for(const z of _)k.push(J.lineString(z,{val:Number(L)}))}for(const L in b.Point)b.Point[L].lng.forEach((_,z)=>{_=X.LngLatHelper.convertToStdLng(_),k.push(J.point([_,L],{val:b.Point[L].val[z],type:b.Point[L].type[z]}))});x=x.concat(k)}}a=new Date().valueOf()-(e+t),console.log("prmsl elapsed: ",a,", total: ",t+=a)}x.length&&(this.weatherLayers[p].data=J.featureCollection(x)),w&&(this.weatherLayers[p].version=Math.random()+1)}}}},handleMove4Weather(){for(const e in this.weatherLayers)this.weatherLayers[e].active&&this.weatherLayers[e].type==="image"&&(this.weatherLayers[e].active=!0,this.weatherLayers[e].version=Math.random()+1);this.handleDrawWeather4Json()},handleBboxClip(e,t){const a=[],r=X.LngLatHelper.convertToStdLng(t._sw.lng),i=X.LngLatHelper.convertToStdLng(t._ne.lng);return e.features.forEach(l=>{if(l.geometry.type!=="Point")if(r>i){let n=[r,t._sw.lat,180,t._ne.lat],c=J.bboxClip(l,n);c.geometry.coordinates.length&&a.push(c),n=[-180,t._sw.lat,i,t._ne.lat],c=J.bboxClip(l,n),c.geometry.coordinates.length&&a.push(c)}else{const n=[r,t._sw.lat,i,t._ne.lat],c=J.bboxClip(l,n);c.geometry.coordinates.length&&a.push(c)}else a.push(l)}),a}}},Bc={class:"idm-gl4-meteo-layers"},Ic={key:0,class:"legend-tip-btn-gl4"},Ac={class:"d-flex flex-row justify-center align-center"},Fc={class:"text-caption"},Gc={class:"d-flex flex-row justify-center align-center"},Wc={key:0,style:{width:"24px",height:"12px",border:"1px solid rgba(var(--v-border-color), var(--v-border-opacity))"}},Zc={class:"text-caption px-2"},Oc={class:"d-flex flex-row justify-start align-center"},jc={class:"d-flex flex-row justify-center align-center",style:{width:"40px"}},Xc={class:"text-caption"},Hc={class:"d-flex justify-start align-center ga-3"},Yc={class:"text-h5 font-weight-medium"},Uc={key:0,class:"w-100 d-flex justify-space-between align-center ga-1 mb-2 px-3"},Jc={key:0,class:"d-flex justify-start align-center ga-4 pl-6"},$c={key:1,class:"d-flex justify-start align-center ga-4 pl-6"},Kc={class:"text-body-1 py-2"},qc={class:"text-body-1 font-weight-medium"},Qc={class:"text-body-2 text-label"},em={class:"text-body-2 text-label"},tm={class:"text-body-2 text-label mb-3"},om={class:"text-body-1 font-weight-medium"},am={class:"text-body-2 text-label"},im={class:"text-body-2 text-label"},rm={class:"text-body-2 text-label mb-3"},lm={class:"text-body-1 py-2"},nm={class:"text-body-1 font-weight-medium"},sm={class:"text-body-2 text-label"},cm={class:"text-body-2 text-label"},mm={class:"text-body-2 text-label mb-3"},dm={class:"text-body-1 font-weight-medium"},hm={class:"text-body-2 text-label"},pm={class:"text-body-2 text-label"},gm={class:"text-body-2 text-label mb-3"},um={class:"text-body-1 py-2"},fm={class:"text-body-1 font-weight-medium"},ym={class:"text-body-2 text-label"},bm={class:"text-body-2 text-label"},wm={class:"text-body-2 text-label mb-3"};function xm(e,t,a,r,i,l){var A,F,Y,D,R,Z,P,K,re,me,he,ee,le,de,we;const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VTooltip"),s=o.resolveComponent("VCol"),d=o.resolveComponent("VRow"),m=o.resolveComponent("VCardText"),g=o.resolveComponent("VDivider"),u=o.resolveComponent("VCard"),y=o.resolveComponent("VSwitch"),f=o.resolveComponent("VBtnToggle"),h=o.resolveComponent("VCardTitle"),p=o.resolveComponent("VCardItem"),w=o.resolveComponent("VCheckbox"),x=o.resolveComponent("VRadio"),b=o.resolveComponent("IdmWindBarb"),k=o.resolveComponent("IdmSigWaveHeight"),L=o.resolveComponent("IdmCurrentDirection"),_=o.resolveComponent("IdmPrmsl"),z=o.resolveComponent("IdmWindParticle"),S=o.resolveComponent("IdmCurrentParticle"),M=o.resolveComponent("IdmWave"),T=o.resolveComponent("IdmSwell"),E=o.resolveComponent("IdmIceEdge"),I=o.resolveComponent("IdmIceCover"),G=o.resolveComponent("IdmIceThickness"),j=o.resolveComponent("IdmPrecip3h"),H=o.resolveComponent("IdmVisibility"),ae=o.resolveComponent("IdmWaterTemp"),N=o.resolveComponent("IdmTemp");return o.openBlock(),o.createElementBlock("div",Bc,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+46+"px",right:i.right+"px"})},[o.createVNode(c,{text:e.$t("weather.weatherLayers"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:W})=>[o.createVNode(n,o.mergeProps(W,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>t[9]||(t[9]=[o.createElementVNode("i",{class:"iconfont icon-Weather text-h4"},null,-1)])),_:2,__:[9]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4),l.showTipMenu?(o.openBlock(),o.createElementBlock("div",Ic,[o.createElementVNode("div",{class:o.normalizeClass(["menu-bar-box pa-1 rounded",a.simple?"simple":""]),style:o.normalizeStyle({right:i.right+"px",top:a.simple?"354px":"450px"})},[o.createVNode(c,{text:e.$t("weather.legend"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:W})=>[o.createVNode(n,o.mergeProps(W,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.legendToggle?"bg-primary active-border":""],onClick:t[0]||(t[0]=te=>i.legendToggle=!i.legendToggle)}),{default:o.withCtx(()=>t[10]||(t[10]=[o.createElementVNode("i",{class:"iconfont icon-Legend text-h4"},null,-1)])),_:2,__:[10]},1040,["class"])]),_:1},8,["text","open-on-focus","open-on-hover"])],6),i.legendToggle?(o.openBlock(),o.createBlock(u,{key:0,elevation:"16",class:"card-info d-flex justify-center align-start",style:o.normalizeStyle({position:"absolute",top:a.simple?"200px":"340px",right:i.right+50+"px"})},{default:o.withCtx(()=>[o.createVNode(m,{class:"d-flex flex-column justify-center align-start text-label px-2",style:{width:"110px"}},{default:o.withCtx(()=>[t[11]||(t[11]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2"},"Wind Level",-1)),o.createVNode(d,{class:"ma-0 ml-n1 text-body-2"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.barbs,(W,te)=>(o.openBlock(),o.createBlock(s,{key:W,cols:"6",class:"d-flex flex-row justify-start align-center py-1 px-0 ma-0"},{default:o.withCtx(()=>[o.createElementVNode("div",Ac,[o.createElementVNode("i",{class:o.normalizeClass(["iconfont",l.barbsIconName[te]]),style:o.normalizeStyle({color:a.theme==="dark"?"#fff":"#000"})},null,6),o.createElementVNode("span",Fc,o.toDisplayString(Number(W)<10?`00${W}kts`:Number(W)<100?`0${W}kts`:`${W}kts`),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[11]}),o.createVNode(g,{vertical:""}),o.createVNode(m,{class:"d-flex flex-column justify-center align-start text-label px-2",style:{width:"100px"}},{default:o.withCtx(()=>[t[12]||(t[12]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2"},"Wave Height",-1)),o.createVNode(d,{class:"ma-0"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.sigWaveHeight,(W,te)=>(o.openBlock(),o.createBlock(s,{key:te,cols:"12",class:"d-flex flex-row justify-start align-center py-1 px-0 ma-0"},{default:o.withCtx(()=>[o.createElementVNode("div",Gc,[te===0?(o.openBlock(),o.createElementBlock("div",Wc)):(o.openBlock(),o.createElementBlock("div",{key:1,style:o.normalizeStyle({width:"24px",height:"12px",background:W.color})},null,4)),o.createElementVNode("div",Zc,o.toDisplayString(W.label),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[12]}),o.createVNode(g,{vertical:""}),o.createVNode(m,{class:"d-flex flex-column justify-center align-start text-label px-2",style:{width:"90px"}},{default:o.withCtx(()=>[t[13]||(t[13]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2"},"Current",-1)),o.createVNode(d,{class:"ma-0 ml-n4"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.current,(W,te)=>(o.openBlock(),o.createBlock(s,{key:te,cols:"12",class:"d-flex flex-row justify-center align-center py-1 px-0 ma-0"},{default:o.withCtx(()=>[o.createElementVNode("div",Oc,[o.createElementVNode("div",jc,[o.createElementVNode("i",{class:"iconfont icon-a-direction-arrow text-label",style:o.normalizeStyle({fontSize:40*W.size+"px"})},null,4)]),o.createElementVNode("div",Xc,o.toDisplayString(W.label),1)])]),_:2},1024))),128))]),_:1})]),_:1,__:[13]})]),_:1},8,["style"])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["available-layers transition d-flex flex-column justify-start align-start",i.toggle?"right-bar":""]),style:o.normalizeStyle(l.listStyle)},[o.createElementVNode("div",{class:o.normalizeClass(["header-box w-100 d-flex justify-space-between align-center",a.simple?"px-3":"px-4"])},[o.createElementVNode("div",Hc,[o.createElementVNode("div",Yc,o.toDisplayString(e.$t("weather.weather")),1),o.createVNode(y,{modelValue:i.autoActive,"onUpdate:modelValue":t[1]||(t[1]=W=>i.autoActive=W),class:"small-switch",color:"primary","base-color":"disabled",inset:"","hide-details":""},null,8,["modelValue"])]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleMenuToggle},{default:o.withCtx(()=>t[14]||(t[14]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[14]},8,["onClick"])],2),a.simple?(o.openBlock(),o.createElementBlock("div",Uc,[o.createElementVNode("div",null,o.toDisplayString(e.$t("weather.forecastModel")),1),o.createVNode(f,{modelValue:i.currentModel,"onUpdate:modelValue":t[2]||(t[2]=W=>i.currentModel=W),rounded:"",height:"28",density:"compact",group:""},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"28",value:"GFS",class:"text-none btn-bg-2 px-1 text-body-1 mt-1",color:i.currentModel==="GFS"?"primary":"","base-color":""},{default:o.withCtx(()=>t[15]||(t[15]=[o.createTextVNode("NOAA",-1)])),_:1,__:[15]},8,["color"]),o.createVNode(n,{density:"compact",height:"28",class:"text-none btn-bg-2 px-1 text-body-1 mt-1",color:i.currentModel==="ECMWF"?"primary":"","base-color":"",value:"ECMWF"},{default:o.withCtx(()=>t[16]||(t[16]=[o.createTextVNode("ECMWF",-1)])),_:1,__:[16]},8,["color"])]),_:1},8,["modelValue"])])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["list-box w-100 scroll overflow-y-auto",[i.autoActive?"":"cursor-not-allowed",a.simple?"px-3":"pl-4 pr-2"]])},[o.createVNode(u,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(p,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(h,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("weather.overlays")),1)]),_:1})]),_:1}),o.createVNode(m,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(W=>W.overlays),W=>(o.openBlock(),o.createBlock(w,{key:W.key,modelValue:i.checkList,"onUpdate:modelValue":t[3]||(t[3]=te=>i.checkList=te),value:W.key,label:e.$t(`weather.${W.locale}`),disabled:!i.autoActive,color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label","disabled"]))),128))]),_:1})]),_:1}),o.createVNode(u,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(p,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(h,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("weather.renders")),1)]),_:1})]),_:1}),o.createVNode(m,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(W=>!W.overlays),W=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:W.key},[o.createVNode(x,{modelValue:i.renderKey,"onUpdate:modelValue":t[4]||(t[4]=te=>i.renderKey=te),label:e.$t(`weather.${W.locale}`),value:W.key,disabled:!i.autoActive,color:"primary",density:"compact",style:{height:"36px"},class:"text-body-2 py-1","hide-details":"",onClick:te=>i.renderKey=i.renderKey===W.key?"":W.key},null,8,["modelValue","label","value","disabled","onClick"]),i.renderKey==="wind-particle"&&W.key==="wind-particle"?(o.openBlock(),o.createElementBlock("div",Jc,[o.createElementVNode("span",null,o.toDisplayString(e.$t("weather.particleAnimatiom")),1),o.createVNode(y,{modelValue:i.showWindParticle,"onUpdate:modelValue":t[5]||(t[5]=te=>i.showWindParticle=te),label:"",class:"small-switch",color:"primary","base-color":"disabled",density:"compact",inset:"",style:{"font-size":"14px"},"hide-details":""},null,8,["modelValue"])])):o.createCommentVNode("",!0),i.renderKey==="current-particle"&&W.key==="current-particle"?(o.openBlock(),o.createElementBlock("div",$c,[o.createElementVNode("span",null,o.toDisplayString(e.$t("weather.particleAnimatiom")),1),o.createVNode(y,{modelValue:i.showCurrentParticle,"onUpdate:modelValue":t[6]||(t[6]=te=>i.showCurrentParticle=te),label:"",class:"small-switch",color:"primary","base-color":"disabled",inset:"",density:"compact",height:"20","hide-details":""},null,8,["modelValue"])])):o.createCommentVNode("",!0),i.renderKey==="wave-group"&&W.key==="wave-group"?(o.openBlock(),o.createBlock(f,{key:2,modelValue:i.waveToggleValue,"onUpdate:modelValue":t[7]||(t[7]=te=>i.waveToggleValue=te),class:"w-100 pl-7 rounded",rounded:"0",height:"30",density:"compact",group:"",disabled:!i.autoActive},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"30",value:"sig-wave",class:"w-50 text-none px-2 text-body-1",color:i.waveToggleValue==="sig-wave"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("weather.significant")),1)]),_:1},8,["color","disabled"]),o.createVNode(n,{density:"compact",height:"30",class:"w-50 text-none px-2 text-body-1",color:i.waveToggleValue==="swell"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive,value:"swell"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("weather.swell")),1)]),_:1},8,["color","disabled"])]),_:1},8,["modelValue","disabled"])):o.createCommentVNode("",!0),i.renderKey==="ice-forecast"&&W.key==="ice-forecast"?(o.openBlock(),o.createBlock(f,{key:3,modelValue:i.iceToggleValue,"onUpdate:modelValue":t[8]||(t[8]=te=>i.iceToggleValue=te),class:"w-100 pl-7 rounded",rounded:"0",height:"30",density:"compact",group:"",disabled:!i.autoActive},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"30",value:"ice-cover",class:"w-50 text-none px-2 text-body-1",color:i.iceToggleValue==="ice-cover"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("weather.coverage")),1)]),_:1},8,["color","disabled"]),o.createVNode(n,{density:"compact",height:"30",class:"w-50 text-none px-2 text-body-1",color:i.iceToggleValue==="ice-thickness"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive,value:"ice-thickness"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("weather.thickness")),1)]),_:1},8,["color","disabled"])]),_:1},8,["modelValue","disabled"])):o.createCommentVNode("",!0)],64))),128))]),_:1})]),_:1}),o.createVNode(u,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(p,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(h,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("weather.forecastModel")),1)]),_:1})]),_:1}),o.createVNode(m,{class:""},{default:o.withCtx(()=>{var W,te,Te,Le,fe,xe,U,ye,ie,ne,Se,Ee,Ve,B,se,ke,Ne,Pe,O,Ce,q,We,Ze,Oe,ve,at,it,rt,lt,nt,st,ct,mt,dt,ht,pt,gt,ut,ft,yt,bt,wt,xt,kt,_t,vt,zt,Lt,Ct,St,Nt,Pt,Mt,Tt,Vt,Et,Rt,Dt,Bt,It,At,Ft,Gt,Wt,Zt,Ot,jt,Xt,Ht,Yt,Ut,Jt,Kt,qt,Qt,eo,to,oo,ao,io,ro,lo,no,so,co,mo,ho,po,go,uo,fo,yo,bo,wo,xo,ko,_o,vo,zo,Lo,Co,So,No,Po,Mo;return[o.createElementVNode("div",Kc,o.toDisplayString(e.$t("weather.atmospheric")),1),o.createElementVNode("div",qc,o.toDisplayString((Te=(te=(W=i.models)==null?void 0:W.weather)==null?void 0:te.NOAA)==null?void 0:Te.source)+" "+o.toDisplayString((xe=(fe=(Le=i.models)==null?void 0:Le.weather)==null?void 0:fe.NOAA)==null?void 0:xe.spatialResolution)+o.toDisplayString(e.$t("units.km"))+" "+o.toDisplayString((ne=(ie=(ye=(U=i.models)==null?void 0:U.weather)==null?void 0:ye.NOAA)==null?void 0:ie.meta)==null?void 0:ne.days)+o.toDisplayString(e.$t("units.days")),1),o.createElementVNode("div",Qc,o.toDisplayString(e.$t("weather.source"))+": NOAA",1),o.createElementVNode("div",em,o.toDisplayString(e.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((B=(Ve=(Ee=(Se=i.models)==null?void 0:Se.weather)==null?void 0:Ee.NOAA)==null?void 0:Ve.meta)==null?void 0:B.availabilityTime)),1),o.createElementVNode("div",tm,o.toDisplayString(e.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((Pe=(Ne=(ke=(se=i.models)==null?void 0:se.weather)==null?void 0:ke.NOAA)==null?void 0:Ne.meta)==null?void 0:Pe.initialisationTime)),1),o.createElementVNode("div",om,o.toDisplayString((q=(Ce=(O=i.models)==null?void 0:O.weather)==null?void 0:Ce.ECMWF)==null?void 0:q.source)+" "+o.toDisplayString((Oe=(Ze=(We=i.models)==null?void 0:We.weather)==null?void 0:Ze.ECMWF)==null?void 0:Oe.spatialResolution)+o.toDisplayString(e.$t("units.km"))+" "+o.toDisplayString((rt=(it=(at=(ve=i.models)==null?void 0:ve.weather)==null?void 0:at.ECMWF)==null?void 0:it.meta)==null?void 0:rt.days)+o.toDisplayString(e.$t("units.days")),1),o.createElementVNode("div",am,o.toDisplayString(e.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",im,o.toDisplayString(e.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((ct=(st=(nt=(lt=i.models)==null?void 0:lt.weather)==null?void 0:nt.ECMWF)==null?void 0:st.meta)==null?void 0:ct.availabilityTime)),1),o.createElementVNode("div",rm,o.toDisplayString(e.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((pt=(ht=(dt=(mt=i.models)==null?void 0:mt.weather)==null?void 0:dt.ECMWF)==null?void 0:ht.meta)==null?void 0:pt.initialisationTime)),1),o.createVNode(g),o.createElementVNode("div",lm,o.toDisplayString(e.$t("weather.wave")),1),o.createElementVNode("div",nm,o.toDisplayString((yt=(ft=(ut=(gt=i.models)==null?void 0:gt.marine)==null?void 0:ut.wave)==null?void 0:ft.NOAA)==null?void 0:yt.source)+" "+o.toDisplayString((kt=(xt=(wt=(bt=i.models)==null?void 0:bt.marine)==null?void 0:wt.wave)==null?void 0:xt.NOAA)==null?void 0:kt.spatialResolution)+o.toDisplayString(e.$t("units.km"))+" "+o.toDisplayString((Ct=(Lt=(zt=(vt=(_t=i.models)==null?void 0:_t.marine)==null?void 0:vt.wave)==null?void 0:zt.NOAA)==null?void 0:Lt.meta)==null?void 0:Ct.days)+o.toDisplayString(e.$t("units.days")),1),o.createElementVNode("div",sm,o.toDisplayString(e.$t("weather.source"))+": NOAA",1),o.createElementVNode("div",cm,o.toDisplayString(e.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((Tt=(Mt=(Pt=(Nt=(St=i.models)==null?void 0:St.marine)==null?void 0:Nt.wave)==null?void 0:Pt.NOAA)==null?void 0:Mt.meta)==null?void 0:Tt.availabilityTime)),1),o.createElementVNode("div",mm,o.toDisplayString(e.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((Bt=(Dt=(Rt=(Et=(Vt=i.models)==null?void 0:Vt.marine)==null?void 0:Et.wave)==null?void 0:Rt.NOAA)==null?void 0:Dt.meta)==null?void 0:Bt.initialisationTime)),1),o.createElementVNode("div",dm,o.toDisplayString((Gt=(Ft=(At=(It=i.models)==null?void 0:It.marine)==null?void 0:At.wave)==null?void 0:Ft.ECMWF)==null?void 0:Gt.source)+" "+o.toDisplayString((jt=(Ot=(Zt=(Wt=i.models)==null?void 0:Wt.marine)==null?void 0:Zt.wave)==null?void 0:Ot.ECMWF)==null?void 0:jt.spatialResolution)+o.toDisplayString(e.$t("units.km"))+" "+o.toDisplayString((Jt=(Ut=(Yt=(Ht=(Xt=i.models)==null?void 0:Xt.marine)==null?void 0:Ht.wave)==null?void 0:Yt.ECMWF)==null?void 0:Ut.meta)==null?void 0:Jt.days)+o.toDisplayString(e.$t("units.days")),1),o.createElementVNode("div",hm,o.toDisplayString(e.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",pm,o.toDisplayString(e.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((to=(eo=(Qt=(qt=(Kt=i.models)==null?void 0:Kt.marine)==null?void 0:qt.wave)==null?void 0:Qt.ECMWF)==null?void 0:eo.meta)==null?void 0:to.availabilityTime)),1),o.createElementVNode("div",gm,o.toDisplayString(e.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((lo=(ro=(io=(ao=(oo=i.models)==null?void 0:oo.marine)==null?void 0:ao.wave)==null?void 0:io.ECMWF)==null?void 0:ro.meta)==null?void 0:lo.initialisationTime)),1),o.createVNode(g),o.createElementVNode("div",um,o.toDisplayString(e.$t("weather.currents")),1),o.createElementVNode("div",fm,o.toDisplayString((mo=(co=(so=(no=i.models)==null?void 0:no.marine)==null?void 0:so.current)==null?void 0:co.ECMWF)==null?void 0:mo.source)+" "+o.toDisplayString((uo=(go=(po=(ho=i.models)==null?void 0:ho.marine)==null?void 0:po.current)==null?void 0:go.ECMWF)==null?void 0:uo.spatialResolution)+o.toDisplayString(e.$t("units.km"))+" "+o.toDisplayString((xo=(wo=(bo=(yo=(fo=i.models)==null?void 0:fo.marine)==null?void 0:yo.current)==null?void 0:bo.ECMWF)==null?void 0:wo.meta)==null?void 0:xo.days)+o.toDisplayString(e.$t("units.days")),1),o.createElementVNode("div",ym,o.toDisplayString(e.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",bm,o.toDisplayString(e.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((Lo=(zo=(vo=(_o=(ko=i.models)==null?void 0:ko.marine)==null?void 0:_o.current)==null?void 0:vo.ECMWF)==null?void 0:zo.meta)==null?void 0:Lo.availabilityTime)),1),o.createElementVNode("div",wm,o.toDisplayString(e.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((Mo=(Po=(No=(So=(Co=i.models)==null?void 0:Co.marine)==null?void 0:So.current)==null?void 0:No.ECMWF)==null?void 0:Po.meta)==null?void 0:Mo.initialisationTime)),1)]}),_:1})]),_:1})],2)],6),a.map?(o.openBlock(),o.createBlock(b,o.mergeProps({key:1,ref:"windBarb",map:a.map,"map-feather":a.mapFeather,"before-layer":"empty-layer-3",wind:(A=i.weatherLayers)==null?void 0:A.wind,"menu-toggle":a.menuToggle},e.$attrs),null,16,["map","map-feather","wind","menu-toggle"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(k,o.mergeProps({key:2,map:a.map,"before-layer":"empty-layer-2","sig-wave-height":(F=i.weatherLayers)==null?void 0:F["sig-wave-height"],"menu-toggle":a.menuToggle,"active-weather-layers":i.activeWeatherLayers},e.$attrs),null,16,["map","sig-wave-height","menu-toggle","active-weather-layers"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(L,o.mergeProps({key:3,map:a.map,"map-feather":a.mapFeather,"before-layer":"empty-layer-2",current:(Y=i.weatherLayers)==null?void 0:Y.current,"menu-toggle":a.menuToggle},e.$attrs),null,16,["map","map-feather","current","menu-toggle"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(_,o.mergeProps({key:4,map:a.map,"before-layer":"empty-layer-3",prmsl:(D=i.weatherLayers)==null?void 0:D.prmsl,"menu-toggle":a.menuToggle,"active-weather-layers":i.activeWeatherLayers},e.$attrs,{theme:a.theme}),null,16,["map","prmsl","menu-toggle","active-weather-layers","theme"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(z,o.mergeProps({key:5,viewport:i.viewport,factor:(R=i.weatherLayers)==null?void 0:R["wind-particle"],"menu-toggle":a.menuToggle,simple:a.simple},e.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(S,o.mergeProps({key:6,viewport:i.viewport,factor:(Z=i.weatherLayers)==null?void 0:Z["current-particle"],"menu-toggle":a.menuToggle,simple:a.simple},e.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(M,o.mergeProps({key:7,viewport:i.viewport,factor:(P=i.weatherLayers)==null?void 0:P["sig-wave"],"menu-toggle":a.menuToggle,simple:a.simple},e.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(T,o.mergeProps({key:8,map:a.map,viewport:i.viewport,factor:(K=i.weatherLayers)==null?void 0:K.swell,"menu-toggle":a.menuToggle,"active-weather-layers":i.activeWeatherLayers,simple:a.simple},e.$attrs),null,16,["map","viewport","factor","menu-toggle","active-weather-layers","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(E,o.mergeProps({key:9,viewport:i.viewport,factor:(re=i.weatherLayers)==null?void 0:re["ice-edge"],"menu-toggle":a.menuToggle,simple:a.simple},e.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(I,o.mergeProps({key:10,viewport:i.viewport,factor:(me=i.weatherLayers)==null?void 0:me["ice-cover"],"menu-toggle":a.menuToggle,simple:a.simple},e.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(G,o.mergeProps({key:11,viewport:i.viewport,factor:(he=i.weatherLayers)==null?void 0:he["ice-thickness"],"menu-toggle":a.menuToggle,simple:a.simple},e.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(j,o.mergeProps({key:12,viewport:i.viewport,factor:(ee=i.weatherLayers)==null?void 0:ee.precip3h,"menu-toggle":a.menuToggle,simple:a.simple},e.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(H,o.mergeProps({key:13,viewport:i.viewport,factor:(le=i.weatherLayers)==null?void 0:le.visibility,"menu-toggle":a.menuToggle,simple:a.simple},e.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(ae,o.mergeProps({key:14,viewport:i.viewport,factor:(de=i.weatherLayers)==null?void 0:de["water-temp"],"menu-toggle":a.menuToggle,simple:a.simple},e.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(N,o.mergeProps({key:15,viewport:i.viewport,factor:(we=i.weatherLayers)==null?void 0:we.temp,"menu-toggle":a.menuToggle,simple:a.simple},e.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0)])}const km=Q(Dc,[["render",xm]]),$e=[{rank:0,name:"Best Match",alias:"BEST MATCH",model:"best_match",models:["best_match"]},{rank:1,name:"GFS",alias:"GFS",model:"gfs_seamless",provider:"NOAA",country:"United States",resolution:25,tips:"3-25km",length:16,frequency:1,models:["gfs_seamless"],categories:"ncep_gfs013,ncep_gfs025,ncep_gfs_graphcast025,ncep_hrrr_conus,ncep_nbm_conus",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:2,name:"ECMWF",alias:"ECMWF",model:"ecmwf_ifs025",provider:"ECMWF",country:"European Union",resolution:25,tips:"25km",length:15,frequency:6,models:["ecmwf_ifs025","ecmwf_aifs025_single"],categories:"ecmwf_ifs025,ecmwf_aifs025_single",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:3,disabled:!0,name:"ICON",alias:"ECMWF",model:"icon_seamless",provider:"Deutscher Wetterdienst (DWD)",country:"Germany",resolution:13,tips:"2-13km",length:7.5,frequency:3,models:["icon_seamless","icon_global","icon_eu","icon_d2"],categories:"dwd_icon,dwd_icon_eps,dwd_icon_d2,dwd_icon_d2_eps,dwd_icon_eu,dwd_icon_eu_eps",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:4,name:"ARPEGE",disabled:!0,alias:"ECMWF",model:"arpege_seamless",provider:"Météo-France",country:"France",resolution:25,tips:"1-25km",length:4,frequency:1,models:["arpege_seamless","arpege_world","arpege_europe"],categories:"meteofrance_arpege_europe,meteofrance_arpege_europe_probabilities,meteofrance_arpege_world025",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:5,name:"UKMO",disabled:!0,alias:"ECMWF",model:"ukmo_seamless",provider:"UK Met Office",country:"United Kingdom",resolution:10,tips:"2-10km",length:7,frequency:1,models:["ukmo_seamless","ukmo_global_deterministic_10km","ukmo_uk_deterministic_2km"],categories:"ukmo_global_deterministic_10km,ukmo_uk_deterministic_2km",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:6,name:"JMA",disabled:!0,alias:"GFS",model:"jma_seamless",provider:"JMA",country:"Japan",resolution:55,tips:"5-55km",length:11,frequency:3,models:["jma_seamless","jma_msm","jma_gsm"],categories:"jma_gsm,jma_msm",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:7,name:"GEM",disabled:!0,alias:"GFS",model:"gem_seamless",provider:"Canadian Weather Service",country:"Canada",resolution:2.5,tips:"2.5km",length:10,frequency:6,models:["gem_seamless","gem_global","gem_regional"],categories:"cmc_gem_gdps,cmc_gem_hrdps,cmc_gem_rdps",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:8,name:"GRAPES",disabled:!0,alias:"GFS",model:"cma_grapes_global",provider:"China Meteorological Administration (CMA)",country:"China",resolution:15,tips:"15km",length:10,frequency:6,models:["cma_grapes_global"],categories:"cma_grapes_global",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:9,name:"ACCESS-G",disabled:!0,alias:"GFS",model:"bom_access_global",provider:"Australian Bureau of Meteorology (BOM)",country:"Australia",resolution:15,tips:"15km",length:10,frequency:6,models:["bom_access_global"],categories:"bom_access_global",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"}],Ke=[{rank:0,name:"Best Match",alias:"BEST MATCH",model:"best_match",models:["best_match"]},{rank:1,name:"MFWAM",alias:"ECMWF",model:"meteofrance_wave",provider:"MeteoFrance",country:"France",resolution:8,tips:"8km",length:10,frequency:12,models:["meteofrance_wave"],categories:"meteofrance_wave",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:2,disabled:!0,name:"SMOC",alias:"ECMWF",model:"meteofrance_currents",provider:"MeteoFrance",country:"France",resolution:8,tips:"8km",length:10,frequency:24,models:["meteofrance_currents"],categories:"meteofrance_currents, meteofrance_sea_surface_temperature",variables:"ocean_u_current,ocean_v_current,invert_barometer_height,sea_level_height_msl,sea_surface_temperature"},{rank:3,disabled:!0,name:"EWAM",alias:"ECMWF",model:"ewam",provider:"DWD",country:"Germany",resolution:5,tips:"5km",length:8,frequency:2,models:["ewam"],categories:"dwd_ewam",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:4,disabled:!0,name:"GWAM",alias:"ECMWF",model:"gwam",provider:"DWD",country:"Germany",resolution:5,tips:"5km",length:4,frequency:2,models:["gwam"],categories:"dwd_gwam",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:5,disabled:!0,name:"ECWAM",alias:"ECMWF",model:"ecmwf_wam025",provider:"ECMWF",country:"Europe",resolution:25,tips:"25km",length:10,frequency:6,models:["ecmwf_wam025"],categories:"ecmwf_wam025",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:6,name:"GFSWave",alias:"GFS",model:"ncep_gfswave025",provider:"NCEP",country:"USA",resolution:25,tips:"25km",length:10,frequency:6,models:["ncep_gfswave025","ncep_gfswave016"],categories:"ncep_gfswave025,ncep_gfswave016",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:7,disabled:!0,name:"ERA5-Ocean",alias:"ECMWF",model:"era5_ocean",provider:"Copernicus",country:"Europe",resolution:50,tips:"50km",length:-5,frequency:1,models:["era5_ocean"],categories:"copernicus_era5_ocean",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"}];let ma=class{static standardWeatherModels(){return $e.filter(t=>!t.disabled&&t.alias)}static standardMarineModels(){return Ke.filter(t=>!t.disabled&&t.alias)}static autoPickLayerModel(t,a="copernicus"){return a=a||"copernicus",a=a==null?void 0:a.toLowerCase(),a=["gfs","ecmwf","copernicus"].includes(a)?a:"copernicus",t=t==null?void 0:t.toLowerCase(),t==="gfs"?"gfs":["ec","ecmwf"].includes(t)?"ecmwf":["copernicus","cmems"].includes(t)?"copernicus":a}static autoPickPeerModel(t,a,r="copernicus"){if(a=this.autoPickLayerModel(a,r),xr.LayerHelper.WEATHER_LAYERS.reduce((i,l)=>l.atmos?i+l.weight:i,0)&t.weight){if(a==="copernicus")return"ecmwf"}else if(a==="ecmwf")return"copernicus";return a}static autoPickMeteoModel(t="best_match"){var a,r;t=t==null?void 0:t.toLowerCase(),t=t==="ec"?"ecmwf":t;const i=t.toLowerCase().split(","),l=[],n=[];for(const c of i){let s=$e.find(m=>{var g,u,y;return((g=m.models)==null?void 0:g.includes(c))||((u=m.alias)==null?void 0:u.toLowerCase())===c||((y=m.name)==null?void 0:y.toLowerCase())===c}),d=Ke.find(m=>{var g,u,y;return((g=m.models)==null?void 0:g.includes(c))||((u=m.alias)==null?void 0:u.toLowerCase())===c||((y=m.name)==null?void 0:y.toLowerCase())===c});s=s||$e.find(m=>{var g,u;return((g=m.alias)==null?void 0:g.toLowerCase())===((u=d==null?void 0:d.alias)==null?void 0:u.toLowerCase())}),d=d||Ke.find(m=>{var g,u;return((g=m.alias)==null?void 0:g.toLowerCase())===((u=s==null?void 0:s.alias)==null?void 0:u.toLowerCase())}),s=s||$e[0],d=d||Ke[0],l.push((a=s.models)!=null&&a.includes(c)?c:s.model),n.push((r=d.models)!=null&&r.includes(c)?c:d.model)}return{weatherModels:l.join(","),marineModels:n.join(",")}}static autoPickSubCategories(t){t=t.toUpperCase();const a=$e.filter(l=>l.alias===t),r=Ke.filter(l=>l.alias===t),i=[];return a.forEach(l=>{l.categories&&i.push(...l.categories.split(","))}),r.forEach(l=>{l.categories&&i.push(...l.categories.split(","))}),i}static pickHourly(t,a){var r,i,l,n,c,s,d,m,g,u,y,f,h,p,w,x,b,k,L,_,z,S,M,T,E,I,G,j,H,ae,N,A,F,Y,D,R,Z,P,K,re,me,he,ee,le,de,we,W,te,Te,Le,fe,xe;const U=typeof a=="string"?C(a):a,ye=t==null?void 0:t.weather,ie=t==null?void 0:t.marine,ne=C((i=(r=ye==null?void 0:ye[0])==null?void 0:r.hourly)==null?void 0:i.date).utc(),Se=ne.clone().add((c=(n=(l=ye==null?void 0:ye[0])==null?void 0:l.hourly)==null?void 0:n.time)==null?void 0:c.at(0),"h"),Ee=ne.clone().add((m=(d=(s=ye==null?void 0:ye[0])==null?void 0:s.hourly)==null?void 0:d.time)==null?void 0:m.at(-1),"h"),Ve=[];if(U.isBetween(Se,Ee,"millisecond","[]")){const B=U.utc().diff(Se,"h",!1);let se,ke;if(ye){let Ne=0,Pe=0,O=0;for(const Ce of ye){const q=Ce==null?void 0:Ce.hourly;for(let ve=B-(B-1)%3;ve<=B;ve++)Ne+=(g=q==null?void 0:q.precipitation)==null?void 0:g.at(ve);for(let ve=B-(B-1)%6;ve<=B;ve++)Pe+=(u=q==null?void 0:q.precipitation)==null?void 0:u.at(ve);for(let ve=B-(B-1)%12;ve<=B;ve++)O+=(y=q==null?void 0:q.precipitation)==null?void 0:y.at(ve);se={temp:(f=q==null?void 0:q.temperature_2m)==null?void 0:f.at(B),apparentTemp:(h=q==null?void 0:q.apparent_temperature)==null?void 0:h.at(B),rh:(p=q==null?void 0:q.relative_humidity_2m)==null?void 0:p.at(B),dp:(w=q==null?void 0:q.dew_point_2m)==null?void 0:w.at(B),precip:{probability:(x=q==null?void 0:q.precipitation_probability)==null?void 0:x.at(B),sum:(b=q==null?void 0:q.precipitation)==null?void 0:b.at(B),sum1Hours:(k=q==null?void 0:q.precipitation)==null?void 0:k.at(B),sum3Hours:Math.round(Ne*100)/100,sum6Hours:Math.round(Pe*100)/100,sum12Hours:Math.round(O*100)/100},pmsl:(L=q==null?void 0:q.pressure_msl)==null?void 0:L.at(B),psurf:(_=q==null?void 0:q.surface_pressure)==null?void 0:_.at(B),code:(z=q==null?void 0:q.weather_code)==null?void 0:z.at(B),visibility:this.m2nm((S=q==null?void 0:q.visibility)==null?void 0:S.at(B)),wind:{speed:(M=q==null?void 0:q.wind_speed_10m)==null?void 0:M.at(B),kts:(T=q==null?void 0:q.wind_speed_10m)==null?void 0:T.at(B),degree:(E=q==null?void 0:q.wind_direction_10m)==null?void 0:E.at(B),bearing:((I=q==null?void 0:q.wind_direction_10m)==null?void 0:I.at(B))!==null?(((G=q==null?void 0:q.wind_direction_10m)==null?void 0:G.at(B))+180)%360:null,gusts:(j=q==null?void 0:q.wind_gusts_10m)==null?void 0:j.at(B)},isDay:(H=q==null?void 0:q.is_day)==null?void 0:H.at(B)};const{name:We,url:Ze,bg:Oe}=this.parseWeatherCode(se.code,se.isDay);se.name=We,se.url=Ze,se.bg=Oe,se.wind.scale=this.beaufort(this.kts2ms(se.wind.kts)),se.wind.direction=this.degree2Direction(se.wind.degree),Ve.push({utc:Se.add(B,"h").format(),model:Ce.model,weather:{...se}})}}if(ie){let Ne=0;for(const Pe of ie){const O=Pe==null?void 0:Pe.hourly;ke={wave:{sig:{height:(ae=O==null?void 0:O.wave_height)==null?void 0:ae.at(B),degree:(N=O==null?void 0:O.wave_direction)==null?void 0:N.at(B),bearing:((A=O==null?void 0:O.wave_direction)==null?void 0:A.at(B))!==null?(((F=O==null?void 0:O.wave_direction)==null?void 0:F.at(B))+180)%360:null,period:(Y=O==null?void 0:O.wave_period)==null?void 0:Y.at(B)},swell:{height:(D=O==null?void 0:O.swell_wave_height)==null?void 0:D.at(B),degree:(R=O==null?void 0:O.swell_wave_direction)==null?void 0:R.at(B),bearing:((Z=O==null?void 0:O.swell_wave_direction)==null?void 0:Z.at(B))!==null?(((P=O==null?void 0:O.swell_wave_direction)==null?void 0:P.at(B))+180)%360:null,period:(K=O==null?void 0:O.swell_wave_period)==null?void 0:K.at(B),peakPeriod:(re=O==null?void 0:O.swell_wave_peak_period)==null?void 0:re.at(B)},wd:{height:(me=O==null?void 0:O.wind_wave_height)==null?void 0:me.at(B),degree:(he=O==null?void 0:O.wind_wave_direction)==null?void 0:he.at(B),bearing:((ee=O==null?void 0:O.wind_wave_direction)==null?void 0:ee.at(B))!==null?(((le=O==null?void 0:O.wind_wave_direction)==null?void 0:le.at(B))+180)%360:null,period:(de=O==null?void 0:O.wind_wave_period)==null?void 0:de.at(B),peakPeriod:(we=O==null?void 0:O.wind_wave_peak_period)==null?void 0:we.at(B)}},current:{speed:(W=O==null?void 0:O.ocean_current_velocity)==null?void 0:W.at(B),kts:(te=O==null?void 0:O.ocean_current_velocity)==null?void 0:te.at(B),degree:(Te=O==null?void 0:O.ocean_current_direction)==null?void 0:Te.at(B),bearing:((Le=O==null?void 0:O.ocean_current_direction)==null?void 0:Le.at(B))??null},sst:(fe=O==null?void 0:O.sea_surface_temperature)==null?void 0:fe.at(B),height:(xe=O==null?void 0:O.sea_level_height_msl)==null?void 0:xe.at(B)},ke.wave=this.parseWave(ke.wave,se==null?void 0:se.wind),ke.current.direction=this.degree2Direction(ke.current.degree),Object.assign(Ve[Ne],ke),Ne++}}}return Ve}static toLegacy(t){var a,r,i,l,n,c,s,d,m,g;return{wind:(a=t==null?void 0:t.weather)==null?void 0:a.wind,visibility:(r=t==null?void 0:t.weather)==null?void 0:r.visibility,temp:(i=t==null?void 0:t.weather)==null?void 0:i.temp,prmsl:(l=t==null?void 0:t.weather)==null?void 0:l.pmsl,gusts:{kts:(c=(n=t==null?void 0:t.weather)==null?void 0:n.wind)==null?void 0:c.gusts},precip:(s=t==null?void 0:t.weather)==null?void 0:s.precip,code:(d=t==null?void 0:t.weather)==null?void 0:d.code,name:(m=t==null?void 0:t.weather)==null?void 0:m.name,url:(g=t==null?void 0:t.weather)==null?void 0:g.url,wave:t==null?void 0:t.wave,current:t==null?void 0:t.current,sst:t==null?void 0:t.sst,height:t==null?void 0:t.height,utc:t==null?void 0:t.utc,source:t==null?void 0:t.model}}static pickDaily(t,a){var r,i,l,n,c,s,d,m,g,u,y,f,h,p,w,x,b,k,L,_,z,S,M,T,E,I,G,j,H,ae,N,A,F,Y,D,R,Z,P,K,re,me,he,ee,le;const de=typeof a=="string"?C(a):a,we=t==null?void 0:t.weather,W=t==null?void 0:t.marine,te=C((l=(i=(r=we==null?void 0:we[0])==null?void 0:r.daily)==null?void 0:i.time)==null?void 0:l.at(0)),Te=C((s=(c=(n=we==null?void 0:we[0])==null?void 0:n.daily)==null?void 0:c.time)==null?void 0:s.at(-1)),Le=[];if(de.isBetween(te,Te,"millisecond","[]")){let fe,xe;const U=de.diff(te,"d",!1);if(we)for(const ye of we){const ie=ye.daily;fe={code:(d=ie.weather_code)==null?void 0:d.at(U),temp:{max:(m=ie.temperature_2m_max)==null?void 0:m.at(U),min:(g=ie.temperature_2m_min)==null?void 0:g.at(U),mean:(u=ie.temperature_2m_mean)==null?void 0:u.at(U)},apparentTemp:{max:(y=ie.apparent_temperature_max)==null?void 0:y.at(U),min:(f=ie.apparent_temperature_min)==null?void 0:f.at(U)},precip:{sum:(h=ie.precipitation_sum)==null?void 0:h.at(U),rainSum:(p=ie.rain_sum)==null?void 0:p.at(U),snowfallSum:(w=ie.snowfall_sum)==null?void 0:w.at(U),showersSum:(x=ie.showers_sum)==null?void 0:x.at(U),hours:(b=ie.precipitation_hours)==null?void 0:b.at(U),probability:(k=ie.precipitation_probability_max)==null?void 0:k.at(U)},rh:{max:(L=ie.relative_humidity_2m_max)==null?void 0:L.at(U),min:(_=ie.relative_humidity_2m_min)==null?void 0:_.at(U),mean:(z=ie.relative_humidity_2m_mean)==null?void 0:z.at(U)},wind:{speed:(S=ie.wind_speed_10m_max)==null?void 0:S.at(U),kts:(M=ie.wind_speed_10m_max)==null?void 0:M.at(U),degree:(T=ie.wind_direction_10m_dominant)==null?void 0:T.at(U),gusts:(E=ie.wind_gusts_10m_max)==null?void 0:E.at(U),bearing:((I=ie.wind_direction_10m_dominant)==null?void 0:I.at(U))!==null?(((G=ie.wind_direction_10m_dominant)==null?void 0:G.at(U))+180)%360:null}};const{name:ne,url:Se,bg:Ee}=this.parseWeatherCode(fe.code,!0);fe.name=ne,fe.url=Se,fe.bg=Ee,fe.wind.scale=this.beaufort(this.kts2ms(fe.wind.kts)),fe.wind.direction=this.degree2Direction(fe.wind.degree),Le.push({utc:te.add(U,"d").utc().format(),model:ye.model,weather:{...fe}})}if(W){let ye=0;for(const ie of W){const ne=ie.daily;xe={wave:{sig:{height:(j=ne.wave_height_max)==null?void 0:j.at(U),degree:(H=ne.wave_direction_dominant)==null?void 0:H.at(U),period:(ae=ne.wave_period_max)==null?void 0:ae.at(U),bearing:((N=ne.wave_direction_dominant)==null?void 0:N.at(U))!==null?(((A=ne.wave_direction_dominant)==null?void 0:A.at(U))+180)%360:null},swell:{height:(F=ne.swell_wave_height_max)==null?void 0:F.at(U),degree:(Y=ne.swell_wave_direction_dominant)==null?void 0:Y.at(U),period:(D=ne.swell_wave_period_max)==null?void 0:D.at(U),peakPeriod:(R=ne.swell_wave_peak_period_max)==null?void 0:R.at(U),bearing:((Z=ne.swell_wave_direction_dominant)==null?void 0:Z.at(U))!==null?((P=ne.swell_wave_direction_dominant)==null?void 0:P.at(U))%360:null},wd:{height:(K=ne.wind_wave_height_max)==null?void 0:K.at(U),degree:(re=ne.wind_wave_direction_dominant)==null?void 0:re.at(U),period:(me=ne.wind_wave_period_max)==null?void 0:me.at(U),peakPeriod:(he=ne.wind_wave_peak_period_max)==null?void 0:he.at(U),bearing:((ee=ne.wind_wave_direction_dominant)==null?void 0:ee.at(U))!==null?(((le=ne.wind_wave_direction_dominant)==null?void 0:le.at(U))+180)%360:null}}},xe.wave=this.parseWave(xe.wave,fe==null?void 0:fe.wind),Object.assign(Le[ye],xe),ye++}}}return Le}static parseWave(t,a){if(t.sig.direction=this.degree2Direction(t.sig.degree),t.swell.direction=this.degree2Direction(t.swell.degree),t.wd.direction=this.degree2Direction(t.wd.degree),t.sig.scale=this.douglas(t.sig.height),t.swell.scale=this.douglas(t.swell.height),t.wd.scale=this.douglas(t.wd.height),t.sig.height===0){const r=Math.sqrt(Math.pow(t.swell.height||0,2)+Math.pow(t.wd.height||0,2));t.sig.height=Math.round(r*100)/100}if(t.swell.height===0)if(t.sig.height>t.wd.height){const r=Math.sqrt(Math.abs(Math.pow(t.sig.height||0,2)-Math.pow(t.wd.height||0,2)));t.swell.height=Math.round(r*100)/100}else{const r=Math.round(.12*this.kts2ms((a==null?void 0:a.kts)||0)*100)/100,i=r>1?r/10:r>.5?r/5:r>.3?r/2:r;t.swell.height=Math.round(i*100)/100}if(t.wd.height===0||t.wd.height>t.sig.height)if(t.sig.height>t.swell.height){const r=Math.sqrt(Math.abs(Math.pow(t.sig.height||0,2)-Math.pow(t.swell.height||0,2))),i=.24*this.kts2ms((a==null?void 0:a.kts)||0);t.wd.height=Math.round(Math.min(r,i)*100)/100}else{const r=.24*this.kts2ms((a==null?void 0:a.kts)||0);t.wd.height=Math.round(r*100)/100}return t.swell.height>t.sig.height&&(t.swell.height=Math.round(t.sig.height*.76*100)/100),t.sig.period||(t.sig.period=Math.round(5*Math.sqrt(t.sig.height))),t.swell.period||(t.swell.period=Math.round(5*Math.sqrt(t.swell.height))),t.wd.period||(t.wd.period=Math.round(5*Math.sqrt(t.wd.height))),t}static parseWeatherCode(t,a){const r=this.weatherCode(t);return(a?r.day:r.night)||{}}static weatherCode(t){const a={code:t};switch(t){case 0:a.day={name:"Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"},a.night={name:"Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"};break;case 1:a.day={name:"Mainly Sunny",url:"https://osshz.idmwx.com/asset/weather/01d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"},a.night={name:"Mainly Clear",url:"https://osshz.idmwx.com/asset/weather/01n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg1.png"};break;case 2:a.day={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg2.png"},a.night={name:"Partly Cloudy",url:"https://osshz.idmwx.com/asset/weather/02n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg2.png"};break;case 3:a.day={name:"Overcast",url:"https://osshz.idmwx.com/asset/weather/04d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg3.png"},a.night={name:"Overcast",url:"https://osshz.idmwx.com/asset/weather/04n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg3.png"};break;case 45:a.day={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"},a.night={name:"Foggy",url:"https://osshz.idmwx.com/asset/weather/50n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"};break;case 48:a.day={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"},a.night={name:"Rime Fog",url:"https://osshz.idmwx.com/asset/weather/50n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg4.png"};break;case 51:a.day={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 53:a.day={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 55:a.day={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/15d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Drizzle",url:"https://osshz.idmwx.com/asset/weather/15n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 56:a.day={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 57:a.day={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/14d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Freezing Drizzle",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 61:a.day={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 63:a.day={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 65:a.day={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 66:a.day={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 67:a.day={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/16d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Freezing Rain",url:"https://osshz.idmwx.com/asset/weather/10n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 71:a.day={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Light Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 73:a.day={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 75:a.day={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Heavy Snow",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 77:a.day={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/17d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Snow Grains",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 80:a.day={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 81:a.day={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 82:a.day={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Showers",url:"https://osshz.idmwx.com/asset/weather/09n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 85:a.day={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Light Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 86:a.day={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"},a.night={name:"Snow Showers",url:"https://osshz.idmwx.com/asset/weather/13n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg6.png"};break;case 95:a.day={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Thunderstorm",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 96:a.day={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Light Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break;case 99:a.day={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11d.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"},a.night={name:"Thunderstorms With Hail",url:"https://osshz.idmwx.com/asset/weather/11n.svg",bg:"https://osshz.idmwx.com/asset/weather/bg5.png"};break}return a}static kts2ms(t){return isNaN(t)||t===null?t:Math.round(t*1852/3600*1e4)/1e4}static kts2kmh(t){return isNaN(t)||t===null?t:t*1.852}static m2nm(t){return isNaN(t)||t===null?t:Math.round(t/1e3/1.852*1e4)/1e4}static kmh2kts(t){return isNaN(t)||t===null?t:this.ms2kts(t*1e3/3600)}static ms2kts(t){return isNaN(t)||t===null?t:Math.round(t*3600/1852*1e4)/1e4}static degree2Radian(t){if(isNaN(t)||t===null)return t;let a=t%360/360*2*Math.PI;return a=a<0?a+2*Math.PI:a,a}static degree2Direction(t){const a=this.degree2Radian(t);if(isNaN(a)||a===null)return null;let r="N/A";const i=Math.PI/16;return a<i?r="N":a>=i&&a<3*i?r="NNE":a>=3*i&&a<5*i?r="NE":a>=5*i&&a<7*i?r="ENE":a>=7*i&&a<9*i?r="E":a>=9*i&&a<11*i?r="ESE":a>=11*i&&a<13*i?r="SE":a>=13*i&&a<15*i?r="SSE":a>=15*i&&a<17*i?r="S":a>=17*i&&a<19*i?r="SSW":a>=19*i&&a<21*i?r="SW":a>=21*i&&a<23*i?r="WSW":a>=23*i&&a<25*i?r="W":a>=25*i&&a<27*i?r="WNW":a>=27*i&&a<29*i?r="NW":a>=29*i&&a<31*i?r="NNW":a>=31*i&&a<32*i&&(r="N"),r}static beaufort(t){let a=0;return isNaN(t)||(t=Math.round(t*10)/10,t<=.2?a=0:t<=1.5?a=1:t<=3.3?a=2:t<=5.4?a=3:t<=7.9?a=4:t<=10.7?a=5:t<=13.8?a=6:t<=17.1?a=7:t<=20.7?a=8:t<=22.4?a=9:t<=28.4?a=10:t<=32.6?a=11:t<=36.9?a=12:t<=41.4?a=13:t<=46.1?a=14:t<=50.9?a=15:t<=55.9?a=16:t<=61.2?a=17:t>61.2&&(a=18)),a}static douglas(t){let a="Calm";return isNaN(t)||t<=.1?a="Calm":t<=.5?a="Smooth":t<=1.25?a="Slight":t<=2.5?a="Moderate":t<=4?a="Rough":t<=6?a="VeryRough":t<=9?a="High":t<=14?a="VeryHigh":a="Precipitous",a}};const xf="",_m={name:"IdmTropicals",props:{simple:{type:Boolean,default:!1},permission:{type:Number},locale:{type:String},map:{type:Object},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}},timeZone:{type:Number},token:{type:String},defaultMeteoToken:{type:String},gateway:{type:String,default:"aa"},assistGateway:{type:Array,default:[]},forecastModel:{type:String},realTime:{type:String},beforeLayer:{type:String}},emits:["tropical","tropicalCenterPoints","tropicalProbability","tropicalNotification"],setup(){return{Theme:be.useTheme()}},data(){return{right:10,toggle:!1,helper:je.CompanyHelper,tropicals:void 0,tropicalCacheKey:"tropicalCacheGL4",source:"tropicals-source",clusterSource:"tropicals-cluster-source",historyLayer:"tropicals-history-layer",forecastLayer:"tropicals-forecast-layer",forecastModelLayer:"tropicals-forecast-model-layer",forecastNameLayer:"tropicals-forecast-name-layer",pointCircleLayer:"tropicals-point-circle-layer",pointLabelLayer:"tropicals-point-label-layer",historyPointCircleLayer:"history-tropicals-point-circle-layer",historyPointLabelLayer:"history-tropicals-point-label-layer",interpolateData:[],interpolateMarkers:[],interpolateSource:"tropicals-interpolate-source",interpolateLineLayer:"tropicals-interpolate-line-layer",showTropicalsInfo:!1,activeTropicals:void 0,activeTropicalsMarker:void 0,empty:J.featureCollection([]),showLegend:!1,showHoverPoint:!1,hoverPoint:void 0,hoverMarker:void 0}},computed:{hoverLayers(){return[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.pointCircleLayer,this.pointCircleLayer+"-border",this.historyPointCircleLayer,this.historyPointCircleLayer+"-border",this.historyPointCircleLayer+"-inner"]},clickLayers(){return[this.forecastNameLayer,this.historyLayer]},computeTime(){return(e,t)=>{if(e){const a=C(e).utcOffset(t),r=t<0?t:"+"+t;return`${a==null?void 0:a.format("MMM-DD/HHmm")} (UTC${r}) ${a==null?void 0:a.fromNow()} `}return"-"}},computeTzTime(){return(e,t,a="MM-DD HH:mm")=>{var r,i;if(e){const l=t||0,n=(i=(r=C(e))==null?void 0:r.utcOffset(l))==null?void 0:i.format(a),c=`(UTC ${l>=0?"+":""}${l})`;return n+" "+c}return"-"}},computeTimezone(){return this.timeZone<0?this.timeZone:"+"+this.timeZone},computeBF(){return function(e){const t=ma.kts2ms(e);return ma.beaufort(t)}},computeMovement(){return function(e){var t,a;return(a=(t=e==null?void 0:e.forecasts)==null?void 0:t.find(r=>!r.disabled))==null?void 0:a.movement}},computePosition(){return e=>!e||e.lng===null||e.lng===void 0||isNaN(e.lng)||e.lat===null||e.lat===void 0||isNaN(e.lat)?"-":X.LngLatHelper.lat2pretty(e==null?void 0:e.lat,2).pretty+" / "+X.LngLatHelper.lng2pretty(e==null?void 0:e.lng,2).pretty}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)})},immediate:!0},map:{handler(){this.map?(this.toggle=localStorage.getItem(this.tropicalCacheKey)==="true"||!1,localStorage.setItem(this.tropicalCacheKey,this.toggle),this.toggle&&this.fetchTropicals()):this.handleClear()}},showTropicalsInfo:{handler(){this.$emit("tropical",this.showTropicalsInfo),this.simple&&this.showTropicalsInfo?this.$nextTick(()=>{var e,t;this.$parent.playerBottom=((t=(e=this.$refs.tropicalsInfo)==null?void 0:e.$el)==null?void 0:t.clientHeight)+10}):this.simple&&(this.$parent.playerBottom=30)},immediate:!0},"tropicals.version":{handler(){this.handleRefresh()}},timeZone:{handler(e,t){e!==t&&this.handleRefresh()}},realTime:{handler(e){this.map&&e&&this.toggle&&this.handleRender()}},locale:{handler(e){this.map&&this.toggle&&this.handleRefresh()}}},mounted(){},methods:{handleMenuToggle(){var e,t,a;this.toggle=!this.toggle,localStorage.setItem(this.tropicalCacheKey,this.toggle),this.toggle?this.fetchTropicals():(this.handleClear(),(a=(t=(e=this.$parent)==null?void 0:e.$refs)==null?void 0:t.idmBottomBar)==null||a.handleToggle("tropical",!1))},async fetchTropicals(){var i,l,n;const e=new Date().valueOf();let t=0,a=0,r=(i=je.LayerHelper.WEATHER_LAYERS.find(c=>c.key==="tropicals"))==null?void 0:i.weight;if(r>0){const c=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],s=await ge.get(`${c}/api/arc/weather/layers2/links?l=${r}&v=${this.forecastModel}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(a=new Date().valueOf()-(e+t),console.log("weather links elapsed: ",a,", total: ",t+=a),((l=s==null?void 0:s.data)==null?void 0:l.code)===0){const d=(n=s==null?void 0:s.data)==null?void 0:n.data;await ge.get(d.tropicals,{headers:{Authorization:this.defaultMeteoToken,key:"tropicals"},responseType:/\.(jpg|png)$/.test(d.tropicals)?"blob":"json"}).then(m=>{var y,f,h;const g=X.TropicalHelper.convert2Geojson(((y=m==null?void 0:m.data)==null?void 0:y.data)||(m==null?void 0:m.data));((h=(f=m==null?void 0:m.config)==null?void 0:f.headers)==null?void 0:h.key)&&g&&(this.tropicals={data:g,active:!0,cached:!0,type:"json",etime:s.data.etime,version:Math.random()+1})}).catch(m=>{console.log(`tropicals fetch layer error: ${m}`)})}a=new Date().valueOf()-(e+t),console.log("tropicals elapsed: ",a,", total: ",t+=a)}},handleRefresh(){var t,a;(((a=(t=this.tropicals)==null?void 0:t.data)==null?void 0:a.features)||[]).forEach(r=>{var l,n,c,s,d,m,g,u,y,f,h,p,w,x,b,k,L,_,z;let i="";switch(!0){case(((l=r.properties.wind)==null?void 0:l.kts)<32||((n=r.properties)==null?void 0:n.kts)<32):i="td";break;case(((c=r.properties.wind)==null?void 0:c.kts)<47||((s=r.properties)==null?void 0:s.kts)<47):i="ts";break;case(((d=r.properties.wind)==null?void 0:d.kts)<63||((m=r.properties)==null?void 0:m.kts)<63):i="sts";break;case(((g=r.properties.wind)==null?void 0:g.kts)<79||((u=r.properties)==null?void 0:u.kts)<79):i="ty";break;case(((y=r.properties.wind)==null?void 0:y.kts)<94||((f=r.properties)==null?void 0:f.kts)<94):i="sty";break;case(((h=r.properties.wind)==null?void 0:h.kts)>=94||((p=r.properties)==null?void 0:p.kts)>=94):i="superTy";break;default:i="superTy";break}r.properties.levelI18n=i,((w=r.geometry)==null?void 0:w.type)==="Point"&&((x=r.properties)!=null&&x.important)&&(r.properties.format=(k=(b=C(r.properties.date))==null?void 0:b.utcOffset(this.timeZone))==null?void 0:k.format(`MMM-DD/HHmm [(utc${this.computeTimezone})]`)),((L=r.geometry)==null?void 0:L.type)==="Point"&&(r.properties.Name=((z=(_=r.properties.name)==null?void 0:_.trim())==null?void 0:z.replace(/^./,S=>S.toUpperCase()))||r.properties.nameCn,r.properties.nameCn=r.properties.nameCn||r.properties.Name||"-")}),this.handleInit()},handleInit(){var e,t,a,r,i,l,n,c,s,d,m,g;this.handleClear(),this.tropicals&&this.map&&(this.handleRender(),(e=this.map)==null||e.on("click",this.clickLayers,this.handleClick),(t=this.map)==null||t.on("mousemove",this.hoverLayers,this.handleHover),(a=this.map)==null||a.on("mouseleave",this.hoverLayers,this.handleLeave)),((l=(i=(r=this.tropicals)==null?void 0:r.data)==null?void 0:i.features)==null?void 0:l.length)>0?(s=(c=(n=this.$parent)==null?void 0:n.$refs)==null?void 0:c.idmBottomBar)==null||s.handleToggle("tropical",!0):(g=(m=(d=this.$parent)==null?void 0:d.$refs)==null?void 0:m.idmBottomBar)==null||g.handleToggle("tropical",!1)},handleRender(){var e,t,a,r,i,l,n,c,s,d;if(this.tropicals&&this.map){const m=new Date().valueOf();let g=0,u=0;(e=this.map)!=null&&e.getSource(this.source)?((a=this.map)==null||a.getSource(this.source).setData((t=this.tropicals)!=null&&t.active?this.tropicals.data:this.empty),u=new Date().valueOf()-(m+g),console.log("[tropicals] update elapsed: ",u,", total: ",g+=u)):(this.map.addSource(this.source,{type:"geojson",data:(r=this.tropicals)!=null&&r.active?(i=this.tropicals)==null?void 0:i.data:this.empty}),this.map.addLayer({id:this.historyLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["==","type","history"],["!=","disabled",!0]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.Theme.current.value.colors["on-surface"],"line-width":3,"line-opacity":.7}},this.beforeLayer),this.map.addLayer({id:this.forecastLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["==","type","forecast"],["!=","disabled",!0]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["match",["get","model"],"cma",this.Theme.current.value.colors["tropicals-cma"],"jma",this.Theme.current.value.colors["tropicals-jma"],"ecmwf",this.Theme.current.value.colors["tropicals-ecmwf"],"ukm",this.Theme.current.value.colors["tropicals-ukm"],"noaa-at",this.Theme.current.value.colors["tropicals-noaa-at"],"noaa-ep",this.Theme.current.value.colors["tropicals-noaa-ep"],this.Theme.current.value.colors["tropicals-noaa-other"]],"line-width":2,"line-opacity":1,"line-dasharray":[1,2]}},this.beforeLayer),this.map.addLayer({id:this.forecastModelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","LineString"],["==","type","forecast"],["!=","disabled",!0]],layout:{"symbol-placement":"line","text-field":"{model}","text-rotation-alignment":"viewport","text-size":12},paint:{"text-color":this.Theme.current.value.dark?"#333":"#fff","text-opacity":1,"text-halo-color":["match",["get","model"],"cma",this.Theme.current.value.colors["tropicals-cma"],"jma",this.Theme.current.value.colors["tropicals-jma"],"ecmwf",this.Theme.current.value.colors["tropicals-ecmwf"],"ukm",this.Theme.current.value.colors["tropicals-ukm"],"noaa-at",this.Theme.current.value.colors["tropicals-noaa-at"],"noaa-ep",this.Theme.current.value.colors["tropicals-noaa-ep"],this.Theme.current.value.colors["tropicals-noaa-other"]],"text-halo-width":4}},this.beforeLayer),u=new Date().valueOf()-(m+g),console.log("[tropical] add elapsed: ",u,", total: ",g+=u)),(l=this.map)!=null&&l.getSource(this.clusterSource)?((c=this.map)==null||c.getSource(this.clusterSource).setData((n=this.tropicals)!=null&&n.active?this.tropicals.data:this.empty),u=new Date().valueOf()-(m+g),console.log("[tropical] update elapsed: ",u,", total: ",g+=u)):(this.map.addSource(this.clusterSource,{type:"geojson",data:(s=this.tropicals)!=null&&s.active?(d=this.tropicals)==null?void 0:d.data:this.empty}),this.map.addLayer({id:this.pointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":5,"circle-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.pointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":4,"circle-color":["case",["boolean",["==",["get","kts",["get","wind"]],null]],this.Theme.current.value.colors["tropicals-td"],["boolean",["<",["get","kts",["get","wind"]],32]],this.Theme.current.value.colors["tropicals-td"],["boolean",["<",["get","kts",["get","wind"]],47]],this.Theme.current.value.colors["tropicals-ts"],["boolean",["<",["get","kts",["get","wind"]],63]],this.Theme.current.value.colors["tropicals-sts"],["boolean",["<",["get","kts",["get","wind"]],79]],this.Theme.current.value.colors["tropicals-ty"],["boolean",["<",["get","kts",["get","wind"]],94]],this.Theme.current.value.colors["tropicals-sty"],["boolean",[">=",["get","kts",["get","wind"]],94]],this.Theme.current.value.colors["tropicals-super-ty"],"#fff"]}},this.beforeLayer),this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.clusterSource,minzoom:5,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[1,0],"text-anchor":"left","text-size":10},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.historyPointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],paint:{"circle-radius":6,"circle-color":"#fff"}},this.beforeLayer),this.map.addLayer({id:this.historyPointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],paint:{"circle-radius":5,"circle-color":"rgba(0,0,0,0.7)"}},this.beforeLayer),this.map.addLayer({id:this.historyPointCircleLayer+"-inner",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],paint:{"circle-radius":3,"circle-color":"#fff"}},this.beforeLayer),this.map.addLayer({id:this.historyPointLabelLayer,type:"symbol",source:this.clusterSource,minzoom:5,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[1,0],"text-anchor":"left","text-size":10},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.forecastNameLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["==","important",!0]],layout:{"text-field":["get",this.locale==="en"?"Name":"nameCn"],"text-anchor":"bottom","text-size":16,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-font":["DIN Pro Regular","Arial Unicode MS Regular"],"text-offset":[0,2]},paint:{"text-color":this.Theme.current.value.colors["map-blue"],"text-halo-color":"#ffffff","text-halo-width":2}},this.beforeLayer),u=new Date().valueOf()-(m+g),console.log("[tropical] add elapsed: ",u,", total: ",g+=u));const y=X.TropicalHelper.interpolate(this.tropicals,1);this.interpolateData=JSON.parse(JSON.stringify(y)),this.handleDateChange()}},handleClear(){var e,t,a,r;this.map&&(this.map.getLayer(this.historyLayer)&&this.map.removeLayer(this.historyLayer),this.map.getLayer(this.forecastLayer)&&this.map.removeLayer(this.forecastLayer),this.map.getLayer(this.forecastModelLayer)&&this.map.removeLayer(this.forecastModelLayer),this.map.getLayer(this.forecastNameLayer)&&this.map.removeLayer(this.forecastNameLayer),this.map.getLayer(this.pointCircleLayer)&&this.map.removeLayer(this.pointCircleLayer),this.map.getLayer(this.pointCircleLayer+"-border")&&this.map.removeLayer(this.pointCircleLayer+"-border"),this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.historyPointCircleLayer)&&this.map.removeLayer(this.historyPointCircleLayer),this.map.getLayer(this.historyPointCircleLayer+"-border")&&this.map.removeLayer(this.historyPointCircleLayer+"-border"),this.map.getLayer(this.historyPointCircleLayer+"-inner")&&this.map.removeLayer(this.historyPointCircleLayer+"-inner"),this.map.getLayer(this.historyPointLabelLayer)&&this.map.removeLayer(this.historyPointLabelLayer),this.map.getLayer(this.interpolateLineLayer)&&this.map.removeLayer(this.interpolateLineLayer),(e=this.interpolateMarkers)==null||e.forEach(i=>i==null?void 0:i.remove()),this.map.getSource(this.source)&&this.map.removeSource(this.source),this.map.getSource(this.clusterSource)&&this.map.removeSource(this.clusterSource),this.map.getSource(this.interpolateSource)&&this.map.removeSource(this.interpolateSource)),(t=this.map)==null||t.off("click",this.clickLayers,this.handleClick),(a=this.map)==null||a.off("mousemove",this.hoverLayers,this.handleHover),(r=this.map)==null||r.off("mouseleave",this.hoverLayers,this.handleLeave),this.handleCloseInfoMarker()},handleDateChange(){var e,t,a,r,i,l,n,c,s,d,m,g,u,y,f,h,p,w,x,b,k,L,_,z,S,M,T,E,I,G,j,H,ae,N,A;if((e=this.interpolateMarkers)==null||e.forEach(F=>F==null?void 0:F.remove()),(t=this.interpolateData)!=null&&t.length&&this.tropicals.active){const F=C(this.realTime).utc().set({minute:0,second:0,millisecond:0}),Y=this.interpolateData.filter(P=>P.properties.date===(F==null?void 0:F.format())&&!P.properties.disabled),D=this.handleComputePolygons(Y),R=J.featureCollection([...Y]);D.forEach(P=>{R.features.push(P)}),(a=this.map)!=null&&a.getSource(this.interpolateSource)?(r=this.map)==null||r.getSource(this.interpolateSource).setData(R):((i=this.map)==null||i.addSource(this.interpolateSource,{type:"geojson",data:R}),(l=this.map)==null||l.addLayer({id:this.interpolateLineLayer,type:"line",source:this.interpolateSource,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-opacity":1,"line-color":["match",["get","level"],7,this.Theme.current.value.colors["tropicals-r7"],10,this.Theme.current.value.colors["tropicals-r10"],this.Theme.current.value.colors["tropicals-r10"]],"line-width":1}},"empty-layer-3")),this.interpolateMarkers=[];const Z=[];for(const P of Y)if(!P.properties.disabled){if(!Z.some(ee=>{var le;return ee.properties.name===((le=P.properties)==null?void 0:le.name)})){const ee=((c=(n=this.tropicals.data.features.find(le=>{var de;return le.properties.name===((de=P.properties)==null?void 0:de.name)}))==null?void 0:n.properties)==null?void 0:c.nameCn)||((s=P.properties)==null?void 0:s.Name)||"-";P.properties.nameCn=ee,P.properties.Name=((m=(d=P.properties.name)==null?void 0:d.trim())==null?void 0:m.replace(/^./,le=>le.toUpperCase()))||P.properties.nameCn,Z.push(P)}let K=this.Theme.current.value.colors["tropicals-ty"];((u=(g=P.properties)==null?void 0:g.wind)==null?void 0:u.kts)<32||!((f=(y=P.properties)==null?void 0:y.wind)!=null&&f.kts)?K=this.Theme.current.value.colors["tropicals-td"]:((p=(h=P.properties)==null?void 0:h.wind)==null?void 0:p.kts)>=32&&((x=(w=P.properties)==null?void 0:w.wind)==null?void 0:x.kts)<47?K=this.Theme.current.value.colors["tropicals-ts"]:((k=(b=P.properties)==null?void 0:b.wind)==null?void 0:k.kts)>=47&&((_=(L=P.properties)==null?void 0:L.wind)==null?void 0:_.kts)<63?K=this.Theme.current.value.colors["tropicals-sts"]:((S=(z=P.properties)==null?void 0:z.wind)==null?void 0:S.kts)>=63&&((T=(M=P.properties)==null?void 0:M.wind)==null?void 0:T.kts)<79?K=this.Theme.current.value.colors["tropicals-ty"]:((I=(E=P.properties)==null?void 0:E.wind)==null?void 0:I.kts)>=79&&((j=(G=P.properties)==null?void 0:G.wind)==null?void 0:j.kts)<94?K=this.Theme.current.value.colors["tropicals-sty"]:((ae=(H=P.properties)==null?void 0:H.wind)==null?void 0:ae.kts)>=94?K=this.Theme.current.value.colors["tropicals-super-ty"]:K=this.Theme.current.value.colors["tropicals-ty"];const re=`<svg t="1719918955501"
204
204
  class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" p-id="18382"
205
205
  xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">
206
206
  <path
@@ -214,7 +214,7 @@
214
214
  <path
215
215
  d="M420.66666667 959.17a16.08 16.08 0 0 1-15.91-13.49A15.89 15.89 0 0 1 415.50666667 928c1.49-0.55 38.88-14.76 72.79-65.52A354.55 354.55 0 0 1 162.66666667 509.17a450.14 450.14 0 0 1 450.5-450.5 16.07 16.07 0 0 1 15.91 13.48 15.88 15.88 0 0 1-10.75 17.66c-1.58 0.58-39.13 14.9-73.07 65.95A354.22 354.22 0 0 1 871.66666667 509.17a16 16 0 0 1-0.52 4.05A450.14 450.14 0 0 1 420.66666667 959.17zM554.80666667 94.72C351.57666667 123.2 194.66666667 298.21 194.66666667 509.17c0 177.08 144.06 321.74 321.13 322.48a16 16 0 0 1 14.07 23.49c-16.11 30.42-34.27 52.37-50.85 68C682.25666667 894.63 839.16666667 719.63 839.16666667 508.67a15.94 15.94 0 0 1 0.47-3.86C837.30666667 329.33 693.82666667 187 517.80666667 186.67A16 16 0 0 1 503.66666667 163.21c16.21-30.69 34.47-52.79 51.14-68.49z"
216
216
  fill="#ffffff" p-id="18386"></path>
217
- </svg>`,me=document.createElement("div");me.className="idm-tropical-gl4-hourly-marker",me.innerHTML=`<div class="${P.geometry.coordinates[1]>=0?"center north":"center south"}">${re}</div>`;const he=new _e.Marker(me).setLngLat(P.geometry.coordinates).addTo(this.map);this.interpolateMarkers.push(he)}this.$emit("tropicalCenterPoints",Z)}else(N=this.map)!=null&&N.getSource(this.interpolateSource)&&((A=this.map)==null||A.getSource(this.interpolateSource).setData(this.empty))},handleClick(e){var i,l,n,c,s,d,m,g,u,y,f;const t=e.features[0],a=(l=(i=this.tropicals)==null?void 0:i.data)==null?void 0:l.features.filter(h=>{var p;return h.geometry.type==="LineString"&&h.properties.type==="forecast"&&h.properties.name===((p=t==null?void 0:t.properties)==null?void 0:p.name)}),r=(c=(n=this.tropicals)==null?void 0:n.data)==null?void 0:c.features.filter(h=>{var p;return h.geometry.type==="LineString"&&h.properties.type==="history"&&h.properties.name===((p=t==null?void 0:t.properties)==null?void 0:p.name)});this.activeTropicals={name:((s=t==null?void 0:t.properties)==null?void 0:s.name)||"-",nameCn:((d=t==null?void 0:t.properties)==null?void 0:d.nameCn)||((m=t==null?void 0:t.properties)==null?void 0:m.name)||"-",Name:((g=t==null?void 0:t.properties)==null?void 0:g.Name)||"-",forecasts:a.map(h=>h.properties),history:(u=r[0])==null?void 0:u.properties,showCircle:(f=(y=a[0])==null?void 0:y.properties)==null?void 0:f.showCircle},this.showTropicalsInfo=!0,this.simple||this.drawTropicalsInfoMaker([e.lngLat.lng,e.lngLat.lat])},drawTropicalsInfoMaker(e){this.$nextTick(()=>{const t=document.getElementById("idm-tropical-gl4-info");this.activeTropicalsMarker?this.activeTropicalsMarker.setLngLat(e).setOffset([220,0]):this.activeTropicalsMarker=new _e.Marker(t).setLngLat(e).setOffset([220,0]).addTo(this.map)})},handleCloseInfoMarker(){this.showTropicalsInfo=!1,this.$nextTick(()=>{var e;(e=this.activeTropicalsMarker)==null||e.remove(),this.activeTropicalsMarker=void 0})},handleForecastToggle(e){var r,i,l,n,c,s;e.disabled=!e.disabled;const t=`${e.name}-${e.model}`,a=(i=(r=this.map)==null?void 0:r.getSource(this.source)._data)==null?void 0:i.features;a.forEach(d=>{d.properties.category===t&&(d.properties.disabled=e.disabled)}),this.interpolateData.forEach(d=>{d.properties.category===t&&(d.properties.disabled=e.disabled)}),(n=(l=this.map)==null?void 0:l.getSource(this.source))==null||n.setData(J.featureCollection(a)),(s=(c=this.map)==null?void 0:c.getSource(this.clusterSource))==null||s.setData(J.featureCollection(a)),this.handleDateChange()},handleStrikeProbability(e){this.$emit("tropicalProbability",e)},handleToggleCircles(e){var t,a;e.showCircle=!e.showCircle,(a=(t=this.tropicals.data)==null?void 0:t.features)==null||a.forEach(r=>{r.properties.name===e.name&&(r.properties.showCircle=e.showCircle)}),this.handleRender()},handleComputePolygons(e){const t=[];for(const a of e){const r=a.properties.wind,i={ne:r.r7ne>=0?r.r7ne:void 0,se:r.r7se>=0?r.r7se:void 0,sw:r.r7sw>=0?r.r7sw:void 0,nw:r.r7nw>=0?r.r7nw:void 0},l=this.handleComputeArc(a.geometry.coordinates,i,{...a.properties,level:7});t.push(l);const n={ne:r.r10ne>=0?r.r10ne:void 0,se:r.r10se>=0?r.r10se:void 0,sw:r.r10sw>=0?r.r10sw:void 0,nw:r.r10nw>=0?r.r10nw:void 0},c=this.handleComputeArc(a.geometry.coordinates,n,{...a.properties,level:10});t.push(c)}return t},handleComputeArc(e,t,a){var l;const r=[];for(const n in t){const c=t[n]??0;let s;switch(n){case"ne":s=J.lineArc(e,c,0,90,{steps:c>0?32:1,units:"nauticalmiles"});break;case"se":s=J.lineArc(e,c,90,180,{steps:c>0?32:1,units:"nauticalmiles"});break;case"sw":s=J.lineArc(e,c,180,270,{steps:c>0?32:1,units:"nauticalmiles"});break;case"nw":s=J.lineArc(e,c,270,360,{steps:c>0?32:1,units:"nauticalmiles"});break}r.push(...(l=s==null?void 0:s.geometry)==null?void 0:l.coordinates)}const i=J.lineString(r);return J.lineToPolygon(i,{properties:a})},handleNotification(e){this.$emit("tropicalNotification",e)},handleHover(e){var i,l,n,c,s;this.map.getCanvas().style.cursor="pointer";const a=this.map.queryRenderedFeatures(e.point,{layers:[this.pointCircleLayer,this.pointCircleLayer+"-border",this.historyPointCircleLayer,this.historyPointCircleLayer+"-border",this.historyPointCircleLayer+"-inner"]})[0];this.hoverPoint=a==null?void 0:a.properties;const r=(l=(i=this.tropicals)==null?void 0:i.data)==null?void 0:l.features.filter(d=>{var m;return d.geometry.type==="LineString"&&d.properties.type==="forecast"&&d.properties.name===((m=a==null?void 0:a.properties)==null?void 0:m.name)});this.hoverPoint&&(this.hoverPoint.lng=a.geometry.coordinates[0],this.hoverPoint.lat=a.geometry.coordinates[1],this.hoverPoint.update=(c=(n=r==null?void 0:r[0])==null?void 0:n.properties)==null?void 0:c.date,(s=this.hoverMarker)==null||s.remove(),this.showHoverPoint=!0,this.$nextTick(()=>{const d=document.getElementById("tropicalHoverMarkerInfo").cloneNode(!0);this.hoverMarker=new _e.Marker(d).setLngLat(a.geometry.coordinates).setOffset([160,0]).addTo(this.map)}))},handleLeave(){var e;this.map.getCanvas().style.cursor="grab",this.showHoverPoint=!1,(e=this.hoverMarker)==null||e.remove(),this.hoverMarker=void 0}}},vm={class:"idm-tropical-gl4"},zm={class:"pb-1"},Lm={class:"text-h5 font-weight-600"},Cm={key:0,class:"text-h5 font-weight-600"},Sm={class:"text-body-1"},Nm={class:"text-label"},Pm={class:"d-flex justify-space-between align-center"},Mm={class:"w-60"},Tm={class:"text-label pr-1"},Vm={class:"flex-1-1-0"},Em={class:"text-label pr-1"},Rm={class:"py-2 d-flex justify-space-between align-center"},Dm={class:"w-60"},Bm={class:"text-label pr-1"},Im={class:"flex-1-1-0"},Am={class:"text-label pr-1"},Fm={class:"d-flex align-center flex-1-1-100 justify-space-between mt-n1"},Gm={class:"text-label pr-1",style:{width:"70px"}},Wm={class:"model-box d-flex justify-end align-center flex-wrap ga-1 pa-1"},Zm={class:"more"},Om={key:0,class:"w-100 d-flex justify-space-between align-center px-2"},jm={class:"pa-1"},Xm={class:"legend d-flex justify-start align-center py-2"},Hm={class:"label"},Ym={class:"legend d-flex justify-start align-center py-2"},Um={class:"label"},Jm={class:"legend d-flex justify-start align-center py-2"},$m={class:"label"},Km={class:"pa-1"},qm={class:"legend d-flex justify-start align-center py-2"},Qm={class:"label"},ed={class:"legend d-flex justify-start align-center py-2"},td={class:"label"},od={class:"legend d-flex justify-start align-center py-2"},ad={class:"label"},id={class:"pa-1"},rd={class:"w-100 legend d-flex justify-start align-center py-2 ga-2"},ld={class:"label"},nd={class:"label"},sd={class:"w-100 legend d-flex justify-start align-center py-2"},cd={class:"label"},md={class:"w-100 legend d-flex justify-start align-center py-2"},dd={class:"label"},hd={key:1,class:"my-3 w-100",style:{height:"80px"}},pd={class:"legend d-flex justify-start align-center"},gd={class:"label"},ud={class:"legend d-flex justify-start align-center"},fd={class:"label"},yd={class:"legend d-flex justify-start align-center"},bd={class:"label"},wd={class:"legend d-flex justify-start align-center"},xd={class:"label"},kd={class:"legend d-flex justify-start align-center"},_d={class:"label"},vd={class:"legend d-flex justify-start align-center"},zd={class:"label"},Ld={class:"legend d-flex justify-start align-center"},Cd={class:"label"},Sd={class:"legend d-flex justify-start align-center"},Nd={class:"label"},Pd={class:"legend d-flex justify-start align-center"},Md={class:"label"},Td={class:"legend d-flex justify-start align-center"},Vd={class:"label"},Ed={class:"d-flex justify-star align-center"},Rd={class:"font-weight-600 mr-1"},Dd={class:""},Bd={class:"port-box d-flex flex-column justify-center align-start ga-2"},Id={key:0,class:"d-flex justify-start align-center"},Ad={class:"text-label pr-1"},Fd={key:1,class:"d-flex justify-start align-center"},Gd={class:"text-label pr-1"},Wd={key:2,class:"d-flex justify-start align-center"},Zd={class:"text-label pr-1"},Od={key:3,class:"d-flex justify-start align-center"},jd={class:"text-label pr-1"},Xd={key:4,class:"d-flex justify-start align-center"},Hd={class:"text-label pr-1"},Yd={key:5,class:"d-flex justify-start align-center"},Ud={class:"text-label pr-1"},Jd={class:"d-flex justify-start align-center"},$d={class:"text-label pr-1"},Kd={key:6,class:"d-flex justify-start align-center"},qd={class:"text-label pr-1"},Qd={key:7,class:"d-flex justify-start align-center"},eh={class:"text-label pr-1"},th={class:"d-flex justify-start align-center"},oh={class:"text-label pr-1"};function ah(e,t,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VTooltip"),s=o.resolveComponent("VCardText"),d=o.resolveComponent("VDivider"),m=o.resolveComponent("VCardActions"),g=o.resolveComponent("VCard"),u=o.resolveComponent("v-card-title"),y=o.resolveComponent("v-divider");return o.openBlock(),o.createElementBlock("div",vm,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+86+"px",right:i.right+"px"})},[o.createVNode(c,{text:e.$t("tropical.tropicals"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:f})=>[o.createVNode(n,o.mergeProps(f,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>t[3]||(t[3]=[o.createElementVNode("i",{class:"iconfont icon-Tropical text-h4"},null,-1)])),_:2,__:[3]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4),i.showTropicalsInfo&&!e.$attrs.hideTropicalsLegend?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"tropicalsInfo",id:"idm-tropical-gl4-info",class:o.normalizeClass(["idm-tropical-gl4-info",a.simple?"page":"dialog"])},[o.createVNode(g,{class:o.normalizeClass(["w-100",a.simple?"rounded-t-4 bg-none":""]),elevation:a.simple?0:16},{default:o.withCtx(()=>[o.createVNode(s,null,{default:o.withCtx(()=>{var f,h,p,w,x,b,k,L,_,z,S,M;return[o.createElementVNode("div",zm,[o.createElementVNode("span",Lm,o.toDisplayString(a.locale==="en"?(f=i.activeTropicals)==null?void 0:f.Name:((h=i.activeTropicals)==null?void 0:h.nameCn)||((p=i.activeTropicals)==null?void 0:p.Name)||"-"),1),(x=(w=i.activeTropicals)==null?void 0:w.history)!=null&&x.levelI18n?(o.openBlock(),o.createElementBlock("span",Cm," , "+o.toDisplayString(e.$t("tropical."+((k=(b=i.activeTropicals)==null?void 0:b.history)==null?void 0:k.levelI18n))),1)):o.createCommentVNode("",!0)]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"close",onClick:o.withModifiers(l.handleCloseInfoMarker,["stop"])},{default:o.withCtx(()=>t[4]||(t[4]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[4]},8,["onClick"]),o.createElementVNode("div",Sm,[o.createElementVNode("span",Nm,o.toDisplayString(e.$t("actions.lastUpdate"))+": ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTime(((_=(L=i.activeTropicals)==null?void 0:L.history)==null?void 0:_.updated)||((M=(S=(z=i.activeTropicals)==null?void 0:z.forecasts)==null?void 0:S.filter(T=>!T.disabled)[0])==null?void 0:M.date),a.timeZone)),1)])]}),_:1}),o.createVNode(d),o.createVNode(s,{class:"text-body-1 py-3"},{default:o.withCtx(()=>{var f,h,p,w,x,b,k,L,_;return[o.createElementVNode("div",Pm,[o.createElementVNode("div",Mm,[o.createElementVNode("label",Tm,o.toDisplayString(e.$t("weather.windSpeed"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((h=(f=i.activeTropicals)==null?void 0:f.history)==null?void 0:h.kts)||"-")+" kts",1),o.createElementVNode("span",null,", BF "+o.toDisplayString(l.computeBF(((w=(p=i.activeTropicals)==null?void 0:p.history)==null?void 0:w.kts)||"-")),1)]),o.createElementVNode("div",Vm,[o.createElementVNode("label",Em,o.toDisplayString(e.$t("weather.pressure"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((b=(x=i.activeTropicals)==null?void 0:x.history)==null?void 0:b.pressure)||"-")+" hPa",1)])]),o.createElementVNode("div",Rm,[o.createElementVNode("div",Dm,[o.createElementVNode("label",Bm,o.toDisplayString(e.$t("tropical.moveSpeed"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((k=l.computeMovement(i.activeTropicals))==null?void 0:k.kts)||"-")+" kts",1)]),o.createElementVNode("div",Im,[o.createElementVNode("label",Am,o.toDisplayString(e.$t("tropical.moveDir"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((L=l.computeMovement(i.activeTropicals))==null?void 0:L.deg)||"-")+"°",1)])]),o.createElementVNode("div",Fm,[o.createElementVNode("label",Gm,o.toDisplayString(e.$t("tropical.models"))+" : ",1),o.createElementVNode("div",Wm,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList((_=i.activeTropicals)==null?void 0:_.forecasts,(z,S)=>(o.openBlock(),o.createBlock(n,{key:S,density:"compact",variant:z.disabled?"text":"flat",color:z.disabled?"":"primary","min-width":30,class:o.normalizeClass(["model text-none text-body-1 px-1",z.disabled?"btn-border-1 btn-bg-1":""]),onClick:o.withModifiers(M=>l.handleForecastToggle(z),["stop"])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(z.model),1)]),_:2},1032,["variant","color","class","onClick"]))),128))])])]}),_:1}),o.createVNode(d),a.simple?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(m,{key:0,class:"d-flex justify-space-between"},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact","prepend-icon":"",variant:"text",color:i.showLegend?"primary":"",class:"text-none text-body-1",onClick:t[0]||(t[0]=o.withModifiers(f=>i.showLegend=!i.showLegend,["stop"]))},{prepend:o.withCtx(()=>t[5]||(t[5]=[o.createElementVNode("i",{class:"iconfont icon-Legend text-h4"},null,-1)])),default:o.withCtx(()=>[o.createTextVNode(" "+o.toDisplayString(e.$t("weather.legend")),1)]),_:1},8,["color"]),o.createElementVNode("div",Zm,[a.permission&i.helper.LEVEL.Supper?(o.openBlock(),o.createBlock(n,{key:0,variant:"text",density:"compact",class:"text-none text-body-1",onClick:t[1]||(t[1]=o.withModifiers(f=>l.handleNotification(i.activeTropicals),["stop"]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("actions.notify")),1)]),_:1})):o.createCommentVNode("",!0),o.createVNode(n,{variant:"text",density:"compact","append-icon":"mdi-chevron-right",class:"text-none text-body-1",onClick:t[2]||(t[2]=o.withModifiers(f=>l.handleStrikeProbability(i.activeTropicals),["stop"]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("actions.viewReport")),1)]),_:1})])]),_:1}))]),_:1},8,["class","elevation"]),a.simple?(o.openBlock(),o.createElementBlock("div",Om,[o.createElementVNode("div",jm,[o.createElementVNode("div",Xm,[t[6]||(t[6]=o.createElementVNode("div",{class:"icon td"},null,-1)),o.createElementVNode("div",Hm,o.toDisplayString(e.$t("tropical.td")),1)]),o.createElementVNode("div",Ym,[t[7]||(t[7]=o.createElementVNode("div",{class:"icon sts"},null,-1)),o.createElementVNode("div",Um,o.toDisplayString(e.$t("tropical.sts")),1)]),o.createElementVNode("div",Jm,[t[8]||(t[8]=o.createElementVNode("div",{class:"icon sty"},null,-1)),o.createElementVNode("div",$m,o.toDisplayString(e.$t("tropical.sty")),1)])]),o.createElementVNode("div",Km,[o.createElementVNode("div",qm,[t[9]||(t[9]=o.createElementVNode("div",{class:"icon ts"},null,-1)),o.createElementVNode("div",Qm,o.toDisplayString(e.$t("tropical.ts")),1)]),o.createElementVNode("div",ed,[t[10]||(t[10]=o.createElementVNode("div",{class:"icon ty"},null,-1)),o.createElementVNode("div",td,o.toDisplayString(e.$t("tropical.ty")),1)]),o.createElementVNode("div",od,[t[11]||(t[11]=o.createElementVNode("div",{class:"icon supper-ty"},null,-1)),o.createElementVNode("div",ad,o.toDisplayString(e.$t("tropical.superTy")),1)])]),o.createElementVNode("div",id,[o.createElementVNode("div",rd,[t[12]||(t[12]=o.createElementVNode("div",{class:"icon history"},null,-1)),o.createElementVNode("div",ld,o.toDisplayString(e.$t("tropical.history")),1),t[13]||(t[13]=o.createElementVNode("div",{class:"icon forecast"},null,-1)),o.createElementVNode("div",nd,o.toDisplayString(e.$t("tropical.forecast")),1)]),o.createElementVNode("div",sd,[t[14]||(t[14]=o.createElementVNode("div",{class:"icon r7"},null,-1)),o.createElementVNode("div",cd,"35kts "+o.toDisplayString(e.$t("tropical.radii")),1)]),o.createElementVNode("div",md,[t[15]||(t[15]=o.createElementVNode("div",{class:"icon r10"},null,-1)),o.createElementVNode("div",dd,"50kts "+o.toDisplayString(e.$t("tropical.radii")),1)])])])):(o.openBlock(),o.createElementBlock("div",hd,[o.withDirectives(o.createVNode(g,{elevation:"16"},{default:o.withCtx(()=>[o.createVNode(s,null,{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(["pa-1 d-flex justify-space-between align-center flex-wrap",a.locale==="zhHans"?" ga-2":" ga-3"])},[o.createElementVNode("div",pd,[t[16]||(t[16]=o.createElementVNode("div",{class:"icon td"},null,-1)),o.createElementVNode("div",gd,o.toDisplayString(e.$t("tropical.td")),1)]),o.createElementVNode("div",ud,[t[17]||(t[17]=o.createElementVNode("div",{class:"icon ts"},null,-1)),o.createElementVNode("div",fd,o.toDisplayString(e.$t("tropical.ts")),1)]),o.createElementVNode("div",yd,[t[18]||(t[18]=o.createElementVNode("div",{class:"icon sts"},null,-1)),o.createElementVNode("div",bd,o.toDisplayString(e.$t("tropical.sts")),1)]),o.createElementVNode("div",wd,[t[19]||(t[19]=o.createElementVNode("div",{class:"icon ty"},null,-1)),o.createElementVNode("div",xd,o.toDisplayString(e.$t("tropical.ty")),1)]),o.createElementVNode("div",kd,[t[20]||(t[20]=o.createElementVNode("div",{class:"icon sty"},null,-1)),o.createElementVNode("div",_d,o.toDisplayString(e.$t("tropical.sty")),1)]),o.createElementVNode("div",vd,[t[21]||(t[21]=o.createElementVNode("div",{class:"icon supper-ty"},null,-1)),o.createElementVNode("div",zd,o.toDisplayString(e.$t("tropical.superTy")),1)]),o.createElementVNode("div",Ld,[t[22]||(t[22]=o.createElementVNode("div",{class:"icon history"},null,-1)),o.createElementVNode("div",Cd,o.toDisplayString(e.$t("tropical.history")),1)]),o.createElementVNode("div",Sd,[t[23]||(t[23]=o.createElementVNode("div",{class:"icon forecast"},null,-1)),o.createElementVNode("div",Nd,o.toDisplayString(e.$t("tropical.forecast")),1)]),o.createElementVNode("div",Pd,[t[24]||(t[24]=o.createElementVNode("div",{class:"icon r7"},null,-1)),o.createElementVNode("div",Md,"35kts "+o.toDisplayString(e.$t("tropical.radii")),1)]),o.createElementVNode("div",Td,[t[25]||(t[25]=o.createElementVNode("div",{class:"icon r10"},null,-1)),o.createElementVNode("div",Vd,"50kts "+o.toDisplayString(e.$t("tropical.radii")),1)])],2),[[o.vShow,i.showLegend]])]),_:1})]),_:1},512),[[o.vShow,i.showLegend]])]))],2)):o.createCommentVNode("",!0),o.withDirectives(o.createVNode(g,{id:"tropicalHoverMarkerInfo",elevation:"16","max-width":"280"},{default:o.withCtx(()=>[o.createVNode(u,null,{default:o.withCtx(()=>{var f,h,p,w;return[o.createElementVNode("div",Ed,[o.createElementVNode("span",Rd,o.toDisplayString(a.locale==="en"?(f=i.hoverPoint)==null?void 0:f.Name:((h=i.hoverPoint)==null?void 0:h.nameCn)||((p=i.hoverPoint)==null?void 0:p.Name)),1),o.createElementVNode("span",Dd," ["+o.toDisplayString(e.$t("tropical."+((w=i.hoverPoint)==null?void 0:w.levelI18n)))+"]",1)])]}),_:1}),o.createVNode(y),o.createVNode(s,{class:"text-body-1"},{default:o.withCtx(()=>{var f,h,p,w,x,b,k,L,_,z,S,M,T,E,I,G,j,H,ae,N;return[o.createElementVNode("div",Bd,[((f=i.hoverPoint)==null?void 0:f.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Id,[o.createElementVNode("label",Ad,o.toDisplayString(e.$t("tropical.updated"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTzTime((h=i.hoverPoint)==null?void 0:h.update,a.timeZone)),1)])):o.createCommentVNode("",!0),((p=i.hoverPoint)==null?void 0:p.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Fd,[o.createElementVNode("label",Gd,o.toDisplayString(e.$t("tropical.forecast"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTzTime((w=i.hoverPoint)==null?void 0:w.date,a.timeZone)),1)])):o.createCommentVNode("",!0),((x=i.hoverPoint)==null?void 0:x.type)==="history"?(o.openBlock(),o.createElementBlock("div",Wd,[o.createElementVNode("label",Zd,o.toDisplayString(e.$t("tropical.forecast"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTzTime((b=i.hoverPoint)==null?void 0:b.date,a.timeZone)),1)])):o.createCommentVNode("",!0),((k=i.hoverPoint)==null?void 0:k.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Od,[o.createElementVNode("label",jd,o.toDisplayString(e.$t("tropical.model"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((L=i.hoverPoint)==null?void 0:L.model)??"-"),1)])):o.createCommentVNode("",!0),((_=i.hoverPoint)==null?void 0:_.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Xd,[o.createElementVNode("label",Hd,o.toDisplayString(e.$t("weather.wind"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((S=JSON.parse((z=i.hoverPoint)==null?void 0:z.wind))==null?void 0:S.kts)??"-")+" kts",1)])):o.createCommentVNode("",!0),((M=i.hoverPoint)==null?void 0:M.type)==="history"?(o.openBlock(),o.createElementBlock("div",Yd,[o.createElementVNode("label",Ud,o.toDisplayString(e.$t("weather.wind"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((T=i.hoverPoint)==null?void 0:T.kts)??"-")+" kts",1)])):o.createCommentVNode("",!0),o.createElementVNode("div",Jd,[o.createElementVNode("label",$d,o.toDisplayString(e.$t("weather.pressure"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((E=i.hoverPoint)==null?void 0:E.pressure)??"-")+" hPa",1)]),((I=i.hoverPoint)==null?void 0:I.type)==="history"?(o.openBlock(),o.createElementBlock("div",Kd,[o.createElementVNode("label",qd,o.toDisplayString(e.$t("tropical.moveSpeed"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((j=JSON.parse((G=i.hoverPoint)==null?void 0:G.movement))==null?void 0:j.kts)??"-")+" kts",1)])):o.createCommentVNode("",!0),((H=i.hoverPoint)==null?void 0:H.type)==="history"?(o.openBlock(),o.createElementBlock("div",Qd,[o.createElementVNode("label",eh,o.toDisplayString(e.$t("tropical.moveDir"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((N=JSON.parse((ae=i.hoverPoint)==null?void 0:ae.movement))==null?void 0:N.deg)??"-")+" °",1)])):o.createCommentVNode("",!0),o.createElementVNode("div",th,[o.createElementVNode("label",oh,o.toDisplayString(e.$t("tropical.position"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computePosition(i.hoverPoint)),1)])])]}),_:1})]),_:1},512),[[o.vShow,i.showHoverPoint]])])}const Ho=Q(_m,[["render",ah]]),kf="",ih={name:"DateTimePicker",props:{width:{type:Number,default:null},height:{type:Number,default:30},position:{type:String,default:"top"},bgClass:{type:String,default:""},locale:{type:String,default:"en"},style:{type:Object,default:{}},intervalHour:{type:Number,default:3},timeZone:{type:Number},dateTime:{type:String},dayAbout:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1}},emits:["dateTime","currentTimestamp","currentRealTime","minTimestamp","maxTimestamp"],data(){return{showDatePicker:!1,minDate:void 0,maxDate:void 0,minTimestamp:void 0,maxTimestamp:void 0,currentDate:void 0,currentTime:void 0,currentTimestamp:void 0,currentDateTimeZ:void 0,currentDateTime:void 0,currentRealTime:void 0,timer:null}},computed:{getStyle(){const e=this.width||220;if(this.position==="top")return{bottom:"40px",left:`-${(420-e)/2}px`};if(this.position==="bottom")return{top:"40px",left:`-${(420-e)/2}px`};if(this.position==="left")return{bottom:"-140px",left:"-428px"};if(this.position==="right")return{bottom:"-140px",right:"-428px"}},hourOptions(){const e=[];for(let t=0;t<24;t++)e.push(t<10?`0${t}:00`:`${t}:00`);return e.filter((t,a)=>(a-this.timeZone)%this.intervalHour===0)},timeZoneNames(){return C.tz.names()},timeZoneName(){var e;return(e=this.timeZoneNames.filter(t=>C.tz(C(),t).utcOffset()===this.timeZone*60))==null?void 0:e[0]},utcTimeZoneName(){return"Africa/Abidjan"},localTimeZoneName(){return Intl.DateTimeFormat().resolvedOptions().timeZone||"Asia/Shanghai"}},watch:{timeZone:{handler(e,t){e!==t&&(this.handleResetDateTime(this.dateTime),this.handleResetMinMax())}},dateTime:{handler(e,t){e&&this.handleResetDateTime(this.dateTime)},immediate:!0},currentTimestamp:{handler(){this.currentDateTimeZ=C(this.currentTimestamp).utc().format("yyyy-MM-DD HH:00[Z]"),this.$emit("dateTime",this.currentDateTimeZ),this.$emit("currentTimestamp",this.currentTimestamp),this.currentDateTime=`${C.tz(this.currentTimestamp,this.timeZoneName).clone().format("yyyy-MM-DD : HH:00")}`},immediate:!0},currentRealTime:{handler(e,t){e!==t&&this.$emit("currentRealTime",this.currentRealTime)}}},mounted(){this.timer=setInterval(()=>{this.currentRealTime=`${C.tz(C().unix()*1e3,this.timeZoneName).clone().format("HH:mm")}`},100),document.addEventListener("click",this.handleClickOutside)},unmounted(){clearInterval(this.timer),this.handleCancelDate(),document.removeEventListener("click",this.handleClickOutside)},methods:{handleReset(){this.handleResetDateTime(),this.handleResetMinMax()},handleResetDateTime(e){var i;const t=C(e).utc().date(),a=Math.ceil(C(e).utc().hour()/3)*3;this.currentTimestamp=((i=C(e))==null?void 0:i.utc().set({date:t,hour:a,minute:0,second:0,millisecond:0}).unix())*1e3;const r=C.tz(this.currentTimestamp,this.timeZoneName).clone();this.currentDate=r.clone().format("YYYY-MM-DD"),this.currentTime=r.clone().format("HH:00"),this.currentDateTime=`${C.tz(this.currentTimestamp,this.timeZoneName).clone().format("yyyy-MM-DD : HH:00")}`,this.currentRealTime=`${C.tz(C().unix()*1e3,this.timeZoneName).clone().format("HH:mm")}`},handleResetMinMax(){var i,l,n,c,s;if(!this.dayAbout.h||!this.dayAbout.f)return;const e=C().utc().date(),t=Math.ceil(C().utc().hour()/3)*3,a=((i=C())==null?void 0:i.utc().set({date:e,hour:t,minute:0,second:0,millisecond:0}).unix())*1e3,r=C.tz(a,this.timeZoneName).clone();this.minDate=r.clone().add(this.dayAbout.h,"day").format("yyyy-MM-DD"),this.maxDate=r.clone().add(this.dayAbout.f,"day").format("yyyy-MM-DD"),this.minTimestamp=((n=(l=C())==null?void 0:l.utc())==null?void 0:n.set({date:e+this.dayAbout.h,hour:0,minute:0,second:0,millisecond:0}).unix())*1e3,this.maxTimestamp=((s=(c=C())==null?void 0:c.utc())==null?void 0:s.set({date:e+this.dayAbout.f,hour:0,minute:0,second:0,millisecond:0}).unix())*1e3,this.$emit("minTimestamp",this.minTimestamp),this.$emit("maxTimestamp",this.maxTimestamp)},handleOpenDatePicker(){this.disabled||(this.showDatePicker=!this.showDatePicker)},handleUpdateMonth(e){const t=e||C.tz(this.currentTimestamp,this.timeZoneName).clone().month(),a=this.locale==="en"?C.tz(this.currentTimestamp,this.timeZoneName).set({month:t}).clone().format("MMM"):C.tz(this.currentTimestamp,this.timeZoneName).set({month:t}).clone().format("M月");this.$nextTick(()=>{const r=document.querySelector(".v-date-picker-controls__month-btn");r.innerText=a})},handleConfirmDate(){const e=C(this.currentDate).format("yyyy-MM-DD"),t=this.currentTime,a=`${e} ${t}`,r=C.tz(a,"YYYY-MM-DD HH:00",this.timeZoneName).clone().tz(this.localTimeZoneName);this.currentTimestamp=r.unix()*1e3,this.showDatePicker=!1},handleCancelDate(){this.showDatePicker=!1;const e=C.tz(this.currentTimestamp,this.timeZoneName).clone();this.currentDate=e.clone().format("YYYY-MM-DD"),this.currentTime=e.clone().format("HH:00")},handleClickOutside(e){const t=this.$refs.idmGl4Timepicker;t&&!t.contains(e.target)&&(this.showDatePicker=!1)}}},rh={class:"idm-gl4-time-picker",ref:"idmGl4Timepicker"},lh={class:"pa-0",style:{width:"320px"}},nh={class:"h-100 pa-0 d-flex flex-column justify-start align-center",style:{width:"100px"}},sh={class:"d-flex justify-center align-center text-body-2",style:{height:"44px"}};function ch(e,t,a,r,i,l){const n=o.resolveComponent("VDatePicker"),c=o.resolveComponent("VDivider"),s=o.resolveComponent("VListItemTitle"),d=o.resolveComponent("VListItem"),m=o.resolveComponent("VList"),g=o.resolveComponent("VCardText"),u=o.resolveComponent("VBtn"),y=o.resolveComponent("VCardActions"),f=o.resolveComponent("VCard");return o.openBlock(),o.createElementBlock("div",rh,[o.createElementVNode("div",{style:o.normalizeStyle({height:a.height+"px",width:a.width?a.width+"px":"auto"}),class:o.normalizeClass([[a.bgClass,{"cursor-pointer":!a.disabled}],"rounded text-body-1 btn-border-1 btn-bg-1 d-flex align-center justify-center px-2"]),onClick:t[0]||(t[0]=(...h)=>l.handleOpenDatePicker&&l.handleOpenDatePicker(...h))},o.toDisplayString(i.currentDateTime)+" | UTC "+o.toDisplayString(a.timeZone<0?a.timeZone:"+"+a.timeZone),7),i.showDatePicker?(o.openBlock(),o.createBlock(f,{key:0,class:"card-box d-flex flex-column border elevation-12",style:o.normalizeStyle(l.getStyle)},{default:o.withCtx(()=>[o.createVNode(g,{class:"w-100 flex-1-1-0 d-flex pa-0 text-body-1"},{default:o.withCtx(()=>[o.createElementVNode("div",lh,[o.createVNode(n,{modelValue:i.currentDate,"onUpdate:modelValue":t[1]||(t[1]=h=>i.currentDate=h),min:i.minDate,max:i.maxDate,"weekday-format":"narrow",color:"primary",density:"compact",class:"w-100","hide-header":""},null,8,["modelValue","min","max"])]),o.createVNode(c,{class:"h-100",vertical:""}),o.createElementVNode("div",nh,[o.createElementVNode("div",sh,o.toDisplayString(e.$t("time.time")),1),o.createVNode(m,{class:"pa-0 flex-1-1-0 scroll"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.hourOptions,(h,p)=>(o.openBlock(),o.createBlock(d,{key:p,value:h,color:"primary",active:i.currentTime===h,rounded:"",height:"26","min-height":"26",class:"rounded-xl",variant:i.currentTime===h?"flat":"text"},{default:o.withCtx(()=>[o.createVNode(s,{class:"text-body-2 font-weight-600 text-center",onClick:w=>i.currentTime=h},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(h),1)]),_:2},1032,["onClick"])]),_:2},1032,["value","active","variant"]))),128))]),_:1})])]),_:1}),o.createVNode(c),o.createVNode(y,{class:"w-100 d-flex justify-end align-center px-4 ga-4",style:{height:"50px"}},{default:o.withCtx(()=>[o.createVNode(u,{size:"small",variant:"tonal",class:"text-none text-body-1 px-4",onClick:l.handleCancelDate},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("actions.cancel")),1)]),_:1},8,["onClick"]),o.createVNode(u,{size:"small",variant:"flat",color:"primary",class:"text-none text-body-1 px-4",onClick:l.handleConfirmDate},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("actions.confirm")),1)]),_:1},8,["onClick"])]),_:1})]),_:1},8,["style"])):o.createCommentVNode("",!0)],512)}const qe=Q(ih,[["render",ch]]),_f="",mh={name:"IdmPoint",components:{DateTimePicker:qe},props:{simple:{type:Boolean,default:!1},isLogin:{type:Boolean,default:!1},token:{type:String},defaultMeteoToken:{type:String},theme:{type:String,default:"zh"},map:{type:Object},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}},gateway:{type:String},timeZone:{type:Number},forecastModel:{type:String},realTime:{type:String},followList:{type:Array}},emits:["meteoMore","follow","cancelFollow","login"],data(){return{right:10,toggle:!1,showForm:!1,showMeteo:!1,loading:!1,form:{lng:void 0,lngDegree:void 0,lngMinute:void 0,lngDirection:"E",lat:void 0,latDegree:void 0,latMinute:void 0,latDirection:"N",dateTime:void 0,forecastModel:""},formRules:{lngDegree:[e=>e!=null&&e!==""||"required",e=>/^\d{1,3}$/.test(e)||"number",e=>parseInt(e)>=0&&parseInt(e)<=180||"0 ~ 180"],lngMinute:[e=>e===void 0||e===null&&e===""||/^\d{1,2}(\.\d+)?$/.test(e)||"number",e=>e===void 0||e===null&&e===""||parseInt(e)>=0&&parseInt(e)<=59||"0 ~ 59"],latDegree:[e=>e!=null&&e!==""||"required",e=>/^\d{1,2}$/.test(e)||"number",e=>parseInt(e)>=0&&parseInt(e)<=90||"0 ~ 90"],latMinute:[e=>e===void 0||e===null&&e===""||/^\d{1,2}(\.\d+)?$/.test(e)||"number",e=>e===void 0||e===null&&e===""||parseInt(e)>=0&&parseInt(e)<=59||"0 ~ 59"]},meteoData:void 0,currentHourData:{},positionOffset:void 0,positionGmt:void 0,positionMarker:void 0,meteoInfoMarker:void 0}},computed:{timeZoneNames(){return C.tz.names()},timeZoneName(){var e;return(e=this.timeZoneNames.filter(t=>C.tz(C(),t).utcOffset()===this.timeZone*60))==null?void 0:e[0]},computedTzTime(){return e=>C.tz(C(e),this.timeZoneName).clone().format("YYYY-MM-DD HHmm")+" (UTC "+(this.timeZone>=0?"+":"")+this.timeZone+")"},computedLocalTime(){return e=>{var r,i,l;const t=Number((r=this.positionOffset)==null?void 0:r.slice(1,3))*(+(((i=this.positionOffset)==null?void 0:i.slice(1))==="+")?1:-1),a=(l=this.timeZoneNames.filter(n=>C.tz(C(),n).utcOffset()===t*60))==null?void 0:l[0];return e?C.tz(C(e),a).clone().format("YYYY-MM-DD HHmm")+" (UTC "+(t>=0?"+":"")+t+")":"-"}},computePosition(){return function(e){return!e||e.lng===null||e.lng===void 0||isNaN(e.lng)||e.lat===null||e.lat===void 0||isNaN(e.lat)?"-":X.LngLatHelper.lat2pretty(e==null?void 0:e.lat,2).pretty+" / "+X.LngLatHelper.lng2pretty(e==null?void 0:e.lng,2).pretty}},computeRoundPrecision(){return function(e,t=4){return e==null||isNaN(e)||isNaN(t)?"-":X.LngLatHelper.roundPrecision(e,t)}}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)})},immediate:!0},toggle:{handler(){this.toggle?this.showForm=!0:(this.showForm=!1,this.showMeteo=!1),this.map&&this.handleBind()},immediate:!0},map:{handler(){this.toggle=!1,this.map&&this.toggle&&this.handleBind()}},showForm:{handler(){this.showForm?this.$nextTick(()=>{var e;(e=this.$refs.spotForm)==null||e.resetValidation()}):this.handleCloseForm()}},showMeteo:{handler(){var e,t,a,r,i,l;this.showMeteo?((a=(t=(e=this.$parent)==null?void 0:e.$refs)==null?void 0:t.idmBottomBar)==null||a.handleToggle("spot",!0),this.simple&&this.$nextTick(()=>{var n,c;this.$parent.playerBottom=((c=(n=this.$refs.spotMeteo)==null?void 0:n.$el)==null?void 0:c.clientHeight)+10})):((l=(i=(r=this.$parent)==null?void 0:r.$refs)==null?void 0:i.idmBottomBar)==null||l.handleToggle("spot",!1),this.simple&&(this.$parent.playerBottom=30))}},realTime:{handler(){this.realTime&&(this.form.dateTime=this.realTime,this.showMeteo&&this.fetchData())}},forecastModel:{handler(){this.form.forecastModel=this.forecastModel},immediate:!0},"form.forecastModel":{handler(e,t){!e&&t&&(this.form.forecastModel=t==="GFS"?"ECMWF":"GFS")}}},methods:{handleMenuToggle(){this.isLogin?this.toggle=!this.toggle:this.$emit("login")},submitForm(){this.handleCloseMeteo(),this.$refs.spotForm.validate().then(async e=>{e!=null&&e.valid&&this.fetchData()})},cancelForm(){var e;(e=this.$refs.spotForm)==null||e.reset(),this.form={lng:void 0,lngDegree:void 0,lngMinute:void 0,lngDirection:"E",lat:void 0,latDegree:void 0,latMinute:void 0,latDirection:"N",dateTime:void 0,forecastModel:this.forecastModel}},handleCloseForm(){this.showForm=!1,this.cancelForm(),this.toggle=!1},async fetchData(){var a;if(isNaN(this.form.latDegree)||isNaN(this.form.latMinute)||isNaN(this.form.lngDegree)||isNaN(this.form.lngMinute))return!1;this.form.lat=(Number(this.form.latDegree??0)+Number(this.form.latMinute??0)/60)*(this.form.latDirection==="N"?1:-1),this.form.lng=(Number(this.form.lngDegree??0)+Number(this.form.lngMinute??0)/60)*(this.form.lngDirection==="E"?1:-1);const e=C();((a=C(this.realTime))==null?void 0:a.diff(e,"d",!0))>=0?await this.fetchForecastData(this.form):await this.fetchHistoryData(this.form)},async fetchForecastData(e){this.loading=!0,this.showMeteo=!0,this.form.lng=e.lng,this.form.lat=e.lat,this.form.followId=e.followId,this.handleDrawInfoMarker([e.lng,e.lat]),this.meteoData=[];const{weatherModels:t,marineModels:a}=Ae.Meteo2Assist.autoPickMeteoModel(e.forecastModel);let r={lat:e.lat,lng:e.lng,datetime:C(e.dateTime).utc().format(),forecastDays:e.day??3,weatherModels:t,marineModels:a};await ge.post(`${this.gateway}/api/arc/meteo2/spot/forecast`,r,{headers:{Authorization:this.token||this.defaultMeteoToken}}).then(i=>{(i==null?void 0:i.data.code)===0?(this.meteoData=i==null?void 0:i.data.data,this.meteoData.lng=e.lng,this.meteoData.lat=e.lat,this.initTableData(this.meteoData),this.loading=!1):this.loading=!1}).catch(()=>{this.loading=!1})},async fetchHistoryData(e){this.loading=!0,this.showMeteo=!0,this.form.lng=e.lng,this.form.lat=e.lat,this.form.followId=e.followId,this.handleDrawInfoMarker([e.lng,e.lat]),this.meteoData=[];const{weatherModels:t,marineModels:a}=Ae.Meteo2Assist.autoPickMeteoModel(e.forecastModel),r={lat:e.lat,lng:e.lng,datetime:C(e.dateTime).utc().format(),forecastDays:2,pastDays:1,weatherModels:t,marineModels:a};await ge.post(`${this.gateway}/api/arc/meteo2/spot/forecast`,r,{headers:{Authorization:this.token||this.defaultMeteoToken}}).then(i=>{(i==null?void 0:i.data.code)===0?(this.meteoData=i==null?void 0:i.data.data,this.meteoData.lng=e.lng,this.meteoData.lat=e.lat,this.initTableData(this.meteoData),this.loading=!1):this.loading=!1}).catch(()=>{this.loading=!1}),this.loading=!1},initTableData(e){var a,r,i,l,n,c,s,d,m,g,u,y,f,h,p,w,x,b,k,L,_,z,S,M,T,E,I,G,j,H,ae,N,A,F,Y,D,R,Z,P,K,re;this.currentHourData={},this.positionGmt=(r=(a=e==null?void 0:e.weather)==null?void 0:a[0])==null?void 0:r.timezone,this.positionOffset=(l=(i=e==null?void 0:e.weather)==null?void 0:i[0])==null?void 0:l.offset;const t=((n=Ae.Meteo2Assist.pickHourly(e,C(this.form.dateTime)))==null?void 0:n[0])||{};this.currentHourData.utc=t.utc,this.currentHourData.lat=e.lat,this.currentHourData.lng=e.lng,this.currentHourData.temp=this.computeRoundPrecision((c=t==null?void 0:t.weather)==null?void 0:c.temp,0)??"-",this.currentHourData.precipProbability=this.computeRoundPrecision((d=(s=t==null?void 0:t.weather)==null?void 0:s.precip)==null?void 0:d.probability,0)??"-",this.currentHourData.precip1h=this.computeRoundPrecision((g=(m=t==null?void 0:t.weather)==null?void 0:m.precip)==null?void 0:g.sum,0)??"-",this.currentHourData.visibility=this.computeRoundPrecision((u=t==null?void 0:t.weather)==null?void 0:u.visibility,0)??"-",this.currentHourData.windSpeed=this.computeRoundPrecision((f=(y=t==null?void 0:t.weather)==null?void 0:y.wind)==null?void 0:f.kts,1)??"-",this.currentHourData.windDir=((p=(h=t==null?void 0:t.weather)==null?void 0:h.wind)==null?void 0:p.direction)??"-",this.currentHourData.windLevel=this.computeRoundPrecision((x=(w=t==null?void 0:t.weather)==null?void 0:w.wind)==null?void 0:x.scale,0)??"-",this.currentHourData.windGust=this.computeRoundPrecision((k=(b=t==null?void 0:t.weather)==null?void 0:b.wind)==null?void 0:k.gusts,1)??"-",this.currentHourData.sigwaveHeight=this.computeRoundPrecision((_=(L=t==null?void 0:t.wave)==null?void 0:L.sig)==null?void 0:_.height,1)??"-",this.currentHourData.sigwaveDir=(S=(z=t==null?void 0:t.wave)==null?void 0:z.sig)==null?void 0:S.direction,this.currentHourData.sigwavePeriod=this.computeRoundPrecision((T=(M=t==null?void 0:t.wave)==null?void 0:M.sig)==null?void 0:T.period,1)??"-",this.currentHourData.windwaveHeight=this.computeRoundPrecision((I=(E=t==null?void 0:t.wave)==null?void 0:E.wd)==null?void 0:I.height,1)??"-",this.currentHourData.windwaveDir=(j=(G=t==null?void 0:t.wave)==null?void 0:G.wd)==null?void 0:j.direction,this.currentHourData.windwavePeriod=this.computeRoundPrecision((ae=(H=t==null?void 0:t.wave)==null?void 0:H.wd)==null?void 0:ae.period,1)??"-",this.currentHourData.swellHeight=this.computeRoundPrecision((A=(N=t==null?void 0:t.wave)==null?void 0:N.swell)==null?void 0:A.height,1)??"-",this.currentHourData.swellDir=(Y=(F=t==null?void 0:t.wave)==null?void 0:F.swell)==null?void 0:Y.direction,this.currentHourData.swellPeriod=this.computeRoundPrecision((R=(D=t==null?void 0:t.wave)==null?void 0:D.swell)==null?void 0:R.period,1)??"-",this.currentHourData.currentSpeed=this.computeRoundPrecision((Z=t==null?void 0:t.current)==null?void 0:Z.speed,1)??"-",this.currentHourData.currentDir=(P=t==null?void 0:t.current)==null?void 0:P.direction,this.currentHourData.currentSpeed=this.computeRoundPrecision((K=t==null?void 0:t.current)==null?void 0:K.speed,1)??"-",this.currentHourData.seaLevel=this.computeRoundPrecision(t==null?void 0:t.height,1)??"-",this.currentHourData.seaTemp=this.computeRoundPrecision(t==null?void 0:t.sst,0)??"-",this.currentHourData.weatherUrls=(re=t==null?void 0:t.weather)==null?void 0:re.url},handleBind(){var e,t;this.toggle?((e=this.map)==null||e.on("click",this.handleClick),this.map&&(this.map.getCanvas().style.cursor="crosshair")):((t=this.map)==null||t.off("click",this.handleClick),this.handleCloseMeteo(),this.map&&(this.map.getCanvas().style.cursor="grab"))},handleClick(e){if(e.originalEvent.stopPropagation(),e.originalEvent.target.className==="mapboxgl-canvas")this.handleGetPosition(e.lngLat),this.$nextTick(()=>{this.fetchData()});else return!1},handleGetPosition(e){if(isNaN(e.lat)||isNaN(e.lng))return!1;this.form.latDegree=Number(X.LngLatHelper.lat2pretty(e.lat).degree),this.form.latMinute=Number(X.LngLatHelper.lat2pretty(e.lat).minute),this.form.latDirection=X.LngLatHelper.lat2pretty(e.lat).direction,this.form.lngDegree=Number(X.LngLatHelper.lng2pretty(e.lng).degree),this.form.lngMinute=Number(X.LngLatHelper.lng2pretty(e.lng).minute),this.form.lngDirection=X.LngLatHelper.lng2pretty(e.lng).direction},handleDrawInfoMarker(e){this.drawPositionMarker(e),this.simple||this.drawMeteoInfoMarker(e)},drawPositionMarker(e){e&&(this.map.flyTo({center:e,duration:300}),this.$nextTick(()=>{var a,r;(a=this.positionMarker)==null||a.remove();const t=(r=document.getElementById("idm-position-icon"))==null?void 0:r.cloneNode(!0);this.positionMarker=new _e.Marker(t).setLngLat(e).setOffset([0,-15]).addTo(this.map)}))},drawMeteoInfoMarker(e){this.$nextTick(()=>{var a;const t=document.getElementById("idm-gl4-spot-meteo");this.meteoInfoMarker?(a=this.meteoInfoMarker)==null||a.setLngLat(e):this.meteoInfoMarker=new _e.Marker(t).setLngLat(e).setOffset([0,-190]).addTo(this.map)})},handleMeteoMore(){this.form.forecastModel=this.forecastModel,this.$emit("meteoMore",this.form)},handleCloseMeteo(){this.showMeteo=!1,this.$nextTick(()=>{var e,t;(e=this.positionMarker)==null||e.remove(),this.positionMarker=void 0,(t=this.meteoInfoMarker)==null||t.remove(),this.meteoInfoMarker=void 0})},handleFollow(){this.$emit("follow",this.form)},handleCancelFollow(){var t,a,r;const e=((t=this.form)==null?void 0:t.followId)||((r=(a=this.followList)==null?void 0:a.find(i=>{var l,n;return(i==null?void 0:i.id)===this.form.followId||((l=i==null?void 0:i.coordinate)==null?void 0:l.lng)===this.form.lng&&((n=i==null?void 0:i.coordinate)==null?void 0:n.lat)===this.form.lat}))==null?void 0:r.id);this.$emit("cancelFollow",e)}}},dh={class:"idm-gl4-spot"},hh={class:"d-flex justify-start align-center"},ph={class:"text-h6 font-weight-600"},gh={class:"d-flex justify-start align-center ga-1 mb-1"},uh={class:"multi-color-icon","aria-hidden":"true"},fh=["xlink:href"],yh={class:"d-flex justify-start align-center ga-1 mb-1"},bh={class:"multi-color-icon","aria-hidden":"true"},wh=["xlink:href"],xh={class:"d-flex justify-start align-center ga-1 mb-1"},kh={class:"multi-color-icon","aria-hidden":"true"},_h=["xlink:href"],vh={class:"d-flex justify-start align-center ga-1 mb-1"},zh={class:"multi-color-icon","aria-hidden":"true"},Lh=["xlink:href"],Ch={class:"d-flex justify-start align-center"},Sh={class:"mx-2"},Nh={class:"mx-0 py-2 d-flex align-center justify-start"},Ph={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},Mh={class:"pa-0 px-0"},Th={class:"mx-0 py-2 d-flex align-center justify-start"},Vh={cols:"9",class:"pa-0 px-0"},Eh={class:"mx-0 py-2 d-flex align-center justify-start"},Rh={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},Dh={style:{width:"150px"},class:"pa-0 text-left"},Bh={style:{width:"80px"},class:"pa-0 pr-2 text-right opacity-50"},Ih={cols:"3",class:"pa-0 px-0 text-left"},Ah={class:"mx-0 py-2 d-flex align-center justify-start"},Fh={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},Gh={style:{width:"150px"},class:"pa-0 text-left"},Wh={style:{width:"80px"},class:"pa-0 pr-2 text-right opacity-50"},Zh={cols:"3",class:"pa-0 text-left"},Oh={class:"mx-0 py-2 d-flex align-center justify-start"},jh={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},Xh={style:{width:"150px"},class:"pa-0 text-left"},Hh={style:{width:"80px"},class:"pa-0 pr-2 text-right opacity-50"},Yh={class:"pa-0 text-left"},Uh={class:"d-flex justify-space-between align-center"},Jh={class:"d-flex justify-start align-center"},$h={class:"mx-1"},Kh={class:"d-flex justify-end align-center"},qh={class:"mx-0 py-1 d-flex align-center justify-start"},Qh={style:{width:"60px"},class:"pa-0 pr-2 text-right opacity-50"},ep={class:"pa-0 px-0"},tp={class:"mx-0 py-1 d-flex align-center justify-start"},op={class:"pa-0 px-0"},ap={class:"gray-bg-2 mx-4 my-2 py-3 px-2 rounded text-font-13 d-flex align-center justify-space-between"},ip={class:"d-flex flex-column align-start justify-center ga-3"},rp={class:"text-label pr-2"},lp={class:"text-label pr-2"},np={class:"text-label pr-2"},sp={class:"d-flex flex-column align-start justify-center ga-3"},cp={class:"text-label pr-2"},mp={class:"text-label pr-2"},dp={class:"text-label pr-2"},hp={id:"idm-position-icon"},pp={class:"multi-color-icon",style:{height:"30px",width:"30px"},"aria-hidden":"true"},gp=["xlink:href"];function up(e,t,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VTooltip"),s=o.resolveComponent("VCardTitle"),d=o.resolveComponent("VDivider"),m=o.resolveComponent("VTextField"),g=o.resolveComponent("VCol"),u=o.resolveComponent("VRow"),y=o.resolveComponent("DateTimePicker"),f=o.resolveComponent("VBtnToggle"),h=o.resolveComponent("VCardText"),p=o.resolveComponent("VCardActions"),w=o.resolveComponent("VForm"),x=o.resolveComponent("VCard");return o.openBlock(),o.createElementBlock("div",dh,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+126+"px",right:i.right+"px"})},[o.createVNode(c,{text:e.$t("spot.spotsMeteo"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:b})=>[o.createVNode(n,o.mergeProps(b,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>t[8]||(t[8]=[o.createElementVNode("i",{class:"iconfont icon-a-Spotweather text-h4"},null,-1)])),_:2,__:[8]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4),i.showForm&&!a.simple?(o.openBlock(),o.createBlock(x,{key:0,class:"spot-form-card",style:o.normalizeStyle({top:a.top+a.paddingTop+126+"px",right:i.right+50+"px"})},{default:o.withCtx(()=>[o.createVNode(s,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>[o.createElementVNode("div",hh,[o.createElementVNode("div",ph,o.toDisplayString(e.$t("spot.spotWeather")),1)]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleCloseForm},{default:o.withCtx(()=>t[9]||(t[9]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[9]},8,["onClick"])]),_:1}),o.createVNode(d),o.createVNode(w,{ref:"spotForm",autocomplete:"off",class:"form-box",onSubmit:o.withModifiers(l.submitForm,["prevent"])},{default:o.withCtx(()=>[o.createVNode(h,{class:"text-body-1 py-1"},{default:o.withCtx(()=>[o.createElementVNode("div",gh,[(o.openBlock(),o.createElementBlock("svg",uh,[o.createElementVNode("use",{"xlink:href":`#icon-lng-${a.theme}`},null,8,fh)])),o.createElementVNode("div",null,o.toDisplayString(e.$t("spot.lat")),1)]),o.createVNode(u,{class:"ma-0"},{default:o.withCtx(()=>[o.createVNode(g,{cols:"4",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.latDegree,"onUpdate:modelValue":t[0]||(t[0]=b=>i.form.latDegree=b),rules:i.formRules.latDegree,label:"",density:"compact",variant:"outlined",height:"32px","min-height":"32px",required:"",dense:"",class:"text-body-1 input-btn-bg-1"},null,8,["modelValue","rules"]),t[10]||(t[10]=o.createElementVNode("span",{class:"px-1"},"°",-1))]),_:1,__:[10]}),o.createVNode(g,{cols:"6",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.latMinute,"onUpdate:modelValue":t[1]||(t[1]=b=>i.form.latMinute=b),rules:i.formRules.latMinute,label:"",density:"compact",variant:"outlined",class:"text-body-1 input-btn-bg-1",required:"",dense:""},null,8,["modelValue","rules"]),t[11]||(t[11]=o.createElementVNode("span",{class:"px-1"},"'",-1))]),_:1,__:[11]}),o.createVNode(g,{cols:"2",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(n,{variant:"outlined",density:"compact",width:"32","min-width":"32",height:"32",class:"text-body-1 btn-bg-1",style:{border:"1px solid rgba(var(--v-theme-on-surface), 0.38)"},onClick:t[2]||(t[2]=b=>i.form.latDirection=i.form.latDirection==="N"?"S":"N")},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.form.latDirection),1)]),_:1})]),_:1})]),_:1}),o.createElementVNode("div",yh,[(o.openBlock(),o.createElementBlock("svg",bh,[o.createElementVNode("use",{"xlink:href":`#icon-lng-${a.theme}`},null,8,wh)])),o.createElementVNode("div",null,o.toDisplayString(e.$t("spot.lng")),1)]),o.createVNode(u,{class:"ma-0"},{default:o.withCtx(()=>[o.createVNode(g,{cols:"4",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.lngDegree,"onUpdate:modelValue":t[3]||(t[3]=b=>i.form.lngDegree=b),rules:i.formRules.lngDegree,density:"compact",variant:"outlined",class:"text-body-1 input-btn-bg-1",required:"",dense:""},null,8,["modelValue","rules"]),t[12]||(t[12]=o.createElementVNode("span",{class:"px-1"},"°",-1))]),_:1,__:[12]}),o.createVNode(g,{cols:"6",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.lngMinute,"onUpdate:modelValue":t[4]||(t[4]=b=>i.form.lngMinute=b),rules:i.formRules.lngMinute,label:"",density:"compact",variant:"outlined",class:"text-body-1 input-btn-bg-1",required:"",dense:""},null,8,["modelValue","rules"]),t[13]||(t[13]=o.createElementVNode("span",{class:"px-1"},"'",-1))]),_:1,__:[13]}),o.createVNode(g,{cols:"2",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(n,{variant:"outlined",density:"compact",width:"32","min-width":"32",height:"32",class:"text-body-1 btn-bg-1",style:{border:"1px solid rgba(var(--v-theme-on-surface), 0.38)"},onClick:t[5]||(t[5]=b=>i.form.lngDirection=i.form.lngDirection==="E"?"W":"E")},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.form.lngDirection),1)]),_:1})]),_:1})]),_:1}),o.createElementVNode("div",xh,[(o.openBlock(),o.createElementBlock("svg",kh,[o.createElementVNode("use",{"xlink:href":`#icon-date-time-${a.theme}`},null,8,_h)])),o.createElementVNode("div",null,o.toDisplayString(e.$t("spot.dateTime")),1)]),o.createVNode(u,{class:"ma-0 mb-4"},{default:o.withCtx(()=>[o.createVNode(g,{cols:"12",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(y,o.mergeProps({"date-time":i.form.dateTime,"time-zone":a.timeZone},e.$attrs,{onDateTime:t[6]||(t[6]=b=>i.form.dateTime=b)}),null,16,["date-time","time-zone"])]),_:1})]),_:1}),o.createElementVNode("div",vh,[(o.openBlock(),o.createElementBlock("svg",zh,[o.createElementVNode("use",{"xlink:href":`#icon-forecast-model-${a.theme}`},null,8,Lh)])),o.createElementVNode("div",null,o.toDisplayString(e.$t("weather.forecastModel")),1)]),o.createVNode(u,{class:"ma-0 mb-2"},{default:o.withCtx(()=>[o.createVNode(g,{cols:"12",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(f,{modelValue:i.form.forecastModel,"onUpdate:modelValue":t[7]||(t[7]=b=>i.form.forecastModel=b),class:"w-100",rounded:"",height:"30",density:"compact",group:""},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"30",value:"GFS",class:o.normalizeClass(["text-none flex-1-1-0",i.form.forecastModel==="GFS"?"":"btn-border-1 btn-bg-1"]),color:i.form.forecastModel==="GFS"?"primary":"","base-color":""},{default:o.withCtx(()=>t[14]||(t[14]=[o.createTextVNode("NOAA",-1)])),_:1,__:[14]},8,["class","color"]),o.createVNode(n,{density:"compact",height:"30",class:o.normalizeClass(["text-none flex-1-1-0",i.form.forecastModel==="ECMWF"?"":"btn-border-1 btn-bg-1"]),color:i.form.forecastModel==="ECMWF"?"primary":"","base-color":"",value:"ECMWF"},{default:o.withCtx(()=>t[15]||(t[15]=[o.createTextVNode("ECMWF",-1)])),_:1,__:[15]},8,["class","color"])]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),o.createVNode(d),o.createVNode(p,{class:"d-flex justify-end align-center ga-4"},{default:o.withCtx(()=>[o.createVNode(n,{size:"small",variant:"outlined",class:"text-none text-body-1 btn-border-1 btn-bg-1",onClick:l.cancelForm},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("actions.clear")),1)]),_:1},8,["onClick"]),o.createVNode(n,{ref:"submitSpot",loading:i.loading,size:"small",variant:"flat",color:"primary",type:"submit",class:"text-none text-body-1"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("actions.confirm")),1)]),_:1},8,["loading"])]),_:1})]),_:1},8,["onSubmit"])]),_:1},8,["style"])):o.createCommentVNode("",!0),i.showMeteo&&!a.simple?(o.openBlock(),o.createBlock(x,{key:1,id:"idm-gl4-spot-meteo",class:"spot-meteo",style:{width:"490px","z-index":"9"}},{default:o.withCtx(()=>[o.createVNode(s,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>[o.createElementVNode("div",Ch,[t[16]||(t[16]=o.createElementVNode("i",{class:"iconfont icon-a-Spotweather text-h5 map-icon-aqua"},null,-1)),o.createElementVNode("div",Sh,o.toDisplayString(l.computePosition(i.form||i.currentHourData)),1)]),o.createVNode(n,{class:"mr-n2",density:"comfortable",icon:"",variant:"plain",onClick:o.withModifiers(l.handleCloseMeteo,["stop"])},{default:o.withCtx(()=>t[17]||(t[17]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[17]},8,["onClick"])]),_:1}),o.createVNode(d),o.createVNode(h,{class:"text-body-1 px-0 py-1"},{default:o.withCtx(()=>{var b,k;return[o.createElementVNode("div",Nh,[o.createElementVNode("div",Ph,o.toDisplayString(e.$t("time.time")),1),o.createElementVNode("div",Mh,o.toDisplayString(l.computedTzTime((b=i.currentHourData)==null?void 0:b.utc)),1)]),o.createElementVNode("div",Th,[t[18]||(t[18]=o.createElementVNode("div",{style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},"LT",-1)),o.createElementVNode("div",Vh,o.toDisplayString(l.computedLocalTime((k=i.currentHourData)==null?void 0:k.utc)),1)]),o.createElementVNode("div",Eh,[o.createElementVNode("div",Rh,o.toDisplayString(e.$t("weather.wind")),1),o.createElementVNode("div",Dh,o.toDisplayString(i.currentHourData.windDir??"-")+"/"+o.toDisplayString(i.currentHourData.windSpeed??"-")+"kts/BF"+o.toDisplayString(i.currentHourData.windLevel??"-"),1),o.createElementVNode("div",Bh,o.toDisplayString(e.$t("weather.sigWave")),1),o.createElementVNode("div",Ih,o.toDisplayString(i.currentHourData.sigwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.sigwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.sigwavePeriod??"-")+"s",1)]),o.createElementVNode("div",Ah,[o.createElementVNode("div",Fh,o.toDisplayString(e.$t("weather.windWave")),1),o.createElementVNode("div",Gh,o.toDisplayString(i.currentHourData.windwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.windwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.windwavePeriod??"-")+"s",1),o.createElementVNode("div",Wh,o.toDisplayString(e.$t("weather.swell")),1),o.createElementVNode("div",Zh,o.toDisplayString(i.currentHourData.swellDir??"-")+"/"+o.toDisplayString(i.currentHourData.swellHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.swellPeriod??"-")+"s",1)]),o.createElementVNode("div",Oh,[o.createElementVNode("div",jh,o.toDisplayString(e.$t("weather.current")),1),o.createElementVNode("div",Xh,o.toDisplayString(i.currentHourData.currentDir??"-")+"/"+o.toDisplayString(i.currentHourData.currentSpeed??"-")+"kts",1),o.createElementVNode("div",Hh,o.toDisplayString(e.$t("weather.visibility")),1),o.createElementVNode("div",Yh,o.toDisplayString(i.currentHourData.visibility??"-")+" nm",1)])]}),_:1}),o.createVNode(d),o.createVNode(p,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>{var b;return[(b=a.followList)!=null&&b.some(k=>{var L,_;return(k==null?void 0:k.id)===i.form.followId||((L=k==null?void 0:k.coordinate)==null?void 0:L.lng)===i.form.lng&&((_=k==null?void 0:k.coordinate)==null?void 0:_.lat)===i.form.lat})?(o.openBlock(),o.createBlock(n,{key:0,class:"text-none text-body-1",id:"idm-gl4-spot-meteo-follow",variant:"text",density:"compact",height:"32",onClick:o.withModifiers(l.handleCancelFollow,["stop"])},{prepend:o.withCtx(()=>t[19]||(t[19]=[o.createElementVNode("i",{class:"iconfont icon-yishoucang text-h6 text-warning"},null,-1)])),default:o.withCtx(()=>[o.createTextVNode(" "+o.toDisplayString(e.$t("actions.unfollow")),1)]),_:1},8,["onClick"])):(o.openBlock(),o.createBlock(n,{key:1,id:"idm-gl4-spot-meteo-unfollow",class:"text-none text-body-1",variant:"text",density:"compact",height:"32",onClick:o.withModifiers(l.handleFollow,["stop"])},{prepend:o.withCtx(()=>t[20]||(t[20]=[o.createElementVNode("i",{class:"iconfont icon-weishoucang text-h6"},null,-1)])),default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("actions.follow"))+" ",1)]),_:1},8,["onClick"])),o.createVNode(n,{height:"32",variant:"text",density:"compact","append-icon":"mdi-chevron-right",class:"text-none text-body-1",onClick:o.withModifiers(l.handleMeteoMore,["stop"])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("spot.forecast")),1)]),_:1},8,["onClick"])]}),_:1})]),_:1})):o.createCommentVNode("",!0),i.showMeteo&&a.simple?(o.openBlock(),o.createBlock(x,{key:2,ref:"spotMeteo",class:"position-absolute bottom-0 rounded-t-4",style:{width:"100vw","z-index":"1001"}},{default:o.withCtx(()=>[o.createVNode(s,null,{default:o.withCtx(()=>{var b;return[o.createElementVNode("div",Uh,[o.createElementVNode("div",Jh,[t[21]||(t[21]=o.createElementVNode("i",{class:"iconfont icon-a-Spotweather text-h5 map-icon-aqua"},null,-1)),o.createElementVNode("div",$h,o.toDisplayString(l.computePosition(i.form||i.currentHourData)),1)]),o.createElementVNode("div",Kh,[(b=a.followList)!=null&&b.some(k=>{var L,_;return(k==null?void 0:k.id)===i.form.followId||((L=k==null?void 0:k.coordinate)==null?void 0:L.lng)===i.form.lng&&((_=k==null?void 0:k.coordinate)==null?void 0:_.lat)===i.form.lat})?(o.openBlock(),o.createBlock(n,{key:0,class:"text-none text-body-1 rounded-circle",variant:"text",density:"compact",height:"32",width:"28","min-width":"28",onClick:o.withModifiers(l.handleCancelFollow,["stop"])},{default:o.withCtx(()=>t[22]||(t[22]=[o.createElementVNode("i",{class:"iconfont icon-yishoucang text-h4 text-warning"},null,-1)])),_:1,__:[22]},8,["onClick"])):(o.openBlock(),o.createBlock(n,{key:1,class:"text-none text-body-1 rounded-circle",variant:"plain",density:"compact",height:"32",width:"28","min-width":"28",onClick:o.withModifiers(l.handleFollow,["stop"])},{default:o.withCtx(()=>t[23]||(t[23]=[o.createElementVNode("i",{class:"iconfont icon-weishoucang text-h4"},null,-1)])),_:1,__:[23]},8,["onClick"])),o.createVNode(n,{class:"mr-n2",density:"comfortable",icon:"",variant:"plain",onClick:o.withModifiers(l.handleCloseMeteo,["stop"])},{default:o.withCtx(()=>t[24]||(t[24]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[24]},8,["onClick"])])]),t[25]||(t[25]=o.createElementVNode("div",{class:"px-5 py-0 text-label text-body-1"},"Spot Weather",-1))]}),_:1,__:[25]}),o.createVNode(d),o.createVNode(h,{class:"text-body-1 px-0 py-2"},{default:o.withCtx(()=>{var b,k;return[o.createElementVNode("div",qh,[o.createElementVNode("div",Qh,o.toDisplayString(e.$t("time.time")),1),o.createElementVNode("div",ep,o.toDisplayString(l.computedTzTime((b=i.currentHourData)==null?void 0:b.utc)),1)]),o.createElementVNode("div",tp,[t[26]||(t[26]=o.createElementVNode("div",{style:{width:"60px"},class:"pa-0 pr-2 text-right opacity-50"},"LT",-1)),o.createElementVNode("div",op,o.toDisplayString(l.computedLocalTime((k=i.currentHourData)==null?void 0:k.utc)),1)]),o.createElementVNode("div",ap,[o.createElementVNode("div",ip,[o.createElementVNode("div",null,[o.createElementVNode("span",rp,o.toDisplayString(e.$t("weather.wind")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.windDir??"-")+"/"+o.toDisplayString(i.currentHourData.windSpeed??"-")+"kts/BF"+o.toDisplayString(i.currentHourData.windLevel??"-"),1)]),o.createElementVNode("div",null,[o.createElementVNode("span",lp,o.toDisplayString(e.$t("weather.sigWave")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.sigwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.sigwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.sigwavePeriod??"-")+"s",1)]),o.createElementVNode("div",null,[o.createElementVNode("span",np,o.toDisplayString(e.$t("weather.windWave")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.windwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.windwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.windwavePeriod??"-")+"s",1)])]),o.createElementVNode("div",sp,[o.createElementVNode("div",null,[o.createElementVNode("span",cp,o.toDisplayString(e.$t("weather.swell")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.swellDir??"-")+"/"+o.toDisplayString(i.currentHourData.swellHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.swellPeriod??"-")+"s",1)]),o.createElementVNode("div",null,[o.createElementVNode("span",mp,o.toDisplayString(e.$t("weather.current")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.currentDir??"-")+"/"+o.toDisplayString(i.currentHourData.currentSpeed??"-")+"kts",1)]),o.createElementVNode("div",null,[o.createElementVNode("span",dp,o.toDisplayString(e.$t("weather.visibility")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.visibility??"-")+" nm",1)])])])]}),_:1})]),_:1},512)):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",hp,[(o.openBlock(),o.createElementBlock("svg",pp,[o.createElementVNode("use",{"xlink:href":`#icon-spot-${a.theme}`},null,8,gp)]))],512),[[o.vShow,i.showMeteo]])])}const fp=Q(mh,[["render",up]]),vf="",yp={name:"IdmMeasure",props:{simple:{type:Boolean,default:!1},map:{type:Object},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}}},setup(){return{Theme:be.useTheme()}},data(){return{right:10,toggle:!1,geojson:[],source:"measure-source",layer:"measure-layer",labelLayer:"measure-label-layer",sumLayer:"measure-suml-layer",tmpSource:"measure-tmp-source",tmpLayer:"measure-tmp-layer",tmpLabelLayer:"measure-tmp-label-layer",closeMarkers:{},pointMarkers:{},tipMarker:void 0,contextmenu:void 0,navigation:"RL",currentLineIndex:1}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)})},immediate:!0},toggle:{handler(){var e,t,a;if(this.toggle)this.handleBind();else{(e=this.map)==null||e.getCanvas().removeEventListener("keydown",this.handleKeydown),(t=this.map)==null||t.off("mousemove",this.handleMove),(a=this.map)==null||a.off("dblclick",this.handleDblClick),this.map;let r=this.geojson.find(i=>!i.closed);r&&this.handleClear(r,!0),this.geojson=this.geojson.filter(i=>!!i.closed),r=J.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(r)}},immediate:!0},map:{handler(){this.map&&(this.toggle?this.handleBind():this.handleUnbind())}}},methods:{handleMenuToggle(){this.toggle=!this.toggle},handleBind(){var e,t,a,r,i;(e=this.map)==null||e.getCanvas().addEventListener("keydown",this.handleKeydown),(t=this.map)==null||t.on("mousemove",this.handleMove),(a=this.map)==null||a.on("dblclick",this.handleDblClick),(r=this.map)==null||r.on("click",this.handleClick),(i=this.map)==null||i.on("contextmenu",this.handleContextmenu),this.map&&(this.map.getCanvas().style.cursor="crosshair")},handleUnbind(){var e,t,a,r,i;(e=this.map)==null||e.getCanvas().removeEventListener("keydown",this.handleKeydown),(t=this.map)==null||t.off("mousemove",this.handleMove),(a=this.map)==null||a.off("dblclick",this.handleDblClick),(r=this.map)==null||r.off("click",this.handleClick),(i=this.map)==null||i.off("contextmenu",this.handleContextmenu);for(const l of this.geojson)this.handleClear(l,!0);this.geojson=[],this.map&&(this.map.getCanvas().style.cursor="grab")},handleKeydown(e){if(e.key==="Shift"){this.navigation=this.navigation==="RL"?"GC":"RL";const t=this.geojson.at(-1),a=t.features.filter(r=>r.geometry.type==="Point");a!=null&&a.length&&(a.at(-1).properties.mode=this.navigation),this.handleRender(t)}},handleDrag(e){var a,r,i,l,n,c,s,d,m,g;const t=(r=(a=e.target)==null?void 0:a._element)==null?void 0:r.id;if((t==null?void 0:t.split("-").length)===2){const u=this.geojson.filter(p=>p.id===t.split("-")[0])[0];this.pointMarkers[u.id].filter(p=>{var w;return((w=p._element)==null?void 0:w.id)===t})[0].setLngLat([(l=(i=e.target)==null?void 0:i._lngLat)==null?void 0:l.lng,(c=(n=e.target)==null?void 0:n._lngLat)==null?void 0:c.lat]);let f;u.features.forEach((p,w)=>{if(p.geometry.type==="Point"&&p.properties.id===t.split("-")[1]){f=w;return}});const h=u.features.filter(p=>p.geometry.type==="Point");this.handleTmpPointUpdate(u,h[f-1],{lng:(d=(s=e.target)==null?void 0:s._lngLat)==null?void 0:d.lng,lat:(g=(m=e.target)==null?void 0:m._lngLat)==null?void 0:g.lat,properties:h[f].properties},f===h.length-1?void 0:h[f+1])}},handleDragEnd(e){var a,r,i,l,n,c,s,d,m,g;const t=(r=(a=e.target)==null?void 0:a._element)==null?void 0:r.id;if((t==null?void 0:t.split("-").length)===2){const u=this.geojson.filter(h=>h.id===t.split("-")[0])[0];this.pointMarkers[u.id].filter(h=>{var p;return((p=h._element)==null?void 0:p.id)===t})[0].setLngLat([(l=(i=e.target)==null?void 0:i._lngLat)==null?void 0:l.lng,(c=(n=e.target)==null?void 0:n._lngLat)==null?void 0:c.lat]);const f=u.features.filter(h=>h.geometry.type==="Point"&&h.properties.id===t.split("-")[1])[0];f.geometry.coordinates=[(d=(s=e.target)==null?void 0:s._lngLat)==null?void 0:d.lng,(g=(m=e.target)==null?void 0:m._lngLat)==null?void 0:g.lat],u.features=u.features.filter(h=>h.geometry.type==="Point"),this.handlePointUpdate(u)}},handleContextmenu(e){var a,r,i,l;e.preventDefault(),(a=this.contextmenu)==null||a.remove();const t=(l=(i=(r=e.originalEvent)==null?void 0:r.target)==null?void 0:i.parentElement)==null?void 0:l.id;if((t==null?void 0:t.split("-").length)===2){const c=this.geojson.filter(s=>s.id===t.split("-")[0])[0].features.filter(s=>s.geometry.type==="Point");if(c.length>2&&c.filter(d=>d.properties.id===(t==null?void 0:t.split("-")[1]))[0]){const d=document.createElement("div");d.className="idm-gl4-measure-contextmenu-marker",d.innerHTML=`<span id="del-${t}" class="del-point">${$t("actions.detele")}</span>`,this.contextmenu=new _e.Marker(d).setOffset([24,0]).setLngLat([e.lngLat.lng,e.lngLat.lat]).addTo(this.map)}}},handleClick(e){var a,r,i,l,n,c;(a=this.contextmenu)==null||a.remove();const t=e.originalEvent.target.className;if(t==="marker-close"){const s=(i=(r=e.originalEvent)==null?void 0:r.srcElement)==null?void 0:i.id,d=this.geojson.filter(m=>m.id===s)[0];d&&this.handleClear(d,!0),this.geojson=this.geojson.filter(m=>m.id!==s),!this.toggle&&!((l=this.geojson)!=null&&l.some(m=>m.closed))&&this.handleUnbind()}else if(t==="del-point"){const s=(c=(n=e.originalEvent.target.id)==null?void 0:n.replace("del-",""))==null?void 0:c.split("-"),d=this.geojson.filter(m=>m.id===s[0])[0];d.features=d.features.filter(m=>m.geometry.type==="Point"&&m.properties.id!==s[1]),this.handlePointUpdate(d)}else if(t!=="marker-label"&&this.toggle){let s=this.geojson.at(-1);s||(s=J.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(s)),s.features=s.features.filter(m=>m.geometry.type==="Point");const d=J.feature({type:"Point",coordinates:[e.lngLat.lng,e.lngLat.lat]},{id:new Date().getTime().toString(),mode:this.navigation,sumLabel:"Start"});s.features.push(d),this.handlePointUpdate(s)}},handlePointUpdate(e){const t=e.features;if(t.length>1){let a=0;const r=[];for(let i=1;i<t.length;i++){const l=t[i-1],n=t[i],c=l.properties,s={lng:l.geometry.coordinates[0],lat:l.geometry.coordinates[1]},d={lng:n.geometry.coordinates[0],lat:n.geometry.coordinates[1]},m=X.LaneHelper.calculateDistance(s,d,c.mode==="RL",4),g=X.LaneHelper.calculateBearing(s,d,c.mode==="RL",2);a=X.LngLatHelper.roundPrecision(a+m,4);let u;c.mode==="RL"?u=X.LngLatHelper.convertToMonotonicLng([s,d]):u=X.LngLatHelper.convertToMonotonicLng(X.LaneHelper.interpolateCoordinates(s,d,200));const y=J.lineString(u.map(h=>[h.lng,h.lat]));y.properties.dist=m,y.properties.bearing=g,y.properties.total=a,y.properties.name="Line "+this.currentLineIndex,r.push(y);const f=t[i];f.properties.totalDist=X.LngLatHelper.roundPrecision((c.totalDist?c.totalDist:0)+m,4),f.properties.sumLabel=f.properties.totalDist+" nm"}t.push(...r),e.total=a}return this.handleRender(e),e},handleTmpPointUpdate(e,t,a,r){const i=J.featureCollection([]);let l,n;if(t){const s=t.properties,d={lng:t.geometry.coordinates[0],lat:t.geometry.coordinates[1]},m={lng:a.lng,lat:a.lat};l=X.LaneHelper.calculateDistance(d,m,s.mode==="RL",4),n=X.LaneHelper.calculateBearing(d,m,s.mode==="RL",2);let g;s.mode==="RL"?g=X.LngLatHelper.convertToMonotonicLng([d,m]):g=X.LngLatHelper.convertToMonotonicLng(X.LaneHelper.interpolateCoordinates(d,m,200));const u=J.lineString(g.map(y=>[y.lng,y.lat]));u.properties.dist=l,u.properties.bearing=n,i.features.push(u)}if(r){const s=a.properties,d=a,m={lng:r.geometry.coordinates[0],lat:r.geometry.coordinates[1]};l=X.LaneHelper.calculateDistance(d,m,s.mode==="RL",4),n=X.LaneHelper.calculateBearing(d,m,s.mode==="RL",2);let g;s.mode==="RL"?g=X.LngLatHelper.convertToMonotonicLng([d,m]):g=X.LngLatHelper.convertToMonotonicLng(X.LaneHelper.interpolateCoordinates(d,m,200));const u=J.lineString(g.map(y=>[y.lng,y.lat]));u.properties.dist=l,u.properties.bearing=n,i.features.push(u)}this.map.getSource(this.tmpSource)?this.map.getSource(this.tmpSource).setData(i):this.map.addSource(this.tmpSource,{type:"geojson",data:i}),this.map.getLayer(this.tmpLayer)||this.map.addLayer({id:this.tmpLayer,type:"line",source:this.tmpSource,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.Theme.current.value.colors["map-orange"],"line-width":2,"line-opacity":1,"line-dasharray":[3,2]}}),this.map.getLayer(this.tmpLabelLayer)||this.map.addLayer({id:this.tmpLabelLayer,type:"symbol",source:this.tmpSource,filter:["==","$type","LineString"],layout:{"symbol-placement":"line-center","text-field":"{dist} nm","text-rotation-alignment":"map","text-size":10,"text-offset":[0,-1]},paint:{"text-opacity":1,"text-color":this.Theme.current.value.colors["on-surface"]}});let c;if(r)c=`<div class="marker-label">${this.$t("measure.dragTips")}</div>`;else{const s=X.LngLatHelper.roundPrecision((e.total??0)+l,1);c=`<div class="marker-label">${this.$t("measure.totalDistance")}: <b>${s}</b>nm, ${this.$t("measure.bearing")}: <b>${n}</b>°</div><div class="marker-label"> ${this.$t("measure.mode")}${this.navigation==="RL"?"RL":"GC"}, ${this.$t("measure.switchTips")}</div><div class="marker-label">${this.$t("measure.clickTips")}</div>`}if(this.tipMarker)this.tipMarker._element.innerHTML=c,this.tipMarker.setLngLat([a.lng,a.lat]);else{const s=document.createElement("div");s.className="idm-gl4-measure-tip-marker",s.innerHTML=c,this.tipMarker=new _e.Marker(s).setOffset([140,0]).setLngLat([a.lng,a.lat]).addTo(this.map)}},handleMove(e){this.map.getCanvas().style.cursor="crosshair";let t=this.geojson.at(-1);t||(t=J.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(t));const a=t.features.filter(r=>r.geometry.type==="Point");a!=null&&a.length&&this.handleTmpPointUpdate(t,a.at(-1),{lng:e.lngLat.lng,lat:e.lngLat.lat})},handleDblClick(e){e.preventDefault();let t=this.geojson.at(-1);t.closed=!0,this.handleRender(t),t=J.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(t),this.currentLineIndex++},handleRender(e){var t;if((t=e==null?void 0:e.features)!=null&&t.length){const a=`${e.id}-${this.source}`,r=`${e.id}-${this.layer}`,i=`${e.id}-${this.labelLayer}`,l=`${e.id}-${this.sumLayer}`;this.map.getSource(a)?this.map.getSource(a).setData(e):this.map.addSource(a,{type:"geojson",data:e}),this.handleClear(e,!1),this.map.addLayer({id:r,type:"line",source:a,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.Theme.current.value.colors["map-orange"],"line-width":2}}),this.map.addLayer({id:i,type:"symbol",source:a,filter:["==","$type","LineString"],layout:{"symbol-placement":"line-center","text-field":"{dist} nm","text-rotation-alignment":"map","text-size":10,"text-offset":[0,-1]},paint:{"text-opacity":1,"text-color":this.Theme.current.value.colors["on-surface"]}}),this.map.addLayer({id:l,type:"symbol",source:a,filter:["==","$type","Point"],layout:{"text-field":"{sumLabel}","text-rotation-alignment":"map","text-size":12,"text-offset":[0,1.5]},paint:{"text-opacity":1,"text-color":this.Theme.current.value.colors["on-surface"]}});const n=e.features.filter(c=>c.geometry.type==="Point");for(const c of n){const s=document.createElement("div");s.id=`${e.id}-${c.properties.id}`,s.className=`${e.closed?"idm-gl4-measure-marker closed":"idm-gl4-measure-marker"}`,s.innerHTML='<div class="marker-circle"></div>';const d=new _e.Marker({element:s,draggable:!0,contextmenu:!0}).setLngLat(c.geometry.coordinates).addTo(this.map);d.on("drag",this.handleDrag),d.on("dragend",this.handleDragEnd),this.pointMarkers[e.id]?this.pointMarkers[e.id].push(d):this.pointMarkers[e.id]=[d]}if(e.closed){const c=n.at(-1),d=e.features.filter(g=>g.geometry.type==="LineString").at(-1),m=document.createElement("div");m.className="idm-gl4-measure-summary-marker",m.innerHTML=`<div class="marker-label">${d.properties.name}</div><div id="${e.id}" class="marker-close">X</div>`,this.closeMarkers[e.id]=new _e.Marker(m).setOffset([0,-30]).setLngLat(c.geometry.coordinates).addTo(this.map)}}},handleClear(e,t=!0){var n,c,s,d,m,g,u,y,f,h;const a=`${e.id}-${this.source}`,r=`${e.id}-${this.layer}`,i=`${e.id}-${this.labelLayer}`,l=`${e.id}-${this.sumLayer}`;(n=this.map)!=null&&n.getLayer(r)&&this.map.removeLayer(r),(c=this.map)!=null&&c.getLayer(i)&&this.map.removeLayer(i),(s=this.map)!=null&&s.getLayer(l)&&this.map.removeLayer(l),(d=this.map)!=null&&d.getLayer(this.tmpLayer)&&this.map.removeLayer(this.tmpLayer),(m=this.map)!=null&&m.getLayer(this.tmpLabelLayer)&&this.map.removeLayer(this.tmpLabelLayer),(g=this.closeMarkers[e.id])==null||g.remove(),this.closeMarkers[e.id]=void 0,(u=this.pointMarkers[e.id])==null||u.forEach(p=>{p==null||p.remove()}),this.pointMarkers[e.id]=[],(y=this.tipMarker)==null||y.remove(),this.tipMarker=void 0,t&&((f=this.map)!=null&&f.getSource(a))&&this.map.removeSource(a),t&&((h=this.map)!=null&&h.getSource(this.tmpSource))&&this.map.removeSource(this.tmpSource)}}},bp={class:"idm-gl4-measure"};function wp(e,t,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VTooltip");return o.openBlock(),o.createElementBlock("div",bp,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+166+"px",right:i.right+"px"})},[o.createVNode(c,{text:e.$t("measure.measure"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:s})=>[o.createVNode(n,o.mergeProps(s,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>t[0]||(t[0]=[o.createElementVNode("i",{class:"iconfont icon-a-Measuredistance text-h4"},null,-1)])),_:2,__:[0]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4)])}const xp=Q(yp,[["render",wp]]);var V={image:new Map,background:new Map,resource:new Map,defaultStyle:new Map,baseStyle:new Map,computedStyle:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}};function kp(e="soft"){switch(V.session.__counterEpoch=(V.session.__counterEpoch||0)+1,e){case"auto":{V.session.styleMap=new Map,V.session.nodeMap=new Map;return}case"soft":{V.session.styleMap=new Map,V.session.nodeMap=new Map,V.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{V.session.styleMap=new Map,V.session.nodeMap=new Map,V.session.styleCache=new WeakMap,V.computedStyle=new WeakMap,V.baseStyle=new Map,V.defaultStyle=new Map,V.image=new Map,V.background=new Map,V.resource=new Map,V.font=new Set;return}default:{V.session.styleMap=new Map,V.session.nodeMap=new Map,V.session.styleCache=new WeakMap;return}}}function Yo(e){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)return null;let a=t[2].trim();return a.startsWith("#")?null:a}function _p(e){if(!e||e==="none")return"";let t=e.replace(/translate[XY]?\([^)]*\)/g,"");return t=t.replace(/matrix\(([^)]+)\)/g,(a,r)=>{let i=r.split(",").map(l=>l.trim());return i.length!==6?`matrix(${r})`:(i[4]="0",i[5]="0",`matrix(${i.join(", ")})`)}),t=t.replace(/matrix3d\(([^)]+)\)/g,(a,r)=>{let i=r.split(",").map(l=>l.trim());return i.length!==16?`matrix3d(${r})`:(i[12]="0",i[13]="0",`matrix3d(${i.join(", ")})`)}),t.trim().replace(/\s{2,}/g," ")}function Ro(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}function vp(e="[snapDOM]",{ttlMs:t=5*6e4,maxEntries:a=12}={}){let r=new Map,i=0;function l(n,c,s){if(i>=a)return;let d=Date.now();(r.get(c)||0)>d||(r.set(c,d+t),i++,n==="warn"&&console&&console.warn?console.warn(`${e} ${s}`):console&&console.error&&console.error(`${e} ${s}`))}return{warnOnce(n,c){l("warn",n,c)},errorOnce(n,c){l("error",n,c)},reset(){r.clear(),i=0}}}var da=vp("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),Uo=new Map,Do=new Map;function zp(e){return/^data:|^blob:|^about:blank$/i.test(e)}function Lp(e,t){try{let a=typeof location<"u"&&location.href?location.href:"http://localhost/",r=t.includes("{url}")?t.split("{url}")[0]:t,i=new URL(r||".",a),l=new URL(e,a);if(l.origin===i.origin)return!0;let n=l.searchParams;if(n&&(n.has("url")||n.has("target")))return!0}catch{}return!1}function Cp(e,t){if(!t||zp(e)||Lp(e,t))return!1;try{let a=typeof location<"u"&&location.href?location.href:"http://localhost/",r=new URL(e,a);return typeof location<"u"?r.origin!==location.origin:!0}catch{return!!t}}function Sp(e,t){if(!t)return e;if(t.includes("{url}"))return t.replace("{urlRaw}",Ro(e)).replace("{url}",encodeURIComponent(e));if(/[?&]url=?$/.test(t))return`${t}${encodeURIComponent(e)}`;if(t.endsWith("?"))return`${t}url=${encodeURIComponent(e)}`;if(t.endsWith("/"))return`${t}${Ro(e)}`;let a=t.includes("?")?"&":"?";return`${t}${a}url=${encodeURIComponent(e)}`}function ha(e){return new Promise((t,a)=>{let r=new FileReader;r.onload=()=>t(String(r.result||"")),r.onerror=()=>a(new Error("read_failed")),r.readAsDataURL(e)})}function Np(e,t){return[t.as||"blob",t.timeout??3e3,t.useProxy||"",t.errorTTL??8e3,e].join("|")}async function Re(e,t={}){let a=t.as??"blob",r=t.timeout??3e3,i=t.useProxy||"",l=t.errorTTL??8e3,n=t.headers||{},c=!!t.silent;if(/^data:/i.test(e))try{if(a==="text")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1};if(a==="dataURL")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1,mime:String(e).slice(5).split(";")[0]||""};let[,p="",w=""]=String(e).match(/^data:([^,]*),(.*)$/)||[],x=/;base64/i.test(p)?atob(w):decodeURIComponent(w),b=new Uint8Array([...x].map(L=>L.charCodeAt(0))),k=new Blob([b],{type:(p||"").split(";")[0]||""});return{ok:!0,data:k,status:200,url:e,fromCache:!1,mime:k.type||""}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(e))try{let p=await fetch(e);if(!p.ok)return{ok:!1,data:null,status:p.status,url:e,fromCache:!1,reason:"http_error"};let w=await p.blob(),x=w.type||p.headers.get("content-type")||"";return a==="dataURL"?{ok:!0,data:await ha(w),status:p.status,url:e,fromCache:!1,mime:x}:a==="text"?{ok:!0,data:await w.text(),status:p.status,url:e,fromCache:!1,mime:x}:{ok:!0,data:w,status:p.status,url:e,fromCache:!1,mime:x}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(e))return a==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:e,fromCache:!1,mime:"image/png"}:{ok:!0,data:a==="text"?"":new Blob([]),status:200,url:e,fromCache:!1};let s=Np(e,{as:a,timeout:r,useProxy:i,errorTTL:l}),d=Do.get(s);if(d&&d.until>Date.now())return{...d.result,fromCache:!0};d&&Do.delete(s);let m=Uo.get(s);if(m)return m;let g=Cp(e,i)?Sp(e,i):e,u=t.credentials;if(!u)try{let p=typeof location<"u"&&location.href?location.href:"http://localhost/",w=new URL(e,p);u=typeof location<"u"&&w.origin===location.origin?"include":"omit"}catch{u="omit"}let y=new AbortController,f=setTimeout(()=>y.abort("timeout"),r),h=(async()=>{try{let p=await fetch(g,{signal:y.signal,credentials:u,headers:n});if(!p.ok){let b={ok:!1,data:null,status:p.status,url:g,fromCache:!1,reason:"http_error"};if(l>0&&Do.set(s,{until:Date.now()+l,result:b}),!c){let k=`${p.status} ${p.statusText||""}`.trim();da.warnOnce(`http:${p.status}:${a}:${new URL(e,(location==null?void 0:location.href)??"http://localhost/").origin}`,`HTTP error ${k} while fetching ${a} ${e}`)}return t.onError&&t.onError(b),b}if(a==="text")return{ok:!0,data:await p.text(),status:p.status,url:g,fromCache:!1};let w=await p.blob(),x=w.type||p.headers.get("content-type")||"";return a==="dataURL"?{ok:!0,data:await ha(w),status:p.status,url:g,fromCache:!1,mime:x}:{ok:!0,data:w,status:p.status,url:g,fromCache:!1,mime:x}}catch(p){let w=p&&typeof p=="object"&&"name"in p&&p.name==="AbortError"?String(p.message||"").includes("timeout")?"timeout":"abort":"network",x={ok:!1,data:null,status:0,url:g,fromCache:!1,reason:w};if(!/^blob:/i.test(e)&&l>0&&Do.set(s,{until:Date.now()+l,result:x}),!c){let b=`${w}:${a}:${new URL(e,(location==null?void 0:location.href)??"http://localhost/").origin}`,k=w==="timeout"?`Timeout after ${r}ms. Consider increasing timeout or using a proxy for ${e}`:w==="abort"?`Request aborted while fetching ${a} ${e}`:`Network/CORS issue while fetching ${a} ${e}. A proxy may be required`;da.errorOnce(b,k)}return t.onError&&t.onError(x),x}finally{clearTimeout(f),Uo.delete(s)}})();return Uo.set(s,h),h}async function pa(e,t={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(e)||e.trim()==="none")return e;let a=Yo(e);if(!a)return e;let r=Ro(a);if(V.background.has(r)){let i=V.background.get(r);return i?`url("${i}")`:"none"}try{let i=await Re(r,{as:"dataURL",useProxy:t.useProxy});return i.ok?(V.background.set(r,i.data),`url("${i.data}")`):(V.background.set(r,null),"none")}catch{return V.background.set(r,null),"none"}}var Pp=new Set(["meta","script","noscript","title","link","template"]),Jo=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]);function Mp(e){if(e=String(e).toLowerCase(),Jo.has(e)){let l={};return V.defaultStyle.set(e,l),l}if(V.defaultStyle.has(e))return V.defaultStyle.get(e);let t=document.getElementById("snapdom-sandbox");t||(t=document.createElement("div"),t.id="snapdom-sandbox",t.setAttribute("data-snapdom-sandbox","true"),t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.style.width="0px",t.style.height="0px",t.style.overflow="hidden",document.body.appendChild(t));let a=document.createElement(e);a.style.all="initial",t.appendChild(a);let r=getComputedStyle(a),i={};for(let l of r){if(ga(l))continue;let n=r.getPropertyValue(l);i[l]=n}return t.removeChild(a),V.defaultStyle.set(e,i),i}var Tp=/(?:^|-)(animation|transition)(?:-|$)/i,Vp=/^(--|view-timeline|scroll-timeline|animation-trigger|offset-|position-try|app-region|interactivity|overlay|view-transition|-webkit-locale|-webkit-user-(?:drag|modify)|-webkit-tap-highlight-color|-webkit-text-security)$/i,Ep=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope"]);function ga(e){let t=String(e).toLowerCase();return!!(Ep.has(t)||Vp.test(t)||Tp.test(t))}function $o(e,t){if(t=String(t||"").toLowerCase(),Jo.has(t))return"";let a=[],r=Mp(t);for(let[i,l]of Object.entries(e)){if(ga(i))continue;let n=r[i];l&&l!==n&&a.push(`${i}:${l}`)}return a.sort(),a.join(";")}function Rp(e){let t=new Set;return e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(e.tagName&&t.add(e.tagName.toLowerCase()),typeof e.querySelectorAll=="function"&&e.querySelectorAll("*").forEach(a=>t.add(a.tagName.toLowerCase())),Array.from(t))}function Dp(e){let t=new Map;for(let r of e){let i=V.defaultStyle.get(r);if(!i)continue;let l=Object.entries(i).map(([n,c])=>`${n}:${c};`).sort().join("");l&&(t.has(l)||t.set(l,[]),t.get(l).push(r))}let a="";for(let[r,i]of t.entries())a+=`${i.join(",")} { ${r} }
217
+ </svg>`,me=document.createElement("div");me.className="idm-tropical-gl4-hourly-marker",me.innerHTML=`<div class="${P.geometry.coordinates[1]>=0?"center north":"center south"}">${re}</div>`;const he=new _e.Marker(me).setLngLat(P.geometry.coordinates).addTo(this.map);this.interpolateMarkers.push(he)}this.$emit("tropicalCenterPoints",Z)}else(N=this.map)!=null&&N.getSource(this.interpolateSource)&&((A=this.map)==null||A.getSource(this.interpolateSource).setData(this.empty))},handleClick(e){var i,l,n,c,s,d,m,g,u,y,f;const t=e.features[0],a=(l=(i=this.tropicals)==null?void 0:i.data)==null?void 0:l.features.filter(h=>{var p;return h.geometry.type==="LineString"&&h.properties.type==="forecast"&&h.properties.name===((p=t==null?void 0:t.properties)==null?void 0:p.name)}),r=(c=(n=this.tropicals)==null?void 0:n.data)==null?void 0:c.features.filter(h=>{var p;return h.geometry.type==="LineString"&&h.properties.type==="history"&&h.properties.name===((p=t==null?void 0:t.properties)==null?void 0:p.name)});this.activeTropicals={name:((s=t==null?void 0:t.properties)==null?void 0:s.name)||"-",nameCn:((d=t==null?void 0:t.properties)==null?void 0:d.nameCn)||((m=t==null?void 0:t.properties)==null?void 0:m.name)||"-",Name:((g=t==null?void 0:t.properties)==null?void 0:g.Name)||"-",forecasts:a.map(h=>h.properties),history:(u=r[0])==null?void 0:u.properties,showCircle:(f=(y=a[0])==null?void 0:y.properties)==null?void 0:f.showCircle},this.showTropicalsInfo=!0,this.simple||this.drawTropicalsInfoMaker([e.lngLat.lng,e.lngLat.lat])},drawTropicalsInfoMaker(e){this.$nextTick(()=>{const t=document.getElementById("idm-tropical-gl4-info");this.activeTropicalsMarker?this.activeTropicalsMarker.setLngLat(e).setOffset([220,0]):this.activeTropicalsMarker=new _e.Marker(t).setLngLat(e).setOffset([220,0]).addTo(this.map)})},handleCloseInfoMarker(){this.showTropicalsInfo=!1,this.$nextTick(()=>{var e;(e=this.activeTropicalsMarker)==null||e.remove(),this.activeTropicalsMarker=void 0})},handleForecastToggle(e){var r,i,l,n,c,s;e.disabled=!e.disabled;const t=`${e.name}-${e.model}`,a=(i=(r=this.map)==null?void 0:r.getSource(this.source)._data)==null?void 0:i.features;a.forEach(d=>{d.properties.category===t&&(d.properties.disabled=e.disabled)}),this.interpolateData.forEach(d=>{d.properties.category===t&&(d.properties.disabled=e.disabled)}),(n=(l=this.map)==null?void 0:l.getSource(this.source))==null||n.setData(J.featureCollection(a)),(s=(c=this.map)==null?void 0:c.getSource(this.clusterSource))==null||s.setData(J.featureCollection(a)),this.handleDateChange()},handleStrikeProbability(e){this.$emit("tropicalProbability",e)},handleToggleCircles(e){var t,a;e.showCircle=!e.showCircle,(a=(t=this.tropicals.data)==null?void 0:t.features)==null||a.forEach(r=>{r.properties.name===e.name&&(r.properties.showCircle=e.showCircle)}),this.handleRender()},handleComputePolygons(e){const t=[];for(const a of e){const r=a.properties.wind,i={ne:r.r7ne>=0?r.r7ne:void 0,se:r.r7se>=0?r.r7se:void 0,sw:r.r7sw>=0?r.r7sw:void 0,nw:r.r7nw>=0?r.r7nw:void 0},l=this.handleComputeArc(a.geometry.coordinates,i,{...a.properties,level:7});t.push(l);const n={ne:r.r10ne>=0?r.r10ne:void 0,se:r.r10se>=0?r.r10se:void 0,sw:r.r10sw>=0?r.r10sw:void 0,nw:r.r10nw>=0?r.r10nw:void 0},c=this.handleComputeArc(a.geometry.coordinates,n,{...a.properties,level:10});t.push(c)}return t},handleComputeArc(e,t,a){var l;const r=[];for(const n in t){const c=t[n]??0;let s;switch(n){case"ne":s=J.lineArc(e,c,0,90,{steps:c>0?32:1,units:"nauticalmiles"});break;case"se":s=J.lineArc(e,c,90,180,{steps:c>0?32:1,units:"nauticalmiles"});break;case"sw":s=J.lineArc(e,c,180,270,{steps:c>0?32:1,units:"nauticalmiles"});break;case"nw":s=J.lineArc(e,c,270,360,{steps:c>0?32:1,units:"nauticalmiles"});break}r.push(...(l=s==null?void 0:s.geometry)==null?void 0:l.coordinates)}const i=J.lineString(r);return J.lineToPolygon(i,{properties:a})},handleNotification(e){this.$emit("tropicalNotification",e)},handleHover(e){var i,l,n,c,s;this.map.getCanvas().style.cursor="pointer";const a=this.map.queryRenderedFeatures(e.point,{layers:[this.pointCircleLayer,this.pointCircleLayer+"-border",this.historyPointCircleLayer,this.historyPointCircleLayer+"-border",this.historyPointCircleLayer+"-inner"]})[0];this.hoverPoint=a==null?void 0:a.properties;const r=(l=(i=this.tropicals)==null?void 0:i.data)==null?void 0:l.features.filter(d=>{var m;return d.geometry.type==="LineString"&&d.properties.type==="forecast"&&d.properties.name===((m=a==null?void 0:a.properties)==null?void 0:m.name)});this.hoverPoint&&(this.hoverPoint.lng=a.geometry.coordinates[0],this.hoverPoint.lat=a.geometry.coordinates[1],this.hoverPoint.update=(c=(n=r==null?void 0:r[0])==null?void 0:n.properties)==null?void 0:c.date,(s=this.hoverMarker)==null||s.remove(),this.showHoverPoint=!0,this.$nextTick(()=>{const d=document.getElementById("tropicalHoverMarkerInfo").cloneNode(!0);this.hoverMarker=new _e.Marker(d).setLngLat(a.geometry.coordinates).setOffset([160,0]).addTo(this.map)}))},handleLeave(){var e;this.map.getCanvas().style.cursor="grab",this.showHoverPoint=!1,(e=this.hoverMarker)==null||e.remove(),this.hoverMarker=void 0}}},vm={class:"idm-tropical-gl4"},zm={class:"pb-1"},Lm={class:"text-h5 font-weight-600"},Cm={key:0,class:"text-h5 font-weight-600"},Sm={class:"text-body-1"},Nm={class:"text-label"},Pm={class:"d-flex justify-space-between align-center"},Mm={class:"w-60"},Tm={class:"text-label pr-1"},Vm={class:"flex-1-1-0"},Em={class:"text-label pr-1"},Rm={class:"py-2 d-flex justify-space-between align-center"},Dm={class:"w-60"},Bm={class:"text-label pr-1"},Im={class:"flex-1-1-0"},Am={class:"text-label pr-1"},Fm={class:"d-flex align-center flex-1-1-100 justify-space-between mt-n1"},Gm={class:"text-label pr-1",style:{width:"70px"}},Wm={class:"model-box d-flex justify-end align-center flex-wrap ga-1 pa-1"},Zm={class:"more"},Om={key:0,class:"w-100 d-flex justify-space-between align-center px-2"},jm={class:"pa-1"},Xm={class:"legend d-flex justify-start align-center py-2"},Hm={class:"label"},Ym={class:"legend d-flex justify-start align-center py-2"},Um={class:"label"},Jm={class:"legend d-flex justify-start align-center py-2"},$m={class:"label"},Km={class:"pa-1"},qm={class:"legend d-flex justify-start align-center py-2"},Qm={class:"label"},ed={class:"legend d-flex justify-start align-center py-2"},td={class:"label"},od={class:"legend d-flex justify-start align-center py-2"},ad={class:"label"},id={class:"pa-1"},rd={class:"w-100 legend d-flex justify-start align-center py-2 ga-2"},ld={class:"label"},nd={class:"label"},sd={class:"w-100 legend d-flex justify-start align-center py-2"},cd={class:"label"},md={class:"w-100 legend d-flex justify-start align-center py-2"},dd={class:"label"},hd={key:1,class:"my-3 w-100",style:{height:"80px"}},pd={class:"legend d-flex justify-start align-center"},gd={class:"label"},ud={class:"legend d-flex justify-start align-center"},fd={class:"label"},yd={class:"legend d-flex justify-start align-center"},bd={class:"label"},wd={class:"legend d-flex justify-start align-center"},xd={class:"label"},kd={class:"legend d-flex justify-start align-center"},_d={class:"label"},vd={class:"legend d-flex justify-start align-center"},zd={class:"label"},Ld={class:"legend d-flex justify-start align-center"},Cd={class:"label"},Sd={class:"legend d-flex justify-start align-center"},Nd={class:"label"},Pd={class:"legend d-flex justify-start align-center"},Md={class:"label"},Td={class:"legend d-flex justify-start align-center"},Vd={class:"label"},Ed={class:"d-flex justify-star align-center"},Rd={class:"font-weight-600 mr-1"},Dd={class:""},Bd={class:"port-box d-flex flex-column justify-center align-start ga-2"},Id={key:0,class:"d-flex justify-start align-center"},Ad={class:"text-label pr-1"},Fd={key:1,class:"d-flex justify-start align-center"},Gd={class:"text-label pr-1"},Wd={key:2,class:"d-flex justify-start align-center"},Zd={class:"text-label pr-1"},Od={key:3,class:"d-flex justify-start align-center"},jd={class:"text-label pr-1"},Xd={key:4,class:"d-flex justify-start align-center"},Hd={class:"text-label pr-1"},Yd={key:5,class:"d-flex justify-start align-center"},Ud={class:"text-label pr-1"},Jd={class:"d-flex justify-start align-center"},$d={class:"text-label pr-1"},Kd={key:6,class:"d-flex justify-start align-center"},qd={class:"text-label pr-1"},Qd={key:7,class:"d-flex justify-start align-center"},eh={class:"text-label pr-1"},th={class:"d-flex justify-start align-center"},oh={class:"text-label pr-1"};function ah(e,t,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VTooltip"),s=o.resolveComponent("VCardText"),d=o.resolveComponent("VDivider"),m=o.resolveComponent("VCardActions"),g=o.resolveComponent("VCard"),u=o.resolveComponent("v-card-title"),y=o.resolveComponent("v-divider");return o.openBlock(),o.createElementBlock("div",vm,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+86+"px",right:i.right+"px"})},[o.createVNode(c,{text:e.$t("tropical.tropicals"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:f})=>[o.createVNode(n,o.mergeProps(f,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>t[3]||(t[3]=[o.createElementVNode("i",{class:"iconfont icon-Tropical text-h4"},null,-1)])),_:2,__:[3]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4),i.showTropicalsInfo&&!e.$attrs.hideTropicalsLegend?(o.openBlock(),o.createElementBlock("div",{key:0,ref:"tropicalsInfo",id:"idm-tropical-gl4-info",class:o.normalizeClass(["idm-tropical-gl4-info",a.simple?"page":"dialog"])},[o.createVNode(g,{class:o.normalizeClass(["w-100",a.simple?"rounded-t-4 bg-none":""]),elevation:a.simple?0:16},{default:o.withCtx(()=>[o.createVNode(s,null,{default:o.withCtx(()=>{var f,h,p,w,x,b,k,L,_,z,S,M;return[o.createElementVNode("div",zm,[o.createElementVNode("span",Lm,o.toDisplayString(a.locale==="en"?(f=i.activeTropicals)==null?void 0:f.Name:((h=i.activeTropicals)==null?void 0:h.nameCn)||((p=i.activeTropicals)==null?void 0:p.Name)||"-"),1),(x=(w=i.activeTropicals)==null?void 0:w.history)!=null&&x.levelI18n?(o.openBlock(),o.createElementBlock("span",Cm," , "+o.toDisplayString(e.$t("tropical."+((k=(b=i.activeTropicals)==null?void 0:b.history)==null?void 0:k.levelI18n))),1)):o.createCommentVNode("",!0)]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"close",onClick:o.withModifiers(l.handleCloseInfoMarker,["stop"])},{default:o.withCtx(()=>t[4]||(t[4]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[4]},8,["onClick"]),o.createElementVNode("div",Sm,[o.createElementVNode("span",Nm,o.toDisplayString(e.$t("actions.lastUpdate"))+": ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTime(((_=(L=i.activeTropicals)==null?void 0:L.history)==null?void 0:_.updated)||((M=(S=(z=i.activeTropicals)==null?void 0:z.forecasts)==null?void 0:S.filter(T=>!T.disabled)[0])==null?void 0:M.date),a.timeZone)),1)])]}),_:1}),o.createVNode(d),o.createVNode(s,{class:"text-body-1 py-3"},{default:o.withCtx(()=>{var f,h,p,w,x,b,k,L,_;return[o.createElementVNode("div",Pm,[o.createElementVNode("div",Mm,[o.createElementVNode("label",Tm,o.toDisplayString(e.$t("weather.windSpeed"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((h=(f=i.activeTropicals)==null?void 0:f.history)==null?void 0:h.kts)||"-")+" kts",1),o.createElementVNode("span",null,", BF "+o.toDisplayString(l.computeBF(((w=(p=i.activeTropicals)==null?void 0:p.history)==null?void 0:w.kts)||"-")),1)]),o.createElementVNode("div",Vm,[o.createElementVNode("label",Em,o.toDisplayString(e.$t("weather.pressure"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((b=(x=i.activeTropicals)==null?void 0:x.history)==null?void 0:b.pressure)||"-")+" hPa",1)])]),o.createElementVNode("div",Rm,[o.createElementVNode("div",Dm,[o.createElementVNode("label",Bm,o.toDisplayString(e.$t("tropical.moveSpeed"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((k=l.computeMovement(i.activeTropicals))==null?void 0:k.kts)||"-")+" kts",1)]),o.createElementVNode("div",Im,[o.createElementVNode("label",Am,o.toDisplayString(e.$t("tropical.moveDir"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((L=l.computeMovement(i.activeTropicals))==null?void 0:L.deg)||"-")+"°",1)])]),o.createElementVNode("div",Fm,[o.createElementVNode("label",Gm,o.toDisplayString(e.$t("tropical.models"))+" : ",1),o.createElementVNode("div",Wm,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList((_=i.activeTropicals)==null?void 0:_.forecasts,(z,S)=>(o.openBlock(),o.createBlock(n,{key:S,density:"compact",variant:z.disabled?"text":"flat",color:z.disabled?"":"primary","min-width":30,class:o.normalizeClass(["model text-none text-body-1 px-1",z.disabled?"btn-border-1 btn-bg-1":""]),onClick:o.withModifiers(M=>l.handleForecastToggle(z),["stop"])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(z.model),1)]),_:2},1032,["variant","color","class","onClick"]))),128))])])]}),_:1}),o.createVNode(d),a.simple?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(m,{key:0,class:"d-flex justify-space-between"},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact","prepend-icon":"",variant:"text",color:i.showLegend?"primary":"",class:"text-none text-body-1",onClick:t[0]||(t[0]=o.withModifiers(f=>i.showLegend=!i.showLegend,["stop"]))},{prepend:o.withCtx(()=>t[5]||(t[5]=[o.createElementVNode("i",{class:"iconfont icon-Legend text-h4"},null,-1)])),default:o.withCtx(()=>[o.createTextVNode(" "+o.toDisplayString(e.$t("weather.legend")),1)]),_:1},8,["color"]),o.createElementVNode("div",Zm,[a.permission&i.helper.LEVEL.Supper?(o.openBlock(),o.createBlock(n,{key:0,variant:"text",density:"compact",class:"text-none text-body-1",onClick:t[1]||(t[1]=o.withModifiers(f=>l.handleNotification(i.activeTropicals),["stop"]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("actions.notify")),1)]),_:1})):o.createCommentVNode("",!0),o.createVNode(n,{variant:"text",density:"compact","append-icon":"mdi-chevron-right",class:"text-none text-body-1",onClick:t[2]||(t[2]=o.withModifiers(f=>l.handleStrikeProbability(i.activeTropicals),["stop"]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("actions.viewReport")),1)]),_:1})])]),_:1}))]),_:1},8,["class","elevation"]),a.simple?(o.openBlock(),o.createElementBlock("div",Om,[o.createElementVNode("div",jm,[o.createElementVNode("div",Xm,[t[6]||(t[6]=o.createElementVNode("div",{class:"icon td"},null,-1)),o.createElementVNode("div",Hm,o.toDisplayString(e.$t("tropical.td")),1)]),o.createElementVNode("div",Ym,[t[7]||(t[7]=o.createElementVNode("div",{class:"icon sts"},null,-1)),o.createElementVNode("div",Um,o.toDisplayString(e.$t("tropical.sts")),1)]),o.createElementVNode("div",Jm,[t[8]||(t[8]=o.createElementVNode("div",{class:"icon sty"},null,-1)),o.createElementVNode("div",$m,o.toDisplayString(e.$t("tropical.sty")),1)])]),o.createElementVNode("div",Km,[o.createElementVNode("div",qm,[t[9]||(t[9]=o.createElementVNode("div",{class:"icon ts"},null,-1)),o.createElementVNode("div",Qm,o.toDisplayString(e.$t("tropical.ts")),1)]),o.createElementVNode("div",ed,[t[10]||(t[10]=o.createElementVNode("div",{class:"icon ty"},null,-1)),o.createElementVNode("div",td,o.toDisplayString(e.$t("tropical.ty")),1)]),o.createElementVNode("div",od,[t[11]||(t[11]=o.createElementVNode("div",{class:"icon supper-ty"},null,-1)),o.createElementVNode("div",ad,o.toDisplayString(e.$t("tropical.superTy")),1)])]),o.createElementVNode("div",id,[o.createElementVNode("div",rd,[t[12]||(t[12]=o.createElementVNode("div",{class:"icon history"},null,-1)),o.createElementVNode("div",ld,o.toDisplayString(e.$t("tropical.history")),1),t[13]||(t[13]=o.createElementVNode("div",{class:"icon forecast"},null,-1)),o.createElementVNode("div",nd,o.toDisplayString(e.$t("tropical.forecast")),1)]),o.createElementVNode("div",sd,[t[14]||(t[14]=o.createElementVNode("div",{class:"icon r7"},null,-1)),o.createElementVNode("div",cd,"35kts "+o.toDisplayString(e.$t("tropical.radii")),1)]),o.createElementVNode("div",md,[t[15]||(t[15]=o.createElementVNode("div",{class:"icon r10"},null,-1)),o.createElementVNode("div",dd,"50kts "+o.toDisplayString(e.$t("tropical.radii")),1)])])])):(o.openBlock(),o.createElementBlock("div",hd,[o.withDirectives(o.createVNode(g,{elevation:"16"},{default:o.withCtx(()=>[o.createVNode(s,null,{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("div",{class:o.normalizeClass(["pa-1 d-flex justify-space-between align-center flex-wrap",a.locale==="zhHans"?" ga-2":" ga-3"])},[o.createElementVNode("div",pd,[t[16]||(t[16]=o.createElementVNode("div",{class:"icon td"},null,-1)),o.createElementVNode("div",gd,o.toDisplayString(e.$t("tropical.td")),1)]),o.createElementVNode("div",ud,[t[17]||(t[17]=o.createElementVNode("div",{class:"icon ts"},null,-1)),o.createElementVNode("div",fd,o.toDisplayString(e.$t("tropical.ts")),1)]),o.createElementVNode("div",yd,[t[18]||(t[18]=o.createElementVNode("div",{class:"icon sts"},null,-1)),o.createElementVNode("div",bd,o.toDisplayString(e.$t("tropical.sts")),1)]),o.createElementVNode("div",wd,[t[19]||(t[19]=o.createElementVNode("div",{class:"icon ty"},null,-1)),o.createElementVNode("div",xd,o.toDisplayString(e.$t("tropical.ty")),1)]),o.createElementVNode("div",kd,[t[20]||(t[20]=o.createElementVNode("div",{class:"icon sty"},null,-1)),o.createElementVNode("div",_d,o.toDisplayString(e.$t("tropical.sty")),1)]),o.createElementVNode("div",vd,[t[21]||(t[21]=o.createElementVNode("div",{class:"icon supper-ty"},null,-1)),o.createElementVNode("div",zd,o.toDisplayString(e.$t("tropical.superTy")),1)]),o.createElementVNode("div",Ld,[t[22]||(t[22]=o.createElementVNode("div",{class:"icon history"},null,-1)),o.createElementVNode("div",Cd,o.toDisplayString(e.$t("tropical.history")),1)]),o.createElementVNode("div",Sd,[t[23]||(t[23]=o.createElementVNode("div",{class:"icon forecast"},null,-1)),o.createElementVNode("div",Nd,o.toDisplayString(e.$t("tropical.forecast")),1)]),o.createElementVNode("div",Pd,[t[24]||(t[24]=o.createElementVNode("div",{class:"icon r7"},null,-1)),o.createElementVNode("div",Md,"35kts "+o.toDisplayString(e.$t("tropical.radii")),1)]),o.createElementVNode("div",Td,[t[25]||(t[25]=o.createElementVNode("div",{class:"icon r10"},null,-1)),o.createElementVNode("div",Vd,"50kts "+o.toDisplayString(e.$t("tropical.radii")),1)])],2),[[o.vShow,i.showLegend]])]),_:1})]),_:1},512),[[o.vShow,i.showLegend]])]))],2)):o.createCommentVNode("",!0),o.withDirectives(o.createVNode(g,{id:"tropicalHoverMarkerInfo",elevation:"16","max-width":"280"},{default:o.withCtx(()=>[o.createVNode(u,null,{default:o.withCtx(()=>{var f,h,p,w;return[o.createElementVNode("div",Ed,[o.createElementVNode("span",Rd,o.toDisplayString(a.locale==="en"?(f=i.hoverPoint)==null?void 0:f.Name:((h=i.hoverPoint)==null?void 0:h.nameCn)||((p=i.hoverPoint)==null?void 0:p.Name)),1),o.createElementVNode("span",Dd," ["+o.toDisplayString(e.$t("tropical."+((w=i.hoverPoint)==null?void 0:w.levelI18n)))+"]",1)])]}),_:1}),o.createVNode(y),o.createVNode(s,{class:"text-body-1"},{default:o.withCtx(()=>{var f,h,p,w,x,b,k,L,_,z,S,M,T,E,I,G,j,H,ae,N;return[o.createElementVNode("div",Bd,[((f=i.hoverPoint)==null?void 0:f.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Id,[o.createElementVNode("label",Ad,o.toDisplayString(e.$t("tropical.updated"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTzTime((h=i.hoverPoint)==null?void 0:h.update,a.timeZone)),1)])):o.createCommentVNode("",!0),((p=i.hoverPoint)==null?void 0:p.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Fd,[o.createElementVNode("label",Gd,o.toDisplayString(e.$t("tropical.forecast"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTzTime((w=i.hoverPoint)==null?void 0:w.date,a.timeZone)),1)])):o.createCommentVNode("",!0),((x=i.hoverPoint)==null?void 0:x.type)==="history"?(o.openBlock(),o.createElementBlock("div",Wd,[o.createElementVNode("label",Zd,o.toDisplayString(e.$t("tropical.forecast"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computeTzTime((b=i.hoverPoint)==null?void 0:b.date,a.timeZone)),1)])):o.createCommentVNode("",!0),((k=i.hoverPoint)==null?void 0:k.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Od,[o.createElementVNode("label",jd,o.toDisplayString(e.$t("tropical.model"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((L=i.hoverPoint)==null?void 0:L.model)??"-"),1)])):o.createCommentVNode("",!0),((_=i.hoverPoint)==null?void 0:_.type)==="forecast"?(o.openBlock(),o.createElementBlock("div",Xd,[o.createElementVNode("label",Hd,o.toDisplayString(e.$t("weather.wind"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((S=JSON.parse((z=i.hoverPoint)==null?void 0:z.wind))==null?void 0:S.kts)??"-")+" kts",1)])):o.createCommentVNode("",!0),((M=i.hoverPoint)==null?void 0:M.type)==="history"?(o.openBlock(),o.createElementBlock("div",Yd,[o.createElementVNode("label",Ud,o.toDisplayString(e.$t("weather.wind"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((T=i.hoverPoint)==null?void 0:T.kts)??"-")+" kts",1)])):o.createCommentVNode("",!0),o.createElementVNode("div",Jd,[o.createElementVNode("label",$d,o.toDisplayString(e.$t("weather.pressure"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((E=i.hoverPoint)==null?void 0:E.pressure)??"-")+" hPa",1)]),((I=i.hoverPoint)==null?void 0:I.type)==="history"?(o.openBlock(),o.createElementBlock("div",Kd,[o.createElementVNode("label",qd,o.toDisplayString(e.$t("tropical.moveSpeed"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((j=JSON.parse((G=i.hoverPoint)==null?void 0:G.movement))==null?void 0:j.kts)??"-")+" kts",1)])):o.createCommentVNode("",!0),((H=i.hoverPoint)==null?void 0:H.type)==="history"?(o.openBlock(),o.createElementBlock("div",Qd,[o.createElementVNode("label",eh,o.toDisplayString(e.$t("tropical.moveDir"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(((N=JSON.parse((ae=i.hoverPoint)==null?void 0:ae.movement))==null?void 0:N.deg)??"-")+" °",1)])):o.createCommentVNode("",!0),o.createElementVNode("div",th,[o.createElementVNode("label",oh,o.toDisplayString(e.$t("tropical.position"))+" : ",1),o.createElementVNode("span",null,o.toDisplayString(l.computePosition(i.hoverPoint)),1)])])]}),_:1})]),_:1},512),[[o.vShow,i.showHoverPoint]])])}const Ho=Q(_m,[["render",ah]]),kf="",ih={name:"DateTimePicker",props:{width:{type:Number,default:null},height:{type:Number,default:30},position:{type:String,default:"top"},bgClass:{type:String,default:""},locale:{type:String,default:"en"},style:{type:Object,default:{}},intervalHour:{type:Number,default:3},timeZone:{type:Number},dateTime:{type:String},dayAbout:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1}},emits:["dateTime","currentTimestamp","currentRealTime","minTimestamp","maxTimestamp"],data(){return{showDatePicker:!1,minDate:void 0,maxDate:void 0,minTimestamp:void 0,maxTimestamp:void 0,currentDate:void 0,currentTime:void 0,currentTimestamp:void 0,currentDateTimeZ:void 0,currentDateTime:void 0,currentRealTime:void 0,timer:null}},computed:{getStyle(){const e=this.width||220;if(this.position==="top")return{bottom:"40px",left:`-${(420-e)/2}px`};if(this.position==="bottom")return{top:"40px",left:`-${(420-e)/2}px`};if(this.position==="left")return{bottom:"-140px",left:"-428px"};if(this.position==="right")return{bottom:"-140px",right:"-428px"}},hourOptions(){const e=[];for(let t=0;t<24;t++)e.push(t<10?`0${t}:00`:`${t}:00`);return e.filter((t,a)=>(a-this.timeZone)%this.intervalHour===0)},timeZoneNames(){return C.tz.names()},timeZoneName(){var e;return(e=this.timeZoneNames.filter(t=>C.tz(C(),t).utcOffset()===this.timeZone*60))==null?void 0:e[0]},utcTimeZoneName(){return"Africa/Abidjan"},localTimeZoneName(){return Intl.DateTimeFormat().resolvedOptions().timeZone||"Asia/Shanghai"}},watch:{timeZone:{handler(e,t){e!==t&&(this.handleResetDateTime(this.dateTime),this.handleResetMinMax())}},dateTime:{handler(e,t){e&&this.handleResetDateTime(this.dateTime)},immediate:!0},currentTimestamp:{handler(){this.currentDateTimeZ=C(this.currentTimestamp).utc().format("yyyy-MM-DD HH:00[Z]"),this.$emit("dateTime",this.currentDateTimeZ),this.$emit("currentTimestamp",this.currentTimestamp),this.currentDateTime=`${C.tz(this.currentTimestamp,this.timeZoneName).clone().format("yyyy-MM-DD : HH:00")}`},immediate:!0},currentRealTime:{handler(e,t){e!==t&&this.$emit("currentRealTime",this.currentRealTime)}}},mounted(){this.timer=setInterval(()=>{this.currentRealTime=`${C.tz(C().unix()*1e3,this.timeZoneName).clone().format("HH:mm")}`},100),document.addEventListener("click",this.handleClickOutside)},unmounted(){clearInterval(this.timer),this.handleCancelDate(),document.removeEventListener("click",this.handleClickOutside)},methods:{handleReset(){this.handleResetDateTime(),this.handleResetMinMax()},handleResetDateTime(e){var i;const t=C(e).utc().date(),a=Math.ceil(C(e).utc().hour()/this.intervalHour)*this.intervalHour;this.currentTimestamp=((i=C(e))==null?void 0:i.utc().set({date:t,hour:a,minute:0,second:0,millisecond:0}).unix())*1e3;const r=C.tz(this.currentTimestamp,this.timeZoneName).clone();this.currentDate=r.clone().format("YYYY-MM-DD"),this.currentTime=r.clone().format("HH:00"),this.currentDateTime=`${C.tz(this.currentTimestamp,this.timeZoneName).clone().format("yyyy-MM-DD : HH:00")}`,this.currentRealTime=`${C.tz(C().unix()*1e3,this.timeZoneName).clone().format("HH:mm")}`},handleResetMinMax(){var i,l,n,c,s;if(!this.dayAbout.h||!this.dayAbout.f)return;const e=C().utc().date(),t=Math.ceil(C().utc().hour()/this.intervalHour)*this.intervalHour,a=((i=C())==null?void 0:i.utc().set({date:e,hour:t,minute:0,second:0,millisecond:0}).unix())*1e3,r=C.tz(a,this.timeZoneName).clone();this.minDate=r.clone().add(this.dayAbout.h,"day").format("yyyy-MM-DD"),this.maxDate=r.clone().add(this.dayAbout.f,"day").format("yyyy-MM-DD"),this.minTimestamp=((n=(l=C())==null?void 0:l.utc())==null?void 0:n.set({date:e+this.dayAbout.h,hour:0,minute:0,second:0,millisecond:0}).unix())*1e3,this.maxTimestamp=((s=(c=C())==null?void 0:c.utc())==null?void 0:s.set({date:e+this.dayAbout.f,hour:0,minute:0,second:0,millisecond:0}).unix())*1e3,this.$emit("minTimestamp",this.minTimestamp),this.$emit("maxTimestamp",this.maxTimestamp)},handleOpenDatePicker(){this.disabled||(this.showDatePicker=!this.showDatePicker)},handleUpdateMonth(e){const t=e||C.tz(this.currentTimestamp,this.timeZoneName).clone().month(),a=this.locale==="en"?C.tz(this.currentTimestamp,this.timeZoneName).set({month:t}).clone().format("MMM"):C.tz(this.currentTimestamp,this.timeZoneName).set({month:t}).clone().format("M月");this.$nextTick(()=>{const r=document.querySelector(".v-date-picker-controls__month-btn");r.innerText=a})},handleConfirmDate(){const e=C(this.currentDate).format("yyyy-MM-DD"),t=this.currentTime,a=`${e} ${t}`,r=C.tz(a,"YYYY-MM-DD HH:00",this.timeZoneName).clone().tz(this.localTimeZoneName);this.currentTimestamp=r.unix()*1e3,this.showDatePicker=!1},handleCancelDate(){this.showDatePicker=!1;const e=C.tz(this.currentTimestamp,this.timeZoneName).clone();this.currentDate=e.clone().format("YYYY-MM-DD"),this.currentTime=e.clone().format("HH:00")},handleClickOutside(e){const t=this.$refs.idmGl4Timepicker;t&&!t.contains(e.target)&&(this.showDatePicker=!1)}}},rh={class:"idm-gl4-time-picker",ref:"idmGl4Timepicker"},lh={class:"pa-0",style:{width:"320px"}},nh={class:"h-100 pa-0 d-flex flex-column justify-start align-center",style:{width:"100px"}},sh={class:"d-flex justify-center align-center text-body-2",style:{height:"44px"}};function ch(e,t,a,r,i,l){const n=o.resolveComponent("VDatePicker"),c=o.resolveComponent("VDivider"),s=o.resolveComponent("VListItemTitle"),d=o.resolveComponent("VListItem"),m=o.resolveComponent("VList"),g=o.resolveComponent("VCardText"),u=o.resolveComponent("VBtn"),y=o.resolveComponent("VCardActions"),f=o.resolveComponent("VCard");return o.openBlock(),o.createElementBlock("div",rh,[o.createElementVNode("div",{style:o.normalizeStyle({height:a.height+"px",width:a.width?a.width+"px":"auto"}),class:o.normalizeClass([[a.bgClass,{"cursor-pointer":!a.disabled}],"rounded text-body-1 btn-border-1 btn-bg-1 d-flex align-center justify-center px-2"]),onClick:t[0]||(t[0]=(...h)=>l.handleOpenDatePicker&&l.handleOpenDatePicker(...h))},o.toDisplayString(i.currentDateTime)+" | UTC "+o.toDisplayString(a.timeZone<0?a.timeZone:"+"+a.timeZone),7),i.showDatePicker?(o.openBlock(),o.createBlock(f,{key:0,class:"card-box d-flex flex-column border elevation-12",style:o.normalizeStyle(l.getStyle)},{default:o.withCtx(()=>[o.createVNode(g,{class:"w-100 flex-1-1-0 d-flex pa-0 text-body-1"},{default:o.withCtx(()=>[o.createElementVNode("div",lh,[o.createVNode(n,{modelValue:i.currentDate,"onUpdate:modelValue":t[1]||(t[1]=h=>i.currentDate=h),min:i.minDate,max:i.maxDate,"weekday-format":"narrow",color:"primary",density:"compact",class:"w-100","hide-header":""},null,8,["modelValue","min","max"])]),o.createVNode(c,{class:"h-100",vertical:""}),o.createElementVNode("div",nh,[o.createElementVNode("div",sh,o.toDisplayString(e.$t("time.time")),1),o.createVNode(m,{class:"pa-0 flex-1-1-0 scroll"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.hourOptions,(h,p)=>(o.openBlock(),o.createBlock(d,{key:p,value:h,color:"primary",active:i.currentTime===h,rounded:"",height:"26","min-height":"26",class:"rounded-xl",variant:i.currentTime===h?"flat":"text"},{default:o.withCtx(()=>[o.createVNode(s,{class:"text-body-2 font-weight-600 text-center",onClick:w=>i.currentTime=h},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(h),1)]),_:2},1032,["onClick"])]),_:2},1032,["value","active","variant"]))),128))]),_:1})])]),_:1}),o.createVNode(c),o.createVNode(y,{class:"w-100 d-flex justify-end align-center px-4 ga-4",style:{height:"50px"}},{default:o.withCtx(()=>[o.createVNode(u,{size:"small",variant:"tonal",class:"text-none text-body-1 px-4",onClick:l.handleCancelDate},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("actions.cancel")),1)]),_:1},8,["onClick"]),o.createVNode(u,{size:"small",variant:"flat",color:"primary",class:"text-none text-body-1 px-4",onClick:l.handleConfirmDate},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("actions.confirm")),1)]),_:1},8,["onClick"])]),_:1})]),_:1},8,["style"])):o.createCommentVNode("",!0)],512)}const qe=Q(ih,[["render",ch]]),_f="",mh={name:"IdmPoint",components:{DateTimePicker:qe},props:{simple:{type:Boolean,default:!1},isLogin:{type:Boolean,default:!1},token:{type:String},defaultMeteoToken:{type:String},theme:{type:String,default:"zh"},map:{type:Object},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}},gateway:{type:String},timeZone:{type:Number},forecastModel:{type:String},realTime:{type:String},followList:{type:Array}},emits:["meteoMore","follow","cancelFollow","login"],data(){return{right:10,toggle:!1,showForm:!1,showMeteo:!1,loading:!1,form:{lng:void 0,lngDegree:void 0,lngMinute:void 0,lngDirection:"E",lat:void 0,latDegree:void 0,latMinute:void 0,latDirection:"N",dateTime:void 0,forecastModel:""},formRules:{lngDegree:[e=>e!=null&&e!==""||"required",e=>/^\d{1,3}$/.test(e)||"number",e=>parseInt(e)>=0&&parseInt(e)<=180||"0 ~ 180"],lngMinute:[e=>e===void 0||e===null&&e===""||/^\d{1,2}(\.\d+)?$/.test(e)||"number",e=>e===void 0||e===null&&e===""||parseInt(e)>=0&&parseInt(e)<=59||"0 ~ 59"],latDegree:[e=>e!=null&&e!==""||"required",e=>/^\d{1,2}$/.test(e)||"number",e=>parseInt(e)>=0&&parseInt(e)<=90||"0 ~ 90"],latMinute:[e=>e===void 0||e===null&&e===""||/^\d{1,2}(\.\d+)?$/.test(e)||"number",e=>e===void 0||e===null&&e===""||parseInt(e)>=0&&parseInt(e)<=59||"0 ~ 59"]},meteoData:void 0,currentHourData:{},positionOffset:void 0,positionGmt:void 0,positionMarker:void 0,meteoInfoMarker:void 0}},computed:{timeZoneNames(){return C.tz.names()},timeZoneName(){var e;return(e=this.timeZoneNames.filter(t=>C.tz(C(),t).utcOffset()===this.timeZone*60))==null?void 0:e[0]},computedTzTime(){return e=>C.tz(C(e),this.timeZoneName).clone().format("YYYY-MM-DD HHmm")+" (UTC "+(this.timeZone>=0?"+":"")+this.timeZone+")"},computedLocalTime(){return e=>{var r,i,l;const t=Number((r=this.positionOffset)==null?void 0:r.slice(1,3))*(+(((i=this.positionOffset)==null?void 0:i.slice(1))==="+")?1:-1),a=(l=this.timeZoneNames.filter(n=>C.tz(C(),n).utcOffset()===t*60))==null?void 0:l[0];return e?C.tz(C(e),a).clone().format("YYYY-MM-DD HHmm")+" (UTC "+(t>=0?"+":"")+t+")":"-"}},computePosition(){return function(e){return!e||e.lng===null||e.lng===void 0||isNaN(e.lng)||e.lat===null||e.lat===void 0||isNaN(e.lat)?"-":X.LngLatHelper.lat2pretty(e==null?void 0:e.lat,2).pretty+" / "+X.LngLatHelper.lng2pretty(e==null?void 0:e.lng,2).pretty}},computeRoundPrecision(){return function(e,t=4){return e==null||isNaN(e)||isNaN(t)?"-":X.LngLatHelper.roundPrecision(e,t)}}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)})},immediate:!0},toggle:{handler(){this.toggle?this.showForm=!0:(this.showForm=!1,this.showMeteo=!1),this.map&&this.handleBind()},immediate:!0},map:{handler(){this.toggle=!1,this.map&&this.toggle&&this.handleBind()}},showForm:{handler(){this.showForm?this.$nextTick(()=>{var e;(e=this.$refs.spotForm)==null||e.resetValidation()}):this.handleCloseForm()}},showMeteo:{handler(){var e,t,a,r,i,l;this.showMeteo?((a=(t=(e=this.$parent)==null?void 0:e.$refs)==null?void 0:t.idmBottomBar)==null||a.handleToggle("spot",!0),this.simple&&this.$nextTick(()=>{var n,c;this.$parent.playerBottom=((c=(n=this.$refs.spotMeteo)==null?void 0:n.$el)==null?void 0:c.clientHeight)+10})):((l=(i=(r=this.$parent)==null?void 0:r.$refs)==null?void 0:i.idmBottomBar)==null||l.handleToggle("spot",!1),this.simple&&(this.$parent.playerBottom=30))}},realTime:{handler(){this.realTime&&(this.form.dateTime=this.realTime,this.showMeteo&&this.fetchData())}},forecastModel:{handler(){this.form.forecastModel=this.forecastModel},immediate:!0},"form.forecastModel":{handler(e,t){!e&&t&&(this.form.forecastModel=t==="GFS"?"ECMWF":"GFS")}}},methods:{handleMenuToggle(){this.isLogin?this.toggle=!this.toggle:this.$emit("login")},submitForm(){this.handleCloseMeteo(),this.$refs.spotForm.validate().then(async e=>{e!=null&&e.valid&&this.fetchData()})},cancelForm(){var e;(e=this.$refs.spotForm)==null||e.reset(),this.form={lng:void 0,lngDegree:void 0,lngMinute:void 0,lngDirection:"E",lat:void 0,latDegree:void 0,latMinute:void 0,latDirection:"N",dateTime:void 0,forecastModel:this.forecastModel}},handleCloseForm(){this.showForm=!1,this.cancelForm(),this.toggle=!1},async fetchData(){var a;if(isNaN(this.form.latDegree)||isNaN(this.form.latMinute)||isNaN(this.form.lngDegree)||isNaN(this.form.lngMinute))return!1;this.form.lat=(Number(this.form.latDegree??0)+Number(this.form.latMinute??0)/60)*(this.form.latDirection==="N"?1:-1),this.form.lng=(Number(this.form.lngDegree??0)+Number(this.form.lngMinute??0)/60)*(this.form.lngDirection==="E"?1:-1);const e=C();((a=C(this.realTime))==null?void 0:a.diff(e,"d",!0))>=0?await this.fetchForecastData(this.form):await this.fetchHistoryData(this.form)},async fetchForecastData(e){this.loading=!0,this.showMeteo=!0,this.form.lng=e.lng,this.form.lat=e.lat,this.form.followId=e.followId,this.handleDrawInfoMarker([e.lng,e.lat]),this.meteoData=[];const{weatherModels:t,marineModels:a}=Ae.Meteo2Assist.autoPickMeteoModel(e.forecastModel);let r={lat:e.lat,lng:e.lng,datetime:C(e.dateTime).utc().format(),forecastDays:e.day??3,weatherModels:t,marineModels:a};await ge.post(`${this.gateway}/api/arc/meteo2/spot/forecast`,r,{headers:{Authorization:this.token||this.defaultMeteoToken}}).then(i=>{(i==null?void 0:i.data.code)===0?(this.meteoData=i==null?void 0:i.data.data,this.meteoData.lng=e.lng,this.meteoData.lat=e.lat,this.initTableData(this.meteoData),this.loading=!1):this.loading=!1}).catch(()=>{this.loading=!1})},async fetchHistoryData(e){this.loading=!0,this.showMeteo=!0,this.form.lng=e.lng,this.form.lat=e.lat,this.form.followId=e.followId,this.handleDrawInfoMarker([e.lng,e.lat]),this.meteoData=[];const{weatherModels:t,marineModels:a}=Ae.Meteo2Assist.autoPickMeteoModel(e.forecastModel),r={lat:e.lat,lng:e.lng,datetime:C(e.dateTime).utc().format(),forecastDays:2,pastDays:1,weatherModels:t,marineModels:a};await ge.post(`${this.gateway}/api/arc/meteo2/spot/forecast`,r,{headers:{Authorization:this.token||this.defaultMeteoToken}}).then(i=>{(i==null?void 0:i.data.code)===0?(this.meteoData=i==null?void 0:i.data.data,this.meteoData.lng=e.lng,this.meteoData.lat=e.lat,this.initTableData(this.meteoData),this.loading=!1):this.loading=!1}).catch(()=>{this.loading=!1}),this.loading=!1},initTableData(e){var a,r,i,l,n,c,s,d,m,g,u,y,f,h,p,w,x,b,k,L,_,z,S,M,T,E,I,G,j,H,ae,N,A,F,Y,D,R,Z,P,K,re;this.currentHourData={},this.positionGmt=(r=(a=e==null?void 0:e.weather)==null?void 0:a[0])==null?void 0:r.timezone,this.positionOffset=(l=(i=e==null?void 0:e.weather)==null?void 0:i[0])==null?void 0:l.offset;const t=((n=Ae.Meteo2Assist.pickHourly(e,C(this.form.dateTime)))==null?void 0:n[0])||{};this.currentHourData.utc=t.utc,this.currentHourData.lat=e.lat,this.currentHourData.lng=e.lng,this.currentHourData.temp=this.computeRoundPrecision((c=t==null?void 0:t.weather)==null?void 0:c.temp,0)??"-",this.currentHourData.precipProbability=this.computeRoundPrecision((d=(s=t==null?void 0:t.weather)==null?void 0:s.precip)==null?void 0:d.probability,0)??"-",this.currentHourData.precip1h=this.computeRoundPrecision((g=(m=t==null?void 0:t.weather)==null?void 0:m.precip)==null?void 0:g.sum,0)??"-",this.currentHourData.visibility=this.computeRoundPrecision((u=t==null?void 0:t.weather)==null?void 0:u.visibility,0)??"-",this.currentHourData.windSpeed=this.computeRoundPrecision((f=(y=t==null?void 0:t.weather)==null?void 0:y.wind)==null?void 0:f.kts,1)??"-",this.currentHourData.windDir=((p=(h=t==null?void 0:t.weather)==null?void 0:h.wind)==null?void 0:p.direction)??"-",this.currentHourData.windLevel=this.computeRoundPrecision((x=(w=t==null?void 0:t.weather)==null?void 0:w.wind)==null?void 0:x.scale,0)??"-",this.currentHourData.windGust=this.computeRoundPrecision((k=(b=t==null?void 0:t.weather)==null?void 0:b.wind)==null?void 0:k.gusts,1)??"-",this.currentHourData.sigwaveHeight=this.computeRoundPrecision((_=(L=t==null?void 0:t.wave)==null?void 0:L.sig)==null?void 0:_.height,1)??"-",this.currentHourData.sigwaveDir=(S=(z=t==null?void 0:t.wave)==null?void 0:z.sig)==null?void 0:S.direction,this.currentHourData.sigwavePeriod=this.computeRoundPrecision((T=(M=t==null?void 0:t.wave)==null?void 0:M.sig)==null?void 0:T.period,1)??"-",this.currentHourData.windwaveHeight=this.computeRoundPrecision((I=(E=t==null?void 0:t.wave)==null?void 0:E.wd)==null?void 0:I.height,1)??"-",this.currentHourData.windwaveDir=(j=(G=t==null?void 0:t.wave)==null?void 0:G.wd)==null?void 0:j.direction,this.currentHourData.windwavePeriod=this.computeRoundPrecision((ae=(H=t==null?void 0:t.wave)==null?void 0:H.wd)==null?void 0:ae.period,1)??"-",this.currentHourData.swellHeight=this.computeRoundPrecision((A=(N=t==null?void 0:t.wave)==null?void 0:N.swell)==null?void 0:A.height,1)??"-",this.currentHourData.swellDir=(Y=(F=t==null?void 0:t.wave)==null?void 0:F.swell)==null?void 0:Y.direction,this.currentHourData.swellPeriod=this.computeRoundPrecision((R=(D=t==null?void 0:t.wave)==null?void 0:D.swell)==null?void 0:R.period,1)??"-",this.currentHourData.currentSpeed=this.computeRoundPrecision((Z=t==null?void 0:t.current)==null?void 0:Z.speed,1)??"-",this.currentHourData.currentDir=(P=t==null?void 0:t.current)==null?void 0:P.direction,this.currentHourData.currentSpeed=this.computeRoundPrecision((K=t==null?void 0:t.current)==null?void 0:K.speed,1)??"-",this.currentHourData.seaLevel=this.computeRoundPrecision(t==null?void 0:t.height,1)??"-",this.currentHourData.seaTemp=this.computeRoundPrecision(t==null?void 0:t.sst,0)??"-",this.currentHourData.weatherUrls=(re=t==null?void 0:t.weather)==null?void 0:re.url},handleBind(){var e,t;this.toggle?((e=this.map)==null||e.on("click",this.handleClick),this.map&&(this.map.getCanvas().style.cursor="crosshair")):((t=this.map)==null||t.off("click",this.handleClick),this.handleCloseMeteo(),this.map&&(this.map.getCanvas().style.cursor="grab"))},handleClick(e){if(e.originalEvent.stopPropagation(),e.originalEvent.target.className==="mapboxgl-canvas")this.handleGetPosition(e.lngLat),this.$nextTick(()=>{this.fetchData()});else return!1},handleGetPosition(e){if(isNaN(e.lat)||isNaN(e.lng))return!1;this.form.latDegree=Number(X.LngLatHelper.lat2pretty(e.lat).degree),this.form.latMinute=Number(X.LngLatHelper.lat2pretty(e.lat).minute),this.form.latDirection=X.LngLatHelper.lat2pretty(e.lat).direction,this.form.lngDegree=Number(X.LngLatHelper.lng2pretty(e.lng).degree),this.form.lngMinute=Number(X.LngLatHelper.lng2pretty(e.lng).minute),this.form.lngDirection=X.LngLatHelper.lng2pretty(e.lng).direction},handleDrawInfoMarker(e){this.drawPositionMarker(e),this.simple||this.drawMeteoInfoMarker(e)},drawPositionMarker(e){e&&(this.map.flyTo({center:e,duration:300}),this.$nextTick(()=>{var a,r;(a=this.positionMarker)==null||a.remove();const t=(r=document.getElementById("idm-position-icon"))==null?void 0:r.cloneNode(!0);this.positionMarker=new _e.Marker(t).setLngLat(e).setOffset([0,-15]).addTo(this.map)}))},drawMeteoInfoMarker(e){this.$nextTick(()=>{var a;const t=document.getElementById("idm-gl4-spot-meteo");this.meteoInfoMarker?(a=this.meteoInfoMarker)==null||a.setLngLat(e):this.meteoInfoMarker=new _e.Marker(t).setLngLat(e).setOffset([0,-190]).addTo(this.map)})},handleMeteoMore(){this.form.forecastModel=this.forecastModel,this.$emit("meteoMore",this.form)},handleCloseMeteo(){this.showMeteo=!1,this.$nextTick(()=>{var e,t;(e=this.positionMarker)==null||e.remove(),this.positionMarker=void 0,(t=this.meteoInfoMarker)==null||t.remove(),this.meteoInfoMarker=void 0})},handleFollow(){this.$emit("follow",this.form)},handleCancelFollow(){var t,a,r;const e=((t=this.form)==null?void 0:t.followId)||((r=(a=this.followList)==null?void 0:a.find(i=>{var l,n;return(i==null?void 0:i.id)===this.form.followId||((l=i==null?void 0:i.coordinate)==null?void 0:l.lng)===this.form.lng&&((n=i==null?void 0:i.coordinate)==null?void 0:n.lat)===this.form.lat}))==null?void 0:r.id);this.$emit("cancelFollow",e)}}},dh={class:"idm-gl4-spot"},hh={class:"d-flex justify-start align-center"},ph={class:"text-h6 font-weight-600"},gh={class:"d-flex justify-start align-center ga-1 mb-1"},uh={class:"multi-color-icon","aria-hidden":"true"},fh=["xlink:href"],yh={class:"d-flex justify-start align-center ga-1 mb-1"},bh={class:"multi-color-icon","aria-hidden":"true"},wh=["xlink:href"],xh={class:"d-flex justify-start align-center ga-1 mb-1"},kh={class:"multi-color-icon","aria-hidden":"true"},_h=["xlink:href"],vh={class:"d-flex justify-start align-center ga-1 mb-1"},zh={class:"multi-color-icon","aria-hidden":"true"},Lh=["xlink:href"],Ch={class:"d-flex justify-start align-center"},Sh={class:"mx-2"},Nh={class:"mx-0 py-2 d-flex align-center justify-start"},Ph={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},Mh={class:"pa-0 px-0"},Th={class:"mx-0 py-2 d-flex align-center justify-start"},Vh={cols:"9",class:"pa-0 px-0"},Eh={class:"mx-0 py-2 d-flex align-center justify-start"},Rh={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},Dh={style:{width:"150px"},class:"pa-0 text-left"},Bh={style:{width:"80px"},class:"pa-0 pr-2 text-right opacity-50"},Ih={cols:"3",class:"pa-0 px-0 text-left"},Ah={class:"mx-0 py-2 d-flex align-center justify-start"},Fh={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},Gh={style:{width:"150px"},class:"pa-0 text-left"},Wh={style:{width:"80px"},class:"pa-0 pr-2 text-right opacity-50"},Zh={cols:"3",class:"pa-0 text-left"},Oh={class:"mx-0 py-2 d-flex align-center justify-start"},jh={style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},Xh={style:{width:"150px"},class:"pa-0 text-left"},Hh={style:{width:"80px"},class:"pa-0 pr-2 text-right opacity-50"},Yh={class:"pa-0 text-left"},Uh={class:"d-flex justify-space-between align-center"},Jh={class:"d-flex justify-start align-center"},$h={class:"mx-1"},Kh={class:"d-flex justify-end align-center"},qh={class:"mx-0 py-1 d-flex align-center justify-start"},Qh={style:{width:"60px"},class:"pa-0 pr-2 text-right opacity-50"},ep={class:"pa-0 px-0"},tp={class:"mx-0 py-1 d-flex align-center justify-start"},op={class:"pa-0 px-0"},ap={class:"gray-bg-2 mx-4 my-2 py-3 px-2 rounded text-font-13 d-flex align-center justify-space-between"},ip={class:"d-flex flex-column align-start justify-center ga-3"},rp={class:"text-label pr-2"},lp={class:"text-label pr-2"},np={class:"text-label pr-2"},sp={class:"d-flex flex-column align-start justify-center ga-3"},cp={class:"text-label pr-2"},mp={class:"text-label pr-2"},dp={class:"text-label pr-2"},hp={id:"idm-position-icon"},pp={class:"multi-color-icon",style:{height:"30px",width:"30px"},"aria-hidden":"true"},gp=["xlink:href"];function up(e,t,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VTooltip"),s=o.resolveComponent("VCardTitle"),d=o.resolveComponent("VDivider"),m=o.resolveComponent("VTextField"),g=o.resolveComponent("VCol"),u=o.resolveComponent("VRow"),y=o.resolveComponent("DateTimePicker"),f=o.resolveComponent("VBtnToggle"),h=o.resolveComponent("VCardText"),p=o.resolveComponent("VCardActions"),w=o.resolveComponent("VForm"),x=o.resolveComponent("VCard");return o.openBlock(),o.createElementBlock("div",dh,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+126+"px",right:i.right+"px"})},[o.createVNode(c,{text:e.$t("spot.spotsMeteo"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:b})=>[o.createVNode(n,o.mergeProps(b,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>t[8]||(t[8]=[o.createElementVNode("i",{class:"iconfont icon-a-Spotweather text-h4"},null,-1)])),_:2,__:[8]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4),i.showForm&&!a.simple?(o.openBlock(),o.createBlock(x,{key:0,class:"spot-form-card",style:o.normalizeStyle({top:a.top+a.paddingTop+126+"px",right:i.right+50+"px"})},{default:o.withCtx(()=>[o.createVNode(s,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>[o.createElementVNode("div",hh,[o.createElementVNode("div",ph,o.toDisplayString(e.$t("spot.spotWeather")),1)]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleCloseForm},{default:o.withCtx(()=>t[9]||(t[9]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[9]},8,["onClick"])]),_:1}),o.createVNode(d),o.createVNode(w,{ref:"spotForm",autocomplete:"off",class:"form-box",onSubmit:o.withModifiers(l.submitForm,["prevent"])},{default:o.withCtx(()=>[o.createVNode(h,{class:"text-body-1 py-1"},{default:o.withCtx(()=>[o.createElementVNode("div",gh,[(o.openBlock(),o.createElementBlock("svg",uh,[o.createElementVNode("use",{"xlink:href":`#icon-lng-${a.theme}`},null,8,fh)])),o.createElementVNode("div",null,o.toDisplayString(e.$t("spot.lat")),1)]),o.createVNode(u,{class:"ma-0"},{default:o.withCtx(()=>[o.createVNode(g,{cols:"4",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.latDegree,"onUpdate:modelValue":t[0]||(t[0]=b=>i.form.latDegree=b),rules:i.formRules.latDegree,label:"",density:"compact",variant:"outlined",height:"32px","min-height":"32px",required:"",dense:"",class:"text-body-1 input-btn-bg-1"},null,8,["modelValue","rules"]),t[10]||(t[10]=o.createElementVNode("span",{class:"px-1"},"°",-1))]),_:1,__:[10]}),o.createVNode(g,{cols:"6",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.latMinute,"onUpdate:modelValue":t[1]||(t[1]=b=>i.form.latMinute=b),rules:i.formRules.latMinute,label:"",density:"compact",variant:"outlined",class:"text-body-1 input-btn-bg-1",required:"",dense:""},null,8,["modelValue","rules"]),t[11]||(t[11]=o.createElementVNode("span",{class:"px-1"},"'",-1))]),_:1,__:[11]}),o.createVNode(g,{cols:"2",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(n,{variant:"outlined",density:"compact",width:"32","min-width":"32",height:"32",class:"text-body-1 btn-bg-1",style:{border:"1px solid rgba(var(--v-theme-on-surface), 0.38)"},onClick:t[2]||(t[2]=b=>i.form.latDirection=i.form.latDirection==="N"?"S":"N")},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.form.latDirection),1)]),_:1})]),_:1})]),_:1}),o.createElementVNode("div",yh,[(o.openBlock(),o.createElementBlock("svg",bh,[o.createElementVNode("use",{"xlink:href":`#icon-lng-${a.theme}`},null,8,wh)])),o.createElementVNode("div",null,o.toDisplayString(e.$t("spot.lng")),1)]),o.createVNode(u,{class:"ma-0"},{default:o.withCtx(()=>[o.createVNode(g,{cols:"4",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.lngDegree,"onUpdate:modelValue":t[3]||(t[3]=b=>i.form.lngDegree=b),rules:i.formRules.lngDegree,density:"compact",variant:"outlined",class:"text-body-1 input-btn-bg-1",required:"",dense:""},null,8,["modelValue","rules"]),t[12]||(t[12]=o.createElementVNode("span",{class:"px-1"},"°",-1))]),_:1,__:[12]}),o.createVNode(g,{cols:"6",class:"pa-0 d-flex"},{default:o.withCtx(()=>[o.createVNode(m,{modelValue:i.form.lngMinute,"onUpdate:modelValue":t[4]||(t[4]=b=>i.form.lngMinute=b),rules:i.formRules.lngMinute,label:"",density:"compact",variant:"outlined",class:"text-body-1 input-btn-bg-1",required:"",dense:""},null,8,["modelValue","rules"]),t[13]||(t[13]=o.createElementVNode("span",{class:"px-1"},"'",-1))]),_:1,__:[13]}),o.createVNode(g,{cols:"2",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(n,{variant:"outlined",density:"compact",width:"32","min-width":"32",height:"32",class:"text-body-1 btn-bg-1",style:{border:"1px solid rgba(var(--v-theme-on-surface), 0.38)"},onClick:t[5]||(t[5]=b=>i.form.lngDirection=i.form.lngDirection==="E"?"W":"E")},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.form.lngDirection),1)]),_:1})]),_:1})]),_:1}),o.createElementVNode("div",xh,[(o.openBlock(),o.createElementBlock("svg",kh,[o.createElementVNode("use",{"xlink:href":`#icon-date-time-${a.theme}`},null,8,_h)])),o.createElementVNode("div",null,o.toDisplayString(e.$t("spot.dateTime")),1)]),o.createVNode(u,{class:"ma-0 mb-4"},{default:o.withCtx(()=>[o.createVNode(g,{cols:"12",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(y,o.mergeProps({"date-time":i.form.dateTime,"time-zone":a.timeZone},e.$attrs,{onDateTime:t[6]||(t[6]=b=>i.form.dateTime=b)}),null,16,["date-time","time-zone"])]),_:1})]),_:1}),o.createElementVNode("div",vh,[(o.openBlock(),o.createElementBlock("svg",zh,[o.createElementVNode("use",{"xlink:href":`#icon-forecast-model-${a.theme}`},null,8,Lh)])),o.createElementVNode("div",null,o.toDisplayString(e.$t("weather.forecastModel")),1)]),o.createVNode(u,{class:"ma-0 mb-2"},{default:o.withCtx(()=>[o.createVNode(g,{cols:"12",class:"pa-0"},{default:o.withCtx(()=>[o.createVNode(f,{modelValue:i.form.forecastModel,"onUpdate:modelValue":t[7]||(t[7]=b=>i.form.forecastModel=b),class:"w-100",rounded:"",height:"30",density:"compact",group:""},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"30",value:"GFS",class:o.normalizeClass(["text-none flex-1-1-0",i.form.forecastModel==="GFS"?"":"btn-border-1 btn-bg-1"]),color:i.form.forecastModel==="GFS"?"primary":"","base-color":""},{default:o.withCtx(()=>t[14]||(t[14]=[o.createTextVNode("NOAA",-1)])),_:1,__:[14]},8,["class","color"]),o.createVNode(n,{density:"compact",height:"30",class:o.normalizeClass(["text-none flex-1-1-0",i.form.forecastModel==="ECMWF"?"":"btn-border-1 btn-bg-1"]),color:i.form.forecastModel==="ECMWF"?"primary":"","base-color":"",value:"ECMWF"},{default:o.withCtx(()=>t[15]||(t[15]=[o.createTextVNode("ECMWF",-1)])),_:1,__:[15]},8,["class","color"])]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),o.createVNode(d),o.createVNode(p,{class:"d-flex justify-end align-center ga-4"},{default:o.withCtx(()=>[o.createVNode(n,{size:"small",variant:"outlined",class:"text-none text-body-1 btn-border-1 btn-bg-1",onClick:l.cancelForm},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("actions.clear")),1)]),_:1},8,["onClick"]),o.createVNode(n,{ref:"submitSpot",loading:i.loading,size:"small",variant:"flat",color:"primary",type:"submit",class:"text-none text-body-1"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("actions.confirm")),1)]),_:1},8,["loading"])]),_:1})]),_:1},8,["onSubmit"])]),_:1},8,["style"])):o.createCommentVNode("",!0),i.showMeteo&&!a.simple?(o.openBlock(),o.createBlock(x,{key:1,id:"idm-gl4-spot-meteo",class:"spot-meteo",style:{width:"490px","z-index":"9"}},{default:o.withCtx(()=>[o.createVNode(s,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>[o.createElementVNode("div",Ch,[t[16]||(t[16]=o.createElementVNode("i",{class:"iconfont icon-a-Spotweather text-h5 map-icon-aqua"},null,-1)),o.createElementVNode("div",Sh,o.toDisplayString(l.computePosition(i.form||i.currentHourData)),1)]),o.createVNode(n,{class:"mr-n2",density:"comfortable",icon:"",variant:"plain",onClick:o.withModifiers(l.handleCloseMeteo,["stop"])},{default:o.withCtx(()=>t[17]||(t[17]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[17]},8,["onClick"])]),_:1}),o.createVNode(d),o.createVNode(h,{class:"text-body-1 px-0 py-1"},{default:o.withCtx(()=>{var b,k;return[o.createElementVNode("div",Nh,[o.createElementVNode("div",Ph,o.toDisplayString(e.$t("time.time")),1),o.createElementVNode("div",Mh,o.toDisplayString(l.computedTzTime((b=i.currentHourData)==null?void 0:b.utc)),1)]),o.createElementVNode("div",Th,[t[18]||(t[18]=o.createElementVNode("div",{style:{width:"100px"},class:"pa-0 pr-2 text-right opacity-50"},"LT",-1)),o.createElementVNode("div",Vh,o.toDisplayString(l.computedLocalTime((k=i.currentHourData)==null?void 0:k.utc)),1)]),o.createElementVNode("div",Eh,[o.createElementVNode("div",Rh,o.toDisplayString(e.$t("weather.wind")),1),o.createElementVNode("div",Dh,o.toDisplayString(i.currentHourData.windDir??"-")+"/"+o.toDisplayString(i.currentHourData.windSpeed??"-")+"kts/BF"+o.toDisplayString(i.currentHourData.windLevel??"-"),1),o.createElementVNode("div",Bh,o.toDisplayString(e.$t("weather.sigWave")),1),o.createElementVNode("div",Ih,o.toDisplayString(i.currentHourData.sigwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.sigwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.sigwavePeriod??"-")+"s",1)]),o.createElementVNode("div",Ah,[o.createElementVNode("div",Fh,o.toDisplayString(e.$t("weather.windWave")),1),o.createElementVNode("div",Gh,o.toDisplayString(i.currentHourData.windwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.windwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.windwavePeriod??"-")+"s",1),o.createElementVNode("div",Wh,o.toDisplayString(e.$t("weather.swell")),1),o.createElementVNode("div",Zh,o.toDisplayString(i.currentHourData.swellDir??"-")+"/"+o.toDisplayString(i.currentHourData.swellHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.swellPeriod??"-")+"s",1)]),o.createElementVNode("div",Oh,[o.createElementVNode("div",jh,o.toDisplayString(e.$t("weather.current")),1),o.createElementVNode("div",Xh,o.toDisplayString(i.currentHourData.currentDir??"-")+"/"+o.toDisplayString(i.currentHourData.currentSpeed??"-")+"kts",1),o.createElementVNode("div",Hh,o.toDisplayString(e.$t("weather.visibility")),1),o.createElementVNode("div",Yh,o.toDisplayString(i.currentHourData.visibility??"-")+" nm",1)])]}),_:1}),o.createVNode(d),o.createVNode(p,{class:"d-flex justify-space-between align-center"},{default:o.withCtx(()=>{var b;return[(b=a.followList)!=null&&b.some(k=>{var L,_;return(k==null?void 0:k.id)===i.form.followId||((L=k==null?void 0:k.coordinate)==null?void 0:L.lng)===i.form.lng&&((_=k==null?void 0:k.coordinate)==null?void 0:_.lat)===i.form.lat})?(o.openBlock(),o.createBlock(n,{key:0,class:"text-none text-body-1",id:"idm-gl4-spot-meteo-follow",variant:"text",density:"compact",height:"32",onClick:o.withModifiers(l.handleCancelFollow,["stop"])},{prepend:o.withCtx(()=>t[19]||(t[19]=[o.createElementVNode("i",{class:"iconfont icon-yishoucang text-h6 text-warning"},null,-1)])),default:o.withCtx(()=>[o.createTextVNode(" "+o.toDisplayString(e.$t("actions.unfollow")),1)]),_:1},8,["onClick"])):(o.openBlock(),o.createBlock(n,{key:1,id:"idm-gl4-spot-meteo-unfollow",class:"text-none text-body-1",variant:"text",density:"compact",height:"32",onClick:o.withModifiers(l.handleFollow,["stop"])},{prepend:o.withCtx(()=>t[20]||(t[20]=[o.createElementVNode("i",{class:"iconfont icon-weishoucang text-h6"},null,-1)])),default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("actions.follow"))+" ",1)]),_:1},8,["onClick"])),o.createVNode(n,{height:"32",variant:"text",density:"compact","append-icon":"mdi-chevron-right",class:"text-none text-body-1",onClick:o.withModifiers(l.handleMeteoMore,["stop"])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.$t("spot.forecast")),1)]),_:1},8,["onClick"])]}),_:1})]),_:1})):o.createCommentVNode("",!0),i.showMeteo&&a.simple?(o.openBlock(),o.createBlock(x,{key:2,ref:"spotMeteo",class:"position-absolute bottom-0 rounded-t-4",style:{width:"100vw","z-index":"1001"}},{default:o.withCtx(()=>[o.createVNode(s,null,{default:o.withCtx(()=>{var b;return[o.createElementVNode("div",Uh,[o.createElementVNode("div",Jh,[t[21]||(t[21]=o.createElementVNode("i",{class:"iconfont icon-a-Spotweather text-h5 map-icon-aqua"},null,-1)),o.createElementVNode("div",$h,o.toDisplayString(l.computePosition(i.form||i.currentHourData)),1)]),o.createElementVNode("div",Kh,[(b=a.followList)!=null&&b.some(k=>{var L,_;return(k==null?void 0:k.id)===i.form.followId||((L=k==null?void 0:k.coordinate)==null?void 0:L.lng)===i.form.lng&&((_=k==null?void 0:k.coordinate)==null?void 0:_.lat)===i.form.lat})?(o.openBlock(),o.createBlock(n,{key:0,class:"text-none text-body-1 rounded-circle",variant:"text",density:"compact",height:"32",width:"28","min-width":"28",onClick:o.withModifiers(l.handleCancelFollow,["stop"])},{default:o.withCtx(()=>t[22]||(t[22]=[o.createElementVNode("i",{class:"iconfont icon-yishoucang text-h4 text-warning"},null,-1)])),_:1,__:[22]},8,["onClick"])):(o.openBlock(),o.createBlock(n,{key:1,class:"text-none text-body-1 rounded-circle",variant:"plain",density:"compact",height:"32",width:"28","min-width":"28",onClick:o.withModifiers(l.handleFollow,["stop"])},{default:o.withCtx(()=>t[23]||(t[23]=[o.createElementVNode("i",{class:"iconfont icon-weishoucang text-h4"},null,-1)])),_:1,__:[23]},8,["onClick"])),o.createVNode(n,{class:"mr-n2",density:"comfortable",icon:"",variant:"plain",onClick:o.withModifiers(l.handleCloseMeteo,["stop"])},{default:o.withCtx(()=>t[24]||(t[24]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[24]},8,["onClick"])])]),t[25]||(t[25]=o.createElementVNode("div",{class:"px-5 py-0 text-label text-body-1"},"Spot Weather",-1))]}),_:1,__:[25]}),o.createVNode(d),o.createVNode(h,{class:"text-body-1 px-0 py-2"},{default:o.withCtx(()=>{var b,k;return[o.createElementVNode("div",qh,[o.createElementVNode("div",Qh,o.toDisplayString(e.$t("time.time")),1),o.createElementVNode("div",ep,o.toDisplayString(l.computedTzTime((b=i.currentHourData)==null?void 0:b.utc)),1)]),o.createElementVNode("div",tp,[t[26]||(t[26]=o.createElementVNode("div",{style:{width:"60px"},class:"pa-0 pr-2 text-right opacity-50"},"LT",-1)),o.createElementVNode("div",op,o.toDisplayString(l.computedLocalTime((k=i.currentHourData)==null?void 0:k.utc)),1)]),o.createElementVNode("div",ap,[o.createElementVNode("div",ip,[o.createElementVNode("div",null,[o.createElementVNode("span",rp,o.toDisplayString(e.$t("weather.wind")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.windDir??"-")+"/"+o.toDisplayString(i.currentHourData.windSpeed??"-")+"kts/BF"+o.toDisplayString(i.currentHourData.windLevel??"-"),1)]),o.createElementVNode("div",null,[o.createElementVNode("span",lp,o.toDisplayString(e.$t("weather.sigWave")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.sigwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.sigwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.sigwavePeriod??"-")+"s",1)]),o.createElementVNode("div",null,[o.createElementVNode("span",np,o.toDisplayString(e.$t("weather.windWave")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.windwaveDir??"-")+"/"+o.toDisplayString(i.currentHourData.windwaveHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.windwavePeriod??"-")+"s",1)])]),o.createElementVNode("div",sp,[o.createElementVNode("div",null,[o.createElementVNode("span",cp,o.toDisplayString(e.$t("weather.swell")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.swellDir??"-")+"/"+o.toDisplayString(i.currentHourData.swellHeight??"-")+"m/"+o.toDisplayString(i.currentHourData.swellPeriod??"-")+"s",1)]),o.createElementVNode("div",null,[o.createElementVNode("span",mp,o.toDisplayString(e.$t("weather.current")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.currentDir??"-")+"/"+o.toDisplayString(i.currentHourData.currentSpeed??"-")+"kts",1)]),o.createElementVNode("div",null,[o.createElementVNode("span",dp,o.toDisplayString(e.$t("weather.visibility")),1),o.createElementVNode("span",null,o.toDisplayString(i.currentHourData.visibility??"-")+" nm",1)])])])]}),_:1})]),_:1},512)):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("div",hp,[(o.openBlock(),o.createElementBlock("svg",pp,[o.createElementVNode("use",{"xlink:href":`#icon-spot-${a.theme}`},null,8,gp)]))],512),[[o.vShow,i.showMeteo]])])}const fp=Q(mh,[["render",up]]),vf="",yp={name:"IdmMeasure",props:{simple:{type:Boolean,default:!1},map:{type:Object},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}}},setup(){return{Theme:be.useTheme()}},data(){return{right:10,toggle:!1,geojson:[],source:"measure-source",layer:"measure-layer",labelLayer:"measure-label-layer",sumLayer:"measure-suml-layer",tmpSource:"measure-tmp-source",tmpLayer:"measure-tmp-layer",tmpLabelLayer:"measure-tmp-label-layer",closeMarkers:{},pointMarkers:{},tipMarker:void 0,contextmenu:void 0,navigation:"RL",currentLineIndex:1}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var e;this.simple||(this.right=(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+10)})},immediate:!0},toggle:{handler(){var e,t,a;if(this.toggle)this.handleBind();else{(e=this.map)==null||e.getCanvas().removeEventListener("keydown",this.handleKeydown),(t=this.map)==null||t.off("mousemove",this.handleMove),(a=this.map)==null||a.off("dblclick",this.handleDblClick),this.map;let r=this.geojson.find(i=>!i.closed);r&&this.handleClear(r,!0),this.geojson=this.geojson.filter(i=>!!i.closed),r=J.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(r)}},immediate:!0},map:{handler(){this.map&&(this.toggle?this.handleBind():this.handleUnbind())}}},methods:{handleMenuToggle(){this.toggle=!this.toggle},handleBind(){var e,t,a,r,i;(e=this.map)==null||e.getCanvas().addEventListener("keydown",this.handleKeydown),(t=this.map)==null||t.on("mousemove",this.handleMove),(a=this.map)==null||a.on("dblclick",this.handleDblClick),(r=this.map)==null||r.on("click",this.handleClick),(i=this.map)==null||i.on("contextmenu",this.handleContextmenu),this.map&&(this.map.getCanvas().style.cursor="crosshair")},handleUnbind(){var e,t,a,r,i;(e=this.map)==null||e.getCanvas().removeEventListener("keydown",this.handleKeydown),(t=this.map)==null||t.off("mousemove",this.handleMove),(a=this.map)==null||a.off("dblclick",this.handleDblClick),(r=this.map)==null||r.off("click",this.handleClick),(i=this.map)==null||i.off("contextmenu",this.handleContextmenu);for(const l of this.geojson)this.handleClear(l,!0);this.geojson=[],this.map&&(this.map.getCanvas().style.cursor="grab")},handleKeydown(e){if(e.key==="Shift"){this.navigation=this.navigation==="RL"?"GC":"RL";const t=this.geojson.at(-1),a=t.features.filter(r=>r.geometry.type==="Point");a!=null&&a.length&&(a.at(-1).properties.mode=this.navigation),this.handleRender(t)}},handleDrag(e){var a,r,i,l,n,c,s,d,m,g;const t=(r=(a=e.target)==null?void 0:a._element)==null?void 0:r.id;if((t==null?void 0:t.split("-").length)===2){const u=this.geojson.filter(p=>p.id===t.split("-")[0])[0];this.pointMarkers[u.id].filter(p=>{var w;return((w=p._element)==null?void 0:w.id)===t})[0].setLngLat([(l=(i=e.target)==null?void 0:i._lngLat)==null?void 0:l.lng,(c=(n=e.target)==null?void 0:n._lngLat)==null?void 0:c.lat]);let f;u.features.forEach((p,w)=>{if(p.geometry.type==="Point"&&p.properties.id===t.split("-")[1]){f=w;return}});const h=u.features.filter(p=>p.geometry.type==="Point");this.handleTmpPointUpdate(u,h[f-1],{lng:(d=(s=e.target)==null?void 0:s._lngLat)==null?void 0:d.lng,lat:(g=(m=e.target)==null?void 0:m._lngLat)==null?void 0:g.lat,properties:h[f].properties},f===h.length-1?void 0:h[f+1])}},handleDragEnd(e){var a,r,i,l,n,c,s,d,m,g;const t=(r=(a=e.target)==null?void 0:a._element)==null?void 0:r.id;if((t==null?void 0:t.split("-").length)===2){const u=this.geojson.filter(h=>h.id===t.split("-")[0])[0];this.pointMarkers[u.id].filter(h=>{var p;return((p=h._element)==null?void 0:p.id)===t})[0].setLngLat([(l=(i=e.target)==null?void 0:i._lngLat)==null?void 0:l.lng,(c=(n=e.target)==null?void 0:n._lngLat)==null?void 0:c.lat]);const f=u.features.filter(h=>h.geometry.type==="Point"&&h.properties.id===t.split("-")[1])[0];f.geometry.coordinates=[(d=(s=e.target)==null?void 0:s._lngLat)==null?void 0:d.lng,(g=(m=e.target)==null?void 0:m._lngLat)==null?void 0:g.lat],u.features=u.features.filter(h=>h.geometry.type==="Point"),this.handlePointUpdate(u)}},handleContextmenu(e){var a,r,i,l;e.preventDefault(),(a=this.contextmenu)==null||a.remove();const t=(l=(i=(r=e.originalEvent)==null?void 0:r.target)==null?void 0:i.parentElement)==null?void 0:l.id;if((t==null?void 0:t.split("-").length)===2){const c=this.geojson.filter(s=>s.id===t.split("-")[0])[0].features.filter(s=>s.geometry.type==="Point");if(c.length>2&&c.filter(d=>d.properties.id===(t==null?void 0:t.split("-")[1]))[0]){const d=document.createElement("div");d.className="idm-gl4-measure-contextmenu-marker",d.innerHTML=`<span id="del-${t}" class="del-point">${$t("actions.detele")}</span>`,this.contextmenu=new _e.Marker(d).setOffset([24,0]).setLngLat([e.lngLat.lng,e.lngLat.lat]).addTo(this.map)}}},handleClick(e){var a,r,i,l,n,c;(a=this.contextmenu)==null||a.remove();const t=e.originalEvent.target.className;if(t==="marker-close"){const s=(i=(r=e.originalEvent)==null?void 0:r.srcElement)==null?void 0:i.id,d=this.geojson.filter(m=>m.id===s)[0];d&&this.handleClear(d,!0),this.geojson=this.geojson.filter(m=>m.id!==s),!this.toggle&&!((l=this.geojson)!=null&&l.some(m=>m.closed))&&this.handleUnbind()}else if(t==="del-point"){const s=(c=(n=e.originalEvent.target.id)==null?void 0:n.replace("del-",""))==null?void 0:c.split("-"),d=this.geojson.filter(m=>m.id===s[0])[0];d.features=d.features.filter(m=>m.geometry.type==="Point"&&m.properties.id!==s[1]),this.handlePointUpdate(d)}else if(t!=="marker-label"&&this.toggle){let s=this.geojson.at(-1);s||(s=J.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(s)),s.features=s.features.filter(m=>m.geometry.type==="Point");const d=J.feature({type:"Point",coordinates:[e.lngLat.lng,e.lngLat.lat]},{id:new Date().getTime().toString(),mode:this.navigation,sumLabel:"Start"});s.features.push(d),this.handlePointUpdate(s)}},handlePointUpdate(e){const t=e.features;if(t.length>1){let a=0;const r=[];for(let i=1;i<t.length;i++){const l=t[i-1],n=t[i],c=l.properties,s={lng:l.geometry.coordinates[0],lat:l.geometry.coordinates[1]},d={lng:n.geometry.coordinates[0],lat:n.geometry.coordinates[1]},m=X.LaneHelper.calculateDistance(s,d,c.mode==="RL",4),g=X.LaneHelper.calculateBearing(s,d,c.mode==="RL",2);a=X.LngLatHelper.roundPrecision(a+m,4);let u;c.mode==="RL"?u=X.LngLatHelper.convertToMonotonicLng([s,d]):u=X.LngLatHelper.convertToMonotonicLng(X.LaneHelper.interpolateCoordinates(s,d,200));const y=J.lineString(u.map(h=>[h.lng,h.lat]));y.properties.dist=m,y.properties.bearing=g,y.properties.total=a,y.properties.name="Line "+this.currentLineIndex,r.push(y);const f=t[i];f.properties.totalDist=X.LngLatHelper.roundPrecision((c.totalDist?c.totalDist:0)+m,4),f.properties.sumLabel=f.properties.totalDist+" nm"}t.push(...r),e.total=a}return this.handleRender(e),e},handleTmpPointUpdate(e,t,a,r){const i=J.featureCollection([]);let l,n;if(t){const s=t.properties,d={lng:t.geometry.coordinates[0],lat:t.geometry.coordinates[1]},m={lng:a.lng,lat:a.lat};l=X.LaneHelper.calculateDistance(d,m,s.mode==="RL",4),n=X.LaneHelper.calculateBearing(d,m,s.mode==="RL",2);let g;s.mode==="RL"?g=X.LngLatHelper.convertToMonotonicLng([d,m]):g=X.LngLatHelper.convertToMonotonicLng(X.LaneHelper.interpolateCoordinates(d,m,200));const u=J.lineString(g.map(y=>[y.lng,y.lat]));u.properties.dist=l,u.properties.bearing=n,i.features.push(u)}if(r){const s=a.properties,d=a,m={lng:r.geometry.coordinates[0],lat:r.geometry.coordinates[1]};l=X.LaneHelper.calculateDistance(d,m,s.mode==="RL",4),n=X.LaneHelper.calculateBearing(d,m,s.mode==="RL",2);let g;s.mode==="RL"?g=X.LngLatHelper.convertToMonotonicLng([d,m]):g=X.LngLatHelper.convertToMonotonicLng(X.LaneHelper.interpolateCoordinates(d,m,200));const u=J.lineString(g.map(y=>[y.lng,y.lat]));u.properties.dist=l,u.properties.bearing=n,i.features.push(u)}this.map.getSource(this.tmpSource)?this.map.getSource(this.tmpSource).setData(i):this.map.addSource(this.tmpSource,{type:"geojson",data:i}),this.map.getLayer(this.tmpLayer)||this.map.addLayer({id:this.tmpLayer,type:"line",source:this.tmpSource,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.Theme.current.value.colors["map-orange"],"line-width":2,"line-opacity":1,"line-dasharray":[3,2]}}),this.map.getLayer(this.tmpLabelLayer)||this.map.addLayer({id:this.tmpLabelLayer,type:"symbol",source:this.tmpSource,filter:["==","$type","LineString"],layout:{"symbol-placement":"line-center","text-field":"{dist} nm","text-rotation-alignment":"map","text-size":10,"text-offset":[0,-1]},paint:{"text-opacity":1,"text-color":this.Theme.current.value.colors["on-surface"]}});let c;if(r)c=`<div class="marker-label">${this.$t("measure.dragTips")}</div>`;else{const s=X.LngLatHelper.roundPrecision((e.total??0)+l,1);c=`<div class="marker-label">${this.$t("measure.totalDistance")}: <b>${s}</b>nm, ${this.$t("measure.bearing")}: <b>${n}</b>°</div><div class="marker-label"> ${this.$t("measure.mode")}${this.navigation==="RL"?"RL":"GC"}, ${this.$t("measure.switchTips")}</div><div class="marker-label">${this.$t("measure.clickTips")}</div>`}if(this.tipMarker)this.tipMarker._element.innerHTML=c,this.tipMarker.setLngLat([a.lng,a.lat]);else{const s=document.createElement("div");s.className="idm-gl4-measure-tip-marker",s.innerHTML=c,this.tipMarker=new _e.Marker(s).setOffset([140,0]).setLngLat([a.lng,a.lat]).addTo(this.map)}},handleMove(e){this.map.getCanvas().style.cursor="crosshair";let t=this.geojson.at(-1);t||(t=J.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(t));const a=t.features.filter(r=>r.geometry.type==="Point");a!=null&&a.length&&this.handleTmpPointUpdate(t,a.at(-1),{lng:e.lngLat.lng,lat:e.lngLat.lat})},handleDblClick(e){e.preventDefault();let t=this.geojson.at(-1);t.closed=!0,this.handleRender(t),t=J.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(t),this.currentLineIndex++},handleRender(e){var t;if((t=e==null?void 0:e.features)!=null&&t.length){const a=`${e.id}-${this.source}`,r=`${e.id}-${this.layer}`,i=`${e.id}-${this.labelLayer}`,l=`${e.id}-${this.sumLayer}`;this.map.getSource(a)?this.map.getSource(a).setData(e):this.map.addSource(a,{type:"geojson",data:e}),this.handleClear(e,!1),this.map.addLayer({id:r,type:"line",source:a,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.Theme.current.value.colors["map-orange"],"line-width":2}}),this.map.addLayer({id:i,type:"symbol",source:a,filter:["==","$type","LineString"],layout:{"symbol-placement":"line-center","text-field":"{dist} nm","text-rotation-alignment":"map","text-size":10,"text-offset":[0,-1]},paint:{"text-opacity":1,"text-color":this.Theme.current.value.colors["on-surface"]}}),this.map.addLayer({id:l,type:"symbol",source:a,filter:["==","$type","Point"],layout:{"text-field":"{sumLabel}","text-rotation-alignment":"map","text-size":12,"text-offset":[0,1.5]},paint:{"text-opacity":1,"text-color":this.Theme.current.value.colors["on-surface"]}});const n=e.features.filter(c=>c.geometry.type==="Point");for(const c of n){const s=document.createElement("div");s.id=`${e.id}-${c.properties.id}`,s.className=`${e.closed?"idm-gl4-measure-marker closed":"idm-gl4-measure-marker"}`,s.innerHTML='<div class="marker-circle"></div>';const d=new _e.Marker({element:s,draggable:!0,contextmenu:!0}).setLngLat(c.geometry.coordinates).addTo(this.map);d.on("drag",this.handleDrag),d.on("dragend",this.handleDragEnd),this.pointMarkers[e.id]?this.pointMarkers[e.id].push(d):this.pointMarkers[e.id]=[d]}if(e.closed){const c=n.at(-1),d=e.features.filter(g=>g.geometry.type==="LineString").at(-1),m=document.createElement("div");m.className="idm-gl4-measure-summary-marker",m.innerHTML=`<div class="marker-label">${d.properties.name}</div><div id="${e.id}" class="marker-close">X</div>`,this.closeMarkers[e.id]=new _e.Marker(m).setOffset([0,-30]).setLngLat(c.geometry.coordinates).addTo(this.map)}}},handleClear(e,t=!0){var n,c,s,d,m,g,u,y,f,h;const a=`${e.id}-${this.source}`,r=`${e.id}-${this.layer}`,i=`${e.id}-${this.labelLayer}`,l=`${e.id}-${this.sumLayer}`;(n=this.map)!=null&&n.getLayer(r)&&this.map.removeLayer(r),(c=this.map)!=null&&c.getLayer(i)&&this.map.removeLayer(i),(s=this.map)!=null&&s.getLayer(l)&&this.map.removeLayer(l),(d=this.map)!=null&&d.getLayer(this.tmpLayer)&&this.map.removeLayer(this.tmpLayer),(m=this.map)!=null&&m.getLayer(this.tmpLabelLayer)&&this.map.removeLayer(this.tmpLabelLayer),(g=this.closeMarkers[e.id])==null||g.remove(),this.closeMarkers[e.id]=void 0,(u=this.pointMarkers[e.id])==null||u.forEach(p=>{p==null||p.remove()}),this.pointMarkers[e.id]=[],(y=this.tipMarker)==null||y.remove(),this.tipMarker=void 0,t&&((f=this.map)!=null&&f.getSource(a))&&this.map.removeSource(a),t&&((h=this.map)!=null&&h.getSource(this.tmpSource))&&this.map.removeSource(this.tmpSource)}}},bp={class:"idm-gl4-measure"};function wp(e,t,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VTooltip");return o.openBlock(),o.createElementBlock("div",bp,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+166+"px",right:i.right+"px"})},[o.createVNode(c,{text:e.$t("measure.measure"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:s})=>[o.createVNode(n,o.mergeProps(s,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>t[0]||(t[0]=[o.createElementVNode("i",{class:"iconfont icon-a-Measuredistance text-h4"},null,-1)])),_:2,__:[0]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4)])}const xp=Q(yp,[["render",wp]]);var V={image:new Map,background:new Map,resource:new Map,defaultStyle:new Map,baseStyle:new Map,computedStyle:new WeakMap,font:new Set,session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map}};function kp(e="soft"){switch(V.session.__counterEpoch=(V.session.__counterEpoch||0)+1,e){case"auto":{V.session.styleMap=new Map,V.session.nodeMap=new Map;return}case"soft":{V.session.styleMap=new Map,V.session.nodeMap=new Map,V.session.styleCache=new WeakMap;return}case"full":return;case"disabled":{V.session.styleMap=new Map,V.session.nodeMap=new Map,V.session.styleCache=new WeakMap,V.computedStyle=new WeakMap,V.baseStyle=new Map,V.defaultStyle=new Map,V.image=new Map,V.background=new Map,V.resource=new Map,V.font=new Set;return}default:{V.session.styleMap=new Map,V.session.nodeMap=new Map,V.session.styleCache=new WeakMap;return}}}function Yo(e){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)return null;let a=t[2].trim();return a.startsWith("#")?null:a}function _p(e){if(!e||e==="none")return"";let t=e.replace(/translate[XY]?\([^)]*\)/g,"");return t=t.replace(/matrix\(([^)]+)\)/g,(a,r)=>{let i=r.split(",").map(l=>l.trim());return i.length!==6?`matrix(${r})`:(i[4]="0",i[5]="0",`matrix(${i.join(", ")})`)}),t=t.replace(/matrix3d\(([^)]+)\)/g,(a,r)=>{let i=r.split(",").map(l=>l.trim());return i.length!==16?`matrix3d(${r})`:(i[12]="0",i[13]="0",`matrix3d(${i.join(", ")})`)}),t.trim().replace(/\s{2,}/g," ")}function Ro(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}function vp(e="[snapDOM]",{ttlMs:t=5*6e4,maxEntries:a=12}={}){let r=new Map,i=0;function l(n,c,s){if(i>=a)return;let d=Date.now();(r.get(c)||0)>d||(r.set(c,d+t),i++,n==="warn"&&console&&console.warn?console.warn(`${e} ${s}`):console&&console.error&&console.error(`${e} ${s}`))}return{warnOnce(n,c){l("warn",n,c)},errorOnce(n,c){l("error",n,c)},reset(){r.clear(),i=0}}}var da=vp("[snapDOM]",{ttlMs:3*6e4,maxEntries:10}),Uo=new Map,Do=new Map;function zp(e){return/^data:|^blob:|^about:blank$/i.test(e)}function Lp(e,t){try{let a=typeof location<"u"&&location.href?location.href:"http://localhost/",r=t.includes("{url}")?t.split("{url}")[0]:t,i=new URL(r||".",a),l=new URL(e,a);if(l.origin===i.origin)return!0;let n=l.searchParams;if(n&&(n.has("url")||n.has("target")))return!0}catch{}return!1}function Cp(e,t){if(!t||zp(e)||Lp(e,t))return!1;try{let a=typeof location<"u"&&location.href?location.href:"http://localhost/",r=new URL(e,a);return typeof location<"u"?r.origin!==location.origin:!0}catch{return!!t}}function Sp(e,t){if(!t)return e;if(t.includes("{url}"))return t.replace("{urlRaw}",Ro(e)).replace("{url}",encodeURIComponent(e));if(/[?&]url=?$/.test(t))return`${t}${encodeURIComponent(e)}`;if(t.endsWith("?"))return`${t}url=${encodeURIComponent(e)}`;if(t.endsWith("/"))return`${t}${Ro(e)}`;let a=t.includes("?")?"&":"?";return`${t}${a}url=${encodeURIComponent(e)}`}function ha(e){return new Promise((t,a)=>{let r=new FileReader;r.onload=()=>t(String(r.result||"")),r.onerror=()=>a(new Error("read_failed")),r.readAsDataURL(e)})}function Np(e,t){return[t.as||"blob",t.timeout??3e3,t.useProxy||"",t.errorTTL??8e3,e].join("|")}async function Re(e,t={}){let a=t.as??"blob",r=t.timeout??3e3,i=t.useProxy||"",l=t.errorTTL??8e3,n=t.headers||{},c=!!t.silent;if(/^data:/i.test(e))try{if(a==="text")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1};if(a==="dataURL")return{ok:!0,data:String(e),status:200,url:e,fromCache:!1,mime:String(e).slice(5).split(";")[0]||""};let[,p="",w=""]=String(e).match(/^data:([^,]*),(.*)$/)||[],x=/;base64/i.test(p)?atob(w):decodeURIComponent(w),b=new Uint8Array([...x].map(L=>L.charCodeAt(0))),k=new Blob([b],{type:(p||"").split(";")[0]||""});return{ok:!0,data:k,status:200,url:e,fromCache:!1,mime:k.type||""}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"special_url_error"}}if(/^blob:/i.test(e))try{let p=await fetch(e);if(!p.ok)return{ok:!1,data:null,status:p.status,url:e,fromCache:!1,reason:"http_error"};let w=await p.blob(),x=w.type||p.headers.get("content-type")||"";return a==="dataURL"?{ok:!0,data:await ha(w),status:p.status,url:e,fromCache:!1,mime:x}:a==="text"?{ok:!0,data:await w.text(),status:p.status,url:e,fromCache:!1,mime:x}:{ok:!0,data:w,status:p.status,url:e,fromCache:!1,mime:x}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:"network"}}if(/^about:blank$/i.test(e))return a==="dataURL"?{ok:!0,data:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",status:200,url:e,fromCache:!1,mime:"image/png"}:{ok:!0,data:a==="text"?"":new Blob([]),status:200,url:e,fromCache:!1};let s=Np(e,{as:a,timeout:r,useProxy:i,errorTTL:l}),d=Do.get(s);if(d&&d.until>Date.now())return{...d.result,fromCache:!0};d&&Do.delete(s);let m=Uo.get(s);if(m)return m;let g=Cp(e,i)?Sp(e,i):e,u=t.credentials;if(!u)try{let p=typeof location<"u"&&location.href?location.href:"http://localhost/",w=new URL(e,p);u=typeof location<"u"&&w.origin===location.origin?"include":"omit"}catch{u="omit"}let y=new AbortController,f=setTimeout(()=>y.abort("timeout"),r),h=(async()=>{try{let p=await fetch(g,{signal:y.signal,credentials:u,headers:n});if(!p.ok){let b={ok:!1,data:null,status:p.status,url:g,fromCache:!1,reason:"http_error"};if(l>0&&Do.set(s,{until:Date.now()+l,result:b}),!c){let k=`${p.status} ${p.statusText||""}`.trim();da.warnOnce(`http:${p.status}:${a}:${new URL(e,(location==null?void 0:location.href)??"http://localhost/").origin}`,`HTTP error ${k} while fetching ${a} ${e}`)}return t.onError&&t.onError(b),b}if(a==="text")return{ok:!0,data:await p.text(),status:p.status,url:g,fromCache:!1};let w=await p.blob(),x=w.type||p.headers.get("content-type")||"";return a==="dataURL"?{ok:!0,data:await ha(w),status:p.status,url:g,fromCache:!1,mime:x}:{ok:!0,data:w,status:p.status,url:g,fromCache:!1,mime:x}}catch(p){let w=p&&typeof p=="object"&&"name"in p&&p.name==="AbortError"?String(p.message||"").includes("timeout")?"timeout":"abort":"network",x={ok:!1,data:null,status:0,url:g,fromCache:!1,reason:w};if(!/^blob:/i.test(e)&&l>0&&Do.set(s,{until:Date.now()+l,result:x}),!c){let b=`${w}:${a}:${new URL(e,(location==null?void 0:location.href)??"http://localhost/").origin}`,k=w==="timeout"?`Timeout after ${r}ms. Consider increasing timeout or using a proxy for ${e}`:w==="abort"?`Request aborted while fetching ${a} ${e}`:`Network/CORS issue while fetching ${a} ${e}. A proxy may be required`;da.errorOnce(b,k)}return t.onError&&t.onError(x),x}finally{clearTimeout(f),Uo.delete(s)}})();return Uo.set(s,h),h}async function pa(e,t={}){if(/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(e)||e.trim()==="none")return e;let a=Yo(e);if(!a)return e;let r=Ro(a);if(V.background.has(r)){let i=V.background.get(r);return i?`url("${i}")`:"none"}try{let i=await Re(r,{as:"dataURL",useProxy:t.useProxy});return i.ok?(V.background.set(r,i.data),`url("${i.data}")`):(V.background.set(r,null),"none")}catch{return V.background.set(r,null),"none"}}var Pp=new Set(["meta","script","noscript","title","link","template"]),Jo=new Set(["meta","link","style","title","noscript","script","template","g","defs","use","marker","mask","clipPath","pattern","path","polygon","polyline","line","circle","ellipse","rect","filter","lineargradient","radialgradient","stop"]);function Mp(e){if(e=String(e).toLowerCase(),Jo.has(e)){let l={};return V.defaultStyle.set(e,l),l}if(V.defaultStyle.has(e))return V.defaultStyle.get(e);let t=document.getElementById("snapdom-sandbox");t||(t=document.createElement("div"),t.id="snapdom-sandbox",t.setAttribute("data-snapdom-sandbox","true"),t.setAttribute("aria-hidden","true"),t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.style.width="0px",t.style.height="0px",t.style.overflow="hidden",document.body.appendChild(t));let a=document.createElement(e);a.style.all="initial",t.appendChild(a);let r=getComputedStyle(a),i={};for(let l of r){if(ga(l))continue;let n=r.getPropertyValue(l);i[l]=n}return t.removeChild(a),V.defaultStyle.set(e,i),i}var Tp=/(?:^|-)(animation|transition)(?:-|$)/i,Vp=/^(--|view-timeline|scroll-timeline|animation-trigger|offset-|position-try|app-region|interactivity|overlay|view-transition|-webkit-locale|-webkit-user-(?:drag|modify)|-webkit-tap-highlight-color|-webkit-text-security)$/i,Ep=new Set(["cursor","pointer-events","touch-action","user-select","print-color-adjust","speak","reading-flow","reading-order","anchor-name","anchor-scope","container-name","container-type","timeline-scope"]);function ga(e){let t=String(e).toLowerCase();return!!(Ep.has(t)||Vp.test(t)||Tp.test(t))}function $o(e,t){if(t=String(t||"").toLowerCase(),Jo.has(t))return"";let a=[],r=Mp(t);for(let[i,l]of Object.entries(e)){if(ga(i))continue;let n=r[i];l&&l!==n&&a.push(`${i}:${l}`)}return a.sort(),a.join(";")}function Rp(e){let t=new Set;return e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(e.tagName&&t.add(e.tagName.toLowerCase()),typeof e.querySelectorAll=="function"&&e.querySelectorAll("*").forEach(a=>t.add(a.tagName.toLowerCase())),Array.from(t))}function Dp(e){let t=new Map;for(let r of e){let i=V.defaultStyle.get(r);if(!i)continue;let l=Object.entries(i).map(([n,c])=>`${n}:${c};`).sort().join("");l&&(t.has(l)||t.set(l,[]),t.get(l).push(r))}let a="";for(let[r,i]of t.entries())a+=`${i.join(",")} { ${r} }
218
218
  `;return a}function Bp(e){let t=Array.from(new Set(e.values())).filter(Boolean).sort(),a=new Map,r=1;for(let i of t)a.set(i,`c${r++}`);return a}function ua(e,t=null){if(!(e instanceof Element))return window.getComputedStyle(e,t);let a=V.computedStyle.get(e);if(a||(a=new Map,V.computedStyle.set(e,a)),!a.has(t)){let r=window.getComputedStyle(e,t);a.set(t,r)}return a.get(t)}function fa(e){let t={};for(let a of e)t[a]=e.getPropertyValue(a);return t}function ya(e){let t=[],a=0,r=0;for(let i=0;i<e.length;i++){let l=e[i];l==="("&&a++,l===")"&&a--,l===","&&a===0&&(t.push(e.slice(r,i).trim()),r=i+1)}return t.push(e.slice(r).trim()),t}var Ip=[/font\s*awesome/i,/material\s*icons/i,/ionicons/i,/glyphicons/i,/feather/i,/bootstrap\s*icons/i,/remix\s*icons/i,/heroicons/i,/layui/i,/lucide/i],Xe=Object.assign({materialIconsFilled:"https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2",materialIconsOutlined:"https://fonts.gstatic.com/s/materialiconsoutlined/v110/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2",materialIconsRound:"https://fonts.gstatic.com/s/materialiconsround/v109/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmPq_HTTw.woff2",materialIconsSharp:"https://fonts.gstatic.com/s/materialiconssharp/v110/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvRImcycg.woff2"},typeof window<"u"&&window.__SNAPDOM_ICON_FONTS__||{}),Ko=[];function Ap(e){let t=Array.isArray(e)?e:[e];for(let a of t)a instanceof RegExp?Ko.push(a):typeof a=="string"?Ko.push(new RegExp(a,"i")):console.warn("[snapdom] Ignored invalid iconFont value:",a)}function De(e){let t=typeof e=="string"?e:"",a=[...Ip,...Ko];for(let r of a)if(r instanceof RegExp&&r.test(t))return!0;return!!(/icon/i.test(t)||/glyph/i.test(t)||/symbols/i.test(t)||/feather/i.test(t)||/fontawesome/i.test(t))}function Fp(e=""){let t=String(e).toLowerCase();return/\bmaterial\s*icons\b/.test(t)||/\bmaterial\s*symbols\b/.test(t)}var ba=new Map;function Gp(e=""){let t=Object.create(null),a=String(e||""),r=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,i;for(;i=r.exec(a);)t[i[1].toUpperCase()]=Number(i[2]);return t}async function Wp(e,t,a){let r=String(e||""),i=r.toLowerCase(),l=String(t||"").toLowerCase();if(/\bmaterial\s*icons\b/.test(i)&&!/\bsymbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};if(!/\bmaterial\s*symbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};let n=a&&(a.FILL??a.fill),c="outlined";/\brounded\b/.test(l)||/\bround\b/.test(l)?c="rounded":/\bsharp\b/.test(l)?c="sharp":/\boutlined\b/.test(l)&&(c="outlined");let s=n===1,d=null;if(s&&(c==="outlined"&&Xe.materialIconsFilled?d={url:Xe.materialIconsFilled,alias:"snapdom-mi-filled"}:c==="rounded"&&Xe.materialIconsRound?d={url:Xe.materialIconsRound,alias:"snapdom-mi-round"}:c==="sharp"&&Xe.materialIconsSharp&&(d={url:Xe.materialIconsSharp,alias:"snapdom-mi-sharp"})),!d)return{familyForMeasure:r,familyForCanvas:r};if(!ba.has(d.alias))try{let g=new FontFace(d.alias,`url(${d.url})`,{style:"normal",weight:"400"});document.fonts.add(g),await g.load(),ba.set(d.alias,!0)}catch{return{familyForMeasure:r,familyForCanvas:r}}let m=`"${d.alias}"`;return{familyForMeasure:m,familyForCanvas:m}}async function Zp(e="Material Icons",t=24){try{await Promise.all([document.fonts.load(`400 ${t}px "${String(e).replace(/["']/g,"")}"`),document.fonts.ready])}catch{}}function Op(e){var i,l;let t=((i=e.getPropertyValue("-webkit-text-fill-color"))==null?void 0:i.trim())||"",a=/^transparent$/i.test(t)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(t);if(t&&!a&&t.toLowerCase()!=="currentcolor")return t;let r=(l=e.color)==null?void 0:l.trim();return r&&r!=="inherit"?r:"#000"}async function jp(e,{family:t="Material Icons",weight:a="normal",fontSize:r=32,color:i="#000",variation:l="",className:n=""}={}){let c=String(t||"").replace(/^['"]+|['"]+$/g,""),s=window.devicePixelRatio||1,d=Gp(l),{familyForMeasure:m,familyForCanvas:g}=await Wp(c,n,d);await Zp(g.replace(/^["']+|["']+$/g,""),r);let u=document.createElement("span");u.textContent=e,u.style.position="absolute",u.style.visibility="hidden",u.style.left="-99999px",u.style.whiteSpace="nowrap",u.style.fontFamily=m,u.style.fontWeight=String(a||"normal"),u.style.fontSize=`${r}px`,u.style.lineHeight="1",u.style.margin="0",u.style.padding="0",u.style.fontFeatureSettings="'liga' 1",u.style.fontVariantLigatures="normal",u.style.color=i,document.body.appendChild(u);let y=u.getBoundingClientRect(),f=Math.max(1,Math.ceil(y.width)),h=Math.max(1,Math.ceil(y.height));document.body.removeChild(u);let p=document.createElement("canvas");p.width=f*s,p.height=h*s;let w=p.getContext("2d");w.scale(s,s),w.font=`${a?`${a} `:""}${r}px ${g}`,w.textAlign="left",w.textBaseline="top",w.fillStyle=i;try{w.fontKerning="normal"}catch{}return w.fillText(e,0,0),{dataUrl:p.toDataURL(),width:f,height:h}}async function Xp(e,t){if(!(e instanceof Element))return 0;let a='.material-icons, [class*="material-symbols"]',r=Array.from(e.querySelectorAll(a)).filter(n=>n&&n.textContent&&n.textContent.trim());if(r.length===0)return 0;let i=t instanceof Element?Array.from(t.querySelectorAll(a)).filter(n=>n&&n.textContent&&n.textContent.trim()):[],l=0;for(let n=0;n<r.length;n++){let c=r[n],s=i[n]||null;try{let d=getComputedStyle(s||c),m=d.fontFamily||"Material Icons";if(!Fp(m))continue;let g=(s||c).textContent.trim();if(!g)continue;let u=parseInt(d.fontSize,10)||24,y=d.fontWeight&&d.fontWeight!=="normal"?d.fontWeight:"normal",f=Op(d),h=d.fontVariationSettings&&d.fontVariationSettings!=="normal"?d.fontVariationSettings:"",p=(s||c).className||"",{dataUrl:w,width:x,height:b}=await jp(g,{family:m,weight:y,fontSize:u,color:f,variation:h,className:p});c.textContent="";let k=c.ownerDocument.createElement("img");k.src=w,k.alt=g,k.style.height=`${u}px`,k.style.width=`${Math.max(1,Math.round(x/b*u))}px`,k.style.objectFit="contain",k.style.verticalAlign=getComputedStyle(c).verticalAlign||"baseline",c.appendChild(k),l++}catch{}}return l}async function Hp(e,t,a,r=32,i="#000"){t=t.replace(/^['"]+|['"]+$/g,"");let l=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let n=document.createElement("span");n.textContent=e,n.style.position="absolute",n.style.visibility="hidden",n.style.fontFamily=`"${t}"`,n.style.fontWeight=a||"normal",n.style.fontSize=`${r}px`,n.style.lineHeight="1",n.style.whiteSpace="nowrap",n.style.padding="0",n.style.margin="0",document.body.appendChild(n);let c=n.getBoundingClientRect(),s=Math.ceil(c.width),d=Math.ceil(c.height);document.body.removeChild(n);let m=document.createElement("canvas");m.width=Math.max(1,s*l),m.height=Math.max(1,d*l);let g=m.getContext("2d");return g.scale(l,l),g.font=a?`${a} ${r}px "${t}"`:`${r}px "${t}"`,g.textAlign="left",g.textBaseline="top",g.fillStyle=i,g.fillText(e,0,0),{dataUrl:m.toDataURL(),width:s,height:d}}var Yp=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","emoji","math","fangsong","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]);function Bo(e){if(!e)return"";for(let t of e.split(",")){let a=t.trim().replace(/^['"]+|['"]+$/g,"");if(a&&!Yp.has(a.toLowerCase()))return a}return""}function Io(e){let t=String(e??"400").trim().toLowerCase();if(t==="normal")return 400;if(t==="bold")return 700;let a=parseInt(t,10);return Number.isFinite(a)?Math.min(900,Math.max(100,a)):400}function Ao(e){let t=String(e??"normal").trim().toLowerCase();return t.startsWith("italic")?"italic":t.startsWith("oblique")?"oblique":"normal"}function Up(e){let t=String(e??"100%").match(/(\d+(?:\.\d+)?)\s*%/);return t?Math.max(50,Math.min(200,parseFloat(t[1]))):100}function Jp(e){let t=String(e||"400").trim(),a=t.match(/^(\d{2,3})\s+(\d{2,3})$/);if(a){let i=Io(a[1]),l=Io(a[2]);return{min:Math.min(i,l),max:Math.max(i,l)}}let r=Io(t);return{min:r,max:r}}function $p(e){let t=String(e||"normal").trim().toLowerCase();return t==="italic"?{kind:"italic"}:t.startsWith("oblique")?{kind:"oblique"}:{kind:"normal"}}function Kp(e){let t=String(e||"100%").trim(),a=t.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(a){let l=parseFloat(a[1]),n=parseFloat(a[2]);return{min:Math.min(l,n),max:Math.max(l,n)}}let r=t.match(/(\d+(?:\.\d+)?)\s*%/),i=r?parseFloat(r[1]):100;return{min:i,max:i}}function qp(e,t){if(!e)return!1;try{let a=new URL(e,location.href);if(a.origin===location.origin)return!0;let r=a.host.toLowerCase();if(["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","p.typekit.net","kit.fontawesome.com","use.fontawesome.com"].some(l=>r.endsWith(l)))return!0;let i=(a.pathname+a.search).toLowerCase();if(/\bfont(s)?\b/.test(i)||/\.woff2?(\b|$)/.test(i))return!0;for(let l of t){let n=l.toLowerCase().replace(/\s+/g,"+"),c=l.toLowerCase().replace(/\s+/g,"-");if(i.includes(n)||i.includes(c))return!0}return!1}catch{return!1}}function Qp(e){var a;let t=new Set;for(let r of e||[]){let i=(a=String(r).split("__")[0])==null?void 0:a.trim();i&&t.add(i)}return t}function wa(e,t){return e&&e.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(a,r,i)=>{let l=(i||"").trim();if(!l||/^data:|^blob:|^https?:|^file:|^about:/i.test(l))return a;let n=l;try{n=new URL(l,t||location.href).href}catch{}return`url("${n}")`})}var qo=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,Fo=4;async function eg(e,t,a){if(!e)return e;let r=new Set;function i(c,s){try{return new URL(c,s||location.href).href}catch{return c}}async function l(c,s,d=0){if(d>Fo)return console.warn(`[snapDOM] @import depth exceeded (${Fo}) at ${s}`),c;let m="",g=0,u;for(;u=qo.exec(c);){m+=c.slice(g,u.index),g=qo.lastIndex;let y=(u[2]||u[4]||"").trim(),f=i(y,s);if(r.has(f)){console.warn(`[snapDOM] Skipping circular @import: ${f}`);continue}r.add(f);let h="";try{let p=await Re(f,{as:"text",useProxy:a,silent:!0});p.ok&&typeof p.data=="string"&&(h=p.data)}catch{}h?(h=wa(h,f),h=await l(h,f,d+1),m+=`
219
219
  /* inlined: ${f} */
220
220
  ${h}