UNPKG

@idmwx/idmui-gl4

Version:

idm webgl4

6 lines 1.04 MB
(function(oe,le){typeof exports=="object"&&typeof module<"u"?le(exports,require("axios"),require("vuetify"),require("vue"),require("mapbox-gl"),require("moment"),require("@idm-plugin/geo"),require("@idm-plugin/meteo"),require("echarts"),require("@turf/turf"),require("@idm-plugin/tag2"),require("@mapbox/sphericalmercator"),require("@idm-plugin/tag"),require("shpjs"),require("gif.js"),require("@idm-plugin/aliclient")):typeof define=="function"&&define.amd?define(["exports","axios","vuetify","vue","mapbox-gl","moment","@idm-plugin/geo","@idm-plugin/meteo","echarts","@turf/turf","@idm-plugin/tag2","@mapbox/sphericalmercator","@idm-plugin/tag","shpjs","gif.js","@idm-plugin/aliclient"],le):(oe=typeof globalThis<"u"?globalThis:oe||self,le(oe["idm-gl"]={},oe.axios,oe.vuetify,oe.Vue,oe["mapbox-gl"],oe.moment,oe["@idm-plugin/geo"],oe["@idm-plugin/meteo"],oe.echarts,oe["@turf/turf"],oe["@idm-plugin/tag2"],oe["@mapbox/sphericalmercator"],oe["@idm-plugin/tag"],oe.shpjs,oe.GIF,oe["@idm-plugin/aliclient"]))})(this,function(oe,le,fe,o,ne,v,M,Ae,ur,fr,je,yr,br,wr,xr,kr){"use strict";var sy=Object.defineProperty;var cy=(oe,le,fe)=>le in oe?sy(oe,le,{enumerable:!0,configurable:!0,writable:!0,value:fe}):oe[le]=fe;var de=(oe,le,fe)=>(cy(oe,typeof le!="symbol"?le+"":le,fe),fe);function sa(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,r.get?r:{enumerable:!0,get:()=>t[a]})}}return e.default=t,Object.freeze(e)}const Mo=sa(ur),D=sa(fr),Y=(t,e)=>{const a=t.__vccOpts||t;for(const[r,i]of e)a[r]=i;return a},_r={name:"IdmWarZone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},setup(){return{Theme:fe.useTheme()}},data(){return{source:"war-zone-source",zoneLayer:"war-zone-layer",zoneLabelLayer:"war-zone-label-layer"}},watch:{zone:{handler(){this.handleRender()},immediate:!0}},methods:{handleRender(){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-color":this.Theme.current.value.colors["map-red"],"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":.7,"line-color":this.Theme.current.value.colors["map-red"]}},this.beforeLayer),this.map.addLayer({id:this.zoneLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.7,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,1],"text-font":["DIN Pro Regular","Arial Unicode MS Regular"]},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer))},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 Lr(t,e,a,r,i,l){return o.openBlock(),o.createElementBlock("div")}const zr=Y(_r,[["render",Lr]]),Cr={name:"IdmGmdssArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},setup(){return{Theme:fe.useTheme()}},data(){return{source:"gmdss-area-source",areaLayer:"gmdss-area-layer",areaLabelLayer:"gmdss-area-label-layer"}},watch:{area:{handler(){this.handleRender()},immediate:!0}},methods:{handleRender(){this.handleClear(),this.area&&(this.map.addSource(this.source,{type:"geojson",data:this.area}),console.log(this.beforeLayer),this.map.addLayer({id:this.areaLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-outline-color":"rgba(255,255,255,0.3)","fill-opacity":.4,"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":.7,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":12,"text-offset":[0,1],"text-font":["DIN Pro Regular","Arial Unicode MS Regular"]},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer))},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 vr(t,e,a,r,i,l){return o.openBlock(),o.createElementBlock("div")}const Sr=Y(Cr,[["render",vr]]),Nr={name:"IdmEcaZone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},setup(){return{Theme:fe.useTheme()}},data(){return{source:"eca-zone-source",zoneLayer:"eca-zone-layer",zoneLabelLayer:"eca-zone-label-layer"}},watch:{zone:{handler(){this.zone?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var t;this.handleClear(),this.zone&&(this.map.getSource(this.source)?(t=this.map)==null||t.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-opacity":.3,"fill-color":"#05f324"}},this.beforeLayer),this.map.addLayer({id:this.zoneLayer+"-border",type:"line",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-color":"#05f324","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":.7,"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,1],"text-font":["DIN Pro Regular","Arial Unicode MS Regular"]},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer)))},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 Pr(t,e,a,r,i,l){return o.openBlock(),o.createElementBlock("div")}const Vr=Y(Nr,[["render",Pr]]),my="",Mr={name:"IdmAlertZone",props:{simple:{type:Boolean,default:!1},map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},setup(){return{Theme:fe.useTheme()}},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",showMakerInfo:!1,form:{},marker:null}},watch:{zone:{handler(){var t,e,a,r,i,l;this.zone?(this.handleRender(),(t=this.map)==null||t.on("click",[this.polygonLabelLayer,this.lineLabelLayer,this.pointLayer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.polygonLabelLayer,this.lineLabelLayer,this.pointLayer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.polygonLabelLayer,this.lineLabelLayer,this.pointLayer],this.handleLeave)):(this.handleClear(),(r=this.map)==null||r.off("click",[this.polygonLabelLayer,this.lineLabelLayer,this.pointLayer],this.handleClick),(i=this.map)==null||i.off("mousemove",[this.polygonLabelLayer,this.lineLabelLayer,this.pointLayer],this.handleHover),(l=this.map)==null||l.off("mouseleave",[this.polygonLabelLayer,this.lineLabelLayer,this.pointLayer],this.handleLeave))},immediate:!0}},methods:{handleRender(){var t;this.handleClear(),this.zone&&(this.map.getSource(this.source)?(t=this.map)==null||t.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":this.Theme.current.value.colors["map-red"],"fill-opacity":.4,"fill-color":this.Theme.current.value.colors["map-red"]}},this.beforeLayer),this.map.addLayer({id:this.polygonLayer+"-border",type:"line",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-width":1,"line-color":this.Theme.current.value.colors["map-red"]}},this.beforeLayer),this.map.addLayer({id:this.lineLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["!=","disabled",!0]],paint:{"line-color":this.Theme.current.value.colors["map-red"],"line-width":2}},this.beforeLayer),this.map.addLayer({id:this.polygonLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-image":"warning","icon-size":1,"icon-offset":[0,-13],"icon-allow-overlap":!0,"icon-rotation-alignment":"viewport"},paint:{"icon-opacity":.8}},this.beforeLayer),this.map.addLayer({id:this.lineLabelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","LineString"],["!=","disabled",!0]],layout:{"symbol-placement":"line-center","icon-image":"warning","icon-size":1,"icon-offset":[0,-15],"icon-allow-overlap":!0,"icon-rotation-alignment":"viewport"},paint:{"icon-opacity":.8}},this.beforeLayer),this.map.addLayer({id:this.pointLayer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-image":"warning","icon-offset":[0,-15],"icon-size":1},paint:{"icon-opacity":.8}},this.beforeLayer)))},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)},handleHover(){this.map.getCanvas().style.cursor="pointer"},handleLeave(){this.map.getCanvas().style.cursor="grab"},handleClick(t){var r,i;const e=t.features[0],a=(i=(r=this.zone)==null?void 0:r.features)==null?void 0:i.filter(l=>{var n,c;return((n=l.properties)==null?void 0:n.id)===((c=e==null?void 0:e.properties)==null?void 0:c.id)})[0];a&&(this.showMakerInfo=!0,this.form={...a.properties},this.simple||this.drawMarker([t.lngLat.lng,t.lngLat.lat]))},drawMarker(t){var e;(e=this.marker)==null||e.remove(),this.$nextTick(()=>{var i,l;const a=(i=document.getElementById("idm-gl4-zone-info"))==null?void 0:i.cloneNode(!0),r=(l=a==null?void 0:a.children[1])==null?void 0:l.children[0];r&&(r.onclick=()=>{this.handleRemoveMarker()}),this.marker=new ne.Marker(a).setLngLat(t).setOffset([230,0]).addTo(this.map)})},handleRemoveMarker(){var t;this.showMakerInfo=!1,(t=this.marker)==null||t.remove()}}},Tr=["innerHTML"];function Dr(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("v-card-text"),s=o.resolveComponent("v-card");return i.showMakerInfo?(o.openBlock(),o.createBlock(s,{key:0,class:o.normalizeClass(["idm-gl4-zone-info overflow-auto scroll",a.simple?"page":"dialog"]),id:"idm-gl4-zone-info"},{default:o.withCtx(()=>[o.createVNode(c,null,{default:o.withCtx(()=>{var d;return[o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"close",onClick:o.withModifiers(l.handleRemoveMarker,["stop"])},{default:o.withCtx(()=>e[0]||(e[0]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[0]},8,["onClick"]),o.createElementVNode("div",{class:"rich-context",innerHTML:(d=i.form)==null?void 0:d.name},null,8,Tr)]}),_:1})]),_:1},8,["class"])):o.createCommentVNode("",!0)}const Er=Y(Mr,[["render",Dr]]),dy="",hy="",Rr={name:"PortDetail",props:{simple:{type:Boolean,default:!1},portId:{type:String},port:{type:Object},token:{type:String},defaultMeteoToken:{type:String},gateway:{type:String},followList:{type:Array},theme:{type:String,default:"dark"},realTime:{type:String},forecastModel:{type:String}},emits:["follow","cancelFollow","meteoMore","close","closeAllDetail"],setup(){return{Theme:fe.useTheme()}},data(){return{meteoData:{},tableData:[{label:"Hours",key:"time.hours",unit:"LT"},{label:"Weather",key:"weather.weather",img:!0,unit:""},{label:"Temp",key:"weather.temp",unit:"℃"},{label:"Precip",key:"weather.precip",unit:"mm"},{label:"Visibility",key:"weather.visibility",unit:"nm"},{label:"Wind",key:"weather.wind",unit:"kts"},{label:"Sig wave",key:"weather.sigWave",unit:"m"},{label:"Swell",key:"weather.swell",unit:"m"},{label:"Current",key:"weather.current",unit:"kts"}],currentIndex:0,loading:!1,interval:6,showTideDetail:!1,tideData:{},tideTableData:[],xDate:[],echartData:null}},computed:{dateList(){var a,r,i,l;const t=[],e=(a=this.port)!=null&&a.lng&&((r=this.port)!=null&&r.lat)?M.LngLatHelper.guessTimeZoneOffset((i=this.port)==null?void 0:i.lng,(l=this.port)==null?void 0:l.lat):0;for(let n=0;n<4;n++){let c={index:n,dateTimeList:[],label:v().utcOffset(e).add(n,"days").format("MM-DD ddd"),startTime:v().utcOffset(e).add(n,"days").set({hour:0,minute:0,second:0,millisecond:0}).format(),dateTime:v().utcOffset(e).add(n,"days").format()};for(let s=0;s<4;s++)c.dateTimeList.push(v(c.startTime).utcOffset(e).add(s*this.interval,"hours").utc().format());t.push(c)}return t},computeLocalTime(){return function(t,e,a="yyyy-MM-DD HH:mm"){if(!t||!e||e.lng===null||e.lng===void 0||isNaN(e.lng)||e.lat===null||e.lat===void 0||isNaN(e.lat))return"-";const r=e!=null&&e.lng&&(e!=null&&e.lat)?M.LngLatHelper.guessTimeZoneOffset(e==null?void 0:e.lng,e==null?void 0:e.lat):0;return v(t).utcOffset(r).format(a)}},computeTimeOffset(){return function(t){if(!t||t.lng===null||t.lng===void 0||isNaN(t.lng)||t.lat===null||t.lat===void 0||isNaN(t.lat))return"-";const e=M.LngLatHelper.guessTimeZoneOffset(t==null?void 0:t.lng,t==null?void 0:t.lat);return"( UTC "+(e>=0?"+":"")+e+" )"}},computePosition(){return function(t){return!t||t.lng===null||t.lng===void 0||isNaN(t.lng)||t.lat===null||t.lat===void 0||isNaN(t.lat)?"-":M.LngLatHelper.lat2pretty(t==null?void 0:t.lat,2).pretty+" / "+M.LngLatHelper.lng2pretty(t==null?void 0:t.lng,2).pretty}},computeRoundPrecision(){return function(t,e=4){return t==null||isNaN(t)||isNaN(e)?"-":M.LngLatHelper.roundPrecision(t,e)}}},watch:{portId:{handler(){var t,e,a;this.portId&&(this.$emit("closeAllDetail"),(a=(e=(t=this.$parent)==null?void 0:t.$parent)==null?void 0:e.$refs.idmIideStation)==null||a.handleCloseDetail(),this.fetchForecastData())},immediate:!0},currentIndex:{handler(){this.initTableData(this.meteoData),this.showTideDetail&&this.initTideTableData(this.tideData)}},theme:{handler(){this.$nextTick(()=>{this.initEchart()})}},showTideDetail:{handler(){this.showTideDetail&&this.echartData&&this.$nextTick(()=>{this.initEchart()})}}},mounted(){},methods:{handleFollow(){this.$emit("follow",{portId:this.portId})},handleCancelFollow(){var e;const t=(e=this.followList)==null?void 0:e.find(a=>{var r;return((r=a.port)==null?void 0:r.id)===this.portId});this.$emit("cancelFollow",t==null?void 0:t.id)},handleMeteoMore(){this.$emit("meteoMore",{...this.port,forecastModel:this.forecastModel})},handleClose(){this.$emit("close")},async fetchForecastData(){var r,i;this.loading=!0,this.meteoData=[];const{weatherModels:t,marineModels:e}=Ae.Meteo2Assist.autoPickMeteoModel(this.forecastModel);let a={lat:(r=this.port)==null?void 0:r.lat,lng:(i=this.port)==null?void 0:i.lng,datetime:this.realTime,pastDays:1,forecastDays:4,weatherModels:t,marineModels:e};await le.post(`${this.gateway}/api/arc/meteo2/spot/forecast`,a,{headers:{Authorization:this.token||this.defaultMeteoToken}}).then(l=>{var n;(l==null?void 0:l.data.code)===0?(this.meteoData=(n=l==null?void 0:l.data)==null?void 0:n.data,this.initTableData(this.meteoData),this.loading=!1):this.loading=!1}).catch(()=>{this.loading=!1})},initTableData(t){var e,a;this.tableData=[{label:"Hours",key:"time.hours",unit:"LT"},{label:"Weather",key:"weather.weather",img:!0,unit:""},{label:"Temp",key:"weather.temp",unit:"℃"},{label:"Precip",key:"weather.precip",unit:"mm"},{label:"Visibility",key:"weather.visibility",unit:"nm"},{label:"Wind",key:"weather.wind",unit:"kts"},{label:"Sig wave",key:"weather.sigWave",unit:"m"},{label:"Swell",key:"weather.swell",unit:"m"},{label:"Current",key:"weather.current",unit:"kts"}],(a=(e=this.dateList)==null?void 0:e[this.currentIndex])==null||a.dateTimeList.forEach((r,i)=>{var c,s,d,m,p,u,y,g,h,f,w,z,b,L,x,k,C,S,N,T,B,E,Z,X,$,ae,P,G,W,U,A,I,j,V,q,re,he,ge;let l={};const n=((c=Ae.Meteo2Assist.pickHourly(t,v(r)))==null?void 0:c[0])||{};l.utc=n.utc,l.lat=t.lat,l.lng=t.lng,l.weatherUrl=(s=n.weather)==null?void 0:s.url,l.temp=this.computeRoundPrecision((d=n==null?void 0:n.weather)==null?void 0:d.temp,0)??"-",l.precipProbability=this.computeRoundPrecision((p=(m=n==null?void 0:n.weather)==null?void 0:m.precip)==null?void 0:p.probability,0)??"-",l.precip1h=this.computeRoundPrecision((y=(u=n==null?void 0:n.weather)==null?void 0:u.precip)==null?void 0:y.sum,1)??"-",l.visibility=this.computeRoundPrecision((g=n==null?void 0:n.weather)==null?void 0:g.visibility,0)??"-",l.windSpeed=this.computeRoundPrecision((f=(h=n==null?void 0:n.weather)==null?void 0:h.wind)==null?void 0:f.kts,1)??"-",l.windDir=(z=(w=n==null?void 0:n.weather)==null?void 0:w.wind)==null?void 0:z.direction,l.windLevel=this.computeRoundPrecision((L=(b=n==null?void 0:n.weather)==null?void 0:b.wind)==null?void 0:L.scale,0)??"-",l.windGust=this.computeRoundPrecision((k=(x=n==null?void 0:n.weather)==null?void 0:x.wind)==null?void 0:k.gusts,1)??"-",l.sigwaveHeight=this.computeRoundPrecision((S=(C=n==null?void 0:n.wave)==null?void 0:C.sig)==null?void 0:S.height,1)??"-",l.sigwaveDir=(T=(N=n==null?void 0:n.wave)==null?void 0:N.sig)==null?void 0:T.direction,l.sigwavePeriod=this.computeRoundPrecision((E=(B=n==null?void 0:n.wave)==null?void 0:B.sig)==null?void 0:E.period,1)??"-",l.windwaveHeight=this.computeRoundPrecision((X=(Z=n==null?void 0:n.wave)==null?void 0:Z.wd)==null?void 0:X.height,1)??"-",l.windwaveDir=(ae=($=n==null?void 0:n.wave)==null?void 0:$.wd)==null?void 0:ae.direction,l.windwavePeriod=this.computeRoundPrecision((G=(P=n==null?void 0:n.wave)==null?void 0:P.wd)==null?void 0:G.period,1)??"-",l.swellHeight=this.computeRoundPrecision((U=(W=n==null?void 0:n.wave)==null?void 0:W.swell)==null?void 0:U.height,1)??"-",l.swellDir=(I=(A=n==null?void 0:n.wave)==null?void 0:A.swell)==null?void 0:I.direction,l.swellPeriod=this.computeRoundPrecision((V=(j=n==null?void 0:n.wave)==null?void 0:j.swell)==null?void 0:V.period,1)??"-",l.currentSpeed=this.computeRoundPrecision((q=n==null?void 0:n.current)==null?void 0:q.speed,1)??"-",l.currentDir=(re=n==null?void 0:n.current)==null?void 0:re.direction,l.currentSpeed=this.computeRoundPrecision((he=n==null?void 0:n.current)==null?void 0:he.speed,1)??"-",l.seaLevel=this.computeRoundPrecision(n==null?void 0:n.height,1)??"-",l.seaTemp=this.computeRoundPrecision(n==null?void 0:n.sst,0)??"-",l.weatherUrls=(ge=n==null?void 0:n.weather)==null?void 0:ge.url,this.tableData[0][`value${i}`]=i*this.interval>10?i*this.interval:"0"+i*this.interval,this.tableData[1][`value${i}`]=l.weatherUrl,this.tableData[2][`value${i}`]=l.temp,this.tableData[3][`value${i}`]=l.precip1h,this.tableData[4][`value${i}`]=l.visibility,this.tableData[5][`value${i}`]=l.windSpeed,this.tableData[6][`value${i}`]=l.sigwaveHeight,this.tableData[7][`value${i}`]=l.swellHeight,this.tableData[8][`value${i}`]=l.currentSpeed})},handleTide(){this.showTideDetail=!0,this.showPortDetail=!1,Object.keys(this.tideData).length===0&&this.fetchTidesData(),this.$nextTick(()=>{const t=this.$refs.scrollDom;console.log(t),t&&t.scrollTo({top:t.scrollHeight-t.clientHeight})})},async fetchTidesData(){var a,r,i,l;this.tideLoading=!0,this.tideData={};let t={lat:this.port.lat,lng:this.port.lng,date:(r=(a=this.dateList)==null?void 0:a[this.currentIndex])==null?void 0:r.dateTime,pastDays:1,forecastDays:5,extremes:!0,heights:!0},e=await le.post(`${this.gateway}/api/arc/meteo2/spot/tides/forecast`,t,{headers:{Authorization:this.token}});((i=e==null?void 0:e.data)==null?void 0:i.code)===0&&(this.tideData=((l=e==null?void 0:e.data)==null?void 0:l.data)||{},this.tideLoading=!1,this.initTideTableData(this.tideData))},initTideTableData(t){var e,a;this.tideTableData=Ae.TidesAssist.pickDailyExtremes(t,(a=(e=this.dateList)==null?void 0:e[this.currentIndex])==null?void 0:a.dateTime),this.initEchartData()},initEchartData(){var t;this.xDate=[],this.echartData={height:[]},(t=this.tideTableData)==null||t.forEach(e=>{this.xDate.push(this.computeLocalTime(e.date,this.port,"MM-DD HH:mm")),this.echartData.height.push([this.computeLocalTime(e.date,this.port,"MM-DD HH:mm"),e.height??void 0,"m"])}),this.initEchart()},initEchart(){Mo.dispose(this.$refs.tideEchart.style);const t=Mo.init(this.$refs.tideEchart),e={animation:!1,tooltip:{trigger:"axis",formatter:function(a){var i;let r=`<div style="font-size: 13px;">${(i=a[0])==null?void 0:i.value[0]}</div>`;return a.forEach(l=>{l.seriesName.indexOf("Min")<=-1&&l.seriesName.indexOf("Max")<=-1&&(r+=`<div style="font-size: 13px;"> <span style="display:inline-block; height: 8px;width: 8px;border-radius: 50%;background-color: ${l.color}"></span> <span>${l.seriesName} : </span> <strong>${l.value[1]}m</strong> </div>`)}),r}},legend:{show:!0,right:20,top:0,itemWidth:30,data:["Height"],selected:{Speed:!0,Draught:!1},textStyle:{color:this.Theme.current.value.colors["on-surface"]}},grid:{top:40,left:10,right:10,bottom:30,containLabel:!0},xAxis:[{type:"category",data:this.xDate,boundaryGap:!0,axisTick:{alignWithLabel:!0,lineStyle:{color:this.Theme.current.value.colors["echart-axis"]}},axisLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["echart-axis"]}},axisLabel:{interval:"auto",margin:15,textStyle:{fontSize:12,color:this.Theme.current.value.colors["echart-axis"]}}}],yAxis:[{name:"(m)",show:!0,nameLocation:"end",position:"left",nameGap:15,splitNumber:5,splitLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["echart-split"]}},alignTicks:!0,axisLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["echart-axis"]}},axisLabel:{textStyle:{fontSize:12,color:this.Theme.current.value.colors["echart-axis"]}}}],series:[{name:"Height",type:"line",showSymbol:!0,yAxisIndex:0,lineStyle:{color:this.Theme.current.value.colors["map-perple"]},itemStyle:{color:this.Theme.current.value.colors["map-perple"]},data:this.echartData.height}]};t==null||t.setOption(e)}}},Br={class:"d-flex justify-space-between align-center"},Ir={class:"d-flex justify-start text-h5 my-2"},Ar={key:0,class:"d-flex justify-end align-center ga-2"},Fr={key:1,class:"d-flex justify-end align-center"},Gr={class:"d-flex justify-start align-center text-body-1 text-label ga-3"},Wr={key:0,class:"btns-box w-100 d-flex justify-center align-center ga-2 mt-2 px-5",style:{height:"48px"}},Zr={class:"summary-box"},Or={class:"d-flex justify-space-between align-center py-2"},jr={class:"d-flex justify-center align-center text-h6 ga-2"},Hr={class:"multi-color-icon","aria-hidden":"true"},Xr=["xlink:href"],Yr={class:"gray-bg-2 rounded d-flex flex-column ga-4 pa-4"},Ur={class:"w-100 d-flex justify-start align-center"},$r={class:"w-30 text-label font-weight-400"},Jr={class:"flex-1-1-0"},Kr={class:"w-100 d-flex justify-start align-center"},qr={class:"w-30 text-label font-weight-400"},Qr={class:"flex-1-1-0"},el={class:"w-100 d-flex justify-start align-center"},tl={class:"w-30 text-label font-weight-400"},ol={class:"flex-1-1-0"},al={class:"table-box w-100 mt-2"},il={class:"w-100 d-flex justify-space-between align-center py-2"},rl={class:"d-flex justify-center align-center text-h6 ga-2"},ll={class:"multi-color-icon","aria-hidden":"true"},nl=["xlink:href"],sl={"fixed-header":"",density:"compact",class:"w-100 forecast-table bg-none"},cl={class:"px-1 text-left text-label font-weight-400",width:"120"},ml={key:0,class:""},dl={class:"px-1 text-center"},hl=["src"],pl={key:1},gl={class:"px-1 text-center"},ul=["src"],fl={key:1},yl={class:"px-1 text-center"},bl=["src"],wl={key:1},xl={class:"px-1 text-center"},kl=["src"],_l={key:1},Ll={class:"table-box w-100 mt-2 d-flex flex-column justify-start align-center"},zl={class:"w-100 d-flex justify-space-between align-center py-2"},Cl={class:"d-flex justify-center align-center text-h6 ga-2"},vl={class:"multi-color-icon","aria-hidden":"true"},Sl=["xlink:href"],Nl={class:"text-body-2 ga-2"},Pl={ref:"tideEchart",class:"w-100",style:{height:"200px"}},Vl={"fixed-header":"",density:"compact",class:"w-100 tide-table bg-none"},Ml={class:"px-1 text-center text-label font-weight-400",width:"120"},Tl={class:"px-1 text-center text-label font-weight-400",width:"120"},Dl={class:"px-1 text-center text-label font-weight-400",width:"120"},El={class:"px-1 text-center"},Rl={class:"px-1 text-center"},Bl={class:"px-1 text-center"};function Il(t,e,a,r,i,l){const n=o.resolveComponent("VBtn"),c=o.resolveComponent("VCardTitle"),s=o.resolveComponent("VDivider"),d=o.resolveComponent("VBtnToggle"),m=o.resolveComponent("VCard");return o.openBlock(),o.createBlock(m,{class:o.normalizeClass(["port-detail-container d-flex flex-column justify-start align-center",a.simple?"page":"dialog"])},{default:o.withCtx(()=>{var p,u,y;return[o.createVNode(c,{class:"w-100"},{default:o.withCtx(()=>{var g,h,f,w,z,b;return[o.createElementVNode("div",Br,[o.createElementVNode("div",Ir,[o.createElementVNode("div",{class:o.normalizeClass(["fi mr-2 rounded elevation-4",`fi-${(g=a.port)!=null&&g.cntLoCode?(f=(h=a.port)==null?void 0:h.cntLoCode)==null?void 0:f.toLowerCase():"xx"}`]),style:{width:"36px",height:"24px"}},null,2),o.createElementVNode("div",null,o.toDisplayString((w=a.port)==null?void 0:w.name),1)]),a.simple?(o.openBlock(),o.createElementBlock("div",Ar,[(z=a.followList)!=null&&z.some(L=>{var x;return((x=L.port)==null?void 0:x.id)===a.portId})?(o.openBlock(),o.createBlock(n,{key:0,class:"text-none rounded-circle",variant:"text",density:"compact",height:"32",width:"28","min-width":"28",onClick:l.handleCancelFollow},{default:o.withCtx(()=>e[2]||(e[2]=[o.createElementVNode("i",{class:"iconfont icon-yishoucang text-h4 text-warning"},null,-1)])),_:1,__:[2]},8,["onClick"])):(o.openBlock(),o.createBlock(n,{key:1,class:"text-none rounded-circle",variant:"plain",density:"compact",height:"32",width:"28","min-width":"28",onClick:l.handleFollow},{default:o.withCtx(()=>e[3]||(e[3]=[o.createElementVNode("i",{class:"iconfont icon-weishoucang text-h4"},null,-1)])),_:1,__:[3]},8,["onClick"])),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"",onClick:l.handleClose},{default:o.withCtx(()=>e[4]||(e[4]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[4]},8,["onClick"])])):(o.openBlock(),o.createElementBlock("div",Fr,[o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"",onClick:l.handleClose},{default:o.withCtx(()=>e[5]||(e[5]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[5]},8,["onClick"])]))]),o.createElementVNode("div",Gr,[o.createElementVNode("div",null,o.toDisplayString(t.$t("port.port")),1),o.createElementVNode("div",null,[e[6]||(e[6]=o.createElementVNode("label",null,"UN/LOCODE: ",-1)),o.createElementVNode("span",null,o.toDisplayString((b=a.port)==null?void 0:b.cntLoCode),1)])])]}),_:1}),o.createVNode(s,{class:"w-100"}),a.simple?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Wr,[(p=a.followList)!=null&&p.some(g=>{var h;return((h=g.port)==null?void 0:h.id)===a.portId})?(o.openBlock(),o.createBlock(n,{key:0,class:"text-none text-body-1 rounded flex-1-1-0 btn-bg-3",variant:"tonal",density:"compact",height:"32",onClick:l.handleCancelFollow},{prepend:o.withCtx(()=>e[7]||(e[7]=[o.createElementVNode("i",{class:"iconfont icon-yishoucang text-h6 text-warning"},null,-1)])),default:o.withCtx(()=>[o.createTextVNode(" "+o.toDisplayString(t.$t("actions.unfollow")),1)]),_:1},8,["onClick"])):(o.openBlock(),o.createBlock(n,{key:1,class:"text-none text-body-1 rounded flex-1-1-0 btn-bg-3",variant:"tonal",density:"compact",height:"32",onClick:l.handleFollow},{prepend:o.withCtx(()=>e[8]||(e[8]=[o.createElementVNode("i",{class:"iconfont icon-weishoucang text-h6"},null,-1)])),default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.follow"))+" ",1)]),_:1},8,["onClick"])),o.createVNode(n,{class:"text-none text-body-1 rounded flex-1-1-0 btn-bg-3",variant:"tonal",density:"compact",height:"32",onClick:l.handleMeteoMore},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("actions.7dayForcast")),1)]),_:1},8,["onClick"])])),o.createElementVNode("div",{ref:"scrollDom",class:o.normalizeClass(["w-100 pt-0 flex-1-1-0 overflow-y-auto scroll mb-4",a.simple?"px-3":"px-5"])},[o.createElementVNode("div",Zr,[o.createElementVNode("div",Or,[o.createElementVNode("div",jr,[(o.openBlock(),o.createElementBlock("svg",Hr,[o.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,Xr)])),o.createElementVNode("div",null,o.toDisplayString(t.$t("detail.summary")),1)]),e[9]||(e[9]=o.createElementVNode("div",{class:"text-body-2 text-success ga-2"},null,-1))]),o.createElementVNode("div",Yr,[o.createElementVNode("div",Ur,[o.createElementVNode("div",$r,o.toDisplayString(t.$t("port.region")),1),o.createElementVNode("div",Jr,o.toDisplayString(((u=a.port)==null?void 0:u.region)??((y=a.port)==null?void 0:y.city)??"-"),1)]),o.createElementVNode("div",Kr,[o.createElementVNode("div",qr,o.toDisplayString(t.$t("port.position")),1),o.createElementVNode("div",Qr,o.toDisplayString(l.computePosition(a.port)),1)]),o.createElementVNode("div",el,[o.createElementVNode("div",tl,o.toDisplayString(t.$t("time.localTime")),1),o.createElementVNode("div",ol,o.toDisplayString(l.computeLocalTime(a.realTime,a.port))+" "+o.toDisplayString(l.computeTimeOffset(a.port)),1)])])]),o.createElementVNode("div",al,[o.createElementVNode("div",il,[o.createElementVNode("div",rl,[(o.openBlock(),o.createElementBlock("svg",ll,[o.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,nl)])),o.createElementVNode("div",null,o.toDisplayString(t.$t("weather.weather")),1)]),e[10]||(e[10]=o.createElementVNode("div",{class:"text-body-2 text-success ga-2"},null,-1))]),o.createElementVNode("div",{class:o.normalizeClass(["w-100 gray-bg-2 rounded",a.simple?"pa-2":"pa-4"])},[o.createVNode(d,{modelValue:i.currentIndex,"onUpdate:modelValue":e[0]||(e[0]=g=>i.currentIndex=g),class:"w-100 gray-bg-1 rounded d-flex justify-space-around align-center ga-0 px-1 mb-2",density:"compact",group:"",height:"26","min-height":"26",rounded:"1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.dateList,g=>(o.openBlock(),o.createBlock(n,{class:"text-none text-body-1 rounded bg-none flex-1-1-0",density:"compact",color:"primary",height:"26",value:g.index},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(g.label),1)]),_:2},1032,["value"]))),256))]),_:1},8,["modelValue"]),o.createElementVNode("table",sl,[o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tableData,g=>(o.openBlock(),o.createElementBlock("tr",{key:g.id},[o.createElementVNode("th",cl,[o.createTextVNode(o.toDisplayString(t.$t(`${g.key}`))+" ",1),g.unit?(o.openBlock(),o.createElementBlock("span",ml," ( "+o.toDisplayString(g.unit)+" )",1)):o.createCommentVNode("",!0)]),o.createElementVNode("td",dl,[g.img?(o.openBlock(),o.createElementBlock("img",{key:0,src:g==null?void 0:g.value0,style:{height:"30px"}},null,8,hl)):(o.openBlock(),o.createElementBlock("span",pl,o.toDisplayString((g==null?void 0:g.value0)??"-"),1))]),o.createElementVNode("td",gl,[g.img?(o.openBlock(),o.createElementBlock("img",{key:0,src:g==null?void 0:g.value1,style:{height:"30px"}},null,8,ul)):(o.openBlock(),o.createElementBlock("span",fl,o.toDisplayString((g==null?void 0:g.value1)??"-"),1))]),o.createElementVNode("td",yl,[g.img?(o.openBlock(),o.createElementBlock("img",{key:0,src:g==null?void 0:g.value2,style:{height:"30px"}},null,8,bl)):(o.openBlock(),o.createElementBlock("span",wl,o.toDisplayString((g==null?void 0:g.value2)??"-"),1))]),o.createElementVNode("td",xl,[g.img?(o.openBlock(),o.createElementBlock("img",{key:0,src:g==null?void 0:g.value3,style:{height:"30px"}},null,8,kl)):(o.openBlock(),o.createElementBlock("span",_l,o.toDisplayString((g==null?void 0:g.value3)??"-"),1))])]))),128))])])],2)]),o.createElementVNode("div",Ll,[o.createElementVNode("div",zl,[o.createElementVNode("div",Cl,[(o.openBlock(),o.createElementBlock("svg",vl,[o.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,Sl)])),o.createElementVNode("div",null,o.toDisplayString(t.$t("tide.tideTimes")),1)]),o.createElementVNode("div",Nl,[i.showTideDetail?(o.openBlock(),o.createBlock(n,{key:0,icon:"mdi-eye-off-outline",density:"compact",variant:"plain",size:"small",onClick:e[1]||(e[1]=g=>i.showTideDetail=!1)})):(o.openBlock(),o.createBlock(n,{key:1,icon:"mdi-eye-outline",density:"compact",variant:"plain",size:"small",onClick:l.handleTide},null,8,["onClick"]))])]),i.showTideDetail?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["w-100 gray-bg-2 rounded",a.simple?"pa-2":"pa-4"])},[o.createElementVNode("div",Pl,null,512),o.createElementVNode("table",Vl,[o.createElementVNode("tbody",null,[o.createElementVNode("tr",null,[o.createElementVNode("th",Ml,o.toDisplayString(t.$t("tide.tide")),1),o.createElementVNode("th",Tl,o.toDisplayString(t.$t("time.time"))+" ( LT ) ",1),o.createElementVNode("th",Dl,o.toDisplayString(t.$t("tide.height"))+" ( m )",1)]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tideTableData,(g,h)=>{var f;return o.openBlock(),o.createElementBlock("tr",{key:h},[o.createElementVNode("td",El,o.toDisplayString(t.$t(`tide.${(f=g==null?void 0:g.type)==null?void 0:f.toLowerCase()}`))+" "+o.toDisplayString(t.$t("tide.tide")),1),o.createElementVNode("td",Rl,o.toDisplayString(l.computeLocalTime(g==null?void 0:g.date,a.port,"MM-DD HH:mm")),1),o.createElementVNode("td",Bl,o.toDisplayString((g==null?void 0:g.height)??"-")+" m",1)])}),128))])])],2)):o.createCommentVNode("",!0)])],2)]}),_:1},8,["class"])}const To=Y(Rr,[["render",Il],["__scopeId","data-v-9181e3c3"]]),py="",Al={name:"IdmPort",components:{PortDetail:To},props:{map:{type:Object},ports:{type:Object},beforeLayer:{type:String},forecastModel:{type:String}},setup(){return{Theme:fe.useTheme()}},emits:["closeAllDetail"],data(){return{source:"port-source",layer:"port-layer",showInfo:!1,showDetail:!1,portId:void 0,port:{},hoverPort:{},marker:void 0}},watch:{ports:{handler(){var t,e,a,r,i,l;this.ports?(this.handleRender(),(t=this.map)==null||t.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):(this.handleClear(),(r=this.map)==null||r.off("click",[this.layer],this.handleClick),(i=this.map)==null||i.off("mousemove",[this.layer],this.handleHover),(l=this.map)==null||l.off("mouseleave",[this.layer],this.handleLeave))},immediate:!0}},methods:{handleRender(){var t;this.ports&&(this.map.getSource(this.source)?(t=this.map)==null||t.getSource(this.source).setData(this.ports):(this.map.addSource(this.source,{type:"geojson",data:this.ports}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":1,"icon-image":"port","icon-offset":[0,-13],"icon-allow-overlap":!1,"icon-ignore-placement":!1,"icon-padding":4,"text-anchor":"bottom","text-field":"{name}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,1.6]},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer)))},handleClear(){this.showInfo=!1,this.showDetail=!1,this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)},handleClick(t){const e=t.features[0];this.portId=e.properties.id,e.properties.id&&(this.port=e.properties,this.port.lng=e.geometry.coordinates[0],this.port.lat=e.geometry.coordinates[1],this.port.forecastModel=this.forecastModel,this.showDetail=!0)},handleHover(t){var r,i;this.map.getCanvas().style.cursor="pointer";const e=t.features[0];if(e.properties.id){this.showInfo=!0,this.hoverPort=e.properties,(r=this.marker)==null||r.remove();const l=(i=document.getElementById("idmPortInfo"))==null?void 0:i.cloneNode(!0);this.marker=new ne.Marker(l).setLngLat([t.lngLat.lng,t.lngLat.lat]).setOffset([0,-70]).addTo(this.map)}},handleLeave(){var t;this.showInfo=!1,this.hoverPort={},(t=this.marker)==null||t.remove(),this.map.getCanvas().style.cursor="grab"},handleCloseDetail(){this.showDetail=!1}}},Fl={class:"port-box d-flex flex-column justify-center align-start ga-1"},Gl={class:"d-flex justify-start align-center text-label"},Wl={class:"d-flex justify-start align-center text-label"};function Zl(t,e,a,r,i,l){const n=o.resolveComponent("VCardText"),c=o.resolveComponent("VCard"),s=o.resolveComponent("PortDetail");return o.openBlock(),o.createElementBlock("div",null,[o.withDirectives(o.createVNode(c,{id:"idmPortInfo",ref:"idmPortInfo"},{default:o.withCtx(()=>[o.createVNode(n,{class:"text-body-1 pr-8"},{default:o.withCtx(()=>[o.createElementVNode("div",Fl,[o.createElementVNode("div",null,o.toDisplayString(t.$t("port.port")),1),o.createElementVNode("div",Gl,[o.createElementVNode("span",null,o.toDisplayString(i.hoverPort.name??"-"),1)]),o.createElementVNode("div",Wl,[e[1]||(e[1]=o.createElementVNode("label",{class:"pr-1"},"LoCode : ",-1)),o.createElementVNode("span",null,o.toDisplayString(i.hoverPort.loCode??"-"),1)])])]),_:1})]),_:1},512),[[o.vShow,i.showInfo]]),i.showDetail?(o.openBlock(),o.createBlock(s,o.mergeProps({key:0,portId:i.portId,port:i.port,forecastModel:a.forecastModel,onClose:l.handleCloseDetail,onCloseAllDetail:e[0]||(e[0]=d=>t.$emit("closeAllDetail",{ports:!0}))},t.$attrs),null,16,["portId","port","forecastModel","onClose"])):o.createCommentVNode("",!0)])}const Ol=Y(Al,[["render",Zl],["__scopeId","data-v-0c0f27d3"]]),jl={name:"IdmLoadLine",props:{map:{type:Object},show:{type:Boolean},beforeLayer:{type:String}},setup(){return{Theme:fe.useTheme()}},data(){return{layer:"loadlines-fill",labelLayer:"loadlines-label"}},watch:{show:{handler(){this.show?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var t,e;(t=this.map)!=null&&t.getLayer(this.layer)&&this.map.setLayoutProperty(this.layer,"visibility","visible"),(e=this.map)!=null&&e.getLayer(this.labelLayer)&&this.map.setLayoutProperty(this.labelLayer,"visibility","visible")},handleClear(){var t,e;(t=this.map)!=null&&t.getLayer(this.layer)&&this.map.setLayoutProperty(this.layer,"visibility","none"),(e=this.map)!=null&&e.getLayer(this.labelLayer)&&this.map.setLayoutProperty(this.labelLayer,"visibility","none")}}};function Hl(t,e,a,r,i,l){return o.openBlock(),o.createElementBlock("div")}const Xl=Y(jl,[["render",Hl]]),Yl={name:"IdmTimezone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},setup(){return{Theme:fe.useTheme()}},data(){return{source:"time-zone-source",zoneLayer:"time-zone-layer",zoneBorderLayer:"time-zone-border-layer",zoneLabelLayer:"time-zone-label-layer",marker:null}},computed:{timeZoneName(){return t=>{var a;return(a=v.tz.names().filter(r=>v.tz(v(),r).utcOffset()===t*60))==null?void 0:a[0]}}},watch:{zone:{handler(){var t,e,a,r;this.zone?(this.handleRender(),(t=this.map)==null||t.on("mousemove",[this.zoneLayer],this.handleHover),(e=this.map)==null||e.on("click",[this.zoneLayer],this.handleHover)):(this.handleClear(),(a=this.map)==null||a.off("mousemove",[this.zoneLayer],this.handleHover),(r=this.map)==null||r.off("click",[this.zoneLayer],this.handleHover))},immediate:!0}},methods:{handleRender(){var e;this.handleClear();let t={features:[],type:"FeatureCollection"};t.features=(e=this.zone.features)==null?void 0:e.map(a=>(a.properties.opacity=0,a.properties.lineOpacity=.2,a.properties.width=1,a)),this.zone&&(this.map.addSource(this.source,{type:"geojson",data:t}),this.map.addLayer({id:this.zoneLayer,type:"fill",source:this.source,filter:["all",["==","$type","Polygon"]],paint:{"fill-opacity":["get","opacity"],"fill-color":["match",["get","offSet"],"-11.5","rgba(255, 92, 88, 1)","-11","rgba(39, 195, 70, 1)","-10.5","rgba(39, 195, 70, 1)","-10","rgba(40, 106, 255, 1)","-9.5","rgba(40, 106, 255, 1)","-9","rgba(255, 92, 88, 1)","-8.5","rgba(255, 92, 88, 1)","-8","rgba(39, 195, 70, 1)","-7.5","rgba(39, 195, 70, 1)","-7","rgba(40, 106, 255, 1)","-6.5","rgba(40, 106, 255, 1)","-6","rgba(255, 92, 88, 1)","-5.5","rgba(255, 92, 88, 1)","-5","rgba(39, 195, 70, 1)","-4.5","rgba(39, 195, 70, 1)","-4","rgba(40, 106, 255, 1)","-3.5","rgba(40, 106, 255, 1)","-3","rgba(255, 92, 88, 1)","-2.5","rgba(255, 92, 88, 1)","-2","rgba(39, 195, 70, 1)","-1.5","rgba(39, 195, 70, 1)","-1","rgba(40, 106, 255, 1)","-0.5","rgba(40, 106, 255, 1)","+0","rgba(255, 92, 88, 1)","+0.5","rgba(255, 92, 88, 1)","+1","rgba(39, 195, 70, 1)","+1.5","rgba(39, 195, 70, 1)","+2","rgba(40, 106, 255, 1)","+2.5","rgba(40, 106, 255, 1)","+3","rgba(255, 92, 88, 1)","+3.5","rgba(255, 92, 88, 1)","+4","rgba(39, 195, 70, 1)","+4.5","rgba(39, 195, 70, 1)","+5","rgba(40, 106, 255, 1)","+5.5","rgba(40, 106, 255, 1)","+6","rgba(255, 92, 88, 1)","+6.5","rgba(255, 92, 88, 1)","+7","rgba(39, 195, 70, 1)","+7.5","rgba(39, 195, 70, 1)","+8","rgba(40, 106, 255, 1)","+8.5","rgba(40, 106, 255, 1)","+9","rgba(255, 92, 88, 1)","+9.5","rgba(255, 92, 88, 1)","+10","rgba(39, 195, 70, 1)","+10.5","rgba(39, 195, 70, 1)","+11","rgba(40, 106, 255, 1)","+11.5","rgba(40, 106, 255, 1)","rgba(255, 92, 88, 1)"]}},this.beforeLayer),this.map.addLayer({id:this.zoneBorderLayer,type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-color":this.Theme.current.value.colors["on-surface"],"line-opacity":["get","lineOpacity"],"line-width":["get","width"]}},this.beforeLayer))},handleClear(){var t;this.map.getLayer(this.zoneLayer)&&this.map.removeLayer(this.zoneLayer),this.map.getLayer(this.zoneBorderLayer)&&this.map.removeLayer(this.zoneBorderLayer),this.map.getLayer(this.zoneLabelLayer)&&this.map.removeLayer(this.zoneLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source),(t=this.marker)==null||t.remove()},handleHover(t){var e,a,r;if(t.features.length){(e=this.marker)==null||e.remove();let i={features:[],type:"FeatureCollection"};i.features=(a=this.zone.features)==null?void 0:a.map(n=>{const c=JSON.parse(JSON.stringify(n));return c.properties.offSet===t.features[0].properties.offSet?(c.properties.opacity=.25,c.properties.lineOpacity=.7,c.properties.width=2):(c.properties.opacity=0,c.properties.lineOpacity=.2,c.properties.width=1),c}),(r=this.map.getSource(this.source))==null||r.setData(i);const l=document.createElement("div");l.className="v-card--variant-elevated rounded px-2 py-1 text-body-1",l.innerHTML=`<div>UTC ${t.features[0].properties.offSet}:00</div> <div>${v.tz(v().format(),this.timeZoneName(t.features[0].properties.offSet)).format("MM-DD HH:mm")}`,this.marker=new ne.Marker(l).setLngLat([t.lngLat.lng,t.lngLat.lat]).setOffset([0,-30]).addTo(this.map)}},handleLeave(){}}};function Ul(t,e,a,r,i,l){return o.openBlock(),o.createElementBlock("div")}const $l=Y(Yl,[["render",Ul]]),Jl={name:"IdmVoluntaryReportingArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},setup(){return{Theme:fe.useTheme()}},data(){return{source:"vra-source",areaLayer:"vra-layer",areaLabelLayer:"vra-label-layer"}},watch:{area:{handler(){this.area?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){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-opacity":.3,"fill-color":"rgba(144, 96, 217, 1)"}},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":"rgba(164, 125, 222, 1)"}},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,1],"text-font":["DIN Pro Regular","Arial Unicode MS Regular"]},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer))},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 Kl(t,e,a,r,i,l){return o.openBlock(),o.createElementBlock("div")}const ql=Y(Jl,[["render",Kl]]),Ql={name:"IdmSpecialArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},setup(){return{Theme:fe.useTheme()}},data(){return{source:"special-area-source",areaLayer:"special-area-layer",areaLabelLayer:"special-area-label-layer"}},watch:{area:{handler(){this.handleRender()},immediate:!0}},methods:{handleRender(){this.handleClear(),this.area&&(this.area.features.forEach(t=>{t.geometry.type==="Polygon"&&t.geometry.coordinates.forEach(e=>M.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-opacity":.25,"fill-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.areaLayer+"-border",type:"line",source:this.source,filter:["==","$type","Polygon"],paint:{"line-width":1,"line-opacity":.7,"line-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.areaLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-size":.7,"icon-image":"identify","text-anchor":"top","text-field":"{lbl}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,1],"text-font":["DIN Pro Regular","Arial Unicode MS Regular"]},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer))},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 en(t,e,a,r,i,l){return o.openBlock(),o.createElementBlock("div")}const tn=Y(Ql,[["render",en]]),on={name:"IdmTerminator",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},data(){return{source:"terminator-source",layer:"terminator-layer"}},watch:{area:{handler(){this.handleRender()},immediate:!0}},methods:{handleRender(){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":"rgba(255,255,255,0.3)","fill-color":"rgba(0, 0, 0, 0.3)"}},this.beforeLayer))},handleClear(){this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function an(t,e,a,r,i,l){return o.openBlock(),o.createElementBlock("div")}const rn=Y(on,[["render",an]]),ln={name:"IdmWorld12nm",props:{map:{type:Object},show:{type:Boolean},weatherLayers:{type:Object,default:()=>({})},zoom:{type:Number,default:3},left:{type:String,default:"10px"},bottom:{type:String,default:"64px"},token:{type:String,default:""}},data(){return{layer:"world-12nm-v4-20231025"}},watch:{show:{handler(){this.show?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var t;(t=this.map)!=null&&t.getLayer(this.layer)&&(this.map.setLayoutProperty(this.layer,"visibility","visible"),this.map.setPaintProperty(this.layer,"line-color","rgb(210,54,83)"),this.map.setPaintProperty(this.layer,"line-width",2))},handleClear(){var t;(t=this.map)!=null&&t.getLayer(this.layer)&&this.map.setLayoutProperty(this.layer,"visibility","none")}}};function nn(t,e,a,r,i,l){return null}const sn=Y(ln,[["render",nn]]),gy="",cn={name:"IdmWorldMarine",props:{map:{type:Object},show:{type:Boolean}},data(){return{labelLayer:"ne-10m-label",lineLayer:"ne-10m-outline"}},watch:{show:{handler(){this.show?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var t,e;(t=this.map)!=null&&t.getLayer(this.lineLayer)&&(this