@idmwx/idmui-gl3 4.4.8 → 4.5.0

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.
@@ -1,4 +1,4 @@
1
- (function(E,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("@turf/turf"),require("@mapbox/sphericalmercator"),require("moment"),require("mapbox-gl"),require("@idm-plugin/geo"),require("axios")):typeof define=="function"&&define.amd?define(["exports","vue","@turf/turf","@mapbox/sphericalmercator","moment","mapbox-gl","@idm-plugin/geo","axios"],r):(E=typeof globalThis<"u"?globalThis:E||self,r(E["idm-gl"]={},E.Vue,E["@turf/turf"],E["@mapbox/sphericalmercator"],E.moment,E["mapbox-gl"],E["@idm-plugin/geo"],E.axios))})(this,function(E,r,Y,Ne,B,O,C,U){"use strict";var Er=Object.defineProperty;var Pr=(E,r,Y)=>r in E?Er(E,r,{enumerable:!0,configurable:!0,writable:!0,value:Y}):E[r]=Y;var P=(E,r,Y)=>(Pr(E,typeof r!="symbol"?r+"":r,Y),Y);function Te(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const x=Te(Y),zr="";var Ve=Object.defineProperty,Ie=(a,e,t)=>e in a?Ve(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,le=(a,e,t)=>(Ie(a,typeof e!="symbol"?e+"":e,t),t);class ce{}le(ce,"LEVEL",{Basic:1,Prime:2,Supper:1024});class he{}le(he,"WEATHER_LAYERS",[{weight:1,name:"Wind",key:"wind",h5:!0,enabled:!0,type:"json",particle:!0},{weight:524288,name:"Wind Particle",key:"wind-particle",peer:{weight:1,key:"wind"},enabled:!0,hide:!0,type:"jpg"},{weight:16,name:"Sig Waves",key:"sig-wave-height",h5:!0,enabled:!0,type:"json"},{weight:4194304,name:"Sig Waves (JPG)",key:"sig-wave",peer:{weight:16,key:"sig-wave"},enabled:!0,hide:!0,type:"jpg"},{weight:8388608,name:"Sig Waves (Contour)",key:"sig-wave-height-contour",peer:{weight:16,key:"sig-wave-contour"},enabled:!0,hide:!0,type:"json"},{weight:96,name:"Current",key:"current",vendor:"cmems",merge:!0,h5:!0,enabled:!0,type:"json"},{weight:1048576,name:"Current Particle",key:"current-particle",vendor:"cmems",peer:{weight:96,key:"current"},enabled:!0,hide:!0,type:"jpg"},{weight:256,name:"Tropicals",key:"tropicals",h5:!0,enabled:!0,type:"json"},{weight:4096,name:"Pressure",h5:!0,key:"prmsl",enabled:!0,type:"json"},{weight:8192,name:"Visibility",vendor:"gfs",key:"visibility",h5:!0,enabled:!0,type:"jpg"},{weight:262144,name:"Precip Acc",key:"precip3h",h5:!0,enabled:!0,type:"jpg"},{weight:6,name:"Swell",key:"swell",merge:!0,h5:!0,enabled:!0,type:"json"},{weight:2,name:"Swell Height",key:"swell-height",partly:!0,enabled:!0,type:"json"},{weight:4,name:"Swell Direction",key:"swell-direction",partly:!0,enabled:!0,type:"json"},{weight:32,name:"Current Direction",key:"current-direction",vendor:"cmems",partly:!0,enabled:!0,type:"json"},{weight:64,name:"Current Speed",key:"current-speed",vendor:"cmems",partly:!0,enabled:!0,type:"json"},{weight:512,name:"Pressure Contour",key:"prmsl-contour",partly:!0,enabled:!0,hide:!0,type:"json"},{weight:1024,name:"Pressure Value",key:"prmsl-value",partly:!0,enabled:!0,hide:!0,type:"json"},{weight:2048,name:"Pressure Front",key:"prmsl-front",partly:!0,enabled:!0,hide:!0,type:"json"},{weight:16384,name:"Iceberg",key:"iceberg",vendor:"cmems",hide:!0,enabled:!1,type:"json"},{weight:32768,name:"Struct Ice",key:"struct-ice",vendor:"cmems",enabled:!1,hide:!0,type:"json"},{weight:65536,name:"Ice Edge",key:"arctic",vendor:"cmems",h5:!0,enabled:!0,type:"jpg"},{weight:131072,name:"Sea Surf. Temp.",key:"water-temp",vendor:"cmems",h5:!0,enabled:!0,type:"jpg"},{weight:2097152,name:"Temp.",key:"temp",h5:!0,enabled:!0,type:"jpg"}]),le(he,"OTHER_LAYERS",[{weight:1,name:"War Zones",key:"war-zones",h5:!0,enabled:!0,type:"json"},{weight:2,name:"GMDSS Areas",key:"gmdss-areas",h5:!0,enabled:!0,type:"json"},{weight:4,name:"ECA Zones",key:"eca-zones",h5:!0,enabled:!0,type:"json"},{weight:8,name:"Load Lines",key:"load-lines",h5:!0,enabled:!0,type:"json"},{weight:16,name:"HRA",key:"high-risk-area",enabled:!1,type:"json"},{weight:32,name:"Pirates",key:"pirates",enabled:!1,type:"json"},{weight:4096,name:"Alert Zones",key:"alert-zones",h5:!0,enabled:!0,type:"json"},{weight:64,name:"Ports",key:"ports",h5:!0,enabled:!0,type:"json"},{weight:128,name:"Time Zones",key:"time-zones",h5:!0,enabled:!0,type:"json"},{weight:256,name:"VRA",key:"voluntary-reporting-area",h5:!0,enabled:!0,type:"json"},{weight:512,name:"Special Areas",key:"special-area",h5:!0,enabled:!0,type:"json"},{weight:1024,name:"Day/Night",key:"day-night",h5:!0,enabled:!0,type:"json"},{weight:2048,name:"ENC",key:"enc",h5:!0,enabled:!0,type:"origin"},{weight:8192,name:"World-12nm",key:"world12nm",h5:!1,enabled:!0,type:"origin"}]);class ge{}le(ge,"WEATHER_TAG",[{weight:4,name:"Adverse Weather Dangerous",key:"DANGEROUS",positive:!0},{weight:2,name:"Adverse Weather Severe",key:"SEVERE",positive:!0},{weight:1,name:"Adverse Weather Heavy",key:"HEAVY",positive:!0}]),le(ge,"SAILING_TAG",[{weight:2048,name:"Deviation",key:"deviation",positive:!0},{weight:4096,name:"Stoppage",key:"stoppage",positive:!0},{weight:8192,name:"Deceleration",key:"deceleration",positive:!0},{weight:16384,name:"No Lane",key:"noLane",positive:!0},{weight:32768,name:"No Noon",key:"noNoon",positive:!0}]),le(ge,"OTHER_TAG",[{weight:2097152,name:"No CP",key:"noCp",positive:!0},{weight:4194304,name:"Send Rpt",key:"sendRpt",positive:!1},{weight:8388608,name:"Send Bps",key:"sendBps",positive:!1},{weight:16777216,name:"Send Pvar",key:"sendPvar",positive:!1},{weight:33554432,name:"Checked",key:"checked",positive:!1},{weight:67108864,name:"Send PWFR",key:"sendPwfr",positive:!1}]);const Nr="",k=(a,e)=>{const t=a.__vccOpts||a;for(const[o,i]of e)t[o]=i;return t},Re={name:"IdmGlLayer",props:{map:{type:Object},mapProjection:{type:String},top:{type:Number,default:60},layerToggle:{type:Boolean,default:!1},toggleVersion:{type:Number},isLogin:{type:Boolean,default:void 0},showWindFeather:{type:Boolean,default:void 0},showWindParticle:{type:Boolean,default:void 0},showCurrentIsoband:{type:Boolean,default:void 0},showCurrentParticle:{type:Boolean,default:void 0}},emits:["weather","other","coordinate","measure","point","3d","layerToggle","handleToggleVersion"],data(){return{autoActive:!0,layers:{weather:[...he.WEATHER_LAYERS.filter(a=>!["swell-height","swell-direction","current-direction","current-speed"].includes(a.key))],other:[...he.OTHER_LAYERS.filter(a=>a.key!=="world12nm"&&a.enabled)]},weatherLayers:[],otherLayers:[],weatherLayersCache:"weatherLayersCache",autoActiveCache:"autoActiveCache",otherLayersCache:"otherLayersCache",collectedLayerCache:"collectedLayerCache",sourceCache:"defaultSourceCache",showCoord:!1,showMeasure:!1,showPoint:!1,show3d:!1,version:{v:"0.0.7",k:"glCacheVersion"},source:"",right:10,rampColorLayers:["visibility","precip3h","temp","water-temp","arctic"]}},computed:{computeLayerClass(){return function(a,e){var o;let t="layer flex-between";return e.some(i=>i.key===a.key)&&(t=t+" active"),(!a.enabled||(o=this.layers.weather)!=null&&o.some(i=>i.key===a.key)&&!this.autoActive||this.rampColorLayers.includes(a.key)&&this.mapProjection==="globe")&&(t=t+" disabled"),t}},hasCollectedLayers(){var a;return((a=this.layers.weather.filter(e=>e.collected))==null?void 0:a.length)>0}},watch:{toggleVersion:{handler(){this.$nextTick(()=>{var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10})}},source:{handler(a,e){a&&e&&a!==e&&this.handleConfirm()}},showWindFeather:{handler(){!this.showWindFeather&&!this.showWindParticle&&this.handleWeatherLayerPick({weight:1,name:"Wind",key:"wind",enabled:!0,type:"json",particle:!0})}},showWindParticle:{handler(){!this.showWindFeather&&!this.showWindParticle&&this.handleWeatherLayerPick({weight:1,name:"Wind",key:"wind",enabled:!0,type:"json",particle:!0})}},showCurrentIsoband:{handler(){!this.showCurrentIsoband&&!this.showCurrentParticle&&this.handleWeatherLayerPick({weight:96,name:"Current",key:"current",vendor:"cmems",merge:!0,h5:!0,enabled:!0})}},showCurrentParticle:{handler(){!this.showCurrentIsoband&&!this.showCurrentParticle&&this.handleWeatherLayerPick({weight:96,name:"Current",key:"current",vendor:"cmems",merge:!0,h5:!0,enabled:!0})}}},mounted(){const a=localStorage.getItem(this.version.k);this.version.v!==a&&(localStorage.removeItem(this.weatherLayersCache),localStorage.removeItem(this.collectedLayerCache),localStorage.removeItem(this.otherLayersCache),localStorage.removeItem("windFeatherCache"),localStorage.removeItem("currentJsonCache"),localStorage.setItem(this.version.k,this.version.v));let e=localStorage.getItem(this.autoActiveCache);this.autoActive=e!=="false",e=localStorage.getItem(this.collectedLayerCache);let t=JSON.parse(e||'[{"weight": 16, "name": "Sig Waves", "key": "sig-wave-height", "collected": true},{"weight": 1, "name": "Wind", "key": "wind", "h5": true, "collected": true},{"weight": 96, "name": "Current", "key": "current", "collected": true},{"weight": 256, "name": "Tropicals", "key": "tropicals", "collected": true},{"weight": 4096, "name": "Pressure", "h5": true, "key": "prmsl", "collected": true},{"weight": 6, "name": "Swell", "key": "swell", "collected": true}]');this.layers.weather.forEach(o=>{o.collected=!!t.some(i=>i.key===o.key&&i.collected)}),e=localStorage.getItem(this.weatherLayersCache),t=JSON.parse(e||'[{"weight":1,"name":"Wind","key":"wind","enabled":true,"type":"json","particle":true},{"weight":4096,"name":"Pressure","key":"prmsl","enabled":true,"type":"json"},{"weight":256,"name":"Tropicals","key":"tropicals","enabled":true,"type":"json"}]'),this.autoActive&&(this.weatherLayers=[...t]),e=localStorage.getItem(this.otherLayersCache),t=JSON.parse(e||'[{"weight":4,"name":"ECA Zones","key":"eca-zones","enabled":true,"type":"json"}]'),this.otherLayers=t,e=localStorage.getItem(this.sourceCache),this.source=e||"GFS",this.handleConfirm()},methods:{handleConfirm(){this.$emit("weather",this.weatherLayers,this.source),this.$emit("other",this.otherLayers),localStorage.setItem(this.autoActiveCache,this.autoActive),localStorage.setItem(this.sourceCache,this.source)},handleWeatherLayerPick(a){if(this.rampColorLayers.includes(a.key)&&this.mapProjection==="globe"||!this.autoActive)return!1;this.weatherLayers.some(e=>e.key===a.key)?this.weatherLayers=this.weatherLayers.filter(e=>e.key!==a.key):this.weatherLayers.length<12&&a.enabled&&(["png","jpg"].includes(a.type)&&(this.weatherLayers=this.weatherLayers.filter(e=>e.type==="json")),this.weatherLayers.push(a)),this.$emit("weather",this.weatherLayers,this.source),localStorage.setItem(this.weatherLayersCache,JSON.stringify(this.weatherLayers)),localStorage.setItem(this.sourceCache,this.source)},handleWeatherLayerCollect(a){var e;a.collected=!a.collected,a.collected&&((e=this.layers.weather.filter(t=>t.collected))==null?void 0:e.length)>=6&&(this.layers.weather.filter(t=>t.collected)[0].collected=!1),localStorage.setItem(this.collectedLayerCache,JSON.stringify(this.layers.weather)),this.$emit("handleToggleVersion")},handleOtherLayerPick(a){this.otherLayers.some(e=>e.key===a.key)?this.otherLayers=this.otherLayers.filter(e=>e.key!==a.key):a.enabled&&this.otherLayers.push(a),localStorage.setItem(this.otherLayersCache,JSON.stringify(this.otherLayers)),this.$emit("other",this.otherLayers)},handleMenuToggle(){this.$emit("layerToggle",!this.layerToggle)},toggleAutoActive(){this.autoActive=!this.autoActive,localStorage.setItem(this.autoActiveCache,this.autoActive),this.autoActive?this.$emit("weather",this.weatherLayers,this.source):this.$emit("weather",[],this.source)},handleCoordToggle(){this.showCoord=!this.showCoord,this.$emit("coordinate",this.showCoord)},handlePointToggle(){this.isLogin?(this.showPoint=!this.showPoint,this.$emit("point",this.showPoint)):this.$emit("handleToggleVersion")},handleMeasureToggle(){this.showMeasure=!this.showMeasure,this.$emit("measure",this.showMeasure)},handle3DToggle(){this.show3d=!this.show3d,this.$emit("3d",this.show3d)}}},De={class:"idm-gl3-layer"},Ae={class:"bar-item layer-bars"},Be={class:"bar-item tool-bars"},Me=["onClick"],je={class:"header-box flex-between"},We={class:"weather-layers card-bg"},Oe={class:"layers-body"},Fe=["onClick"],$e=["onClick"],He={key:0,class:"iconfont bookmark active"},Ue={key:1,class:"iconfont bookmark inactive"},Ze={class:"other-layers card-bg"},Ge={class:"layers-body"},Je=["onClick"],Xe={class:"flex-start"},qe={class:"source-layers card-bg"},Ye={class:"layers-body"};function Qe(a,e,t,o,i,s){const n=r.resolveComponent("ElTooltip"),l=r.resolveComponent("ElRadio"),h=r.resolveComponent("ElRadioGroup"),d=r.resolveComponent("ElScrollbar");return r.openBlock(),r.createElementBlock("div",De,[r.createElementVNode("div",{class:"menu-bar-box",style:r.normalizeStyle({top:t.top+10+"px",right:i.right+"px"})},[r.createElementVNode("div",Ae,[r.createVNode(n,{placement:"left",effect:"light",content:"Menu","show-after":1e3},{default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(t.layerToggle?"menu-icon active":"menu-icon"),onClick:e[0]||(e[0]=(...c)=>s.handleMenuToggle&&s.handleMenuToggle(...c))},e[9]||(e[9]=[r.createElementVNode("span",{class:"iconfont"},"",-1)]),2)]),_:1})])],4),r.createElementVNode("div",{class:"menu-bar-box",style:r.normalizeStyle({top:t.top+160+"px",right:i.right+"px"})},[r.createElementVNode("div",Be,[r.createVNode(n,{placement:"left",effect:"light",content:"Measure","show-after":1e3},{default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(i.showMeasure?"menu-icon active":"menu-icon"),onClick:e[1]||(e[1]=(...c)=>s.handleMeasureToggle&&s.handleMeasureToggle(...c))},e[10]||(e[10]=[r.createElementVNode("span",{class:"iconfont"},"",-1)]),2)]),_:1}),r.createVNode(n,{placement:"left",effect:"light",content:"Point Meteo","show-after":1e3},{default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(i.showPoint?"menu-icon active":"menu-icon"),onClick:e[2]||(e[2]=(...c)=>s.handlePointToggle&&s.handlePointToggle(...c))},e[11]||(e[11]=[r.createElementVNode("span",{class:"iconfont"},"",-1)]),2)]),_:1}),r.createVNode(n,{placement:"left",effect:"light",content:"Grid","show-after":1e3},{default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(i.showCoord?"menu-icon active":"menu-icon"),onClick:e[3]||(e[3]=(...c)=>s.handleCoordToggle&&s.handleCoordToggle(...c))},e[12]||(e[12]=[r.createElementVNode("span",{class:"iconfont"},"",-1)]),2)]),_:1}),r.createVNode(n,{placement:"left",effect:"light",content:"3D","show-after":1e3},{default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(i.show3d?"menu-icon active":"menu-icon"),onClick:e[4]||(e[4]=(...c)=>s.handle3DToggle&&s.handle3DToggle(...c))},e[13]||(e[13]=[r.createElementVNode("span",{class:"iconfont"},"",-1)]),2)]),_:1})])],4),s.hasCollectedLayers?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["active-layers flex-between",i.autoActive?"active":""]),style:r.normalizeStyle({right:i.right+"px",bottom:"100px"})},[r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.layers.weather.filter(c=>c.collected),c=>(r.openBlock(),r.createElementBlock("div",{key:c.key,class:r.normalizeClass(s.computeLayerClass(c,i.weatherLayers)),onClick:m=>s.handleWeatherLayerPick(c)},[e[14]||(e[14]=r.createElementVNode("div",{class:"checkbox"},null,-1)),r.createElementVNode("span",null,r.toDisplayString(c.name),1)],10,Me))),128))]),r.createElementVNode("div",{class:"switch flex-center",style:{"margin-top":"4px","align-self":"flex-start"},onClick:e[5]||(e[5]=(...c)=>s.toggleAutoActive&&s.toggleAutoActive(...c))},e[15]||(e[15]=[r.createElementVNode("i",{class:"iconfont open"},"",-1),r.createElementVNode("i",{class:"iconfont close"},"",-1)]))],6)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"available-layers flex-center",style:r.normalizeStyle({top:t.top+"px",right:t.layerToggle?"0px":"-240px"})},[r.createElementVNode("div",{class:r.normalizeClass(["list-box",t.layerToggle?"right-bar":""])},[r.createElementVNode("div",je,[e[16]||(e[16]=r.createElementVNode("div",null,"Layers",-1)),r.createElementVNode("div",{class:"iconfont close-btn",onClick:e[6]||(e[6]=(...c)=>s.handleMenuToggle&&s.handleMenuToggle(...c))},"")]),r.createVNode(d,{style:{flex:"1"}},{default:r.withCtx(()=>[r.createElementVNode("div",We,[r.createElementVNode("div",{class:r.normalizeClass(["layers-title flex-between",i.autoActive?"active":""])},[e[18]||(e[18]=r.createElementVNode("div",null,"Weather Layers",-1)),r.createElementVNode("div",{class:"switch flex-center",style:{"margin-right":"0"},onClick:e[7]||(e[7]=(...c)=>s.toggleAutoActive&&s.toggleAutoActive(...c))},e[17]||(e[17]=[r.createElementVNode("i",{class:"iconfont open"},"",-1),r.createElementVNode("i",{class:"iconfont close"},"",-1)]))],2),r.createElementVNode("div",Oe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.layers.weather,c=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:c.key},[c.hide?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(s.computeLayerClass(c,i.weatherLayers))},[r.createElementVNode("div",{class:"flex-start",onClick:m=>s.handleWeatherLayerPick(c)},[e[19]||(e[19]=r.createElementVNode("div",{class:"checkbox"},null,-1)),r.createElementVNode("span",null,r.toDisplayString(c.name),1)],8,Fe),r.createElementVNode("div",{onClick:m=>s.handleWeatherLayerCollect(c)},[c.collected?(r.openBlock(),r.createElementBlock("i",He,"")):(r.openBlock(),r.createElementBlock("i",Ue,""))],8,$e)],2))],64))),128)),e[20]||(e[20]=r.createElementVNode("div",{class:"tip flex-start"},[r.createElementVNode("i",{class:"iconfont bookmark",style:{"align-self":"flex-start",padding:"5px 5px 0 0"}},""),r.createElementVNode("div",null,"Bookmark your favorite layer to homepage(Max 6)")],-1))])]),r.createElementVNode("div",Ze,[e[22]||(e[22]=r.createElementVNode("div",{class:"layers-title"},"Other Layers",-1)),r.createElementVNode("div",Ge,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.layers.other,c=>(r.openBlock(),r.createElementBlock("div",{key:c.key,class:r.normalizeClass(s.computeLayerClass(c,i.otherLayers)),onClick:m=>s.handleOtherLayerPick(c)},[r.createElementVNode("div",Xe,[e[21]||(e[21]=r.createElementVNode("div",{class:"switch flex-center"},[r.createElementVNode("i",{class:"iconfont open"},""),r.createElementVNode("i",{class:"iconfont close"},"")],-1)),r.createElementVNode("span",null,r.toDisplayString(c.name),1)])],10,Je))),128))])]),r.createElementVNode("div",qe,[e[25]||(e[25]=r.createElementVNode("span",{class:"layers-title"},"Forecast Model",-1)),r.createElementVNode("div",Ye,[r.createVNode(h,{modelValue:i.source,"onUpdate:modelValue":e[8]||(e[8]=c=>i.source=c),class:"layer-radio flex-col-center-start"},{default:r.withCtx(()=>[r.createVNode(l,{value:"GFS"},{default:r.withCtx(()=>e[23]||(e[23]=[r.createTextVNode("GFS")])),_:1}),r.createVNode(l,{value:"CMEMS"},{default:r.withCtx(()=>e[24]||(e[24]=[r.createTextVNode("CMEMS")])),_:1})]),_:1},8,["modelValue"])])])]),_:1})],2)],4)])}const Ke=k(Re,[["render",Qe]]),Tr="",et={name:"IdmWindBarb",props:{map:{type:Object},wind:{type:Object},current:{type:Object},beforeLayer:{type:String},mapProjection:{type:String},showParticle:{type:Boolean,default:!1},toggleVersion:{type:Number}},emits:["particle","showWindFeather"],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:x.featureCollection([]),showFeather:localStorage.getItem("windFeatherCache")==="true"||!1,windFeatherCache:"windFeatherCache",right:10,bottom:125,windBarbLoaded:!1}},watch:{"wind.version":{handler(){var a;(a=this.wind)!=null&&a.active&&this.showFeather?this.handleRender():this.handleClear()},deep:!0},showParticle:{handler(){},immediate:!0},showFeather:{handler(){localStorage.setItem(this.windFeatherCache,this.showFeather),this.handleToggle(),this.$emit("showWindFeather",this.showFeather)},immediate:!0},toggleVersion:{handler(){var a,e,t,o;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10,this.bottom=(e=this.current)!=null&&e.active?(((t=document.getElementsByClassName("active-layers")[0])==null?void 0:t.clientHeight)||0)+148:(((o=document.getElementsByClassName("active-layers")[0])==null?void 0:o.clientHeight)||0)+110},immediate:!0}},methods:{handleParticle(){this.$emit("particle",{particle:!this.showParticle,key:"wind",weight:1})},handleRender(){var a,e,t,o;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.wind){const i=new Date().valueOf();let s=0,n=0,l=this.empty;if((a=this.wind)!=null&&a.active&&(l=(e=this.wind)==null?void 0:e.data),(t=this.map)!=null&&t.getSource(this.source))(o=this.map)==null||o.getSource(this.source).setData(l),n=new Date().valueOf()-(i+s),console.log("[wind] update elapsed: ",n,", total: ",s+=n);else{this.map.addSource(this.source,{type:"geojson",data:l});for(let h=0;h<(this.barbs??[]).length-1;h++){const d=(this.barbs??[])[h]||0,c=(this.barbs??[])[h+1]||0,m=d<10?`00${d}kts`:d<100?`0${d}kts`:`${d}kts`;this.map.addLayer({id:m,type:"symbol",filter:["all",[">=","spd",d],["<","spd",c]],source:this.source,layout:{"symbol-placement":"point","icon-image":m,"icon-size":.14,"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":1,"text-color":"#222"}},this.beforeLayer)}this.windBarbLoaded=!0,n=new Date().valueOf()-(i+s),console.log("[wind] add elapsed: ",n,", total: ",s+=n)}}},handleToggle(){if(!this.windBarbLoaded)this.handleRender();else for(const a of this.barbs??[]){const e=a<10?`00${a}kts`:a<100?`0${a}kts`:`${a}kts`;this.map.getLayer(e)&&this.map.setLayoutProperty(e,"visibility",this.showFeather?"visible":"none")}},handleClear(){for(const a of this.barbs??[]){const e=a<10?`00${a}kts`:a<100?`0${a}kts`:`${a}kts`;this.map.getLayer(e)&&this.map.removeLayer(e)}this.map.getSource(this.source)&&this.map.removeSource(this.source),this.windBarbLoaded=!1}}},tt={key:0};function at(a,e,t,o,i,s){var n;return(n=t.wind)!=null&&n.active?(r.openBlock(),r.createElementBlock("div",tt,[r.createElementVNode("div",{class:"flex-center wind-tool-bars",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:i.bottom+"px"}])},[t.mapProjection==="mercator"?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["item-bar flex-start",t.showParticle?"active":"inactive"]),onClick:e[0]||(e[0]=(...l)=>s.handleParticle&&s.handleParticle(...l))},e[2]||(e[2]=[r.createElementVNode("div",{class:"checkbox"},null,-1),r.createElementVNode("span",null,"Wind Particles",-1)]),2)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(["item-bar flex-start",i.showFeather?"active":"inactive"]),onClick:e[1]||(e[1]=l=>i.showFeather=!i.showFeather)},e[3]||(e[3]=[r.createElementVNode("div",{class:"checkbox"},null,-1),r.createElementVNode("span",null,"Wind Feather",-1)]),2)],4)])):r.createCommentVNode("",!0)}const rt=k(et,[["render",at]]);class ue{constructor(e){P(this,"map");P(this,"mercator");P(this,"rampColorLayer");P(this,"rampColorSource");P(this,"particleLayer");P(this,"particleSource");P(this,"rampColorCanvas");P(this,"particleCanvas");P(this,"ratio");this.map=e,this.mercator=new Ne,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,t=0){return e>180?this.convertNLng(e-360,t+1):e<-180?this.convertNLng(e+360,t+1):[e,t]}getBoundLngLat(){const e=this.map.getBounds();return[[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(){const e=this.map.getBounds(),t=this.map.getZoom()+1,o=[e._ne.lng,e._ne.lat],i=[e._sw.lng,e._sw.lat],[s,n]=this.convertNLng(o[0]),[l,h]=this.convertNLng(i[0]),[d,c]=this.mercator.px([s,o[1]],t),[m,u]=this.mercator.px([l,i[1]],t),p=Math.round(this.mercator.size*Math.pow(2,t)*(n+h));return[m,u,d+p,c]}getBoundRange(){const e=this.map.getZoom()+1,t=this.mercator.size*Math.pow(2,e),o=this.getBoundPixel();return[o[0]/t,o[2]/t,o[3]/t,o[1]/t]}getWorldCopy(e,t){const o=2**t,[i,s,n,l]=e.map(c=>~~(c/(o*256))),h=[];for(let c=l;c<=s;c++)for(let m=i;m<=n;m++)h.push([m,c]);return h.map(c=>{const m=2**t*256;return[c[0]*m,c[1]*m,m]})}resize(){let e=this.map.getSource(this.rampColorSource);e.setCoordinates(this.getBoundLngLat()),e=this.map.getSource(this.particleSource),e.setCoordinates(this.getBoundLngLat()),this.rampColorCanvas.width=this.map._canvas.clientWidth,this.rampColorCanvas.height=this.map._canvas.clientHeight,this.particleCanvas.width=this.map._canvas.clientWidth,this.particleCanvas.height=this.map._canvas.clientHeight}toggle(e){const t=this.map.getLayoutProperty(this.rampColorLayer,"visibility"),o=e?"visible":"none";t!==o&&this.map.setLayoutProperty(this.rampColorLayer,"visibility",o)}toggleParticle(e){const t=this.map.getLayoutProperty(this.particleLayer,"visibility"),o=e?"visible":"none";t!==o&&this.map.setLayoutProperty(this.particleLayer,"visibility",o)}}class Z{createShader(e,t,o){const i=e.createShader(t);if(i&&(e.shaderSource(i,o),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS)))throw new Error(e.getShaderInfoLog(i)||"error happened while create shader...");return i}createTexture(e,t,o,i,s,n,l){const h=e.createTexture();return e.bindTexture(e.TEXTURE_2D,h),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,o),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,i),s instanceof Uint8Array?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n,l,0,e.RGBA,e.UNSIGNED_BYTE,s):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,s),e.bindTexture(e.TEXTURE_2D,null),h}createDataBuffer(e,t,o){if(e){const i=e.createBuffer();return t==="array"?(e.bindBuffer(e.ARRAY_BUFFER,i),o&&e.bufferData(e.ARRAY_BUFFER,o,e.STATIC_DRAW)):t==="element"&&(e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,i),o&&e.bufferData(e.ELEMENT_ARRAY_BUFFER,o,e.STATIC_DRAW)),i}return null}createProgram(e,t,o){const i=e.createProgram(),s=this.createShader(e,e.VERTEX_SHADER,t),n=this.createShader(e,e.FRAGMENT_SHADER,o);if(i&&s&&n&&(e.attachShader(i,s),e.attachShader(i,n),e.linkProgram(i),!e.getProgramParameter(i,e.LINK_STATUS)))throw new Error(e.getProgramInfoLog(i)||"error happened while creating ramp color program");return i}createProgramWrapper(e,t,o){const i=this.createProgram(e,t,o);if(i){const s={program:i},n=e.getProgramParameter(i,e.ACTIVE_ATTRIBUTES);for(let h=0;h<n;h++){const d=e.getActiveAttrib(i,h);s[d.name]=e.getAttribLocation(i,d.name)}const l=e.getProgramParameter(i,e.ACTIVE_UNIFORMS);for(let h=0;h<l;h++){const d=e.getActiveUniform(i,h);s[d.name]=e.getUniformLocation(i,d.name)}return s}}setup(e,t,o=!1,i,s){const n=document.createElement("canvas");n.width=256,n.height=1;const l=n.getContext("2d");if(l&&e){const h=l==null?void 0:l.createLinearGradient(0,0,256,0);return t.forEach(([d,c])=>{h.addColorStop(d,c)}),l.fillStyle=h,l.fillRect(0,0,256,1),{canvas:n,texture:this.createTexture(e,e.LINEAR,e.LINEAR,e.CLAMP_TO_EDGE,o?new Uint8Array(l.getImageData(0,0,256,1).data):n,i,s)}}}setupParticle(e,t=1e3){const o=Math.ceil(Math.sqrt(t)),i=o*o,s=new Uint8Array(i*4);for(let c=0;c<s.length;c++)s[c]=Math.floor(Math.random()*256);const n=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,s,o,o),l=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,s,o,o),h=new Float32Array(i);for(let c=0;c<i;c++)h[c]=c;const d=this.createDataBuffer(e,"array",h);return{resolution:o,total:i,texture0:n,texture1:l,indexBuffer:d}}bind(e,t,o){const i=this.createProgram(e,t,o);if(i){const s=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 l=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);this.createDataBuffer(e,"array",l);const h=e.getAttribLocation(i,"a_texCoord");return e.enableVertexAttribArray(h),e.vertexAttribPointer(h,2,e.FLOAT,!1,0,0),{program:i,aPositionBuffer:s}}return{}}bindParticle(e,t,o,i,s,n){const l=this.createProgramWrapper(e,t,o),h=this.createProgramWrapper(e,i,s),d=this.createProgramWrapper(e,i,n),c=this.createDataBuffer(e,"array",new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1])),m=e.createFramebuffer();return{particle:l,screen:h,update:d,quadBuffer:c,frameBuffer:m}}draw(e,t,o,i,s,n,l){var h,d;if(t&&o){e.resize(),t==null||t.viewport(0,0,(h=t==null?void 0:t.canvas)==null?void 0:h.width,(d=t==null?void 0:t.canvas)==null?void 0:d.height),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);try{const c=t.getUniformLocation(o,"u_resolution"),m=t.getUniformLocation(o,"u_image"),u=t.getUniformLocation(o,"u_color");if(t.useProgram(o),t.uniform2f(c,t.canvas.width*e.ratio,t.canvas.height*e.ratio),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,i),t.uniform1i(m,0),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,s),t.uniform1i(u,1),l!=null&&l.uvRange&&(l!=null&&l.sRange)){const y=t.getUniformLocation(o,"u_range_u_v"),w=t.getUniformLocation(o,"u_range_s");t.uniform2f(y,l.uvRange[0],l.uvRange[1]),t.uniform2f(w,l.sRange[0],l.sRange[1])}const p=e.getBoundPixel(),b=e.map.getZoom()+1,f=e.getWorldCopy(p,b);for(const y of f){const w=(y[0]-p[0])*e.ratio,g=(y[1]-p[3])*e.ratio,v=y[2]*e.ratio,[_,L,z,N]=[w,v+w,g,v+g],V=new Float32Array([_,z,L,z,_,N,_,N,L,z,L,N]);t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,V,t.STATIC_DRAW),t.drawArrays(t.TRIANGLES,0,6)}}catch(c){console.log(`render failed...${c}`)}}}drawParticle(e,t,o,i,s){var n,l;t&&(t==null||t.viewport(0,0,(n=t==null?void 0:t.canvas)==null?void 0:n.width,(l=t==null?void 0:t.canvas)==null?void 0:l.height),t.disable(t.DEPTH_TEST),t.disable(t.STENCIL_TEST),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,o),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,i.texture0),this.renderScreen(e,t,i,s),this.updateParticles(e,t,i,s))}renderScreen(e,t,o,i){t.bindFramebuffer(t.FRAMEBUFFER,o.frameBuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,o.screenTexture,0),t.viewport(0,0,t.canvas.width,t.canvas.height),this.renderScreenTexture(t,o.backgroundTexture,o.screen,o.quadBuffer,.95),this.renderParticles(e,t,o,i),t.bindFramebuffer(t.FRAMEBUFFER,null),this.renderScreenTexture(t,o.screenTexture,o.screen,o.quadBuffer,1);const s=o.backgroundTexture;o.backgroundTexture=o.screenTexture,o.screenTexture=s}renderScreenTexture(e,t,o,i,s){e&&(e.useProgram(o.program),e.bindBuffer(e.ARRAY_BUFFER,i),e.enableVertexAttribArray(o.a_pos),e.vertexAttribPointer(o.a_pos,2,e.FLOAT,!1,0,0),e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,t),e.uniform1i(o.u_screen,2),e.uniform1f(o.u_opacity,s),e.drawArrays(e.TRIANGLES,0,6))}renderParticles(e,t,o,i){if(t){t.useProgram(o.particle.program),t.bindBuffer(t.ARRAY_BUFFER,o.indexBuffer),t.enableVertexAttribArray(o.particle.a_index),t.vertexAttribPointer(o.particle.a_index,1,t.FLOAT,!1,0,0),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,o.color.texture),t.uniform1i(o.particle.u_factor,0),t.uniform1i(o.particle.u_particles,1),t.uniform1i(o.particle.u_color_ramp,2),t.uniform1f(o.particle.u_particles_resolution,o.resolution*e.ratio),t.uniform1f(o.particle.u_point,e.ratio);const s=e.getBoundRange();t.uniform4f(o.particle.u_viewport,s[0],s[1],s[2],s[3]),t.uniform2f(o.particle.u_factor_min,i.uvRange[0],i.uvRange[0]),t.uniform2f(o.particle.u_factor_max,i.uvRange[1],i.uvRange[1]),t.drawArrays(t.POINTS,0,o.total)}}updateParticles(e,t,o,i){var n,l;if(t){t.bindFramebuffer(t.FRAMEBUFFER,o.frameBuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,o.texture1,0),t.viewport(0,0,o.resolution,o.resolution),t.useProgram(o.update.program),t.bindBuffer(t.ARRAY_BUFFER,o.quadBuffer),t.enableVertexAttribArray(o.update.a_pos),t.vertexAttribPointer(o.update.a_pos,2,t.FLOAT,!1,0,0),t.uniform1i(o.update.u_factor,0),t.uniform1i(o.update.u_particles,1);const h=e.getBoundRange();t.uniform4f(o.update.u_viewport,h[0],h[1],h[2],h[3]),t.uniform1f(o.update.u_rand_seed,Math.random()),t.uniform2f(o.update.u_factor_res,(n=o==null?void 0:o.image)==null?void 0:n.width,(l=o==null?void 0:o.image)==null?void 0:l.height),t.uniform2f(o.update.u_factor_min,i.uvRange[0],i.uvRange[0]),t.uniform2f(o.update.u_factor_max,i.uvRange[1],i.uvRange[1]),t.uniform1f(o.update.u_speed_factor,i.speedFactor*e.ratio),t.uniform1f(o.update.u_drop_rate,i.dropRate),t.uniform1f(o.update.u_drop_rate_bump,i.dropRateBump),t.drawArrays(t.TRIANGLES,0,6)}const s=o.texture0;o.texture0=o.texture1,o.texture1=s}resize(e,t){e.resize();const o=new Uint8Array(t.canvas.width*t.canvas.height*4).fill(0,0,t.canvas.width*t.canvas.height*4),i=this.createTexture(t,t.NEAREST,t.NEAREST,t.CLAMP_TO_EDGE,o,t.canvas.width,t.canvas.height),s=this.createTexture(t,t.NEAREST,t.NEAREST,t.CLAMP_TO_EDGE,o,t.canvas.width,t.canvas.height);return{screenTexture:i,backgroundTexture:s}}async loadImg(e){return new Promise(t=>{const o=new Blob([e],{type:e.type}),i=URL.createObjectURL(o),s=new Image;s.crossOrigin="anonymous",s.src=i,s.onload=()=>t(s)})}}class T{}P(T,"vertexSchema",`
1
+ (function(E,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("@turf/turf"),require("@mapbox/sphericalmercator"),require("moment"),require("mapbox-gl"),require("@idm-plugin/geo"),require("axios")):typeof define=="function"&&define.amd?define(["exports","vue","@turf/turf","@mapbox/sphericalmercator","moment","mapbox-gl","@idm-plugin/geo","axios"],r):(E=typeof globalThis<"u"?globalThis:E||self,r(E["idm-gl"]={},E.Vue,E["@turf/turf"],E["@mapbox/sphericalmercator"],E.moment,E["mapbox-gl"],E["@idm-plugin/geo"],E.axios))})(this,function(E,r,Y,Ne,B,O,C,U){"use strict";var Pr=Object.defineProperty;var zr=(E,r,Y)=>r in E?Pr(E,r,{enumerable:!0,configurable:!0,writable:!0,value:Y}):E[r]=Y;var P=(E,r,Y)=>(zr(E,typeof r!="symbol"?r+"":r,Y),Y);function Te(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,o.get?o:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const x=Te(Y),Nr="";var Ve=Object.defineProperty,Ie=(a,e,t)=>e in a?Ve(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,le=(a,e,t)=>(Ie(a,typeof e!="symbol"?e+"":e,t),t);class ce{}le(ce,"LEVEL",{Basic:1,Prime:2,Supper:1024});class he{}le(he,"WEATHER_LAYERS",[{weight:1,name:"Wind",key:"wind",h5:!0,enabled:!0,type:"json",particle:!0},{weight:524288,name:"Wind Particle",key:"wind-particle",peer:{weight:1,key:"wind"},enabled:!0,hide:!0,type:"jpg"},{weight:16,name:"Sig Waves",key:"sig-wave-height",h5:!0,enabled:!0,type:"json"},{weight:4194304,name:"Sig Waves (JPG)",key:"sig-wave",peer:{weight:16,key:"sig-wave"},enabled:!0,hide:!0,type:"jpg"},{weight:8388608,name:"Sig Waves (Contour)",key:"sig-wave-height-contour",peer:{weight:16,key:"sig-wave-contour"},enabled:!0,hide:!0,type:"json"},{weight:96,name:"Current",key:"current",vendor:"cmems",merge:!0,h5:!0,enabled:!0,type:"json"},{weight:1048576,name:"Current Particle",key:"current-particle",vendor:"cmems",peer:{weight:96,key:"current"},enabled:!0,hide:!0,type:"jpg"},{weight:256,name:"Tropicals",key:"tropicals",h5:!0,enabled:!0,type:"json"},{weight:4096,name:"Pressure",h5:!0,key:"prmsl",enabled:!0,type:"json"},{weight:8192,name:"Visibility",vendor:"gfs",key:"visibility",h5:!0,enabled:!0,type:"jpg"},{weight:262144,name:"Precip Acc",key:"precip3h",h5:!0,enabled:!0,type:"jpg"},{weight:6,name:"Swell",key:"swell",merge:!0,h5:!0,enabled:!0,type:"json"},{weight:2,name:"Swell Height",key:"swell-height",partly:!0,enabled:!0,type:"json"},{weight:4,name:"Swell Direction",key:"swell-direction",partly:!0,enabled:!0,type:"json"},{weight:32,name:"Current Direction",key:"current-direction",vendor:"cmems",partly:!0,enabled:!0,type:"json"},{weight:64,name:"Current Speed",key:"current-speed",vendor:"cmems",partly:!0,enabled:!0,type:"json"},{weight:512,name:"Pressure Contour",key:"prmsl-contour",partly:!0,enabled:!0,hide:!0,type:"json"},{weight:1024,name:"Pressure Value",key:"prmsl-value",partly:!0,enabled:!0,hide:!0,type:"json"},{weight:2048,name:"Pressure Front",key:"prmsl-front",partly:!0,enabled:!0,hide:!0,type:"json"},{weight:16384,name:"Iceberg",key:"iceberg",vendor:"cmems",hide:!0,enabled:!1,type:"json"},{weight:32768,name:"Struct Ice",key:"struct-ice",vendor:"cmems",enabled:!1,hide:!0,type:"json"},{weight:65536,name:"Ice Edge",key:"arctic",vendor:"cmems",h5:!0,enabled:!0,type:"jpg"},{weight:131072,name:"Sea Surf. Temp.",key:"water-temp",vendor:"cmems",h5:!0,enabled:!0,type:"jpg"},{weight:2097152,name:"Temp.",key:"temp",h5:!0,enabled:!0,type:"jpg"}]),le(he,"OTHER_LAYERS",[{weight:1,name:"War Zones",key:"war-zones",h5:!0,enabled:!0,type:"json"},{weight:2,name:"GMDSS Areas",key:"gmdss-areas",h5:!0,enabled:!0,type:"json"},{weight:4,name:"ECA Zones",key:"eca-zones",h5:!0,enabled:!0,type:"json"},{weight:8,name:"Load Lines",key:"load-lines",h5:!0,enabled:!0,type:"json"},{weight:16,name:"HRA",key:"high-risk-area",enabled:!1,type:"json"},{weight:32,name:"Pirates",key:"pirates",enabled:!1,type:"json"},{weight:4096,name:"Alert Zones",key:"alert-zones",h5:!0,enabled:!0,type:"json"},{weight:64,name:"Ports",key:"ports",h5:!0,enabled:!0,type:"json"},{weight:128,name:"Time Zones",key:"time-zones",h5:!0,enabled:!0,type:"json"},{weight:256,name:"VRA",key:"voluntary-reporting-area",h5:!0,enabled:!0,type:"json"},{weight:512,name:"Special Areas",key:"special-area",h5:!0,enabled:!0,type:"json"},{weight:1024,name:"Day/Night",key:"day-night",h5:!0,enabled:!0,type:"json"},{weight:2048,name:"ENC",key:"enc",h5:!0,enabled:!0,type:"origin"},{weight:8192,name:"World-12nm",key:"world12nm",h5:!1,enabled:!0,type:"origin"}]);class ge{}le(ge,"WEATHER_TAG",[{weight:4,name:"Adverse Weather Dangerous",key:"DANGEROUS",positive:!0},{weight:2,name:"Adverse Weather Severe",key:"SEVERE",positive:!0},{weight:1,name:"Adverse Weather Heavy",key:"HEAVY",positive:!0}]),le(ge,"SAILING_TAG",[{weight:2048,name:"Deviation",key:"deviation",positive:!0},{weight:4096,name:"Stoppage",key:"stoppage",positive:!0},{weight:8192,name:"Deceleration",key:"deceleration",positive:!0},{weight:16384,name:"No Lane",key:"noLane",positive:!0},{weight:32768,name:"No Noon",key:"noNoon",positive:!0}]),le(ge,"OTHER_TAG",[{weight:2097152,name:"No CP",key:"noCp",positive:!0},{weight:4194304,name:"Send Rpt",key:"sendRpt",positive:!1},{weight:8388608,name:"Send Bps",key:"sendBps",positive:!1},{weight:16777216,name:"Send Pvar",key:"sendPvar",positive:!1},{weight:33554432,name:"Checked",key:"checked",positive:!1},{weight:67108864,name:"Send PWFR",key:"sendPwfr",positive:!1}]);const Tr="",k=(a,e)=>{const t=a.__vccOpts||a;for(const[o,i]of e)t[o]=i;return t},Re={name:"IdmGlLayer",props:{map:{type:Object},mapProjection:{type:String},top:{type:Number,default:60},layerToggle:{type:Boolean,default:!1},toggleVersion:{type:Number},isLogin:{type:Boolean,default:void 0},showWindFeather:{type:Boolean,default:void 0},showWindParticle:{type:Boolean,default:void 0},showCurrentIsoband:{type:Boolean,default:void 0},showCurrentParticle:{type:Boolean,default:void 0}},emits:["weather","other","coordinate","measure","point","3d","layerToggle","handleToggleVersion"],data(){return{autoActive:!0,layers:{weather:[...he.WEATHER_LAYERS.filter(a=>!["swell-height","swell-direction","current-direction","current-speed"].includes(a.key))],other:[...he.OTHER_LAYERS.filter(a=>a.key!=="world12nm"&&a.enabled)]},weatherLayers:[],otherLayers:[],weatherLayersCache:"weatherLayersCache",autoActiveCache:"autoActiveCache",otherLayersCache:"otherLayersCache",collectedLayerCache:"collectedLayerCache",sourceCache:"defaultSourceCache",showCoord:!1,showMeasure:!1,showPoint:!1,show3d:!1,version:{v:"0.0.7",k:"glCacheVersion"},source:"",right:10,rampColorLayers:["visibility","precip3h","temp","water-temp","arctic"]}},computed:{computeLayerClass(){return function(a,e){var o;let t="layer flex-between";return e.some(i=>i.key===a.key)&&(t=t+" active"),(!a.enabled||(o=this.layers.weather)!=null&&o.some(i=>i.key===a.key)&&!this.autoActive||this.rampColorLayers.includes(a.key)&&this.mapProjection==="globe")&&(t=t+" disabled"),t}},hasCollectedLayers(){var a;return((a=this.layers.weather.filter(e=>e.collected))==null?void 0:a.length)>0}},watch:{toggleVersion:{handler(){this.$nextTick(()=>{var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10})}},source:{handler(a,e){a&&e&&a!==e&&this.handleConfirm()}},showWindFeather:{handler(){!this.showWindFeather&&!this.showWindParticle&&this.handleWeatherLayerPick({weight:1,name:"Wind",key:"wind",enabled:!0,type:"json",particle:!0})}},showWindParticle:{handler(){!this.showWindFeather&&!this.showWindParticle&&this.handleWeatherLayerPick({weight:1,name:"Wind",key:"wind",enabled:!0,type:"json",particle:!0})}},showCurrentIsoband:{handler(){!this.showCurrentIsoband&&!this.showCurrentParticle&&this.handleWeatherLayerPick({weight:96,name:"Current",key:"current",vendor:"cmems",merge:!0,h5:!0,enabled:!0})}},showCurrentParticle:{handler(){!this.showCurrentIsoband&&!this.showCurrentParticle&&this.handleWeatherLayerPick({weight:96,name:"Current",key:"current",vendor:"cmems",merge:!0,h5:!0,enabled:!0})}}},mounted(){const a=localStorage.getItem(this.version.k);this.version.v!==a&&(localStorage.removeItem(this.weatherLayersCache),localStorage.removeItem(this.collectedLayerCache),localStorage.removeItem(this.otherLayersCache),localStorage.removeItem("windFeatherCache"),localStorage.removeItem("currentJsonCache"),localStorage.setItem(this.version.k,this.version.v));let e=localStorage.getItem(this.autoActiveCache);this.autoActive=e!=="false",e=localStorage.getItem(this.collectedLayerCache);let t=JSON.parse(e||'[{"weight": 16, "name": "Sig Waves", "key": "sig-wave-height", "collected": true},{"weight": 1, "name": "Wind", "key": "wind", "h5": true, "collected": true},{"weight": 96, "name": "Current", "key": "current", "collected": true},{"weight": 256, "name": "Tropicals", "key": "tropicals", "collected": true},{"weight": 4096, "name": "Pressure", "h5": true, "key": "prmsl", "collected": true},{"weight": 6, "name": "Swell", "key": "swell", "collected": true}]');this.layers.weather.forEach(o=>{o.collected=!!t.some(i=>i.key===o.key&&i.collected)}),e=localStorage.getItem(this.weatherLayersCache),t=JSON.parse(e||'[{"weight":1,"name":"Wind","key":"wind","enabled":true,"type":"json","particle":true},{"weight":4096,"name":"Pressure","key":"prmsl","enabled":true,"type":"json"},{"weight":256,"name":"Tropicals","key":"tropicals","enabled":true,"type":"json"}]'),this.autoActive&&(this.weatherLayers=[...t]),e=localStorage.getItem(this.otherLayersCache),t=JSON.parse(e||'[{"weight":4,"name":"ECA Zones","key":"eca-zones","enabled":true,"type":"json"}]'),this.otherLayers=t,e=localStorage.getItem(this.sourceCache),this.source=e||"GFS",this.handleConfirm()},methods:{handleConfirm(){this.$emit("weather",this.weatherLayers,this.source),this.$emit("other",this.otherLayers),localStorage.setItem(this.autoActiveCache,this.autoActive),localStorage.setItem(this.sourceCache,this.source)},handleWeatherLayerPick(a){if(this.rampColorLayers.includes(a.key)&&this.mapProjection==="globe"||!this.autoActive)return!1;["wind","current"].includes(a.key)&&!this.showWindFeather&&!this.showCurrentIsoband&&(a.particle=!0),this.weatherLayers.some(e=>e.key===a.key)?this.weatherLayers=this.weatherLayers.filter(e=>e.key!==a.key):this.weatherLayers.length<12&&a.enabled&&(["png","jpg"].includes(a.type)&&(this.weatherLayers=this.weatherLayers.filter(e=>e.type==="json")),this.weatherLayers.push(a)),this.$emit("weather",this.weatherLayers,this.source),localStorage.setItem(this.weatherLayersCache,JSON.stringify(this.weatherLayers)),localStorage.setItem(this.sourceCache,this.source)},handleWeatherLayerCollect(a){var e;!a.collected&&((e=this.layers.weather.filter(t=>t.collected))==null?void 0:e.length)>=6&&(this.layers.weather.filter(t=>t.collected)[0].collected=!1),a.collected=!a.collected,localStorage.setItem(this.collectedLayerCache,JSON.stringify(this.layers.weather)),this.$emit("handleToggleVersion")},handleOtherLayerPick(a){this.otherLayers.some(e=>e.key===a.key)?this.otherLayers=this.otherLayers.filter(e=>e.key!==a.key):a.enabled&&this.otherLayers.push(a),localStorage.setItem(this.otherLayersCache,JSON.stringify(this.otherLayers)),this.$emit("other",this.otherLayers)},handleMenuToggle(){this.$emit("layerToggle",!this.layerToggle)},toggleAutoActive(){this.autoActive=!this.autoActive,localStorage.setItem(this.autoActiveCache,this.autoActive),this.autoActive?this.$emit("weather",this.weatherLayers,this.source):this.$emit("weather",[],this.source)},handleCoordToggle(){this.showCoord=!this.showCoord,this.$emit("coordinate",this.showCoord)},handlePointToggle(){this.isLogin?(this.showPoint=!this.showPoint,this.$emit("point",this.showPoint)):this.$emit("handleToggleVersion")},handleMeasureToggle(){this.showMeasure=!this.showMeasure,this.$emit("measure",this.showMeasure)},handle3DToggle(){this.show3d=!this.show3d,this.$emit("3d",this.show3d)}}},De={class:"idm-gl3-layer"},Ae={class:"bar-item layer-bars"},Be={class:"bar-item tool-bars"},Me={style:{display:"flex","align-items":"center","flex-wrap":"wrap"}},je=["onClick"],We={class:"header-box flex-between"},Oe={class:"weather-layers card-bg"},Fe={class:"layers-body"},$e=["onClick"],He=["onClick"],Ue={key:0,class:"iconfont bookmark active"},Ze={key:1,class:"iconfont bookmark inactive"},Ge={class:"other-layers card-bg"},Je={class:"layers-body"},Xe=["onClick"],qe={class:"flex-start"},Ye={class:"source-layers card-bg"},Qe={class:"layers-body"};function Ke(a,e,t,o,i,s){const n=r.resolveComponent("ElTooltip"),l=r.resolveComponent("ElRadio"),h=r.resolveComponent("ElRadioGroup"),d=r.resolveComponent("ElScrollbar");return r.openBlock(),r.createElementBlock("div",De,[r.createElementVNode("div",{class:"menu-bar-box",style:r.normalizeStyle({top:t.top+10+"px",right:i.right+"px"})},[r.createElementVNode("div",Ae,[r.createVNode(n,{placement:"left",effect:"light",content:"Menu","show-after":1e3},{default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(t.layerToggle?"menu-icon active":"menu-icon"),onClick:e[0]||(e[0]=(...c)=>s.handleMenuToggle&&s.handleMenuToggle(...c))},e[9]||(e[9]=[r.createElementVNode("span",{class:"iconfont"},"",-1)]),2)]),_:1})])],4),r.createElementVNode("div",{class:"menu-bar-box",style:r.normalizeStyle({top:t.top+160+"px",right:i.right+"px"})},[r.createElementVNode("div",Be,[r.createVNode(n,{placement:"left",effect:"light",content:"Measure","show-after":1e3},{default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(i.showMeasure?"menu-icon active":"menu-icon"),onClick:e[1]||(e[1]=(...c)=>s.handleMeasureToggle&&s.handleMeasureToggle(...c))},e[10]||(e[10]=[r.createElementVNode("span",{class:"iconfont"},"",-1)]),2)]),_:1}),r.createVNode(n,{placement:"left",effect:"light",content:"Point Meteo","show-after":1e3},{default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(i.showPoint?"menu-icon active":"menu-icon"),onClick:e[2]||(e[2]=(...c)=>s.handlePointToggle&&s.handlePointToggle(...c))},e[11]||(e[11]=[r.createElementVNode("span",{class:"iconfont"},"",-1)]),2)]),_:1}),r.createVNode(n,{placement:"left",effect:"light",content:"Grid","show-after":1e3},{default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(i.showCoord?"menu-icon active":"menu-icon"),onClick:e[3]||(e[3]=(...c)=>s.handleCoordToggle&&s.handleCoordToggle(...c))},e[12]||(e[12]=[r.createElementVNode("span",{class:"iconfont"},"",-1)]),2)]),_:1}),r.createVNode(n,{placement:"left",effect:"light",content:"3D","show-after":1e3},{default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(i.show3d?"menu-icon active":"menu-icon"),onClick:e[4]||(e[4]=(...c)=>s.handle3DToggle&&s.handle3DToggle(...c))},e[13]||(e[13]=[r.createElementVNode("span",{class:"iconfont"},"",-1)]),2)]),_:1})])],4),s.hasCollectedLayers?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["active-layers flex-between",i.autoActive?"active":""]),style:r.normalizeStyle({right:i.right+"px",bottom:"100px"})},[r.createElementVNode("div",Me,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.layers.weather.filter(c=>c.collected),c=>(r.openBlock(),r.createElementBlock("div",{key:c.key,class:r.normalizeClass(s.computeLayerClass(c,i.weatherLayers)),onClick:m=>s.handleWeatherLayerPick(c)},[e[14]||(e[14]=r.createElementVNode("div",{class:"checkbox"},null,-1)),r.createElementVNode("span",null,r.toDisplayString(c.name),1)],10,je))),128))]),r.createElementVNode("div",{class:"switch flex-center",style:{"margin-top":"4px","align-self":"flex-start","font-size":"28px"},onClick:e[5]||(e[5]=(...c)=>s.toggleAutoActive&&s.toggleAutoActive(...c))},e[15]||(e[15]=[r.createElementVNode("i",{class:"iconfont open"},"",-1),r.createElementVNode("i",{class:"iconfont close"},"",-1)]))],6)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"available-layers flex-center",style:r.normalizeStyle({top:t.top+"px",right:t.layerToggle?"0px":"-240px"})},[r.createElementVNode("div",{class:r.normalizeClass(["list-box",t.layerToggle?"right-bar":""])},[r.createElementVNode("div",We,[e[16]||(e[16]=r.createElementVNode("div",null,"Layers",-1)),r.createElementVNode("div",{class:"iconfont close-btn",onClick:e[6]||(e[6]=(...c)=>s.handleMenuToggle&&s.handleMenuToggle(...c))},"")]),r.createVNode(d,{style:{flex:"1"}},{default:r.withCtx(()=>[r.createElementVNode("div",Oe,[r.createElementVNode("div",{class:r.normalizeClass(["layers-title flex-between",i.autoActive?"active":""])},[e[18]||(e[18]=r.createElementVNode("div",null,"Weather Layers",-1)),r.createElementVNode("div",{class:"switch flex-center",style:{"margin-right":"0"},onClick:e[7]||(e[7]=(...c)=>s.toggleAutoActive&&s.toggleAutoActive(...c))},e[17]||(e[17]=[r.createElementVNode("i",{class:"iconfont open"},"",-1),r.createElementVNode("i",{class:"iconfont close"},"",-1)]))],2),r.createElementVNode("div",Fe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.layers.weather,c=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:c.key},[c.hide?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(s.computeLayerClass(c,i.weatherLayers))},[r.createElementVNode("div",{class:"flex-start",onClick:m=>s.handleWeatherLayerPick(c)},[e[19]||(e[19]=r.createElementVNode("div",{class:"checkbox"},null,-1)),r.createElementVNode("span",null,r.toDisplayString(c.name),1)],8,$e),r.createElementVNode("div",{onClick:m=>s.handleWeatherLayerCollect(c)},[c.collected?(r.openBlock(),r.createElementBlock("i",Ue,"")):(r.openBlock(),r.createElementBlock("i",Ze,""))],8,He)],2))],64))),128)),e[20]||(e[20]=r.createElementVNode("div",{class:"tip flex-start"},[r.createElementVNode("i",{class:"iconfont bookmark",style:{"align-self":"flex-start",padding:"5px 5px 0 0"}},""),r.createElementVNode("div",null,"Bookmark your favorite layer to homepage(Max 6)")],-1))])]),r.createElementVNode("div",Ge,[e[22]||(e[22]=r.createElementVNode("div",{class:"layers-title"},"Other Layers",-1)),r.createElementVNode("div",Je,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.layers.other,c=>(r.openBlock(),r.createElementBlock("div",{key:c.key,class:r.normalizeClass(s.computeLayerClass(c,i.otherLayers)),onClick:m=>s.handleOtherLayerPick(c)},[r.createElementVNode("div",qe,[e[21]||(e[21]=r.createElementVNode("div",{class:"switch flex-center"},[r.createElementVNode("i",{class:"iconfont open"},""),r.createElementVNode("i",{class:"iconfont close"},"")],-1)),r.createElementVNode("span",null,r.toDisplayString(c.name),1)])],10,Xe))),128))])]),r.createElementVNode("div",Ye,[e[25]||(e[25]=r.createElementVNode("span",{class:"layers-title"},"Forecast Model",-1)),r.createElementVNode("div",Qe,[r.createVNode(h,{modelValue:i.source,"onUpdate:modelValue":e[8]||(e[8]=c=>i.source=c),class:"layer-radio flex-col-center-start"},{default:r.withCtx(()=>[r.createVNode(l,{value:"GFS"},{default:r.withCtx(()=>e[23]||(e[23]=[r.createTextVNode("GFS")])),_:1}),r.createVNode(l,{value:"CMEMS"},{default:r.withCtx(()=>e[24]||(e[24]=[r.createTextVNode("CMEMS")])),_:1})]),_:1},8,["modelValue"])])])]),_:1})],2)],4)])}const et=k(Re,[["render",Ke]]),Vr="",tt={name:"IdmWindBarb",props:{map:{type:Object},wind:{type:Object},current:{type:Object},beforeLayer:{type:String},mapProjection:{type:String},showParticle:{type:Boolean,default:!1},toggleVersion:{type:Number}},emits:["particle","showWindFeather"],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:x.featureCollection([]),showFeather:localStorage.getItem("windFeatherCache")==="true"||!1,windFeatherCache:"windFeatherCache",right:10,bottom:125,windBarbLoaded:!1}},watch:{"wind.version":{handler(){var a;(a=this.wind)!=null&&a.active&&this.showFeather?this.handleRender():this.handleClear()},deep:!0},showParticle:{handler(){},immediate:!0},showFeather:{handler(){localStorage.setItem(this.windFeatherCache,this.showFeather),this.handleToggle(),this.$emit("showWindFeather",this.showFeather)},immediate:!0},toggleVersion:{handler(){var a,e,t,o;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10,this.bottom=(e=this.current)!=null&&e.active?(((t=document.getElementsByClassName("active-layers")[0])==null?void 0:t.clientHeight)||0)+148:(((o=document.getElementsByClassName("active-layers")[0])==null?void 0:o.clientHeight)||0)+110},immediate:!0}},methods:{handleParticle(){this.$emit("particle",{particle:!this.showParticle,key:"wind",weight:1})},handleRender(){var a,e,t,o;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.wind){const i=new Date().valueOf();let s=0,n=0,l=this.empty;if((a=this.wind)!=null&&a.active&&(l=(e=this.wind)==null?void 0:e.data),(t=this.map)!=null&&t.getSource(this.source))(o=this.map)==null||o.getSource(this.source).setData(l),n=new Date().valueOf()-(i+s),console.log("[wind] update elapsed: ",n,", total: ",s+=n);else{this.map.addSource(this.source,{type:"geojson",data:l});for(let h=0;h<(this.barbs??[]).length-1;h++){const d=(this.barbs??[])[h]||0,c=(this.barbs??[])[h+1]||0,m=d<10?`00${d}kts`:d<100?`0${d}kts`:`${d}kts`;this.map.addLayer({id:m,type:"symbol",filter:["all",[">=","spd",d],["<","spd",c]],source:this.source,layout:{"symbol-placement":"point","icon-image":m,"icon-size":.14,"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":1,"text-color":"#222"}},this.beforeLayer)}this.windBarbLoaded=!0,n=new Date().valueOf()-(i+s),console.log("[wind] add elapsed: ",n,", total: ",s+=n)}}},handleToggle(){if(!this.windBarbLoaded)this.handleRender();else for(const a of this.barbs??[]){const e=a<10?`00${a}kts`:a<100?`0${a}kts`:`${a}kts`;this.map.getLayer(e)&&this.map.setLayoutProperty(e,"visibility",this.showFeather?"visible":"none")}},handleClear(){for(const a of this.barbs??[]){const e=a<10?`00${a}kts`:a<100?`0${a}kts`:`${a}kts`;this.map.getLayer(e)&&this.map.removeLayer(e)}this.map.getSource(this.source)&&this.map.removeSource(this.source),this.windBarbLoaded=!1}}},at={key:0};function rt(a,e,t,o,i,s){var n;return(n=t.wind)!=null&&n.active?(r.openBlock(),r.createElementBlock("div",at,[r.createElementVNode("div",{class:"flex-center wind-tool-bars",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:i.bottom+"px"}])},[t.mapProjection==="mercator"?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["item-bar flex-start",t.showParticle?"active":"inactive"]),onClick:e[0]||(e[0]=(...l)=>s.handleParticle&&s.handleParticle(...l))},e[2]||(e[2]=[r.createElementVNode("div",{class:"checkbox"},null,-1),r.createElementVNode("span",null,"Wind Particles",-1)]),2)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(["item-bar flex-start",i.showFeather?"active":"inactive"]),onClick:e[1]||(e[1]=l=>i.showFeather=!i.showFeather)},e[3]||(e[3]=[r.createElementVNode("div",{class:"checkbox"},null,-1),r.createElementVNode("span",null,"Wind Feather",-1)]),2)],4)])):r.createCommentVNode("",!0)}const it=k(tt,[["render",rt]]);class ue{constructor(e){P(this,"map");P(this,"mercator");P(this,"rampColorLayer");P(this,"rampColorSource");P(this,"particleLayer");P(this,"particleSource");P(this,"rampColorCanvas");P(this,"particleCanvas");P(this,"ratio");this.map=e,this.mercator=new Ne,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,t=0){return e>180?this.convertNLng(e-360,t+1):e<-180?this.convertNLng(e+360,t+1):[e,t]}getBoundLngLat(){const e=this.map.getBounds();return[[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(){const e=this.map.getBounds(),t=this.map.getZoom()+1,o=[e._ne.lng,e._ne.lat],i=[e._sw.lng,e._sw.lat],[s,n]=this.convertNLng(o[0]),[l,h]=this.convertNLng(i[0]),[d,c]=this.mercator.px([s,o[1]],t),[m,u]=this.mercator.px([l,i[1]],t),p=Math.round(this.mercator.size*Math.pow(2,t)*(n+h));return[m,u,d+p,c]}getBoundRange(){const e=this.map.getZoom()+1,t=this.mercator.size*Math.pow(2,e),o=this.getBoundPixel();return[o[0]/t,o[2]/t,o[3]/t,o[1]/t]}getWorldCopy(e,t){const o=2**t,[i,s,n,l]=e.map(c=>~~(c/(o*256))),h=[];for(let c=l;c<=s;c++)for(let m=i;m<=n;m++)h.push([m,c]);return h.map(c=>{const m=2**t*256;return[c[0]*m,c[1]*m,m]})}resize(){let e=this.map.getSource(this.rampColorSource);e.setCoordinates(this.getBoundLngLat()),e=this.map.getSource(this.particleSource),e.setCoordinates(this.getBoundLngLat()),this.rampColorCanvas.width=this.map._canvas.clientWidth,this.rampColorCanvas.height=this.map._canvas.clientHeight,this.particleCanvas.width=this.map._canvas.clientWidth,this.particleCanvas.height=this.map._canvas.clientHeight}toggle(e){const t=this.map.getLayoutProperty(this.rampColorLayer,"visibility"),o=e?"visible":"none";t!==o&&this.map.setLayoutProperty(this.rampColorLayer,"visibility",o)}toggleParticle(e){const t=this.map.getLayoutProperty(this.particleLayer,"visibility"),o=e?"visible":"none";t!==o&&this.map.setLayoutProperty(this.particleLayer,"visibility",o)}}class Z{createShader(e,t,o){const i=e.createShader(t);if(i&&(e.shaderSource(i,o),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS)))throw new Error(e.getShaderInfoLog(i)||"error happened while create shader...");return i}createTexture(e,t,o,i,s,n,l){const h=e.createTexture();return e.bindTexture(e.TEXTURE_2D,h),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,o),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,i),s instanceof Uint8Array?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n,l,0,e.RGBA,e.UNSIGNED_BYTE,s):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,s),e.bindTexture(e.TEXTURE_2D,null),h}createDataBuffer(e,t,o){if(e){const i=e.createBuffer();return t==="array"?(e.bindBuffer(e.ARRAY_BUFFER,i),o&&e.bufferData(e.ARRAY_BUFFER,o,e.STATIC_DRAW)):t==="element"&&(e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,i),o&&e.bufferData(e.ELEMENT_ARRAY_BUFFER,o,e.STATIC_DRAW)),i}return null}createProgram(e,t,o){const i=e.createProgram(),s=this.createShader(e,e.VERTEX_SHADER,t),n=this.createShader(e,e.FRAGMENT_SHADER,o);if(i&&s&&n&&(e.attachShader(i,s),e.attachShader(i,n),e.linkProgram(i),!e.getProgramParameter(i,e.LINK_STATUS)))throw new Error(e.getProgramInfoLog(i)||"error happened while creating ramp color program");return i}createProgramWrapper(e,t,o){const i=this.createProgram(e,t,o);if(i){const s={program:i},n=e.getProgramParameter(i,e.ACTIVE_ATTRIBUTES);for(let h=0;h<n;h++){const d=e.getActiveAttrib(i,h);s[d.name]=e.getAttribLocation(i,d.name)}const l=e.getProgramParameter(i,e.ACTIVE_UNIFORMS);for(let h=0;h<l;h++){const d=e.getActiveUniform(i,h);s[d.name]=e.getUniformLocation(i,d.name)}return s}}setup(e,t,o=!1,i,s){const n=document.createElement("canvas");n.width=256,n.height=1;const l=n.getContext("2d");if(l&&e){const h=l==null?void 0:l.createLinearGradient(0,0,256,0);return t.forEach(([d,c])=>{h.addColorStop(d,c)}),l.fillStyle=h,l.fillRect(0,0,256,1),{canvas:n,texture:this.createTexture(e,e.LINEAR,e.LINEAR,e.CLAMP_TO_EDGE,o?new Uint8Array(l.getImageData(0,0,256,1).data):n,i,s)}}}setupParticle(e,t=1e3){const o=Math.ceil(Math.sqrt(t)),i=o*o,s=new Uint8Array(i*4);for(let c=0;c<s.length;c++)s[c]=Math.floor(Math.random()*256);const n=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,s,o,o),l=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,s,o,o),h=new Float32Array(i);for(let c=0;c<i;c++)h[c]=c;const d=this.createDataBuffer(e,"array",h);return{resolution:o,total:i,texture0:n,texture1:l,indexBuffer:d}}bind(e,t,o){const i=this.createProgram(e,t,o);if(i){const s=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 l=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);this.createDataBuffer(e,"array",l);const h=e.getAttribLocation(i,"a_texCoord");return e.enableVertexAttribArray(h),e.vertexAttribPointer(h,2,e.FLOAT,!1,0,0),{program:i,aPositionBuffer:s}}return{}}bindParticle(e,t,o,i,s,n){const l=this.createProgramWrapper(e,t,o),h=this.createProgramWrapper(e,i,s),d=this.createProgramWrapper(e,i,n),c=this.createDataBuffer(e,"array",new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1])),m=e.createFramebuffer();return{particle:l,screen:h,update:d,quadBuffer:c,frameBuffer:m}}draw(e,t,o,i,s,n,l){var h,d;if(t&&o){e.resize(),t==null||t.viewport(0,0,(h=t==null?void 0:t.canvas)==null?void 0:h.width,(d=t==null?void 0:t.canvas)==null?void 0:d.height),t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);try{const c=t.getUniformLocation(o,"u_resolution"),m=t.getUniformLocation(o,"u_image"),u=t.getUniformLocation(o,"u_color");if(t.useProgram(o),t.uniform2f(c,t.canvas.width*e.ratio,t.canvas.height*e.ratio),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,i),t.uniform1i(m,0),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,s),t.uniform1i(u,1),l!=null&&l.uvRange&&(l!=null&&l.sRange)){const y=t.getUniformLocation(o,"u_range_u_v"),w=t.getUniformLocation(o,"u_range_s");t.uniform2f(y,l.uvRange[0],l.uvRange[1]),t.uniform2f(w,l.sRange[0],l.sRange[1])}const p=e.getBoundPixel(),b=e.map.getZoom()+1,f=e.getWorldCopy(p,b);for(const y of f){const w=(y[0]-p[0])*e.ratio,g=(y[1]-p[3])*e.ratio,v=y[2]*e.ratio,[_,L,z,N]=[w,v+w,g,v+g],V=new Float32Array([_,z,L,z,_,N,_,N,L,z,L,N]);t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,V,t.STATIC_DRAW),t.drawArrays(t.TRIANGLES,0,6)}}catch(c){console.log(`render failed...${c}`)}}}drawParticle(e,t,o,i,s){var n,l;t&&(t==null||t.viewport(0,0,(n=t==null?void 0:t.canvas)==null?void 0:n.width,(l=t==null?void 0:t.canvas)==null?void 0:l.height),t.disable(t.DEPTH_TEST),t.disable(t.STENCIL_TEST),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,o),t.activeTexture(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,i.texture0),this.renderScreen(e,t,i,s),this.updateParticles(e,t,i,s))}renderScreen(e,t,o,i){t.bindFramebuffer(t.FRAMEBUFFER,o.frameBuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,o.screenTexture,0),t.viewport(0,0,t.canvas.width,t.canvas.height),this.renderScreenTexture(t,o.backgroundTexture,o.screen,o.quadBuffer,.95),this.renderParticles(e,t,o,i),t.bindFramebuffer(t.FRAMEBUFFER,null),this.renderScreenTexture(t,o.screenTexture,o.screen,o.quadBuffer,1);const s=o.backgroundTexture;o.backgroundTexture=o.screenTexture,o.screenTexture=s}renderScreenTexture(e,t,o,i,s){e&&(e.useProgram(o.program),e.bindBuffer(e.ARRAY_BUFFER,i),e.enableVertexAttribArray(o.a_pos),e.vertexAttribPointer(o.a_pos,2,e.FLOAT,!1,0,0),e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,t),e.uniform1i(o.u_screen,2),e.uniform1f(o.u_opacity,s),e.drawArrays(e.TRIANGLES,0,6))}renderParticles(e,t,o,i){if(t){t.useProgram(o.particle.program),t.bindBuffer(t.ARRAY_BUFFER,o.indexBuffer),t.enableVertexAttribArray(o.particle.a_index),t.vertexAttribPointer(o.particle.a_index,1,t.FLOAT,!1,0,0),t.activeTexture(t.TEXTURE2),t.bindTexture(t.TEXTURE_2D,o.color.texture),t.uniform1i(o.particle.u_factor,0),t.uniform1i(o.particle.u_particles,1),t.uniform1i(o.particle.u_color_ramp,2),t.uniform1f(o.particle.u_particles_resolution,o.resolution*e.ratio),t.uniform1f(o.particle.u_point,e.ratio);const s=e.getBoundRange();t.uniform4f(o.particle.u_viewport,s[0],s[1],s[2],s[3]),t.uniform2f(o.particle.u_factor_min,i.uvRange[0],i.uvRange[0]),t.uniform2f(o.particle.u_factor_max,i.uvRange[1],i.uvRange[1]),t.drawArrays(t.POINTS,0,o.total)}}updateParticles(e,t,o,i){var n,l;if(t){t.bindFramebuffer(t.FRAMEBUFFER,o.frameBuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,o.texture1,0),t.viewport(0,0,o.resolution,o.resolution),t.useProgram(o.update.program),t.bindBuffer(t.ARRAY_BUFFER,o.quadBuffer),t.enableVertexAttribArray(o.update.a_pos),t.vertexAttribPointer(o.update.a_pos,2,t.FLOAT,!1,0,0),t.uniform1i(o.update.u_factor,0),t.uniform1i(o.update.u_particles,1);const h=e.getBoundRange();t.uniform4f(o.update.u_viewport,h[0],h[1],h[2],h[3]),t.uniform1f(o.update.u_rand_seed,Math.random()),t.uniform2f(o.update.u_factor_res,(n=o==null?void 0:o.image)==null?void 0:n.width,(l=o==null?void 0:o.image)==null?void 0:l.height),t.uniform2f(o.update.u_factor_min,i.uvRange[0],i.uvRange[0]),t.uniform2f(o.update.u_factor_max,i.uvRange[1],i.uvRange[1]),t.uniform1f(o.update.u_speed_factor,i.speedFactor*e.ratio),t.uniform1f(o.update.u_drop_rate,i.dropRate),t.uniform1f(o.update.u_drop_rate_bump,i.dropRateBump),t.drawArrays(t.TRIANGLES,0,6)}const s=o.texture0;o.texture0=o.texture1,o.texture1=s}resize(e,t){e.resize();const o=new Uint8Array(t.canvas.width*t.canvas.height*4).fill(0,0,t.canvas.width*t.canvas.height*4),i=this.createTexture(t,t.NEAREST,t.NEAREST,t.CLAMP_TO_EDGE,o,t.canvas.width,t.canvas.height),s=this.createTexture(t,t.NEAREST,t.NEAREST,t.CLAMP_TO_EDGE,o,t.canvas.width,t.canvas.height);return{screenTexture:i,backgroundTexture:s}}async loadImg(e){return new Promise(t=>{const o=new Blob([e],{type:e.type}),i=URL.createObjectURL(o),s=new Image;s.crossOrigin="anonymous",s.src=i,s.onload=()=>t(s)})}}class T{}P(T,"vertexSchema",`
2
2
  //canvas 坐标系上的坐标 (x, y)
3
3
  attribute vec2 a_position; //像素坐标
4
4
  attribute vec2 a_texCoord; //纹理坐标
@@ -186,8 +186,8 @@
186
186
  gl_FragColor = vec4(
187
187
  fract(pos * 255.0),
188
188
  floor(pos * 255.0) / 255.0);
189
- }`);class ve{constructor(e="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNseTVudHJzYzAwNWUwbHBsZHkyaDRqczMiLCJyb2xlIjoxLCJuYW1lIjoiZmFrZUBvcm13eC5jb20iLCJwbGF0SWQiOiJnZDBtdDFkIiwiY29tcGFueSI6eyJpZCI6bnVsbCwiY2hpbGRyZW4iOltdfSwiaWF0IjoxNzIzMDI0MDI0LCJleHAiOjM5MzA1NDQwMjR9.RrKcdcMnq-FxBLJQ-i6lx2FscDE46y8EvHIemPW4HTg"){P(this,"token");P(this,"mapboxCustomer");P(this,"i4");P(this,"hi");P(this,"td");P(this,"windy");this.token=e,this.mapboxCustomer={source:this.initialOnlineStyle().sources.composite,layers:{water:{id:"water",type:"fill",source:"composite","source-layer":"water",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},paint:{"fill-color":"hsl(205, 75%, 70%)"}},waterDeplth:{id:"water-depth",type:"fill",source:"composite","source-layer":"depth",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},maxzoom:8,paint:{"fill-antialias":!1,"fill-color":["interpolate",["linear"],["zoom"],6,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0.35)",200,"hsla(205, 75%, 63%, 0.35)",7e3,"hsla(205, 75%, 56%, 0.35)"],8,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0)",200,"hsla(205, 75%, 63%, 0)",7e3,"hsla(205, 75%, 53%, 0)"]]}},countryBoundary:{id:"country-boundaries",type:"fill",source:"composite","source-layer":"country_boundaries",layout:{visibility:"visible"},paint:{"fill-color":"#d9d8d8"}},countryAdmin0BoundaryBg:{id:"admin-0-boundary-bg",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-width":["interpolate",["linear"],["zoom"],3,4,12,8],"line-color":"rgb(193, 190, 190)","line-opacity":["interpolate",["linear"],["zoom"],3,0,4,.5],"line-blur":["interpolate",["linear"],["zoom"],3,0,12,2]}},countryAdmin0Boundary:{id:"admin-0-boundary",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","disputed"],"false"],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(114, 110, 111)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[2,0]],7,["literal",[2,2,6,2]]]}},countryAdmin0BoundaryDisputed:{id:"admin-0-boundary-disputed",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","disputed"],"true"],["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(95, 93, 94)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[3,2,5]],7,["literal",[2,1.5]]]}},countryLabel:{id:"country-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},layout:{visibility:"visible","text-field":["coalesce",["get","name_en"],["get","name"]],"text-line-height":1.1,"text-max-width":6,"text-font":["HelveticaNeueThin"],"text-radial-offset":["step",["zoom"],.6,8,0],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],7,"auto"],"text-size":["interpolate",["cubic-bezier",.2,0,.7,1],["zoom"],1,["step",["get","symbolrank"],11,4,9,5,8],9,["step",["get","symbolrank"],22,4,19,5,17]]},paint:{"text-color":"rgba(255,255,255,0)"}}}},this.td={source:{type:"raster",tiles:["https://t0.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t1.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t2.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t3.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t4.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t5.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t6.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t7.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8"],tileSize:256},layer:{id:"td",type:"raster",source:"td",layout:{visibility:"visible"}}},this.i4={source:{type:"raster",tiles:["https://osshz.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz1.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz2.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz3.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz4.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz5.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz6.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz7.idmwx.com/nautical/{z}/{x}/{y}.png"],tileSize:256},layer:{id:"i4",type:"raster",source:"i4",layout:{visibility:"none"}}},this.hi={source:{type:"raster",tiles:[`https://assist0.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist1.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist2.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist3.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist4.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist5.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist6.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist7.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`],tileSize:256},layer:{id:"hi",type:"raster",source:"hi",layout:{visibility:"none"}}},this.windy={darkmap:{source:{type:"raster",tiles:["https://tiles.windy.com/tiles/v10.0/darkmap/{z}/{x}/{y}.png"],tileSize:256},layer:{id:"darkmap",type:"raster",source:"darkmap",layout:{visibility:"none"}}},grayland:{source:{type:"raster",tiles:["https://tiles.windy.com/tiles/v9.0/grayland/{z}/{x}/{y}.png"],tileSize:256},layer:{id:"grayland",type:"raster",source:"grayland",layout:{visibility:"none"},paint:{"raster-opacity":1}}}}}initialOnlineStyle(){return{version:8,name:"map-weather-v2.0.0",metadata:{"mapbox:print":{width:8.5,height:11,units:"in",format:"png",resolution:300},"mapbox:type":"default","mapbox:trackposition":!0,"mapbox:autocomposite":!0,"mapbox:sdk-support":{android:"11.0.0",ios:"11.0.0",js:"3.0.0"},"mapbox:origin":"outdoors-v12","mapbox:groups":{"Terrain, terrain-labels":{name:"Terrain, terrain-labels",collapsed:!0},"Administrative boundaries, admin":{name:"Administrative boundaries, admin",collapsed:!1},"Land & water, built":{name:"Land & water, built",collapsed:!1},"Terrain, surface":{name:"Terrain, surface",collapsed:!0},"Land & water, land":{name:"Land & water, land",collapsed:!1},"Natural features, natural-labels":{name:"Natural features, natural-labels",collapsed:!0},"Walking, cycling, etc., barriers-bridges":{name:"Walking, cycling, etc., barriers-bridges",collapsed:!0},"Place labels, place-labels":{name:"Place labels, place-labels",collapsed:!1},"Transit, ferries":{name:"Transit, ferries",collapsed:!0},"Transit, elevated":{name:"Transit, elevated",collapsed:!0},"Walking, cycling, etc., tunnels":{name:"Walking, cycling, etc., tunnels",collapsed:!0},"Terrain, land":{name:"Terrain, land",collapsed:!0},"Road network, tunnels-case":{name:"Road network, tunnels-case",collapsed:!0},"Walking, cycling, etc., walking-cycling-labels":{name:"Walking, cycling, etc., walking-cycling-labels",collapsed:!0},"Walking, cycling, etc., surface":{name:"Walking, cycling, etc., surface",collapsed:!0},"Road network, surface-icons":{name:"Road network, surface-icons",collapsed:!0},"Land & water, water":{name:"Land & water, water",collapsed:!1}}},lights:[],fog:{color:"#ffffff",range:[.5,10],"high-color":"#245cdf","space-color":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"horizon-blend":["interpolate",["linear"],["zoom"],4,.2,7,.1],"star-intensity":["interpolate",["linear"],["zoom"],5,.35,6,0],"vertical-range":[0,0]},center:[80.02170408691855,17.83215724225399],zoom:2.4589703839156347,bearing:0,pitch:1,sprite:"mapbox://sprites/neatchenheng/clxwst0tq00wd01rn0usb2eer/3hcvufdre7i2yn9nbkvi9f9xi",glyphs:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",projection:{name:"equirectangular"},sources:{composite:{type:"vector",url:"mapbox://mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,mapbox.mapbox-bathymetry-v2,mapbox.country-boundaries-v1",data:{attribution:'<a href="https://www.mapbox.com/about/maps/" target="_blank" title="Mapbox" aria-label="Mapbox">&copy; Mapbox</a> <a href="https://www.openstreetmap.org/about/" target="_blank" title="OpenStreetMap" aria-label="OpenStreetMap">&copy; OpenStreetMap</a> <a href="https://www.mapbox.com/about/maps/" target="_blank" title="Mapbox" aria-label="Mapbox">&copy; Mapbox</a> <a href="https://www.openstreetmap.org/about/" target="_blank" title="OpenStreetMap" aria-label="OpenStreetMap">&copy; OpenStreetMap</a> <a class="mapbox-improve-map" href="https://www.mapbox.com/contribute/" target="_blank" title="Improve this map" aria-label="Improve this map">Improve this map</a>',bounds:[-180,-85.051129,180,85],center:[0,-.025564500000001544,0],description:"Global polygon tileset of country boundaries and disputed areas",format:"pbf",language_options:{ar:"Arabic",ca:"Catalan",cs:"Czech",da:"Danish",de:"German",el:"Greek",en:"English",es:"Spanish",fa:"Farsi",fi:"Finnish",fr:"French",he:"Hebrew",hu:"Hungarian",id:"Indonesian",it:"Italian",ja:"Japanese",ka:"Georgian",ko:"Korean",local:"Renderable local language",lv:"Latvian",ms:"Malay",nb:"Norwegian Bokmål",nl:"Dutch",no:"Norwegian",pl:"Polish",pt:"Portuguese",ro:"Romanian",ru:"Russian",sk:"Slovak",sl:"Slovenian",sr:"Serbian",sv:"Swedish",th:"Thai",tl:"Tagalog",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese","zh-Hans":"Simplified Chinese","zh-Hant":"Traditional Chinese"},mapbox_logo:!0,maskLevel:9,maxzoom:16,minzoom:0,mts:!0,name:"Mapbox Countries v1 + Mapbox Bathymetry v2 + Mapbox Terrain v2 + Mapbox Streets v8",scheme:"xyz",tilejson:"2.2.0",tiles:["https://a.tiles.mapbox.com/v4/mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,mapbox.mapbox-bathymetry-v2,mapbox.country-boundaries-v1/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1IjoibmVhdGNoZW5oZW5nIiwiYSI6ImNsdXM3cnBmODBsemgycW1vaXc1bjV6bXMifQ.w6fqHGRbhNhLvm0LnX4ZVw","https://b.tiles.mapbox.com/v4/mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,mapbox.mapbox-bathymetry-v2,mapbox.country-boundaries-v1/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1IjoibmVhdGNoZW5oZW5nIiwiYSI6ImNsdXM3cnBmODBsemgycW1vaXc1bjV6bXMifQ.w6fqHGRbhNhLvm0LnX4ZVw"],vector_layers:[{id:"landuse",minzoom:5,source:"mapbox.mapbox-streets-v8"},{id:"waterway",minzoom:7,source:"mapbox.mapbox-streets-v8"},{id:"water",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"aeroway",minzoom:9,source:"mapbox.mapbox-streets-v8"},{id:"structure",minzoom:13,source:"mapbox.mapbox-streets-v8"},{id:"building",minzoom:12,source:"mapbox.mapbox-streets-v8"},{id:"landuse_overlay",minzoom:5,source:"mapbox.mapbox-streets-v8"},{id:"road",minzoom:3,source:"mapbox.mapbox-streets-v8"},{id:"admin",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"place_label",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"airport_label",minzoom:8,source:"mapbox.mapbox-streets-v8"},{id:"transit_stop_label",minzoom:5,source:"mapbox.mapbox-streets-v8"},{id:"natural_label",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"poi_label",minzoom:6,source:"mapbox.mapbox-streets-v8"},{id:"motorway_junction",minzoom:9,source:"mapbox.mapbox-streets-v8"},{id:"housenum_label",minzoom:16,source:"mapbox.mapbox-streets-v8"},{id:"landcover",maxzoom:22,minzoom:0,source:"mapbox.mapbox-terrain-v2"},{id:"hillshade",maxzoom:22,minzoom:0,source:"mapbox.mapbox-terrain-v2"},{id:"contour",maxzoom:22,minzoom:0,source:"mapbox.mapbox-terrain-v2"},{id:"depth",maxzoom:7,minzoom:0,source:"mapbox.mapbox-bathymetry-v2"},{id:"country_boundaries",maxzoom:22,minzoom:0,source:"mapbox.country-boundaries-v1"}],worldview_default:"US",worldview_options:{AR:"Argentina",CN:"China",IN:"India",JP:"Japan",MA:"Morocco",RS:"Serbia",RU:"Russia",TR:"Turkey",US:"United States"}}}},layers:[{id:"land",type:"background",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},paint:{"background-color":"rgb(171, 174, 172)"}},{id:"landcover",type:"fill",source:"composite","source-layer":"landcover",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},maxzoom:12,paint:{"fill-color":["match",["get","class"],"wood","hsl(0, 0%, 69%)","scrub","hsl(0, 0%, 69%)","crop","hsl(0, 0%, 69%)","grass","hsl(0, 0%, 69%)","snow","hsl(0, 0%, 69%)","hsl(0, 0%, 69%)"],"fill-opacity":["interpolate",["exponential",1.5],["zoom"],8,.8,12,0],"fill-antialias":!1}},{id:"national-park",type:"fill",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:5,filter:["==",["get","class"],"national_park"],paint:{"fill-color":"hsl(98, 38%, 68%)","fill-opacity":["interpolate",["linear"],["zoom"],5,0,6,.6,12,.2]}},{id:"national-park_tint-band",type:"line",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:9,filter:["==",["get","class"],"national_park"],paint:{"line-color":"hsl(98, 38%, 68%)","line-width":["interpolate",["exponential",1.5],["zoom"],9,1,14,8],"line-blur":["interpolate",["exponential",1.5],["zoom"],9,1,14,8]}},{id:"landuse",type:"fill",source:"composite","source-layer":"landuse",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:5,filter:["all",[">=",["to-number",["get","sizerank"]],0],["match",["get","class"],["agriculture","wood","grass","scrub","glacier","pitch","sand"],["step",["zoom"],!1,11,!0],"residential",["step",["zoom"],!0,10,!1],["park","airport"],["step",["zoom"],!1,8,["case",["==",["get","sizerank"],1],!0,!1],10,!0],["facility","industrial"],["step",["zoom"],!1,12,!0],"rock",["step",["zoom"],!1,11,!0],"cemetery",["step",["zoom"],!1,11,!0],"school",["step",["zoom"],!1,11,!0],"hospital",["step",["zoom"],!1,11,!0],"commercial_area",["step",["zoom"],!1,11,!0],!1],["<=",["-",["to-number",["get","sizerank"]],["interpolate",["exponential",1.5],["zoom"],12,0,18,14]],14]],paint:{"fill-color":["interpolate",["linear"],["zoom"],15,["match",["get","class"],"wood","hsla(103, 50%, 60%, 0.8)","scrub","hsla(98, 47%, 68%, 0.6)","agriculture","hsla(98, 50%, 74%, 0.6)","park",["match",["get","type"],["garden","playground","zoo"],"hsl(98, 38%, 68%)","hsl(98, 55%, 70%)"],"grass","hsla(98, 50%, 74%, 0.6)","airport","hsl(230, 40%, 82%)","cemetery","hsl(98, 45%, 75%)","glacier","hsl(205, 45%, 95%)","hospital","hsl(20, 45%, 82%)","pitch","hsl(88, 65%, 75%)","sand","hsl(69, 60%, 72%)","rock","hsl(60, 0%, 85%)","school","hsl(40, 45%, 78%)","commercial_area","hsl(55, 45%, 85%)","residential","hsl(60, 7%, 87%)",["facility","industrial"],"hsl(230, 20%, 85%)","hsl(60, 12%, 72%)"],16,["match",["get","class"],"wood","hsla(103, 50%, 60%, 0.8)","scrub","hsla(98, 47%, 68%, 0.6)","agriculture","hsla(98, 50%, 74%, 0.6)","park",["match",["get","type"],["garden","playground","zoo"],"hsl(98, 38%, 68%)","hsl(98, 55%, 70%)"],"grass","hsla(98, 50%, 74%, 0.6)","airport","hsl(230, 40%, 82%)","cemetery","hsl(98, 45%, 75%)","glacier","hsl(205, 45%, 95%)","hospital","hsl(20, 45%, 82%)","pitch","hsl(88, 65%, 75%)","sand","hsl(69, 60%, 72%)","rock","hsla(60, 0%, 85%, 0.5)","school","hsl(40, 45%, 78%)","commercial_area","hsla(55, 45%, 85%, 0.5)",["facility","industrial"],"hsl(230, 20%, 85%)","hsl(60, 12%, 72%)"]],"fill-opacity":["interpolate",["linear"],["zoom"],8,["match",["get","class"],"residential",.8,.2],10,["match",["get","class"],"residential",0,1]],"fill-antialias":!1}},{id:"pitch-outline",type:"line",source:"composite","source-layer":"landuse",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:15,filter:["==",["get","class"],"pitch"],paint:{"line-color":"hsl(0, 0%, 69%)"}},{id:"waterway-shadow",type:"line",source:"composite","source-layer":"waterway",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:10,layout:{"line-cap":["step",["zoom"],"butt",11,"round"],"line-join":["step",["zoom"],"miter",11,"round"]},paint:{"line-color":"hsl(224, 79%, 69%)","line-width":["interpolate",["exponential",1.3],["zoom"],9,["match",["get","class"],["canal","river"],.1,0],20,["match",["get","class"],["canal","river"],8,3]],"line-translate":["interpolate",["exponential",1.2],["zoom"],7,["literal",[0,0]],16,["literal",[-1,-1]]],"line-translate-anchor":"viewport","line-opacity":["interpolate",["linear"],["zoom"],8,0,8.5,1]}},{id:"water-shadow",type:"fill",source:"composite","source-layer":"water",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:10,paint:{"fill-color":"hsl(224, 79%, 69%)","fill-translate":["interpolate",["exponential",1.2],["zoom"],7,["literal",[0,0]],16,["literal",[-1,-1]]],"fill-translate-anchor":"viewport"}},{id:"waterway",type:"line",source:"composite","source-layer":"waterway",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:8,layout:{"line-cap":["step",["zoom"],"butt",11,"round"],"line-join":["step",["zoom"],"miter",11,"round"]},paint:{"line-color":"hsl(205, 75%, 70%)","line-width":["interpolate",["exponential",1.3],["zoom"],9,["match",["get","class"],["canal","river"],.1,0],20,["match",["get","class"],["canal","river"],8,3]],"line-opacity":["interpolate",["linear"],["zoom"],8,0,8.5,1]}},{id:"water",type:"fill",source:"composite","source-layer":"water",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},paint:{"fill-color":"hsl(205, 75%, 70%)"}},{id:"water-depth",type:"fill",source:"composite","source-layer":"depth",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},maxzoom:8,paint:{"fill-antialias":!1,"fill-color":["interpolate",["linear"],["zoom"],6,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0.35)",200,"hsla(205, 75%, 63%, 0.35)",7e3,"hsla(205, 75%, 56%, 0.35)"],8,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0)",200,"hsla(205, 75%, 63%, 0)",7e3,"hsla(205, 75%, 53%, 0)"]]}},{id:"wetland",type:"fill",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:5,filter:["match",["get","class"],["wetland","wetland_noveg"],!0,!1],paint:{"fill-color":"hsl(194, 38%, 74%)","fill-opacity":["interpolate",["linear"],["zoom"],10,.25,10.5,.15]}},{id:"wetland-pattern",type:"fill",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:5,filter:["match",["get","class"],["wetland","wetland_noveg"],!0,!1],paint:{"fill-color":"hsl(194, 38%, 74%)","fill-opacity":["interpolate",["linear"],["zoom"],10,0,10.5,1],"fill-pattern":"wetland","fill-translate-anchor":"viewport"}},{id:"land-structure-polygon",type:"fill",source:"composite","source-layer":"structure",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, built"},minzoom:13,filter:["all",["==",["get","class"],"land"],["==",["geometry-type"],"Polygon"]],paint:{"fill-color":"hsl(0, 0%, 69%)"}},{id:"land-structure-line",type:"line",source:"composite","source-layer":"structure",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, built"},minzoom:13,filter:["all",["==",["get","class"],"land"],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"square"},paint:{"line-width":["interpolate",["exponential",1.99],["zoom"],14,.75,20,40],"line-color":"hsl(60, 20%, 85%)"}},{id:"country-boundaries",type:"fill",source:"composite","source-layer":"country_boundaries",paint:{"fill-color":["interpolate",["linear"],["zoom"],0,"rgb(171, 174, 172)",22,"rgb(171, 174, 172)"]}},{id:"admin-0-boundary-bg",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-width":["interpolate",["linear"],["zoom"],3,4,12,8],"line-color":"rgb(193, 190, 190)","line-opacity":["interpolate",["linear"],["zoom"],3,0,4,.5],"line-blur":["interpolate",["linear"],["zoom"],3,0,12,2]}},{id:"admin-0-boundary",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","disputed"],"false"],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(114, 110, 111)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[2,0]],7,["literal",[2,2,6,2]]]}},{id:"admin-0-boundary-disputed",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","disputed"],"true"],["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(95, 93, 94)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[3,2,5]],7,["literal",[2,1.5]]]}},{id:"waterway-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:13,filter:["all",["match",["get","class"],["canal","river","stream","disputed_canal","disputed_river","disputed_stream"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"LineString"]],layout:{"text-font":["DIN Pro Italic","Arial Unicode MS Regular"],"text-max-angle":30,"symbol-spacing":["interpolate",["linear",1],["zoom"],15,250,17,400],"text-size":["interpolate",["linear"],["zoom"],13,12,18,18],"symbol-placement":"line","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]],visibility:"none"},paint:{"text-color":"hsl(205, 43%, 90%)","text-halo-color":"hsla(60, 17%, 84%, 0.5)"}},{id:"natural-line-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:4,filter:["all",["match",["get","class"],["glacier","landform","disputed_glacier","disputed_landform"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["<=",["get","filterrank"],4],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"LineString"]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"text-max-angle":30,"text-field":["coalesce",["get","name_en"],["get","name"]],"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport",visibility:"none"},paint:{"text-halo-width":.5,"text-halo-color":"hsl(60, 17%, 84%)","text-halo-blur":.5,"text-color":"hsl(340, 10%, 38%)"}},{id:"natural-point-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:4,filter:["all",["match",["get","class"],["dock","glacier","landform","water_feature","wetland","disputed_dock","disputed_glacier","disputed_landform","disputed_water_feature","disputed_wetland"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["<=",["get","filterrank"],4],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"Point"]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"icon-image":["case",["has","maki_beta"],["coalesce",["image",["get","maki_beta"]],["image",["get","maki"]]],["image",["get","maki"]]],"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-offset":["step",["zoom"],["step",["get","sizerank"],["literal",[0,0]],5,["literal",[0,.8]]],17,["step",["get","sizerank"],["literal",[0,0]],13,["literal",[0,.8]]]],"text-anchor":["step",["zoom"],["step",["get","sizerank"],"center",5,"top"],17,["step",["get","sizerank"],"center",13,"top"]],"text-field":["coalesce",["get","name_en"],["get","name"]],visibility:"none"},paint:{"icon-opacity":["step",["zoom"],["step",["get","sizerank"],0,5,1],17,["step",["get","sizerank"],0,13,1]],"text-halo-color":"hsl(60, 20%, 98%)","text-halo-width":.5,"text-halo-blur":.5,"text-color":"hsl(340, 10%, 38%)"}},{id:"water-line-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:1,filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water","disputed_bay","disputed_ocean","disputed_reservoir","disputed_sea","disputed_water"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"LineString"]],layout:{"text-size":["interpolate",["linear"],["zoom"],0,["*",["-",16,["sqrt",["get","sizerank"]]],1],22,["*",["-",22,["sqrt",["get","sizerank"]]],1]],"text-max-angle":30,"text-letter-spacing":["match",["get","class"],"ocean",.25,["sea","bay"],.15,0],"text-font":["DIN Pro Italic","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]],visibility:"none"},paint:{"text-color":["match",["get","class"],["bay","ocean","sea"],"hsl(205, 71%, 90%)","hsl(205, 43%, 90%)"],"text-halo-color":"hsla(60, 17%, 84%, 0.5)"}},{id:"water-point-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:1,filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water","disputed_bay","disputed_ocean","disputed_reservoir","disputed_sea","disputed_water"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"Point"]],layout:{"text-line-height":1.3,"text-size":["interpolate",["linear"],["zoom"],0,["*",["-",16,["sqrt",["get","sizerank"]]],1],22,["*",["-",22,["sqrt",["get","sizerank"]]],1]],"text-font":["DIN Pro Italic","Arial Unicode MS Regular"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":["match",["get","class"],"ocean",.25,["bay","sea"],.15,.01],"text-max-width":["match",["get","class"],"ocean",4,"sea",5,["bay","water"],7,10],visibility:"none"},paint:{"text-color":["match",["get","class"],["bay","ocean","sea"],"hsl(205, 71%, 90%)","hsl(205, 43%, 90%)"],"text-halo-color":"hsla(60, 17%, 84%, 0.5)"}},{id:"settlement-subdivision-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:10,maxzoom:15,filter:["all",["match",["get","class"],["settlement_subdivision","disputed_settlement_subdivision"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["<=",["get","filterrank"],3],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-transform":"uppercase","text-font":["DIN Pro Regular","Arial Unicode MS Regular"],"text-letter-spacing":["match",["get","type"],"suburb",.15,.05],"text-max-width":7,"text-padding":3,"text-size":["interpolate",["cubic-bezier",.5,0,1,1],["zoom"],11,["match",["get","type"],"suburb",11,10.5],15,["match",["get","type"],"suburb",15,14]],visibility:"none"},paint:{"text-halo-color":"hsla(60, 25%, 100%, 0.75)","text-halo-width":1,"text-color":"hsl(230, 29%, 36%)","text-halo-blur":.5}},{id:"settlement-minor-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:2,maxzoom:13,filter:["all",["<=",["get","filterrank"],3],["match",["get","class"],["settlement","disputed_settlement"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["zoom"],[">",["get","symbolrank"],6],4,[">=",["get","symbolrank"],7],6,[">=",["get","symbolrank"],8],7,[">=",["get","symbolrank"],10],10,[">=",["get","symbolrank"],11],11,[">=",["get","symbolrank"],13],12,[">=",["get","symbolrank"],15]],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],11,9,10],6,["step",["get","symbolrank"],14,9,12,12,10],8,["step",["get","symbolrank"],16,9,14,12,12,15,10],13,["step",["get","symbolrank"],22,9,20,12,16,15,14]],"text-radial-offset":["step",["zoom"],["match",["get","capital"],2,.6,.55],8,0],"symbol-sort-key":["get","symbolrank"],"icon-image":["step",["zoom"],["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],8,""],"text-font":["DIN Pro Regular","Arial Unicode MS Regular"],"text-justify":"auto",visibility:"none","text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-max-width":7},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":"hsl(60, 25%, 100%)","text-halo-width":1,"text-halo-blur":1}},{id:"settlement-major-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:2,maxzoom:15,filter:["all",["<=",["get","filterrank"],3],["match",["get","class"],["settlement","disputed_settlement"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["zoom"],!1,2,["<=",["get","symbolrank"],6],4,["<",["get","symbolrank"],7],6,["<",["get","symbolrank"],8],7,["<",["get","symbolrank"],10],10,["<",["get","symbolrank"],11],11,["<",["get","symbolrank"],13],12,["<",["get","symbolrank"],15],13,[">=",["get","symbolrank"],11],14,[">=",["get","symbolrank"],15]],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],13,6,11],6,["step",["get","symbolrank"],18,6,16,7,14],8,["step",["get","symbolrank"],20,9,16,10,14],15,["step",["get","symbolrank"],24,9,20,12,16,15,14]],"text-radial-offset":["step",["zoom"],["match",["get","capital"],2,.6,.55],8,0],"symbol-sort-key":["get","symbolrank"],"icon-image":["step",["zoom"],["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],8,""],"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],8,"center"],visibility:"none","text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-max-width":7},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":"hsl(60, 25%, 100%)","text-halo-width":1,"text-halo-blur":1}},{id:"state-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:3,maxzoom:9,filter:["all",["match",["get","class"],["state","disputed_state"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-size":["interpolate",["cubic-bezier",.85,.7,.65,1],["zoom"],4,["step",["get","symbolrank"],9,6,8,7,7],9,["step",["get","symbolrank"],21,6,16,7,14]],"text-transform":"uppercase","text-font":["DIN Pro Bold","Arial Unicode MS Bold"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":.15,"text-max-width":6,visibility:"none"},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":"hsl(60, 25%, 100%)","text-halo-width":1,"text-opacity":.5}},{id:"country-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:1,maxzoom:10,filter:["all",["match",["get","class"],["country","disputed_country"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-line-height":1.1,"text-max-width":6,"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-radial-offset":["step",["zoom"],.6,8,0],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],7,"auto"],"text-size":["interpolate",["cubic-bezier",.2,0,.7,1],["zoom"],1,["step",["get","symbolrank"],11,4,9,5,8],9,["step",["get","symbolrank"],22,4,19,5,17]]},paint:{"icon-opacity":["step",["zoom"],["case",["has","text_anchor"],1,0],7,0],"text-color":"hsl(230, 29%, 0%)","text-halo-color":["interpolate",["linear"],["zoom"],2,"hsla(60, 25%, 100%, 0.75)",3,"hsl(60, 25%, 100%)"],"text-halo-width":1.25}},{id:"continent-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:.75,maxzoom:3,filter:["==",["get","class"],"continent"],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-line-height":1.1,"text-max-width":6,"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-size":["interpolate",["exponential",.5],["zoom"],0,10,2.5,15],"text-transform":"uppercase","text-letter-spacing":.05,visibility:"none"},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":["interpolate",["linear"],["zoom"],0,"hsla(60, 25%, 100%, 0.75)",3,"hsl(60, 25%, 100%)"],"text-halo-width":1.5,"text-opacity":["interpolate",["linear"],["zoom"],0,.8,1.5,.5,2.5,0]}}]}}}const Vr="",it={name:"IdmWindParticle",props:{factor:{type:Object},viewport:{type:ue},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleOptions:{fadeOpacity:.9,speedFactor:.25,dropRate:.003,dropRateBump:.01,uvRange:[-25,26],sRange:[0,31.985]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[wind-particle] add elapsed: ",t,", total: ",e+=t)}},handleClear(){var a,e,t,o,i,s,n,l;(a=this.viewport)==null||a.toggle(!1),(e=this.viewport)==null||e.toggleParticle(!1),this.context=void 0,this.particleContext=void 0,this.etime=void 0,this.initial=!0,(o=(t=this.viewport)==null?void 0:t.map)==null||o.off("resize",this.handleResize),(s=(i=this.viewport)==null?void 0:i.map)==null||s.off("movestart",this.handlePause),(l=(n=this.viewport)==null?void 0:n.map)==null||l.off("moveend",this.handlePlay),this.handlePause()},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.uvFragmentSchema);this.program=e,this.aPositionBuffer=t}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const a=[[0,"rgb(183,224,224)"],[1,"rgb(217,220,220)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,I.vertexSchema,I.fragmentSchema,I.quadVertSchema,I.screenFragmentSchema,I.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,a,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,9e3),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,a),this.wrapper.image=a}this.initial&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext)}},handlePause(){this.paused=!0,this.animation&&(cancelAnimationFrame(this.animation),this.viewport.toggleParticle(!1))},handlePlay(){this.paused=!1,this.animation=requestAnimationFrame(()=>{this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay()})}}},ot={key:0};function st(a,e,t,o,i,s){var n;return(n=t.factor)!=null&&n.active?(r.openBlock(),r.createElementBlock("div",ot,[r.createElementVNode("div",{class:"legend-bars flex-center",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:t.bottom}])},e[0]||(e[0]=[r.createElementVNode("span",null,"kts",-1),r.createElementVNode("span",null,"0",-1),r.createElementVNode("span",null,"5",-1),r.createElementVNode("span",null,"10",-1),r.createElementVNode("span",null,"20",-1),r.createElementVNode("span",null,"30",-1),r.createElementVNode("span",null,"40",-1),r.createElementVNode("span",null,"60",-1)]),4)])):r.createCommentVNode("",!0)}const nt=k(it,[["render",st],["__scopeId","data-v-64887571"]]),Ir="",lt={name:"IdmCurrent",props:{map:{type:Object},current:{type:Object},beforeLayer:{type:String},mapProjection:{type:String},showParticle:{type:Boolean,default:!1},marginBottom:{type:String,default:"30px"},toggleVersion:{type:Number}},emits:["particle","showCurrentIsoband","handleToggleVersion"],data(){return{source:"current-source",directionLayer:"current-direction-layer",speedLayer:"current-speed-layer",speedLabelLayer:"current-speed-label-layer",empty:x.featureCollection([]),showJson:localStorage.getItem("currentJsonCache")==="true"||!1,currentJsonCache:"currentJsonCache",right:10,bottom:95}},watch:{"current.version":{handler(){var a;(a=this.current)!=null&&a.active?this.handleRender():this.handleClear(),this.$emit("handleToggleVersion")},deep:!0},showParticle:{handler(){},immediate:!0},showJson:{handler(){this.showJson,localStorage.setItem(this.currentJsonCache,this.showJson),this.handleToggle(),this.$emit("showCurrentIsoband",this.showJson)},immediate:!0},toggleVersion:{handler(){var a,e;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10,this.bottom=(((e=document.getElementsByClassName("active-layers")[0])==null?void 0:e.clientHeight)||0)+110},immediate:!0}},methods:{handleParticle(a){this.$emit("particle",{particle:a,key:"current",weight:96})},handleRender(){var a,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.current){const t=new Date().valueOf();let o=0,i=0,s=this.empty;this.current.active&&(s=this.current.data),(a=this.map)!=null&&a.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),i=new Date().valueOf()-(t+o),console.log("[current] update elapsed: ",i,", total: ",o+=i)):(this.map.addSource(this.source,{type:"geojson",data:s}),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"],"#e1ffb3",1,"#ffff00",3,"#ff9500",4,"#f44336",5,"#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),this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"arrow-red","icon-size":["interpolate",["linear"],["get","spd"],.5,.14,3,.28],"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":.6}},this.beforeLayer),i=new Date().valueOf()-(t+o),console.log("[current] add elapsed: ",i,", total: ",o+=i)),this.handleToggle()}},handleToggle(){this.map.getLayer(this.speedLayer)&&this.map.setLayoutProperty(this.speedLayer,"visibility",this.showJson?"visible":"none"),this.map.getLayer(this.speedLabelLayer)&&this.map.setLayoutProperty(this.speedLabelLayer,"visibility",this.showJson?"visible":"none"),this.map.getLayer(this.directionLayer)&&this.map.setLayoutProperty(this.directionLayer,"visibility",this.showJson?"visible":"none")},handleClear(){this.map.getLayer(this.speedLayer)&&this.map.removeLayer(this.speedLayer),this.map.getLayer(this.speedLabelLayer)&&this.map.removeLayer(this.speedLabelLayer),this.map.getLayer(this.directionLayer)&&this.map.removeLayer(this.directionLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}},ct={key:0};function ht(a,e,t,o,i,s){var n;return(n=t.current)!=null&&n.active?(r.openBlock(),r.createElementBlock("div",ct,[r.createElementVNode("div",{class:"flex-center current-tool-bars",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:i.bottom+"px"}])},[t.mapProjection==="mercator"?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["flex-start item-bar",t.showParticle?"active":"inactive"]),onClick:e[0]||(e[0]=l=>s.handleParticle(!t.showParticle))},e[2]||(e[2]=[r.createElementVNode("div",{class:"checkbox"},null,-1),r.createElementVNode("span",null,"Current Particles",-1)]),2)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(["flex-start item-bar",i.showJson?"active":"inactive"]),onClick:e[1]||(e[1]=l=>i.showJson=!i.showJson)},e[3]||(e[3]=[r.createElementVNode("div",{class:"checkbox"},null,-1),r.createElementVNode("span",null,"Current Isoband",-1)]),2)],4)])):r.createCommentVNode("",!0)}const dt=k(lt,[["render",ht]]),Rr="",mt={name:"IdmCurrentParticle",props:{factor:{type:Object},viewport:{type:ue},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleOptions:{fadeOpacity:.96,speedFactor:4,dropRate:.005,dropRateBump:.01,uvRange:[-2.5,2.6],sRange:[0,3]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[current-particle] add elapsed: ",t,", total: ",e+=t)}},handleClear(){var a,e,t,o,i,s,n,l;(a=this.viewport)==null||a.toggle(!1),(e=this.viewport)==null||e.toggleParticle(!1),this.context=void 0,this.particleContext=void 0,this.etime=void 0,this.initial=!0,(o=(t=this.viewport)==null?void 0:t.map)==null||o.off("resize",this.handleResize),(s=(i=this.viewport)==null?void 0:i.map)==null||s.off("movestart",this.handlePause),(l=(n=this.viewport)==null?void 0:n.map)==null||l.off("moveend",this.handlePlay),this.handlePause()},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.uvFragmentSchema);this.program=e,this.aPositionBuffer=t}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const a=[[0,"rgb(183,224,224)"],[1,"rgb(199,202,202)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,I.vertexSchema,I.fragmentSchema,I.quadVertSchema,I.screenFragmentSchema,I.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,a,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,12e3),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,a),this.wrapper.image=a}this.initial&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext)}},handlePause(){this.paused=!0,this.animation&&(cancelAnimationFrame(this.animation),this.viewport.toggleParticle(!1))},handlePlay(){this.paused=!1,this.animation=requestAnimationFrame(()=>{this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay()})}}},pt={key:0};function yt(a,e,t,o,i,s){var n;return(n=t.factor)!=null&&n.active?(r.openBlock(),r.createElementBlock("div",pt,[r.createElementVNode("div",{class:"legend-bars flex-center",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:t.bottom}])},e[0]||(e[0]=[r.createElementVNode("span",null,"kts",-1),r.createElementVNode("span",null,"0",-1),r.createElementVNode("span",null,"0.4",-1),r.createElementVNode("span",null,"0.8",-1),r.createElementVNode("span",null,"1.6",-1),r.createElementVNode("span",null,"2",-1),r.createElementVNode("span",null,"3.2",-1)]),4)])):r.createCommentVNode("",!0)}const ft=k(mt,[["render",yt],["__scopeId","data-v-6d4fd206"]]),ut={name:"IdmSigWave",props:{map:{type:Object},sigWave:{type:Object},beforeLayer:{type:String}},data(){return{source:"sig-wave-source",heightLayer:"sig-wave-height-layer",heightLabelLayer:"sig-wave-height-label-layer",empty:x.featureCollection([])}},watch:{"sigWave.version":{handler(){var a;(a=this.sigWave)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var a,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.sigWave){const t=new Date().valueOf();let o=0,i=0,s=this.empty;this.sigWave.active&&(s=this.sigWave.data),(a=this.map)!=null&&a.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),i=new Date().valueOf()-(t+o),console.log("[sig.wave] update elapsed: ",i,", total: ",o+=i)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.heightLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],layout:{"fill-sort-key":["get","val"]},paint:{"fill-outline-color":"#888","fill-opacity":.8,"fill-color":["step",["get","val"],"rgba(186,247,237,0.5)",3,"rgba(93,235,185,0.8)",4,"rgba(101,252,149,0.9)",5,"#b3ff6b",6,"#fee600",7,"#ffa200",8,"#ff6600",9,"#e23304",10,"#f80078",11,"#dc03d2",12,"#a603f8",13,"#7102ab"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Polygon"],layout:{"symbol-placement":"line","symbol-avoid-edges":!0,"symbol-sort-key":["get","val"],"text-field":"{val} m","text-rotation-alignment":"viewport","text-size":10},paint:{"text-opacity":.7}},this.beforeLayer),i=new Date().valueOf()-(t+o),console.log("[sig.wave] add elapsed: ",i,", total: ",o+=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 gt(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const bt=k(ut,[["render",gt]]),wt={name:"IdmSwell",props:{map:{type:Object},swell:{type:Object},beforeLayer:{type:String}},data(){return{source:"swell-source",directionLayer:"swell-direction-layer",heightLayer:"swell-height-layer",heightLabelLayer:"swell-height-label-layer",empty:x.featureCollection([])}},watch:{"swell.version":{handler(){var a;(a=this.swell)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var a,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.swell){const t=new Date().valueOf();let o=0,i=0,s=this.empty;this.swell.active&&(s=this.swell.data),(a=this.map)!=null&&a.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),i=new Date().valueOf()-(t+o),console.log("[swell] update elapsed: ",i,", total: ",o+=i)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.heightLayer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-opacity":1,"line-width":2,"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":12},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":4}},this.beforeLayer),this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"arrow-yellow","icon-size":{base:1,stops:[[2,.14],[6,.28]]},"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,180],[360,540]]}},paint:{"icon-opacity":.8}},this.beforeLayer),i=new Date().valueOf()-(t+o),console.log("[swell] add elapsed: ",i,", total: ",o+=i),setTimeout(()=>{this.map.moveLayer("country-boundaries",null)},100))}},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.getSource(this.source)&&this.map.removeSource(this.source)}}};function Lt(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const vt=k(wt,[["render",Lt]]),xt={name:"IdmPrmsl",props:{map:{type:Object},prmsl:{type:Object},beforeLayer:{type:String},activeWeatherLayers:{type:Array}},data(){return{source:"prmsl-source",layer:"prmsl-layer",labelLayer:"prmsl-label-layer",pointLabelLayer:"prmsl-point-label-layer",empty:x.featureCollection([])}},watch:{"prmsl.version":{handler(){var a;(a=this.prmsl)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var a,e,t;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.prmsl){const o=new Date().valueOf();let i=0,s=0,n=this.empty;this.prmsl.active&&(n=this.prmsl.data),(a=this.map)!=null&&a.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(n),s=new Date().valueOf()-(o+i),console.log("[prmsl] update elapsed: ",s,", total: ",i+=s)):(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(244,67,54,1)",980,"rgba(255,255,0,1)",1100,"rgba(199,171,250,1)"],"line-width":1,"line-opacity":1}},this.beforeLayer),(t=this.map)==null||t.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":12},paint:{"text-color":"black","text-opacity":.9,"text-halo-color":"rgba(255,255,255,1)","text-halo-width":1}},this.beforeLayer),setTimeout(()=>{this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":["format",["get","type"],{"font-scale":1.03},`
190
- `,["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":12},paint:{"text-opacity":1,"text-color":["step",["get","val"],"white",980,"black",1100,"black"],"text-halo-color":["step",["get","val"],"rgba(162,13,2,0.9)",920,"rgba(244,67,54,0.9)",980,"rgba(255,255,0,0.9)",1100,"rgba(199,171,250,0.9)"],"text-halo-width":4}},this.beforeLayer)},1e3),s=new Date().valueOf()-(o+i),console.log("[prmsl] add elapsed: ",s,", total: ",i+=s))}},handleMove(){var a,e;(e=(a=this.map)==null?void 0:a.getLayer("country-boundaries"))==null||e.setLayoutProperty("visibility","visible"),this.map.getLayer(this.pointLabelLayer)&&this.map.moveLayer(this.pointLabelLayer,"country-boundaries"),this.map.getLayer(this.labelLayer)&&this.map.moveLayer(this.labelLayer,"country-boundaries"),this.map.getLayer(this.layer)&&this.map.moveLayer(this.layer,"country-boundaries")},handleClear(){var a,e;this.activeWeatherLayers.length===0&&((e=(a=this.map)==null?void 0:a.getLayer("country-boundaries"))==null||e.setLayoutProperty("visibility","none")),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 _t(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const Ct=k(xt,[["render",_t]]),kt={name:"IdmIceberg",props:{map:{type:Object},iceberg:{type:Object},beforeLayer:{type:String}},data(){return{source:"iceberg-source",layer:"iceberg-layer",empty:x.featureCollection([])}},watch:{"iceberg.version":{handler(){var a;(a=this.iceberg)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var a,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.iceberg){const t=new Date().valueOf();let o=0,i=0,s=this.empty;this.iceberg.active&&(s=this.iceberg.data),(a=this.map)!=null&&a.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),i=new Date().valueOf()-(t+o),console.log("[iceberg] update elapsed: ",i,", total: ",o+=i)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-color":"rgba(255,255,255, 0.8)","line-width":2,"line-opacity":1}}),i=new Date().valueOf()-(t+o),console.log("[iceberg] add elapsed: ",i,", total: ",o+=i))}},handleClear(){this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function St(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const Et=k(kt,[["render",St]]),Dr="",Pt={name:"IdmTropicals",props:{map:{type:Object},tropicals:{type:Object},date:{type:String},timeZone:{type:Number,default:0}},emits:["tropical","tropicalProbability"],data(){return{helper:ce,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",showTropicals:!1,activeTropicals:void 0,activeTropicalsMarker:void 0,empty:x.featureCollection([]),circleSource:"circle-source",circleSourceData:x.featureCollection([]),circleLayer:"tropical-circle-layer"}},computed:{computeTime(){return function(a){if(a){const e=B(a).utc().utcOffset(this.timeZone),t=this.timeZone<0?this.timeZone:"+"+this.timeZone;return`${e.format("MMM-DD,HHmm")}[ UTC ${t} ] ( ${e==null?void 0:e.fromNow()} )`}return"-"}},computeTimezone(){return this.timeZone<0?this.timeZone:"+"+this.timeZone}},watch:{"tropicals.active":{handler(){this.handleInit()},immediate:!0},showTropicals:{handler(){this.$emit("tropical",this.showTropicals)},immediate:!0},"tropicals.version":{handler(){this.handleRefresh()}},timeZone:{handler(){this.handleRefresh()}}},methods:{handleRefresh(){var o,i;const a=((i=(o=this.tropicals)==null?void 0:o.data)==null?void 0:i.features)||[],e=B().utc().hour(),t=[];a.forEach(s=>{var n,l,h;(n=s.properties)!=null&&n.name&&!t.includes((l=s.properties)==null?void 0:l.name)&&t.push((h=s.properties)==null?void 0:h.name)}),t.forEach(s=>{var d;let n=0,l;const h=a.filter(c=>{var m,u;return((u=(m=c.properties)==null?void 0:m.category)==null?void 0:u.split("-")[0])===s});(d=h.filter(c=>{var m,u;return((m=c.geometry)==null?void 0:m.type)==="LineString"&&((u=c.properties)==null?void 0:u.type)==="forecast"})[0])==null||d.properties.model,h.forEach((c,m)=>{var u,p,b,f,y,w;((u=c.geometry)==null?void 0:u.type)==="Point"&&((p=c.properties)==null?void 0:p.type)==="history"&&(n=m,l=l===void 0?m:l),((b=c.geometry)==null?void 0:b.type)==="Point"&&((f=c.properties)==null?void 0:f.type)==="forecast"&&l===void 0&&(l=m),((y=c.geometry)==null?void 0:y.type)==="LineString"&&((w=c.properties)==null||w.type)}),h.map((c,m)=>{var u,p,b,f,y,w,g;if(((u=c.geometry)==null?void 0:u.type)==="LineString"&&((p=c.properties)==null||p.type),((b=c.geometry)==null?void 0:b.type)==="Point"&&((f=c.properties)==null?void 0:f.type)==="forecast"&&(c.properties.name=s,c.properties.format=B(c.properties.date).utcOffset(this.timeZone).format(`MMM-DD,HHmm [(utc ${this.computeTimezone})]`)),((y=c.geometry)==null?void 0:y.type)==="Point"&&((w=c.properties)==null?void 0:w.type)==="history"){c.properties.format=B(c.properties.date).utcOffset(this.timeZone).format(`MMM-DD,HHmm [(utc ${this.computeTimezone})]`);const v=B((g=c.properties)==null?void 0:g.date).utc().format("HHmm")===B().utc().hour(Math.floor(e/6)*6).minute("00").format("HHmm");c.properties.showHistoryLabel=v||m===n,c.properties.showNameLabel=m===n,c.properties.name=s}return c})}),this.handleInit()},handleInit(){var a,e;this.tropicals&&this.tropicals.active?(this.handleRender(),(a=this.map)==null||a.on("click",[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.forecastModelLayer,this.pointCircleLayer,this.pointLabelLayer,this.historyPointCircleLayer,this.historyPointLabelLayer],this.handleClick)):(this.handleClear(),(e=this.map)==null||e.off("click",[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.forecastModelLayer,this.pointCircleLayer,this.pointLabelLayer,this.historyPointCircleLayer,this.historyPointLabelLayer],this.handleClick))},handleRender(){var a,e,t,o,i,s,n,l,h,d;if(!this.map)setTimeout(()=>{this.handleRender()},500);else{if(this.tropicals){const m=new Date().valueOf();let u=0,p=0;(a=this.map)!=null&&a.getSource(this.source)?((t=this.map)==null||t.getSource(this.source).setData((e=this.tropicals)!=null&&e.active?this.tropicals.data:this.empty),p=new Date().valueOf()-(m+u),console.log("[tropicals] update elapsed: ",p,", total: ",u+=p)):(this.map.addSource(this.source,{type:"geojson",data:(o=this.tropicals)!=null&&o.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":"#000","line-width":4,"line-opacity":.5}}),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","#e2ea03","jma","#01d2b7","ecmwf","#f582f2","ukm","#f5bb47","noaa-at","#9758fb","noaa-ep","#9758fb","#fff"],"line-width":3,"line-opacity":.9,"line-dasharray":[1,2]}}),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":13},paint:{"text-color":["match",["get","model"],"cma","#000","jma","#000","ecmwf","#fff","ukm","#fff","noaa-at","#fff","noaa-ep","#fff","#000"],"text-opacity":1,"text-halo-color":["match",["get","model"],"cma","#e2ea03","jma","#01d2b7","ecmwf","#f582f2","ukm","#f5bb47","noaa-at","#9758fb","noaa-ep","#9758fb","#fff"],"text-halo-width":4}}),p=new Date().valueOf()-(m+u),console.log("[tropical] add elapsed: ",p,", total: ",u+=p)),(s=this.map)!=null&&s.getSource(this.clusterSource)?((l=this.map)==null||l.getSource(this.clusterSource).setData((n=this.tropicals)!=null&&n.active?this.tropicals.data:this.empty),p=new Date().valueOf()-(m+u),console.log("[tropical] update elapsed: ",p,", total: ",u+=p)):(this.map.addSource(this.clusterSource,{type:"geojson",data:(h=this.tropicals)!=null&&h.active?(d=this.tropicals)==null?void 0:d.data:this.empty}),this.map.addLayer({id:this.pointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":6,"circle-color":"#fff"}}),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","spd",["get","wind"]],null]],"#03f869",["boolean",["<",["get","spd",["get","wind"]],17.2]],"#03f869",["boolean",["<=",["get","spd",["get","wind"]],24.5]],"#f2f202",["boolean",["<=",["get","spd",["get","wind"]],32.7]],"#ff9100",["boolean",["<=",["get","spd",["get","wind"]],41.5]],"#f44336",["boolean",["<",["get","spd",["get","wind"]],51]],"#f903d0",["boolean",[">=",["get","spd",["get","wind"]],51]],"#8702f9","#fff"]}}),this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[0,-.5],"text-anchor":"bottom-left","text-size":12},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"#fff","text-halo-width":1}}),this.map.addLayer({id:this.historyPointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],paint:{"circle-radius":8,"circle-color":"#fff"}}),this.map.addLayer({id:this.historyPointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],paint:{"circle-radius":6,"circle-color":"rgba(0,0,0,0.7)"}}),this.map.addLayer({id:this.historyPointCircleLayer+"-inner",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],paint:{"circle-radius":4,"circle-color":"#fff"}}),this.map.addLayer({id:this.historyPointLabelLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[0,-.5],"text-anchor":"bottom-left","text-size":14},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"#fff","text-halo-width":1}}),this.map.addLayer({id:this.forecastNameLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showNameLabel",!0]],layout:{"text-field":["get","name"],"text-offset":[0,1.5],"text-anchor":"bottom","text-size":16,"text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#fff","text-halo-color":"#0033ff","text-halo-width":4}}),p=new Date().valueOf()-(m+u),console.log("[tropical] add elapsed: ",p,", total: ",u+=p))}this.handleDrawCircle();const c=C.TropicalHelper.interpolate(this.tropicals,1);this.interpolateData=JSON.parse(JSON.stringify(c)),this.interpolateData.filter(m=>m.properties.name==="kristy"&&m.properties.model==="ecmwf"),this.handleDateChange()}},handleClear(){var a;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),(a=this.interpolateMarkers)==null||a.forEach(e=>e==null?void 0:e.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),this.map.getLayer(this.circleLayer)&&this.map.removeLayer(this.circleLayer),this.map.getSource(this.circleSource)&&this.map.removeSource(this.circleSource))},handleDateChange(){var a,e,t,o,i,s,n,l,h,d,c,m,u,p,b,f,y,w,g,v,_,L,z,N,V,R,D,M,Q,K,ee,te,ae,re,ie,G;if((a=this.interpolateMarkers)==null||a.forEach(j=>j==null?void 0:j.remove()),this.circleSourceData.features=[],(e=this.interpolateData)!=null&&e.length&&this.tropicals.active){const j=B(this.date).utc().set({minute:0,second:0,millisecond:0}),F=this.interpolateData.filter(S=>S.properties.date===j.format()&&!S.properties.disabled),oe=this.handleComputePolygons(F),$=x.featureCollection([...F]);oe.forEach(S=>{$.features.push(S)}),(t=this.map)!=null&&t.getSource(this.interpolateSource)?(o=this.map)==null||o.getSource(this.interpolateSource).setData($):((i=this.map)==null||i.addSource(this.interpolateSource,{type:"geojson",data:$}),(s=this.map)==null||s.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,"#ff9100",10,"#f44336","#ffffff"],"line-width":1}})),this.interpolateMarkers=[];for(const S of F)if(!S.properties.disabled){let A="#f44336";((l=(n=S.properties)==null?void 0:n.wind)==null?void 0:l.spd)<17.2||!((d=(h=S.properties)==null?void 0:h.wind)!=null&&d.spd)?A="#03f869":((m=(c=S.properties)==null?void 0:c.wind)==null?void 0:m.spd)>=17.2&&((p=(u=S.properties)==null?void 0:u.wind)==null?void 0:p.spd)<24.5?A="#f2f202":((f=(b=S.properties)==null?void 0:b.wind)==null?void 0:f.spd)>=24.5&&((w=(y=S.properties)==null?void 0:y.wind)==null?void 0:w.spd)<32.7?A="#ff9100":((v=(g=S.properties)==null?void 0:g.wind)==null?void 0:v.spd)>=32.7&&((L=(_=S.properties)==null?void 0:_.wind)==null?void 0:L.spd)<41.5?A="#f44336":((N=(z=S.properties)==null?void 0:z.wind)==null?void 0:N.spd)>=41.5&&((R=(V=S.properties)==null?void 0:V.wind)==null?void 0:R.spd)<51?A="#f903d0":((M=(D=S.properties)==null?void 0:D.wind)==null?void 0:M.spd)>=51?A="#8702f9":A="#f44336";const se=`<svg t="1719918955501"
189
+ }`);class ve{constructor(e="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNseTVudHJzYzAwNWUwbHBsZHkyaDRqczMiLCJyb2xlIjoxLCJuYW1lIjoiZmFrZUBvcm13eC5jb20iLCJwbGF0SWQiOiJnZDBtdDFkIiwiY29tcGFueSI6eyJpZCI6bnVsbCwiY2hpbGRyZW4iOltdfSwiaWF0IjoxNzIzMDI0MDI0LCJleHAiOjM5MzA1NDQwMjR9.RrKcdcMnq-FxBLJQ-i6lx2FscDE46y8EvHIemPW4HTg"){P(this,"token");P(this,"mapboxCustomer");P(this,"i4");P(this,"hi");P(this,"td");P(this,"windy");this.token=e,this.mapboxCustomer={source:this.initialOnlineStyle().sources.composite,layers:{water:{id:"water",type:"fill",source:"composite","source-layer":"water",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},paint:{"fill-color":"hsl(205, 75%, 70%)"}},waterDeplth:{id:"water-depth",type:"fill",source:"composite","source-layer":"depth",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},maxzoom:8,paint:{"fill-antialias":!1,"fill-color":["interpolate",["linear"],["zoom"],6,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0.35)",200,"hsla(205, 75%, 63%, 0.35)",7e3,"hsla(205, 75%, 56%, 0.35)"],8,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0)",200,"hsla(205, 75%, 63%, 0)",7e3,"hsla(205, 75%, 53%, 0)"]]}},countryBoundary:{id:"country-boundaries",type:"fill",source:"composite","source-layer":"country_boundaries",layout:{visibility:"visible"},paint:{"fill-color":"#d9d8d8"}},countryAdmin0BoundaryBg:{id:"admin-0-boundary-bg",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-width":["interpolate",["linear"],["zoom"],3,4,12,8],"line-color":"rgb(193, 190, 190)","line-opacity":["interpolate",["linear"],["zoom"],3,0,4,.5],"line-blur":["interpolate",["linear"],["zoom"],3,0,12,2]}},countryAdmin0Boundary:{id:"admin-0-boundary",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","disputed"],"false"],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(114, 110, 111)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[2,0]],7,["literal",[2,2,6,2]]]}},countryAdmin0BoundaryDisputed:{id:"admin-0-boundary-disputed",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","disputed"],"true"],["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(95, 93, 94)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[3,2,5]],7,["literal",[2,1.5]]]}},countryLabel:{id:"country-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},layout:{visibility:"visible","text-field":["coalesce",["get","name_en"],["get","name"]],"text-line-height":1.1,"text-max-width":6,"text-font":["HelveticaNeueThin"],"text-radial-offset":["step",["zoom"],.6,8,0],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],7,"auto"],"text-size":["interpolate",["cubic-bezier",.2,0,.7,1],["zoom"],1,["step",["get","symbolrank"],11,4,9,5,8],9,["step",["get","symbolrank"],22,4,19,5,17]]},paint:{"text-color":"rgba(255,255,255,0)"}}}},this.td={source:{type:"raster",tiles:["https://t0.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t1.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t2.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t3.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t4.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t5.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t6.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8","https://t7.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=3b3833b65e3705d5dc51a5e473b41da8"],tileSize:256},layer:{id:"td",type:"raster",source:"td",layout:{visibility:"visible"}}},this.i4={source:{type:"raster",tiles:["https://osshz.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz1.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz2.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz3.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz4.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz5.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz6.idmwx.com/nautical/{z}/{x}/{y}.png","https://osshz7.idmwx.com/nautical/{z}/{x}/{y}.png"],tileSize:256},layer:{id:"i4",type:"raster",source:"i4",layout:{visibility:"none"}}},this.hi={source:{type:"raster",tiles:[`https://assist0.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist1.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist2.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist3.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist4.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist5.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist6.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`,`https://assist7.idmwx.com/api/arc/hifleets/{z}/{y}/{x}/nauticalmap?tk=${this.token}`],tileSize:256},layer:{id:"hi",type:"raster",source:"hi",layout:{visibility:"none"}}},this.windy={darkmap:{source:{type:"raster",tiles:["https://tiles.windy.com/tiles/v10.0/darkmap/{z}/{x}/{y}.png"],tileSize:256},layer:{id:"darkmap",type:"raster",source:"darkmap",layout:{visibility:"none"}}},grayland:{source:{type:"raster",tiles:["https://tiles.windy.com/tiles/v9.0/grayland/{z}/{x}/{y}.png"],tileSize:256},layer:{id:"grayland",type:"raster",source:"grayland",layout:{visibility:"none"},paint:{"raster-opacity":1}}}}}initialOnlineStyle(){return{version:8,name:"map-weather-v2.0.0",metadata:{"mapbox:print":{width:8.5,height:11,units:"in",format:"png",resolution:300},"mapbox:type":"default","mapbox:trackposition":!0,"mapbox:autocomposite":!0,"mapbox:sdk-support":{android:"11.0.0",ios:"11.0.0",js:"3.0.0"},"mapbox:origin":"outdoors-v12","mapbox:groups":{"Terrain, terrain-labels":{name:"Terrain, terrain-labels",collapsed:!0},"Administrative boundaries, admin":{name:"Administrative boundaries, admin",collapsed:!1},"Land & water, built":{name:"Land & water, built",collapsed:!1},"Terrain, surface":{name:"Terrain, surface",collapsed:!0},"Land & water, land":{name:"Land & water, land",collapsed:!1},"Natural features, natural-labels":{name:"Natural features, natural-labels",collapsed:!0},"Walking, cycling, etc., barriers-bridges":{name:"Walking, cycling, etc., barriers-bridges",collapsed:!0},"Place labels, place-labels":{name:"Place labels, place-labels",collapsed:!1},"Transit, ferries":{name:"Transit, ferries",collapsed:!0},"Transit, elevated":{name:"Transit, elevated",collapsed:!0},"Walking, cycling, etc., tunnels":{name:"Walking, cycling, etc., tunnels",collapsed:!0},"Terrain, land":{name:"Terrain, land",collapsed:!0},"Road network, tunnels-case":{name:"Road network, tunnels-case",collapsed:!0},"Walking, cycling, etc., walking-cycling-labels":{name:"Walking, cycling, etc., walking-cycling-labels",collapsed:!0},"Walking, cycling, etc., surface":{name:"Walking, cycling, etc., surface",collapsed:!0},"Road network, surface-icons":{name:"Road network, surface-icons",collapsed:!0},"Land & water, water":{name:"Land & water, water",collapsed:!1}}},lights:[],fog:{color:"#ffffff",range:[.5,10],"high-color":"#245cdf","space-color":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"horizon-blend":["interpolate",["linear"],["zoom"],4,.2,7,.1],"star-intensity":["interpolate",["linear"],["zoom"],5,.35,6,0],"vertical-range":[0,0]},center:[80.02170408691855,17.83215724225399],zoom:2.4589703839156347,bearing:0,pitch:1,sprite:"mapbox://sprites/neatchenheng/clxwst0tq00wd01rn0usb2eer/3hcvufdre7i2yn9nbkvi9f9xi",glyphs:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",projection:{name:"equirectangular"},sources:{composite:{type:"vector",url:"mapbox://mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,mapbox.mapbox-bathymetry-v2,mapbox.country-boundaries-v1",data:{attribution:'<a href="https://www.mapbox.com/about/maps/" target="_blank" title="Mapbox" aria-label="Mapbox">&copy; Mapbox</a> <a href="https://www.openstreetmap.org/about/" target="_blank" title="OpenStreetMap" aria-label="OpenStreetMap">&copy; OpenStreetMap</a> <a href="https://www.mapbox.com/about/maps/" target="_blank" title="Mapbox" aria-label="Mapbox">&copy; Mapbox</a> <a href="https://www.openstreetmap.org/about/" target="_blank" title="OpenStreetMap" aria-label="OpenStreetMap">&copy; OpenStreetMap</a> <a class="mapbox-improve-map" href="https://www.mapbox.com/contribute/" target="_blank" title="Improve this map" aria-label="Improve this map">Improve this map</a>',bounds:[-180,-85.051129,180,85],center:[0,-.025564500000001544,0],description:"Global polygon tileset of country boundaries and disputed areas",format:"pbf",language_options:{ar:"Arabic",ca:"Catalan",cs:"Czech",da:"Danish",de:"German",el:"Greek",en:"English",es:"Spanish",fa:"Farsi",fi:"Finnish",fr:"French",he:"Hebrew",hu:"Hungarian",id:"Indonesian",it:"Italian",ja:"Japanese",ka:"Georgian",ko:"Korean",local:"Renderable local language",lv:"Latvian",ms:"Malay",nb:"Norwegian Bokmål",nl:"Dutch",no:"Norwegian",pl:"Polish",pt:"Portuguese",ro:"Romanian",ru:"Russian",sk:"Slovak",sl:"Slovenian",sr:"Serbian",sv:"Swedish",th:"Thai",tl:"Tagalog",tr:"Turkish",uk:"Ukrainian",vi:"Vietnamese","zh-Hans":"Simplified Chinese","zh-Hant":"Traditional Chinese"},mapbox_logo:!0,maskLevel:9,maxzoom:16,minzoom:0,mts:!0,name:"Mapbox Countries v1 + Mapbox Bathymetry v2 + Mapbox Terrain v2 + Mapbox Streets v8",scheme:"xyz",tilejson:"2.2.0",tiles:["https://a.tiles.mapbox.com/v4/mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,mapbox.mapbox-bathymetry-v2,mapbox.country-boundaries-v1/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1IjoibmVhdGNoZW5oZW5nIiwiYSI6ImNsdXM3cnBmODBsemgycW1vaXc1bjV6bXMifQ.w6fqHGRbhNhLvm0LnX4ZVw","https://b.tiles.mapbox.com/v4/mapbox.mapbox-streets-v8,mapbox.mapbox-terrain-v2,mapbox.mapbox-bathymetry-v2,mapbox.country-boundaries-v1/{z}/{x}/{y}.vector.pbf?access_token=pk.eyJ1IjoibmVhdGNoZW5oZW5nIiwiYSI6ImNsdXM3cnBmODBsemgycW1vaXc1bjV6bXMifQ.w6fqHGRbhNhLvm0LnX4ZVw"],vector_layers:[{id:"landuse",minzoom:5,source:"mapbox.mapbox-streets-v8"},{id:"waterway",minzoom:7,source:"mapbox.mapbox-streets-v8"},{id:"water",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"aeroway",minzoom:9,source:"mapbox.mapbox-streets-v8"},{id:"structure",minzoom:13,source:"mapbox.mapbox-streets-v8"},{id:"building",minzoom:12,source:"mapbox.mapbox-streets-v8"},{id:"landuse_overlay",minzoom:5,source:"mapbox.mapbox-streets-v8"},{id:"road",minzoom:3,source:"mapbox.mapbox-streets-v8"},{id:"admin",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"place_label",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"airport_label",minzoom:8,source:"mapbox.mapbox-streets-v8"},{id:"transit_stop_label",minzoom:5,source:"mapbox.mapbox-streets-v8"},{id:"natural_label",minzoom:0,source:"mapbox.mapbox-streets-v8"},{id:"poi_label",minzoom:6,source:"mapbox.mapbox-streets-v8"},{id:"motorway_junction",minzoom:9,source:"mapbox.mapbox-streets-v8"},{id:"housenum_label",minzoom:16,source:"mapbox.mapbox-streets-v8"},{id:"landcover",maxzoom:22,minzoom:0,source:"mapbox.mapbox-terrain-v2"},{id:"hillshade",maxzoom:22,minzoom:0,source:"mapbox.mapbox-terrain-v2"},{id:"contour",maxzoom:22,minzoom:0,source:"mapbox.mapbox-terrain-v2"},{id:"depth",maxzoom:7,minzoom:0,source:"mapbox.mapbox-bathymetry-v2"},{id:"country_boundaries",maxzoom:22,minzoom:0,source:"mapbox.country-boundaries-v1"}],worldview_default:"US",worldview_options:{AR:"Argentina",CN:"China",IN:"India",JP:"Japan",MA:"Morocco",RS:"Serbia",RU:"Russia",TR:"Turkey",US:"United States"}}}},layers:[{id:"land",type:"background",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},paint:{"background-color":"rgb(171, 174, 172)"}},{id:"landcover",type:"fill",source:"composite","source-layer":"landcover",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},maxzoom:12,paint:{"fill-color":["match",["get","class"],"wood","hsl(0, 0%, 69%)","scrub","hsl(0, 0%, 69%)","crop","hsl(0, 0%, 69%)","grass","hsl(0, 0%, 69%)","snow","hsl(0, 0%, 69%)","hsl(0, 0%, 69%)"],"fill-opacity":["interpolate",["exponential",1.5],["zoom"],8,.8,12,0],"fill-antialias":!1}},{id:"national-park",type:"fill",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:5,filter:["==",["get","class"],"national_park"],paint:{"fill-color":"hsl(98, 38%, 68%)","fill-opacity":["interpolate",["linear"],["zoom"],5,0,6,.6,12,.2]}},{id:"national-park_tint-band",type:"line",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:9,filter:["==",["get","class"],"national_park"],paint:{"line-color":"hsl(98, 38%, 68%)","line-width":["interpolate",["exponential",1.5],["zoom"],9,1,14,8],"line-blur":["interpolate",["exponential",1.5],["zoom"],9,1,14,8]}},{id:"landuse",type:"fill",source:"composite","source-layer":"landuse",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:5,filter:["all",[">=",["to-number",["get","sizerank"]],0],["match",["get","class"],["agriculture","wood","grass","scrub","glacier","pitch","sand"],["step",["zoom"],!1,11,!0],"residential",["step",["zoom"],!0,10,!1],["park","airport"],["step",["zoom"],!1,8,["case",["==",["get","sizerank"],1],!0,!1],10,!0],["facility","industrial"],["step",["zoom"],!1,12,!0],"rock",["step",["zoom"],!1,11,!0],"cemetery",["step",["zoom"],!1,11,!0],"school",["step",["zoom"],!1,11,!0],"hospital",["step",["zoom"],!1,11,!0],"commercial_area",["step",["zoom"],!1,11,!0],!1],["<=",["-",["to-number",["get","sizerank"]],["interpolate",["exponential",1.5],["zoom"],12,0,18,14]],14]],paint:{"fill-color":["interpolate",["linear"],["zoom"],15,["match",["get","class"],"wood","hsla(103, 50%, 60%, 0.8)","scrub","hsla(98, 47%, 68%, 0.6)","agriculture","hsla(98, 50%, 74%, 0.6)","park",["match",["get","type"],["garden","playground","zoo"],"hsl(98, 38%, 68%)","hsl(98, 55%, 70%)"],"grass","hsla(98, 50%, 74%, 0.6)","airport","hsl(230, 40%, 82%)","cemetery","hsl(98, 45%, 75%)","glacier","hsl(205, 45%, 95%)","hospital","hsl(20, 45%, 82%)","pitch","hsl(88, 65%, 75%)","sand","hsl(69, 60%, 72%)","rock","hsl(60, 0%, 85%)","school","hsl(40, 45%, 78%)","commercial_area","hsl(55, 45%, 85%)","residential","hsl(60, 7%, 87%)",["facility","industrial"],"hsl(230, 20%, 85%)","hsl(60, 12%, 72%)"],16,["match",["get","class"],"wood","hsla(103, 50%, 60%, 0.8)","scrub","hsla(98, 47%, 68%, 0.6)","agriculture","hsla(98, 50%, 74%, 0.6)","park",["match",["get","type"],["garden","playground","zoo"],"hsl(98, 38%, 68%)","hsl(98, 55%, 70%)"],"grass","hsla(98, 50%, 74%, 0.6)","airport","hsl(230, 40%, 82%)","cemetery","hsl(98, 45%, 75%)","glacier","hsl(205, 45%, 95%)","hospital","hsl(20, 45%, 82%)","pitch","hsl(88, 65%, 75%)","sand","hsl(69, 60%, 72%)","rock","hsla(60, 0%, 85%, 0.5)","school","hsl(40, 45%, 78%)","commercial_area","hsla(55, 45%, 85%, 0.5)",["facility","industrial"],"hsl(230, 20%, 85%)","hsl(60, 12%, 72%)"]],"fill-opacity":["interpolate",["linear"],["zoom"],8,["match",["get","class"],"residential",.8,.2],10,["match",["get","class"],"residential",0,1]],"fill-antialias":!1}},{id:"pitch-outline",type:"line",source:"composite","source-layer":"landuse",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, land"},minzoom:15,filter:["==",["get","class"],"pitch"],paint:{"line-color":"hsl(0, 0%, 69%)"}},{id:"waterway-shadow",type:"line",source:"composite","source-layer":"waterway",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:10,layout:{"line-cap":["step",["zoom"],"butt",11,"round"],"line-join":["step",["zoom"],"miter",11,"round"]},paint:{"line-color":"hsl(224, 79%, 69%)","line-width":["interpolate",["exponential",1.3],["zoom"],9,["match",["get","class"],["canal","river"],.1,0],20,["match",["get","class"],["canal","river"],8,3]],"line-translate":["interpolate",["exponential",1.2],["zoom"],7,["literal",[0,0]],16,["literal",[-1,-1]]],"line-translate-anchor":"viewport","line-opacity":["interpolate",["linear"],["zoom"],8,0,8.5,1]}},{id:"water-shadow",type:"fill",source:"composite","source-layer":"water",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:10,paint:{"fill-color":"hsl(224, 79%, 69%)","fill-translate":["interpolate",["exponential",1.2],["zoom"],7,["literal",[0,0]],16,["literal",[-1,-1]]],"fill-translate-anchor":"viewport"}},{id:"waterway",type:"line",source:"composite","source-layer":"waterway",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:8,layout:{"line-cap":["step",["zoom"],"butt",11,"round"],"line-join":["step",["zoom"],"miter",11,"round"]},paint:{"line-color":"hsl(205, 75%, 70%)","line-width":["interpolate",["exponential",1.3],["zoom"],9,["match",["get","class"],["canal","river"],.1,0],20,["match",["get","class"],["canal","river"],8,3]],"line-opacity":["interpolate",["linear"],["zoom"],8,0,8.5,1]}},{id:"water",type:"fill",source:"composite","source-layer":"water",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},paint:{"fill-color":"hsl(205, 75%, 70%)"}},{id:"water-depth",type:"fill",source:"composite","source-layer":"depth",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},maxzoom:8,paint:{"fill-antialias":!1,"fill-color":["interpolate",["linear"],["zoom"],6,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0.35)",200,"hsla(205, 75%, 63%, 0.35)",7e3,"hsla(205, 75%, 56%, 0.35)"],8,["interpolate",["linear"],["get","min_depth"],0,"hsla(205, 75%, 70%, 0)",200,"hsla(205, 75%, 63%, 0)",7e3,"hsla(205, 75%, 53%, 0)"]]}},{id:"wetland",type:"fill",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:5,filter:["match",["get","class"],["wetland","wetland_noveg"],!0,!1],paint:{"fill-color":"hsl(194, 38%, 74%)","fill-opacity":["interpolate",["linear"],["zoom"],10,.25,10.5,.15]}},{id:"wetland-pattern",type:"fill",source:"composite","source-layer":"landuse_overlay",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, water"},minzoom:5,filter:["match",["get","class"],["wetland","wetland_noveg"],!0,!1],paint:{"fill-color":"hsl(194, 38%, 74%)","fill-opacity":["interpolate",["linear"],["zoom"],10,0,10.5,1],"fill-pattern":"wetland","fill-translate-anchor":"viewport"}},{id:"land-structure-polygon",type:"fill",source:"composite","source-layer":"structure",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, built"},minzoom:13,filter:["all",["==",["get","class"],"land"],["==",["geometry-type"],"Polygon"]],paint:{"fill-color":"hsl(0, 0%, 69%)"}},{id:"land-structure-line",type:"line",source:"composite","source-layer":"structure",metadata:{"mapbox:featureComponent":"land-and-water","mapbox:group":"Land & water, built"},minzoom:13,filter:["all",["==",["get","class"],"land"],["==",["geometry-type"],"LineString"]],layout:{"line-cap":"square"},paint:{"line-width":["interpolate",["exponential",1.99],["zoom"],14,.75,20,40],"line-color":"hsl(60, 20%, 85%)"}},{id:"country-boundaries",type:"fill",source:"composite","source-layer":"country_boundaries",paint:{"fill-color":["interpolate",["linear"],["zoom"],0,"rgb(171, 174, 172)",22,"rgb(171, 174, 172)"]}},{id:"admin-0-boundary-bg",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-width":["interpolate",["linear"],["zoom"],3,4,12,8],"line-color":"rgb(193, 190, 190)","line-opacity":["interpolate",["linear"],["zoom"],3,0,4,.5],"line-blur":["interpolate",["linear"],["zoom"],3,0,12,2]}},{id:"admin-0-boundary",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","admin_level"],0],["==",["get","disputed"],"false"],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(114, 110, 111)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[2,0]],7,["literal",[2,2,6,2]]]}},{id:"admin-0-boundary-disputed",type:"line",source:"composite","source-layer":"admin",metadata:{"mapbox:featureComponent":"admin-boundaries","mapbox:group":"Administrative boundaries, admin"},minzoom:1,filter:["all",["==",["get","disputed"],"true"],["==",["get","admin_level"],0],["==",["get","maritime"],"false"],["match",["get","worldview"],["all","CN"],!0,!1]],paint:{"line-color":"rgb(95, 93, 94)","line-width":["interpolate",["linear"],["zoom"],3,.5,12,2],"line-dasharray":["step",["zoom"],["literal",[3,2,5]],7,["literal",[2,1.5]]]}},{id:"waterway-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:13,filter:["all",["match",["get","class"],["canal","river","stream","disputed_canal","disputed_river","disputed_stream"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"LineString"]],layout:{"text-font":["DIN Pro Italic","Arial Unicode MS Regular"],"text-max-angle":30,"symbol-spacing":["interpolate",["linear",1],["zoom"],15,250,17,400],"text-size":["interpolate",["linear"],["zoom"],13,12,18,18],"symbol-placement":"line","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]],visibility:"none"},paint:{"text-color":"hsl(205, 43%, 90%)","text-halo-color":"hsla(60, 17%, 84%, 0.5)"}},{id:"natural-line-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:4,filter:["all",["match",["get","class"],["glacier","landform","disputed_glacier","disputed_landform"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["<=",["get","filterrank"],4],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"LineString"]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"text-max-angle":30,"text-field":["coalesce",["get","name_en"],["get","name"]],"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport",visibility:"none"},paint:{"text-halo-width":.5,"text-halo-color":"hsl(60, 17%, 84%)","text-halo-blur":.5,"text-color":"hsl(340, 10%, 38%)"}},{id:"natural-point-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:4,filter:["all",["match",["get","class"],["dock","glacier","landform","water_feature","wetland","disputed_dock","disputed_glacier","disputed_landform","disputed_water_feature","disputed_wetland"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["<=",["get","filterrank"],4],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"Point"]],layout:{"text-size":["step",["zoom"],["step",["get","sizerank"],18,5,12],17,["step",["get","sizerank"],18,13,12]],"icon-image":["case",["has","maki_beta"],["coalesce",["image",["get","maki_beta"]],["image",["get","maki"]]],["image",["get","maki"]]],"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-offset":["step",["zoom"],["step",["get","sizerank"],["literal",[0,0]],5,["literal",[0,.8]]],17,["step",["get","sizerank"],["literal",[0,0]],13,["literal",[0,.8]]]],"text-anchor":["step",["zoom"],["step",["get","sizerank"],"center",5,"top"],17,["step",["get","sizerank"],"center",13,"top"]],"text-field":["coalesce",["get","name_en"],["get","name"]],visibility:"none"},paint:{"icon-opacity":["step",["zoom"],["step",["get","sizerank"],0,5,1],17,["step",["get","sizerank"],0,13,1]],"text-halo-color":"hsl(60, 20%, 98%)","text-halo-width":.5,"text-halo-blur":.5,"text-color":"hsl(340, 10%, 38%)"}},{id:"water-line-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:1,filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water","disputed_bay","disputed_ocean","disputed_reservoir","disputed_sea","disputed_water"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"LineString"]],layout:{"text-size":["interpolate",["linear"],["zoom"],0,["*",["-",16,["sqrt",["get","sizerank"]]],1],22,["*",["-",22,["sqrt",["get","sizerank"]]],1]],"text-max-angle":30,"text-letter-spacing":["match",["get","class"],"ocean",.25,["sea","bay"],.15,0],"text-font":["DIN Pro Italic","Arial Unicode MS Regular"],"symbol-placement":"line-center","text-pitch-alignment":"viewport","text-field":["coalesce",["get","name_en"],["get","name"]],visibility:"none"},paint:{"text-color":["match",["get","class"],["bay","ocean","sea"],"hsl(205, 71%, 90%)","hsl(205, 43%, 90%)"],"text-halo-color":"hsla(60, 17%, 84%, 0.5)"}},{id:"water-point-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"natural-features","mapbox:group":"Natural features, natural-labels"},minzoom:1,filter:["all",["match",["get","class"],["bay","ocean","reservoir","sea","water","disputed_bay","disputed_ocean","disputed_reservoir","disputed_sea","disputed_water"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],1],60,["<",["distance-from-center"],1.5],70,["<",["distance-from-center"],2]],["==",["geometry-type"],"Point"]],layout:{"text-line-height":1.3,"text-size":["interpolate",["linear"],["zoom"],0,["*",["-",16,["sqrt",["get","sizerank"]]],1],22,["*",["-",22,["sqrt",["get","sizerank"]]],1]],"text-font":["DIN Pro Italic","Arial Unicode MS Regular"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":["match",["get","class"],"ocean",.25,["bay","sea"],.15,.01],"text-max-width":["match",["get","class"],"ocean",4,"sea",5,["bay","water"],7,10],visibility:"none"},paint:{"text-color":["match",["get","class"],["bay","ocean","sea"],"hsl(205, 71%, 90%)","hsl(205, 43%, 90%)"],"text-halo-color":"hsla(60, 17%, 84%, 0.5)"}},{id:"settlement-subdivision-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:10,maxzoom:15,filter:["all",["match",["get","class"],["settlement_subdivision","disputed_settlement_subdivision"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["<=",["get","filterrank"],3],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-transform":"uppercase","text-font":["DIN Pro Regular","Arial Unicode MS Regular"],"text-letter-spacing":["match",["get","type"],"suburb",.15,.05],"text-max-width":7,"text-padding":3,"text-size":["interpolate",["cubic-bezier",.5,0,1,1],["zoom"],11,["match",["get","type"],"suburb",11,10.5],15,["match",["get","type"],"suburb",15,14]],visibility:"none"},paint:{"text-halo-color":"hsla(60, 25%, 100%, 0.75)","text-halo-width":1,"text-color":"hsl(230, 29%, 36%)","text-halo-blur":.5}},{id:"settlement-minor-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:2,maxzoom:13,filter:["all",["<=",["get","filterrank"],3],["match",["get","class"],["settlement","disputed_settlement"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["zoom"],[">",["get","symbolrank"],6],4,[">=",["get","symbolrank"],7],6,[">=",["get","symbolrank"],8],7,[">=",["get","symbolrank"],10],10,[">=",["get","symbolrank"],11],11,[">=",["get","symbolrank"],13],12,[">=",["get","symbolrank"],15]],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],11,9,10],6,["step",["get","symbolrank"],14,9,12,12,10],8,["step",["get","symbolrank"],16,9,14,12,12,15,10],13,["step",["get","symbolrank"],22,9,20,12,16,15,14]],"text-radial-offset":["step",["zoom"],["match",["get","capital"],2,.6,.55],8,0],"symbol-sort-key":["get","symbolrank"],"icon-image":["step",["zoom"],["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],8,""],"text-font":["DIN Pro Regular","Arial Unicode MS Regular"],"text-justify":"auto",visibility:"none","text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-max-width":7},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":"hsl(60, 25%, 100%)","text-halo-width":1,"text-halo-blur":1}},{id:"settlement-major-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:2,maxzoom:15,filter:["all",["<=",["get","filterrank"],3],["match",["get","class"],["settlement","disputed_settlement"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["zoom"],!1,2,["<=",["get","symbolrank"],6],4,["<",["get","symbolrank"],7],6,["<",["get","symbolrank"],8],7,["<",["get","symbolrank"],10],10,["<",["get","symbolrank"],11],11,["<",["get","symbolrank"],13],12,["<",["get","symbolrank"],15],13,[">=",["get","symbolrank"],11],14,[">=",["get","symbolrank"],15]],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-line-height":1.1,"text-size":["interpolate",["cubic-bezier",.2,0,.9,1],["zoom"],3,["step",["get","symbolrank"],13,6,11],6,["step",["get","symbolrank"],18,6,16,7,14],8,["step",["get","symbolrank"],20,9,16,10,14],15,["step",["get","symbolrank"],24,9,20,12,16,15,14]],"text-radial-offset":["step",["zoom"],["match",["get","capital"],2,.6,.55],8,0],"symbol-sort-key":["get","symbolrank"],"icon-image":["step",["zoom"],["case",["==",["get","capital"],2],"border-dot-13",["step",["get","symbolrank"],"dot-11",9,"dot-10",11,"dot-9"]],8,""],"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],8,"center"],visibility:"none","text-anchor":["step",["zoom"],["get","text_anchor"],8,"center"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-max-width":7},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":"hsl(60, 25%, 100%)","text-halo-width":1,"text-halo-blur":1}},{id:"state-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:3,maxzoom:9,filter:["all",["match",["get","class"],["state","disputed_state"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-size":["interpolate",["cubic-bezier",.85,.7,.65,1],["zoom"],4,["step",["get","symbolrank"],9,6,8,7,7],9,["step",["get","symbolrank"],21,6,16,7,14]],"text-transform":"uppercase","text-font":["DIN Pro Bold","Arial Unicode MS Bold"],"text-field":["coalesce",["get","name_en"],["get","name"]],"text-letter-spacing":.15,"text-max-width":6,visibility:"none"},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":"hsl(60, 25%, 100%)","text-halo-width":1,"text-opacity":.5}},{id:"country-label",type:"symbol",source:"composite","source-layer":"place_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:1,maxzoom:10,filter:["all",["match",["get","class"],["country","disputed_country"],["match",["get","worldview"],["all","CN"],!0,!1],!1],["step",["pitch"],!0,50,["<",["distance-from-center"],3],60,["<",["distance-from-center"],4],70,["<",["distance-from-center"],5]]],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-line-height":1.1,"text-max-width":6,"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-radial-offset":["step",["zoom"],.6,8,0],"text-justify":["step",["zoom"],["match",["get","text_anchor"],["left","bottom-left","top-left"],"left",["right","bottom-right","top-right"],"right","center"],7,"auto"],"text-size":["interpolate",["cubic-bezier",.2,0,.7,1],["zoom"],1,["step",["get","symbolrank"],11,4,9,5,8],9,["step",["get","symbolrank"],22,4,19,5,17]]},paint:{"icon-opacity":["step",["zoom"],["case",["has","text_anchor"],1,0],7,0],"text-color":"hsl(230, 29%, 0%)","text-halo-color":["interpolate",["linear"],["zoom"],2,"hsla(60, 25%, 100%, 0.75)",3,"hsl(60, 25%, 100%)"],"text-halo-width":1.25}},{id:"continent-label",type:"symbol",source:"composite","source-layer":"natural_label",metadata:{"mapbox:featureComponent":"place-labels","mapbox:group":"Place labels, place-labels"},minzoom:.75,maxzoom:3,filter:["==",["get","class"],"continent"],layout:{"text-field":["coalesce",["get","name_en"],["get","name"]],"text-line-height":1.1,"text-max-width":6,"text-font":["DIN Pro Medium","Arial Unicode MS Regular"],"text-size":["interpolate",["exponential",.5],["zoom"],0,10,2.5,15],"text-transform":"uppercase","text-letter-spacing":.05,visibility:"none"},paint:{"text-color":"hsl(230, 29%, 0%)","text-halo-color":["interpolate",["linear"],["zoom"],0,"hsla(60, 25%, 100%, 0.75)",3,"hsl(60, 25%, 100%)"],"text-halo-width":1.5,"text-opacity":["interpolate",["linear"],["zoom"],0,.8,1.5,.5,2.5,0]}}]}}}const Ir="",ot={name:"IdmWindParticle",props:{factor:{type:Object},viewport:{type:ue},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleOptions:{fadeOpacity:.9,speedFactor:.25,dropRate:.003,dropRateBump:.01,uvRange:[-25,26],sRange:[0,31.985]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[wind-particle] add elapsed: ",t,", total: ",e+=t)}},handleClear(){var a,e,t,o,i,s,n,l;(a=this.viewport)==null||a.toggle(!1),(e=this.viewport)==null||e.toggleParticle(!1),this.context=void 0,this.particleContext=void 0,this.etime=void 0,this.initial=!0,(o=(t=this.viewport)==null?void 0:t.map)==null||o.off("resize",this.handleResize),(s=(i=this.viewport)==null?void 0:i.map)==null||s.off("movestart",this.handlePause),(l=(n=this.viewport)==null?void 0:n.map)==null||l.off("moveend",this.handlePlay),this.handlePause()},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.uvFragmentSchema);this.program=e,this.aPositionBuffer=t}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const a=[[0,"rgb(183,224,224)"],[1,"rgb(217,220,220)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,I.vertexSchema,I.fragmentSchema,I.quadVertSchema,I.screenFragmentSchema,I.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,a,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,9e3),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,a),this.wrapper.image=a}this.initial&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext)}},handlePause(){this.paused=!0,this.animation&&(cancelAnimationFrame(this.animation),this.viewport.toggleParticle(!1))},handlePlay(){this.paused=!1,this.animation=requestAnimationFrame(()=>{this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay()})}}},st={key:0};function nt(a,e,t,o,i,s){var n;return(n=t.factor)!=null&&n.active?(r.openBlock(),r.createElementBlock("div",st,[r.createElementVNode("div",{class:"legend-bars flex-center",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:t.bottom}])},e[0]||(e[0]=[r.createElementVNode("span",null,"kts",-1),r.createElementVNode("span",null,"0",-1),r.createElementVNode("span",null,"5",-1),r.createElementVNode("span",null,"10",-1),r.createElementVNode("span",null,"20",-1),r.createElementVNode("span",null,"30",-1),r.createElementVNode("span",null,"40",-1),r.createElementVNode("span",null,"60",-1)]),4)])):r.createCommentVNode("",!0)}const lt=k(ot,[["render",nt],["__scopeId","data-v-64887571"]]),Rr="",ct={name:"IdmCurrent",props:{map:{type:Object},current:{type:Object},beforeLayer:{type:String},mapProjection:{type:String},showParticle:{type:Boolean,default:!1},marginBottom:{type:String,default:"30px"},toggleVersion:{type:Number}},emits:["particle","showCurrentIsoband","handleToggleVersion"],data(){return{source:"current-source",directionLayer:"current-direction-layer",speedLayer:"current-speed-layer",speedLabelLayer:"current-speed-label-layer",empty:x.featureCollection([]),showJson:localStorage.getItem("currentJsonCache")==="true"||!1,currentJsonCache:"currentJsonCache",right:10,bottom:95}},watch:{"current.version":{handler(){var a;(a=this.current)!=null&&a.active?this.handleRender():this.handleClear(),this.$emit("handleToggleVersion")},deep:!0},showParticle:{handler(){},immediate:!0},showJson:{handler(){this.showJson,localStorage.setItem(this.currentJsonCache,this.showJson),this.handleToggle(),this.$emit("showCurrentIsoband",this.showJson)},immediate:!0},toggleVersion:{handler(){var a,e;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10,this.bottom=(((e=document.getElementsByClassName("active-layers")[0])==null?void 0:e.clientHeight)||0)+110},immediate:!0}},methods:{handleParticle(a){this.$emit("particle",{particle:a,key:"current",weight:96})},handleRender(){var a,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.current){const t=new Date().valueOf();let o=0,i=0,s=this.empty;this.current.active&&(s=this.current.data),(a=this.map)!=null&&a.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),i=new Date().valueOf()-(t+o),console.log("[current] update elapsed: ",i,", total: ",o+=i)):(this.map.addSource(this.source,{type:"geojson",data:s}),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"],"#e1ffb3",1,"#ffff00",3,"#ff9500",4,"#f44336",5,"#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),this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"arrow-red","icon-size":["interpolate",["linear"],["get","spd"],.5,.14,3,.28],"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":.6}},this.beforeLayer),i=new Date().valueOf()-(t+o),console.log("[current] add elapsed: ",i,", total: ",o+=i)),this.handleToggle()}},handleToggle(){this.map.getLayer(this.speedLayer)&&this.map.setLayoutProperty(this.speedLayer,"visibility",this.showJson?"visible":"none"),this.map.getLayer(this.speedLabelLayer)&&this.map.setLayoutProperty(this.speedLabelLayer,"visibility",this.showJson?"visible":"none"),this.map.getLayer(this.directionLayer)&&this.map.setLayoutProperty(this.directionLayer,"visibility",this.showJson?"visible":"none")},handleClear(){this.map.getLayer(this.speedLayer)&&this.map.removeLayer(this.speedLayer),this.map.getLayer(this.speedLabelLayer)&&this.map.removeLayer(this.speedLabelLayer),this.map.getLayer(this.directionLayer)&&this.map.removeLayer(this.directionLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}},ht={key:0};function dt(a,e,t,o,i,s){var n;return(n=t.current)!=null&&n.active?(r.openBlock(),r.createElementBlock("div",ht,[r.createElementVNode("div",{class:"flex-center current-tool-bars",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:i.bottom+"px"}])},[t.mapProjection==="mercator"?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["flex-start item-bar",t.showParticle?"active":"inactive"]),onClick:e[0]||(e[0]=l=>s.handleParticle(!t.showParticle))},e[2]||(e[2]=[r.createElementVNode("div",{class:"checkbox"},null,-1),r.createElementVNode("span",null,"Current Particles",-1)]),2)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(["flex-start item-bar",i.showJson?"active":"inactive"]),onClick:e[1]||(e[1]=l=>i.showJson=!i.showJson)},e[3]||(e[3]=[r.createElementVNode("div",{class:"checkbox"},null,-1),r.createElementVNode("span",null,"Current Isoband",-1)]),2)],4)])):r.createCommentVNode("",!0)}const mt=k(ct,[["render",dt]]),Dr="",pt={name:"IdmCurrentParticle",props:{factor:{type:Object},viewport:{type:ue},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleOptions:{fadeOpacity:.96,speedFactor:4,dropRate:.005,dropRateBump:.01,uvRange:[-2.5,2.6],sRange:[0,3]},paused:!1,initial:!0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[current-particle] add elapsed: ",t,", total: ",e+=t)}},handleClear(){var a,e,t,o,i,s,n,l;(a=this.viewport)==null||a.toggle(!1),(e=this.viewport)==null||e.toggleParticle(!1),this.context=void 0,this.particleContext=void 0,this.etime=void 0,this.initial=!0,(o=(t=this.viewport)==null?void 0:t.map)==null||o.off("resize",this.handleResize),(s=(i=this.viewport)==null?void 0:i.map)==null||s.off("movestart",this.handlePause),(l=(n=this.viewport)==null?void 0:n.map)==null||l.off("moveend",this.handlePlay),this.handlePause()},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.uvFragmentSchema);this.program=e,this.aPositionBuffer=t}this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){this.particleContext=this.viewport.particleCanvas.getContext("webgl");const a=[[0,"rgb(183,224,224)"],[1,"rgb(199,202,202)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,I.vertexSchema,I.fragmentSchema,I.quadVertSchema,I.screenFragmentSchema,I.updateFragmentSchema),this.wrapper.color=this.webgl.setup(this.particleContext,a,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,12e3),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,a),this.wrapper.image=a}this.initial&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext)}},handlePause(){this.paused=!0,this.animation&&(cancelAnimationFrame(this.animation),this.viewport.toggleParticle(!1))},handlePlay(){this.paused=!1,this.animation=requestAnimationFrame(()=>{this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay()})}}},yt={key:0};function ft(a,e,t,o,i,s){var n;return(n=t.factor)!=null&&n.active?(r.openBlock(),r.createElementBlock("div",yt,[r.createElementVNode("div",{class:"legend-bars flex-center",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:t.bottom}])},e[0]||(e[0]=[r.createElementVNode("span",null,"kts",-1),r.createElementVNode("span",null,"0",-1),r.createElementVNode("span",null,"0.4",-1),r.createElementVNode("span",null,"0.8",-1),r.createElementVNode("span",null,"1.6",-1),r.createElementVNode("span",null,"2",-1),r.createElementVNode("span",null,"3.2",-1)]),4)])):r.createCommentVNode("",!0)}const ut=k(pt,[["render",ft],["__scopeId","data-v-6d4fd206"]]),gt={name:"IdmSigWave",props:{map:{type:Object},sigWave:{type:Object},beforeLayer:{type:String},activeWeatherLayers:{type:Array}},data(){return{source:"sig-wave-source",heightLayer:"sig-wave-height-layer",heightLabelLayer:"sig-wave-height-label-layer",empty:x.featureCollection([])}},watch:{"sigWave.version":{handler(){var a;(a=this.sigWave)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},activeWeatherLayers:{handler(){setTimeout(()=>{},200)},deep:!0}},methods:{handleRender(){var a,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.sigWave){const t=new Date().valueOf();let o=0,i=0,s=this.empty;this.sigWave.active&&(s=this.sigWave.data),(a=this.map)!=null&&a.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),i=new Date().valueOf()-(t+o),console.log("[sig.wave] update elapsed: ",i,", total: ",o+=i)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.heightLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],layout:{"fill-sort-key":["get","val"]},paint:{"fill-outline-color":"#888","fill-opacity":.8,"fill-color":["step",["get","val"],"rgba(186,247,237,0.5)",3,"rgba(93,235,185,0.8)",4,"rgba(101,252,149,0.9)",5,"#b3ff6b",6,"#fee600",7,"#ffa200",8,"#ff6600",9,"#e23304",10,"#f80078",11,"#dc03d2",12,"#a603f8",13,"#7102ab"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Polygon"],layout:{"symbol-placement":"line","symbol-avoid-edges":!0,"symbol-sort-key":["get","val"],"text-field":"{val} m","text-rotation-alignment":"viewport","text-size":10},paint:{"text-opacity":.7}},this.beforeLayer),i=new Date().valueOf()-(t+o),console.log("[sig.wave] add elapsed: ",i,", total: ",o+=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 bt(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const wt=k(gt,[["render",bt]]),Lt={name:"IdmSwell",props:{map:{type:Object},swell:{type:Object},beforeLayer:{type:String},activeWeatherLayers:{type:Array}},data(){return{source:"swell-source",directionLayer:"swell-direction-layer",heightLayer:"swell-height-layer",heightLabelLayer:"swell-height-label-layer",empty:x.featureCollection([])}},watch:{"swell.version":{handler(){var a;(a=this.swell)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},activeWeatherLayers:{handler(){setTimeout(()=>{},300)},deep:!0}},methods:{handleRender(){var a,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.swell){const t=new Date().valueOf();let o=0,i=0,s=this.empty;this.swell.active&&(s=this.swell.data),(a=this.map)!=null&&a.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),i=new Date().valueOf()-(t+o),console.log("[swell] update elapsed: ",i,", total: ",o+=i)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.heightLayer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-opacity":1,"line-width":2,"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":12},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":4}},this.beforeLayer),this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"arrow-yellow","icon-size":{base:1,stops:[[2,.14],[6,.28]]},"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,180],[360,540]]}},paint:{"icon-opacity":.8}},this.beforeLayer),i=new Date().valueOf()-(t+o),console.log("[swell] add elapsed: ",i,", total: ",o+=i))}},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.getSource(this.source)&&this.map.removeSource(this.source)}}};function vt(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const xt=k(Lt,[["render",vt]]),_t={name:"IdmPrmsl",props:{map:{type:Object},prmsl:{type:Object},beforeLayer:{type:String},showRampColor:{type:Boolean},activeWeatherLayers:{type:Array}},data(){return{source:"prmsl-source",layer:"prmsl-layer",labelLayer:"prmsl-label-layer",pointLabelLayer:"prmsl-point-label-layer",empty:x.featureCollection([])}},watch:{"prmsl.version":{handler(){var a;(a=this.prmsl)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},activeWeatherLayers:{handler(){setTimeout(()=>{},300)},deep:!0,immediate:!0}},methods:{handleRender(){var a,e,t;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.prmsl){const o=new Date().valueOf();let i=0,s=0,n=this.empty;this.prmsl.active&&(n=this.prmsl.data),(a=this.map)!=null&&a.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(n),s=new Date().valueOf()-(o+i),console.log("[prmsl] update elapsed: ",s,", total: ",i+=s)):(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(244,67,54,1)",980,"rgba(255,255,0,1)",1100,"rgba(199,171,250,1)"],"line-width":1,"line-opacity":1}},this.beforeLayer),(t=this.map)==null||t.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":12},paint:{"text-color":"black","text-opacity":.9,"text-halo-color":"rgba(255,255,255,1)","text-halo-width":1}},this.beforeLayer),setTimeout(()=>{this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":["format",["get","type"],{"font-scale":1.03},`
190
+ `,["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":12},paint:{"text-opacity":1,"text-color":["step",["get","val"],"white",980,"black",1100,"black"],"text-halo-color":["step",["get","val"],"rgba(162,13,2,0.9)",920,"rgba(244,67,54,0.9)",980,"rgba(255,255,0,0.9)",1100,"rgba(199,171,250,0.9)"],"text-halo-width":4}},this.beforeLayer)},100),s=new Date().valueOf()-(o+i),console.log("[prmsl] add elapsed: ",s,", total: ",i+=s))}},handleMove(){var a,e;(e=(a=this.map)==null?void 0:a.getLayer("country-boundaries"))==null||e.setLayoutProperty("visibility","visible"),this.map.getLayer(this.pointLabelLayer)&&this.map.moveLayer(this.pointLabelLayer,"country-boundaries"),this.map.getLayer(this.labelLayer)&&this.map.moveLayer(this.labelLayer,"country-boundaries"),this.map.getLayer(this.layer)&&this.map.moveLayer(this.layer,"country-boundaries")},handleClear(){var a,e;this.activeWeatherLayers.length===0&&((e=(a=this.map)==null?void 0:a.getLayer("country-boundaries"))==null||e.setLayoutProperty("visibility","none")),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 Ct(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const kt=k(_t,[["render",Ct]]),St={name:"IdmIceberg",props:{map:{type:Object},iceberg:{type:Object},beforeLayer:{type:String}},data(){return{source:"iceberg-source",layer:"iceberg-layer",empty:x.featureCollection([])}},watch:{"iceberg.version":{handler(){var a;(a=this.iceberg)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0}},methods:{handleRender(){var a,e;if(!this.map)setTimeout(()=>{this.handleRender()},500);else if(this.iceberg){const t=new Date().valueOf();let o=0,i=0,s=this.empty;this.iceberg.active&&(s=this.iceberg.data),(a=this.map)!=null&&a.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(s),i=new Date().valueOf()-(t+o),console.log("[iceberg] update elapsed: ",i,", total: ",o+=i)):(this.map.addSource(this.source,{type:"geojson",data:s}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-color":"rgba(255,255,255, 0.8)","line-width":2,"line-opacity":1}}),i=new Date().valueOf()-(t+o),console.log("[iceberg] add elapsed: ",i,", total: ",o+=i))}},handleClear(){this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Et(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const Pt=k(St,[["render",Et]]),Ar="",zt={name:"IdmTropicals",props:{map:{type:Object},tropicals:{type:Object},date:{type:String},timeZone:{type:Number,default:0}},emits:["tropical","tropicalProbability"],data(){return{helper:ce,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",showTropicals:!1,activeTropicals:void 0,activeTropicalsMarker:void 0,empty:x.featureCollection([]),circleSource:"circle-source",circleSourceData:x.featureCollection([]),circleLayer:"tropical-circle-layer"}},computed:{computeTime(){return function(a){if(a){const e=B(a).utc().utcOffset(this.timeZone),t=this.timeZone<0?this.timeZone:"+"+this.timeZone;return`${e.format("MMM-DD,HHmm")}[ UTC ${t} ] ( ${e==null?void 0:e.fromNow()} )`}return"-"}},computeTimezone(){return this.timeZone<0?this.timeZone:"+"+this.timeZone}},watch:{"tropicals.active":{handler(){this.handleInit()},immediate:!0},showTropicals:{handler(){this.$emit("tropical",this.showTropicals)},immediate:!0},"tropicals.version":{handler(){this.handleRefresh()}},timeZone:{handler(){this.handleRefresh()}}},methods:{handleRefresh(){var o,i;const a=((i=(o=this.tropicals)==null?void 0:o.data)==null?void 0:i.features)||[],e=B().utc().hour(),t=[];a.forEach(s=>{var n,l,h;(n=s.properties)!=null&&n.name&&!t.includes((l=s.properties)==null?void 0:l.name)&&t.push((h=s.properties)==null?void 0:h.name)}),t.forEach(s=>{var d;let n=0,l;const h=a.filter(c=>{var m,u;return((u=(m=c.properties)==null?void 0:m.category)==null?void 0:u.split("-")[0])===s});(d=h.filter(c=>{var m,u;return((m=c.geometry)==null?void 0:m.type)==="LineString"&&((u=c.properties)==null?void 0:u.type)==="forecast"})[0])==null||d.properties.model,h.forEach((c,m)=>{var u,p,b,f,y,w;((u=c.geometry)==null?void 0:u.type)==="Point"&&((p=c.properties)==null?void 0:p.type)==="history"&&(n=m,l=l===void 0?m:l),((b=c.geometry)==null?void 0:b.type)==="Point"&&((f=c.properties)==null?void 0:f.type)==="forecast"&&l===void 0&&(l=m),((y=c.geometry)==null?void 0:y.type)==="LineString"&&((w=c.properties)==null||w.type)}),h.map((c,m)=>{var u,p,b,f,y,w,g;if(((u=c.geometry)==null?void 0:u.type)==="LineString"&&((p=c.properties)==null||p.type),((b=c.geometry)==null?void 0:b.type)==="Point"&&((f=c.properties)==null?void 0:f.type)==="forecast"&&(c.properties.name=s,c.properties.format=B(c.properties.date).utcOffset(this.timeZone).format(`MMM-DD,HHmm [(utc ${this.computeTimezone})]`)),((y=c.geometry)==null?void 0:y.type)==="Point"&&((w=c.properties)==null?void 0:w.type)==="history"){c.properties.format=B(c.properties.date).utcOffset(this.timeZone).format(`MMM-DD,HHmm [(utc ${this.computeTimezone})]`);const v=B((g=c.properties)==null?void 0:g.date).utc().format("HHmm")===B().utc().hour(Math.floor(e/6)*6).minute("00").format("HHmm");c.properties.showHistoryLabel=v||m===n,c.properties.showNameLabel=m===n,c.properties.name=s}return c})}),this.handleInit()},handleInit(){var a,e;this.tropicals&&this.tropicals.active?(this.handleRender(),(a=this.map)==null||a.on("click",[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.forecastModelLayer,this.pointCircleLayer,this.pointLabelLayer,this.historyPointCircleLayer,this.historyPointLabelLayer],this.handleClick)):(this.handleClear(),(e=this.map)==null||e.off("click",[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.forecastModelLayer,this.pointCircleLayer,this.pointLabelLayer,this.historyPointCircleLayer,this.historyPointLabelLayer],this.handleClick))},handleRender(){var a,e,t,o,i,s,n,l,h,d;if(!this.map)setTimeout(()=>{this.handleRender()},500);else{if(this.tropicals){const m=new Date().valueOf();let u=0,p=0;(a=this.map)!=null&&a.getSource(this.source)?((t=this.map)==null||t.getSource(this.source).setData((e=this.tropicals)!=null&&e.active?this.tropicals.data:this.empty),p=new Date().valueOf()-(m+u),console.log("[tropicals] update elapsed: ",p,", total: ",u+=p)):(this.map.addSource(this.source,{type:"geojson",data:(o=this.tropicals)!=null&&o.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":"#000","line-width":4,"line-opacity":.5}}),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","#e2ea03","jma","#01d2b7","ecmwf","#f582f2","ukm","#f5bb47","noaa-at","#9758fb","noaa-ep","#9758fb","#fff"],"line-width":3,"line-opacity":.9,"line-dasharray":[1,2]}}),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":13},paint:{"text-color":["match",["get","model"],"cma","#000","jma","#000","ecmwf","#fff","ukm","#fff","noaa-at","#fff","noaa-ep","#fff","#000"],"text-opacity":1,"text-halo-color":["match",["get","model"],"cma","#e2ea03","jma","#01d2b7","ecmwf","#f582f2","ukm","#f5bb47","noaa-at","#9758fb","noaa-ep","#9758fb","#fff"],"text-halo-width":4}}),p=new Date().valueOf()-(m+u),console.log("[tropical] add elapsed: ",p,", total: ",u+=p)),(s=this.map)!=null&&s.getSource(this.clusterSource)?((l=this.map)==null||l.getSource(this.clusterSource).setData((n=this.tropicals)!=null&&n.active?this.tropicals.data:this.empty),p=new Date().valueOf()-(m+u),console.log("[tropical] update elapsed: ",p,", total: ",u+=p)):(this.map.addSource(this.clusterSource,{type:"geojson",data:(h=this.tropicals)!=null&&h.active?(d=this.tropicals)==null?void 0:d.data:this.empty}),this.map.addLayer({id:this.pointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":6,"circle-color":"#fff"}}),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","spd",["get","wind"]],null]],"#03f869",["boolean",["<",["get","spd",["get","wind"]],17.2]],"#03f869",["boolean",["<=",["get","spd",["get","wind"]],24.5]],"#f2f202",["boolean",["<=",["get","spd",["get","wind"]],32.7]],"#ff9100",["boolean",["<=",["get","spd",["get","wind"]],41.5]],"#f44336",["boolean",["<",["get","spd",["get","wind"]],51]],"#f903d0",["boolean",[">=",["get","spd",["get","wind"]],51]],"#8702f9","#fff"]}}),this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[0,-.5],"text-anchor":"bottom-left","text-size":12},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"#fff","text-halo-width":1}}),this.map.addLayer({id:this.historyPointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],paint:{"circle-radius":8,"circle-color":"#fff"}}),this.map.addLayer({id:this.historyPointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],paint:{"circle-radius":6,"circle-color":"rgba(0,0,0,0.7)"}}),this.map.addLayer({id:this.historyPointCircleLayer+"-inner",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],paint:{"circle-radius":4,"circle-color":"#fff"}}),this.map.addLayer({id:this.historyPointLabelLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showHistoryLabel",!0],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[0,-.5],"text-anchor":"bottom-left","text-size":14},paint:{"text-color":"rgba(0, 0, 0, 1)","text-halo-color":"#fff","text-halo-width":1}}),this.map.addLayer({id:this.forecastNameLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","showNameLabel",!0]],layout:{"text-field":["get","name"],"text-offset":[0,1.5],"text-anchor":"bottom","text-size":16,"text-allow-overlap":!0,"text-ignore-placement":!0},paint:{"text-color":"#fff","text-halo-color":"#0033ff","text-halo-width":4}}),p=new Date().valueOf()-(m+u),console.log("[tropical] add elapsed: ",p,", total: ",u+=p))}this.handleDrawCircle();const c=C.TropicalHelper.interpolate(this.tropicals,1);this.interpolateData=JSON.parse(JSON.stringify(c)),this.interpolateData.filter(m=>m.properties.name==="kristy"&&m.properties.model==="ecmwf"),this.handleDateChange()}},handleClear(){var a;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),(a=this.interpolateMarkers)==null||a.forEach(e=>e==null?void 0:e.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),this.map.getLayer(this.circleLayer)&&this.map.removeLayer(this.circleLayer),this.map.getSource(this.circleSource)&&this.map.removeSource(this.circleSource))},handleDateChange(){var a,e,t,o,i,s,n,l,h,d,c,m,u,p,b,f,y,w,g,v,_,L,z,N,V,R,D,M,Q,K,ee,te,ae,re,ie,G;if((a=this.interpolateMarkers)==null||a.forEach(j=>j==null?void 0:j.remove()),this.circleSourceData.features=[],(e=this.interpolateData)!=null&&e.length&&this.tropicals.active){const j=B(this.date).utc().set({minute:0,second:0,millisecond:0}),F=this.interpolateData.filter(S=>S.properties.date===j.format()&&!S.properties.disabled),oe=this.handleComputePolygons(F),$=x.featureCollection([...F]);oe.forEach(S=>{$.features.push(S)}),(t=this.map)!=null&&t.getSource(this.interpolateSource)?(o=this.map)==null||o.getSource(this.interpolateSource).setData($):((i=this.map)==null||i.addSource(this.interpolateSource,{type:"geojson",data:$}),(s=this.map)==null||s.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,"#ff9100",10,"#f44336","#ffffff"],"line-width":1}})),this.interpolateMarkers=[];for(const S of F)if(!S.properties.disabled){let A="#f44336";((l=(n=S.properties)==null?void 0:n.wind)==null?void 0:l.spd)<17.2||!((d=(h=S.properties)==null?void 0:h.wind)!=null&&d.spd)?A="#03f869":((m=(c=S.properties)==null?void 0:c.wind)==null?void 0:m.spd)>=17.2&&((p=(u=S.properties)==null?void 0:u.wind)==null?void 0:p.spd)<24.5?A="#f2f202":((f=(b=S.properties)==null?void 0:b.wind)==null?void 0:f.spd)>=24.5&&((w=(y=S.properties)==null?void 0:y.wind)==null?void 0:w.spd)<32.7?A="#ff9100":((v=(g=S.properties)==null?void 0:g.wind)==null?void 0:v.spd)>=32.7&&((L=(_=S.properties)==null?void 0:_.wind)==null?void 0:L.spd)<41.5?A="#f44336":((N=(z=S.properties)==null?void 0:z.wind)==null?void 0:N.spd)>=41.5&&((R=(V=S.properties)==null?void 0:V.wind)==null?void 0:R.spd)<51?A="#f903d0":((M=(D=S.properties)==null?void 0:D.wind)==null?void 0:M.spd)>=51?A="#8702f9":A="#f44336";const se=`<svg t="1719918955501"
191
191
  class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" p-id="18382"
192
192
  xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">
193
193
  <path
@@ -201,4 +201,4 @@
201
201
  <path
202
202
  d="M420.66666667 959.17a16.08 16.08 0 0 1-15.91-13.49A15.89 15.89 0 0 1 415.50666667 928c1.49-0.55 38.88-14.76 72.79-65.52A354.55 354.55 0 0 1 162.66666667 509.17a450.14 450.14 0 0 1 450.5-450.5 16.07 16.07 0 0 1 15.91 13.48 15.88 15.88 0 0 1-10.75 17.66c-1.58 0.58-39.13 14.9-73.07 65.95A354.22 354.22 0 0 1 871.66666667 509.17a16 16 0 0 1-0.52 4.05A450.14 450.14 0 0 1 420.66666667 959.17zM554.80666667 94.72C351.57666667 123.2 194.66666667 298.21 194.66666667 509.17c0 177.08 144.06 321.74 321.13 322.48a16 16 0 0 1 14.07 23.49c-16.11 30.42-34.27 52.37-50.85 68C682.25666667 894.63 839.16666667 719.63 839.16666667 508.67a15.94 15.94 0 0 1 0.47-3.86C837.30666667 329.33 693.82666667 187 517.80666667 186.67A16 16 0 0 1 503.66666667 163.21c16.21-30.69 34.47-52.79 51.14-68.49z"
203
203
  fill="#ffffff" p-id="18386"></path>
204
- </svg>`,H=document.createElement("div");H.className="hurricane-hourly-marker",H.innerHTML=`<div class="${S.geometry.coordinates[1]>=0?"center north":"center south"}">${se}</div>`;const ne=new O.Marker(H).setLngLat(S.geometry.coordinates).addTo(this.map);if(this.interpolateMarkers.push(ne),(Q=S.properties)!=null&&Q.showCircle){const J={radius:100,coordinates:S.geometry.coordinates},X={radius:200,coordinates:S.geometry.coordinates},q={radius:500,coordinates:S.geometry.coordinates};(K=this.circleSourceData)==null||K.features.push(x.circle(J.coordinates,J.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}})),(ee=this.circleSourceData)==null||ee.features.push(x.circle(X.coordinates,X.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}})),(te=this.circleSourceData)==null||te.features.push(x.circle(q.coordinates,q.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}}))}(re=(ae=this.map)==null?void 0:ae.getSource(this.circleSource))==null||re.setData(this.circleSourceData)}}else(ie=this.map)!=null&&ie.getSource(this.interpolateSource)&&((G=this.map)==null||G.getSource(this.interpolateSource).setData(this.empty))},handleClick(a){var s,n,l,h,d,c,m,u;const e=a.features[0],t=(n=(s=this.tropicals)==null?void 0:s.data)==null?void 0:n.features.filter(p=>{var b;return p.geometry.type==="LineString"&&p.properties.type==="forecast"&&p.properties.name===((b=e==null?void 0:e.properties)==null?void 0:b.name)});t.sort((p,b)=>{var f,y,w,g;return((f=p.properties)==null?void 0:f.model)==="cma"?-1:((y=p.properties)==null?void 0:y.model)==="jma"?((w=b.properties)==null?void 0:w.model)==="cma"?1:-1:p.properties.model==="ecmwf"?["jma","cma"].includes((g=b.properties)==null?void 0:g.model)?1:-1:0});const o=(h=(l=this.tropicals)==null?void 0:l.data)==null?void 0:h.features.filter(p=>{var b;return p.geometry.type==="LineString"&&p.properties.type==="history"&&p.properties.name===((b=e==null?void 0:e.properties)==null?void 0:b.name)});this.activeTropicals={name:(d=e==null?void 0:e.properties)==null?void 0:d.name,forecasts:t.map(p=>p.properties),history:(c=o[0])==null?void 0:c.properties,showCircle:(u=(m=t[0])==null?void 0:m.properties)==null?void 0:u.showCircle},this.showTropicals=!0;const i=document.getElementById("active-tropical");this.activeTropicalsMarker?this.activeTropicalsMarker.setLngLat([a.lngLat.lng,a.lngLat.lat]):this.activeTropicalsMarker=new O.Marker(i).setLngLat([a.lngLat.lng,a.lngLat.lat]).setOffset([220,0]).addTo(this.map)},handleForecastToggle(a){var o,i,s,n,l,h;a.disabled=!a.disabled;const e=`${a.name}-${a.model}`,t=(i=(o=this.map)==null?void 0:o.getSource(this.source)._data)==null?void 0:i.features;t.forEach(d=>{d.properties.category===e&&(d.properties.disabled=a.disabled)}),this.interpolateData.forEach(d=>{d.properties.category===e&&(d.properties.disabled=a.disabled)}),(n=(s=this.map)==null?void 0:s.getSource(this.source))==null||n.setData(x.featureCollection(t)),(h=(l=this.map)==null?void 0:l.getSource(this.clusterSource))==null||h.setData(x.featureCollection(t)),this.handleDateChange()},handleStrikeProbability(a){this.$emit("tropicalProbability",a)},handleToggleCircles(a){var e,t;a.showCircle=!a.showCircle,(t=(e=this.tropicals.data)==null?void 0:e.features)==null||t.forEach(o=>{o.properties.name===a.name&&(o.properties.showCircle=a.showCircle)}),this.handleRender()},handleDrawCircle(){var a,e;(a=this.map)!=null&&a.getSource(this.circleSource)?(e=this.map)==null||e.getSource(this.circleSource).setData(this.circleSourceData):(this.map.addSource(this.circleSource,{type:"geojson",data:this.circleSourceData}),this.map.addLayer({id:this.circleLayer,type:"line",source:this.circleSource,filter:["all",["==","$type","Polygon"],["==","type","tropicalCircle"]],paint:{"line-color":"#fff","line-width":2,"line-opacity":1,"line-dasharray":[1,1]}}))},handleComputePolygons(a){const e=[];for(const t of a){const o=t.properties.wind,i={ne:o.r7ne>=0?o.r7ne:void 0,se:o.r7se>=0?o.r7se:void 0,sw:o.r7sw>=0?o.r7sw:void 0,nw:o.r7nw>=0?o.r7nw:void 0},s=this.handleComputeArc(t.geometry.coordinates,i,{...t.properties,level:7});e.push(s);const n={ne:o.r10ne>=0?o.r10ne:void 0,se:o.r10se>=0?o.r10se:void 0,sw:o.r10sw>=0?o.r10sw:void 0,nw:o.r10nw>=0?o.r10nw:void 0},l=this.handleComputeArc(t.geometry.coordinates,n,{...t.properties,level:10});e.push(l)}return e},handleComputeArc(a,e,t){var s;const o=[];for(const n in e){const l=e[n]??0;let h;switch(n){case"ne":h=x.lineArc(a,l*1.852,0,90,{steps:l>0?64:1});break;case"se":h=x.lineArc(a,l*1.852,90,180,{steps:l>0?64:1});break;case"sw":h=x.lineArc(a,l*1.852,180,270,{steps:l>0?64:1});break;case"nw":h=x.lineArc(a,l*1.852,270,360,{steps:l>0?64:1});break}o.push(...(s=h==null?void 0:h.geometry)==null?void 0:s.coordinates)}const i=x.lineString(o);return x.lineToPolygon(i,{properties:t})}}},zt={id:"active-tropical",class:"active-tropical"},Nt={class:"header-box"},Tt={class:"main"},Vt={key:0},It={class:"sub"},Rt={id:"meteoBox",class:"main-box"},Dt={class:"content"},At={class:"row"},Bt={class:"col col-left",style:{"justify-content":"flex-start"}},Mt={class:"col col-right",style:{"justify-content":"flex-start"}},jt={class:"row"},Wt={class:"col col-24",style:{"justify-content":"flex-start"}},Ot={class:"forecast-models"},Ft=["onClick"],$t={class:"more"};function Ht(a,e,t,o,i,s){var n,l,h,d,c,m,u,p,b,f,y,w,g,v,_;return r.withDirectives((r.openBlock(),r.createElementBlock("div",zt,[r.createElementVNode("div",Nt,[r.createElementVNode("div",{class:"iconfont close-btn",onClick:e[0]||(e[0]=L=>i.showTropicals=!1)},""),r.createElementVNode("div",Tt,[(l=(n=i.activeTropicals)==null?void 0:n.history)!=null&&l.level?(r.openBlock(),r.createElementBlock("span",Vt,r.toDisplayString((d=(h=i.activeTropicals)==null?void 0:h.history)==null?void 0:d.level)+" , ",1)):r.createCommentVNode("",!0),r.createTextVNode(r.toDisplayString((c=i.activeTropicals)==null?void 0:c.name),1)]),r.createElementVNode("div",It," Last update: "+r.toDisplayString(s.computeTime(((u=(m=i.activeTropicals)==null?void 0:m.history)==null?void 0:u.updated)||((f=(b=(p=i.activeTropicals)==null?void 0:p.forecasts)==null?void 0:b.filter(L=>!L.disabled)[0])==null?void 0:f.date))),1)]),r.createElementVNode("div",Rt,[r.createElementVNode("div",Dt,[r.createElementVNode("div",At,[r.createElementVNode("div",Bt,[e[2]||(e[2]=r.createElementVNode("label",null,"Wind speed : ",-1)),r.createElementVNode("span",null,r.toDisplayString(((w=(y=i.activeTropicals)==null?void 0:y.history)==null?void 0:w.kts)||"-")+"[kts]",1)]),r.createElementVNode("div",Mt,[e[3]||(e[3]=r.createElementVNode("label",null,"Pressure : ",-1)),r.createElementVNode("span",null,r.toDisplayString(((v=(g=i.activeTropicals)==null?void 0:g.history)==null?void 0:v.pressure)||"-")+"[hPa]",1)])]),r.createElementVNode("div",jt,[r.createElementVNode("div",Wt,[e[4]||(e[4]=r.createElementVNode("label",{style:{width:"max-content"}},"Forecast Models : ",-1)),r.createElementVNode("div",Ot,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList((_=i.activeTropicals)==null?void 0:_.forecasts,(L,z)=>{var N,V,R,D;return r.openBlock(),r.createElementBlock("div",{key:z,class:r.normalizeClass(["model",L.disabled?"":"active",z>0&&z<((V=(N=i.activeTropicals)==null?void 0:N.forecasts)==null?void 0:V.length)-1&&((D=(R=i.activeTropicals)==null?void 0:R.forecasts)==null?void 0:D.length)>2?"center-child":""]),onClick:M=>s.handleForecastToggle(L)},[r.createElementVNode("span",{class:r.normalizeClass(L.model)},r.toDisplayString(L.model),3)],10,Ft)}),128))])])]),e[5]||(e[5]=r.createStaticVNode('<div class="row" style="padding:0;height:1px;margin:10px 0;background:var(--idm-black-1);" data-v-f122450c></div><div class="row" style="padding:2px 10px;" data-v-f122450c><div class="legend" data-v-f122450c><div class="icon td" data-v-f122450c></div><div class="label" data-v-f122450c>TD</div></div><div class="legend" data-v-f122450c><div class="icon ts" data-v-f122450c></div><div class="label" data-v-f122450c>TS</div></div><div class="legend" data-v-f122450c><div class="icon sts" data-v-f122450c></div><div class="label" data-v-f122450c>STS</div></div><div class="legend" data-v-f122450c><div class="icon ty" data-v-f122450c></div><div class="label" data-v-f122450c>TY</div></div><div class="legend" data-v-f122450c><div class="icon sty" data-v-f122450c></div><div class="label" data-v-f122450c>STY</div></div><div class="legend" data-v-f122450c><div class="icon supper-ty" data-v-f122450c></div><div class="label" data-v-f122450c>Super TY</div></div></div><div class="row" style="padding:2px 10px;" data-v-f122450c><div class="legend" data-v-f122450c><div class="icon history" data-v-f122450c></div><div class="label" data-v-f122450c>History</div></div><div class="legend" data-v-f122450c><div class="icon r7" data-v-f122450c></div><div class="label" data-v-f122450c>35kts Radii</div></div><div class="legend" data-v-f122450c><div class="icon r10" data-v-f122450c></div><div class="label" data-v-f122450c>50kts Radii</div></div></div>',3))]),r.createElementVNode("div",$t,[r.createElementVNode("div",{class:"button",onClick:e[1]||(e[1]=L=>s.handleStrikeProbability(i.activeTropicals))},"Strike Probability >>")])])],512)),[[r.vShow,i.showTropicals&&!a.$attrs.hideTropicalsLegend]])}const be=k(Pt,[["render",Ht],["__scopeId","data-v-f122450c"]]),Ar="",Ut={name:"IdmPrecip3h",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[precip3h] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Zt={key:0};function Gt(a,e,t,o,i,s){var n;return(n=t.factor)!=null&&n.active?(r.openBlock(),r.createElementBlock("div",Zt,[r.createElementVNode("div",{class:"legend-bars flex-center",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:t.bottom}])},e[0]||(e[0]=[r.createElementVNode("span",null,"mm",-1),r.createElementVNode("span",null,"1.5",-1),r.createElementVNode("span",null,"2",-1),r.createElementVNode("span",null,"3",-1),r.createElementVNode("span",null,"7",-1),r.createElementVNode("span",null,"10",-1),r.createElementVNode("span",null,"20",-1),r.createElementVNode("span",null,"30",-1)]),4)])):r.createCommentVNode("",!0)}const Jt=k(Ut,[["render",Gt],["__scopeId","data-v-9708a7a3"]]),Br="",Xt={name:"IdmVisibility",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[visibility] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},qt={key:0};function Yt(a,e,t,o,i,s){var n;return(n=t.factor)!=null&&n.active?(r.openBlock(),r.createElementBlock("div",qt,[r.createElementVNode("div",{class:"legend-bars flex-center",style:r.normalizeStyle([{position:"absolute"},{right:a.right+"px",bottom:t.bottom}])},e[0]||(e[0]=[r.createElementVNode("span",null,"nm",-1),r.createElementVNode("span",null,"0",-1),r.createElementVNode("span",null,"0.5",-1),r.createElementVNode("span",null,"1.5",-1),r.createElementVNode("span",null,"3",-1),r.createElementVNode("span",null,"9",-1)]),4)])):r.createCommentVNode("",!0)}const Qt=k(Xt,[["render",Yt],["__scopeId","data-v-f7b2fb08"]]),Mr="",Kt={name:"IdmWaterTemp",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[water-temp] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},ea={key:0};function ta(a,e,t,o,i,s){var n;return(n=t.factor)!=null&&n.active?(r.openBlock(),r.createElementBlock("div",ea,[r.createElementVNode("div",{class:"legend-bars flex-center",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:t.bottom}])},e[0]||(e[0]=[r.createElementVNode("span",null,"°C",-1),r.createElementVNode("span",null,"0",-1),r.createElementVNode("span",null,"10",-1),r.createElementVNode("span",null,"20",-1),r.createElementVNode("span",null,"30",-1),r.createElementVNode("span",null,"40",-1)]),4)])):r.createCommentVNode("",!0)}const aa=k(Kt,[["render",ta],["__scopeId","data-v-7521f582"]]),jr="",ra={name:"IdmTemp",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[water-temp] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},ia={key:0};function oa(a,e,t,o,i,s){var n;return(n=t.factor)!=null&&n.active?(r.openBlock(),r.createElementBlock("div",ia,[r.createElementVNode("div",{class:"legend-bars flex-center",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:t.bottom}])},e[0]||(e[0]=[r.createElementVNode("span",null,"°C",-1),r.createElementVNode("span",null,"-20",-1),r.createElementVNode("span",null,"-10",-1),r.createElementVNode("span",null,"0",-1),r.createElementVNode("span",null,"10",-1),r.createElementVNode("span",null,"20",-1),r.createElementVNode("span",null,"30",-1),r.createElementVNode("span",null,"40",-1)]),4)])):r.createCommentVNode("",!0)}const sa=k(ra,[["render",oa],["__scopeId","data-v-25daaa82"]]),Wr="",na={name:"IdmArctic",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[water-temp] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgba(76, 165, 228, 0)"],[50/255,"rgba(76, 165, 228, 0)"],[51/255,"rgb(76, 165, 228)"],[102/255,"rgb(129, 204, 197)"],[153/255,"rgb(150, 209, 216)"],[204/255,"rgb(180, 209, 216)"],[1,"rgb(180, 209, 216)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},la={key:0};function ca(a,e,t,o,i,s){var n;return(n=t.factor)!=null&&n.active?(r.openBlock(),r.createElementBlock("div",la,[r.createElementVNode("div",{class:"legend-bars flex-center",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:t.bottom}])},e[0]||(e[0]=[r.createElementVNode("span",null,"m",-1),r.createElementVNode("span",null,"0",-1),r.createElementVNode("span",null,"0.5",-1),r.createElementVNode("span",null,"1",-1),r.createElementVNode("span",null,"1.5",-1),r.createElementVNode("span",null,"2",-1)]),4)])):r.createCommentVNode("",!0)}const ha=k(na,[["render",ca],["__scopeId","data-v-5bb73794"]]),Or="",da={name:"IdmPoint",emits:["point","more"],props:{map:{type:Object},show:{type:Boolean},timeZone:{type:Number,default:0},meteo:{type:Object}},data(){return{showMeteo:!1,meteoMarker:void 0,helper:ce}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){this.map&&this.show&&this.handleBind()}},meteo:{handler(){this.meteo?(this.showMeteo=!0,this.handleRender()):this.showMeteo=!1}}},computed:{computeTime(){return function(a){if(a){const e=B(a).utc().utcOffset(this.timeZone),t=this.timeZone<0?this.timeZone:"+"+this.timeZone;return`${e.format("MMM-DD,HHmm")} ( UTC ${t} )`}return"-"}},computeLat(){return function(a,e=4){return C.LngLatHelper.lat2pretty(a,e).pretty}},computeLng(){return function(a,e=4){return C.LngLatHelper.lng2pretty(a,e).pretty}},roundPrecision(){return function(a,e=4){return isNaN(a)?"-":C.LngLatHelper.roundPrecision(a,e)}}},methods:{handleBind(){var a,e;this.show?(a=this.map)==null||a.on("click",this.handleClick):((e=this.map)==null||e.off("click",this.handleClick),this.showMeteo=!1)},handleClick(a){a.originalEvent.stopPropagation();const e=a.originalEvent.target.className;e.indexOf("close")>-1?this.showMeteo=!1:e==="more"?this.$emit("more",this.meteo):this.$emit("point",a.lngLat)},handleRender(){var a;if(this.meteo){const e=document.getElementById("point-meteo");this.meteoMarker?(a=this.meteoMarker)==null||a.setLngLat([this.meteo.lng,this.meteo.lat]):this.meteoMarker=new O.Marker(e).setLngLat([this.meteo.lng,this.meteo.lat]).addTo(this.map)}}}},ma={id:"point-meteo",class:"point-meteo"},pa={class:"meteo-box"},ya={class:"header-box"},fa={class:"main"},ua={class:"sub"},ga={class:"main-box"},ba={class:"flex-space"},wa={class:"flex-space"},La={class:"flex-space"},va={class:"flex-space"},xa={class:"flex-space"},_a={class:"flex-space"},Ca={class:"flex-space"},ka={class:"flex-space"},Sa={class:"flex-space"};function Ea(a,e,t,o,i,s){var n,l,h,d,c,m,u,p,b,f,y,w,g,v,_,L,z,N,V,R,D,M,Q,K,ee,te,ae,re,ie,G,j,F,oe,$,S,A,se,H,ne,J,X,q,de,me,pe,ye,fe;return r.withDirectives((r.openBlock(),r.createElementBlock("div",ma,[r.createElementVNode("div",pa,[r.createElementVNode("div",ya,[r.createElementVNode("div",{class:"iconfont close",onClick:e[0]||(e[0]=Le=>i.showMeteo=!1)},""),r.createElementVNode("div",fa,r.toDisplayString(s.computeLat((n=t.meteo)==null?void 0:n.lat))+","+r.toDisplayString(s.computeLng((l=t.meteo)==null?void 0:l.lng)),1),r.createElementVNode("div",ua,r.toDisplayString(s.computeTime((h=t.meteo)==null?void 0:h.utc)),1)]),r.createElementVNode("div",ga,[r.createElementVNode("div",ba,[e[1]||(e[1]=r.createElementVNode("label",null,"Wind",-1)),r.createElementVNode("span",null,r.toDisplayString(((c=(d=t.meteo)==null?void 0:d.wind)==null?void 0:c.direction)||"-")+"/"+r.toDisplayString(s.roundPrecision((u=(m=t.meteo)==null?void 0:m.wind)==null?void 0:u.kts,1))+"[kts]/"+r.toDisplayString((b=(p=t.meteo)==null?void 0:p.wind)==null?void 0:b.scale)+"[BF]/"+r.toDisplayString(s.roundPrecision((y=(f=t.meteo)==null?void 0:f.gusts)==null?void 0:y.kts,1))+"[kts]",1)]),r.createElementVNode("div",wa,[e[2]||(e[2]=r.createElementVNode("label",null,"Wind.Wave",-1)),r.createElementVNode("span",null,r.toDisplayString(((v=(g=(w=t.meteo)==null?void 0:w.wave)==null?void 0:g.wd)==null?void 0:v.direction)||"-")+"/"+r.toDisplayString(s.roundPrecision((z=(L=(_=t.meteo)==null?void 0:_.wave)==null?void 0:L.wd)==null?void 0:z.height,1))+"[m]/"+r.toDisplayString(s.roundPrecision((R=(V=(N=t.meteo)==null?void 0:N.wave)==null?void 0:V.wd)==null?void 0:R.period,1))+"[s]",1)]),r.createElementVNode("div",La,[e[3]||(e[3]=r.createElementVNode("label",null,"Swell",-1)),r.createElementVNode("span",null,r.toDisplayString(((Q=(M=(D=t.meteo)==null?void 0:D.wave)==null?void 0:M.swell)==null?void 0:Q.direction)||"-")+"/"+r.toDisplayString(s.roundPrecision((te=(ee=(K=t.meteo)==null?void 0:K.wave)==null?void 0:ee.swell)==null?void 0:te.height,1))+"[m]/"+r.toDisplayString(s.roundPrecision((ie=(re=(ae=t.meteo)==null?void 0:ae.wave)==null?void 0:re.swell)==null?void 0:ie.period,1))+"[s]",1)]),r.createElementVNode("div",va,[e[4]||(e[4]=r.createElementVNode("label",null,"Sig.Wave",-1)),r.createElementVNode("span",null,r.toDisplayString(((F=(j=(G=t.meteo)==null?void 0:G.wave)==null?void 0:j.sig)==null?void 0:F.direction)||"-")+"/"+r.toDisplayString(s.roundPrecision((S=($=(oe=t.meteo)==null?void 0:oe.wave)==null?void 0:$.sig)==null?void 0:S.height,1))+"[m]/"+r.toDisplayString(s.roundPrecision((H=(se=(A=t.meteo)==null?void 0:A.wave)==null?void 0:se.sig)==null?void 0:H.period,1))+"[s]",1)]),r.createElementVNode("div",xa,[e[5]||(e[5]=r.createElementVNode("label",null,"Current",-1)),r.createElementVNode("span",null,r.toDisplayString(((J=(ne=t.meteo)==null?void 0:ne.current)==null?void 0:J.direction)||"-")+"/"+r.toDisplayString(s.roundPrecision((q=(X=t.meteo)==null?void 0:X.current)==null?void 0:q.kts,2))+"[kts]",1)]),r.createElementVNode("div",_a,[e[6]||(e[6]=r.createElementVNode("label",null,"Precip",-1)),r.createElementVNode("span",null,r.toDisplayString(s.roundPrecision((me=(de=t.meteo)==null?void 0:de.precip)==null?void 0:me.inter6h,2))+"[mm]",1)]),r.createElementVNode("div",Ca,[e[7]||(e[7]=r.createElementVNode("label",null,"Visibility",-1)),r.createElementVNode("span",null,r.toDisplayString(s.roundPrecision(((pe=t.meteo)==null?void 0:pe.visibility)/1852,0))+"[nm]",1)]),r.createElementVNode("div",ka,[e[8]||(e[8]=r.createElementVNode("label",null,"Temp",-1)),r.createElementVNode("span",null,r.toDisplayString(s.roundPrecision((ye=t.meteo)==null?void 0:ye.temp,0))+"[°C]",1)]),r.createElementVNode("div",Sa,[e[9]||(e[9]=r.createElementVNode("label",null,"Water Temp",-1)),r.createElementVNode("span",null,r.toDisplayString(s.roundPrecision((fe=t.meteo)==null?void 0:fe.waterTemp,2))+"[°C]",1)])]),r.createCommentVNode("",!0)])],512)),[[r.vShow,i.showMeteo]])}const Pa=k(da,[["render",Ea],["__scopeId","data-v-efcf572f"]]),za={name:"IdmWarZone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},data(){return{source:"war-zone-source",zoneLayer:"war-zone-layer",zoneLabelLayer:"war-zone-label-layer"}},watch:{zone:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.zone&&(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.zoneLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-color":"#f44336","fill-opacity":.4}},this.beforeLayer),this.map.addLayer({id:this.zoneLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":1,"line-color":"#f44336"}},this.beforeLayer),this.map.addLayer({id:this.zoneLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-1]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.zoneLayer)&&this.map.removeLayer(this.zoneLayer),this.map.getLayer(this.zoneLayer+"-border")&&this.map.removeLayer(this.zoneLayer+"-border"),this.map.getLayer(this.zoneLabelLayer)&&this.map.removeLayer(this.zoneLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Na(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const Ta=k(za,[["render",Na]]),Va={name:"IdmGmdssArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},data(){return{source:"gmdss-area-source",areaLayer:"gmdss-area-layer",areaLabelLayer:"gmdss-area-label-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":["match",["get","val"],"AreaI","#EB8996","AreaII","#6F448B","AreaIII","#3E8BD3","AreaIV","#5EBCC4","AreaV","#00AAE7","AreaVI","#9CCE6D","AreaVII","#F4AE00","AreaVIII","#EF9A85","AreaIX","#00AAA7","AreaX","#7AC49F","AreaXI","#DFDFDF","AreaXII","#FFF974","AreaXIII","#EF9A85","AreaXIV","#86A2D1","AreaXV","#EC8972","AreaXVI","#EAC2DA","AreaXVII","#B9C8E7","AreaXVIII","#BBA1C8","AreaXIX","#FAE0BD","AreaXX","#DBECC8","AreaXXI","#D496AF","#ffffff"]}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":12,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-opacity":.8,"text-color":"#000"}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Ia(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const Ra=k(Va,[["render",Ia]]),Da={name:"IdmEcaZone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},data(){return{source:"eca-zone-source",zoneLayer:"eca-zone-layer",zoneLabelLayer:"eca-zone-label-layer"}},watch:{zone:{handler(){this.zone?this.handleRender():this.handleClear()}}},methods:{handleRender(){var a;this.map?(this.handleClear(),this.zone&&(this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(this.zone):(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.zoneLayer,type:"fill",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"fill-outline-color":"silver","fill-opacity":.4,"fill-color":"#05f324"}}),this.map.addLayer({id:this.zoneLayer+"-border",type:"line",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-color":"#04c021","line-width":1,"line-opacity":1}},this.beforeLayer),this.map.addLayer({id:this.zoneLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-max-width":16,"text-justify":"left","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}})))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.zoneLayer)&&this.map.removeLayer(this.zoneLayer),this.map.getLayer(this.zoneLayer+"-border")&&this.map.removeLayer(this.zoneLayer+"-border"),this.map.getLayer(this.zoneLabelLayer)&&this.map.removeLayer(this.zoneLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Aa(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const Ba=k(Da,[["render",Aa]]),Fr="",Ma={name:"IdmAlertZone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},data(){return{source:"alert-zone-source",polygonLayer:"alert-zone-polygon-layer",polygonLabelLayer:"alert-zone-polygon-label-layer",lineLayer:"alert-zone-line-layer",lineLabelLayer:"alert-zone-line-label-layer",pointLayer:"alert-zone-point-layer",showZone:!1,form:{}}},watch:{zone:{handler(){var a,e;this.zone?(this.handleRender(),(a=this.map)==null||a.on("click",[this.polygonLabelLayer,this.lineLabelLayer,this.pointLayer],this.handleClick)):(this.handleClear(),(e=this.map)==null||e.off("click",[this.polygonLabelLayer,this.lineLabelLayer,this.pointLayer],this.handleClick))}}},methods:{handleClick(a){var o;const e=a.features[0],t=(o=this.zone)==null?void 0:o.features.filter(i=>{var s;return i.properties.id===((s=e==null?void 0:e.properties)==null?void 0:s.id)})[0];if(t){this.showZone=!0,this.form={...t.properties};const i=document.getElementById("idm-gl3-zone-info");this.marker?this.marker.setLngLat([a.lngLat.lng,a.lngLat.lat]):this.marker=new O.Marker(i).setLngLat([a.lngLat.lng,a.lngLat.lat]).setOffset([0,0]).addTo(this.map)}},handleRender(){var a;this.map?(this.handleClear(),this.zone&&(this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(this.zone):(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.polygonLayer,type:"fill",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"fill-outline-color":"#d57d02","fill-opacity":.4,"fill-color":"#d57d02"}}),this.map.addLayer({id:this.polygonLayer+"-border",type:"line",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-width":1,"line-color":"#d57d02"}}),this.map.addLayer({id:this.lineLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["!=","disabled",!0]],paint:{"line-color":"#d57d02","line-width":2}}),this.map.addLayer({id:this.polygonLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-image":"alert","icon-size":.08,"icon-allow-overlap":!0,"icon-rotation-alignment":"viewport"},paint:{"icon-opacity":.8}}),this.map.addLayer({id:this.lineLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","LineString"],["!=","disabled",!0]],layout:{"symbol-placement":"line-center","icon-image":"alert","icon-size":.08,"icon-allow-overlap":!0,"icon-rotation-alignment":"viewport"},paint:{"icon-opacity":.8}}),this.map.addLayer({id:this.pointLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-image":"alert","icon-size":.08},paint:{"icon-opacity":.8}})))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.polygonLayer)&&this.map.removeLayer(this.polygonLayer),this.map.getLayer(this.polygonLayer+"-border")&&this.map.removeLayer(this.polygonLayer+"-border"),this.map.getLayer(this.polygonLabelLayer)&&this.map.removeLayer(this.polygonLabelLayer),this.map.getLayer(this.lineLayer)&&this.map.removeLayer(this.lineLayer),this.map.getLayer(this.lineLabelLayer)&&this.map.removeLayer(this.lineLabelLayer),this.map.getLayer(this.pointLayer)&&this.map.removeLayer(this.pointLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}},ja={id:"idm-gl3-zone-info"},Wa=["innerHTML"];function Oa(a,e,t,o,i,s){var n;return r.withDirectives((r.openBlock(),r.createElementBlock("div",ja,[r.createElementVNode("div",{class:"iconfont close",onClick:e[0]||(e[0]=l=>i.showZone=!1)},""),r.createElementVNode("div",{class:"rich-context",innerHTML:(n=i.form)==null?void 0:n.name},null,8,Wa)],512)),[[r.vShow,i.showZone]])}const Fa=k(Ma,[["render",Oa]]),$r="",$a={name:"IdmPort",props:{map:{type:Object},port:{type:Object},beforeLayer:{type:String}},emits:["port"],data(){return{source:"port-source",layer:"port-layer",showPort:!1,form:{},marker:void 0}},computed:{computeLat(){return function(a){return C.LngLatHelper.lat2pretty(a,4).pretty}},computeLng(){return function(a){return C.LngLatHelper.lng2pretty(a,4).pretty}}},watch:{port:{handler(){var a,e;this.port?(this.handleRender(),(a=this.map)==null||a.on("click",[this.layer],this.handleClick)):(this.handleClear(),(e=this.map)==null||e.off("click",[this.layer],this.handleClick))}}},methods:{handleClick(a){var o;const e=a.features[0],t=(o=this.port)==null?void 0:o.features.filter(i=>{var s;return i.properties.id===((s=e==null?void 0:e.properties)==null?void 0:s.id)})[0];if(t){this.showPort=!0,this.form={...t.properties},this.form.lng=t.geometry.coordinates[0],this.form.lat=t.geometry.coordinates[1];const i=document.getElementById("port-info");this.marker?this.marker.setLngLat([a.lngLat.lng,a.lngLat.lat]):this.marker=new O.Marker(i).setLngLat([a.lngLat.lng,a.lngLat.lat]).setOffset([0,-85]).addTo(this.map)}},handleEmit(){this.$emit("port",this.form)},handleRender(){var a;this.map?this.port&&(this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(this.port):(this.map.addSource(this.source,{type:"geojson",data:this.port}),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","text-anchor":"left","text-field":"{name}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[1,0]},paint:{"text-color":"rgba(0, 0, 0, 0.8)","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.showPort=!1,this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}},Ha={id:"port-info"},Ua={class:"port-box"},Za={class:"flex-start"},Ga={class:"flex-start"},Ja={class:"flex-start"},Xa={class:"flex-start",style:{"align-items":"flex-start"}};function qa(a,e,t,o,i,s){return r.withDirectives((r.openBlock(),r.createElementBlock("div",Ha,[r.createElementVNode("div",{class:"close iconfont",onClick:e[0]||(e[0]=n=>i.showPort=!1)},""),r.createElementVNode("div",Ua,[r.createElementVNode("div",Za,[e[2]||(e[2]=r.createElementVNode("label",null,"Name : ",-1)),r.createElementVNode("span",{onClick:e[1]||(e[1]=(...n)=>s.handleEmit&&s.handleEmit(...n))},r.toDisplayString(i.form.name),1)]),r.createElementVNode("div",Ga,[e[3]||(e[3]=r.createElementVNode("label",null,"Position : ",-1)),r.createElementVNode("span",null,r.toDisplayString(s.computeLat(i.form.lat))+", "+r.toDisplayString(s.computeLng(i.form.lng)),1)]),r.createElementVNode("div",Ja,[e[4]||(e[4]=r.createElementVNode("label",null,"LoCode : ",-1)),r.createElementVNode("span",null,r.toDisplayString(i.form.loCode||"-"),1)]),r.createElementVNode("div",Xa,[e[5]||(e[5]=r.createElementVNode("label",null,"Region : ",-1)),r.createElementVNode("span",null,r.toDisplayString(i.form.zoneName||"-"),1)])])],512)),[[r.vShow,i.showPort]])}const Ya=k($a,[["render",qa],["__scopeId","data-v-c07e4c45"]]),Qa={name:"IdmLoadLine",props:{map:{type:Object},line:{type:Object},beforeLayer:{type:String}},data(){return{source:"load-line-source",lineLayer:"load-line-layer",lineLabelLayer:"load-line-label-layer"}},watch:{line:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.line&&(this.map.addSource(this.source,{type:"geojson",data:this.line}),this.map.addLayer({id:this.lineLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.75,"fill-color":["match",["get","val"],"LLGreen","#A0C0C0","LLRed","#F5A39D","LLBlue","#6B94E4","#ffffff"]}},this.beforeLayer),this.map.addLayer({id:this.lineLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":"{lbl} (Length < {shipLength}, {start} - {end})","text-rotation-alignment":"viewport","text-offset":[0,1],"text-size":10,"text-allow-overlap":!0},paint:{"text-opacity":.8}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.lineLayer)&&this.map.removeLayer(this.lineLayer),this.map.getLayer(this.lineLabelLayer)&&this.map.removeLayer(this.lineLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Ka(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const er=k(Qa,[["render",Ka]]),tr={name:"IdmTimezone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},data(){return{source:"time-zone-source",zoneLayer:"time-zone-layer",zoneLabelLayer:"time-zone-label-layer"}},watch:{zone:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.zone&&(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.zoneLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":["match",["get","offSet"],"-11.5","rgba(255,0,0,0.4)","-11","rgba(0,255,0,0.3)","-10.5","rgba(0,255,0,0.3)","-10","rgba(0,0,255,0.3)","-9.5","rgba(0,0,255,0.3)","-9","rgba(255,0,0,0.4)","-8.5","rgba(255,0,0,0.4)","-8","rgba(0,255,0,0.3)","-7.5","rgba(0,255,0,0.3)","-7","rgba(0,0,255,0.3)","-6.5","rgba(0,0,255,0.3)","-6","rgba(255,0,0,0.4)","-5.5","rgba(255,0,0,0.4)","-5","rgba(0,255,0,0.3)","-4.5","rgba(0,255,0,0.3)","-4","rgba(0,0,255,0.3)","-3.5","rgba(0,0,255,0.3)","-3","rgba(255,0,0,0.4)","-2.5","rgba(255,0,0,0.4)","-2","rgba(0,255,0,0.3)","-1.5","rgba(0,255,0,0.3)","-1","rgba(0,0,255,0.3)","-0.5","rgba(0,0,255,0.3)","+0","rgba(255,0,0,0.4)","+0.5","rgba(255,0,0,0.4)","+1","rgba(0,255,0,0.3)","+1.5","rgba(0,255,0,0.3)","+2","rgba(0,0,255,0.3)","+2.5","rgba(0,0,255,0.3)","+3","rgba(255,0,0,0.4)","+3.5","rgba(255,0,0,0.4)","+4","rgba(0,255,0,0.3)","+4.5","rgba(0,255,0,0.3)","+5","rgba(0,0,255,0.3)","+5.5","rgba(0,0,255,0.3)","+6","rgba(255,0,0,0.4)","+6.5","rgba(255,0,0,0.4)","+7","rgba(0,255,0,0.3)","+7.5","rgba(0,255,0,0.3)","+8","rgba(0,0,255,0.3)","+8.5","rgba(0,0,255,0.3)","+9","rgba(255,0,0,0.4)","+9.5","rgba(255,0,0,0.4)","+10","rgba(0,255,0,0.3)","+10.5","rgba(0,255,0,0.3)","+11","rgba(0,0,255,0.3)","+11.5","rgba(0,0,255,0.3)","rgba(255,0,0,0.4)"]}}),this.map.addLayer({id:this.zoneLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":"{offSet}","text-rotation-alignment":"viewport","text-size":12,"text-offset":[0,1]},paint:{"text-opacity":.8,"text-color":"#fff"}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.zoneLayer)&&this.map.removeLayer(this.zoneLayer),this.map.getLayer(this.zoneLabelLayer)&&this.map.removeLayer(this.zoneLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function ar(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const rr=k(tr,[["render",ar]]),ir={name:"IdmVoluntaryReportingArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},data(){return{source:"vra-source",areaLayer:"vra-layer",areaLabelLayer:"vra-label-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.4,"fill-color":"#9f30f9"}},this.beforeLayer),this.map.addLayer({id:this.areaLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":1,"line-color":"#9f30f9"}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLayer+"-border")&&this.map.removeLayer(this.areaLayer+"-border"),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function or(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const sr=k(ir,[["render",or]]),nr={name:"IdmSpecialArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},data(){return{source:"special-area-source",areaLayer:"special-area-layer",areaLabelLayer:"special-area-label-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.area.features.forEach(a=>{a.geometry.type==="Polygon"&&a.geometry.coordinates.forEach(e=>C.LngLatHelper.convertToMonotonicLng2(e))}),this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.4,"fill-color":["match",["get","val"],"DefaultStyle","rgb(0,0,0)","JWCriskArea","rgb(0,0,0)","rgb(0,0,0)"]}},this.beforeLayer),this.map.addLayer({id:this.areaLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":.4,"line-color":"rgb(0,0,0)"}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLayer+"-border")&&this.map.removeLayer(this.areaLayer+"-border"),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function lr(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const cr=k(nr,[["render",lr]]),hr={name:"IdmTerminator",props:{map:{type:Object},area:{type:Object}},data(){return{source:"terminator-source",layer:"terminator-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.layer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":"rgba(0, 0, 0, 0.4)"}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function dr(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const mr=k(hr,[["render",dr]]),Hr="",pr={name:"IdmLatLng",props:{map:{type:Object},show:{type:Boolean},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{lngLat:void 0,source:"idm-lat-lng-source",layer:"idm-lat-lng-layer",labelLayer:"idm-lat-lng-label-layer",right:10}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){var a;this.map&&((a=this.map)==null||a.on("mousemove",this.handleMouseMove))},immediate:!0},toggleVersion:{handler(){var a,e;this.right=(((a=document.getElementsByClassName("legend-bars")[0])==null?void 0:a.clientWidth)||-10)+(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+20},immediate:!0}},methods:{handleBind(){var a,e;this.show?((a=this.map)==null||a.on("zoomend",this.handleZoomEnd),this.handleRender()):(this.handleClear(),(e=this.map)==null||e.off("zoomend",this.handleZoomEnd))},handleMouseMove(a){const e=a.lngLat,t=C.LngLatHelper.lng2pretty(e.lng,2),o=C.LngLatHelper.lat2pretty(e.lat,2);this.lngLat={lng:t,lat:o}},handleComputeLatLngs(){var o;const a=(o=this.map)==null?void 0:o.getZoom();console.log(a);let e=30;a>4?e=10:a>3&&(e=15);const t=[];for(let i=-60;i<90;i+=e)t.push({type:"Feature",geometry:{type:"LineString",coordinates:[[-180,i],[180,i]]}});for(let i=-180;i<180;i+=e)t.push({type:"Feature",geometry:{type:"LineString",coordinates:[[i,-90],[i,90]]}});for(let i=180;i>-180;i-=e)for(let s=-60;s<90;s+=e)t.push({type:"Feature",geometry:{type:"Point",coordinates:[i,s]},properties:{val:`${s>0?s+" N":s===0?s:s*-1+" S"}, ${i>0?i+" E":i*-1+" W"}`}});return t},handleZoomEnd(){var e;const a=this.handleComputeLatLngs();(e=this.map)==null||e.getSource(this.source).setData(x.featureCollection(a))},handleRender(){if(this.map){const a=this.handleComputeLatLngs();this.map.addSource(this.source,{type:"geojson",data:{type:"FeatureCollection",features:a}}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"rgba(0, 0, 0, 0.3)","line-width":1}}),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":.8}})}},handleClear(){var a,e,t,o,i,s;(a=this.map)!=null&&a.getLayer(this.layer)&&((e=this.map)==null||e.removeLayer(this.layer)),(t=this.map)!=null&&t.getLayer(this.labelLayer)&&((o=this.map)==null||o.removeLayer(this.labelLayer)),(i=this.map)!=null&&i.getSource(this.source)&&((s=this.map)==null||s.removeSource(this.source))}}};function yr(a,e,t,o,i,s){return i.lngLat?(r.openBlock(),r.createElementBlock("div",{key:0,class:"lat-lng-tip",style:r.normalizeStyle({right:i.right+"px",bottom:t.bottom})},[r.createElementVNode("span",null,r.toDisplayString(i.lngLat.lat.pretty),1),e[0]||(e[0]=r.createElementVNode("span",null,", ",-1)),r.createElementVNode("span",null,r.toDisplayString(i.lngLat.lng.pretty),1)],4)):r.createCommentVNode("",!0)}const we=k(pr,[["render",yr],["__scopeId","data-v-73241fe7"]]),fr={name:"IdmMeasure",props:{map:{type:Object},show:{type:Boolean}},data(){return{geojson:[],source:"measure-source",layer:"measure-layer",labelLayer:"measure-label-layer",tmpSource:"measure-tmp-source",tmpLayer:"measure-tmp-layer",tmpLabelLayer:"measure-tmp-label-layer",closeMarkers:{},pointMarkers:{},tipMarker:void 0,contextmenu:void 0,navigation:"RL"}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){this.map&&this.handleBind()}}},methods:{handleBind(){var a,e,t,o,i,s,n,l,h,d;if(this.show)(a=this.map)==null||a.getCanvas().addEventListener("keydown",this.handleKeydown),(e=this.map)==null||e.on("mousemove",this.handleMove),(t=this.map)==null||t.on("dblclick",this.handleDblClick),(o=this.map)==null||o.on("click",this.handleClick),(i=this.map)==null||i.on("contextmenu",this.handleContextmenu),this.map&&(this.map.getCanvas().style.cursor="crosshair");else{(s=this.map)==null||s.getCanvas().removeEventListener("keydown",this.handleKeydown),(n=this.map)==null||n.off("mousemove",this.handleMove),(l=this.map)==null||l.off("dblclick",this.handleDblClick),(h=this.map)==null||h.off("click",this.handleClick),(d=this.map)==null||d.off("contextmenu",this.handleContextmenu);for(const c of this.geojson)this.handleClear(c,!0);this.geojson=[],this.map&&(this.map.getCanvas().style.cursor="grab")}},handleKeydown(a){if(a.key==="Shift"){this.navigation=this.navigation==="RL"?"GC":"RL";const t=this.geojson.at(-1).features.filter(o=>o.geometry.type==="Point");t.length&&(t.at(-1).properties.mode=this.navigation)}},handleDrag(a){var t,o,i,s,n,l,h,d,c,m;const e=(o=(t=a.target)==null?void 0:t._element)==null?void 0:o.id;if((e==null?void 0:e.split("-").length)===2){const u=this.geojson.filter(y=>y.id===e.split("-")[0])[0];this.pointMarkers[u.id].filter(y=>{var w;return((w=y._element)==null?void 0:w.id)===e})[0].setLngLat([(s=(i=a.target)==null?void 0:i._lngLat)==null?void 0:s.lng,(l=(n=a.target)==null?void 0:n._lngLat)==null?void 0:l.lat]);let b;u.features.forEach((y,w)=>{if(y.geometry.type==="Point"&&y.properties.id==e.split("-")[1]){b=w;return}});const f=u.features.filter(y=>y.geometry.type==="Point");this.handleTmpPointUpdate(u,f[b-1],{lng:(d=(h=a.target)==null?void 0:h._lngLat)==null?void 0:d.lng,lat:(m=(c=a.target)==null?void 0:c._lngLat)==null?void 0:m.lat,properties:f[b].properties},b===f.length-1?void 0:f[b+1])}},handleDragEnd(a){var t,o,i,s,n,l,h,d,c,m;const e=(o=(t=a.target)==null?void 0:t._element)==null?void 0:o.id;if((e==null?void 0:e.split("-").length)===2){const u=this.geojson.filter(f=>f.id===e.split("-")[0])[0];this.pointMarkers[u.id].filter(f=>{var y;return((y=f._element)==null?void 0:y.id)===e})[0].setLngLat([(s=(i=a.target)==null?void 0:i._lngLat)==null?void 0:s.lng,(l=(n=a.target)==null?void 0:n._lngLat)==null?void 0:l.lat]);const b=u.features.filter(f=>f.geometry.type==="Point"&&f.properties.id==e.split("-")[1])[0];b.geometry.coordinates=[(d=(h=a.target)==null?void 0:h._lngLat)==null?void 0:d.lng,(m=(c=a.target)==null?void 0:c._lngLat)==null?void 0:m.lat],u.features=u.features.filter(f=>f.geometry.type==="Point"),this.handlePointUpdate(u)}},handleContextmenu(a){var t,o,i,s;a.preventDefault(),(t=this.contextmenu)==null||t.remove();const e=(s=(i=(o=a.originalEvent)==null?void 0:o.target)==null?void 0:i.parentElement)==null?void 0:s.id;if((e==null?void 0:e.split("-").length)===2){const l=this.geojson.filter(h=>h.id===e.split("-")[0])[0].features.filter(h=>h.geometry.type==="Point");if(l.length>2&&l.filter(d=>d.properties.id===(e==null?void 0:e.split("-")[1]))[0]){const d=document.createElement("div");d.className="point-contextmenu-marker",d.innerHTML=`<span id="del-${e}" class="del-point">Del</span>`,this.contextmenu=new O.Marker(d).setOffset([24,0]).setLngLat([a.lngLat.lng,a.lngLat.lat]).addTo(this.map)}}},handleClick(a){var t,o,i,s,n;(t=this.contextmenu)==null||t.remove();const e=a.originalEvent.target.className;if(e==="marker-close"){const l=(i=(o=a.originalEvent)==null?void 0:o.srcElement)==null?void 0:i.id,h=this.geojson.filter(d=>d.id===l)[0];h&&this.handleClear(h,!0),this.geojson=this.geojson.filter(d=>d.id!==l)}else if(e==="del-point"){const l=(n=(s=a.originalEvent.target.id)==null?void 0:s.replace("del-",""))==null?void 0:n.split("-"),h=this.geojson.filter(d=>d.id===l[0])[0];h.features=h.features.filter(d=>d.geometry.type==="Point"&&d.properties.id!==l[1]),this.handlePointUpdate(h)}else if(e!=="marker-label"){let l=this.geojson.at(-1);l||(l=x.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(l)),l.features=l.features.filter(d=>d.geometry.type==="Point");const h=x.feature({type:"Point",coordinates:[a.lngLat.lng,a.lngLat.lat]},{id:new Date().getTime().toString(),mode:this.navigation});l.features.push(h),this.handlePointUpdate(l)}},handlePointUpdate(a){const e=a.features;if(e.length>1){let t=0;const o=[];for(let i=1;i<e.length;i++){const s=e[i-1],n=e[i],l=s.properties,h={lng:s.geometry.coordinates[0],lat:s.geometry.coordinates[1]},d={lng:n.geometry.coordinates[0],lat:n.geometry.coordinates[1]},c=C.LaneHelper.calculateDistance(h,d,l.mode==="RL",2),m=C.LaneHelper.calculateBearing(h,d,l.mode==="RL",2);t=C.LngLatHelper.roundPrecision(t+c,2);let u;l.mode==="RL"?u=C.LngLatHelper.convertToMonotonicLng([h,d]):u=C.LngLatHelper.convertToMonotonicLng(C.LaneHelper.interpolateCoordinates(h,d,200));const p=x.lineString(u.map(b=>[b.lng,b.lat]));p.properties.dist=c,p.properties.bearing=m,p.properties.total=t,o.push(p)}e.push(...o),a.total=t}return this.handleRender(a),a},handleTmpPointUpdate(a,e,t,o){const i=x.featureCollection([]);let s,n;if(e){const h=e.properties,d={lng:e.geometry.coordinates[0],lat:e.geometry.coordinates[1]},c={lng:t.lng,lat:t.lat};s=C.LaneHelper.calculateDistance(d,c,h.mode==="RL",2),n=C.LaneHelper.calculateBearing(d,c,h.mode==="RL",2);let m;h.mode==="RL"?m=C.LngLatHelper.convertToMonotonicLng([d,c]):m=C.LngLatHelper.convertToMonotonicLng(C.LaneHelper.interpolateCoordinates(d,c,200));const u=x.lineString(m.map(p=>[p.lng,p.lat]));u.properties.dist=s,u.properties.bearing=n,i.features.push(u)}if(o){const h=t.properties,d=t,c={lng:o.geometry.coordinates[0],lat:o.geometry.coordinates[1]};s=C.LaneHelper.calculateDistance(d,c,h.mode==="RL",2),n=C.LaneHelper.calculateBearing(d,c,h.mode==="RL",2);let m;h.mode==="RL"?m=C.LngLatHelper.convertToMonotonicLng([d,c]):m=C.LngLatHelper.convertToMonotonicLng(C.LaneHelper.interpolateCoordinates(d,c,200));const u=x.lineString(m.map(p=>[p.lng,p.lat]));u.properties.dist=s,u.properties.bearing=n,i.features.push(u)}this.map.getSource(this.tmpSource)?this.map.getSource(this.tmpSource).setData(i):this.map.addSource(this.tmpSource,{type:"geojson",data:i}),this.map.getLayer(this.tmpLayer)||this.map.addLayer({id:this.tmpLayer,type:"line",source:this.tmpSource,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#F44336","line-width":2,"line-opacity":1,"line-dasharray":[3,2]}}),this.map.getLayer(this.tmpLabelLayer)||this.map.addLayer({id:this.tmpLabelLayer,type:"symbol",source:this.tmpSource,filter:["==","$type","LineString"],layout:{"symbol-placement":"line-center","text-field":"{dist} nm","text-rotation-alignment":"map","text-size":12},paint:{"text-opacity":1,"text-color":"#fff","text-halo-color":"#F44336","text-halo-width":4,"text-halo-blur":0}});let l;if(o?l='<div class="marker-label">Drag and drop</div>':l=`<div class="marker-label">Tol distance: <b>${C.LngLatHelper.roundPrecision((a.total??0)+s,2)}</b>nm, bearing: <b>${n}</b>°</div><div class="marker-label">${this.navigation==="RL"?"RL":"GC"} mode, using 'Shift' to switch</div><div class="marker-label">Double click to end</div>`,this.tipMarker)this.tipMarker._element.innerHTML=l,this.tipMarker.setLngLat([t.lng,t.lat]);else{const h=document.createElement("div");h.className="tip-marker",h.innerHTML=l,this.tipMarker=new O.Marker(h).setOffset([140,0]).setLngLat([t.lng,t.lat]).addTo(this.map)}},handleMove(a){this.map.getCanvas().style.cursor="crosshair";let e=this.geojson.at(-1);e||(e=x.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e));const t=e.features.filter(o=>o.geometry.type==="Point");t!=null&&t.length&&this.handleTmpPointUpdate(e,t.at(-1),{lng:a.lngLat.lng,lat:a.lngLat.lat})},handleDblClick(a){a.preventDefault();let e=this.geojson.at(-1);e.closed=!0,this.handleRender(e),e=x.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e)},handleRender(a){var e;if((e=a==null?void 0:a.features)!=null&&e.length){const t=`${a.id}-${this.source}`,o=`${a.id}-${this.layer}`,i=`${a.id}-${this.labelLayer}`;this.map.getSource(t)?this.map.getSource(t).setData(a):this.map.addSource(t,{type:"geojson",data:a}),this.handleClear(a,!1),this.map.addLayer({id:o,type:"line",source:t,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#F44336","line-width":2}}),this.map.addLayer({id:i,type:"symbol",source:t,filter:["==","$type","LineString"],layout:{"symbol-placement":"line-center","text-field":"{dist}nm,{bearing}°","text-rotation-alignment":"map","text-size":12},paint:{"text-opacity":1,"text-color":"#fff","text-halo-color":"#F44336","text-halo-width":4,"text-halo-blur":0}});const s=a.features.filter(n=>n.geometry.type==="Point");for(const n of s){const l=document.createElement("div");l.id=`${a.id}-${n.properties.id}`,l.className=`${a.closed?"point-marker closed":"point-marker"}`,l.innerHTML='<div class="marker-circle"></div>';const h=new O.Marker({element:l,draggable:!0,contextmenu:!0}).setLngLat(n.geometry.coordinates).addTo(this.map);h.on("drag",this.handleDrag),h.on("dragend",this.handleDragEnd),this.pointMarkers[a.id]?this.pointMarkers[a.id].push(h):this.pointMarkers[a.id]=[h]}if(a.closed){const n=s.at(-1),h=a.features.filter(c=>c.geometry.type==="LineString").at(-1),d=document.createElement("div");d.className="point-summary-marker",d.innerHTML=`<div id="${a.id}" class="marker-close">×</div><div class="marker-label">Tol: ${h.properties.total}nm</div>`,this.closeMarkers[a.id]=new O.Marker(d).setOffset([60,0]).setLngLat(n.geometry.coordinates).addTo(this.map)}}},handleClear(a,e=!0){var s,n,l,h,d,c,m,u,p;const t=`${a.id}-${this.source}`,o=`${a.id}-${this.layer}`,i=`${a.id}-${this.labelLayer}`;(s=this.map)!=null&&s.getLayer(o)&&this.map.removeLayer(o),(n=this.map)!=null&&n.getLayer(i)&&this.map.removeLayer(i),(l=this.map)!=null&&l.getLayer(this.tmpLayer)&&this.map.removeLayer(this.tmpLayer),(h=this.map)!=null&&h.getLayer(this.tmpLabelLayer)&&this.map.removeLayer(this.tmpLabelLayer),(d=this.closeMarkers[a.id])==null||d.remove(),this.closeMarkers[a.id]=void 0,(c=this.pointMarkers[a.id])==null||c.forEach(b=>{b==null||b.remove()}),this.pointMarkers[a.id]=[],(m=this.tipMarker)==null||m.remove(),this.tipMarker=void 0,e&&((u=this.map)!=null&&u.getSource(t))&&this.map.removeSource(t),e&&((p=this.map)!=null&&p.getSource(this.tmpSource))&&this.map.removeSource(this.tmpSource)}}};function ur(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const gr=k(fr,[["render",ur]]),Ur="",br={name:"IdmENC",props:{map:{type:Object},enabled:{type:Boolean},beforeLayer:{type:String,default:"grayland"},bottom:{type:String,default:"260px"},token:{type:String,default:""},toggleVersion:{type:Number},permission:{type:Number}},emits:["enc"],data(){return{helper:ce,vendor:this.$attrs.permission&ce.LEVEL.Supper?"hi":"i4",right:10}},watch:{vendor:{handler(){this.$emit("enc",this.vendor)},immediate:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{}},wr={key:0},Lr={class:"bar-item"};function vr(a,e,t,o,i,s){const n=r.resolveComponent("ElTooltip");return t.enabled&&t.permission&i.helper.LEVEL.Supper?(r.openBlock(),r.createElementBlock("div",wr,[r.createElementVNode("div",{class:"menu-bar-box",style:r.normalizeStyle({position:"absolute",right:i.right+"px",bottom:t.bottom})},[r.createElementVNode("div",Lr,[r.createVNode(n,{placement:"left",effect:"light",content:"Hifleet","show-after":1e3},{default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(i.vendor==="hi"?"menu-icon active":"menu-icon"),onClick:e[0]||(e[0]=l=>i.vendor="hi")},e[2]||(e[2]=[r.createElementVNode("span",{class:"iconfont"},"HI",-1)]),2)]),_:1}),r.createVNode(n,{placement:"left",effect:"light",content:"I4insight","show-after":1e3},{default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(i.vendor==="i4"?"menu-icon active":"menu-icon"),onClick:e[1]||(e[1]=l=>i.vendor="i4")},e[3]||(e[3]=[r.createElementVNode("span",{class:"iconfont"},"I4",-1)]),2)]),_:1})])],4)])):r.createCommentVNode("",!0)}const xr=k(br,[["render",vr],["__scopeId","data-v-5873cc66"]]),Zr="",_r={name:"IdmGLV2",components:{IdmGlLayer:Ke,IdmWindBarb:rt,IdmWindParticle:nt,IdmCurrents:dt,IdmCurrentParticle:ft,IdmSigWave:bt,IdmSwell:vt,IdmPrmsl:Ct,IdmIceberg:Et,IdmTropicals:be,IdmPrecip3h:Jt,IdmVisibility:Qt,IdmWaterTemp:aa,IdmTemp:sa,IdmArctic:ha,IdmWarZone:Ta,IdmGmdssArea:Ra,IdmEcaZone:Ba,IdmAlertZone:Fa,IdmPort:Ya,IdmLoadLine:er,IdmTimezone:rr,IdmVRA:sr,IdmSpecialArea:cr,IdmTerminator:mr,IdmLatLng:we,IdmMeasure:gr,IdmPoint:Pa,IdmENC:xr},props:{map:{type:Object,default:void 0},token:{type:String},ts:{type:String},beforeLayer:{type:String,default:""},toggleVersion:{type:Number}},emits:["toggleVersion","activeWeatherLayers"],data(){return{weatherLayers:{},activeWeatherLayers:[],weatherWeight:0,otherLayers:{},otherWeight:0,showCoord:!1,showMeasure:!1,showPoint:!1,show3d:!1,meteo:void 0,source:"",gateway:"https://cbe.idmwx.com",mapProjection:"mercator",zoom:6,viewport:void 0,particleFactor:void 0,showRampColor:!1,activeWindLayer:!1,showWindFeather:!1,showWindParticle:!1,showCurrentIsoband:!1,showCurrentParticle:!1,enc:"",defaultMeteoToken:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNseTVudHJzYzAwNWUwbHBsZHkyaDRqczMiLCJyb2xlIjoxLCJuYW1lIjoiZmFrZUBvcm13eC5jb20iLCJwbGF0SWQiOiJnZDBtdDFkIiwiY29tcGFueSI6eyJpZCI6bnVsbCwiY2hpbGRyZW4iOltdfSwiaWF0IjoxNzIzMDI0MDI0LCJleHAiOjM5MzA1NDQwMjR9.RrKcdcMnq-FxBLJQ-i6lx2FscDE46y8EvHIemPW4HTg",helper:new ve}},watch:{ts:{handler(a,e){a&&e&&B(a).utc().format("yyyy-MM-DD HH")!==B(e).utc().format("yyyy-MM-DD HH")&&this.$nextTick(()=>{this.handleDateChange({tropicals:!1})})},immediate:!0},map:{handler(){this.map&&(this.map.on("zoomend",this.handleDragEndWithZoom4Json),this.map.on("dragend",this.handleDragEndWithZoom4Json),this.map.on("move",this.handleDragEndWithZoom4Image),this.viewport=new ue(this.map),this.handleRampColorInitial())},immediate:!0},enc:{handler(a,e){var t,o,i,s,n,l,h,d;a?((o=(t=this.map)==null?void 0:t.getLayer(a))==null||o.setLayoutProperty("visibility","visible"),(s=(i=this.map)==null?void 0:i.getLayer(e))==null||s.setLayoutProperty("visibility","none")):((l=(n=this.map)==null?void 0:n.getLayer("i4"))==null||l.setLayoutProperty("visibility","none"),(d=(h=this.map)==null?void 0:h.getLayer("hi"))==null||d.setLayoutProperty("visibility","none"))}},activeWeatherLayers:{handler(){var a,e,t,o,i,s,n,l,h,d,c,m,u,p,b,f,y,w;if(!this.map)return!1;this.activeWeatherLayers.length>0?((e=(a=this.map)==null?void 0:a.getLayer(this.enc))==null||e.setLayoutProperty("visibility","none"),(o=(t=this.map)==null?void 0:t.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))==null||o.setLayoutProperty("visibility","visible"),(s=this.map)!=null&&s.getLayer((i=this.viewport)==null?void 0:i.rampColorLayer)&&((n=this.map)!=null&&n.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&this.mapProjection==="mercator"&&((h=this.map)==null||h.moveLayer((l=this.viewport)==null?void 0:l.rampColorLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)),(c=this.map)!=null&&c.getLayer((d=this.viewport)==null?void 0:d.particleLayer)&&((m=this.map)!=null&&m.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&this.mapProjection==="mercator"&&((p=this.map)==null||p.moveLayer((u=this.viewport)==null?void 0:u.particleLayer,this.helper.mapboxCustomer.layers.countryBoundary.id))):((f=(b=this.map)==null?void 0:b.getLayer(this.enc))==null||f.setLayoutProperty("visibility","visible"),(w=(y=this.map)==null?void 0:y.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))==null||w.setLayoutProperty("visibility","none")),this.$emit("activeWeatherLayers",this.activeWeatherLayers)},immediate:!0}},methods:{async fetchWeatherLayers(a={tropicals:!1}){var i,s,n,l,h,d,c,m;const e=new Date().valueOf();let t=0,o=0;if(this.map){const u=((i=this.map)==null?void 0:i.getZoom())+1,p=(s=this.map)==null?void 0:s.getBounds(),b=`${p._sw.lng},${p._sw.lat},${p._ne.lng},${p._ne.lat}`;if(this.handleRampColorState(),this.particleFactor){const f=he.WEATHER_LAYERS.find(y=>{var w;return((w=y.peer)==null?void 0:w.weight)===this.particleFactor.weight});this.particleFactor.particle?this.weatherWeight=this.weatherWeight&f.weight?this.weatherWeight:this.weatherWeight+f.weight:this.weatherWeight=this.weatherWeight&f.weight?this.weatherWeight-f.weight:this.weatherWeight}if(this.weatherWeight>0){let f=this.weatherWeight,y;if(a.tropicals||this.weatherWeight&256&&(y=this.weatherLayers.tropicals,y&&(f-=256,y.version=Math.random()+1)),f>0){const w=await U.get(`${this.gateway}/api/arc/weather/layers/links?l=${f}&v=${this.source}&z=${u}&bbox=${b}&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(o=new Date().valueOf()-(e+t),console.log("weather links elapsed: ",o,", total: ",t+=o),((n=w==null?void 0:w.data)==null?void 0:n.code)===0){const g=(l=w==null?void 0:w.data)==null?void 0:l.data,v=[];for(const L in g)L==="ice-edge"&&(g[L]="https://idm-hz.oss-cn-hangzhou.aliyuncs.com/test/sea_ice_contours.geojson"),L!=="tropicals"&&v.push(U.get(g[L],{headers:{Authorization:this.token||this.defaultMeteoToken,key:L},responseType:/\.(jpg|png)$/.test(g[L])?"blob":"json"}).catch(z=>{console.log(`[${L}] fetch layer error: ${z}`)}));const _=await Promise.all(v);this.weatherLayers={},_.map(L=>{var V,R,D,M;const z=((V=L==null?void 0:L.data)==null?void 0:V.data)||(L==null?void 0:L.data),N=(D=(R=L==null?void 0:L.config)==null?void 0:R.headers)==null?void 0:D.key;N&&z&&(this.weatherLayers[N]={raw:z,type:((M=L==null?void 0:L.config)==null?void 0:M.responseType)==="blob"?"image":"json",etime:this.ts})}),g.tropicals&&U.get(g.tropicals,{headers:{Authorization:this.token||this.defaultMeteoToken,key:"tropicals"}}).then(L=>{var V,R,D;const z=C.TropicalHelper.convert2Geojson(((V=L==null?void 0:L.data)==null?void 0:V.data)||(L==null?void 0:L.data)),N=(D=(R=L==null?void 0:L.config)==null?void 0:R.headers)==null?void 0:D.key;this.weatherLayers[N]={data:z,active:!0,cached:!1,type:"json",etime:this.ts,version:Math.random()+1}})}if(o=new Date().valueOf()-(e+t),console.log("weather layers elapsed: ",o,", total: ",t+=o),this.weatherLayers["swell-direction"]||this.weatherLayers["swell-height"]){const g=(h=this.weatherLayers["swell-direction"])==null?void 0:h.raw,v=(d=this.weatherLayers["swell-height"])==null?void 0:d.raw;delete this.weatherLayers["swell-direction"],delete this.weatherLayers["swell-height"],this.weatherLayers.swell={type:"json",direction:g,height:{raw:v},etime:this.ts}}if(this.weatherLayers["current-direction"]||this.weatherLayers["current-speed"]){const g=(c=this.weatherLayers["current-direction"])==null?void 0:c.raw,v=(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:g,speed:{raw:v},etime:this.ts}}}y&&(y.etime=this.ts,y.cached=!0,this.weatherLayers.tropicals=y)}this.handleWeatherLayerToggle(),this.handleDragEndWithZoom4Json()}this.$emit("toggleVersion",Math.random())},async fetchOtherLayers(a={all:!1,dayNight:!1,enc:!1}){var e,t,o,i;if(this.map){let s=this.otherWeight;if(s){let n=!1;if(this.otherWeight&2048&&(s=this.otherWeight-2048,n=!0),s){if(a.all){const l=await U.get(`${this.gateway}/api/arc/other/layers/links?l=${s}&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(((e=l==null?void 0:l.data)==null?void 0:e.code)===0){const h=(t=l==null?void 0:l.data)==null?void 0:t.data,d=[];for(const m in h)d.push(U.get(h[m],{headers:{Authorization:this.token||this.defaultMeteoToken,key:m}}));const c=await Promise.all(d);this.otherLayers={enc:n},c.map(m=>{var b,f,y;const u=((b=m==null?void 0:m.data)==null?void 0:b.data)||(m==null?void 0:m.data),p=(y=(f=m==null?void 0:m.config)==null?void 0:f.headers)==null?void 0:y.key;this.otherLayers[p]=u})}}else if(a.dayNight&&s&1024){const l=await U.get(`${this.gateway}/api/arc/other/layers/links?l=1024&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(((o=l==null?void 0:l.data)==null?void 0:o.code)===0){const h=(i=l==null?void 0:l.data)==null?void 0:i.data,d=[];for(const m in h)d.push(U.get(h[m],{headers:{Authorization:this.token||this.defaultMeteoToken,key:m}}));(await Promise.all(d)).map(m=>{var b,f,y;const u=((b=m==null?void 0:m.data)==null?void 0:b.data)||(m==null?void 0:m.data),p=(y=(f=m==null?void 0:m.config)==null?void 0:f.headers)==null?void 0:y.key;this.otherLayers[p]=u})}}}else this.otherLayers={enc:n}}else this.otherLayers={};this.handleBeforeLayerToggle()}},handleRampColorState(){var a;if(this.showRampColor=!1,this.showWindParticle=!1,this.showCurrentParticle=!1,(a=this.particleFactor)!=null&&a.particle)this.showRampColor=!0,this.showWindParticle=this.particleFactor.key==="wind",this.showCurrentParticle=this.particleFactor.key==="current",this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.type==="json");else for(const e of this.activeWeatherLayers)["png","jpg"].includes(e.type)&&(this.showRampColor=!0);this.activeWindLayer=!!this.activeWeatherLayers.find(e=>e.key==="wind"),this.$refs.layer&&(this.$refs.layer.activeWeatherLayers=this.activeWeatherLayers)},handleRampColorInitial(){var a,e,t,o,i,s,n,l,h,d,c,m;this.viewport.map.getSource((a=this.viewport)==null?void 0:a.rampColorSource)||this.viewport.map.addSource((e=this.viewport)==null?void 0:e.rampColorSource,{type:"canvas",canvas:(t=this.viewport)==null?void 0:t.rampColorCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((o=this.viewport)==null?void 0:o.rampColorLayer)||this.viewport.map.addLayer({type:"raster",id:(i=this.viewport)==null?void 0:i.rampColorLayer,source:(s=this.viewport)==null?void 0:s.rampColorSource,layout:{visibility:"none"}},this.beforeLayer),this.viewport.map.getSource((n=this.viewport)==null?void 0:n.particleSource)||this.viewport.map.addSource((l=this.viewport)==null?void 0:l.particleSource,{type:"canvas",canvas:(h=this.viewport)==null?void 0:h.particleCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((d=this.viewport)==null?void 0:d.particleLayer)||this.viewport.map.addLayer({type:"raster",id:(c=this.viewport)==null?void 0:c.particleLayer,source:(m=this.viewport)==null?void 0:m.particleSource,layout:{visibility:"none"}},this.beforeLayer)},handleDragEndWithZoom4Json(){var d,c,m,u;const a=new Date().valueOf();let e=0,t=0;const o=(d=this.map)==null?void 0:d.getBounds(),i=this.map.getZoom(),s=C.LngLatHelper.convertToStdLng(o._sw.lng),n=C.LngLatHelper.convertToStdLng(o._ne.lng),l=Math.floor(o._sw.lat),h=Math.ceil(o._ne.lat);for(const p in this.weatherLayers)if(this.weatherLayers[p].active&&this.weatherLayers[p].type==="json"){this.weatherLayers[p].active=!1,this.weatherLayers[p].version=Math.random()+1;let b=[];if(["swell","current"].includes(p)){const f=((c=this.weatherLayers[p])==null?void 0:c.direction)||{};for(const y in f)if(y>l&&y<h&&(!(i<=this.zoom)||y%(i<this.zoom/2?5:3)===0)){const w=f[y].lng;s>n?w.forEach((g,v)=>{var _;if((g>=s&&g<=180||g>=-180&&g<=n)&&(!(i<=this.zoom)||g%(i<this.zoom/2?5:3)===0)){const L=x.point([g,y],{val:f[y].val[v],spd:(_=f[y].spd)==null?void 0:_[v]});b.push(L)}}):w.forEach((g,v)=>{var _;if(g>=s&&g<=n&&(!(i<=this.zoom)||g%(i<this.zoom/2?5:3)===0)){const L=x.point([g,y],{val:f[y].val[v],spd:(_=f[y].spd)==null?void 0:_[v]});b.push(L)}})}if(t=new Date().valueOf()-(a+e),console.log("direction elapsed: ",t,", total: ",e+=t),p==="swell"){const y=this.weatherLayers[p].height;if(y){if(!y.data){const w=[];for(const g in(m=y.raw)==null?void 0:m.LineString){const v=y.raw.LineString[g];for(const _ of v)w.push(x.lineString(_,{val:Number(g)}));y.data=x.featureCollection(w)}}if(y.data){const w=this.handleBboxClip(y.data,o);b=b.concat(w)}t=new Date().valueOf()-(a+e),console.log("height elapsed: ",t,", total: ",e+=t)}}if(p==="current"){const y=this.weatherLayers[p].speed;if(y){if(!y.data){const g=[];for(const v in(u=y.raw)==null?void 0:u.Polygon){const _=y.raw.Polygon[v];for(const L of _)g.push(x.polygon(L,{val:Number(v)}))}y.data=x.featureCollection(g)}const w=i<this.zoom?y.data.features.filter(g=>g.properties.val>.5):y.data.features;b=b.concat(w),t=new Date().valueOf()-(a+e),console.log("speed elapsed: ",t,", total: ",e+=t)}}}else if(p==="wind"){const f=this.weatherLayers.wind.raw;for(const y in f)if(y>l&&y<h&&(!(i<=this.zoom)||y%(i<this.zoom/2?5:3)===0)){const w=f[y].lng;s>n?w.forEach((g,v)=>{if((g>=s&&g<=180||g>=-180&&g<=n)&&(!(i<=this.zoom)||g%(i<this.zoom/2?5:3)===0)){const _=x.point([g,y],{val:f[y].val[v],spd:f[y].spd[v]});b.push(_)}}):w.forEach((g,v)=>{if(g>=s&&g<=n&&(!(i<=this.zoom)||g%(i<this.zoom/2?5:3)===0)){const _=x.point([g,y],{val:f[y].val[v],spd:f[y].spd[v]});b.push(_)}})}t=new Date().valueOf()-(a+e),console.log("wind barb elapsed: ",t,", total: ",e+=t)}else if(p==="sig-wave-height"){if(this.weatherLayers[p].data)b=this.weatherLayers[p].data;else{const f=this.weatherLayers[p].raw;if(f){const y=[];for(const w in f.Polygon){const g=f.Polygon[w];for(const v of g)y.push(x.polygon(v,{val:Number(w)}))}for(const w in f.Point){const g=f.Point[w];for(const v of g)y.push(...x.points(v,{val:Number(w)}).features)}b=b.concat(y)}}t=new Date().valueOf()-(a+e),console.log("sigWave elapsed: ",t,", total: ",e+=t)}else if(p==="prmsl"){if(this.weatherLayers[p].data)b=this.weatherLayers[p].data;else{const f=this.weatherLayers[p].raw;if(f){const y=[];for(const w in f.LineString){const g=f.LineString[w];for(const v of g)y.push(x.lineString(v,{val:Number(w)}))}for(const w in f.Point)f.Point[w].lng.forEach((g,v)=>{g=C.LngLatHelper.convertToStdLng(g),y.push(x.point([g,w],{val:f.Point[w].val[v],type:f.Point[w].type[v]}))});b=b.concat(y)}}t=new Date().valueOf()-(a+e),console.log("prmsl elapsed: ",t,", total: ",e+=t)}else if(p==="arctic"||p==="iceberg"){if(this.weatherLayers[p].data)b=this.weatherLayers[p].data;else{const f=this.weatherLayers[p].raw;if(f){const y=[];for(const w in f.LineString){const g=f.LineString[w];for(const v of g)y.push(x.lineString(v,{val:Number(w)}))}b=b.concat(y)}}t=new Date().valueOf()-(a+e)}console.log(p," elapsed: ",t,", total: ",e+=t),b.length&&(this.weatherLayers[p].data=x.featureCollection(b)),this.weatherLayers[p].active=!0,this.weatherLayers[p].version=Math.random()+1}},handleDragEndWithZoom4Image(){for(const a in this.weatherLayers)this.weatherLayers[a].active&&this.weatherLayers[a].type==="image"&&(this.weatherLayers[a].active=!0,this.weatherLayers[a].version=Math.random()+1)},handleBboxClip(a,e){const t=[],o=C.LngLatHelper.convertToStdLng(e._sw.lng),i=C.LngLatHelper.convertToStdLng(e._ne.lng);return a.features.forEach(s=>{if(s.geometry.type!=="Point")if(o>i){let n=[o,e._sw.lat,180,e._ne.lat],l=x.bboxClip(s,n);l.geometry.coordinates.length&&t.push(l),n=[-180,e._sw.lat,i,e._ne.lat],l=x.bboxClip(s,n),l.geometry.coordinates.length&&t.push(l)}else{const n=[o,e._sw.lat,i,e._ne.lat],l=x.bboxClip(s,n);l.geometry.coordinates.length&&t.push(l)}else t.push(s)}),t},handleWeatherLayerToggle(){var a;for(const e in this.weatherLayers)this.weatherLayers[e].active=!1,this.weatherLayers[e].version=Math.random()+1;for(const e of this.activeWeatherLayers){let t=e.key;t.indexOf("swell")>-1?t="swell":t.indexOf("current")>-1&&(t="current"),this.weatherLayers[t]&&(this.weatherLayers[t].active=!0,this.weatherLayers[t].version=Math.random()+1,((a=this.particleFactor)==null?void 0:a.key)===t&&this.weatherLayers[`${t}-particle`]&&(this.weatherLayers[`${t}-particle`].active=this.particleFactor.particle))}this.handleBeforeLayerToggle()},handleBeforeLayerToggle(){var a,e,t,o,i,s,n,l,h,d,c,m,u;(a=this.map)!=null&&a.getLayer(this.beforeLayer)&&((e=this.activeWeatherLayers)!=null&&e.length||(t=this.otherLayers)!=null&&t["war-zones"]||(o=this.otherLayers)!=null&&o["gmdss-areas"]||(i=this.otherLayers)!=null&&i["load-lines"]||(s=this.otherLayers)!=null&&s["high-risk-area"]||(n=this.otherLayers)!=null&&n["time-zones"]||(l=this.otherLayers)!=null&&l.pirates||(h=this.otherLayers)!=null&&h.ports||(d=this.otherLayers)!=null&&d.enc||(c=this.otherLayers)!=null&&c["voluntary-reporting-area"]||(m=this.otherLayers)!=null&&m["eca-zones"]||(u=this.otherLayers)!=null&&u["special-area"])&&this.map.setLayoutProperty(this.beforeLayer,"visibility","visible")},handleDateChange(a={tropicals:!1}){this.fetchWeatherLayers(a),this.fetchOtherLayers({dayNight:!0})},handleWeatherLayerChange(a,e){if(!this.map)setTimeout(()=>{this.handleWeatherLayerChange(a,e)},500);else{this.activeWeatherLayers=a;const t=this.activeWeatherLayers.some(s=>{var n;return["wind","current"].includes(s.key)&&(!((n=Object.keys(s))!=null&&n.some(l=>l==="particle"))||!!s.particle)}),o=this.activeWeatherLayers.some(s=>["png","jpg"].includes(s.type));t&&!o?(this.activeWeatherLayers.forEach(s=>{["wind","current"].includes(s.key)&&(this.particleFactor=s)}),this.particleFactor.particle=!0):o&&this.particleFactor&&(this.particleFactor.particle=!1);const i=a==null?void 0:a.reduce((s,n)=>s+(s&(n==null?void 0:n.weight)?0:n==null?void 0:n.weight),0);this.weatherWeight!==i||this.source!==e?(this.source=e,this.weatherWeight=i,this.fetchWeatherLayers({tropicals:!1})):this.handleWeatherLayerToggle()}},handleOtherLayerChange(a){if(!this.map)setTimeout(()=>{this.handleOtherLayerChange(a)},500);else{const e=a==null?void 0:a.reduce((t,o)=>t+(o==null?void 0:o.weight),0);a.find(t=>t.key==="enc")?this.enc="i4":this.enc="",this.otherWeight!=e&&(this.otherWeight=e,this.fetchOtherLayers({all:!0}))}},async handlePointChange(a){const e=this.ts?B(this.ts):B(),t={lat:a.lat,lng:a.lng,ts:e.utc().format(),wt:!0,src:this.source},o=await U.get(`${this.gateway}/api/arc/meteo/query`,{params:t,headers:{Authorization:this.token||this.defaultMeteoToken}});(o==null?void 0:o.status)===200&&(this.meteo={...o==null?void 0:o.data,...a})},handle3dToggle(a){var e,t,o,i,s,n,l,h,d,c,m,u,p,b,f,y,w,g,v,_;a?(this.map.setProjection("globe"),this.mapProjection="globe",(t=this.map)!=null&&t.getLayer((e=this.viewport)==null?void 0:e.rampColorLayer)&&((o=this.map)!=null&&o.getLayer(this.helper.mapboxCustomer.layers.water.id))&&((s=this.map)==null||s.moveLayer((i=this.viewport)==null?void 0:i.rampColorLayer,this.helper.mapboxCustomer.layers.water.id)),(l=this.map)!=null&&l.getLayer((n=this.viewport)==null?void 0:n.particleLayer)&&((h=this.map)!=null&&h.getLayer(this.helper.mapboxCustomer.layers.water.id))&&((c=this.map)==null||c.moveLayer((d=this.viewport)==null?void 0:d.particleLayer,this.helper.mapboxCustomer.layers.water.id)),this.map.off("zoomend",this.handleDragEndWithZoom4Json),this.map.off("dragend",this.handleDragEndWithZoom4Json),this.map.off("move",this.handleDragEndWithZoom4Image)):(this.map.setProjection("mercator"),this.mapProjection="mercator",this.map.on("zoomend",this.handleDragEndWithZoom4Json),this.map.on("dragend",this.handleDragEndWithZoom4Json),this.map.on("move",this.handleDragEndWithZoom4Image),this.handleDragEndWithZoom4Image(),this.handleDragEndWithZoom4Json(),(u=this.map)!=null&&u.getLayer((m=this.viewport)==null?void 0:m.rampColorLayer)&&((p=this.map)!=null&&p.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&((f=this.map)==null||f.moveLayer((b=this.viewport)==null?void 0:b.rampColorLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)),(w=this.map)!=null&&w.getLayer((y=this.viewport)==null?void 0:y.particleLayer)&&((g=this.map)!=null&&g.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&((_=this.map)==null||_.moveLayer((v=this.viewport)==null?void 0:v.particleLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)))},handleParticle(a){this.particleFactor=a,this.weatherLayers[a.key]&&(this.weatherLayers[a.key].particle=a.particle),this.activeWeatherLayers.forEach(o=>{o.key===a.key&&(o.particle=a.particle)});let e=localStorage.getItem("weatherLayersCache");const t=JSON.parse(e)||[];t==null||t.forEach(o=>{o.key===a.key&&(o.particle=a.particle)}),localStorage.setItem("weatherLayersCache",JSON.stringify(t)),this.fetchWeatherLayers({tropicals:!1})},handleToggleVersion(){this.$emit("toggleVersion",Math.random())}}},Cr={key:0,className:"map-gl-home"};function kr(a,e,t,o,i,s){var G,j,F,oe,$,S,A,se,H,ne,J,X,q,de,me,pe,ye,fe,Le,_e,Ce,ke,Se,Ee,Pe,ze;const n=r.resolveComponent("IdmGlLayer"),l=r.resolveComponent("IdmENC"),h=r.resolveComponent("IdmSigWave"),d=r.resolveComponent("IdmSwell"),c=r.resolveComponent("IdmPrmsl"),m=r.resolveComponent("IdmIceberg"),u=r.resolveComponent("IdmTropicals"),p=r.resolveComponent("IdmCurrents"),b=r.resolveComponent("IdmCurrentParticle"),f=r.resolveComponent("IdmWindBarb"),y=r.resolveComponent("IdmWindParticle"),w=r.resolveComponent("IdmPrecip3h"),g=r.resolveComponent("IdmVisibility"),v=r.resolveComponent("IdmWaterTemp"),_=r.resolveComponent("IdmTemp"),L=r.resolveComponent("IdmArctic"),z=r.resolveComponent("IdmWarZone"),N=r.resolveComponent("IdmGmdssArea"),V=r.resolveComponent("IdmEcaZone"),R=r.resolveComponent("IdmAlertZone"),D=r.resolveComponent("IdmPort"),M=r.resolveComponent("IdmLoadLine"),Q=r.resolveComponent("IdmTimezone"),K=r.resolveComponent("IdmVRA"),ee=r.resolveComponent("IdmSpecialArea"),te=r.resolveComponent("IdmTerminator"),ae=r.resolveComponent("IdmLatLng"),re=r.resolveComponent("IdmMeasure"),ie=r.resolveComponent("IdmPoint");return t.map?(r.openBlock(),r.createElementBlock("div",Cr,[r.createVNode(n,r.mergeProps({ref:"layer",map:t.map,"toggle-version":t.toggleVersion,"map-projection":i.mapProjection,showWindFeather:i.showWindFeather,showWindParticle:i.showWindParticle,showCurrentIsoband:i.showCurrentIsoband,showCurrentParticle:i.showCurrentParticle},a.$attrs,{onWeather:s.handleWeatherLayerChange,onOther:s.handleOtherLayerChange,onCoordinate:e[0]||(e[0]=W=>i.showCoord=W),onMeasure:e[1]||(e[1]=W=>i.showMeasure=W),onPoint:e[2]||(e[2]=W=>i.showPoint=W),on3d:s.handle3dToggle,onHandleToggleVersion:s.handleToggleVersion}),null,16,["map","toggle-version","map-projection","showWindFeather","showWindParticle","showCurrentIsoband","showCurrentParticle","onWeather","onOther","on3d","onHandleToggleVersion"]),r.createVNode(l,r.mergeProps({map:t.map,token:t.token,enabled:(G=i.otherLayers)==null?void 0:G.enc,"toggle-version":t.toggleVersion},a.$attrs,{onEnc:e[3]||(e[3]=W=>i.enc=W)}),null,16,["map","token","enabled","toggle-version"]),r.createVNode(h,r.mergeProps({map:t.map,"sig-wave":(j=i.weatherLayers)==null?void 0:j["sig-wave-height"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","sig-wave","before-layer"]),r.createVNode(d,r.mergeProps({map:t.map,swell:(F=i.weatherLayers)==null?void 0:F.swell,"before-layer":t.beforeLayer},a.$attrs),null,16,["map","swell","before-layer"]),r.createVNode(c,r.mergeProps({map:t.map,prmsl:(oe=i.weatherLayers)==null?void 0:oe.prmsl,"before-layer":t.beforeLayer,"active-weather-layers":i.activeWeatherLayers},a.$attrs),null,16,["map","prmsl","before-layer","active-weather-layers"]),r.createVNode(m,r.mergeProps({map:t.map,iceberg:($=i.weatherLayers)==null?void 0:$.iceberg,"before-layer":t.beforeLayer},a.$attrs),null,16,["map","iceberg","before-layer"]),r.createVNode(u,r.mergeProps({map:t.map,date:t.ts,tropicals:(S=i.weatherLayers)==null?void 0:S.tropicals,"before-layer":t.beforeLayer},a.$attrs),null,16,["map","date","tropicals","before-layer"]),r.createVNode(p,r.mergeProps({map:t.map,"map-projection":i.mapProjection,current:(A=i.weatherLayers)==null?void 0:A.current,"before-layer":t.beforeLayer,"show-particle":i.showCurrentParticle,"margin-bottom":i.activeWindLayer?i.showRampColor?"84px":"56px":i.showRampColor?"56px":"30px","toggle-version":t.toggleVersion,"weather-layers":i.weatherLayers},a.$attrs,{onShowCurrentIsoband:e[4]||(e[4]=W=>i.showCurrentIsoband=W),onParticle:s.handleParticle,onHandleToggleVersion:s.handleToggleVersion}),null,16,["map","map-projection","current","before-layer","show-particle","margin-bottom","toggle-version","weather-layers","onParticle","onHandleToggleVersion"]),r.createVNode(b,r.mergeProps({viewport:i.viewport,factor:(se=i.weatherLayers)==null?void 0:se["current-particle"],"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),r.createVNode(f,r.mergeProps({ref:"windBarb",map:t.map,"map-projection":i.mapProjection,wind:(H=i.weatherLayers)==null?void 0:H.wind,current:(ne=i.weatherLayers)==null?void 0:ne.current,"before-layer":t.beforeLayer,"margin-bottom":i.showRampColor?"56px":"30px","show-particle":i.showWindParticle},a.$attrs,{"toggle-version":t.toggleVersion,"weather-layers":i.weatherLayers,onParticle:s.handleParticle,onShowWindFeather:e[5]||(e[5]=W=>i.showWindFeather=W)}),null,16,["map","map-projection","wind","current","before-layer","margin-bottom","show-particle","toggle-version","weather-layers","onParticle"]),r.createVNode(y,r.mergeProps({viewport:i.viewport,factor:(J=i.weatherLayers)==null?void 0:J["wind-particle"],"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),r.createVNode(w,r.mergeProps({viewport:i.viewport,factor:(X=i.weatherLayers)==null?void 0:X.precip3h,"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),r.createVNode(g,r.mergeProps({viewport:i.viewport,factor:(q=i.weatherLayers)==null?void 0:q.visibility,"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),r.createVNode(v,r.mergeProps({viewport:i.viewport,factor:(de=i.weatherLayers)==null?void 0:de["water-temp"],"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),r.createVNode(_,r.mergeProps({viewport:i.viewport,factor:(me=i.weatherLayers)==null?void 0:me.temp,"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),r.createVNode(L,r.mergeProps({viewport:i.viewport,factor:(pe=i.weatherLayers)==null?void 0:pe.arctic,"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),r.createVNode(z,r.mergeProps({map:t.map,zone:(ye=i.otherLayers)==null?void 0:ye["war-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),r.createVNode(N,r.mergeProps({map:t.map,area:(fe=i.otherLayers)==null?void 0:fe["gmdss-areas"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","area","before-layer"]),r.createVNode(V,r.mergeProps({map:t.map,zone:(Le=i.otherLayers)==null?void 0:Le["eca-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),r.createVNode(R,r.mergeProps({map:t.map,zone:(_e=i.otherLayers)==null?void 0:_e["alert-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),r.createVNode(D,r.mergeProps({map:t.map,port:(Ce=i.otherLayers)==null?void 0:Ce.ports,"before-layer":t.beforeLayer},a.$attrs),null,16,["map","port","before-layer"]),r.createVNode(M,r.mergeProps({map:t.map,line:(ke=i.otherLayers)==null?void 0:ke["load-lines"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","line","before-layer"]),r.createVNode(Q,r.mergeProps({map:t.map,zone:(Se=i.otherLayers)==null?void 0:Se["time-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),r.createVNode(K,r.mergeProps({map:t.map,area:(Ee=i.otherLayers)==null?void 0:Ee["voluntary-reporting-area"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","area","before-layer"]),r.createVNode(ee,r.mergeProps({map:t.map,area:(Pe=i.otherLayers)==null?void 0:Pe["special-area"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","area","before-layer"]),r.createVNode(te,r.mergeProps({map:t.map,area:(ze=i.otherLayers)==null?void 0:ze["day-night"]},a.$attrs),null,16,["map","area"]),r.createVNode(ae,r.mergeProps({map:t.map,show:i.showCoord,"toggle-version":t.toggleVersion},a.$attrs),null,16,["map","show","toggle-version"]),r.createVNode(re,r.mergeProps({map:t.map,show:i.showMeasure},a.$attrs),null,16,["map","show"]),r.createVNode(ie,r.mergeProps({map:t.map,show:i.showPoint,meteo:i.meteo},a.$attrs,{onPoint:s.handlePointChange}),null,16,["map","show","meteo","onPoint"])])):r.createCommentVNode("",!0)}const xe=k(_r,[["render",kr]]),Sr={install(a){a.component("MapboxGL",xe),a.component("TropicalGL",be),a.component("LatLngGL",we)}};E.LatLngGL=we,E.MapboxGL=xe,E.MapboxGLPlugin=Sr,E.MapboxHelper=ve,E.ParticleSchema=I,E.TropicalGL=be,E.Viewport=ue,E.WebGL=Z,E.WebGLSchema=T,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
204
+ </svg>`,H=document.createElement("div");H.className="hurricane-hourly-marker",H.innerHTML=`<div class="${S.geometry.coordinates[1]>=0?"center north":"center south"}">${se}</div>`;const ne=new O.Marker(H).setLngLat(S.geometry.coordinates).addTo(this.map);if(this.interpolateMarkers.push(ne),(Q=S.properties)!=null&&Q.showCircle){const J={radius:100,coordinates:S.geometry.coordinates},X={radius:200,coordinates:S.geometry.coordinates},q={radius:500,coordinates:S.geometry.coordinates};(K=this.circleSourceData)==null||K.features.push(x.circle(J.coordinates,J.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}})),(ee=this.circleSourceData)==null||ee.features.push(x.circle(X.coordinates,X.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}})),(te=this.circleSourceData)==null||te.features.push(x.circle(q.coordinates,q.radius,{steps:100,units:"kilometers",properties:{type:"tropicalCircle"}}))}(re=(ae=this.map)==null?void 0:ae.getSource(this.circleSource))==null||re.setData(this.circleSourceData)}}else(ie=this.map)!=null&&ie.getSource(this.interpolateSource)&&((G=this.map)==null||G.getSource(this.interpolateSource).setData(this.empty))},handleClick(a){var s,n,l,h,d,c,m,u;const e=a.features[0],t=(n=(s=this.tropicals)==null?void 0:s.data)==null?void 0:n.features.filter(p=>{var b;return p.geometry.type==="LineString"&&p.properties.type==="forecast"&&p.properties.name===((b=e==null?void 0:e.properties)==null?void 0:b.name)});t.sort((p,b)=>{var f,y,w,g;return((f=p.properties)==null?void 0:f.model)==="cma"?-1:((y=p.properties)==null?void 0:y.model)==="jma"?((w=b.properties)==null?void 0:w.model)==="cma"?1:-1:p.properties.model==="ecmwf"?["jma","cma"].includes((g=b.properties)==null?void 0:g.model)?1:-1:0});const o=(h=(l=this.tropicals)==null?void 0:l.data)==null?void 0:h.features.filter(p=>{var b;return p.geometry.type==="LineString"&&p.properties.type==="history"&&p.properties.name===((b=e==null?void 0:e.properties)==null?void 0:b.name)});this.activeTropicals={name:(d=e==null?void 0:e.properties)==null?void 0:d.name,forecasts:t.map(p=>p.properties),history:(c=o[0])==null?void 0:c.properties,showCircle:(u=(m=t[0])==null?void 0:m.properties)==null?void 0:u.showCircle},this.showTropicals=!0;const i=document.getElementById("active-tropical");this.activeTropicalsMarker?this.activeTropicalsMarker.setLngLat([a.lngLat.lng,a.lngLat.lat]):this.activeTropicalsMarker=new O.Marker(i).setLngLat([a.lngLat.lng,a.lngLat.lat]).setOffset([220,0]).addTo(this.map)},handleForecastToggle(a){var o,i,s,n,l,h;a.disabled=!a.disabled;const e=`${a.name}-${a.model}`,t=(i=(o=this.map)==null?void 0:o.getSource(this.source)._data)==null?void 0:i.features;t.forEach(d=>{d.properties.category===e&&(d.properties.disabled=a.disabled)}),this.interpolateData.forEach(d=>{d.properties.category===e&&(d.properties.disabled=a.disabled)}),(n=(s=this.map)==null?void 0:s.getSource(this.source))==null||n.setData(x.featureCollection(t)),(h=(l=this.map)==null?void 0:l.getSource(this.clusterSource))==null||h.setData(x.featureCollection(t)),this.handleDateChange()},handleStrikeProbability(a){this.$emit("tropicalProbability",a)},handleToggleCircles(a){var e,t;a.showCircle=!a.showCircle,(t=(e=this.tropicals.data)==null?void 0:e.features)==null||t.forEach(o=>{o.properties.name===a.name&&(o.properties.showCircle=a.showCircle)}),this.handleRender()},handleDrawCircle(){var a,e;(a=this.map)!=null&&a.getSource(this.circleSource)?(e=this.map)==null||e.getSource(this.circleSource).setData(this.circleSourceData):(this.map.addSource(this.circleSource,{type:"geojson",data:this.circleSourceData}),this.map.addLayer({id:this.circleLayer,type:"line",source:this.circleSource,filter:["all",["==","$type","Polygon"],["==","type","tropicalCircle"]],paint:{"line-color":"#fff","line-width":2,"line-opacity":1,"line-dasharray":[1,1]}}))},handleComputePolygons(a){const e=[];for(const t of a){const o=t.properties.wind,i={ne:o.r7ne>=0?o.r7ne:void 0,se:o.r7se>=0?o.r7se:void 0,sw:o.r7sw>=0?o.r7sw:void 0,nw:o.r7nw>=0?o.r7nw:void 0},s=this.handleComputeArc(t.geometry.coordinates,i,{...t.properties,level:7});e.push(s);const n={ne:o.r10ne>=0?o.r10ne:void 0,se:o.r10se>=0?o.r10se:void 0,sw:o.r10sw>=0?o.r10sw:void 0,nw:o.r10nw>=0?o.r10nw:void 0},l=this.handleComputeArc(t.geometry.coordinates,n,{...t.properties,level:10});e.push(l)}return e},handleComputeArc(a,e,t){var s;const o=[];for(const n in e){const l=e[n]??0;let h;switch(n){case"ne":h=x.lineArc(a,l*1.852,0,90,{steps:l>0?64:1});break;case"se":h=x.lineArc(a,l*1.852,90,180,{steps:l>0?64:1});break;case"sw":h=x.lineArc(a,l*1.852,180,270,{steps:l>0?64:1});break;case"nw":h=x.lineArc(a,l*1.852,270,360,{steps:l>0?64:1});break}o.push(...(s=h==null?void 0:h.geometry)==null?void 0:s.coordinates)}const i=x.lineString(o);return x.lineToPolygon(i,{properties:t})}}},Nt={id:"active-tropical",class:"active-tropical"},Tt={class:"header-box"},Vt={class:"main"},It={key:0},Rt={class:"sub"},Dt={id:"meteoBox",class:"main-box"},At={class:"content"},Bt={class:"row"},Mt={class:"col col-left",style:{"justify-content":"flex-start"}},jt={class:"col col-right",style:{"justify-content":"flex-start"}},Wt={class:"row"},Ot={class:"col col-24",style:{"justify-content":"flex-start"}},Ft={class:"forecast-models"},$t=["onClick"],Ht={class:"more"};function Ut(a,e,t,o,i,s){var n,l,h,d,c,m,u,p,b,f,y,w,g,v,_;return r.withDirectives((r.openBlock(),r.createElementBlock("div",Nt,[r.createElementVNode("div",Tt,[r.createElementVNode("div",{class:"iconfont close-btn",onClick:e[0]||(e[0]=L=>i.showTropicals=!1)},""),r.createElementVNode("div",Vt,[(l=(n=i.activeTropicals)==null?void 0:n.history)!=null&&l.level?(r.openBlock(),r.createElementBlock("span",It,r.toDisplayString((d=(h=i.activeTropicals)==null?void 0:h.history)==null?void 0:d.level)+" , ",1)):r.createCommentVNode("",!0),r.createTextVNode(r.toDisplayString((c=i.activeTropicals)==null?void 0:c.name),1)]),r.createElementVNode("div",Rt," Last update: "+r.toDisplayString(s.computeTime(((u=(m=i.activeTropicals)==null?void 0:m.history)==null?void 0:u.updated)||((f=(b=(p=i.activeTropicals)==null?void 0:p.forecasts)==null?void 0:b.filter(L=>!L.disabled)[0])==null?void 0:f.date))),1)]),r.createElementVNode("div",Dt,[r.createElementVNode("div",At,[r.createElementVNode("div",Bt,[r.createElementVNode("div",Mt,[e[2]||(e[2]=r.createElementVNode("label",null,"Wind speed : ",-1)),r.createElementVNode("span",null,r.toDisplayString(((w=(y=i.activeTropicals)==null?void 0:y.history)==null?void 0:w.kts)||"-")+"[kts]",1)]),r.createElementVNode("div",jt,[e[3]||(e[3]=r.createElementVNode("label",null,"Pressure : ",-1)),r.createElementVNode("span",null,r.toDisplayString(((v=(g=i.activeTropicals)==null?void 0:g.history)==null?void 0:v.pressure)||"-")+"[hPa]",1)])]),r.createElementVNode("div",Wt,[r.createElementVNode("div",Ot,[e[4]||(e[4]=r.createElementVNode("label",{style:{width:"max-content"}},"Forecast Models : ",-1)),r.createElementVNode("div",Ft,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList((_=i.activeTropicals)==null?void 0:_.forecasts,(L,z)=>{var N,V,R,D;return r.openBlock(),r.createElementBlock("div",{key:z,class:r.normalizeClass(["model",L.disabled?"":"active",z>0&&z<((V=(N=i.activeTropicals)==null?void 0:N.forecasts)==null?void 0:V.length)-1&&((D=(R=i.activeTropicals)==null?void 0:R.forecasts)==null?void 0:D.length)>2?"center-child":""]),onClick:M=>s.handleForecastToggle(L)},[r.createElementVNode("span",{class:r.normalizeClass(L.model)},r.toDisplayString(L.model),3)],10,$t)}),128))])])]),e[5]||(e[5]=r.createStaticVNode('<div class="row" style="padding:0;height:1px;margin:10px 0;background:var(--idm-black-1);" data-v-f122450c></div><div class="row" style="padding:2px 10px;" data-v-f122450c><div class="legend" data-v-f122450c><div class="icon td" data-v-f122450c></div><div class="label" data-v-f122450c>TD</div></div><div class="legend" data-v-f122450c><div class="icon ts" data-v-f122450c></div><div class="label" data-v-f122450c>TS</div></div><div class="legend" data-v-f122450c><div class="icon sts" data-v-f122450c></div><div class="label" data-v-f122450c>STS</div></div><div class="legend" data-v-f122450c><div class="icon ty" data-v-f122450c></div><div class="label" data-v-f122450c>TY</div></div><div class="legend" data-v-f122450c><div class="icon sty" data-v-f122450c></div><div class="label" data-v-f122450c>STY</div></div><div class="legend" data-v-f122450c><div class="icon supper-ty" data-v-f122450c></div><div class="label" data-v-f122450c>Super TY</div></div></div><div class="row" style="padding:2px 10px;" data-v-f122450c><div class="legend" data-v-f122450c><div class="icon history" data-v-f122450c></div><div class="label" data-v-f122450c>History</div></div><div class="legend" data-v-f122450c><div class="icon r7" data-v-f122450c></div><div class="label" data-v-f122450c>35kts Radii</div></div><div class="legend" data-v-f122450c><div class="icon r10" data-v-f122450c></div><div class="label" data-v-f122450c>50kts Radii</div></div></div>',3))]),r.createElementVNode("div",Ht,[r.createElementVNode("div",{class:"button",onClick:e[1]||(e[1]=L=>s.handleStrikeProbability(i.activeTropicals))},"Strike Probability >>")])])],512)),[[r.vShow,i.showTropicals&&!a.$attrs.hideTropicalsLegend]])}const be=k(zt,[["render",Ut],["__scopeId","data-v-f122450c"]]),Br="",Zt={name:"IdmPrecip3h",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[precip3h] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Gt={key:0};function Jt(a,e,t,o,i,s){var n;return(n=t.factor)!=null&&n.active?(r.openBlock(),r.createElementBlock("div",Gt,[r.createElementVNode("div",{class:"legend-bars flex-center",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:t.bottom}])},e[0]||(e[0]=[r.createElementVNode("span",null,"mm",-1),r.createElementVNode("span",null,"1.5",-1),r.createElementVNode("span",null,"2",-1),r.createElementVNode("span",null,"3",-1),r.createElementVNode("span",null,"7",-1),r.createElementVNode("span",null,"10",-1),r.createElementVNode("span",null,"20",-1),r.createElementVNode("span",null,"30",-1)]),4)])):r.createCommentVNode("",!0)}const Xt=k(Zt,[["render",Jt],["__scopeId","data-v-9708a7a3"]]),Mr="",qt={name:"IdmVisibility",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[visibility] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},Yt={key:0};function Qt(a,e,t,o,i,s){var n;return(n=t.factor)!=null&&n.active?(r.openBlock(),r.createElementBlock("div",Yt,[r.createElementVNode("div",{class:"legend-bars flex-center",style:r.normalizeStyle([{position:"absolute"},{right:a.right+"px",bottom:t.bottom}])},e[0]||(e[0]=[r.createElementVNode("span",null,"nm",-1),r.createElementVNode("span",null,"0",-1),r.createElementVNode("span",null,"0.5",-1),r.createElementVNode("span",null,"1.5",-1),r.createElementVNode("span",null,"3",-1),r.createElementVNode("span",null,"9",-1)]),4)])):r.createCommentVNode("",!0)}const Kt=k(qt,[["render",Qt],["__scopeId","data-v-f7b2fb08"]]),jr="",ea={name:"IdmWaterTemp",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[water-temp] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},ta={key:0};function aa(a,e,t,o,i,s){var n;return(n=t.factor)!=null&&n.active?(r.openBlock(),r.createElementBlock("div",ta,[r.createElementVNode("div",{class:"legend-bars flex-center",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:t.bottom}])},e[0]||(e[0]=[r.createElementVNode("span",null,"°C",-1),r.createElementVNode("span",null,"0",-1),r.createElementVNode("span",null,"10",-1),r.createElementVNode("span",null,"20",-1),r.createElementVNode("span",null,"30",-1),r.createElementVNode("span",null,"40",-1)]),4)])):r.createCommentVNode("",!0)}const ra=k(ea,[["render",aa],["__scopeId","data-v-7521f582"]]),Wr="",ia={name:"IdmTemp",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[water-temp] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[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,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},oa={key:0};function sa(a,e,t,o,i,s){var n;return(n=t.factor)!=null&&n.active?(r.openBlock(),r.createElementBlock("div",oa,[r.createElementVNode("div",{class:"legend-bars flex-center",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:t.bottom}])},e[0]||(e[0]=[r.createElementVNode("span",null,"°C",-1),r.createElementVNode("span",null,"-20",-1),r.createElementVNode("span",null,"-10",-1),r.createElementVNode("span",null,"0",-1),r.createElementVNode("span",null,"10",-1),r.createElementVNode("span",null,"20",-1),r.createElementVNode("span",null,"30",-1),r.createElementVNode("span",null,"40",-1)]),4)])):r.createCommentVNode("",!0)}const na=k(ia,[["render",sa],["__scopeId","data-v-25daaa82"]]),Or="",la={name:"IdmArctic",props:{factor:{type:Object},viewport:{type:Object},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new Z,etime:void 0,right:10}},watch:{"factor.version":{handler(){var a;(a=this.factor)!=null&&a.active?this.handleRender():this.handleClear()},deep:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{handleRender(){if(!this.viewport)setTimeout(()=>{this.handleRender()},500);else if(this.factor){const a=new Date().valueOf();let e=0,t=0;this.handleDraw(),t=new Date().valueOf()-(a+e),console.log("[water-temp] add elapsed: ",t,", total: ",e+=t)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){this.context=this.viewport.rampColorCanvas.getContext("webgl");const a=[[0,"rgba(76, 165, 228, 0)"],[50/255,"rgba(76, 165, 228, 0)"],[51/255,"rgb(76, 165, 228)"],[102/255,"rgb(129, 204, 197)"],[153/255,"rgb(150, 209, 216)"],[204/255,"rgb(180, 209, 216)"],[1,"rgb(180, 209, 216)"]];this.rampColor=this.webgl.setup(this.context,a);const{program:e,aPositionBuffer:t}=this.webgl.bind(this.context,T.vertexSchema,T.fragmentSchema);this.program=e,this.aPositionBuffer=t}},async handleDraw(){if(this.handleSetup(),this.etime!==this.factor.etime){this.etime=this.factor.etime;const a=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,a)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}},ca={key:0};function ha(a,e,t,o,i,s){var n;return(n=t.factor)!=null&&n.active?(r.openBlock(),r.createElementBlock("div",ca,[r.createElementVNode("div",{class:"legend-bars flex-center",style:r.normalizeStyle([{position:"absolute"},{right:i.right+"px",bottom:t.bottom}])},e[0]||(e[0]=[r.createElementVNode("span",null,"m",-1),r.createElementVNode("span",null,"0",-1),r.createElementVNode("span",null,"0.5",-1),r.createElementVNode("span",null,"1",-1),r.createElementVNode("span",null,"1.5",-1),r.createElementVNode("span",null,"2",-1)]),4)])):r.createCommentVNode("",!0)}const da=k(la,[["render",ha],["__scopeId","data-v-5bb73794"]]),Fr="",ma={name:"IdmPoint",emits:["point","more"],props:{map:{type:Object},show:{type:Boolean},timeZone:{type:Number,default:0},meteo:{type:Object}},data(){return{showMeteo:!1,meteoMarker:void 0,helper:ce}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){this.map&&this.show&&this.handleBind()}},meteo:{handler(){this.meteo?(this.showMeteo=!0,this.handleRender()):this.showMeteo=!1}}},computed:{computeTime(){return function(a){if(a){const e=B(a).utc().utcOffset(this.timeZone),t=this.timeZone<0?this.timeZone:"+"+this.timeZone;return`${e.format("MMM-DD,HHmm")} ( UTC ${t} )`}return"-"}},computeLat(){return function(a,e=4){return C.LngLatHelper.lat2pretty(a,e).pretty}},computeLng(){return function(a,e=4){return C.LngLatHelper.lng2pretty(a,e).pretty}},roundPrecision(){return function(a,e=4){return isNaN(a)?"-":C.LngLatHelper.roundPrecision(a,e)}}},methods:{handleBind(){var a,e;this.show?(a=this.map)==null||a.on("click",this.handleClick):((e=this.map)==null||e.off("click",this.handleClick),this.showMeteo=!1)},handleClick(a){a.originalEvent.stopPropagation();const e=a.originalEvent.target.className;e.indexOf("close")>-1?this.showMeteo=!1:e==="more"?this.$emit("more",this.meteo):this.$emit("point",a.lngLat)},handleRender(){var a;if(this.meteo){const e=document.getElementById("point-meteo");this.meteoMarker?(a=this.meteoMarker)==null||a.setLngLat([this.meteo.lng,this.meteo.lat]):this.meteoMarker=new O.Marker(e).setLngLat([this.meteo.lng,this.meteo.lat]).addTo(this.map)}}}},pa={id:"point-meteo",class:"point-meteo"},ya={class:"meteo-box"},fa={class:"header-box"},ua={class:"main"},ga={class:"sub"},ba={class:"main-box"},wa={class:"flex-space"},La={class:"flex-space"},va={class:"flex-space"},xa={class:"flex-space"},_a={class:"flex-space"},Ca={class:"flex-space"},ka={class:"flex-space"},Sa={class:"flex-space"},Ea={class:"flex-space"};function Pa(a,e,t,o,i,s){var n,l,h,d,c,m,u,p,b,f,y,w,g,v,_,L,z,N,V,R,D,M,Q,K,ee,te,ae,re,ie,G,j,F,oe,$,S,A,se,H,ne,J,X,q,de,me,pe,ye,fe;return r.withDirectives((r.openBlock(),r.createElementBlock("div",pa,[r.createElementVNode("div",ya,[r.createElementVNode("div",fa,[r.createElementVNode("div",{class:"iconfont close",onClick:e[0]||(e[0]=Le=>i.showMeteo=!1)},""),r.createElementVNode("div",ua,r.toDisplayString(s.computeLat((n=t.meteo)==null?void 0:n.lat))+","+r.toDisplayString(s.computeLng((l=t.meteo)==null?void 0:l.lng)),1),r.createElementVNode("div",ga,r.toDisplayString(s.computeTime((h=t.meteo)==null?void 0:h.utc)),1)]),r.createElementVNode("div",ba,[r.createElementVNode("div",wa,[e[1]||(e[1]=r.createElementVNode("label",null,"Wind",-1)),r.createElementVNode("span",null,r.toDisplayString(((c=(d=t.meteo)==null?void 0:d.wind)==null?void 0:c.direction)||"-")+"/"+r.toDisplayString(s.roundPrecision((u=(m=t.meteo)==null?void 0:m.wind)==null?void 0:u.kts,1))+"[kts]/"+r.toDisplayString((b=(p=t.meteo)==null?void 0:p.wind)==null?void 0:b.scale)+"[BF]/"+r.toDisplayString(s.roundPrecision((y=(f=t.meteo)==null?void 0:f.gusts)==null?void 0:y.kts,1))+"[kts]",1)]),r.createElementVNode("div",La,[e[2]||(e[2]=r.createElementVNode("label",null,"Wind.Wave",-1)),r.createElementVNode("span",null,r.toDisplayString(((v=(g=(w=t.meteo)==null?void 0:w.wave)==null?void 0:g.wd)==null?void 0:v.direction)||"-")+"/"+r.toDisplayString(s.roundPrecision((z=(L=(_=t.meteo)==null?void 0:_.wave)==null?void 0:L.wd)==null?void 0:z.height,1))+"[m]/"+r.toDisplayString(s.roundPrecision((R=(V=(N=t.meteo)==null?void 0:N.wave)==null?void 0:V.wd)==null?void 0:R.period,1))+"[s]",1)]),r.createElementVNode("div",va,[e[3]||(e[3]=r.createElementVNode("label",null,"Swell",-1)),r.createElementVNode("span",null,r.toDisplayString(((Q=(M=(D=t.meteo)==null?void 0:D.wave)==null?void 0:M.swell)==null?void 0:Q.direction)||"-")+"/"+r.toDisplayString(s.roundPrecision((te=(ee=(K=t.meteo)==null?void 0:K.wave)==null?void 0:ee.swell)==null?void 0:te.height,1))+"[m]/"+r.toDisplayString(s.roundPrecision((ie=(re=(ae=t.meteo)==null?void 0:ae.wave)==null?void 0:re.swell)==null?void 0:ie.period,1))+"[s]",1)]),r.createElementVNode("div",xa,[e[4]||(e[4]=r.createElementVNode("label",null,"Sig.Wave",-1)),r.createElementVNode("span",null,r.toDisplayString(((F=(j=(G=t.meteo)==null?void 0:G.wave)==null?void 0:j.sig)==null?void 0:F.direction)||"-")+"/"+r.toDisplayString(s.roundPrecision((S=($=(oe=t.meteo)==null?void 0:oe.wave)==null?void 0:$.sig)==null?void 0:S.height,1))+"[m]/"+r.toDisplayString(s.roundPrecision((H=(se=(A=t.meteo)==null?void 0:A.wave)==null?void 0:se.sig)==null?void 0:H.period,1))+"[s]",1)]),r.createElementVNode("div",_a,[e[5]||(e[5]=r.createElementVNode("label",null,"Current",-1)),r.createElementVNode("span",null,r.toDisplayString(((J=(ne=t.meteo)==null?void 0:ne.current)==null?void 0:J.direction)||"-")+"/"+r.toDisplayString(s.roundPrecision((q=(X=t.meteo)==null?void 0:X.current)==null?void 0:q.kts,2))+"[kts]",1)]),r.createElementVNode("div",Ca,[e[6]||(e[6]=r.createElementVNode("label",null,"Precip",-1)),r.createElementVNode("span",null,r.toDisplayString(s.roundPrecision((me=(de=t.meteo)==null?void 0:de.precip)==null?void 0:me.inter6h,2))+"[mm]",1)]),r.createElementVNode("div",ka,[e[7]||(e[7]=r.createElementVNode("label",null,"Visibility",-1)),r.createElementVNode("span",null,r.toDisplayString(s.roundPrecision(((pe=t.meteo)==null?void 0:pe.visibility)/1852,0))+"[nm]",1)]),r.createElementVNode("div",Sa,[e[8]||(e[8]=r.createElementVNode("label",null,"Temp",-1)),r.createElementVNode("span",null,r.toDisplayString(s.roundPrecision((ye=t.meteo)==null?void 0:ye.temp,0))+"[°C]",1)]),r.createElementVNode("div",Ea,[e[9]||(e[9]=r.createElementVNode("label",null,"Water Temp",-1)),r.createElementVNode("span",null,r.toDisplayString(s.roundPrecision((fe=t.meteo)==null?void 0:fe.waterTemp,2))+"[°C]",1)])]),r.createCommentVNode("",!0)])],512)),[[r.vShow,i.showMeteo]])}const za=k(ma,[["render",Pa],["__scopeId","data-v-efcf572f"]]),Na={name:"IdmWarZone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},data(){return{source:"war-zone-source",zoneLayer:"war-zone-layer",zoneLabelLayer:"war-zone-label-layer"}},watch:{zone:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.zone&&(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.zoneLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-color":"#f44336","fill-opacity":.4}},this.beforeLayer),this.map.addLayer({id:this.zoneLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":1,"line-color":"#f44336"}},this.beforeLayer),this.map.addLayer({id:this.zoneLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-1]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.zoneLayer)&&this.map.removeLayer(this.zoneLayer),this.map.getLayer(this.zoneLayer+"-border")&&this.map.removeLayer(this.zoneLayer+"-border"),this.map.getLayer(this.zoneLabelLayer)&&this.map.removeLayer(this.zoneLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Ta(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const Va=k(Na,[["render",Ta]]),Ia={name:"IdmGmdssArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},data(){return{source:"gmdss-area-source",areaLayer:"gmdss-area-layer",areaLabelLayer:"gmdss-area-label-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":["match",["get","val"],"AreaI","#EB8996","AreaII","#6F448B","AreaIII","#3E8BD3","AreaIV","#5EBCC4","AreaV","#00AAE7","AreaVI","#9CCE6D","AreaVII","#F4AE00","AreaVIII","#EF9A85","AreaIX","#00AAA7","AreaX","#7AC49F","AreaXI","#DFDFDF","AreaXII","#FFF974","AreaXIII","#EF9A85","AreaXIV","#86A2D1","AreaXV","#EC8972","AreaXVI","#EAC2DA","AreaXVII","#B9C8E7","AreaXVIII","#BBA1C8","AreaXIX","#FAE0BD","AreaXX","#DBECC8","AreaXXI","#D496AF","#ffffff"]}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":12,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-opacity":.8,"text-color":"#000"}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Ra(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const Da=k(Ia,[["render",Ra]]),Aa={name:"IdmEcaZone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},data(){return{source:"eca-zone-source",zoneLayer:"eca-zone-layer",zoneLabelLayer:"eca-zone-label-layer"}},watch:{zone:{handler(){this.zone?this.handleRender():this.handleClear()}}},methods:{handleRender(){var a;this.map?(this.handleClear(),this.zone&&(this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(this.zone):(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.zoneLayer,type:"fill",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"fill-outline-color":"silver","fill-opacity":.4,"fill-color":"#05f324"}}),this.map.addLayer({id:this.zoneLayer+"-border",type:"line",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-color":"#04c021","line-width":1,"line-opacity":1}},this.beforeLayer),this.map.addLayer({id:this.zoneLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-max-width":16,"text-justify":"left","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}})))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.zoneLayer)&&this.map.removeLayer(this.zoneLayer),this.map.getLayer(this.zoneLayer+"-border")&&this.map.removeLayer(this.zoneLayer+"-border"),this.map.getLayer(this.zoneLabelLayer)&&this.map.removeLayer(this.zoneLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Ba(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const Ma=k(Aa,[["render",Ba]]),$r="",ja={name:"IdmAlertZone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},data(){return{source:"alert-zone-source",polygonLayer:"alert-zone-polygon-layer",polygonLabelLayer:"alert-zone-polygon-label-layer",lineLayer:"alert-zone-line-layer",lineLabelLayer:"alert-zone-line-label-layer",pointLayer:"alert-zone-point-layer",showZone:!1,form:{}}},watch:{zone:{handler(){var a,e;this.zone?(this.handleRender(),(a=this.map)==null||a.on("click",[this.polygonLabelLayer,this.lineLabelLayer,this.pointLayer],this.handleClick)):(this.handleClear(),(e=this.map)==null||e.off("click",[this.polygonLabelLayer,this.lineLabelLayer,this.pointLayer],this.handleClick))}}},methods:{handleClick(a){var o;const e=a.features[0],t=(o=this.zone)==null?void 0:o.features.filter(i=>{var s;return i.properties.id===((s=e==null?void 0:e.properties)==null?void 0:s.id)})[0];if(t){this.showZone=!0,this.form={...t.properties};const i=document.getElementById("idm-gl3-zone-info");this.marker?this.marker.setLngLat([a.lngLat.lng,a.lngLat.lat]):this.marker=new O.Marker(i).setLngLat([a.lngLat.lng,a.lngLat.lat]).setOffset([0,0]).addTo(this.map)}},handleRender(){var a;this.map?(this.handleClear(),this.zone&&(this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(this.zone):(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.polygonLayer,type:"fill",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"fill-outline-color":"#d57d02","fill-opacity":.4,"fill-color":"#d57d02"}}),this.map.addLayer({id:this.polygonLayer+"-border",type:"line",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-width":1,"line-color":"#d57d02"}}),this.map.addLayer({id:this.lineLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["!=","disabled",!0]],paint:{"line-color":"#d57d02","line-width":2}}),this.map.addLayer({id:this.polygonLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-image":"alert","icon-size":.08,"icon-allow-overlap":!0,"icon-rotation-alignment":"viewport"},paint:{"icon-opacity":.8}}),this.map.addLayer({id:this.lineLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","LineString"],["!=","disabled",!0]],layout:{"symbol-placement":"line-center","icon-image":"alert","icon-size":.08,"icon-allow-overlap":!0,"icon-rotation-alignment":"viewport"},paint:{"icon-opacity":.8}}),this.map.addLayer({id:this.pointLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-image":"alert","icon-size":.08},paint:{"icon-opacity":.8}})))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.polygonLayer)&&this.map.removeLayer(this.polygonLayer),this.map.getLayer(this.polygonLayer+"-border")&&this.map.removeLayer(this.polygonLayer+"-border"),this.map.getLayer(this.polygonLabelLayer)&&this.map.removeLayer(this.polygonLabelLayer),this.map.getLayer(this.lineLayer)&&this.map.removeLayer(this.lineLayer),this.map.getLayer(this.lineLabelLayer)&&this.map.removeLayer(this.lineLabelLayer),this.map.getLayer(this.pointLayer)&&this.map.removeLayer(this.pointLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}},Wa={id:"idm-gl3-zone-info"},Oa=["innerHTML"];function Fa(a,e,t,o,i,s){var n;return r.withDirectives((r.openBlock(),r.createElementBlock("div",Wa,[r.createElementVNode("div",{class:"iconfont close",onClick:e[0]||(e[0]=l=>i.showZone=!1)},""),r.createElementVNode("div",{class:"rich-context",innerHTML:(n=i.form)==null?void 0:n.name},null,8,Oa)],512)),[[r.vShow,i.showZone]])}const $a=k(ja,[["render",Fa]]),Hr="",Ha={name:"IdmPort",props:{map:{type:Object},port:{type:Object},beforeLayer:{type:String}},emits:["port"],data(){return{source:"port-source",layer:"port-layer",showPort:!1,form:{},marker:void 0}},computed:{computeLat(){return function(a){return C.LngLatHelper.lat2pretty(a,4).pretty}},computeLng(){return function(a){return C.LngLatHelper.lng2pretty(a,4).pretty}}},watch:{port:{handler(){var a,e;this.port?(this.handleRender(),(a=this.map)==null||a.on("click",[this.layer],this.handleClick)):(this.handleClear(),(e=this.map)==null||e.off("click",[this.layer],this.handleClick))}}},methods:{handleClick(a){var o;const e=a.features[0],t=(o=this.port)==null?void 0:o.features.filter(i=>{var s;return i.properties.id===((s=e==null?void 0:e.properties)==null?void 0:s.id)})[0];if(t){this.showPort=!0,this.form={...t.properties},this.form.lng=t.geometry.coordinates[0],this.form.lat=t.geometry.coordinates[1];const i=document.getElementById("port-info");this.marker?this.marker.setLngLat([a.lngLat.lng,a.lngLat.lat]):this.marker=new O.Marker(i).setLngLat([a.lngLat.lng,a.lngLat.lat]).setOffset([0,-85]).addTo(this.map)}},handleEmit(){this.$emit("port",this.form)},handleRender(){var a;this.map?this.port&&(this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(this.port):(this.map.addSource(this.source,{type:"geojson",data:this.port}),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","text-anchor":"left","text-field":"{name}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[1,0]},paint:{"text-color":"rgba(0, 0, 0, 0.8)","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.showPort=!1,this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}},Ua={id:"port-info"},Za={class:"port-box"},Ga={class:"flex-start"},Ja={class:"flex-start"},Xa={class:"flex-start"},qa={class:"flex-start",style:{"align-items":"flex-start"}};function Ya(a,e,t,o,i,s){return r.withDirectives((r.openBlock(),r.createElementBlock("div",Ua,[r.createElementVNode("div",{class:"close iconfont",onClick:e[0]||(e[0]=n=>i.showPort=!1)},""),r.createElementVNode("div",Za,[r.createElementVNode("div",Ga,[e[2]||(e[2]=r.createElementVNode("label",null,"Name : ",-1)),r.createElementVNode("span",{onClick:e[1]||(e[1]=(...n)=>s.handleEmit&&s.handleEmit(...n))},r.toDisplayString(i.form.name),1)]),r.createElementVNode("div",Ja,[e[3]||(e[3]=r.createElementVNode("label",null,"Position : ",-1)),r.createElementVNode("span",null,r.toDisplayString(s.computeLat(i.form.lat))+", "+r.toDisplayString(s.computeLng(i.form.lng)),1)]),r.createElementVNode("div",Xa,[e[4]||(e[4]=r.createElementVNode("label",null,"LoCode : ",-1)),r.createElementVNode("span",null,r.toDisplayString(i.form.loCode||"-"),1)]),r.createElementVNode("div",qa,[e[5]||(e[5]=r.createElementVNode("label",null,"Region : ",-1)),r.createElementVNode("span",null,r.toDisplayString(i.form.zoneName||"-"),1)])])],512)),[[r.vShow,i.showPort]])}const Qa=k(Ha,[["render",Ya],["__scopeId","data-v-c07e4c45"]]),Ka={name:"IdmLoadLine",props:{map:{type:Object},line:{type:Object},beforeLayer:{type:String}},data(){return{source:"load-line-source",lineLayer:"load-line-layer",lineLabelLayer:"load-line-label-layer"}},watch:{line:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.line&&(this.map.addSource(this.source,{type:"geojson",data:this.line}),this.map.addLayer({id:this.lineLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.75,"fill-color":["match",["get","val"],"LLGreen","#A0C0C0","LLRed","#F5A39D","LLBlue","#6B94E4","#ffffff"]}},this.beforeLayer),this.map.addLayer({id:this.lineLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":"{lbl} (Length < {shipLength}, {start} - {end})","text-rotation-alignment":"viewport","text-offset":[0,1],"text-size":10,"text-allow-overlap":!0},paint:{"text-opacity":.8}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.lineLayer)&&this.map.removeLayer(this.lineLayer),this.map.getLayer(this.lineLabelLayer)&&this.map.removeLayer(this.lineLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function er(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const tr=k(Ka,[["render",er]]),ar={name:"IdmTimezone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},data(){return{source:"time-zone-source",zoneLayer:"time-zone-layer",zoneLabelLayer:"time-zone-label-layer"}},watch:{zone:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.zone&&(this.map.addSource(this.source,{type:"geojson",data:this.zone}),this.map.addLayer({id:this.zoneLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":["match",["get","offSet"],"-11.5","rgba(255,0,0,0.4)","-11","rgba(0,255,0,0.3)","-10.5","rgba(0,255,0,0.3)","-10","rgba(0,0,255,0.3)","-9.5","rgba(0,0,255,0.3)","-9","rgba(255,0,0,0.4)","-8.5","rgba(255,0,0,0.4)","-8","rgba(0,255,0,0.3)","-7.5","rgba(0,255,0,0.3)","-7","rgba(0,0,255,0.3)","-6.5","rgba(0,0,255,0.3)","-6","rgba(255,0,0,0.4)","-5.5","rgba(255,0,0,0.4)","-5","rgba(0,255,0,0.3)","-4.5","rgba(0,255,0,0.3)","-4","rgba(0,0,255,0.3)","-3.5","rgba(0,0,255,0.3)","-3","rgba(255,0,0,0.4)","-2.5","rgba(255,0,0,0.4)","-2","rgba(0,255,0,0.3)","-1.5","rgba(0,255,0,0.3)","-1","rgba(0,0,255,0.3)","-0.5","rgba(0,0,255,0.3)","+0","rgba(255,0,0,0.4)","+0.5","rgba(255,0,0,0.4)","+1","rgba(0,255,0,0.3)","+1.5","rgba(0,255,0,0.3)","+2","rgba(0,0,255,0.3)","+2.5","rgba(0,0,255,0.3)","+3","rgba(255,0,0,0.4)","+3.5","rgba(255,0,0,0.4)","+4","rgba(0,255,0,0.3)","+4.5","rgba(0,255,0,0.3)","+5","rgba(0,0,255,0.3)","+5.5","rgba(0,0,255,0.3)","+6","rgba(255,0,0,0.4)","+6.5","rgba(255,0,0,0.4)","+7","rgba(0,255,0,0.3)","+7.5","rgba(0,255,0,0.3)","+8","rgba(0,0,255,0.3)","+8.5","rgba(0,0,255,0.3)","+9","rgba(255,0,0,0.4)","+9.5","rgba(255,0,0,0.4)","+10","rgba(0,255,0,0.3)","+10.5","rgba(0,255,0,0.3)","+11","rgba(0,0,255,0.3)","+11.5","rgba(0,0,255,0.3)","rgba(255,0,0,0.4)"]}}),this.map.addLayer({id:this.zoneLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":"{offSet}","text-rotation-alignment":"viewport","text-size":12,"text-offset":[0,1]},paint:{"text-opacity":.8,"text-color":"#fff"}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.zoneLayer)&&this.map.removeLayer(this.zoneLayer),this.map.getLayer(this.zoneLabelLayer)&&this.map.removeLayer(this.zoneLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function rr(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const ir=k(ar,[["render",rr]]),or={name:"IdmVoluntaryReportingArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},data(){return{source:"vra-source",areaLayer:"vra-layer",areaLabelLayer:"vra-label-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.4,"fill-color":"#9f30f9"}},this.beforeLayer),this.map.addLayer({id:this.areaLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":1,"line-color":"#9f30f9"}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLayer+"-border")&&this.map.removeLayer(this.areaLayer+"-border"),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function sr(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const nr=k(or,[["render",sr]]),lr={name:"IdmSpecialArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},data(){return{source:"special-area-source",areaLayer:"special-area-layer",areaLabelLayer:"special-area-label-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.area.features.forEach(a=>{a.geometry.type==="Polygon"&&a.geometry.coordinates.forEach(e=>C.LngLatHelper.convertToMonotonicLng2(e))}),this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.4,"fill-color":["match",["get","val"],"DefaultStyle","rgb(0,0,0)","JWCriskArea","rgb(0,0,0)","rgb(0,0,0)"]}},this.beforeLayer),this.map.addLayer({id:this.areaLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":.4,"line-color":"rgb(0,0,0)"}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.1,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,-3.5]},paint:{"icon-opacity":.8,"text-color":"#000","text-halo-color":"#fff","text-halo-width":1}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.areaLayer)&&this.map.removeLayer(this.areaLayer),this.map.getLayer(this.areaLayer+"-border")&&this.map.removeLayer(this.areaLayer+"-border"),this.map.getLayer(this.areaLabelLayer)&&this.map.removeLayer(this.areaLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function cr(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const hr=k(lr,[["render",cr]]),dr={name:"IdmTerminator",props:{map:{type:Object},area:{type:Object}},data(){return{source:"terminator-source",layer:"terminator-layer"}},watch:{area:{handler(){this.handleRender()}}},methods:{handleRender(){this.map?(this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),this.map.addLayer({id:this.layer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"silver","fill-opacity":.5,"fill-color":"rgba(0, 0, 0, 0.4)"}}))):setTimeout(()=>{this.handleRender()},500)},handleClear(){this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function mr(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const pr=k(dr,[["render",mr]]),Ur="",yr={name:"IdmLatLng",props:{map:{type:Object},show:{type:Boolean},bottom:{type:String,default:"70px"},toggleVersion:{type:Number}},data(){return{lngLat:void 0,source:"idm-lat-lng-source",layer:"idm-lat-lng-layer",labelLayer:"idm-lat-lng-label-layer",right:10}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){var a;this.map&&((a=this.map)==null||a.on("mousemove",this.handleMouseMove))},immediate:!0},toggleVersion:{handler(){var a,e;this.right=(((a=document.getElementsByClassName("legend-bars")[0])==null?void 0:a.clientWidth)||-10)+(((e=document.getElementsByClassName("right-bar")[0])==null?void 0:e.clientWidth)||0)+20},immediate:!0}},methods:{handleBind(){var a,e;this.show?((a=this.map)==null||a.on("zoomend",this.handleZoomEnd),this.handleRender()):(this.handleClear(),(e=this.map)==null||e.off("zoomend",this.handleZoomEnd))},handleMouseMove(a){const e=a.lngLat,t=C.LngLatHelper.lng2pretty(e.lng,2),o=C.LngLatHelper.lat2pretty(e.lat,2);this.lngLat={lng:t,lat:o}},handleComputeLatLngs(){var o;const a=(o=this.map)==null?void 0:o.getZoom();console.log(a);let e=30;a>4?e=10:a>3&&(e=15);const t=[];for(let i=-60;i<90;i+=e)t.push({type:"Feature",geometry:{type:"LineString",coordinates:[[-180,i],[180,i]]}});for(let i=-180;i<180;i+=e)t.push({type:"Feature",geometry:{type:"LineString",coordinates:[[i,-90],[i,90]]}});for(let i=180;i>-180;i-=e)for(let s=-60;s<90;s+=e)t.push({type:"Feature",geometry:{type:"Point",coordinates:[i,s]},properties:{val:`${s>0?s+" N":s===0?s:s*-1+" S"}, ${i>0?i+" E":i*-1+" W"}`}});return t},handleZoomEnd(){var e;const a=this.handleComputeLatLngs();(e=this.map)==null||e.getSource(this.source).setData(x.featureCollection(a))},handleRender(){if(this.map){const a=this.handleComputeLatLngs();this.map.addSource(this.source,{type:"geojson",data:{type:"FeatureCollection",features:a}}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":"rgba(0, 0, 0, 0.3)","line-width":1}}),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":.8}})}},handleClear(){var a,e,t,o,i,s;(a=this.map)!=null&&a.getLayer(this.layer)&&((e=this.map)==null||e.removeLayer(this.layer)),(t=this.map)!=null&&t.getLayer(this.labelLayer)&&((o=this.map)==null||o.removeLayer(this.labelLayer)),(i=this.map)!=null&&i.getSource(this.source)&&((s=this.map)==null||s.removeSource(this.source))}}};function fr(a,e,t,o,i,s){return i.lngLat?(r.openBlock(),r.createElementBlock("div",{key:0,class:"lat-lng-tip",style:r.normalizeStyle({right:i.right+"px",bottom:t.bottom})},[r.createElementVNode("span",null,r.toDisplayString(i.lngLat.lat.pretty),1),e[0]||(e[0]=r.createElementVNode("span",null,", ",-1)),r.createElementVNode("span",null,r.toDisplayString(i.lngLat.lng.pretty),1)],4)):r.createCommentVNode("",!0)}const we=k(yr,[["render",fr],["__scopeId","data-v-73241fe7"]]),ur={name:"IdmMeasure",props:{map:{type:Object},show:{type:Boolean}},data(){return{geojson:[],source:"measure-source",layer:"measure-layer",labelLayer:"measure-label-layer",tmpSource:"measure-tmp-source",tmpLayer:"measure-tmp-layer",tmpLabelLayer:"measure-tmp-label-layer",closeMarkers:{},pointMarkers:{},tipMarker:void 0,contextmenu:void 0,navigation:"RL"}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){this.map&&this.handleBind()}}},methods:{handleBind(){var a,e,t,o,i,s,n,l,h,d;if(this.show)(a=this.map)==null||a.getCanvas().addEventListener("keydown",this.handleKeydown),(e=this.map)==null||e.on("mousemove",this.handleMove),(t=this.map)==null||t.on("dblclick",this.handleDblClick),(o=this.map)==null||o.on("click",this.handleClick),(i=this.map)==null||i.on("contextmenu",this.handleContextmenu),this.map&&(this.map.getCanvas().style.cursor="crosshair");else{(s=this.map)==null||s.getCanvas().removeEventListener("keydown",this.handleKeydown),(n=this.map)==null||n.off("mousemove",this.handleMove),(l=this.map)==null||l.off("dblclick",this.handleDblClick),(h=this.map)==null||h.off("click",this.handleClick),(d=this.map)==null||d.off("contextmenu",this.handleContextmenu);for(const c of this.geojson)this.handleClear(c,!0);this.geojson=[],this.map&&(this.map.getCanvas().style.cursor="grab")}},handleKeydown(a){if(a.key==="Shift"){this.navigation=this.navigation==="RL"?"GC":"RL";const t=this.geojson.at(-1).features.filter(o=>o.geometry.type==="Point");t.length&&(t.at(-1).properties.mode=this.navigation)}},handleDrag(a){var t,o,i,s,n,l,h,d,c,m;const e=(o=(t=a.target)==null?void 0:t._element)==null?void 0:o.id;if((e==null?void 0:e.split("-").length)===2){const u=this.geojson.filter(y=>y.id===e.split("-")[0])[0];this.pointMarkers[u.id].filter(y=>{var w;return((w=y._element)==null?void 0:w.id)===e})[0].setLngLat([(s=(i=a.target)==null?void 0:i._lngLat)==null?void 0:s.lng,(l=(n=a.target)==null?void 0:n._lngLat)==null?void 0:l.lat]);let b;u.features.forEach((y,w)=>{if(y.geometry.type==="Point"&&y.properties.id==e.split("-")[1]){b=w;return}});const f=u.features.filter(y=>y.geometry.type==="Point");this.handleTmpPointUpdate(u,f[b-1],{lng:(d=(h=a.target)==null?void 0:h._lngLat)==null?void 0:d.lng,lat:(m=(c=a.target)==null?void 0:c._lngLat)==null?void 0:m.lat,properties:f[b].properties},b===f.length-1?void 0:f[b+1])}},handleDragEnd(a){var t,o,i,s,n,l,h,d,c,m;const e=(o=(t=a.target)==null?void 0:t._element)==null?void 0:o.id;if((e==null?void 0:e.split("-").length)===2){const u=this.geojson.filter(f=>f.id===e.split("-")[0])[0];this.pointMarkers[u.id].filter(f=>{var y;return((y=f._element)==null?void 0:y.id)===e})[0].setLngLat([(s=(i=a.target)==null?void 0:i._lngLat)==null?void 0:s.lng,(l=(n=a.target)==null?void 0:n._lngLat)==null?void 0:l.lat]);const b=u.features.filter(f=>f.geometry.type==="Point"&&f.properties.id==e.split("-")[1])[0];b.geometry.coordinates=[(d=(h=a.target)==null?void 0:h._lngLat)==null?void 0:d.lng,(m=(c=a.target)==null?void 0:c._lngLat)==null?void 0:m.lat],u.features=u.features.filter(f=>f.geometry.type==="Point"),this.handlePointUpdate(u)}},handleContextmenu(a){var t,o,i,s;a.preventDefault(),(t=this.contextmenu)==null||t.remove();const e=(s=(i=(o=a.originalEvent)==null?void 0:o.target)==null?void 0:i.parentElement)==null?void 0:s.id;if((e==null?void 0:e.split("-").length)===2){const l=this.geojson.filter(h=>h.id===e.split("-")[0])[0].features.filter(h=>h.geometry.type==="Point");if(l.length>2&&l.filter(d=>d.properties.id===(e==null?void 0:e.split("-")[1]))[0]){const d=document.createElement("div");d.className="point-contextmenu-marker",d.innerHTML=`<span id="del-${e}" class="del-point">Del</span>`,this.contextmenu=new O.Marker(d).setOffset([24,0]).setLngLat([a.lngLat.lng,a.lngLat.lat]).addTo(this.map)}}},handleClick(a){var t,o,i,s,n;(t=this.contextmenu)==null||t.remove();const e=a.originalEvent.target.className;if(e==="marker-close"){const l=(i=(o=a.originalEvent)==null?void 0:o.srcElement)==null?void 0:i.id,h=this.geojson.filter(d=>d.id===l)[0];h&&this.handleClear(h,!0),this.geojson=this.geojson.filter(d=>d.id!==l)}else if(e==="del-point"){const l=(n=(s=a.originalEvent.target.id)==null?void 0:s.replace("del-",""))==null?void 0:n.split("-"),h=this.geojson.filter(d=>d.id===l[0])[0];h.features=h.features.filter(d=>d.geometry.type==="Point"&&d.properties.id!==l[1]),this.handlePointUpdate(h)}else if(e!=="marker-label"){let l=this.geojson.at(-1);l||(l=x.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(l)),l.features=l.features.filter(d=>d.geometry.type==="Point");const h=x.feature({type:"Point",coordinates:[a.lngLat.lng,a.lngLat.lat]},{id:new Date().getTime().toString(),mode:this.navigation});l.features.push(h),this.handlePointUpdate(l)}},handlePointUpdate(a){const e=a.features;if(e.length>1){let t=0;const o=[];for(let i=1;i<e.length;i++){const s=e[i-1],n=e[i],l=s.properties,h={lng:s.geometry.coordinates[0],lat:s.geometry.coordinates[1]},d={lng:n.geometry.coordinates[0],lat:n.geometry.coordinates[1]},c=C.LaneHelper.calculateDistance(h,d,l.mode==="RL",2),m=C.LaneHelper.calculateBearing(h,d,l.mode==="RL",2);t=C.LngLatHelper.roundPrecision(t+c,2);let u;l.mode==="RL"?u=C.LngLatHelper.convertToMonotonicLng([h,d]):u=C.LngLatHelper.convertToMonotonicLng(C.LaneHelper.interpolateCoordinates(h,d,200));const p=x.lineString(u.map(b=>[b.lng,b.lat]));p.properties.dist=c,p.properties.bearing=m,p.properties.total=t,o.push(p)}e.push(...o),a.total=t}return this.handleRender(a),a},handleTmpPointUpdate(a,e,t,o){const i=x.featureCollection([]);let s,n;if(e){const h=e.properties,d={lng:e.geometry.coordinates[0],lat:e.geometry.coordinates[1]},c={lng:t.lng,lat:t.lat};s=C.LaneHelper.calculateDistance(d,c,h.mode==="RL",2),n=C.LaneHelper.calculateBearing(d,c,h.mode==="RL",2);let m;h.mode==="RL"?m=C.LngLatHelper.convertToMonotonicLng([d,c]):m=C.LngLatHelper.convertToMonotonicLng(C.LaneHelper.interpolateCoordinates(d,c,200));const u=x.lineString(m.map(p=>[p.lng,p.lat]));u.properties.dist=s,u.properties.bearing=n,i.features.push(u)}if(o){const h=t.properties,d=t,c={lng:o.geometry.coordinates[0],lat:o.geometry.coordinates[1]};s=C.LaneHelper.calculateDistance(d,c,h.mode==="RL",2),n=C.LaneHelper.calculateBearing(d,c,h.mode==="RL",2);let m;h.mode==="RL"?m=C.LngLatHelper.convertToMonotonicLng([d,c]):m=C.LngLatHelper.convertToMonotonicLng(C.LaneHelper.interpolateCoordinates(d,c,200));const u=x.lineString(m.map(p=>[p.lng,p.lat]));u.properties.dist=s,u.properties.bearing=n,i.features.push(u)}this.map.getSource(this.tmpSource)?this.map.getSource(this.tmpSource).setData(i):this.map.addSource(this.tmpSource,{type:"geojson",data:i}),this.map.getLayer(this.tmpLayer)||this.map.addLayer({id:this.tmpLayer,type:"line",source:this.tmpSource,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#F44336","line-width":2,"line-opacity":1,"line-dasharray":[3,2]}}),this.map.getLayer(this.tmpLabelLayer)||this.map.addLayer({id:this.tmpLabelLayer,type:"symbol",source:this.tmpSource,filter:["==","$type","LineString"],layout:{"symbol-placement":"line-center","text-field":"{dist} nm","text-rotation-alignment":"map","text-size":12},paint:{"text-opacity":1,"text-color":"#fff","text-halo-color":"#F44336","text-halo-width":4,"text-halo-blur":0}});let l;if(o?l='<div class="marker-label">Drag and drop</div>':l=`<div class="marker-label">Tol distance: <b>${C.LngLatHelper.roundPrecision((a.total??0)+s,2)}</b>nm, bearing: <b>${n}</b>°</div><div class="marker-label">${this.navigation==="RL"?"RL":"GC"} mode, using 'Shift' to switch</div><div class="marker-label">Double click to end</div>`,this.tipMarker)this.tipMarker._element.innerHTML=l,this.tipMarker.setLngLat([t.lng,t.lat]);else{const h=document.createElement("div");h.className="tip-marker",h.innerHTML=l,this.tipMarker=new O.Marker(h).setOffset([140,0]).setLngLat([t.lng,t.lat]).addTo(this.map)}},handleMove(a){this.map.getCanvas().style.cursor="crosshair";let e=this.geojson.at(-1);e||(e=x.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e));const t=e.features.filter(o=>o.geometry.type==="Point");t!=null&&t.length&&this.handleTmpPointUpdate(e,t.at(-1),{lng:a.lngLat.lng,lat:a.lngLat.lat})},handleDblClick(a){a.preventDefault();let e=this.geojson.at(-1);e.closed=!0,this.handleRender(e),e=x.featureCollection([],{id:new Date().getTime().toString()}),this.geojson.push(e)},handleRender(a){var e;if((e=a==null?void 0:a.features)!=null&&e.length){const t=`${a.id}-${this.source}`,o=`${a.id}-${this.layer}`,i=`${a.id}-${this.labelLayer}`;this.map.getSource(t)?this.map.getSource(t).setData(a):this.map.addSource(t,{type:"geojson",data:a}),this.handleClear(a,!1),this.map.addLayer({id:o,type:"line",source:t,filter:["==","$type","LineString"],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#F44336","line-width":2}}),this.map.addLayer({id:i,type:"symbol",source:t,filter:["==","$type","LineString"],layout:{"symbol-placement":"line-center","text-field":"{dist}nm,{bearing}°","text-rotation-alignment":"map","text-size":12},paint:{"text-opacity":1,"text-color":"#fff","text-halo-color":"#F44336","text-halo-width":4,"text-halo-blur":0}});const s=a.features.filter(n=>n.geometry.type==="Point");for(const n of s){const l=document.createElement("div");l.id=`${a.id}-${n.properties.id}`,l.className=`${a.closed?"point-marker closed":"point-marker"}`,l.innerHTML='<div class="marker-circle"></div>';const h=new O.Marker({element:l,draggable:!0,contextmenu:!0}).setLngLat(n.geometry.coordinates).addTo(this.map);h.on("drag",this.handleDrag),h.on("dragend",this.handleDragEnd),this.pointMarkers[a.id]?this.pointMarkers[a.id].push(h):this.pointMarkers[a.id]=[h]}if(a.closed){const n=s.at(-1),h=a.features.filter(c=>c.geometry.type==="LineString").at(-1),d=document.createElement("div");d.className="point-summary-marker",d.innerHTML=`<div id="${a.id}" class="marker-close">×</div><div class="marker-label">Tol: ${h.properties.total}nm</div>`,this.closeMarkers[a.id]=new O.Marker(d).setOffset([60,0]).setLngLat(n.geometry.coordinates).addTo(this.map)}}},handleClear(a,e=!0){var s,n,l,h,d,c,m,u,p;const t=`${a.id}-${this.source}`,o=`${a.id}-${this.layer}`,i=`${a.id}-${this.labelLayer}`;(s=this.map)!=null&&s.getLayer(o)&&this.map.removeLayer(o),(n=this.map)!=null&&n.getLayer(i)&&this.map.removeLayer(i),(l=this.map)!=null&&l.getLayer(this.tmpLayer)&&this.map.removeLayer(this.tmpLayer),(h=this.map)!=null&&h.getLayer(this.tmpLabelLayer)&&this.map.removeLayer(this.tmpLabelLayer),(d=this.closeMarkers[a.id])==null||d.remove(),this.closeMarkers[a.id]=void 0,(c=this.pointMarkers[a.id])==null||c.forEach(b=>{b==null||b.remove()}),this.pointMarkers[a.id]=[],(m=this.tipMarker)==null||m.remove(),this.tipMarker=void 0,e&&((u=this.map)!=null&&u.getSource(t))&&this.map.removeSource(t),e&&((p=this.map)!=null&&p.getSource(this.tmpSource))&&this.map.removeSource(this.tmpSource)}}};function gr(a,e,t,o,i,s){return r.openBlock(),r.createElementBlock("div")}const br=k(ur,[["render",gr]]),Zr="",wr={name:"IdmENC",props:{map:{type:Object},enabled:{type:Boolean},beforeLayer:{type:String,default:"grayland"},bottom:{type:String,default:"260px"},token:{type:String,default:""},toggleVersion:{type:Number},permission:{type:Number}},emits:["enc"],data(){return{helper:ce,vendor:this.$attrs.permission&ce.LEVEL.Supper?"hi":"i4",right:10}},watch:{vendor:{handler(){this.$emit("enc",this.vendor)},immediate:!0},toggleVersion:{handler(){var a;this.right=(((a=document.getElementsByClassName("right-bar")[0])==null?void 0:a.clientWidth)||0)+10},immediate:!0}},methods:{}},Lr={key:0},vr={class:"bar-item"};function xr(a,e,t,o,i,s){const n=r.resolveComponent("ElTooltip");return t.enabled&&t.permission&i.helper.LEVEL.Supper?(r.openBlock(),r.createElementBlock("div",Lr,[r.createElementVNode("div",{class:"menu-bar-box",style:r.normalizeStyle({position:"absolute",right:i.right+"px",bottom:t.bottom})},[r.createElementVNode("div",vr,[r.createVNode(n,{placement:"left",effect:"light",content:"Hifleet","show-after":1e3},{default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(i.vendor==="hi"?"menu-icon active":"menu-icon"),onClick:e[0]||(e[0]=l=>i.vendor="hi")},e[2]||(e[2]=[r.createElementVNode("span",{class:"iconfont"},"HI",-1)]),2)]),_:1}),r.createVNode(n,{placement:"left",effect:"light",content:"I4insight","show-after":1e3},{default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(i.vendor==="i4"?"menu-icon active":"menu-icon"),onClick:e[1]||(e[1]=l=>i.vendor="i4")},e[3]||(e[3]=[r.createElementVNode("span",{class:"iconfont"},"I4",-1)]),2)]),_:1})])],4)])):r.createCommentVNode("",!0)}const _r=k(wr,[["render",xr],["__scopeId","data-v-5873cc66"]]),Gr="",Cr={name:"IdmGLV2",components:{IdmGlLayer:et,IdmWindBarb:it,IdmWindParticle:lt,IdmCurrents:mt,IdmCurrentParticle:ut,IdmSigWave:wt,IdmSwell:xt,IdmPrmsl:kt,IdmIceberg:Pt,IdmTropicals:be,IdmPrecip3h:Xt,IdmVisibility:Kt,IdmWaterTemp:ra,IdmTemp:na,IdmArctic:da,IdmWarZone:Va,IdmGmdssArea:Da,IdmEcaZone:Ma,IdmAlertZone:$a,IdmPort:Qa,IdmLoadLine:tr,IdmTimezone:ir,IdmVRA:nr,IdmSpecialArea:hr,IdmTerminator:pr,IdmLatLng:we,IdmMeasure:br,IdmPoint:za,IdmENC:_r},props:{map:{type:Object,default:void 0},token:{type:String},ts:{type:String},beforeLayer:{type:String,default:""},toggleVersion:{type:Number}},emits:["toggleVersion","activeWeatherLayers"],data(){return{weatherLayers:{},activeWeatherLayers:[],weatherWeight:0,otherLayers:{},otherWeight:0,showCoord:!1,showMeasure:!1,showPoint:!1,show3d:!1,meteo:void 0,source:"",gateway:"https://cbe.idmwx.com",mapProjection:"mercator",zoom:6,viewport:void 0,particleFactor:void 0,showRampColor:!1,activeWindLayer:!1,showWindFeather:!1,showWindParticle:!1,showCurrentIsoband:!1,showCurrentParticle:!1,enc:"",defaultMeteoToken:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6ImNseTVudHJzYzAwNWUwbHBsZHkyaDRqczMiLCJyb2xlIjoxLCJuYW1lIjoiZmFrZUBvcm13eC5jb20iLCJwbGF0SWQiOiJnZDBtdDFkIiwiY29tcGFueSI6eyJpZCI6bnVsbCwiY2hpbGRyZW4iOltdfSwiaWF0IjoxNzIzMDI0MDI0LCJleHAiOjM5MzA1NDQwMjR9.RrKcdcMnq-FxBLJQ-i6lx2FscDE46y8EvHIemPW4HTg",helper:new ve}},watch:{ts:{handler(a,e){a&&e&&B(a).utc().format("yyyy-MM-DD HH")!==B(e).utc().format("yyyy-MM-DD HH")&&this.$nextTick(()=>{this.handleDateChange({tropicals:!1})})},immediate:!0},map:{handler(){this.map&&(this.map.on("zoomend",this.handleDragEndWithZoom4Json),this.map.on("dragend",this.handleDragEndWithZoom4Json),this.map.on("move",this.handleDragEndWithZoom4Image),this.viewport=new ue(this.map),this.handleRampColorInitial())},immediate:!0},enc:{handler(a,e){var t,o,i,s,n,l,h,d;a?((o=(t=this.map)==null?void 0:t.getLayer(a))==null||o.setLayoutProperty("visibility","visible"),(s=(i=this.map)==null?void 0:i.getLayer(e))==null||s.setLayoutProperty("visibility","none")):((l=(n=this.map)==null?void 0:n.getLayer("i4"))==null||l.setLayoutProperty("visibility","none"),(d=(h=this.map)==null?void 0:h.getLayer("hi"))==null||d.setLayoutProperty("visibility","none"))}},activeWeatherLayers:{handler(){var a,e,t,o,i,s,n,l,h,d,c,m,u,p,b,f,y,w;if(!this.map)return!1;this.activeWeatherLayers.length>0?((e=(a=this.map)==null?void 0:a.getLayer(this.enc))==null||e.setLayoutProperty("visibility","none"),(o=(t=this.map)==null?void 0:t.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))==null||o.setLayoutProperty("visibility","visible"),(s=this.map)!=null&&s.getLayer((i=this.viewport)==null?void 0:i.rampColorLayer)&&((n=this.map)!=null&&n.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&this.mapProjection==="mercator"&&((h=this.map)==null||h.moveLayer((l=this.viewport)==null?void 0:l.rampColorLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)),(c=this.map)!=null&&c.getLayer((d=this.viewport)==null?void 0:d.particleLayer)&&((m=this.map)!=null&&m.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&this.mapProjection==="mercator"&&((p=this.map)==null||p.moveLayer((u=this.viewport)==null?void 0:u.particleLayer,this.helper.mapboxCustomer.layers.countryBoundary.id))):((f=(b=this.map)==null?void 0:b.getLayer(this.enc))==null||f.setLayoutProperty("visibility","visible"),(w=(y=this.map)==null?void 0:y.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))==null||w.setLayoutProperty("visibility","none")),this.$emit("activeWeatherLayers",this.activeWeatherLayers)},immediate:!0}},methods:{async fetchWeatherLayers(a={tropicals:!1}){var i,s,n,l,h,d,c,m;const e=new Date().valueOf();let t=0,o=0;if(this.map){const u=((i=this.map)==null?void 0:i.getZoom())+1,p=(s=this.map)==null?void 0:s.getBounds(),b=`${p._sw.lng},${p._sw.lat},${p._ne.lng},${p._ne.lat}`;if(this.handleRampColorState(),this.particleFactor){const f=he.WEATHER_LAYERS.find(y=>{var w;return((w=y.peer)==null?void 0:w.weight)===this.particleFactor.weight});this.particleFactor.particle?this.weatherWeight=this.weatherWeight&f.weight?this.weatherWeight:this.weatherWeight+f.weight:this.weatherWeight=this.weatherWeight&f.weight?this.weatherWeight-f.weight:this.weatherWeight}if(this.weatherWeight>0){let f=this.weatherWeight,y;if(a.tropicals||this.weatherWeight&256&&(y=this.weatherLayers.tropicals,y&&(f-=256,y.version=Math.random()+1)),f>0){const w=await U.get(`${this.gateway}/api/arc/weather/layers/links?l=${f}&v=${this.source}&z=${u}&bbox=${b}&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(o=new Date().valueOf()-(e+t),console.log("weather links elapsed: ",o,", total: ",t+=o),((n=w==null?void 0:w.data)==null?void 0:n.code)===0){const g=(l=w==null?void 0:w.data)==null?void 0:l.data,v=[];for(const L in g)L==="ice-edge"&&(g[L]="https://idm-hz.oss-cn-hangzhou.aliyuncs.com/test/sea_ice_contours.geojson"),L!=="tropicals"&&v.push(U.get(g[L],{headers:{Authorization:this.token||this.defaultMeteoToken,key:L},responseType:/\.(jpg|png)$/.test(g[L])?"blob":"json"}).catch(z=>{console.log(`[${L}] fetch layer error: ${z}`)}));const _=await Promise.all(v);this.weatherLayers={},_.map(L=>{var V,R,D,M;const z=((V=L==null?void 0:L.data)==null?void 0:V.data)||(L==null?void 0:L.data),N=(D=(R=L==null?void 0:L.config)==null?void 0:R.headers)==null?void 0:D.key;N&&z&&(this.weatherLayers[N]={raw:z,type:((M=L==null?void 0:L.config)==null?void 0:M.responseType)==="blob"?"image":"json",etime:this.ts})}),g.tropicals&&U.get(g.tropicals,{headers:{Authorization:this.token||this.defaultMeteoToken,key:"tropicals"}}).then(L=>{var V,R,D;const z=C.TropicalHelper.convert2Geojson(((V=L==null?void 0:L.data)==null?void 0:V.data)||(L==null?void 0:L.data)),N=(D=(R=L==null?void 0:L.config)==null?void 0:R.headers)==null?void 0:D.key;this.weatherLayers[N]={data:z,active:!0,cached:!1,type:"json",etime:this.ts,version:Math.random()+1}})}if(o=new Date().valueOf()-(e+t),console.log("weather layers elapsed: ",o,", total: ",t+=o),this.weatherLayers["swell-direction"]||this.weatherLayers["swell-height"]){const g=(h=this.weatherLayers["swell-direction"])==null?void 0:h.raw,v=(d=this.weatherLayers["swell-height"])==null?void 0:d.raw;delete this.weatherLayers["swell-direction"],delete this.weatherLayers["swell-height"],this.weatherLayers.swell={type:"json",direction:g,height:{raw:v},etime:this.ts}}if(this.weatherLayers["current-direction"]||this.weatherLayers["current-speed"]){const g=(c=this.weatherLayers["current-direction"])==null?void 0:c.raw,v=(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:g,speed:{raw:v},etime:this.ts}}}y&&(y.etime=this.ts,y.cached=!0,this.weatherLayers.tropicals=y)}this.handleWeatherLayerToggle(),this.handleDragEndWithZoom4Json()}this.$emit("toggleVersion",Math.random())},async fetchOtherLayers(a={all:!1,dayNight:!1,enc:!1}){var e,t,o,i;if(this.map){let s=this.otherWeight;if(s){let n=!1;if(this.otherWeight&2048&&(s=this.otherWeight-2048,n=!0),s){if(a.all){const l=await U.get(`${this.gateway}/api/arc/other/layers/links?l=${s}&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(((e=l==null?void 0:l.data)==null?void 0:e.code)===0){const h=(t=l==null?void 0:l.data)==null?void 0:t.data,d=[];for(const m in h)d.push(U.get(h[m],{headers:{Authorization:this.token||this.defaultMeteoToken,key:m}}));const c=await Promise.all(d);this.otherLayers={enc:n},c.map(m=>{var b,f,y;const u=((b=m==null?void 0:m.data)==null?void 0:b.data)||(m==null?void 0:m.data),p=(y=(f=m==null?void 0:m.config)==null?void 0:f.headers)==null?void 0:y.key;this.otherLayers[p]=u})}}else if(a.dayNight&&s&1024){const l=await U.get(`${this.gateway}/api/arc/other/layers/links?l=1024&t=${this.ts}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(((o=l==null?void 0:l.data)==null?void 0:o.code)===0){const h=(i=l==null?void 0:l.data)==null?void 0:i.data,d=[];for(const m in h)d.push(U.get(h[m],{headers:{Authorization:this.token||this.defaultMeteoToken,key:m}}));(await Promise.all(d)).map(m=>{var b,f,y;const u=((b=m==null?void 0:m.data)==null?void 0:b.data)||(m==null?void 0:m.data),p=(y=(f=m==null?void 0:m.config)==null?void 0:f.headers)==null?void 0:y.key;this.otherLayers[p]=u})}}}else this.otherLayers={enc:n}}else this.otherLayers={};this.handleBeforeLayerToggle()}},handleRampColorState(){var a;if(this.showRampColor=!1,this.showWindParticle=!1,this.showCurrentParticle=!1,(a=this.particleFactor)!=null&&a.particle)this.showRampColor=!0,this.showWindParticle=this.particleFactor.key==="wind",this.showCurrentParticle=this.particleFactor.key==="current",this.activeWeatherLayers=this.activeWeatherLayers.filter(e=>e.type==="json");else for(const e of this.activeWeatherLayers)["png","jpg"].includes(e.type)&&(this.showRampColor=!0);this.activeWindLayer=!!this.activeWeatherLayers.find(e=>e.key==="wind"),this.$refs.layer&&(this.$refs.layer.activeWeatherLayers=this.activeWeatherLayers)},handleRampColorInitial(){var a,e,t,o,i,s,n,l,h,d,c,m;this.viewport.map.getSource((a=this.viewport)==null?void 0:a.rampColorSource)||this.viewport.map.addSource((e=this.viewport)==null?void 0:e.rampColorSource,{type:"canvas",canvas:(t=this.viewport)==null?void 0:t.rampColorCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((o=this.viewport)==null?void 0:o.rampColorLayer)||this.viewport.map.addLayer({type:"raster",id:(i=this.viewport)==null?void 0:i.rampColorLayer,source:(s=this.viewport)==null?void 0:s.rampColorSource,layout:{visibility:"none"}},this.beforeLayer),this.viewport.map.getSource((n=this.viewport)==null?void 0:n.particleSource)||this.viewport.map.addSource((l=this.viewport)==null?void 0:l.particleSource,{type:"canvas",canvas:(h=this.viewport)==null?void 0:h.particleCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((d=this.viewport)==null?void 0:d.particleLayer)||this.viewport.map.addLayer({type:"raster",id:(c=this.viewport)==null?void 0:c.particleLayer,source:(m=this.viewport)==null?void 0:m.particleSource,layout:{visibility:"none"}},this.beforeLayer)},handleDragEndWithZoom4Json(){var d,c,m,u;const a=new Date().valueOf();let e=0,t=0;const o=(d=this.map)==null?void 0:d.getBounds(),i=this.map.getZoom(),s=C.LngLatHelper.convertToStdLng(o._sw.lng),n=C.LngLatHelper.convertToStdLng(o._ne.lng),l=Math.floor(o._sw.lat),h=Math.ceil(o._ne.lat);for(const p in this.weatherLayers)if(this.weatherLayers[p].active&&this.weatherLayers[p].type==="json"){this.weatherLayers[p].active=!1,this.weatherLayers[p].version=Math.random()+1;let b=[];if(["swell","current"].includes(p)){const f=((c=this.weatherLayers[p])==null?void 0:c.direction)||{};for(const y in f)if(y>l&&y<h&&(!(i<=this.zoom)||y%(i<this.zoom/2?5:3)===0)){const w=f[y].lng;s>n?w.forEach((g,v)=>{var _;if((g>=s&&g<=180||g>=-180&&g<=n)&&(!(i<=this.zoom)||g%(i<this.zoom/2?5:3)===0)){const L=x.point([g,y],{val:f[y].val[v],spd:(_=f[y].spd)==null?void 0:_[v]});b.push(L)}}):w.forEach((g,v)=>{var _;if(g>=s&&g<=n&&(!(i<=this.zoom)||g%(i<this.zoom/2?5:3)===0)){const L=x.point([g,y],{val:f[y].val[v],spd:(_=f[y].spd)==null?void 0:_[v]});b.push(L)}})}if(t=new Date().valueOf()-(a+e),console.log("direction elapsed: ",t,", total: ",e+=t),p==="swell"){const y=this.weatherLayers[p].height;if(y){if(!y.data){const w=[];for(const g in(m=y.raw)==null?void 0:m.LineString){const v=y.raw.LineString[g];for(const _ of v)w.push(x.lineString(_,{val:Number(g)}));y.data=x.featureCollection(w)}}if(y.data){const w=this.handleBboxClip(y.data,o);b=b.concat(w)}t=new Date().valueOf()-(a+e),console.log("height elapsed: ",t,", total: ",e+=t)}}if(p==="current"){const y=this.weatherLayers[p].speed;if(y){if(!y.data){const g=[];for(const v in(u=y.raw)==null?void 0:u.Polygon){const _=y.raw.Polygon[v];for(const L of _)g.push(x.polygon(L,{val:Number(v)}))}y.data=x.featureCollection(g)}const w=i<this.zoom?y.data.features.filter(g=>g.properties.val>.5):y.data.features;b=b.concat(w),t=new Date().valueOf()-(a+e),console.log("speed elapsed: ",t,", total: ",e+=t)}}}else if(p==="wind"){const f=this.weatherLayers.wind.raw;for(const y in f)if(y>l&&y<h&&(!(i<=this.zoom)||y%(i<this.zoom/2?5:3)===0)){const w=f[y].lng;s>n?w.forEach((g,v)=>{if((g>=s&&g<=180||g>=-180&&g<=n)&&(!(i<=this.zoom)||g%(i<this.zoom/2?5:3)===0)){const _=x.point([g,y],{val:f[y].val[v],spd:f[y].spd[v]});b.push(_)}}):w.forEach((g,v)=>{if(g>=s&&g<=n&&(!(i<=this.zoom)||g%(i<this.zoom/2?5:3)===0)){const _=x.point([g,y],{val:f[y].val[v],spd:f[y].spd[v]});b.push(_)}})}t=new Date().valueOf()-(a+e),console.log("wind barb elapsed: ",t,", total: ",e+=t)}else if(p==="sig-wave-height"){if(this.weatherLayers[p].data)b=this.weatherLayers[p].data;else{const f=this.weatherLayers[p].raw;if(f){const y=[];for(const w in f.Polygon){const g=f.Polygon[w];for(const v of g)y.push(x.polygon(v,{val:Number(w)}))}for(const w in f.Point){const g=f.Point[w];for(const v of g)y.push(...x.points(v,{val:Number(w)}).features)}b=b.concat(y)}}t=new Date().valueOf()-(a+e),console.log("sigWave elapsed: ",t,", total: ",e+=t)}else if(p==="prmsl"){if(this.weatherLayers[p].data)b=this.weatherLayers[p].data;else{const f=this.weatherLayers[p].raw;if(f){const y=[];for(const w in f.LineString){const g=f.LineString[w];for(const v of g)y.push(x.lineString(v,{val:Number(w)}))}for(const w in f.Point)f.Point[w].lng.forEach((g,v)=>{g=C.LngLatHelper.convertToStdLng(g),y.push(x.point([g,w],{val:f.Point[w].val[v],type:f.Point[w].type[v]}))});b=b.concat(y)}}t=new Date().valueOf()-(a+e),console.log("prmsl elapsed: ",t,", total: ",e+=t)}else if(p==="arctic"||p==="iceberg"){if(this.weatherLayers[p].data)b=this.weatherLayers[p].data;else{const f=this.weatherLayers[p].raw;if(f){const y=[];for(const w in f.LineString){const g=f.LineString[w];for(const v of g)y.push(x.lineString(v,{val:Number(w)}))}b=b.concat(y)}}t=new Date().valueOf()-(a+e)}console.log(p," elapsed: ",t,", total: ",e+=t),b.length&&(this.weatherLayers[p].data=x.featureCollection(b)),this.weatherLayers[p].active=!0,this.weatherLayers[p].version=Math.random()+1}},handleDragEndWithZoom4Image(){for(const a in this.weatherLayers)this.weatherLayers[a].active&&this.weatherLayers[a].type==="image"&&(this.weatherLayers[a].active=!0,this.weatherLayers[a].version=Math.random()+1)},handleBboxClip(a,e){const t=[],o=C.LngLatHelper.convertToStdLng(e._sw.lng),i=C.LngLatHelper.convertToStdLng(e._ne.lng);return a.features.forEach(s=>{if(s.geometry.type!=="Point")if(o>i){let n=[o,e._sw.lat,180,e._ne.lat],l=x.bboxClip(s,n);l.geometry.coordinates.length&&t.push(l),n=[-180,e._sw.lat,i,e._ne.lat],l=x.bboxClip(s,n),l.geometry.coordinates.length&&t.push(l)}else{const n=[o,e._sw.lat,i,e._ne.lat],l=x.bboxClip(s,n);l.geometry.coordinates.length&&t.push(l)}else t.push(s)}),t},handleWeatherLayerToggle(){var a;for(const e in this.weatherLayers)this.weatherLayers[e].active=!1,this.weatherLayers[e].version=Math.random()+1;for(const e of this.activeWeatherLayers){let t=e.key;t.indexOf("swell")>-1?t="swell":t.indexOf("current")>-1&&(t="current"),this.weatherLayers[t]&&(this.weatherLayers[t].active=!0,this.weatherLayers[t].version=Math.random()+1,((a=this.particleFactor)==null?void 0:a.key)===t&&this.weatherLayers[`${t}-particle`]&&(this.weatherLayers[`${t}-particle`].active=this.particleFactor.particle))}this.handleBeforeLayerToggle()},handleBeforeLayerToggle(){var a,e,t,o,i,s,n,l,h,d,c,m,u;(a=this.map)!=null&&a.getLayer(this.beforeLayer)&&((e=this.activeWeatherLayers)!=null&&e.length||(t=this.otherLayers)!=null&&t["war-zones"]||(o=this.otherLayers)!=null&&o["gmdss-areas"]||(i=this.otherLayers)!=null&&i["load-lines"]||(s=this.otherLayers)!=null&&s["high-risk-area"]||(n=this.otherLayers)!=null&&n["time-zones"]||(l=this.otherLayers)!=null&&l.pirates||(h=this.otherLayers)!=null&&h.ports||(d=this.otherLayers)!=null&&d.enc||(c=this.otherLayers)!=null&&c["voluntary-reporting-area"]||(m=this.otherLayers)!=null&&m["eca-zones"]||(u=this.otherLayers)!=null&&u["special-area"])&&this.map.setLayoutProperty(this.beforeLayer,"visibility","visible")},handleDateChange(a={tropicals:!1}){this.fetchWeatherLayers(a),this.fetchOtherLayers({dayNight:!0})},handleWeatherLayerChange(a,e){if(!this.map)setTimeout(()=>{this.handleWeatherLayerChange(a,e)},500);else{this.activeWeatherLayers=a;const t=this.activeWeatherLayers.some(s=>{var n;return["wind","current"].includes(s.key)&&(!((n=Object.keys(s))!=null&&n.some(l=>l==="particle"))||!!s.particle)}),o=this.activeWeatherLayers.some(s=>["png","jpg"].includes(s.type));t&&!o?(this.activeWeatherLayers.forEach(s=>{["wind","current"].includes(s.key)&&(this.particleFactor=s)}),this.particleFactor.particle=!0):o&&this.particleFactor&&(this.particleFactor.particle=!1);const i=a==null?void 0:a.reduce((s,n)=>s+(s&(n==null?void 0:n.weight)?0:n==null?void 0:n.weight),0);this.weatherWeight!==i||this.source!==e?(this.source=e,this.weatherWeight=i,this.fetchWeatherLayers({tropicals:!1})):this.handleWeatherLayerToggle()}},handleOtherLayerChange(a){if(!this.map)setTimeout(()=>{this.handleOtherLayerChange(a)},500);else{const e=a==null?void 0:a.reduce((t,o)=>t+(o==null?void 0:o.weight),0);a.find(t=>t.key==="enc")?this.enc="i4":this.enc="",this.otherWeight!=e&&(this.otherWeight=e,this.fetchOtherLayers({all:!0}))}},async handlePointChange(a){const e=this.ts?B(this.ts):B(),t={lat:a.lat,lng:a.lng,ts:e.utc().format(),wt:!0,src:this.source},o=await U.get(`${this.gateway}/api/arc/meteo/query`,{params:t,headers:{Authorization:this.token||this.defaultMeteoToken}});(o==null?void 0:o.status)===200&&(this.meteo={...o==null?void 0:o.data,...a})},handle3dToggle(a){var e,t,o,i,s,n,l,h,d,c,m,u,p,b,f,y,w,g,v,_;a?(this.map.setProjection("globe"),this.mapProjection="globe",(t=this.map)!=null&&t.getLayer((e=this.viewport)==null?void 0:e.rampColorLayer)&&((o=this.map)!=null&&o.getLayer(this.helper.mapboxCustomer.layers.water.id))&&((s=this.map)==null||s.moveLayer((i=this.viewport)==null?void 0:i.rampColorLayer,this.helper.mapboxCustomer.layers.water.id)),(l=this.map)!=null&&l.getLayer((n=this.viewport)==null?void 0:n.particleLayer)&&((h=this.map)!=null&&h.getLayer(this.helper.mapboxCustomer.layers.water.id))&&((c=this.map)==null||c.moveLayer((d=this.viewport)==null?void 0:d.particleLayer,this.helper.mapboxCustomer.layers.water.id)),this.map.off("zoomend",this.handleDragEndWithZoom4Json),this.map.off("dragend",this.handleDragEndWithZoom4Json),this.map.off("move",this.handleDragEndWithZoom4Image)):(this.map.setProjection("mercator"),this.mapProjection="mercator",this.map.on("zoomend",this.handleDragEndWithZoom4Json),this.map.on("dragend",this.handleDragEndWithZoom4Json),this.map.on("move",this.handleDragEndWithZoom4Image),this.handleDragEndWithZoom4Image(),this.handleDragEndWithZoom4Json(),(u=this.map)!=null&&u.getLayer((m=this.viewport)==null?void 0:m.rampColorLayer)&&((p=this.map)!=null&&p.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&((f=this.map)==null||f.moveLayer((b=this.viewport)==null?void 0:b.rampColorLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)),(w=this.map)!=null&&w.getLayer((y=this.viewport)==null?void 0:y.particleLayer)&&((g=this.map)!=null&&g.getLayer(this.helper.mapboxCustomer.layers.countryBoundary.id))&&((_=this.map)==null||_.moveLayer((v=this.viewport)==null?void 0:v.particleLayer,this.helper.mapboxCustomer.layers.countryBoundary.id)))},handleParticle(a){this.particleFactor=a,this.weatherLayers[a.key]&&(this.weatherLayers[a.key].particle=a.particle),this.activeWeatherLayers.forEach(o=>{o.key===a.key&&(o.particle=a.particle)});let e=localStorage.getItem("weatherLayersCache");const t=JSON.parse(e)||[];t==null||t.forEach(o=>{o.key===a.key&&(o.particle=a.particle)}),localStorage.setItem("weatherLayersCache",JSON.stringify(t)),this.fetchWeatherLayers({tropicals:!1})},handleToggleVersion(){this.$emit("toggleVersion",Math.random())}}},kr={key:0,className:"map-gl-home"};function Sr(a,e,t,o,i,s){var G,j,F,oe,$,S,A,se,H,ne,J,X,q,de,me,pe,ye,fe,Le,_e,Ce,ke,Se,Ee,Pe,ze;const n=r.resolveComponent("IdmGlLayer"),l=r.resolveComponent("IdmENC"),h=r.resolveComponent("IdmSigWave"),d=r.resolveComponent("IdmSwell"),c=r.resolveComponent("IdmPrmsl"),m=r.resolveComponent("IdmIceberg"),u=r.resolveComponent("IdmTropicals"),p=r.resolveComponent("IdmCurrents"),b=r.resolveComponent("IdmCurrentParticle"),f=r.resolveComponent("IdmWindBarb"),y=r.resolveComponent("IdmWindParticle"),w=r.resolveComponent("IdmPrecip3h"),g=r.resolveComponent("IdmVisibility"),v=r.resolveComponent("IdmWaterTemp"),_=r.resolveComponent("IdmTemp"),L=r.resolveComponent("IdmArctic"),z=r.resolveComponent("IdmWarZone"),N=r.resolveComponent("IdmGmdssArea"),V=r.resolveComponent("IdmEcaZone"),R=r.resolveComponent("IdmAlertZone"),D=r.resolveComponent("IdmPort"),M=r.resolveComponent("IdmLoadLine"),Q=r.resolveComponent("IdmTimezone"),K=r.resolveComponent("IdmVRA"),ee=r.resolveComponent("IdmSpecialArea"),te=r.resolveComponent("IdmTerminator"),ae=r.resolveComponent("IdmLatLng"),re=r.resolveComponent("IdmMeasure"),ie=r.resolveComponent("IdmPoint");return t.map?(r.openBlock(),r.createElementBlock("div",kr,[r.createVNode(n,r.mergeProps({ref:"layer",map:t.map,"toggle-version":t.toggleVersion,"map-projection":i.mapProjection,showWindFeather:i.showWindFeather,showWindParticle:i.showWindParticle,showCurrentIsoband:i.showCurrentIsoband,showCurrentParticle:i.showCurrentParticle},a.$attrs,{onWeather:s.handleWeatherLayerChange,onOther:s.handleOtherLayerChange,onCoordinate:e[0]||(e[0]=W=>i.showCoord=W),onMeasure:e[1]||(e[1]=W=>i.showMeasure=W),onPoint:e[2]||(e[2]=W=>i.showPoint=W),on3d:s.handle3dToggle,onHandleToggleVersion:s.handleToggleVersion}),null,16,["map","toggle-version","map-projection","showWindFeather","showWindParticle","showCurrentIsoband","showCurrentParticle","onWeather","onOther","on3d","onHandleToggleVersion"]),r.createVNode(l,r.mergeProps({map:t.map,token:t.token,enabled:(G=i.otherLayers)==null?void 0:G.enc,"toggle-version":t.toggleVersion},a.$attrs,{onEnc:e[3]||(e[3]=W=>i.enc=W)}),null,16,["map","token","enabled","toggle-version"]),r.createVNode(h,r.mergeProps({map:t.map,"sig-wave":(j=i.weatherLayers)==null?void 0:j["sig-wave-height"],"before-layer":t.beforeLayer,activeWeatherLayers:i.activeWeatherLayers},a.$attrs),null,16,["map","sig-wave","before-layer","activeWeatherLayers"]),r.createVNode(d,r.mergeProps({map:t.map,swell:(F=i.weatherLayers)==null?void 0:F.swell,"before-layer":t.beforeLayer,activeWeatherLayers:i.activeWeatherLayers},a.$attrs),null,16,["map","swell","before-layer","activeWeatherLayers"]),r.createVNode(c,r.mergeProps({map:t.map,prmsl:(oe=i.weatherLayers)==null?void 0:oe.prmsl,"before-layer":t.beforeLayer,"active-weather-layers":i.activeWeatherLayers},a.$attrs),null,16,["map","prmsl","before-layer","active-weather-layers"]),r.createVNode(m,r.mergeProps({map:t.map,iceberg:($=i.weatherLayers)==null?void 0:$.iceberg,"before-layer":t.beforeLayer},a.$attrs),null,16,["map","iceberg","before-layer"]),r.createVNode(u,r.mergeProps({map:t.map,date:t.ts,tropicals:(S=i.weatherLayers)==null?void 0:S.tropicals,"before-layer":t.beforeLayer},a.$attrs),null,16,["map","date","tropicals","before-layer"]),r.createVNode(p,r.mergeProps({map:t.map,"map-projection":i.mapProjection,current:(A=i.weatherLayers)==null?void 0:A.current,"before-layer":t.beforeLayer,"show-particle":i.showCurrentParticle,"margin-bottom":i.activeWindLayer?i.showRampColor?"84px":"56px":i.showRampColor?"56px":"30px","toggle-version":t.toggleVersion,"weather-layers":i.weatherLayers},a.$attrs,{onShowCurrentIsoband:e[4]||(e[4]=W=>i.showCurrentIsoband=W),onParticle:s.handleParticle,onHandleToggleVersion:s.handleToggleVersion}),null,16,["map","map-projection","current","before-layer","show-particle","margin-bottom","toggle-version","weather-layers","onParticle","onHandleToggleVersion"]),r.createVNode(b,r.mergeProps({viewport:i.viewport,factor:(se=i.weatherLayers)==null?void 0:se["current-particle"],"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),r.createVNode(f,r.mergeProps({ref:"windBarb",map:t.map,"map-projection":i.mapProjection,wind:(H=i.weatherLayers)==null?void 0:H.wind,current:(ne=i.weatherLayers)==null?void 0:ne.current,"before-layer":t.beforeLayer,"margin-bottom":i.showRampColor?"56px":"30px","show-particle":i.showWindParticle},a.$attrs,{"toggle-version":t.toggleVersion,"weather-layers":i.weatherLayers,onParticle:s.handleParticle,onShowWindFeather:e[5]||(e[5]=W=>i.showWindFeather=W)}),null,16,["map","map-projection","wind","current","before-layer","margin-bottom","show-particle","toggle-version","weather-layers","onParticle"]),r.createVNode(y,r.mergeProps({viewport:i.viewport,factor:(J=i.weatherLayers)==null?void 0:J["wind-particle"],"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),r.createVNode(w,r.mergeProps({viewport:i.viewport,factor:(X=i.weatherLayers)==null?void 0:X.precip3h,"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),r.createVNode(g,r.mergeProps({viewport:i.viewport,factor:(q=i.weatherLayers)==null?void 0:q.visibility,"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),r.createVNode(v,r.mergeProps({viewport:i.viewport,factor:(de=i.weatherLayers)==null?void 0:de["water-temp"],"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),r.createVNode(_,r.mergeProps({viewport:i.viewport,factor:(me=i.weatherLayers)==null?void 0:me.temp,"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),r.createVNode(L,r.mergeProps({viewport:i.viewport,factor:(pe=i.weatherLayers)==null?void 0:pe.arctic,"before-layer":t.beforeLayer,"toggle-version":t.toggleVersion},a.$attrs),null,16,["viewport","factor","before-layer","toggle-version"]),r.createVNode(z,r.mergeProps({map:t.map,zone:(ye=i.otherLayers)==null?void 0:ye["war-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),r.createVNode(N,r.mergeProps({map:t.map,area:(fe=i.otherLayers)==null?void 0:fe["gmdss-areas"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","area","before-layer"]),r.createVNode(V,r.mergeProps({map:t.map,zone:(Le=i.otherLayers)==null?void 0:Le["eca-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),r.createVNode(R,r.mergeProps({map:t.map,zone:(_e=i.otherLayers)==null?void 0:_e["alert-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),r.createVNode(D,r.mergeProps({map:t.map,port:(Ce=i.otherLayers)==null?void 0:Ce.ports,"before-layer":t.beforeLayer},a.$attrs),null,16,["map","port","before-layer"]),r.createVNode(M,r.mergeProps({map:t.map,line:(ke=i.otherLayers)==null?void 0:ke["load-lines"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","line","before-layer"]),r.createVNode(Q,r.mergeProps({map:t.map,zone:(Se=i.otherLayers)==null?void 0:Se["time-zones"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","zone","before-layer"]),r.createVNode(K,r.mergeProps({map:t.map,area:(Ee=i.otherLayers)==null?void 0:Ee["voluntary-reporting-area"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","area","before-layer"]),r.createVNode(ee,r.mergeProps({map:t.map,area:(Pe=i.otherLayers)==null?void 0:Pe["special-area"],"before-layer":t.beforeLayer},a.$attrs),null,16,["map","area","before-layer"]),r.createVNode(te,r.mergeProps({map:t.map,area:(ze=i.otherLayers)==null?void 0:ze["day-night"]},a.$attrs),null,16,["map","area"]),r.createVNode(ae,r.mergeProps({map:t.map,show:i.showCoord,"toggle-version":t.toggleVersion},a.$attrs),null,16,["map","show","toggle-version"]),r.createVNode(re,r.mergeProps({map:t.map,show:i.showMeasure},a.$attrs),null,16,["map","show"]),r.createVNode(ie,r.mergeProps({map:t.map,show:i.showPoint,meteo:i.meteo},a.$attrs,{onPoint:s.handlePointChange}),null,16,["map","show","meteo","onPoint"])])):r.createCommentVNode("",!0)}const xe=k(Cr,[["render",Sr]]),Er={install(a){a.component("MapboxGL",xe),a.component("TropicalGL",be),a.component("LatLngGL",we)}};E.LatLngGL=we,E.MapboxGL=xe,E.MapboxGLPlugin=Er,E.MapboxHelper=ve,E.ParticleSchema=I,E.TropicalGL=be,E.Viewport=ue,E.WebGL=Z,E.WebGLSchema=T,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});