@idmwx/idmui-gl4 3.5.1 → 3.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-3VYIPD3A-430e5f7b.js → chunk-3VYIPD3A-a6d163f1.js} +1 -1
- package/dist/{chunk-ANSXOGKI-d98a511c.js → chunk-ANSXOGKI-4579de59.js} +1 -1
- package/dist/{chunk-T4JIPPZO-126a02a5.js → chunk-T4JIPPZO-e72eb32f.js} +1 -1
- package/dist/{download-82c87fa4.js → download-64c170e7.js} +3 -3
- package/dist/{index-1dc638f4.js → index-5073d89a.js} +128 -128
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +2 -2
- package/dist/{rasterize-JS5G2XHH-ef72d7e4.js → rasterize-JS5G2XHH-8c7f95b0.js} +3 -3
- package/dist/style.css +1 -1
- package/dist/{toBlob-bd0b90a4.js → toBlob-1a9ea2ef.js} +3 -3
- package/dist/{toCanvas-bf31915c.js → toCanvas-369fa248.js} +2 -2
- package/dist/{toImg-4565d72a.js → toImg-21049add.js} +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as x, c as D, D as T, L as g, a as S, b as W, M as f, f as h, e as k, P as y, T as B, V, W as d, d as u } from "./index-
|
|
1
|
+
import { B as x, c as D, D as T, L as g, a as S, b as W, M as f, f as h, e as k, P as y, T as B, V, W as d, d as u } from "./index-5073d89a.js";
|
|
2
2
|
import "axios";
|
|
3
3
|
import "vuetify";
|
|
4
4
|
import "vue";
|
package/dist/index.umd.cjs
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
<span style="display:inline-block; height: 8px;width: 8px;border-radius: 50%;background-color: ${l.color}"></span>
|
|
3
3
|
<span>${l.seriesName} : </span>
|
|
4
4
|
<strong>${l.value[1]}m</strong>
|
|
5
|
-
</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}]};o==null||o.setOption(e)}}},Ar={class:"d-flex justify-space-between align-center"},Lr={class:"d-flex justify-start text-h5 my-2"},Cr={key:0,class:"d-flex justify-end align-center ga-2"},vr={key:1,class:"d-flex justify-end align-center"},zr={class:"d-flex justify-start align-center text-h6 text-label ga-3"},_r={key:0,class:"btns-box w-100 d-flex justify-center align-center ga-2 mt-2 px-5",style:{height:"48px"}},Sr={class:"summary-box"},Nr={class:"d-flex justify-space-between align-center py-2"},Mr={class:"d-flex justify-center align-center text-h6 ga-2"},Pr={class:"multi-color-icon","aria-hidden":"true"},Vr=["xlink:href"],Tr={class:"gray-bg-2 rounded d-flex flex-column ga-4 pa-4"},Er={class:"w-100 d-flex justify-start align-center"},Dr={class:"w-30 text-label font-weight-400"},Rr={class:"flex-1-1-0"},Br={class:"w-100 d-flex justify-start align-center"},Ir={class:"w-30 text-label font-weight-400"},Fr={class:"flex-1-1-0"},Gr={class:"w-100 d-flex justify-start align-center"},jr={class:"w-30 text-label font-weight-400"},Wr={class:"flex-1-1-0"},Zr={class:"table-box w-100 mt-2"},Xr={class:"w-100 d-flex justify-space-between align-center py-2"},Hr={class:"d-flex justify-center align-center text-h6 ga-2"},Or={class:"multi-color-icon","aria-hidden":"true"},Yr=["xlink:href"],Ur={"fixed-header":"",density:"compact",class:"w-100 forecast-table bg-none"},Jr={class:"px-1 text-left text-label font-weight-400",width:"120"},Kr={key:0,class:""},Qr={class:"px-1 text-center"},qr=["src"],$r={key:1},el={class:"px-1 text-center"},tl=["src"],ol={key:1},al={class:"px-1 text-center"},il=["src"],rl={key:1},ll={class:"px-1 text-center"},nl=["src"],sl={key:1},cl={class:"table-box w-100 mt-2 d-flex flex-column justify-start align-center"},ml={class:"w-100 d-flex justify-space-between align-center py-2"},dl={class:"d-flex justify-center align-center text-h6 ga-2"},hl={class:"multi-color-icon","aria-hidden":"true"},pl=["xlink:href"],gl={class:"text-body-2 ga-2"},ul={ref:"tideEchart",class:"w-100",style:{height:"200px"}},fl={"fixed-header":"",density:"compact",class:"w-100 tide-table bg-none"},yl={class:"px-1 text-center text-label font-weight-400",width:"120"},bl={class:"px-1 text-center text-label font-weight-400",width:"120"},wl={class:"px-1 text-center text-label font-weight-400",width:"120"},xl={class:"px-1 text-center"},kl={class:"px-1 text-center"},Al={class:"px-1 text-center"};function Ll(o,e,a,r,i,l){const n=t.resolveComponent("VBtn"),c=t.resolveComponent("VCardTitle"),s=t.resolveComponent("VDivider"),m=t.resolveComponent("VBtnToggle"),d=t.resolveComponent("VCard");return t.openBlock(),t.createBlock(d,{class:t.normalizeClass(["port-detail-container d-flex flex-column justify-start align-center",a.simple?"page":"dialog"])},{default:t.withCtx(()=>{var g,u,y;return[t.createVNode(c,{class:"w-100"},{default:t.withCtx(()=>{var p,h,f,w,b,A;return[t.createElementVNode("div",Ar,[t.createElementVNode("div",Lr,[t.createElementVNode("div",{class:t.normalizeClass(["fi mr-2 rounded elevation-4",`fi-${(p=a.port)!=null&&p.cntLoCode?(f=(h=a.port)==null?void 0:h.cntLoCode)==null?void 0:f.toLowerCase():"xx"}`]),style:{width:"36px",height:"24px"}},null,2),t.createElementVNode("div",null,t.toDisplayString((w=a.port)==null?void 0:w.name),1)]),a.simple?(t.openBlock(),t.createElementBlock("div",Cr,[(b=a.followList)!=null&&b.some(x=>{var C;return((C=x.port)==null?void 0:C.id)===a.portId})?(t.openBlock(),t.createBlock(n,{key:0,class:"text-none rounded-circle",variant:"text",density:"compact",height:"32",width:"28","min-width":"28",onClick:l.handleCancelFollow},{default:t.withCtx(()=>e[2]||(e[2]=[t.createElementVNode("i",{class:"iconfont icon-yishoucang text-h4 text-warning"},null,-1)])),_:1,__:[2]},8,["onClick"])):(t.openBlock(),t.createBlock(n,{key:1,class:"text-none rounded-circle",variant:"plain",density:"compact",height:"32",width:"28","min-width":"28",onClick:l.handleFollow},{default:t.withCtx(()=>e[3]||(e[3]=[t.createElementVNode("i",{class:"iconfont icon-weishoucang text-h4"},null,-1)])),_:1,__:[3]},8,["onClick"])),t.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"",onClick:l.handleClose},{default:t.withCtx(()=>e[4]||(e[4]=[t.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[4]},8,["onClick"])])):(t.openBlock(),t.createElementBlock("div",vr,[t.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"",onClick:l.handleClose},{default:t.withCtx(()=>e[5]||(e[5]=[t.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[5]},8,["onClick"])]))]),t.createElementVNode("div",zr,[t.createElementVNode("div",null,t.toDisplayString(o.$t("port.port")),1),t.createElementVNode("div",null,[e[6]||(e[6]=t.createElementVNode("label",null,"UN/LOCODE: ",-1)),t.createElementVNode("span",null,t.toDisplayString((A=a.port)==null?void 0:A.cntLoCode),1)])])]}),_:1}),t.createVNode(s,{class:"w-100"}),a.simple?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",_r,[(g=a.followList)!=null&&g.some(p=>{var h;return((h=p.port)==null?void 0:h.id)===a.portId})?(t.openBlock(),t.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:t.withCtx(()=>e[7]||(e[7]=[t.createElementVNode("i",{class:"iconfont icon-yishoucang text-h6 text-warning"},null,-1)])),default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(o.$t("actions.unfollow")),1)]),_:1},8,["onClick"])):(t.openBlock(),t.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:t.withCtx(()=>e[8]||(e[8]=[t.createElementVNode("i",{class:"iconfont icon-weishoucang text-h6"},null,-1)])),default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(o.$t("actions.follow"))+" ",1)]),_:1},8,["onClick"])),t.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:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(o.$t("actions.7dayForcast")),1)]),_:1},8,["onClick"])])),t.createElementVNode("div",{ref:"scrollDom",class:t.normalizeClass(["w-100 pt-0 flex-1-1-0 overflow-y-auto scroll mb-4",a.simple?"px-3":"px-5"])},[t.createElementVNode("div",Sr,[t.createElementVNode("div",Nr,[t.createElementVNode("div",Mr,[(t.openBlock(),t.createElementBlock("svg",Pr,[t.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,Vr)])),t.createElementVNode("div",null,t.toDisplayString(o.$t("detail.summary")),1)]),e[9]||(e[9]=t.createElementVNode("div",{class:"text-body-2 text-success ga-2"},null,-1))]),t.createElementVNode("div",Tr,[t.createElementVNode("div",Er,[t.createElementVNode("div",Dr,t.toDisplayString(o.$t("port.region")),1),t.createElementVNode("div",Rr,t.toDisplayString(((u=a.port)==null?void 0:u.region)??((y=a.port)==null?void 0:y.city)??"-"),1)]),t.createElementVNode("div",Br,[t.createElementVNode("div",Ir,t.toDisplayString(o.$t("port.position")),1),t.createElementVNode("div",Fr,t.toDisplayString(l.computePosition(a.port)),1)]),t.createElementVNode("div",Gr,[t.createElementVNode("div",jr,t.toDisplayString(o.$t("time.localTime")),1),t.createElementVNode("div",Wr,t.toDisplayString(l.computeLocalTime(a.realTime,a.port))+" "+t.toDisplayString(l.computeTimeOffset(a.port)),1)])])]),t.createElementVNode("div",Zr,[t.createElementVNode("div",Xr,[t.createElementVNode("div",Hr,[(t.openBlock(),t.createElementBlock("svg",Or,[t.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,Yr)])),t.createElementVNode("div",null,t.toDisplayString(o.$t("weather.weather")),1)]),e[10]||(e[10]=t.createElementVNode("div",{class:"text-body-2 text-success ga-2"},null,-1))]),t.createElementVNode("div",{class:t.normalizeClass(["w-100 gray-bg-2 rounded",a.simple?"pa-2":"pa-4 py-2"])},[t.createVNode(m,{modelValue:i.currentIndex,"onUpdate:modelValue":e[0]||(e[0]=p=>i.currentIndex=p),class:"w-100 d-flex justify-space-around align-center ga-0 mb-2",density:"compact",group:"",height:"26","min-height":"26",rounded:"1",mandatory:""},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.dateList,p=>(t.openBlock(),t.createBlock(n,{key:p.index,class:"text-none text-body-1 flex-1-1-0 gray-bg-2",density:"compact",color:"primary",height:"26",value:p.index},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(p.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"]),t.createElementVNode("table",Ur,[t.createElementVNode("tbody",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData,p=>(t.openBlock(),t.createElementBlock("tr",{key:p.id},[t.createElementVNode("th",Jr,[t.createTextVNode(t.toDisplayString(o.$t(`${p.key}`))+" ",1),p.unit?(t.openBlock(),t.createElementBlock("span",Kr," ( "+t.toDisplayString(p.unit)+" )",1)):t.createCommentVNode("",!0)]),t.createElementVNode("td",Qr,[p.img?(t.openBlock(),t.createElementBlock("img",{key:0,src:p==null?void 0:p.value0,style:{height:"30px"}},null,8,qr)):(t.openBlock(),t.createElementBlock("span",$r,t.toDisplayString((p==null?void 0:p.value0)??"-"),1))]),t.createElementVNode("td",el,[p.img?(t.openBlock(),t.createElementBlock("img",{key:0,src:p==null?void 0:p.value1,style:{height:"30px"}},null,8,tl)):(t.openBlock(),t.createElementBlock("span",ol,t.toDisplayString((p==null?void 0:p.value1)??"-"),1))]),t.createElementVNode("td",al,[p.img?(t.openBlock(),t.createElementBlock("img",{key:0,src:p==null?void 0:p.value2,style:{height:"30px"}},null,8,il)):(t.openBlock(),t.createElementBlock("span",rl,t.toDisplayString((p==null?void 0:p.value2)??"-"),1))]),t.createElementVNode("td",ll,[p.img?(t.openBlock(),t.createElementBlock("img",{key:0,src:p==null?void 0:p.value3,style:{height:"30px"}},null,8,nl)):(t.openBlock(),t.createElementBlock("span",sl,t.toDisplayString((p==null?void 0:p.value3)??"-"),1))])]))),128))])])],2)]),t.createElementVNode("div",cl,[t.createElementVNode("div",ml,[t.createElementVNode("div",dl,[(t.openBlock(),t.createElementBlock("svg",hl,[t.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,pl)])),t.createElementVNode("div",null,t.toDisplayString(o.$t("tide.tideTimes")),1)]),t.createElementVNode("div",gl,[i.showTideDetail?(t.openBlock(),t.createBlock(n,{key:0,icon:"mdi-eye-outline",density:"compact",variant:"plain",size:"small",onClick:e[1]||(e[1]=p=>i.showTideDetail=!1)})):(t.openBlock(),t.createBlock(n,{key:1,icon:"mdi-eye-off-outline",density:"compact",variant:"plain",size:"small",onClick:l.handleTide},null,8,["onClick"]))])]),i.showTideDetail?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["w-100 gray-bg-2 rounded",a.simple?"pa-2":"pa-4"])},[t.createElementVNode("div",ul,null,512),t.createElementVNode("table",fl,[t.createElementVNode("tbody",null,[t.createElementVNode("tr",null,[t.createElementVNode("th",yl,t.toDisplayString(o.$t("tide.tide")),1),t.createElementVNode("th",bl,t.toDisplayString(o.$t("time.time"))+" ( LT ) ",1),t.createElementVNode("th",wl,t.toDisplayString(o.$t("tide.height"))+" ( m )",1)]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tideTableData,(p,h)=>{var f;return t.openBlock(),t.createElementBlock("tr",{key:h},[t.createElementVNode("td",xl,t.toDisplayString(o.$t(`tide.${(f=p==null?void 0:p.type)==null?void 0:f.toLowerCase()}`))+" "+t.toDisplayString(o.$t("tide.tide")),1),t.createElementVNode("td",kl,t.toDisplayString(l.computeLocalTime(p==null?void 0:p.date,a.port,"MM-DD HH:mm")),1),t.createElementVNode("td",Al,t.toDisplayString((p==null?void 0:p.height)??"-")+" m",1)])}),128))])])],2)):t.createCommentVNode("",!0)])],2)]}),_:1},8,["class"])}const No=K(kr,[["render",Ll],["__scopeId","data-v-6adcdfea"]]),jy="",Cl={name:"IdmPort",components:{PortDetail:No},props:{map:{type:Object},ports:{type:Object},beforeLayer:{type:String},forecastModel:{type:String}},emits:["closeAllDetail"],setup(){return{Theme:ye.useTheme()}},data(){return{source:"port-source",layer:"port-layer",showInfo:!1,showDetail:!1,portId:void 0,port:{},hoverPort:{},marker:void 0}},watch:{ports:{handler(){var o,e,a,r,i,l;this.ports?(this.handleRender(),(o=this.map)==null||o.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 o;this.ports&&(this.map.getSource(this.source)?(o=this.map)==null||o.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(o){const e=o.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(o){var r,i;this.map.getCanvas().style.cursor="pointer";const e=o.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 de.Marker(l).setLngLat([o.lngLat.lng,o.lngLat.lat]).setOffset([0,-70]).addTo(this.map)}},handleLeave(){var o;this.showInfo=!1,this.hoverPort={},(o=this.marker)==null||o.remove(),this.map.getCanvas().style.cursor="grab"},handleCloseDetail(){this.showDetail=!1}}},vl={class:"port-box d-flex flex-column justify-center align-start ga-1"},zl={class:"d-flex justify-start align-center text-label"},_l={class:"d-flex justify-start align-center text-label"};function Sl(o,e,a,r,i,l){const n=t.resolveComponent("VCardText"),c=t.resolveComponent("VCard"),s=t.resolveComponent("PortDetail");return t.openBlock(),t.createElementBlock("div",null,[t.withDirectives(t.createVNode(c,{id:"idmPortInfo",ref:"idmPortInfo"},{default:t.withCtx(()=>[t.createVNode(n,{class:"text-body-1 pr-8"},{default:t.withCtx(()=>[t.createElementVNode("div",vl,[t.createElementVNode("div",null,t.toDisplayString(o.$t("port.port")),1),t.createElementVNode("div",zl,[t.createElementVNode("span",null,t.toDisplayString(i.hoverPort.name??"-"),1)]),t.createElementVNode("div",_l,[e[1]||(e[1]=t.createElementVNode("label",{class:"pr-1"},"LoCode : ",-1)),t.createElementVNode("span",null,t.toDisplayString(i.hoverPort.loCode??"-"),1)])])]),_:1})]),_:1},512),[[t.vShow,i.showInfo]]),i.showDetail?(t.openBlock(),t.createBlock(s,t.mergeProps({key:0,"port-id":i.portId,port:i.port,"forecast-model":a.forecastModel},o.$attrs,{onClose:l.handleCloseDetail,onCloseAllDetail:e[0]||(e[0]=m=>o.$emit("closeAllDetail",{ports:!0}))}),null,16,["port-id","port","forecast-model","onClose"])):t.createCommentVNode("",!0)])}const Nl=K(Cl,[["render",Sl],["__scopeId","data-v-d5b056e5"]]),Ml={name:"IdmLoadLine",props:{map:{type:Object},show:{type:Boolean},beforeLayer:{type:String}},setup(){return{Theme:ye.useTheme()}},data(){return{layer:"loadlines-fill",labelLayer:"loadlines-label"}},watch:{show:{handler(){this.show?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var o,e;(o=this.map)!=null&&o.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 o,e;(o=this.map)!=null&&o.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 Pl(o,e,a,r,i,l){return t.openBlock(),t.createElementBlock("div")}const Vl=K(Ml,[["render",Pl]]),Tl={name:"IdmTimezone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},setup(){return{Theme:ye.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 o=>{var a;return(a=v.tz.names().filter(r=>v.tz(v(),r).utcOffset()===o*60))==null?void 0:a[0]}}},watch:{zone:{handler(){var o,e,a,r;this.zone?(this.handleRender(),(o=this.map)==null||o.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 o={features:[],type:"FeatureCollection"};o.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:o}),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 o;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),(o=this.marker)==null||o.remove()},handleHover(o){var e,a,r;if(o.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===o.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 ${o.features[0].properties.offSet}:00</div>
|
|
5
|
+
</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}]};o==null||o.setOption(e)}}},Ar={class:"d-flex justify-space-between align-center"},Lr={class:"d-flex justify-start text-h5 my-2"},Cr={key:0,class:"d-flex justify-end align-center ga-2"},vr={key:1,class:"d-flex justify-end align-center"},zr={class:"d-flex justify-start align-center text-h6 text-label ga-3"},_r={key:0,class:"btns-box w-100 d-flex justify-center align-center ga-2 mt-2 px-5",style:{height:"48px"}},Sr={class:"summary-box"},Nr={class:"d-flex justify-space-between align-center py-2"},Mr={class:"d-flex justify-center align-center text-h6 ga-2"},Pr={class:"multi-color-icon","aria-hidden":"true"},Vr=["xlink:href"],Tr={class:"gray-bg-2 rounded d-flex flex-column ga-4 pa-4"},Er={class:"w-100 d-flex justify-start align-center"},Dr={class:"w-30 text-label font-weight-400"},Rr={class:"flex-1-1-0"},Br={class:"w-100 d-flex justify-start align-center"},Ir={class:"w-30 text-label font-weight-400"},Fr={class:"flex-1-1-0"},Gr={class:"w-100 d-flex justify-start align-center"},jr={class:"w-30 text-label font-weight-400"},Wr={class:"flex-1-1-0"},Zr={class:"table-box w-100 mt-2"},Xr={class:"w-100 d-flex justify-space-between align-center py-2"},Hr={class:"d-flex justify-center align-center text-h6 ga-2"},Or={class:"multi-color-icon","aria-hidden":"true"},Yr=["xlink:href"],Ur={"fixed-header":"",density:"compact",class:"w-100 forecast-table bg-none"},Jr={class:"px-1 text-left text-label font-weight-400",width:"120"},Kr={key:0,class:""},Qr={class:"px-1 text-center"},qr=["src"],$r={key:1},el={class:"px-1 text-center"},tl=["src"],ol={key:1},al={class:"px-1 text-center"},il=["src"],rl={key:1},ll={class:"px-1 text-center"},nl=["src"],sl={key:1},cl={class:"table-box w-100 mt-2 d-flex flex-column justify-start align-center"},ml={class:"w-100 d-flex justify-space-between align-center py-2"},dl={class:"d-flex justify-center align-center text-h6 ga-2"},hl={class:"multi-color-icon","aria-hidden":"true"},pl=["xlink:href"],gl={class:"text-body-2 ga-2"},ul={ref:"tideEchart",class:"w-100",style:{height:"200px"}},fl={"fixed-header":"",density:"compact",class:"w-100 tide-table bg-none"},yl={class:"px-1 text-center text-label font-weight-400",width:"120"},bl={class:"px-1 text-center text-label font-weight-400",width:"120"},wl={class:"px-1 text-center text-label font-weight-400",width:"120"},xl={class:"px-1 text-center"},kl={class:"px-1 text-center"},Al={class:"px-1 text-center"};function Ll(o,e,a,r,i,l){const n=t.resolveComponent("VBtn"),c=t.resolveComponent("VCardTitle"),s=t.resolveComponent("VDivider"),m=t.resolveComponent("VBtnToggle"),d=t.resolveComponent("VCard");return t.openBlock(),t.createBlock(d,{class:t.normalizeClass(["port-detail-container d-flex flex-column justify-start align-center",a.simple?"page":"dialog"])},{default:t.withCtx(()=>{var g,u,y;return[t.createVNode(c,{class:"w-100"},{default:t.withCtx(()=>{var p,h,f,w,b,A;return[t.createElementVNode("div",Ar,[t.createElementVNode("div",Lr,[t.createElementVNode("div",{class:t.normalizeClass(["fi mr-2 rounded elevation-4",`fi-${(p=a.port)!=null&&p.cntLoCode?(f=(h=a.port)==null?void 0:h.cntLoCode)==null?void 0:f.toLowerCase():"xx"}`]),style:{width:"36px",height:"24px"}},null,2),t.createElementVNode("div",null,t.toDisplayString((w=a.port)==null?void 0:w.name),1)]),a.simple?(t.openBlock(),t.createElementBlock("div",Cr,[(b=a.followList)!=null&&b.some(x=>{var C;return((C=x.port)==null?void 0:C.id)===a.portId})?(t.openBlock(),t.createBlock(n,{key:0,class:"text-none rounded-circle",variant:"text",density:"compact",height:"32",width:"28","min-width":"28",onClick:l.handleCancelFollow},{default:t.withCtx(()=>e[2]||(e[2]=[t.createElementVNode("i",{class:"iconfont icon-yishoucang text-h4 text-warning"},null,-1)])),_:1,__:[2]},8,["onClick"])):(t.openBlock(),t.createBlock(n,{key:1,class:"text-none rounded-circle",variant:"plain",density:"compact",height:"32",width:"28","min-width":"28",onClick:l.handleFollow},{default:t.withCtx(()=>e[3]||(e[3]=[t.createElementVNode("i",{class:"iconfont icon-weishoucang text-h4"},null,-1)])),_:1,__:[3]},8,["onClick"])),t.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"",onClick:l.handleClose},{default:t.withCtx(()=>e[4]||(e[4]=[t.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[4]},8,["onClick"])])):(t.openBlock(),t.createElementBlock("div",vr,[t.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"",onClick:l.handleClose},{default:t.withCtx(()=>e[5]||(e[5]=[t.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[5]},8,["onClick"])]))]),t.createElementVNode("div",zr,[t.createElementVNode("div",null,t.toDisplayString(o.$t("port.port")),1),t.createElementVNode("div",null,[e[6]||(e[6]=t.createElementVNode("label",null,"UN/LOCODE: ",-1)),t.createElementVNode("span",null,t.toDisplayString((A=a.port)==null?void 0:A.cntLoCode),1)])])]}),_:1}),t.createVNode(s,{class:"w-100"}),a.simple?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",_r,[(g=a.followList)!=null&&g.some(p=>{var h;return((h=p.port)==null?void 0:h.id)===a.portId})?(t.openBlock(),t.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:t.withCtx(()=>e[7]||(e[7]=[t.createElementVNode("i",{class:"iconfont icon-yishoucang text-h6 text-warning"},null,-1)])),default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(o.$t("actions.unfollow")),1)]),_:1},8,["onClick"])):(t.openBlock(),t.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:t.withCtx(()=>e[8]||(e[8]=[t.createElementVNode("i",{class:"iconfont icon-weishoucang text-h6"},null,-1)])),default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(o.$t("actions.follow"))+" ",1)]),_:1},8,["onClick"])),t.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:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(o.$t("actions.7dayForcast")),1)]),_:1},8,["onClick"])])),t.createElementVNode("div",{ref:"scrollDom",class:t.normalizeClass(["w-100 pt-0 flex-1-1-0 overflow-y-auto scroll mb-4",a.simple?"px-3":"px-5"])},[t.createElementVNode("div",Sr,[t.createElementVNode("div",Nr,[t.createElementVNode("div",Mr,[(t.openBlock(),t.createElementBlock("svg",Pr,[t.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,Vr)])),t.createElementVNode("div",null,t.toDisplayString(o.$t("detail.summary")),1)]),e[9]||(e[9]=t.createElementVNode("div",{class:"text-body-2 text-success ga-2"},null,-1))]),t.createElementVNode("div",Tr,[t.createElementVNode("div",Er,[t.createElementVNode("div",Dr,t.toDisplayString(o.$t("port.region")),1),t.createElementVNode("div",Rr,t.toDisplayString(((u=a.port)==null?void 0:u.region)??((y=a.port)==null?void 0:y.city)??"-"),1)]),t.createElementVNode("div",Br,[t.createElementVNode("div",Ir,t.toDisplayString(o.$t("port.position")),1),t.createElementVNode("div",Fr,t.toDisplayString(l.computePosition(a.port)),1)]),t.createElementVNode("div",Gr,[t.createElementVNode("div",jr,t.toDisplayString(o.$t("time.localTime")),1),t.createElementVNode("div",Wr,t.toDisplayString(l.computeLocalTime(a.realTime,a.port))+" "+t.toDisplayString(l.computeTimeOffset(a.port)),1)])])]),t.createElementVNode("div",Zr,[t.createElementVNode("div",Xr,[t.createElementVNode("div",Hr,[(t.openBlock(),t.createElementBlock("svg",Or,[t.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,Yr)])),t.createElementVNode("div",null,t.toDisplayString(o.$t("weather.weather")),1)]),e[10]||(e[10]=t.createElementVNode("div",{class:"text-body-2 text-success ga-2"},null,-1))]),t.createElementVNode("div",{class:t.normalizeClass(["w-100 gray-bg-2 rounded",a.simple?"pa-2":"pa-4 py-2"])},[t.createVNode(m,{modelValue:i.currentIndex,"onUpdate:modelValue":e[0]||(e[0]=p=>i.currentIndex=p),class:"w-100 d-flex justify-space-around align-center ga-0 mb-2",density:"compact",group:"",height:"26","min-height":"26",rounded:"1",mandatory:""},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.dateList,p=>(t.openBlock(),t.createBlock(n,{key:p.index,class:t.normalizeClass(["text-none text-body-1 flex-1-1-0",`bg-${p.index===i.currentIndex?"bg-primary":"gray-bg-2"}`]),density:"compact",color:"primary",height:"26",value:p.index},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(p.label),1)]),_:2},1032,["class","value"]))),128))]),_:1},8,["modelValue"]),t.createElementVNode("table",Ur,[t.createElementVNode("tbody",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tableData,p=>(t.openBlock(),t.createElementBlock("tr",{key:p.id},[t.createElementVNode("th",Jr,[t.createTextVNode(t.toDisplayString(o.$t(`${p.key}`))+" ",1),p.unit?(t.openBlock(),t.createElementBlock("span",Kr," ( "+t.toDisplayString(p.unit)+" )",1)):t.createCommentVNode("",!0)]),t.createElementVNode("td",Qr,[p.img?(t.openBlock(),t.createElementBlock("img",{key:0,src:p==null?void 0:p.value0,style:{height:"30px"}},null,8,qr)):(t.openBlock(),t.createElementBlock("span",$r,t.toDisplayString((p==null?void 0:p.value0)??"-"),1))]),t.createElementVNode("td",el,[p.img?(t.openBlock(),t.createElementBlock("img",{key:0,src:p==null?void 0:p.value1,style:{height:"30px"}},null,8,tl)):(t.openBlock(),t.createElementBlock("span",ol,t.toDisplayString((p==null?void 0:p.value1)??"-"),1))]),t.createElementVNode("td",al,[p.img?(t.openBlock(),t.createElementBlock("img",{key:0,src:p==null?void 0:p.value2,style:{height:"30px"}},null,8,il)):(t.openBlock(),t.createElementBlock("span",rl,t.toDisplayString((p==null?void 0:p.value2)??"-"),1))]),t.createElementVNode("td",ll,[p.img?(t.openBlock(),t.createElementBlock("img",{key:0,src:p==null?void 0:p.value3,style:{height:"30px"}},null,8,nl)):(t.openBlock(),t.createElementBlock("span",sl,t.toDisplayString((p==null?void 0:p.value3)??"-"),1))])]))),128))])])],2)]),t.createElementVNode("div",cl,[t.createElementVNode("div",ml,[t.createElementVNode("div",dl,[(t.openBlock(),t.createElementBlock("svg",hl,[t.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,pl)])),t.createElementVNode("div",null,t.toDisplayString(o.$t("tide.tideTimes")),1)]),t.createElementVNode("div",gl,[i.showTideDetail?(t.openBlock(),t.createBlock(n,{key:0,icon:"mdi-eye-outline",density:"compact",variant:"plain",size:"small",onClick:e[1]||(e[1]=p=>i.showTideDetail=!1)})):(t.openBlock(),t.createBlock(n,{key:1,icon:"mdi-eye-off-outline",density:"compact",variant:"plain",size:"small",onClick:l.handleTide},null,8,["onClick"]))])]),i.showTideDetail?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["w-100 gray-bg-2 rounded",a.simple?"pa-2":"pa-4"])},[t.createElementVNode("div",ul,null,512),t.createElementVNode("table",fl,[t.createElementVNode("tbody",null,[t.createElementVNode("tr",null,[t.createElementVNode("th",yl,t.toDisplayString(o.$t("tide.tide")),1),t.createElementVNode("th",bl,t.toDisplayString(o.$t("time.time"))+" ( LT ) ",1),t.createElementVNode("th",wl,t.toDisplayString(o.$t("tide.height"))+" ( m )",1)]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tideTableData,(p,h)=>{var f;return t.openBlock(),t.createElementBlock("tr",{key:h},[t.createElementVNode("td",xl,t.toDisplayString(o.$t(`tide.${(f=p==null?void 0:p.type)==null?void 0:f.toLowerCase()}`))+" "+t.toDisplayString(o.$t("tide.tide")),1),t.createElementVNode("td",kl,t.toDisplayString(l.computeLocalTime(p==null?void 0:p.date,a.port,"MM-DD HH:mm")),1),t.createElementVNode("td",Al,t.toDisplayString((p==null?void 0:p.height)??"-")+" m",1)])}),128))])])],2)):t.createCommentVNode("",!0)])],2)]}),_:1},8,["class"])}const No=K(kr,[["render",Ll],["__scopeId","data-v-0c944618"]]),jy="",Cl={name:"IdmPort",components:{PortDetail:No},props:{map:{type:Object},ports:{type:Object},beforeLayer:{type:String},forecastModel:{type:String}},emits:["closeAllDetail"],setup(){return{Theme:ye.useTheme()}},data(){return{source:"port-source",layer:"port-layer",showInfo:!1,showDetail:!1,portId:void 0,port:{},hoverPort:{},marker:void 0}},watch:{ports:{handler(){var o,e,a,r,i,l;this.ports?(this.handleRender(),(o=this.map)==null||o.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 o;this.ports&&(this.map.getSource(this.source)?(o=this.map)==null||o.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(o){const e=o.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(o){var r,i;this.map.getCanvas().style.cursor="pointer";const e=o.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 de.Marker(l).setLngLat([o.lngLat.lng,o.lngLat.lat]).setOffset([0,-70]).addTo(this.map)}},handleLeave(){var o;this.showInfo=!1,this.hoverPort={},(o=this.marker)==null||o.remove(),this.map.getCanvas().style.cursor="grab"},handleCloseDetail(){this.showDetail=!1}}},vl={class:"port-box d-flex flex-column justify-center align-start ga-1"},zl={class:"d-flex justify-start align-center text-label"},_l={class:"d-flex justify-start align-center text-label"};function Sl(o,e,a,r,i,l){const n=t.resolveComponent("VCardText"),c=t.resolveComponent("VCard"),s=t.resolveComponent("PortDetail");return t.openBlock(),t.createElementBlock("div",null,[t.withDirectives(t.createVNode(c,{id:"idmPortInfo",ref:"idmPortInfo"},{default:t.withCtx(()=>[t.createVNode(n,{class:"text-body-1 pr-8"},{default:t.withCtx(()=>[t.createElementVNode("div",vl,[t.createElementVNode("div",null,t.toDisplayString(o.$t("port.port")),1),t.createElementVNode("div",zl,[t.createElementVNode("span",null,t.toDisplayString(i.hoverPort.name??"-"),1)]),t.createElementVNode("div",_l,[e[1]||(e[1]=t.createElementVNode("label",{class:"pr-1"},"LoCode : ",-1)),t.createElementVNode("span",null,t.toDisplayString(i.hoverPort.loCode??"-"),1)])])]),_:1})]),_:1},512),[[t.vShow,i.showInfo]]),i.showDetail?(t.openBlock(),t.createBlock(s,t.mergeProps({key:0,"port-id":i.portId,port:i.port,"forecast-model":a.forecastModel},o.$attrs,{onClose:l.handleCloseDetail,onCloseAllDetail:e[0]||(e[0]=m=>o.$emit("closeAllDetail",{ports:!0}))}),null,16,["port-id","port","forecast-model","onClose"])):t.createCommentVNode("",!0)])}const Nl=K(Cl,[["render",Sl],["__scopeId","data-v-d5b056e5"]]),Ml={name:"IdmLoadLine",props:{map:{type:Object},show:{type:Boolean},beforeLayer:{type:String}},setup(){return{Theme:ye.useTheme()}},data(){return{layer:"loadlines-fill",labelLayer:"loadlines-label"}},watch:{show:{handler(){this.show?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var o,e;(o=this.map)!=null&&o.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 o,e;(o=this.map)!=null&&o.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 Pl(o,e,a,r,i,l){return t.openBlock(),t.createElementBlock("div")}const Vl=K(Ml,[["render",Pl]]),Tl={name:"IdmTimezone",props:{map:{type:Object},zone:{type:Object},beforeLayer:{type:String}},setup(){return{Theme:ye.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 o=>{var a;return(a=v.tz.names().filter(r=>v.tz(v(),r).utcOffset()===o*60))==null?void 0:a[0]}}},watch:{zone:{handler(){var o,e,a,r;this.zone?(this.handleRender(),(o=this.map)==null||o.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 o={features:[],type:"FeatureCollection"};o.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:o}),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 o;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),(o=this.marker)==null||o.remove()},handleHover(o){var e,a,r;if(o.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===o.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 ${o.features[0].properties.offSet}:00</div>
|
|
6
6
|
<div>${v.tz(v().format(),this.timeZoneName(o.features[0].properties.offSet)).format("MM-DD HH:mm")}`,this.marker=new de.Marker(l).setLngLat([o.lngLat.lng,o.lngLat.lat]).setOffset([0,-30]).addTo(this.map)}},handleLeave(){}}};function El(o,e,a,r,i,l){return t.openBlock(),t.createElementBlock("div")}const Dl=K(Tl,[["render",El]]),Rl={name:"IdmVoluntaryReportingArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},setup(){return{Theme:ye.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 Bl(o,e,a,r,i,l){return t.openBlock(),t.createElementBlock("div")}const Il=K(Rl,[["render",Bl]]),Fl={name:"IdmSpecialArea",props:{map:{type:Object},area:{type:Object},beforeLayer:{type:String}},setup(){return{Theme:ye.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(o=>{o.geometry.type==="Polygon"&&o.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 Gl(o,e,a,r,i,l){return t.openBlock(),t.createElementBlock("div")}const jl=K(Fl,[["render",Gl]]),Wl={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 Zl(o,e,a,r,i,l){return t.openBlock(),t.createElementBlock("div")}const Xl=K(Wl,[["render",Zl]]),Hl={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 o;(o=this.map)!=null&&o.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 o;(o=this.map)!=null&&o.getLayer(this.layer)&&this.map.setLayoutProperty(this.layer,"visibility","none")}}};function Ol(o,e,a,r,i,l){return null}const Yl=K(Hl,[["render",Ol]]),Wy="",Ul={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 o,e;(o=this.map)!=null&&o.getLayer(this.lineLayer)&&(this.map.setLayoutProperty(this.lineLayer,"visibility","visible"),this.map.setPaintProperty(this.lineLayer,"line-width",1)),(e=this.map)!=null&&e.getLayer(this.labelLayer)&&this.map.setLayoutProperty(this.labelLayer,"visibility","visible")},handleClear(){var o,e;(o=this.map)!=null&&o.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","none"),(e=this.map)!=null&&e.getLayer(this.labelLayer)&&this.map.setLayoutProperty(this.labelLayer,"visibility","none")}}};function Jl(o,e,a,r,i,l){return null}const Kl=K(Ul,[["render",Jl]]),Ql={name:"IdmChinaRoute",props:{map:{type:Object},show:{type:Boolean},locale:{type:String,default:"zhHans"}},data(){return{labelLayer:"china-route-label",lineLayer:"china-route-line",fillLayer:"china-route-fill"}},watch:{show:{handler(){this.show?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var o,e,a;(o=this.map)!=null&&o.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","visible"),(e=this.map)!=null&&e.getLayer(this.fillLayer)&&this.map.setLayoutProperty(this.fillLayer,"visibility","visible"),(a=this.map)!=null&&a.getLayer(this.labelLayer)&&(this.map.setLayoutProperty(this.labelLayer,"visibility","visible"),this.map.setLayoutProperty(this.labelLayer,"text-field",this.locale==="en"?"{route_name_en}":"{route_name}"))},handleClear(){var o,e,a;(o=this.map)!=null&&o.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","none"),(e=this.map)!=null&&e.getLayer(this.fillLayer)&&this.map.setLayoutProperty(this.fillLayer,"visibility","none"),(a=this.map)!=null&&a.getLayer(this.labelLayer)&&this.map.setLayoutProperty(this.labelLayer,"visibility","none")}}};function ql(o,e,a,r,i,l){return null}const $l=K(Ql,[["render",ql]]),Zy="",Xy="",en={name:"IdmTideStations",props:{simple:{type:Boolean,default:!1},map:{type:Object},gateway:{type:String},token:{type:String},defaultMeteoToken:{type:String},theme:{type:String,default:"dark"},locale:{type:String},realTime:{type:String},timeZone:{type:Number},forecastModel:{type:String},station:{type:Object}},emits:["close","closeAllDetail"],setup(){return{Theme:ye.useTheme()}},data(){return{tideData:{},tideTableData:[],currentIndex:0,xDate:[],echartData:{}}},computed:{dateList(){var a,r,i,l;const o=[],e=(a=this.station)!=null&&a.lng&&((r=this.station)!=null&&r.lat)?M.LngLatHelper.guessTimeZoneOffset((i=this.station)==null?void 0:i.lng,(l=this.station)==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*3,"hours").utc().format());o.push(c)}return o},computeLocalTime(){return function(o,e,a="yyyy-MM-DD HH:mm"){if(!o||!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(o).utcOffset(r).format(a)}},computeTimeOffset(){return function(o){if(!o||o.lng===null||o.lng===void 0||isNaN(o.lng)||o.lat===null||o.lat===void 0||isNaN(o.lat))return"-";const e=M.LngLatHelper.guessTimeZoneOffset(o==null?void 0:o.lng,o==null?void 0:o.lat);return"( UTC "+(e>=0?"+":"")+e+" )"}},computePosition(){return function(o){return!o||o.lng===null||o.lng===void 0||isNaN(o.lng)||o.lat===null||o.lat===void 0||isNaN(o.lat)?"-":M.LngLatHelper.lat2pretty(o==null?void 0:o.lat,2).pretty+" / "+M.LngLatHelper.lng2pretty(o==null?void 0:o.lng,2).pretty}},computeRoundPrecision(){return function(o,e=4){return o==null||isNaN(o)||isNaN(e)?"-":M.LngLatHelper.roundPrecision(o,e)}}},watch:{theme:{handler(){this.$nextTick(()=>{this.initEchart()})}},currentIndex:{handler(){this.initTideTableData(this.tideData)}},station:{handler(){this.$emit("closeAllDetail",{tide:!0}),this.fetchTidesData()},immediate:!0}},methods:{async fetchTidesData(){var a,r,i,l;this.tideLoading=!0,this.tideData={};let o={lat:this.station.lat,lng:this.station.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 me.post(`${this.gateway}/api/arc/meteo2/spot/tides/forecast`,o,{headers:{Authorization:this.token||this.defaultMeteoToken}});((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(o){var e,a;this.tideTableData=Kt.TidesAssist.pickDailyExtremes(o,(a=(e=this.dateList)==null?void 0:e[this.currentIndex])==null?void 0:a.dateTime),this.initEchartData()},initEchartData(){var o;this.xDate=[],this.echartData={height:[]},(o=this.tideTableData)==null||o.forEach(e=>{this.xDate.push(this.computeLocalTime(e.date,this.station,"MM-DD HH:mm")),this.echartData.height.push([this.computeLocalTime(e.date,this.station,"MM-DD HH:mm"),e.height??void 0,"m"])}),this.initEchart()},initEchart(){So.dispose(this.$refs.tideEchart.style);const o=So.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;">
|
|
7
7
|
<span style="display:inline-block; height: 8px;width: 8px;border-radius: 50%;background-color: ${l.color}"></span>
|
|
8
8
|
<span>${l.seriesName} : </span>
|
|
9
9
|
<strong>${l.value[1]}m</strong>
|
|
10
|
-
</div>`)}),r}},legend:{show:!0,right:20,top:0,itemWidth:30,data:["Height"],textStyle:{color:this.Theme.current.value.colors["on-surface"]}},grid:{top:40,left:10,right:10,bottom:30,containLabel:!0},xAxis:[{type:"category",data:this.xDate,boundaryGap:!0,axisTick:{alignWithLabel:!0,lineStyle:{color:this.Theme.current.value.colors["echart-axis"]}},axisLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["echart-axis"]}},axisLabel:{interval:"auto",margin:15,textStyle:{fontSize:12,color:this.Theme.current.value.colors["echart-axis"]}}}],yAxis:[{name:"(m)",show:!0,nameLocation:"end",position:"left",nameGap:15,splitNumber:5,splitLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["echart-split"]}},alignTicks:!0,axisLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["echart-axis"]}},axisLabel:{textStyle:{fontSize:12,color:this.Theme.current.value.colors["echart-axis"]}}}],series:[{name:"Height",type:"line",showSymbol:!0,yAxisIndex:0,lineStyle:{color:this.Theme.current.value.colors["map-perple"]},itemStyle:{color:this.Theme.current.value.colors["map-perple"]},data:this.echartData.height}]};o==null||o.setOption(e)},handleClose(){this.$emit("close")}}},tn={class:"d-flex justify-space-between align-center"},on={class:"d-flex justify-start text-h5 my-2"},an={class:"d-flex justify-start align-center text-h6 text-label ga-3"},rn={class:"summary-box w-100"},ln={class:"d-flex justify-space-between align-center py-2"},nn={class:"d-flex justify-center align-center text-h6 ga-2"},sn={class:"multi-color-icon","aria-hidden":"true"},cn=["xlink:href"],mn={class:"gray-bg-2 rounded d-flex flex-column ga-4 pa-4"},dn={class:"w-100 d-flex justify-start align-center"},hn={class:"w-30 text-label font-weight-400"},pn={class:"flex-1-1-0"},gn={class:"w-100 d-flex justify-start align-center"},un={class:"w-30 text-label font-weight-400"},fn={class:"flex-1-1-0"},yn={class:"w-100 d-flex justify-start align-center"},bn={class:"w-30 text-label font-weight-400"},wn={class:"flex-1-1-0"},xn={class:"table-box w-100 mt-2 mb-4 d-flex flex-column justify-start align-center"},kn={class:"w-100 d-flex justify-space-between align-center py-2"},An={class:"d-flex justify-center align-center text-h6 ga-2"},Ln={class:"multi-color-icon","aria-hidden":"true"},Cn=["xlink:href"],vn={ref:"tideEchart",class:"w-100",style:{height:"244px"}},zn={"fixed-header":"",density:"compact",class:"w-100 tide-table bg-none"},_n={class:"px-1 text-center text-label font-weight-400",width:"120"},Sn={class:"px-1 text-center text-label font-weight-400",width:"120"},Nn={class:"px-1 text-center text-label font-weight-400",width:"120"},Mn={class:"px-1 text-center"},Pn={class:"px-1 text-center"},Vn={class:"px-1 text-center"};function Tn(o,e,a,r,i,l){const n=t.resolveComponent("VBtn"),c=t.resolveComponent("VCardTitle"),s=t.resolveComponent("VDivider"),m=t.resolveComponent("VBtnToggle"),d=t.resolveComponent("VCard");return t.openBlock(),t.createBlock(d,{class:t.normalizeClass(["tide-detail-container d-flex flex-column justify-start align-center",a.simple?"page":"dialog"])},{default:t.withCtx(()=>{var g,u;return[t.createVNode(c,{class:"w-100"},{default:t.withCtx(()=>{var y;return[t.createElementVNode("div",tn,[t.createElementVNode("div",on,[t.createElementVNode("div",null,t.toDisplayString((y=a.station)==null?void 0:y.name),1)]),t.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"",onClick:l.handleClose},{default:t.withCtx(()=>e[1]||(e[1]=[t.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[1]},8,["onClick"])]),t.createElementVNode("div",an,[t.createElementVNode("div",null,t.toDisplayString(o.$t("tide.tideStation")),1)])]}),_:1}),t.createVNode(s,{class:"w-100"}),t.createElementVNode("div",{class:t.normalizeClass(["w-100 pt-0 pb-0 overflow-y-auto scroll",a.simple?"px-3":"px-5"])},[t.createElementVNode("div",rn,[t.createElementVNode("div",ln,[t.createElementVNode("div",nn,[(t.openBlock(),t.createElementBlock("svg",sn,[t.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,cn)])),t.createElementVNode("div",null,t.toDisplayString(o.$t("detail.summary")),1)])]),t.createElementVNode("div",mn,[t.createElementVNode("div",dn,[t.createElementVNode("div",hn,t.toDisplayString(o.$t("tide.region")),1),t.createElementVNode("div",pn,t.toDisplayString(((g=a.station)==null?void 0:g.Country)??((u=a.station)==null?void 0:u.city)??"-"),1)]),t.createElementVNode("div",gn,[t.createElementVNode("div",un,t.toDisplayString(o.$t("tide.position")),1),t.createElementVNode("div",fn,t.toDisplayString(l.computePosition(a.station)),1)]),t.createElementVNode("div",yn,[t.createElementVNode("div",bn,t.toDisplayString(o.$t("time.localTime")),1),t.createElementVNode("div",wn,t.toDisplayString(l.computeLocalTime(a.realTime,a.station))+" "+t.toDisplayString(l.computeTimeOffset(a.station)),1)])])]),t.createElementVNode("div",xn,[t.createElementVNode("div",kn,[t.createElementVNode("div",An,[(t.openBlock(),t.createElementBlock("svg",Ln,[t.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,Cn)])),t.createElementVNode("div",null,t.toDisplayString(o.$t("tide.tideTimes")),1)]),e[2]||(e[2]=t.createElementVNode("div",{class:"text-body-2 text-success ga-2"},null,-1))]),t.createElementVNode("div",{class:t.normalizeClass(["w-100 gray-bg-2 rounded",a.simple?"pa-2":"pa-4 py-2"])},[t.createVNode(m,{modelValue:i.currentIndex,"onUpdate:modelValue":e[0]||(e[0]=y=>i.currentIndex=y),class:"w-100 d-flex justify-space-around align-center ga-0 mb-4",density:"compact",group:"",height:"26","min-height":"26",rounded:"1",mandatory:""},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.dateList,y=>(t.openBlock(),t.createBlock(n,{key:y.label,class:"text-none text-body-1 flex-1-1-0 gray-bg-2",density:"compact",color:"primary",height:"26",value:y.index},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(y.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"]),t.createElementVNode("div",vn,null,512),t.createElementVNode("table",zn,[t.createElementVNode("tbody",null,[t.createElementVNode("tr",null,[t.createElementVNode("th",_n,t.toDisplayString(o.$t("tide.tide")),1),t.createElementVNode("th",Sn,t.toDisplayString(o.$t("time.time"))+" ( LT ) ",1),t.createElementVNode("th",Nn,t.toDisplayString(o.$t("tide.height"))+" ( m )",1)]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tideTableData,(y,p)=>{var h;return t.openBlock(),t.createElementBlock("tr",{key:p},[t.createElementVNode("td",Mn,t.toDisplayString(o.$t(`tide.${(h=y==null?void 0:y.type)==null?void 0:h.toLowerCase()}`))+" "+t.toDisplayString(o.$t("tide.tide")),1),t.createElementVNode("td",Pn,t.toDisplayString(l.computeLocalTime(y==null?void 0:y.date,a.station,"MM-DD HH:mm")),1),t.createElementVNode("td",Vn,t.toDisplayString((y==null?void 0:y.height)??"-")+" m",1)])}),128))])])],2)])],2)]}),_:1},8,["class"])}const En=K(en,[["render",Tn],["__scopeId","data-v-69fa2a3c"]]),Hy="",Dn={name:"IdmTideStations",components:{TideDetail:En},props:{map:{type:Object},show:{type:Boolean},locale:{type:String},beforeLayer:{type:String}},data(){return{layer:"tide-stations",showInfo:!1,hoverStation:void 0,marker:null,showDetail:!1,station:void 0}},watch:{show:{handler(){var o,e,a,r,i,l;this.show?(this.handleRender(),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):(this.handleClear(),(r=this.map)==null||r.off("click",[this.layer],this.handleClick),(i=this.map)==null||i.off("mousemove",[this.layer],this.handleHover),(l=this.map)==null||l.off("mouseleave",[this.layer],this.handleLeave))},immediate:!0},locale:{handler(){this.show&&this.handleRender()},immediate:!0}},methods:{handleRender(){var o;(o=this.map)!=null&&o.getLayer(this.layer)&&(this.map.setLayoutProperty(this.layer,"visibility","visible"),this.map.setLayoutProperty(this.layer,"text-field",this.locale==="en"?"{Location_EN}":"{Location_CN}"))},handleClear(){var o;this.showInfo=!1,(o=this.map)!=null&&o.getLayer(this.layer)&&this.map.setLayoutProperty(this.layer,"visibility","none")},handleClick(o){const e=o.features[0];e.properties&&(this.station=e.properties,this.station.name=this.locale==="en"?e.properties.Location_EN:e.properties.Location_CN,this.station.lng=e.geometry.coordinates[0],this.station.lat=e.geometry.coordinates[1],this.showDetail=!0)},handleHover(o){var a,r;this.map.getCanvas().style.cursor="pointer";const e=o.features[0];if(e.properties){this.showInfo=!0,this.hoverStation=e.properties,this.hoverStation.name=this.locale==="en"?e.properties.Location_EN:e.properties.Location_CN,this.hoverStation.lng=e.geometry.coordinates[0],this.hoverStation.lat=e.geometry.coordinates[1],(a=this.marker)==null||a.remove();const i=(r=document.getElementById("idmTidalInfo"))==null?void 0:r.cloneNode(!0);this.marker=new de.Marker(i).setLngLat([o.lngLat.lng,o.lngLat.lat]).setOffset([0,-60]).addTo(this.map)}},handleLeave(){var o;this.showInfo=!1,this.hoverStation={},(o=this.marker)==null||o.remove(),this.map.getCanvas().style.cursor="grab"},handleCloseDetail(){this.showDetail=!1}}},Rn={class:"station-box d-flex flex-column justify-center align-start ga-1"},Bn={class:"d-flex justify-start align-center"},In={class:"d-flex justify-start align-center"},Fn={class:"text-label"};function Gn(o,e,a,r,i,l){const n=t.resolveComponent("VCardText"),c=t.resolveComponent("VCard"),s=t.resolveComponent("TideDetail");return t.openBlock(),t.createElementBlock("div",null,[t.withDirectives(t.createVNode(c,{id:"idmTidalInfo"},{default:t.withCtx(()=>[t.createVNode(n,{class:"pr-8 text-body-1"},{default:t.withCtx(()=>{var m,d;return[t.createElementVNode("div",Rn,[t.createElementVNode("div",Bn,t.toDisplayString(o.$t("tide.tideStation")),1),t.createElementVNode("div",In,[t.createElementVNode("label",Fn,t.toDisplayString((m=i.hoverStation)==null?void 0:m.name)+" , "+t.toDisplayString(((d=i.hoverStation)==null?void 0:d.Country)||"-"),1)])])]}),_:1})]),_:1},512),[[t.vShow,i.showInfo]]),i.showDetail?(t.openBlock(),t.createBlock(s,t.mergeProps({key:0,station:i.station},o.$attrs,{onClose:l.handleCloseDetail}),null,16,["station","onClose"])):t.createCommentVNode("",!0)])}const jn=K(Dn,[["render",Gn],["__scopeId","data-v-ad725d5e"]]),Wn={name:"IdmIceAreas",props:{map:{type:Object},show:{type:Boolean}},data(){return{lineLayer:"ice-area-line",fillLayer:"ice-area-fill"}},watch:{show:{handler(){this.show?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var o,e;(o=this.map)!=null&&o.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","visible"),(e=this.map)!=null&&e.getLayer(this.fillLayer)&&this.map.setLayoutProperty(this.fillLayer,"visibility","visible")},handleClear(){var o,e;(o=this.map)!=null&&o.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","none"),(e=this.map)!=null&&e.getLayer(this.fillLayer)&&this.map.setLayoutProperty(this.fillLayer,"visibility","none")}}};function Zn(o,e,a,r,i,l){return null}const Xn=K(Wn,[["render",Zn]]),Oy="",Hn={name:"IdmLatLng",props:{simple:{type:Boolean,default:!1},map:{type:Object},show:{type:Boolean},mapFeather:{type:String},beforeLayer:{type:String},menuToggle:{type:Object}},data(){return{lngLat:{e:{lng:0,lat:0},lng:0,lat:0,str:""},source:"idm-lat-lng-source",layer:"idm-lat-lng-layer",labelLayer:"idm-lat-lng-label-layer",right:10}},computed:{lineColor(){return["satellite","dark"].includes(this.mapFeather)?"rgba(255, 255, 255, 0.3)":"rgba(0, 0, 0, 0.3)"},labelColor(){return["satellite","dark"].includes(this.mapFeather)?"rgba(255, 255, 255, 0.8)":"rgba(0, 0, 0, 0.5)"}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){var o;this.map&&((o=this.map)==null||o.on("mousemove",this.handleMouseMove))},immediate:!0},"menuToggle.v":{handler(){var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10},immediate:!0},"lngLat.e":{handler(o){this.lngLat.lng=M.LngLatHelper.lng2pretty(o==null?void 0:o.lng,2).pretty,this.lngLat.lat=M.LngLatHelper.lat2pretty(o==null?void 0:o.lat,2).pretty,this.lngLat.str=`[${M.LngLatHelper.str2Lat(o==null?void 0:o.lat,4)}, ${M.LngLatHelper.str2Lng(o==null?void 0:o.lng,4)}]`},immediate:!0}},methods:{handleBind(){var o,e;this.show?((o=this.map)==null||o.on("zoomend",this.handleZoomEnd),this.handleRender()):(this.handleClear(),(e=this.map)==null||e.off("zoomend",this.handleZoomEnd))},handleMouseMove(o){this.lngLat.e=o.lngLat},handleComputeLatLngs(){var r;const o=(r=this.map)==null?void 0:r.getZoom();let e=30;o>4?e=10:o>3&&(e=15);const a=[];for(let i=-60;i<90;i+=e)a.push({type:"Feature",geometry:{type:"LineString",coordinates:[[-180,i],[180,i]]}});for(let i=-180;i<180;i+=e)a.push({type:"Feature",geometry:{type:"LineString",coordinates:[[i,-90],[i,90]]}});for(let i=180;i>-180;i-=e)for(let l=-60;l<90;l+=e)a.push({type:"Feature",geometry:{type:"Point",coordinates:[i,l]},properties:{val:`${l>0?l+" N":l===0?l:l*-1+" S"}, ${i>0?i+" E":i*-1+" W"}`}});return a},handleZoomEnd(){var e;const o=this.handleComputeLatLngs();(e=this.map)==null||e.getSource(this.source).setData(E.featureCollection(o))},handleRender(){if(this.handleClear(),this.map){const o=this.handleComputeLatLngs();this.map.addSource(this.source,{type:"geojson",data:{type:"FeatureCollection",features:o}}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":this.lineColor,"line-width":1}},this.beforeLayer),this.map.addLayer({id:this.labelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":"{val}","text-rotation-alignment":"viewport","text-offset":[0,1],"text-size":10,"text-allow-overlap":!0},paint:{"text-opacity":1,"text-color":this.labelColor}},this.beforeLayer)}},handleClear(){var o,e,a,r,i,l;(o=this.map)!=null&&o.getLayer(this.layer)&&((e=this.map)==null||e.removeLayer(this.layer)),(a=this.map)!=null&&a.getLayer(this.labelLayer)&&((r=this.map)==null||r.removeLayer(this.labelLayer)),(i=this.map)!=null&&i.getSource(this.source)&&((l=this.map)==null||l.removeSource(this.source))}}};function On(o,e,a,r,i,l){var n,c,s;return a.simple?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:"idm-lat-lng-tip-gl4 pa-2 text-caption text-right rounded",style:t.normalizeStyle({right:i.right+"px"})},[t.createElementVNode("div",null,t.toDisplayString((n=i.lngLat)==null?void 0:n.lat),1),t.createElementVNode("div",null,t.toDisplayString((c=i.lngLat)==null?void 0:c.lng),1),t.createElementVNode("div",null,t.toDisplayString((s=i.lngLat)==null?void 0:s.str),1)],4))}const jo=K(Hn,[["render",On]]),Yy="",Yn={name:"IdmFollowPort",components:{PortDetail:No},props:{map:{type:Object},beforeLayer:{type:String},forecastModel:{type:String},show:{type:Boolean},followList:{type:Array}},emits:["closeAllDetail"],setup(){return{Theme:ye.useTheme()}},data(){return{source:"follow-port-source",layer:"follow-port-layer",showInfo:!1,portId:"",hoverPort:{},port:{},marker:void 0,showDetail:!1}},watch:{show:{handler(){var o,e,a;this.show?(this.handleRender(),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()},immediate:!0},followList:{handler(){var o,e,a;this.followList&&this.show?(this.handleClear(),this.handleRender(),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()}}},methods:{handleRender(){var e,a;const o={features:[],type:"FeatureCollection"};(e=this.followList)==null||e.forEach(r=>{var i;if((i=r.port)!=null&&i.id){const l=r.port,n={type:"Feature",properties:l,geometry:{type:"Point",coordinates:[l.lng,l.lat]}};o.features.push(n)}}),this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(o):(this.map.addSource(this.source,{type:"geojson",data:o}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":1,"icon-image":"port","icon-offset":[0,-13],"text-anchor":"bottom","text-field":"{name}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,1.6]},paint:{"text-color":this.Theme.current.value.colors["on-surface"],"text-halo-width":1}},this.beforeLayer))},handleClear(){var o,e,a;this.showInfo=!1,this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)},handleClick(o){const e=o.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(o){var r,i;this.map.getCanvas().style.cursor="pointer";const e=o.features[0];if(e.properties.id){this.showInfo=!0,this.hoverPort=e.properties,(r=this.marker)==null||r.remove();const l=(i=document.getElementById("idmFollowPortInfo"))==null?void 0:i.cloneNode(!0);this.marker=new de.Marker(l).setLngLat([o.lngLat.lng,o.lngLat.lat]).setOffset([0,-70]).addTo(this.map)}},handleLeave(){var o;this.showInfo=!1,this.hoverPort={},(o=this.marker)==null||o.remove(),this.map.getCanvas().style.cursor="grab"},handleCloseDetail(){this.showDetail=!1}}},Un={class:"port-box d-flex flex-column justify-center align-start ga-1"},Jn={class:"d-flex justify-start align-center text-label"},Kn={class:"d-flex justify-start align-center text-label"};function Qn(o,e,a,r,i,l){const n=t.resolveComponent("VCardText"),c=t.resolveComponent("VCard"),s=t.resolveComponent("PortDetail");return t.openBlock(),t.createElementBlock("div",null,[t.withDirectives(t.createVNode(c,{id:"idmFollowPortInfo",ref:"idmFollowPortInfo"},{default:t.withCtx(()=>[t.createVNode(n,{class:"text-body-1 pr-8"},{default:t.withCtx(()=>[t.createElementVNode("div",Un,[t.createElementVNode("div",null,t.toDisplayString(o.$t("port.port")),1),t.createElementVNode("div",Jn,[t.createElementVNode("span",null,t.toDisplayString(i.hoverPort.name??"-"),1)]),t.createElementVNode("div",Kn,[e[1]||(e[1]=t.createElementVNode("label",{class:"pr-1"},"LoCode : ",-1)),t.createElementVNode("span",null,t.toDisplayString(i.hoverPort.loCode??"-"),1)])])]),_:1})]),_:1},512),[[t.vShow,i.showInfo]]),i.showDetail?(t.openBlock(),t.createBlock(s,t.mergeProps({key:0,"port-id":i.portId,port:i.port,"forecast-model":a.forecastModel,"follow-list":a.followList},o.$attrs,{onClose:l.handleCloseDetail,onCloseAllDetail:e[0]||(e[0]=m=>o.$emit("closeAllDetail",{followPort:!0}))}),null,16,["port-id","port","forecast-model","follow-list","onClose"])):t.createCommentVNode("",!0)])}const qn=K(Yn,[["render",Qn],["__scopeId","data-v-9b28c4ea"]]),Uy="",$n={name:"IdmFollowPosition",props:{map:{type:Object},beforeLayer:{type:String},forecastModel:{type:String},show:{type:Boolean},followList:{type:Array},realTime:{type:String}},setup(){return{Theme:ye.useTheme()}},data(){return{source:"follow-coordinate-source",layer:"follow-coordinate-layer",position:{},showInfo:!1,marker:null}},computed:{computePosition(){return function(o){return!o||o.lng===null||o.lng===void 0||isNaN(o.lng)||o.lat===null||o.lat===void 0||isNaN(o.lat)?"-":M.LngLatHelper.lat2pretty(o==null?void 0:o.lat,2).pretty+" / "+M.LngLatHelper.lng2pretty(o==null?void 0:o.lng,2).pretty}}},watch:{show:{handler(){var o,e,a;this.show?(this.handleClear(),this.handleRender(),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()},immediate:!0},followList:{handler(){var o,e,a;this.followList&&this.show?(this.handleClear(),this.handleRender(),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()}}},methods:{handleRender(){var e,a;const o={features:[],type:"FeatureCollection"};(e=this.followList)==null||e.forEach(r=>{if(r.coordinate){const i=r.coordinate,l={type:"Feature",properties:{id:r.id,remark:r.remark,...r.coordinate},geometry:{type:"Point",coordinates:[i.lng,i.lat]}};o.features.push(l)}}),this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(o):(this.map.addSource(this.source,{type:"geojson",data:o}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":1.1,"icon-image":"location","icon-offset":[0,-16]},paint:{"text-color":this.Theme.current.value.colors["on-surface"],"text-halo-width":1}},this.beforeLayer))},handleClear(){var o,e,a;this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source),(o=this.map)==null||o.off("click",[this.layer],this.handleClick),(e=this.map)==null||e.off("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.off("mouseleave",[this.layer],this.handleLeave)},handleClick(o){var a,r,i,l,n,c,s,m,d;const e=o.features[0];if(e.properties){const g=e.properties;g.lng=e.geometry.coordinates[0],g.lat=e.geometry.coordinates[1];const u=v(),y=(a=v(this.realTime))==null?void 0:a.diff(u,"d",!0),p={followId:g.id,lat:g.lat,lng:g.lng,datetime:this.realTime,forecastModel:this.forecastModel};y>=0?(n=(l=(i=(r=this.$parent)==null?void 0:r.$parent)==null?void 0:i.$refs)==null?void 0:l.idmSpot)==null||n.fetchForecastData(p):(d=(m=(s=(c=this.$parent)==null?void 0:c.$parent)==null?void 0:s.$refs)==null?void 0:m.idmSpot)==null||d.fetchHistoryData(p)}},handleHover(o){var a;this.map.getCanvas().style.cursor="pointer";const e=o.features[0];if(e.properties.id){this.showInfo=!0,this.position=e.properties,(a=this.marker)==null||a.remove();const r=document.getElementById("idmFollowPositionInfo").cloneNode(!0);this.marker=new de.Marker(r).setLngLat([o.lngLat.lng,o.lngLat.lat]).setOffset([0,-70]).addTo(this.map)}},handleLeave(){var o;this.showInfo=!1,(o=this.marker)==null||o.remove(),this.map.getCanvas().style.cursor="grab"}}},es={class:"position-box d-flex flex-column justify-center align-start ga-1"},ts={class:"d-flex justify-start align-center text-label"},os={key:0,class:"d-flex justify-start align-center text-label"};function as(o,e,a,r,i,l){const n=t.resolveComponent("VCardText"),c=t.resolveComponent("VCard");return t.withDirectives((t.openBlock(),t.createBlock(c,{id:"idmFollowPositionInfo",ref:"idmFollowPositionInfo"},{default:t.withCtx(()=>[t.createVNode(n,{class:"text-body-1 pr-8"},{default:t.withCtx(()=>[t.createElementVNode("div",es,[e[0]||(e[0]=t.createElementVNode("div",null,"Location",-1)),t.createElementVNode("div",ts,[t.createElementVNode("span",null,t.toDisplayString(l.computePosition(i.position)),1)]),i.position.remark?(t.openBlock(),t.createElementBlock("div",os,[t.createElementVNode("span",null,t.toDisplayString(i.position.remark??"-"),1)])):t.createCommentVNode("",!0)])]),_:1})]),_:1},512)),[[t.vShow,i.showInfo]])}const is=K($n,[["render",as],["__scopeId","data-v-1de14e27"]]),Jy="",rs={name:"IdmOtherLayerr",components:{IdmWarZone:mr,IdmGmdssArea:pr,IdmEcaZone:fr,IdmAlertZone:xr,IdmPort:Nl,IdmLoadLine:Vl,IdmTimezone:Dl,IdmVRA:Il,IdmSpecialArea:jl,IdmTerminator:Xl,IdmWorld12nm:Yl,IdmWorldMarine:Kl,IdmChinaRoute:$l,IdmTideStations:jn,IdmIceAreas:Xn,IdmLatLng:jo,IdmFollowPort:qn,IdmFollowPosition:is},props:{simple:{type:Boolean,default:!1},map:{type:Object},theme:{type:String},token:{type:String},isLogin:{type:Boolean,default:!1},defaultMeteoToken:{type:String},gateway:{type:String},assistGateway:{type:Array,default:[]},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuHeight:{type:Number,default:248},menuToggle:{type:Object,default:{}},ts:{type:String},forecastModel:{type:String},realTime:{type:String}},emits:["map","other","menuToggle","mapFeather","theme","followLayerList","otherCheckList","tempFeatherCount"],data(){return{right:10,toggle:!1,mapFeather:localStorage.getItem("mapFeathersCacheGL4")||"dark",tagLayers:[...eo.LayerHelper.OTHER_LAYERS.filter(o=>o.enabled)],layerWeight:0,otherLayers:{},activeOtherLayers:[],cache:{v:"0.0.2",versionKey:"otherLayerCacheVersionGL4",checkListKey:"otherChecklistCacheGL4",followListKey:"otherFollowListCacheGL4",mapFeatherKey:"mapFeathersCacheGL4"},mapFeathers:[{name:"Light Map",value:"light",locale:"lightMap"},{name:"Dark Map",value:"dark",locale:"darkMap"},{name:"Satelite Map",value:"satellite",locale:"satelliteMap"},{name:"Nautical Map",value:"nautical",locale:"nauticalMap"}],checkList:[]}},computed:{listStyle(){return this.simple?{top:this.top+"px",left:this.toggle?"0px":"-280px"}:{top:this.top+"px",right:this.toggle?"0px":"-280px"}}},watch:{"menuToggle.v":{handler(){this.toggle=this.menuToggle.otherLayers,this.$nextTick(()=>{var o;this.simple||(this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10)})},immediate:!0},realTime:{handler(o,e){o&&e&&o!==e&&this.checkList.includes("day-night")&&this.fetchDayNightLayer()}},theme:{handler(){this.theme==="light"?this.mapFeather=["light","nautical"].includes(this.mapFeather)?this.mapFeather:"light":this.theme==="dark"&&(this.mapFeather=["dark","satellite"].includes(this.mapFeather)?this.mapFeather:"dark")}},mapFeather:{handler(){localStorage.setItem(this.cache.mapFeatherKey,this.mapFeather),this.$emit("mapFeather",this.mapFeather),this.$emit("theme",["light","nautical"].includes(this.mapFeather)?"light":"dark")},immediate:!0},checkList:{handler(o,e){localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList)),this.activeOtherLayers=this.tagLayers.filter(l=>this.checkList.includes(l.key))||[];const a=o==null?void 0:o.filter(l=>!(e!=null&&e.includes(l))),r=e==null?void 0:e.filter(l=>!(o!=null&&o.includes(l))),i=o==null?void 0:o.filter(l=>e==null?void 0:e.includes(l));if((r==null?void 0:r.length)>0&&r.forEach(l=>{this.otherLayers[l]=void 0,delete this.otherLayers[l]}),(a==null?void 0:a.length)>0){const l=this.tagLayers.filter(n=>this.checkList.includes(n.key)&&!i.includes(n.key))||[];this.handleLayersChange(l)}this.$emit("otherCheckList",this.checkList)}}},async mounted(){this.fetchCache()},methods:{fetchCache(){const o=localStorage.getItem(this.cache.versionKey);this.cache.v!==o&&(localStorage.removeItem(this.cache.checkListKey),localStorage.removeItem(this.cache.followListKey),localStorage.removeItem(this.cache.mapFeatherKey),localStorage.setItem(this.cache.versionKey,this.cache.v));let e=localStorage.getItem(this.cache.checkListKey);this.checkList=JSON.parse(e||'["eca-zones"]'),localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList)),e=localStorage.getItem(this.cache.mapFeatherKey);const a=e||"dark";this.$emit("mapFeather",a),localStorage.setItem(this.cache.mapFeatherKey,a)},handleMenuToggle(){this.$emit("menuToggle","otherLayers")},handleToggleMapFeather(o){this.mapFeather=o.value,(this.mapFeather==="light"||this.mapFeather==="dark")&&this.$emit("tempFeatherCount")},async fetchOtherLayers(){var e,a;let o=this.layerWeight;if(o){const r=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],i=await me.get(`${r}/api/arc/other/layers/links?l=${o}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(((e=i==null?void 0:i.data)==null?void 0:e.code)===0){const l=(a=i==null?void 0:i.data)==null?void 0:a.data,n=[];for(const s in l)n.push(me.get(l[s],{headers:{Authorization:this.defaultMeteoToken,key:s}}));(await Promise.all(n)).map(s=>{var g,u,y;const m=((g=s==null?void 0:s.data)==null?void 0:g.data)||(s==null?void 0:s.data),d=(y=(u=s==null?void 0:s.config)==null?void 0:u.headers)==null?void 0:y.key;this.otherLayers[d]=m})}}},async fetchDayNightLayer(){var a,r;const o=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],e=await me.get(`${o}/api/arc/other/layers/links?l=1024&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});((a=e==null?void 0:e.data)==null?void 0:a.code)===0&&(this.otherLayers["day-night"]=((r=e==null?void 0:e.data)==null?void 0:r.data)||(e==null?void 0:e.data))},handleLayersChange(o){const e=o==null?void 0:o.reduce((a,r)=>a+(r==null?void 0:r.weight),0);this.layerWeight=e,this.fetchOtherLayers()}}},ls={class:"idm-gl4-other-layer"},ns={class:"header-box w-100 d-flex justify-space-between align-center px-4"},ss={class:"text-h5 font-weight-medium"},cs={class:"layers-body mt-4 mb-2 d-flex justify-start align-center flex-wrap"},ms=["onClick"],ds={key:0,src:"https://ossimg.ormwx.com/asset/dark-map.png",class:"border rounded-sm"},hs={key:1,src:"https://ossimg.ormwx.com/asset/nautical-map.png",class:"border rounded-sm"},ps={key:2,src:"https://ossimg.ormwx.com/asset/satellite-map.png",class:"border rounded-sm"},gs={key:3,src:"https://ossimg.ormwx.com/asset/light-map.png",class:"border rounded-sm"},us={class:"text-body-2 text-center pt-2"};function fs(o,e,a,r,i,l){var se,le,N,j,Z,Q,G,B,U;const n=t.resolveComponent("VBtn"),c=t.resolveComponent("VTooltip"),s=t.resolveComponent("VCardTitle"),m=t.resolveComponent("VCardItem"),d=t.resolveComponent("VCheckbox"),g=t.resolveComponent("VCardText"),u=t.resolveComponent("VCard"),y=t.resolveComponent("IdmPort"),p=t.resolveComponent("IdmTideStations"),h=t.resolveComponent("IdmLatLng"),f=t.resolveComponent("IdmTerminator"),w=t.resolveComponent("IdmTimezone"),b=t.resolveComponent("IdmAlertZone"),A=t.resolveComponent("IdmEcaZone"),x=t.resolveComponent("IdmWarZone"),C=t.resolveComponent("IdmGmdssArea"),k=t.resolveComponent("IdmLoadLine"),_=t.resolveComponent("IdmWorldMarine"),z=t.resolveComponent("IdmVRA"),P=t.resolveComponent("IdmSpecialArea"),T=t.resolveComponent("IdmWorld12nm"),V=t.resolveComponent("IdmChinaRoute"),O=t.resolveComponent("IdmIceAreas"),Y=t.resolveComponent("IdmFollowPort"),J=t.resolveComponent("IdmFollowPosition");return t.openBlock(),t.createElementBlock("div",ls,[t.createElementVNode("div",{class:t.normalizeClass(["menu-bar-box transition px-1 rounded",a.simple?"simple":""]),style:t.normalizeStyle({top:a.top+10+"px",right:i.right+"px",paddingTop:a.paddingTop+"px",height:a.menuHeight+"px"})},[t.createVNode(c,{text:o.$t("layer.mapLayers"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:t.withCtx(({props:S})=>[t.createVNode(n,t.mergeProps(S,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:t.withCtx(()=>e[5]||(e[5]=[t.createElementVNode("i",{class:"iconfont icon-Layer text-h4"},null,-1)])),_:2,__:[5]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],6),t.createElementVNode("div",{class:t.normalizeClass(["available-layers transition d-flex flex-column justify-start align-start",i.toggle?"right-bar":""]),style:t.normalizeStyle(l.listStyle)},[t.createElementVNode("div",ns,[t.createElementVNode("div",ss,t.toDisplayString(o.$t("layer.layers")),1),t.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleMenuToggle},{default:t.withCtx(()=>e[6]||(e[6]=[t.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[6]},8,["onClick"])]),t.createElementVNode("div",{class:t.normalizeClass(["list-box w-100 flex-1-1-0 scroll overflow-y-auto",a.simple?"px-3":"pl-4 pr-2"])},[t.createVNode(u,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:t.withCtx(()=>[t.createVNode(m,{class:"border-b-thin"},{default:t.withCtx(()=>[t.createVNode(s,{class:"text-h6"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(o.$t("layer.mapFeathers")),1)]),_:1})]),_:1}),t.createVNode(g,{class:"pb-2"},{default:t.withCtx(()=>[t.createElementVNode("div",cs,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.mapFeathers,S=>(t.openBlock(),t.createElementBlock("div",{key:S.value,class:"mb-4 feather-item",onClick:ee=>l.handleToggleMapFeather(S)},[t.createElementVNode("div",{class:t.normalizeClass([i.mapFeather===S.value?"active":"","img-box"])},[S.value==="dark"?(t.openBlock(),t.createElementBlock("img",ds)):S.value==="nautical"?(t.openBlock(),t.createElementBlock("img",hs)):S.value==="satellite"?(t.openBlock(),t.createElementBlock("img",ps)):(t.openBlock(),t.createElementBlock("img",gs))],2),t.createElementVNode("div",us,t.toDisplayString(o.$t(`layer.${S.locale}`)),1)],8,ms))),128))]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tagLayers.filter(S=>["graticule","day-night","time-zones"].includes(S.key)),S=>(t.openBlock(),t.createBlock(d,{key:S.key,modelValue:i.checkList,"onUpdate:modelValue":e[0]||(e[0]=ee=>i.checkList=ee),value:S.key,label:o.$t(`layer.${S.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2 mx-n1","hide-details":""},null,8,["modelValue","value","label"]))),128))]),_:1})]),_:1}),t.createVNode(u,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:t.withCtx(()=>[t.createVNode(m,{class:"border-b-thin"},{default:t.withCtx(()=>[t.createVNode(s,{class:"text-h6"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(o.$t("layer.pointsOfInteresting")),1)]),_:1})]),_:1}),t.createVNode(g,{class:"py-2 mx-n1"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tagLayers.filter(S=>["ports","alert-zones","tidal-stations"].includes(S.key)),S=>(t.openBlock(),t.createBlock(d,{key:S.key,modelValue:i.checkList,"onUpdate:modelValue":e[1]||(e[1]=ee=>i.checkList=ee),value:S.key,label:o.$t(`layer.${S.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label"]))),128))]),_:1})]),_:1}),t.createVNode(u,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:t.withCtx(()=>[t.createVNode(m,{class:"border-b-thin"},{default:t.withCtx(()=>[t.createVNode(s,{class:"text-h6"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(o.$t("layer.otherLayers")),1)]),_:1})]),_:1}),t.createVNode(g,{class:"py-2 mx-n1"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tagLayers.filter(S=>!["graticule","day-night","time-zones","ports","alert-zones","tidal-stations"].includes(S.key)),S=>(t.openBlock(),t.createBlock(d,{key:S.key,modelValue:i.checkList,"onUpdate:modelValue":e[2]||(e[2]=ee=>i.checkList=ee),value:S.key,label:o.$t(`layer.${S.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label"]))),128))]),_:1})]),_:1}),t.createVNode(u,{class:"block-bg mx-auto mb-3",elevation:"0"},{default:t.withCtx(()=>[t.createVNode(m,{class:"border-b-thin"},{default:t.withCtx(()=>[t.createVNode(s,{class:"text-h6"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(o.$t("layer.myFollows")),1)]),_:1})]),_:1}),t.createVNode(g,{class:"py-2 mx-n1"},{default:t.withCtx(()=>[t.createVNode(d,{modelValue:i.checkList,"onUpdate:modelValue":e[3]||(e[3]=S=>i.checkList=S),value:"follow-ports",label:o.$t("layer.ports"),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","label"]),t.createVNode(d,{modelValue:i.checkList,"onUpdate:modelValue":e[4]||(e[4]=S=>i.checkList=S),value:"follow-positions",label:o.$t("layer.locations"),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","label"])]),_:1})]),_:1})],2)],6),a.map?(t.openBlock(),t.createBlock(y,t.mergeProps({key:0,ref:"idmPorts",simple:a.simple,map:a.map,ports:(se=i.otherLayers)==null?void 0:se.ports,gateway:a.gateway,token:a.token,"forecast-model":a.forecastModel,"real-time":a.realTime,theme:a.theme},o.$attrs,{"before-layer":"empty-layer-3"}),null,16,["simple","map","ports","gateway","token","forecast-model","real-time","theme"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(p,t.mergeProps({key:1,ref:"idmIideStation",simple:a.simple,map:a.map,gateway:a.gateway,token:a.token,"default-meteo-token":a.defaultMeteoToken,show:i.checkList.includes("tidal-stations"),theme:a.theme,"real-time":a.realTime,"forecast-model":a.forecastModel,"before-layer":"empty-layer-3"},o.$attrs),null,16,["simple","map","gateway","token","default-meteo-token","show","theme","real-time","forecast-model"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(h,t.mergeProps({key:2,simple:a.simple,map:a.map,"menu-toggle":a.menuToggle,show:i.checkList.includes("graticule")},o.$attrs,{"before-layer":"empty-layer-3"}),null,16,["simple","map","menu-toggle","show"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(f,t.mergeProps({key:3,map:a.map,area:(le=i.otherLayers)==null?void 0:le["day-night"]},o.$attrs,{"before-layer":"empty-layer-2"}),null,16,["map","area"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(w,t.mergeProps({key:4,map:a.map,zone:(N=i.otherLayers)==null?void 0:N["time-zones"],"real-time":a.realTime},o.$attrs,{"before-layer":"empty-layer-3"}),null,16,["map","zone","real-time"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(b,t.mergeProps({key:5,map:a.map,simple:a.simple,zone:(j=i.otherLayers)==null?void 0:j["alert-zones"]},o.$attrs,{"before-layer":"empty-layer-3",theme:a.theme}),null,16,["map","simple","zone","theme"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(A,t.mergeProps({key:6,map:a.map,zone:(Z=i.otherLayers)==null?void 0:Z["eca-zones"]},o.$attrs),null,16,["map","zone"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(x,t.mergeProps({key:7,map:a.map,zone:(Q=i.otherLayers)==null?void 0:Q["war-zones"]},o.$attrs),null,16,["map","zone"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(C,t.mergeProps({key:8,map:a.map,area:(G=i.otherLayers)==null?void 0:G["gmdss-areas"]},o.$attrs),null,16,["map","area"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(k,t.mergeProps({key:9,map:a.map,show:i.checkList.includes("load-lines")},o.$attrs),null,16,["map","show"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(_,t.mergeProps({key:10,map:a.map,token:a.token,show:i.checkList.includes("worldMarine")},o.$attrs),null,16,["map","token","show"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(z,t.mergeProps({key:11,map:a.map,area:(B=i.otherLayers)==null?void 0:B["voluntary-reporting-area"]},o.$attrs),null,16,["map","area"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(P,t.mergeProps({key:12,map:a.map,area:(U=i.otherLayers)==null?void 0:U["special-area"]},o.$attrs),null,16,["map","area"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(T,t.mergeProps({key:13,map:a.map,token:a.token,show:i.checkList.includes("world12nm")},o.$attrs),null,16,["map","token","show"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(V,t.mergeProps({key:14,map:a.map,token:a.token,show:i.checkList.includes("chinaRoute")},o.$attrs),null,16,["map","token","show"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(O,t.mergeProps({key:15,map:a.map,show:i.checkList.includes("ice-areas")},o.$attrs),null,16,["map","show"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(Y,t.mergeProps({key:16,ref:"idmFollowPort",simple:a.simple,map:a.map,show:i.checkList.includes("follow-ports"),gateway:a.gateway,token:a.token,"forecast-model":a.forecastModel,"real-time":a.realTime},o.$attrs,{"before-layer":"empty-layer-3"}),null,16,["simple","map","show","gateway","token","forecast-model","real-time"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(J,t.mergeProps({key:17,ref:"idmFollowPosition",simple:a.simple,map:a.map,show:i.checkList.includes("follow-positions"),"forecast-model":a.forecastModel,"real-time":a.realTime},o.$attrs),null,16,["simple","map","show","forecast-model","real-time"])):t.createCommentVNode("",!0)])}const ys=K(rs,[["render",fs]]);class Mo{constructor(e){pe(this,"map");pe(this,"mercator");pe(this,"rampColorLayer");pe(this,"rampColorSource");pe(this,"particleLayer");pe(this,"particleSource");pe(this,"rampColorCanvas");pe(this,"particleCanvas");pe(this,"ratio");this.map=e,this.mercator=new ir,this.rampColorLayer="ramp-color-layer",this.rampColorSource="ramp-color-source",this.particleLayer="particle-layer",this.particleSource="particle-source",this.rampColorCanvas=document.createElement("canvas"),this.particleCanvas=document.createElement("canvas"),this.ratio=window.devicePixelRatio}convertNLng(e,a=0){return e>180?this.convertNLng(e-360,a+1):e<-180?this.convertNLng(e+360,a+1):[e,a]}getBoundLngLat(){var a;const e=(a=this.map)==null?void 0:a.getBounds();return e?[[e._sw.lng,e._ne.lat],[e._ne.lng,e._ne.lat],[e._ne.lng,e._sw.lat],[e._sw.lng,e._sw.lat]]:[]}getBoundPixel(){var p,h;const e=(p=this.map)==null?void 0:p.getBounds();if(!e)return[];const a=((h=this.map)==null?void 0:h.getZoom())+1,r=[e._ne.lng,e._ne.lat],i=[e._sw.lng,e._sw.lat],[l,n]=this.convertNLng(r[0]),[c,s]=this.convertNLng(i[0]),[m,d]=this.mercator.px([l,r[1]],a),[g,u]=this.mercator.px([c,i[1]],a),y=Math.round(this.mercator.size*Math.pow(2,a)*(n+s));return[g,u,m+y,d]}getBoundRange(){const e=this.map.getZoom()+1,a=this.mercator.size*Math.pow(2,e),r=this.getBoundPixel();return[r[0]/a,r[2]/a,r[3]/a,r[1]/a]}getWorldCopy(e,a){const r=2**a,[i,l,n,c]=e.map(d=>~~(d/(r*256))),s=[];for(let d=c;d<=l;d++)for(let g=i;g<=n;g++)s.push([g,d]);return s.map(d=>{const g=2**a*256;return[d[0]*g,d[1]*g,g]})}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){var i;const a=(i=this.map)==null?void 0:i.getLayoutProperty(this.rampColorLayer,"visibility"),r=e?"visible":"none";a!==r&&this.map.setLayoutProperty(this.rampColorLayer,"visibility",r)}toggleParticle(e){var i;const a=(i=this.map)==null?void 0:i.getLayoutProperty(this.particleLayer,"visibility"),r=e?"visible":"none";a!==r&&this.map.setLayoutProperty(this.particleLayer,"visibility",r)}}class $e{createShader(e,a,r){const i=e.createShader(a);if(i&&(e.shaderSource(i,r),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS)))throw new Error(e.getShaderInfoLog(i)||"error happened while create shader...");return i}createTexture(e,a,r,i,l,n,c){const s=e.createTexture();return e.bindTexture(e.TEXTURE_2D,s),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,a),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,i),l instanceof Uint8Array?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n,c,0,e.RGBA,e.UNSIGNED_BYTE,l):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,l),e.bindTexture(e.TEXTURE_2D,null),s}createDataBuffer(e,a,r){if(e){const i=e.createBuffer();return a==="array"?(e.bindBuffer(e.ARRAY_BUFFER,i),r&&e.bufferData(e.ARRAY_BUFFER,r,e.STATIC_DRAW)):a==="element"&&(e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,i),r&&e.bufferData(e.ELEMENT_ARRAY_BUFFER,r,e.STATIC_DRAW)),i}return null}createProgram(e,a,r){const i=e.createProgram(),l=this.createShader(e,e.VERTEX_SHADER,a),n=this.createShader(e,e.FRAGMENT_SHADER,r);if(i&&l&&n&&(e.attachShader(i,l),e.attachShader(i,n),e.linkProgram(i),!e.getProgramParameter(i,e.LINK_STATUS)))throw new Error(e.getProgramInfoLog(i)||"error happened while creating ramp color program");return i}createProgramWrapper(e,a,r){const i=this.createProgram(e,a,r);if(i){const l={program:i},n=e.getProgramParameter(i,e.ACTIVE_ATTRIBUTES);for(let s=0;s<n;s++){const m=e.getActiveAttrib(i,s);l[m.name]=e.getAttribLocation(i,m.name)}const c=e.getProgramParameter(i,e.ACTIVE_UNIFORMS);for(let s=0;s<c;s++){const m=e.getActiveUniform(i,s);l[m.name]=e.getUniformLocation(i,m.name)}return l}}setup(e,a,r=!1,i,l){const n=document.createElement("canvas");n.width=256,n.height=1;const c=n.getContext("2d");if(c&&e){const s=c==null?void 0:c.createLinearGradient(0,0,256,0);return a.forEach(([m,d])=>{s.addColorStop(m,d)}),c.fillStyle=s,c.fillRect(0,0,256,1),{canvas:n,texture:this.createTexture(e,e.LINEAR,e.LINEAR,e.CLAMP_TO_EDGE,r?new Uint8Array(c.getImageData(0,0,256,1).data):n,i,l)}}}setupParticle(e,a=1e3){const r=Math.ceil(Math.sqrt(a)),i=r*r,l=new Uint8Array(i*4);for(let d=0;d<l.length;d++)l[d]=Math.floor(Math.random()*256);const n=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,l,r,r),c=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,l,r,r),s=new Float32Array(i);for(let d=0;d<i;d++)s[d]=d;const m=this.createDataBuffer(e,"array",s);return{resolution:r,total:i,texture0:n,texture1:c,indexBuffer:m}}bind(e,a,r){const i=this.createProgram(e,a,r);if(i){const l=this.createDataBuffer(e,"array",void 0),n=e.getAttribLocation(i,"a_position");e.enableVertexAttribArray(n),e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0);const c=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);this.createDataBuffer(e,"array",c);const s=e.getAttribLocation(i,"a_texCoord");return e.enableVertexAttribArray(s),e.vertexAttribPointer(s,2,e.FLOAT,!1,0,0),{program:i,aPositionBuffer:l}}return{}}bindParticle(e,a,r,i,l,n){const c=this.createProgramWrapper(e,a,r),s=this.createProgramWrapper(e,i,l),m=this.createProgramWrapper(e,i,n),d=this.createDataBuffer(e,"array",new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1])),g=e.createFramebuffer();return{particle:c,screen:s,update:m,quadBuffer:d,frameBuffer:g}}draw(e,a,r,i,l,n,c){var s,m;if(a&&r){e.resize(),a==null||a.viewport(0,0,(s=a==null?void 0:a.canvas)==null?void 0:s.width,(m=a==null?void 0:a.canvas)==null?void 0:m.height),a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT);try{a.useProgram(r);const d={resolution:a.getUniformLocation(r,"u_resolution"),image:a.getUniformLocation(r,"u_image"),color:a.getUniformLocation(r,"u_color"),scale:a.getUniformLocation(r,"u_scale"),uvRange:a.getUniformLocation(r,"u_range_u_v"),sRange:a.getUniformLocation(r,"u_range_s")};d.resolution&&a.uniform2f(d.resolution,a.canvas.width*e.ratio,a.canvas.height*e.ratio),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,i),d.image&&a.uniform1i(d.image,0),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,l),d.color&&a.uniform1i(d.color,1),c!=null&&c.uvRange&&(c!=null&&c.sRange)&&(d.uvRange&&a.uniform2f(d.uvRange,c.uvRange[0],c.uvRange[1]),d.sRange&&a.uniform2f(d.sRange,c.sRange[0],c.sRange[1])),d.scale&&a.uniform1f(d.scale,(c==null?void 0:c.scale)||1);const g=e.getBoundPixel(),u=e.map.getZoom()+1,y=e.getWorldCopy(g,u);for(const p of y){const h=(p[0]-g[0])*e.ratio,f=(p[1]-g[3])*e.ratio,w=p[2]*e.ratio,[b,A,x,C]=[h,w+h,f,w+f],k=new Float32Array([b,x,A,x,b,C,b,C,A,x,A,C]);a.bindBuffer(a.ARRAY_BUFFER,n),a.bufferData(a.ARRAY_BUFFER,k,a.STATIC_DRAW),a.drawArrays(a.TRIANGLES,0,6)}}catch(d){console.log(`render failed...${d}`)}}}drawParticle(e,a,r,i,l){var n,c;a&&(a==null||a.viewport(0,0,(n=a==null?void 0:a.canvas)==null?void 0:n.width,(c=a==null?void 0:a.canvas)==null?void 0:c.height),a.disable(a.DEPTH_TEST),a.disable(a.STENCIL_TEST),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,r),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,i.texture0),this.renderScreen(e,a,i,l),this.updateParticles(e,a,i,l))}renderScreen(e,a,r,i){a.bindFramebuffer(a.FRAMEBUFFER,r.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,r.screenTexture,0),a.viewport(0,0,a.canvas.width,a.canvas.height),this.renderScreenTexture(a,r.backgroundTexture,r.screen,r.quadBuffer,.95),this.renderParticles(e,a,r,i),a.bindFramebuffer(a.FRAMEBUFFER,null),this.renderScreenTexture(a,r.screenTexture,r.screen,r.quadBuffer,1);const l=r.backgroundTexture;r.backgroundTexture=r.screenTexture,r.screenTexture=l}renderScreenTexture(e,a,r,i,l){e&&(e.useProgram(r.program),e.bindBuffer(e.ARRAY_BUFFER,i),e.enableVertexAttribArray(r.a_pos),e.vertexAttribPointer(r.a_pos,2,e.FLOAT,!1,0,0),e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,a),e.uniform1i(r.u_screen,2),e.uniform1f(r.u_opacity,l),e.drawArrays(e.TRIANGLES,0,6))}renderParticles(e,a,r,i){if(a){a.useProgram(r.particle.program),a.bindBuffer(a.ARRAY_BUFFER,r.indexBuffer),a.enableVertexAttribArray(r.particle.a_index),a.vertexAttribPointer(r.particle.a_index,1,a.FLOAT,!1,0,0),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,r.color.texture),a.uniform1i(r.particle.u_factor,0),a.uniform1i(r.particle.u_particles,1),a.uniform1i(r.particle.u_color_ramp,2),a.uniform1f(r.particle.u_particles_resolution,r.resolution*e.ratio),a.uniform1f(r.particle.u_point,e.ratio);const l=e.getBoundRange();a.uniform4f(r.particle.u_viewport,l[0],l[1],l[2],l[3]),a.uniform2f(r.particle.u_factor_min,i.uvRange[0],i.uvRange[0]),a.uniform2f(r.particle.u_factor_max,i.uvRange[1],i.uvRange[1]),a.drawArrays(a.POINTS,0,r.total)}}updateParticles(e,a,r,i){var n,c;if(a){a.bindFramebuffer(a.FRAMEBUFFER,r.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,r.texture1,0),a.viewport(0,0,r.resolution,r.resolution),a.useProgram(r.update.program),a.bindBuffer(a.ARRAY_BUFFER,r.quadBuffer),a.enableVertexAttribArray(r.update.a_pos),a.vertexAttribPointer(r.update.a_pos,2,a.FLOAT,!1,0,0),a.uniform1i(r.update.u_factor,0),a.uniform1i(r.update.u_particles,1);const s=e.getBoundRange();a.uniform4f(r.update.u_viewport,s[0],s[1],s[2],s[3]),a.uniform1f(r.update.u_rand_seed,Math.random()),a.uniform2f(r.update.u_factor_res,(n=r==null?void 0:r.image)==null?void 0:n.width,(c=r==null?void 0:r.image)==null?void 0:c.height),a.uniform2f(r.update.u_factor_min,i.uvRange[0],i.uvRange[0]),a.uniform2f(r.update.u_factor_max,i.uvRange[1],i.uvRange[1]),a.uniform1f(r.update.u_speed_factor,i.speedFactor*e.ratio),a.uniform1f(r.update.u_drop_rate,i.dropRate),a.uniform1f(r.update.u_drop_rate_bump,i.dropRateBump),a.drawArrays(a.TRIANGLES,0,6)}const l=r.texture0;r.texture0=r.texture1,r.texture1=l}resize(e,a){e.resize();const r=new Uint8Array(a.canvas.width*a.canvas.height*4).fill(0,0,a.canvas.width*a.canvas.height*4),i=this.createTexture(a,a.NEAREST,a.NEAREST,a.CLAMP_TO_EDGE,r,a.canvas.width,a.canvas.height),l=this.createTexture(a,a.NEAREST,a.NEAREST,a.CLAMP_TO_EDGE,r,a.canvas.width,a.canvas.height);return{screenTexture:i,backgroundTexture:l}}async loadImg(e){return new Promise(a=>{const r=new Blob([e],{type:e.type}),i=URL.createObjectURL(r),l=new Image;l.crossOrigin="anonymous",l.src=i,l.onload=()=>a(l)})}}class fe{}pe(fe,"vertexSchema",`
|
|
10
|
+
</div>`)}),r}},legend:{show:!0,right:20,top:0,itemWidth:30,data:["Height"],textStyle:{color:this.Theme.current.value.colors["on-surface"]}},grid:{top:40,left:10,right:10,bottom:30,containLabel:!0},xAxis:[{type:"category",data:this.xDate,boundaryGap:!0,axisTick:{alignWithLabel:!0,lineStyle:{color:this.Theme.current.value.colors["echart-axis"]}},axisLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["echart-axis"]}},axisLabel:{interval:"auto",margin:15,textStyle:{fontSize:12,color:this.Theme.current.value.colors["echart-axis"]}}}],yAxis:[{name:"(m)",show:!0,nameLocation:"end",position:"left",nameGap:15,splitNumber:5,splitLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["echart-split"]}},alignTicks:!0,axisLine:{show:!0,lineStyle:{color:this.Theme.current.value.colors["echart-axis"]}},axisLabel:{textStyle:{fontSize:12,color:this.Theme.current.value.colors["echart-axis"]}}}],series:[{name:"Height",type:"line",showSymbol:!0,yAxisIndex:0,lineStyle:{color:this.Theme.current.value.colors["map-perple"]},itemStyle:{color:this.Theme.current.value.colors["map-perple"]},data:this.echartData.height}]};o==null||o.setOption(e)},handleClose(){this.$emit("close")}}},tn={class:"d-flex justify-space-between align-center"},on={class:"d-flex justify-start text-h5 my-2"},an={class:"d-flex justify-start align-center text-h6 text-label ga-3"},rn={class:"summary-box w-100"},ln={class:"d-flex justify-space-between align-center py-2"},nn={class:"d-flex justify-center align-center text-h6 ga-2"},sn={class:"multi-color-icon","aria-hidden":"true"},cn=["xlink:href"],mn={class:"gray-bg-2 rounded d-flex flex-column ga-4 pa-4"},dn={class:"w-100 d-flex justify-start align-center"},hn={class:"w-30 text-label font-weight-400"},pn={class:"flex-1-1-0"},gn={class:"w-100 d-flex justify-start align-center"},un={class:"w-30 text-label font-weight-400"},fn={class:"flex-1-1-0"},yn={class:"w-100 d-flex justify-start align-center"},bn={class:"w-30 text-label font-weight-400"},wn={class:"flex-1-1-0"},xn={class:"table-box w-100 mt-2 mb-4 d-flex flex-column justify-start align-center"},kn={class:"w-100 d-flex justify-space-between align-center py-2"},An={class:"d-flex justify-center align-center text-h6 ga-2"},Ln={class:"multi-color-icon","aria-hidden":"true"},Cn=["xlink:href"],vn={ref:"tideEchart",class:"w-100",style:{height:"244px"}},zn={"fixed-header":"",density:"compact",class:"w-100 tide-table bg-none"},_n={class:"px-1 text-center text-label font-weight-400",width:"120"},Sn={class:"px-1 text-center text-label font-weight-400",width:"120"},Nn={class:"px-1 text-center text-label font-weight-400",width:"120"},Mn={class:"px-1 text-center"},Pn={class:"px-1 text-center"},Vn={class:"px-1 text-center"};function Tn(o,e,a,r,i,l){const n=t.resolveComponent("VBtn"),c=t.resolveComponent("VCardTitle"),s=t.resolveComponent("VDivider"),m=t.resolveComponent("VBtnToggle"),d=t.resolveComponent("VCard");return t.openBlock(),t.createBlock(d,{class:t.normalizeClass(["tide-detail-container d-flex flex-column justify-start align-center",a.simple?"page":"dialog"])},{default:t.withCtx(()=>{var g,u;return[t.createVNode(c,{class:"w-100"},{default:t.withCtx(()=>{var y;return[t.createElementVNode("div",tn,[t.createElementVNode("div",on,[t.createElementVNode("div",null,t.toDisplayString((y=a.station)==null?void 0:y.name),1)]),t.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"",onClick:l.handleClose},{default:t.withCtx(()=>e[1]||(e[1]=[t.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[1]},8,["onClick"])]),t.createElementVNode("div",an,[t.createElementVNode("div",null,t.toDisplayString(o.$t("tide.tideStation")),1)])]}),_:1}),t.createVNode(s,{class:"w-100"}),t.createElementVNode("div",{class:t.normalizeClass(["w-100 pt-0 pb-0 overflow-y-auto scroll",a.simple?"px-3":"px-5"])},[t.createElementVNode("div",rn,[t.createElementVNode("div",ln,[t.createElementVNode("div",nn,[(t.openBlock(),t.createElementBlock("svg",sn,[t.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,cn)])),t.createElementVNode("div",null,t.toDisplayString(o.$t("detail.summary")),1)])]),t.createElementVNode("div",mn,[t.createElementVNode("div",dn,[t.createElementVNode("div",hn,t.toDisplayString(o.$t("tide.region")),1),t.createElementVNode("div",pn,t.toDisplayString(((g=a.station)==null?void 0:g.Country)??((u=a.station)==null?void 0:u.city)??"-"),1)]),t.createElementVNode("div",gn,[t.createElementVNode("div",un,t.toDisplayString(o.$t("tide.position")),1),t.createElementVNode("div",fn,t.toDisplayString(l.computePosition(a.station)),1)]),t.createElementVNode("div",yn,[t.createElementVNode("div",bn,t.toDisplayString(o.$t("time.localTime")),1),t.createElementVNode("div",wn,t.toDisplayString(l.computeLocalTime(a.realTime,a.station))+" "+t.toDisplayString(l.computeTimeOffset(a.station)),1)])])]),t.createElementVNode("div",xn,[t.createElementVNode("div",kn,[t.createElementVNode("div",An,[(t.openBlock(),t.createElementBlock("svg",Ln,[t.createElementVNode("use",{"xlink:href":`#icon-title-${a.theme}`},null,8,Cn)])),t.createElementVNode("div",null,t.toDisplayString(o.$t("tide.tideTimes")),1)]),e[2]||(e[2]=t.createElementVNode("div",{class:"text-body-2 text-success ga-2"},null,-1))]),t.createElementVNode("div",{class:t.normalizeClass(["w-100 gray-bg-2 rounded",a.simple?"pa-2":"pa-4 py-2"])},[t.createVNode(m,{modelValue:i.currentIndex,"onUpdate:modelValue":e[0]||(e[0]=y=>i.currentIndex=y),class:"w-100 d-flex justify-space-around align-center ga-0 mb-4",density:"compact",group:"",height:"26","min-height":"26",rounded:"1",mandatory:""},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.dateList,y=>(t.openBlock(),t.createBlock(n,{key:y.label,class:t.normalizeClass(["text-none text-body-1 flex-1-1-0",`bg-${y.index===i.currentIndex?"bg-primary":"gray-bg-2"}`]),density:"compact",color:"primary",height:"26",value:y.index},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(y.label),1)]),_:2},1032,["class","value"]))),128))]),_:1},8,["modelValue"]),t.createElementVNode("div",vn,null,512),t.createElementVNode("table",zn,[t.createElementVNode("tbody",null,[t.createElementVNode("tr",null,[t.createElementVNode("th",_n,t.toDisplayString(o.$t("tide.tide")),1),t.createElementVNode("th",Sn,t.toDisplayString(o.$t("time.time"))+" ( LT ) ",1),t.createElementVNode("th",Nn,t.toDisplayString(o.$t("tide.height"))+" ( m )",1)]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tideTableData,(y,p)=>{var h;return t.openBlock(),t.createElementBlock("tr",{key:p},[t.createElementVNode("td",Mn,t.toDisplayString(o.$t(`tide.${(h=y==null?void 0:y.type)==null?void 0:h.toLowerCase()}`))+" "+t.toDisplayString(o.$t("tide.tide")),1),t.createElementVNode("td",Pn,t.toDisplayString(l.computeLocalTime(y==null?void 0:y.date,a.station,"MM-DD HH:mm")),1),t.createElementVNode("td",Vn,t.toDisplayString((y==null?void 0:y.height)??"-")+" m",1)])}),128))])])],2)])],2)]}),_:1},8,["class"])}const En=K(en,[["render",Tn],["__scopeId","data-v-5c51381d"]]),Hy="",Dn={name:"IdmTideStations",components:{TideDetail:En},props:{map:{type:Object},show:{type:Boolean},locale:{type:String},beforeLayer:{type:String}},data(){return{layer:"tide-stations",showInfo:!1,hoverStation:void 0,marker:null,showDetail:!1,station:void 0}},watch:{show:{handler(){var o,e,a,r,i,l;this.show?(this.handleRender(),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):(this.handleClear(),(r=this.map)==null||r.off("click",[this.layer],this.handleClick),(i=this.map)==null||i.off("mousemove",[this.layer],this.handleHover),(l=this.map)==null||l.off("mouseleave",[this.layer],this.handleLeave))},immediate:!0},locale:{handler(){this.show&&this.handleRender()},immediate:!0}},methods:{handleRender(){var o;(o=this.map)!=null&&o.getLayer(this.layer)&&(this.map.setLayoutProperty(this.layer,"visibility","visible"),this.map.setLayoutProperty(this.layer,"text-field",this.locale==="en"?"{Location_EN}":"{Location_CN}"))},handleClear(){var o;this.showInfo=!1,(o=this.map)!=null&&o.getLayer(this.layer)&&this.map.setLayoutProperty(this.layer,"visibility","none")},handleClick(o){const e=o.features[0];e.properties&&(this.station=e.properties,this.station.name=this.locale==="en"?e.properties.Location_EN:e.properties.Location_CN,this.station.lng=e.geometry.coordinates[0],this.station.lat=e.geometry.coordinates[1],this.showDetail=!0)},handleHover(o){var a,r;this.map.getCanvas().style.cursor="pointer";const e=o.features[0];if(e.properties){this.showInfo=!0,this.hoverStation=e.properties,this.hoverStation.name=this.locale==="en"?e.properties.Location_EN:e.properties.Location_CN,this.hoverStation.lng=e.geometry.coordinates[0],this.hoverStation.lat=e.geometry.coordinates[1],(a=this.marker)==null||a.remove();const i=(r=document.getElementById("idmTidalInfo"))==null?void 0:r.cloneNode(!0);this.marker=new de.Marker(i).setLngLat([o.lngLat.lng,o.lngLat.lat]).setOffset([0,-60]).addTo(this.map)}},handleLeave(){var o;this.showInfo=!1,this.hoverStation={},(o=this.marker)==null||o.remove(),this.map.getCanvas().style.cursor="grab"},handleCloseDetail(){this.showDetail=!1}}},Rn={class:"station-box d-flex flex-column justify-center align-start ga-1"},Bn={class:"d-flex justify-start align-center"},In={class:"d-flex justify-start align-center"},Fn={class:"text-label"};function Gn(o,e,a,r,i,l){const n=t.resolveComponent("VCardText"),c=t.resolveComponent("VCard"),s=t.resolveComponent("TideDetail");return t.openBlock(),t.createElementBlock("div",null,[t.withDirectives(t.createVNode(c,{id:"idmTidalInfo"},{default:t.withCtx(()=>[t.createVNode(n,{class:"pr-8 text-body-1"},{default:t.withCtx(()=>{var m,d;return[t.createElementVNode("div",Rn,[t.createElementVNode("div",Bn,t.toDisplayString(o.$t("tide.tideStation")),1),t.createElementVNode("div",In,[t.createElementVNode("label",Fn,t.toDisplayString((m=i.hoverStation)==null?void 0:m.name)+" , "+t.toDisplayString(((d=i.hoverStation)==null?void 0:d.Country)||"-"),1)])])]}),_:1})]),_:1},512),[[t.vShow,i.showInfo]]),i.showDetail?(t.openBlock(),t.createBlock(s,t.mergeProps({key:0,station:i.station},o.$attrs,{onClose:l.handleCloseDetail}),null,16,["station","onClose"])):t.createCommentVNode("",!0)])}const jn=K(Dn,[["render",Gn],["__scopeId","data-v-ad725d5e"]]),Wn={name:"IdmIceAreas",props:{map:{type:Object},show:{type:Boolean}},data(){return{lineLayer:"ice-area-line",fillLayer:"ice-area-fill"}},watch:{show:{handler(){this.show?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var o,e;(o=this.map)!=null&&o.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","visible"),(e=this.map)!=null&&e.getLayer(this.fillLayer)&&this.map.setLayoutProperty(this.fillLayer,"visibility","visible")},handleClear(){var o,e;(o=this.map)!=null&&o.getLayer(this.lineLayer)&&this.map.setLayoutProperty(this.lineLayer,"visibility","none"),(e=this.map)!=null&&e.getLayer(this.fillLayer)&&this.map.setLayoutProperty(this.fillLayer,"visibility","none")}}};function Zn(o,e,a,r,i,l){return null}const Xn=K(Wn,[["render",Zn]]),Oy="",Hn={name:"IdmLatLng",props:{simple:{type:Boolean,default:!1},map:{type:Object},show:{type:Boolean},mapFeather:{type:String},beforeLayer:{type:String},menuToggle:{type:Object}},data(){return{lngLat:{e:{lng:0,lat:0},lng:0,lat:0,str:""},source:"idm-lat-lng-source",layer:"idm-lat-lng-layer",labelLayer:"idm-lat-lng-label-layer",right:10}},computed:{lineColor(){return["satellite","dark"].includes(this.mapFeather)?"rgba(255, 255, 255, 0.3)":"rgba(0, 0, 0, 0.3)"},labelColor(){return["satellite","dark"].includes(this.mapFeather)?"rgba(255, 255, 255, 0.8)":"rgba(0, 0, 0, 0.5)"}},watch:{show:{handler(){this.handleBind()},immediate:!0},map:{handler(){var o;this.map&&((o=this.map)==null||o.on("mousemove",this.handleMouseMove))},immediate:!0},"menuToggle.v":{handler(){var o;this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10},immediate:!0},"lngLat.e":{handler(o){this.lngLat.lng=M.LngLatHelper.lng2pretty(o==null?void 0:o.lng,2).pretty,this.lngLat.lat=M.LngLatHelper.lat2pretty(o==null?void 0:o.lat,2).pretty,this.lngLat.str=`[${M.LngLatHelper.str2Lat(o==null?void 0:o.lat,4)}, ${M.LngLatHelper.str2Lng(o==null?void 0:o.lng,4)}]`},immediate:!0}},methods:{handleBind(){var o,e;this.show?((o=this.map)==null||o.on("zoomend",this.handleZoomEnd),this.handleRender()):(this.handleClear(),(e=this.map)==null||e.off("zoomend",this.handleZoomEnd))},handleMouseMove(o){this.lngLat.e=o.lngLat},handleComputeLatLngs(){var r;const o=(r=this.map)==null?void 0:r.getZoom();let e=30;o>4?e=10:o>3&&(e=15);const a=[];for(let i=-60;i<90;i+=e)a.push({type:"Feature",geometry:{type:"LineString",coordinates:[[-180,i],[180,i]]}});for(let i=-180;i<180;i+=e)a.push({type:"Feature",geometry:{type:"LineString",coordinates:[[i,-90],[i,90]]}});for(let i=180;i>-180;i-=e)for(let l=-60;l<90;l+=e)a.push({type:"Feature",geometry:{type:"Point",coordinates:[i,l]},properties:{val:`${l>0?l+" N":l===0?l:l*-1+" S"}, ${i>0?i+" E":i*-1+" W"}`}});return a},handleZoomEnd(){var e;const o=this.handleComputeLatLngs();(e=this.map)==null||e.getSource(this.source).setData(E.featureCollection(o))},handleRender(){if(this.handleClear(),this.map){const o=this.handleComputeLatLngs();this.map.addSource(this.source,{type:"geojson",data:{type:"FeatureCollection",features:o}}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],layout:{"line-join":"round","line-cap":"round"},paint:{"line-color":this.lineColor,"line-width":1}},this.beforeLayer),this.map.addLayer({id:this.labelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-field":"{val}","text-rotation-alignment":"viewport","text-offset":[0,1],"text-size":10,"text-allow-overlap":!0},paint:{"text-opacity":1,"text-color":this.labelColor}},this.beforeLayer)}},handleClear(){var o,e,a,r,i,l;(o=this.map)!=null&&o.getLayer(this.layer)&&((e=this.map)==null||e.removeLayer(this.layer)),(a=this.map)!=null&&a.getLayer(this.labelLayer)&&((r=this.map)==null||r.removeLayer(this.labelLayer)),(i=this.map)!=null&&i.getSource(this.source)&&((l=this.map)==null||l.removeSource(this.source))}}};function On(o,e,a,r,i,l){var n,c,s;return a.simple?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:"idm-lat-lng-tip-gl4 pa-2 text-caption text-right rounded",style:t.normalizeStyle({right:i.right+"px"})},[t.createElementVNode("div",null,t.toDisplayString((n=i.lngLat)==null?void 0:n.lat),1),t.createElementVNode("div",null,t.toDisplayString((c=i.lngLat)==null?void 0:c.lng),1),t.createElementVNode("div",null,t.toDisplayString((s=i.lngLat)==null?void 0:s.str),1)],4))}const jo=K(Hn,[["render",On]]),Yy="",Yn={name:"IdmFollowPort",components:{PortDetail:No},props:{map:{type:Object},beforeLayer:{type:String},forecastModel:{type:String},show:{type:Boolean},followList:{type:Array}},emits:["closeAllDetail"],setup(){return{Theme:ye.useTheme()}},data(){return{source:"follow-port-source",layer:"follow-port-layer",showInfo:!1,portId:"",hoverPort:{},port:{},marker:void 0,showDetail:!1}},watch:{show:{handler(){var o,e,a;this.show?(this.handleRender(),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()},immediate:!0},followList:{handler(){var o,e,a;this.followList&&this.show?(this.handleClear(),this.handleRender(),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()}}},methods:{handleRender(){var e,a;const o={features:[],type:"FeatureCollection"};(e=this.followList)==null||e.forEach(r=>{var i;if((i=r.port)!=null&&i.id){const l=r.port,n={type:"Feature",properties:l,geometry:{type:"Point",coordinates:[l.lng,l.lat]}};o.features.push(n)}}),this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(o):(this.map.addSource(this.source,{type:"geojson",data:o}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":1,"icon-image":"port","icon-offset":[0,-13],"text-anchor":"bottom","text-field":"{name}","text-rotation-alignment":"viewport","text-size":10,"text-offset":[0,1.6]},paint:{"text-color":this.Theme.current.value.colors["on-surface"],"text-halo-width":1}},this.beforeLayer))},handleClear(){var o,e,a;this.showInfo=!1,this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)},handleClick(o){const e=o.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(o){var r,i;this.map.getCanvas().style.cursor="pointer";const e=o.features[0];if(e.properties.id){this.showInfo=!0,this.hoverPort=e.properties,(r=this.marker)==null||r.remove();const l=(i=document.getElementById("idmFollowPortInfo"))==null?void 0:i.cloneNode(!0);this.marker=new de.Marker(l).setLngLat([o.lngLat.lng,o.lngLat.lat]).setOffset([0,-70]).addTo(this.map)}},handleLeave(){var o;this.showInfo=!1,this.hoverPort={},(o=this.marker)==null||o.remove(),this.map.getCanvas().style.cursor="grab"},handleCloseDetail(){this.showDetail=!1}}},Un={class:"port-box d-flex flex-column justify-center align-start ga-1"},Jn={class:"d-flex justify-start align-center text-label"},Kn={class:"d-flex justify-start align-center text-label"};function Qn(o,e,a,r,i,l){const n=t.resolveComponent("VCardText"),c=t.resolveComponent("VCard"),s=t.resolveComponent("PortDetail");return t.openBlock(),t.createElementBlock("div",null,[t.withDirectives(t.createVNode(c,{id:"idmFollowPortInfo",ref:"idmFollowPortInfo"},{default:t.withCtx(()=>[t.createVNode(n,{class:"text-body-1 pr-8"},{default:t.withCtx(()=>[t.createElementVNode("div",Un,[t.createElementVNode("div",null,t.toDisplayString(o.$t("port.port")),1),t.createElementVNode("div",Jn,[t.createElementVNode("span",null,t.toDisplayString(i.hoverPort.name??"-"),1)]),t.createElementVNode("div",Kn,[e[1]||(e[1]=t.createElementVNode("label",{class:"pr-1"},"LoCode : ",-1)),t.createElementVNode("span",null,t.toDisplayString(i.hoverPort.loCode??"-"),1)])])]),_:1})]),_:1},512),[[t.vShow,i.showInfo]]),i.showDetail?(t.openBlock(),t.createBlock(s,t.mergeProps({key:0,"port-id":i.portId,port:i.port,"forecast-model":a.forecastModel,"follow-list":a.followList},o.$attrs,{onClose:l.handleCloseDetail,onCloseAllDetail:e[0]||(e[0]=m=>o.$emit("closeAllDetail",{followPort:!0}))}),null,16,["port-id","port","forecast-model","follow-list","onClose"])):t.createCommentVNode("",!0)])}const qn=K(Yn,[["render",Qn],["__scopeId","data-v-9b28c4ea"]]),Uy="",$n={name:"IdmFollowPosition",props:{map:{type:Object},beforeLayer:{type:String},forecastModel:{type:String},show:{type:Boolean},followList:{type:Array},realTime:{type:String}},setup(){return{Theme:ye.useTheme()}},data(){return{source:"follow-coordinate-source",layer:"follow-coordinate-layer",position:{},showInfo:!1,marker:null}},computed:{computePosition(){return function(o){return!o||o.lng===null||o.lng===void 0||isNaN(o.lng)||o.lat===null||o.lat===void 0||isNaN(o.lat)?"-":M.LngLatHelper.lat2pretty(o==null?void 0:o.lat,2).pretty+" / "+M.LngLatHelper.lng2pretty(o==null?void 0:o.lng,2).pretty}}},watch:{show:{handler(){var o,e,a;this.show?(this.handleClear(),this.handleRender(),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()},immediate:!0},followList:{handler(){var o,e,a;this.followList&&this.show?(this.handleClear(),this.handleRender(),(o=this.map)==null||o.on("click",[this.layer],this.handleClick),(e=this.map)==null||e.on("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.on("mouseleave",[this.layer],this.handleLeave)):this.handleClear()}}},methods:{handleRender(){var e,a;const o={features:[],type:"FeatureCollection"};(e=this.followList)==null||e.forEach(r=>{if(r.coordinate){const i=r.coordinate,l={type:"Feature",properties:{id:r.id,remark:r.remark,...r.coordinate},geometry:{type:"Point",coordinates:[i.lng,i.lat]}};o.features.push(l)}}),this.map.getSource(this.source)?(a=this.map)==null||a.getSource(this.source).setData(o):(this.map.addSource(this.source,{type:"geojson",data:o}),this.map.addLayer({id:this.layer,type:"symbol",source:this.source,filter:["all",["==","$type","Point"],["!=","disabled",!0]],layout:{"symbol-placement":"point","icon-size":1.1,"icon-image":"location","icon-offset":[0,-16]},paint:{"text-color":this.Theme.current.value.colors["on-surface"],"text-halo-width":1}},this.beforeLayer))},handleClear(){var o,e,a;this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source),(o=this.map)==null||o.off("click",[this.layer],this.handleClick),(e=this.map)==null||e.off("mousemove",[this.layer],this.handleHover),(a=this.map)==null||a.off("mouseleave",[this.layer],this.handleLeave)},handleClick(o){var a,r,i,l,n,c,s,m,d;const e=o.features[0];if(e.properties){const g=e.properties;g.lng=e.geometry.coordinates[0],g.lat=e.geometry.coordinates[1];const u=v(),y=(a=v(this.realTime))==null?void 0:a.diff(u,"d",!0),p={followId:g.id,lat:g.lat,lng:g.lng,datetime:this.realTime,forecastModel:this.forecastModel};y>=0?(n=(l=(i=(r=this.$parent)==null?void 0:r.$parent)==null?void 0:i.$refs)==null?void 0:l.idmSpot)==null||n.fetchForecastData(p):(d=(m=(s=(c=this.$parent)==null?void 0:c.$parent)==null?void 0:s.$refs)==null?void 0:m.idmSpot)==null||d.fetchHistoryData(p)}},handleHover(o){var a;this.map.getCanvas().style.cursor="pointer";const e=o.features[0];if(e.properties.id){this.showInfo=!0,this.position=e.properties,(a=this.marker)==null||a.remove();const r=document.getElementById("idmFollowPositionInfo").cloneNode(!0);this.marker=new de.Marker(r).setLngLat([o.lngLat.lng,o.lngLat.lat]).setOffset([0,-70]).addTo(this.map)}},handleLeave(){var o;this.showInfo=!1,(o=this.marker)==null||o.remove(),this.map.getCanvas().style.cursor="grab"}}},es={class:"position-box d-flex flex-column justify-center align-start ga-1"},ts={class:"d-flex justify-start align-center text-label"},os={key:0,class:"d-flex justify-start align-center text-label"};function as(o,e,a,r,i,l){const n=t.resolveComponent("VCardText"),c=t.resolveComponent("VCard");return t.withDirectives((t.openBlock(),t.createBlock(c,{id:"idmFollowPositionInfo",ref:"idmFollowPositionInfo"},{default:t.withCtx(()=>[t.createVNode(n,{class:"text-body-1 pr-8"},{default:t.withCtx(()=>[t.createElementVNode("div",es,[e[0]||(e[0]=t.createElementVNode("div",null,"Location",-1)),t.createElementVNode("div",ts,[t.createElementVNode("span",null,t.toDisplayString(l.computePosition(i.position)),1)]),i.position.remark?(t.openBlock(),t.createElementBlock("div",os,[t.createElementVNode("span",null,t.toDisplayString(i.position.remark??"-"),1)])):t.createCommentVNode("",!0)])]),_:1})]),_:1},512)),[[t.vShow,i.showInfo]])}const is=K($n,[["render",as],["__scopeId","data-v-1de14e27"]]),Jy="",rs={name:"IdmOtherLayerr",components:{IdmWarZone:mr,IdmGmdssArea:pr,IdmEcaZone:fr,IdmAlertZone:xr,IdmPort:Nl,IdmLoadLine:Vl,IdmTimezone:Dl,IdmVRA:Il,IdmSpecialArea:jl,IdmTerminator:Xl,IdmWorld12nm:Yl,IdmWorldMarine:Kl,IdmChinaRoute:$l,IdmTideStations:jn,IdmIceAreas:Xn,IdmLatLng:jo,IdmFollowPort:qn,IdmFollowPosition:is},props:{simple:{type:Boolean,default:!1},map:{type:Object},theme:{type:String},token:{type:String},isLogin:{type:Boolean,default:!1},defaultMeteoToken:{type:String},gateway:{type:String},assistGateway:{type:Array,default:[]},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuHeight:{type:Number,default:248},menuToggle:{type:Object,default:{}},ts:{type:String},forecastModel:{type:String},realTime:{type:String}},emits:["map","other","menuToggle","mapFeather","theme","followLayerList","otherCheckList","tempFeatherCount"],data(){return{right:10,toggle:!1,mapFeather:localStorage.getItem("mapFeathersCacheGL4")||"dark",tagLayers:[...eo.LayerHelper.OTHER_LAYERS.filter(o=>o.enabled)],layerWeight:0,otherLayers:{},activeOtherLayers:[],cache:{v:"0.0.2",versionKey:"otherLayerCacheVersionGL4",checkListKey:"otherChecklistCacheGL4",followListKey:"otherFollowListCacheGL4",mapFeatherKey:"mapFeathersCacheGL4"},mapFeathers:[{name:"Light Map",value:"light",locale:"lightMap"},{name:"Dark Map",value:"dark",locale:"darkMap"},{name:"Satelite Map",value:"satellite",locale:"satelliteMap"},{name:"Nautical Map",value:"nautical",locale:"nauticalMap"}],checkList:[]}},computed:{listStyle(){return this.simple?{top:this.top+"px",left:this.toggle?"0px":"-280px"}:{top:this.top+"px",right:this.toggle?"0px":"-280px"}}},watch:{"menuToggle.v":{handler(){this.toggle=this.menuToggle.otherLayers,this.$nextTick(()=>{var o;this.simple||(this.right=(((o=document.getElementsByClassName("right-bar")[0])==null?void 0:o.clientWidth)||0)+10)})},immediate:!0},realTime:{handler(o,e){o&&e&&o!==e&&this.checkList.includes("day-night")&&this.fetchDayNightLayer()}},theme:{handler(){this.theme==="light"?this.mapFeather=["light","nautical"].includes(this.mapFeather)?this.mapFeather:"light":this.theme==="dark"&&(this.mapFeather=["dark","satellite"].includes(this.mapFeather)?this.mapFeather:"dark")}},mapFeather:{handler(){localStorage.setItem(this.cache.mapFeatherKey,this.mapFeather),this.$emit("mapFeather",this.mapFeather),this.$emit("theme",["light","nautical"].includes(this.mapFeather)?"light":"dark")},immediate:!0},checkList:{handler(o,e){localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList)),this.activeOtherLayers=this.tagLayers.filter(l=>this.checkList.includes(l.key))||[];const a=o==null?void 0:o.filter(l=>!(e!=null&&e.includes(l))),r=e==null?void 0:e.filter(l=>!(o!=null&&o.includes(l))),i=o==null?void 0:o.filter(l=>e==null?void 0:e.includes(l));if((r==null?void 0:r.length)>0&&r.forEach(l=>{this.otherLayers[l]=void 0,delete this.otherLayers[l]}),(a==null?void 0:a.length)>0){const l=this.tagLayers.filter(n=>this.checkList.includes(n.key)&&!i.includes(n.key))||[];this.handleLayersChange(l)}this.$emit("otherCheckList",this.checkList)}}},async mounted(){this.fetchCache()},methods:{fetchCache(){const o=localStorage.getItem(this.cache.versionKey);this.cache.v!==o&&(localStorage.removeItem(this.cache.checkListKey),localStorage.removeItem(this.cache.followListKey),localStorage.removeItem(this.cache.mapFeatherKey),localStorage.setItem(this.cache.versionKey,this.cache.v));let e=localStorage.getItem(this.cache.checkListKey);this.checkList=JSON.parse(e||'["eca-zones"]'),localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList)),e=localStorage.getItem(this.cache.mapFeatherKey);const a=e||"dark";this.$emit("mapFeather",a),localStorage.setItem(this.cache.mapFeatherKey,a)},handleMenuToggle(){this.$emit("menuToggle","otherLayers")},handleToggleMapFeather(o){this.mapFeather=o.value,(this.mapFeather==="light"||this.mapFeather==="dark")&&this.$emit("tempFeatherCount")},async fetchOtherLayers(){var e,a;let o=this.layerWeight;if(o){const r=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],i=await me.get(`${r}/api/arc/other/layers/links?l=${o}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(((e=i==null?void 0:i.data)==null?void 0:e.code)===0){const l=(a=i==null?void 0:i.data)==null?void 0:a.data,n=[];for(const s in l)n.push(me.get(l[s],{headers:{Authorization:this.defaultMeteoToken,key:s}}));(await Promise.all(n)).map(s=>{var g,u,y;const m=((g=s==null?void 0:s.data)==null?void 0:g.data)||(s==null?void 0:s.data),d=(y=(u=s==null?void 0:s.config)==null?void 0:u.headers)==null?void 0:y.key;this.otherLayers[d]=m})}}},async fetchDayNightLayer(){var a,r;const o=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],e=await me.get(`${o}/api/arc/other/layers/links?l=1024&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});((a=e==null?void 0:e.data)==null?void 0:a.code)===0&&(this.otherLayers["day-night"]=((r=e==null?void 0:e.data)==null?void 0:r.data)||(e==null?void 0:e.data))},handleLayersChange(o){const e=o==null?void 0:o.reduce((a,r)=>a+(r==null?void 0:r.weight),0);this.layerWeight=e,this.fetchOtherLayers()}}},ls={class:"idm-gl4-other-layer"},ns={class:"header-box w-100 d-flex justify-space-between align-center px-4"},ss={class:"text-h5 font-weight-medium"},cs={class:"layers-body mt-4 mb-2 d-flex justify-start align-center flex-wrap"},ms=["onClick"],ds={key:0,src:"https://ossimg.ormwx.com/asset/dark-map.png",class:"border rounded-sm"},hs={key:1,src:"https://ossimg.ormwx.com/asset/nautical-map.png",class:"border rounded-sm"},ps={key:2,src:"https://ossimg.ormwx.com/asset/satellite-map.png",class:"border rounded-sm"},gs={key:3,src:"https://ossimg.ormwx.com/asset/light-map.png",class:"border rounded-sm"},us={class:"text-body-2 text-center pt-2"};function fs(o,e,a,r,i,l){var se,le,N,j,Z,Q,G,B,U;const n=t.resolveComponent("VBtn"),c=t.resolveComponent("VTooltip"),s=t.resolveComponent("VCardTitle"),m=t.resolveComponent("VCardItem"),d=t.resolveComponent("VCheckbox"),g=t.resolveComponent("VCardText"),u=t.resolveComponent("VCard"),y=t.resolveComponent("IdmPort"),p=t.resolveComponent("IdmTideStations"),h=t.resolveComponent("IdmLatLng"),f=t.resolveComponent("IdmTerminator"),w=t.resolveComponent("IdmTimezone"),b=t.resolveComponent("IdmAlertZone"),A=t.resolveComponent("IdmEcaZone"),x=t.resolveComponent("IdmWarZone"),C=t.resolveComponent("IdmGmdssArea"),k=t.resolveComponent("IdmLoadLine"),_=t.resolveComponent("IdmWorldMarine"),z=t.resolveComponent("IdmVRA"),P=t.resolveComponent("IdmSpecialArea"),T=t.resolveComponent("IdmWorld12nm"),V=t.resolveComponent("IdmChinaRoute"),O=t.resolveComponent("IdmIceAreas"),Y=t.resolveComponent("IdmFollowPort"),J=t.resolveComponent("IdmFollowPosition");return t.openBlock(),t.createElementBlock("div",ls,[t.createElementVNode("div",{class:t.normalizeClass(["menu-bar-box transition px-1 rounded",a.simple?"simple":""]),style:t.normalizeStyle({top:a.top+10+"px",right:i.right+"px",paddingTop:a.paddingTop+"px",height:a.menuHeight+"px"})},[t.createVNode(c,{text:o.$t("layer.mapLayers"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:t.withCtx(({props:S})=>[t.createVNode(n,t.mergeProps(S,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:t.withCtx(()=>e[5]||(e[5]=[t.createElementVNode("i",{class:"iconfont icon-Layer text-h4"},null,-1)])),_:2,__:[5]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],6),t.createElementVNode("div",{class:t.normalizeClass(["available-layers transition d-flex flex-column justify-start align-start",i.toggle?"right-bar":""]),style:t.normalizeStyle(l.listStyle)},[t.createElementVNode("div",ns,[t.createElementVNode("div",ss,t.toDisplayString(o.$t("layer.layers")),1),t.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleMenuToggle},{default:t.withCtx(()=>e[6]||(e[6]=[t.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[6]},8,["onClick"])]),t.createElementVNode("div",{class:t.normalizeClass(["list-box w-100 flex-1-1-0 scroll overflow-y-auto",a.simple?"px-3":"pl-4 pr-2"])},[t.createVNode(u,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:t.withCtx(()=>[t.createVNode(m,{class:"border-b-thin"},{default:t.withCtx(()=>[t.createVNode(s,{class:"text-h6"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(o.$t("layer.mapFeathers")),1)]),_:1})]),_:1}),t.createVNode(g,{class:"pb-2"},{default:t.withCtx(()=>[t.createElementVNode("div",cs,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.mapFeathers,S=>(t.openBlock(),t.createElementBlock("div",{key:S.value,class:"mb-4 feather-item",onClick:ee=>l.handleToggleMapFeather(S)},[t.createElementVNode("div",{class:t.normalizeClass([i.mapFeather===S.value?"active":"","img-box"])},[S.value==="dark"?(t.openBlock(),t.createElementBlock("img",ds)):S.value==="nautical"?(t.openBlock(),t.createElementBlock("img",hs)):S.value==="satellite"?(t.openBlock(),t.createElementBlock("img",ps)):(t.openBlock(),t.createElementBlock("img",gs))],2),t.createElementVNode("div",us,t.toDisplayString(o.$t(`layer.${S.locale}`)),1)],8,ms))),128))]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tagLayers.filter(S=>["graticule","day-night","time-zones"].includes(S.key)),S=>(t.openBlock(),t.createBlock(d,{key:S.key,modelValue:i.checkList,"onUpdate:modelValue":e[0]||(e[0]=ee=>i.checkList=ee),value:S.key,label:o.$t(`layer.${S.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2 mx-n1","hide-details":""},null,8,["modelValue","value","label"]))),128))]),_:1})]),_:1}),t.createVNode(u,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:t.withCtx(()=>[t.createVNode(m,{class:"border-b-thin"},{default:t.withCtx(()=>[t.createVNode(s,{class:"text-h6"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(o.$t("layer.pointsOfInteresting")),1)]),_:1})]),_:1}),t.createVNode(g,{class:"py-2 mx-n1"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tagLayers.filter(S=>["ports","alert-zones","tidal-stations"].includes(S.key)),S=>(t.openBlock(),t.createBlock(d,{key:S.key,modelValue:i.checkList,"onUpdate:modelValue":e[1]||(e[1]=ee=>i.checkList=ee),value:S.key,label:o.$t(`layer.${S.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label"]))),128))]),_:1})]),_:1}),t.createVNode(u,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:t.withCtx(()=>[t.createVNode(m,{class:"border-b-thin"},{default:t.withCtx(()=>[t.createVNode(s,{class:"text-h6"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(o.$t("layer.otherLayers")),1)]),_:1})]),_:1}),t.createVNode(g,{class:"py-2 mx-n1"},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.tagLayers.filter(S=>!["graticule","day-night","time-zones","ports","alert-zones","tidal-stations"].includes(S.key)),S=>(t.openBlock(),t.createBlock(d,{key:S.key,modelValue:i.checkList,"onUpdate:modelValue":e[2]||(e[2]=ee=>i.checkList=ee),value:S.key,label:o.$t(`layer.${S.locale}`),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label"]))),128))]),_:1})]),_:1}),t.createVNode(u,{class:"block-bg mx-auto mb-3",elevation:"0"},{default:t.withCtx(()=>[t.createVNode(m,{class:"border-b-thin"},{default:t.withCtx(()=>[t.createVNode(s,{class:"text-h6"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(o.$t("layer.myFollows")),1)]),_:1})]),_:1}),t.createVNode(g,{class:"py-2 mx-n1"},{default:t.withCtx(()=>[t.createVNode(d,{modelValue:i.checkList,"onUpdate:modelValue":e[3]||(e[3]=S=>i.checkList=S),value:"follow-ports",label:o.$t("layer.ports"),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","label"]),t.createVNode(d,{modelValue:i.checkList,"onUpdate:modelValue":e[4]||(e[4]=S=>i.checkList=S),value:"follow-positions",label:o.$t("layer.locations"),color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","label"])]),_:1})]),_:1})],2)],6),a.map?(t.openBlock(),t.createBlock(y,t.mergeProps({key:0,ref:"idmPorts",simple:a.simple,map:a.map,ports:(se=i.otherLayers)==null?void 0:se.ports,gateway:a.gateway,token:a.token,"forecast-model":a.forecastModel,"real-time":a.realTime,theme:a.theme},o.$attrs,{"before-layer":"empty-layer-3"}),null,16,["simple","map","ports","gateway","token","forecast-model","real-time","theme"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(p,t.mergeProps({key:1,ref:"idmIideStation",simple:a.simple,map:a.map,gateway:a.gateway,token:a.token,"default-meteo-token":a.defaultMeteoToken,show:i.checkList.includes("tidal-stations"),theme:a.theme,"real-time":a.realTime,"forecast-model":a.forecastModel,"before-layer":"empty-layer-3"},o.$attrs),null,16,["simple","map","gateway","token","default-meteo-token","show","theme","real-time","forecast-model"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(h,t.mergeProps({key:2,simple:a.simple,map:a.map,"menu-toggle":a.menuToggle,show:i.checkList.includes("graticule")},o.$attrs,{"before-layer":"empty-layer-3"}),null,16,["simple","map","menu-toggle","show"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(f,t.mergeProps({key:3,map:a.map,area:(le=i.otherLayers)==null?void 0:le["day-night"]},o.$attrs,{"before-layer":"empty-layer-2"}),null,16,["map","area"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(w,t.mergeProps({key:4,map:a.map,zone:(N=i.otherLayers)==null?void 0:N["time-zones"],"real-time":a.realTime},o.$attrs,{"before-layer":"empty-layer-3"}),null,16,["map","zone","real-time"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(b,t.mergeProps({key:5,map:a.map,simple:a.simple,zone:(j=i.otherLayers)==null?void 0:j["alert-zones"]},o.$attrs,{"before-layer":"empty-layer-3",theme:a.theme}),null,16,["map","simple","zone","theme"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(A,t.mergeProps({key:6,map:a.map,zone:(Z=i.otherLayers)==null?void 0:Z["eca-zones"]},o.$attrs),null,16,["map","zone"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(x,t.mergeProps({key:7,map:a.map,zone:(Q=i.otherLayers)==null?void 0:Q["war-zones"]},o.$attrs),null,16,["map","zone"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(C,t.mergeProps({key:8,map:a.map,area:(G=i.otherLayers)==null?void 0:G["gmdss-areas"]},o.$attrs),null,16,["map","area"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(k,t.mergeProps({key:9,map:a.map,show:i.checkList.includes("load-lines")},o.$attrs),null,16,["map","show"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(_,t.mergeProps({key:10,map:a.map,token:a.token,show:i.checkList.includes("worldMarine")},o.$attrs),null,16,["map","token","show"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(z,t.mergeProps({key:11,map:a.map,area:(B=i.otherLayers)==null?void 0:B["voluntary-reporting-area"]},o.$attrs),null,16,["map","area"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(P,t.mergeProps({key:12,map:a.map,area:(U=i.otherLayers)==null?void 0:U["special-area"]},o.$attrs),null,16,["map","area"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(T,t.mergeProps({key:13,map:a.map,token:a.token,show:i.checkList.includes("world12nm")},o.$attrs),null,16,["map","token","show"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(V,t.mergeProps({key:14,map:a.map,token:a.token,show:i.checkList.includes("chinaRoute")},o.$attrs),null,16,["map","token","show"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(O,t.mergeProps({key:15,map:a.map,show:i.checkList.includes("ice-areas")},o.$attrs),null,16,["map","show"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(Y,t.mergeProps({key:16,ref:"idmFollowPort",simple:a.simple,map:a.map,show:i.checkList.includes("follow-ports"),gateway:a.gateway,token:a.token,"forecast-model":a.forecastModel,"real-time":a.realTime},o.$attrs,{"before-layer":"empty-layer-3"}),null,16,["simple","map","show","gateway","token","forecast-model","real-time"])):t.createCommentVNode("",!0),a.map?(t.openBlock(),t.createBlock(J,t.mergeProps({key:17,ref:"idmFollowPosition",simple:a.simple,map:a.map,show:i.checkList.includes("follow-positions"),"forecast-model":a.forecastModel,"real-time":a.realTime},o.$attrs),null,16,["simple","map","show","forecast-model","real-time"])):t.createCommentVNode("",!0)])}const ys=K(rs,[["render",fs]]);class Mo{constructor(e){pe(this,"map");pe(this,"mercator");pe(this,"rampColorLayer");pe(this,"rampColorSource");pe(this,"particleLayer");pe(this,"particleSource");pe(this,"rampColorCanvas");pe(this,"particleCanvas");pe(this,"ratio");this.map=e,this.mercator=new ir,this.rampColorLayer="ramp-color-layer",this.rampColorSource="ramp-color-source",this.particleLayer="particle-layer",this.particleSource="particle-source",this.rampColorCanvas=document.createElement("canvas"),this.particleCanvas=document.createElement("canvas"),this.ratio=window.devicePixelRatio}convertNLng(e,a=0){return e>180?this.convertNLng(e-360,a+1):e<-180?this.convertNLng(e+360,a+1):[e,a]}getBoundLngLat(){var a;const e=(a=this.map)==null?void 0:a.getBounds();return e?[[e._sw.lng,e._ne.lat],[e._ne.lng,e._ne.lat],[e._ne.lng,e._sw.lat],[e._sw.lng,e._sw.lat]]:[]}getBoundPixel(){var p,h;const e=(p=this.map)==null?void 0:p.getBounds();if(!e)return[];const a=((h=this.map)==null?void 0:h.getZoom())+1,r=[e._ne.lng,e._ne.lat],i=[e._sw.lng,e._sw.lat],[l,n]=this.convertNLng(r[0]),[c,s]=this.convertNLng(i[0]),[m,d]=this.mercator.px([l,r[1]],a),[g,u]=this.mercator.px([c,i[1]],a),y=Math.round(this.mercator.size*Math.pow(2,a)*(n+s));return[g,u,m+y,d]}getBoundRange(){const e=this.map.getZoom()+1,a=this.mercator.size*Math.pow(2,e),r=this.getBoundPixel();return[r[0]/a,r[2]/a,r[3]/a,r[1]/a]}getWorldCopy(e,a){const r=2**a,[i,l,n,c]=e.map(d=>~~(d/(r*256))),s=[];for(let d=c;d<=l;d++)for(let g=i;g<=n;g++)s.push([g,d]);return s.map(d=>{const g=2**a*256;return[d[0]*g,d[1]*g,g]})}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){var i;const a=(i=this.map)==null?void 0:i.getLayoutProperty(this.rampColorLayer,"visibility"),r=e?"visible":"none";a!==r&&this.map.setLayoutProperty(this.rampColorLayer,"visibility",r)}toggleParticle(e){var i;const a=(i=this.map)==null?void 0:i.getLayoutProperty(this.particleLayer,"visibility"),r=e?"visible":"none";a!==r&&this.map.setLayoutProperty(this.particleLayer,"visibility",r)}}class $e{createShader(e,a,r){const i=e.createShader(a);if(i&&(e.shaderSource(i,r),e.compileShader(i),!e.getShaderParameter(i,e.COMPILE_STATUS)))throw new Error(e.getShaderInfoLog(i)||"error happened while create shader...");return i}createTexture(e,a,r,i,l,n,c){const s=e.createTexture();return e.bindTexture(e.TEXTURE_2D,s),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,a),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,i),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,i),l instanceof Uint8Array?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,n,c,0,e.RGBA,e.UNSIGNED_BYTE,l):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,l),e.bindTexture(e.TEXTURE_2D,null),s}createDataBuffer(e,a,r){if(e){const i=e.createBuffer();return a==="array"?(e.bindBuffer(e.ARRAY_BUFFER,i),r&&e.bufferData(e.ARRAY_BUFFER,r,e.STATIC_DRAW)):a==="element"&&(e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,i),r&&e.bufferData(e.ELEMENT_ARRAY_BUFFER,r,e.STATIC_DRAW)),i}return null}createProgram(e,a,r){const i=e.createProgram(),l=this.createShader(e,e.VERTEX_SHADER,a),n=this.createShader(e,e.FRAGMENT_SHADER,r);if(i&&l&&n&&(e.attachShader(i,l),e.attachShader(i,n),e.linkProgram(i),!e.getProgramParameter(i,e.LINK_STATUS)))throw new Error(e.getProgramInfoLog(i)||"error happened while creating ramp color program");return i}createProgramWrapper(e,a,r){const i=this.createProgram(e,a,r);if(i){const l={program:i},n=e.getProgramParameter(i,e.ACTIVE_ATTRIBUTES);for(let s=0;s<n;s++){const m=e.getActiveAttrib(i,s);l[m.name]=e.getAttribLocation(i,m.name)}const c=e.getProgramParameter(i,e.ACTIVE_UNIFORMS);for(let s=0;s<c;s++){const m=e.getActiveUniform(i,s);l[m.name]=e.getUniformLocation(i,m.name)}return l}}setup(e,a,r=!1,i,l){const n=document.createElement("canvas");n.width=256,n.height=1;const c=n.getContext("2d");if(c&&e){const s=c==null?void 0:c.createLinearGradient(0,0,256,0);return a.forEach(([m,d])=>{s.addColorStop(m,d)}),c.fillStyle=s,c.fillRect(0,0,256,1),{canvas:n,texture:this.createTexture(e,e.LINEAR,e.LINEAR,e.CLAMP_TO_EDGE,r?new Uint8Array(c.getImageData(0,0,256,1).data):n,i,l)}}}setupParticle(e,a=1e3){const r=Math.ceil(Math.sqrt(a)),i=r*r,l=new Uint8Array(i*4);for(let d=0;d<l.length;d++)l[d]=Math.floor(Math.random()*256);const n=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,l,r,r),c=this.createTexture(e,e.NEAREST,e.NEAREST,e.CLAMP_TO_EDGE,l,r,r),s=new Float32Array(i);for(let d=0;d<i;d++)s[d]=d;const m=this.createDataBuffer(e,"array",s);return{resolution:r,total:i,texture0:n,texture1:c,indexBuffer:m}}bind(e,a,r){const i=this.createProgram(e,a,r);if(i){const l=this.createDataBuffer(e,"array",void 0),n=e.getAttribLocation(i,"a_position");e.enableVertexAttribArray(n),e.vertexAttribPointer(n,2,e.FLOAT,!1,0,0);const c=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]);this.createDataBuffer(e,"array",c);const s=e.getAttribLocation(i,"a_texCoord");return e.enableVertexAttribArray(s),e.vertexAttribPointer(s,2,e.FLOAT,!1,0,0),{program:i,aPositionBuffer:l}}return{}}bindParticle(e,a,r,i,l,n){const c=this.createProgramWrapper(e,a,r),s=this.createProgramWrapper(e,i,l),m=this.createProgramWrapper(e,i,n),d=this.createDataBuffer(e,"array",new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1])),g=e.createFramebuffer();return{particle:c,screen:s,update:m,quadBuffer:d,frameBuffer:g}}draw(e,a,r,i,l,n,c){var s,m;if(a&&r){e.resize(),a==null||a.viewport(0,0,(s=a==null?void 0:a.canvas)==null?void 0:s.width,(m=a==null?void 0:a.canvas)==null?void 0:m.height),a.clearColor(0,0,0,0),a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT);try{a.useProgram(r);const d={resolution:a.getUniformLocation(r,"u_resolution"),image:a.getUniformLocation(r,"u_image"),color:a.getUniformLocation(r,"u_color"),scale:a.getUniformLocation(r,"u_scale"),uvRange:a.getUniformLocation(r,"u_range_u_v"),sRange:a.getUniformLocation(r,"u_range_s")};d.resolution&&a.uniform2f(d.resolution,a.canvas.width*e.ratio,a.canvas.height*e.ratio),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,i),d.image&&a.uniform1i(d.image,0),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,l),d.color&&a.uniform1i(d.color,1),c!=null&&c.uvRange&&(c!=null&&c.sRange)&&(d.uvRange&&a.uniform2f(d.uvRange,c.uvRange[0],c.uvRange[1]),d.sRange&&a.uniform2f(d.sRange,c.sRange[0],c.sRange[1])),d.scale&&a.uniform1f(d.scale,(c==null?void 0:c.scale)||1);const g=e.getBoundPixel(),u=e.map.getZoom()+1,y=e.getWorldCopy(g,u);for(const p of y){const h=(p[0]-g[0])*e.ratio,f=(p[1]-g[3])*e.ratio,w=p[2]*e.ratio,[b,A,x,C]=[h,w+h,f,w+f],k=new Float32Array([b,x,A,x,b,C,b,C,A,x,A,C]);a.bindBuffer(a.ARRAY_BUFFER,n),a.bufferData(a.ARRAY_BUFFER,k,a.STATIC_DRAW),a.drawArrays(a.TRIANGLES,0,6)}}catch(d){console.log(`render failed...${d}`)}}}drawParticle(e,a,r,i,l){var n,c;a&&(a==null||a.viewport(0,0,(n=a==null?void 0:a.canvas)==null?void 0:n.width,(c=a==null?void 0:a.canvas)==null?void 0:c.height),a.disable(a.DEPTH_TEST),a.disable(a.STENCIL_TEST),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,r),a.activeTexture(a.TEXTURE1),a.bindTexture(a.TEXTURE_2D,i.texture0),this.renderScreen(e,a,i,l),this.updateParticles(e,a,i,l))}renderScreen(e,a,r,i){a.bindFramebuffer(a.FRAMEBUFFER,r.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,r.screenTexture,0),a.viewport(0,0,a.canvas.width,a.canvas.height),this.renderScreenTexture(a,r.backgroundTexture,r.screen,r.quadBuffer,.95),this.renderParticles(e,a,r,i),a.bindFramebuffer(a.FRAMEBUFFER,null),this.renderScreenTexture(a,r.screenTexture,r.screen,r.quadBuffer,1);const l=r.backgroundTexture;r.backgroundTexture=r.screenTexture,r.screenTexture=l}renderScreenTexture(e,a,r,i,l){e&&(e.useProgram(r.program),e.bindBuffer(e.ARRAY_BUFFER,i),e.enableVertexAttribArray(r.a_pos),e.vertexAttribPointer(r.a_pos,2,e.FLOAT,!1,0,0),e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,a),e.uniform1i(r.u_screen,2),e.uniform1f(r.u_opacity,l),e.drawArrays(e.TRIANGLES,0,6))}renderParticles(e,a,r,i){if(a){a.useProgram(r.particle.program),a.bindBuffer(a.ARRAY_BUFFER,r.indexBuffer),a.enableVertexAttribArray(r.particle.a_index),a.vertexAttribPointer(r.particle.a_index,1,a.FLOAT,!1,0,0),a.activeTexture(a.TEXTURE2),a.bindTexture(a.TEXTURE_2D,r.color.texture),a.uniform1i(r.particle.u_factor,0),a.uniform1i(r.particle.u_particles,1),a.uniform1i(r.particle.u_color_ramp,2),a.uniform1f(r.particle.u_particles_resolution,r.resolution*e.ratio),a.uniform1f(r.particle.u_point,e.ratio);const l=e.getBoundRange();a.uniform4f(r.particle.u_viewport,l[0],l[1],l[2],l[3]),a.uniform2f(r.particle.u_factor_min,i.uvRange[0],i.uvRange[0]),a.uniform2f(r.particle.u_factor_max,i.uvRange[1],i.uvRange[1]),a.drawArrays(a.POINTS,0,r.total)}}updateParticles(e,a,r,i){var n,c;if(a){a.bindFramebuffer(a.FRAMEBUFFER,r.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,r.texture1,0),a.viewport(0,0,r.resolution,r.resolution),a.useProgram(r.update.program),a.bindBuffer(a.ARRAY_BUFFER,r.quadBuffer),a.enableVertexAttribArray(r.update.a_pos),a.vertexAttribPointer(r.update.a_pos,2,a.FLOAT,!1,0,0),a.uniform1i(r.update.u_factor,0),a.uniform1i(r.update.u_particles,1);const s=e.getBoundRange();a.uniform4f(r.update.u_viewport,s[0],s[1],s[2],s[3]),a.uniform1f(r.update.u_rand_seed,Math.random()),a.uniform2f(r.update.u_factor_res,(n=r==null?void 0:r.image)==null?void 0:n.width,(c=r==null?void 0:r.image)==null?void 0:c.height),a.uniform2f(r.update.u_factor_min,i.uvRange[0],i.uvRange[0]),a.uniform2f(r.update.u_factor_max,i.uvRange[1],i.uvRange[1]),a.uniform1f(r.update.u_speed_factor,i.speedFactor*e.ratio),a.uniform1f(r.update.u_drop_rate,i.dropRate),a.uniform1f(r.update.u_drop_rate_bump,i.dropRateBump),a.drawArrays(a.TRIANGLES,0,6)}const l=r.texture0;r.texture0=r.texture1,r.texture1=l}resize(e,a){e.resize();const r=new Uint8Array(a.canvas.width*a.canvas.height*4).fill(0,0,a.canvas.width*a.canvas.height*4),i=this.createTexture(a,a.NEAREST,a.NEAREST,a.CLAMP_TO_EDGE,r,a.canvas.width,a.canvas.height),l=this.createTexture(a,a.NEAREST,a.NEAREST,a.CLAMP_TO_EDGE,r,a.canvas.width,a.canvas.height);return{screenTexture:i,backgroundTexture:l}}async loadImg(e){return new Promise(a=>{const r=new Blob([e],{type:e.type}),i=URL.createObjectURL(r),l=new Image;l.crossOrigin="anonymous",l.src=i,l.onload=()=>a(l)})}}class fe{}pe(fe,"vertexSchema",`
|
|
11
11
|
//canvas 坐标系上的坐标 (x, y)
|
|
12
12
|
attribute vec2 a_position; //像素坐标
|
|
13
13
|
attribute vec2 a_texCoord; //纹理坐标
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as l } from "./chunk-ANSXOGKI-
|
|
2
|
-
import "./chunk-3VYIPD3A-
|
|
3
|
-
import "./index-
|
|
1
|
+
import { d as l } from "./chunk-ANSXOGKI-4579de59.js";
|
|
2
|
+
import "./chunk-3VYIPD3A-a6d163f1.js";
|
|
3
|
+
import "./index-5073d89a.js";
|
|
4
4
|
import "axios";
|
|
5
5
|
import "vuetify";
|
|
6
6
|
import "vue";
|