@idmwx/idmui-gl4 3.8.1 → 3.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-3VYIPD3A-7c3245c9.js → chunk-3VYIPD3A-03109a46.js} +1 -1
- package/dist/{chunk-ANSXOGKI-2015e9ff.js → chunk-ANSXOGKI-72f37f60.js} +1 -1
- package/dist/{chunk-T4JIPPZO-4cdcfb4a.js → chunk-T4JIPPZO-bfa83c91.js} +1 -1
- package/dist/{download-87732143.js → download-f1f9b65a.js} +3 -3
- package/dist/{index-28a4f6f9.js → index-0f297b00.js} +53 -27
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +2 -2
- package/dist/mapbox/src/components/other/index.vue.d.ts +9 -2
- package/dist/mapbox/src/components/weather/prmsl.vue.d.ts +14 -0
- package/dist/{rasterize-JS5G2XHH-c48564a9.js → rasterize-JS5G2XHH-6f31de44.js} +3 -3
- package/dist/{toBlob-09130b9b.js → toBlob-fed1c14a.js} +3 -3
- package/dist/{toCanvas-5845fed6.js → toCanvas-017719bc.js} +2 -2
- package/dist/{toImg-d29e4678.js → toImg-1ebb6a86.js} +3 -3
- package/package.json +1 -1
package/dist/index.umd.cjs
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<span style="display:inline-block; height: 8px;width: 8px;border-radius: 50%;background-color: ${l.color}"></span>
|
|
8
8
|
<span>${l.seriesName} : </span>
|
|
9
9
|
<strong>${l.value[1]}m</strong>
|
|
10
|
-
</div>`)}),r}},legend:{show:!0,right:20,top:0,itemWidth:30,data:["Height"],textStyle:{color:this.Theme.current.value.colors["on-surface"]}},grid:{top:40,left:10,right:10,bottom:30,containLabel:!0},xAxis:[{type:"category",data:this.xDate,boundaryGap:!0,axisTick:{alignWithLabel:!0,lineStyle:{color:this.Theme.current.value.colors["echart-axis"]}},axisLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["echart-axis"]}},axisLabel:{interval:"auto",margin:15,textStyle:{fontSize:12,color:this.Theme.current.value.colors["echart-axis"]}}}],yAxis:[{name:"(m)",show:!0,nameLocation:"end",position:"left",nameGap:15,splitNumber:5,splitLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["echart-split"]}},alignTicks:!0,axisLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["echart-axis"]}},axisLabel:{textStyle:{fontSize:12,color:this.Theme.current.value.colors["echart-axis"]}}}],series:[{name:"Height",type:"line",showSymbol:!0,yAxisIndex:0,lineStyle:{color:this.Theme.current.value.colors["map-perple"]},itemStyle:{color:this.Theme.current.value.colors["map-perple"]},data:this.echartData.height}]};t==null||t.setOption(e)},handleClose(){this.$emit("close")}}},es={class:"d-flex justify-space-between align-center"},ts={class:"d-flex justify-start text-h5 my-2"},os={class:"d-flex justify-start align-center text-h6 text-label ga-3"},as={class:"summary-box w-100"},is={class:"d-flex justify-space-between align-center py-2"},rs={class:"d-flex justify-center align-center text-h6 ga-2"},ls={class:"multi-color-icon","aria-hidden":"true"},ns=["xlink:href"],ss={class:"gray-bg-2 rounded d-flex flex-column ga-4 pa-4"},cs={class:"w-100 d-flex justify-start align-center"},ms={class:"w-30 text-label font-weight-400"},ds={class:"flex-1-1-0"},hs={class:"w-100 d-flex justify-start align-center"},ps={class:"w-30 text-label font-weight-400"},gs={class:"flex-1-1-0"},us={class:"w-100 d-flex justify-start align-center"},fs={class:"w-30 text-label font-weight-400"},ys={class:"flex-1-1-0"},bs={class:"table-box w-100 mt-2 mb-4 d-flex flex-column justify-start align-center"},ws={class:"w-100 d-flex justify-space-between align-center py-2"},xs={class:"d-flex justify-center align-center text-h6 ga-2"},ks={class:"multi-color-icon","aria-hidden":"true"},As=["xlink:href"],Ls={ref:"tideEchart",class:"w-100",style:{height:"244px"}},vs={"fixed-header":"",density:"compact",class:"w-100 tide-table bg-none"},Cs={class:"px-1 text-center text-label font-weight-400",width:"120"},zs={class:"px-1 text-center text-label font-weight-400",width:"120"},_s={class:"px-1 text-center text-label font-weight-400",width:"120"},Ss={class:"px-1 text-center"},Ps={class:"px-1 text-center"},Ns={class:"px-1 text-center"};function Ms(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),s=o.resolveComponent("VCardTitle"),c=o.resolveComponent("VDivider"),m=o.resolveComponent("VBtnToggle"),d=o.resolveComponent("VCard");return o.openBlock(),o.createBlock(d,{class:o.normalizeClass(["tide-detail-container d-flex flex-column justify-start align-center",a.simple?"page":"dialog"])},{default:o.withCtx(()=>{var u,f;return[o.createVNode(s,{class:"w-100"},{default:o.withCtx(()=>{var g;return[o.createElementVNode("div",es,[o.createElementVNode("div",ts,[o.createElementVNode("div",null,o.toDisplayString((g=a.station)==null?void 0:g.name),1)]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"",onClick:l.handleClose},{default:o.withCtx(()=>e[1]||(e[1]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[1]},8,["onClick"])]),o.createElementVNode("div",os,[o.createElementVNode("div",null,o.toDisplayString(t.$t("tide.tideStation")),1)])]}),_:1}),o.createVNode(c,{class:"w-100"}),o.createElementVNode("div",{class:o.normalizeClass(["w-100 pt-0 pb-0 overflow-y-auto scroll",a.simple?"px-3":"px-5"])},[o.createElementVNode("div",as,[o.createElementVNode("div",is,[o.createElementVNode("div",rs,[(o.openBlock(),o.createElementBlock("svg",ls,[o.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,ns)])),o.createElementVNode("div",null,o.toDisplayString(t.$t("detail.summary")),1)])]),o.createElementVNode("div",ss,[o.createElementVNode("div",cs,[o.createElementVNode("div",ms,o.toDisplayString(t.$t("tide.region")),1),o.createElementVNode("div",ds,o.toDisplayString(((u=a.station)==null?void 0:u.Country)??((f=a.station)==null?void 0:f.city)??"-"),1)]),o.createElementVNode("div",hs,[o.createElementVNode("div",ps,o.toDisplayString(t.$t("tide.position")),1),o.createElementVNode("div",gs,o.toDisplayString(l.computePosition(a.station)),1)]),o.createElementVNode("div",us,[o.createElementVNode("div",fs,o.toDisplayString(t.$t("time.localTime")),1),o.createElementVNode("div",ys,o.toDisplayString(l.computeLocalTime(a.realTime,a.station))+" "+o.toDisplayString(l.computeTimeOffset(a.station)),1)])])]),o.createElementVNode("div",bs,[o.createElementVNode("div",ws,[o.createElementVNode("div",xs,[(o.openBlock(),o.createElementBlock("svg",ks,[o.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,As)])),o.createElementVNode("div",null,o.toDisplayString(t.$t("tide.tideTimes")),1)]),e[2]||(e[2]=o.createElementVNode("div",{class:"text-body-2 text-success ga-2"},null,-1))]),o.createElementVNode("div",{class:o.normalizeClass(["w-100 gray-bg-2 rounded",a.simple?"pa-2":"pa-4 py-2"])},[o.createVNode(m,{modelValue:i.currentIndex,"onUpdate:modelValue":e[0]||(e[0]=g=>i.currentIndex=g),class:"w-100 d-flex justify-space-around align-center ga-0 mb-4",density:"compact",group:"",height:"26","min-height":"26",rounded:"1",mandatory:""},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.dateList,g=>(o.openBlock(),o.createBlock(n,{key:g.label,class:o.normalizeClass(["text-none text-body-1 flex-1-1-0",`bg-${g.index===i.currentIndex?"bg-primary":"gray-bg-2"}`]),density:"compact",color:"primary",height:"26",value:g.index},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(g.label),1)]),_:2},1032,["class","value"]))),128))]),_:1},8,["modelValue"]),o.createElementVNode("div",Ls,null,512),o.createElementVNode("table",vs,[o.createElementVNode("tbody",null,[o.createElementVNode("tr",null,[o.createElementVNode("th",Cs,o.toDisplayString(t.$t("tide.tide")),1),o.createElementVNode("th",zs,o.toDisplayString(t.$t("time.time"))+" ( LT ) ",1),o.createElementVNode("th",_s,o.toDisplayString(t.$t("tide.height"))+" ( m )",1)]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tideTableData,(g,p)=>{var h;return o.openBlock(),o.createElementBlock("tr",{key:p},[o.createElementVNode("td",Ss,o.toDisplayString(t.$t(`tide.${(h=g==null?void 0:g.type)==null?void 0:h.toLowerCase()}`))+" "+o.toDisplayString(t.$t("tide.tide")),1),o.createElementVNode("td",Ps,o.toDisplayString(l.computeLocalTime(g==null?void 0:g.date,a.station,"MM-DD HH:mm")),1),o.createElementVNode("td",Ns,o.toDisplayString((g==null?void 0:g.height)??"-")+" m",1)])}),128))])])],2)])],2)]}),_:1},8,["class"])}const Ts=K($n,[["render",Ms],["__scopeId","data-v-5c51381d"]]),q1="",Vs={name:"IdmTideStations",components:{TideDetail:Ts},props:{map:{type:Object},show:{type:Boolean},locale:{type:String},beforeLayer:{type:String}},data(){return{layer:"tide-stations",showInfo:!1,hoverStation:void 0,marker:null,showDetail:!1,station:void 0}},watch:{show:{handler(){var t,e,a,r,i,l;this.show?(this.handleRender(),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):(this.handleClear(),(r=this.map)==null||r.off("click",[this.layer],this.handleClick),(i=this.map)==null||i.off("mousemove",[this.layer],this.handleHover),(l=this.map)==null||l.off("mouseleave",[this.layer],this.handleLeave))},immediate:!0},locale:{handler(){this.show&&this.handleRender()},immediate:!0}},methods:{handleRender(){var t;(t=this.map)!=null&&t.getLayer(this.layer)&&(this.map.setLayoutProperty(this.layer,"visibility","visible"),this.map.setLayoutProperty(this.layer,"text-field",this.locale==="en"?"{Location_EN}":"{Location_CN}"))},handleClear(){var t;this.showInfo=!1,(t=this.map)!=null&&t.getLayer(this.layer)&&this.map.setLayoutProperty(this.layer,"visibility","none")},handleClick(t){const e=t.features[0];e.properties&&(this.station=e.properties,this.station.name=this.locale==="en"?e.properties.Location_EN:e.properties.Location_CN,this.station.lng=e.geometry.coordinates[0],this.station.lat=e.geometry.coordinates[1],this.showDetail=!0)},handleHover(t){var a,r;this.map.getCanvas().style.cursor="pointer";const e=t.features[0];if(e.properties){this.showInfo=!0,this.hoverStation=e.properties,this.hoverStation.name=this.locale==="en"?e.properties.Location_EN:e.properties.Location_CN,this.hoverStation.lng=e.geometry.coordinates[0],this.hoverStation.lat=e.geometry.coordinates[1],(a=this.marker)==null||a.remove();const i=(r=document.getElementById("idmTidalInfo"))==null?void 0:r.cloneNode(!0);this.marker=new pe.Marker(i).setLngLat([t.lngLat.lng,t.lngLat.lat]).setOffset([0,-60]).addTo(this.map)}},handleLeave(){var t;this.showInfo=!1,this.hoverStation={},(t=this.marker)==null||t.remove(),this.map.getCanvas().style.cursor="grab"},handleCloseDetail(){this.showDetail=!1}}},Es={class:"station-box d-flex flex-column justify-center align-start ga-1"},Rs={class:"d-flex justify-start align-center"},Ds={class:"d-flex justify-start align-center"},Bs={class:"text-label"};function Is(t,e,a,r,i,l){const n=o.resolveComponent("VCardText"),s=o.resolveComponent("VCard"),c=o.resolveComponent("TideDetail");return o.openBlock(),o.createElementBlock("div",null,[o.withDirectives(o.createVNode(s,{id:"idmTidalInfo"},{default:o.withCtx(()=>[o.createVNode(n,{class:"pr-8 text-body-1"},{default:o.withCtx(()=>{var m,d;return[o.createElementVNode("div",Es,[o.createElementVNode("div",Rs,o.toDisplayString(t.$t("tide.tideStation")),1),o.createElementVNode("div",Ds,[o.createElementVNode("label",Bs,o.toDisplayString((m=i.hoverStation)==null?void 0:m.name)+" , "+o.toDisplayString(((d=i.hoverStation)==null?void 0:d.Country)||"-"),1)])])]}),_:1})]),_:1},512),[[o.vShow,i.showInfo]]),i.showDetail?(o.openBlock(),o.createBlock(c,o.mergeProps({key:0,station:i.station},t.$attrs,{onClose:l.handleCloseDetail}),null,16,["station","onClose"])):o.createCommentVNode("",!0)])}const Fs=K(Vs,[["render",Is],["__scopeId","data-v-ad725d5e"]]),Gs={name:"IdmIceAreas",props:{map:{type:Object},show:{type:Boolean}},data(){return{lineLayer:"ice-area-line",fillLayer:"ice-area-fill"}},watch:{show:{handler(){this.show?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var t,e;(t=this.map)!=null&&t.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","visible"),(e=this.map)!=null&&e.getLayer(this.fillLayer)&&this.map.setLayoutProperty(this.fillLayer,"visibility","visible")},handleClear(){var t,e;(t=this.map)!=null&&t.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","none"),(e=this.map)!=null&&e.getLayer(this.fillLayer)&&this.map.setLayoutProperty(this.fillLayer,"visibility","none")}}};function js(t,e,a,r,i,l){return null}const Ws=K(Gs,[["render",js]]),$1="",Zs={name:"IdmLatLng",props:{simple:{type:Boolean,default:!1},map:{type:Object},show:{type:Boolean},mapFeather:{type:String},beforeLayer:{type:String},menuToggle:{type:Object}},data(){return{lngLat:{e:{lng:0,lat:0},lng:0,lat:0,str:""},source:"idm-lat-lng-source",layer:"idm-lat-lng-layer",labelLayer:"idm-lat-lng-label-layer",right:10}},computed:{lineColor(){return["satellite","dark"].includes(this.mapFeather)?"rgba(255, 255, 255, 0.3)":"rgba(0, 0, 0, 0.3)"},labelColor(){return["satellite","dark"].includes(this.mapFeather)?"rgba(255, 255, 255, 0.8)":"rgba(0, 0, 0, 0.5)"}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){var t;this.map&&((t=this.map)==null||t.on("mousemove",this.handleMouseMove))},immediate:!0},"menuToggle.v":{handler(){var t;this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10},immediate:!0},"lngLat.e":{handler(t){this.lngLat.lng=P.LngLatHelper.lng2pretty(t==null?void 0:t.lng,2).pretty,this.lngLat.lat=P.LngLatHelper.lat2pretty(t==null?void 0:t.lat,2).pretty,this.lngLat.str=`[${P.LngLatHelper.str2Lat(t==null?void 0:t.lat,4)}, ${P.LngLatHelper.str2Lng(t==null?void 0:t.lng,4)}]`},immediate:!0}},methods:{handleBind(){var t,e;this.show?((t=this.map)==null||t.on("zoomend",this.handleZoomEnd),this.handleRender()):(this.handleClear(),(e=this.map)==null||e.off("zoomend",this.handleZoomEnd))},handleMouseMove(t){this.lngLat.e=t.lngLat},handleComputeLatLngs(){var r;const t=(r=this.map)==null?void 0:r.getZoom();let e=30;t>4?e=10:t>3&&(e=15);const a=[];for(let i=-60;i<90;i+=e)a.push({type:"Feature",geometry:{type:"LineString",coordinates:[[-180,i],[180,i]]}});for(let i=-180;i<180;i+=e)a.push({type:"Feature",geometry:{type:"LineString",coordinates:[[i,-90],[i,90]]}});for(let i=180;i>-180;i-=e)for(let l=-60;l<90;l+=e)a.push({type:"Feature",geometry:{type:"Point",coordinates:[i,l]},properties:{val:`${l>0?l+" N":l===0?l:l*-1+" S"}, ${i>0?i+" E":i*-1+" W"}`}});return a},handleZoomEnd(){var e;const t=this.handleComputeLatLngs();(e=this.map)==null||e.getSource(this.source).setData(V.featureCollection(t))},handleRender(){if(this.handleClear(),this.map){const t=this.handleComputeLatLngs();this.map.addSource(this.source,{type:"geojson",data:{type:"FeatureCollection",features:t}}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":this.lineColor,"line-width":1}},this.beforeLayer),this.map.addLayer({id:this.labelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":"{val}","text-rotation-alignment":"viewport","text-offset":[0,1],"text-size":10,"text-allow-overlap":!0},paint:{"text-opacity":1,"text-color":this.labelColor}},this.beforeLayer)}},handleClear(){var t,e,a,r,i,l;(t=this.map)!=null&&t.getLayer(this.layer)&&((e=this.map)==null||e.removeLayer(this.layer)),(a=this.map)!=null&&a.getLayer(this.labelLayer)&&((r=this.map)==null||r.removeLayer(this.labelLayer)),(i=this.map)!=null&&i.getSource(this.source)&&((l=this.map)==null||l.removeSource(this.source))}}};function Hs(t,e,a,r,i,l){var n,s,c;return a.simple?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:0,class:"idm-lat-lng-tip-gl4 pa-2 py-1 text-caption text-right rounded",style:o.normalizeStyle({right:i.right+"px"})},[o.createElementVNode("div",null,o.toDisplayString((n=i.lngLat)==null?void 0:n.lat),1),o.createElementVNode("div",null,o.toDisplayString((s=i.lngLat)==null?void 0:s.lng),1),o.createElementVNode("div",null,o.toDisplayString((c=i.lngLat)==null?void 0:c.str),1)],4))}const Xo=K(Zs,[["render",Hs]]),eb="",Xs={name:"IdmFollowPort",components:{PortDetail:Eo},props:{map:{type:Object},beforeLayer:{type:String},forecastModel:{type:String},show:{type:Boolean},followList:{type:Array}},emits:["closeAllDetail"],setup(){return{Theme:be.useTheme()}},data(){return{source:"follow-port-source",layer:"follow-port-layer",showInfo:!1,portId:"",hoverPort:{},port:{},marker:void 0,showDetail:!1}},watch:{show:{handler(){var t,e,a;this.show?(this.handleRender(),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()},immediate:!0},followList:{handler(){var t,e,a;this.followList&&this.show?(this.handleClear(),this.handleRender(),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()}}},methods:{handleRender(){var e,a;const t={features:[],type:"FeatureCollection"};(e=this.followList)==null||e.forEach(r=>{var i;if((i=r.port)!=null&&i.id){const l=r.port,n={type:"Feature",properties:l,geometry:{type:"Point",coordinates:[l.lng,l.lat]}};t.features.push(n)}}),this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(t):(this.map.addSource(this.source,{type:"geojson",data:t}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":1,"icon-image":"port","icon-offset":[0,-13],"text-anchor":"bottom","text-field":"{name}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,1.6]},paint:{"text-color":this.Theme.current.value.colors["on-surface"],"text-halo-width":1}},this.beforeLayer))},handleClear(){var t,e,a;this.showInfo=!1,this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)},handleClick(t){const e=t.features[0];this.portId=e.properties.id,e.properties.id&&(this.port=e.properties,this.port.lng=e.geometry.coordinates[0],this.port.lat=e.geometry.coordinates[1],this.port.forecastModel=this.forecastModel,this.showDetail=!0)},handleHover(t){var r,i;this.map.getCanvas().style.cursor="pointer";const e=t.features[0];if(e.properties.id){this.showInfo=!0,this.hoverPort=e.properties,(r=this.marker)==null||r.remove();const l=(i=document.getElementById("idmFollowPortInfo"))==null?void 0:i.cloneNode(!0);this.marker=new pe.Marker(l).setLngLat([t.lngLat.lng,t.lngLat.lat]).setOffset([0,-70]).addTo(this.map)}},handleLeave(){var t;this.showInfo=!1,this.hoverPort={},(t=this.marker)==null||t.remove(),this.map.getCanvas().style.cursor="grab"},handleCloseDetail(){this.showDetail=!1}}},Os={class:"port-box d-flex flex-column justify-center align-start ga-1"},Ys={class:"d-flex justify-start align-center text-label"},Us={class:"d-flex justify-start align-center text-label"};function Js(t,e,a,r,i,l){const n=o.resolveComponent("VCardText"),s=o.resolveComponent("VCard"),c=o.resolveComponent("PortDetail");return o.openBlock(),o.createElementBlock("div",null,[o.withDirectives(o.createVNode(s,{id:"idmFollowPortInfo",ref:"idmFollowPortInfo"},{default:o.withCtx(()=>[o.createVNode(n,{class:"text-body-1 pr-8"},{default:o.withCtx(()=>[o.createElementVNode("div",Os,[o.createElementVNode("div",null,o.toDisplayString(t.$t("port.port")),1),o.createElementVNode("div",Ys,[o.createElementVNode("span",null,o.toDisplayString(i.hoverPort.name??"-"),1)]),o.createElementVNode("div",Us,[e[1]||(e[1]=o.createElementVNode("label",{class:"pr-1"},"LoCode : ",-1)),o.createElementVNode("span",null,o.toDisplayString(i.hoverPort.loCode??"-"),1)])])]),_:1})]),_:1},512),[[o.vShow,i.showInfo]]),i.showDetail?(o.openBlock(),o.createBlock(c,o.mergeProps({key:0,"port-id":i.portId,port:i.port,"forecast-model":a.forecastModel,"follow-list":a.followList},t.$attrs,{onClose:l.handleCloseDetail,onCloseAllDetail:e[0]||(e[0]=m=>t.$emit("closeAllDetail",{followPort:!0}))}),null,16,["port-id","port","forecast-model","follow-list","onClose"])):o.createCommentVNode("",!0)])}const Ks=K(Xs,[["render",Js],["__scopeId","data-v-9b28c4ea"]]),tb="",Qs={name:"IdmFollowPosition",props:{map:{type:Object},beforeLayer:{type:String},forecastModel:{type:String},show:{type:Boolean},followList:{type:Array},realTime:{type:String}},setup(){return{Theme:be.useTheme()}},data(){return{source:"follow-coordinate-source",layer:"follow-coordinate-layer",position:{},showInfo:!1,marker:null}},computed:{computePosition(){return function(t){return!t||t.lng===null||t.lng===void 0||isNaN(t.lng)||t.lat===null||t.lat===void 0||isNaN(t.lat)?"-":P.LngLatHelper.lat2pretty(t==null?void 0:t.lat,2).pretty+" / "+P.LngLatHelper.lng2pretty(t==null?void 0:t.lng,2).pretty}}},watch:{show:{handler(){var t,e,a;this.show?(this.handleClear(),this.handleRender(),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()},immediate:!0},followList:{handler(){var t,e,a;this.followList&&this.show?(this.handleClear(),this.handleRender(),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()}}},methods:{handleRender(){var e,a;const t={features:[],type:"FeatureCollection"};(e=this.followList)==null||e.forEach(r=>{if(r.coordinate){const i=r.coordinate,l={type:"Feature",properties:{id:r.id,remark:r.remark,...r.coordinate},geometry:{type:"Point",coordinates:[i.lng,i.lat]}};t.features.push(l)}}),this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(t):(this.map.addSource(this.source,{type:"geojson",data:t}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":1.1,"icon-image":"location","icon-offset":[0,-16]},paint:{"text-color":this.Theme.current.value.colors["on-surface"],"text-halo-width":1}},this.beforeLayer))},handleClear(){var t,e,a;this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source),(t=this.map)==null||t.off("click",[this.layer],this.handleClick),(e=this.map)==null||e.off("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.off("mouseleave",[this.layer],this.handleLeave)},handleClick(t){var a,r,i,l,n,s,c,m,d;const e=t.features[0];if(e.properties){const u=e.properties;u.lng=e.geometry.coordinates[0],u.lat=e.geometry.coordinates[1];const f=z(),g=(a=z(this.realTime))==null?void 0:a.diff(f,"d",!0),p={followId:u.id,lat:u.lat,lng:u.lng,datetime:this.realTime,forecastModel:this.forecastModel};g>=0?(n=(l=(i=(r=this.$parent)==null?void 0:r.$parent)==null?void 0:i.$refs)==null?void 0:l.idmSpot)==null||n.fetchForecastData(p):(d=(m=(c=(s=this.$parent)==null?void 0:s.$parent)==null?void 0:c.$refs)==null?void 0:m.idmSpot)==null||d.fetchHistoryData(p)}},handleHover(t){var a;this.map.getCanvas().style.cursor="pointer";const e=t.features[0];if(e.properties.id){this.showInfo=!0,this.position=e.properties,(a=this.marker)==null||a.remove();const r=document.getElementById("idmFollowPositionInfo").cloneNode(!0);this.marker=new pe.Marker(r).setLngLat([t.lngLat.lng,t.lngLat.lat]).setOffset([0,-70]).addTo(this.map)}},handleLeave(){var t;this.showInfo=!1,(t=this.marker)==null||t.remove(),this.map.getCanvas().style.cursor="grab"}}},qs={class:"position-box d-flex flex-column justify-center align-start ga-1"},$s={class:"d-flex justify-start align-center text-label"},ec={key:0,class:"d-flex justify-start align-center text-label"};function tc(t,e,a,r,i,l){const n=o.resolveComponent("VCardText"),s=o.resolveComponent("VCard");return o.withDirectives((o.openBlock(),o.createBlock(s,{id:"idmFollowPositionInfo",ref:"idmFollowPositionInfo"},{default:o.withCtx(()=>[o.createVNode(n,{class:"text-body-1 pr-8"},{default:o.withCtx(()=>[o.createElementVNode("div",qs,[e[0]||(e[0]=o.createElementVNode("div",null,"Location",-1)),o.createElementVNode("div",$s,[o.createElementVNode("span",null,o.toDisplayString(l.computePosition(i.position)),1)]),i.position.remark?(o.openBlock(),o.createElementBlock("div",ec,[o.createElementVNode("span",null,o.toDisplayString(i.position.remark??"-"),1)])):o.createCommentVNode("",!0)])]),_:1})]),_:1},512)),[[o.vShow,i.showInfo]])}const oc=K(Qs,[["render",tc],["__scopeId","data-v-1de14e27"]]),ob="",ac={name:"IdmOtherLayerr",components:{IdmWarZone:rl,IdmGmdssArea:sl,IdmEcaZone:dl,IdmAlertZone:ul,IdmPort:Cn,IdmLoadLine:Sn,IdmTimezone:Mn,IdmVRA:En,IdmSpecialArea:Bn,IdmTerminator:Gn,IdmWorld12nm:Zn,IdmWorldMarine:On,IdmChinaRoute:Jn,IdmNsrAreas:qn,IdmTideStations:Fs,IdmIceAreas:Ws,IdmLatLng:Xo,IdmFollowPort:Ks,IdmFollowPosition:oc},props:{simple:{type:Boolean,default:!1},map:{type:Object},theme:{type:String},token:{type:String},isLogin:{type:Boolean,default:!1},defaultMeteoToken:{type:String},gateway:{type:String},assistGateway:{type:Array,default:[]},top:{type:Number,default:0},paddingTop:{type:Number,default:8},menuHeight:{type:Number,default:248},menuToggle:{type:Object,default:{}},ts:{type:String},forecastModel:{type:String},realTime:{type:String},platform:{type:String}},emits:["map","other","menuToggle","mapFeather","theme","followLayerList","otherCheckList"],data(){return{right:10,toggle:!1,mapFeather:localStorage.getItem("mapFeathersCacheGL4")||"dark",tagLayers:[...no.LayerHelper.OTHER_LAYERS.filter(t=>t.enabled)],layerWeight:0,otherLayers:{},activeOtherLayers:[],cache:{v:"0.0.3",versionKey:"otherLayerCacheVersionGL4",checkListKey:"otherChecklistCacheGL4",followListKey:"otherFollowListCacheGL4",mapFeatherKey:"mapFeathersCacheGL4",nauticalKey:"nauticalLayerCacheGL4"},mapFeathers:[{name:"Light Map",value:"light",locale:"lightMap"},{name:"Dark Map",value:"dark",locale:"darkMap"},{name:"Satelite Map",value:"satellite",locale:"satelliteMap",hide:this.platform==="ops",replace:"dark"},{name:"Nautical Map",value:"nautical",locale:"nauticalMap",hide:this.platform==="ops",replace:"light"}],checkList:[]}},computed:{listStyle(){return this.simple?{top:this.top+"px",left:this.toggle?"0px":"-280px",height:"calc(100vh - "+this.top+"px)"}:{top:this.top+"px",right:this.toggle?"0px":"-280px",height:"calc(100vh - "+this.top+"px)"}}},watch:{"menuToggle.v":{handler(){this.toggle=this.menuToggle.otherLayers,this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})},immediate:!0},realTime:{handler(t,e){t&&e&&t!==e&&this.checkList.includes("day-night")&&this.fetchDayNightLayer()}},theme:{handler(){this.theme==="light"?this.mapFeather=["light","nautical"].includes(this.mapFeather)?this.mapFeather:"light":this.theme==="dark"&&(this.mapFeather=["dark","satellite"].includes(this.mapFeather)?this.mapFeather:"dark")}},mapFeather:{handler(){localStorage.setItem(this.cache.mapFeatherKey,this.mapFeather),this.$emit("mapFeather",this.mapFeather),this.$emit("theme",["light","nautical"].includes(this.mapFeather)?"light":"dark")},immediate:!0},checkList:{handler(t,e){localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList)),this.activeOtherLayers=this.tagLayers.filter(l=>this.checkList.includes(l.key))||[];const a=t==null?void 0:t.filter(l=>!(e!=null&&e.includes(l))),r=e==null?void 0:e.filter(l=>!(t!=null&&t.includes(l))),i=t==null?void 0:t.filter(l=>e==null?void 0:e.includes(l));if((r==null?void 0:r.length)>0&&r.forEach(l=>{this.otherLayers[l]=void 0,delete this.otherLayers[l]}),(a==null?void 0:a.length)>0){const l=this.tagLayers.filter(n=>this.checkList.includes(n.key)&&!i.includes(n.key))||[];this.handleLayersChange(l)}this.$emit("otherCheckList",this.checkList)}}},async mounted(){this.fetchCache()},methods:{fetchCache(){var r;const t=localStorage.getItem(this.cache.versionKey);this.cache.v!==t&&(localStorage.removeItem(this.cache.checkListKey),localStorage.removeItem(this.cache.followListKey),localStorage.removeItem(this.cache.mapFeatherKey),localStorage.removeItem(this.cache.nauticalKey),localStorage.setItem(this.cache.versionKey,this.cache.v));let e=localStorage.getItem(this.cache.checkListKey);this.checkList=JSON.parse(e||'["eca-zones"]'),localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList)),e=localStorage.getItem(this.cache.mapFeatherKey);const a=this.mapFeathers.some(i=>i.value===e&&!i.hide)?e:((r=this.mapFeathers.find(i=>i.value===e))==null?void 0:r.replace)||"dark";this.$emit("mapFeather",a),localStorage.setItem(this.cache.mapFeatherKey,a)},handleMenuToggle(){this.$emit("menuToggle","otherLayers")},handleToggleMapFeather(t){this.mapFeather=t.value},async fetchOtherLayers(){var e,a;let t=this.layerWeight;if(t){const r=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],i=await he.get(`${r}/api/arc/other/layers/links?l=${t}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(((e=i==null?void 0:i.data)==null?void 0:e.code)===0){const l=(a=i==null?void 0:i.data)==null?void 0:a.data,n=[];for(const c in l)n.push(he.get(l[c],{headers:{Authorization:this.defaultMeteoToken,key:c}}));(await Promise.all(n)).map(c=>{var u,f,g;const m=((u=c==null?void 0:c.data)==null?void 0:u.data)||(c==null?void 0:c.data),d=(g=(f=c==null?void 0:c.config)==null?void 0:f.headers)==null?void 0:g.key;this.otherLayers[d]=m})}}},async fetchDayNightLayer(){var a,r;const t=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],e=await he.get(`${t}/api/arc/other/layers/links?l=1024&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});((a=e==null?void 0:e.data)==null?void 0:a.code)===0&&(this.otherLayers["day-night"]=((r=e==null?void 0:e.data)==null?void 0:r.data)||(e==null?void 0:e.data))},handleLayersChange(t){const e=t==null?void 0:t.reduce((a,r)=>a+(r==null?void 0:r.weight),0);this.layerWeight=e,this.fetchOtherLayers()}}},ic={class:"idm-gl4-other-layer"},rc={class:"header-box w-100 d-flex justify-space-between align-center px-4"},lc={class:"text-h5 font-weight-medium"},nc={class:"layers-body mt-4 mb-2 d-flex justify-start align-center flex-wrap"},sc=["onClick"],cc={key:0,src:"https://ossimg.ormwx.com/asset/dark-map.png",class:"border rounded-sm"},mc={key:1,src:"https://ossimg.ormwx.com/asset/nautical-map.png",class:"border rounded-sm"},dc={key:2,src:"https://ossimg.ormwx.com/asset/satellite-map.png",class:"border rounded-sm"},hc={key:3,src:"https://ossimg.ormwx.com/asset/light-map.png",class:"border rounded-sm"},pc={class:"text-body-2 text-center pt-2"};function gc(t,e,a,r,i,l){var le,S,W,Z,ee,j,B,J,E;const n=o.resolveComponent("VBtn"),s=o.resolveComponent("VTooltip"),c=o.resolveComponent("VCardTitle"),m=o.resolveComponent("VCardItem"),d=o.resolveComponent("VCheckbox"),u=o.resolveComponent("VCardText"),f=o.resolveComponent("VCard"),g=o.resolveComponent("IdmPort"),p=o.resolveComponent("IdmTideStations"),h=o.resolveComponent("IdmLatLng"),y=o.resolveComponent("IdmTerminator"),k=o.resolveComponent("IdmTimezone"),x=o.resolveComponent("IdmAlertZone"),b=o.resolveComponent("IdmEcaZone"),A=o.resolveComponent("IdmWarZone"),v=o.resolveComponent("IdmGmdssArea"),L=o.resolveComponent("IdmLoadLine"),C=o.resolveComponent("IdmWorldMarine"),_=o.resolveComponent("IdmVRA"),N=o.resolveComponent("IdmSpecialArea"),M=o.resolveComponent("IdmWorld12nm"),T=o.resolveComponent("IdmChinaRoute"),I=o.resolveComponent("IdmIceAreas"),X=o.resolveComponent("IdmNsrAreas"),Q=o.resolveComponent("IdmFollowPort"),q=o.resolveComponent("IdmFollowPosition");return o.openBlock(),o.createElementBlock("div",ic,[o.createElementVNode("div",{class:o.normalizeClass(["menu-bar-box transition px-1 rounded",a.simple?"simple":""]),style:o.normalizeStyle({top:a.top+10+"px",right:i.right+"px",paddingTop:a.paddingTop+"px",height:a.menuHeight+"px"})},[o.createVNode(s,{text:t.$t("layer.mapLayers"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:O})=>[o.createVNode(n,o.mergeProps(O,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>e[5]||(e[5]=[o.createElementVNode("i",{class:"iconfont icon-Layer text-h4"},null,-1)])),_:2,__:[5]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],6),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",rc,[o.createElementVNode("div",lc,o.toDisplayString(t.$t("layer.layers")),1),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleMenuToggle},{default:o.withCtx(()=>e[6]||(e[6]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[6]},8,["onClick"])]),o.createElementVNode("div",{class:o.normalizeClass(["list-box w-100 flex-1-1-0 scroll overflow-y-auto",a.simple?"px-3":"pl-4 pr-2"])},[o.createVNode(f,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(m,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(c,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("layer.mapFeathers")),1)]),_:1})]),_:1}),o.createVNode(u,{class:"pb-2"},{default:o.withCtx(()=>{var O;return[o.createElementVNode("div",nc,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList((O=i.mapFeathers)==null?void 0:O.filter($=>!$.hide),$=>(o.openBlock(),o.createElementBlock("div",{key:$.value,class:"mb-4 feather-item",onClick:de=>l.handleToggleMapFeather($)},[o.createElementVNode("div",{class:o.normalizeClass([i.mapFeather===$.value?"active":"","img-box"])},[$.value==="dark"?(o.openBlock(),o.createElementBlock("img",cc)):$.value==="nautical"?(o.openBlock(),o.createElementBlock("img",mc)):$.value==="satellite"?(o.openBlock(),o.createElementBlock("img",dc)):(o.openBlock(),o.createElementBlock("img",hc))],2),o.createElementVNode("div",pc,o.toDisplayString(t.$t(`layer.${$.locale}`)),1)],8,sc))),128))]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter($=>["graticule","day-night","time-zones"].includes($.key)),$=>(o.openBlock(),o.createBlock(d,{key:$.key,modelValue:i.checkList,"onUpdate:modelValue":e[0]||(e[0]=de=>i.checkList=de),value:$.key,label:t.$t(`layer.${$.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2 mx-n1","hide-details":""},null,8,["modelValue","value","label"]))),128))]}),_:1})]),_:1}),o.createVNode(f,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(m,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(c,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("layer.pointsOfInteresting")),1)]),_:1})]),_:1}),o.createVNode(u,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(O=>["ports","alert-zones","tidal-stations"].includes(O.key)),O=>(o.openBlock(),o.createBlock(d,{key:O.key,modelValue:i.checkList,"onUpdate:modelValue":e[1]||(e[1]=$=>i.checkList=$),value:O.key,label:t.$t(`layer.${O.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label"]))),128))]),_:1})]),_:1}),o.createVNode(f,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(m,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(c,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("layer.otherLayers")),1)]),_:1})]),_:1}),o.createVNode(u,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(O=>!["graticule","day-night","time-zones","ports","alert-zones","tidal-stations"].includes(O.key)),O=>(o.openBlock(),o.createBlock(d,{key:O.key,modelValue:i.checkList,"onUpdate:modelValue":e[2]||(e[2]=$=>i.checkList=$),value:O.key,label:t.$t(`layer.${O.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label"]))),128))]),_:1})]),_:1}),o.createVNode(f,{class:"block-bg mx-auto mb-3",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(m,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(c,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("layer.myFollows")),1)]),_:1})]),_:1}),o.createVNode(u,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[o.createVNode(d,{modelValue:i.checkList,"onUpdate:modelValue":e[3]||(e[3]=O=>i.checkList=O),value:"follow-ports",label:t.$t("layer.ports"),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","label"]),o.createVNode(d,{modelValue:i.checkList,"onUpdate:modelValue":e[4]||(e[4]=O=>i.checkList=O),value:"follow-positions",label:t.$t("layer.locations"),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","label"])]),_:1})]),_:1})],2)],6),a.map?(o.openBlock(),o.createBlock(g,o.mergeProps({key:0,ref:"idmPorts",simple:a.simple,map:a.map,ports:(le=i.otherLayers)==null?void 0:le.ports,gateway:a.gateway,token:a.token,"forecast-model":a.forecastModel,"real-time":a.realTime,theme:a.theme},t.$attrs,{"before-layer":"empty-layer-3"}),null,16,["simple","map","ports","gateway","token","forecast-model","real-time","theme"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(p,o.mergeProps({key:1,ref:"idmIideStation",simple:a.simple,map:a.map,gateway:a.gateway,token:a.token,"default-meteo-token":a.defaultMeteoToken,show:i.checkList.includes("tidal-stations"),theme:a.theme,"real-time":a.realTime,"forecast-model":a.forecastModel,"before-layer":"empty-layer-3"},t.$attrs),null,16,["simple","map","gateway","token","default-meteo-token","show","theme","real-time","forecast-model"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(h,o.mergeProps({key:2,simple:a.simple,map:a.map,"menu-toggle":a.menuToggle,show:i.checkList.includes("graticule")},t.$attrs,{"before-layer":"empty-layer-3"}),null,16,["simple","map","menu-toggle","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(y,o.mergeProps({key:3,map:a.map,area:(S=i.otherLayers)==null?void 0:S["day-night"]},t.$attrs,{"before-layer":"empty-layer-2"}),null,16,["map","area"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(k,o.mergeProps({key:4,map:a.map,zone:(W=i.otherLayers)==null?void 0:W["time-zones"],"real-time":a.realTime},t.$attrs,{"before-layer":"empty-layer-3"}),null,16,["map","zone","real-time"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(x,o.mergeProps({key:5,map:a.map,simple:a.simple,zone:(Z=i.otherLayers)==null?void 0:Z["alert-zones"]},t.$attrs,{"before-layer":"empty-layer-3",theme:a.theme}),null,16,["map","simple","zone","theme"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(b,o.mergeProps({key:6,map:a.map,zone:(ee=i.otherLayers)==null?void 0:ee["eca-zones"]},t.$attrs),null,16,["map","zone"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(A,o.mergeProps({key:7,map:a.map,zone:(j=i.otherLayers)==null?void 0:j["war-zones"]},t.$attrs),null,16,["map","zone"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(v,o.mergeProps({key:8,map:a.map,area:(B=i.otherLayers)==null?void 0:B["gmdss-areas"]},t.$attrs),null,16,["map","area"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(L,o.mergeProps({key:9,map:a.map,show:i.checkList.includes("load-lines")},t.$attrs),null,16,["map","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(C,o.mergeProps({key:10,map:a.map,token:a.token,show:i.checkList.includes("worldMarine")},t.$attrs),null,16,["map","token","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(_,o.mergeProps({key:11,map:a.map,area:(J=i.otherLayers)==null?void 0:J["voluntary-reporting-area"]},t.$attrs),null,16,["map","area"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(N,o.mergeProps({key:12,map:a.map,area:(E=i.otherLayers)==null?void 0:E["special-area"]},t.$attrs),null,16,["map","area"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(M,o.mergeProps({key:13,map:a.map,token:a.token,show:i.checkList.includes("world12nm")},t.$attrs),null,16,["map","token","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(T,o.mergeProps({key:14,map:a.map,token:a.token,show:i.checkList.includes("chinaRoute")},t.$attrs),null,16,["map","token","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(I,o.mergeProps({key:15,map:a.map,show:i.checkList.includes("ice-areas")},t.$attrs),null,16,["map","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(X,o.mergeProps({key:16,map:a.map,show:i.checkList.includes("nsr")},t.$attrs),null,16,["map","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(Q,o.mergeProps({key:17,ref:"idmFollowPort",simple:a.simple,map:a.map,show:i.checkList.includes("follow-ports"),gateway:a.gateway,token:a.token,"forecast-model":a.forecastModel,"real-time":a.realTime},t.$attrs,{"before-layer":"empty-layer-3"}),null,16,["simple","map","show","gateway","token","forecast-model","real-time"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(q,o.mergeProps({key:18,ref:"idmFollowPosition",simple:a.simple,map:a.map,show:i.checkList.includes("follow-positions"),"forecast-model":a.forecastModel,"real-time":a.realTime},t.$attrs),null,16,["simple","map","show","forecast-model","real-time"])):o.createCommentVNode("",!0)])}const uc=K(ac,[["render",gc]]);class to{constructor(e){oe(this,"map");oe(this,"mercator");oe(this,"rampColorLayer");oe(this,"rampColorSource");oe(this,"particleLayer");oe(this,"particleSource");oe(this,"rampColorCanvas");oe(this,"particleCanvas");oe(this,"ratio");this.map=e,this.mercator=new $r,this.rampColorLayer="ramp-color-layer",this.rampColorSource="ramp-color-source",this.particleLayer="particle-layer",this.particleSource="particle-source",this.rampColorCanvas=document.createElement("canvas"),this.particleCanvas=document.createElement("canvas"),this.ratio=window.devicePixelRatio}convertNLng(e,a=0){return e>180?this.convertNLng(e-360,a+1):e<-180?this.convertNLng(e+360,a+1):[e,a]}getBoundLngLat(){var a;const e=(a=this.map)==null?void 0:a.getBounds();return e?[[e._sw.lng,e._ne.lat],[e._ne.lng,e._ne.lat],[e._ne.lng,e._sw.lat],[e._sw.lng,e._sw.lat]]:[]}getBoundPixel(){var p,h;const e=(p=this.map)==null?void 0:p.getBounds();if(!e)return[];const a=((h=this.map)==null?void 0:h.getZoom())+1,r=[e._ne.lng,e._ne.lat],i=[e._sw.lng,e._sw.lat],[l,n]=this.convertNLng(r[0]),[s,c]=this.convertNLng(i[0]),[m,d]=this.mercator.px([l,r[1]],a),[u,f]=this.mercator.px([s,i[1]],a),g=Math.round(this.mercator.size*Math.pow(2,a)*(n+c));return[u,f,m+g,d]}getBoundRange(){const e=this.map.getZoom()+1,a=this.mercator.size*Math.pow(2,e),r=this.getBoundPixel();return[r[0]/a,r[2]/a,r[3]/a,r[1]/a]}getWorldCopy(e,a){const r=2**a,[i,l,n,s]=e.map(d=>~~(d/(r*256))),c=[];for(let d=s;d<=l;d++)for(let u=i;u<=n;u++)c.push([u,d]);return c.map(d=>{const u=2**a*256;return[d[0]*u,d[1]*u,u]})}resize(){let e=this.map.getSource(this.rampColorSource);e==null||e.setCoordinates(this.getBoundLngLat()),e=this.map.getSource(this.particleSource),e==null||e.setCoordinates(this.getBoundLngLat());const a=this.map.getCanvas(),r=Math.max(1,a.clientWidth),i=Math.max(1,a.clientHeight);for(const l of[this.rampColorCanvas,this.particleCanvas])l.width!==r&&(l.width=r),l.height!==i&&(l.height=i)}toggle(e){var i;if(!((i=this.map)!=null&&i.getLayer(this.rampColorLayer)))return;const a=this.map.getLayoutProperty(this.rampColorLayer,"visibility"),r=e?"visible":"none";a!==r&&this.map.setLayoutProperty(this.rampColorLayer,"visibility",r)}toggleParticle(e){var i;if(!((i=this.map)!=null&&i.getLayer(this.particleLayer)))return;const a=this.map.getLayoutProperty(this.particleLayer,"visibility"),r=e?"visible":"none";a!==r&&this.map.setLayoutProperty(this.particleLayer,"visibility",r)}}class $e{isWebGL2(e){return typeof e.createVertexArray=="function"}createContext(e,a={}){const r=["webgl2","webgl"];for(const i of r)try{const l=i==="webgl2"?e.getContext("webgl2",a):e.getContext("webgl",a);if(l)return console.info("[WebGL] Renderer:",this.isWebGL2(l)?"WebGL 2":"WebGL 1"),l}catch{}return null}createParticleContext(e){return this.createContext(e,{alpha:!0,depth:!1,stencil:!1,antialias:!1,preserveDrawingBuffer:!0})}createShader(e,a,r){const i=e.createShader(a);if(i){const l=this.isWebGL2(e)?fe.toWebGL2(r,a===e.VERTEX_SHADER?"vertex":"fragment"):r;if(e.shaderSource(i,l),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS)){const n=e.getShaderInfoLog(i);throw e.deleteShader(i),new Error(n||"error happened while create shader...")}}return i}createTexture(e,a,r,i,l,n,s){const c=e.createTexture();e.bindTexture(e.TEXTURE_2D,c),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,a),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,i);const m=this.isWebGL2(e)?e.RGBA8:e.RGBA;if(l===null||l instanceof Uint8Array){if(n===void 0||s===void 0)throw e.deleteTexture(c),new Error("Pixel textures require explicit dimensions.");e.texImage2D(e.TEXTURE_2D,0,m,n,s,0,e.RGBA,e.UNSIGNED_BYTE,l)}else e.texImage2D(e.TEXTURE_2D,0,m,e.RGBA,e.UNSIGNED_BYTE,l);return e.bindTexture(e.TEXTURE_2D,null),c}createDataBuffer(e,a,r){if(e){const i=e.createBuffer();return a==="array"?(e.bindBuffer(e.ARRAY_BUFFER,i),r&&e.bufferData(e.ARRAY_BUFFER,r,e.STATIC_DRAW)):a==="element"&&(e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,i),r&&e.bufferData(e.ELEMENT_ARRAY_BUFFER,r,e.STATIC_DRAW)),i}return null}createProgram(e,a,r){const i=e.createProgram(),l=this.createShader(e,e.VERTEX_SHADER,a),n=this.createShader(e,e.FRAGMENT_SHADER,r);if(i&&l&&n&&(e.attachShader(i,l),e.attachShader(i,n),e.linkProgram(i),e.deleteShader(l),e.deleteShader(n),!e.getProgramParameter(i,e.LINK_STATUS))){const s=e.getProgramInfoLog(i);throw e.deleteProgram(i),new Error(s||"error happened while creating ramp color program")}return i}createProgramWrapper(e,a,r){const i=this.createProgram(e,a,r);if(i){const l={program:i},n=e.getProgramParameter(i,e.ACTIVE_ATTRIBUTES);for(let c=0;c<n;c++){const m=e.getActiveAttrib(i,c);l[m.name]=e.getAttribLocation(i,m.name)}const s=e.getProgramParameter(i,e.ACTIVE_UNIFORMS);for(let c=0;c<s;c++){const m=e.getActiveUniform(i,c);l[m.name]=e.getUniformLocation(i,m.name)}return l}}setup(e,a,r=!1,i,l){const n=document.createElement("canvas");n.width=256,n.height=1;const s=n.getContext("2d");if(s&&e){const c=s==null?void 0:s.createLinearGradient(0,0,256,0);return a.forEach(([m,d])=>{c.addColorStop(m,d)}),s.fillStyle=c,s.fillRect(0,0,256,1),{canvas:n,texture:this.createTexture(e,e.LINEAR,e.LINEAR,e.CLAMP_TO_EDGE,r?new Uint8Array(s.getImageData(0,0,256,1).data):n,i,l)}}}setupParticle(e,a=1e3,r="points",i=!1){const l=Math.ceil(Math.sqrt(a)),n=l*l,s=n*(r==="lines"?2:1),c=new Uint8Array(n*4);for(let p=0;p<c.length;p++)c[p]=Math.floor(Math.random()*256);const m=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,c,l,l),d=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,c,l,l);let u=null;if(!this.isWebGL2(e)){const p=new Float32Array(s);for(let h=0;h<s;h++)p[h]=h;u=this.createDataBuffer(e,"array",p)}const f=i?this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,null,l,l):null,g=i?this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,null,l,l):null;return{resolution:l,total:n,texture0:m,texture1:d,indexBuffer:u,renderMode:r,lifecycleTexture0:f,lifecycleTexture1:g}}bind(e,a,r){if(!e)return{};const i=this.createProgram(e,a,r);if(i){const l=this.createDataBuffer(e,"array",void 0),n=e.getAttribLocation(i,"a_position");e.enableVertexAttribArray(n),e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0);const s=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);this.createDataBuffer(e,"array",s);const c=e.getAttribLocation(i,"a_texCoord");return e.enableVertexAttribArray(c),e.vertexAttribPointer(c,2,e.FLOAT,!1,0,0),{program:i,aPositionBuffer:l}}return{}}bindParticle(e,a,r,i,l,n){const s=this.createProgramWrapper(e,a,r),c=this.createProgramWrapper(e,i,l),m=this.createProgramWrapper(e,i,n),u=this.isWebGL2(e)?null:this.createDataBuffer(e,"array",new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1])),f=this.isWebGL2(e)?e.createVertexArray():null,g=e.createFramebuffer();return{particle:s,screen:c,update:m,quadBuffer:u,frameBuffer:g,vertexArray:f}}draw(e,a,r,i,l,n,s){var c,m;if(a&&r){e.resize(),a==null||a.viewport(0,0,(c=a==null?void 0:a.canvas)==null?void 0:c.width,(m=a==null?void 0:a.canvas)==null?void 0:m.height),a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT);try{a.useProgram(r);const d={resolution:a.getUniformLocation(r,"u_resolution"),image:a.getUniformLocation(r,"u_image"),color:a.getUniformLocation(r,"u_color"),scale:a.getUniformLocation(r,"u_scale"),uvRange:a.getUniformLocation(r,"u_range_u_v"),sRange:a.getUniformLocation(r,"u_range_s")};d.resolution&&a.uniform2f(d.resolution,a.canvas.width*e.ratio,a.canvas.height*e.ratio),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,i),d.image&&a.uniform1i(d.image,0),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,l),d.color&&a.uniform1i(d.color,1),s!=null&&s.uvRange&&(s!=null&&s.sRange)&&(d.uvRange&&a.uniform2f(d.uvRange,s.uvRange[0],s.uvRange[1]),d.sRange&&a.uniform2f(d.sRange,s.sRange[0],s.sRange[1])),d.scale&&a.uniform1f(d.scale,(s==null?void 0:s.scale)||1);const u=e.getBoundPixel(),f=e.map.getZoom()+1,g=e.getWorldCopy(u,f);for(const p of g){const h=(p[0]-u[0])*e.ratio,y=(p[1]-u[3])*e.ratio,k=p[2]*e.ratio,[x,b,A,v]=[h,k+h,y,k+y],L=new Float32Array([x,A,b,A,x,v,x,v,b,A,b,v]);a.bindBuffer(a.ARRAY_BUFFER,n),a.bufferData(a.ARRAY_BUFFER,L,a.STATIC_DRAW),a.drawArrays(a.TRIANGLES,0,6)}}catch(d){console.log(`render failed...${d}`)}}}drawParticle(e,a,r,i,l,n=0){!a||!i||!r||a.isContextLost()||((i.screenWidth!==a.canvas.width||i.screenHeight!==a.canvas.height)&&Object.assign(i,this.resize(e,a,i)),this.isWebGL2(a)&&a.bindVertexArray(i.vertexArray),a.disable(a.DEPTH_TEST),a.disable(a.STENCIL_TEST),a.disable(a.BLEND),a.disable(a.DITHER),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,r),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,i.texture0),i.lifecycleTexture0&&(a.activeTexture(a.TEXTURE3),a.bindTexture(a.TEXTURE_2D,i.lifecycleTexture0)),this.renderScreen(e,a,i,l),this.updateParticles(e,a,i,l,n),a.bindFramebuffer(a.FRAMEBUFFER,null),this.isWebGL2(a)&&a.bindVertexArray(null))}renderScreen(e,a,r,i){a.bindFramebuffer(a.FRAMEBUFFER,r.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,r.screenTexture,0),a.viewport(0,0,a.canvas.width,a.canvas.height),this.renderScreenTexture(a,r.backgroundTexture,r.screen,r.quadBuffer,i.fadeOpacity),this.renderParticles(e,a,r,i),a.bindFramebuffer(a.FRAMEBUFFER,null),this.renderScreenTexture(a,r.screenTexture,r.screen,r.quadBuffer,1);const l=r.backgroundTexture;r.backgroundTexture=r.screenTexture,r.screenTexture=l}renderScreenTexture(e,a,r,i,l){e&&(e.useProgram(r.program),this.isWebGL2(e)||(e.bindBuffer(e.ARRAY_BUFFER,i),e.enableVertexAttribArray(r.a_pos),e.vertexAttribPointer(r.a_pos,2,e.FLOAT,!1,0,0)),e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,a),e.uniform1i(r.u_screen,2),e.uniform1f(r.u_opacity,l),e.drawArrays(e.TRIANGLES,0,6))}renderParticles(e,a,r,i){if(a){a.useProgram(r.particle.program),this.isWebGL2(a)||(a.bindBuffer(a.ARRAY_BUFFER,r.indexBuffer),a.enableVertexAttribArray(r.particle.a_index),a.vertexAttribPointer(r.particle.a_index,1,a.FLOAT,!1,0,0)),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,r.color.texture),a.uniform1i(r.particle.u_factor,0),a.uniform1i(r.particle.u_particles,1),a.uniform1i(r.particle.u_color_ramp,2),a.uniform1f(r.particle.u_particles_resolution,r.resolution),a.uniform1f(r.particle.u_point,e.ratio);const l=e.getBoundRange();a.uniform4f(r.particle.u_viewport,l[0],l[1],l[2],l[3]),a.uniform2f(r.particle.u_factor_min,i.uvRange[0],i.uvRange[0]),a.uniform2f(r.particle.u_factor_max,i.uvRange[1],i.uvRange[1]),r.lifecycleTexture0&&(a.uniform1i(r.particle.u_lifecycle,3),a.uniform1i(r.particle.u_reset_lifecycle,r.resetLifecycle?1:0),a.enable(a.BLEND),a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA)),r.renderMode==="lines"?(a.uniform2f(r.particle.u_resolution,a.canvas.width,a.canvas.height),a.uniform2f(r.particle.u_factor_res,r.image.width,r.image.height),a.uniform1f(r.particle.u_line_length,i.lineLength??6),a.uniform1f(r.particle.u_line_opacity,i.lineOpacity??1),a.lineWidth(1),a.drawArrays(a.LINES,0,r.total*2)):a.drawArrays(a.POINTS,0,r.total),r.lifecycleTexture0&&a.disable(a.BLEND)}}updateParticles(e,a,r,i,l=0){var s,c;if(a){a.bindFramebuffer(a.FRAMEBUFFER,r.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,r.texture1,0),a.viewport(0,0,r.resolution,r.resolution),a.useProgram(r.update.program),this.isWebGL2(a)||(a.bindBuffer(a.ARRAY_BUFFER,r.quadBuffer),a.enableVertexAttribArray(r.update.a_pos),a.vertexAttribPointer(r.update.a_pos,2,a.FLOAT,!1,0,0)),a.uniform1i(r.update.u_factor,0),a.uniform1i(r.update.u_particles,1);const m=e.getBoundRange();if(a.uniform4f(r.update.u_viewport,m[0],m[1],m[2],m[3]),a.uniform1f(r.update.u_rand_seed,Math.random()),a.uniform2f(r.update.u_factor_res,(s=r==null?void 0:r.image)==null?void 0:s.width,(c=r==null?void 0:r.image)==null?void 0:c.height),a.uniform2f(r.update.u_factor_min,i.uvRange[0],i.uvRange[0]),a.uniform2f(r.update.u_factor_max,i.uvRange[1],i.uvRange[1]),a.uniform1f(r.update.u_speed_factor,i.speedFactor*e.ratio),a.uniform1f(r.update.u_drop_rate,i.dropRate),a.uniform1f(r.update.u_drop_rate_bump,i.dropRateBump),r.lifecycleTexture0&&(a.uniform1i(r.update.u_lifecycle,3),a.uniform1i(r.update.u_reset_lifecycle,r.resetLifecycle?1:0),a.uniform1f(r.update.u_delta_seconds,Number.isFinite(l)?Math.max(0,l):0),a.uniform1i(r.update.u_write_lifecycle,0)),a.drawArrays(a.TRIANGLES,0,6),r.lifecycleTexture0){a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,r.lifecycleTexture1,0),a.uniform1i(r.update.u_write_lifecycle,1),a.drawArrays(a.TRIANGLES,0,6);const d=r.lifecycleTexture0;r.lifecycleTexture0=r.lifecycleTexture1,r.lifecycleTexture1=d,r.resetLifecycle=!1}}const n=r.texture0;r.texture0=r.texture1,r.texture1=n}resize(e,a,r){e.resize();const{width:i,height:l}=a.canvas;if((r==null?void 0:r.screenWidth)===i&&(r==null?void 0:r.screenHeight)===l)return r;r&&(a.deleteTexture(r.screenTexture||null),a.deleteTexture(r.backgroundTexture||null));const n=this.createTexture(a,a.NEAREST,a.NEAREST,a.CLAMP_TO_EDGE,null,i,l),s=this.createTexture(a,a.NEAREST,a.NEAREST,a.CLAMP_TO_EDGE,null,i,l);return{screenTexture:n,backgroundTexture:s,screenWidth:i,screenHeight:l}}destroyParticle(e,a){var r,i,l,n;if(!(!e||!a)){e.bindFramebuffer(e.FRAMEBUFFER,null),this.isWebGL2(e)&&(e.bindVertexArray(null),e.deleteVertexArray(a.vertexArray||null));for(const s of[a.texture0,a.texture1,a.screenTexture,a.backgroundTexture,(r=a.color)==null?void 0:r.texture])e.deleteTexture(s||null);a.lifecycleTexture0&&e.deleteTexture(a.lifecycleTexture0),a.lifecycleTexture1&&e.deleteTexture(a.lifecycleTexture1),e.deleteBuffer(a.indexBuffer||null),e.deleteBuffer(a.quadBuffer||null),e.deleteFramebuffer(a.frameBuffer||null);for(const s of[(i=a.particle)==null?void 0:i.program,(l=a.screen)==null?void 0:l.program,(n=a.update)==null?void 0:n.program])e.deleteProgram(s||null)}}async loadImg(e){return new Promise((a,r)=>{const i=typeof e!="string",l=i?URL.createObjectURL(new Blob([e],{type:e.type})):e,n=new Image,s=()=>{i&&URL.revokeObjectURL(l),n.onload=n.onerror=null};n.crossOrigin="anonymous",n.onload=()=>{s(),a(n)},n.onerror=()=>{s(),r(new Error("Unable to load weather texture."))},n.src=l})}}class fe{static toWebGL2(e,a){if(/^\s*#version\s+300\s+es\b/.test(e))return e;const r=e.replace(/^\s*#version\s+100\s*\n/,"").replace(/precision\s+(?:lowp|mediump|highp)\s+float\s*;/g,"").replace(/\battribute\b/g,"in").replace(/\bvarying\b/g,a==="vertex"?"out":"in").replace(/\btexture2D\b/g,"texture").replace(/\bgl_FragColor\b/g,"fragColor");return`#version 300 es
|
|
10
|
+
</div>`)}),r}},legend:{show:!0,right:20,top:0,itemWidth:30,data:["Height"],textStyle:{color:this.Theme.current.value.colors["on-surface"]}},grid:{top:40,left:10,right:10,bottom:30,containLabel:!0},xAxis:[{type:"category",data:this.xDate,boundaryGap:!0,axisTick:{alignWithLabel:!0,lineStyle:{color:this.Theme.current.value.colors["echart-axis"]}},axisLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["echart-axis"]}},axisLabel:{interval:"auto",margin:15,textStyle:{fontSize:12,color:this.Theme.current.value.colors["echart-axis"]}}}],yAxis:[{name:"(m)",show:!0,nameLocation:"end",position:"left",nameGap:15,splitNumber:5,splitLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["echart-split"]}},alignTicks:!0,axisLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["echart-axis"]}},axisLabel:{textStyle:{fontSize:12,color:this.Theme.current.value.colors["echart-axis"]}}}],series:[{name:"Height",type:"line",showSymbol:!0,yAxisIndex:0,lineStyle:{color:this.Theme.current.value.colors["map-perple"]},itemStyle:{color:this.Theme.current.value.colors["map-perple"]},data:this.echartData.height}]};t==null||t.setOption(e)},handleClose(){this.$emit("close")}}},es={class:"d-flex justify-space-between align-center"},ts={class:"d-flex justify-start text-h5 my-2"},os={class:"d-flex justify-start align-center text-h6 text-label ga-3"},as={class:"summary-box w-100"},is={class:"d-flex justify-space-between align-center py-2"},rs={class:"d-flex justify-center align-center text-h6 ga-2"},ls={class:"multi-color-icon","aria-hidden":"true"},ns=["xlink:href"],ss={class:"gray-bg-2 rounded d-flex flex-column ga-4 pa-4"},cs={class:"w-100 d-flex justify-start align-center"},ms={class:"w-30 text-label font-weight-400"},ds={class:"flex-1-1-0"},hs={class:"w-100 d-flex justify-start align-center"},ps={class:"w-30 text-label font-weight-400"},gs={class:"flex-1-1-0"},us={class:"w-100 d-flex justify-start align-center"},fs={class:"w-30 text-label font-weight-400"},ys={class:"flex-1-1-0"},bs={class:"table-box w-100 mt-2 mb-4 d-flex flex-column justify-start align-center"},ws={class:"w-100 d-flex justify-space-between align-center py-2"},xs={class:"d-flex justify-center align-center text-h6 ga-2"},ks={class:"multi-color-icon","aria-hidden":"true"},As=["xlink:href"],Ls={ref:"tideEchart",class:"w-100",style:{height:"244px"}},vs={"fixed-header":"",density:"compact",class:"w-100 tide-table bg-none"},Cs={class:"px-1 text-center text-label font-weight-400",width:"120"},zs={class:"px-1 text-center text-label font-weight-400",width:"120"},_s={class:"px-1 text-center text-label font-weight-400",width:"120"},Ss={class:"px-1 text-center"},Ps={class:"px-1 text-center"},Ns={class:"px-1 text-center"};function Ms(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),s=o.resolveComponent("VCardTitle"),c=o.resolveComponent("VDivider"),m=o.resolveComponent("VBtnToggle"),d=o.resolveComponent("VCard");return o.openBlock(),o.createBlock(d,{class:o.normalizeClass(["tide-detail-container d-flex flex-column justify-start align-center",a.simple?"page":"dialog"])},{default:o.withCtx(()=>{var u,f;return[o.createVNode(s,{class:"w-100"},{default:o.withCtx(()=>{var g;return[o.createElementVNode("div",es,[o.createElementVNode("div",ts,[o.createElementVNode("div",null,o.toDisplayString((g=a.station)==null?void 0:g.name),1)]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"",onClick:l.handleClose},{default:o.withCtx(()=>e[1]||(e[1]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[1]},8,["onClick"])]),o.createElementVNode("div",os,[o.createElementVNode("div",null,o.toDisplayString(t.$t("tide.tideStation")),1)])]}),_:1}),o.createVNode(c,{class:"w-100"}),o.createElementVNode("div",{class:o.normalizeClass(["w-100 pt-0 pb-0 overflow-y-auto scroll",a.simple?"px-3":"px-5"])},[o.createElementVNode("div",as,[o.createElementVNode("div",is,[o.createElementVNode("div",rs,[(o.openBlock(),o.createElementBlock("svg",ls,[o.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,ns)])),o.createElementVNode("div",null,o.toDisplayString(t.$t("detail.summary")),1)])]),o.createElementVNode("div",ss,[o.createElementVNode("div",cs,[o.createElementVNode("div",ms,o.toDisplayString(t.$t("tide.region")),1),o.createElementVNode("div",ds,o.toDisplayString(((u=a.station)==null?void 0:u.Country)??((f=a.station)==null?void 0:f.city)??"-"),1)]),o.createElementVNode("div",hs,[o.createElementVNode("div",ps,o.toDisplayString(t.$t("tide.position")),1),o.createElementVNode("div",gs,o.toDisplayString(l.computePosition(a.station)),1)]),o.createElementVNode("div",us,[o.createElementVNode("div",fs,o.toDisplayString(t.$t("time.localTime")),1),o.createElementVNode("div",ys,o.toDisplayString(l.computeLocalTime(a.realTime,a.station))+" "+o.toDisplayString(l.computeTimeOffset(a.station)),1)])])]),o.createElementVNode("div",bs,[o.createElementVNode("div",ws,[o.createElementVNode("div",xs,[(o.openBlock(),o.createElementBlock("svg",ks,[o.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,As)])),o.createElementVNode("div",null,o.toDisplayString(t.$t("tide.tideTimes")),1)]),e[2]||(e[2]=o.createElementVNode("div",{class:"text-body-2 text-success ga-2"},null,-1))]),o.createElementVNode("div",{class:o.normalizeClass(["w-100 gray-bg-2 rounded",a.simple?"pa-2":"pa-4 py-2"])},[o.createVNode(m,{modelValue:i.currentIndex,"onUpdate:modelValue":e[0]||(e[0]=g=>i.currentIndex=g),class:"w-100 d-flex justify-space-around align-center ga-0 mb-4",density:"compact",group:"",height:"26","min-height":"26",rounded:"1",mandatory:""},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.dateList,g=>(o.openBlock(),o.createBlock(n,{key:g.label,class:o.normalizeClass(["text-none text-body-1 flex-1-1-0",`bg-${g.index===i.currentIndex?"bg-primary":"gray-bg-2"}`]),density:"compact",color:"primary",height:"26",value:g.index},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(g.label),1)]),_:2},1032,["class","value"]))),128))]),_:1},8,["modelValue"]),o.createElementVNode("div",Ls,null,512),o.createElementVNode("table",vs,[o.createElementVNode("tbody",null,[o.createElementVNode("tr",null,[o.createElementVNode("th",Cs,o.toDisplayString(t.$t("tide.tide")),1),o.createElementVNode("th",zs,o.toDisplayString(t.$t("time.time"))+" ( LT ) ",1),o.createElementVNode("th",_s,o.toDisplayString(t.$t("tide.height"))+" ( m )",1)]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tideTableData,(g,p)=>{var h;return o.openBlock(),o.createElementBlock("tr",{key:p},[o.createElementVNode("td",Ss,o.toDisplayString(t.$t(`tide.${(h=g==null?void 0:g.type)==null?void 0:h.toLowerCase()}`))+" "+o.toDisplayString(t.$t("tide.tide")),1),o.createElementVNode("td",Ps,o.toDisplayString(l.computeLocalTime(g==null?void 0:g.date,a.station,"MM-DD HH:mm")),1),o.createElementVNode("td",Ns,o.toDisplayString((g==null?void 0:g.height)??"-")+" m",1)])}),128))])])],2)])],2)]}),_:1},8,["class"])}const Ts=K($n,[["render",Ms],["__scopeId","data-v-5c51381d"]]),q1="",Vs={name:"IdmTideStations",components:{TideDetail:Ts},props:{map:{type:Object},show:{type:Boolean},locale:{type:String},beforeLayer:{type:String}},data(){return{layer:"tide-stations",showInfo:!1,hoverStation:void 0,marker:null,showDetail:!1,station:void 0}},watch:{show:{handler(){var t,e,a,r,i,l;this.show?(this.handleRender(),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):(this.handleClear(),(r=this.map)==null||r.off("click",[this.layer],this.handleClick),(i=this.map)==null||i.off("mousemove",[this.layer],this.handleHover),(l=this.map)==null||l.off("mouseleave",[this.layer],this.handleLeave))},immediate:!0},locale:{handler(){this.show&&this.handleRender()},immediate:!0}},methods:{handleRender(){var t;(t=this.map)!=null&&t.getLayer(this.layer)&&(this.map.setLayoutProperty(this.layer,"visibility","visible"),this.map.setLayoutProperty(this.layer,"text-field",this.locale==="en"?"{Location_EN}":"{Location_CN}"))},handleClear(){var t;this.showInfo=!1,(t=this.map)!=null&&t.getLayer(this.layer)&&this.map.setLayoutProperty(this.layer,"visibility","none")},handleClick(t){const e=t.features[0];e.properties&&(this.station=e.properties,this.station.name=this.locale==="en"?e.properties.Location_EN:e.properties.Location_CN,this.station.lng=e.geometry.coordinates[0],this.station.lat=e.geometry.coordinates[1],this.showDetail=!0)},handleHover(t){var a,r;this.map.getCanvas().style.cursor="pointer";const e=t.features[0];if(e.properties){this.showInfo=!0,this.hoverStation=e.properties,this.hoverStation.name=this.locale==="en"?e.properties.Location_EN:e.properties.Location_CN,this.hoverStation.lng=e.geometry.coordinates[0],this.hoverStation.lat=e.geometry.coordinates[1],(a=this.marker)==null||a.remove();const i=(r=document.getElementById("idmTidalInfo"))==null?void 0:r.cloneNode(!0);this.marker=new pe.Marker(i).setLngLat([t.lngLat.lng,t.lngLat.lat]).setOffset([0,-60]).addTo(this.map)}},handleLeave(){var t;this.showInfo=!1,this.hoverStation={},(t=this.marker)==null||t.remove(),this.map.getCanvas().style.cursor="grab"},handleCloseDetail(){this.showDetail=!1}}},Es={class:"station-box d-flex flex-column justify-center align-start ga-1"},Rs={class:"d-flex justify-start align-center"},Ds={class:"d-flex justify-start align-center"},Bs={class:"text-label"};function Is(t,e,a,r,i,l){const n=o.resolveComponent("VCardText"),s=o.resolveComponent("VCard"),c=o.resolveComponent("TideDetail");return o.openBlock(),o.createElementBlock("div",null,[o.withDirectives(o.createVNode(s,{id:"idmTidalInfo"},{default:o.withCtx(()=>[o.createVNode(n,{class:"pr-8 text-body-1"},{default:o.withCtx(()=>{var m,d;return[o.createElementVNode("div",Es,[o.createElementVNode("div",Rs,o.toDisplayString(t.$t("tide.tideStation")),1),o.createElementVNode("div",Ds,[o.createElementVNode("label",Bs,o.toDisplayString((m=i.hoverStation)==null?void 0:m.name)+" , "+o.toDisplayString(((d=i.hoverStation)==null?void 0:d.Country)||"-"),1)])])]}),_:1})]),_:1},512),[[o.vShow,i.showInfo]]),i.showDetail?(o.openBlock(),o.createBlock(c,o.mergeProps({key:0,station:i.station},t.$attrs,{onClose:l.handleCloseDetail}),null,16,["station","onClose"])):o.createCommentVNode("",!0)])}const Fs=K(Vs,[["render",Is],["__scopeId","data-v-ad725d5e"]]),Gs={name:"IdmIceAreas",props:{map:{type:Object},show:{type:Boolean}},data(){return{lineLayer:"ice-area-line",fillLayer:"ice-area-fill"}},watch:{show:{handler(){this.show?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var t,e;(t=this.map)!=null&&t.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","visible"),(e=this.map)!=null&&e.getLayer(this.fillLayer)&&this.map.setLayoutProperty(this.fillLayer,"visibility","visible")},handleClear(){var t,e;(t=this.map)!=null&&t.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","none"),(e=this.map)!=null&&e.getLayer(this.fillLayer)&&this.map.setLayoutProperty(this.fillLayer,"visibility","none")}}};function js(t,e,a,r,i,l){return null}const Ws=K(Gs,[["render",js]]),$1="",Zs={name:"IdmLatLng",props:{simple:{type:Boolean,default:!1},map:{type:Object},show:{type:Boolean},mapFeather:{type:String},beforeLayer:{type:String},menuToggle:{type:Object}},data(){return{lngLat:{e:{lng:0,lat:0},lng:0,lat:0,str:""},source:"idm-lat-lng-source",layer:"idm-lat-lng-layer",labelLayer:"idm-lat-lng-label-layer",right:10}},computed:{lineColor(){return["satellite","dark"].includes(this.mapFeather)?"rgba(255, 255, 255, 0.3)":"rgba(0, 0, 0, 0.3)"},labelColor(){return["satellite","dark"].includes(this.mapFeather)?"rgba(255, 255, 255, 0.8)":"rgba(0, 0, 0, 0.5)"}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){var t;this.map&&((t=this.map)==null||t.on("mousemove",this.handleMouseMove))},immediate:!0},"menuToggle.v":{handler(){var t;this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10},immediate:!0},"lngLat.e":{handler(t){this.lngLat.lng=P.LngLatHelper.lng2pretty(t==null?void 0:t.lng,2).pretty,this.lngLat.lat=P.LngLatHelper.lat2pretty(t==null?void 0:t.lat,2).pretty,this.lngLat.str=`[${P.LngLatHelper.str2Lat(t==null?void 0:t.lat,4)}, ${P.LngLatHelper.str2Lng(t==null?void 0:t.lng,4)}]`},immediate:!0}},methods:{handleBind(){var t,e;this.show?((t=this.map)==null||t.on("zoomend",this.handleZoomEnd),this.handleRender()):(this.handleClear(),(e=this.map)==null||e.off("zoomend",this.handleZoomEnd))},handleMouseMove(t){this.lngLat.e=t.lngLat},handleComputeLatLngs(){var r;const t=(r=this.map)==null?void 0:r.getZoom();let e=30;t>4?e=10:t>3&&(e=15);const a=[];for(let i=-60;i<90;i+=e)a.push({type:"Feature",geometry:{type:"LineString",coordinates:[[-180,i],[180,i]]}});for(let i=-180;i<180;i+=e)a.push({type:"Feature",geometry:{type:"LineString",coordinates:[[i,-90],[i,90]]}});for(let i=180;i>-180;i-=e)for(let l=-60;l<90;l+=e)a.push({type:"Feature",geometry:{type:"Point",coordinates:[i,l]},properties:{val:`${l>0?l+" N":l===0?l:l*-1+" S"}, ${i>0?i+" E":i*-1+" W"}`}});return a},handleZoomEnd(){var e;const t=this.handleComputeLatLngs();(e=this.map)==null||e.getSource(this.source).setData(V.featureCollection(t))},handleRender(){if(this.handleClear(),this.map){const t=this.handleComputeLatLngs();this.map.addSource(this.source,{type:"geojson",data:{type:"FeatureCollection",features:t}}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":this.lineColor,"line-width":1}},this.beforeLayer),this.map.addLayer({id:this.labelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":"{val}","text-rotation-alignment":"viewport","text-offset":[0,1],"text-size":10,"text-allow-overlap":!0},paint:{"text-opacity":1,"text-color":this.labelColor}},this.beforeLayer)}},handleClear(){var t,e,a,r,i,l;(t=this.map)!=null&&t.getLayer(this.layer)&&((e=this.map)==null||e.removeLayer(this.layer)),(a=this.map)!=null&&a.getLayer(this.labelLayer)&&((r=this.map)==null||r.removeLayer(this.labelLayer)),(i=this.map)!=null&&i.getSource(this.source)&&((l=this.map)==null||l.removeSource(this.source))}}};function Hs(t,e,a,r,i,l){var n,s,c;return a.simple?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:0,class:"idm-lat-lng-tip-gl4 pa-2 py-1 text-caption text-right rounded",style:o.normalizeStyle({right:i.right+"px"})},[o.createElementVNode("div",null,o.toDisplayString((n=i.lngLat)==null?void 0:n.lat),1),o.createElementVNode("div",null,o.toDisplayString((s=i.lngLat)==null?void 0:s.lng),1),o.createElementVNode("div",null,o.toDisplayString((c=i.lngLat)==null?void 0:c.str),1)],4))}const Xo=K(Zs,[["render",Hs]]),eb="",Xs={name:"IdmFollowPort",components:{PortDetail:Eo},props:{map:{type:Object},beforeLayer:{type:String},forecastModel:{type:String},show:{type:Boolean},followList:{type:Array}},emits:["closeAllDetail"],setup(){return{Theme:be.useTheme()}},data(){return{source:"follow-port-source",layer:"follow-port-layer",showInfo:!1,portId:"",hoverPort:{},port:{},marker:void 0,showDetail:!1}},watch:{show:{handler(){var t,e,a;this.show?(this.handleRender(),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()},immediate:!0},followList:{handler(){var t,e,a;this.followList&&this.show?(this.handleClear(),this.handleRender(),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()}}},methods:{handleRender(){var e,a;const t={features:[],type:"FeatureCollection"};(e=this.followList)==null||e.forEach(r=>{var i;if((i=r.port)!=null&&i.id){const l=r.port,n={type:"Feature",properties:l,geometry:{type:"Point",coordinates:[l.lng,l.lat]}};t.features.push(n)}}),this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(t):(this.map.addSource(this.source,{type:"geojson",data:t}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":1,"icon-image":"port","icon-offset":[0,-13],"text-anchor":"bottom","text-field":"{name}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,1.6]},paint:{"text-color":this.Theme.current.value.colors["on-surface"],"text-halo-width":1}},this.beforeLayer))},handleClear(){var t,e,a;this.showInfo=!1,this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)},handleClick(t){const e=t.features[0];this.portId=e.properties.id,e.properties.id&&(this.port=e.properties,this.port.lng=e.geometry.coordinates[0],this.port.lat=e.geometry.coordinates[1],this.port.forecastModel=this.forecastModel,this.showDetail=!0)},handleHover(t){var r,i;this.map.getCanvas().style.cursor="pointer";const e=t.features[0];if(e.properties.id){this.showInfo=!0,this.hoverPort=e.properties,(r=this.marker)==null||r.remove();const l=(i=document.getElementById("idmFollowPortInfo"))==null?void 0:i.cloneNode(!0);this.marker=new pe.Marker(l).setLngLat([t.lngLat.lng,t.lngLat.lat]).setOffset([0,-70]).addTo(this.map)}},handleLeave(){var t;this.showInfo=!1,this.hoverPort={},(t=this.marker)==null||t.remove(),this.map.getCanvas().style.cursor="grab"},handleCloseDetail(){this.showDetail=!1}}},Os={class:"port-box d-flex flex-column justify-center align-start ga-1"},Ys={class:"d-flex justify-start align-center text-label"},Us={class:"d-flex justify-start align-center text-label"};function Js(t,e,a,r,i,l){const n=o.resolveComponent("VCardText"),s=o.resolveComponent("VCard"),c=o.resolveComponent("PortDetail");return o.openBlock(),o.createElementBlock("div",null,[o.withDirectives(o.createVNode(s,{id:"idmFollowPortInfo",ref:"idmFollowPortInfo"},{default:o.withCtx(()=>[o.createVNode(n,{class:"text-body-1 pr-8"},{default:o.withCtx(()=>[o.createElementVNode("div",Os,[o.createElementVNode("div",null,o.toDisplayString(t.$t("port.port")),1),o.createElementVNode("div",Ys,[o.createElementVNode("span",null,o.toDisplayString(i.hoverPort.name??"-"),1)]),o.createElementVNode("div",Us,[e[1]||(e[1]=o.createElementVNode("label",{class:"pr-1"},"LoCode : ",-1)),o.createElementVNode("span",null,o.toDisplayString(i.hoverPort.loCode??"-"),1)])])]),_:1})]),_:1},512),[[o.vShow,i.showInfo]]),i.showDetail?(o.openBlock(),o.createBlock(c,o.mergeProps({key:0,"port-id":i.portId,port:i.port,"forecast-model":a.forecastModel,"follow-list":a.followList},t.$attrs,{onClose:l.handleCloseDetail,onCloseAllDetail:e[0]||(e[0]=m=>t.$emit("closeAllDetail",{followPort:!0}))}),null,16,["port-id","port","forecast-model","follow-list","onClose"])):o.createCommentVNode("",!0)])}const Ks=K(Xs,[["render",Js],["__scopeId","data-v-9b28c4ea"]]),tb="",Qs={name:"IdmFollowPosition",props:{map:{type:Object},beforeLayer:{type:String},forecastModel:{type:String},show:{type:Boolean},followList:{type:Array},realTime:{type:String}},setup(){return{Theme:be.useTheme()}},data(){return{source:"follow-coordinate-source",layer:"follow-coordinate-layer",position:{},showInfo:!1,marker:null}},computed:{computePosition(){return function(t){return!t||t.lng===null||t.lng===void 0||isNaN(t.lng)||t.lat===null||t.lat===void 0||isNaN(t.lat)?"-":P.LngLatHelper.lat2pretty(t==null?void 0:t.lat,2).pretty+" / "+P.LngLatHelper.lng2pretty(t==null?void 0:t.lng,2).pretty}}},watch:{show:{handler(){var t,e,a;this.show?(this.handleClear(),this.handleRender(),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()},immediate:!0},followList:{handler(){var t,e,a;this.followList&&this.show?(this.handleClear(),this.handleRender(),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()}}},methods:{handleRender(){var e,a;const t={features:[],type:"FeatureCollection"};(e=this.followList)==null||e.forEach(r=>{if(r.coordinate){const i=r.coordinate,l={type:"Feature",properties:{id:r.id,remark:r.remark,...r.coordinate},geometry:{type:"Point",coordinates:[i.lng,i.lat]}};t.features.push(l)}}),this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(t):(this.map.addSource(this.source,{type:"geojson",data:t}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":1.1,"icon-image":"location","icon-offset":[0,-16]},paint:{"text-color":this.Theme.current.value.colors["on-surface"],"text-halo-width":1}},this.beforeLayer))},handleClear(){var t,e,a;this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source),(t=this.map)==null||t.off("click",[this.layer],this.handleClick),(e=this.map)==null||e.off("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.off("mouseleave",[this.layer],this.handleLeave)},handleClick(t){var a,r,i,l,n,s,c,m,d;const e=t.features[0];if(e.properties){const u=e.properties;u.lng=e.geometry.coordinates[0],u.lat=e.geometry.coordinates[1];const f=z(),g=(a=z(this.realTime))==null?void 0:a.diff(f,"d",!0),p={followId:u.id,lat:u.lat,lng:u.lng,datetime:this.realTime,forecastModel:this.forecastModel};g>=0?(n=(l=(i=(r=this.$parent)==null?void 0:r.$parent)==null?void 0:i.$refs)==null?void 0:l.idmSpot)==null||n.fetchForecastData(p):(d=(m=(c=(s=this.$parent)==null?void 0:s.$parent)==null?void 0:c.$refs)==null?void 0:m.idmSpot)==null||d.fetchHistoryData(p)}},handleHover(t){var a;this.map.getCanvas().style.cursor="pointer";const e=t.features[0];if(e.properties.id){this.showInfo=!0,this.position=e.properties,(a=this.marker)==null||a.remove();const r=document.getElementById("idmFollowPositionInfo").cloneNode(!0);this.marker=new pe.Marker(r).setLngLat([t.lngLat.lng,t.lngLat.lat]).setOffset([0,-70]).addTo(this.map)}},handleLeave(){var t;this.showInfo=!1,(t=this.marker)==null||t.remove(),this.map.getCanvas().style.cursor="grab"}}},qs={class:"position-box d-flex flex-column justify-center align-start ga-1"},$s={class:"d-flex justify-start align-center text-label"},ec={key:0,class:"d-flex justify-start align-center text-label"};function tc(t,e,a,r,i,l){const n=o.resolveComponent("VCardText"),s=o.resolveComponent("VCard");return o.withDirectives((o.openBlock(),o.createBlock(s,{id:"idmFollowPositionInfo",ref:"idmFollowPositionInfo"},{default:o.withCtx(()=>[o.createVNode(n,{class:"text-body-1 pr-8"},{default:o.withCtx(()=>[o.createElementVNode("div",qs,[e[0]||(e[0]=o.createElementVNode("div",null,"Location",-1)),o.createElementVNode("div",$s,[o.createElementVNode("span",null,o.toDisplayString(l.computePosition(i.position)),1)]),i.position.remark?(o.openBlock(),o.createElementBlock("div",ec,[o.createElementVNode("span",null,o.toDisplayString(i.position.remark??"-"),1)])):o.createCommentVNode("",!0)])]),_:1})]),_:1},512)),[[o.vShow,i.showInfo]])}const oc=K(Qs,[["render",tc],["__scopeId","data-v-1de14e27"]]),ob="",ac={name:"IdmOtherLayerr",components:{IdmWarZone:rl,IdmGmdssArea:sl,IdmEcaZone:dl,IdmAlertZone:ul,IdmPort:Cn,IdmLoadLine:Sn,IdmTimezone:Mn,IdmVRA:En,IdmSpecialArea:Bn,IdmTerminator:Gn,IdmWorld12nm:Zn,IdmWorldMarine:On,IdmChinaRoute:Jn,IdmNsrAreas:qn,IdmTideStations:Fs,IdmIceAreas:Ws,IdmLatLng:Xo,IdmFollowPort:Ks,IdmFollowPosition:oc},props:{simple:{type:Boolean,default:!1},map:{type:Object},theme:{type:String},token:{type:String},isLogin:{type:Boolean,default:!1},defaultMeteoToken:{type:String},gateway:{type:String},assistGateway:{type:Array,default:[]},top:{type:Number,default:0},paddingTop:{type:Number,default:8},menuHeight:{type:Number,default:248},menuToggle:{type:Object,default:{}},ts:{type:String},forecastModel:{type:String},realTime:{type:String},platform:{type:String},mapFeather:{type:String}},emits:["map","other","menuToggle","mapFeather","theme","followLayerList","otherCheckList"],data(){return{right:10,toggle:!1,mapboxFeather:void 0,tagLayers:[...no.LayerHelper.OTHER_LAYERS.filter(t=>t.enabled)],layerWeight:0,otherLayers:{},activeOtherLayers:[],cache:{v:"0.0.2",versionKey:"otherLayerCacheVersionGL4",checkListKey:"otherChecklistCacheGL4",followListKey:"otherFollowListCacheGL4",mapFeatherKey:"mapFeathersCacheGL4",nauticalKey:"nauticalLayerCacheGL4"},featherOptions:[{name:"Light Map",value:"light",locale:"lightMap"},{name:"Dark Map",value:"dark",locale:"darkMap"},{name:"Satelite Map",value:"satellite",locale:"satelliteMap",hide:this.platform==="ops",replace:"dark"},{name:"Nautical Map",value:"nautical",locale:"nauticalMap",hide:this.platform==="ops",replace:"light"}],checkList:[]}},computed:{listStyle(){return this.simple?{top:this.top+"px",left:this.toggle?"0px":"-280px",height:"calc(100vh - "+this.top+"px)"}:{top:this.top+"px",right:this.toggle?"0px":"-280px",height:"calc(100vh - "+this.top+"px)"}}},watch:{"menuToggle.v":{handler(){this.toggle=this.menuToggle.otherLayers,this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})},immediate:!0},realTime:{handler(t,e){t&&e&&t!==e&&this.checkList.includes("day-night")&&this.fetchDayNightLayer()}},theme:{handler(){this.theme==="light"?this.mapboxFeather=["light","nautical"].includes(this.mapboxFeather)?this.mapboxFeather:"light":this.theme==="dark"&&(this.mapboxFeather=["dark","satellite"].includes(this.mapboxFeather)?this.mapboxFeather:"dark")}},mapFeather:{handler(){this.mapFeather&&(this.mapboxFeather=this.mapFeather)},immediate:!0},mapboxFeather:{handler(){localStorage.setItem(this.cache.mapFeatherKey,this.mapboxFeather),this.$emit("mapFeather",this.mapboxFeather),this.$emit("theme",["light","nautical"].includes(this.mapboxFeather)?"light":"dark")}},checkList:{handler(t,e){localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList)),this.activeOtherLayers=this.tagLayers.filter(l=>this.checkList.includes(l.key))||[];const a=t==null?void 0:t.filter(l=>!(e!=null&&e.includes(l))),r=e==null?void 0:e.filter(l=>!(t!=null&&t.includes(l))),i=t==null?void 0:t.filter(l=>e==null?void 0:e.includes(l));if((r==null?void 0:r.length)>0&&r.forEach(l=>{this.otherLayers[l]=void 0,delete this.otherLayers[l]}),(a==null?void 0:a.length)>0){const l=this.tagLayers.filter(n=>this.checkList.includes(n.key)&&!i.includes(n.key))||[];this.handleLayersChange(l)}this.$emit("otherCheckList",this.checkList)}}},async mounted(){this.fetchCache()},methods:{fetchCache(){var r;const t=localStorage.getItem(this.cache.versionKey);this.cache.v!==t&&(localStorage.removeItem(this.cache.checkListKey),localStorage.removeItem(this.cache.followListKey),localStorage.removeItem(this.cache.mapFeatherKey),localStorage.removeItem(this.cache.nauticalKey),localStorage.setItem(this.cache.versionKey,this.cache.v));let e=localStorage.getItem(this.cache.checkListKey);this.checkList=JSON.parse(e||'["eca-zones"]'),localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList)),e=localStorage.getItem(this.cache.mapFeatherKey);const a=this.featherOptions.some(i=>i.value===e&&!i.hide)?e:((r=this.featherOptions.find(i=>i.value===e))==null?void 0:r.replace)||"dark";this.$emit("mapFeather",a),localStorage.setItem(this.cache.mapFeatherKey,a)},handleMenuToggle(){this.$emit("menuToggle","otherLayers")},handleToggleMapFeather(t){this.mapboxFeather=t.value},async fetchOtherLayers(){var e,a;let t=this.layerWeight;if(t){const r=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],i=await he.get(`${r}/api/arc/other/layers/links?l=${t}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(((e=i==null?void 0:i.data)==null?void 0:e.code)===0){const l=(a=i==null?void 0:i.data)==null?void 0:a.data,n=[];for(const c in l)n.push(he.get(l[c],{headers:{Authorization:this.defaultMeteoToken,key:c}}));(await Promise.all(n)).map(c=>{var u,f,g;const m=((u=c==null?void 0:c.data)==null?void 0:u.data)||(c==null?void 0:c.data),d=(g=(f=c==null?void 0:c.config)==null?void 0:f.headers)==null?void 0:g.key;this.otherLayers[d]=m})}}},async fetchDayNightLayer(){var a,r;const t=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],e=await he.get(`${t}/api/arc/other/layers/links?l=1024&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});((a=e==null?void 0:e.data)==null?void 0:a.code)===0&&(this.otherLayers["day-night"]=((r=e==null?void 0:e.data)==null?void 0:r.data)||(e==null?void 0:e.data))},handleLayersChange(t){const e=t==null?void 0:t.reduce((a,r)=>a+(r==null?void 0:r.weight),0);this.layerWeight=e,this.fetchOtherLayers()}}},ic={class:"idm-gl4-other-layer"},rc={class:"header-box w-100 d-flex justify-space-between align-center px-4"},lc={class:"text-h5 font-weight-medium"},nc={class:"layers-body mt-4 mb-2 d-flex justify-start align-center flex-wrap"},sc=["onClick"],cc={key:0,src:"https://ossimg.ormwx.com/asset/dark-map.png",class:"border rounded-sm"},mc={key:1,src:"https://ossimg.ormwx.com/asset/nautical-map.png",class:"border rounded-sm"},dc={key:2,src:"https://ossimg.ormwx.com/asset/satellite-map.png",class:"border rounded-sm"},hc={key:3,src:"https://ossimg.ormwx.com/asset/light-map.png",class:"border rounded-sm"},pc={class:"text-body-2 text-center pt-2"};function gc(t,e,a,r,i,l){var le,S,W,Z,ee,j,B,J,E;const n=o.resolveComponent("VBtn"),s=o.resolveComponent("VTooltip"),c=o.resolveComponent("VCardTitle"),m=o.resolveComponent("VCardItem"),d=o.resolveComponent("VCheckbox"),u=o.resolveComponent("VCardText"),f=o.resolveComponent("VCard"),g=o.resolveComponent("IdmPort"),p=o.resolveComponent("IdmTideStations"),h=o.resolveComponent("IdmLatLng"),y=o.resolveComponent("IdmTerminator"),k=o.resolveComponent("IdmTimezone"),x=o.resolveComponent("IdmAlertZone"),b=o.resolveComponent("IdmEcaZone"),A=o.resolveComponent("IdmWarZone"),v=o.resolveComponent("IdmGmdssArea"),L=o.resolveComponent("IdmLoadLine"),C=o.resolveComponent("IdmWorldMarine"),_=o.resolveComponent("IdmVRA"),N=o.resolveComponent("IdmSpecialArea"),M=o.resolveComponent("IdmWorld12nm"),T=o.resolveComponent("IdmChinaRoute"),I=o.resolveComponent("IdmIceAreas"),X=o.resolveComponent("IdmNsrAreas"),Q=o.resolveComponent("IdmFollowPort"),q=o.resolveComponent("IdmFollowPosition");return o.openBlock(),o.createElementBlock("div",ic,[o.createElementVNode("div",{class:o.normalizeClass(["menu-bar-box transition px-1 rounded",a.simple?"simple":""]),style:o.normalizeStyle({top:a.top+10+"px",right:i.right+"px",paddingTop:a.paddingTop+"px",height:a.menuHeight+"px"})},[o.createVNode(s,{text:t.$t("layer.mapLayers"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:O})=>[o.createVNode(n,o.mergeProps(O,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>e[5]||(e[5]=[o.createElementVNode("i",{class:"iconfont icon-Layer text-h4"},null,-1)])),_:2,__:[5]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],6),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",rc,[o.createElementVNode("div",lc,o.toDisplayString(t.$t("layer.layers")),1),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleMenuToggle},{default:o.withCtx(()=>e[6]||(e[6]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[6]},8,["onClick"])]),o.createElementVNode("div",{class:o.normalizeClass(["list-box w-100 flex-1-1-0 scroll overflow-y-auto",a.simple?"px-3":"pl-4 pr-2"])},[o.createVNode(f,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(m,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(c,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("layer.featherOptions")),1)]),_:1})]),_:1}),o.createVNode(u,{class:"pb-2"},{default:o.withCtx(()=>{var O;return[o.createElementVNode("div",nc,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList((O=i.featherOptions)==null?void 0:O.filter($=>!$.hide),$=>(o.openBlock(),o.createElementBlock("div",{key:$.value,class:"mb-4 feather-item",onClick:de=>l.handleToggleMapFeather($)},[o.createElementVNode("div",{class:o.normalizeClass([i.mapboxFeather===$.value?"active":"","img-box"])},[$.value==="dark"?(o.openBlock(),o.createElementBlock("img",cc)):$.value==="nautical"?(o.openBlock(),o.createElementBlock("img",mc)):$.value==="satellite"?(o.openBlock(),o.createElementBlock("img",dc)):(o.openBlock(),o.createElementBlock("img",hc))],2),o.createElementVNode("div",pc,o.toDisplayString(t.$t(`layer.${$.locale}`)),1)],8,sc))),128))]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter($=>["graticule","day-night","time-zones"].includes($.key)),$=>(o.openBlock(),o.createBlock(d,{key:$.key,modelValue:i.checkList,"onUpdate:modelValue":e[0]||(e[0]=de=>i.checkList=de),value:$.key,label:t.$t(`layer.${$.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2 mx-n1","hide-details":""},null,8,["modelValue","value","label"]))),128))]}),_:1})]),_:1}),o.createVNode(f,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(m,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(c,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("layer.pointsOfInteresting")),1)]),_:1})]),_:1}),o.createVNode(u,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(O=>["ports","alert-zones","tidal-stations"].includes(O.key)),O=>(o.openBlock(),o.createBlock(d,{key:O.key,modelValue:i.checkList,"onUpdate:modelValue":e[1]||(e[1]=$=>i.checkList=$),value:O.key,label:t.$t(`layer.${O.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label"]))),128))]),_:1})]),_:1}),o.createVNode(f,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(m,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(c,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("layer.otherLayers")),1)]),_:1})]),_:1}),o.createVNode(u,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(O=>!["graticule","day-night","time-zones","ports","alert-zones","tidal-stations"].includes(O.key)),O=>(o.openBlock(),o.createBlock(d,{key:O.key,modelValue:i.checkList,"onUpdate:modelValue":e[2]||(e[2]=$=>i.checkList=$),value:O.key,label:t.$t(`layer.${O.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label"]))),128))]),_:1})]),_:1}),o.createVNode(f,{class:"block-bg mx-auto mb-3",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(m,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(c,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("layer.myFollows")),1)]),_:1})]),_:1}),o.createVNode(u,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[o.createVNode(d,{modelValue:i.checkList,"onUpdate:modelValue":e[3]||(e[3]=O=>i.checkList=O),value:"follow-ports",label:t.$t("layer.ports"),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","label"]),o.createVNode(d,{modelValue:i.checkList,"onUpdate:modelValue":e[4]||(e[4]=O=>i.checkList=O),value:"follow-positions",label:t.$t("layer.locations"),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","label"])]),_:1})]),_:1})],2)],6),a.map?(o.openBlock(),o.createBlock(g,o.mergeProps({key:0,ref:"idmPorts",simple:a.simple,map:a.map,ports:(le=i.otherLayers)==null?void 0:le.ports,gateway:a.gateway,token:a.token,"forecast-model":a.forecastModel,"real-time":a.realTime,theme:a.theme},t.$attrs,{"before-layer":"empty-layer-3"}),null,16,["simple","map","ports","gateway","token","forecast-model","real-time","theme"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(p,o.mergeProps({key:1,ref:"idmIideStation",simple:a.simple,map:a.map,gateway:a.gateway,token:a.token,"default-meteo-token":a.defaultMeteoToken,show:i.checkList.includes("tidal-stations"),theme:a.theme,"real-time":a.realTime,"forecast-model":a.forecastModel,"before-layer":"empty-layer-3"},t.$attrs),null,16,["simple","map","gateway","token","default-meteo-token","show","theme","real-time","forecast-model"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(h,o.mergeProps({key:2,simple:a.simple,map:a.map,"menu-toggle":a.menuToggle,show:i.checkList.includes("graticule")},t.$attrs,{"before-layer":"empty-layer-3"}),null,16,["simple","map","menu-toggle","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(y,o.mergeProps({key:3,map:a.map,area:(S=i.otherLayers)==null?void 0:S["day-night"]},t.$attrs,{"before-layer":"empty-layer-2"}),null,16,["map","area"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(k,o.mergeProps({key:4,map:a.map,zone:(W=i.otherLayers)==null?void 0:W["time-zones"],"real-time":a.realTime},t.$attrs,{"before-layer":"empty-layer-3"}),null,16,["map","zone","real-time"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(x,o.mergeProps({key:5,map:a.map,simple:a.simple,zone:(Z=i.otherLayers)==null?void 0:Z["alert-zones"]},t.$attrs,{"before-layer":"empty-layer-3",theme:a.theme}),null,16,["map","simple","zone","theme"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(b,o.mergeProps({key:6,map:a.map,zone:(ee=i.otherLayers)==null?void 0:ee["eca-zones"]},t.$attrs),null,16,["map","zone"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(A,o.mergeProps({key:7,map:a.map,zone:(j=i.otherLayers)==null?void 0:j["war-zones"]},t.$attrs),null,16,["map","zone"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(v,o.mergeProps({key:8,map:a.map,area:(B=i.otherLayers)==null?void 0:B["gmdss-areas"]},t.$attrs),null,16,["map","area"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(L,o.mergeProps({key:9,map:a.map,show:i.checkList.includes("load-lines")},t.$attrs),null,16,["map","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(C,o.mergeProps({key:10,map:a.map,token:a.token,show:i.checkList.includes("worldMarine")},t.$attrs),null,16,["map","token","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(_,o.mergeProps({key:11,map:a.map,area:(J=i.otherLayers)==null?void 0:J["voluntary-reporting-area"]},t.$attrs),null,16,["map","area"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(N,o.mergeProps({key:12,map:a.map,area:(E=i.otherLayers)==null?void 0:E["special-area"]},t.$attrs),null,16,["map","area"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(M,o.mergeProps({key:13,map:a.map,token:a.token,show:i.checkList.includes("world12nm")},t.$attrs),null,16,["map","token","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(T,o.mergeProps({key:14,map:a.map,token:a.token,show:i.checkList.includes("chinaRoute")},t.$attrs),null,16,["map","token","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(I,o.mergeProps({key:15,map:a.map,show:i.checkList.includes("ice-areas")},t.$attrs),null,16,["map","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(X,o.mergeProps({key:16,map:a.map,show:i.checkList.includes("nsr")},t.$attrs),null,16,["map","show"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(Q,o.mergeProps({key:17,ref:"idmFollowPort",simple:a.simple,map:a.map,show:i.checkList.includes("follow-ports"),gateway:a.gateway,token:a.token,"forecast-model":a.forecastModel,"real-time":a.realTime},t.$attrs,{"before-layer":"empty-layer-3"}),null,16,["simple","map","show","gateway","token","forecast-model","real-time"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(q,o.mergeProps({key:18,ref:"idmFollowPosition",simple:a.simple,map:a.map,show:i.checkList.includes("follow-positions"),"forecast-model":a.forecastModel,"real-time":a.realTime},t.$attrs),null,16,["simple","map","show","forecast-model","real-time"])):o.createCommentVNode("",!0)])}const uc=K(ac,[["render",gc]]);class to{constructor(e){oe(this,"map");oe(this,"mercator");oe(this,"rampColorLayer");oe(this,"rampColorSource");oe(this,"particleLayer");oe(this,"particleSource");oe(this,"rampColorCanvas");oe(this,"particleCanvas");oe(this,"ratio");this.map=e,this.mercator=new $r,this.rampColorLayer="ramp-color-layer",this.rampColorSource="ramp-color-source",this.particleLayer="particle-layer",this.particleSource="particle-source",this.rampColorCanvas=document.createElement("canvas"),this.particleCanvas=document.createElement("canvas"),this.ratio=window.devicePixelRatio}convertNLng(e,a=0){return e>180?this.convertNLng(e-360,a+1):e<-180?this.convertNLng(e+360,a+1):[e,a]}getBoundLngLat(){var a;const e=(a=this.map)==null?void 0:a.getBounds();return e?[[e._sw.lng,e._ne.lat],[e._ne.lng,e._ne.lat],[e._ne.lng,e._sw.lat],[e._sw.lng,e._sw.lat]]:[]}getBoundPixel(){var p,h;const e=(p=this.map)==null?void 0:p.getBounds();if(!e)return[];const a=((h=this.map)==null?void 0:h.getZoom())+1,r=[e._ne.lng,e._ne.lat],i=[e._sw.lng,e._sw.lat],[l,n]=this.convertNLng(r[0]),[s,c]=this.convertNLng(i[0]),[m,d]=this.mercator.px([l,r[1]],a),[u,f]=this.mercator.px([s,i[1]],a),g=Math.round(this.mercator.size*Math.pow(2,a)*(n+c));return[u,f,m+g,d]}getBoundRange(){const e=this.map.getZoom()+1,a=this.mercator.size*Math.pow(2,e),r=this.getBoundPixel();return[r[0]/a,r[2]/a,r[3]/a,r[1]/a]}getWorldCopy(e,a){const r=2**a,[i,l,n,s]=e.map(d=>~~(d/(r*256))),c=[];for(let d=s;d<=l;d++)for(let u=i;u<=n;u++)c.push([u,d]);return c.map(d=>{const u=2**a*256;return[d[0]*u,d[1]*u,u]})}resize(){let e=this.map.getSource(this.rampColorSource);e==null||e.setCoordinates(this.getBoundLngLat()),e=this.map.getSource(this.particleSource),e==null||e.setCoordinates(this.getBoundLngLat());const a=this.map.getCanvas(),r=Math.max(1,a.clientWidth),i=Math.max(1,a.clientHeight);for(const l of[this.rampColorCanvas,this.particleCanvas])l.width!==r&&(l.width=r),l.height!==i&&(l.height=i)}toggle(e){var i;if(!((i=this.map)!=null&&i.getLayer(this.rampColorLayer)))return;const a=this.map.getLayoutProperty(this.rampColorLayer,"visibility"),r=e?"visible":"none";a!==r&&this.map.setLayoutProperty(this.rampColorLayer,"visibility",r)}toggleParticle(e){var i;if(!((i=this.map)!=null&&i.getLayer(this.particleLayer)))return;const a=this.map.getLayoutProperty(this.particleLayer,"visibility"),r=e?"visible":"none";a!==r&&this.map.setLayoutProperty(this.particleLayer,"visibility",r)}}class $e{isWebGL2(e){return typeof e.createVertexArray=="function"}createContext(e,a={}){const r=["webgl2","webgl"];for(const i of r)try{const l=i==="webgl2"?e.getContext("webgl2",a):e.getContext("webgl",a);if(l)return console.info("[WebGL] Renderer:",this.isWebGL2(l)?"WebGL 2":"WebGL 1"),l}catch{}return null}createParticleContext(e){return this.createContext(e,{alpha:!0,depth:!1,stencil:!1,antialias:!1,preserveDrawingBuffer:!0})}createShader(e,a,r){const i=e.createShader(a);if(i){const l=this.isWebGL2(e)?fe.toWebGL2(r,a===e.VERTEX_SHADER?"vertex":"fragment"):r;if(e.shaderSource(i,l),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS)){const n=e.getShaderInfoLog(i);throw e.deleteShader(i),new Error(n||"error happened while create shader...")}}return i}createTexture(e,a,r,i,l,n,s){const c=e.createTexture();e.bindTexture(e.TEXTURE_2D,c),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,a),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,i);const m=this.isWebGL2(e)?e.RGBA8:e.RGBA;if(l===null||l instanceof Uint8Array){if(n===void 0||s===void 0)throw e.deleteTexture(c),new Error("Pixel textures require explicit dimensions.");e.texImage2D(e.TEXTURE_2D,0,m,n,s,0,e.RGBA,e.UNSIGNED_BYTE,l)}else e.texImage2D(e.TEXTURE_2D,0,m,e.RGBA,e.UNSIGNED_BYTE,l);return e.bindTexture(e.TEXTURE_2D,null),c}createDataBuffer(e,a,r){if(e){const i=e.createBuffer();return a==="array"?(e.bindBuffer(e.ARRAY_BUFFER,i),r&&e.bufferData(e.ARRAY_BUFFER,r,e.STATIC_DRAW)):a==="element"&&(e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,i),r&&e.bufferData(e.ELEMENT_ARRAY_BUFFER,r,e.STATIC_DRAW)),i}return null}createProgram(e,a,r){const i=e.createProgram(),l=this.createShader(e,e.VERTEX_SHADER,a),n=this.createShader(e,e.FRAGMENT_SHADER,r);if(i&&l&&n&&(e.attachShader(i,l),e.attachShader(i,n),e.linkProgram(i),e.deleteShader(l),e.deleteShader(n),!e.getProgramParameter(i,e.LINK_STATUS))){const s=e.getProgramInfoLog(i);throw e.deleteProgram(i),new Error(s||"error happened while creating ramp color program")}return i}createProgramWrapper(e,a,r){const i=this.createProgram(e,a,r);if(i){const l={program:i},n=e.getProgramParameter(i,e.ACTIVE_ATTRIBUTES);for(let c=0;c<n;c++){const m=e.getActiveAttrib(i,c);l[m.name]=e.getAttribLocation(i,m.name)}const s=e.getProgramParameter(i,e.ACTIVE_UNIFORMS);for(let c=0;c<s;c++){const m=e.getActiveUniform(i,c);l[m.name]=e.getUniformLocation(i,m.name)}return l}}setup(e,a,r=!1,i,l){const n=document.createElement("canvas");n.width=256,n.height=1;const s=n.getContext("2d");if(s&&e){const c=s==null?void 0:s.createLinearGradient(0,0,256,0);return a.forEach(([m,d])=>{c.addColorStop(m,d)}),s.fillStyle=c,s.fillRect(0,0,256,1),{canvas:n,texture:this.createTexture(e,e.LINEAR,e.LINEAR,e.CLAMP_TO_EDGE,r?new Uint8Array(s.getImageData(0,0,256,1).data):n,i,l)}}}setupParticle(e,a=1e3,r="points",i=!1){const l=Math.ceil(Math.sqrt(a)),n=l*l,s=n*(r==="lines"?2:1),c=new Uint8Array(n*4);for(let p=0;p<c.length;p++)c[p]=Math.floor(Math.random()*256);const m=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,c,l,l),d=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,c,l,l);let u=null;if(!this.isWebGL2(e)){const p=new Float32Array(s);for(let h=0;h<s;h++)p[h]=h;u=this.createDataBuffer(e,"array",p)}const f=i?this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,null,l,l):null,g=i?this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,null,l,l):null;return{resolution:l,total:n,texture0:m,texture1:d,indexBuffer:u,renderMode:r,lifecycleTexture0:f,lifecycleTexture1:g}}bind(e,a,r){if(!e)return{};const i=this.createProgram(e,a,r);if(i){const l=this.createDataBuffer(e,"array",void 0),n=e.getAttribLocation(i,"a_position");e.enableVertexAttribArray(n),e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0);const s=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);this.createDataBuffer(e,"array",s);const c=e.getAttribLocation(i,"a_texCoord");return e.enableVertexAttribArray(c),e.vertexAttribPointer(c,2,e.FLOAT,!1,0,0),{program:i,aPositionBuffer:l}}return{}}bindParticle(e,a,r,i,l,n){const s=this.createProgramWrapper(e,a,r),c=this.createProgramWrapper(e,i,l),m=this.createProgramWrapper(e,i,n),u=this.isWebGL2(e)?null:this.createDataBuffer(e,"array",new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1])),f=this.isWebGL2(e)?e.createVertexArray():null,g=e.createFramebuffer();return{particle:s,screen:c,update:m,quadBuffer:u,frameBuffer:g,vertexArray:f}}draw(e,a,r,i,l,n,s){var c,m;if(a&&r){e.resize(),a==null||a.viewport(0,0,(c=a==null?void 0:a.canvas)==null?void 0:c.width,(m=a==null?void 0:a.canvas)==null?void 0:m.height),a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT);try{a.useProgram(r);const d={resolution:a.getUniformLocation(r,"u_resolution"),image:a.getUniformLocation(r,"u_image"),color:a.getUniformLocation(r,"u_color"),scale:a.getUniformLocation(r,"u_scale"),uvRange:a.getUniformLocation(r,"u_range_u_v"),sRange:a.getUniformLocation(r,"u_range_s")};d.resolution&&a.uniform2f(d.resolution,a.canvas.width*e.ratio,a.canvas.height*e.ratio),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,i),d.image&&a.uniform1i(d.image,0),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,l),d.color&&a.uniform1i(d.color,1),s!=null&&s.uvRange&&(s!=null&&s.sRange)&&(d.uvRange&&a.uniform2f(d.uvRange,s.uvRange[0],s.uvRange[1]),d.sRange&&a.uniform2f(d.sRange,s.sRange[0],s.sRange[1])),d.scale&&a.uniform1f(d.scale,(s==null?void 0:s.scale)||1);const u=e.getBoundPixel(),f=e.map.getZoom()+1,g=e.getWorldCopy(u,f);for(const p of g){const h=(p[0]-u[0])*e.ratio,y=(p[1]-u[3])*e.ratio,k=p[2]*e.ratio,[x,b,A,v]=[h,k+h,y,k+y],L=new Float32Array([x,A,b,A,x,v,x,v,b,A,b,v]);a.bindBuffer(a.ARRAY_BUFFER,n),a.bufferData(a.ARRAY_BUFFER,L,a.STATIC_DRAW),a.drawArrays(a.TRIANGLES,0,6)}}catch(d){console.log(`render failed...${d}`)}}}drawParticle(e,a,r,i,l,n=0){!a||!i||!r||a.isContextLost()||((i.screenWidth!==a.canvas.width||i.screenHeight!==a.canvas.height)&&Object.assign(i,this.resize(e,a,i)),this.isWebGL2(a)&&a.bindVertexArray(i.vertexArray),a.disable(a.DEPTH_TEST),a.disable(a.STENCIL_TEST),a.disable(a.BLEND),a.disable(a.DITHER),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,r),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,i.texture0),i.lifecycleTexture0&&(a.activeTexture(a.TEXTURE3),a.bindTexture(a.TEXTURE_2D,i.lifecycleTexture0)),this.renderScreen(e,a,i,l),this.updateParticles(e,a,i,l,n),a.bindFramebuffer(a.FRAMEBUFFER,null),this.isWebGL2(a)&&a.bindVertexArray(null))}renderScreen(e,a,r,i){a.bindFramebuffer(a.FRAMEBUFFER,r.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,r.screenTexture,0),a.viewport(0,0,a.canvas.width,a.canvas.height),this.renderScreenTexture(a,r.backgroundTexture,r.screen,r.quadBuffer,i.fadeOpacity),this.renderParticles(e,a,r,i),a.bindFramebuffer(a.FRAMEBUFFER,null),this.renderScreenTexture(a,r.screenTexture,r.screen,r.quadBuffer,1);const l=r.backgroundTexture;r.backgroundTexture=r.screenTexture,r.screenTexture=l}renderScreenTexture(e,a,r,i,l){e&&(e.useProgram(r.program),this.isWebGL2(e)||(e.bindBuffer(e.ARRAY_BUFFER,i),e.enableVertexAttribArray(r.a_pos),e.vertexAttribPointer(r.a_pos,2,e.FLOAT,!1,0,0)),e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,a),e.uniform1i(r.u_screen,2),e.uniform1f(r.u_opacity,l),e.drawArrays(e.TRIANGLES,0,6))}renderParticles(e,a,r,i){if(a){a.useProgram(r.particle.program),this.isWebGL2(a)||(a.bindBuffer(a.ARRAY_BUFFER,r.indexBuffer),a.enableVertexAttribArray(r.particle.a_index),a.vertexAttribPointer(r.particle.a_index,1,a.FLOAT,!1,0,0)),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,r.color.texture),a.uniform1i(r.particle.u_factor,0),a.uniform1i(r.particle.u_particles,1),a.uniform1i(r.particle.u_color_ramp,2),a.uniform1f(r.particle.u_particles_resolution,r.resolution),a.uniform1f(r.particle.u_point,e.ratio);const l=e.getBoundRange();a.uniform4f(r.particle.u_viewport,l[0],l[1],l[2],l[3]),a.uniform2f(r.particle.u_factor_min,i.uvRange[0],i.uvRange[0]),a.uniform2f(r.particle.u_factor_max,i.uvRange[1],i.uvRange[1]),r.lifecycleTexture0&&(a.uniform1i(r.particle.u_lifecycle,3),a.uniform1i(r.particle.u_reset_lifecycle,r.resetLifecycle?1:0),a.enable(a.BLEND),a.blendFunc(a.ONE,a.ONE_MINUS_SRC_ALPHA)),r.renderMode==="lines"?(a.uniform2f(r.particle.u_resolution,a.canvas.width,a.canvas.height),a.uniform2f(r.particle.u_factor_res,r.image.width,r.image.height),a.uniform1f(r.particle.u_line_length,i.lineLength??6),a.uniform1f(r.particle.u_line_opacity,i.lineOpacity??1),a.lineWidth(1),a.drawArrays(a.LINES,0,r.total*2)):a.drawArrays(a.POINTS,0,r.total),r.lifecycleTexture0&&a.disable(a.BLEND)}}updateParticles(e,a,r,i,l=0){var s,c;if(a){a.bindFramebuffer(a.FRAMEBUFFER,r.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,r.texture1,0),a.viewport(0,0,r.resolution,r.resolution),a.useProgram(r.update.program),this.isWebGL2(a)||(a.bindBuffer(a.ARRAY_BUFFER,r.quadBuffer),a.enableVertexAttribArray(r.update.a_pos),a.vertexAttribPointer(r.update.a_pos,2,a.FLOAT,!1,0,0)),a.uniform1i(r.update.u_factor,0),a.uniform1i(r.update.u_particles,1);const m=e.getBoundRange();if(a.uniform4f(r.update.u_viewport,m[0],m[1],m[2],m[3]),a.uniform1f(r.update.u_rand_seed,Math.random()),a.uniform2f(r.update.u_factor_res,(s=r==null?void 0:r.image)==null?void 0:s.width,(c=r==null?void 0:r.image)==null?void 0:c.height),a.uniform2f(r.update.u_factor_min,i.uvRange[0],i.uvRange[0]),a.uniform2f(r.update.u_factor_max,i.uvRange[1],i.uvRange[1]),a.uniform1f(r.update.u_speed_factor,i.speedFactor*e.ratio),a.uniform1f(r.update.u_drop_rate,i.dropRate),a.uniform1f(r.update.u_drop_rate_bump,i.dropRateBump),r.lifecycleTexture0&&(a.uniform1i(r.update.u_lifecycle,3),a.uniform1i(r.update.u_reset_lifecycle,r.resetLifecycle?1:0),a.uniform1f(r.update.u_delta_seconds,Number.isFinite(l)?Math.max(0,l):0),a.uniform1i(r.update.u_write_lifecycle,0)),a.drawArrays(a.TRIANGLES,0,6),r.lifecycleTexture0){a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,r.lifecycleTexture1,0),a.uniform1i(r.update.u_write_lifecycle,1),a.drawArrays(a.TRIANGLES,0,6);const d=r.lifecycleTexture0;r.lifecycleTexture0=r.lifecycleTexture1,r.lifecycleTexture1=d,r.resetLifecycle=!1}}const n=r.texture0;r.texture0=r.texture1,r.texture1=n}resize(e,a,r){e.resize();const{width:i,height:l}=a.canvas;if((r==null?void 0:r.screenWidth)===i&&(r==null?void 0:r.screenHeight)===l)return r;r&&(a.deleteTexture(r.screenTexture||null),a.deleteTexture(r.backgroundTexture||null));const n=this.createTexture(a,a.NEAREST,a.NEAREST,a.CLAMP_TO_EDGE,null,i,l),s=this.createTexture(a,a.NEAREST,a.NEAREST,a.CLAMP_TO_EDGE,null,i,l);return{screenTexture:n,backgroundTexture:s,screenWidth:i,screenHeight:l}}destroyParticle(e,a){var r,i,l,n;if(!(!e||!a)){e.bindFramebuffer(e.FRAMEBUFFER,null),this.isWebGL2(e)&&(e.bindVertexArray(null),e.deleteVertexArray(a.vertexArray||null));for(const s of[a.texture0,a.texture1,a.screenTexture,a.backgroundTexture,(r=a.color)==null?void 0:r.texture])e.deleteTexture(s||null);a.lifecycleTexture0&&e.deleteTexture(a.lifecycleTexture0),a.lifecycleTexture1&&e.deleteTexture(a.lifecycleTexture1),e.deleteBuffer(a.indexBuffer||null),e.deleteBuffer(a.quadBuffer||null),e.deleteFramebuffer(a.frameBuffer||null);for(const s of[(i=a.particle)==null?void 0:i.program,(l=a.screen)==null?void 0:l.program,(n=a.update)==null?void 0:n.program])e.deleteProgram(s||null)}}async loadImg(e){return new Promise((a,r)=>{const i=typeof e!="string",l=i?URL.createObjectURL(new Blob([e],{type:e.type})):e,n=new Image,s=()=>{i&&URL.revokeObjectURL(l),n.onload=n.onerror=null};n.crossOrigin="anonymous",n.onload=()=>{s(),a(n)},n.onerror=()=>{s(),r(new Error("Unable to load weather texture."))},n.src=l})}}class fe{static toWebGL2(e,a){if(/^\s*#version\s+300\s+es\b/.test(e))return e;const r=e.replace(/^\s*#version\s+100\s*\n/,"").replace(/precision\s+(?:lowp|mediump|highp)\s+float\s*;/g,"").replace(/\battribute\b/g,"in").replace(/\bvarying\b/g,a==="vertex"?"out":"in").replace(/\btexture2D\b/g,"texture").replace(/\bgl_FragColor\b/g,"fragColor");return`#version 300 es
|
|
11
11
|
precision highp float;
|
|
12
12
|
${a==="fragment"?`out vec4 fragColor;
|
|
13
13
|
`:""}${r}`}}oe(fe,"vertexSchema",`
|
|
@@ -401,7 +401,7 @@ ${a==="fragment"?`out vec4 fragColor;
|
|
|
401
401
|
}`);let so=Me;const fc={"000kts":'<svg t="1756203850656" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4213" width="200" height="200"><path d="M729.6 512a217.6 217.6 0 1 0-217.6 217.6v59.733333a277.333333 277.333333 0 1 1 0-554.666666 277.333333 277.333333 0 0 1 0 554.666666v-59.733333a217.6 217.6 0 0 0 217.6-217.6z" fill="#ffffff" p-id="4214"></path><path d="M558.933333 512a46.933333 46.933333 0 1 0-46.933333 46.933333v59.733334a106.666667 106.666667 0 1 1 0-213.333334 106.666667 106.666667 0 0 1 0 213.333334v-59.733334a46.933333 46.933333 0 0 0 46.933333-46.933333z" fill="#ffffff" p-id="4215"></path></svg>',"002kts":'<svg t="1756203870666" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4371" width="200" height="200"><path d="M511.975255 4.26646a29.865223 29.865223 0 0 1 29.865223 29.865224v897.791273l58.151856-46.504419a29.907888 29.907888 0 0 1 37.288864 46.717742l-106.661511 85.329209a29.865223 29.865223 0 0 1-37.288865 0l-106.661511-85.329209a29.865223 29.865223 0 0 1 37.288864-46.675077l58.151856 46.461754V34.131684a29.865223 29.865223 0 0 1 29.865224-29.865224z" fill="#ffffff" p-id="4372"></path></svg>',"005kts":'<svg t="1756203883896" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4528" width="200" height="200"><path d="M511.825979 4.265216a29.856515 29.856515 0 0 1 29.856516 29.856516v102.706413l145.443882-97.673458a29.856515 29.856515 0 0 1 33.268689 49.604468l-174.873877 117.378758c-1.194261 0.853043-2.55913 1.364869-3.838694 2.004652v723.508674l58.1349-46.49086a29.899168 29.899168 0 0 1 37.277993 46.70412l-106.630413 85.30433a29.856515 29.856515 0 0 1-37.277992 0l-106.630412-85.30433a29.856515 29.856515 0 0 1 37.277992-46.661468l58.134901 46.448208V34.121732a29.856515 29.856515 0 0 1 29.856515-29.856516z" fill="#ffffff" p-id="4529"></path></svg>',"010kts":'<svg t="1756203893742" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4685" width="200" height="200"><path d="M687.93386 4.887188a29.854538 29.854538 0 1 1 31.560512 50.667416L541.646623 166.186993v765.768907l58.131051-46.445132a29.854538 29.854538 0 0 1 37.275523 46.658378l-106.623351 85.298681a29.854538 29.854538 0 0 1-37.275523 0l-106.623351-85.298681a29.854538 29.854538 0 0 1 37.275523-46.658378l58.131051 46.487781V153.903983c0-0.767688 0.127948-1.535376 0.213247-2.345714a29.72659 29.72659 0 0 1 13.861036-27.295577l191.922031-119.375504z" fill="#ffffff" p-id="4686"></path></svg>',"015kts":'<svg t="1756203906240" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4842" width="200" height="200"><path d="M687.93386 4.887188a29.854538 29.854538 0 1 1 31.560512 50.667416L541.646623 166.186993v76.683514l73.783359-46.018638a29.854538 29.854538 0 1 1 31.560511 50.582118L541.646623 313.327217v618.628683l58.131051-46.445132a29.854538 29.854538 0 0 1 37.275523 46.658378l-106.623351 85.298681a29.854538 29.854538 0 0 1-37.275523 0l-106.623351-85.298681a29.854538 29.854538 0 0 1 37.275523-46.658378l58.131051 46.487781V153.903983c0-0.767688 0.127948-1.535376 0.213247-2.345714a29.72659 29.72659 0 0 1 13.861036-27.295577l191.922031-119.375504z" fill="#ffffff" p-id="4843"></path></svg>',"020kts":'<svg t="1756203915478" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4999" width="200" height="200"><path d="M687.93386 4.887188a29.854538 29.854538 0 1 1 31.560512 50.667416L541.646623 166.186993V240.908638l146.287237-91.013693a29.854538 29.854538 0 1 1 31.560512 50.667417L541.646623 311.2374v620.7185l58.131051-46.445132a29.854538 29.854538 0 0 1 37.275523 46.658378l-106.623351 85.298681a29.854538 29.854538 0 0 1-37.275523 0l-106.623351-85.298681a29.854538 29.854538 0 0 1 37.275523-46.658378l58.131051 46.487781V153.903983c0-0.767688 0.127948-1.535376 0.213247-2.345714a29.72659 29.72659 0 0 1 13.861036-27.295577l191.922031-119.375504z" fill="#ffffff" p-id="5000"></path></svg>',"025kts":'<svg t="1756203931490" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5156" width="200" height="200"><path d="M687.910653 4.887023a29.853531 29.853531 0 1 1 31.559447 50.665707L541.62835 166.181387V240.90051l146.282303-91.010622a29.853531 29.853531 0 1 1 31.559447 50.665708L541.62835 311.2269v76.638279l73.738222-46.059733a29.853531 29.853531 0 0 1 31.644743 50.665707l-105.340317 65.84836v473.604947l58.043794-46.443565a29.853531 29.853531 0 0 1 37.359562 46.656804l-106.619754 85.295804a29.853531 29.853531 0 0 1-37.359562 0l-106.619754-85.295804a29.853531 29.853531 0 0 1 37.359562-46.656804l58.086442 46.486213V153.898791c0-0.767662 0.127944-1.535324 0.213239-2.345634a29.725587 29.725587 0 0 1 13.860568-27.294657l191.915558-119.371477z" fill="#ffffff" p-id="5157"></path></svg>',"030kts":'<svg t="1756203940193" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5313" width="200" height="200"><path d="M687.93386 4.887188a29.854538 29.854538 0 1 1 31.560512 50.667416L541.646623 166.186993V240.908638l146.287237-91.013693a29.854538 29.854538 0 1 1 31.560512 50.667417L541.646623 311.2374v74.636345l146.287237-90.971043a29.854538 29.854538 0 1 1 31.560512 50.667417l-177.847749 110.632389v475.753392l58.131051-46.445132a29.854538 29.854538 0 0 1 37.275523 46.658378l-106.623351 85.298681a29.854538 29.854538 0 0 1-37.275523 0l-106.623351-85.298681a29.854538 29.854538 0 0 1 37.275523-46.658378l58.131051 46.487781V153.903983c0-0.767688 0.127948-1.535376 0.213247-2.345714a29.72659 29.72659 0 0 1 13.861036-27.295577l191.922031-119.375504z" fill="#ffffff" p-id="5314"></path></svg>',"035kts":'<svg t="1756203952289" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5470" width="200" height="200"><path d="M687.910653 4.887023a29.853531 29.853531 0 1 1 31.559447 50.665707L541.62835 166.181387V240.90051l146.282303-91.010622a29.853531 29.853531 0 1 1 31.559447 50.665708L541.62835 311.2269v74.633828l146.282303-90.967974a29.853531 29.853531 0 1 1 31.559447 50.665707l-177.84175 110.628657v76.680927l73.738222-46.059734a29.853531 29.853531 0 0 1 31.644743 50.623059l-105.340317 65.891008v328.602082l58.043794-46.443565a29.853531 29.853531 0 0 1 37.359562 46.656804l-106.619754 85.295804a29.853531 29.853531 0 0 1-37.359562 0l-106.619754-85.295804a29.853531 29.853531 0 0 1 37.359562-46.656804l58.086442 46.486213V153.898791c0-0.767662 0.127944-1.535324 0.213239-2.345634a29.725587 29.725587 0 0 1 13.860568-27.294657l191.915558-119.371477z" fill="#ffffff" p-id="5471"></path></svg>',"040kts":'<svg t="1756203961957" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5627" width="200" height="200"><path d="M687.93386 4.887188a29.854538 29.854538 0 1 1 31.560512 50.667416L541.646623 166.186993V240.908638l146.287237-91.013693a29.854538 29.854538 0 1 1 31.560512 50.667417L541.646623 311.2374v74.636345l146.287237-90.971043a29.854538 29.854538 0 1 1 31.560512 50.667417l-177.847749 110.632389v74.721644l146.287237-91.013692a29.854538 29.854538 0 1 1 31.560512 50.667416l-177.847749 110.632389v330.745635l58.131051-46.445132a29.854538 29.854538 0 0 1 37.275523 46.658378l-106.623351 85.298681a29.854538 29.854538 0 0 1-37.275523 0l-106.623351-85.298681a29.854538 29.854538 0 0 1 37.275523-46.658378l58.131051 46.487781V153.903983c0-0.767688 0.127948-1.535376 0.213247-2.345714a29.72659 29.72659 0 0 1 13.861036-27.295577l191.922031-119.375504z" fill="#ffffff" p-id="5628"></path></svg>',"045kts":'<svg t="1756203969362" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5784" width="200" height="200"><path d="M687.910653 4.887023a29.853531 29.853531 0 1 1 31.559447 50.665707L541.62835 166.181387V240.90051l146.282303-91.010622a29.853531 29.853531 0 1 1 31.559447 50.665708L541.62835 311.2269v74.633828l146.282303-90.967974a29.853531 29.853531 0 1 1 31.559447 50.665707l-177.84175 110.628657v74.719123l146.282303-91.010622a29.853531 29.853531 0 1 1 31.559447 50.665707l-177.84175 110.628657v76.680927l73.738222-46.059734a29.853531 29.853531 0 0 1 31.644743 50.665708l-105.340317 65.84836v183.599216l58.043794-46.443565a29.853531 29.853531 0 0 1 37.359562 46.656804l-106.619754 85.295804a29.853531 29.853531 0 0 1-37.359562 0l-106.619754-85.295804a29.853531 29.853531 0 0 1 37.359562-46.656804l58.086442 46.486213V153.898791c0-0.767662 0.127944-1.535324 0.213239-2.345634a29.725587 29.725587 0 0 1 13.860568-27.294657l191.915558-119.371477z" fill="#ffffff" p-id="5785"></path></svg>',"050kts":'<svg t="1756203979191" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5941" width="200" height="200"><path d="M699.699515 0a29.865223 29.865223 0 0 1 29.865223 29.865223c0 0.426646-0.170658 0.853292-0.170659 1.237274a29.737229 29.737229 0 0 1-13.908661 26.238732l-170.658418 106.74684c-0.938621 0.597304-1.962572 0.981286-2.986522 1.450597v766.384291l58.151856-46.504419a29.907888 29.907888 0 0 1 37.288864 46.717742l-106.661511 85.329209a29.865223 29.865223 0 0 1-37.288865 0l-106.661511-85.329209a29.865223 29.865223 0 0 1 37.288864-46.675077l58.151856 46.461754V34.131684c0-0.725298 0.127994-1.407932 0.213323-2.133231C482.238025 31.273155 482.110031 30.590521 482.110031 29.865223A29.865223 29.865223 0 0 1 511.975255 0h187.72426z" fill="#ffffff" p-id="5942"></path></svg>',"055kts":'<svg t="1756203990154" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6098" width="200" height="200"><path d="M699.676193 0a29.864228 29.864228 0 0 1 29.864228 29.864228c0 0.426632-0.170653 0.853264-0.170653 1.237232a29.736238 29.736238 0 0 1-13.908197 26.237857l-170.65273 106.743283c-0.93859 0.597285-1.962506 0.981253-2.986423 1.450548v77.092371l73.764642-46.076237a29.864228 29.864228 0 0 1 31.656082 50.641197L541.822418 313.062433v618.829462l58.064591-46.502868a29.906891 29.906891 0 0 1 37.372948 46.716184l-106.657956 85.326365a29.864228 29.864228 0 0 1-37.372948 0l-106.657956-85.326365a29.864228 29.864228 0 0 1 37.372948-46.673521l58.107254 46.460205V34.130546c0-0.725274 0.12799-1.407885 0.213316-2.133159C482.221952 31.272113 482.093962 30.589502 482.093962 29.864228A29.864228 29.864228 0 0 1 511.95819 0h187.718003z" fill="#ffffff" p-id="6099"></path></svg>',"060kts":'<svg t="1756203999756" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6255" width="200" height="200"><path d="M699.699515 0a29.865223 29.865223 0 0 1 29.865223 29.865223c0 0.426646-0.170658 0.853292-0.170659 1.237274a29.737229 29.737229 0 0 1-13.908661 26.238732l-170.658418 106.74684c-0.938621 0.597304-1.962572 0.981286-2.986522 1.450597v75.089704l146.339593-91.046266a29.865223 29.865223 0 1 1 31.571808 50.68555L541.840478 310.939638v620.983319l58.151856-46.504419a29.907888 29.907888 0 0 1 37.288864 46.717742l-106.661511 85.329209a29.865223 29.865223 0 0 1-37.288865 0l-106.661511-85.329209a29.865223 29.865223 0 0 1 37.288864-46.675077l58.151856 46.461754V34.131684c0-0.725298 0.127994-1.407932 0.213323-2.133231C482.238025 31.273155 482.110031 30.590521 482.110031 29.865223A29.865223 29.865223 0 0 1 511.975255 0h187.72426z" fill="#ffffff" p-id="6256"></path></svg>',"065kts":'<svg t="1756204005834" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6412" width="200" height="200"><path d="M699.676193 0a29.864228 29.864228 0 0 1 29.864228 29.864228c0 0.426632-0.170653 0.853264-0.170653 1.237232a29.736238 29.736238 0 0 1-13.908197 26.237857l-170.65273 106.743283c-0.93859 0.597285-1.962506 0.981253-2.986423 1.450548v75.087201l146.334716-91.043231a29.864228 29.864228 0 1 1 31.570755 50.683861L541.822418 310.929274v76.708402l73.764642-46.076237a29.864228 29.864228 0 0 1 31.656082 50.641198l-105.378061 65.914617v473.774641l58.064591-46.502868a29.906891 29.906891 0 0 1 37.372948 46.716184l-106.657956 85.326365a29.864228 29.864228 0 0 1-37.372948 0l-106.657956-85.326365a29.864228 29.864228 0 0 1 37.372948-46.673521l58.107254 46.460205V34.130546c0-0.725274 0.12799-1.407885 0.213316-2.133159C482.221952 31.272113 482.093962 30.589502 482.093962 29.864228A29.864228 29.864228 0 0 1 511.95819 0h187.718003z" fill="#ffffff" p-id="6413"></path></svg>',"070kts":'<svg t="1756204018577" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6569" width="200" height="200"><path d="M699.699515 0a29.865223 29.865223 0 0 1 29.865223 29.865223c0 0.426646-0.170658 0.853292-0.170659 1.237274a29.737229 29.737229 0 0 1-13.908661 26.238732l-170.658418 106.74684c-0.938621 0.597304-1.962572 0.981286-2.986522 1.450597v75.089704l146.339593-91.046266a29.865223 29.865223 0 1 1 31.571808 50.68555L541.840478 310.939638V385.688025l146.339593-91.046266a29.865223 29.865223 0 1 1 31.571808 50.68555l-177.911401 110.714649v475.880999l58.151856-46.504419a29.907888 29.907888 0 0 1 37.288864 46.717742l-106.661511 85.329209a29.865223 29.865223 0 0 1-37.288865 0l-106.661511-85.329209a29.865223 29.865223 0 0 1 37.288864-46.675077l58.151856 46.461754V34.131684c0-0.725298 0.127994-1.407932 0.213323-2.133231C482.238025 31.273155 482.110031 30.590521 482.110031 29.865223A29.865223 29.865223 0 0 1 511.975255 0h187.72426z" fill="#ffffff" p-id="6570"></path></svg>',"075kts":'<svg t="1756204027005" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6726" width="200" height="200"><path d="M699.676193 0a29.864228 29.864228 0 0 1 29.864228 29.864228c0 0.426632-0.170653 0.853264-0.170653 1.237232a29.736238 29.736238 0 0 1-13.908197 26.237857l-170.65273 106.743283c-0.93859 0.597285-1.962506 0.981253-2.986423 1.450548v75.087201l146.334716-91.043231a29.864228 29.864228 0 1 1 31.570755 50.683861L541.822418 310.929274V385.67517l146.334716-91.043232a29.864228 29.864228 0 1 1 31.570755 50.683861l-177.905471 110.710959v76.665739l73.764642-46.076237a29.864228 29.864228 0 0 1 31.656082 50.68386l-105.378061 65.871954v328.719821l58.064591-46.502868a29.906891 29.906891 0 0 1 37.372948 46.716184l-106.657956 85.326365a29.864228 29.864228 0 0 1-37.372948 0l-106.657956-85.326365a29.864228 29.864228 0 0 1 37.372948-46.673521l58.107254 46.460205V34.130546c0-0.725274 0.12799-1.407885 0.213316-2.133159C482.221952 31.272113 482.093962 30.589502 482.093962 29.864228A29.864228 29.864228 0 0 1 511.95819 0h187.718003z" fill="#ffffff" p-id="6727"></path></svg>',"080kts":'<svg t="1756204045675" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6883" width="200" height="200"><path d="M699.699515 0a29.865223 29.865223 0 0 1 29.865223 29.865223c0 0.426646-0.170658 0.853292-0.170659 1.237274a29.737229 29.737229 0 0 1-13.908661 26.238732l-170.658418 106.74684c-0.938621 0.597304-1.962572 0.981286-2.986522 1.450597v75.089704l146.339593-91.046266a29.865223 29.865223 0 1 1 31.571808 50.68555L541.840478 310.939638V385.688025l146.339593-91.046266a29.865223 29.865223 0 1 1 31.571808 50.68555l-177.911401 110.714649v74.663058l146.339593-91.003602a29.865223 29.865223 0 0 1 31.571808 50.685551l-177.911401 110.671984v330.864008l58.151856-46.504419a29.907888 29.907888 0 0 1 37.288864 46.717742l-106.661511 85.329209a29.865223 29.865223 0 0 1-37.288865 0l-106.661511-85.329209a29.865223 29.865223 0 0 1 37.288864-46.675077l58.151856 46.461754V34.131684c0-0.725298 0.127994-1.407932 0.213323-2.133231C482.238025 31.273155 482.110031 30.590521 482.110031 29.865223A29.865223 29.865223 0 0 1 511.975255 0h187.72426z" fill="#ffffff" p-id="6884"></path></svg>',"085kts":'<svg t="1756204058904" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7040" width="200" height="200"><path d="M699.676193 0a29.864228 29.864228 0 0 1 29.864228 29.864228c0 0.426632-0.170653 0.853264-0.170653 1.237232a29.736238 29.736238 0 0 1-13.908197 26.237857l-170.65273 106.743283c-0.93859 0.597285-1.962506 0.981253-2.986423 1.450548v58.021928l146.334716-91.043231a29.864228 29.864228 0 1 1 31.570755 50.683861L541.822418 293.906664V351.544624l146.334716-91.043232a29.864228 29.864228 0 1 1 31.570755 50.683861L541.822418 421.896212v57.637959l146.334716-91.043231a29.864228 29.864228 0 1 1 31.570755 50.683861l-177.905471 110.710958v55.376811l73.764642-46.076237a29.864228 29.864228 0 0 1 31.656082 50.641198l-105.378061 65.871954v256.19241l58.064591-46.502868a29.906891 29.906891 0 0 1 37.372948 46.716184l-106.657956 85.326365a29.864228 29.864228 0 0 1-37.372948 0l-106.657956-85.326365a29.864228 29.864228 0 0 1 37.372948-46.673521l58.107254 46.460205V34.130546c0-0.725274 0.12799-1.407885 0.213316-2.133159C482.221952 31.272113 482.093962 30.589502 482.093962 29.864228A29.864228 29.864228 0 0 1 511.95819 0h187.718003z" fill="#ffffff" p-id="7041"></path></svg>',"090kts":'<svg t="1756204072839" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7197" width="200" height="200"><path d="M699.699515 0a29.865223 29.865223 0 0 1 29.865223 29.865223c0 0.426646-0.170658 0.853292-0.170659 1.237274a29.737229 29.737229 0 0 1-13.908661 26.238732l-170.658418 106.74684c-0.938621 0.597304-1.962572 0.981286-2.986522 1.450597v58.023862l146.339593-91.046266a29.865223 29.865223 0 1 1 31.571808 50.68555L541.840478 293.916461V351.556341l146.339593-91.046266a29.865223 29.865223 0 1 1 31.571808 50.685551L541.840478 421.910274v57.639881l146.339593-91.046266a29.865223 29.865223 0 1 1 31.571808 50.68555l-177.911401 110.714649v57.639881l146.339593-91.046266a29.865223 29.865223 0 1 1 31.571808 50.68555l-177.911401 110.714649v254.025055l58.151856-46.504419a29.907888 29.907888 0 0 1 37.288864 46.717742l-106.661511 85.329209a29.865223 29.865223 0 0 1-37.288865 0l-106.661511-85.329209a29.865223 29.865223 0 0 1 37.288864-46.675077l58.151856 46.461754V34.131684c0-0.725298 0.127994-1.407932 0.213323-2.133231C482.238025 31.273155 482.110031 30.590521 482.110031 29.865223A29.865223 29.865223 0 0 1 511.975255 0h187.72426z" fill="#ffffff" p-id="7198"></path></svg>',"095kts":'<svg t="1756204086889" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7354" width="200" height="200"><path d="M699.676193 0a29.864228 29.864228 0 0 1 29.864228 29.864228c0 0.426632-0.170653 0.853264-0.170653 1.237232a29.736238 29.736238 0 0 1-13.908197 26.237857l-170.65273 106.743283c-0.93859 0.597285-1.962506 0.981253-2.986423 1.450548v45.222974l146.334716-91.043232a29.864228 29.864228 0 0 1 31.570755 50.683861L541.822418 281.150373V330.213033l146.334716-91.043232a29.864228 29.864228 0 1 1 31.570755 50.683861L541.822418 400.564621v49.105323l146.334716-91.043232a29.864228 29.864228 0 1 1 31.570755 50.683861l-177.905471 110.710959v49.062659l146.334716-91.000568a29.864228 29.864228 0 1 1 31.570755 50.683861l-177.905471 110.668295v42.577857l73.764642-46.076238a29.864228 29.864228 0 0 1 31.656082 50.683861l-105.378061 65.871954v179.398682l58.064591-46.502868a29.906891 29.906891 0 0 1 37.372948 46.716184l-106.657956 85.326365a29.864228 29.864228 0 0 1-37.372948 0l-106.657956-85.326365a29.864228 29.864228 0 0 1 37.372948-46.673521l58.107254 46.460205V34.130546c0-0.725274 0.12799-1.407885 0.213316-2.133159C482.221952 31.272113 482.093962 30.589502 482.093962 29.864228A29.864228 29.864228 0 0 1 511.95819 0h187.718003z" fill="#ffffff" p-id="7355"></path></svg>',"100kts":'<svg t="1756204093086" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7511" width="200" height="200"><path d="M699.699515 0a29.865223 29.865223 0 0 1 29.865223 29.865223c0 0.426646-0.170658 0.853292-0.170659 1.237274a29.737229 29.737229 0 0 1-13.908661 26.238732L568.420526 149.326116H699.699515a29.865223 29.865223 0 0 1 29.865223 29.865223c0 0.426646-0.170658 0.853292-0.170659 1.237274a29.737229 29.737229 0 0 1-13.908661 26.238731l-170.573089 106.746841c-0.981286 0.597304-2.047901 0.981286-3.071851 1.450597v617.058175l58.151856-46.504419a29.907888 29.907888 0 0 1 37.288864 46.717742l-106.661511 85.329209a29.865223 29.865223 0 0 1-37.288865 0l-106.661511-85.329209a29.865223 29.865223 0 0 1 37.288864-46.675077l58.151856 46.461754V34.131684c0-0.725298 0.127994-1.407932 0.213323-2.133231C482.238025 31.273155 482.110031 30.590521 482.110031 29.865223A29.865223 29.865223 0 0 1 511.975255 0h187.72426z" fill="#ffffff" p-id="7512"></path></svg>',"105kts":'<svg t="1756204103259" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7668" width="200" height="200"><path d="M699.699515 0a29.865223 29.865223 0 0 1 29.865223 29.865223c0 0.426646-0.170658 0.853292-0.170659 1.237274a29.737229 29.737229 0 0 1-13.908661 26.238732L568.420526 149.326116H699.699515a29.865223 29.865223 0 0 1 29.865223 29.865223c0 0.426646-0.170658 0.853292-0.170659 1.237274a29.737229 29.737229 0 0 1-13.908661 26.238731l-170.658418 106.746841c-0.938621 0.597304-1.962572 0.981286-2.986522 1.450597v79.356164l146.339593-91.046266a29.865223 29.865223 0 1 1 31.571808 50.68555l-177.911401 110.714649v467.348078l58.151856-46.504419a29.907888 29.907888 0 0 1 37.288864 46.717742l-106.661511 85.329209a29.865223 29.865223 0 0 1-37.288865 0l-106.661511-85.329209a29.865223 29.865223 0 0 1 37.288864-46.675077l58.151856 46.461754V34.131684c0-0.725298 0.127994-1.407932 0.213323-2.133231C482.238025 31.273155 482.110031 30.590521 482.110031 29.865223A29.865223 29.865223 0 0 1 511.975255 0h187.72426z" fill="#ffffff" p-id="7669"></path></svg>'},yc={name:"IdmWindBarb",props:{map:{type:Object},wind:{type:Object},beforeLayer:{type:String},theme:{type:String},mapFeather:{type:String},hasRampLayer:{type:Boolean},nautical:{type:String}},emits:[],data(){return{source:"wind-barb-source",barbs:[0,2,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105],empty:V.featureCollection([]),windBarbLoaded:!1,svgs:fc}},computed:{opacity(){return(this.mapFeather==="light"||this.nautical==="hi"||this.nautical==="i4")&&!this.hasRampLayer?.6:.7},color(){return(this.mapFeather==="light"||this.nautical==="hi"||this.nautical==="i4")&&!this.hasRampLayer?"#000623":"#ffffff"}},watch:{"wind.version":{handler(){var t;(t=this.wind)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},color:{handler(){var t;(t=this.wind)!=null&&t.active&&(this.handleClear(),this.handleRender())}}},methods:{handleRender(){var t,e,a;if(this.map&&this.wind){const r=new Date().valueOf();let i=0;const l=this.wind.active?this.wind.data:this.empty;if((t=this.map)!=null&&t.getSource(this.source))(e=this.map)==null||e.getSource(this.source).setData(l),new Date().valueOf()-(r+i);else{this.map.addSource(this.source,{type:"geojson",data:l});for(let n=0;n<(this.barbs??[]).length-1;n++){const s=(this.barbs??[])[n]||0,c=(this.barbs??[])[n+1]||0,m=s<10?`00${s}kts`:s<100?`0${s}kts`:`${s}kts`,d=new Image(48,48),u=(a=this.svgs[m].replace(/fill="#ffffff"/g,`fill="${this.color}"`))==null?void 0:a.replace(/fill="#000623"/g,`fill="${this.color}"`);d.src="data:image/svg+xml;base64,"+window.btoa(u),d.onload=()=>{this.map.hasImage(m+"-icon")?this.map.updateImage(m+"-icon",d):this.map.addImage(m+"-icon",d),this.map.getLayer(m)||this.map.addLayer({id:m,type:"symbol",filter:["all",[">=","spd",s],["<","spd",c]],source:this.source,layout:{"symbol-placement":"point","icon-image":m+"-icon","icon-size":.5,"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"dir",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":this.opacity}},this.beforeLayer)}}this.windBarbLoaded=!0,new Date().valueOf()-(r+i)}}},handleClear(){for(const t of this.barbs??[]){const e=t<10?`00${t}kts`:t<100?`0${t}kts`:`${t}kts`;this.map.getLayer(e)&&this.map.removeLayer(e),this.map.hasImage(e+"-icon")&&this.map.removeImage(e+"-icon")}this.map.getSource(this.source)&&this.map.removeSource(this.source),this.windBarbLoaded=!1}}};function bc(t,e,a,r,i,l){return null}const wc=K(yc,[["render",bc]]),ab="",xc={name:"IdmWindParticle",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:to},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleCount:this.simple?3e3:9e3,particleOptions:{fadeOpacity:.95,speedFactor:this.simple?.1:.2,dropRate:.003,dropRateBump:.01,uvRange:[-25,26],sRange:[0,31.985]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{async handler(){var t,e;(t=this.factor)!=null&&t.active?await this.handleRender():this.handleClear(),(e=this.factor)!=null&&e.particle||this.handleClearParticle()},immediate:!0},"factor.particle":{async handler(t,e){t!==e&&e!==void 0&&(t?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},beforeUnmount(){this.handleClear()},methods:{async handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;await this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[wind-particle] add elapsed: ",a,", total: ",e+=a)}},handleSetup(){var t;if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const e=[[0,"rgb(98, 113, 184, 0.8)"],[12/255,"rgb(98, 113, 184)"],[24/255,"rgb(61, 110, 163)"],[32/255,"rgb(74, 146, 148)"],[40/255,"rgb(77, 142, 124)"],[60/255,"rgb(76, 164, 76)"],[80/255,"rgb(103, 164, 54)"],[100/255,"rgb(162, 135, 64)"],[120/255,"rgb(162, 109, 92)"],[140/255,"rgb(141, 63, 92)"],[160/255,"rgb(151, 75, 145)"],[200/255,"rgb(95, 100, 160)"],[240/255,"rgb(91, 136, 161)"],[1,"rgb(91, 136, 161)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:a,aPositionBuffer:r}=this.webgl.bind(this.context,fe.vertexSchema,fe.uvFragmentSchema);this.program=a,this.aPositionBuffer=r}(t=this.factor)!=null&&t.particle&&this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){if(this.particleContext=this.webgl.createParticleContext(this.viewport.particleCanvas),!this.particleContext)return;const t=[[0,"rgb(183,224,224)"],[1,"rgb(217,220,220)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,...at.getSources(this.webgl.isWebGL2(this.particleContext))),this.wrapper.color=this.webgl.setup(this.particleContext,t,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,this.particleCount),...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(){var a;if(this.handleSetup(),!this.context)return;const t=this.context,e=this.factor.etime;if(this.etime!==e||this.particleContext&&!this.particleTexture){const r=await this.webgl.loadImg(this.factor.raw);if(this.context!==t||!((a=this.factor)!=null&&a.active)||this.factor.etime!==e)return;this.etime=e,this.context.deleteTexture(this.texture||null),this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,r),this.particleContext&&this.wrapper&&this.factor.particle&&(this.particleContext.deleteTexture(this.particleTexture||null),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,r),this.wrapper.image=r)}this.initial&&this.particleTexture&&(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.particleContext||!this.wrapper||(this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext,this.wrapper)})},handlePause(){var t;this.paused=!0,this.animation!=null&&cancelAnimationFrame(this.animation),this.animation=void 0,(t=this.viewport)==null||t.toggleParticle(!1)},handlePlay(){var t,e;!((t=this.factor)!=null&&t.active)||!((e=this.factor)!=null&&e.particle)||!this.particleContext||!this.particleTexture||!this.wrapper||this.animation!=null||(this.paused=!1,this.animation=requestAnimationFrame(()=>{var a,r;this.animation=void 0,!(this.paused||!((a=this.factor)!=null&&a.active)||!((r=this.factor)!=null&&r.particle)||!this.particleContext||!this.wrapper)&&(this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay())}))},handleClearParticle(){var t,e,a,r,i,l,n;this.handlePause(),this.webgl.destroyParticle(this.particleContext,this.wrapper),(t=this.particleContext)==null||t.deleteTexture(this.particleTexture||null),this.wrapper=void 0,this.particleTexture=void 0,this.particleContext=void 0,this.initial=!0,(a=(e=this.viewport)==null?void 0:e.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)},handleClear(){var t;(t=this.viewport)==null||t.toggle(!1),this.context=void 0,this.etime=void 0,this.handleClearParticle()}}},kc={key:0};function Ac(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",kc,[o.createElementVNode("div",{class:"legend-bars-gl4 wind",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[0]=[o.createElementVNode("span",null,"kts",-1),o.createElementVNode("span",null,"0",-1),o.createElementVNode("span",null,"5",-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),o.createElementVNode("span",null,"60",-1)]),4)])):o.createCommentVNode("",!0)}const Lc=K(xc,[["render",Ac]]),vc={name:"IdmCurrent",props:{map:{type:Object},current:{type:Object},beforeLayer:{type:String},theme:{type:String},mapFeather:{type:String},hasRampLayer:{type:Boolean},nautical:{type:String}},emits:[],data(){return{source:"current-source",directionLayer:"current-direction-layer",speedLayer:"current-speed-layer",speedLabelLayer:"current-speed-label-layer",empty:V.featureCollection([])}},computed:{opacity(){return(this.mapFeather==="light"||this.nautical==="hi"||this.nautical==="i4")&&!this.hasRampLayer?.6:.7},color(){return(this.mapFeather==="light"||this.nautical==="hi"||this.nautical==="i4")&&!this.hasRampLayer?"#000623":"#ffffff"}},watch:{"current.version":{handler(){var t;(t=this.current)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},color:{handler(){var t;(t=this.current)!=null&&t.active&&(this.handleClear(),this.handleRender())}}},methods:{handleRender(){var t,e;if(this.map&&this.current){const a=new Date().valueOf();let r=0,i=0;const l=this.current.active?this.current.data:this.empty;if((t=this.map)!=null&&t.getSource(this.source))(e=this.map)==null||e.getSource(this.source).setData(l),i=new Date().valueOf()-(a+r),console.log("[current] update elapsed: ",i,", total: ",r+=i);else{this.map.addSource(this.source,{type:"geojson",data:l}),this.map.addLayer({id:this.speedLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":["step",["get","val"],"rgb(58, 164, 58)",1,"#ffff00",2,"#ff9500",3,"#f44336"]}},this.beforeLayer),this.map.addLayer({id:this.speedLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Polygon"],layout:{"symbol-placement":"line","text-field":"{val} kts","text-allow-overlap":!0,"text-rotation-alignment":"viewport","text-size":12},paint:{"text-color":"rgba(0, 0, 0, 0.8)"}},this.beforeLayer);const n=new Image(48,48),s=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
402
402
|
<path d="M10 2.5V17.5" stroke="${this.color}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
403
403
|
<path d="M5 7.5L10 2.5L15 7.5" stroke="${this.color}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
404
|
-
</svg>`;n.src="data:image/svg+xml;base64,"+window.btoa(s);const c=[n];let m=0;c.forEach(d=>{d.onload=()=>{m++,this.map.hasImage("currentDirIcon")?this.map.updateImage("currentDirIcon",n):this.map.addImage("currentDirIcon",n),m===1&&!this.map.getLayer(this.directionLayer)&&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)}}},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.hasImage("currentDirIcon")&&this.map.removeImage("currentDirIcon"),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Cc(t,e,a,r,i,l){return null}const zc=K(vc,[["render",Cc]]),ib="",_c={name:"IdmCurrentParticle",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:to},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleCount:this.simple?6e3:13e3,particleOptions:{fadeOpacity:.99,speedFactor:this.simple?1.2:2,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 t,e;(t=this.factor)!=null&&t.active?await this.handleRender():this.handleClear(),(e=this.factor)!=null&&e.particle||this.handleClearParticle()},immediate:!0},"factor.particle":{async handler(t,e){t!==e&&e!==void 0&&(t?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},beforeUnmount(){this.handleClear()},methods:{async handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;await this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[current-particle] add elapsed: ",a,", total: ",e+=a)}},handleSetup(){var t;if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;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:a,aPositionBuffer:r}=this.webgl.bind(this.context,fe.vertexSchema,fe.uvFragmentSchema);this.program=a,this.aPositionBuffer=r}(t=this.factor)!=null&&t.particle&&this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){if(this.particleContext=this.webgl.createParticleContext(this.viewport.particleCanvas),!this.particleContext)return;const t=[[0,"rgb(183,224,224)"],[1,"rgb(199,202,202)"],[.6,"rgb(199,202,202)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,...at.getSources(this.webgl.isWebGL2(this.particleContext))),this.wrapper.color=this.webgl.setup(this.particleContext,t,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,this.particleCount),...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(){var a;if(this.handleSetup(),!this.context)return;const t=this.context,e=this.factor.etime;if(this.etime!==e||this.particleContext&&!this.particleTexture){const r=await this.webgl.loadImg(this.factor.raw);if(this.context!==t||!((a=this.factor)!=null&&a.active)||this.factor.etime!==e)return;this.etime=e,this.context.deleteTexture(this.texture||null),this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,r),this.particleContext&&this.wrapper&&this.factor.particle&&(this.particleContext.deleteTexture(this.particleTexture||null),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,r),this.wrapper.image=r)}this.initial&&this.particleTexture&&(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.particleContext||!this.wrapper||(this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext,this.wrapper)})},handlePause(){var t;this.paused=!0,this.animation!=null&&cancelAnimationFrame(this.animation),this.animation=void 0,(t=this.viewport)==null||t.toggleParticle(!1)},handlePlay(){var t,e;!((t=this.factor)!=null&&t.active)||!((e=this.factor)!=null&&e.particle)||!this.particleContext||!this.particleTexture||!this.wrapper||this.animation!=null||(this.paused=!1,this.animation=requestAnimationFrame(()=>{var a,r;this.animation=void 0,!(this.paused||!((a=this.factor)!=null&&a.active)||!((r=this.factor)!=null&&r.particle)||!this.particleContext||!this.wrapper)&&(this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay())}))},handleClearParticle(){var t,e,a,r,i,l,n;this.handlePause(),this.webgl.destroyParticle(this.particleContext,this.wrapper),(t=this.particleContext)==null||t.deleteTexture(this.particleTexture||null),this.wrapper=void 0,this.particleTexture=void 0,this.particleContext=void 0,this.initial=!0,(a=(e=this.viewport)==null?void 0:e.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)},handleClear(){var t;(t=this.viewport)==null||t.toggle(!1),this.context=void 0,this.etime=void 0,this.handleClearParticle()}}},Sc={key:0};function Pc(t,e,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 current",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[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 Nc=K(_c,[["render",Pc]]),rb="",Mc={name:"IdmSigWaveParticle",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:to},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,rendererKey:"sig-wave-particle",backgroundFragmentSchema:fe.sigWaveFragmentSchema,etime:void 0,dataSource:void 0,imageSource:void 0,imageEtime:void 0,imagePromise:void 0,drawVersion:0,wrapper:void 0,animation:void 0,lastParticleFrameTime:void 0,particleContext:void 0,particleTexture:void 0,particleCount:this.simple?3e3:9e3,particleOptions:{fadeOpacity:0,lineLength:6,lineOpacity:.9,speedFactor:this.simple?.1:.2,dropRate:0,dropRateBump:0,uvRange:[0,12.75],sRange:[0,12.75]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{async handler(){var t,e;(t=this.factor)!=null&&t.active?await this.handleRender():this.handleClear(),(e=this.factor)!=null&&e.particle||this.handleClearParticle()},immediate:!0},"factor.particle":{async handler(t,e){var a;t!==e&&e!==void 0&&(t&&((a=this.factor)!=null&&a.active)?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},beforeUnmount(){this.handleClear(),this.imagePromise=void 0,this.imageSource=void 0,this.imageEtime=void 0},methods:{async handleRender(){var t;if(!(!((t=this.factor)!=null&&t.active)||!this.viewport))try{const e=new Date().valueOf();let a=0,r=0;await this.handleDraw(),r=new Date().valueOf()-(e+a),console.log(`[${this.rendererKey}] add elapsed: `,r,", total: ",a+=r)}catch(e){this.handleClear(),console.error(`[${this.rendererKey}] Render failed:`,e)}},handleSetup(){var t;if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;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:a,aPositionBuffer:r}=this.webgl.bind(this.context,fe.vertexSchema,this.backgroundFragmentSchema);this.program=a,this.aPositionBuffer=r}(t=this.factor)!=null&&t.particle&&this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){if(this.particleContext=this.webgl.createParticleContext(this.viewport.particleCanvas),!this.particleContext)return;const t=[[0,"rgb(183,224,224)"],[1,"rgb(217,220,220)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,...so.getSources(this.webgl.isWebGL2(this.particleContext))),this.wrapper.color=this.webgl.setup(this.particleContext,t,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,this.particleCount,"lines",!0),...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(){var i;this.handleSetup();const t=this.context;if(!t)return;const e=++this.drawVersion,{raw:a,etime:r}=this.factor;if(!this.texture||this.etime!==r||this.dataSource!==a||this.particleContext&&!this.particleTexture){(this.imageSource!==a||this.imageEtime!==r||!this.imagePromise)&&(this.imageSource=a,this.imageEtime=r,this.imagePromise=this.webgl.loadImg(a));let l;try{l=await this.imagePromise}catch(n){if(e!==this.drawVersion)return;throw this.imagePromise=void 0,n}if(e!==this.drawVersion||this.context!==t||!((i=this.factor)!=null&&i.active)||this.factor.raw!==a||this.factor.etime!==r)return;this.etime=r,this.dataSource=a,this.context.deleteTexture(this.texture||null),this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,l),this.particleContext&&this.wrapper&&this.factor.particle&&(this.particleContext.deleteTexture(this.particleTexture||null),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.NEAREST,this.particleContext.CLAMP_TO_EDGE,l),this.wrapper.image=l,this.wrapper.resetLifecycle=!0,this.lastParticleFrameTime=void 0)}this.initial&&this.particleTexture&&(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.particleContext||!this.wrapper||(this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext,this.wrapper)})},handlePause(){var t;this.paused=!0,this.animation!=null&&cancelAnimationFrame(this.animation),this.animation=void 0,this.lastParticleFrameTime=void 0,this.particleContext&&((t=this.viewport)==null||t.toggleParticle(!1))},handlePlay(){var t,e;!((t=this.factor)!=null&&t.active)||!((e=this.factor)!=null&&e.particle)||!this.particleContext||!this.particleTexture||!this.wrapper||this.animation!=null||(this.paused=!1,this.animation=requestAnimationFrame(a=>{var i,l;if(this.animation=void 0,this.paused||!((i=this.factor)!=null&&i.active)||!((l=this.factor)!=null&&l.particle)||!this.particleContext||!this.wrapper)return;const r=this.lastParticleFrameTime==null?0:Math.max(0,(a-this.lastParticleFrameTime)/1e3);this.lastParticleFrameTime=a,this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions,r),this.viewport.toggleParticle(!0),this.handlePlay()}))},handleClearParticle(){var t,e,a,r,i,l,n;this.handlePause(),this.webgl.destroyParticle(this.particleContext,this.wrapper),(t=this.particleContext)==null||t.deleteTexture(this.particleTexture||null),this.wrapper=void 0,this.particleTexture=void 0,this.particleContext=void 0,this.initial=!0,(a=(e=this.viewport)==null?void 0:e.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)},handleClear(){var t,e;++this.drawVersion,this.context&&((t=this.viewport)==null||t.toggle(!1),this.context.deleteTexture(this.texture||null),this.context.deleteTexture(((e=this.rampColor)==null?void 0:e.texture)||null),this.context.deleteBuffer(this.aPositionBuffer||null),this.context.deleteProgram(this.program||null)),this.context=void 0,this.texture=void 0,this.rampColor=void 0,this.aPositionBuffer=void 0,this.program=void 0,this.etime=void 0,this.dataSource=void 0,this.handleClearParticle()}}},Tc={key:0};function Vc(t,e,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 sig-wave-particle",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[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 Ec=K(Mc,[["render",Vc],["__scopeId","data-v-0e362094"]]),Rc={name:"IdmSigWaveHeight",props:{map:{type:Object},sigWaveHeight:{type:Object},beforeLayer:{type:String}},data(){return{source:"sig-wave-height-source",heightLayer:"sig-wave-height-layer",heightLabelLayer:"sig-wave-height-label-layer",empty:V.featureCollection([])}},watch:{"sigWaveHeight.version":{handler(){var t;(t=this.sigWaveHeight)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var t,e;if(this.sigWaveHeight){const a=new Date().valueOf();let r=0,i=0,l=this.empty;this.sigWaveHeight.active&&(l=this.sigWaveHeight.data),(t=this.map)!=null&&t.getSource(this.source)?((e=this.map)==null||e.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 Dc(t,e,a,r,i,l){return null}const Bc=K(Rc,[["render",Dc]]),lb="",Ic={name:"IdmSwellParticle",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:to},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,rendererKey:"swell-particle",backgroundFragmentSchema:fe.fragmentSchema,etime:void 0,dataSource:void 0,imageSource:void 0,imagePromise:void 0,drawVersion:0,wrapper:void 0,animation:void 0,lastParticleFrameTime:void 0,particleContext:void 0,particleTexture:void 0,particleCount:this.simple?3e3:9e3,particleOptions:{fadeOpacity:0,lineLength:6,lineOpacity:.9,speedFactor:this.simple?.1:.2,dropRate:0,dropRateBump:0,uvRange:[0,12.75],sRange:[0,12.75]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{async handler(){var t,e;(t=this.factor)!=null&&t.active?await this.handleRender():this.handleClear(),(e=this.factor)!=null&&e.particle||this.handleClearParticle()},immediate:!0},"factor.particle":{async handler(t,e){var a;t!==e&&e!==void 0&&(t&&((a=this.factor)!=null&&a.active)?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},beforeUnmount(){this.handleClear(),this.imagePromise=void 0,this.imageSource=void 0},methods:{async handleRender(){var t;if(!(!((t=this.factor)!=null&&t.active)||!this.viewport))try{const e=new Date().valueOf();await this.handleDraw(),console.log(`[${this.rendererKey}] 渲染耗时: `,new Date().valueOf()-e)}catch(e){this.handleClear(),console.error(`[${this.rendererKey}] 渲染失败:`,e)}},handleSetup(){var t;if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;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:a,aPositionBuffer:r}=this.webgl.bind(this.context,fe.vertexSchema,this.backgroundFragmentSchema);this.program=a,this.aPositionBuffer=r}(t=this.factor)!=null&&t.particle&&this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){if(this.particleContext=this.webgl.createParticleContext(this.viewport.particleCanvas),!this.particleContext)return;const t=[[0,"rgb(183,224,224)"],[1,"rgb(217,220,220)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,...so.getSources(this.webgl.isWebGL2(this.particleContext))),this.wrapper.color=this.webgl.setup(this.particleContext,t,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,this.particleCount,"lines",!0),...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(){var i;this.handleSetup();const t=this.context;if(!t)return;const e=++this.drawVersion,{raw:a,etime:r}=this.factor;if(!this.texture||this.etime!==r||this.dataSource!==a||this.particleContext&&!this.particleTexture){(this.imageSource!==a||!this.imagePromise)&&(this.imageSource=a,this.imagePromise=this.webgl.loadImg(a));let l;try{l=await this.imagePromise}catch(n){if(e!==this.drawVersion)return;throw this.imagePromise=void 0,n}if(e!==this.drawVersion||this.context!==t||!((i=this.factor)!=null&&i.active)||this.factor.raw!==a||this.factor.etime!==r)return;this.etime=r,this.dataSource=a,this.context.deleteTexture(this.texture||null),this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,l),this.particleContext&&this.wrapper&&this.factor.particle&&(this.particleContext.deleteTexture(this.particleTexture||null),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.NEAREST,this.particleContext.CLAMP_TO_EDGE,l),this.wrapper.image=l,this.wrapper.resetLifecycle=!0,this.lastParticleFrameTime=void 0)}this.initial&&this.particleTexture&&(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.particleContext||!this.wrapper||(this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext,this.wrapper)})},handlePause(){var t;this.paused=!0,this.animation!=null&&cancelAnimationFrame(this.animation),this.animation=void 0,this.lastParticleFrameTime=void 0,this.particleContext&&((t=this.viewport)==null||t.toggleParticle(!1))},handlePlay(){var t,e;!((t=this.factor)!=null&&t.active)||!((e=this.factor)!=null&&e.particle)||!this.particleContext||!this.particleTexture||!this.wrapper||this.animation!=null||(this.paused=!1,this.animation=requestAnimationFrame(a=>{var i,l;if(this.animation=void 0,this.paused||!((i=this.factor)!=null&&i.active)||!((l=this.factor)!=null&&l.particle)||!this.particleContext||!this.wrapper)return;const r=this.lastParticleFrameTime==null?0:Math.max(0,(a-this.lastParticleFrameTime)/1e3);this.lastParticleFrameTime=a,this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions,r),this.viewport.toggleParticle(!0),this.handlePlay()}))},handleClearParticle(){var t,e,a,r,i,l,n;this.handlePause(),this.webgl.destroyParticle(this.particleContext,this.wrapper),(t=this.particleContext)==null||t.deleteTexture(this.particleTexture||null),this.wrapper=void 0,this.particleTexture=void 0,this.particleContext=void 0,this.initial=!0,(a=(e=this.viewport)==null?void 0:e.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)},handleClear(){var t,e;++this.drawVersion,this.context&&((t=this.viewport)==null||t.toggle(!1),this.context.deleteTexture(this.texture||null),this.context.deleteTexture(((e=this.rampColor)==null?void 0:e.texture)||null),this.context.deleteBuffer(this.aPositionBuffer||null),this.context.deleteProgram(this.program||null)),this.context=void 0,this.texture=void 0,this.rampColor=void 0,this.aPositionBuffer=void 0,this.program=void 0,this.etime=void 0,this.dataSource=void 0,this.handleClearParticle()}}},Fc={key:0};function Gc(t,e,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 swell",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[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 jc=K(Ic,[["render",Gc],["__scopeId","data-v-c0342437"]]),Wc={name:"IdmSwellDirection",props:{map:{type:Object},swell:{type:Object},beforeLayer:{type:String},mapFeather:{type:String},hasRampLayer:{type:Boolean},nautical:{type:String}},data(){return{source:"swell-source",directionLayer:"swell-direction-layer",heightLayer:"swell-height-layer",heightLabelLayer:"swell-height-label-layer",empty:V.featureCollection([])}},computed:{opacity(){return(this.mapFeather==="light"||this.nautical==="hi"||this.nautical==="i4")&&!this.hasRampLayer?.6:.7},color(){return(this.mapFeather==="light"||this.nautical==="hi"||this.nautical==="i4")&&!this.hasRampLayer?"#000623":"#ffffff"}},watch:{"swell.version":{handler(){var t;(t=this.swell)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},color:{handler(){var t;(t=this.swell)!=null&&t.active&&(this.handleClear(),this.handleRender())}}},methods:{handleRender(){var t,e;if(this.swell){const a=new Date().valueOf();let r=0,i=this.empty;if(this.swell.active&&(i=this.swell.data),(t=this.map)!=null&&t.getSource(this.source))(e=this.map)==null||e.getSource(this.source).setData(i),new Date().valueOf()-(a+r);else{this.map.addSource(this.source,{type:"geojson",data:i}),this.map.addLayer({id:this.heightLayer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-opacity":1,"line-width":1,"line-color":["match",["get","val"],2,"rgba(255,255,0,0.9)",3,"rgba(255,149,0,0.9)",4,"rgba(244,67,54,0.9)",5,"rgba(162,2,31,0.9)",6,"rgba(162,2,31,0.9)","rgba(162,2,31,0.9)"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","LineString"],layout:{"symbol-placement":"line","text-rotation-alignment":"viewport","text-field":"{val}m","text-size":11},paint:{"text-color":["step",["get","val"],"black",4,"white",5,"white",6,"white"],"text-halo-color":["match",["get","val"],2,"rgba(255,255,0,0.7)",3,"rgba(255,149,0,0.7)",4,"rgba(244,67,54,0.7)",5,"rgba(162,13,2,0.7)",6,"rgba(162,13,2,0.7)","rgba(162,13,2,0.7)"],"text-halo-width":2}},this.beforeLayer);const l=new Image(72,72);let n=`<svg t="1752721890391" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12518" width="200" height="200"><path d="M481.386772 959.514313 481.386772 334.713224c-56.000432 37.288255-92.523253 55.876612-142.312216 57.787124 85.834924-84.884272 130.528845-195.161888 172.552961-328.434218 40.259936 133.272329 89.39296 238.731196 172.622546 328.434218-54.105269-5.729491-86.780459-21.201881-146.338926-58.965973l0 625.979938L481.386772 959.514313z" p-id="12519" fill="${this.color}"></path></svg>`,s="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(n)));l.src=s,l.onload=()=>{this.map.hasImage("swellDirIconWhite")?this.map.updateImage("swellDirIconWhite",l):this.map.addImage("swellDirIconWhite",l),this.map.getLayer(this.directionLayer)||this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"swellDirIconWhite","icon-size":{base:1,stops:[[2,.32],[6,.5]]},"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,180],[360,540]]}},paint:{"icon-opacity":this.opacity}},this.beforeLayer)},new Date().valueOf()-(a+r)}}},handleClear(){this.map.getLayer(this.heightLayer)&&this.map.removeLayer(this.heightLayer),this.map.getLayer(this.heightLabelLayer)&&this.map.removeLayer(this.heightLabelLayer),this.map.getLayer(this.directionLayer)&&this.map.removeLayer(this.directionLayer),this.map.hasImage("swellDirIconWhite")&&this.map.removeImage("swellDirIconWhite"),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Zc(t,e,a,r,i,l){return o.openBlock(),o.createElementBlock("div")}const Hc=K(Wc,[["render",Zc]]),Xc={name:"IdmPrmsl",props:{map:{type:Object},prmsl:{type:Object},beforeLayer:{type:String},theme:{type:String}},data(){return{source:"prmsl-source",layer:"prmsl-layer",labelLayer:"prmsl-label-layer",pointLabelLayer:"prmsl-point-label-layer",empty:V.featureCollection([])}},watch:{"prmsl.version":{handler(){var t;(t=this.prmsl)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var t,e,a;if(this.prmsl){const r=new Date().valueOf();let i=0,l=0,n=this.empty;this.prmsl.active&&(n=this.prmsl.data),(t=this.map)!=null&&t.getSource(this.source)?((e=this.map)==null||e.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},`
|
|
404
|
+
</svg>`;n.src="data:image/svg+xml;base64,"+window.btoa(s);const c=[n];let m=0;c.forEach(d=>{d.onload=()=>{m++,this.map.hasImage("currentDirIcon")?this.map.updateImage("currentDirIcon",n):this.map.addImage("currentDirIcon",n),m===1&&!this.map.getLayer(this.directionLayer)&&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)}}},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.hasImage("currentDirIcon")&&this.map.removeImage("currentDirIcon"),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Cc(t,e,a,r,i,l){return null}const zc=K(vc,[["render",Cc]]),ib="",_c={name:"IdmCurrentParticle",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:to},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleCount:this.simple?6e3:13e3,particleOptions:{fadeOpacity:.99,speedFactor:this.simple?1.2:2,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 t,e;(t=this.factor)!=null&&t.active?await this.handleRender():this.handleClear(),(e=this.factor)!=null&&e.particle||this.handleClearParticle()},immediate:!0},"factor.particle":{async handler(t,e){t!==e&&e!==void 0&&(t?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},beforeUnmount(){this.handleClear()},methods:{async handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;await this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[current-particle] add elapsed: ",a,", total: ",e+=a)}},handleSetup(){var t;if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;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:a,aPositionBuffer:r}=this.webgl.bind(this.context,fe.vertexSchema,fe.uvFragmentSchema);this.program=a,this.aPositionBuffer=r}(t=this.factor)!=null&&t.particle&&this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){if(this.particleContext=this.webgl.createParticleContext(this.viewport.particleCanvas),!this.particleContext)return;const t=[[0,"rgb(183,224,224)"],[1,"rgb(199,202,202)"],[.6,"rgb(199,202,202)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,...at.getSources(this.webgl.isWebGL2(this.particleContext))),this.wrapper.color=this.webgl.setup(this.particleContext,t,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,this.particleCount),...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(){var a;if(this.handleSetup(),!this.context)return;const t=this.context,e=this.factor.etime;if(this.etime!==e||this.particleContext&&!this.particleTexture){const r=await this.webgl.loadImg(this.factor.raw);if(this.context!==t||!((a=this.factor)!=null&&a.active)||this.factor.etime!==e)return;this.etime=e,this.context.deleteTexture(this.texture||null),this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,r),this.particleContext&&this.wrapper&&this.factor.particle&&(this.particleContext.deleteTexture(this.particleTexture||null),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,r),this.wrapper.image=r)}this.initial&&this.particleTexture&&(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.particleContext||!this.wrapper||(this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext,this.wrapper)})},handlePause(){var t;this.paused=!0,this.animation!=null&&cancelAnimationFrame(this.animation),this.animation=void 0,(t=this.viewport)==null||t.toggleParticle(!1)},handlePlay(){var t,e;!((t=this.factor)!=null&&t.active)||!((e=this.factor)!=null&&e.particle)||!this.particleContext||!this.particleTexture||!this.wrapper||this.animation!=null||(this.paused=!1,this.animation=requestAnimationFrame(()=>{var a,r;this.animation=void 0,!(this.paused||!((a=this.factor)!=null&&a.active)||!((r=this.factor)!=null&&r.particle)||!this.particleContext||!this.wrapper)&&(this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay())}))},handleClearParticle(){var t,e,a,r,i,l,n;this.handlePause(),this.webgl.destroyParticle(this.particleContext,this.wrapper),(t=this.particleContext)==null||t.deleteTexture(this.particleTexture||null),this.wrapper=void 0,this.particleTexture=void 0,this.particleContext=void 0,this.initial=!0,(a=(e=this.viewport)==null?void 0:e.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)},handleClear(){var t;(t=this.viewport)==null||t.toggle(!1),this.context=void 0,this.etime=void 0,this.handleClearParticle()}}},Sc={key:0};function Pc(t,e,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 current",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[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 Nc=K(_c,[["render",Pc]]),rb="",Mc={name:"IdmSigWaveParticle",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:to},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,rendererKey:"sig-wave-particle",backgroundFragmentSchema:fe.sigWaveFragmentSchema,etime:void 0,dataSource:void 0,imageSource:void 0,imageEtime:void 0,imagePromise:void 0,drawVersion:0,wrapper:void 0,animation:void 0,lastParticleFrameTime:void 0,particleContext:void 0,particleTexture:void 0,particleCount:this.simple?3e3:9e3,particleOptions:{fadeOpacity:0,lineLength:6,lineOpacity:.9,speedFactor:this.simple?.1:.2,dropRate:0,dropRateBump:0,uvRange:[0,12.75],sRange:[0,12.75]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{async handler(){var t,e;(t=this.factor)!=null&&t.active?await this.handleRender():this.handleClear(),(e=this.factor)!=null&&e.particle||this.handleClearParticle()},immediate:!0},"factor.particle":{async handler(t,e){var a;t!==e&&e!==void 0&&(t&&((a=this.factor)!=null&&a.active)?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},beforeUnmount(){this.handleClear(),this.imagePromise=void 0,this.imageSource=void 0,this.imageEtime=void 0},methods:{async handleRender(){var t;if(!(!((t=this.factor)!=null&&t.active)||!this.viewport))try{const e=new Date().valueOf();let a=0,r=0;await this.handleDraw(),r=new Date().valueOf()-(e+a),console.log(`[${this.rendererKey}] add elapsed: `,r,", total: ",a+=r)}catch(e){this.handleClear(),console.error(`[${this.rendererKey}] Render failed:`,e)}},handleSetup(){var t;if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;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:a,aPositionBuffer:r}=this.webgl.bind(this.context,fe.vertexSchema,this.backgroundFragmentSchema);this.program=a,this.aPositionBuffer=r}(t=this.factor)!=null&&t.particle&&this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){if(this.particleContext=this.webgl.createParticleContext(this.viewport.particleCanvas),!this.particleContext)return;const t=[[0,"rgb(183,224,224)"],[1,"rgb(217,220,220)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,...so.getSources(this.webgl.isWebGL2(this.particleContext))),this.wrapper.color=this.webgl.setup(this.particleContext,t,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,this.particleCount,"lines",!0),...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(){var i;this.handleSetup();const t=this.context;if(!t)return;const e=++this.drawVersion,{raw:a,etime:r}=this.factor;if(!this.texture||this.etime!==r||this.dataSource!==a||this.particleContext&&!this.particleTexture){(this.imageSource!==a||this.imageEtime!==r||!this.imagePromise)&&(this.imageSource=a,this.imageEtime=r,this.imagePromise=this.webgl.loadImg(a));let l;try{l=await this.imagePromise}catch(n){if(e!==this.drawVersion)return;throw this.imagePromise=void 0,n}if(e!==this.drawVersion||this.context!==t||!((i=this.factor)!=null&&i.active)||this.factor.raw!==a||this.factor.etime!==r)return;this.etime=r,this.dataSource=a,this.context.deleteTexture(this.texture||null),this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,l),this.particleContext&&this.wrapper&&this.factor.particle&&(this.particleContext.deleteTexture(this.particleTexture||null),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.NEAREST,this.particleContext.CLAMP_TO_EDGE,l),this.wrapper.image=l,this.wrapper.resetLifecycle=!0,this.lastParticleFrameTime=void 0)}this.initial&&this.particleTexture&&(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.particleContext||!this.wrapper||(this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext,this.wrapper)})},handlePause(){var t;this.paused=!0,this.animation!=null&&cancelAnimationFrame(this.animation),this.animation=void 0,this.lastParticleFrameTime=void 0,this.particleContext&&((t=this.viewport)==null||t.toggleParticle(!1))},handlePlay(){var t,e;!((t=this.factor)!=null&&t.active)||!((e=this.factor)!=null&&e.particle)||!this.particleContext||!this.particleTexture||!this.wrapper||this.animation!=null||(this.paused=!1,this.animation=requestAnimationFrame(a=>{var i,l;if(this.animation=void 0,this.paused||!((i=this.factor)!=null&&i.active)||!((l=this.factor)!=null&&l.particle)||!this.particleContext||!this.wrapper)return;const r=this.lastParticleFrameTime==null?0:Math.max(0,(a-this.lastParticleFrameTime)/1e3);this.lastParticleFrameTime=a,this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions,r),this.viewport.toggleParticle(!0),this.handlePlay()}))},handleClearParticle(){var t,e,a,r,i,l,n;this.handlePause(),this.webgl.destroyParticle(this.particleContext,this.wrapper),(t=this.particleContext)==null||t.deleteTexture(this.particleTexture||null),this.wrapper=void 0,this.particleTexture=void 0,this.particleContext=void 0,this.initial=!0,(a=(e=this.viewport)==null?void 0:e.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)},handleClear(){var t,e;++this.drawVersion,this.context&&((t=this.viewport)==null||t.toggle(!1),this.context.deleteTexture(this.texture||null),this.context.deleteTexture(((e=this.rampColor)==null?void 0:e.texture)||null),this.context.deleteBuffer(this.aPositionBuffer||null),this.context.deleteProgram(this.program||null)),this.context=void 0,this.texture=void 0,this.rampColor=void 0,this.aPositionBuffer=void 0,this.program=void 0,this.etime=void 0,this.dataSource=void 0,this.handleClearParticle()}}},Tc={key:0};function Vc(t,e,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 sig-wave-particle",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[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 Ec=K(Mc,[["render",Vc],["__scopeId","data-v-0e362094"]]),Rc={name:"IdmSigWaveHeight",props:{map:{type:Object},sigWaveHeight:{type:Object},beforeLayer:{type:String}},data(){return{source:"sig-wave-height-source",heightLayer:"sig-wave-height-layer",heightLabelLayer:"sig-wave-height-label-layer",empty:V.featureCollection([])}},watch:{"sigWaveHeight.version":{handler(){var t;(t=this.sigWaveHeight)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var t,e;if(this.sigWaveHeight){const a=new Date().valueOf();let r=0,i=0,l=this.empty;this.sigWaveHeight.active&&(l=this.sigWaveHeight.data),(t=this.map)!=null&&t.getSource(this.source)?((e=this.map)==null||e.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 Dc(t,e,a,r,i,l){return null}const Bc=K(Rc,[["render",Dc]]),lb="",Ic={name:"IdmSwellParticle",props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:to},menuToggle:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,rendererKey:"swell-particle",backgroundFragmentSchema:fe.fragmentSchema,etime:void 0,dataSource:void 0,imageSource:void 0,imagePromise:void 0,drawVersion:0,wrapper:void 0,animation:void 0,lastParticleFrameTime:void 0,particleContext:void 0,particleTexture:void 0,particleCount:this.simple?3e3:9e3,particleOptions:{fadeOpacity:0,lineLength:6,lineOpacity:.9,speedFactor:this.simple?.1:.2,dropRate:0,dropRateBump:0,uvRange:[0,12.75],sRange:[0,12.75]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{async handler(){var t,e;(t=this.factor)!=null&&t.active?await this.handleRender():this.handleClear(),(e=this.factor)!=null&&e.particle||this.handleClearParticle()},immediate:!0},"factor.particle":{async handler(t,e){var a;t!==e&&e!==void 0&&(t&&((a=this.factor)!=null&&a.active)?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},beforeUnmount(){this.handleClear(),this.imagePromise=void 0,this.imageSource=void 0},methods:{async handleRender(){var t;if(!(!((t=this.factor)!=null&&t.active)||!this.viewport))try{const e=new Date().valueOf();await this.handleDraw(),console.log(`[${this.rendererKey}] 渲染耗时: `,new Date().valueOf()-e)}catch(e){this.handleClear(),console.error(`[${this.rendererKey}] 渲染失败:`,e)}},handleSetup(){var t;if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;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:a,aPositionBuffer:r}=this.webgl.bind(this.context,fe.vertexSchema,this.backgroundFragmentSchema);this.program=a,this.aPositionBuffer=r}(t=this.factor)!=null&&t.particle&&this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){if(this.particleContext=this.webgl.createParticleContext(this.viewport.particleCanvas),!this.particleContext)return;const t=[[0,"rgb(183,224,224)"],[1,"rgb(217,220,220)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,...so.getSources(this.webgl.isWebGL2(this.particleContext))),this.wrapper.color=this.webgl.setup(this.particleContext,t,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,this.particleCount,"lines",!0),...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(){var i;this.handleSetup();const t=this.context;if(!t)return;const e=++this.drawVersion,{raw:a,etime:r}=this.factor;if(!this.texture||this.etime!==r||this.dataSource!==a||this.particleContext&&!this.particleTexture){(this.imageSource!==a||!this.imagePromise)&&(this.imageSource=a,this.imagePromise=this.webgl.loadImg(a));let l;try{l=await this.imagePromise}catch(n){if(e!==this.drawVersion)return;throw this.imagePromise=void 0,n}if(e!==this.drawVersion||this.context!==t||!((i=this.factor)!=null&&i.active)||this.factor.raw!==a||this.factor.etime!==r)return;this.etime=r,this.dataSource=a,this.context.deleteTexture(this.texture||null),this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,l),this.particleContext&&this.wrapper&&this.factor.particle&&(this.particleContext.deleteTexture(this.particleTexture||null),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.NEAREST,this.particleContext.CLAMP_TO_EDGE,l),this.wrapper.image=l,this.wrapper.resetLifecycle=!0,this.lastParticleFrameTime=void 0)}this.initial&&this.particleTexture&&(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.particleContext||!this.wrapper||(this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext,this.wrapper)})},handlePause(){var t;this.paused=!0,this.animation!=null&&cancelAnimationFrame(this.animation),this.animation=void 0,this.lastParticleFrameTime=void 0,this.particleContext&&((t=this.viewport)==null||t.toggleParticle(!1))},handlePlay(){var t,e;!((t=this.factor)!=null&&t.active)||!((e=this.factor)!=null&&e.particle)||!this.particleContext||!this.particleTexture||!this.wrapper||this.animation!=null||(this.paused=!1,this.animation=requestAnimationFrame(a=>{var i,l;if(this.animation=void 0,this.paused||!((i=this.factor)!=null&&i.active)||!((l=this.factor)!=null&&l.particle)||!this.particleContext||!this.wrapper)return;const r=this.lastParticleFrameTime==null?0:Math.max(0,(a-this.lastParticleFrameTime)/1e3);this.lastParticleFrameTime=a,this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions,r),this.viewport.toggleParticle(!0),this.handlePlay()}))},handleClearParticle(){var t,e,a,r,i,l,n;this.handlePause(),this.webgl.destroyParticle(this.particleContext,this.wrapper),(t=this.particleContext)==null||t.deleteTexture(this.particleTexture||null),this.wrapper=void 0,this.particleTexture=void 0,this.particleContext=void 0,this.initial=!0,(a=(e=this.viewport)==null?void 0:e.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)},handleClear(){var t,e;++this.drawVersion,this.context&&((t=this.viewport)==null||t.toggle(!1),this.context.deleteTexture(this.texture||null),this.context.deleteTexture(((e=this.rampColor)==null?void 0:e.texture)||null),this.context.deleteBuffer(this.aPositionBuffer||null),this.context.deleteProgram(this.program||null)),this.context=void 0,this.texture=void 0,this.rampColor=void 0,this.aPositionBuffer=void 0,this.program=void 0,this.etime=void 0,this.dataSource=void 0,this.handleClearParticle()}}},Fc={key:0};function Gc(t,e,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 swell",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[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 jc=K(Ic,[["render",Gc],["__scopeId","data-v-c0342437"]]),Wc={name:"IdmSwellDirection",props:{map:{type:Object},swell:{type:Object},beforeLayer:{type:String},mapFeather:{type:String},hasRampLayer:{type:Boolean},nautical:{type:String}},data(){return{source:"swell-source",directionLayer:"swell-direction-layer",heightLayer:"swell-height-layer",heightLabelLayer:"swell-height-label-layer",empty:V.featureCollection([])}},computed:{opacity(){return(this.mapFeather==="light"||this.nautical==="hi"||this.nautical==="i4")&&!this.hasRampLayer?.6:.7},color(){return(this.mapFeather==="light"||this.nautical==="hi"||this.nautical==="i4")&&!this.hasRampLayer?"#000623":"#ffffff"}},watch:{"swell.version":{handler(){var t;(t=this.swell)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},color:{handler(){var t;(t=this.swell)!=null&&t.active&&(this.handleClear(),this.handleRender())}}},methods:{handleRender(){var t,e;if(this.swell){const a=new Date().valueOf();let r=0,i=this.empty;if(this.swell.active&&(i=this.swell.data),(t=this.map)!=null&&t.getSource(this.source))(e=this.map)==null||e.getSource(this.source).setData(i),new Date().valueOf()-(a+r);else{this.map.addSource(this.source,{type:"geojson",data:i}),this.map.addLayer({id:this.heightLayer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-opacity":1,"line-width":1,"line-color":["match",["get","val"],2,"rgba(255,255,0,0.9)",3,"rgba(255,149,0,0.9)",4,"rgba(244,67,54,0.9)",5,"rgba(162,2,31,0.9)",6,"rgba(162,2,31,0.9)","rgba(162,2,31,0.9)"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","LineString"],layout:{"symbol-placement":"line","text-rotation-alignment":"viewport","text-field":"{val}m","text-size":11},paint:{"text-color":["step",["get","val"],"black",4,"white",5,"white",6,"white"],"text-halo-color":["match",["get","val"],2,"rgba(255,255,0,0.7)",3,"rgba(255,149,0,0.7)",4,"rgba(244,67,54,0.7)",5,"rgba(162,13,2,0.7)",6,"rgba(162,13,2,0.7)","rgba(162,13,2,0.7)"],"text-halo-width":2}},this.beforeLayer);const l=new Image(72,72);let n=`<svg t="1752721890391" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12518" width="200" height="200"><path d="M481.386772 959.514313 481.386772 334.713224c-56.000432 37.288255-92.523253 55.876612-142.312216 57.787124 85.834924-84.884272 130.528845-195.161888 172.552961-328.434218 40.259936 133.272329 89.39296 238.731196 172.622546 328.434218-54.105269-5.729491-86.780459-21.201881-146.338926-58.965973l0 625.979938L481.386772 959.514313z" p-id="12519" fill="${this.color}"></path></svg>`,s="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(n)));l.src=s,l.onload=()=>{this.map.hasImage("swellDirIconWhite")?this.map.updateImage("swellDirIconWhite",l):this.map.addImage("swellDirIconWhite",l),this.map.getLayer(this.directionLayer)||this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"swellDirIconWhite","icon-size":{base:1,stops:[[2,.32],[6,.5]]},"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,180],[360,540]]}},paint:{"icon-opacity":this.opacity}},this.beforeLayer)},new Date().valueOf()-(a+r)}}},handleClear(){this.map.getLayer(this.heightLayer)&&this.map.removeLayer(this.heightLayer),this.map.getLayer(this.heightLabelLayer)&&this.map.removeLayer(this.heightLabelLayer),this.map.getLayer(this.directionLayer)&&this.map.removeLayer(this.directionLayer),this.map.hasImage("swellDirIconWhite")&&this.map.removeImage("swellDirIconWhite"),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Zc(t,e,a,r,i,l){return o.openBlock(),o.createElementBlock("div")}const Hc=K(Wc,[["render",Zc]]),Xc={name:"IdmPrmsl",props:{map:{type:Object},prmsl:{type:Object},beforeLayer:{type:String},theme:{type:String},hasRampLayer:{type:Boolean},nautical:{type:String}},data(){return{source:"prmsl-source",layer:"prmsl-layer",labelLayer:"prmsl-label-layer",pointLabelLayer:"prmsl-point-label-layer",empty:V.featureCollection([])}},computed:{opacity(){return(this.theme==="light"||this.nautical==="hi"||this.nautical==="i4")&&!this.hasRampLayer?1:.3}},watch:{"prmsl.version":{handler(){var t;(t=this.prmsl)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},opacity:{handler(){var t;(t=this.prmsl)!=null&&t.active&&(this.handleClear(),this.handleRender())}}},methods:{handleRender(){var t,e,a;if(this.prmsl){const r=new Date().valueOf();let i=0,l=0,n=this.empty;this.prmsl.active&&(n=this.prmsl.data),(t=this.map)!=null&&t.getSource(this.source)?((e=this.map)==null||e.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.opacity}},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},`
|
|
405
405
|
`,["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 Oc(t,e,a,r,i,l){return null}const Yc=K(Xc,[["render",Oc]]),nb="",Uc={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 $e,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[ice-edge] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[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,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=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,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},Jc={key:0};function Kc(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",Jc,[o.createElementVNode("div",{class:"legend-bars-gl4 ice-edge",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[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 Qc=K(Uc,[["render",Kc]]),sb="",qc={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 $e,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[ice-cover] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[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,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=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,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},$c={key:0};function em(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",$c,[o.createElementVNode("div",{class:"legend-bars-gl4 ice-cover",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[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 tm=K(qc,[["render",em],["__scopeId","data-v-2e9090ae"]]),cb="",om={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 $e,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[ice-thickness] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[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,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=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,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},am={key:0};function im(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",am,[o.createElementVNode("div",{class:"legend-bars-gl4 ice-thickness",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[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 rm=K(om,[["render",im]]),mb="",lm={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 $e,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},deeimmediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[precip3h] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[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,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=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,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},nm={key:0};function sm(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",nm,[o.createElementVNode("div",{class:"legend-bars-gl4 precip3h",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[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 cm=K(lm,[["render",sm]]),db="",mm={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 $e,etime:void 0}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[visibility] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[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,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=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,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},dm={key:0};function hm(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",dm,[o.createElementVNode("div",{class:"legend-bars-gl4 visibility",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[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 pm=K(mm,[["render",hm]]),hb="",gm={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 $e,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[water-temp] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[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,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=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,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},um={key:0};function fm(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",um,[o.createElementVNode("div",{class:"legend-bars-gl4 water-temp",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[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 ym=K(gm,[["render",fm]]),pb="",bm={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 $e,etime:void 0,right:10}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},"menuToggle.v":{handler(){var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0;this.handleDraw(),new Date().valueOf()-(t+e)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[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,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=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,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},wm={key:0};function xm(t,e,a,r,i,l){var n;return(n=a.factor)!=null&&n.active?(o.openBlock(),o.createElementBlock("div",wm,[o.createElementVNode("div",{class:"legend-bars-gl4 temp",style:o.normalizeStyle({right:i.right+"px"})},e[0]||(e[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 km=K(bm,[["render",xm]]),gb="",Am={name:"IdmGlLayer",components:{IdmWindBarb:wc,IdmWindParticle:Lc,IdmCurrentDirection:zc,IdmCurrentParticle:Nc,IdmSigWaveParticle:Ec,IdmSigWaveHeight:Bc,IdmSwellParticle:jc,IdmSwellDirection:Hc,IdmPrmsl:Yc,IdmIceEdge:Qc,IdmIceCover:tm,IdmIceThickness:rm,IdmPrecip3h:cm,IdmVisibility:pm,IdmWaterTemp:ym,IdmTemp:km},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:0},paddingTop:{type:Number,default:8},menuHeight:{type:Number,default:248},menuToggle:{type:Object,default:{}},realTime:{type:String},forecastModel:{type:String},beforeLayer:{type:String},platform:{type:String}},emits:["forecastModel","menuToggle","weatherCheckList","autoActive","weatherRendered"],data(){const t=[...no.LayerHelper.WEATHER_LAYERS];return{right:10,toggle:!1,autoActive:!0,weatherWeight:0,allLayers:t,tagLayers:t.filter(e=>!e.hide),checkList:[],renderKey:"",iceToggleValue:void 0,weatherLayers:{},activeWeatherLayers:[],cache:{v:"0.0.2",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,showSigWaveParticle:!0,showSwellParticle:!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",height:"calc(100vh - "+this.top+"px)"}:{top:this.top+"px",right:this.toggle?"0px":"-280px",height:"calc(100vh - "+this.top+"px)"}},computeDateZ(){return function(t){var e;if(t){const a=z(t);return`${(e=a==null?void 0:a.utc())==null?void 0:e.format("MMM-DD/HHmm")}Z`}return"-"}},computeDateUpdate(){return function(t){return t?z(t).fromNow():"-"}},overlaysKeys(){return this.tagLayers.filter(t=>t.overlays).map(t=>t.key)},rendersKeys(){return this.allLayers.filter(t=>!t.overlays&&t.enabled).map(t=>t.key)},showTipMenu(){return this.checkList.includes("wind")||this.checkList.includes("current-direction")||this.checkList.includes("sig-wave-height")},barbsIconName(){var e,a,r;const t=[];for(let i=0;i<((a=(e=this.legend)==null?void 0:e.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`;t.push("icon-a-"+n)}return t},lengendTipTop(){return this.platform==="ops"?this.top+this.menuHeight+232:this.top+this.menuHeight+142}},watch:{"menuToggle.v":{handler(){this.toggle=this.menuToggle.weatherLayers,this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})}},currentModel:{handler(t,e){this.$emit("forecastModel",t),localStorage.setItem("forecastModelCacheGL4",t)},immediate:!0},forecastModel:{handler(t,e){t&&t!==e&&this.handleWeatherLayerChange({sourceChanged:!0})}},map:{handler(){const t=this.map;t&&(this.viewport=new to(t),t.once("idle",()=>{this.map===t&&(this.fetchCache(),t.on("move",this.handleMove4Weather),this.handleRampColorInitial())}),t.triggerRepaint())},immediate:!0},realTime:{handler(t,e){t&&e&&z(t).utc().format("yyyy-MM-DD HH")!==z(e).utc().format("yyyy-MM-DD HH")&&this.$nextTick(()=>{this.fetchWeatherLayers()})},immediate:!0},renderKey:{handler(t,e){if(t&&t!==e){const a=this.checkList.filter(r=>!this.rendersKeys.some(i=>i===r));t==="ice-forecast"?(this.iceToggleValue=this.iceToggleValue||"ice-cover",this.checkList=[...a,"ice-forecast",this.iceToggleValue||"ice-cover"]):this.checkList=[...a,t]}else!t&&e&&(this.checkList=this.checkList.filter(a=>a!==e))}},checkList:{handler(t,e){var a,r,i,l,n,s;this.handleCheckListChange(t,e),this.$emit("weatherCheckList",t),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):(s=(n=(l=this.$parent)==null?void 0:l.$refs)==null?void 0:n.idmBottomBar)==null||s.handleToggle("weather",!1)}},autoActive:{handler(t){var e,a,r,i,l,n;localStorage.setItem(this.cache.autoActiveKey,this.autoActive),this.activeWeatherLayers=this.autoActive?this.allLayers.filter(s=>this.checkList.includes(s.key)):[],this.handleWeatherLayerChange(),this.autoActive&&this.checkList.length?(r=(a=(e=this.$parent)==null?void 0:e.$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(t){if(t){const e=this.checkList.filter(a=>!this.rendersKeys.some(r=>r===a));this.checkList=[...e,"ice-forecast",this.iceToggleValue]}}},showWindParticle:{handler(t){let e="wind-particle";this.weatherLayers[e]&&(this.weatherLayers[e].particle=t,this.weatherLayers[e].version=Math.random()+1)}},showCurrentParticle:{handler(t){let e="current-particle";this.weatherLayers[e]&&(this.weatherLayers[e].particle=t,this.weatherLayers[e].version=Math.random()+1)}},showSigWaveParticle:{handler(t){const e=this.weatherLayers["sig-wave-particle"];e&&(e.particle=t)}},showSwellParticle:{handler(t){const e=this.weatherLayers["swell-particle"];e&&(e.particle=t)}},isLogin:{handler(t){t?this.fetchModels():this.models={}},immediate:!0}},mounted(){this.fetchModels()},methods:{arraysEqual(t,e){if((t==null?void 0:t.length)!==(e==null?void 0:e.length))return!1;for(let a=0;a<(t==null?void 0:t.length);a++)if((t==null?void 0:t[a])!==(e==null?void 0:e[a]))return!1;return!0},normalizeWaveSelection(t){const e=t.map(a=>a==="sig-wave"?"sig-wave-particle":a==="swell"?"swell-particle":a);return[...new Set(e)].filter(a=>this.allLayers.some(r=>r.key===a))},fetchCache(){const t=localStorage.getItem(this.cache.versionKey);this.cache.v!==t&&(localStorage.removeItem(this.cache.autoActiveKey),localStorage.removeItem(this.cache.checkListKey),localStorage.setItem(this.cache.versionKey,this.cache.v));let e=localStorage.getItem(this.cache.autoActiveKey);this.autoActive=e!=="false",localStorage.setItem(this.cache.autoActiveKey,this.autoActive),e=localStorage.getItem(this.cache.checkListKey);const a=JSON.parse(e||JSON.stringify(["wind","sig-wave-height"]));this.iceToggleValue=a.includes("ice-thickness")?"ice-thickness":void 0,this.checkList=this.normalizeWaveSelection(a),this.renderKey=this.checkList.find(r=>this.rendersKeys.includes(r))||"",localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList))},handleMenuToggle(){this.$emit("menuToggle","weatherLayers")},handleFastWeatherToggle(t){let e=[];this.checkList.includes(t)?e=this.checkList.filter(a=>a!==t):(e=[...this.checkList,t],this.checkList=e),this.handleCheckListChange(e,this.checkList)},handleCheckListChange(t,e){if(this.arraysEqual(t,e))return this.handleMove4Weather(),!1;const a=[...new Set(t)],r=a==null?void 0:a.filter(n=>!(e!=null&&e.includes(n)))[0],i=e==null?void 0:e.filter(n=>!(a!=null&&a.includes(n)))[0],l=this.checkList.filter(n=>!this.rendersKeys.some(s=>s===n));if(r)if(r==="ice-cover"||r==="ice-thickness"||r==="ice-forecast")this.checkList=[...l,"ice-forecast",this.iceToggleValue||"ice-cover"],this.iceToggleValue=this.iceToggleValue||"ice-cover";else if(this.rendersKeys.includes(r))this.checkList=[...l,r];else{const n=a.filter(c=>!this.rendersKeys.includes(c)),s=this.checkList.filter(c=>this.rendersKeys.includes(c));this.checkList=[...n,...s]}i&&(i==="ice-forecast"?(this.checkList=a.filter(n=>!["ice-cover","ice-thickness","ice-forecast"].includes(n)),this.iceToggleValue=void 0):this.checkList=a),this.checkList.includes("wind-particle")&&!(e!=null&&e.includes("wind-particle"))&&(this.showWindParticle=!0),this.checkList.includes("current-particle")&&!(e!=null&&e.includes("current-particle"))&&(this.showCurrentParticle=!0),this.checkList.includes("sig-wave-particle")&&!(e!=null&&e.includes("sig-wave-particle"))&&(this.showSigWaveParticle=!0),this.checkList.includes("swell-particle")&&!(e!=null&&e.includes("swell-particle"))&&(this.showSwellParticle=!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 t=await he.get(`${this.gateway}/api/arc/meteo2/models2`,{headers:{Authorization:this.defaultMeteoToken}});(t==null?void 0:t.data.code)===0&&(this.models=t==null?void 0:t.data.data)},async fetchWeatherLayers(t={}){var r,i,l,n,s,c,m,d,u;const e=new Date().valueOf();let a=0;if(this.map){const f=((r=this.map)==null?void 0:r.getZoom())+1,g=(i=this.map)==null?void 0:i.getBounds(),p=`${g._sw.lng},${g._sw.lat},${g._ne.lng},${g._ne.lat}`;if(this.particleFactor&&((l=this.$refs.layer)!=null&&l.autoActive)){const h=no.LayerHelper.WEATHER_LAYERS.find(y=>{var k;return((k=y.peer)==null?void 0:k.weight)===this.particleFactor.weight});this.particleFactor.particle&&(this.showWindParticle||this.showCurrentParticle)?this.weatherWeight=this.weatherWeight&h.weight?this.weatherWeight:this.weatherWeight+h.weight:this.weatherWeight=this.weatherWeight&h.weight?this.weatherWeight-h.weight:this.weatherWeight}if(this.weatherWeight>0){let h=this.weatherWeight;if(h>0){const y=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],k=await he.get(`${y}/api/arc/weather/layers2/links?l=${h}&v=${this.forecastModel}&z=${f}&bbox=${p}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(new Date().valueOf()-(e+a),((n=k==null?void 0:k.data)==null?void 0:n.code)===0){const x=(s=k==null?void 0:k.data)==null?void 0:s.data,b=[];for(const v in x)b.push(he.get(x[v],{headers:{Authorization:this.defaultMeteoToken,key:v},responseType:/\.(jpg|png)$/.test(x[v])?"blob":"json"}).catch(L=>{console.log(`[${v}] fetch layer error: ${L}`)}));const A=await Promise.all(b);this.weatherLayers={},A.map(v=>{var _,N,M,T;const L=((_=v==null?void 0:v.data)==null?void 0:_.data)||(v==null?void 0:v.data);let C=(M=(N=v==null?void 0:v.config)==null?void 0:N.headers)==null?void 0:M.key;C==="sig-wave"&&(C="sig-wave-particle"),C==="swell"&&(C="swell-particle"),C&&L&&(this.weatherLayers[C]={raw:L,type:((T=v==null?void 0:v.config)==null?void 0:T.responseType)==="blob"?"image":"json",etime:k.data.etime})})}if(new Date().valueOf()-(e+a),this.weatherLayers["current-direction"]||this.weatherLayers["current-speed"]){const x=(c=this.weatherLayers["current-direction"])==null?void 0:c.raw,b=(m=this.weatherLayers["current-speed"])==null?void 0:m.raw;delete this.weatherLayers["current-direction"],delete this.weatherLayers["current-speed"],this.weatherLayers.current={type:"json",direction:x,speed:{raw:b},etime:k.data.etime}}if(this.weatherLayers["swell-direction"]||this.weatherLayers["swell-height"]){const x=(d=this.weatherLayers["swell-direction"])==null?void 0:d.raw,b=(u=this.weatherLayers["swell-height"])==null?void 0:u.raw;delete this.weatherLayers["swell-direction"],delete this.weatherLayers["swell-height"],this.weatherLayers["swell-direction-contour"]={type:"json",direction:x,height:{raw:b},etime:k.data.etime}}}}this.handleWeatherLayerToggle(),this.handleDrawWeather4Json(),this.$nextTick(()=>{var h,y,k,x,b;(b=(x=(k=(y=(h=this.$parent)==null?void 0:h.$refs)==null?void 0:y.idmBottomBar)==null?void 0:k.$refs)==null?void 0:x.capture)==null||b.captureCurrentFrame()})}},handleWeatherLayerToggle(){for(const t in this.weatherLayers)this.weatherLayers[t].active=!1,this.weatherLayers[t].version=Math.random()+1;for(const t of this.activeWeatherLayers){let e=t.key;e==="current-direction"&&(e="current"),this.weatherLayers[e]&&(this.weatherLayers[e].active=!0,this.weatherLayers[e].version=Math.random()+1,e==="wind-particle"&&(this.weatherLayers[e].particle=this.showWindParticle),e==="current-particle"&&(this.weatherLayers[e].particle=this.showCurrentParticle),e==="sig-wave-particle"&&(this.weatherLayers[e].particle=this.showSigWaveParticle),e==="swell-particle"&&(this.weatherLayers[e].particle=this.showSwellParticle))}},handleWeatherLayerChange(t={sourceChanged:!1}){var a;const e=(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);t!=null&&t.sourceChanged||this.weatherWeight!==e?(this.weatherWeight=e,this.fetchWeatherLayers()):this.handleWeatherLayerToggle()},handleRampColorInitial(){var t,e,a,r,i,l,n,s,c,m,d,u;this.viewport.map.getSource((t=this.viewport)==null?void 0:t.rampColorSource)||this.viewport.map.addSource((e=this.viewport)==null?void 0:e.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"},paint:{"raster-fade-duration":0}},this.beforeLayer),this.viewport.map.getSource((n=this.viewport)==null?void 0:n.particleSource)||this.viewport.map.addSource((s=this.viewport)==null?void 0:s.particleSource,{type:"canvas",canvas:(c=this.viewport)==null?void 0:c.particleCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((m=this.viewport)==null?void 0:m.particleLayer)||this.viewport.map.addLayer({type:"raster",id:(d=this.viewport)==null?void 0:d.particleLayer,source:(u=this.viewport)==null?void 0:u.particleSource,layout:{visibility:"none"},paint:{"raster-fade-duration":0}},this.beforeLayer)},handleDrawWeather4Json(){var l,n,s,c,m,d,u;const t=new Date().valueOf();let e=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 f=P.LngLatHelper.convertToStdLng(r._sw.lng),g=P.LngLatHelper.convertToStdLng(r._ne.lng),p=Math.floor(r._sw.lat),h=Math.ceil(r._ne.lat);for(const y in this.weatherLayers){let k=!1;if(this.weatherLayers[y].active&&this.weatherLayers[y].type==="json"){let x=[];if(y==="current"){k=!0;const b=((s=this.weatherLayers[y])==null?void 0:s.direction)||{};for(const v in b)if(v>p&&v<h&&(!(i<=this.zoom)||v%(i<2?10:i<4?5:3)===0)){const L=b[v].lng;f>g?L.forEach((C,_)=>{var N,M,T,I,X,Q;if(i<2){if((C>=0&&C<=360||C>=-360&&C<=0)&&C%10===0){const q=V.point([C,v],{val:((N=b[v].val)==null?void 0:N[_])||((M=b[v].dir)==null?void 0:M[_]),spd:(T=b[v].spd)==null?void 0:T[_]});x.push(q)}}else if((C>=f&&C<=180||C>=-180&&C<=g)&&(!(i<=this.zoom)||C%(i<2?10:i<4?5:3)===0)){const q=V.point([C,v],{val:((I=b[v].val)==null?void 0:I[_])||((X=b[v].dir)==null?void 0:X[_]),spd:(Q=b[v].spd)==null?void 0:Q[_]});x.push(q)}}):L.forEach((C,_)=>{var N,M,T,I,X,Q;if(f<2){if((C>=0&&C<=360||C>=-360&&C<=0)&&C%10===0){const q=V.point([C,v],{val:((N=b[v].val)==null?void 0:N[_])||((M=b[v].dir)==null?void 0:M[_]),spd:(T=b[v].spd)==null?void 0:T[_]});x.push(q)}}else if(C>=f&&C<=g&&(!(i<=this.zoom)||C%(i<this.zoom/2?5:3)===0)){const q=V.point([C,v],{val:((I=b[v].val)==null?void 0:I[_])||((X=b[v].dir)==null?void 0:X[_]),spd:(Q=b[v].spd)==null?void 0:Q[_]});x.push(q)}})}a=new Date().valueOf()-(t+e);const A=this.weatherLayers[y].speed;if(A){if(!A.data){const L=[];for(const C in(c=A.raw)==null?void 0:c.Polygon){const _=A.raw.Polygon[C];for(const N of _)L.push(V.polygon(N,{val:Number(C)}))}A.data=V.featureCollection(L)}const v=i<this.zoom?A.data.features.filter(L=>L.properties.val>.5):A.data.features;x=x.concat(v),a=new Date().valueOf()-(t+e)}}else if(y==="wind"){k=!0;const b=this.weatherLayers.wind.raw;for(const A in b)if(A>p&&A<h&&(!(i<=this.zoom)||A%(i<2?10:i<4?5:3)===0)){const v=b[A].lng;f>g?v.forEach((L,C)=>{var _,N,M,T;if(i<2){if((L>=0&&L<=360||L>=-360&&L<=0)&&L%10===0){const I=V.point([L,A],{dir:((_=b[A].val)==null?void 0:_[C])||((N=b[A].dir)==null?void 0:N[C]),spd:b[A].spd[C]});x.push(I)}}else if((L>=f&&L<=180||L>=-180&&L<=g)&&(!(i<=this.zoom)||L%(i<2?10:i<4?5:3)===0)){const I=V.point([L,A],{dir:((M=b[A].val)==null?void 0:M[C])||((T=b[A].dir)==null?void 0:T[C]),spd:b[A].spd[C]});x.push(I)}}):v.forEach((L,C)=>{var _,N,M,T;if(i<2){if((L>=0&&L<=360||L>=-360&&L<=0)&&L%10===0){const I=V.point([L,A],{dir:((_=b[A].val)==null?void 0:_[C])||((N=b[A].dir)==null?void 0:N[C]),spd:b[A].spd[C]});x.push(I)}}else if(L>=f&&L<=g&&(!(i<=this.zoom)||L%(i<2?10:i<4?5:3)===0)){const I=V.point([L,A],{dir:((M=b[A].val)==null?void 0:M[C])||((T=b[A].dir)==null?void 0:T[C]),spd:b[A].spd[C]});x.push(I)}})}a=new Date().valueOf()-(t+e)}else if(y==="sig-wave-height"){if(this.weatherLayers[y].data)x=this.weatherLayers[y].data;else{k=!0;const b=this.weatherLayers[y].raw;if(b){const A=[];for(const v in b.Polygon){const L=b.Polygon[v];for(const C of L)A.push(V.polygon(C,{val:Number(v)}))}for(const v in b.MultiPolygon){const L=b.MultiPolygon[v];for(const C of L)A.push(V.multiPolygon(C,{val:Number(v)}))}for(const v in b.Point){const L=b.Point[v];for(let C=0;C<((m=L.lng)==null?void 0:m.length);C++)A.push(V.point([L.lng[C],v],{val:Number(L.val[C])}))}x=x.concat(A)}}a=new Date().valueOf()-(t+e)}else if(y==="prmsl"){if(this.weatherLayers[y].data)x=this.weatherLayers[y].data;else{k=!0;const b=this.weatherLayers[y].raw;if(b){const A=[];for(const v in b.LineString){const L=b.LineString[v];for(const C of L)A.push(V.lineString(C,{val:Number(v)}))}for(const v in b.Point)b.Point[v].lng.forEach((L,C)=>{L=P.LngLatHelper.convertToStdLng(L),A.push(V.point([L,v],{val:b.Point[v].val[C],type:b.Point[v].type[C]}))});x=x.concat(A)}}a=new Date().valueOf()-(t+e)}else if(y==="swell-direction-contour"){k=!0;const b=((d=this.weatherLayers[y])==null?void 0:d.direction)||{};for(const v in b)if(v>p&&v<h&&(!(i<=this.zoom)||v%(i<2?10:i<4?5:3)===0)){const L=b[v].lng;f>g?L.forEach((C,_)=>{var N,M,T,I,X,Q;if(i<2){if((C>=0&&C<=360||C>=-360&&C<=0)&&C%10===0){const q=V.point([C,v],{val:((N=b[v].val)==null?void 0:N[_])||((M=b[v].dir)==null?void 0:M[_]),spd:(T=b[v].spd)==null?void 0:T[_]});x.push(q)}}else if((C>=f&&C<=180||C>=-180&&C<=g)&&(!(i<=this.zoom)||C%(i<2?10:i<4?5:3)===0)){const q=V.point([C,v],{val:((I=b[v].val)==null?void 0:I[_])||((X=b[v].dir)==null?void 0:X[_]),spd:(Q=b[v].spd)==null?void 0:Q[_]});x.push(q)}}):L.forEach((C,_)=>{var N,M,T,I,X,Q;if(f<2){if((C>=0&&C<=360||C>=-360&&C<=0)&&C%10===0){const q=V.point([C,v],{val:((N=b[v].val)==null?void 0:N[_])||((M=b[v].dir)==null?void 0:M[_]),spd:(T=b[v].spd)==null?void 0:T[_]});x.push(q)}}else if(C>=f&&C<=g&&(!(i<=this.zoom)||C%(i<2?10:i<4?5:3)===0)){const q=V.point([C,v],{val:((I=b[v].val)==null?void 0:I[_])||((X=b[v].dir)==null?void 0:X[_]),spd:(Q=b[v].spd)==null?void 0:Q[_]});x.push(q)}})}a=new Date().valueOf()-(t+e),console.log("swell direction elapsed: ",a,", total: ",e+=a);const A=this.weatherLayers[y].height;if(A){if(!A.data){const v=[];for(const L in(u=A.raw)==null?void 0:u.LineString){const C=A.raw.LineString[L];for(const _ of C)v.push(V.lineString(_,{val:Number(L)}));A.data=V.featureCollection(v)}}if(A.data){const v=this.handleBboxClip(A.data,r);x=x.concat(v)}a=new Date().valueOf()-(t+e),console.log("swell height elapsed: ",a,", total: ",e+=a)}}x.length&&(this.weatherLayers[y].data=V.featureCollection(x)),k&&(this.weatherLayers[y].version=Math.random()+1)}}}},handleBboxClip(t,e){const a=[],r=P.LngLatHelper.convertToStdLng(e._sw.lng),i=P.LngLatHelper.convertToStdLng(e._ne.lng);return t.features.forEach(l=>{if(l.geometry.type!=="Point")if(r>i){let n=[r,e._sw.lat,180,e._ne.lat],s=V.bboxClip(l,n);s.geometry.coordinates.length&&a.push(s),n=[-180,e._sw.lat,i,e._ne.lat],s=V.bboxClip(l,n),s.geometry.coordinates.length&&a.push(s)}else{const n=[r,e._sw.lat,i,e._ne.lat],s=V.bboxClip(l,n);s.geometry.coordinates.length&&a.push(s)}else a.push(l)}),a},handleMove4Weather(){for(const t in this.weatherLayers)this.weatherLayers[t].active&&this.weatherLayers[t].type==="image"&&(this.weatherLayers[t].active=!0,this.weatherLayers[t].version=Math.random()+1);this.handleDrawWeather4Json()}}},Lm={class:"idm-gl4-meteo-layers"},vm={key:0,class:"legend-tip-btn-gl4"},Cm={class:"d-flex flex-row justify-start align-center flex-wrap text-body-2"},zm={class:"d-flex flex-row justify-center align-center"},_m={class:"text-caption"},Sm={class:"d-flex flex-row justify-start align-center flex-wrap text-body-2"},Pm={class:"d-flex flex-row justify-center align-center"},Nm={key:0,style:{width:"24px",height:"12px",border:"1px solid rgba(var(--v-border-color), var(--v-border-opacity))"}},Mm={class:"text-caption px-2"},Tm={class:"d-flex flex-row justify-start align-start flex-wrap text-body-2 ml-n1"},Vm={class:"d-flex flex-row justify-start align-center"},Em={class:"d-flex flex-row justify-center align-center",style:{width:"40px"}},Rm={class:"text-caption"},Dm={class:"d-flex justify-start align-center ga-3"},Bm={class:"text-h5 font-weight-medium"},Im={key:0,class:"w-100 d-flex justify-space-between align-center ga-1 mb-2 px-3"},Fm={key:0,class:"d-flex justify-start align-center ga-4 pl-6"},Gm={key:1,class:"d-flex justify-start align-center ga-4 pl-6"},jm={key:2,class:"d-flex justify-start align-center ga-4 pl-6"},Wm={key:3,class:"d-flex justify-start align-center ga-4 pl-6"},Zm={class:"text-body-1 py-2"},Hm={class:"text-body-1 font-weight-medium"},Xm={class:"text-body-2 text-label"},Om={class:"text-body-2 text-label"},Ym={class:"text-body-2 text-label mb-3"},Um={class:"text-body-1 font-weight-medium"},Jm={class:"text-body-2 text-label"},Km={class:"text-body-2 text-label"},Qm={class:"text-body-2 text-label mb-3"},qm={class:"text-body-1 py-2"},$m={class:"text-body-1 font-weight-medium"},ed={class:"text-body-2 text-label"},td={class:"text-body-2 text-label"},od={class:"text-body-2 text-label mb-3"},ad={class:"text-body-1 font-weight-medium"},id={class:"text-body-2 text-label"},rd={class:"text-body-2 text-label"},ld={class:"text-body-2 text-label mb-3"},nd={class:"text-body-1 py-2"},sd={class:"text-body-1 font-weight-medium"},cd={class:"text-body-2 text-label"},md={class:"text-body-2 text-label"},dd={class:"text-body-2 text-label mb-3"};function hd(t,e,a,r,i,l){var S,W,Z,ee,j,B,J,E,O,$,de,ue,re,ge,ye,_e;const n=o.resolveComponent("VBtn"),s=o.resolveComponent("VTooltip"),c=o.resolveComponent("VCardText"),m=o.resolveComponent("VDivider"),d=o.resolveComponent("VCard"),u=o.resolveComponent("VSwitch"),f=o.resolveComponent("VBtnToggle"),g=o.resolveComponent("VCardTitle"),p=o.resolveComponent("VCardItem"),h=o.resolveComponent("VCheckbox"),y=o.resolveComponent("VRadio"),k=o.resolveComponent("IdmWindBarb"),x=o.resolveComponent("IdmSigWaveHeight"),b=o.resolveComponent("IdmCurrentDirection"),A=o.resolveComponent("IdmSwellDirection"),v=o.resolveComponent("IdmPrmsl"),L=o.resolveComponent("IdmWindParticle"),C=o.resolveComponent("IdmCurrentParticle"),_=o.resolveComponent("IdmSigWaveParticle"),N=o.resolveComponent("IdmSwellParticle"),M=o.resolveComponent("IdmIceEdge"),T=o.resolveComponent("IdmIceCover"),I=o.resolveComponent("IdmIceThickness"),X=o.resolveComponent("IdmPrecip3h"),Q=o.resolveComponent("IdmVisibility"),q=o.resolveComponent("IdmWaterTemp"),le=o.resolveComponent("IdmTemp");return o.openBlock(),o.createElementBlock("div",Lm,[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(s,{text:t.$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:U})=>[o.createVNode(n,o.mergeProps(U,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>e[10]||(e[10]=[o.createElementVNode("i",{class:"iconfont icon-Weather text-h4"},null,-1)])),_:2,__:[10]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4),l.showTipMenu?(o.openBlock(),o.createElementBlock("div",vm,[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?"394px":l.lengendTipTop+"px"})},[o.createVNode(s,{text:t.$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:U})=>[o.createVNode(n,o.mergeProps(U,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.legendToggle?"bg-primary active-border":""],onClick:e[0]||(e[0]=ne=>i.legendToggle=!i.legendToggle)}),{default:o.withCtx(()=>e[11]||(e[11]=[o.createElementVNode("i",{class:"iconfont icon-Legend text-h4"},null,-1)])),_:2,__:[11]},1040,["class"])]),_:1},8,["text","open-on-focus","open-on-hover"])],6),i.legendToggle?(o.openBlock(),o.createBlock(d,{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(c,{class:"d-flex flex-column justify-center align-start text-label px-1",style:{width:"120px"}},{default:o.withCtx(()=>[e[12]||(e[12]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2 mx-1"},"Wind Level",-1)),o.createElementVNode("div",Cm,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.barbs,(U,ne)=>(o.openBlock(),o.createElementBlock("div",{key:U,class:"w-50 d-flex flex-row justify-start align-center py-1 px-0 ma-0"},[o.createElementVNode("div",zm,[o.createElementVNode("i",{class:o.normalizeClass(["iconfont",l.barbsIconName[ne]]),style:o.normalizeStyle({color:a.theme==="dark"?"#fff":"#000"})},null,6),o.createElementVNode("span",_m,o.toDisplayString(Number(U)<10?`00${U}kts`:Number(U)<100?`0${U}kts`:`${U}kts`),1)])]))),128))])]),_:1,__:[12]}),o.createVNode(m,{vertical:""}),o.createVNode(c,{class:"d-flex flex-column justify-center align-start text-label px-2",style:{width:"100px"}},{default:o.withCtx(()=>[e[13]||(e[13]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2"},"Wave Height",-1)),o.createElementVNode("div",Sm,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.sigWaveHeight,(U,ne)=>(o.openBlock(),o.createElementBlock("div",{key:ne,class:"w-100 d-flex flex-row justify-start align-center py-1 px-0 ma-0"},[o.createElementVNode("div",Pm,[ne===0?(o.openBlock(),o.createElementBlock("div",Nm)):(o.openBlock(),o.createElementBlock("div",{key:1,style:o.normalizeStyle({width:"24px",height:"12px",background:U.color})},null,4)),o.createElementVNode("div",Mm,o.toDisplayString(U.label),1)])]))),128))])]),_:1,__:[13]}),o.createVNode(m,{vertical:""}),o.createVNode(c,{class:"d-flex flex-column justify-center align-start text-label pl-0 pr-2",style:{width:"100px"}},{default:o.withCtx(()=>[e[14]||(e[14]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2 mx-2"},"Current",-1)),o.createElementVNode("div",Tm,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.current,(U,ne)=>(o.openBlock(),o.createElementBlock("div",{key:ne,class:"w-100 d-flex flex-row justify-center align-center py-1 px-0 ma-0"},[o.createElementVNode("div",Vm,[o.createElementVNode("div",Em,[o.createElementVNode("i",{class:"iconfont icon-a-direction-arrow text-label",style:o.normalizeStyle({fontSize:40*U.size+"px"})},null,4)]),o.createElementVNode("div",Rm,o.toDisplayString(U.label),1)])]))),128))])]),_:1,__:[14]})]),_: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",Dm,[o.createElementVNode("div",Bm,o.toDisplayString(t.$t("weather.weather")),1),o.createVNode(u,{modelValue:i.autoActive,"onUpdate:modelValue":e[1]||(e[1]=U=>i.autoActive=U),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(()=>e[15]||(e[15]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[15]},8,["onClick"])],2),a.simple?(o.openBlock(),o.createElementBlock("div",Im,[o.createElementVNode("div",null,o.toDisplayString(t.$t("weather.forecastModel")),1),o.createVNode(f,{modelValue:i.currentModel,"onUpdate:modelValue":e[2]||(e[2]=U=>i.currentModel=U),rounded:"",height:"28",density:"compact",mandatory:"",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(()=>e[16]||(e[16]=[o.createTextVNode(" NOAA ",-1)])),_:1,__:[16]},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(()=>e[17]||(e[17]=[o.createTextVNode(" ECMWF ",-1)])),_:1,__:[17]},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(d,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(p,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(g,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.overlays")),1)]),_:1})]),_:1}),o.createVNode(c,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(U=>U.overlays),U=>(o.openBlock(),o.createBlock(h,{key:U.key,modelValue:i.checkList,"onUpdate:modelValue":e[3]||(e[3]=ne=>i.checkList=ne),value:U.key,label:t.$t(`weather.${U.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(d,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(p,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(g,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.renders")),1)]),_:1})]),_:1}),o.createVNode(c,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(U=>!U.overlays),U=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:U.key},[o.createVNode(y,{modelValue:i.renderKey,"onUpdate:modelValue":e[4]||(e[4]=ne=>i.renderKey=ne),label:t.$t(`weather.${U.locale}`),value:U.key,disabled:!i.autoActive,color:"primary",density:"compact",style:{height:"36px"},class:"text-body-2 py-1","hide-details":"",onClick:ne=>i.renderKey=i.renderKey===U.key?"":U.key},null,8,["modelValue","label","value","disabled","onClick"]),i.renderKey==="wind-particle"&&U.key==="wind-particle"?(o.openBlock(),o.createElementBlock("div",Fm,[o.createElementVNode("span",null,o.toDisplayString(t.$t("weather.particleAnimatiom")),1),o.createVNode(u,{modelValue:i.showWindParticle,"onUpdate:modelValue":e[5]||(e[5]=ne=>i.showWindParticle=ne),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"&&U.key==="current-particle"?(o.openBlock(),o.createElementBlock("div",Gm,[o.createElementVNode("span",null,o.toDisplayString(t.$t("weather.particleAnimatiom")),1),o.createVNode(u,{modelValue:i.showCurrentParticle,"onUpdate:modelValue":e[6]||(e[6]=ne=>i.showCurrentParticle=ne),label:"",class:"small-switch",color:"primary","base-color":"disabled",inset:"",density:"compact",height:"20","hide-details":""},null,8,["modelValue"])])):o.createCommentVNode("",!0),i.renderKey==="sig-wave-particle"&&U.key==="sig-wave-particle"?(o.openBlock(),o.createElementBlock("div",jm,[o.createElementVNode("span",null,o.toDisplayString(t.$t("weather.particleAnimatiom")),1),o.createVNode(u,{modelValue:i.showSigWaveParticle,"onUpdate:modelValue":e[7]||(e[7]=ne=>i.showSigWaveParticle=ne),class:"small-switch",color:"primary","base-color":"disabled",density:"compact",inset:"","hide-details":"",disabled:!i.autoActive},null,8,["modelValue","disabled"])])):o.createCommentVNode("",!0),i.renderKey==="swell-particle"&&U.key==="swell-particle"?(o.openBlock(),o.createElementBlock("div",Wm,[o.createElementVNode("span",null,o.toDisplayString(t.$t("weather.particleAnimatiom")),1),o.createVNode(u,{modelValue:i.showSwellParticle,"onUpdate:modelValue":e[8]||(e[8]=ne=>i.showSwellParticle=ne),class:"small-switch",color:"primary","base-color":"disabled",density:"compact",inset:"","hide-details":"",disabled:!i.autoActive},null,8,["modelValue","disabled"])])):o.createCommentVNode("",!0),i.renderKey==="ice-forecast"&&U.key==="ice-forecast"?(o.openBlock(),o.createBlock(f,{key:4,modelValue:i.iceToggleValue,"onUpdate:modelValue":e[9]||(e[9]=ne=>i.iceToggleValue=ne),class:"w-100 pl-7 rounded",rounded:"0",height:"30",density:"compact",group:"",mandatory:"",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(t.$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(t.$t("weather.thickness")),1)]),_:1},8,["color","disabled"])]),_:1},8,["modelValue","disabled"])):o.createCommentVNode("",!0)],64))),128))]),_:1})]),_:1}),o.createVNode(d,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(p,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(g,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.forecastModel")),1)]),_:1})]),_:1}),o.createVNode(c,{class:""},{default:o.withCtx(()=>{var U,ne,Fe,Ge,Re,Ce,je,Te,Ve,De,We,Ze,Be,xe,ke,ze,He,Xe,Oe,Pe,it,rt,lt,nt,st,ct,mt,dt,ht,pt,gt,ut,ft,yt,bt,wt,xt,kt,At,Lt,vt,Ct,zt,_t,St,Pt,Nt,Mt,Tt,Vt,Et,Rt,Dt,Bt,It,Ft,Gt,jt,Wt,Ne,Ee,Zt,Ye,Ht,et,Ae,Ue,ie,Le,Y,H,Je,Ie,Se,F,Xt,te,ve,Ke,tt,ot,D,Qe,G,qe,Yt,se,eo,me,yo,bo,wo,xo,ko,Ao,Lo,vo,Co,zo,_o,So,Po,No,Mo,To;return[o.createElementVNode("div",Zm,o.toDisplayString(t.$t("weather.atmospheric")),1),o.createElementVNode("div",Hm,o.toDisplayString((Fe=(ne=(U=i.models)==null?void 0:U.weather)==null?void 0:ne.NOAA)==null?void 0:Fe.source)+" "+o.toDisplayString((Ce=(Re=(Ge=i.models)==null?void 0:Ge.weather)==null?void 0:Re.NOAA)==null?void 0:Ce.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((De=(Ve=(Te=(je=i.models)==null?void 0:je.weather)==null?void 0:Te.NOAA)==null?void 0:Ve.meta)==null?void 0:De.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",Xm,o.toDisplayString(t.$t("weather.source"))+": NOAA",1),o.createElementVNode("div",Om,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((xe=(Be=(Ze=(We=i.models)==null?void 0:We.weather)==null?void 0:Ze.NOAA)==null?void 0:Be.meta)==null?void 0:xe.availabilityTime)),1),o.createElementVNode("div",Ym,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((Xe=(He=(ze=(ke=i.models)==null?void 0:ke.weather)==null?void 0:ze.NOAA)==null?void 0:He.meta)==null?void 0:Xe.initialisationTime)),1),o.createElementVNode("div",Um,o.toDisplayString((it=(Pe=(Oe=i.models)==null?void 0:Oe.weather)==null?void 0:Pe.ECMWF)==null?void 0:it.source)+" "+o.toDisplayString((nt=(lt=(rt=i.models)==null?void 0:rt.weather)==null?void 0:lt.ECMWF)==null?void 0:nt.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((dt=(mt=(ct=(st=i.models)==null?void 0:st.weather)==null?void 0:ct.ECMWF)==null?void 0:mt.meta)==null?void 0:dt.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",Jm,o.toDisplayString(t.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",Km,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((ut=(gt=(pt=(ht=i.models)==null?void 0:ht.weather)==null?void 0:pt.ECMWF)==null?void 0:gt.meta)==null?void 0:ut.availabilityTime)),1),o.createElementVNode("div",Qm,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((wt=(bt=(yt=(ft=i.models)==null?void 0:ft.weather)==null?void 0:yt.ECMWF)==null?void 0:bt.meta)==null?void 0:wt.initialisationTime)),1),o.createVNode(m),o.createElementVNode("div",qm,o.toDisplayString(t.$t("weather.wave")),1),o.createElementVNode("div",$m,o.toDisplayString((Lt=(At=(kt=(xt=i.models)==null?void 0:xt.marine)==null?void 0:kt.wave)==null?void 0:At.NOAA)==null?void 0:Lt.source)+" "+o.toDisplayString((_t=(zt=(Ct=(vt=i.models)==null?void 0:vt.marine)==null?void 0:Ct.wave)==null?void 0:zt.NOAA)==null?void 0:_t.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((Tt=(Mt=(Nt=(Pt=(St=i.models)==null?void 0:St.marine)==null?void 0:Pt.wave)==null?void 0:Nt.NOAA)==null?void 0:Mt.meta)==null?void 0:Tt.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",ed,o.toDisplayString(t.$t("weather.source"))+": NOAA",1),o.createElementVNode("div",td,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((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.availabilityTime)),1),o.createElementVNode("div",od,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((Wt=(jt=(Gt=(Ft=(It=i.models)==null?void 0:It.marine)==null?void 0:Ft.wave)==null?void 0:Gt.NOAA)==null?void 0:jt.meta)==null?void 0:Wt.initialisationTime)),1),o.createElementVNode("div",ad,o.toDisplayString((Ye=(Zt=(Ee=(Ne=i.models)==null?void 0:Ne.marine)==null?void 0:Ee.wave)==null?void 0:Zt.ECMWF)==null?void 0:Ye.source)+" "+o.toDisplayString((Ue=(Ae=(et=(Ht=i.models)==null?void 0:Ht.marine)==null?void 0:et.wave)==null?void 0:Ae.ECMWF)==null?void 0:Ue.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((Je=(H=(Y=(Le=(ie=i.models)==null?void 0:ie.marine)==null?void 0:Le.wave)==null?void 0:Y.ECMWF)==null?void 0:H.meta)==null?void 0:Je.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",id,o.toDisplayString(t.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",rd,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((te=(Xt=(F=(Se=(Ie=i.models)==null?void 0:Ie.marine)==null?void 0:Se.wave)==null?void 0:F.ECMWF)==null?void 0:Xt.meta)==null?void 0:te.availabilityTime)),1),o.createElementVNode("div",ld,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((D=(ot=(tt=(Ke=(ve=i.models)==null?void 0:ve.marine)==null?void 0:Ke.wave)==null?void 0:tt.ECMWF)==null?void 0:ot.meta)==null?void 0:D.initialisationTime)),1),o.createVNode(m),o.createElementVNode("div",nd,o.toDisplayString(t.$t("weather.currents")),1),o.createElementVNode("div",sd,o.toDisplayString((Yt=(qe=(G=(Qe=i.models)==null?void 0:Qe.marine)==null?void 0:G.current)==null?void 0:qe.ECMWF)==null?void 0:Yt.source)+" "+o.toDisplayString((yo=(me=(eo=(se=i.models)==null?void 0:se.marine)==null?void 0:eo.current)==null?void 0:me.ECMWF)==null?void 0:yo.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((Ao=(ko=(xo=(wo=(bo=i.models)==null?void 0:bo.marine)==null?void 0:wo.current)==null?void 0:xo.ECMWF)==null?void 0:ko.meta)==null?void 0:Ao.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",cd,o.toDisplayString(t.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",md,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((_o=(zo=(Co=(vo=(Lo=i.models)==null?void 0:Lo.marine)==null?void 0:vo.current)==null?void 0:Co.ECMWF)==null?void 0:zo.meta)==null?void 0:_o.availabilityTime)),1),o.createElementVNode("div",dd,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((To=(Mo=(No=(Po=(So=i.models)==null?void 0:So.marine)==null?void 0:Po.current)==null?void 0:No.ECMWF)==null?void 0:Mo.meta)==null?void 0:To.initialisationTime)),1)]}),_:1})]),_:1})],2)],6),a.map?(o.openBlock(),o.createBlock(k,o.mergeProps({key:1,ref:"windBarb",map:a.map,"map-feather":a.mapFeather,"before-layer":"empty-layer-3",wind:(S=i.weatherLayers)==null?void 0:S.wind},t.$attrs),null,16,["map","map-feather","wind"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(x,o.mergeProps({key:2,map:a.map,"before-layer":"empty-layer-2","sig-wave-height":(W=i.weatherLayers)==null?void 0:W["sig-wave-height"]},t.$attrs),null,16,["map","sig-wave-height"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(b,o.mergeProps({key:3,map:a.map,"map-feather":a.mapFeather,"before-layer":"empty-layer-1",current:(Z=i.weatherLayers)==null?void 0:Z.current},t.$attrs),null,16,["map","map-feather","current"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(A,o.mergeProps({key:4,map:a.map,"map-feather":a.mapFeather,"before-layer":"empty-layer-1",swell:(ee=i.weatherLayers)==null?void 0:ee["swell-direction-contour"]},t.$attrs,{theme:a.theme}),null,16,["map","map-feather","swell","theme"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(v,o.mergeProps({key:5,map:a.map,"before-layer":"empty-layer-3",prmsl:(j=i.weatherLayers)==null?void 0:j.prmsl},t.$attrs,{theme:a.theme}),null,16,["map","prmsl","theme"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(L,o.mergeProps({key:6,viewport:i.viewport,factor:(B=i.weatherLayers)==null?void 0:B["wind-particle"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(C,o.mergeProps({key:7,viewport:i.viewport,factor:(J=i.weatherLayers)==null?void 0:J["current-particle"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(_,o.mergeProps({key:8,viewport:i.viewport,factor:(E=i.weatherLayers)==null?void 0:E["sig-wave-particle"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(N,o.mergeProps({key:9,viewport:i.viewport,factor:(O=i.weatherLayers)==null?void 0:O["swell-particle"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(M,o.mergeProps({key:10,viewport:i.viewport,factor:($=i.weatherLayers)==null?void 0:$["ice-edge"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(T,o.mergeProps({key:11,viewport:i.viewport,factor:(de=i.weatherLayers)==null?void 0:de["ice-cover"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(I,o.mergeProps({key:12,viewport:i.viewport,factor:(ue=i.weatherLayers)==null?void 0:ue["ice-thickness"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(X,o.mergeProps({key:13,viewport:i.viewport,factor:(re=i.weatherLayers)==null?void 0:re.precip3h,"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(Q,o.mergeProps({key:14,viewport:i.viewport,factor:(ge=i.weatherLayers)==null?void 0:ge.visibility,"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(q,o.mergeProps({key:15,viewport:i.viewport,factor:(ye=i.weatherLayers)==null?void 0:ye["water-temp"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(le,o.mergeProps({key:16,viewport:i.viewport,factor:(_e=i.weatherLayers)==null?void 0:_e.temp,"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0)])}const pd=K(Am,[["render",hd]]),co=[{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","ecmwf_ifs"],categories:"ecmwf_ifs025,ecmwf_aifs025_single,ecmwf_ifs",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"}],mo=[{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 co.filter(e=>!e.disabled&&e.alias)}static standardMarineModels(){return mo.filter(e=>!e.disabled&&e.alias)}static autoPickLayerModel(e,a="copernicus"){return a=a||"copernicus",a=a==null?void 0:a.toLowerCase(),a=["gfs","ecmwf","copernicus"].includes(a)?a:"copernicus",e=e==null?void 0:e.toLowerCase(),e==="gfs"?"gfs":["ec","ecmwf"].includes(e)?"ecmwf":["copernicus","cmems"].includes(e)?"copernicus":a}static autoPickPeerModel(e,a,r="copernicus"){if(a=this.autoPickLayerModel(a,r),el.LayerHelper.WEATHER_LAYERS.reduce((i,l)=>l.atmos?i+l.weight:i,0)&e.weight){if(a==="copernicus")return"ecmwf"}else{if(["sig-wave","sig-wave-height","sig-wave-height-contour"].includes(e.key))return a;if(a==="ecmwf")return"copernicus"}return a}static autoPickMeteoModel(e="best_match"){var a,r;e=e==null?void 0:e.toLowerCase(),e=e==="ec"?"ecmwf":e;const i=e.toLowerCase().split(","),l=[],n=[];for(const s of i){let c=co.find(d=>{var u,f,g;return((u=d.models)==null?void 0:u.includes(s))||((f=d.alias)==null?void 0:f.toLowerCase())===s||((g=d.name)==null?void 0:g.toLowerCase())===s}),m=mo.find(d=>{var u,f,g;return((u=d.models)==null?void 0:u.includes(s))||((f=d.alias)==null?void 0:f.toLowerCase())===s||((g=d.name)==null?void 0:g.toLowerCase())===s});c=c||co.find(d=>{var u,f;return((u=d.alias)==null?void 0:u.toLowerCase())===((f=m==null?void 0:m.alias)==null?void 0:f.toLowerCase())}),m=m||mo.find(d=>{var u,f;return((u=d.alias)==null?void 0:u.toLowerCase())===((f=c==null?void 0:c.alias)==null?void 0:f.toLowerCase())}),c=c||co[0],m=m||mo[0],l.push((a=c.models)!=null&&a.includes(s)?s:c.model),n.push((r=m.models)!=null&&r.includes(s)?s:m.model)}return{weatherModels:l.join(","),marineModels:n.join(",")}}static autoPickSubCategories(e){e=e.toUpperCase();const a=co.filter(l=>l.alias===e),r=mo.filter(l=>l.alias===e),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(e,a){var r,i,l,n,s,c,m,d,u,f,g,p,h,y,k,x,b,A,v,L,C,_,N,M,T,I,X,Q,q,le,S,W,Z,ee,j,B,J,E,O,$,de,ue,re,ge,ye,_e,U,ne,Fe,Ge,Re,Ce,je,Te,Ve,De,We,Ze,Be,xe,ke,ze,He,Xe,Oe,Pe,it,rt,lt,nt,st,ct,mt,dt,ht,pt,gt,ut,ft,yt,bt,wt,xt,kt,At,Lt,vt,Ct,zt,_t,St,Pt,Nt,Mt,Tt,Vt,Et,Rt,Dt,Bt,It,Ft,Gt,jt,Wt,Ne,Ee,Zt,Ye,Ht,et,Ae,Ue;const ie=typeof a=="string"?z(a):a;let Le=ie.clone();const Y=e==null?void 0:e.weather,H=e==null?void 0:e.marine,Je=((i=(r=Y==null?void 0:Y[0])==null?void 0:r.hourly)==null?void 0:i.date)||((n=(l=H==null?void 0:H[0])==null?void 0:l.hourly)==null?void 0:n.date),Ie=z.utc(Je),Se=Ie.clone().add(((m=(c=(s=Y==null?void 0:Y[0])==null?void 0:s.hourly)==null?void 0:c.time)==null?void 0:m.at(0))||((f=(u=(d=H==null?void 0:H[0])==null?void 0:d.hourly)==null?void 0:u.time)==null?void 0:f.at(0)),"h"),F=Ie.clone().add(((h=(p=(g=Y==null?void 0:Y[0])==null?void 0:g.hourly)==null?void 0:p.time)==null?void 0:h.at(-1))||((x=(k=(y=H==null?void 0:H[0])==null?void 0:y.hourly)==null?void 0:k.time)==null?void 0:x.at(-1)),"h"),Xt=[];Le=Le.isBefore(Se)?Se.clone():Le,Le=Le.isAfter(F)?F.clone():Le;const te=Le.utc().diff(Se,"h",!1);let ve,Ke;if(Y!=null&&Y.length){let tt=0,ot=0,D=0;for(const Qe of Y){const G=Qe==null?void 0:Qe.hourly;for(let me=te-(te-1)%3;me<=te;me++)tt+=((b=G==null?void 0:G.precipitation)==null?void 0:b.at(me))??0;for(let me=te-(te-1)%6;me<=te;me++)ot+=((A=G==null?void 0:G.precipitation)==null?void 0:A.at(me))??0;for(let me=te-(te-1)%12;me<=te;me++)D+=((v=G==null?void 0:G.precipitation)==null?void 0:v.at(me))??0;const qe=((L=G==null?void 0:G.wind_direction_10m)==null?void 0:L.at(te))??((_=(C=G==null?void 0:G.wind_direction_10m)==null?void 0:C.filter(me=>me!==null))==null?void 0:_.at(-1));ve={temp:((N=G==null?void 0:G.temperature_2m)==null?void 0:N.at(te))??((T=(M=G==null?void 0:G.temperature_2m)==null?void 0:M.filter(me=>me!==null))==null?void 0:T.at(-1)),apparentTemp:((I=G==null?void 0:G.apparent_temperature)==null?void 0:I.at(te))??((Q=(X=G==null?void 0:G.apparent_temperature)==null?void 0:X.filter(me=>me!==null))==null?void 0:Q.at(-1)),rh:((q=G==null?void 0:G.relative_humidity_2m)==null?void 0:q.at(te))??((S=(le=G==null?void 0:G.relative_humidity_2m)==null?void 0:le.filter(me=>me!==null))==null?void 0:S.at(-1)),dp:((W=G==null?void 0:G.dew_point_2m)==null?void 0:W.at(te))??((ee=(Z=G==null?void 0:G.dew_point_2m)==null?void 0:Z.filter(me=>me!==null))==null?void 0:ee.at(-1)),precip:{probability:((j=G==null?void 0:G.precipitation_probability)==null?void 0:j.at(te))??0,sum:((B=G==null?void 0:G.precipitation)==null?void 0:B.at(te))??0,sum1Hours:((J=G==null?void 0:G.precipitation)==null?void 0:J.at(te))??0,sum3Hours:Math.round(tt*100)/100,sum6Hours:Math.round(ot*100)/100,sum12Hours:Math.round(D*100)/100},pmsl:((E=G==null?void 0:G.pressure_msl)==null?void 0:E.at(te))??(($=(O=G==null?void 0:G.pressure_msl)==null?void 0:O.filter(me=>me!==null))==null?void 0:$.at(-1)),psurf:((de=G==null?void 0:G.surface_pressure)==null?void 0:de.at(te))??((re=(ue=G==null?void 0:G.surface_pressure)==null?void 0:ue.filter(me=>me!==null))==null?void 0:re.at(-1)),code:((ge=G==null?void 0:G.weather_code)==null?void 0:ge.at(te))??((_e=(ye=G==null?void 0:G.weather_code)==null?void 0:ye.filter(me=>me!==null))==null?void 0:_e.at(-1)),visibility:this.m2nm(((U=G==null?void 0:G.visibility)==null?void 0:U.at(te))??((Fe=(ne=G==null?void 0:G.visibility)==null?void 0:ne.filter(me=>me!==null))==null?void 0:Fe.at(-1))),wind:{speed:((Ge=G==null?void 0:G.wind_speed_10m)==null?void 0:Ge.at(te))??((Ce=(Re=G==null?void 0:G.wind_speed_10m)==null?void 0:Re.filter(me=>me!==null))==null?void 0:Ce.at(-1)),kts:((je=G==null?void 0:G.wind_speed_10m)==null?void 0:je.at(te))??((Ve=(Te=G==null?void 0:G.wind_speed_10m)==null?void 0:Te.filter(me=>me!==null))==null?void 0:Ve.at(-1)),degree:qe,bearing:qe!==null?Math.round((qe+180)%360):null,gusts:((De=G==null?void 0:G.wind_gusts_10m)==null?void 0:De.at(te))??((Ze=(We=G==null?void 0:G.wind_gusts_10m)==null?void 0:We.filter(me=>me!==null))==null?void 0:Ze.at(-1))},isDay:(Be=G==null?void 0:G.is_day)==null?void 0:Be.at(te)};const{name:Yt,url:se,bg:eo}=this.parseWeatherCode(ve.code,ve.isDay);ve.name=Yt,ve.url=se,ve.bg=eo,ve.wind.scale=this.beaufort(this.kts2ms(ve.wind.kts)),ve.wind.direction=this.degree2Direction(ve.wind.degree),Xt.push({utc:ie.utc().format(),realUTC:Se.add(te,"h").format(),model:Qe.model,weather:{...ve}})}}if(H!=null&&H.length){let tt=0;for(const ot of H){const D=ot==null?void 0:ot.hourly,Qe=((xe=D==null?void 0:D.wave_direction)==null?void 0:xe.at(te))??((ze=(ke=D==null?void 0:D.wave_direction)==null?void 0:ke.filter(se=>se!==null))==null?void 0:ze.at(-1)),G=((He=D==null?void 0:D.swell_wave_direction)==null?void 0:He.at(te))??((Oe=(Xe=D==null?void 0:D.swell_wave_direction)==null?void 0:Xe.filter(se=>se!==null))==null?void 0:Oe.at(-1)),qe=((Pe=D==null?void 0:D.wind_wave_direction)==null?void 0:Pe.at(te))??((rt=(it=D==null?void 0:D.wind_wave_direction)==null?void 0:it.filter(se=>se!==null))==null?void 0:rt.at(-1)),Yt=((lt=D==null?void 0:D.ocean_current_direction)==null?void 0:lt.at(te))??((st=(nt=D==null?void 0:D.ocean_current_direction)==null?void 0:nt.filter(se=>se!==null))==null?void 0:st.at(-1));Ke={wave:{sig:{height:((ct=D==null?void 0:D.wave_height)==null?void 0:ct.at(te))??((dt=(mt=D==null?void 0:D.wave_height)==null?void 0:mt.filter(se=>se!==null))==null?void 0:dt.at(-1)),degree:Qe,bearing:Qe!==null?Math.round((Qe+180)%360):null,period:((ht=D==null?void 0:D.wave_period)==null?void 0:ht.at(te))??((gt=(pt=D==null?void 0:D.wave_period)==null?void 0:pt.filter(se=>se!==null))==null?void 0:gt.at(-1))},swell:{height:((ut=D==null?void 0:D.swell_wave_height)==null?void 0:ut.at(te))??((yt=(ft=D==null?void 0:D.swell_wave_height)==null?void 0:ft.filter(se=>se!==null))==null?void 0:yt.at(-1)),degree:G,bearing:G!==null?Math.round((G+180)%360):null,period:((bt=D==null?void 0:D.swell_wave_period)==null?void 0:bt.at(te))??((xt=(wt=D==null?void 0:D.swell_wave_period)==null?void 0:wt.filter(se=>se!==null))==null?void 0:xt.at(-1)),peakPeriod:((kt=D==null?void 0:D.swell_wave_peak_period)==null?void 0:kt.at(te))??((Lt=(At=D==null?void 0:D.swell_wave_peak_period)==null?void 0:At.filter(se=>se!==null))==null?void 0:Lt.at(-1))},wd:{height:((vt=D==null?void 0:D.wind_wave_height)==null?void 0:vt.at(te))??((zt=(Ct=D==null?void 0:D.wind_wave_height)==null?void 0:Ct.filter(se=>se!==null))==null?void 0:zt.at(-1)),degree:qe,bearing:qe!==null?Math.round((qe+180)%360):null,period:((_t=D==null?void 0:D.wind_wave_period)==null?void 0:_t.at(te))??((Pt=(St=D==null?void 0:D.wind_wave_period)==null?void 0:St.filter(se=>se!==null))==null?void 0:Pt.at(-1)),peakPeriod:((Nt=D==null?void 0:D.wind_wave_peak_period)==null?void 0:Nt.at(te))??((Tt=(Mt=D==null?void 0:D.wind_wave_peak_period)==null?void 0:Mt.filter(se=>se!==null))==null?void 0:Tt.at(-1))}},current:{speed:((Vt=D==null?void 0:D.ocean_current_velocity)==null?void 0:Vt.at(te))??((Rt=(Et=D==null?void 0:D.ocean_current_velocity)==null?void 0:Et.filter(se=>se!==null))==null?void 0:Rt.at(-1)),kts:((Dt=D==null?void 0:D.ocean_current_velocity)==null?void 0:Dt.at(te))??((It=(Bt=D==null?void 0:D.ocean_current_velocity)==null?void 0:Bt.filter(se=>se!==null))==null?void 0:It.at(-1)),degree:Yt,bearing:Yt},sst:((Ft=D==null?void 0:D.sea_surface_temperature)==null?void 0:Ft.at(te))??((jt=(Gt=D==null?void 0:D.sea_surface_temperature)==null?void 0:Gt.filter(se=>se!==null))==null?void 0:jt.at(-1)),height:((Wt=D==null?void 0:D.sea_level_height_msl)==null?void 0:Wt.at(te))??((Ee=(Ne=D==null?void 0:D.sea_level_height_msl)==null?void 0:Ne.filter(se=>se!==null))==null?void 0:Ee.at(-1)),ice:{sit:((Zt=D==null?void 0:D.sea_ice_thickness)==null?void 0:Zt.at(te))??((Ht=(Ye=D==null?void 0:D.sea_ice_thickness)==null?void 0:Ye.filter(se=>se!==null))==null?void 0:Ht.at(-1)),sic:((et=D==null?void 0:D.sea_ice_concentration)==null?void 0:et.at(te))??((Ue=(Ae=D==null?void 0:D.sea_ice_concentration)==null?void 0:Ae.filter(se=>se!==null))==null?void 0:Ue.at(-1))}},Ke.wave=this.parseWave(Ke.wave,ve==null?void 0:ve.wind),Ke.current.direction=this.degree2Direction(Ke.current.degree),Xt[tt]?Object.assign(Xt[tt],Ke):Xt.push({utc:ie.utc().format(),realUTC:Se.add(te,"h").format(),model:ot.model,...Ke}),tt++}}return Xt}static toLegacy(e){var a,r,i,l,n,s,c,m,d,u;return{wind:(a=e==null?void 0:e.weather)==null?void 0:a.wind,visibility:(r=e==null?void 0:e.weather)==null?void 0:r.visibility,temp:(i=e==null?void 0:e.weather)==null?void 0:i.temp,prmsl:(l=e==null?void 0:e.weather)==null?void 0:l.pmsl,gusts:{kts:(s=(n=e==null?void 0:e.weather)==null?void 0:n.wind)==null?void 0:s.gusts},precip:(c=e==null?void 0:e.weather)==null?void 0:c.precip,code:(m=e==null?void 0:e.weather)==null?void 0:m.code,name:(d=e==null?void 0:e.weather)==null?void 0:d.name,url:(u=e==null?void 0:e.weather)==null?void 0:u.url,wave:e==null?void 0:e.wave,current:e==null?void 0:e.current,sst:e==null?void 0:e.sst,height:e==null?void 0:e.height,utc:e==null?void 0:e.utc,source:e==null?void 0:e.model,ice:e==null?void 0:e.ice}}static pickDaily(e,a){var r,i,l,n,s,c,m,d,u,f,g,p,h,y,k,x,b,A,v,L,C,_,N,M,T,I,X,Q,q,le,S,W,Z,ee,j,B,J,E,O,$,de,ue,re,ge,ye,_e,U,ne,Fe,Ge,Re,Ce,je,Te,Ve,De,We,Ze,Be,xe,ke,ze,He,Xe,Oe,Pe,it,rt,lt,nt,st,ct,mt,dt,ht,pt,gt,ut,ft,yt,bt,wt,xt,kt,At,Lt,vt,Ct,zt,_t,St,Pt,Nt,Mt,Tt,Vt,Et,Rt,Dt,Bt,It,Ft,Gt,jt;const Wt=typeof a=="string"?z(a):a;let Ne=Wt.clone();const Ee=e==null?void 0:e.weather,Zt=e==null?void 0:e.marine,Ye=z((l=(i=(r=Ee==null?void 0:Ee[0])==null?void 0:r.daily)==null?void 0:i.time)==null?void 0:l.at(0)),Ht=z((c=(s=(n=Ee==null?void 0:Ee[0])==null?void 0:n.daily)==null?void 0:s.time)==null?void 0:c.at(-1)),et=[];Ne=Ne.isBefore(Ye)?Ye.clone():Ne,Ne=Ne.isAfter(Ht)?Ht.clone():Ne;let Ae,Ue;const ie=Ne.diff(Ye,"d",!1);if(Ee)for(const Le of Ee){const Y=Le.daily,H=((m=Y.wind_direction_10m_dominant)==null?void 0:m.at(ie))??((u=(d=Y.wind_direction_10m_dominant)==null?void 0:d.filter(F=>F!==null))==null?void 0:u.at(-1));Ae={code:((f=Y.weather_code)==null?void 0:f.at(ie))??((p=(g=Y.weather_code)==null?void 0:g.filter(F=>F!==null))==null?void 0:p.at(-1)),temp:{max:((h=Y.temperature_2m_max)==null?void 0:h.at(ie))??((k=(y=Y.temperature_2m_max)==null?void 0:y.filter(F=>F!==null))==null?void 0:k.at(-1)),min:((x=Y.temperature_2m_min)==null?void 0:x.at(ie))??((A=(b=Y.temperature_2m_min)==null?void 0:b.filter(F=>F!==null))==null?void 0:A.at(-1)),mean:((v=Y.temperature_2m_mean)==null?void 0:v.at(ie))??((C=(L=Y.temperature_2m_mean)==null?void 0:L.filter(F=>F!==null))==null?void 0:C.at(-1))},apparentTemp:{max:((_=Y.apparent_temperature_max)==null?void 0:_.at(ie))??((M=(N=Y.apparent_temperature_max)==null?void 0:N.filter(F=>F!==null))==null?void 0:M.at(-1)),min:((T=Y.apparent_temperature_min)==null?void 0:T.at(ie))??((X=(I=Y.apparent_temperature_min)==null?void 0:I.filter(F=>F!==null))==null?void 0:X.at(-1))},precip:{sum:((Q=Y.precipitation_sum)==null?void 0:Q.at(ie))??((le=(q=Y.precipitation_sum)==null?void 0:q.filter(F=>F!==null))==null?void 0:le.at(-1)),rainSum:((S=Y.rain_sum)==null?void 0:S.at(ie))??((Z=(W=Y.rain_sum)==null?void 0:W.filter(F=>F!==null))==null?void 0:Z.at(-1)),snowfallSum:((ee=Y.snowfall_sum)==null?void 0:ee.at(ie))??((B=(j=Y.snowfall_sum)==null?void 0:j.filter(F=>F!==null))==null?void 0:B.at(-1)),showersSum:((J=Y.showers_sum)==null?void 0:J.at(ie))??((O=(E=Y.showers_sum)==null?void 0:E.filter(F=>F!==null))==null?void 0:O.at(-1)),hours:(($=Y.precipitation_hours)==null?void 0:$.at(ie))??0,probability:((de=Y.precipitation_probability_max)==null?void 0:de.at(ie))??0},rh:{max:((ue=Y.relative_humidity_2m_max)==null?void 0:ue.at(ie))??((ge=(re=Y.relative_humidity_2m_max)==null?void 0:re.filter(F=>F!==null))==null?void 0:ge.at(-1)),min:((ye=Y.relative_humidity_2m_min)==null?void 0:ye.at(ie))??((U=(_e=Y.relative_humidity_2m_min)==null?void 0:_e.filter(F=>F!==null))==null?void 0:U.at(-1)),mean:((ne=Y.relative_humidity_2m_mean)==null?void 0:ne.at(ie))??((Ge=(Fe=Y.relative_humidity_2m_mean)==null?void 0:Fe.filter(F=>F!==null))==null?void 0:Ge.at(-1))},wind:{speed:((Re=Y.wind_speed_10m_max)==null?void 0:Re.at(ie))??((je=(Ce=Y.wind_speed_10m_max)==null?void 0:Ce.filter(F=>F!==null))==null?void 0:je.at(-1)),kts:((Te=Y.wind_speed_10m_max)==null?void 0:Te.at(ie))??((De=(Ve=Y.wind_speed_10m_max)==null?void 0:Ve.filter(F=>F!==null))==null?void 0:De.at(-1)),degree:H,gusts:((We=Y.wind_gusts_10m_max)==null?void 0:We.at(ie))??((Be=(Ze=Y.wind_gusts_10m_max)==null?void 0:Ze.filter(F=>F!==null))==null?void 0:Be.at(-1)),mean:((xe=Y.wind_speed_10m_mean)==null?void 0:xe.at(ie))??((ze=(ke=Y.wind_speed_10m_mean)==null?void 0:ke.filter(F=>F!==null))==null?void 0:ze.at(-1)),bearing:H!==null?Math.round((H+180)%360):null},visibility:{max:this.m2nm(((He=Y.visibility_max)==null?void 0:He.at(ie))??((Oe=(Xe=Y.visibility_max)==null?void 0:Xe.filter(F=>F!==null))==null?void 0:Oe.at(-1))),min:this.m2nm(((Pe=Y.visibility_min)==null?void 0:Pe.at(ie))??((rt=(it=Y.visibility_min)==null?void 0:it.filter(F=>F!==null))==null?void 0:rt.at(-1))),mean:this.m2nm(((lt=Y.visibility_mean)==null?void 0:lt.at(ie))??((st=(nt=Y.visibility_mean)==null?void 0:nt.filter(F=>F!==null))==null?void 0:st.at(-1)))}};const{name:Je,url:Ie,bg:Se}=this.parseWeatherCode(Ae.code,!0);Ae.name=Je,Ae.url=Ie,Ae.bg=Se,Ae.wind.scale=this.beaufort(this.kts2ms(Ae.wind.kts)),Ae.wind.direction=this.degree2Direction(Ae.wind.degree),et.push({utc:Wt.utc().format(),realUTC:Ye.add(ie,"d").utc().format(),model:Le.model,weather:{...Ae}})}if(Zt){let Le=0;for(const Y of Zt){const H=Y.daily,Je=((ct=H==null?void 0:H.wave_direction_dominant)==null?void 0:ct.at(ie))||((dt=(mt=H==null?void 0:H.wave_direction_dominant)==null?void 0:mt.filter(F=>F!==null))==null?void 0:dt.at(-1)),Ie=((ht=H==null?void 0:H.swell_wave_direction_dominant)==null?void 0:ht.at(ie))||((gt=(pt=H==null?void 0:H.swell_wave_direction_dominant)==null?void 0:pt.filter(F=>F!==null))==null?void 0:gt.at(-1)),Se=((ut=H==null?void 0:H.wind_wave_direction_dominant)==null?void 0:ut.at(ie))||((yt=(ft=H==null?void 0:H.wind_wave_direction_dominant)==null?void 0:ft.filter(F=>F!==null))==null?void 0:yt.at(-1));Ue={wave:{sig:{height:((bt=H==null?void 0:H.wave_height_max)==null?void 0:bt.at(ie))||((xt=(wt=H==null?void 0:H.wave_height_max)==null?void 0:wt.filter(F=>F!==null))==null?void 0:xt.at(-1)),degree:Je,period:((kt=H==null?void 0:H.wave_period_max)==null?void 0:kt.at(ie))||((Lt=(At=H==null?void 0:H.wave_period_max)==null?void 0:At.filter(F=>F!==null))==null?void 0:Lt.at(-1)),bearing:Je!==null?Math.round((Je+180)%360):null},swell:{height:((vt=H==null?void 0:H.swell_wave_height_max)==null?void 0:vt.at(ie))??((zt=(Ct=H==null?void 0:H.swell_wave_height_max)==null?void 0:Ct.filter(F=>F!==null))==null?void 0:zt.at(-1)),degree:Ie,period:((_t=H==null?void 0:H.swell_wave_period_max)==null?void 0:_t.at(ie))??((Pt=(St=H==null?void 0:H.swell_wave_period_max)==null?void 0:St.filter(F=>F!==null))==null?void 0:Pt.at(-1)),peakPeriod:((Nt=H==null?void 0:H.swell_wave_peak_period_max)==null?void 0:Nt.at(ie))??((Tt=(Mt=H==null?void 0:H.swell_wave_peak_period_max)==null?void 0:Mt.filter(F=>F!==null))==null?void 0:Tt.at(-1)),bearing:Ie!==null?Math.round((Ie+180)%360):null},wd:{height:((Vt=H==null?void 0:H.wind_wave_height_max)==null?void 0:Vt.at(ie))??((Rt=(Et=H==null?void 0:H.wind_wave_height_max)==null?void 0:Et.filter(F=>F!==null))==null?void 0:Rt.at(-1)),degree:Se,period:((Dt=H==null?void 0:H.wind_wave_period_max)==null?void 0:Dt.at(ie))??((It=(Bt=H==null?void 0:H.wind_wave_period_max)==null?void 0:Bt.filter(F=>F!==null))==null?void 0:It.at(-1)),peakPeriod:((Ft=H==null?void 0:H.wind_wave_peak_period_max)==null?void 0:Ft.at(ie))??((jt=(Gt=H==null?void 0:H.wind_wave_peak_period_max)==null?void 0:Gt.filter(F=>F!==null))==null?void 0:jt.at(-1)),bearing:Se!==null?Math.round((Se+180)%360):null}}},Ue.wave=this.parseWave(Ue.wave,Ae==null?void 0:Ae.wind),Object.assign(et[Le]||{},Ue),Le++}}return et}static parseWave(e,a){if(e.sig.direction=this.degree2Direction(e.sig.degree),e.swell.direction=this.degree2Direction(e.swell.degree),e.wd.direction=this.degree2Direction(e.wd.degree),e.sig.scale=this.douglas(e.sig.height),e.swell.scale=this.douglas(e.swell.height),e.wd.scale=this.douglas(e.wd.height),e.sig.height==0){const r=Math.sqrt(Math.pow(e.swell.height||0,2)+Math.pow(e.wd.height||0,2));e.sig.height=r?Math.round(r*100)/100:.1}if(e.swell.height===0)if(e.sig.height>e.wd.height){const r=Math.sqrt(Math.abs(Math.pow(e.sig.height||0,2)-Math.pow(e.wd.height||0,2)));e.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,l=Math.max(e.sig.height,e.wd.height);e.swell.height=Math.round((i<l?i:l/2)*100)/100}if(e.wd.height===0)if(e.sig.height>e.swell.height){const r=Math.sqrt(Math.abs(Math.pow(e.sig.height||0,2)-Math.pow(e.swell.height||0,2))),i=.24*this.kts2ms((a==null?void 0:a.kts)||0);e.wd.height=Math.round(Math.min(r,i)*100)/100}else{const r=.24*this.kts2ms((a==null?void 0:a.kts)||0),i=Math.max(e.sig.height,e.swell.height);e.wd.height=Math.round((r<i?r:i/2)*100)/100}if(e.swell.height>=e.sig.height&&(e.swell.height=Math.round(e.sig.height*.8*100)/100),e.wd.height>=e.sig.height&&(e.wd.height=Math.round(e.sig.height*.8*100)/100),!e.sig.period){const r=Math.max(e.swell.period,e.wd.period);e.sig.period=Math.round(6*Math.sqrt(e.sig.height)),e.sig.period=isNaN(r)?void 0:e.sig.period>r?r:e.sig.period}if(!e.swell.period){e.swell.period=Math.round(6*Math.sqrt(e.swell.height));const r=Math.max(e.sig.period,e.wd.period);e.swell.period=isNaN(r)?void 0:e.swell.period>r?r:e.swell.period}if(!e.wd.period){e.wd.period=Math.round(6*Math.sqrt(e.wd.height));const r=Math.max(e.sig.period,e.swell.period);e.wd.period=isNaN(r)?void 0:e.wd.period>r?r:e.wd.period}return e}static parseWeatherCode(e,a){const r=this.weatherCode(e);return(a?r.day:r.night)||{}}static weatherCode(e){const a={code:e};switch(e){case 0:a.day={name:"Sunny",url:"https://ossimg.ormwx.com/asset/weather/01d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg1.png"},a.night={name:"Clear",url:"https://ossimg.ormwx.com/asset/weather/01n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg1.png"};break;case 1:a.day={name:"Mainly Sunny",url:"https://ossimg.ormwx.com/asset/weather/01d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg1.png"},a.night={name:"Mainly Clear",url:"https://ossimg.ormwx.com/asset/weather/01n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg1.png"};break;case 2:a.day={name:"Partly Cloudy",url:"https://ossimg.ormwx.com/asset/weather/02d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg2.png"},a.night={name:"Partly Cloudy",url:"https://ossimg.ormwx.com/asset/weather/02n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg2.png"};break;case 3:a.day={name:"Overcast",url:"https://ossimg.ormwx.com/asset/weather/04d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg3.png"},a.night={name:"Overcast",url:"https://ossimg.ormwx.com/asset/weather/04n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg3.png"};break;case 45:a.day={name:"Foggy",url:"https://ossimg.ormwx.com/asset/weather/50d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg4.png"},a.night={name:"Foggy",url:"https://ossimg.ormwx.com/asset/weather/50n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg4.png"};break;case 48:a.day={name:"Rime Fog",url:"https://ossimg.ormwx.com/asset/weather/50d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg4.png"},a.night={name:"Rime Fog",url:"https://ossimg.ormwx.com/asset/weather/50n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg4.png"};break;case 51:a.day={name:"Light Drizzle",url:"https://ossimg.ormwx.com/asset/weather/14d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Drizzle",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 53:a.day={name:"Drizzle",url:"https://ossimg.ormwx.com/asset/weather/14d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Drizzle",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 55:a.day={name:"Heavy Drizzle",url:"https://ossimg.ormwx.com/asset/weather/15d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Drizzle",url:"https://ossimg.ormwx.com/asset/weather/15n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 56:a.day={name:"Light Freezing Drizzle",url:"https://ossimg.ormwx.com/asset/weather/14d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Freezing Drizzle",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 57:a.day={name:"Freezing Drizzle",url:"https://ossimg.ormwx.com/asset/weather/14d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Freezing Drizzle",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 61:a.day={name:"Light Rain",url:"https://ossimg.ormwx.com/asset/weather/16d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Rain",url:"https://ossimg.ormwx.com/asset/weather/10n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 63:a.day={name:"Rain",url:"https://ossimg.ormwx.com/asset/weather/16d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Rain",url:"https://ossimg.ormwx.com/asset/weather/10n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 65:a.day={name:"Heavy Rain",url:"https://ossimg.ormwx.com/asset/weather/16d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Rain",url:"https://ossimg.ormwx.com/asset/weather/10n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 66:a.day={name:"Light Freezing Rain",url:"https://ossimg.ormwx.com/asset/weather/16d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Freezing Rain",url:"https://ossimg.ormwx.com/asset/weather/10n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 67:a.day={name:"Freezing Rain",url:"https://ossimg.ormwx.com/asset/weather/16d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Freezing Rain",url:"https://ossimg.ormwx.com/asset/weather/10n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 71:a.day={name:"Light Snow",url:"https://ossimg.ormwx.com/asset/weather/17d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Light Snow",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 73:a.day={name:"Snow",url:"https://ossimg.ormwx.com/asset/weather/17d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Snow",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 75:a.day={name:"Heavy Snow",url:"https://ossimg.ormwx.com/asset/weather/17d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Heavy Snow",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 77:a.day={name:"Snow Grains",url:"https://ossimg.ormwx.com/asset/weather/17d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Snow Grains",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 80:a.day={name:"Light Showers",url:"https://ossimg.ormwx.com/asset/weather/09d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Showers",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 81:a.day={name:"Showers",url:"https://ossimg.ormwx.com/asset/weather/09d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Showers",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 82:a.day={name:"Heavy Showers",url:"https://ossimg.ormwx.com/asset/weather/09d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Showers",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 85:a.day={name:"Light Snow Showers",url:"https://ossimg.ormwx.com/asset/weather/13d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Light Snow Showers",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 86:a.day={name:"Snow Showers",url:"https://ossimg.ormwx.com/asset/weather/13d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Snow Showers",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 95:a.day={name:"Thunderstorm",url:"https://ossimg.ormwx.com/asset/weather/11d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Thunderstorm",url:"https://ossimg.ormwx.com/asset/weather/11n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 96:a.day={name:"Light Thunderstorms With Hail",url:"https://ossimg.ormwx.com/asset/weather/11d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Thunderstorms With Hail",url:"https://ossimg.ormwx.com/asset/weather/11n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 99:a.day={name:"Thunderstorms With Hail",url:"https://ossimg.ormwx.com/asset/weather/11d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Thunderstorms With Hail",url:"https://ossimg.ormwx.com/asset/weather/11n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break}return a}static kts2ms(e){return isNaN(e)||e===null?e:Math.round(e*1852/3600*1e4)/1e4}static kts2kmh(e){return isNaN(e)||e===null?e:e*1.852}static m2nm(e){return isNaN(e)||e===null?e:Math.round(e/1e3/1.852*1e4)/1e4}static kmh2kts(e){return isNaN(e)||e===null?e:this.ms2kts(e*1e3/3600)}static ms2kts(e){return isNaN(e)||e===null?e:Math.round(e*3600/1852*1e4)/1e4}static degree2Radian(e){if(isNaN(e)||e===null)return e;let a=e%360/360*2*Math.PI;return a=a<0?a+2*Math.PI:a,a}static degree2Direction(e){const a=this.degree2Radian(e);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(e){let a=0;return isNaN(e)||(e=Math.round(e*10)/10,e<=.2?a=0:e<=1.5?a=1:e<=3.3?a=2:e<=5.4?a=3:e<=7.9?a=4:e<=10.7?a=5:e<=13.8?a=6:e<=17.1?a=7:e<=20.7?a=8:e<=22.4?a=9:e<=28.4?a=10:e<=32.6?a=11:e<=36.9?a=12:e<=41.4?a=13:e<=46.1?a=14:e<=50.9?a=15:e<=55.9?a=16:e<=61.2?a=17:e>61.2&&(a=18)),a}static douglas(e){let a="Calm";return isNaN(e)||e<=.1?a="Calm":e<=.5?a="Smooth":e<=1.25?a="Slight":e<=2.5?a="Moderate":e<=4?a="Rough":e<=6?a="VeryRough":e<=9?a="High":e<=14?a="VeryHigh":a="Precipitous",a}};const ub="",gd={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:no.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:V.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(t,e)=>{if(t){const a=z(t).utcOffset(e),r=e<0?e:"+"+e;return`${a==null?void 0:a.format("MMM-DD/HHmm")} (UTC${r}) ${a==null?void 0:a.fromNow()} `}return"-"}},computeTzTime(){return(t,e,a="MM-DD HH:mm")=>{var r,i;if(t){const l=e||0,n=(i=(r=z(t))==null?void 0:r.utcOffset(l))==null?void 0:i.format(a),s=`(UTC ${l>=0?"+":""}${l})`;return n+" "+s}return"-"}},computeTimezone(){return this.timeZone<0?this.timeZone:"+"+this.timeZone},computeBF(){return function(t){const e=ma.kts2ms(t);return ma.beaufort(e)}},computeMovement(){return function(t){var e,a;return(a=(e=t==null?void 0:t.forecasts)==null?void 0:e.find(r=>!r.disabled))==null?void 0:a.movement}},computePosition(){return t=>!t||t.lng===null||t.lng===void 0||isNaN(t.lng)||t.lat===null||t.lat===void 0||isNaN(t.lat)?"-":P.LngLatHelper.lat2pretty(t==null?void 0:t.lat,2).pretty+" / "+P.LngLatHelper.lng2pretty(t==null?void 0:t.lng,2).pretty}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.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 t,e;this.$parent.playerBottom=((e=(t=this.$refs.tropicalsInfo)==null?void 0:t.$el)==null?void 0:e.clientHeight)+10}):this.simple&&(this.$parent.playerBottom=30)},immediate:!0},"tropicals.version":{handler(){this.handleRefresh()}},timeZone:{handler(t,e){t!==e&&this.handleRefresh()}},realTime:{handler(t){this.map&&t&&this.toggle&&this.handleRender()}},locale:{handler(t){this.map&&this.toggle&&this.handleRefresh()}}},methods:{handleMenuToggle(){var t,e,a;this.toggle=!this.toggle,localStorage.setItem(this.tropicalCacheKey,this.toggle),this.toggle?this.fetchTropicals():(this.handleClear(),(a=(e=(t=this.$parent)==null?void 0:t.$refs)==null?void 0:e.idmBottomBar)==null||a.handleToggle("tropical",!1))},async fetchTropicals(){var i,l,n;const t=new Date().valueOf();let e=0,a=0,r=(i=no.LayerHelper.WEATHER_LAYERS.find(s=>s.key==="tropicals"))==null?void 0:i.weight;if(r>0){const s=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],c=await he.get(`${s}/api/arc/weather/layers2/links?l=${r}&v=${this.forecastModel}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(a=new Date().valueOf()-(t+e),console.log("weather links elapsed: ",a,", total: ",e+=a),((l=c==null?void 0:c.data)==null?void 0:l.code)===0){const m=(n=c==null?void 0:c.data)==null?void 0:n.data;await he.get(m.tropicals,{headers:{Authorization:this.defaultMeteoToken,key:"tropicals"},responseType:/\.(jpg|png)$/.test(m.tropicals)?"blob":"json"}).then(d=>{var g,p,h;const u=P.TropicalHelper.convert2Geojson(((g=d==null?void 0:d.data)==null?void 0:g.data)||(d==null?void 0:d.data));((h=(p=d==null?void 0:d.config)==null?void 0:p.headers)==null?void 0:h.key)&&u&&(this.tropicals={data:u,active:!0,cached:!0,type:"json",etime:c.data.etime,version:Math.random()+1})}).catch(d=>{console.log(`tropicals fetch layer error: ${d}`)})}a=new Date().valueOf()-(t+e),console.log("tropicals elapsed: ",a,", total: ",e+=a)}},handleRefresh(){var e,a;(((a=(e=this.tropicals)==null?void 0:e.data)==null?void 0:a.features)||[]).forEach(r=>{var l,n,s,c,m,d,u,f,g,p,h,y,k,x,b,A,v,L,C;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(((s=r.properties.wind)==null?void 0:s.kts)<47||((c=r.properties)==null?void 0:c.kts)<47):i="ts";break;case(((m=r.properties.wind)==null?void 0:m.kts)<63||((d=r.properties)==null?void 0:d.kts)<63):i="sts";break;case(((u=r.properties.wind)==null?void 0:u.kts)<79||((f=r.properties)==null?void 0:f.kts)<79):i="ty";break;case(((g=r.properties.wind)==null?void 0:g.kts)<94||((p=r.properties)==null?void 0:p.kts)<94):i="sty";break;case(((h=r.properties.wind)==null?void 0:h.kts)>=94||((y=r.properties)==null?void 0:y.kts)>=94):i="superTy";break;default:i="superTy";break}r.properties.levelI18n=i,((k=r.geometry)==null?void 0:k.type)==="Point"&&((x=r.properties)!=null&&x.important)&&(r.properties.format=(A=(b=z(r.properties.date))==null?void 0:b.utcOffset(this.timeZone))==null?void 0:A.format(`MMM-DD/HHmm [(utc${this.computeTimezone})]`)),((v=r.geometry)==null?void 0:v.type)==="Point"&&(r.properties.Name=((C=(L=r.properties.name)==null?void 0:L.trim())==null?void 0:C.replace(/^./,_=>_.toUpperCase()))||r.properties.nameCn,r.properties.nameCn=r.properties.nameCn||r.properties.Name||"-")}),this.handleInit()},handleInit(){var t,e,a,r,i,l,n,s,c,m,d,u;this.handleClear(),this.tropicals&&this.map&&(this.handleRender(),(t=this.map)==null||t.on("click",this.clickLayers,this.handleClick),(e=this.map)==null||e.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?(c=(s=(n=this.$parent)==null?void 0:n.$refs)==null?void 0:s.idmBottomBar)==null||c.handleToggle("tropical",!0):(u=(d=(m=this.$parent)==null?void 0:m.$refs)==null?void 0:d.idmBottomBar)==null||u.handleToggle("tropical",!1)},handleRender(){var t,e,a,r,i,l,n,s,c,m;if(this.tropicals&&this.map){const d=new Date().valueOf();let u=0,f=0;(t=this.map)!=null&&t.getSource(this.source)?((a=this.map)==null||a.getSource(this.source).setData((e=this.tropicals)!=null&&e.active?this.tropicals.data:this.empty),f=new Date().valueOf()-(d+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),f=new Date().valueOf()-(d+u),console.log("[tropical] add elapsed: ",f,", total: ",u+=f)),(l=this.map)!=null&&l.getSource(this.clusterSource)?((s=this.map)==null||s.getSource(this.clusterSource).setData((n=this.tropicals)!=null&&n.active?this.tropicals.data:this.empty),f=new Date().valueOf()-(d+u),console.log("[tropical] update elapsed: ",f,", total: ",u+=f)):(this.map.addSource(this.clusterSource,{type:"geojson",data:(c=this.tropicals)!=null&&c.active?(m=this.tropicals)==null?void 0:m.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),f=new Date().valueOf()-(d+u),console.log("[tropical] add elapsed: ",f,", total: ",u+=f));const g=P.TropicalHelper.interpolate(this.tropicals,1);this.interpolateData=JSON.parse(JSON.stringify(g)),this.handleDateChange()}},handleClear(){var t,e,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),(t=this.interpolateMarkers)==null||t.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)),(e=this.map)==null||e.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 t,e,a,r,i,l,n,s,c,m,d,u,f,g,p,h,y,k,x,b,A,v,L,C,_,N,M,T,I,X,Q,q,le,S,W;if((t=this.interpolateMarkers)==null||t.forEach(Z=>Z==null?void 0:Z.remove()),(e=this.interpolateData)!=null&&e.length&&this.tropicals.active){const Z=z(this.realTime).utc().set({minute:0,second:0,millisecond:0}),ee=this.interpolateData.filter(E=>E.properties.date===(Z==null?void 0:Z.format())&&!E.properties.disabled),j=this.handleComputePolygons(ee),B=V.featureCollection([...ee]);j.forEach(E=>{B.features.push(E)}),(a=this.map)!=null&&a.getSource(this.interpolateSource)?(r=this.map)==null||r.getSource(this.interpolateSource).setData(B):((i=this.map)==null||i.addSource(this.interpolateSource,{type:"geojson",data:B}),(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 J=[];for(const E of ee)if(!E.properties.disabled){if(!J.some(re=>{var ge;return re.properties.name===((ge=E.properties)==null?void 0:ge.name)})){const re=((s=(n=this.tropicals.data.features.find(ge=>{var ye;return ge.properties.name===((ye=E.properties)==null?void 0:ye.name)}))==null?void 0:n.properties)==null?void 0:s.nameCn)||((c=E.properties)==null?void 0:c.Name)||"-";E.properties.nameCn=re,E.properties.Name=((d=(m=E.properties.name)==null?void 0:m.trim())==null?void 0:d.replace(/^./,ge=>ge.toUpperCase()))||E.properties.nameCn,J.push(E)}let O=this.Theme.current.value.colors["tropicals-ty"];((f=(u=E.properties)==null?void 0:u.wind)==null?void 0:f.kts)<32||!((p=(g=E.properties)==null?void 0:g.wind)!=null&&p.kts)?O=this.Theme.current.value.colors["tropicals-td"]:((y=(h=E.properties)==null?void 0:h.wind)==null?void 0:y.kts)>=32&&((x=(k=E.properties)==null?void 0:k.wind)==null?void 0:x.kts)<47?O=this.Theme.current.value.colors["tropicals-ts"]:((A=(b=E.properties)==null?void 0:b.wind)==null?void 0:A.kts)>=47&&((L=(v=E.properties)==null?void 0:v.wind)==null?void 0:L.kts)<63?O=this.Theme.current.value.colors["tropicals-sts"]:((_=(C=E.properties)==null?void 0:C.wind)==null?void 0:_.kts)>=63&&((M=(N=E.properties)==null?void 0:N.wind)==null?void 0:M.kts)<79?O=this.Theme.current.value.colors["tropicals-ty"]:((I=(T=E.properties)==null?void 0:T.wind)==null?void 0:I.kts)>=79&&((Q=(X=E.properties)==null?void 0:X.wind)==null?void 0:Q.kts)<94?O=this.Theme.current.value.colors["tropicals-sty"]:((le=(q=E.properties)==null?void 0:q.wind)==null?void 0:le.kts)>=94?O=this.Theme.current.value.colors["tropicals-super-ty"]:O=this.Theme.current.value.colors["tropicals-ty"];const $=`<svg t="1719918955501"
|
|
406
406
|
class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" p-id="18382"
|
|
407
407
|
xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">
|