@idmwx/idmui-gl4 3.9.8 → 3.9.9
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-503de71a.js → chunk-3VYIPD3A-d4577dfc.js} +1 -1
- package/dist/{chunk-ANSXOGKI-c1eb0dc5.js → chunk-ANSXOGKI-97528b6a.js} +1 -1
- package/dist/{chunk-T4JIPPZO-bb038cca.js → chunk-T4JIPPZO-d92de456.js} +1 -1
- package/dist/{download-5d3a7841.js → download-39ba17fc.js} +3 -3
- package/dist/{index-212fbf94.js → index-582c7bfb.js} +17 -17
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/{rasterize-JS5G2XHH-9d61edec.js → rasterize-JS5G2XHH-9e766b69.js} +3 -3
- package/dist/{toBlob-b83c42a5.js → toBlob-4b26937e.js} +3 -3
- package/dist/{toCanvas-3592d269.js → toCanvas-87d48af5.js} +2 -2
- package/dist/{toImg-0cfbd5c8.js → toImg-0bbbfb77.js} +3 -3
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as a } from "./chunk-3VYIPD3A-
|
|
1
|
+
import { W as a } from "./chunk-3VYIPD3A-d4577dfc.js";
|
|
2
2
|
async function o(r, t) {
|
|
3
3
|
let i = await a(r, t), e = new Image();
|
|
4
4
|
return e.src = i.toDataURL(`image/${t.format}`, t.quality), await e.decode(), e.style.width = `${i.width / t.dpr}px`, e.style.height = `${i.height / t.dpr}px`, e;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { m as d } from "./chunk-T4JIPPZO-
|
|
2
|
-
import { W as f } from "./chunk-3VYIPD3A-
|
|
3
|
-
import "./index-
|
|
1
|
+
import { m as d } from "./chunk-T4JIPPZO-d92de456.js";
|
|
2
|
+
import { W as f } from "./chunk-3VYIPD3A-d4577dfc.js";
|
|
3
|
+
import "./index-582c7bfb.js";
|
|
4
4
|
import "axios";
|
|
5
5
|
import "vuetify";
|
|
6
6
|
import "vue";
|
|
@@ -9948,7 +9948,7 @@ const Ud = {
|
|
|
9948
9948
|
},
|
|
9949
9949
|
timeZone: {
|
|
9950
9950
|
handler(t, e) {
|
|
9951
|
-
t !== e && this.handleRefresh();
|
|
9951
|
+
t !== e && this.toggle && this.handleRefresh();
|
|
9952
9952
|
}
|
|
9953
9953
|
},
|
|
9954
9954
|
realTime: {
|
|
@@ -18351,52 +18351,52 @@ Se.capture = async (t, e, o) => {
|
|
|
18351
18351
|
if (o !== fl)
|
|
18352
18352
|
throw new Error("[snapdom.capture] is internal. Use snapdom(...) instead.");
|
|
18353
18353
|
let i = await gl(t, e), a = { img: async (u, h) => {
|
|
18354
|
-
let { toImg: f } = await import("./toImg-
|
|
18354
|
+
let { toImg: f } = await import("./toImg-0bbbfb77.js");
|
|
18355
18355
|
return f(i, { ...u, ...h || {} });
|
|
18356
18356
|
}, svg: async (u, h) => {
|
|
18357
|
-
let { toSvg: f } = await import("./toImg-
|
|
18357
|
+
let { toSvg: f } = await import("./toImg-0bbbfb77.js");
|
|
18358
18358
|
return f(i, { ...u, ...h || {} });
|
|
18359
18359
|
}, canvas: async (u, h) => {
|
|
18360
|
-
let { toCanvas: f } = await import("./toCanvas-
|
|
18360
|
+
let { toCanvas: f } = await import("./toCanvas-87d48af5.js");
|
|
18361
18361
|
return f(i, { ...u, ...h || {} });
|
|
18362
18362
|
}, blob: async (u, h) => {
|
|
18363
|
-
let { toBlob: f } = await import("./toBlob-
|
|
18363
|
+
let { toBlob: f } = await import("./toBlob-4b26937e.js");
|
|
18364
18364
|
return f(i, { ...u, ...h || {} });
|
|
18365
18365
|
}, png: async (u, h) => {
|
|
18366
|
-
let { rasterize: f } = await import("./rasterize-JS5G2XHH-
|
|
18366
|
+
let { rasterize: f } = await import("./rasterize-JS5G2XHH-9e766b69.js");
|
|
18367
18367
|
return f(i, { ...u, ...h || {}, format: "png" });
|
|
18368
18368
|
}, jpeg: async (u, h) => {
|
|
18369
|
-
let { rasterize: f } = await import("./rasterize-JS5G2XHH-
|
|
18369
|
+
let { rasterize: f } = await import("./rasterize-JS5G2XHH-9e766b69.js");
|
|
18370
18370
|
return f(i, { ...u, ...h || {}, format: "jpeg" });
|
|
18371
18371
|
}, webp: async (u, h) => {
|
|
18372
|
-
let { rasterize: f } = await import("./rasterize-JS5G2XHH-
|
|
18372
|
+
let { rasterize: f } = await import("./rasterize-JS5G2XHH-9e766b69.js");
|
|
18373
18373
|
return f(i, { ...u, ...h || {}, format: "webp" });
|
|
18374
18374
|
}, download: async (u, h) => {
|
|
18375
|
-
let { download: f } = await import("./download-
|
|
18375
|
+
let { download: f } = await import("./download-39ba17fc.js");
|
|
18376
18376
|
return f(i, { ...u, ...h || {} });
|
|
18377
18377
|
} }, r = { ...e, export: { url: i }, exports: { svg: async (u) => {
|
|
18378
|
-
let { toSvg: h } = await import("./toImg-
|
|
18378
|
+
let { toSvg: h } = await import("./toImg-0bbbfb77.js");
|
|
18379
18379
|
return h(i, { ...e, ...u || {}, [po]: !0 });
|
|
18380
18380
|
}, canvas: async (u) => {
|
|
18381
|
-
let { toCanvas: h } = await import("./toCanvas-
|
|
18381
|
+
let { toCanvas: h } = await import("./toCanvas-87d48af5.js");
|
|
18382
18382
|
return h(i, { ...e, ...u || {}, [po]: !0 });
|
|
18383
18383
|
}, png: async (u) => {
|
|
18384
|
-
let { rasterize: h } = await import("./rasterize-JS5G2XHH-
|
|
18384
|
+
let { rasterize: h } = await import("./rasterize-JS5G2XHH-9e766b69.js");
|
|
18385
18385
|
return h(i, { ...e, ...u || {}, format: "png", [po]: !0 });
|
|
18386
18386
|
}, jpeg: async (u) => {
|
|
18387
|
-
let { rasterize: h } = await import("./rasterize-JS5G2XHH-
|
|
18387
|
+
let { rasterize: h } = await import("./rasterize-JS5G2XHH-9e766b69.js");
|
|
18388
18388
|
return h(i, { ...e, ...u || {}, format: "jpeg", [po]: !0 });
|
|
18389
18389
|
}, jpg: async (u) => {
|
|
18390
|
-
let { rasterize: h } = await import("./rasterize-JS5G2XHH-
|
|
18390
|
+
let { rasterize: h } = await import("./rasterize-JS5G2XHH-9e766b69.js");
|
|
18391
18391
|
return h(i, { ...e, ...u || {}, format: "jpeg", [po]: !0 });
|
|
18392
18392
|
}, webp: async (u) => {
|
|
18393
|
-
let { rasterize: h } = await import("./rasterize-JS5G2XHH-
|
|
18393
|
+
let { rasterize: h } = await import("./rasterize-JS5G2XHH-9e766b69.js");
|
|
18394
18394
|
return h(i, { ...e, ...u || {}, format: "webp", [po]: !0 });
|
|
18395
18395
|
}, blob: async (u) => {
|
|
18396
|
-
let { toBlob: h } = await import("./toBlob-
|
|
18396
|
+
let { toBlob: h } = await import("./toBlob-4b26937e.js");
|
|
18397
18397
|
return h(i, { ...e, ...u || {}, [po]: !0 });
|
|
18398
18398
|
}, img: async (u) => {
|
|
18399
|
-
let { toImg: h } = await import("./toImg-
|
|
18399
|
+
let { toImg: h } = await import("./toImg-0bbbfb77.js");
|
|
18400
18400
|
return h(i, { ...e, ...u || {}, [po]: !0 });
|
|
18401
18401
|
} } }, l = await D0("defineExports", r), n = Object.assign({}, ...l.filter((u) => u && typeof u == "object")), s = { ...a, ...n };
|
|
18402
18402
|
s.jpeg && !s.jpg && (s.jpg = (u, h) => s.jpeg(u, h));
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as D, c as M, D as n, L as x, a as T, b as W, M as h, g as V, e as f, P as k, S as w, T as y, V as B, f as d, W as u, d as v } from "./index-
|
|
1
|
+
import { B as D, c as M, D as n, L as x, a as T, b as W, M as h, g as V, e as f, P as k, S as w, T as y, V as B, f as d, W as u, d as v } from "./index-582c7bfb.js";
|
|
2
2
|
import "axios";
|
|
3
3
|
import "vuetify";
|
|
4
4
|
import "vue";
|
package/dist/index.umd.cjs
CHANGED
|
@@ -620,7 +620,7 @@ ${a==="fragment"?`out vec4 fragColor;
|
|
|
620
620
|
<path d="M10 2.5V17.5" stroke="${this.color}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
621
621
|
<path d="M5 7.5L10 2.5L15 7.5" stroke="${this.color}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
622
622
|
</svg>`;n.src="data:image/svg+xml;base64,"+window.btoa(s);const c=[n];let m=0;c.forEach(d=>{d.onload=()=>{m++,this.map.hasImage("currentDirIcon")?this.map.updateImage("currentDirIcon",n):this.map.addImage("currentDirIcon",n),m===1&&!this.map.getLayer(this.directionLayer)&&this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"currentDirIcon","icon-size":["interpolate",["linear"],["get","spd"],.5,.3,1,.5,1.5,.7,2,.8,3.5,1],"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,0],[360,360]]}},paint:{"icon-opacity":this.opacity}},this.beforeLayer)}}),i=new Date().valueOf()-(a+r)}}},handleClear(){this.map.getLayer(this.speedLayer)&&this.map.removeLayer(this.speedLayer),this.map.getLayer(this.speedLabelLayer)&&this.map.removeLayer(this.speedLabelLayer),this.map.getLayer(this.directionLayer)&&this.map.removeLayer(this.directionLayer),this.map.hasImage("currentDirIcon")&&this.map.removeImage("currentDirIcon"),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function Kc(t,e,a,r,i,l){return null}const Qc=Q(Jc,[["render",Kc]]),qc={name:"IdmCurrentParticle",components:{LegendBar:it},props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:[to,eo]}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0,wrapper:void 0,animation:void 0,particleContext:void 0,particleTexture:void 0,particleCount:this.simple?6e3:13e3,particleOptions:{fadeOpacity:.99,speedFactor:this.simple?1.2:2,dropRate:.005,dropRateBump:.01,uvRange:[-2.5,2.6],sRange:[0,3],scale:.3},paused:!1,initial:!0}},watch:{"factor.version":{async handler(){var t,e;(t=this.factor)!=null&&t.active?await this.handleRender():this.handleClear(),(e=this.factor)!=null&&e.particle||this.handleClearParticle()},immediate:!0},"factor.particle":{async handler(t,e){t!==e&&e!==void 0&&(t?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}}},beforeUnmount(){this.handleClear()},methods:{async handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;await this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[current-particle] add elapsed: ",a,", total: ",e+=a)}},handleSetup(){var t;if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const e=[[0/255,"rgba(95, 143, 197,1)"],[5/255,"rgba(64,127,115,1)"],[10/255,"rgb(58,164,58)"],[15/255,"rgb(191,182,67)"],[20/255,"rgb(197,154,68)"],[30/255,"rgb(160,70,94)"],[40/255,"rgb(138,84,166)"],[45/255,"rgb(82,113,165)"],[50/255,"rgb(84,142,152)"],[65/255,"rgb(150,181,184)"],[80/255,"rgb(195,194,194)"],[254/255,"rgb(195,194,194)"],[1,"rgb(195,194,194)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:a,aPositionBuffer:r}=this.webgl.bind(this.context,fe.vertexSchema,fe.uvFragmentSchema);this.program=a,this.aPositionBuffer=r}(t=this.factor)!=null&&t.particle&&this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){if(this.particleContext=this.webgl.createParticleContext(this.viewport.particleCanvas),!this.particleContext)return;const t=[[0,"rgb(183,224,224)"],[1,"rgb(199,202,202)"],[.6,"rgb(199,202,202)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,...at.getSources(this.webgl.isWebGL2(this.particleContext))),this.wrapper.color=this.webgl.setup(this.particleContext,t,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,this.particleCount),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){var a;if(this.handleSetup(),!this.context)return;const t=this.context,e=this.factor.etime;if(this.etime!==e||this.particleContext&&!this.particleTexture){const r=await this.webgl.loadImg(this.factor.raw);if(this.context!==t||!((a=this.factor)!=null&&a.active)||this.factor.etime!==e)return;this.etime=e,this.context.deleteTexture(this.texture||null),this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,r),this.particleContext&&this.wrapper&&this.factor.particle&&(this.particleContext.deleteTexture(this.particleTexture||null),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.LINEAR,this.particleContext.CLAMP_TO_EDGE,r),this.wrapper.image=r)}this.initial&&this.particleTexture&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){!this.particleContext||!this.wrapper||(this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext,this.wrapper)})},handlePause(){var t;this.paused=!0,this.animation!=null&&cancelAnimationFrame(this.animation),this.animation=void 0,(t=this.viewport)==null||t.toggleParticle(!1)},handlePlay(){var t,e;!((t=this.factor)!=null&&t.active)||!((e=this.factor)!=null&&e.particle)||!this.particleContext||!this.particleTexture||!this.wrapper||this.animation!=null||(this.paused=!1,this.animation=requestAnimationFrame(()=>{var a,r;this.animation=void 0,!(this.paused||!((a=this.factor)!=null&&a.active)||!((r=this.factor)!=null&&r.particle)||!this.particleContext||!this.wrapper)&&(this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions),this.viewport.toggleParticle(!0),this.handlePlay())}))},handleClearParticle(){var t,e,a,r,i,l,n;this.handlePause(),this.webgl.destroyParticle(this.particleContext,this.wrapper),(t=this.particleContext)==null||t.deleteTexture(this.particleTexture||null),this.wrapper=void 0,this.particleTexture=void 0,this.particleContext=void 0,this.initial=!0,(a=(e=this.viewport)==null?void 0:e.map)==null||a.off("resize",this.handleResize),(i=(r=this.viewport)==null?void 0:r.map)==null||i.off("movestart",this.handlePause),(n=(l=this.viewport)==null?void 0:l.map)==null||n.off("moveend",this.handlePlay)},handleClear(){var t;(t=this.viewport)==null||t.toggle(!1),this.context=void 0,this.etime=void 0,this.handleClearParticle()}}},$c={key:0};function em(t,e,a,r,i,l){var s;const n=o.resolveComponent("LegendBar");return(s=a.factor)!=null&&s.active?(o.openBlock(),o.createElementBlock("div",$c,[o.createVNode(n,o.mergeProps({class:"current",unit:"kts",labels:[0,.4,.8,1.6,2,3.2],simple:a.simple},t.$attrs),null,16,["simple"])])):o.createCommentVNode("",!0)}const tm=Q(qc,[["render",em]]),om={name:"IdmSigWaveParticle",components:{LegendBar:it},props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:[to,eo]}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,rendererKey:"sig-wave-particle",backgroundFragmentSchema:fe.sigWaveFragmentSchema,etime:void 0,dataSource:void 0,imageSource:void 0,imageEtime:void 0,imagePromise:void 0,drawVersion:0,wrapper:void 0,animation:void 0,lastParticleFrameTime:void 0,particleContext:void 0,particleTexture:void 0,particleCount:this.simple?3e3:9e3,particleOptions:{fadeOpacity:0,lineLength:6,lineOpacity:.9,speedFactor:this.simple?.1:.2,dropRate:0,dropRateBump:0,uvRange:[0,12.75],sRange:[0,12.75]},paused:!1,initial:!0}},watch:{"factor.version":{async handler(){var t,e;(t=this.factor)!=null&&t.active?await this.handleRender():this.handleClear(),(e=this.factor)!=null&&e.particle||this.handleClearParticle()},immediate:!0},"factor.particle":{async handler(t,e){var a;t!==e&&e!==void 0&&(t&&((a=this.factor)!=null&&a.active)?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}}},beforeUnmount(){this.handleClear(),this.imagePromise=void 0,this.imageSource=void 0,this.imageEtime=void 0},methods:{async handleRender(){var t;if(!(!((t=this.factor)!=null&&t.active)||!this.viewport))try{const e=new Date().valueOf();let a=0,r=0;await this.handleDraw(),r=new Date().valueOf()-(e+a),console.log(`[${this.rendererKey}] add elapsed: `,r,", total: ",a+=r)}catch(e){this.handleClear(),console.error(`[${this.rendererKey}] Render failed:`,e)}},handleSetup(){var t;if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const e=[[0,"rgb(50, 158, 186)"],[10/255,"rgb(50, 158, 186)"],[20/255,"rgb(48, 128, 164)"],[30/255,"rgb(48, 99, 142)"],[40/255,"rgb(57, 61, 143)"],[50/255,"rgb(179, 86, 189)"],[60/255,"rgb(154, 45, 123)"],[80/255,"rgb(134, 48, 48)"],[120/255,"rgb(194, 77, 91)"],[150/255,"rgb(192, 118, 105)"],[180/255,"rgb(192, 163, 157)"],[1,"rgb(192, 163, 157)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:a,aPositionBuffer:r}=this.webgl.bind(this.context,fe.vertexSchema,this.backgroundFragmentSchema);this.program=a,this.aPositionBuffer=r}(t=this.factor)!=null&&t.particle&&this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){if(this.particleContext=this.webgl.createParticleContext(this.viewport.particleCanvas),!this.particleContext)return;const t=[[0,"rgb(183,224,224)"],[1,"rgb(217,220,220)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,...go.getSources(this.webgl.isWebGL2(this.particleContext))),this.wrapper.color=this.webgl.setup(this.particleContext,t,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,this.particleCount,"lines",!0),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){var i;this.handleSetup();const t=this.context;if(!t)return;const e=++this.drawVersion,{raw:a,etime:r}=this.factor;if(!this.texture||this.etime!==r||this.dataSource!==a||this.particleContext&&!this.particleTexture){(this.imageSource!==a||this.imageEtime!==r||!this.imagePromise)&&(this.imageSource=a,this.imageEtime=r,this.imagePromise=this.webgl.loadImg(a));let l;try{l=await this.imagePromise}catch(n){if(e!==this.drawVersion)return;throw this.imagePromise=void 0,n}if(e!==this.drawVersion||this.context!==t||!((i=this.factor)!=null&&i.active)||this.factor.raw!==a||this.factor.etime!==r)return;this.etime=r,this.dataSource=a,this.context.deleteTexture(this.texture||null),this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,l),this.particleContext&&this.wrapper&&this.factor.particle&&(this.particleContext.deleteTexture(this.particleTexture||null),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.NEAREST,this.particleContext.CLAMP_TO_EDGE,l),this.wrapper.image=l,this.wrapper.resetLifecycle=!0,this.lastParticleFrameTime=void 0)}this.initial&&this.particleTexture&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){!this.particleContext||!this.wrapper||(this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext,this.wrapper)})},handlePause(){var t;this.paused=!0,this.animation!=null&&cancelAnimationFrame(this.animation),this.animation=void 0,this.lastParticleFrameTime=void 0,this.particleContext&&((t=this.viewport)==null||t.toggleParticle(!1))},handlePlay(){var t,e;!((t=this.factor)!=null&&t.active)||!((e=this.factor)!=null&&e.particle)||!this.particleContext||!this.particleTexture||!this.wrapper||this.animation!=null||(this.paused=!1,this.animation=requestAnimationFrame(a=>{var i,l;if(this.animation=void 0,this.paused||!((i=this.factor)!=null&&i.active)||!((l=this.factor)!=null&&l.particle)||!this.particleContext||!this.wrapper)return;const r=this.lastParticleFrameTime==null?0:Math.max(0,(a-this.lastParticleFrameTime)/1e3);this.lastParticleFrameTime=a,this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions,r),this.viewport.toggleParticle(!0),this.handlePlay()}))},handleClearParticle(){var t,e,a,r,i,l,n;this.handlePause(),this.webgl.destroyParticle(this.particleContext,this.wrapper),(t=this.particleContext)==null||t.deleteTexture(this.particleTexture||null),this.wrapper=void 0,this.particleTexture=void 0,this.particleContext=void 0,this.initial=!0,(a=(e=this.viewport)==null?void 0:e.map)==null||a.off("resize",this.handleResize),(i=(r=this.viewport)==null?void 0:r.map)==null||i.off("movestart",this.handlePause),(n=(l=this.viewport)==null?void 0:l.map)==null||n.off("moveend",this.handlePlay)},handleClear(){var t,e;++this.drawVersion,this.context&&((t=this.viewport)==null||t.toggle(!1),this.context.deleteTexture(this.texture||null),this.context.deleteTexture(((e=this.rampColor)==null?void 0:e.texture)||null),this.context.deleteBuffer(this.aPositionBuffer||null),this.context.deleteProgram(this.program||null)),this.context=void 0,this.texture=void 0,this.rampColor=void 0,this.aPositionBuffer=void 0,this.program=void 0,this.etime=void 0,this.dataSource=void 0,this.handleClearParticle()}}},am={key:0};function im(t,e,a,r,i,l){var s;const n=o.resolveComponent("LegendBar");return(s=a.factor)!=null&&s.active?(o.openBlock(),o.createElementBlock("div",am,[o.createVNode(n,o.mergeProps({class:"sig-wave-particle",unit:"m",labels:[.5,1,1.5,2,6,9],simple:a.simple},t.$attrs),null,16,["simple"])])):o.createCommentVNode("",!0)}const rm=Q(om,[["render",im]]),lm={name:"IdmSigWaveHeight",props:{map:{type:Object},sigWaveHeight:{type:Object},beforeLayer:{type:String}},data(){return{source:"sig-wave-height-source",heightLayer:"sig-wave-height-layer",heightLabelLayer:"sig-wave-height-label-layer",empty:E.featureCollection([])}},watch:{"sigWaveHeight.version":{handler(){var t;(t=this.sigWaveHeight)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){var t,e;if(this.sigWaveHeight){const a=new Date().valueOf();let r=0,i=0,l=this.empty;this.sigWaveHeight.active&&(l=this.sigWaveHeight.data),(t=this.map)!=null&&t.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(l),i=new Date().valueOf()-(a+r),console.log("[sig-wave-height] update elapsed: ",i,", total: ",r+=i)):(this.map.addSource(this.source,{type:"geojson",data:l}),this.map.addLayer({id:this.heightLayer,type:"fill",source:this.source,filter:["==","$type","Polygon"],paint:{"fill-opacity":.8,"fill-color":["step",["get","val"],"rgba(0,235,156,0)",2,"rgba(0,235,156,0.4)",3,"#ffed00",4,"#ff9800",5,"#f77800",6,"#e4711e",7,"#e06128",8,"#dc5132",9,"#d5453c",10,"#cd3a46",12,"#be2c50",14,"#b41a5a"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","symbol-spacing":100,"text-field":["format",["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":10},paint:{"text-color":["step",["get","val"],"rgba(0, 0, 0, 0.7)",9,"rgba(255,255,255,0.8)"]}},this.beforeLayer),i=new Date().valueOf()-(a+r),console.log("[sig-wave-height] add elapsed: ",i,", total: ",r+=i))}},handleClear(){this.map.getLayer(this.heightLayer)&&this.map.removeLayer(this.heightLayer),this.map.getLayer(this.heightLabelLayer)&&this.map.removeLayer(this.heightLabelLayer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function nm(t,e,a,r,i,l){return null}const sm=Q(lm,[["render",nm]]),cm={name:"IdmSwellParticle",components:{LegendBar:it},props:{simple:{type:Boolean,default:!1},factor:{type:Object},viewport:{type:[to,eo]}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,rendererKey:"swell-particle",backgroundFragmentSchema:fe.fragmentSchema,etime:void 0,dataSource:void 0,imageSource:void 0,imagePromise:void 0,drawVersion:0,wrapper:void 0,animation:void 0,lastParticleFrameTime:void 0,particleContext:void 0,particleTexture:void 0,particleCount:this.simple?3e3:9e3,particleOptions:{fadeOpacity:0,lineLength:6,lineOpacity:.9,speedFactor:this.simple?.1:.2,dropRate:0,dropRateBump:0,uvRange:[0,12.75],sRange:[0,12.75]},paused:!1,initial:!0}},watch:{"factor.version":{async handler(){var t,e;(t=this.factor)!=null&&t.active?await this.handleRender():this.handleClear(),(e=this.factor)!=null&&e.particle||this.handleClearParticle()},immediate:!0},"factor.particle":{async handler(t,e){var a;t!==e&&e!==void 0&&(t&&((a=this.factor)!=null&&a.active)?(this.handleClear(),await this.handleRender()):this.handleClearParticle())}}},beforeUnmount(){this.handleClear(),this.imagePromise=void 0,this.imageSource=void 0},methods:{async handleRender(){var t;if(!(!((t=this.factor)!=null&&t.active)||!this.viewport))try{const e=new Date().valueOf();await this.handleDraw(),console.log(`[${this.rendererKey}] 渲染耗时: `,new Date().valueOf()-e)}catch(e){this.handleClear(),console.error(`[${this.rendererKey}] 渲染失败:`,e)}},handleSetup(){var t;if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const e=[[0,"rgb(50, 158, 186)"],[10/255,"rgb(50, 158, 186)"],[20/255,"rgb(48, 128, 164)"],[30/255,"rgb(48, 99, 142)"],[40/255,"rgb(57, 61, 143)"],[50/255,"rgb(179, 86, 189)"],[60/255,"rgb(154, 45, 123)"],[80/255,"rgb(134, 48, 48)"],[120/255,"rgb(194, 77, 91)"],[150/255,"rgb(192, 118, 105)"],[180/255,"rgb(192, 163, 157)"],[1,"rgb(192, 163, 157)"]];this.rampColor=this.webgl.setup(this.context,e);const{program:a,aPositionBuffer:r}=this.webgl.bind(this.context,fe.vertexSchema,this.backgroundFragmentSchema);this.program=a,this.aPositionBuffer=r}(t=this.factor)!=null&&t.particle&&this.handleParticleSetup()},handleParticleSetup(){if(!this.particleContext){if(this.particleContext=this.webgl.createParticleContext(this.viewport.particleCanvas),!this.particleContext)return;const t=[[0,"rgb(183,224,224)"],[1,"rgb(217,220,220)"]];this.wrapper=this.webgl.bindParticle(this.particleContext,...go.getSources(this.webgl.isWebGL2(this.particleContext))),this.wrapper.color=this.webgl.setup(this.particleContext,t,!0,16,16),this.wrapper={...this.wrapper,...this.webgl.setupParticle(this.particleContext,this.particleCount,"lines",!0),...this.webgl.resize(this.viewport,this.particleContext)},this.viewport.map.on("resize",this.handleResize),this.viewport.map.on("movestart",this.handlePause),this.viewport.map.on("moveend",this.handlePlay)}},async handleDraw(){var i;this.handleSetup();const t=this.context;if(!t)return;const e=++this.drawVersion,{raw:a,etime:r}=this.factor;if(!this.texture||this.etime!==r||this.dataSource!==a||this.particleContext&&!this.particleTexture){(this.imageSource!==a||!this.imagePromise)&&(this.imageSource=a,this.imagePromise=this.webgl.loadImg(a));let l;try{l=await this.imagePromise}catch(n){if(e!==this.drawVersion)return;throw this.imagePromise=void 0,n}if(e!==this.drawVersion||this.context!==t||!((i=this.factor)!=null&&i.active)||this.factor.raw!==a||this.factor.etime!==r)return;this.etime=r,this.dataSource=a,this.context.deleteTexture(this.texture||null),this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,l),this.particleContext&&this.wrapper&&this.factor.particle&&(this.particleContext.deleteTexture(this.particleTexture||null),this.particleTexture=this.webgl.createTexture(this.particleContext,this.particleContext.NEAREST,this.particleContext.NEAREST,this.particleContext.CLAMP_TO_EDGE,l),this.wrapper.image=l,this.wrapper.resetLifecycle=!0,this.lastParticleFrameTime=void 0)}this.initial&&this.particleTexture&&(this.initial=!1,this.handlePlay()),this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer,this.particleOptions),this.viewport.toggle(!0)},handleResize(){!this.particleContext||!this.wrapper||(this.wrapper={...this.wrapper,...this.webgl.resize(this.viewport,this.particleContext,this.wrapper)})},handlePause(){var t;this.paused=!0,this.animation!=null&&cancelAnimationFrame(this.animation),this.animation=void 0,this.lastParticleFrameTime=void 0,this.particleContext&&((t=this.viewport)==null||t.toggleParticle(!1))},handlePlay(){var t,e;!((t=this.factor)!=null&&t.active)||!((e=this.factor)!=null&&e.particle)||!this.particleContext||!this.particleTexture||!this.wrapper||this.animation!=null||(this.paused=!1,this.animation=requestAnimationFrame(a=>{var i,l;if(this.animation=void 0,this.paused||!((i=this.factor)!=null&&i.active)||!((l=this.factor)!=null&&l.particle)||!this.particleContext||!this.wrapper)return;const r=this.lastParticleFrameTime==null?0:Math.max(0,(a-this.lastParticleFrameTime)/1e3);this.lastParticleFrameTime=a,this.webgl.drawParticle(this.viewport,this.particleContext,this.particleTexture,this.wrapper,this.particleOptions,r),this.viewport.toggleParticle(!0),this.handlePlay()}))},handleClearParticle(){var t,e,a,r,i,l,n;this.handlePause(),this.webgl.destroyParticle(this.particleContext,this.wrapper),(t=this.particleContext)==null||t.deleteTexture(this.particleTexture||null),this.wrapper=void 0,this.particleTexture=void 0,this.particleContext=void 0,this.initial=!0,(a=(e=this.viewport)==null?void 0:e.map)==null||a.off("resize",this.handleResize),(i=(r=this.viewport)==null?void 0:r.map)==null||i.off("movestart",this.handlePause),(n=(l=this.viewport)==null?void 0:l.map)==null||n.off("moveend",this.handlePlay)},handleClear(){var t,e;++this.drawVersion,this.context&&((t=this.viewport)==null||t.toggle(!1),this.context.deleteTexture(this.texture||null),this.context.deleteTexture(((e=this.rampColor)==null?void 0:e.texture)||null),this.context.deleteBuffer(this.aPositionBuffer||null),this.context.deleteProgram(this.program||null)),this.context=void 0,this.texture=void 0,this.rampColor=void 0,this.aPositionBuffer=void 0,this.program=void 0,this.etime=void 0,this.dataSource=void 0,this.handleClearParticle()}}},mm={key:0};function dm(t,e,a,r,i,l){var s;const n=o.resolveComponent("LegendBar");return(s=a.factor)!=null&&s.active?(o.openBlock(),o.createElementBlock("div",mm,[o.createVNode(n,o.mergeProps({class:"swell",unit:"m",labels:[.5,1,1.5,2,6,9],simple:a.simple},t.$attrs),null,16,["simple"])])):o.createCommentVNode("",!0)}const hm=Q(cm,[["render",dm]]),pm={name:"IdmSwellDirection",props:{map:{type:Object},swell:{type:Object},beforeLayer:{type:String},mapFeather:{type:String},hasRampLayer:{type:Boolean},nautical:{type:String}},data(){return{source:"swell-source",directionLayer:"swell-direction-layer",heightLayer:"swell-height-layer",heightLabelLayer:"swell-height-label-layer",empty:E.featureCollection([])}},computed:{opacity(){return(this.mapFeather==="light"||this.nautical==="hi"||this.nautical==="i4")&&!this.hasRampLayer?.6:.7},color(){return(this.mapFeather==="light"||this.nautical==="hi"||this.nautical==="i4")&&!this.hasRampLayer?"#000623":"#ffffff"}},watch:{"swell.version":{handler(){var t;(t=this.swell)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},color:{handler(){var t;(t=this.swell)!=null&&t.active&&(this.handleClear(),this.handleRender())}}},methods:{handleRender(){var t,e;if(this.swell){const a=new Date().valueOf();let r=0,i=this.empty;if(this.swell.active&&(i=this.swell.data),(t=this.map)!=null&&t.getSource(this.source))(e=this.map)==null||e.getSource(this.source).setData(i),new Date().valueOf()-(a+r);else{this.map.addSource(this.source,{type:"geojson",data:i}),this.map.addLayer({id:this.heightLayer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-opacity":1,"line-width":1,"line-color":["match",["get","val"],2,"rgba(255,255,0,0.9)",3,"rgba(255,149,0,0.9)",4,"rgba(244,67,54,0.9)",5,"rgba(162,2,31,0.9)",6,"rgba(162,2,31,0.9)","rgba(162,2,31,0.9)"]}},this.beforeLayer),this.map.addLayer({id:this.heightLabelLayer,type:"symbol",source:this.source,filter:["==","$type","LineString"],layout:{"symbol-placement":"line","text-rotation-alignment":"viewport","text-field":"{val}m","text-size":11},paint:{"text-color":["step",["get","val"],"black",4,"white",5,"white",6,"white"],"text-halo-color":["match",["get","val"],2,"rgba(255,255,0,0.7)",3,"rgba(255,149,0,0.7)",4,"rgba(244,67,54,0.7)",5,"rgba(162,13,2,0.7)",6,"rgba(162,13,2,0.7)","rgba(162,13,2,0.7)"],"text-halo-width":2}},this.beforeLayer);const l=new Image(72,72);let n=`<svg t="1752721890391" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12518" width="200" height="200"><path d="M481.386772 959.514313 481.386772 334.713224c-56.000432 37.288255-92.523253 55.876612-142.312216 57.787124 85.834924-84.884272 130.528845-195.161888 172.552961-328.434218 40.259936 133.272329 89.39296 238.731196 172.622546 328.434218-54.105269-5.729491-86.780459-21.201881-146.338926-58.965973l0 625.979938L481.386772 959.514313z" p-id="12519" fill="${this.color}"></path></svg>`,s="data:image/svg+xml;base64,"+window.btoa(unescape(encodeURIComponent(n)));l.src=s,l.onload=()=>{this.map.hasImage("swellDirIconWhite")?this.map.updateImage("swellDirIconWhite",l):this.map.addImage("swellDirIconWhite",l),this.map.getLayer(this.directionLayer)||this.map.addLayer({id:this.directionLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","icon-image":"swellDirIconWhite","icon-size":{base:1,stops:[[2,.32],[6,.5]]},"icon-offset":[0,-20],"icon-allow-overlap":!0,"icon-rotation-alignment":"map","icon-rotate":{property:"val",stops:[[0,180],[360,540]]}},paint:{"icon-opacity":this.opacity}},this.beforeLayer)},new Date().valueOf()-(a+r)}}},handleClear(){this.map.getLayer(this.heightLayer)&&this.map.removeLayer(this.heightLayer),this.map.getLayer(this.heightLabelLayer)&&this.map.removeLayer(this.heightLabelLayer),this.map.getLayer(this.directionLayer)&&this.map.removeLayer(this.directionLayer),this.map.hasImage("swellDirIconWhite")&&this.map.removeImage("swellDirIconWhite"),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function um(t,e,a,r,i,l){return o.openBlock(),o.createElementBlock("div")}const gm=Q(pm,[["render",um]]),fm={name:"IdmPrmsl",props:{map:{type:Object},prmsl:{type:Object},beforeLayer:{type:String},theme:{type:String},hasRampLayer:{type:Boolean},nautical:{type:String}},data(){return{source:"prmsl-source",layer:"prmsl-layer",labelLayer:"prmsl-label-layer",pointLabelLayer:"prmsl-point-label-layer",empty:E.featureCollection([])}},computed:{opacity(){return(this.theme==="light"||this.nautical==="hi"||this.nautical==="i4")&&!this.hasRampLayer?1:.3}},watch:{"prmsl.version":{handler(){var t;(t=this.prmsl)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0},opacity:{handler(){var t;(t=this.prmsl)!=null&&t.active&&(this.handleClear(),this.handleRender())}}},methods:{handleRender(){var t,e,a;if(this.prmsl){const r=new Date().valueOf();let i=0,l=0,n=this.empty;this.prmsl.active&&(n=this.prmsl.data),(t=this.map)!=null&&t.getSource(this.source)?((e=this.map)==null||e.getSource(this.source).setData(n),l=new Date().valueOf()-(r+i),console.log("[prmsl] update elapsed: ",l,", total: ",i+=l)):(this.map.addSource(this.source,{type:"geojson",data:n}),this.map.addLayer({id:this.layer,type:"line",source:this.source,filter:["==","$type","LineString"],paint:{"line-color":["step",["get","val"],"rgba(162,13,2,1)",920,"rgba(255, 96, 98, 1)",980,"rgba(255, 246, 184, 1)",1100,"rgba(199,171,250,1)"],"line-width":1,"line-opacity":this.opacity}},this.beforeLayer),(a=this.map)==null||a.addLayer({id:this.labelLayer,type:"symbol",source:this.source,minzoom:4,filter:["==","$type","LineString"],layout:{"symbol-placement":"line","text-rotation-alignment":"viewport","text-field":"{val}","text-size":10},paint:{"text-color":"black","text-halo-color":"rgba(255,255,255,1)","text-opacity":.7,"text-halo-width":1}},this.beforeLayer),this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.source,filter:["==","$type","Point"],layout:{"symbol-placement":"point","text-allow-overlap":!0,"text-field":["format",["get","type"],{"font-scale":1.03},`
|
|
623
|
-
`,["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":12,"text-font":["DIN Pro Regular","Arial Unicode MS Regular"]},paint:{"text-color":this.theme==="light"?["step",["get","val"],"rgba(0, 0, 0, 0.5)",920,"rgba(0, 0, 0, 0.5)",980,"rgba(0, 0, 0, 0.7)",1100,"rgba(0, 0, 0, 0.7)"]:"rgba(0,0,0,1)","text-halo-color":["step",["get","val"],"rgba(162,13,2,1)",920,"rgba(255, 96, 98, 1)",980,"rgba(255, 246, 184, 1)",1100,"rgba(199,171,250,1)"],"text-halo-width":1}},this.beforeLayer),l=new Date().valueOf()-(r+i),console.log("[prmsl] add elapsed: ",l,", total: ",i+=l))}},handleClear(){this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.labelLayer)&&this.map.removeLayer(this.labelLayer),this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function ym(t,e,a,r,i,l){return null}const bm=Q(fm,[["render",ym]]),wm={name:"IdmIceEdge",components:{LegendBar:it},props:{factor:{type:Object},viewport:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[ice-edge] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[0,"rgba(86, 169, 230, 0)"],[1/255,"rgba(86, 169, 230, 0)"],[25/255,"rgba(86, 169, 230, 1)"],[25/255,"rgba(47, 226, 155, 1)"],[100/255,"rgba(47, 226, 155, 1)"],[100/255,"rgba(213, 253, 37, 1)"],[175/255,"rgba(213, 253, 37, 1)"],[175/255,"rgba(230, 176, 39, 1)"],[225/255,"rgba(230, 176, 39, 1)"],[225/255,"rgba(230, 84, 39, 1)"],[250/255,"rgba(230, 84, 39, 1)"],[1,"rgba(230, 84, 39, 1)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},xm={key:0};function km(t,e,a,r,i,l){var s;const n=o.resolveComponent("LegendBar");return(s=a.factor)!=null&&s.active?(o.openBlock(),o.createElementBlock("div",xm,[o.createVNode(n,o.mergeProps({class:"ice-edge",unit:"%",labels:["",10,"","",40,"","",70,"",90,""],"unit-color":"rgba(var(--v-theme-black), 0.7)"},t.$attrs),null,16)])):o.createCommentVNode("",!0)}const Am=Q(wm,[["render",km]]),Lm={name:"IdmCover",components:{LegendBar:it},props:{factor:{type:Object},viewport:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[ice-cover] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[0,"rgba(68, 1, 84, 0)"],[1/255,"rgba(63, 72, 137, 0)"],[50/255,"rgba(53, 125, 177, 1)"],[100/255,"rgba(33, 145, 140, 1)"],[150/255,"rgba(45, 178, 125, 1)"],[200/255,"rgba(112, 207, 87, 1)"],[250/255,"rgba(253, 231, 37, 0.8)"],[1,"rgba(253, 231, 37, 1)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},vm={key:0};function Cm(t,e,a,r,i,l){var s;const n=o.resolveComponent("LegendBar");return(s=a.factor)!=null&&s.active?(o.openBlock(),o.createElementBlock("div",vm,[o.createVNode(n,o.mergeProps({class:"ice-cover",unit:"%",labels:[20,40,60,80,100]},t.$attrs),null,16)])):o.createCommentVNode("",!0)}const _m=Q(Lm,[["render",Cm]]),zm={name:"IdmThickness",components:{LegendBar:it},props:{factor:{type:Object},viewport:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[ice-thickness] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[0,"rgba(4, 6, 19, 0)"],[1/255,"rgba(4, 6, 19, 0)"],[20/255,"rgba(51, 50, 102, 1)"],[40/255,"rgba(63, 82, 158, 1)"],[50/255,"rgba(66, 123, 183, 1)"],[60/255,"rgba(92, 161, 197, 1)"],[80/255,"rgba(134, 199, 212, 0.7)"],[100/255,"rgba(134, 199, 212, 1)"],[150/255,"rgba(234, 253, 2536, 0.8)"],[250/255,"rgba(234, 253, 2536, 0.9)"],[1,"rgba(234, 253, 2536, 1)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},Sm={key:0};function Pm(t,e,a,r,i,l){var s;const n=o.resolveComponent("LegendBar");return(s=a.factor)!=null&&s.active?(o.openBlock(),o.createElementBlock("div",Sm,[o.createVNode(n,o.mergeProps({class:"ice-thickness",unit:"m",labels:[0,.6,1,1.5,2,3]},t.$attrs),null,16)])):o.createCommentVNode("",!0)}const Mm=Q(zm,[["render",Pm]]),Tm={name:"IdmPrecip3h",components:{LegendBar:it},props:{factor:{type:Object},viewport:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},deeimmediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[precip3h] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[0,"rgba(59, 126, 162, 0)"],[14/255,"rgba(84,170,230, 0)"],[15/255,"rgba(172, 210, 255, 0.8)"],[20/255,"rgba(51,202,248,0.8)"],[30/255,"rgba(3,248,103,0.8)"],[49/255,"rgba(14,201,3,0.8)"],[57/255,"rgba(190,226,2,0.8)"],[73/255,"rgba(248,1,1,0.8)"],[82/255,"rgba(197,5,58,0.8)"],[1,"rgba(197,5,58,0.8)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},Nm={key:0};function Em(t,e,a,r,i,l){var s;const n=o.resolveComponent("LegendBar");return(s=a.factor)!=null&&s.active?(o.openBlock(),o.createElementBlock("div",Nm,[o.createVNode(n,o.mergeProps({class:"precip3h",unit:"mm",labels:[1.5,2,3,7,10,20,30]},t.$attrs),null,16)])):o.createCommentVNode("",!0)}const Vm=Q(Tm,[["render",Em]]),Rm={name:"IdmVisibility",components:{LegendBar:it},props:{factor:{type:Object},viewport:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[visibility] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[0,"rgba(189,50,160,0.8)"],[8/255,"rgba(208,56,56,0.8)"],[27/255,"rgba(190,226,2,0.8)"],[60/255,"rgba(3,236,118,0.8)"],[160/255,"rgba(172, 210,255,0.8)"],[161/255,"rgba(172, 210,255,0)"],[1,"rgba(144,144,144,0)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},Dm={key:0};function Bm(t,e,a,r,i,l){var s;const n=o.resolveComponent("LegendBar");return(s=a.factor)!=null&&s.active?(o.openBlock(),o.createElementBlock("div",Dm,[o.createVNode(n,o.mergeProps({class:"visibility",unit:"nm",labels:[0,.5,1.5,3,9]},t.$attrs),null,16)])):o.createCommentVNode("",!0)}const Im=Q(Rm,[["render",Bm]]),Fm={name:"IdmWaterTemp",components:{LegendBar:it},props:{factor:{type:Object},viewport:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[water-temp] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[0,"rgba(95, 143, 197)"],[46/255,"rgba(95, 143, 197)"],[69/255,"rgb(80, 140, 62)"],[92/255,"rgb(121, 146, 28)"],[115/255,"rgb(171, 161, 14)"],[138/255,"rgb(223, 177, 69)"],[161/255,"rgb(243, 150, 6)"],[184/255,"rgb(236, 95, 21)"],[207/255,"rgb(190, 65, 18)"],[230/255,"rgb(138, 43, 10)"],[1,"rgb(138, 43, 10)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},Gm={key:0};function jm(t,e,a,r,i,l){var s;const n=o.resolveComponent("LegendBar");return(s=a.factor)!=null&&s.active?(o.openBlock(),o.createElementBlock("div",Gm,[o.createVNode(n,o.mergeProps({class:"water-temp",unit:"°C",labels:[0,10,20,30,40]},t.$attrs),null,16)])):o.createCommentVNode("",!0)}const Wm=Q(Fm,[["render",jm]]),Zm={name:"IdmTemp",components:{LegendBar:it},props:{factor:{type:Object},viewport:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0;this.handleDraw(),new Date().valueOf()-(t+e)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[0,"rgb(149, 137, 211)"],[100/255,"rgb(149, 137, 211)"],[110/255,"rgb(150, 209, 216)"],[120/255,"rgb(129, 204, 197)"],[130/255,"rgb(103, 180, 186)"],[140/255,"rgb(95, 143, 197)"],[150/255,"rgb(80, 140, 62)"],[160/255,"rgb(121, 146, 28)"],[170/255,"rgb(171, 161, 14)"],[180/255,"rgb(223, 177, 6)"],[190/255,"rgb(243, 150, 6)"],[200/255,"rgb(236, 95, 21)"],[210/255,"rgb(190, 65, 18)"],[220/255,"rgb(138, 43, 10)"],[1,"rgb(138, 43, 10)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},Hm={key:0};function Xm(t,e,a,r,i,l){var s;const n=o.resolveComponent("LegendBar");return(s=a.factor)!=null&&s.active?(o.openBlock(),o.createElementBlock("div",Hm,[o.createVNode(n,o.mergeProps({class:"temp",unit:"°C",labels:[-20,-10,0,10,20,30,40]},t.$attrs),null,16)])):o.createCommentVNode("",!0)}const Om=Q(Zm,[["render",Xm]]),jb="",Ym={name:"IdmGlLayer",components:{IdmWindBarb:Wc,IdmWindParticle:Uc,IdmCurrentDirection:Qc,IdmCurrentParticle:tm,IdmSigWaveParticle:rm,IdmSigWaveHeight:sm,IdmSwellParticle:hm,IdmSwellDirection:gm,IdmPrmsl:bm,IdmIceEdge:Am,IdmIceCover:_m,IdmIceThickness:Mm,IdmPrecip3h:Vm,IdmVisibility:Im,IdmWaterTemp:Wm,IdmTemp:Om},props:{simple:{type:Boolean,default:!1},isLogin:{type:Boolean,default:!1},theme:{type:String},map:{type:Object},mapFeather:{type:String},gateway:{type:String},assistGateway:{type:Array,default:[]},defaultMeteoToken:{type:String},top:{type:Number,default:0},paddingTop:{type:Number,default:8},menuHeight:{type:Number,default:248},menuToggle:{type:Object,default:{}},realTime:{type:String},forecastModel:{type:String},beforeLayer:{type:String},platform:{type:String},projection:{type:String}},emits:["forecastModel","menuToggle","weatherCheckList","autoActive","weatherRendered","rampLayersReady"],data(){const t=[...ho.LayerHelper.WEATHER_LAYERS];return{right:10,toggle:!1,autoActive:!0,weatherWeight:0,allLayers:t,tagLayers:t.filter(e=>!e.hide),checkList:[],renderKey:"",iceToggleValue:void 0,weatherLayers:{},activeWeatherLayers:[],cache:{v:"0.0.4",versionKey:"weatherLayerCacheVersionGL4",autoActiveKey:"autoActiveCacheGL4",checkListKey:"weatherCheckListCacheGL4"},models:{},currentModel:localStorage.getItem("forecastModelCacheGL4")==="GFS"?"GFS":"ECMWF",zoom:6,viewport:void 0,viewportSeq:0,particleFactor:void 0,showWindParticle:!0,showCurrentParticle:!0,showSigWaveParticle:!0,showSwellParticle:!0,legendToggle:!1,legend:{barbs:[2,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,0],current:[{label:"0-0.5 kts",size:.3,color:"rgb(58, 164, 58)"},{label:"0.5-1 kts",size:.4,color:"#ffff00"},{label:"1-1.5 kts",size:.6,color:"#ff9500"},{label:"1.5-2 kts",size:.8,color:"#f44336"},{label:">= 2 kts",size:1,color:"#e4711e"}],sigWaveHeight:[{label:"< 2 m",color:"rgba(0,235,156,0)"},{label:"2-3 m",color:"rgba(0,235,156,0.4)"},{label:"3-4 m",color:"#ffed00"},{label:"4-5 m",color:"#ff9800"},{label:"5-6 m",color:"#f77800"},{label:"6-7 m",color:"#e4711e"},{label:"7-8 m",color:"#e06128"},{label:"8-9 m",color:"#dc5132"},{label:"9-10 m",color:"#d5453c"},{label:"10-12 m",color:"#cd3a46"},{label:"12-14 m",color:"#be2c50"},{label:"> 14 m",color:"#aa1a5a"}]}}},computed:{listStyle(){return this.simple?{top:this.top+"px",left:this.toggle?"0px":"-280px",height:"calc(100vh - "+this.top+"px)"}:{top:this.top+"px",right:this.toggle?"0px":"-280px",height:"calc(100vh - "+this.top+"px)"}},computeDateZ(){return function(t){var e;if(t){const a=_(t);return`${(e=a==null?void 0:a.utc())==null?void 0:e.format("MMM-DD/HHmm")}Z`}return"-"}},computeDateUpdate(){return function(t){return t?_(t).fromNow():"-"}},overlaysKeys(){return this.tagLayers.filter(t=>t.overlays).map(t=>t.key)},rendersKeys(){return this.allLayers.filter(t=>!t.overlays&&t.enabled).map(t=>t.key)},showTipMenu(){return this.checkList.includes("wind")||this.checkList.includes("current-direction")||this.checkList.includes("sig-wave-height")},barbsIconName(){var e,a,r;const t=[];for(let i=0;i<((a=(e=this.legend)==null?void 0:e.barbs)==null?void 0:a.length);i++){const l=((r=this.legend)==null?void 0:r.barbs[i])||0,n=l<10?`00${l}kts`:l<100?`0${l}kts`:`${l}kts`;t.push("icon-a-"+n)}return t},lengendTipTop(){return this.platform==="ops"?this.top+this.menuHeight+322:this.top+this.menuHeight+232},viewportKey(){return this.viewport?(this.viewport.isGlobe?"globe":"mercator")+"-"+this.viewportSeq:"none"}},watch:{"menuToggle.v":{handler(){this.toggle=this.menuToggle.weatherLayers,this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})}},currentModel:{handler(t,e){this.$emit("forecastModel",t),localStorage.setItem("forecastModelCacheGL4",t)},immediate:!0},forecastModel:{handler(t,e){t&&t!==e&&this.handleWeatherLayerChange({sourceChanged:!0})}},map:{handler(){var e,a,r,i;const t=this.map;(a=(e=this.viewport)==null?void 0:e.map)==null||a.off("move",this.handleMove4Weather),(i=(r=this.viewport)==null?void 0:r.cleanup)==null||i.call(r),this.viewport=void 0,t&&(this.viewportSeq+=1,this.projection==="globe"?this.viewport=new eo(t):this.viewport=new to(t),t.once("idle",()=>{this.map===t&&(this.fetchCache(),t.on("move",this.handleMove4Weather),this.handleRampColorInitial())}),t.triggerRepaint())},immediate:!0},projection:{handler(t,e){var a,r;!t||t===e||!this.map||!this.viewport||((r=(a=this.viewport)==null?void 0:a.cleanup)==null||r.call(a),this.viewportSeq+=1,t==="globe"?this.viewport=new eo(this.map):this.viewport=new to(this.map),this.handleRampColorInitial(),this.handleMove4Weather(),this.map.triggerRepaint())}},realTime:{handler(t,e){t&&e&&_(t).utc().format("yyyy-MM-DD HH")!==_(e).utc().format("yyyy-MM-DD HH")&&this.$nextTick(()=>{this.fetchWeatherLayers()})},immediate:!0},renderKey:{handler(t,e){if(t&&t!==e){const a=this.checkList.filter(r=>!this.rendersKeys.some(i=>i===r));t==="ice-forecast"?(this.iceToggleValue=this.iceToggleValue||"ice-cover",this.checkList=[...a,"ice-forecast",this.iceToggleValue||"ice-cover"]):this.checkList=[...a,t]}else!t&&e&&(this.checkList=this.checkList.filter(a=>a!==e))}},checkList:{handler(t,e){var a,r,i,l,n,s;this.handleCheckListChange(t,e),this.$emit("weatherCheckList",t),this.autoActive&&this.checkList.length?(i=(r=(a=this.$parent)==null?void 0:a.$refs)==null?void 0:r.idmBottomBar)==null||i.handleToggle("weather",!0):(s=(n=(l=this.$parent)==null?void 0:l.$refs)==null?void 0:n.idmBottomBar)==null||s.handleToggle("weather",!1)}},autoActive:{handler(t){var e,a,r,i,l,n;localStorage.setItem(this.cache.autoActiveKey,this.autoActive),this.activeWeatherLayers=this.autoActive?this.allLayers.filter(s=>this.checkList.includes(s.key)):[],this.handleWeatherLayerChange(),this.autoActive&&this.checkList.length?(r=(a=(e=this.$parent)==null?void 0:e.$refs)==null?void 0:a.idmBottomBar)==null||r.handleToggle("weather",!0):(n=(l=(i=this.$parent)==null?void 0:i.$refs)==null?void 0:l.idmBottomBar)==null||n.handleToggle("weather",!1),this.$emit("autoActive",this.autoActive)}},iceToggleValue:{handler(t){if(t){const e=this.checkList.filter(a=>!this.rendersKeys.some(r=>r===a));this.checkList=[...e,"ice-forecast",this.iceToggleValue]}}},showWindParticle:{handler(t){let e="wind-particle";this.weatherLayers[e]&&(this.weatherLayers[e].particle=t,this.weatherLayers[e].version=Math.random()+1)}},showCurrentParticle:{handler(t){let e="current-particle";this.weatherLayers[e]&&(this.weatherLayers[e].particle=t,this.weatherLayers[e].version=Math.random()+1)}},showSigWaveParticle:{handler(t){const e=this.weatherLayers["sig-wave-particle"];e&&(e.particle=t)}},showSwellParticle:{handler(t){const e=this.weatherLayers["swell-particle"];e&&(e.particle=t)}},isLogin:{handler(t){t?this.fetchModels():this.models={}},immediate:!0}},mounted(){this.fetchModels()},beforeUnmount(){var t,e,a,r;(e=(t=this.viewport)==null?void 0:t.map)==null||e.off("move",this.handleMove4Weather),(r=(a=this.viewport)==null?void 0:a.cleanup)==null||r.call(a),this.viewport=void 0},methods:{arraysEqual(t,e){if((t==null?void 0:t.length)!==(e==null?void 0:e.length))return!1;for(let a=0;a<(t==null?void 0:t.length);a++)if((t==null?void 0:t[a])!==(e==null?void 0:e[a]))return!1;return!0},normalizeWaveSelection(t){const e=t.map(a=>a==="sig-wave"?"sig-wave-particle":a==="swell"?"swell-particle":a);return[...new Set(e)].filter(a=>this.allLayers.some(r=>r.key===a))},fetchCache(){const t=localStorage.getItem(this.cache.versionKey);this.cache.v!==t&&(localStorage.removeItem(this.cache.autoActiveKey),localStorage.removeItem(this.cache.checkListKey),localStorage.setItem(this.cache.versionKey,this.cache.v));let e=localStorage.getItem(this.cache.autoActiveKey);this.autoActive=e!=="false",localStorage.setItem(this.cache.autoActiveKey,this.autoActive),e=localStorage.getItem(this.cache.checkListKey);const a=JSON.parse(e||JSON.stringify(["wind","sig-wave-height"]));this.iceToggleValue=a.includes("ice-thickness")?"ice-thickness":void 0,this.checkList=this.normalizeWaveSelection(a),this.renderKey=this.checkList.find(r=>this.rendersKeys.includes(r))||"",localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList))},handleMenuToggle(){this.$emit("menuToggle","weatherLayers")},handleFastWeatherToggle(t){let e=[];this.checkList.includes(t)?e=this.checkList.filter(a=>a!==t):(e=[...this.checkList,t],this.checkList=e),this.handleCheckListChange(e,this.checkList)},handleCheckListChange(t,e){if(this.arraysEqual(t,e))return this.handleMove4Weather(),!1;const a=[...new Set(t)],r=a==null?void 0:a.filter(n=>!(e!=null&&e.includes(n)))[0],i=e==null?void 0:e.filter(n=>!(a!=null&&a.includes(n)))[0],l=this.checkList.filter(n=>!this.rendersKeys.some(s=>s===n));if(r)if(r==="ice-cover"||r==="ice-thickness"||r==="ice-forecast")this.checkList=[...l,"ice-forecast",this.iceToggleValue||"ice-cover"],this.iceToggleValue=this.iceToggleValue||"ice-cover";else if(this.rendersKeys.includes(r))this.checkList=[...l,r];else{const n=a.filter(c=>!this.rendersKeys.includes(c)),s=this.checkList.filter(c=>this.rendersKeys.includes(c));this.checkList=[...n,...s]}i&&(i==="ice-forecast"?(this.checkList=a.filter(n=>!["ice-cover","ice-thickness","ice-forecast"].includes(n)),this.iceToggleValue=void 0):this.checkList=a),this.checkList.includes("wind-particle")&&!(e!=null&&e.includes("wind-particle"))&&(this.showWindParticle=!0),this.checkList.includes("current-particle")&&!(e!=null&&e.includes("current-particle"))&&(this.showCurrentParticle=!0),this.checkList.includes("sig-wave-particle")&&!(e!=null&&e.includes("sig-wave-particle"))&&(this.showSigWaveParticle=!0),this.checkList.includes("swell-particle")&&!(e!=null&&e.includes("swell-particle"))&&(this.showSwellParticle=!0),localStorage.setItem(this.cache.checkListKey,JSON.stringify(a)),this.activeWeatherLayers=this.autoActive?this.allLayers.filter(n=>a.includes(n.key)):[],this.handleWeatherLayerChange()},async fetchModels(){this.models={};const t=await de.get(`${this.gateway}/api/arc/meteo2/models2`,{headers:{Authorization:this.defaultMeteoToken}});(t==null?void 0:t.data.code)===0&&(this.models=t==null?void 0:t.data.data)},async fetchWeatherLayers(t={}){var r,i,l,n,s,c,m,d,g;const e=new Date().valueOf();let a=0;if(this.map){const u=((r=this.map)==null?void 0:r.getZoom())+1,y=(i=this.map)==null?void 0:i.getBounds(),p=`${y._sw.lng},${y._sw.lat},${y._ne.lng},${y._ne.lat}`;if(this.particleFactor&&((l=this.$refs.layer)!=null&&l.autoActive)){const h=ho.LayerHelper.WEATHER_LAYERS.find(f=>{var x;return((x=f.peer)==null?void 0:x.weight)===this.particleFactor.weight});this.particleFactor.particle&&(this.showWindParticle||this.showCurrentParticle)?this.weatherWeight=this.weatherWeight&h.weight?this.weatherWeight:this.weatherWeight+h.weight:this.weatherWeight=this.weatherWeight&h.weight?this.weatherWeight-h.weight:this.weatherWeight}if(this.weatherWeight>0){let h=this.weatherWeight;if(h>0){const f=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],x=await de.get(`${f}/api/arc/weather/layers2/links?l=${h}&v=${this.forecastModel}&z=${u}&bbox=${p}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(new Date().valueOf()-(e+a),((n=x==null?void 0:x.data)==null?void 0:n.code)===0){const v=(s=x==null?void 0:x.data)==null?void 0:s.data,b=[];for(const A in v)b.push(de.get(v[A],{headers:{Authorization:this.defaultMeteoToken,key:A},responseType:/\.(jpg|png)$/.test(v[A])?"blob":"json"}).catch(L=>{console.log(`[${A}] fetch layer error: ${L}`)}));const k=await Promise.all(b);this.weatherLayers={},k.map(A=>{var z,M,T,N;const L=((z=A==null?void 0:A.data)==null?void 0:z.data)||(A==null?void 0:A.data);let C=(T=(M=A==null?void 0:A.config)==null?void 0:M.headers)==null?void 0:T.key;C==="sig-wave"&&(C="sig-wave-particle"),C==="swell"&&(C="swell-particle"),C&&L&&(this.weatherLayers[C]={raw:L,type:((N=A==null?void 0:A.config)==null?void 0:N.responseType)==="blob"?"image":"json",etime:x.data.etime})})}if(new Date().valueOf()-(e+a),this.weatherLayers["current-direction"]||this.weatherLayers["current-speed"]){const v=(c=this.weatherLayers["current-direction"])==null?void 0:c.raw,b=(m=this.weatherLayers["current-speed"])==null?void 0:m.raw;delete this.weatherLayers["current-direction"],delete this.weatherLayers["current-speed"],this.weatherLayers.current={type:"json",direction:v,speed:{raw:b},etime:x.data.etime}}if(this.weatherLayers["swell-direction"]||this.weatherLayers["swell-height"]){const v=(d=this.weatherLayers["swell-direction"])==null?void 0:d.raw,b=(g=this.weatherLayers["swell-height"])==null?void 0:g.raw;delete this.weatherLayers["swell-direction"],delete this.weatherLayers["swell-height"],this.weatherLayers["swell-direction-contour"]={type:"json",direction:v,height:{raw:b},etime:x.data.etime}}}}this.handleWeatherLayerToggle(),this.handleDrawWeather4Json(),this.$nextTick(()=>{var h,f,x,v,b;(b=(v=(x=(f=(h=this.$parent)==null?void 0:h.$refs)==null?void 0:f.idmBottomBar)==null?void 0:x.$refs)==null?void 0:v.capture)==null||b.captureCurrentFrame()})}},handleWeatherLayerToggle(){for(const t in this.weatherLayers)this.weatherLayers[t].active=!1,this.weatherLayers[t].version=Math.random()+1;for(const t of this.activeWeatherLayers){let e=t.key;e==="current-direction"&&(e="current"),this.weatherLayers[e]&&(this.weatherLayers[e].active=!0,this.weatherLayers[e].version=Math.random()+1,e==="wind-particle"&&(this.weatherLayers[e].particle=this.showWindParticle),e==="current-particle"&&(this.weatherLayers[e].particle=this.showCurrentParticle),e==="sig-wave-particle"&&(this.weatherLayers[e].particle=this.showSigWaveParticle),e==="swell-particle"&&(this.weatherLayers[e].particle=this.showSwellParticle))}},handleWeatherLayerChange(t={sourceChanged:!1}){var a;const e=(a=this.activeWeatherLayers)==null?void 0:a.reduce((r,i)=>r+(r&(i==null?void 0:i.weight)?0:i==null?void 0:i.weight),0);t!=null&&t.sourceChanged||this.weatherWeight!==e?(this.weatherWeight=e,this.fetchWeatherLayers()):this.handleWeatherLayerToggle()},handleRampColorInitial(){var t,e,a,r,i,l,n,s,c,m,d,g,u;if((t=this.viewport)!=null&&t.isGlobe){this.viewport.initGlobeLayers(this.beforeLayer),this.$emit("rampLayersReady");return}this.viewport.map.getSource((e=this.viewport)==null?void 0:e.rampColorSource)||this.viewport.map.addSource((a=this.viewport)==null?void 0:a.rampColorSource,{type:"canvas",canvas:(r=this.viewport)==null?void 0:r.rampColorCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((i=this.viewport)==null?void 0:i.rampColorLayer)||this.viewport.map.addLayer({type:"raster",id:(l=this.viewport)==null?void 0:l.rampColorLayer,source:(n=this.viewport)==null?void 0:n.rampColorSource,layout:{visibility:"none"},paint:{"raster-fade-duration":0}},this.beforeLayer),this.viewport.map.getSource((s=this.viewport)==null?void 0:s.particleSource)||this.viewport.map.addSource((c=this.viewport)==null?void 0:c.particleSource,{type:"canvas",canvas:(m=this.viewport)==null?void 0:m.particleCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((d=this.viewport)==null?void 0:d.particleLayer)||this.viewport.map.addLayer({type:"raster",id:(g=this.viewport)==null?void 0:g.particleLayer,source:(u=this.viewport)==null?void 0:u.particleSource,layout:{visibility:"none"},paint:{"raster-fade-duration":0}},this.beforeLayer),this.$emit("rampLayersReady")},handleDrawWeather4Json(){var l,n,s,c,m,d,g;const t=new Date().valueOf();let e=0,a=0;const r=(l=this.map)==null?void 0:l.getBounds(),i=(n=this.map)==null?void 0:n.getZoom();if(r&&i){const u=P.LngLatHelper.convertToStdLng(r._sw.lng),y=P.LngLatHelper.convertToStdLng(r._ne.lng),p=Math.floor(r._sw.lat),h=Math.ceil(r._ne.lat);for(const f in this.weatherLayers){let x=!1;if(this.weatherLayers[f].active&&this.weatherLayers[f].type==="json"){let v=[];if(f==="current"){x=!0;const b=((s=this.weatherLayers[f])==null?void 0:s.direction)||{};for(const A in b)if(A>p&&A<h&&(!(i<=this.zoom)||A%(i<2?10:i<4?5:3)===0)){const L=b[A].lng;u>y?L.forEach((C,z)=>{var M,T,N,F,O,q;if(i<2){if((C>=0&&C<=360||C>=-360&&C<=0)&&C%10===0){const $=E.point([C,A],{val:((M=b[A].val)==null?void 0:M[z])||((T=b[A].dir)==null?void 0:T[z]),spd:(N=b[A].spd)==null?void 0:N[z]});v.push($)}}else if((C>=u&&C<=180||C>=-180&&C<=y)&&(!(i<=this.zoom)||C%(i<2?10:i<4?5:3)===0)){const $=E.point([C,A],{val:((F=b[A].val)==null?void 0:F[z])||((O=b[A].dir)==null?void 0:O[z]),spd:(q=b[A].spd)==null?void 0:q[z]});v.push($)}}):L.forEach((C,z)=>{var M,T,N,F,O,q;if(u<2){if((C>=0&&C<=360||C>=-360&&C<=0)&&C%10===0){const $=E.point([C,A],{val:((M=b[A].val)==null?void 0:M[z])||((T=b[A].dir)==null?void 0:T[z]),spd:(N=b[A].spd)==null?void 0:N[z]});v.push($)}}else if(C>=u&&C<=y&&(!(i<=this.zoom)||C%(i<this.zoom/2?5:3)===0)){const $=E.point([C,A],{val:((F=b[A].val)==null?void 0:F[z])||((O=b[A].dir)==null?void 0:O[z]),spd:(q=b[A].spd)==null?void 0:q[z]});v.push($)}})}a=new Date().valueOf()-(t+e);const k=this.weatherLayers[f].speed;if(k){if(!k.data){const L=[];for(const C in(c=k.raw)==null?void 0:c.Polygon){const z=k.raw.Polygon[C];for(const M of z)L.push(E.polygon(M,{val:Number(C)}))}k.data=E.featureCollection(L)}const A=i<this.zoom?k.data.features.filter(L=>L.properties.val>.5):k.data.features;v=v.concat(A),a=new Date().valueOf()-(t+e)}}else if(f==="wind"){x=!0;const b=this.weatherLayers.wind.raw;for(const k in b)if(k>p&&k<h&&(!(i<=this.zoom)||k%(i<2?10:i<4?5:3)===0)){const A=b[k].lng;u>y?A.forEach((L,C)=>{var z,M,T,N;if(i<2){if((L>=0&&L<=360||L>=-360&&L<=0)&&L%10===0){const F=E.point([L,k],{dir:((z=b[k].val)==null?void 0:z[C])||((M=b[k].dir)==null?void 0:M[C]),spd:b[k].spd[C]});v.push(F)}}else if((L>=u&&L<=180||L>=-180&&L<=y)&&(!(i<=this.zoom)||L%(i<2?10:i<4?5:3)===0)){const F=E.point([L,k],{dir:((T=b[k].val)==null?void 0:T[C])||((N=b[k].dir)==null?void 0:N[C]),spd:b[k].spd[C]});v.push(F)}}):A.forEach((L,C)=>{var z,M,T,N;if(i<2){if((L>=0&&L<=360||L>=-360&&L<=0)&&L%10===0){const F=E.point([L,k],{dir:((z=b[k].val)==null?void 0:z[C])||((M=b[k].dir)==null?void 0:M[C]),spd:b[k].spd[C]});v.push(F)}}else if(L>=u&&L<=y&&(!(i<=this.zoom)||L%(i<2?10:i<4?5:3)===0)){const F=E.point([L,k],{dir:((T=b[k].val)==null?void 0:T[C])||((N=b[k].dir)==null?void 0:N[C]),spd:b[k].spd[C]});v.push(F)}})}a=new Date().valueOf()-(t+e)}else if(f==="sig-wave-height"){if(this.weatherLayers[f].data)v=this.weatherLayers[f].data;else{x=!0;const b=this.weatherLayers[f].raw;if(b){const k=[];for(const A in b.Polygon){const L=b.Polygon[A];for(const C of L)k.push(E.polygon(C,{val:Number(A)}))}for(const A in b.MultiPolygon){const L=b.MultiPolygon[A];for(const C of L)k.push(E.multiPolygon(C,{val:Number(A)}))}for(const A in b.Point){const L=b.Point[A];for(let C=0;C<((m=L.lng)==null?void 0:m.length);C++)k.push(E.point([L.lng[C],A],{val:Number(L.val[C])}))}v=v.concat(k)}}a=new Date().valueOf()-(t+e)}else if(f==="prmsl"){if(this.weatherLayers[f].data)v=this.weatherLayers[f].data;else{x=!0;const b=this.weatherLayers[f].raw;if(b){const k=[];for(const A in b.LineString){const L=b.LineString[A];for(const C of L)k.push(E.lineString(C,{val:Number(A)}))}for(const A in b.Point)b.Point[A].lng.forEach((L,C)=>{L=P.LngLatHelper.convertToStdLng(L),k.push(E.point([L,A],{val:b.Point[A].val[C],type:b.Point[A].type[C]}))});v=v.concat(k)}}a=new Date().valueOf()-(t+e)}else if(f==="swell-direction-contour"){x=!0;const b=((d=this.weatherLayers[f])==null?void 0:d.direction)||{};for(const A in b)if(A>p&&A<h&&(!(i<=this.zoom)||A%(i<2?10:i<4?5:3)===0)){const L=b[A].lng;u>y?L.forEach((C,z)=>{var M,T,N,F,O,q;if(i<2){if((C>=0&&C<=360||C>=-360&&C<=0)&&C%10===0){const $=E.point([C,A],{val:((M=b[A].val)==null?void 0:M[z])||((T=b[A].dir)==null?void 0:T[z]),spd:(N=b[A].spd)==null?void 0:N[z]});v.push($)}}else if((C>=u&&C<=180||C>=-180&&C<=y)&&(!(i<=this.zoom)||C%(i<2?10:i<4?5:3)===0)){const $=E.point([C,A],{val:((F=b[A].val)==null?void 0:F[z])||((O=b[A].dir)==null?void 0:O[z]),spd:(q=b[A].spd)==null?void 0:q[z]});v.push($)}}):L.forEach((C,z)=>{var M,T,N,F,O,q;if(u<2){if((C>=0&&C<=360||C>=-360&&C<=0)&&C%10===0){const $=E.point([C,A],{val:((M=b[A].val)==null?void 0:M[z])||((T=b[A].dir)==null?void 0:T[z]),spd:(N=b[A].spd)==null?void 0:N[z]});v.push($)}}else if(C>=u&&C<=y&&(!(i<=this.zoom)||C%(i<2?10:i<4?5:3)===0)){const $=E.point([C,A],{val:((F=b[A].val)==null?void 0:F[z])||((O=b[A].dir)==null?void 0:O[z]),spd:(q=b[A].spd)==null?void 0:q[z]});v.push($)}})}a=new Date().valueOf()-(t+e),console.log("swell direction elapsed: ",a,", total: ",e+=a);const k=this.weatherLayers[f].height;if(k){if(!k.data){const A=[];for(const L in(g=k.raw)==null?void 0:g.LineString){const C=k.raw.LineString[L];for(const z of C)A.push(E.lineString(z,{val:Number(L)}));k.data=E.featureCollection(A)}}if(k.data){const A=this.handleBboxClip(k.data,r);v=v.concat(A)}a=new Date().valueOf()-(t+e),console.log("swell height elapsed: ",a,", total: ",e+=a)}}v.length&&(this.weatherLayers[f].data=E.featureCollection(v)),x&&(this.weatherLayers[f].version=Math.random()+1)}}}},handleBboxClip(t,e){const a=[],r=P.LngLatHelper.convertToStdLng(e._sw.lng),i=P.LngLatHelper.convertToStdLng(e._ne.lng);return t.features.forEach(l=>{if(l.geometry.type!=="Point")if(r>i){let n=[r,e._sw.lat,180,e._ne.lat],s=E.bboxClip(l,n);s.geometry.coordinates.length&&a.push(s),n=[-180,e._sw.lat,i,e._ne.lat],s=E.bboxClip(l,n),s.geometry.coordinates.length&&a.push(s)}else{const n=[r,e._sw.lat,i,e._ne.lat],s=E.bboxClip(l,n);s.geometry.coordinates.length&&a.push(s)}else a.push(l)}),a},handleMove4Weather(){for(const t in this.weatherLayers)this.weatherLayers[t].active&&this.weatherLayers[t].type==="image"&&(this.weatherLayers[t].active=!0,this.weatherLayers[t].version=Math.random()+1);this.handleDrawWeather4Json()}}},Um={class:"idm-gl4-meteo-layers"},Jm={key:0,class:"legend-tip-btn-gl4"},Km={class:"d-flex flex-row justify-start align-center flex-wrap text-body-2"},Qm={class:"d-flex flex-row justify-center align-center"},qm={class:"text-caption"},$m={class:"d-flex flex-row justify-start align-center flex-wrap text-body-2"},ed={class:"d-flex flex-row justify-center align-center"},td={key:0,style:{width:"24px",height:"12px",border:"1px solid rgba(var(--v-border-color), var(--v-border-opacity))"}},od={class:"text-caption px-2"},ad={class:"d-flex flex-row justify-start align-start flex-wrap text-body-2 ml-n1"},id={class:"d-flex flex-row justify-start align-center"},rd={class:"d-flex flex-row justify-center align-center",style:{width:"40px"}},ld={class:"text-caption"},nd={class:"d-flex justify-start align-center ga-3"},sd={class:"text-h5 font-weight-medium"},cd={key:0,class:"w-100 d-flex justify-space-between align-center ga-1 mb-2 px-3"},md={key:0,class:"d-flex justify-start align-center ga-4 pl-6"},dd={key:1,class:"d-flex justify-start align-center ga-4 pl-6"},hd={key:2,class:"d-flex justify-start align-center ga-4 pl-6"},pd={key:3,class:"d-flex justify-start align-center ga-4 pl-6"},ud={class:"text-body-1 py-2"},gd={class:"text-body-1 font-weight-medium"},fd={class:"text-body-2 text-label"},yd={class:"text-body-2 text-label"},bd={class:"text-body-2 text-label mb-3"},wd={class:"text-body-1 font-weight-medium"},xd={class:"text-body-2 text-label"},kd={class:"text-body-2 text-label"},Ad={class:"text-body-2 text-label mb-3"},Ld={class:"text-body-1 py-2"},vd={class:"text-body-1 font-weight-medium"},Cd={class:"text-body-2 text-label"},_d={class:"text-body-2 text-label"},zd={class:"text-body-2 text-label mb-3"},Sd={class:"text-body-1 font-weight-medium"},Pd={class:"text-body-2 text-label"},Md={class:"text-body-2 text-label"},Td={class:"text-body-2 text-label mb-3"},Nd={class:"text-body-1 py-2"},Ed={class:"text-body-1 font-weight-medium"},Vd={class:"text-body-2 text-label"},Rd={class:"text-body-2 text-label"},Dd={class:"text-body-2 text-label mb-3"};function Bd(t,e,a,r,i,l){var S,Z,H,te,W,I,K,V,Y,ee,he,ge,re,ue,ye,ze;const n=o.resolveComponent("VBtn"),s=o.resolveComponent("VTooltip"),c=o.resolveComponent("VCardText"),m=o.resolveComponent("VDivider"),d=o.resolveComponent("VCard"),g=o.resolveComponent("VSwitch"),u=o.resolveComponent("VBtnToggle"),y=o.resolveComponent("VCardTitle"),p=o.resolveComponent("VCardItem"),h=o.resolveComponent("VCheckbox"),f=o.resolveComponent("VRadio"),x=o.resolveComponent("IdmWindBarb"),v=o.resolveComponent("IdmSigWaveHeight"),b=o.resolveComponent("IdmCurrentDirection"),k=o.resolveComponent("IdmSwellDirection"),A=o.resolveComponent("IdmPrmsl"),L=o.resolveComponent("IdmWindParticle"),C=o.resolveComponent("IdmCurrentParticle"),z=o.resolveComponent("IdmSigWaveParticle"),M=o.resolveComponent("IdmSwellParticle"),T=o.resolveComponent("IdmIceEdge"),N=o.resolveComponent("IdmIceCover"),F=o.resolveComponent("IdmIceThickness"),O=o.resolveComponent("IdmPrecip3h"),q=o.resolveComponent("IdmVisibility"),$=o.resolveComponent("IdmWaterTemp"),le=o.resolveComponent("IdmTemp");return o.openBlock(),o.createElementBlock("div",Um,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+46+"px",right:i.right+"px"})},[o.createVNode(s,{text:t.$t("weather.weatherLayers"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:J})=>[o.createVNode(n,o.mergeProps(J,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>e[10]||(e[10]=[o.createElementVNode("i",{class:"iconfont icon-Weather text-h4"},null,-1)])),_:2,__:[10]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4),l.showTipMenu?(o.openBlock(),o.createElementBlock("div",Jm,[o.createElementVNode("div",{class:o.normalizeClass(["menu-bar-box pa-1 rounded",a.simple?"simple":""]),style:o.normalizeStyle({right:i.right+"px",top:a.simple?"426px":l.lengendTipTop+"px"})},[o.createVNode(s,{text:t.$t("weather.legend"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:J})=>[o.createVNode(n,o.mergeProps(J,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.legendToggle?"bg-primary active-border":""],onClick:e[0]||(e[0]=ne=>i.legendToggle=!i.legendToggle)}),{default:o.withCtx(()=>e[11]||(e[11]=[o.createElementVNode("i",{class:"iconfont icon-Legend text-h4"},null,-1)])),_:2,__:[11]},1040,["class"])]),_:1},8,["text","open-on-focus","open-on-hover"])],6),i.legendToggle?(o.openBlock(),o.createBlock(d,{key:0,elevation:"16",class:"card-info d-flex justify-center align-start",style:o.normalizeStyle({position:"absolute",top:a.simple?"200px":"340px",right:i.right+50+"px"})},{default:o.withCtx(()=>[o.createVNode(c,{class:"d-flex flex-column justify-center align-start text-label px-1",style:{width:"120px"}},{default:o.withCtx(()=>[e[12]||(e[12]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2 mx-1"},"Wind Level",-1)),o.createElementVNode("div",Km,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.barbs,(J,ne)=>(o.openBlock(),o.createElementBlock("div",{key:J,class:"w-50 d-flex flex-row justify-start align-center py-1 px-0 ma-0"},[o.createElementVNode("div",Qm,[o.createElementVNode("i",{class:o.normalizeClass(["iconfont",l.barbsIconName[ne]]),style:o.normalizeStyle({color:a.theme==="dark"?"#fff":"#000"})},null,6),o.createElementVNode("span",qm,o.toDisplayString(Number(J)<10?`00${J}kts`:Number(J)<100?`0${J}kts`:`${J}kts`),1)])]))),128))])]),_:1,__:[12]}),o.createVNode(m,{vertical:""}),o.createVNode(c,{class:"d-flex flex-column justify-center align-start text-label px-2",style:{width:"100px"}},{default:o.withCtx(()=>[e[13]||(e[13]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2"},"Wave Height",-1)),o.createElementVNode("div",$m,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.sigWaveHeight,(J,ne)=>(o.openBlock(),o.createElementBlock("div",{key:ne,class:"w-100 d-flex flex-row justify-start align-center py-1 px-0 ma-0"},[o.createElementVNode("div",ed,[ne===0?(o.openBlock(),o.createElementBlock("div",td)):(o.openBlock(),o.createElementBlock("div",{key:1,style:o.normalizeStyle({width:"24px",height:"12px",background:J.color})},null,4)),o.createElementVNode("div",od,o.toDisplayString(J.label),1)])]))),128))])]),_:1,__:[13]}),o.createVNode(m,{vertical:""}),o.createVNode(c,{class:"d-flex flex-column justify-center align-start text-label pl-0 pr-2",style:{width:"100px"}},{default:o.withCtx(()=>[e[14]||(e[14]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2 mx-2"},"Current",-1)),o.createElementVNode("div",ad,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.current,(J,ne)=>(o.openBlock(),o.createElementBlock("div",{key:ne,class:"w-100 d-flex flex-row justify-center align-center py-1 px-0 ma-0"},[o.createElementVNode("div",id,[o.createElementVNode("div",rd,[o.createElementVNode("i",{class:"iconfont icon-a-direction-arrow text-label",style:o.normalizeStyle({fontSize:40*J.size+"px"})},null,4)]),o.createElementVNode("div",ld,o.toDisplayString(J.label),1)])]))),128))])]),_:1,__:[14]})]),_:1},8,["style"])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["available-layers transition d-flex flex-column justify-start align-start",i.toggle?"right-bar":""]),style:o.normalizeStyle(l.listStyle)},[o.createElementVNode("div",{class:o.normalizeClass(["header-box w-100 d-flex justify-space-between align-center",a.simple?"px-3":"px-4"])},[o.createElementVNode("div",nd,[o.createElementVNode("div",sd,o.toDisplayString(t.$t("weather.weather")),1),o.createVNode(g,{modelValue:i.autoActive,"onUpdate:modelValue":e[1]||(e[1]=J=>i.autoActive=J),class:"small-switch",color:"primary","base-color":"disabled",inset:"","hide-details":""},null,8,["modelValue"])]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleMenuToggle},{default:o.withCtx(()=>e[15]||(e[15]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[15]},8,["onClick"])],2),a.simple?(o.openBlock(),o.createElementBlock("div",cd,[o.createElementVNode("div",null,o.toDisplayString(t.$t("weather.forecastModel")),1),o.createVNode(u,{modelValue:i.currentModel,"onUpdate:modelValue":e[2]||(e[2]=J=>i.currentModel=J),rounded:"",height:"28",density:"compact",mandatory:"",group:""},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"28",value:"GFS",class:"text-none btn-bg-2 px-1 text-body-1 mt-1",color:i.currentModel==="GFS"?"primary":"","base-color":""},{default:o.withCtx(()=>e[16]||(e[16]=[o.createTextVNode(" NOAA ",-1)])),_:1,__:[16]},8,["color"]),o.createVNode(n,{density:"compact",height:"28",class:"text-none btn-bg-2 px-1 text-body-1 mt-1",color:i.currentModel==="ECMWF"?"primary":"","base-color":"",value:"ECMWF"},{default:o.withCtx(()=>e[17]||(e[17]=[o.createTextVNode(" ECMWF ",-1)])),_:1,__:[17]},8,["color"])]),_:1},8,["modelValue"])])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["list-box w-100 scroll overflow-y-auto",[i.autoActive?"":"cursor-not-allowed",a.simple?"px-3":"pl-4 pr-2"]])},[o.createVNode(d,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(p,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(y,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.overlays")),1)]),_:1})]),_:1}),o.createVNode(c,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(J=>J.overlays),J=>(o.openBlock(),o.createBlock(h,{key:J.key,modelValue:i.checkList,"onUpdate:modelValue":e[3]||(e[3]=ne=>i.checkList=ne),value:J.key,label:t.$t(`weather.${J.locale}`),disabled:!i.autoActive,color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label","disabled"]))),128))]),_:1})]),_:1}),o.createVNode(d,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(p,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(y,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.renders")),1)]),_:1})]),_:1}),o.createVNode(c,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(J=>!J.overlays),J=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:J.key},[o.createVNode(f,{modelValue:i.renderKey,"onUpdate:modelValue":e[4]||(e[4]=ne=>i.renderKey=ne),label:t.$t(`weather.${J.locale}`),value:J.key,disabled:!i.autoActive,color:"primary",density:"compact",style:{height:"36px"},class:"text-body-2 py-1","hide-details":"",onClick:ne=>i.renderKey=i.renderKey===J.key?"":J.key},null,8,["modelValue","label","value","disabled","onClick"]),i.renderKey==="wind-particle"&&J.key==="wind-particle"?(o.openBlock(),o.createElementBlock("div",md,[o.createElementVNode("span",null,o.toDisplayString(t.$t("weather.particleAnimatiom")),1),o.createVNode(g,{modelValue:i.showWindParticle,"onUpdate:modelValue":e[5]||(e[5]=ne=>i.showWindParticle=ne),label:"",class:"small-switch",color:"primary","base-color":"disabled",density:"compact",inset:"",style:{"font-size":"14px"},"hide-details":""},null,8,["modelValue"])])):o.createCommentVNode("",!0),i.renderKey==="current-particle"&&J.key==="current-particle"?(o.openBlock(),o.createElementBlock("div",dd,[o.createElementVNode("span",null,o.toDisplayString(t.$t("weather.particleAnimatiom")),1),o.createVNode(g,{modelValue:i.showCurrentParticle,"onUpdate:modelValue":e[6]||(e[6]=ne=>i.showCurrentParticle=ne),label:"",class:"small-switch",color:"primary","base-color":"disabled",inset:"",density:"compact",height:"20","hide-details":""},null,8,["modelValue"])])):o.createCommentVNode("",!0),i.renderKey==="sig-wave-particle"&&J.key==="sig-wave-particle"?(o.openBlock(),o.createElementBlock("div",hd,[o.createElementVNode("span",null,o.toDisplayString(t.$t("weather.particleAnimatiom")),1),o.createVNode(g,{modelValue:i.showSigWaveParticle,"onUpdate:modelValue":e[7]||(e[7]=ne=>i.showSigWaveParticle=ne),class:"small-switch",color:"primary","base-color":"disabled",density:"compact",inset:"","hide-details":"",disabled:!i.autoActive},null,8,["modelValue","disabled"])])):o.createCommentVNode("",!0),i.renderKey==="swell-particle"&&J.key==="swell-particle"?(o.openBlock(),o.createElementBlock("div",pd,[o.createElementVNode("span",null,o.toDisplayString(t.$t("weather.particleAnimatiom")),1),o.createVNode(g,{modelValue:i.showSwellParticle,"onUpdate:modelValue":e[8]||(e[8]=ne=>i.showSwellParticle=ne),class:"small-switch",color:"primary","base-color":"disabled",density:"compact",inset:"","hide-details":"",disabled:!i.autoActive},null,8,["modelValue","disabled"])])):o.createCommentVNode("",!0),i.renderKey==="ice-forecast"&&J.key==="ice-forecast"?(o.openBlock(),o.createBlock(u,{key:4,modelValue:i.iceToggleValue,"onUpdate:modelValue":e[9]||(e[9]=ne=>i.iceToggleValue=ne),class:"w-100 pl-7 rounded",rounded:"0",height:"30",density:"compact",group:"",mandatory:"",disabled:!i.autoActive},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"30",value:"ice-cover",class:"w-50 text-none px-2 text-body-1",color:i.iceToggleValue==="ice-cover"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.coverage")),1)]),_:1},8,["color","disabled"]),o.createVNode(n,{density:"compact",height:"30",class:"w-50 text-none px-2 text-body-1",color:i.iceToggleValue==="ice-thickness"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive,value:"ice-thickness"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.thickness")),1)]),_:1},8,["color","disabled"])]),_:1},8,["modelValue","disabled"])):o.createCommentVNode("",!0)],64))),128))]),_:1})]),_:1}),o.createVNode(d,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(p,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(y,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.forecastModel")),1)]),_:1})]),_:1}),o.createVNode(c,{class:""},{default:o.withCtx(()=>{var J,ne,Fe,Ge,Re,Ce,je,Ne,Ee,De,We,Ze,Be,xe,ke,_e,He,Xe,Oe,Pe,rt,lt,nt,st,ct,mt,dt,ht,pt,ut,gt,ft,yt,bt,wt,xt,kt,At,Lt,vt,Ct,_t,zt,St,Pt,Mt,Tt,Nt,Et,Vt,Rt,Dt,Bt,It,Ft,Gt,jt,Wt,Zt,Me,Ve,Ht,Ye,Xt,et,Ae,Ue,ie,Le,U,X,Je,Ie,Se,G,Ot,oe,ve,Ke,tt,ot,B,Qe,j,qe,Ut,se,io,me,Lo,vo,Co,_o,zo,So,Po,Mo,To,No,Eo,Vo,Ro,Do,Bo,Io;return[o.createElementVNode("div",ud,o.toDisplayString(t.$t("weather.atmospheric")),1),o.createElementVNode("div",gd,o.toDisplayString((Fe=(ne=(J=i.models)==null?void 0:J.weather)==null?void 0:ne.NOAA)==null?void 0:Fe.source)+" "+o.toDisplayString((Ce=(Re=(Ge=i.models)==null?void 0:Ge.weather)==null?void 0:Re.NOAA)==null?void 0:Ce.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((De=(Ee=(Ne=(je=i.models)==null?void 0:je.weather)==null?void 0:Ne.NOAA)==null?void 0:Ee.meta)==null?void 0:De.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",fd,o.toDisplayString(t.$t("weather.source"))+": NOAA",1),o.createElementVNode("div",yd,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((xe=(Be=(Ze=(We=i.models)==null?void 0:We.weather)==null?void 0:Ze.NOAA)==null?void 0:Be.meta)==null?void 0:xe.availabilityTime)),1),o.createElementVNode("div",bd,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((Xe=(He=(_e=(ke=i.models)==null?void 0:ke.weather)==null?void 0:_e.NOAA)==null?void 0:He.meta)==null?void 0:Xe.initialisationTime)),1),o.createElementVNode("div",wd,o.toDisplayString((rt=(Pe=(Oe=i.models)==null?void 0:Oe.weather)==null?void 0:Pe.ECMWF)==null?void 0:rt.source)+" "+o.toDisplayString((st=(nt=(lt=i.models)==null?void 0:lt.weather)==null?void 0:nt.ECMWF)==null?void 0:st.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((ht=(dt=(mt=(ct=i.models)==null?void 0:ct.weather)==null?void 0:mt.ECMWF)==null?void 0:dt.meta)==null?void 0:ht.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",xd,o.toDisplayString(t.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",kd,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((ft=(gt=(ut=(pt=i.models)==null?void 0:pt.weather)==null?void 0:ut.ECMWF)==null?void 0:gt.meta)==null?void 0:ft.availabilityTime)),1),o.createElementVNode("div",Ad,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((xt=(wt=(bt=(yt=i.models)==null?void 0:yt.weather)==null?void 0:bt.ECMWF)==null?void 0:wt.meta)==null?void 0:xt.initialisationTime)),1),o.createVNode(m),o.createElementVNode("div",Ld,o.toDisplayString(t.$t("weather.wave")),1),o.createElementVNode("div",vd,o.toDisplayString((vt=(Lt=(At=(kt=i.models)==null?void 0:kt.marine)==null?void 0:At.wave)==null?void 0:Lt.NOAA)==null?void 0:vt.source)+" "+o.toDisplayString((St=(zt=(_t=(Ct=i.models)==null?void 0:Ct.marine)==null?void 0:_t.wave)==null?void 0:zt.NOAA)==null?void 0:St.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((Et=(Nt=(Tt=(Mt=(Pt=i.models)==null?void 0:Pt.marine)==null?void 0:Mt.wave)==null?void 0:Tt.NOAA)==null?void 0:Nt.meta)==null?void 0:Et.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",Cd,o.toDisplayString(t.$t("weather.source"))+": NOAA",1),o.createElementVNode("div",_d,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((It=(Bt=(Dt=(Rt=(Vt=i.models)==null?void 0:Vt.marine)==null?void 0:Rt.wave)==null?void 0:Dt.NOAA)==null?void 0:Bt.meta)==null?void 0:It.availabilityTime)),1),o.createElementVNode("div",zd,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((Zt=(Wt=(jt=(Gt=(Ft=i.models)==null?void 0:Ft.marine)==null?void 0:Gt.wave)==null?void 0:jt.NOAA)==null?void 0:Wt.meta)==null?void 0:Zt.initialisationTime)),1),o.createElementVNode("div",Sd,o.toDisplayString((Ye=(Ht=(Ve=(Me=i.models)==null?void 0:Me.marine)==null?void 0:Ve.wave)==null?void 0:Ht.ECMWF)==null?void 0:Ye.source)+" "+o.toDisplayString((Ue=(Ae=(et=(Xt=i.models)==null?void 0:Xt.marine)==null?void 0:et.wave)==null?void 0:Ae.ECMWF)==null?void 0:Ue.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((Je=(X=(U=(Le=(ie=i.models)==null?void 0:ie.marine)==null?void 0:Le.wave)==null?void 0:U.ECMWF)==null?void 0:X.meta)==null?void 0:Je.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",Pd,o.toDisplayString(t.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",Md,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((oe=(Ot=(G=(Se=(Ie=i.models)==null?void 0:Ie.marine)==null?void 0:Se.wave)==null?void 0:G.ECMWF)==null?void 0:Ot.meta)==null?void 0:oe.availabilityTime)),1),o.createElementVNode("div",Td,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((B=(ot=(tt=(Ke=(ve=i.models)==null?void 0:ve.marine)==null?void 0:Ke.wave)==null?void 0:tt.ECMWF)==null?void 0:ot.meta)==null?void 0:B.initialisationTime)),1),o.createVNode(m),o.createElementVNode("div",Nd,o.toDisplayString(t.$t("weather.currents")),1),o.createElementVNode("div",Ed,o.toDisplayString((Ut=(qe=(j=(Qe=i.models)==null?void 0:Qe.marine)==null?void 0:j.current)==null?void 0:qe.ECMWF)==null?void 0:Ut.source)+" "+o.toDisplayString((Lo=(me=(io=(se=i.models)==null?void 0:se.marine)==null?void 0:io.current)==null?void 0:me.ECMWF)==null?void 0:Lo.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((So=(zo=(_o=(Co=(vo=i.models)==null?void 0:vo.marine)==null?void 0:Co.current)==null?void 0:_o.ECMWF)==null?void 0:zo.meta)==null?void 0:So.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",Vd,o.toDisplayString(t.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",Rd,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((Eo=(No=(To=(Mo=(Po=i.models)==null?void 0:Po.marine)==null?void 0:Mo.current)==null?void 0:To.ECMWF)==null?void 0:No.meta)==null?void 0:Eo.availabilityTime)),1),o.createElementVNode("div",Dd,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((Io=(Bo=(Do=(Ro=(Vo=i.models)==null?void 0:Vo.marine)==null?void 0:Ro.current)==null?void 0:Do.ECMWF)==null?void 0:Bo.meta)==null?void 0:Io.initialisationTime)),1)]}),_:1})]),_:1})],2)],6),a.map?(o.openBlock(),o.createBlock(x,o.mergeProps({key:1,ref:"windBarb",map:a.map,"map-feather":a.mapFeather,"before-layer":"empty-layer-3",wind:(S=i.weatherLayers)==null?void 0:S.wind},t.$attrs),null,16,["map","map-feather","wind"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(v,o.mergeProps({key:2,map:a.map,"before-layer":"empty-layer-2","sig-wave-height":(Z=i.weatherLayers)==null?void 0:Z["sig-wave-height"]},t.$attrs),null,16,["map","sig-wave-height"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(b,o.mergeProps({key:3,map:a.map,"map-feather":a.mapFeather,"before-layer":"empty-layer-1",current:(H=i.weatherLayers)==null?void 0:H.current},t.$attrs),null,16,["map","map-feather","current"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(k,o.mergeProps({key:4,map:a.map,"map-feather":a.mapFeather,"before-layer":"empty-layer-1",swell:(te=i.weatherLayers)==null?void 0:te["swell-direction-contour"]},t.$attrs,{theme:a.theme}),null,16,["map","map-feather","swell","theme"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(A,o.mergeProps({key:5,map:a.map,"before-layer":"empty-layer-3",prmsl:(W=i.weatherLayers)==null?void 0:W.prmsl},t.$attrs,{theme:a.theme}),null,16,["map","prmsl","theme"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(L,o.mergeProps({key:l.viewportKey,viewport:i.viewport,factor:(I=i.weatherLayers)==null?void 0:I["wind-particle"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(C,o.mergeProps({key:l.viewportKey,viewport:i.viewport,factor:(K=i.weatherLayers)==null?void 0:K["current-particle"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(z,o.mergeProps({key:l.viewportKey,viewport:i.viewport,factor:(V=i.weatherLayers)==null?void 0:V["sig-wave-particle"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(M,o.mergeProps({key:l.viewportKey,viewport:i.viewport,factor:(Y=i.weatherLayers)==null?void 0:Y["swell-particle"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(T,o.mergeProps({key:l.viewportKey,viewport:i.viewport,factor:(ee=i.weatherLayers)==null?void 0:ee["ice-edge"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(N,o.mergeProps({key:l.viewportKey,viewport:i.viewport,factor:(he=i.weatherLayers)==null?void 0:he["ice-cover"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(F,o.mergeProps({key:l.viewportKey,viewport:i.viewport,factor:(ge=i.weatherLayers)==null?void 0:ge["ice-thickness"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(O,o.mergeProps({key:l.viewportKey,viewport:i.viewport,factor:(re=i.weatherLayers)==null?void 0:re.precip3h,"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(q,o.mergeProps({key:l.viewportKey,viewport:i.viewport,factor:(ue=i.weatherLayers)==null?void 0:ue.visibility,"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock($,o.mergeProps({key:l.viewportKey,viewport:i.viewport,factor:(ye=i.weatherLayers)==null?void 0:ye["water-temp"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(le,o.mergeProps({key:l.viewportKey,viewport:i.viewport,factor:(ze=i.weatherLayers)==null?void 0:ze.temp,"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0)])}const Id=Q(Ym,[["render",Bd]]),fo=[{rank:0,name:"Best Match",alias:"BEST MATCH",model:"best_match",models:["best_match"]},{rank:1,name:"GFS",alias:"GFS",model:"gfs_seamless",provider:"NOAA",country:"United States",resolution:25,tips:"3-25km",length:16,frequency:1,models:["gfs_seamless"],categories:"ncep_gfs013,ncep_gfs025,ncep_gfs_graphcast025,ncep_hrrr_conus,ncep_nbm_conus",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:2,name:"ECMWF",alias:"ECMWF",model:"ecmwf_ifs025",provider:"ECMWF",country:"European Union",resolution:25,tips:"25km",length:15,frequency:6,models:["ecmwf_ifs025","ecmwf_aifs025_single","ecmwf_ifs"],categories:"ecmwf_ifs025,ecmwf_aifs025_single,ecmwf_ifs",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:3,disabled:!0,name:"ICON",alias:"ECMWF",model:"icon_seamless",provider:"Deutscher Wetterdienst (DWD)",country:"Germany",resolution:13,tips:"2-13km",length:7.5,frequency:3,models:["icon_seamless","icon_global","icon_eu","icon_d2"],categories:"dwd_icon,dwd_icon_eps,dwd_icon_d2,dwd_icon_d2_eps,dwd_icon_eu,dwd_icon_eu_eps",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:4,name:"ARPEGE",disabled:!0,alias:"ECMWF",model:"arpege_seamless",provider:"Météo-France",country:"France",resolution:25,tips:"1-25km",length:4,frequency:1,models:["arpege_seamless","arpege_world","arpege_europe"],categories:"meteofrance_arpege_europe,meteofrance_arpege_europe_probabilities,meteofrance_arpege_world025",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:5,name:"UKMO",disabled:!0,alias:"ECMWF",model:"ukmo_seamless",provider:"UK Met Office",country:"United Kingdom",resolution:10,tips:"2-10km",length:7,frequency:1,models:["ukmo_seamless","ukmo_global_deterministic_10km","ukmo_uk_deterministic_2km"],categories:"ukmo_global_deterministic_10km,ukmo_uk_deterministic_2km",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:6,name:"JMA",disabled:!0,alias:"GFS",model:"jma_seamless",provider:"JMA",country:"Japan",resolution:55,tips:"5-55km",length:11,frequency:3,models:["jma_seamless","jma_msm","jma_gsm"],categories:"jma_gsm,jma_msm",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:7,name:"GEM",disabled:!0,alias:"GFS",model:"gem_seamless",provider:"Canadian Weather Service",country:"Canada",resolution:2.5,tips:"2.5km",length:10,frequency:6,models:["gem_seamless","gem_global","gem_regional"],categories:"cmc_gem_gdps,cmc_gem_hrdps,cmc_gem_rdps",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:8,name:"GRAPES",disabled:!0,alias:"GFS",model:"cma_grapes_global",provider:"China Meteorological Administration (CMA)",country:"China",resolution:15,tips:"15km",length:10,frequency:6,models:["cma_grapes_global"],categories:"cma_grapes_global",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:9,name:"ACCESS-G",disabled:!0,alias:"GFS",model:"bom_access_global",provider:"Australian Bureau of Meteorology (BOM)",country:"Australia",resolution:15,tips:"15km",length:10,frequency:6,models:["bom_access_global"],categories:"bom_access_global",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"}],yo=[{rank:0,name:"Best Match",alias:"BEST MATCH",model:"best_match",models:["best_match"]},{rank:1,name:"MFWAM",alias:"ECMWF",model:"meteofrance_wave",provider:"MeteoFrance",country:"France",resolution:8,tips:"8km",length:10,frequency:12,models:["meteofrance_wave"],categories:"meteofrance_wave",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:2,disabled:!0,name:"SMOC",alias:"ECMWF",model:"meteofrance_currents",provider:"MeteoFrance",country:"France",resolution:8,tips:"8km",length:10,frequency:24,models:["meteofrance_currents"],categories:"meteofrance_currents, meteofrance_sea_surface_temperature",variables:"ocean_u_current,ocean_v_current,invert_barometer_height,sea_level_height_msl,sea_surface_temperature"},{rank:3,disabled:!0,name:"EWAM",alias:"ECMWF",model:"ewam",provider:"DWD",country:"Germany",resolution:5,tips:"5km",length:8,frequency:2,models:["ewam"],categories:"dwd_ewam",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:4,disabled:!0,name:"GWAM",alias:"ECMWF",model:"gwam",provider:"DWD",country:"Germany",resolution:5,tips:"5km",length:4,frequency:2,models:["gwam"],categories:"dwd_gwam",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:5,disabled:!0,name:"ECWAM",alias:"ECMWF",model:"ecmwf_wam025",provider:"ECMWF",country:"Europe",resolution:25,tips:"25km",length:10,frequency:6,models:["ecmwf_wam025"],categories:"ecmwf_wam025",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:6,name:"GFSWave",alias:"GFS",model:"ncep_gfswave025",provider:"NCEP",country:"USA",resolution:25,tips:"25km",length:10,frequency:6,models:["ncep_gfswave025","ncep_gfswave016"],categories:"ncep_gfswave025,ncep_gfswave016",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:7,disabled:!0,name:"ERA5-Ocean",alias:"ECMWF",model:"era5_ocean",provider:"Copernicus",country:"Europe",resolution:50,tips:"50km",length:-5,frequency:1,models:["era5_ocean"],categories:"copernicus_era5_ocean",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"}];let va=class{static standardWeatherModels(){return fo.filter(e=>!e.disabled&&e.alias)}static standardMarineModels(){return yo.filter(e=>!e.disabled&&e.alias)}static autoPickLayerModel(e,a="copernicus"){return a=a||"copernicus",a=a==null?void 0:a.toLowerCase(),a=["gfs","ecmwf","copernicus"].includes(a)?a:"copernicus",e=e==null?void 0:e.toLowerCase(),e==="gfs"?"gfs":["ec","ecmwf"].includes(e)?"ecmwf":["copernicus","cmems"].includes(e)?"copernicus":a}static autoPickPeerModel(e,a,r="copernicus"){if(a=this.autoPickLayerModel(a,r),pl.LayerHelper.WEATHER_LAYERS.reduce((i,l)=>l.atmos?i+l.weight:i,0)&e.weight){if(a==="copernicus")return"ecmwf"}else{if(["sig-wave","sig-wave-height","sig-wave-height-contour"].includes(e.key))return a;if(a==="ecmwf")return"copernicus"}return a}static autoPickMeteoModel(e="best_match"){var a,r;e=e==null?void 0:e.toLowerCase(),e=e==="ec"?"ecmwf":e;const i=e.toLowerCase().split(","),l=[],n=[];for(const s of i){let c=fo.find(d=>{var g,u,y;return((g=d.models)==null?void 0:g.includes(s))||((u=d.alias)==null?void 0:u.toLowerCase())===s||((y=d.name)==null?void 0:y.toLowerCase())===s}),m=yo.find(d=>{var g,u,y;return((g=d.models)==null?void 0:g.includes(s))||((u=d.alias)==null?void 0:u.toLowerCase())===s||((y=d.name)==null?void 0:y.toLowerCase())===s});c=c||fo.find(d=>{var g,u;return((g=d.alias)==null?void 0:g.toLowerCase())===((u=m==null?void 0:m.alias)==null?void 0:u.toLowerCase())}),m=m||yo.find(d=>{var g,u;return((g=d.alias)==null?void 0:g.toLowerCase())===((u=c==null?void 0:c.alias)==null?void 0:u.toLowerCase())}),c=c||fo[0],m=m||yo[0],l.push((a=c.models)!=null&&a.includes(s)?s:c.model),n.push((r=m.models)!=null&&r.includes(s)?s:m.model)}return{weatherModels:l.join(","),marineModels:n.join(",")}}static autoPickSubCategories(e){e=e.toUpperCase();const a=fo.filter(l=>l.alias===e),r=yo.filter(l=>l.alias===e),i=[];return a.forEach(l=>{l.categories&&i.push(...l.categories.split(","))}),r.forEach(l=>{l.categories&&i.push(...l.categories.split(","))}),i}static pickHourly(e,a){var r,i,l,n,s,c,m,d,g,u,y,p,h,f,x,v,b,k,A,L,C,z,M,T,N,F,O,q,$,le,S,Z,H,te,W,I,K,V,Y,ee,he,ge,re,ue,ye,ze,J,ne,Fe,Ge,Re,Ce,je,Ne,Ee,De,We,Ze,Be,xe,ke,_e,He,Xe,Oe,Pe,rt,lt,nt,st,ct,mt,dt,ht,pt,ut,gt,ft,yt,bt,wt,xt,kt,At,Lt,vt,Ct,_t,zt,St,Pt,Mt,Tt,Nt,Et,Vt,Rt,Dt,Bt,It,Ft,Gt,jt,Wt,Zt,Me,Ve,Ht,Ye,Xt,et,Ae,Ue;const ie=typeof a=="string"?_(a):a;let Le=ie.clone();const U=e==null?void 0:e.weather,X=e==null?void 0:e.marine,Je=((i=(r=U==null?void 0:U[0])==null?void 0:r.hourly)==null?void 0:i.date)||((n=(l=X==null?void 0:X[0])==null?void 0:l.hourly)==null?void 0:n.date),Ie=_.utc(Je),Se=Ie.clone().add(((m=(c=(s=U==null?void 0:U[0])==null?void 0:s.hourly)==null?void 0:c.time)==null?void 0:m.at(0))||((u=(g=(d=X==null?void 0:X[0])==null?void 0:d.hourly)==null?void 0:g.time)==null?void 0:u.at(0)),"h"),G=Ie.clone().add(((h=(p=(y=U==null?void 0:U[0])==null?void 0:y.hourly)==null?void 0:p.time)==null?void 0:h.at(-1))||((v=(x=(f=X==null?void 0:X[0])==null?void 0:f.hourly)==null?void 0:x.time)==null?void 0:v.at(-1)),"h"),Ot=[];Le=Le.isBefore(Se)?Se.clone():Le,Le=Le.isAfter(G)?G.clone():Le;const oe=Le.utc().diff(Se,"h",!1);let ve,Ke;if(U!=null&&U.length){let tt=0,ot=0,B=0;for(const Qe of U){const j=Qe==null?void 0:Qe.hourly;for(let me=oe-(oe-1)%3;me<=oe;me++)tt+=((b=j==null?void 0:j.precipitation)==null?void 0:b.at(me))??0;for(let me=oe-(oe-1)%6;me<=oe;me++)ot+=((k=j==null?void 0:j.precipitation)==null?void 0:k.at(me))??0;for(let me=oe-(oe-1)%12;me<=oe;me++)B+=((A=j==null?void 0:j.precipitation)==null?void 0:A.at(me))??0;const qe=((L=j==null?void 0:j.wind_direction_10m)==null?void 0:L.at(oe))??((z=(C=j==null?void 0:j.wind_direction_10m)==null?void 0:C.filter(me=>me!==null))==null?void 0:z.at(-1));ve={temp:((M=j==null?void 0:j.temperature_2m)==null?void 0:M.at(oe))??((N=(T=j==null?void 0:j.temperature_2m)==null?void 0:T.filter(me=>me!==null))==null?void 0:N.at(-1)),apparentTemp:((F=j==null?void 0:j.apparent_temperature)==null?void 0:F.at(oe))??((q=(O=j==null?void 0:j.apparent_temperature)==null?void 0:O.filter(me=>me!==null))==null?void 0:q.at(-1)),rh:(($=j==null?void 0:j.relative_humidity_2m)==null?void 0:$.at(oe))??((S=(le=j==null?void 0:j.relative_humidity_2m)==null?void 0:le.filter(me=>me!==null))==null?void 0:S.at(-1)),dp:((Z=j==null?void 0:j.dew_point_2m)==null?void 0:Z.at(oe))??((te=(H=j==null?void 0:j.dew_point_2m)==null?void 0:H.filter(me=>me!==null))==null?void 0:te.at(-1)),precip:{probability:((W=j==null?void 0:j.precipitation_probability)==null?void 0:W.at(oe))??0,sum:((I=j==null?void 0:j.precipitation)==null?void 0:I.at(oe))??0,sum1Hours:((K=j==null?void 0:j.precipitation)==null?void 0:K.at(oe))??0,sum3Hours:Math.round(tt*100)/100,sum6Hours:Math.round(ot*100)/100,sum12Hours:Math.round(B*100)/100},pmsl:((V=j==null?void 0:j.pressure_msl)==null?void 0:V.at(oe))??((ee=(Y=j==null?void 0:j.pressure_msl)==null?void 0:Y.filter(me=>me!==null))==null?void 0:ee.at(-1)),psurf:((he=j==null?void 0:j.surface_pressure)==null?void 0:he.at(oe))??((re=(ge=j==null?void 0:j.surface_pressure)==null?void 0:ge.filter(me=>me!==null))==null?void 0:re.at(-1)),code:((ue=j==null?void 0:j.weather_code)==null?void 0:ue.at(oe))??((ze=(ye=j==null?void 0:j.weather_code)==null?void 0:ye.filter(me=>me!==null))==null?void 0:ze.at(-1)),visibility:this.m2nm(((J=j==null?void 0:j.visibility)==null?void 0:J.at(oe))??((Fe=(ne=j==null?void 0:j.visibility)==null?void 0:ne.filter(me=>me!==null))==null?void 0:Fe.at(-1))),wind:{speed:((Ge=j==null?void 0:j.wind_speed_10m)==null?void 0:Ge.at(oe))??((Ce=(Re=j==null?void 0:j.wind_speed_10m)==null?void 0:Re.filter(me=>me!==null))==null?void 0:Ce.at(-1)),kts:((je=j==null?void 0:j.wind_speed_10m)==null?void 0:je.at(oe))??((Ee=(Ne=j==null?void 0:j.wind_speed_10m)==null?void 0:Ne.filter(me=>me!==null))==null?void 0:Ee.at(-1)),degree:qe,bearing:qe!==null?Math.round((qe+180)%360):null,gusts:((De=j==null?void 0:j.wind_gusts_10m)==null?void 0:De.at(oe))??((Ze=(We=j==null?void 0:j.wind_gusts_10m)==null?void 0:We.filter(me=>me!==null))==null?void 0:Ze.at(-1))},isDay:(Be=j==null?void 0:j.is_day)==null?void 0:Be.at(oe)};const{name:Ut,url:se,bg:io}=this.parseWeatherCode(ve.code,ve.isDay);ve.name=Ut,ve.url=se,ve.bg=io,ve.wind.scale=this.beaufort(this.kts2ms(ve.wind.kts)),ve.wind.direction=this.degree2Direction(ve.wind.degree),Ot.push({utc:ie.utc().format(),realUTC:Se.add(oe,"h").format(),model:Qe.model,weather:{...ve}})}}if(X!=null&&X.length){let tt=0;for(const ot of X){const B=ot==null?void 0:ot.hourly,Qe=((xe=B==null?void 0:B.wave_direction)==null?void 0:xe.at(oe))??((_e=(ke=B==null?void 0:B.wave_direction)==null?void 0:ke.filter(se=>se!==null))==null?void 0:_e.at(-1)),j=((He=B==null?void 0:B.swell_wave_direction)==null?void 0:He.at(oe))??((Oe=(Xe=B==null?void 0:B.swell_wave_direction)==null?void 0:Xe.filter(se=>se!==null))==null?void 0:Oe.at(-1)),qe=((Pe=B==null?void 0:B.wind_wave_direction)==null?void 0:Pe.at(oe))??((lt=(rt=B==null?void 0:B.wind_wave_direction)==null?void 0:rt.filter(se=>se!==null))==null?void 0:lt.at(-1)),Ut=((nt=B==null?void 0:B.ocean_current_direction)==null?void 0:nt.at(oe))??((ct=(st=B==null?void 0:B.ocean_current_direction)==null?void 0:st.filter(se=>se!==null))==null?void 0:ct.at(-1));Ke={wave:{sig:{height:((mt=B==null?void 0:B.wave_height)==null?void 0:mt.at(oe))??((ht=(dt=B==null?void 0:B.wave_height)==null?void 0:dt.filter(se=>se!==null))==null?void 0:ht.at(-1)),degree:Qe,bearing:Qe!==null?Math.round((Qe+180)%360):null,period:((pt=B==null?void 0:B.wave_period)==null?void 0:pt.at(oe))??((gt=(ut=B==null?void 0:B.wave_period)==null?void 0:ut.filter(se=>se!==null))==null?void 0:gt.at(-1))},swell:{height:((ft=B==null?void 0:B.swell_wave_height)==null?void 0:ft.at(oe))??((bt=(yt=B==null?void 0:B.swell_wave_height)==null?void 0:yt.filter(se=>se!==null))==null?void 0:bt.at(-1)),degree:j,bearing:j!==null?Math.round((j+180)%360):null,period:((wt=B==null?void 0:B.swell_wave_period)==null?void 0:wt.at(oe))??((kt=(xt=B==null?void 0:B.swell_wave_period)==null?void 0:xt.filter(se=>se!==null))==null?void 0:kt.at(-1)),peakPeriod:((At=B==null?void 0:B.swell_wave_peak_period)==null?void 0:At.at(oe))??((vt=(Lt=B==null?void 0:B.swell_wave_peak_period)==null?void 0:Lt.filter(se=>se!==null))==null?void 0:vt.at(-1))},wd:{height:((Ct=B==null?void 0:B.wind_wave_height)==null?void 0:Ct.at(oe))??((zt=(_t=B==null?void 0:B.wind_wave_height)==null?void 0:_t.filter(se=>se!==null))==null?void 0:zt.at(-1)),degree:qe,bearing:qe!==null?Math.round((qe+180)%360):null,period:((St=B==null?void 0:B.wind_wave_period)==null?void 0:St.at(oe))??((Mt=(Pt=B==null?void 0:B.wind_wave_period)==null?void 0:Pt.filter(se=>se!==null))==null?void 0:Mt.at(-1)),peakPeriod:((Tt=B==null?void 0:B.wind_wave_peak_period)==null?void 0:Tt.at(oe))??((Et=(Nt=B==null?void 0:B.wind_wave_peak_period)==null?void 0:Nt.filter(se=>se!==null))==null?void 0:Et.at(-1))}},current:{speed:((Vt=B==null?void 0:B.ocean_current_velocity)==null?void 0:Vt.at(oe))??((Dt=(Rt=B==null?void 0:B.ocean_current_velocity)==null?void 0:Rt.filter(se=>se!==null))==null?void 0:Dt.at(-1)),kts:((Bt=B==null?void 0:B.ocean_current_velocity)==null?void 0:Bt.at(oe))??((Ft=(It=B==null?void 0:B.ocean_current_velocity)==null?void 0:It.filter(se=>se!==null))==null?void 0:Ft.at(-1)),degree:Ut,bearing:Ut},sst:((Gt=B==null?void 0:B.sea_surface_temperature)==null?void 0:Gt.at(oe))??((Wt=(jt=B==null?void 0:B.sea_surface_temperature)==null?void 0:jt.filter(se=>se!==null))==null?void 0:Wt.at(-1)),height:((Zt=B==null?void 0:B.sea_level_height_msl)==null?void 0:Zt.at(oe))??((Ve=(Me=B==null?void 0:B.sea_level_height_msl)==null?void 0:Me.filter(se=>se!==null))==null?void 0:Ve.at(-1)),ice:{sit:((Ht=B==null?void 0:B.sea_ice_thickness)==null?void 0:Ht.at(oe))??((Xt=(Ye=B==null?void 0:B.sea_ice_thickness)==null?void 0:Ye.filter(se=>se!==null))==null?void 0:Xt.at(-1)),sic:((et=B==null?void 0:B.sea_ice_concentration)==null?void 0:et.at(oe))??((Ue=(Ae=B==null?void 0:B.sea_ice_concentration)==null?void 0:Ae.filter(se=>se!==null))==null?void 0:Ue.at(-1))}},Ke.wave=this.parseWave(Ke.wave,ve==null?void 0:ve.wind),Ke.current.direction=this.degree2Direction(Ke.current.degree),Ot[tt]?Object.assign(Ot[tt],Ke):Ot.push({utc:ie.utc().format(),realUTC:Se.add(oe,"h").format(),model:ot.model,...Ke}),tt++}}return Ot}static toLegacy(e){var a,r,i,l,n,s,c,m,d,g;return{wind:(a=e==null?void 0:e.weather)==null?void 0:a.wind,visibility:(r=e==null?void 0:e.weather)==null?void 0:r.visibility,temp:(i=e==null?void 0:e.weather)==null?void 0:i.temp,prmsl:(l=e==null?void 0:e.weather)==null?void 0:l.pmsl,gusts:{kts:(s=(n=e==null?void 0:e.weather)==null?void 0:n.wind)==null?void 0:s.gusts},precip:(c=e==null?void 0:e.weather)==null?void 0:c.precip,code:(m=e==null?void 0:e.weather)==null?void 0:m.code,name:(d=e==null?void 0:e.weather)==null?void 0:d.name,url:(g=e==null?void 0:e.weather)==null?void 0:g.url,wave:e==null?void 0:e.wave,current:e==null?void 0:e.current,sst:e==null?void 0:e.sst,height:e==null?void 0:e.height,utc:e==null?void 0:e.utc,source:e==null?void 0:e.model,ice:e==null?void 0:e.ice}}static pickDaily(e,a){var r,i,l,n,s,c,m,d,g,u,y,p,h,f,x,v,b,k,A,L,C,z,M,T,N,F,O,q,$,le,S,Z,H,te,W,I,K,V,Y,ee,he,ge,re,ue,ye,ze,J,ne,Fe,Ge,Re,Ce,je,Ne,Ee,De,We,Ze,Be,xe,ke,_e,He,Xe,Oe,Pe,rt,lt,nt,st,ct,mt,dt,ht,pt,ut,gt,ft,yt,bt,wt,xt,kt,At,Lt,vt,Ct,_t,zt,St,Pt,Mt,Tt,Nt,Et,Vt,Rt,Dt,Bt,It,Ft,Gt,jt,Wt;const Zt=typeof a=="string"?_(a):a;let Me=Zt.clone();const Ve=e==null?void 0:e.weather,Ht=e==null?void 0:e.marine,Ye=_((l=(i=(r=Ve==null?void 0:Ve[0])==null?void 0:r.daily)==null?void 0:i.time)==null?void 0:l.at(0)),Xt=_((c=(s=(n=Ve==null?void 0:Ve[0])==null?void 0:n.daily)==null?void 0:s.time)==null?void 0:c.at(-1)),et=[];Me=Me.isBefore(Ye)?Ye.clone():Me,Me=Me.isAfter(Xt)?Xt.clone():Me;let Ae,Ue;const ie=Me.diff(Ye,"d",!1);if(Ve)for(const Le of Ve){const U=Le.daily,X=((m=U.wind_direction_10m_dominant)==null?void 0:m.at(ie))??((g=(d=U.wind_direction_10m_dominant)==null?void 0:d.filter(G=>G!==null))==null?void 0:g.at(-1));Ae={code:((u=U.weather_code)==null?void 0:u.at(ie))??((p=(y=U.weather_code)==null?void 0:y.filter(G=>G!==null))==null?void 0:p.at(-1)),temp:{max:((h=U.temperature_2m_max)==null?void 0:h.at(ie))??((x=(f=U.temperature_2m_max)==null?void 0:f.filter(G=>G!==null))==null?void 0:x.at(-1)),min:((v=U.temperature_2m_min)==null?void 0:v.at(ie))??((k=(b=U.temperature_2m_min)==null?void 0:b.filter(G=>G!==null))==null?void 0:k.at(-1)),mean:((A=U.temperature_2m_mean)==null?void 0:A.at(ie))??((C=(L=U.temperature_2m_mean)==null?void 0:L.filter(G=>G!==null))==null?void 0:C.at(-1))},apparentTemp:{max:((z=U.apparent_temperature_max)==null?void 0:z.at(ie))??((T=(M=U.apparent_temperature_max)==null?void 0:M.filter(G=>G!==null))==null?void 0:T.at(-1)),min:((N=U.apparent_temperature_min)==null?void 0:N.at(ie))??((O=(F=U.apparent_temperature_min)==null?void 0:F.filter(G=>G!==null))==null?void 0:O.at(-1))},precip:{sum:((q=U.precipitation_sum)==null?void 0:q.at(ie))??((le=($=U.precipitation_sum)==null?void 0:$.filter(G=>G!==null))==null?void 0:le.at(-1)),rainSum:((S=U.rain_sum)==null?void 0:S.at(ie))??((H=(Z=U.rain_sum)==null?void 0:Z.filter(G=>G!==null))==null?void 0:H.at(-1)),snowfallSum:((te=U.snowfall_sum)==null?void 0:te.at(ie))??((I=(W=U.snowfall_sum)==null?void 0:W.filter(G=>G!==null))==null?void 0:I.at(-1)),showersSum:((K=U.showers_sum)==null?void 0:K.at(ie))??((Y=(V=U.showers_sum)==null?void 0:V.filter(G=>G!==null))==null?void 0:Y.at(-1)),hours:((ee=U.precipitation_hours)==null?void 0:ee.at(ie))??0,probability:((he=U.precipitation_probability_max)==null?void 0:he.at(ie))??0},rh:{max:((ge=U.relative_humidity_2m_max)==null?void 0:ge.at(ie))??((ue=(re=U.relative_humidity_2m_max)==null?void 0:re.filter(G=>G!==null))==null?void 0:ue.at(-1)),min:((ye=U.relative_humidity_2m_min)==null?void 0:ye.at(ie))??((J=(ze=U.relative_humidity_2m_min)==null?void 0:ze.filter(G=>G!==null))==null?void 0:J.at(-1)),mean:((ne=U.relative_humidity_2m_mean)==null?void 0:ne.at(ie))??((Ge=(Fe=U.relative_humidity_2m_mean)==null?void 0:Fe.filter(G=>G!==null))==null?void 0:Ge.at(-1))},wind:{speed:((Re=U.wind_speed_10m_max)==null?void 0:Re.at(ie))??((je=(Ce=U.wind_speed_10m_max)==null?void 0:Ce.filter(G=>G!==null))==null?void 0:je.at(-1)),kts:((Ne=U.wind_speed_10m_max)==null?void 0:Ne.at(ie))??((De=(Ee=U.wind_speed_10m_max)==null?void 0:Ee.filter(G=>G!==null))==null?void 0:De.at(-1)),degree:X,gusts:((We=U.wind_gusts_10m_max)==null?void 0:We.at(ie))??((Be=(Ze=U.wind_gusts_10m_max)==null?void 0:Ze.filter(G=>G!==null))==null?void 0:Be.at(-1)),mean:((xe=U.wind_speed_10m_mean)==null?void 0:xe.at(ie))??((_e=(ke=U.wind_speed_10m_mean)==null?void 0:ke.filter(G=>G!==null))==null?void 0:_e.at(-1)),bearing:X!==null?Math.round((X+180)%360):null},visibility:{max:this.m2nm(((He=U.visibility_max)==null?void 0:He.at(ie))??((Oe=(Xe=U.visibility_max)==null?void 0:Xe.filter(G=>G!==null))==null?void 0:Oe.at(-1))),min:this.m2nm(((Pe=U.visibility_min)==null?void 0:Pe.at(ie))??((lt=(rt=U.visibility_min)==null?void 0:rt.filter(G=>G!==null))==null?void 0:lt.at(-1))),mean:this.m2nm(((nt=U.visibility_mean)==null?void 0:nt.at(ie))??((ct=(st=U.visibility_mean)==null?void 0:st.filter(G=>G!==null))==null?void 0:ct.at(-1)))}};const{name:Je,url:Ie,bg:Se}=this.parseWeatherCode(Ae.code,!0);Ae.name=Je,Ae.url=Ie,Ae.bg=Se,Ae.wind.scale=this.beaufort(this.kts2ms(Ae.wind.kts)),Ae.wind.direction=this.degree2Direction(Ae.wind.degree),et.push({utc:Zt.utc().format(),realUTC:Ye.add(ie,"d").utc().format(),model:Le.model,weather:{...Ae}})}if(Ht){let Le=0;for(const U of Ht){const X=U.daily,Je=((mt=X==null?void 0:X.wave_direction_dominant)==null?void 0:mt.at(ie))||((ht=(dt=X==null?void 0:X.wave_direction_dominant)==null?void 0:dt.filter(G=>G!==null))==null?void 0:ht.at(-1)),Ie=((pt=X==null?void 0:X.swell_wave_direction_dominant)==null?void 0:pt.at(ie))||((gt=(ut=X==null?void 0:X.swell_wave_direction_dominant)==null?void 0:ut.filter(G=>G!==null))==null?void 0:gt.at(-1)),Se=((ft=X==null?void 0:X.wind_wave_direction_dominant)==null?void 0:ft.at(ie))||((bt=(yt=X==null?void 0:X.wind_wave_direction_dominant)==null?void 0:yt.filter(G=>G!==null))==null?void 0:bt.at(-1));Ue={wave:{sig:{height:((wt=X==null?void 0:X.wave_height_max)==null?void 0:wt.at(ie))||((kt=(xt=X==null?void 0:X.wave_height_max)==null?void 0:xt.filter(G=>G!==null))==null?void 0:kt.at(-1)),degree:Je,period:((At=X==null?void 0:X.wave_period_max)==null?void 0:At.at(ie))||((vt=(Lt=X==null?void 0:X.wave_period_max)==null?void 0:Lt.filter(G=>G!==null))==null?void 0:vt.at(-1)),bearing:Je!==null?Math.round((Je+180)%360):null},swell:{height:((Ct=X==null?void 0:X.swell_wave_height_max)==null?void 0:Ct.at(ie))??((zt=(_t=X==null?void 0:X.swell_wave_height_max)==null?void 0:_t.filter(G=>G!==null))==null?void 0:zt.at(-1)),degree:Ie,period:((St=X==null?void 0:X.swell_wave_period_max)==null?void 0:St.at(ie))??((Mt=(Pt=X==null?void 0:X.swell_wave_period_max)==null?void 0:Pt.filter(G=>G!==null))==null?void 0:Mt.at(-1)),peakPeriod:((Tt=X==null?void 0:X.swell_wave_peak_period_max)==null?void 0:Tt.at(ie))??((Et=(Nt=X==null?void 0:X.swell_wave_peak_period_max)==null?void 0:Nt.filter(G=>G!==null))==null?void 0:Et.at(-1)),bearing:Ie!==null?Math.round((Ie+180)%360):null},wd:{height:((Vt=X==null?void 0:X.wind_wave_height_max)==null?void 0:Vt.at(ie))??((Dt=(Rt=X==null?void 0:X.wind_wave_height_max)==null?void 0:Rt.filter(G=>G!==null))==null?void 0:Dt.at(-1)),degree:Se,period:((Bt=X==null?void 0:X.wind_wave_period_max)==null?void 0:Bt.at(ie))??((Ft=(It=X==null?void 0:X.wind_wave_period_max)==null?void 0:It.filter(G=>G!==null))==null?void 0:Ft.at(-1)),peakPeriod:((Gt=X==null?void 0:X.wind_wave_peak_period_max)==null?void 0:Gt.at(ie))??((Wt=(jt=X==null?void 0:X.wind_wave_peak_period_max)==null?void 0:jt.filter(G=>G!==null))==null?void 0:Wt.at(-1)),bearing:Se!==null?Math.round((Se+180)%360):null}}},Ue.wave=this.parseWave(Ue.wave,Ae==null?void 0:Ae.wind),Object.assign(et[Le]||{},Ue),Le++}}return et}static parseWave(e,a){if(e.sig.direction=this.degree2Direction(e.sig.degree),e.swell.direction=this.degree2Direction(e.swell.degree),e.wd.direction=this.degree2Direction(e.wd.degree),e.sig.scale=this.douglas(e.sig.height),e.swell.scale=this.douglas(e.swell.height),e.wd.scale=this.douglas(e.wd.height),e.sig.height==0){const r=Math.sqrt(Math.pow(e.swell.height||0,2)+Math.pow(e.wd.height||0,2));e.sig.height=r?Math.round(r*100)/100:.1}if(e.swell.height===0)if(e.sig.height>e.wd.height){const r=Math.sqrt(Math.abs(Math.pow(e.sig.height||0,2)-Math.pow(e.wd.height||0,2)));e.swell.height=Math.round(r*100)/100}else{const r=Math.round(.12*this.kts2ms((a==null?void 0:a.kts)||0)*100)/100,i=r>1?r/10:r>.5?r/5:r>.3?r/2:r,l=Math.max(e.sig.height,e.wd.height);e.swell.height=Math.round((i<l?i:l/2)*100)/100}if(e.wd.height===0)if(e.sig.height>e.swell.height){const r=Math.sqrt(Math.abs(Math.pow(e.sig.height||0,2)-Math.pow(e.swell.height||0,2))),i=.24*this.kts2ms((a==null?void 0:a.kts)||0);e.wd.height=Math.round(Math.min(r,i)*100)/100}else{const r=.24*this.kts2ms((a==null?void 0:a.kts)||0),i=Math.max(e.sig.height,e.swell.height);e.wd.height=Math.round((r<i?r:i/2)*100)/100}if(e.swell.height>=e.sig.height&&(e.swell.height=Math.round(e.sig.height*.8*100)/100),e.wd.height>=e.sig.height&&(e.wd.height=Math.round(e.sig.height*.8*100)/100),!e.sig.period){const r=Math.max(e.swell.period,e.wd.period);e.sig.period=Math.round(6*Math.sqrt(e.sig.height)),e.sig.period=isNaN(r)?void 0:e.sig.period>r?r:e.sig.period}if(!e.swell.period){e.swell.period=Math.round(6*Math.sqrt(e.swell.height));const r=Math.max(e.sig.period,e.wd.period);e.swell.period=isNaN(r)?void 0:e.swell.period>r?r:e.swell.period}if(!e.wd.period){e.wd.period=Math.round(6*Math.sqrt(e.wd.height));const r=Math.max(e.sig.period,e.swell.period);e.wd.period=isNaN(r)?void 0:e.wd.period>r?r:e.wd.period}return e}static parseWeatherCode(e,a){const r=this.weatherCode(e);return(a?r.day:r.night)||{}}static weatherCode(e){const a={code:e};switch(e){case 0:a.day={name:"Sunny",url:"https://ossimg.ormwx.com/asset/weather/01d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg1.png"},a.night={name:"Clear",url:"https://ossimg.ormwx.com/asset/weather/01n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg1.png"};break;case 1:a.day={name:"Mainly Sunny",url:"https://ossimg.ormwx.com/asset/weather/01d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg1.png"},a.night={name:"Mainly Clear",url:"https://ossimg.ormwx.com/asset/weather/01n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg1.png"};break;case 2:a.day={name:"Partly Cloudy",url:"https://ossimg.ormwx.com/asset/weather/02d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg2.png"},a.night={name:"Partly Cloudy",url:"https://ossimg.ormwx.com/asset/weather/02n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg2.png"};break;case 3:a.day={name:"Overcast",url:"https://ossimg.ormwx.com/asset/weather/04d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg3.png"},a.night={name:"Overcast",url:"https://ossimg.ormwx.com/asset/weather/04n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg3.png"};break;case 45:a.day={name:"Foggy",url:"https://ossimg.ormwx.com/asset/weather/50d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg4.png"},a.night={name:"Foggy",url:"https://ossimg.ormwx.com/asset/weather/50n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg4.png"};break;case 48:a.day={name:"Rime Fog",url:"https://ossimg.ormwx.com/asset/weather/50d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg4.png"},a.night={name:"Rime Fog",url:"https://ossimg.ormwx.com/asset/weather/50n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg4.png"};break;case 51:a.day={name:"Light Drizzle",url:"https://ossimg.ormwx.com/asset/weather/14d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Drizzle",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 53:a.day={name:"Drizzle",url:"https://ossimg.ormwx.com/asset/weather/14d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Drizzle",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 55:a.day={name:"Heavy Drizzle",url:"https://ossimg.ormwx.com/asset/weather/15d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Drizzle",url:"https://ossimg.ormwx.com/asset/weather/15n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 56:a.day={name:"Light Freezing Drizzle",url:"https://ossimg.ormwx.com/asset/weather/14d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Freezing Drizzle",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 57:a.day={name:"Freezing Drizzle",url:"https://ossimg.ormwx.com/asset/weather/14d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Freezing Drizzle",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 61:a.day={name:"Light Rain",url:"https://ossimg.ormwx.com/asset/weather/16d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Rain",url:"https://ossimg.ormwx.com/asset/weather/10n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 63:a.day={name:"Rain",url:"https://ossimg.ormwx.com/asset/weather/16d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Rain",url:"https://ossimg.ormwx.com/asset/weather/10n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 65:a.day={name:"Heavy Rain",url:"https://ossimg.ormwx.com/asset/weather/16d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Rain",url:"https://ossimg.ormwx.com/asset/weather/10n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 66:a.day={name:"Light Freezing Rain",url:"https://ossimg.ormwx.com/asset/weather/16d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Freezing Rain",url:"https://ossimg.ormwx.com/asset/weather/10n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 67:a.day={name:"Freezing Rain",url:"https://ossimg.ormwx.com/asset/weather/16d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Freezing Rain",url:"https://ossimg.ormwx.com/asset/weather/10n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 71:a.day={name:"Light Snow",url:"https://ossimg.ormwx.com/asset/weather/17d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Light Snow",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 73:a.day={name:"Snow",url:"https://ossimg.ormwx.com/asset/weather/17d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Snow",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 75:a.day={name:"Heavy Snow",url:"https://ossimg.ormwx.com/asset/weather/17d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Heavy Snow",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 77:a.day={name:"Snow Grains",url:"https://ossimg.ormwx.com/asset/weather/17d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Snow Grains",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 80:a.day={name:"Light Showers",url:"https://ossimg.ormwx.com/asset/weather/09d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Showers",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 81:a.day={name:"Showers",url:"https://ossimg.ormwx.com/asset/weather/09d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Showers",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 82:a.day={name:"Heavy Showers",url:"https://ossimg.ormwx.com/asset/weather/09d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Showers",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 85:a.day={name:"Light Snow Showers",url:"https://ossimg.ormwx.com/asset/weather/13d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Light Snow Showers",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 86:a.day={name:"Snow Showers",url:"https://ossimg.ormwx.com/asset/weather/13d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Snow Showers",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 95:a.day={name:"Thunderstorm",url:"https://ossimg.ormwx.com/asset/weather/11d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Thunderstorm",url:"https://ossimg.ormwx.com/asset/weather/11n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 96:a.day={name:"Light Thunderstorms With Hail",url:"https://ossimg.ormwx.com/asset/weather/11d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Thunderstorms With Hail",url:"https://ossimg.ormwx.com/asset/weather/11n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 99:a.day={name:"Thunderstorms With Hail",url:"https://ossimg.ormwx.com/asset/weather/11d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Thunderstorms With Hail",url:"https://ossimg.ormwx.com/asset/weather/11n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break}return a}static kts2ms(e){return isNaN(e)||e===null?e:Math.round(e*1852/3600*1e4)/1e4}static kts2kmh(e){return isNaN(e)||e===null?e:e*1.852}static m2nm(e){return isNaN(e)||e===null?e:Math.round(e/1e3/1.852*1e4)/1e4}static kmh2kts(e){return isNaN(e)||e===null?e:this.ms2kts(e*1e3/3600)}static ms2kts(e){return isNaN(e)||e===null?e:Math.round(e*3600/1852*1e4)/1e4}static degree2Radian(e){if(isNaN(e)||e===null)return e;let a=e%360/360*2*Math.PI;return a=a<0?a+2*Math.PI:a,a}static degree2Direction(e){const a=this.degree2Radian(e);if(isNaN(a)||a===null)return null;let r="N/A";const i=Math.PI/16;return a<i?r="N":a>=i&&a<3*i?r="NNE":a>=3*i&&a<5*i?r="NE":a>=5*i&&a<7*i?r="ENE":a>=7*i&&a<9*i?r="E":a>=9*i&&a<11*i?r="ESE":a>=11*i&&a<13*i?r="SE":a>=13*i&&a<15*i?r="SSE":a>=15*i&&a<17*i?r="S":a>=17*i&&a<19*i?r="SSW":a>=19*i&&a<21*i?r="SW":a>=21*i&&a<23*i?r="WSW":a>=23*i&&a<25*i?r="W":a>=25*i&&a<27*i?r="WNW":a>=27*i&&a<29*i?r="NW":a>=29*i&&a<31*i?r="NNW":a>=31*i&&a<32*i&&(r="N"),r}static beaufort(e){let a=0;return isNaN(e)||(e=Math.round(e*10)/10,e<=.2?a=0:e<=1.5?a=1:e<=3.3?a=2:e<=5.4?a=3:e<=7.9?a=4:e<=10.7?a=5:e<=13.8?a=6:e<=17.1?a=7:e<=20.7?a=8:e<=22.4?a=9:e<=28.4?a=10:e<=32.6?a=11:e<=36.9?a=12:e<=41.4?a=13:e<=46.1?a=14:e<=50.9?a=15:e<=55.9?a=16:e<=61.2?a=17:e>61.2&&(a=18)),a}static douglas(e){let a="Calm";return isNaN(e)||e<=.1?a="Calm":e<=.5?a="Smooth":e<=1.25?a="Slight":e<=2.5?a="Moderate":e<=4?a="Rough":e<=6?a="VeryRough":e<=9?a="High":e<=14?a="VeryHigh":a="Precipitous",a}};const Wb="",Fd={name:"IdmTropicals",props:{simple:{type:Boolean,default:!1},permission:{type:Number},locale:{type:String},map:{type:Object},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}},timeZone:{type:Number},token:{type:String},defaultMeteoToken:{type:String},gateway:{type:String,default:"aa"},assistGateway:{type:Array,default:[]},forecastModel:{type:String},realTime:{type:String},beforeLayer:{type:String},platform:{type:String}},emits:["tropical","tropicalCenterPoints","tropicalReport"],setup(){return{Theme:be.useTheme()}},data(){return{right:10,toggle:!1,helper:ho.CompanyHelper,tropicals:void 0,tropicalCacheKey:"tropicalCacheGL4",source:"tropicals-source",clusterSource:"tropicals-cluster-source",historyLayer:"tropicals-history-layer",forecastLayer:"tropicals-forecast-layer",forecastModelLayer:"tropicals-forecast-model-layer",forecastNameLayer:"tropicals-forecast-name-layer",pointCircleLayer:"tropicals-point-circle-layer",pointLabelLayer:"tropicals-point-label-layer",historyPointCircleLayer:"history-tropicals-point-circle-layer",historyPointLabelLayer:"history-tropicals-point-label-layer",interpolateData:[],interpolateMarkers:[],interpolateSource:"tropicals-interpolate-source",interpolateLineLayer:"tropicals-interpolate-line-layer",showTropicalsInfo:!1,activeTropicals:void 0,activeTropicalsMarker:void 0,empty:E.featureCollection([]),showLegend:!1,showHoverPoint:!1,hoverPoint:void 0,hoverMarker:void 0}},computed:{hoverLayers(){return[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.pointCircleLayer,this.pointCircleLayer+"-border",this.historyPointCircleLayer,this.historyPointCircleLayer+"-border",this.historyPointCircleLayer+"-inner"]},clickLayers(){return[this.forecastNameLayer,this.historyLayer]},computeTime(){return(t,e)=>{if(t){const a=_(t).utcOffset(e),r=e<0?e:"+"+e;return`${a==null?void 0:a.format("MMM-DD/HHmm")} (UTC${r}) ${a==null?void 0:a.fromNow()} `}return"-"}},computeTzTime(){return(t,e,a="MM-DD HH:mm")=>{var r,i;if(t){const l=e||0,n=(i=(r=_(t))==null?void 0:r.utcOffset(l))==null?void 0:i.format(a),s=`(UTC ${l>=0?"+":""}${l})`;return n+" "+s}return"-"}},computeTimezone(){return this.timeZone<0?this.timeZone:"+"+this.timeZone},computeBF(){return function(t){const e=va.kts2ms(t);return va.beaufort(e)}},computeMovement(){return function(t){var e,a;return(a=(e=t==null?void 0:t.forecasts)==null?void 0:e.find(r=>!r.disabled))==null?void 0:a.movement}},computePosition(){return t=>!t||t.lng===null||t.lng===void 0||isNaN(t.lng)||t.lat===null||t.lat===void 0||isNaN(t.lat)?"-":P.LngLatHelper.lat2pretty(t==null?void 0:t.lat,2).pretty+" / "+P.LngLatHelper.lng2pretty(t==null?void 0:t.lng,2).pretty}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})},immediate:!0},map:{handler(t,e){e==null||e.off("render",this.handleUpdateMarkerVisibility),this.map?(this.map.on("render",this.handleUpdateMarkerVisibility),this.toggle=localStorage.getItem(this.tropicalCacheKey)==="true"||!1,localStorage.setItem(this.tropicalCacheKey,this.toggle),this.toggle&&this.fetchTropicals()):this.handleClear()}},showTropicalsInfo:{handler(){this.$emit("tropical",this.showTropicalsInfo),this.simple&&this.showTropicalsInfo?this.$nextTick(()=>{var t,e;this.$parent.playerBottom=((e=(t=this.$refs.tropicalsInfo)==null?void 0:t.$el)==null?void 0:e.clientHeight)+10}):this.simple&&(this.$parent.playerBottom=30)},immediate:!0},"tropicals.version":{handler(){this.handleRefresh()}},timeZone:{handler(t,e){t!==e&&this.handleRefresh()}},realTime:{handler(t){this.map&&t&&this.toggle&&this.handleRender()}},locale:{handler(t){this.map&&this.toggle&&this.handleRefresh()}}},methods:{handleMenuToggle(){var t,e,a;this.toggle=!this.toggle,localStorage.setItem(this.tropicalCacheKey,this.toggle),this.toggle?this.fetchTropicals():(this.handleClear(),(a=(e=(t=this.$parent)==null?void 0:t.$refs)==null?void 0:e.idmBottomBar)==null||a.handleToggle("tropical",!1))},async fetchTropicals(){var i,l,n;const t=new Date().valueOf();let e=0,a=0,r=(i=ho.LayerHelper.WEATHER_LAYERS.find(s=>s.key==="tropicals"))==null?void 0:i.weight;if(r>0){const s=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],c=await de.get(`${s}/api/arc/weather/layers2/links?l=${r}&v=${this.forecastModel}&t=${this.realTime}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(a=new Date().valueOf()-(t+e),console.log("weather links elapsed: ",a,", total: ",e+=a),((l=c==null?void 0:c.data)==null?void 0:l.code)===0){const m=(n=c==null?void 0:c.data)==null?void 0:n.data;await de.get(m.tropicals,{headers:{Authorization:this.token||this.defaultMeteoToken,key:"tropicals"},responseType:/\.(jpg|png)$/.test(m.tropicals)?"blob":"json"}).then(d=>{var y,p,h,f;const g=P.TropicalHelper.convert2Geojson(((y=d==null?void 0:d.data)==null?void 0:y.data)||(d==null?void 0:d.data));((h=(p=d==null?void 0:d.config)==null?void 0:p.headers)==null?void 0:h.key)&&g&&(this.tropicals={data:g,list:(f=d.data)==null?void 0:f.data,active:!0,cached:!0,type:"json",etime:c.data.etime,version:Math.random()+1})}).catch(d=>{console.log(`tropicals fetch layer error: ${d}`)})}a=new Date().valueOf()-(t+e),console.log("tropicals elapsed: ",a,", total: ",e+=a)}},handleRefresh(){var e,a;(((a=(e=this.tropicals)==null?void 0:e.data)==null?void 0:a.features)||[]).forEach(r=>{var l,n,s,c,m,d,g,u,y,p,h,f,x,v,b,k,A,L,C;let i="";switch(!0){case(((l=r.properties.wind)==null?void 0:l.kts)<32||((n=r.properties)==null?void 0:n.kts)<32):i="td";break;case(((s=r.properties.wind)==null?void 0:s.kts)<47||((c=r.properties)==null?void 0:c.kts)<47):i="ts";break;case(((m=r.properties.wind)==null?void 0:m.kts)<63||((d=r.properties)==null?void 0:d.kts)<63):i="sts";break;case(((g=r.properties.wind)==null?void 0:g.kts)<79||((u=r.properties)==null?void 0:u.kts)<79):i="ty";break;case(((y=r.properties.wind)==null?void 0:y.kts)<94||((p=r.properties)==null?void 0:p.kts)<94):i="sty";break;case(((h=r.properties.wind)==null?void 0:h.kts)>=94||((f=r.properties)==null?void 0:f.kts)>=94):i="superTy";break;default:i="superTy";break}r.properties.levelI18n=i,((x=r.geometry)==null?void 0:x.type)==="Point"&&((v=r.properties)!=null&&v.important)&&(r.properties.format=(k=(b=_(r.properties.date))==null?void 0:b.utcOffset(this.timeZone))==null?void 0:k.format(`MMM-DD/HHmm [(utc${this.computeTimezone})]`)),((A=r.geometry)==null?void 0:A.type)==="Point"&&(r.properties.Name=((C=(L=r.properties.name)==null?void 0:L.trim())==null?void 0:C.replace(/^./,z=>z.toUpperCase()))||r.properties.nameCn,r.properties.nameCn=r.properties.nameCn||r.properties.Name||"-")}),this.handleInit()},handleInit(){var t,e,a,r,i,l,n,s,c,m,d,g;this.handleClear(),this.tropicals&&this.map&&(this.handleRender(),(t=this.map)==null||t.on("click",this.clickLayers,this.handleClick),(e=this.map)==null||e.on("mousemove",this.hoverLayers,this.handleHover),(a=this.map)==null||a.on("mouseleave",this.hoverLayers,this.handleLeave)),((l=(i=(r=this.tropicals)==null?void 0:r.data)==null?void 0:i.features)==null?void 0:l.length)>0?(c=(s=(n=this.$parent)==null?void 0:n.$refs)==null?void 0:s.idmBottomBar)==null||c.handleToggle("tropical",!0):(g=(d=(m=this.$parent)==null?void 0:m.$refs)==null?void 0:d.idmBottomBar)==null||g.handleToggle("tropical",!1)},handleRender(){var t,e,a,r,i,l,n,s,c,m;if(this.tropicals&&this.map){const d=new Date().valueOf();let g=0,u=0;(t=this.map)!=null&&t.getSource(this.source)?((a=this.map)==null||a.getSource(this.source).setData((e=this.tropicals)!=null&&e.active?this.tropicals.data:this.empty),u=new Date().valueOf()-(d+g)):(this.map.addSource(this.source,{type:"geojson",data:(r=this.tropicals)!=null&&r.active?(i=this.tropicals)==null?void 0:i.data:this.empty}),this.map.addLayer({id:this.historyLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["==","type","history"],["!=","disabled",!0]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.Theme.current.value.colors["on-surface"],"line-width":3,"line-opacity":.7}},this.beforeLayer),this.map.addLayer({id:this.forecastLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["==","type","forecast"],["!=","disabled",!0]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["match",["get","model"],"cma",this.Theme.current.value.colors["tropicals-cma"],"jma",this.Theme.current.value.colors["tropicals-jma"],"ecmwf",this.Theme.current.value.colors["tropicals-ecmwf"],"ukm",this.Theme.current.value.colors["tropicals-ukm"],"noaa-at",this.Theme.current.value.colors["tropicals-noaa-at"],"noaa-ep",this.Theme.current.value.colors["tropicals-noaa-ep"],this.Theme.current.value.colors["tropicals-noaa-other"]],"line-width":2,"line-opacity":1,"line-dasharray":[1,2]}},this.beforeLayer),this.map.addLayer({id:this.forecastModelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","LineString"],["==","type","forecast"],["!=","disabled",!0]],layout:{"symbol-placement":"line","text-field":"{model}","text-rotation-alignment":"viewport","text-size":12},paint:{"text-color":this.Theme.current.value.dark?"#333":"#fff","text-opacity":1,"text-halo-color":["match",["get","model"],"cma",this.Theme.current.value.colors["tropicals-cma"],"jma",this.Theme.current.value.colors["tropicals-jma"],"ecmwf",this.Theme.current.value.colors["tropicals-ecmwf"],"ukm",this.Theme.current.value.colors["tropicals-ukm"],"noaa-at",this.Theme.current.value.colors["tropicals-noaa-at"],"noaa-ep",this.Theme.current.value.colors["tropicals-noaa-ep"],this.Theme.current.value.colors["tropicals-noaa-other"]],"text-halo-width":4}},this.beforeLayer),u=new Date().valueOf()-(d+g),console.log("[tropical] add elapsed: ",u,", total: ",g+=u)),(l=this.map)!=null&&l.getSource(this.clusterSource)?((s=this.map)==null||s.getSource(this.clusterSource).setData((n=this.tropicals)!=null&&n.active?this.tropicals.data:this.empty),u=new Date().valueOf()-(d+g),console.log("[tropical] update elapsed: ",u,", total: ",g+=u)):(this.map.addSource(this.clusterSource,{type:"geojson",data:(c=this.tropicals)!=null&&c.active?(m=this.tropicals)==null?void 0:m.data:this.empty}),this.map.addLayer({id:this.pointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":5,"circle-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.pointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":4,"circle-color":["case",["boolean",["==",["get","kts",["get","wind"]],null]],this.Theme.current.value.colors["tropicals-td"],["boolean",["<",["get","kts",["get","wind"]],32]],this.Theme.current.value.colors["tropicals-td"],["boolean",["<",["get","kts",["get","wind"]],47]],this.Theme.current.value.colors["tropicals-ts"],["boolean",["<",["get","kts",["get","wind"]],63]],this.Theme.current.value.colors["tropicals-sts"],["boolean",["<",["get","kts",["get","wind"]],79]],this.Theme.current.value.colors["tropicals-ty"],["boolean",["<",["get","kts",["get","wind"]],94]],this.Theme.current.value.colors["tropicals-sty"],["boolean",[">=",["get","kts",["get","wind"]],94]],this.Theme.current.value.colors["tropicals-super-ty"],"#fff"]}},this.beforeLayer),this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.clusterSource,minzoom:5,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[1,0],"text-anchor":"left","text-size":10},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.historyPointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],paint:{"circle-radius":6,"circle-color":"#fff"}},this.beforeLayer),this.map.addLayer({id:this.historyPointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],paint:{"circle-radius":5,"circle-color":"rgba(0,0,0,0.7)"}},this.beforeLayer),this.map.addLayer({id:this.historyPointCircleLayer+"-inner",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],paint:{"circle-radius":3,"circle-color":"#fff"}},this.beforeLayer),this.map.addLayer({id:this.historyPointLabelLayer,type:"symbol",source:this.clusterSource,minzoom:5,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[1,0],"text-anchor":"left","text-size":10},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.forecastNameLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["==","important",!0]],layout:{"text-field":["get",this.locale==="en"?"Name":"nameCn"],"text-anchor":"bottom","text-size":16,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-font":["DIN Pro Regular","Arial Unicode MS Regular"],"text-offset":[0,2]},paint:{"text-color":this.Theme.current.value.colors["map-blue"],"text-halo-color":"#ffffff","text-halo-width":2}},this.beforeLayer),u=new Date().valueOf()-(d+g),console.log("[tropical] add elapsed: ",u,", total: ",g+=u));const y=P.TropicalHelper.interpolate(this.tropicals,1);this.interpolateData=JSON.parse(JSON.stringify(y)),this.handleDateChange()}},handleClear(){var t,e,a,r,i;this.map&&(this.map.getLayer(this.historyLayer)&&this.map.removeLayer(this.historyLayer),this.map.getLayer(this.forecastLayer)&&this.map.removeLayer(this.forecastLayer),this.map.getLayer(this.forecastModelLayer)&&this.map.removeLayer(this.forecastModelLayer),this.map.getLayer(this.forecastNameLayer)&&this.map.removeLayer(this.forecastNameLayer),this.map.getLayer(this.pointCircleLayer)&&this.map.removeLayer(this.pointCircleLayer),this.map.getLayer(this.pointCircleLayer+"-border")&&this.map.removeLayer(this.pointCircleLayer+"-border"),this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.historyPointCircleLayer)&&this.map.removeLayer(this.historyPointCircleLayer),this.map.getLayer(this.historyPointCircleLayer+"-border")&&this.map.removeLayer(this.historyPointCircleLayer+"-border"),this.map.getLayer(this.historyPointCircleLayer+"-inner")&&this.map.removeLayer(this.historyPointCircleLayer+"-inner"),this.map.getLayer(this.historyPointLabelLayer)&&this.map.removeLayer(this.historyPointLabelLayer),this.map.getLayer(this.interpolateLineLayer)&&this.map.removeLayer(this.interpolateLineLayer),(t=this.interpolateMarkers)==null||t.forEach(l=>l==null?void 0:l.remove()),this.map.getSource(this.source)&&this.map.removeSource(this.source),this.map.getSource(this.clusterSource)&&this.map.removeSource(this.clusterSource),this.map.getSource(this.interpolateSource)&&this.map.removeSource(this.interpolateSource)),(e=this.map)==null||e.off("click",this.clickLayers,this.handleClick),(a=this.map)==null||a.off("mousemove",this.hoverLayers,this.handleHover),(r=this.map)==null||r.off("mouseleave",this.hoverLayers,this.handleLeave),(i=this.map)==null||i.off("render",this.handleUpdateMarkerVisibility),this.handleCloseInfoMarker()},handleUpdateMarkerVisibility(){const t=this.map;if(!t)return;const e=t.getCenter();for(const a of this.interpolateMarkers||[]){const r=a==null?void 0:a.getElement();if(!r)continue;const i=a.getLngLat(),n=E.distance(e.toArray(),[i.lng,i.lat],{units:"radians"})>=Math.PI/2?"hidden":"visible";r.style.visibility!==n&&(r.style.visibility=n)}},handleDateChange(){var t,e,a,r,i,l,n,s,c,m,d,g,u,y,p,h,f,x,v,b,k,A,L,C,z,M,T,N,F,O,q,$,le,S,Z;if((t=this.interpolateMarkers)==null||t.forEach(H=>H==null?void 0:H.remove()),(e=this.interpolateData)!=null&&e.length&&this.tropicals.active){const H=_(this.realTime).utc().set({minute:0,second:0,millisecond:0}),te=this.interpolateData.filter(V=>V.properties.date===(H==null?void 0:H.format())&&!V.properties.disabled),W=this.handleComputePolygons(te),I=E.featureCollection([...te]);W.forEach(V=>{I.features.push(V)}),(a=this.map)!=null&&a.getSource(this.interpolateSource)?(r=this.map)==null||r.getSource(this.interpolateSource).setData(I):((i=this.map)==null||i.addSource(this.interpolateSource,{type:"geojson",data:I}),(l=this.map)==null||l.addLayer({id:this.interpolateLineLayer,type:"line",source:this.interpolateSource,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-opacity":1,"line-color":["match",["get","level"],7,this.Theme.current.value.colors["tropicals-r7"],10,this.Theme.current.value.colors["tropicals-r10"],this.Theme.current.value.colors["tropicals-r10"]],"line-width":1}},"empty-layer-3")),this.interpolateMarkers=[];const K=[];for(const V of te)if(!V.properties.disabled){if(!K.some(re=>{var ue;return re.properties.name===((ue=V.properties)==null?void 0:ue.name)})){const re=((s=(n=this.tropicals.data.features.find(ue=>{var ye;return ue.properties.name===((ye=V.properties)==null?void 0:ye.name)}))==null?void 0:n.properties)==null?void 0:s.nameCn)||((c=V.properties)==null?void 0:c.Name)||"-";V.properties.nameCn=re,V.properties.Name=((d=(m=V.properties.name)==null?void 0:m.trim())==null?void 0:d.replace(/^./,ue=>ue.toUpperCase()))||V.properties.nameCn,K.push(V)}let Y=this.Theme.current.value.colors["tropicals-ty"];((u=(g=V.properties)==null?void 0:g.wind)==null?void 0:u.kts)<32||!((p=(y=V.properties)==null?void 0:y.wind)!=null&&p.kts)?Y=this.Theme.current.value.colors["tropicals-td"]:((f=(h=V.properties)==null?void 0:h.wind)==null?void 0:f.kts)>=32&&((v=(x=V.properties)==null?void 0:x.wind)==null?void 0:v.kts)<47?Y=this.Theme.current.value.colors["tropicals-ts"]:((k=(b=V.properties)==null?void 0:b.wind)==null?void 0:k.kts)>=47&&((L=(A=V.properties)==null?void 0:A.wind)==null?void 0:L.kts)<63?Y=this.Theme.current.value.colors["tropicals-sts"]:((z=(C=V.properties)==null?void 0:C.wind)==null?void 0:z.kts)>=63&&((T=(M=V.properties)==null?void 0:M.wind)==null?void 0:T.kts)<79?Y=this.Theme.current.value.colors["tropicals-ty"]:((F=(N=V.properties)==null?void 0:N.wind)==null?void 0:F.kts)>=79&&((q=(O=V.properties)==null?void 0:O.wind)==null?void 0:q.kts)<94?Y=this.Theme.current.value.colors["tropicals-sty"]:((le=($=V.properties)==null?void 0:$.wind)==null?void 0:le.kts)>=94?Y=this.Theme.current.value.colors["tropicals-super-ty"]:Y=this.Theme.current.value.colors["tropicals-ty"];const ee=`<svg t="1719918955501"
|
|
623
|
+
`,["get","val"],{"font-scale":1}],"text-rotation-alignment":"map","text-line-height":1.3,"text-size":12,"text-font":["DIN Pro Regular","Arial Unicode MS Regular"]},paint:{"text-color":this.theme==="light"?["step",["get","val"],"rgba(0, 0, 0, 0.5)",920,"rgba(0, 0, 0, 0.5)",980,"rgba(0, 0, 0, 0.7)",1100,"rgba(0, 0, 0, 0.7)"]:"rgba(0,0,0,1)","text-halo-color":["step",["get","val"],"rgba(162,13,2,1)",920,"rgba(255, 96, 98, 1)",980,"rgba(255, 246, 184, 1)",1100,"rgba(199,171,250,1)"],"text-halo-width":1}},this.beforeLayer),l=new Date().valueOf()-(r+i),console.log("[prmsl] add elapsed: ",l,", total: ",i+=l))}},handleClear(){this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.labelLayer)&&this.map.removeLayer(this.labelLayer),this.map.getLayer(this.layer)&&this.map.removeLayer(this.layer),this.map.getSource(this.source)&&this.map.removeSource(this.source)}}};function ym(t,e,a,r,i,l){return null}const bm=Q(fm,[["render",ym]]),wm={name:"IdmIceEdge",components:{LegendBar:it},props:{factor:{type:Object},viewport:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[ice-edge] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[0,"rgba(86, 169, 230, 0)"],[1/255,"rgba(86, 169, 230, 0)"],[25/255,"rgba(86, 169, 230, 1)"],[25/255,"rgba(47, 226, 155, 1)"],[100/255,"rgba(47, 226, 155, 1)"],[100/255,"rgba(213, 253, 37, 1)"],[175/255,"rgba(213, 253, 37, 1)"],[175/255,"rgba(230, 176, 39, 1)"],[225/255,"rgba(230, 176, 39, 1)"],[225/255,"rgba(230, 84, 39, 1)"],[250/255,"rgba(230, 84, 39, 1)"],[1,"rgba(230, 84, 39, 1)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},xm={key:0};function km(t,e,a,r,i,l){var s;const n=o.resolveComponent("LegendBar");return(s=a.factor)!=null&&s.active?(o.openBlock(),o.createElementBlock("div",xm,[o.createVNode(n,o.mergeProps({class:"ice-edge",unit:"%",labels:["",10,"","",40,"","",70,"",90,""],"unit-color":"rgba(var(--v-theme-black), 0.7)"},t.$attrs),null,16)])):o.createCommentVNode("",!0)}const Am=Q(wm,[["render",km]]),Lm={name:"IdmCover",components:{LegendBar:it},props:{factor:{type:Object},viewport:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[ice-cover] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[0,"rgba(68, 1, 84, 0)"],[1/255,"rgba(63, 72, 137, 0)"],[50/255,"rgba(53, 125, 177, 1)"],[100/255,"rgba(33, 145, 140, 1)"],[150/255,"rgba(45, 178, 125, 1)"],[200/255,"rgba(112, 207, 87, 1)"],[250/255,"rgba(253, 231, 37, 0.8)"],[1,"rgba(253, 231, 37, 1)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},vm={key:0};function Cm(t,e,a,r,i,l){var s;const n=o.resolveComponent("LegendBar");return(s=a.factor)!=null&&s.active?(o.openBlock(),o.createElementBlock("div",vm,[o.createVNode(n,o.mergeProps({class:"ice-cover",unit:"%",labels:[20,40,60,80,100]},t.$attrs),null,16)])):o.createCommentVNode("",!0)}const _m=Q(Lm,[["render",Cm]]),zm={name:"IdmThickness",components:{LegendBar:it},props:{factor:{type:Object},viewport:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[ice-thickness] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[0,"rgba(4, 6, 19, 0)"],[1/255,"rgba(4, 6, 19, 0)"],[20/255,"rgba(51, 50, 102, 1)"],[40/255,"rgba(63, 82, 158, 1)"],[50/255,"rgba(66, 123, 183, 1)"],[60/255,"rgba(92, 161, 197, 1)"],[80/255,"rgba(134, 199, 212, 0.7)"],[100/255,"rgba(134, 199, 212, 1)"],[150/255,"rgba(234, 253, 2536, 0.8)"],[250/255,"rgba(234, 253, 2536, 0.9)"],[1,"rgba(234, 253, 2536, 1)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},Sm={key:0};function Pm(t,e,a,r,i,l){var s;const n=o.resolveComponent("LegendBar");return(s=a.factor)!=null&&s.active?(o.openBlock(),o.createElementBlock("div",Sm,[o.createVNode(n,o.mergeProps({class:"ice-thickness",unit:"m",labels:[0,.6,1,1.5,2,3]},t.$attrs),null,16)])):o.createCommentVNode("",!0)}const Mm=Q(zm,[["render",Pm]]),Tm={name:"IdmPrecip3h",components:{LegendBar:it},props:{factor:{type:Object},viewport:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},deeimmediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[precip3h] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[0,"rgba(59, 126, 162, 0)"],[14/255,"rgba(84,170,230, 0)"],[15/255,"rgba(172, 210, 255, 0.8)"],[20/255,"rgba(51,202,248,0.8)"],[30/255,"rgba(3,248,103,0.8)"],[49/255,"rgba(14,201,3,0.8)"],[57/255,"rgba(190,226,2,0.8)"],[73/255,"rgba(248,1,1,0.8)"],[82/255,"rgba(197,5,58,0.8)"],[1,"rgba(197,5,58,0.8)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},Nm={key:0};function Em(t,e,a,r,i,l){var s;const n=o.resolveComponent("LegendBar");return(s=a.factor)!=null&&s.active?(o.openBlock(),o.createElementBlock("div",Nm,[o.createVNode(n,o.mergeProps({class:"precip3h",unit:"mm",labels:[1.5,2,3,7,10,20,30]},t.$attrs),null,16)])):o.createCommentVNode("",!0)}const Vm=Q(Tm,[["render",Em]]),Rm={name:"IdmVisibility",components:{LegendBar:it},props:{factor:{type:Object},viewport:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[visibility] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[0,"rgba(189,50,160,0.8)"],[8/255,"rgba(208,56,56,0.8)"],[27/255,"rgba(190,226,2,0.8)"],[60/255,"rgba(3,236,118,0.8)"],[160/255,"rgba(172, 210,255,0.8)"],[161/255,"rgba(172, 210,255,0)"],[1,"rgba(144,144,144,0)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},Dm={key:0};function Bm(t,e,a,r,i,l){var s;const n=o.resolveComponent("LegendBar");return(s=a.factor)!=null&&s.active?(o.openBlock(),o.createElementBlock("div",Dm,[o.createVNode(n,o.mergeProps({class:"visibility",unit:"nm",labels:[0,.5,1.5,3,9]},t.$attrs),null,16)])):o.createCommentVNode("",!0)}const Im=Q(Rm,[["render",Bm]]),Fm={name:"IdmWaterTemp",components:{LegendBar:it},props:{factor:{type:Object},viewport:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0,a=0;this.handleDraw(),a=new Date().valueOf()-(t+e),console.log("[water-temp] add elapsed: ",a,", total: ",e+=a)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[0,"rgba(95, 143, 197)"],[46/255,"rgba(95, 143, 197)"],[69/255,"rgb(80, 140, 62)"],[92/255,"rgb(121, 146, 28)"],[115/255,"rgb(171, 161, 14)"],[138/255,"rgb(223, 177, 69)"],[161/255,"rgb(243, 150, 6)"],[184/255,"rgb(236, 95, 21)"],[207/255,"rgb(190, 65, 18)"],[230/255,"rgb(138, 43, 10)"],[1,"rgb(138, 43, 10)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},Gm={key:0};function jm(t,e,a,r,i,l){var s;const n=o.resolveComponent("LegendBar");return(s=a.factor)!=null&&s.active?(o.openBlock(),o.createElementBlock("div",Gm,[o.createVNode(n,o.mergeProps({class:"water-temp",unit:"°C",labels:[0,10,20,30,40]},t.$attrs),null,16)])):o.createCommentVNode("",!0)}const Wm=Q(Fm,[["render",jm]]),Zm={name:"IdmTemp",components:{LegendBar:it},props:{factor:{type:Object},viewport:{type:Object}},data(){return{program:void 0,context:void 0,texture:void 0,rampColor:void 0,aPositionBuffer:void 0,webgl:new $e,etime:void 0}},watch:{"factor.version":{handler(){var t;(t=this.factor)!=null&&t.active?this.handleRender():this.handleClear()},immediate:!0}},methods:{handleRender(){if(this.factor){const t=new Date().valueOf();let e=0;this.handleDraw(),new Date().valueOf()-(t+e)}},handleClear(){this.context=void 0,this.etime=void 0,this.viewport.toggle(!1)},handleSetup(){if(!this.context){if(this.context=this.webgl.createContext(this.viewport.rampColorCanvas),!this.context)return;const t=[[0,"rgb(149, 137, 211)"],[100/255,"rgb(149, 137, 211)"],[110/255,"rgb(150, 209, 216)"],[120/255,"rgb(129, 204, 197)"],[130/255,"rgb(103, 180, 186)"],[140/255,"rgb(95, 143, 197)"],[150/255,"rgb(80, 140, 62)"],[160/255,"rgb(121, 146, 28)"],[170/255,"rgb(171, 161, 14)"],[180/255,"rgb(223, 177, 6)"],[190/255,"rgb(243, 150, 6)"],[200/255,"rgb(236, 95, 21)"],[210/255,"rgb(190, 65, 18)"],[220/255,"rgb(138, 43, 10)"],[1,"rgb(138, 43, 10)"]];this.rampColor=this.webgl.setup(this.context,t);const{program:e,aPositionBuffer:a}=this.webgl.bind(this.context,fe.vertexSchema,fe.fragmentSchema);this.program=e,this.aPositionBuffer=a}},async handleDraw(){if(this.handleSetup(),!!this.context){if(this.etime!==this.factor.etime){this.etime=this.factor.etime;const t=await this.webgl.loadImg(this.factor.raw);this.texture=this.webgl.createTexture(this.context,this.context.NEAREST,this.context.LINEAR,this.context.CLAMP_TO_EDGE,t)}this.webgl.draw(this.viewport,this.context,this.program,this.texture,this.rampColor.texture,this.aPositionBuffer),this.viewport.toggle(!0)}}}},Hm={key:0};function Xm(t,e,a,r,i,l){var s;const n=o.resolveComponent("LegendBar");return(s=a.factor)!=null&&s.active?(o.openBlock(),o.createElementBlock("div",Hm,[o.createVNode(n,o.mergeProps({class:"temp",unit:"°C",labels:[-20,-10,0,10,20,30,40]},t.$attrs),null,16)])):o.createCommentVNode("",!0)}const Om=Q(Zm,[["render",Xm]]),jb="",Ym={name:"IdmGlLayer",components:{IdmWindBarb:Wc,IdmWindParticle:Uc,IdmCurrentDirection:Qc,IdmCurrentParticle:tm,IdmSigWaveParticle:rm,IdmSigWaveHeight:sm,IdmSwellParticle:hm,IdmSwellDirection:gm,IdmPrmsl:bm,IdmIceEdge:Am,IdmIceCover:_m,IdmIceThickness:Mm,IdmPrecip3h:Vm,IdmVisibility:Im,IdmWaterTemp:Wm,IdmTemp:Om},props:{simple:{type:Boolean,default:!1},isLogin:{type:Boolean,default:!1},theme:{type:String},map:{type:Object},mapFeather:{type:String},gateway:{type:String},assistGateway:{type:Array,default:[]},defaultMeteoToken:{type:String},top:{type:Number,default:0},paddingTop:{type:Number,default:8},menuHeight:{type:Number,default:248},menuToggle:{type:Object,default:{}},realTime:{type:String},forecastModel:{type:String},beforeLayer:{type:String},platform:{type:String},projection:{type:String}},emits:["forecastModel","menuToggle","weatherCheckList","autoActive","weatherRendered","rampLayersReady"],data(){const t=[...ho.LayerHelper.WEATHER_LAYERS];return{right:10,toggle:!1,autoActive:!0,weatherWeight:0,allLayers:t,tagLayers:t.filter(e=>!e.hide),checkList:[],renderKey:"",iceToggleValue:void 0,weatherLayers:{},activeWeatherLayers:[],cache:{v:"0.0.4",versionKey:"weatherLayerCacheVersionGL4",autoActiveKey:"autoActiveCacheGL4",checkListKey:"weatherCheckListCacheGL4"},models:{},currentModel:localStorage.getItem("forecastModelCacheGL4")==="GFS"?"GFS":"ECMWF",zoom:6,viewport:void 0,viewportSeq:0,particleFactor:void 0,showWindParticle:!0,showCurrentParticle:!0,showSigWaveParticle:!0,showSwellParticle:!0,legendToggle:!1,legend:{barbs:[2,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100,105,0],current:[{label:"0-0.5 kts",size:.3,color:"rgb(58, 164, 58)"},{label:"0.5-1 kts",size:.4,color:"#ffff00"},{label:"1-1.5 kts",size:.6,color:"#ff9500"},{label:"1.5-2 kts",size:.8,color:"#f44336"},{label:">= 2 kts",size:1,color:"#e4711e"}],sigWaveHeight:[{label:"< 2 m",color:"rgba(0,235,156,0)"},{label:"2-3 m",color:"rgba(0,235,156,0.4)"},{label:"3-4 m",color:"#ffed00"},{label:"4-5 m",color:"#ff9800"},{label:"5-6 m",color:"#f77800"},{label:"6-7 m",color:"#e4711e"},{label:"7-8 m",color:"#e06128"},{label:"8-9 m",color:"#dc5132"},{label:"9-10 m",color:"#d5453c"},{label:"10-12 m",color:"#cd3a46"},{label:"12-14 m",color:"#be2c50"},{label:"> 14 m",color:"#aa1a5a"}]}}},computed:{listStyle(){return this.simple?{top:this.top+"px",left:this.toggle?"0px":"-280px",height:"calc(100vh - "+this.top+"px)"}:{top:this.top+"px",right:this.toggle?"0px":"-280px",height:"calc(100vh - "+this.top+"px)"}},computeDateZ(){return function(t){var e;if(t){const a=_(t);return`${(e=a==null?void 0:a.utc())==null?void 0:e.format("MMM-DD/HHmm")}Z`}return"-"}},computeDateUpdate(){return function(t){return t?_(t).fromNow():"-"}},overlaysKeys(){return this.tagLayers.filter(t=>t.overlays).map(t=>t.key)},rendersKeys(){return this.allLayers.filter(t=>!t.overlays&&t.enabled).map(t=>t.key)},showTipMenu(){return this.checkList.includes("wind")||this.checkList.includes("current-direction")||this.checkList.includes("sig-wave-height")},barbsIconName(){var e,a,r;const t=[];for(let i=0;i<((a=(e=this.legend)==null?void 0:e.barbs)==null?void 0:a.length);i++){const l=((r=this.legend)==null?void 0:r.barbs[i])||0,n=l<10?`00${l}kts`:l<100?`0${l}kts`:`${l}kts`;t.push("icon-a-"+n)}return t},lengendTipTop(){return this.platform==="ops"?this.top+this.menuHeight+322:this.top+this.menuHeight+232},viewportKey(){return this.viewport?(this.viewport.isGlobe?"globe":"mercator")+"-"+this.viewportSeq:"none"}},watch:{"menuToggle.v":{handler(){this.toggle=this.menuToggle.weatherLayers,this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})}},currentModel:{handler(t,e){this.$emit("forecastModel",t),localStorage.setItem("forecastModelCacheGL4",t)},immediate:!0},forecastModel:{handler(t,e){t&&t!==e&&this.handleWeatherLayerChange({sourceChanged:!0})}},map:{handler(){var e,a,r,i;const t=this.map;(a=(e=this.viewport)==null?void 0:e.map)==null||a.off("move",this.handleMove4Weather),(i=(r=this.viewport)==null?void 0:r.cleanup)==null||i.call(r),this.viewport=void 0,t&&(this.viewportSeq+=1,this.projection==="globe"?this.viewport=new eo(t):this.viewport=new to(t),t.once("idle",()=>{this.map===t&&(this.fetchCache(),t.on("move",this.handleMove4Weather),this.handleRampColorInitial())}),t.triggerRepaint())},immediate:!0},projection:{handler(t,e){var a,r;!t||t===e||!this.map||!this.viewport||((r=(a=this.viewport)==null?void 0:a.cleanup)==null||r.call(a),this.viewportSeq+=1,t==="globe"?this.viewport=new eo(this.map):this.viewport=new to(this.map),this.handleRampColorInitial(),this.handleMove4Weather(),this.map.triggerRepaint())}},realTime:{handler(t,e){t&&e&&_(t).utc().format("yyyy-MM-DD HH")!==_(e).utc().format("yyyy-MM-DD HH")&&this.$nextTick(()=>{this.fetchWeatherLayers()})},immediate:!0},renderKey:{handler(t,e){if(t&&t!==e){const a=this.checkList.filter(r=>!this.rendersKeys.some(i=>i===r));t==="ice-forecast"?(this.iceToggleValue=this.iceToggleValue||"ice-cover",this.checkList=[...a,"ice-forecast",this.iceToggleValue||"ice-cover"]):this.checkList=[...a,t]}else!t&&e&&(this.checkList=this.checkList.filter(a=>a!==e))}},checkList:{handler(t,e){var a,r,i,l,n,s;this.handleCheckListChange(t,e),this.$emit("weatherCheckList",t),this.autoActive&&this.checkList.length?(i=(r=(a=this.$parent)==null?void 0:a.$refs)==null?void 0:r.idmBottomBar)==null||i.handleToggle("weather",!0):(s=(n=(l=this.$parent)==null?void 0:l.$refs)==null?void 0:n.idmBottomBar)==null||s.handleToggle("weather",!1)}},autoActive:{handler(t){var e,a,r,i,l,n;localStorage.setItem(this.cache.autoActiveKey,this.autoActive),this.activeWeatherLayers=this.autoActive?this.allLayers.filter(s=>this.checkList.includes(s.key)):[],this.handleWeatherLayerChange(),this.autoActive&&this.checkList.length?(r=(a=(e=this.$parent)==null?void 0:e.$refs)==null?void 0:a.idmBottomBar)==null||r.handleToggle("weather",!0):(n=(l=(i=this.$parent)==null?void 0:i.$refs)==null?void 0:l.idmBottomBar)==null||n.handleToggle("weather",!1),this.$emit("autoActive",this.autoActive)}},iceToggleValue:{handler(t){if(t){const e=this.checkList.filter(a=>!this.rendersKeys.some(r=>r===a));this.checkList=[...e,"ice-forecast",this.iceToggleValue]}}},showWindParticle:{handler(t){let e="wind-particle";this.weatherLayers[e]&&(this.weatherLayers[e].particle=t,this.weatherLayers[e].version=Math.random()+1)}},showCurrentParticle:{handler(t){let e="current-particle";this.weatherLayers[e]&&(this.weatherLayers[e].particle=t,this.weatherLayers[e].version=Math.random()+1)}},showSigWaveParticle:{handler(t){const e=this.weatherLayers["sig-wave-particle"];e&&(e.particle=t)}},showSwellParticle:{handler(t){const e=this.weatherLayers["swell-particle"];e&&(e.particle=t)}},isLogin:{handler(t){t?this.fetchModels():this.models={}},immediate:!0}},mounted(){this.fetchModels()},beforeUnmount(){var t,e,a,r;(e=(t=this.viewport)==null?void 0:t.map)==null||e.off("move",this.handleMove4Weather),(r=(a=this.viewport)==null?void 0:a.cleanup)==null||r.call(a),this.viewport=void 0},methods:{arraysEqual(t,e){if((t==null?void 0:t.length)!==(e==null?void 0:e.length))return!1;for(let a=0;a<(t==null?void 0:t.length);a++)if((t==null?void 0:t[a])!==(e==null?void 0:e[a]))return!1;return!0},normalizeWaveSelection(t){const e=t.map(a=>a==="sig-wave"?"sig-wave-particle":a==="swell"?"swell-particle":a);return[...new Set(e)].filter(a=>this.allLayers.some(r=>r.key===a))},fetchCache(){const t=localStorage.getItem(this.cache.versionKey);this.cache.v!==t&&(localStorage.removeItem(this.cache.autoActiveKey),localStorage.removeItem(this.cache.checkListKey),localStorage.setItem(this.cache.versionKey,this.cache.v));let e=localStorage.getItem(this.cache.autoActiveKey);this.autoActive=e!=="false",localStorage.setItem(this.cache.autoActiveKey,this.autoActive),e=localStorage.getItem(this.cache.checkListKey);const a=JSON.parse(e||JSON.stringify(["wind","sig-wave-height"]));this.iceToggleValue=a.includes("ice-thickness")?"ice-thickness":void 0,this.checkList=this.normalizeWaveSelection(a),this.renderKey=this.checkList.find(r=>this.rendersKeys.includes(r))||"",localStorage.setItem(this.cache.checkListKey,JSON.stringify(this.checkList))},handleMenuToggle(){this.$emit("menuToggle","weatherLayers")},handleFastWeatherToggle(t){let e=[];this.checkList.includes(t)?e=this.checkList.filter(a=>a!==t):(e=[...this.checkList,t],this.checkList=e),this.handleCheckListChange(e,this.checkList)},handleCheckListChange(t,e){if(this.arraysEqual(t,e))return this.handleMove4Weather(),!1;const a=[...new Set(t)],r=a==null?void 0:a.filter(n=>!(e!=null&&e.includes(n)))[0],i=e==null?void 0:e.filter(n=>!(a!=null&&a.includes(n)))[0],l=this.checkList.filter(n=>!this.rendersKeys.some(s=>s===n));if(r)if(r==="ice-cover"||r==="ice-thickness"||r==="ice-forecast")this.checkList=[...l,"ice-forecast",this.iceToggleValue||"ice-cover"],this.iceToggleValue=this.iceToggleValue||"ice-cover";else if(this.rendersKeys.includes(r))this.checkList=[...l,r];else{const n=a.filter(c=>!this.rendersKeys.includes(c)),s=this.checkList.filter(c=>this.rendersKeys.includes(c));this.checkList=[...n,...s]}i&&(i==="ice-forecast"?(this.checkList=a.filter(n=>!["ice-cover","ice-thickness","ice-forecast"].includes(n)),this.iceToggleValue=void 0):this.checkList=a),this.checkList.includes("wind-particle")&&!(e!=null&&e.includes("wind-particle"))&&(this.showWindParticle=!0),this.checkList.includes("current-particle")&&!(e!=null&&e.includes("current-particle"))&&(this.showCurrentParticle=!0),this.checkList.includes("sig-wave-particle")&&!(e!=null&&e.includes("sig-wave-particle"))&&(this.showSigWaveParticle=!0),this.checkList.includes("swell-particle")&&!(e!=null&&e.includes("swell-particle"))&&(this.showSwellParticle=!0),localStorage.setItem(this.cache.checkListKey,JSON.stringify(a)),this.activeWeatherLayers=this.autoActive?this.allLayers.filter(n=>a.includes(n.key)):[],this.handleWeatherLayerChange()},async fetchModels(){this.models={};const t=await de.get(`${this.gateway}/api/arc/meteo2/models2`,{headers:{Authorization:this.defaultMeteoToken}});(t==null?void 0:t.data.code)===0&&(this.models=t==null?void 0:t.data.data)},async fetchWeatherLayers(t={}){var r,i,l,n,s,c,m,d,g;const e=new Date().valueOf();let a=0;if(this.map){const u=((r=this.map)==null?void 0:r.getZoom())+1,y=(i=this.map)==null?void 0:i.getBounds(),p=`${y._sw.lng},${y._sw.lat},${y._ne.lng},${y._ne.lat}`;if(this.particleFactor&&((l=this.$refs.layer)!=null&&l.autoActive)){const h=ho.LayerHelper.WEATHER_LAYERS.find(f=>{var x;return((x=f.peer)==null?void 0:x.weight)===this.particleFactor.weight});this.particleFactor.particle&&(this.showWindParticle||this.showCurrentParticle)?this.weatherWeight=this.weatherWeight&h.weight?this.weatherWeight:this.weatherWeight+h.weight:this.weatherWeight=this.weatherWeight&h.weight?this.weatherWeight-h.weight:this.weatherWeight}if(this.weatherWeight>0){let h=this.weatherWeight;if(h>0){const f=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],x=await de.get(`${f}/api/arc/weather/layers2/links?l=${h}&v=${this.forecastModel}&z=${u}&bbox=${p}&t=${this.realTime}`,{headers:{Authorization:this.defaultMeteoToken}});if(new Date().valueOf()-(e+a),((n=x==null?void 0:x.data)==null?void 0:n.code)===0){const v=(s=x==null?void 0:x.data)==null?void 0:s.data,b=[];for(const A in v)b.push(de.get(v[A],{headers:{Authorization:this.defaultMeteoToken,key:A},responseType:/\.(jpg|png)$/.test(v[A])?"blob":"json"}).catch(L=>{console.log(`[${A}] fetch layer error: ${L}`)}));const k=await Promise.all(b);this.weatherLayers={},k.map(A=>{var z,M,T,N;const L=((z=A==null?void 0:A.data)==null?void 0:z.data)||(A==null?void 0:A.data);let C=(T=(M=A==null?void 0:A.config)==null?void 0:M.headers)==null?void 0:T.key;C==="sig-wave"&&(C="sig-wave-particle"),C==="swell"&&(C="swell-particle"),C&&L&&(this.weatherLayers[C]={raw:L,type:((N=A==null?void 0:A.config)==null?void 0:N.responseType)==="blob"?"image":"json",etime:x.data.etime})})}if(new Date().valueOf()-(e+a),this.weatherLayers["current-direction"]||this.weatherLayers["current-speed"]){const v=(c=this.weatherLayers["current-direction"])==null?void 0:c.raw,b=(m=this.weatherLayers["current-speed"])==null?void 0:m.raw;delete this.weatherLayers["current-direction"],delete this.weatherLayers["current-speed"],this.weatherLayers.current={type:"json",direction:v,speed:{raw:b},etime:x.data.etime}}if(this.weatherLayers["swell-direction"]||this.weatherLayers["swell-height"]){const v=(d=this.weatherLayers["swell-direction"])==null?void 0:d.raw,b=(g=this.weatherLayers["swell-height"])==null?void 0:g.raw;delete this.weatherLayers["swell-direction"],delete this.weatherLayers["swell-height"],this.weatherLayers["swell-direction-contour"]={type:"json",direction:v,height:{raw:b},etime:x.data.etime}}}}this.handleWeatherLayerToggle(),this.handleDrawWeather4Json(),this.$nextTick(()=>{var h,f,x,v,b;(b=(v=(x=(f=(h=this.$parent)==null?void 0:h.$refs)==null?void 0:f.idmBottomBar)==null?void 0:x.$refs)==null?void 0:v.capture)==null||b.captureCurrentFrame()})}},handleWeatherLayerToggle(){for(const t in this.weatherLayers)this.weatherLayers[t].active=!1,this.weatherLayers[t].version=Math.random()+1;for(const t of this.activeWeatherLayers){let e=t.key;e==="current-direction"&&(e="current"),this.weatherLayers[e]&&(this.weatherLayers[e].active=!0,this.weatherLayers[e].version=Math.random()+1,e==="wind-particle"&&(this.weatherLayers[e].particle=this.showWindParticle),e==="current-particle"&&(this.weatherLayers[e].particle=this.showCurrentParticle),e==="sig-wave-particle"&&(this.weatherLayers[e].particle=this.showSigWaveParticle),e==="swell-particle"&&(this.weatherLayers[e].particle=this.showSwellParticle))}},handleWeatherLayerChange(t={sourceChanged:!1}){var a;const e=(a=this.activeWeatherLayers)==null?void 0:a.reduce((r,i)=>r+(r&(i==null?void 0:i.weight)?0:i==null?void 0:i.weight),0);t!=null&&t.sourceChanged||this.weatherWeight!==e?(this.weatherWeight=e,this.fetchWeatherLayers()):this.handleWeatherLayerToggle()},handleRampColorInitial(){var t,e,a,r,i,l,n,s,c,m,d,g,u;if((t=this.viewport)!=null&&t.isGlobe){this.viewport.initGlobeLayers(this.beforeLayer),this.$emit("rampLayersReady");return}this.viewport.map.getSource((e=this.viewport)==null?void 0:e.rampColorSource)||this.viewport.map.addSource((a=this.viewport)==null?void 0:a.rampColorSource,{type:"canvas",canvas:(r=this.viewport)==null?void 0:r.rampColorCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((i=this.viewport)==null?void 0:i.rampColorLayer)||this.viewport.map.addLayer({type:"raster",id:(l=this.viewport)==null?void 0:l.rampColorLayer,source:(n=this.viewport)==null?void 0:n.rampColorSource,layout:{visibility:"none"},paint:{"raster-fade-duration":0}},this.beforeLayer),this.viewport.map.getSource((s=this.viewport)==null?void 0:s.particleSource)||this.viewport.map.addSource((c=this.viewport)==null?void 0:c.particleSource,{type:"canvas",canvas:(m=this.viewport)==null?void 0:m.particleCanvas,animate:!0,coordinates:this.viewport.getBoundLngLat()}),this.viewport.map.getLayer((d=this.viewport)==null?void 0:d.particleLayer)||this.viewport.map.addLayer({type:"raster",id:(g=this.viewport)==null?void 0:g.particleLayer,source:(u=this.viewport)==null?void 0:u.particleSource,layout:{visibility:"none"},paint:{"raster-fade-duration":0}},this.beforeLayer),this.$emit("rampLayersReady")},handleDrawWeather4Json(){var l,n,s,c,m,d,g;const t=new Date().valueOf();let e=0,a=0;const r=(l=this.map)==null?void 0:l.getBounds(),i=(n=this.map)==null?void 0:n.getZoom();if(r&&i){const u=P.LngLatHelper.convertToStdLng(r._sw.lng),y=P.LngLatHelper.convertToStdLng(r._ne.lng),p=Math.floor(r._sw.lat),h=Math.ceil(r._ne.lat);for(const f in this.weatherLayers){let x=!1;if(this.weatherLayers[f].active&&this.weatherLayers[f].type==="json"){let v=[];if(f==="current"){x=!0;const b=((s=this.weatherLayers[f])==null?void 0:s.direction)||{};for(const A in b)if(A>p&&A<h&&(!(i<=this.zoom)||A%(i<2?10:i<4?5:3)===0)){const L=b[A].lng;u>y?L.forEach((C,z)=>{var M,T,N,F,O,q;if(i<2){if((C>=0&&C<=360||C>=-360&&C<=0)&&C%10===0){const $=E.point([C,A],{val:((M=b[A].val)==null?void 0:M[z])||((T=b[A].dir)==null?void 0:T[z]),spd:(N=b[A].spd)==null?void 0:N[z]});v.push($)}}else if((C>=u&&C<=180||C>=-180&&C<=y)&&(!(i<=this.zoom)||C%(i<2?10:i<4?5:3)===0)){const $=E.point([C,A],{val:((F=b[A].val)==null?void 0:F[z])||((O=b[A].dir)==null?void 0:O[z]),spd:(q=b[A].spd)==null?void 0:q[z]});v.push($)}}):L.forEach((C,z)=>{var M,T,N,F,O,q;if(u<2){if((C>=0&&C<=360||C>=-360&&C<=0)&&C%10===0){const $=E.point([C,A],{val:((M=b[A].val)==null?void 0:M[z])||((T=b[A].dir)==null?void 0:T[z]),spd:(N=b[A].spd)==null?void 0:N[z]});v.push($)}}else if(C>=u&&C<=y&&(!(i<=this.zoom)||C%(i<this.zoom/2?5:3)===0)){const $=E.point([C,A],{val:((F=b[A].val)==null?void 0:F[z])||((O=b[A].dir)==null?void 0:O[z]),spd:(q=b[A].spd)==null?void 0:q[z]});v.push($)}})}a=new Date().valueOf()-(t+e);const k=this.weatherLayers[f].speed;if(k){if(!k.data){const L=[];for(const C in(c=k.raw)==null?void 0:c.Polygon){const z=k.raw.Polygon[C];for(const M of z)L.push(E.polygon(M,{val:Number(C)}))}k.data=E.featureCollection(L)}const A=i<this.zoom?k.data.features.filter(L=>L.properties.val>.5):k.data.features;v=v.concat(A),a=new Date().valueOf()-(t+e)}}else if(f==="wind"){x=!0;const b=this.weatherLayers.wind.raw;for(const k in b)if(k>p&&k<h&&(!(i<=this.zoom)||k%(i<2?10:i<4?5:3)===0)){const A=b[k].lng;u>y?A.forEach((L,C)=>{var z,M,T,N;if(i<2){if((L>=0&&L<=360||L>=-360&&L<=0)&&L%10===0){const F=E.point([L,k],{dir:((z=b[k].val)==null?void 0:z[C])||((M=b[k].dir)==null?void 0:M[C]),spd:b[k].spd[C]});v.push(F)}}else if((L>=u&&L<=180||L>=-180&&L<=y)&&(!(i<=this.zoom)||L%(i<2?10:i<4?5:3)===0)){const F=E.point([L,k],{dir:((T=b[k].val)==null?void 0:T[C])||((N=b[k].dir)==null?void 0:N[C]),spd:b[k].spd[C]});v.push(F)}}):A.forEach((L,C)=>{var z,M,T,N;if(i<2){if((L>=0&&L<=360||L>=-360&&L<=0)&&L%10===0){const F=E.point([L,k],{dir:((z=b[k].val)==null?void 0:z[C])||((M=b[k].dir)==null?void 0:M[C]),spd:b[k].spd[C]});v.push(F)}}else if(L>=u&&L<=y&&(!(i<=this.zoom)||L%(i<2?10:i<4?5:3)===0)){const F=E.point([L,k],{dir:((T=b[k].val)==null?void 0:T[C])||((N=b[k].dir)==null?void 0:N[C]),spd:b[k].spd[C]});v.push(F)}})}a=new Date().valueOf()-(t+e)}else if(f==="sig-wave-height"){if(this.weatherLayers[f].data)v=this.weatherLayers[f].data;else{x=!0;const b=this.weatherLayers[f].raw;if(b){const k=[];for(const A in b.Polygon){const L=b.Polygon[A];for(const C of L)k.push(E.polygon(C,{val:Number(A)}))}for(const A in b.MultiPolygon){const L=b.MultiPolygon[A];for(const C of L)k.push(E.multiPolygon(C,{val:Number(A)}))}for(const A in b.Point){const L=b.Point[A];for(let C=0;C<((m=L.lng)==null?void 0:m.length);C++)k.push(E.point([L.lng[C],A],{val:Number(L.val[C])}))}v=v.concat(k)}}a=new Date().valueOf()-(t+e)}else if(f==="prmsl"){if(this.weatherLayers[f].data)v=this.weatherLayers[f].data;else{x=!0;const b=this.weatherLayers[f].raw;if(b){const k=[];for(const A in b.LineString){const L=b.LineString[A];for(const C of L)k.push(E.lineString(C,{val:Number(A)}))}for(const A in b.Point)b.Point[A].lng.forEach((L,C)=>{L=P.LngLatHelper.convertToStdLng(L),k.push(E.point([L,A],{val:b.Point[A].val[C],type:b.Point[A].type[C]}))});v=v.concat(k)}}a=new Date().valueOf()-(t+e)}else if(f==="swell-direction-contour"){x=!0;const b=((d=this.weatherLayers[f])==null?void 0:d.direction)||{};for(const A in b)if(A>p&&A<h&&(!(i<=this.zoom)||A%(i<2?10:i<4?5:3)===0)){const L=b[A].lng;u>y?L.forEach((C,z)=>{var M,T,N,F,O,q;if(i<2){if((C>=0&&C<=360||C>=-360&&C<=0)&&C%10===0){const $=E.point([C,A],{val:((M=b[A].val)==null?void 0:M[z])||((T=b[A].dir)==null?void 0:T[z]),spd:(N=b[A].spd)==null?void 0:N[z]});v.push($)}}else if((C>=u&&C<=180||C>=-180&&C<=y)&&(!(i<=this.zoom)||C%(i<2?10:i<4?5:3)===0)){const $=E.point([C,A],{val:((F=b[A].val)==null?void 0:F[z])||((O=b[A].dir)==null?void 0:O[z]),spd:(q=b[A].spd)==null?void 0:q[z]});v.push($)}}):L.forEach((C,z)=>{var M,T,N,F,O,q;if(u<2){if((C>=0&&C<=360||C>=-360&&C<=0)&&C%10===0){const $=E.point([C,A],{val:((M=b[A].val)==null?void 0:M[z])||((T=b[A].dir)==null?void 0:T[z]),spd:(N=b[A].spd)==null?void 0:N[z]});v.push($)}}else if(C>=u&&C<=y&&(!(i<=this.zoom)||C%(i<2?10:i<4?5:3)===0)){const $=E.point([C,A],{val:((F=b[A].val)==null?void 0:F[z])||((O=b[A].dir)==null?void 0:O[z]),spd:(q=b[A].spd)==null?void 0:q[z]});v.push($)}})}a=new Date().valueOf()-(t+e),console.log("swell direction elapsed: ",a,", total: ",e+=a);const k=this.weatherLayers[f].height;if(k){if(!k.data){const A=[];for(const L in(g=k.raw)==null?void 0:g.LineString){const C=k.raw.LineString[L];for(const z of C)A.push(E.lineString(z,{val:Number(L)}));k.data=E.featureCollection(A)}}if(k.data){const A=this.handleBboxClip(k.data,r);v=v.concat(A)}a=new Date().valueOf()-(t+e),console.log("swell height elapsed: ",a,", total: ",e+=a)}}v.length&&(this.weatherLayers[f].data=E.featureCollection(v)),x&&(this.weatherLayers[f].version=Math.random()+1)}}}},handleBboxClip(t,e){const a=[],r=P.LngLatHelper.convertToStdLng(e._sw.lng),i=P.LngLatHelper.convertToStdLng(e._ne.lng);return t.features.forEach(l=>{if(l.geometry.type!=="Point")if(r>i){let n=[r,e._sw.lat,180,e._ne.lat],s=E.bboxClip(l,n);s.geometry.coordinates.length&&a.push(s),n=[-180,e._sw.lat,i,e._ne.lat],s=E.bboxClip(l,n),s.geometry.coordinates.length&&a.push(s)}else{const n=[r,e._sw.lat,i,e._ne.lat],s=E.bboxClip(l,n);s.geometry.coordinates.length&&a.push(s)}else a.push(l)}),a},handleMove4Weather(){for(const t in this.weatherLayers)this.weatherLayers[t].active&&this.weatherLayers[t].type==="image"&&(this.weatherLayers[t].active=!0,this.weatherLayers[t].version=Math.random()+1);this.handleDrawWeather4Json()}}},Um={class:"idm-gl4-meteo-layers"},Jm={key:0,class:"legend-tip-btn-gl4"},Km={class:"d-flex flex-row justify-start align-center flex-wrap text-body-2"},Qm={class:"d-flex flex-row justify-center align-center"},qm={class:"text-caption"},$m={class:"d-flex flex-row justify-start align-center flex-wrap text-body-2"},ed={class:"d-flex flex-row justify-center align-center"},td={key:0,style:{width:"24px",height:"12px",border:"1px solid rgba(var(--v-border-color), var(--v-border-opacity))"}},od={class:"text-caption px-2"},ad={class:"d-flex flex-row justify-start align-start flex-wrap text-body-2 ml-n1"},id={class:"d-flex flex-row justify-start align-center"},rd={class:"d-flex flex-row justify-center align-center",style:{width:"40px"}},ld={class:"text-caption"},nd={class:"d-flex justify-start align-center ga-3"},sd={class:"text-h5 font-weight-medium"},cd={key:0,class:"w-100 d-flex justify-space-between align-center ga-1 mb-2 px-3"},md={key:0,class:"d-flex justify-start align-center ga-4 pl-6"},dd={key:1,class:"d-flex justify-start align-center ga-4 pl-6"},hd={key:2,class:"d-flex justify-start align-center ga-4 pl-6"},pd={key:3,class:"d-flex justify-start align-center ga-4 pl-6"},ud={class:"text-body-1 py-2"},gd={class:"text-body-1 font-weight-medium"},fd={class:"text-body-2 text-label"},yd={class:"text-body-2 text-label"},bd={class:"text-body-2 text-label mb-3"},wd={class:"text-body-1 font-weight-medium"},xd={class:"text-body-2 text-label"},kd={class:"text-body-2 text-label"},Ad={class:"text-body-2 text-label mb-3"},Ld={class:"text-body-1 py-2"},vd={class:"text-body-1 font-weight-medium"},Cd={class:"text-body-2 text-label"},_d={class:"text-body-2 text-label"},zd={class:"text-body-2 text-label mb-3"},Sd={class:"text-body-1 font-weight-medium"},Pd={class:"text-body-2 text-label"},Md={class:"text-body-2 text-label"},Td={class:"text-body-2 text-label mb-3"},Nd={class:"text-body-1 py-2"},Ed={class:"text-body-1 font-weight-medium"},Vd={class:"text-body-2 text-label"},Rd={class:"text-body-2 text-label"},Dd={class:"text-body-2 text-label mb-3"};function Bd(t,e,a,r,i,l){var S,Z,H,te,W,I,K,V,Y,ee,he,ge,re,ue,ye,ze;const n=o.resolveComponent("VBtn"),s=o.resolveComponent("VTooltip"),c=o.resolveComponent("VCardText"),m=o.resolveComponent("VDivider"),d=o.resolveComponent("VCard"),g=o.resolveComponent("VSwitch"),u=o.resolveComponent("VBtnToggle"),y=o.resolveComponent("VCardTitle"),p=o.resolveComponent("VCardItem"),h=o.resolveComponent("VCheckbox"),f=o.resolveComponent("VRadio"),x=o.resolveComponent("IdmWindBarb"),v=o.resolveComponent("IdmSigWaveHeight"),b=o.resolveComponent("IdmCurrentDirection"),k=o.resolveComponent("IdmSwellDirection"),A=o.resolveComponent("IdmPrmsl"),L=o.resolveComponent("IdmWindParticle"),C=o.resolveComponent("IdmCurrentParticle"),z=o.resolveComponent("IdmSigWaveParticle"),M=o.resolveComponent("IdmSwellParticle"),T=o.resolveComponent("IdmIceEdge"),N=o.resolveComponent("IdmIceCover"),F=o.resolveComponent("IdmIceThickness"),O=o.resolveComponent("IdmPrecip3h"),q=o.resolveComponent("IdmVisibility"),$=o.resolveComponent("IdmWaterTemp"),le=o.resolveComponent("IdmTemp");return o.openBlock(),o.createElementBlock("div",Um,[o.createElementVNode("div",{class:"menu-bar-box transition pa-1",style:o.normalizeStyle({top:a.top+a.paddingTop+46+"px",right:i.right+"px"})},[o.createVNode(s,{text:t.$t("weather.weatherLayers"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:J})=>[o.createVNode(n,o.mergeProps(J,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.toggle?"bg-primary active-border":""],onClick:l.handleMenuToggle}),{default:o.withCtx(()=>e[10]||(e[10]=[o.createElementVNode("i",{class:"iconfont icon-Weather text-h4"},null,-1)])),_:2,__:[10]},1040,["class","onClick"])]),_:1},8,["text","open-on-focus","open-on-hover"])],4),l.showTipMenu?(o.openBlock(),o.createElementBlock("div",Jm,[o.createElementVNode("div",{class:o.normalizeClass(["menu-bar-box pa-1 rounded",a.simple?"simple":""]),style:o.normalizeStyle({right:i.right+"px",top:a.simple?"426px":l.lengendTipTop+"px"})},[o.createVNode(s,{text:t.$t("weather.legend"),location:"left",interactive:!0,"open-on-click":!1,"open-on-focus":!a.simple,"open-on-hover":!a.simple},{activator:o.withCtx(({props:J})=>[o.createVNode(n,o.mergeProps(J,{"min-width":"32",width:"32",height:"32",class:["text-none pa-0",i.legendToggle?"bg-primary active-border":""],onClick:e[0]||(e[0]=ne=>i.legendToggle=!i.legendToggle)}),{default:o.withCtx(()=>e[11]||(e[11]=[o.createElementVNode("i",{class:"iconfont icon-Legend text-h4"},null,-1)])),_:2,__:[11]},1040,["class"])]),_:1},8,["text","open-on-focus","open-on-hover"])],6),i.legendToggle?(o.openBlock(),o.createBlock(d,{key:0,elevation:"16",class:"card-info d-flex justify-center align-start",style:o.normalizeStyle({position:"absolute",top:a.simple?"200px":"340px",right:i.right+50+"px"})},{default:o.withCtx(()=>[o.createVNode(c,{class:"d-flex flex-column justify-center align-start text-label px-1",style:{width:"120px"}},{default:o.withCtx(()=>[e[12]||(e[12]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2 mx-1"},"Wind Level",-1)),o.createElementVNode("div",Km,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.barbs,(J,ne)=>(o.openBlock(),o.createElementBlock("div",{key:J,class:"w-50 d-flex flex-row justify-start align-center py-1 px-0 ma-0"},[o.createElementVNode("div",Qm,[o.createElementVNode("i",{class:o.normalizeClass(["iconfont",l.barbsIconName[ne]]),style:o.normalizeStyle({color:a.theme==="dark"?"#fff":"#000"})},null,6),o.createElementVNode("span",qm,o.toDisplayString(Number(J)<10?`00${J}kts`:Number(J)<100?`0${J}kts`:`${J}kts`),1)])]))),128))])]),_:1,__:[12]}),o.createVNode(m,{vertical:""}),o.createVNode(c,{class:"d-flex flex-column justify-center align-start text-label px-2",style:{width:"100px"}},{default:o.withCtx(()=>[e[13]||(e[13]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2"},"Wave Height",-1)),o.createElementVNode("div",$m,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.sigWaveHeight,(J,ne)=>(o.openBlock(),o.createElementBlock("div",{key:ne,class:"w-100 d-flex flex-row justify-start align-center py-1 px-0 ma-0"},[o.createElementVNode("div",ed,[ne===0?(o.openBlock(),o.createElementBlock("div",td)):(o.openBlock(),o.createElementBlock("div",{key:1,style:o.normalizeStyle({width:"24px",height:"12px",background:J.color})},null,4)),o.createElementVNode("div",od,o.toDisplayString(J.label),1)])]))),128))])]),_:1,__:[13]}),o.createVNode(m,{vertical:""}),o.createVNode(c,{class:"d-flex flex-column justify-center align-start text-label pl-0 pr-2",style:{width:"100px"}},{default:o.withCtx(()=>[e[14]||(e[14]=o.createElementVNode("div",{class:"text-body-2 font-weight-600 mb-2 mx-2"},"Current",-1)),o.createElementVNode("div",ad,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.legend.current,(J,ne)=>(o.openBlock(),o.createElementBlock("div",{key:ne,class:"w-100 d-flex flex-row justify-center align-center py-1 px-0 ma-0"},[o.createElementVNode("div",id,[o.createElementVNode("div",rd,[o.createElementVNode("i",{class:"iconfont icon-a-direction-arrow text-label",style:o.normalizeStyle({fontSize:40*J.size+"px"})},null,4)]),o.createElementVNode("div",ld,o.toDisplayString(J.label),1)])]))),128))])]),_:1,__:[14]})]),_:1},8,["style"])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["available-layers transition d-flex flex-column justify-start align-start",i.toggle?"right-bar":""]),style:o.normalizeStyle(l.listStyle)},[o.createElementVNode("div",{class:o.normalizeClass(["header-box w-100 d-flex justify-space-between align-center",a.simple?"px-3":"px-4"])},[o.createElementVNode("div",nd,[o.createElementVNode("div",sd,o.toDisplayString(t.$t("weather.weather")),1),o.createVNode(g,{modelValue:i.autoActive,"onUpdate:modelValue":e[1]||(e[1]=J=>i.autoActive=J),class:"small-switch",color:"primary","base-color":"disabled",inset:"","hide-details":""},null,8,["modelValue"])]),o.createVNode(n,{icon:"",density:"compact",variant:"plain",class:"mr-n2",onClick:l.handleMenuToggle},{default:o.withCtx(()=>e[15]||(e[15]=[o.createElementVNode("i",{class:"iconfont icon-close text-h4"},null,-1)])),_:1,__:[15]},8,["onClick"])],2),a.simple?(o.openBlock(),o.createElementBlock("div",cd,[o.createElementVNode("div",null,o.toDisplayString(t.$t("weather.forecastModel")),1),o.createVNode(u,{modelValue:i.currentModel,"onUpdate:modelValue":e[2]||(e[2]=J=>i.currentModel=J),rounded:"",height:"28",density:"compact",mandatory:"",group:""},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"28",value:"GFS",class:"text-none btn-bg-2 px-1 text-body-1 mt-1",color:i.currentModel==="GFS"?"primary":"","base-color":""},{default:o.withCtx(()=>e[16]||(e[16]=[o.createTextVNode(" NOAA ",-1)])),_:1,__:[16]},8,["color"]),o.createVNode(n,{density:"compact",height:"28",class:"text-none btn-bg-2 px-1 text-body-1 mt-1",color:i.currentModel==="ECMWF"?"primary":"","base-color":"",value:"ECMWF"},{default:o.withCtx(()=>e[17]||(e[17]=[o.createTextVNode(" ECMWF ",-1)])),_:1,__:[17]},8,["color"])]),_:1},8,["modelValue"])])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["list-box w-100 scroll overflow-y-auto",[i.autoActive?"":"cursor-not-allowed",a.simple?"px-3":"pl-4 pr-2"]])},[o.createVNode(d,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(p,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(y,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.overlays")),1)]),_:1})]),_:1}),o.createVNode(c,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(J=>J.overlays),J=>(o.openBlock(),o.createBlock(h,{key:J.key,modelValue:i.checkList,"onUpdate:modelValue":e[3]||(e[3]=ne=>i.checkList=ne),value:J.key,label:t.$t(`weather.${J.locale}`),disabled:!i.autoActive,color:"primary",density:"compact",style:{height:"36px"},class:"flex-1-0-100 text-body-2","hide-details":""},null,8,["modelValue","value","label","disabled"]))),128))]),_:1})]),_:1}),o.createVNode(d,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(p,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(y,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.renders")),1)]),_:1})]),_:1}),o.createVNode(c,{class:"py-2 mx-n1"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.tagLayers.filter(J=>!J.overlays),J=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:J.key},[o.createVNode(f,{modelValue:i.renderKey,"onUpdate:modelValue":e[4]||(e[4]=ne=>i.renderKey=ne),label:t.$t(`weather.${J.locale}`),value:J.key,disabled:!i.autoActive,color:"primary",density:"compact",style:{height:"36px"},class:"text-body-2 py-1","hide-details":"",onClick:ne=>i.renderKey=i.renderKey===J.key?"":J.key},null,8,["modelValue","label","value","disabled","onClick"]),i.renderKey==="wind-particle"&&J.key==="wind-particle"?(o.openBlock(),o.createElementBlock("div",md,[o.createElementVNode("span",null,o.toDisplayString(t.$t("weather.particleAnimatiom")),1),o.createVNode(g,{modelValue:i.showWindParticle,"onUpdate:modelValue":e[5]||(e[5]=ne=>i.showWindParticle=ne),label:"",class:"small-switch",color:"primary","base-color":"disabled",density:"compact",inset:"",style:{"font-size":"14px"},"hide-details":""},null,8,["modelValue"])])):o.createCommentVNode("",!0),i.renderKey==="current-particle"&&J.key==="current-particle"?(o.openBlock(),o.createElementBlock("div",dd,[o.createElementVNode("span",null,o.toDisplayString(t.$t("weather.particleAnimatiom")),1),o.createVNode(g,{modelValue:i.showCurrentParticle,"onUpdate:modelValue":e[6]||(e[6]=ne=>i.showCurrentParticle=ne),label:"",class:"small-switch",color:"primary","base-color":"disabled",inset:"",density:"compact",height:"20","hide-details":""},null,8,["modelValue"])])):o.createCommentVNode("",!0),i.renderKey==="sig-wave-particle"&&J.key==="sig-wave-particle"?(o.openBlock(),o.createElementBlock("div",hd,[o.createElementVNode("span",null,o.toDisplayString(t.$t("weather.particleAnimatiom")),1),o.createVNode(g,{modelValue:i.showSigWaveParticle,"onUpdate:modelValue":e[7]||(e[7]=ne=>i.showSigWaveParticle=ne),class:"small-switch",color:"primary","base-color":"disabled",density:"compact",inset:"","hide-details":"",disabled:!i.autoActive},null,8,["modelValue","disabled"])])):o.createCommentVNode("",!0),i.renderKey==="swell-particle"&&J.key==="swell-particle"?(o.openBlock(),o.createElementBlock("div",pd,[o.createElementVNode("span",null,o.toDisplayString(t.$t("weather.particleAnimatiom")),1),o.createVNode(g,{modelValue:i.showSwellParticle,"onUpdate:modelValue":e[8]||(e[8]=ne=>i.showSwellParticle=ne),class:"small-switch",color:"primary","base-color":"disabled",density:"compact",inset:"","hide-details":"",disabled:!i.autoActive},null,8,["modelValue","disabled"])])):o.createCommentVNode("",!0),i.renderKey==="ice-forecast"&&J.key==="ice-forecast"?(o.openBlock(),o.createBlock(u,{key:4,modelValue:i.iceToggleValue,"onUpdate:modelValue":e[9]||(e[9]=ne=>i.iceToggleValue=ne),class:"w-100 pl-7 rounded",rounded:"0",height:"30",density:"compact",group:"",mandatory:"",disabled:!i.autoActive},{default:o.withCtx(()=>[o.createVNode(n,{density:"compact",height:"30",value:"ice-cover",class:"w-50 text-none px-2 text-body-1",color:i.iceToggleValue==="ice-cover"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.coverage")),1)]),_:1},8,["color","disabled"]),o.createVNode(n,{density:"compact",height:"30",class:"w-50 text-none px-2 text-body-1",color:i.iceToggleValue==="ice-thickness"?"primary":"","base-color":"grey-lighten-1",disabled:!i.autoActive,value:"ice-thickness"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.thickness")),1)]),_:1},8,["color","disabled"])]),_:1},8,["modelValue","disabled"])):o.createCommentVNode("",!0)],64))),128))]),_:1})]),_:1}),o.createVNode(d,{class:"block-bg mx-auto mb-2",elevation:"0"},{default:o.withCtx(()=>[o.createVNode(p,{class:"border-b-thin"},{default:o.withCtx(()=>[o.createVNode(y,{class:"text-h6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.$t("weather.forecastModel")),1)]),_:1})]),_:1}),o.createVNode(c,{class:""},{default:o.withCtx(()=>{var J,ne,Fe,Ge,Re,Ce,je,Ne,Ee,De,We,Ze,Be,xe,ke,_e,He,Xe,Oe,Pe,rt,lt,nt,st,ct,mt,dt,ht,pt,ut,gt,ft,yt,bt,wt,xt,kt,At,Lt,vt,Ct,_t,zt,St,Pt,Mt,Tt,Nt,Et,Vt,Rt,Dt,Bt,It,Ft,Gt,jt,Wt,Zt,Me,Ve,Ht,Ye,Xt,et,Ae,Ue,ie,Le,U,X,Je,Ie,Se,G,Ot,oe,ve,Ke,tt,ot,B,Qe,j,qe,Ut,se,io,me,Lo,vo,Co,_o,zo,So,Po,Mo,To,No,Eo,Vo,Ro,Do,Bo,Io;return[o.createElementVNode("div",ud,o.toDisplayString(t.$t("weather.atmospheric")),1),o.createElementVNode("div",gd,o.toDisplayString((Fe=(ne=(J=i.models)==null?void 0:J.weather)==null?void 0:ne.NOAA)==null?void 0:Fe.source)+" "+o.toDisplayString((Ce=(Re=(Ge=i.models)==null?void 0:Ge.weather)==null?void 0:Re.NOAA)==null?void 0:Ce.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((De=(Ee=(Ne=(je=i.models)==null?void 0:je.weather)==null?void 0:Ne.NOAA)==null?void 0:Ee.meta)==null?void 0:De.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",fd,o.toDisplayString(t.$t("weather.source"))+": NOAA",1),o.createElementVNode("div",yd,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((xe=(Be=(Ze=(We=i.models)==null?void 0:We.weather)==null?void 0:Ze.NOAA)==null?void 0:Be.meta)==null?void 0:xe.availabilityTime)),1),o.createElementVNode("div",bd,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((Xe=(He=(_e=(ke=i.models)==null?void 0:ke.weather)==null?void 0:_e.NOAA)==null?void 0:He.meta)==null?void 0:Xe.initialisationTime)),1),o.createElementVNode("div",wd,o.toDisplayString((rt=(Pe=(Oe=i.models)==null?void 0:Oe.weather)==null?void 0:Pe.ECMWF)==null?void 0:rt.source)+" "+o.toDisplayString((st=(nt=(lt=i.models)==null?void 0:lt.weather)==null?void 0:nt.ECMWF)==null?void 0:st.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((ht=(dt=(mt=(ct=i.models)==null?void 0:ct.weather)==null?void 0:mt.ECMWF)==null?void 0:dt.meta)==null?void 0:ht.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",xd,o.toDisplayString(t.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",kd,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((ft=(gt=(ut=(pt=i.models)==null?void 0:pt.weather)==null?void 0:ut.ECMWF)==null?void 0:gt.meta)==null?void 0:ft.availabilityTime)),1),o.createElementVNode("div",Ad,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((xt=(wt=(bt=(yt=i.models)==null?void 0:yt.weather)==null?void 0:bt.ECMWF)==null?void 0:wt.meta)==null?void 0:xt.initialisationTime)),1),o.createVNode(m),o.createElementVNode("div",Ld,o.toDisplayString(t.$t("weather.wave")),1),o.createElementVNode("div",vd,o.toDisplayString((vt=(Lt=(At=(kt=i.models)==null?void 0:kt.marine)==null?void 0:At.wave)==null?void 0:Lt.NOAA)==null?void 0:vt.source)+" "+o.toDisplayString((St=(zt=(_t=(Ct=i.models)==null?void 0:Ct.marine)==null?void 0:_t.wave)==null?void 0:zt.NOAA)==null?void 0:St.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((Et=(Nt=(Tt=(Mt=(Pt=i.models)==null?void 0:Pt.marine)==null?void 0:Mt.wave)==null?void 0:Tt.NOAA)==null?void 0:Nt.meta)==null?void 0:Et.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",Cd,o.toDisplayString(t.$t("weather.source"))+": NOAA",1),o.createElementVNode("div",_d,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((It=(Bt=(Dt=(Rt=(Vt=i.models)==null?void 0:Vt.marine)==null?void 0:Rt.wave)==null?void 0:Dt.NOAA)==null?void 0:Bt.meta)==null?void 0:It.availabilityTime)),1),o.createElementVNode("div",zd,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((Zt=(Wt=(jt=(Gt=(Ft=i.models)==null?void 0:Ft.marine)==null?void 0:Gt.wave)==null?void 0:jt.NOAA)==null?void 0:Wt.meta)==null?void 0:Zt.initialisationTime)),1),o.createElementVNode("div",Sd,o.toDisplayString((Ye=(Ht=(Ve=(Me=i.models)==null?void 0:Me.marine)==null?void 0:Ve.wave)==null?void 0:Ht.ECMWF)==null?void 0:Ye.source)+" "+o.toDisplayString((Ue=(Ae=(et=(Xt=i.models)==null?void 0:Xt.marine)==null?void 0:et.wave)==null?void 0:Ae.ECMWF)==null?void 0:Ue.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((Je=(X=(U=(Le=(ie=i.models)==null?void 0:ie.marine)==null?void 0:Le.wave)==null?void 0:U.ECMWF)==null?void 0:X.meta)==null?void 0:Je.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",Pd,o.toDisplayString(t.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",Md,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((oe=(Ot=(G=(Se=(Ie=i.models)==null?void 0:Ie.marine)==null?void 0:Se.wave)==null?void 0:G.ECMWF)==null?void 0:Ot.meta)==null?void 0:oe.availabilityTime)),1),o.createElementVNode("div",Td,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((B=(ot=(tt=(Ke=(ve=i.models)==null?void 0:ve.marine)==null?void 0:Ke.wave)==null?void 0:tt.ECMWF)==null?void 0:ot.meta)==null?void 0:B.initialisationTime)),1),o.createVNode(m),o.createElementVNode("div",Nd,o.toDisplayString(t.$t("weather.currents")),1),o.createElementVNode("div",Ed,o.toDisplayString((Ut=(qe=(j=(Qe=i.models)==null?void 0:Qe.marine)==null?void 0:j.current)==null?void 0:qe.ECMWF)==null?void 0:Ut.source)+" "+o.toDisplayString((Lo=(me=(io=(se=i.models)==null?void 0:se.marine)==null?void 0:io.current)==null?void 0:me.ECMWF)==null?void 0:Lo.spatialResolution)+o.toDisplayString(t.$t("units.km"))+" "+o.toDisplayString((So=(zo=(_o=(Co=(vo=i.models)==null?void 0:vo.marine)==null?void 0:Co.current)==null?void 0:_o.ECMWF)==null?void 0:zo.meta)==null?void 0:So.days)+o.toDisplayString(t.$t("units.days")),1),o.createElementVNode("div",Vd,o.toDisplayString(t.$t("weather.source"))+": ECMWF",1),o.createElementVNode("div",Rd,o.toDisplayString(t.$t("weather.lastUpdate"))+": "+o.toDisplayString(l.computeDateUpdate((Eo=(No=(To=(Mo=(Po=i.models)==null?void 0:Po.marine)==null?void 0:Mo.current)==null?void 0:To.ECMWF)==null?void 0:No.meta)==null?void 0:Eo.availabilityTime)),1),o.createElementVNode("div",Dd,o.toDisplayString(t.$t("weather.referenceTime"))+": "+o.toDisplayString(l.computeDateZ((Io=(Bo=(Do=(Ro=(Vo=i.models)==null?void 0:Vo.marine)==null?void 0:Ro.current)==null?void 0:Do.ECMWF)==null?void 0:Bo.meta)==null?void 0:Io.initialisationTime)),1)]}),_:1})]),_:1})],2)],6),a.map?(o.openBlock(),o.createBlock(x,o.mergeProps({key:1,ref:"windBarb",map:a.map,"map-feather":a.mapFeather,"before-layer":"empty-layer-3",wind:(S=i.weatherLayers)==null?void 0:S.wind},t.$attrs),null,16,["map","map-feather","wind"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(v,o.mergeProps({key:2,map:a.map,"before-layer":"empty-layer-2","sig-wave-height":(Z=i.weatherLayers)==null?void 0:Z["sig-wave-height"]},t.$attrs),null,16,["map","sig-wave-height"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(b,o.mergeProps({key:3,map:a.map,"map-feather":a.mapFeather,"before-layer":"empty-layer-1",current:(H=i.weatherLayers)==null?void 0:H.current},t.$attrs),null,16,["map","map-feather","current"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(k,o.mergeProps({key:4,map:a.map,"map-feather":a.mapFeather,"before-layer":"empty-layer-1",swell:(te=i.weatherLayers)==null?void 0:te["swell-direction-contour"]},t.$attrs,{theme:a.theme}),null,16,["map","map-feather","swell","theme"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(A,o.mergeProps({key:5,map:a.map,"before-layer":"empty-layer-3",prmsl:(W=i.weatherLayers)==null?void 0:W.prmsl},t.$attrs,{theme:a.theme}),null,16,["map","prmsl","theme"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(L,o.mergeProps({key:l.viewportKey,viewport:i.viewport,factor:(I=i.weatherLayers)==null?void 0:I["wind-particle"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(C,o.mergeProps({key:l.viewportKey,viewport:i.viewport,factor:(K=i.weatherLayers)==null?void 0:K["current-particle"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(z,o.mergeProps({key:l.viewportKey,viewport:i.viewport,factor:(V=i.weatherLayers)==null?void 0:V["sig-wave-particle"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(M,o.mergeProps({key:l.viewportKey,viewport:i.viewport,factor:(Y=i.weatherLayers)==null?void 0:Y["swell-particle"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(T,o.mergeProps({key:l.viewportKey,viewport:i.viewport,factor:(ee=i.weatherLayers)==null?void 0:ee["ice-edge"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(N,o.mergeProps({key:l.viewportKey,viewport:i.viewport,factor:(he=i.weatherLayers)==null?void 0:he["ice-cover"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(F,o.mergeProps({key:l.viewportKey,viewport:i.viewport,factor:(ge=i.weatherLayers)==null?void 0:ge["ice-thickness"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(O,o.mergeProps({key:l.viewportKey,viewport:i.viewport,factor:(re=i.weatherLayers)==null?void 0:re.precip3h,"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(q,o.mergeProps({key:l.viewportKey,viewport:i.viewport,factor:(ue=i.weatherLayers)==null?void 0:ue.visibility,"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock($,o.mergeProps({key:l.viewportKey,viewport:i.viewport,factor:(ye=i.weatherLayers)==null?void 0:ye["water-temp"],"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0),a.map?(o.openBlock(),o.createBlock(le,o.mergeProps({key:l.viewportKey,viewport:i.viewport,factor:(ze=i.weatherLayers)==null?void 0:ze.temp,"menu-toggle":a.menuToggle,simple:a.simple},t.$attrs),null,16,["viewport","factor","menu-toggle","simple"])):o.createCommentVNode("",!0)])}const Id=Q(Ym,[["render",Bd]]),fo=[{rank:0,name:"Best Match",alias:"BEST MATCH",model:"best_match",models:["best_match"]},{rank:1,name:"GFS",alias:"GFS",model:"gfs_seamless",provider:"NOAA",country:"United States",resolution:25,tips:"3-25km",length:16,frequency:1,models:["gfs_seamless"],categories:"ncep_gfs013,ncep_gfs025,ncep_gfs_graphcast025,ncep_hrrr_conus,ncep_nbm_conus",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:2,name:"ECMWF",alias:"ECMWF",model:"ecmwf_ifs025",provider:"ECMWF",country:"European Union",resolution:25,tips:"25km",length:15,frequency:6,models:["ecmwf_ifs025","ecmwf_aifs025_single","ecmwf_ifs"],categories:"ecmwf_ifs025,ecmwf_aifs025_single,ecmwf_ifs",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:3,disabled:!0,name:"ICON",alias:"ECMWF",model:"icon_seamless",provider:"Deutscher Wetterdienst (DWD)",country:"Germany",resolution:13,tips:"2-13km",length:7.5,frequency:3,models:["icon_seamless","icon_global","icon_eu","icon_d2"],categories:"dwd_icon,dwd_icon_eps,dwd_icon_d2,dwd_icon_d2_eps,dwd_icon_eu,dwd_icon_eu_eps",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:4,name:"ARPEGE",disabled:!0,alias:"ECMWF",model:"arpege_seamless",provider:"Météo-France",country:"France",resolution:25,tips:"1-25km",length:4,frequency:1,models:["arpege_seamless","arpege_world","arpege_europe"],categories:"meteofrance_arpege_europe,meteofrance_arpege_europe_probabilities,meteofrance_arpege_world025",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:5,name:"UKMO",disabled:!0,alias:"ECMWF",model:"ukmo_seamless",provider:"UK Met Office",country:"United Kingdom",resolution:10,tips:"2-10km",length:7,frequency:1,models:["ukmo_seamless","ukmo_global_deterministic_10km","ukmo_uk_deterministic_2km"],categories:"ukmo_global_deterministic_10km,ukmo_uk_deterministic_2km",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:6,name:"JMA",disabled:!0,alias:"GFS",model:"jma_seamless",provider:"JMA",country:"Japan",resolution:55,tips:"5-55km",length:11,frequency:3,models:["jma_seamless","jma_msm","jma_gsm"],categories:"jma_gsm,jma_msm",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:7,name:"GEM",disabled:!0,alias:"GFS",model:"gem_seamless",provider:"Canadian Weather Service",country:"Canada",resolution:2.5,tips:"2.5km",length:10,frequency:6,models:["gem_seamless","gem_global","gem_regional"],categories:"cmc_gem_gdps,cmc_gem_hrdps,cmc_gem_rdps",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:8,name:"GRAPES",disabled:!0,alias:"GFS",model:"cma_grapes_global",provider:"China Meteorological Administration (CMA)",country:"China",resolution:15,tips:"15km",length:10,frequency:6,models:["cma_grapes_global"],categories:"cma_grapes_global",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"},{rank:9,name:"ACCESS-G",disabled:!0,alias:"GFS",model:"bom_access_global",provider:"Australian Bureau of Meteorology (BOM)",country:"Australia",resolution:15,tips:"15km",length:10,frequency:6,models:["bom_access_global"],categories:"bom_access_global",variables:"temperature_2m,relative_humidity_2m,dew_point_2m,apparent_temperature,precipitation_probability,precipitation,rain,showers,snowfall_water_equivalent,snowfall,frozen_precipitation_percent,pressure_msl,cloud_cover,visibility,wind_speed_10m,wind_u_component_10m,wind_v_component_10m,wind_direction_10m,wind_gusts_10m,cape,lifted_index,weather_code"}],yo=[{rank:0,name:"Best Match",alias:"BEST MATCH",model:"best_match",models:["best_match"]},{rank:1,name:"MFWAM",alias:"ECMWF",model:"meteofrance_wave",provider:"MeteoFrance",country:"France",resolution:8,tips:"8km",length:10,frequency:12,models:["meteofrance_wave"],categories:"meteofrance_wave",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:2,disabled:!0,name:"SMOC",alias:"ECMWF",model:"meteofrance_currents",provider:"MeteoFrance",country:"France",resolution:8,tips:"8km",length:10,frequency:24,models:["meteofrance_currents"],categories:"meteofrance_currents, meteofrance_sea_surface_temperature",variables:"ocean_u_current,ocean_v_current,invert_barometer_height,sea_level_height_msl,sea_surface_temperature"},{rank:3,disabled:!0,name:"EWAM",alias:"ECMWF",model:"ewam",provider:"DWD",country:"Germany",resolution:5,tips:"5km",length:8,frequency:2,models:["ewam"],categories:"dwd_ewam",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:4,disabled:!0,name:"GWAM",alias:"ECMWF",model:"gwam",provider:"DWD",country:"Germany",resolution:5,tips:"5km",length:4,frequency:2,models:["gwam"],categories:"dwd_gwam",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:5,disabled:!0,name:"ECWAM",alias:"ECMWF",model:"ecmwf_wam025",provider:"ECMWF",country:"Europe",resolution:25,tips:"25km",length:10,frequency:6,models:["ecmwf_wam025"],categories:"ecmwf_wam025",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:6,name:"GFSWave",alias:"GFS",model:"ncep_gfswave025",provider:"NCEP",country:"USA",resolution:25,tips:"25km",length:10,frequency:6,models:["ncep_gfswave025","ncep_gfswave016"],categories:"ncep_gfswave025,ncep_gfswave016",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"},{rank:7,disabled:!0,name:"ERA5-Ocean",alias:"ECMWF",model:"era5_ocean",provider:"Copernicus",country:"Europe",resolution:50,tips:"50km",length:-5,frequency:1,models:["era5_ocean"],categories:"copernicus_era5_ocean",variables:"swell_wave_direction,swell_wave_height,swell_wave_period,swell_wave_peak_period,wave_direction,wave_height,wave_period,wind_wave_direction,wind_wave_height,wind_wave_period,wind_wave_peak_period"}];let va=class{static standardWeatherModels(){return fo.filter(e=>!e.disabled&&e.alias)}static standardMarineModels(){return yo.filter(e=>!e.disabled&&e.alias)}static autoPickLayerModel(e,a="copernicus"){return a=a||"copernicus",a=a==null?void 0:a.toLowerCase(),a=["gfs","ecmwf","copernicus"].includes(a)?a:"copernicus",e=e==null?void 0:e.toLowerCase(),e==="gfs"?"gfs":["ec","ecmwf"].includes(e)?"ecmwf":["copernicus","cmems"].includes(e)?"copernicus":a}static autoPickPeerModel(e,a,r="copernicus"){if(a=this.autoPickLayerModel(a,r),pl.LayerHelper.WEATHER_LAYERS.reduce((i,l)=>l.atmos?i+l.weight:i,0)&e.weight){if(a==="copernicus")return"ecmwf"}else{if(["sig-wave","sig-wave-height","sig-wave-height-contour"].includes(e.key))return a;if(a==="ecmwf")return"copernicus"}return a}static autoPickMeteoModel(e="best_match"){var a,r;e=e==null?void 0:e.toLowerCase(),e=e==="ec"?"ecmwf":e;const i=e.toLowerCase().split(","),l=[],n=[];for(const s of i){let c=fo.find(d=>{var g,u,y;return((g=d.models)==null?void 0:g.includes(s))||((u=d.alias)==null?void 0:u.toLowerCase())===s||((y=d.name)==null?void 0:y.toLowerCase())===s}),m=yo.find(d=>{var g,u,y;return((g=d.models)==null?void 0:g.includes(s))||((u=d.alias)==null?void 0:u.toLowerCase())===s||((y=d.name)==null?void 0:y.toLowerCase())===s});c=c||fo.find(d=>{var g,u;return((g=d.alias)==null?void 0:g.toLowerCase())===((u=m==null?void 0:m.alias)==null?void 0:u.toLowerCase())}),m=m||yo.find(d=>{var g,u;return((g=d.alias)==null?void 0:g.toLowerCase())===((u=c==null?void 0:c.alias)==null?void 0:u.toLowerCase())}),c=c||fo[0],m=m||yo[0],l.push((a=c.models)!=null&&a.includes(s)?s:c.model),n.push((r=m.models)!=null&&r.includes(s)?s:m.model)}return{weatherModels:l.join(","),marineModels:n.join(",")}}static autoPickSubCategories(e){e=e.toUpperCase();const a=fo.filter(l=>l.alias===e),r=yo.filter(l=>l.alias===e),i=[];return a.forEach(l=>{l.categories&&i.push(...l.categories.split(","))}),r.forEach(l=>{l.categories&&i.push(...l.categories.split(","))}),i}static pickHourly(e,a){var r,i,l,n,s,c,m,d,g,u,y,p,h,f,x,v,b,k,A,L,C,z,M,T,N,F,O,q,$,le,S,Z,H,te,W,I,K,V,Y,ee,he,ge,re,ue,ye,ze,J,ne,Fe,Ge,Re,Ce,je,Ne,Ee,De,We,Ze,Be,xe,ke,_e,He,Xe,Oe,Pe,rt,lt,nt,st,ct,mt,dt,ht,pt,ut,gt,ft,yt,bt,wt,xt,kt,At,Lt,vt,Ct,_t,zt,St,Pt,Mt,Tt,Nt,Et,Vt,Rt,Dt,Bt,It,Ft,Gt,jt,Wt,Zt,Me,Ve,Ht,Ye,Xt,et,Ae,Ue;const ie=typeof a=="string"?_(a):a;let Le=ie.clone();const U=e==null?void 0:e.weather,X=e==null?void 0:e.marine,Je=((i=(r=U==null?void 0:U[0])==null?void 0:r.hourly)==null?void 0:i.date)||((n=(l=X==null?void 0:X[0])==null?void 0:l.hourly)==null?void 0:n.date),Ie=_.utc(Je),Se=Ie.clone().add(((m=(c=(s=U==null?void 0:U[0])==null?void 0:s.hourly)==null?void 0:c.time)==null?void 0:m.at(0))||((u=(g=(d=X==null?void 0:X[0])==null?void 0:d.hourly)==null?void 0:g.time)==null?void 0:u.at(0)),"h"),G=Ie.clone().add(((h=(p=(y=U==null?void 0:U[0])==null?void 0:y.hourly)==null?void 0:p.time)==null?void 0:h.at(-1))||((v=(x=(f=X==null?void 0:X[0])==null?void 0:f.hourly)==null?void 0:x.time)==null?void 0:v.at(-1)),"h"),Ot=[];Le=Le.isBefore(Se)?Se.clone():Le,Le=Le.isAfter(G)?G.clone():Le;const oe=Le.utc().diff(Se,"h",!1);let ve,Ke;if(U!=null&&U.length){let tt=0,ot=0,B=0;for(const Qe of U){const j=Qe==null?void 0:Qe.hourly;for(let me=oe-(oe-1)%3;me<=oe;me++)tt+=((b=j==null?void 0:j.precipitation)==null?void 0:b.at(me))??0;for(let me=oe-(oe-1)%6;me<=oe;me++)ot+=((k=j==null?void 0:j.precipitation)==null?void 0:k.at(me))??0;for(let me=oe-(oe-1)%12;me<=oe;me++)B+=((A=j==null?void 0:j.precipitation)==null?void 0:A.at(me))??0;const qe=((L=j==null?void 0:j.wind_direction_10m)==null?void 0:L.at(oe))??((z=(C=j==null?void 0:j.wind_direction_10m)==null?void 0:C.filter(me=>me!==null))==null?void 0:z.at(-1));ve={temp:((M=j==null?void 0:j.temperature_2m)==null?void 0:M.at(oe))??((N=(T=j==null?void 0:j.temperature_2m)==null?void 0:T.filter(me=>me!==null))==null?void 0:N.at(-1)),apparentTemp:((F=j==null?void 0:j.apparent_temperature)==null?void 0:F.at(oe))??((q=(O=j==null?void 0:j.apparent_temperature)==null?void 0:O.filter(me=>me!==null))==null?void 0:q.at(-1)),rh:(($=j==null?void 0:j.relative_humidity_2m)==null?void 0:$.at(oe))??((S=(le=j==null?void 0:j.relative_humidity_2m)==null?void 0:le.filter(me=>me!==null))==null?void 0:S.at(-1)),dp:((Z=j==null?void 0:j.dew_point_2m)==null?void 0:Z.at(oe))??((te=(H=j==null?void 0:j.dew_point_2m)==null?void 0:H.filter(me=>me!==null))==null?void 0:te.at(-1)),precip:{probability:((W=j==null?void 0:j.precipitation_probability)==null?void 0:W.at(oe))??0,sum:((I=j==null?void 0:j.precipitation)==null?void 0:I.at(oe))??0,sum1Hours:((K=j==null?void 0:j.precipitation)==null?void 0:K.at(oe))??0,sum3Hours:Math.round(tt*100)/100,sum6Hours:Math.round(ot*100)/100,sum12Hours:Math.round(B*100)/100},pmsl:((V=j==null?void 0:j.pressure_msl)==null?void 0:V.at(oe))??((ee=(Y=j==null?void 0:j.pressure_msl)==null?void 0:Y.filter(me=>me!==null))==null?void 0:ee.at(-1)),psurf:((he=j==null?void 0:j.surface_pressure)==null?void 0:he.at(oe))??((re=(ge=j==null?void 0:j.surface_pressure)==null?void 0:ge.filter(me=>me!==null))==null?void 0:re.at(-1)),code:((ue=j==null?void 0:j.weather_code)==null?void 0:ue.at(oe))??((ze=(ye=j==null?void 0:j.weather_code)==null?void 0:ye.filter(me=>me!==null))==null?void 0:ze.at(-1)),visibility:this.m2nm(((J=j==null?void 0:j.visibility)==null?void 0:J.at(oe))??((Fe=(ne=j==null?void 0:j.visibility)==null?void 0:ne.filter(me=>me!==null))==null?void 0:Fe.at(-1))),wind:{speed:((Ge=j==null?void 0:j.wind_speed_10m)==null?void 0:Ge.at(oe))??((Ce=(Re=j==null?void 0:j.wind_speed_10m)==null?void 0:Re.filter(me=>me!==null))==null?void 0:Ce.at(-1)),kts:((je=j==null?void 0:j.wind_speed_10m)==null?void 0:je.at(oe))??((Ee=(Ne=j==null?void 0:j.wind_speed_10m)==null?void 0:Ne.filter(me=>me!==null))==null?void 0:Ee.at(-1)),degree:qe,bearing:qe!==null?Math.round((qe+180)%360):null,gusts:((De=j==null?void 0:j.wind_gusts_10m)==null?void 0:De.at(oe))??((Ze=(We=j==null?void 0:j.wind_gusts_10m)==null?void 0:We.filter(me=>me!==null))==null?void 0:Ze.at(-1))},isDay:(Be=j==null?void 0:j.is_day)==null?void 0:Be.at(oe)};const{name:Ut,url:se,bg:io}=this.parseWeatherCode(ve.code,ve.isDay);ve.name=Ut,ve.url=se,ve.bg=io,ve.wind.scale=this.beaufort(this.kts2ms(ve.wind.kts)),ve.wind.direction=this.degree2Direction(ve.wind.degree),Ot.push({utc:ie.utc().format(),realUTC:Se.add(oe,"h").format(),model:Qe.model,weather:{...ve}})}}if(X!=null&&X.length){let tt=0;for(const ot of X){const B=ot==null?void 0:ot.hourly,Qe=((xe=B==null?void 0:B.wave_direction)==null?void 0:xe.at(oe))??((_e=(ke=B==null?void 0:B.wave_direction)==null?void 0:ke.filter(se=>se!==null))==null?void 0:_e.at(-1)),j=((He=B==null?void 0:B.swell_wave_direction)==null?void 0:He.at(oe))??((Oe=(Xe=B==null?void 0:B.swell_wave_direction)==null?void 0:Xe.filter(se=>se!==null))==null?void 0:Oe.at(-1)),qe=((Pe=B==null?void 0:B.wind_wave_direction)==null?void 0:Pe.at(oe))??((lt=(rt=B==null?void 0:B.wind_wave_direction)==null?void 0:rt.filter(se=>se!==null))==null?void 0:lt.at(-1)),Ut=((nt=B==null?void 0:B.ocean_current_direction)==null?void 0:nt.at(oe))??((ct=(st=B==null?void 0:B.ocean_current_direction)==null?void 0:st.filter(se=>se!==null))==null?void 0:ct.at(-1));Ke={wave:{sig:{height:((mt=B==null?void 0:B.wave_height)==null?void 0:mt.at(oe))??((ht=(dt=B==null?void 0:B.wave_height)==null?void 0:dt.filter(se=>se!==null))==null?void 0:ht.at(-1)),degree:Qe,bearing:Qe!==null?Math.round((Qe+180)%360):null,period:((pt=B==null?void 0:B.wave_period)==null?void 0:pt.at(oe))??((gt=(ut=B==null?void 0:B.wave_period)==null?void 0:ut.filter(se=>se!==null))==null?void 0:gt.at(-1))},swell:{height:((ft=B==null?void 0:B.swell_wave_height)==null?void 0:ft.at(oe))??((bt=(yt=B==null?void 0:B.swell_wave_height)==null?void 0:yt.filter(se=>se!==null))==null?void 0:bt.at(-1)),degree:j,bearing:j!==null?Math.round((j+180)%360):null,period:((wt=B==null?void 0:B.swell_wave_period)==null?void 0:wt.at(oe))??((kt=(xt=B==null?void 0:B.swell_wave_period)==null?void 0:xt.filter(se=>se!==null))==null?void 0:kt.at(-1)),peakPeriod:((At=B==null?void 0:B.swell_wave_peak_period)==null?void 0:At.at(oe))??((vt=(Lt=B==null?void 0:B.swell_wave_peak_period)==null?void 0:Lt.filter(se=>se!==null))==null?void 0:vt.at(-1))},wd:{height:((Ct=B==null?void 0:B.wind_wave_height)==null?void 0:Ct.at(oe))??((zt=(_t=B==null?void 0:B.wind_wave_height)==null?void 0:_t.filter(se=>se!==null))==null?void 0:zt.at(-1)),degree:qe,bearing:qe!==null?Math.round((qe+180)%360):null,period:((St=B==null?void 0:B.wind_wave_period)==null?void 0:St.at(oe))??((Mt=(Pt=B==null?void 0:B.wind_wave_period)==null?void 0:Pt.filter(se=>se!==null))==null?void 0:Mt.at(-1)),peakPeriod:((Tt=B==null?void 0:B.wind_wave_peak_period)==null?void 0:Tt.at(oe))??((Et=(Nt=B==null?void 0:B.wind_wave_peak_period)==null?void 0:Nt.filter(se=>se!==null))==null?void 0:Et.at(-1))}},current:{speed:((Vt=B==null?void 0:B.ocean_current_velocity)==null?void 0:Vt.at(oe))??((Dt=(Rt=B==null?void 0:B.ocean_current_velocity)==null?void 0:Rt.filter(se=>se!==null))==null?void 0:Dt.at(-1)),kts:((Bt=B==null?void 0:B.ocean_current_velocity)==null?void 0:Bt.at(oe))??((Ft=(It=B==null?void 0:B.ocean_current_velocity)==null?void 0:It.filter(se=>se!==null))==null?void 0:Ft.at(-1)),degree:Ut,bearing:Ut},sst:((Gt=B==null?void 0:B.sea_surface_temperature)==null?void 0:Gt.at(oe))??((Wt=(jt=B==null?void 0:B.sea_surface_temperature)==null?void 0:jt.filter(se=>se!==null))==null?void 0:Wt.at(-1)),height:((Zt=B==null?void 0:B.sea_level_height_msl)==null?void 0:Zt.at(oe))??((Ve=(Me=B==null?void 0:B.sea_level_height_msl)==null?void 0:Me.filter(se=>se!==null))==null?void 0:Ve.at(-1)),ice:{sit:((Ht=B==null?void 0:B.sea_ice_thickness)==null?void 0:Ht.at(oe))??((Xt=(Ye=B==null?void 0:B.sea_ice_thickness)==null?void 0:Ye.filter(se=>se!==null))==null?void 0:Xt.at(-1)),sic:((et=B==null?void 0:B.sea_ice_concentration)==null?void 0:et.at(oe))??((Ue=(Ae=B==null?void 0:B.sea_ice_concentration)==null?void 0:Ae.filter(se=>se!==null))==null?void 0:Ue.at(-1))}},Ke.wave=this.parseWave(Ke.wave,ve==null?void 0:ve.wind),Ke.current.direction=this.degree2Direction(Ke.current.degree),Ot[tt]?Object.assign(Ot[tt],Ke):Ot.push({utc:ie.utc().format(),realUTC:Se.add(oe,"h").format(),model:ot.model,...Ke}),tt++}}return Ot}static toLegacy(e){var a,r,i,l,n,s,c,m,d,g;return{wind:(a=e==null?void 0:e.weather)==null?void 0:a.wind,visibility:(r=e==null?void 0:e.weather)==null?void 0:r.visibility,temp:(i=e==null?void 0:e.weather)==null?void 0:i.temp,prmsl:(l=e==null?void 0:e.weather)==null?void 0:l.pmsl,gusts:{kts:(s=(n=e==null?void 0:e.weather)==null?void 0:n.wind)==null?void 0:s.gusts},precip:(c=e==null?void 0:e.weather)==null?void 0:c.precip,code:(m=e==null?void 0:e.weather)==null?void 0:m.code,name:(d=e==null?void 0:e.weather)==null?void 0:d.name,url:(g=e==null?void 0:e.weather)==null?void 0:g.url,wave:e==null?void 0:e.wave,current:e==null?void 0:e.current,sst:e==null?void 0:e.sst,height:e==null?void 0:e.height,utc:e==null?void 0:e.utc,source:e==null?void 0:e.model,ice:e==null?void 0:e.ice}}static pickDaily(e,a){var r,i,l,n,s,c,m,d,g,u,y,p,h,f,x,v,b,k,A,L,C,z,M,T,N,F,O,q,$,le,S,Z,H,te,W,I,K,V,Y,ee,he,ge,re,ue,ye,ze,J,ne,Fe,Ge,Re,Ce,je,Ne,Ee,De,We,Ze,Be,xe,ke,_e,He,Xe,Oe,Pe,rt,lt,nt,st,ct,mt,dt,ht,pt,ut,gt,ft,yt,bt,wt,xt,kt,At,Lt,vt,Ct,_t,zt,St,Pt,Mt,Tt,Nt,Et,Vt,Rt,Dt,Bt,It,Ft,Gt,jt,Wt;const Zt=typeof a=="string"?_(a):a;let Me=Zt.clone();const Ve=e==null?void 0:e.weather,Ht=e==null?void 0:e.marine,Ye=_((l=(i=(r=Ve==null?void 0:Ve[0])==null?void 0:r.daily)==null?void 0:i.time)==null?void 0:l.at(0)),Xt=_((c=(s=(n=Ve==null?void 0:Ve[0])==null?void 0:n.daily)==null?void 0:s.time)==null?void 0:c.at(-1)),et=[];Me=Me.isBefore(Ye)?Ye.clone():Me,Me=Me.isAfter(Xt)?Xt.clone():Me;let Ae,Ue;const ie=Me.diff(Ye,"d",!1);if(Ve)for(const Le of Ve){const U=Le.daily,X=((m=U.wind_direction_10m_dominant)==null?void 0:m.at(ie))??((g=(d=U.wind_direction_10m_dominant)==null?void 0:d.filter(G=>G!==null))==null?void 0:g.at(-1));Ae={code:((u=U.weather_code)==null?void 0:u.at(ie))??((p=(y=U.weather_code)==null?void 0:y.filter(G=>G!==null))==null?void 0:p.at(-1)),temp:{max:((h=U.temperature_2m_max)==null?void 0:h.at(ie))??((x=(f=U.temperature_2m_max)==null?void 0:f.filter(G=>G!==null))==null?void 0:x.at(-1)),min:((v=U.temperature_2m_min)==null?void 0:v.at(ie))??((k=(b=U.temperature_2m_min)==null?void 0:b.filter(G=>G!==null))==null?void 0:k.at(-1)),mean:((A=U.temperature_2m_mean)==null?void 0:A.at(ie))??((C=(L=U.temperature_2m_mean)==null?void 0:L.filter(G=>G!==null))==null?void 0:C.at(-1))},apparentTemp:{max:((z=U.apparent_temperature_max)==null?void 0:z.at(ie))??((T=(M=U.apparent_temperature_max)==null?void 0:M.filter(G=>G!==null))==null?void 0:T.at(-1)),min:((N=U.apparent_temperature_min)==null?void 0:N.at(ie))??((O=(F=U.apparent_temperature_min)==null?void 0:F.filter(G=>G!==null))==null?void 0:O.at(-1))},precip:{sum:((q=U.precipitation_sum)==null?void 0:q.at(ie))??((le=($=U.precipitation_sum)==null?void 0:$.filter(G=>G!==null))==null?void 0:le.at(-1)),rainSum:((S=U.rain_sum)==null?void 0:S.at(ie))??((H=(Z=U.rain_sum)==null?void 0:Z.filter(G=>G!==null))==null?void 0:H.at(-1)),snowfallSum:((te=U.snowfall_sum)==null?void 0:te.at(ie))??((I=(W=U.snowfall_sum)==null?void 0:W.filter(G=>G!==null))==null?void 0:I.at(-1)),showersSum:((K=U.showers_sum)==null?void 0:K.at(ie))??((Y=(V=U.showers_sum)==null?void 0:V.filter(G=>G!==null))==null?void 0:Y.at(-1)),hours:((ee=U.precipitation_hours)==null?void 0:ee.at(ie))??0,probability:((he=U.precipitation_probability_max)==null?void 0:he.at(ie))??0},rh:{max:((ge=U.relative_humidity_2m_max)==null?void 0:ge.at(ie))??((ue=(re=U.relative_humidity_2m_max)==null?void 0:re.filter(G=>G!==null))==null?void 0:ue.at(-1)),min:((ye=U.relative_humidity_2m_min)==null?void 0:ye.at(ie))??((J=(ze=U.relative_humidity_2m_min)==null?void 0:ze.filter(G=>G!==null))==null?void 0:J.at(-1)),mean:((ne=U.relative_humidity_2m_mean)==null?void 0:ne.at(ie))??((Ge=(Fe=U.relative_humidity_2m_mean)==null?void 0:Fe.filter(G=>G!==null))==null?void 0:Ge.at(-1))},wind:{speed:((Re=U.wind_speed_10m_max)==null?void 0:Re.at(ie))??((je=(Ce=U.wind_speed_10m_max)==null?void 0:Ce.filter(G=>G!==null))==null?void 0:je.at(-1)),kts:((Ne=U.wind_speed_10m_max)==null?void 0:Ne.at(ie))??((De=(Ee=U.wind_speed_10m_max)==null?void 0:Ee.filter(G=>G!==null))==null?void 0:De.at(-1)),degree:X,gusts:((We=U.wind_gusts_10m_max)==null?void 0:We.at(ie))??((Be=(Ze=U.wind_gusts_10m_max)==null?void 0:Ze.filter(G=>G!==null))==null?void 0:Be.at(-1)),mean:((xe=U.wind_speed_10m_mean)==null?void 0:xe.at(ie))??((_e=(ke=U.wind_speed_10m_mean)==null?void 0:ke.filter(G=>G!==null))==null?void 0:_e.at(-1)),bearing:X!==null?Math.round((X+180)%360):null},visibility:{max:this.m2nm(((He=U.visibility_max)==null?void 0:He.at(ie))??((Oe=(Xe=U.visibility_max)==null?void 0:Xe.filter(G=>G!==null))==null?void 0:Oe.at(-1))),min:this.m2nm(((Pe=U.visibility_min)==null?void 0:Pe.at(ie))??((lt=(rt=U.visibility_min)==null?void 0:rt.filter(G=>G!==null))==null?void 0:lt.at(-1))),mean:this.m2nm(((nt=U.visibility_mean)==null?void 0:nt.at(ie))??((ct=(st=U.visibility_mean)==null?void 0:st.filter(G=>G!==null))==null?void 0:ct.at(-1)))}};const{name:Je,url:Ie,bg:Se}=this.parseWeatherCode(Ae.code,!0);Ae.name=Je,Ae.url=Ie,Ae.bg=Se,Ae.wind.scale=this.beaufort(this.kts2ms(Ae.wind.kts)),Ae.wind.direction=this.degree2Direction(Ae.wind.degree),et.push({utc:Zt.utc().format(),realUTC:Ye.add(ie,"d").utc().format(),model:Le.model,weather:{...Ae}})}if(Ht){let Le=0;for(const U of Ht){const X=U.daily,Je=((mt=X==null?void 0:X.wave_direction_dominant)==null?void 0:mt.at(ie))||((ht=(dt=X==null?void 0:X.wave_direction_dominant)==null?void 0:dt.filter(G=>G!==null))==null?void 0:ht.at(-1)),Ie=((pt=X==null?void 0:X.swell_wave_direction_dominant)==null?void 0:pt.at(ie))||((gt=(ut=X==null?void 0:X.swell_wave_direction_dominant)==null?void 0:ut.filter(G=>G!==null))==null?void 0:gt.at(-1)),Se=((ft=X==null?void 0:X.wind_wave_direction_dominant)==null?void 0:ft.at(ie))||((bt=(yt=X==null?void 0:X.wind_wave_direction_dominant)==null?void 0:yt.filter(G=>G!==null))==null?void 0:bt.at(-1));Ue={wave:{sig:{height:((wt=X==null?void 0:X.wave_height_max)==null?void 0:wt.at(ie))||((kt=(xt=X==null?void 0:X.wave_height_max)==null?void 0:xt.filter(G=>G!==null))==null?void 0:kt.at(-1)),degree:Je,period:((At=X==null?void 0:X.wave_period_max)==null?void 0:At.at(ie))||((vt=(Lt=X==null?void 0:X.wave_period_max)==null?void 0:Lt.filter(G=>G!==null))==null?void 0:vt.at(-1)),bearing:Je!==null?Math.round((Je+180)%360):null},swell:{height:((Ct=X==null?void 0:X.swell_wave_height_max)==null?void 0:Ct.at(ie))??((zt=(_t=X==null?void 0:X.swell_wave_height_max)==null?void 0:_t.filter(G=>G!==null))==null?void 0:zt.at(-1)),degree:Ie,period:((St=X==null?void 0:X.swell_wave_period_max)==null?void 0:St.at(ie))??((Mt=(Pt=X==null?void 0:X.swell_wave_period_max)==null?void 0:Pt.filter(G=>G!==null))==null?void 0:Mt.at(-1)),peakPeriod:((Tt=X==null?void 0:X.swell_wave_peak_period_max)==null?void 0:Tt.at(ie))??((Et=(Nt=X==null?void 0:X.swell_wave_peak_period_max)==null?void 0:Nt.filter(G=>G!==null))==null?void 0:Et.at(-1)),bearing:Ie!==null?Math.round((Ie+180)%360):null},wd:{height:((Vt=X==null?void 0:X.wind_wave_height_max)==null?void 0:Vt.at(ie))??((Dt=(Rt=X==null?void 0:X.wind_wave_height_max)==null?void 0:Rt.filter(G=>G!==null))==null?void 0:Dt.at(-1)),degree:Se,period:((Bt=X==null?void 0:X.wind_wave_period_max)==null?void 0:Bt.at(ie))??((Ft=(It=X==null?void 0:X.wind_wave_period_max)==null?void 0:It.filter(G=>G!==null))==null?void 0:Ft.at(-1)),peakPeriod:((Gt=X==null?void 0:X.wind_wave_peak_period_max)==null?void 0:Gt.at(ie))??((Wt=(jt=X==null?void 0:X.wind_wave_peak_period_max)==null?void 0:jt.filter(G=>G!==null))==null?void 0:Wt.at(-1)),bearing:Se!==null?Math.round((Se+180)%360):null}}},Ue.wave=this.parseWave(Ue.wave,Ae==null?void 0:Ae.wind),Object.assign(et[Le]||{},Ue),Le++}}return et}static parseWave(e,a){if(e.sig.direction=this.degree2Direction(e.sig.degree),e.swell.direction=this.degree2Direction(e.swell.degree),e.wd.direction=this.degree2Direction(e.wd.degree),e.sig.scale=this.douglas(e.sig.height),e.swell.scale=this.douglas(e.swell.height),e.wd.scale=this.douglas(e.wd.height),e.sig.height==0){const r=Math.sqrt(Math.pow(e.swell.height||0,2)+Math.pow(e.wd.height||0,2));e.sig.height=r?Math.round(r*100)/100:.1}if(e.swell.height===0)if(e.sig.height>e.wd.height){const r=Math.sqrt(Math.abs(Math.pow(e.sig.height||0,2)-Math.pow(e.wd.height||0,2)));e.swell.height=Math.round(r*100)/100}else{const r=Math.round(.12*this.kts2ms((a==null?void 0:a.kts)||0)*100)/100,i=r>1?r/10:r>.5?r/5:r>.3?r/2:r,l=Math.max(e.sig.height,e.wd.height);e.swell.height=Math.round((i<l?i:l/2)*100)/100}if(e.wd.height===0)if(e.sig.height>e.swell.height){const r=Math.sqrt(Math.abs(Math.pow(e.sig.height||0,2)-Math.pow(e.swell.height||0,2))),i=.24*this.kts2ms((a==null?void 0:a.kts)||0);e.wd.height=Math.round(Math.min(r,i)*100)/100}else{const r=.24*this.kts2ms((a==null?void 0:a.kts)||0),i=Math.max(e.sig.height,e.swell.height);e.wd.height=Math.round((r<i?r:i/2)*100)/100}if(e.swell.height>=e.sig.height&&(e.swell.height=Math.round(e.sig.height*.8*100)/100),e.wd.height>=e.sig.height&&(e.wd.height=Math.round(e.sig.height*.8*100)/100),!e.sig.period){const r=Math.max(e.swell.period,e.wd.period);e.sig.period=Math.round(6*Math.sqrt(e.sig.height)),e.sig.period=isNaN(r)?void 0:e.sig.period>r?r:e.sig.period}if(!e.swell.period){e.swell.period=Math.round(6*Math.sqrt(e.swell.height));const r=Math.max(e.sig.period,e.wd.period);e.swell.period=isNaN(r)?void 0:e.swell.period>r?r:e.swell.period}if(!e.wd.period){e.wd.period=Math.round(6*Math.sqrt(e.wd.height));const r=Math.max(e.sig.period,e.swell.period);e.wd.period=isNaN(r)?void 0:e.wd.period>r?r:e.wd.period}return e}static parseWeatherCode(e,a){const r=this.weatherCode(e);return(a?r.day:r.night)||{}}static weatherCode(e){const a={code:e};switch(e){case 0:a.day={name:"Sunny",url:"https://ossimg.ormwx.com/asset/weather/01d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg1.png"},a.night={name:"Clear",url:"https://ossimg.ormwx.com/asset/weather/01n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg1.png"};break;case 1:a.day={name:"Mainly Sunny",url:"https://ossimg.ormwx.com/asset/weather/01d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg1.png"},a.night={name:"Mainly Clear",url:"https://ossimg.ormwx.com/asset/weather/01n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg1.png"};break;case 2:a.day={name:"Partly Cloudy",url:"https://ossimg.ormwx.com/asset/weather/02d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg2.png"},a.night={name:"Partly Cloudy",url:"https://ossimg.ormwx.com/asset/weather/02n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg2.png"};break;case 3:a.day={name:"Overcast",url:"https://ossimg.ormwx.com/asset/weather/04d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg3.png"},a.night={name:"Overcast",url:"https://ossimg.ormwx.com/asset/weather/04n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg3.png"};break;case 45:a.day={name:"Foggy",url:"https://ossimg.ormwx.com/asset/weather/50d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg4.png"},a.night={name:"Foggy",url:"https://ossimg.ormwx.com/asset/weather/50n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg4.png"};break;case 48:a.day={name:"Rime Fog",url:"https://ossimg.ormwx.com/asset/weather/50d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg4.png"},a.night={name:"Rime Fog",url:"https://ossimg.ormwx.com/asset/weather/50n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg4.png"};break;case 51:a.day={name:"Light Drizzle",url:"https://ossimg.ormwx.com/asset/weather/14d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Drizzle",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 53:a.day={name:"Drizzle",url:"https://ossimg.ormwx.com/asset/weather/14d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Drizzle",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 55:a.day={name:"Heavy Drizzle",url:"https://ossimg.ormwx.com/asset/weather/15d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Drizzle",url:"https://ossimg.ormwx.com/asset/weather/15n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 56:a.day={name:"Light Freezing Drizzle",url:"https://ossimg.ormwx.com/asset/weather/14d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Freezing Drizzle",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 57:a.day={name:"Freezing Drizzle",url:"https://ossimg.ormwx.com/asset/weather/14d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Freezing Drizzle",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 61:a.day={name:"Light Rain",url:"https://ossimg.ormwx.com/asset/weather/16d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Rain",url:"https://ossimg.ormwx.com/asset/weather/10n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 63:a.day={name:"Rain",url:"https://ossimg.ormwx.com/asset/weather/16d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Rain",url:"https://ossimg.ormwx.com/asset/weather/10n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 65:a.day={name:"Heavy Rain",url:"https://ossimg.ormwx.com/asset/weather/16d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Rain",url:"https://ossimg.ormwx.com/asset/weather/10n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 66:a.day={name:"Light Freezing Rain",url:"https://ossimg.ormwx.com/asset/weather/16d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Freezing Rain",url:"https://ossimg.ormwx.com/asset/weather/10n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 67:a.day={name:"Freezing Rain",url:"https://ossimg.ormwx.com/asset/weather/16d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Freezing Rain",url:"https://ossimg.ormwx.com/asset/weather/10n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 71:a.day={name:"Light Snow",url:"https://ossimg.ormwx.com/asset/weather/17d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Light Snow",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 73:a.day={name:"Snow",url:"https://ossimg.ormwx.com/asset/weather/17d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Snow",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 75:a.day={name:"Heavy Snow",url:"https://ossimg.ormwx.com/asset/weather/17d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Heavy Snow",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 77:a.day={name:"Snow Grains",url:"https://ossimg.ormwx.com/asset/weather/17d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Snow Grains",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 80:a.day={name:"Light Showers",url:"https://ossimg.ormwx.com/asset/weather/09d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Showers",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 81:a.day={name:"Showers",url:"https://ossimg.ormwx.com/asset/weather/09d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Showers",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 82:a.day={name:"Heavy Showers",url:"https://ossimg.ormwx.com/asset/weather/09d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Heavy Showers",url:"https://ossimg.ormwx.com/asset/weather/09n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 85:a.day={name:"Light Snow Showers",url:"https://ossimg.ormwx.com/asset/weather/13d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Light Snow Showers",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 86:a.day={name:"Snow Showers",url:"https://ossimg.ormwx.com/asset/weather/13d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"},a.night={name:"Snow Showers",url:"https://ossimg.ormwx.com/asset/weather/13n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg6.png"};break;case 95:a.day={name:"Thunderstorm",url:"https://ossimg.ormwx.com/asset/weather/11d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Thunderstorm",url:"https://ossimg.ormwx.com/asset/weather/11n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 96:a.day={name:"Light Thunderstorms With Hail",url:"https://ossimg.ormwx.com/asset/weather/11d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Light Thunderstorms With Hail",url:"https://ossimg.ormwx.com/asset/weather/11n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break;case 99:a.day={name:"Thunderstorms With Hail",url:"https://ossimg.ormwx.com/asset/weather/11d.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"},a.night={name:"Thunderstorms With Hail",url:"https://ossimg.ormwx.com/asset/weather/11n.svg",bg:"https://ossimg.ormwx.com/asset/weather/bg5.png"};break}return a}static kts2ms(e){return isNaN(e)||e===null?e:Math.round(e*1852/3600*1e4)/1e4}static kts2kmh(e){return isNaN(e)||e===null?e:e*1.852}static m2nm(e){return isNaN(e)||e===null?e:Math.round(e/1e3/1.852*1e4)/1e4}static kmh2kts(e){return isNaN(e)||e===null?e:this.ms2kts(e*1e3/3600)}static ms2kts(e){return isNaN(e)||e===null?e:Math.round(e*3600/1852*1e4)/1e4}static degree2Radian(e){if(isNaN(e)||e===null)return e;let a=e%360/360*2*Math.PI;return a=a<0?a+2*Math.PI:a,a}static degree2Direction(e){const a=this.degree2Radian(e);if(isNaN(a)||a===null)return null;let r="N/A";const i=Math.PI/16;return a<i?r="N":a>=i&&a<3*i?r="NNE":a>=3*i&&a<5*i?r="NE":a>=5*i&&a<7*i?r="ENE":a>=7*i&&a<9*i?r="E":a>=9*i&&a<11*i?r="ESE":a>=11*i&&a<13*i?r="SE":a>=13*i&&a<15*i?r="SSE":a>=15*i&&a<17*i?r="S":a>=17*i&&a<19*i?r="SSW":a>=19*i&&a<21*i?r="SW":a>=21*i&&a<23*i?r="WSW":a>=23*i&&a<25*i?r="W":a>=25*i&&a<27*i?r="WNW":a>=27*i&&a<29*i?r="NW":a>=29*i&&a<31*i?r="NNW":a>=31*i&&a<32*i&&(r="N"),r}static beaufort(e){let a=0;return isNaN(e)||(e=Math.round(e*10)/10,e<=.2?a=0:e<=1.5?a=1:e<=3.3?a=2:e<=5.4?a=3:e<=7.9?a=4:e<=10.7?a=5:e<=13.8?a=6:e<=17.1?a=7:e<=20.7?a=8:e<=22.4?a=9:e<=28.4?a=10:e<=32.6?a=11:e<=36.9?a=12:e<=41.4?a=13:e<=46.1?a=14:e<=50.9?a=15:e<=55.9?a=16:e<=61.2?a=17:e>61.2&&(a=18)),a}static douglas(e){let a="Calm";return isNaN(e)||e<=.1?a="Calm":e<=.5?a="Smooth":e<=1.25?a="Slight":e<=2.5?a="Moderate":e<=4?a="Rough":e<=6?a="VeryRough":e<=9?a="High":e<=14?a="VeryHigh":a="Precipitous",a}};const Wb="",Fd={name:"IdmTropicals",props:{simple:{type:Boolean,default:!1},permission:{type:Number},locale:{type:String},map:{type:Object},top:{type:Number,default:60},paddingTop:{type:Number,default:48},menuToggle:{type:Object,default:{}},timeZone:{type:Number},token:{type:String},defaultMeteoToken:{type:String},gateway:{type:String,default:"aa"},assistGateway:{type:Array,default:[]},forecastModel:{type:String},realTime:{type:String},beforeLayer:{type:String},platform:{type:String}},emits:["tropical","tropicalCenterPoints","tropicalReport"],setup(){return{Theme:be.useTheme()}},data(){return{right:10,toggle:!1,helper:ho.CompanyHelper,tropicals:void 0,tropicalCacheKey:"tropicalCacheGL4",source:"tropicals-source",clusterSource:"tropicals-cluster-source",historyLayer:"tropicals-history-layer",forecastLayer:"tropicals-forecast-layer",forecastModelLayer:"tropicals-forecast-model-layer",forecastNameLayer:"tropicals-forecast-name-layer",pointCircleLayer:"tropicals-point-circle-layer",pointLabelLayer:"tropicals-point-label-layer",historyPointCircleLayer:"history-tropicals-point-circle-layer",historyPointLabelLayer:"history-tropicals-point-label-layer",interpolateData:[],interpolateMarkers:[],interpolateSource:"tropicals-interpolate-source",interpolateLineLayer:"tropicals-interpolate-line-layer",showTropicalsInfo:!1,activeTropicals:void 0,activeTropicalsMarker:void 0,empty:E.featureCollection([]),showLegend:!1,showHoverPoint:!1,hoverPoint:void 0,hoverMarker:void 0}},computed:{hoverLayers(){return[this.forecastNameLayer,this.forecastLayer,this.historyLayer,this.pointCircleLayer,this.pointCircleLayer+"-border",this.historyPointCircleLayer,this.historyPointCircleLayer+"-border",this.historyPointCircleLayer+"-inner"]},clickLayers(){return[this.forecastNameLayer,this.historyLayer]},computeTime(){return(t,e)=>{if(t){const a=_(t).utcOffset(e),r=e<0?e:"+"+e;return`${a==null?void 0:a.format("MMM-DD/HHmm")} (UTC${r}) ${a==null?void 0:a.fromNow()} `}return"-"}},computeTzTime(){return(t,e,a="MM-DD HH:mm")=>{var r,i;if(t){const l=e||0,n=(i=(r=_(t))==null?void 0:r.utcOffset(l))==null?void 0:i.format(a),s=`(UTC ${l>=0?"+":""}${l})`;return n+" "+s}return"-"}},computeTimezone(){return this.timeZone<0?this.timeZone:"+"+this.timeZone},computeBF(){return function(t){const e=va.kts2ms(t);return va.beaufort(e)}},computeMovement(){return function(t){var e,a;return(a=(e=t==null?void 0:t.forecasts)==null?void 0:e.find(r=>!r.disabled))==null?void 0:a.movement}},computePosition(){return t=>!t||t.lng===null||t.lng===void 0||isNaN(t.lng)||t.lat===null||t.lat===void 0||isNaN(t.lat)?"-":P.LngLatHelper.lat2pretty(t==null?void 0:t.lat,2).pretty+" / "+P.LngLatHelper.lng2pretty(t==null?void 0:t.lng,2).pretty}},watch:{"menuToggle.v":{handler(){this.$nextTick(()=>{var t;this.simple||(this.right=(((t=document.getElementsByClassName("right-bar")[0])==null?void 0:t.clientWidth)||0)+10)})},immediate:!0},map:{handler(t,e){e==null||e.off("render",this.handleUpdateMarkerVisibility),this.map?(this.map.on("render",this.handleUpdateMarkerVisibility),this.toggle=localStorage.getItem(this.tropicalCacheKey)==="true"||!1,localStorage.setItem(this.tropicalCacheKey,this.toggle),this.toggle&&this.fetchTropicals()):this.handleClear()}},showTropicalsInfo:{handler(){this.$emit("tropical",this.showTropicalsInfo),this.simple&&this.showTropicalsInfo?this.$nextTick(()=>{var t,e;this.$parent.playerBottom=((e=(t=this.$refs.tropicalsInfo)==null?void 0:t.$el)==null?void 0:e.clientHeight)+10}):this.simple&&(this.$parent.playerBottom=30)},immediate:!0},"tropicals.version":{handler(){this.handleRefresh()}},timeZone:{handler(t,e){t!==e&&this.toggle&&this.handleRefresh()}},realTime:{handler(t){this.map&&t&&this.toggle&&this.handleRender()}},locale:{handler(t){this.map&&this.toggle&&this.handleRefresh()}}},methods:{handleMenuToggle(){var t,e,a;this.toggle=!this.toggle,localStorage.setItem(this.tropicalCacheKey,this.toggle),this.toggle?this.fetchTropicals():(this.handleClear(),(a=(e=(t=this.$parent)==null?void 0:t.$refs)==null?void 0:e.idmBottomBar)==null||a.handleToggle("tropical",!1))},async fetchTropicals(){var i,l,n;const t=new Date().valueOf();let e=0,a=0,r=(i=ho.LayerHelper.WEATHER_LAYERS.find(s=>s.key==="tropicals"))==null?void 0:i.weight;if(r>0){const s=this.assistGateway[Math.round(Math.random()*(this.assistGateway.length-1))],c=await de.get(`${s}/api/arc/weather/layers2/links?l=${r}&v=${this.forecastModel}&t=${this.realTime}`,{headers:{Authorization:this.token||this.defaultMeteoToken}});if(a=new Date().valueOf()-(t+e),console.log("weather links elapsed: ",a,", total: ",e+=a),((l=c==null?void 0:c.data)==null?void 0:l.code)===0){const m=(n=c==null?void 0:c.data)==null?void 0:n.data;await de.get(m.tropicals,{headers:{Authorization:this.token||this.defaultMeteoToken,key:"tropicals"},responseType:/\.(jpg|png)$/.test(m.tropicals)?"blob":"json"}).then(d=>{var y,p,h,f;const g=P.TropicalHelper.convert2Geojson(((y=d==null?void 0:d.data)==null?void 0:y.data)||(d==null?void 0:d.data));((h=(p=d==null?void 0:d.config)==null?void 0:p.headers)==null?void 0:h.key)&&g&&(this.tropicals={data:g,list:(f=d.data)==null?void 0:f.data,active:!0,cached:!0,type:"json",etime:c.data.etime,version:Math.random()+1})}).catch(d=>{console.log(`tropicals fetch layer error: ${d}`)})}a=new Date().valueOf()-(t+e),console.log("tropicals elapsed: ",a,", total: ",e+=a)}},handleRefresh(){var e,a;(((a=(e=this.tropicals)==null?void 0:e.data)==null?void 0:a.features)||[]).forEach(r=>{var l,n,s,c,m,d,g,u,y,p,h,f,x,v,b,k,A,L,C;let i="";switch(!0){case(((l=r.properties.wind)==null?void 0:l.kts)<32||((n=r.properties)==null?void 0:n.kts)<32):i="td";break;case(((s=r.properties.wind)==null?void 0:s.kts)<47||((c=r.properties)==null?void 0:c.kts)<47):i="ts";break;case(((m=r.properties.wind)==null?void 0:m.kts)<63||((d=r.properties)==null?void 0:d.kts)<63):i="sts";break;case(((g=r.properties.wind)==null?void 0:g.kts)<79||((u=r.properties)==null?void 0:u.kts)<79):i="ty";break;case(((y=r.properties.wind)==null?void 0:y.kts)<94||((p=r.properties)==null?void 0:p.kts)<94):i="sty";break;case(((h=r.properties.wind)==null?void 0:h.kts)>=94||((f=r.properties)==null?void 0:f.kts)>=94):i="superTy";break;default:i="superTy";break}r.properties.levelI18n=i,((x=r.geometry)==null?void 0:x.type)==="Point"&&((v=r.properties)!=null&&v.important)&&(r.properties.format=(k=(b=_(r.properties.date))==null?void 0:b.utcOffset(this.timeZone))==null?void 0:k.format(`MMM-DD/HHmm [(utc${this.computeTimezone})]`)),((A=r.geometry)==null?void 0:A.type)==="Point"&&(r.properties.Name=((C=(L=r.properties.name)==null?void 0:L.trim())==null?void 0:C.replace(/^./,z=>z.toUpperCase()))||r.properties.nameCn,r.properties.nameCn=r.properties.nameCn||r.properties.Name||"-")}),this.handleInit()},handleInit(){var t,e,a,r,i,l,n,s,c,m,d,g;this.handleClear(),this.tropicals&&this.map&&(this.handleRender(),(t=this.map)==null||t.on("click",this.clickLayers,this.handleClick),(e=this.map)==null||e.on("mousemove",this.hoverLayers,this.handleHover),(a=this.map)==null||a.on("mouseleave",this.hoverLayers,this.handleLeave)),((l=(i=(r=this.tropicals)==null?void 0:r.data)==null?void 0:i.features)==null?void 0:l.length)>0?(c=(s=(n=this.$parent)==null?void 0:n.$refs)==null?void 0:s.idmBottomBar)==null||c.handleToggle("tropical",!0):(g=(d=(m=this.$parent)==null?void 0:m.$refs)==null?void 0:d.idmBottomBar)==null||g.handleToggle("tropical",!1)},handleRender(){var t,e,a,r,i,l,n,s,c,m;if(this.tropicals&&this.map){const d=new Date().valueOf();let g=0,u=0;(t=this.map)!=null&&t.getSource(this.source)?((a=this.map)==null||a.getSource(this.source).setData((e=this.tropicals)!=null&&e.active?this.tropicals.data:this.empty),u=new Date().valueOf()-(d+g)):(this.map.addSource(this.source,{type:"geojson",data:(r=this.tropicals)!=null&&r.active?(i=this.tropicals)==null?void 0:i.data:this.empty}),this.map.addLayer({id:this.historyLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["==","type","history"],["!=","disabled",!0]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":this.Theme.current.value.colors["on-surface"],"line-width":3,"line-opacity":.7}},this.beforeLayer),this.map.addLayer({id:this.forecastLayer,type:"line",source:this.source,filter:["all",["==","$type","LineString"],["==","type","forecast"],["!=","disabled",!0]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":["match",["get","model"],"cma",this.Theme.current.value.colors["tropicals-cma"],"jma",this.Theme.current.value.colors["tropicals-jma"],"ecmwf",this.Theme.current.value.colors["tropicals-ecmwf"],"ukm",this.Theme.current.value.colors["tropicals-ukm"],"noaa-at",this.Theme.current.value.colors["tropicals-noaa-at"],"noaa-ep",this.Theme.current.value.colors["tropicals-noaa-ep"],this.Theme.current.value.colors["tropicals-noaa-other"]],"line-width":2,"line-opacity":1,"line-dasharray":[1,2]}},this.beforeLayer),this.map.addLayer({id:this.forecastModelLayer,type:"symbol",source:this.source,filter:["all",["==","$type","LineString"],["==","type","forecast"],["!=","disabled",!0]],layout:{"symbol-placement":"line","text-field":"{model}","text-rotation-alignment":"viewport","text-size":12},paint:{"text-color":this.Theme.current.value.dark?"#333":"#fff","text-opacity":1,"text-halo-color":["match",["get","model"],"cma",this.Theme.current.value.colors["tropicals-cma"],"jma",this.Theme.current.value.colors["tropicals-jma"],"ecmwf",this.Theme.current.value.colors["tropicals-ecmwf"],"ukm",this.Theme.current.value.colors["tropicals-ukm"],"noaa-at",this.Theme.current.value.colors["tropicals-noaa-at"],"noaa-ep",this.Theme.current.value.colors["tropicals-noaa-ep"],this.Theme.current.value.colors["tropicals-noaa-other"]],"text-halo-width":4}},this.beforeLayer),u=new Date().valueOf()-(d+g),console.log("[tropical] add elapsed: ",u,", total: ",g+=u)),(l=this.map)!=null&&l.getSource(this.clusterSource)?((s=this.map)==null||s.getSource(this.clusterSource).setData((n=this.tropicals)!=null&&n.active?this.tropicals.data:this.empty),u=new Date().valueOf()-(d+g),console.log("[tropical] update elapsed: ",u,", total: ",g+=u)):(this.map.addSource(this.clusterSource,{type:"geojson",data:(c=this.tropicals)!=null&&c.active?(m=this.tropicals)==null?void 0:m.data:this.empty}),this.map.addLayer({id:this.pointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":5,"circle-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.pointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],paint:{"circle-radius":4,"circle-color":["case",["boolean",["==",["get","kts",["get","wind"]],null]],this.Theme.current.value.colors["tropicals-td"],["boolean",["<",["get","kts",["get","wind"]],32]],this.Theme.current.value.colors["tropicals-td"],["boolean",["<",["get","kts",["get","wind"]],47]],this.Theme.current.value.colors["tropicals-ts"],["boolean",["<",["get","kts",["get","wind"]],63]],this.Theme.current.value.colors["tropicals-sts"],["boolean",["<",["get","kts",["get","wind"]],79]],this.Theme.current.value.colors["tropicals-ty"],["boolean",["<",["get","kts",["get","wind"]],94]],this.Theme.current.value.colors["tropicals-sty"],["boolean",[">=",["get","kts",["get","wind"]],94]],this.Theme.current.value.colors["tropicals-super-ty"],"#fff"]}},this.beforeLayer),this.map.addLayer({id:this.pointLabelLayer,type:"symbol",source:this.clusterSource,minzoom:5,filter:["all",["==","$type","Point"],["==","type","forecast"],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[1,0],"text-anchor":"left","text-size":10},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.historyPointCircleLayer+"-border",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],paint:{"circle-radius":6,"circle-color":"#fff"}},this.beforeLayer),this.map.addLayer({id:this.historyPointCircleLayer,type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],paint:{"circle-radius":5,"circle-color":"rgba(0,0,0,0.7)"}},this.beforeLayer),this.map.addLayer({id:this.historyPointCircleLayer+"-inner",type:"circle",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],paint:{"circle-radius":3,"circle-color":"#fff"}},this.beforeLayer),this.map.addLayer({id:this.historyPointLabelLayer,type:"symbol",source:this.clusterSource,minzoom:5,filter:["all",["==","$type","Point"],["==","type","history"],["==","important",!0],["!=","disabled",!0]],layout:{"text-field":["get","format"],"text-offset":[1,0],"text-anchor":"left","text-size":10},paint:{"text-color":this.Theme.current.value.colors["on-surface"]}},this.beforeLayer),this.map.addLayer({id:this.forecastNameLayer,type:"symbol",source:this.clusterSource,filter:["all",["==","$type","Point"],["==","type","forecast"],["==","important",!0]],layout:{"text-field":["get",this.locale==="en"?"Name":"nameCn"],"text-anchor":"bottom","text-size":16,"text-allow-overlap":!0,"text-ignore-placement":!0,"text-font":["DIN Pro Regular","Arial Unicode MS Regular"],"text-offset":[0,2]},paint:{"text-color":this.Theme.current.value.colors["map-blue"],"text-halo-color":"#ffffff","text-halo-width":2}},this.beforeLayer),u=new Date().valueOf()-(d+g),console.log("[tropical] add elapsed: ",u,", total: ",g+=u));const y=P.TropicalHelper.interpolate(this.tropicals,1);this.interpolateData=JSON.parse(JSON.stringify(y)),this.handleDateChange()}},handleClear(){var t,e,a,r,i;this.map&&(this.map.getLayer(this.historyLayer)&&this.map.removeLayer(this.historyLayer),this.map.getLayer(this.forecastLayer)&&this.map.removeLayer(this.forecastLayer),this.map.getLayer(this.forecastModelLayer)&&this.map.removeLayer(this.forecastModelLayer),this.map.getLayer(this.forecastNameLayer)&&this.map.removeLayer(this.forecastNameLayer),this.map.getLayer(this.pointCircleLayer)&&this.map.removeLayer(this.pointCircleLayer),this.map.getLayer(this.pointCircleLayer+"-border")&&this.map.removeLayer(this.pointCircleLayer+"-border"),this.map.getLayer(this.pointLabelLayer)&&this.map.removeLayer(this.pointLabelLayer),this.map.getLayer(this.historyPointCircleLayer)&&this.map.removeLayer(this.historyPointCircleLayer),this.map.getLayer(this.historyPointCircleLayer+"-border")&&this.map.removeLayer(this.historyPointCircleLayer+"-border"),this.map.getLayer(this.historyPointCircleLayer+"-inner")&&this.map.removeLayer(this.historyPointCircleLayer+"-inner"),this.map.getLayer(this.historyPointLabelLayer)&&this.map.removeLayer(this.historyPointLabelLayer),this.map.getLayer(this.interpolateLineLayer)&&this.map.removeLayer(this.interpolateLineLayer),(t=this.interpolateMarkers)==null||t.forEach(l=>l==null?void 0:l.remove()),this.map.getSource(this.source)&&this.map.removeSource(this.source),this.map.getSource(this.clusterSource)&&this.map.removeSource(this.clusterSource),this.map.getSource(this.interpolateSource)&&this.map.removeSource(this.interpolateSource)),(e=this.map)==null||e.off("click",this.clickLayers,this.handleClick),(a=this.map)==null||a.off("mousemove",this.hoverLayers,this.handleHover),(r=this.map)==null||r.off("mouseleave",this.hoverLayers,this.handleLeave),(i=this.map)==null||i.off("render",this.handleUpdateMarkerVisibility),this.handleCloseInfoMarker()},handleUpdateMarkerVisibility(){const t=this.map;if(!t)return;const e=t.getCenter();for(const a of this.interpolateMarkers||[]){const r=a==null?void 0:a.getElement();if(!r)continue;const i=a.getLngLat(),n=E.distance(e.toArray(),[i.lng,i.lat],{units:"radians"})>=Math.PI/2?"hidden":"visible";r.style.visibility!==n&&(r.style.visibility=n)}},handleDateChange(){var t,e,a,r,i,l,n,s,c,m,d,g,u,y,p,h,f,x,v,b,k,A,L,C,z,M,T,N,F,O,q,$,le,S,Z;if((t=this.interpolateMarkers)==null||t.forEach(H=>H==null?void 0:H.remove()),(e=this.interpolateData)!=null&&e.length&&this.tropicals.active){const H=_(this.realTime).utc().set({minute:0,second:0,millisecond:0}),te=this.interpolateData.filter(V=>V.properties.date===(H==null?void 0:H.format())&&!V.properties.disabled),W=this.handleComputePolygons(te),I=E.featureCollection([...te]);W.forEach(V=>{I.features.push(V)}),(a=this.map)!=null&&a.getSource(this.interpolateSource)?(r=this.map)==null||r.getSource(this.interpolateSource).setData(I):((i=this.map)==null||i.addSource(this.interpolateSource,{type:"geojson",data:I}),(l=this.map)==null||l.addLayer({id:this.interpolateLineLayer,type:"line",source:this.interpolateSource,filter:["all",["==","$type","Polygon"],["!=","disabled",!0]],paint:{"line-opacity":1,"line-color":["match",["get","level"],7,this.Theme.current.value.colors["tropicals-r7"],10,this.Theme.current.value.colors["tropicals-r10"],this.Theme.current.value.colors["tropicals-r10"]],"line-width":1}},"empty-layer-3")),this.interpolateMarkers=[];const K=[];for(const V of te)if(!V.properties.disabled){if(!K.some(re=>{var ue;return re.properties.name===((ue=V.properties)==null?void 0:ue.name)})){const re=((s=(n=this.tropicals.data.features.find(ue=>{var ye;return ue.properties.name===((ye=V.properties)==null?void 0:ye.name)}))==null?void 0:n.properties)==null?void 0:s.nameCn)||((c=V.properties)==null?void 0:c.Name)||"-";V.properties.nameCn=re,V.properties.Name=((d=(m=V.properties.name)==null?void 0:m.trim())==null?void 0:d.replace(/^./,ue=>ue.toUpperCase()))||V.properties.nameCn,K.push(V)}let Y=this.Theme.current.value.colors["tropicals-ty"];((u=(g=V.properties)==null?void 0:g.wind)==null?void 0:u.kts)<32||!((p=(y=V.properties)==null?void 0:y.wind)!=null&&p.kts)?Y=this.Theme.current.value.colors["tropicals-td"]:((f=(h=V.properties)==null?void 0:h.wind)==null?void 0:f.kts)>=32&&((v=(x=V.properties)==null?void 0:x.wind)==null?void 0:v.kts)<47?Y=this.Theme.current.value.colors["tropicals-ts"]:((k=(b=V.properties)==null?void 0:b.wind)==null?void 0:k.kts)>=47&&((L=(A=V.properties)==null?void 0:A.wind)==null?void 0:L.kts)<63?Y=this.Theme.current.value.colors["tropicals-sts"]:((z=(C=V.properties)==null?void 0:C.wind)==null?void 0:z.kts)>=63&&((T=(M=V.properties)==null?void 0:M.wind)==null?void 0:T.kts)<79?Y=this.Theme.current.value.colors["tropicals-ty"]:((F=(N=V.properties)==null?void 0:N.wind)==null?void 0:F.kts)>=79&&((q=(O=V.properties)==null?void 0:O.wind)==null?void 0:q.kts)<94?Y=this.Theme.current.value.colors["tropicals-sty"]:((le=($=V.properties)==null?void 0:$.wind)==null?void 0:le.kts)>=94?Y=this.Theme.current.value.colors["tropicals-super-ty"]:Y=this.Theme.current.value.colors["tropicals-ty"];const ee=`<svg t="1719918955501"
|
|
624
624
|
class="icon" viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" p-id="18382"
|
|
625
625
|
xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">
|
|
626
626
|
<path
|
|
@@ -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-97528b6a.js";
|
|
2
|
+
import "./chunk-3VYIPD3A-d4577dfc.js";
|
|
3
|
+
import "./index-582c7bfb.js";
|
|
4
4
|
import "axios";
|
|
5
5
|
import "vuetify";
|
|
6
6
|
import "vue";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { m as k } from "./chunk-T4JIPPZO-
|
|
2
|
-
import "./chunk-3VYIPD3A-
|
|
3
|
-
import "./index-
|
|
1
|
+
import { m as k } from "./chunk-T4JIPPZO-d92de456.js";
|
|
2
|
+
import "./chunk-3VYIPD3A-d4577dfc.js";
|
|
3
|
+
import "./index-582c7bfb.js";
|
|
4
4
|
import "axios";
|
|
5
5
|
import "vuetify";
|
|
6
6
|
import "vue";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as u } from "./chunk-ANSXOGKI-
|
|
2
|
-
import { l as g } from "./index-
|
|
3
|
-
import "./chunk-3VYIPD3A-
|
|
1
|
+
import { d as u } from "./chunk-ANSXOGKI-97528b6a.js";
|
|
2
|
+
import { l as g } from "./index-582c7bfb.js";
|
|
3
|
+
import "./chunk-3VYIPD3A-d4577dfc.js";
|
|
4
4
|
import "axios";
|
|
5
5
|
import "vuetify";
|
|
6
6
|
import "vue";
|