@xweather/mapsgl 1.9.2 → 1.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/mapsgl.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * @xweather/mapsgl - 1.9.2
3
+ * @xweather/mapsgl - 1.9.3
4
4
  * (c) 2026 Vaisala Xweather
5
5
  * License: BSD
6
6
  * https://www.xweather.com
@@ -16,4 +16,4 @@
16
16
  * Copyright (c) 2015-2019 Ronny Lorenz <ronny@tbi.univie.ac.at>
17
17
  */function Lm(t,e,i){return t<e?(i-t)/(e-t):(t-i)/(t-e)}function Om(){this.successCallback=null,this.verbose=!1,this.polygons=!1,this.polygons_full=!1,this.linearRing=!0,this.noQuadTree=!1,this.noFrame=!1}function jm(t,e,i,r){var s=[];return t.polygons.forEach((function(t){t.forEach((function(t){t[0]+=e,t[1]+=i})),r.linearRing&&t.push(t[0]),s.push(t)})),s}function Dm(t,e,i,r){return 0===i?(t+=1,e+=r[0][1]):1===i?t+=r[0][0]:2===i?e+=r[0][1]:3===i&&(t+=r[0][0],e+=1),[t,e]}function Xm(t,e,i){return 0===i?t++:1===i||(2===i?e++:3===i&&(t++,e++)),[t,e]}function Bm(t,e,i,r,s){var a=r,n=s,o=0,l=0;if(this.x=e,this.y=i,this.lowerBound=null,this.upperBound=null,this.childA=null,this.childB=null,this.childC=null,this.childD=null,1===r&&1===s)this.lowerBound=Math.min(t[i][e],t[i][e+1],t[i+1][e+1],t[i+1][e]),this.upperBound=Math.max(t[i][e],t[i][e+1],t[i+1][e+1],t[i+1][e]);else{if(r>1){for(;0!==a;)a>>=1,o++;r===1<<o-1&&o--,a=1<<o-1}if(s>1){for(;0!==n;)n>>=1,l++;s===1<<l-1&&l--,n=1<<l-1}this.childA=new Bm(t,e,i,a,n),this.lowerBound=this.childA.lowerBound,this.upperBound=this.childA.upperBound,r-a>0&&(this.childB=new Bm(t,e+a,i,r-a,n),this.lowerBound=Math.min(this.lowerBound,this.childB.lowerBound),this.upperBound=Math.max(this.upperBound,this.childB.upperBound),s-n>0&&(this.childC=new Bm(t,e+a,i+n,r-a,s-n),this.lowerBound=Math.min(this.lowerBound,this.childC.lowerBound),this.upperBound=Math.max(this.upperBound,this.childC.upperBound))),s-n>0&&(this.childD=new Bm(t,e,i+n,a,s-n),this.lowerBound=Math.min(this.lowerBound,this.childD.lowerBound),this.upperBound=Math.max(this.upperBound,this.childD.upperBound))}}function Pm(t){var e,i;if(!t)throw new Error("data is required");if(!Array.isArray(t)||!Array.isArray(t[0]))throw new Error("data must be scalar field, i.e. array of arrays");if(t.length<2)throw new Error("data must contain at least two rows");if((i=t[0].length)<2)throw new Error("data must contain at least two columns");for(e=1;e<t.length;e++){if(!Array.isArray(t[e]))throw new Error("Row "+e+" is not an array");if(t[e].length!=i)throw new Error("unequal row lengths detected, please provide a regular grid")}this.data=t,this.root=new Bm(t,0,0,t[0].length-1,t.length-1)}function Hm(t,e,i,r){var s,a,n,o,l,h,d=0,c=t[i+1][e],u=t[i+1][e+1],p=t[i][e+1],m=t[i][e],g=r.threshold;if(!(isNaN(m)||isNaN(p)||isNaN(u)||isNaN(c))){switch(d|=c>=g?8:0,d|=u>=g?4:0,d|=p>=g?2:0,h={cval:d=+(d|=m>=g?1:0),polygons:[],edges:{},x0:m,x1:p,x2:u,x3:c},d){case 0:r.polygons&&h.polygons.push([[0,0],[0,1],[1,1],[1,0]]);break;case 15:break;case 14:s=r.interpolate(m,c,g),o=r.interpolate(m,p,g),r.polygons_full&&(h.edges.left={path:[[0,s],[o,0]],move:{x:0,y:-1,enter:"top"}}),r.polygons&&h.polygons.push([[0,0],[0,s],[o,0]]);break;case 13:o=r.interpolate(m,p,g),a=r.interpolate(p,u,g),r.polygons_full&&(h.edges.bottom={path:[[o,0],[1,a]],move:{x:1,y:0,enter:"left"}}),r.polygons&&h.polygons.push([[o,0],[1,a],[1,0]]);break;case 11:a=r.interpolate(p,u,g),n=r.interpolate(c,u,g),r.polygons_full&&(h.edges.right={path:[[1,a],[n,1]],move:{x:0,y:1,enter:"bottom"}}),r.polygons&&h.polygons.push([[1,a],[n,1],[1,1]]);break;case 7:s=r.interpolate(m,c,g),n=r.interpolate(c,u,g),r.polygons_full&&(h.edges.top={path:[[n,1],[0,s]],move:{x:-1,y:0,enter:"right"}}),r.polygons&&h.polygons.push([[n,1],[0,s],[0,1]]);break;case 1:s=r.interpolate(m,c,g),o=r.interpolate(m,p,g),r.polygons_full&&(h.edges.bottom={path:[[o,0],[0,s]],move:{x:-1,y:0,enter:"right"}}),r.polygons&&h.polygons.push([[o,0],[0,s],[0,1],[1,1],[1,0]]);break;case 2:o=r.interpolate(m,p,g),a=r.interpolate(p,u,g),r.polygons_full&&(h.edges.right={path:[[1,a],[o,0]],move:{x:0,y:-1,enter:"top"}}),r.polygons&&h.polygons.push([[0,0],[0,1],[1,1],[1,a],[o,0]]);break;case 4:a=r.interpolate(p,u,g),n=r.interpolate(c,u,g),r.polygons_full&&(h.edges.top={path:[[n,1],[1,a]],move:{x:1,y:0,enter:"left"}}),r.polygons&&h.polygons.push([[0,0],[0,1],[n,1],[1,a],[1,0]]);break;case 8:s=r.interpolate(m,c,g),n=r.interpolate(c,u,g),r.polygons_full&&(h.edges.left={path:[[0,s],[n,1]],move:{x:0,y:1,enter:"bottom"}}),r.polygons&&h.polygons.push([[0,0],[0,s],[n,1],[1,1],[1,0]]);break;case 12:s=r.interpolate(m,c,g),a=r.interpolate(p,u,g),r.polygons_full&&(h.edges.left={path:[[0,s],[1,a]],move:{x:1,y:0,enter:"left"}}),r.polygons&&h.polygons.push([[0,0],[0,s],[1,a],[1,0]]);break;case 9:o=r.interpolate(m,p,g),n=r.interpolate(c,u,g),r.polygons_full&&(h.edges.bottom={path:[[o,0],[n,1]],move:{x:0,y:1,enter:"bottom"}}),r.polygons&&h.polygons.push([[o,0],[n,1],[1,1],[1,0]]);break;case 3:s=r.interpolate(m,c,g),a=r.interpolate(p,u,g),r.polygons_full&&(h.edges.right={path:[[1,a],[0,s]],move:{x:-1,y:0,enter:"right"}}),r.polygons&&h.polygons.push([[0,s],[0,1],[1,1],[1,a]]);break;case 6:o=r.interpolate(m,p,g),n=r.interpolate(c,u,g),r.polygons_full&&(h.edges.top={path:[[n,1],[o,0]],move:{x:0,y:-1,enter:"top"}}),r.polygons&&h.polygons.push([[0,0],[0,1],[n,1],[o,0]]);break;case 10:s=r.interpolate(m,c,g),a=r.interpolate(p,u,g),o=r.interpolate(m,p,g),n=r.interpolate(c,u,g),l=(m+p+u+c)/4,r.polygons_full&&(l<g?(h.edges.left={path:[[0,s],[n,1]],move:{x:0,y:1,enter:"bottom"}},h.edges.right={path:[[1,a],[o,0]],move:{x:0,y:-1,enter:"top"}}):(h.edges.right={path:[[1,a],[n,1]],move:{x:0,y:1,enter:"bottom"}},h.edges.left={path:[[0,s],[o,0]],move:{x:0,y:-1,enter:"top"}})),r.polygons&&(l<g?h.polygons.push([[0,0],[0,s],[n,1],[1,1],[1,a],[o,0]]):(h.polygons.push([[0,0],[0,s],[o,0]]),h.polygons.push([[n,1],[1,1],[1,a]])));break;case 5:s=r.interpolate(m,c,g),a=r.interpolate(p,u,g),o=r.interpolate(m,p,g),n=r.interpolate(c,u,g),l=(m+p+u+c)/4,r.polygons_full&&(l<g?(h.edges.bottom={path:[[o,0],[0,s]],move:{x:-1,y:0,enter:"right"}},h.edges.top={path:[[n,1],[1,a]],move:{x:1,y:0,enter:"left"}}):(h.edges.top={path:[[n,1],[0,s]],move:{x:-1,y:0,enter:"right"}},h.edges.bottom={path:[[o,0],[1,a]],move:{x:1,y:0,enter:"left"}})),r.polygons&&(l<g?h.polygons.push([[0,s],[0,1],[n,1],[1,a],[1,0],[o,0]]):(h.polygons.push([[0,s],[0,1],[n,1]]),h.polygons.push([[o,0],[1,a],[1,0]])))}return h}}function Um(t,e,i){const r=t.getTime()/864e5+2440587.5-2451545,s=(357.529+.98560028*r)%360,a=((280.459+.98564736*r)%360+1.915*Math.sin(Yt(s))+.02*Math.sin(2*Yt(s)))%360,n=23.439-36e-8*r,o=Lt(Math.atan2(Math.cos(Yt(n))*Math.sin(Yt(a)),Math.cos(Yt(a)))),l=Lt(Math.asin(Math.sin(Yt(n))*Math.sin(Yt(a)))),h=((100.46+.985647*r+i+15*(t.getUTCHours()+t.getUTCMinutes()/60+t.getUTCSeconds()/3600))%360-o+360)%360;return Lt(Math.asin(Math.sin(Yt(e))*Math.sin(Yt(l))+Math.cos(Yt(e))*Math.cos(Yt(l))*Math.cos(Yt(h))))}function Qm(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const r=[];return function(t,e,i){var r,s,a,n=!1,o=!1,l=null,h=null,d=null,c=null,u=null,p=[];if(!t)throw new Error("data is required");if(null==e)throw new Error("threshold is required");if(i&&"object"!=typeof i)throw new Error("options must be an object");if(r=function(t){var e,i,r,s,a;for(s=new Om,t=t||{},a=Object.keys(s),e=0;e<a.length;e++)null!=(r=t[i=a[e]])&&(s[i]=r);return s.polygons_full=!s.polygons,s.interpolate=Lm,s}(i),t instanceof Pm)l=t,h=t.root,d=t.data,r.noQuadTree||(n=!0);else{if(!Array.isArray(t)||!Array.isArray(t[0]))throw new Error("input is neither array of arrays nor object retrieved from 'QuadTree()'");d=t}if(Array.isArray(e)){for(o=!0,r.noQuadTree||(n=!0),s=0;s<e.length;s++)if(isNaN(+e[s]))throw new Error("threshold["+s+"] is not a number")}else{if(isNaN(+e))throw new Error("threshold must be a number or array of numbers");e=[e]}n&&!h&&(l=new Pm(d),h=l.root,d=l.data),e.forEach((function(t,e){if(u=[],r.threshold=t,r.polygons)if(n)h.cellsBelowThreshold(r.threshold,!0).forEach((function(t){u=u.concat(jm(Hm(d,t.x,t.y,r),t.x,t.y,r))}));else for(a=0;a<d.length-1;++a)for(e=0;e<d[0].length-1;++e)u=u.concat(jm(Hm(d,e,a,r),e,a,r));else{for(c=[],e=0;e<d[0].length-1;++e)c[e]=[];if(n)h.cellsBelowThreshold(r.threshold,!1).forEach((function(t){c[t.x][t.y]=Hm(d,t.x,t.y,r)}));else for(e=0;e<d[0].length-1;++e)for(a=0;a<d.length-1;++a)c[e][a]=Hm(d,e,a,r);u=function(t,e,i){var r,s,a,n,o,l,h,d,c,u,p,m,g,f,v,y=[],b=t.length-1,x=t[0].length-1,w=["right","bottom","left","top"],_=[0,-1,0,1],M=[-1,0,1,0],Z={bottom:1,left:2,top:3,right:0};return i.noFrame||function(t,e){var i,r,s,a,n;for(i=!0,r=t[0].length,s=t.length,n=0;n<s;n++)if(t[n][0]>=e||t[n][r-1]>=e){i=!1;break}if(i&&(t[s-1][0]>=e||t[s-1][r-1]>=e)&&(i=!1),i)for(a=0;a<r-1;a++)if(t[0][a]>=e||t[s-1][a]>e){i=!1;break}return i}(t,i.threshold)&&y.push(i.linearRing?[[0,0],[0,b],[x,b],[x,0],[0,0]]:[[0,0],[0,b],[x,b],[x,0]]),e.forEach((function(t,A){t.forEach((function(t,T){for(r=null,s=0;s<4;s++)if("object"==typeof t.edges[r=w[s]]){for(l=r,h=A,d=T,c=!1,(o=[]).push(u=[A+(a=t.edges[r]).path[0][0],T+a.path[0][1]]);!c&&"object"==typeof(n=e[h][d]).edges[l];)if(a=n.edges[l],delete n.edges[l],(p=a.path[1])[0]+=h,p[1]+=d,o.push(p),l=a.move.enter,d+=a.move.y,void 0===e[h+=a.move.x]||void 0===e[h][d]){if(!i.linearRing)break;if(m=0,g=0,h===x?(h--,m=0):h<0?(h++,m=2):d===b?(d--,m=3):d<0&&(d++,m=1),h===A&&d===T&&m===Z[r]){c=!0,l=r;break}for(;;){if(f=!1,g>4)throw new Error("Direction change counter overflow! This should never happen!");if(void 0!==e[h]&&void 0!==e[h][d]&&"object"==typeof(n=e[h][d]).edges[v=w[m]]){o.push(Dm(h,d,m,(a=n.edges[v]).path)),l=v,f=!0;break}if(f)break;if(o.push(Xm(h,d,m)),d+=M[m],void 0!==e[h+=_[m]]&&void 0!==e[h][d]||(0===m&&d<0||1===m&&h<0||2===m&&d===b||3===m&&h===x)&&(h-=_[m],d-=M[m],m=(m+1)%4,g++),h===A&&d===T&&m===Z[r]){c=!0,l=r;break}}}!i.linearRing||o[o.length-1][0]===u[0]&&o[o.length-1][1]===u[1]||o.push(u),y.push(o)}}))})),y}(d,c,r)}o?p.push(u):p=u,"function"==typeof r.successCallback&&r.successCallback(p,t)}))}(t,[e],{successCallback:t=>{const e=Array.isArray(t[0])?t[0]:t;for(const t of e){const e=t.map((t=>{let[e,r]=t;return[e*i-180,90-r*i]}));e.length>2&&(e[0][0]!==e.at(-1)[0]||e[0][1]!==e.at(-1)[1])&&e.push(e[0]),r.push(e)}}}),r.length>0?r:null}Bm.prototype.cellsInBand=function(t,e,i){var r=[];return i=void 0===i||i,this.lowerBound>e||this.upperBound<t||(this.childA||this.childB||this.childC||this.childD?(this.childA&&(r=r.concat(this.childA.cellsInBand(t,e,i))),this.childB&&(r=r.concat(this.childB.cellsInBand(t,e,i))),this.childD&&(r=r.concat(this.childD.cellsInBand(t,e,i))),this.childC&&(r=r.concat(this.childC.cellsInBand(t,e,i)))):(i||this.lowerBound<=t||this.upperBound>=e)&&r.push({x:this.x,y:this.y})),r},Bm.prototype.cellsBelowThreshold=function(t,e){var i=[];return e=void 0===e||e,this.lowerBound>t||(this.childA||this.childB||this.childC||this.childD?(this.childA&&(i=i.concat(this.childA.cellsBelowThreshold(t,e))),this.childB&&(i=i.concat(this.childB.cellsBelowThreshold(t,e))),this.childD&&(i=i.concat(this.childD.cellsBelowThreshold(t,e))),this.childC&&(i=i.concat(this.childC.cellsBelowThreshold(t,e)))):(e||this.upperBound>=t)&&i.push({x:this.x,y:this.y})),i};const Km=class{constructor(t){this.date=t}update(t){this.date=t;const e=function(t){const e=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const i=[];Math.floor(180/e),Math.floor(360/e);let r=90;for(;r>=-90;){const s=[];let a=-180;for(;a<=180;){const i=Um(t,r,a);s.push(i),a+=e}i.push(s),r-=e}return i}(t,2),i=Qm(e,0,2),r=Qm(e,-6,2),s=Qm(e,-12,2),a=Qm(e,-18,2),n={type:"FeatureCollection",features:[]};return i&&n.features.push({type:"Feature",geometry:{type:"Polygon",coordinates:i},properties:{level:"civil"}}),r&&n.features.push({type:"Feature",geometry:{type:"Polygon",coordinates:r},properties:{level:"nautical"}}),s&&n.features.push({type:"Feature",geometry:{type:"Polygon",coordinates:s},properties:{level:"astronomical"}}),n.features.push({type:"Feature",geometry:{type:"Polygon",coordinates:a},properties:{level:"night"}}),n}(this.date);this.source.setData(e)}addToMap(t){const e={id:"mapsgl::daynight",type:Ft.o.geojson,url:void 0,data:{type:"FeatureCollection",features:[]},metadataUrl:void 0,timeSeries:void 0},i={type:xs.m.fill,source:e.id,paint:{fill:{color:t=>"rgba(0, 0, 0, 0.25)"}}},r=t.addSource(e.id,e);r instanceof Zn&&(this.source=r);const s=t.addLayer("mapsgl::daynight",i);s instanceof ro&&(this.layer=s),this.update(t.timeline.currentDate),t.timeline.on(Gn.A.ADVANCE,this.handleTimelineAdvance,null,this)}removeFromMap(t){t.timeline.off(Gn.A.ADVANCE,this.handleTimelineAdvance),this.source&&t.removeSource(this.source.id),this.layer&&t.removeLayer(this.layer.id)}handleTimelineAdvance(t){this.update(t.date)}},Jm=class extends O.A{constructor(){super(...arguments),this._sources=new Set,this._loadingSourceIds=new Set,this._progressBySourceId=new Map,this._progress={total:0,completed:0,failed:0,cancelled:0,progress:0},this._boundHandlers=new Map}get loadingSourceIds(){return this._loadingSourceIds}get progress(){return this._progress}get isLoading(){return this._loadingSourceIds.size>0}register(t){this._sources.add(t);const e={start:this.onSourceLoadStart.bind(this),progress:this.onSourceLoadProgress.bind(this),complete:this.onSourceLoadComplete.bind(this)};this._boundHandlers.set(t,e),t.on(yt.A.LOAD_START,e.start),t.on(yt.A.LOAD_PROGRESS,e.progress),t.on(yt.A.LOAD_COMPLETE,e.complete)}unregister(t){this._sources.delete(t);const e=this._boundHandlers.get(t);e&&(t.off(yt.A.LOAD_START,e.start),t.off(yt.A.LOAD_PROGRESS,e.progress),t.off(yt.A.LOAD_COMPLETE,e.complete),this._boundHandlers.delete(t))}updateTotalProgress(){let t=0,e=0,i=0,r=0;for(const s of this._progressBySourceId.values())t+=s.total,e+=s.completed,i+=s.failed,r+=s.cancelled;this._progress={total:t,completed:e,failed:i,cancelled:r,progress:t>0?(e+i+r)/t:0}}onSourceLoadStart(t){0===this._loadingSourceIds.size&&this.trigger(yt.A.LOAD_START),this._loadingSourceIds.add(t.sourceId),this.updateTotalProgress()}onSourceLoadProgress(t){this._progressBySourceId.set(t.sourceId,t.progress),this.updateTotalProgress(),this.trigger(yt.A.LOAD_PROGRESS,{progress:this._progress})}onSourceLoadComplete(t){this._loadingSourceIds.delete(t.sourceId),this.updateTotalProgress(),0===this._loadingSourceIds.size&&this.trigger(yt.A.LOAD_COMPLETE)}},qm=class extends O.A{get needsViewportUpdate(){return this._needsViewportUpdate}get container(){}get context(){return this._context}set context(t){this._context=t,this.store.source.each((e=>{if(e instanceof ms){const i=t.gl;e.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE)}}))}get isReady(){return this._isReady}get fps(){return this._fps.fps}get sources(){return[...this.store.source.cache.values()]}get layers(){return[...this.store.layer.orderedLayers()]}get controls(){return this._controls}get sourceIds(){return[...this.store.source.cache.keys()]}get layerIds(){return[...this.store.layer.cache.keys()]}get weatherLayerIds(){return[...this._weatherElements.keys()]}get libraryInfo(){return{name:void 0,version:{current:0,min:0}}}constructor(t,e){var i,r,s,a,n;if(super(),this.store={source:void 0,layer:void 0,overlay:void 0},this.state=new Rn.A({fullscreen:!1,tileBounds:void 0,units:Object.assign({},I.defaultUnits.imperial)}),this._loadingSourcesTracker=new Jm,this._weatherElements=new Map,this._controls={legend:void 0,dataInspector:void 0},this._eventHandlers={},this._resumeAnimationOnMoveEnd=!0,this._resumeAnimation=!1,this._preloadAnimationData=!1,this._dataEvaluatorsByLayer={},this.needsRedraw=!1,this._needsViewportUpdate=!0,this.isFadingSymbols=!1,this._isReady=!1,this._triggerPreloadAnimation=!1,this._preloadAnimationRequestId=0,this._hasPendingPreloadAnimationRequest=!1,this.debouncedPreloadAnimationData=(0,wn.s)((()=>{this.preloadAnimationData().catch((t=>{console.error("[MapsGL] Error preloading animation data",t)}))}),250),this.updateSymbolPlacement=ln((()=>{const t=this.getSymbolLayers();t.length>0&&this.placement.placeSymbols(t),this.isFadingSymbols=t.length>0||this.placement.isDirty,this.isFadingSymbols&&this.fadeSymbolsIfNeeded()}),150),this._handleFullScreenChange=t=>{const e=k(this.container);this.state.setState({fullscreen:e}),this.trigger("fullscreenchange")},this._handleSourceLoadEvent=t=>{this.updateSymbolPlacement()},this._handleLayerLoadEvent=t=>{const{type:e,layerId:i}=t,r=this.getLayer(i);r&&(e===On?this.setNeedsPreloadAnimationData():e===Xn?this.trigger("layer:load:progress",{layer:r,progress:t.progress}):e===Dn?this.trigger("layer:load:start",{layer:r}):e===Bn&&this.trigger("layer:load:complete",{layer:r}))},this._handleLayerShow=t=>{this.trigger("layer:show",{layer:t.target}),this._handleLayerVisibilityChange(t)},this._handleLayerHide=t=>{this.trigger("layer:hide",{layer:t.target}),this._handleLayerVisibilityChange(t)},this._handleLayerVisibilityChange=t=>{var e;if(this.updateSymbolPlacement(),null===(e=t.target)||void 0===e?void 0:e.id){const e=t.target.id;[...this._weatherElements.values()].forEach((t=>{var i;(null===(i=t.layer)||void 0===i?void 0:i.id)===e&&this.controls.legend&&t.legendId&&(t.layer.visible?this.controls.legend.addLegend(t.legendId,t.config.legend,{bounds:this.getBounds()}):this.controls.legend.removeLegend(t.legendId))}))}},this._handleLegendUnitsChange=t=>{const e=t.units;(0,I.equalUnits)(this.state.get("units"),e)||this.setUnits(e)},this._updateLegendsForMap=t=>{const e=this.controls.legend;null==e||e.legends.forEach((t=>{var e,i;if(null===(e=t.legend.options.points)||void 0===e?void 0:e.requiresMapBounds)t.legend.update({},{time:this.timeline.currentDate,bounds:this.getBounds()});else if(null===(i=t.legend.options.points)||void 0===i?void 0:i.layerId){const e=t.legend.options.points.layerId;let i;if([...this._weatherElements.keys()].forEach((t=>{const r=this._weatherElements.get(t);new RegExp(e).test(r.code)&&(i=r.layer)})),i&&i instanceof Hd){const e=i.getVisibleFeatures();t.legend.update({},{features:e})}}}))},this._handleMouseMoveEvent=t=>{const e=this.transform.pointToLocation(t.point),i=this.controls.dataInspector;i&&i.isEnabled&&((0,gt.Z)(e)?i.show(t.point,e):i.hide())},!e.account)throw new Error("[MapsGL] Map controller must include a valid account configuration.");this._fps=Cn,this._fps.start(2e4),window.addEventListener("focus",(()=>{this._fps.fps<50&&this._fps.start(2e4)})),this.account=e.account,this.weatherProvider=new Ms(this.account),this.map=t,this.store.source=new no,this.store.layer=new Eu(this.store.source),this.store.overlay={},this.style=new Wm({fontUrl:"https://cdn.aerisapi.com/sdk/js/mapsgl/fonts/{name}_{start}-{end}.json"}),this.scene=new Lu({camera:"perspective",map:{size:this.getSize(),fov:this.getFov()}}),this.transform=this.getTransform(t),this.placement=new un(this.transform),this.checkVersion(),this.viewport=new kn,this.viewport.renderWorldCopies=!1===this.transform.isGlobe,this.updateViewport(),this._loadingSourcesTracker.on(hr,(()=>{this.trigger(yt.A.LOAD_START)})),this._loadingSourcesTracker.on(dr,(t=>{this.trigger(yt.A.LOAD_PROGRESS,{progress:t.progress})})),this._loadingSourcesTracker.on(cr,(()=>{this.trigger(yt.A.LOAD_COMPLETE),this.preloadAnimationDataIfNeeded()})),e.units&&this.state.setState({units:Object.assign(Object.assign({},this.state.get("units")),e.units)}),this.timeline=new Sn(Object.assign({id:"map-timeline",start:new Date(Date.now()-864e5),end:new Date,duration:4,endDelay:2},e.animation)),this.timeline.on(Gn.A.RANGE_CHANGE,(()=>{this.setNeedsPreloadAnimationData()})),this.timeline.on(Gn.A.ADVANCE,(t=>{ea(Math.floor(t.date.getTime()/1e3))})),ea(Math.floor(this.timeline.currentDate.getTime()/1e3)),this._animatorSync=new fm(this.timeline),this._animatorSync.pauseWhileLoading=(null===(i=e.animation)||void 0===i?void 0:i.pauseWhileLoading)||!1,this.on(eo,(()=>{this._animatorSync.setNeedsUpdate()})),this._resumeAnimationOnMoveEnd=null===(s=null===(r=e.animation)||void 0===r?void 0:r.resumeOnMoveEnd)||void 0===s||s,this._preloadAnimationData=null!==(n=null===(a=e.animation)||void 0===a?void 0:a.preloadData)&&void 0!==n&&n,this.inspector=new In(this),this.on(qn,(()=>{this.setNeedsViewportUpdate()})),this.on($n,(()=>{this.timeline.isPaused?!0!==this._animatorSync.isPausedForLoading&&(this._animatorSync.shouldResumeAfterLoading=!1):(this.timeline.pause(),this._resumeAnimation=this._resumeAnimationOnMoveEnd)})),this.on(to,(()=>{this.setNeedsViewportUpdate(),this.preloadAnimationDataIfNeeded(),this.timeline.isPaused&&this._resumeAnimation&&(this._animatorSync.shouldResumeAfterLoading=this._resumeAnimationOnMoveEnd,!1===this._animatorSync.isPausedForLoading&&this.timeline.resume()),this._resumeAnimation=!1})),this.on(eo,(()=>{this.setNeedsPreloadAnimationData()}))}initialize(){return this.setNeedsViewportUpdate(),this.weatherProvider.initialize(this.account,this.style).then((()=>{this._isReady=!0,this.trigger("load")}))}checkVersion(){const{name:t,version:{current:e,min:i}}=this.libraryInfo;(0,V.n)(e)&&(0,mt.vA)(e>=i,`[MapsGL] Version for the ${t} library must be ${i} or higher, but version ${e} is being used.`)}getSize(){throw new Error("Subclasses must override `getSize`")}setSize(t){throw new Error("Subclasses must override `setSize`")}setContainerSize(t){let{width:e,height:i}=t;const r=this.container;r&&(r.style.width="string"==typeof e?e:`${e}px`,r.style.height="string"==typeof i?i:`${i}px`,this.resize())}getCenter(){throw new Error("Subclasses must override `getCenter`")}getNonPaddedCenter(){return this.getCenter()}setCenter(t){throw new Error("Subclasses must override `setCenter`")}getBounds(){throw new Error("Subclasses must override `getBounds`")}getZoom(){throw new Error("Subclasses must override `getZoom`")}setZoom(t){throw new Error("Subclasses must override `setZoom`")}getBearing(){throw new Error("Subclasses must override `getBearing`")}getPitch(){throw new Error("Subclasses must override `getPitch`")}getFov(){throw new Error("Subclasses must override `getFov`")}getUnits(){return Object.assign({},this.state.get("units"))}setUnits(t){var e;this.state.setState({units:Object.assign(Object.assign({},this.state.get("units")),t)}),null===(e=this.controls.legend)||void 0===e||e.setUnits(this.state.get("units")),this.trigger(io,{units:this.state.get("units")})}setUnitsForSystem(t){this.setUnits((0,I.getDefaultUnitsForSystem)(t))}redraw(){throw new Error("Subclasses must override `redraw`")}resize(){const t=this.getSize();this.context.size.width===t.width&&this.context.size.height===t.height||this.invalidateMapSize()}toggleFullscreen(){const t=this.container,e=this.state.get("fullscreen"),i=document;e?(i.exitFullscreen?i.exitFullscreen():i.mozCancelFullScreen?i.mozCancelFullScreen():i.webkitCancelFullScreen?i.webkitCancelFullScreen():i.msExitFullscreen&&i.msExitFullscreen(),this.state.setState({fullscreen:!1})):(t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):t.msRequestFullscreen?t.msRequestFullscreen():t.webkitEnterFullscreen&&t.webkitEnterFullscreen(),this.state.setState({fullscreen:!0}))}setPaintProperty(t,e,i){const r=this.getLayer(t);r&&r.setPaintProperty(e,i)}addLegendControl(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.controls.legend)return;if((0,V.g)(t))throw new Error("[MapsGL] DOM target not provided for `addLegendControl`");const i=new tp(Object.assign({units:this.state.get("units")},e));return i.addTo(t),this._controls.legend=i,this.on(to,this._updateLegendsForMap,null,this),i.on("add",this._updateLegendsForMap,null,this),i.on(Du,this._handleLegendUnitsChange,null,this),this.timeline.on(Gn.A.ADVANCE,this._updateLegendsForMap,null,this),[...this._weatherElements.values()].filter((t=>t.active&&t.layer.visible)).forEach((t=>{const e=t.config.legend;if(e){const r=i.addLegend(e.id,e,{bounds:this.getBounds()});r&&(t.legendId=r.id,this.setupLegendEvents(t))}})),i}addDataInspectorControl(){if(this.controls.dataInspector)return;const t=this.container||document.body,e=new gm(this.inspector,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{});return e.addTo(t),this._controls.dataInspector=e,[...this._weatherElements.values()].forEach((t=>{const i=this._dataEvaluatorsByLayer[t.id];i&&e.setEvaluator(t.id,i)})),"move"===e.options.event?(this.on(Jn,this._handleMouseMoveEvent),this.on(Kn,e.handleMouseOutEvent)):this.on(Qn,e.handleMapClickEvent),e.options.stream&&this.timeline.on(Gn.A.ADVANCE,e.update),this.on($n,e.handleMapMoveEvent),e}removeLegendControl(){const t=this._controls.legend;t&&(t.remove(),t.off(Du,this._handleLegendUnitsChange)),this.off(to,this._updateLegendsForMap),this.off(Gn.A.ADVANCE,this._updateLegendsForMap),delete this._controls.legend}removeDataInspectorControl(){const t=this._controls.dataInspector;t&&(t.remove(),this.off(Jn,this._handleMouseMoveEvent),this.off(Kn,t.handleMouseOutEvent),this.off(Qn,t.handleMapClickEvent),this.off($n,t.handleMapMoveEvent),this.timeline.off(Gn.A.ADVANCE,t.update))}addDayNightOverlay(){(0,gt.E)(this.store.overlay.daynight)&&(this.store.overlay.daynight=new Km(this.timeline.currentDate)),this.store.overlay.daynight.addToMap(this)}removeDayNightOverlay(){(0,gt.Z)(this.store.overlay.daynight)&&(this.store.overlay.daynight.removeFromMap(this),delete this.store.overlay.daynight)}hasWeatherLayer(t){var e;this.checkReady();const i=(null===(e=this.getWeatherElement(t))||void 0===e?void 0:e.id)||t,r=this.weatherProvider.getWeatherLayerConfig(t);return!!this.hasLayer(i)||!!Array.isArray(r)&&r.filter((t=>this.hasWeatherLayer(t))).length===r.length}getWeatherLayer(t){var e;if((0,gt.E)(t))return;this.checkReady();const i=this.weatherProvider.getWeatherLayerConfig(t);return Array.isArray(i)?i.map((t=>{const e=this.getWeatherLayer(t);return!1===Array.isArray(e)?e:null})).filter(Boolean):null===(e=this.getWeatherElement(t))||void 0===e?void 0:e.layer}setWeatherLayerVisibility(t,e){this.checkReady();const i=this.weatherProvider.getWeatherLayerConfig(t);if(!i)return void console.warn(`[MapsGL] No weather layer configuration for the id '${t}'`);if(Array.isArray(i))return void i.forEach((t=>this.setWeatherLayerVisibility(t,e)));const r=this.getWeatherElement(t);if(!r)return;const s=this.getLayer(r.id);s&&(e?s.show():s.hide())}getWeatherElement(t){return this._weatherElements.get(t)}addWeatherLayer(t,e,i){var r,s;let a,n;if(e=e||{},"string"==typeof t?a=t:(0,rt.G)(t)&&(n=t,a=n.id),(0,gt.E)(a))return void console.warn(`[MapsGL] Invalid weather layer identifier "${t}" provided for 'addWeatherLayer'`);this.checkReady();const o=null!==(r=null==e?void 0:e.id)&&void 0!==r?r:a,l=this.getWeatherElement(o);if(l){if(l.isQueryLayer)return l.layer.show(),l.layer;if(!1===l.active)return l.active=!0,l.layer.show(),l.layer;if((0,U.I)(e))return void console.warn(`[MapsGL] Weather layer with id '${a}' already exists on the map`)}const h=this.weatherProvider.getLayerAlias(a);if(h)return console.warn(`[MapsGL] Attempting to use deprecated weather layer id '${a}'. Using '${h}' instead.`),this.hasWeatherLayer(h)?void 0:this.addWeatherLayer(h,e,i);if((0,gt.E)(n)&&(n=this.weatherProvider.getWeatherLayerConfig(a,Object.assign(Object.assign({},e),{timeline:this.timeline}))),(0,gt.E)(n))return void console.warn(`[MapsGL] No weather layer configuration for the id '${a}'`);if(Array.isArray(n)){delete e.id;let t=i;const r=(null==e?void 0:e.childLayers)||{},s=n.reduce(((e,s)=>{if(this.hasWeatherLayer(s))e.push(this.getWeatherLayer(s));else{const a=this.addWeatherLayer(s,r[s],i);a instanceof ro&&(t=a.id,e.push(a))}return e}),[]);return s.length>0?s:void 0}const d=new Ym(a,n);if(d.addTo(this,i,e),(0,gt.E)(d.layer))return void console.error(`[MapsGL] No layer created for weather layer with id '${a}'`);d.isMask||this._weatherElements.set(o,d);const c=d.config.legend;if(this.controls.legend&&(0,gt.Z)(c)&&!0!==(null==e?void 0:e.hidden)){const t=this.controls.legend.addLegend(c.id,c,{bounds:this.getBounds()});t&&(d.legendId=t.id,this.setupLegendEvents(d))}return this._dataEvaluatorsByLayer[d.id]=d.config.evaluator,null===(s=this.controls.dataInspector)||void 0===s||s.setEvaluator(d.id,d.config.evaluator),d.layer}removeWeatherLayer(t){var e,i,r;if((0,gt.E)(t))return void console.warn(`[MapsGL] Invalid weather layer identifier "${t}" provided for 'removeWeatherLayer'`);this.checkReady();const s=this.weatherProvider.getWeatherLayerConfig(t);if(!s)return void console.warn(`[MapsGL] No weather layer configuration for the id '${t}'`);if(Array.isArray(s))return void s.forEach((t=>this.removeWeatherLayer(t)));const a=this.getWeatherElement(t);if(a&&this.getLayer(a.id)&&(a.legendId&&(null===(e=this.controls.legend)||void 0===e||e.removeLegend(a.legendId)),a.remove(this))){this._weatherElements.delete(t);const e=a.config.source.id;this.hasSource(e)&&0===(null===(r=null===(i=this.getSource(e))||void 0===i?void 0:i.consumingLayers)||void 0===r?void 0:r.length)&&this.removeSource(e)}}hasSource(t){return this.store.source.has(t)}hasLayer(t){return this.store.layer.has(t)}getSource(t){return this.store.source.get(t)}getLayer(t){return this.store.layer.get(t)}findLayer(t){return this.store.layer.find(t)}addSource(t,e){const i=this.store.source.add(t,e);if(i){if(i.style=this.style,i.on(yt.A.LOAD_START,this._handleSourceLoadEvent.bind(this)),i.on(yt.A.TILE_LOAD,this._handleSourceLoadEvent.bind(this)),i.on(yt.A.LOAD_COMPLETE,this._handleSourceLoadEvent.bind(this)),this._loadingSourcesTracker.register(i),i.getMetadata().catch((t=>{console.error("[MapsGL] Error getting metadata for source",i.id,t)})),i instanceof Yr){const t=()=>{i.metadata.setValidTimeRange({start:this.timeline.startDate,end:this.timeline.endDate})};this.timeline.on(Gn.A.RANGE_CHANGE,(()=>{t()})),t()}return this.trigger("source:add",{source:i}),i}}addLayer(t,e,i){var r;let s=this.store.layer.count;i&&(s=Math.max(0,this.store.layer.getIndex(i)-1)),"debug"===e.type&&!1===this.hasSource("debug")&&(this.addSource("debug",{type:"debug"}),e.source="debug");const a=this.store.layer.insertAt(s,t,e,this.scene);return/::mask-?/.test(t)&&(a.isLayerMask=!0),a.mask&&Array.isArray(a.mask.layers)&&a.mask.layers.forEach((t=>{const e=t.id;e&&!0===this._weatherElements.has(e)&&this._weatherElements.delete(e)})),(0,V.g)(a)&&this.hasLayer(t)?this.getLayer(t):(a&&(a.on(Yn,this._handleLayerShow,null,this),a.on(Ln,this._handleLayerHide,null,this),a.on(On,this._handleLayerLoadEvent,null,this),a.on(Dn,this._handleLayerLoadEvent,null,this),a.on(Xn,this._handleLayerLoadEvent,null,this),a.on(Bn,this._handleLayerLoadEvent,null,this),this.add(a,i),a.animator&&(this._animatorSync.add(a),null===(r=this.timeline)||void 0===r||r.add(a.animator.animation),a.enabled=a.animator.canShowForDate()),this.triggerRedraw(),this.trigger("layer:add",{layer:a}),this._handleLayerVisibilityChange({layer:a})),a)}moveLayer(t,e){const i=(0,V.g)(e)?-1:Math.max(0,this.store.layer.getIndex(e))-1;this.store.layer.move(t,i)}removeSource(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const i=this.getSource(t);i?(this.store.source.remove(t),this._loadingSourcesTracker.unregister(i),i.style=void 0,i.off(yt.A.LOAD_START,this._handleSourceLoadEvent),i.off(yt.A.TILE_LOAD,this._handleSourceLoadEvent),i.off(yt.A.LOAD_COMPLETE,this._handleSourceLoadEvent),this.trigger("source:remove",{source:i}),e&&i.dispose()):console.warn(`[MapsGL] Source does not exist for identifier '${t}'`)}removeLayer(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var i;const r=this.store.layer.remove(t);r?(r.off(Yn,this._handleLayerShow),r.off(Ln,this._handleLayerHide),r.off(Dn,this._handleLayerLoadEvent),r.off(Xn,this._handleLayerLoadEvent),r.off(Bn,this._handleLayerLoadEvent),r.animator&&(this._animatorSync.remove(r),null===(i=this.timeline)||void 0===i||i.remove(r.animator.animation)),r.mask=void 0,this.remove(r),this.triggerRedraw(),this.trigger("layer:remove",{layer:r}),this._handleLayerVisibilityChange({layer:r}),e&&(r.mask&&Array.isArray(r.mask.layers)&&r.mask.layers.forEach((t=>{t.dispose()})),r.dispose())):console.warn(`[MapsGL] Layer does not exist for identifier '${t}'`)}query(t){return this.inspector.query(t)}queryPromise(t){return this.inspector.queryPromise(t)}setRefreshInterval(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this._refreshInterval&&clearInterval(this._refreshInterval),0===t)return void(this._refreshInterval=void 0);const i=60*Math.max(t,1)*1e3;i>0&&(this._refreshInterval=setInterval((()=>{const t=this.timeline.startOffset,i=this.timeline.endOffset,r=e?new Date:this.timeline.currentDate,s=new Date;this.timeline.startDate=new Date(s.getTime()+t),this.timeline.endDate=new Date(s.getTime()+i),this.timeline.goToDate(r)}),i))}preloadAnimationData(){return this._hasPendingPreloadAnimationRequest=!0,this._preloadAnimationRequestId+=1,this._activePreloadAnimationPromise||(this._activePreloadAnimationPromise=this._drainPreloadAnimationQueue().finally((()=>{this._activePreloadAnimationPromise=void 0}))),this._activePreloadAnimationPromise}_drainPreloadAnimationQueue(){return t=this,i=function*(){for(;this._hasPendingPreloadAnimationRequest;){this._hasPendingPreloadAnimationRequest=!1;const t=this._preloadAnimationRequestId;yield this._animatorSync.preloadData(),t!==this._preloadAnimationRequestId&&this._animatorSync.setNeedsUpdate()}},new((e=void 0)||(e=Promise))((function(r,s){function a(t){try{o(i.next(t))}catch(t){s(t)}}function n(t){try{o(i.throw(t))}catch(t){s(t)}}function o(t){var i;t.done?r(t.value):(i=t.value,i instanceof e?i:new e((function(t){t(i)}))).then(a,n)}o((i=i.apply(t,[])).next())}));var t,e,i}cancelPreloadAnimationData(){this._activePreloadAnimationPromise&&(this._preloadAnimationRequestId+=1,this._animatorSync.setNeedsUpdate())}setNeedsPreloadAnimationData(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.cancelPreloadAnimationData(),this._triggerPreloadAnimation=this._preloadAnimationData,t&&this.preloadAnimationDataIfNeeded()}preloadAnimationDataIfNeeded(){this._triggerPreloadAnimation&&(this.debouncedPreloadAnimationData(),this._triggerPreloadAnimation=!1)}triggerRedraw(){this.needsRedraw=!0,this.redraw()}getTransform(t){return new Nm(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ce,this.scene)}getProjection(){return this.transform.projection.type}setProjection(t){this.transform.setProjection(t),this.viewport.renderWorldCopies=!1===this.transform.isGlobe}add(t,e){t.map=this}remove(t){t.map=void 0}invalidateMapSize(){throw new Error("Subclasses must override `invalidateMapSize`")}getViewportState(){return{id:"base",size:this.getSize(),center:this.getCenter(),nonPaddedCenter:this.getNonPaddedCenter(),zoom:this.getZoom(),bounds:this.getBounds(),pitch:this.getPitch(),bearing:this.getBearing(),fov:this.getFov(),elevation:0}}updateViewport(){if(!1===this.needsViewportUpdate)return;this.getProjection()!==this.transform.projection.type&&this.transform.setProjection(this.getProjection());const t=this.getViewportState();this.transform.updateOnMapViewChange&&this.transform.update(t),this.viewport.updateFromMapViewState(t,this.transform),this.updateSymbolPlacement();const e=this.viewport.getVisibleTileBounds(),i=this.state.get("tileBounds");(0,V.n)(e)&&((0,V.g)(i)||!1===(null==i?void 0:i.equals(e)))&&(this.state.setState("tileBounds",e),this.trigger(eo,{tileBounds:e.info})),this._needsViewportUpdate=!1}setNeedsViewportUpdate(){this._needsViewportUpdate=!0}getSymbolLayers(){const t=[];return this.layers.filter((t=>t.visible)).forEach((e=>{var i,r;const s="symbol"===e.type||"text"===e.type,a=e.paint.symbolAllowOverlap()&&"map"!==e.paint.symbolOverlapMode();if(e instanceof Yd&&s&&!1===a){const s=this.viewport.getVisibleTileCoords(e.getDataZoom()).map((t=>{const i=t.normalize();let r=e.source.tiles.get(i);return(0,V.n)(r)&&0!==t.wrap&&(r=r.clone(t.wrap)),r})).filter((t=>(0,V.n)(t)));t.push({id:e.id,tiles:s,paint:e.paint,interval:e.renderer instanceof Lh?null===(r=null===(i=e.renderer)||void 0===i?void 0:i.timeState)||void 0===r?void 0:r.interval:void 0})}})),t}fadeSymbolsIfNeeded(){let t=!1;this.getSymbolLayers().forEach((e=>{if(this.placement.updateLayerOpacities(e.id,e.tiles)){const i=this.getLayer(e.id);null==i||i.setNeedsUpdate(),t=!0}})),this.isFadingSymbols=t,this.triggerRedraw()}setupEvents(t){const e=this.map;let i="on";e.addEventListener?i="addEventListener":e.addListener&&(i="addListener"),"function"==typeof e[i]&&Object.keys(t).forEach((e=>{this._eventHandlers[i]=(i=>{const r=this.dataForMapEvent(e,i);this.shouldTriggerMapEvent(e)&&this.trigger(t[e],r)}).bind(this),this.map[i](e,this._eventHandlers[i])})),["","moz","webkit","ms"].forEach((t=>{document.addEventListener(`${t}fullscreenchange`,this._handleFullScreenChange.bind(this))}))}setupLegendEvents(t){var e,i,r;const s=null===(e=this.controls.legend)||void 0===e?void 0:e.getLegend(t.legendId);s&&(t.layer.on(Pn,(t=>{let{property:e,value:i}=t;if("sample.colorscale"===e)(0,V.n)(i.masks)?s.update({bar:i.masks.map((t=>{var e,r;const s=null!==(r=null!==(e=i.normalized)&&void 0!==e?e:t.colorscale.normalized)&&void 0!==r&&r;return Object.assign(Object.assign({},t),{colorscale:Object.assign(Object.assign({},t.colorscale),{normalized:s})})}))}):s.update({bar:{colorscale:i}});else if(/^sample\.colorscale\.\w+/.test(e)){const t=e.replace(/^sample\.colorscale\./,""),r=s.options.bar;Array.isArray(r)?r.forEach((e=>(0,X.h)(e.colorscale,t,i))):(0,X.h)(r.colorscale,t,i),s.update({bar:r})}})),null===(i=s.options.points)||void 0===i?void 0:i.layerId)&&(null===(r=this.getSource(t.config.source.id))||void 0===r||r.on(yt.A.DATA_CHANGE,this._updateLegendsForMap))}checkReady(){!1===this._isReady&&(0,mt.$8)("[MapsGL] Map controller is not initialized. Check the `MapController#isReady` property or \n wait for the `MapController:load` event before performing actions with the map or controller.")}_tick(t){this.style.imageManager.triggerFrame(),this.isFadingSymbols&&this.fadeSymbolsIfNeeded()}shouldTriggerMapEvent(t){return!0}dataForMapEvent(t,e){}dispose(){var t;this.timeline.clear(),this.store.layer.each((t=>{this.hasLayer(t.id)&&this.removeLayer(t.id,!0)})),this.store.source.each((t=>{this.hasSource(t.id)&&this.removeSource(t.id,!0)})),null===(t=this.context)||void 0===t||t.dispose();const e=this.map;let i="off";e.addEventListener?i="addEventListener":e.addListener&&(i="addListener"),"function"==typeof e[i]&&(Object.keys(this._eventHandlers).forEach((t=>{this.map[i](t,this._eventHandlers[i])})),this._eventHandlers={})}},$m=class extends qm{get context(){return this.map.context}constructor(t,e){super(t,e),this.setupEvents({load:"load",unload:"unload",resize:"resize",click:"click",dblclick:"dblclick",mousedown:"mousedown",mouseup:"mouseup",mouseover:"mouseover",mouseout:"mouseout",mousemove:"mousemove",zoom:"zoom",zoomstart:"zoom:start",zoomend:"zoom:end",move:"move",movestart:"move:start",moveend:"move:end",popupopen:"popupopen",popupclose:"popupclose"}),this.initialize()}getSize(){return this.map.getSize()}getCenter(){return this.map.getCenter()}setCenter(t){this.map.setCenter(t)}getZoom(){return this.map.getZoom()}setZoom(t){this.map.setZoom(t)}getBounds(){return this.map.getBounds()}fitBounds(){}getBearing(){return 0}getPitch(){return 0}getFov(){return zm}redraw(){this.map.redraw()}add(t,e){super.add(t,e),t.map=this,this.map.addLayer(t)}remove(t){super.remove(t),this.map.removeLayer(t),t.map=void 0}updateViewport(){super.updateViewport(),this.map.transform.state=this.transform.state}project(t){const e=this.transform.projection.project(t.lat,t.lon);return{x:e.x*this.map.container.offsetWidth,y:e.y*this.map.container.offsetHeight}}unproject(t){const e={x:t.x/this.map.container.offsetWidth,y:t.y/this.map.container.offsetHeight,z:0};return this.transform.projection.unproject(e.x,e.y)}dataForMapEvent(t,e){if(!e)return;let i;switch(t){case"click":case"dblclick":case"mousemove":i={coord:{lat:e.latlng.lat,lon:e.latlng.lng},point:{x:e.containerPoint.x,y:e.containerPoint.y}}}return i}};var tg=i(7290),eg=i(6339);const ig=class{constructor(){this.cache=new Map}get(t){return this.cache.get(t)}set(t,e){this.cache.set(t,e)}has(t){return this.cache.has(t)}exists(t){const e=[...this.cache.values()];return t instanceof ir?e.some((e=>e.id===t.id)):e.includes(t)}delete(t){const e=this.get(t);e instanceof ir&&e.dispose(),this.cache.delete(t)}dispose(){this.cache.forEach(((t,e)=>{this.delete(e)})),this.cache.clear()}},rg=class{constructor(t){this.textures=new ig,this.programs=new ig,this.geometry=new ig,this.objects=new ig,this.context=t}getProgram(t,e,i){const r=function(t){let e=t;return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).forEach((t=>{e+=`/${t}`})),e}(t,e);let s=this.programs.get(r);return s||(s=i(this.context),this.programs.set(r,s)),s}getOrCreateProgram(t,e){return this.getProgram(t,e.defines||[],(t=>new fd(t,Object.assign(Object.assign({},e),{uniforms:e.uniforms||{}}))))}hasProgram(t){return this.programs.exists(t)}generateSubdividedQuad(t){const e=`subdivided-quad-${t}`;let i=this.geometry.get(e);if(!i){const r=t+1,s=r*r,a=new Float32Array(2*s),n=new Float32Array(2*s),o=new Uint16Array(t*t*6);let l=0,h=0,d=0;for(let e=0;e<=t;e++)for(let i=0;i<=t;i++){const s=i/t,c=e/t;if(a[l++]=s,a[l++]=c,n[h++]=s,n[h++]=c,i<t&&e<t){const t=e*r+i,s=t+1,a=(e+1)*r+i,n=a+1;o[d++]=t,o[d++]=a,o[d++]=s,o[d++]=s,o[d++]=a,o[d++]=n}}i=new Wa(this.context,{position:{size:2,data:a},uv:{size:2,data:n},index:{data:o}}),this.geometry.set(e,i)}return i}getFullscreenQuad(){let t=this.geometry.get("quad"),e=this.objects.get("camera:quad");return t||(t=new Wa(this.context,{position:{size:2,data:new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1])},uv:{size:2,data:new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1])}}),this.geometry.set("quad",t)),e||(e=new Nu(0,1,1,0,0,1),this.objects.set("camera:quad",e)),{geometry:t,camera:e}}dispose(){this.textures.dispose(),this.programs.dispose(),this.geometry.dispose(),this.objects.dispose()}};var sg;const ag=!!(null===(sg=null===document||void 0===document?void 0:document.createElement("canvas"))||void 0===sg?void 0:sg.getContext("webgl2")),ng=()=>ag&&"undefined"!=typeof WebGL2RenderingContext;let og=1;const lg=class extends O.A{constructor(t,e={}){var i,r,s;super(),this.dpr=1,this._extensions={},this._ownsCanvas=!1,this.id=og++,this.cache=new rg(this),t||((null===(i=e.context)||void 0===i?void 0:i.canvas)?t=e.context.canvas:(t=It(),this._ownsCanvas=!0)),this._canvas=t,this._gl=e.context?e.context:ng()&&"webgl"!==e.type?t.getContext("webgl2",Object.assign({antialias:!0},e)):t.getContext("webgl",Object.assign({antialias:!0},e)),this._state=new od(this.gl),this.vertexAttribDivisor=this.getExtension("ANGLE_instanced_arrays","vertexAttribDivisor","vertexAttribDivisorANGLE"),this.drawArraysInstanced=this.getExtension("ANGLE_instanced_arrays","drawArraysInstanced","drawArraysInstancedANGLE"),this.drawElementsInstanced=this.getExtension("ANGLE_instanced_arrays","drawElementsInstanced","drawElementsInstancedANGLE"),this.createVertexArray=this.getExtension("OES_vertex_array_object","createVertexArray","createVertexArrayOES"),this.bindVertexArray=this.getExtension("OES_vertex_array_object","bindVertexArray","bindVertexArrayOES"),this.deleteVertexArray=this.getExtension("OES_vertex_array_object","deleteVertexArray","deleteVertexArrayOES"),this._contextSize={width:(null===(r=this.canvas)||void 0===r?void 0:r.clientWidth)||this.canvas.width,height:(null===(s=this.canvas)||void 0===s?void 0:s.clientHeight)||this.canvas.height},this._handleResizeBind=this._handleResize.bind(this),window.addEventListener("resize",this._handleResizeBind,!1),window.addEventListener("orientationchange",this._handleResizeBind,!1),window.addEventListener("webkitfullscreenchange",this._handleResizeBind,!1),this._canvas.addEventListener("webglcontextlost",this._handleContextLost,!1)}get canvas(){return this._canvas}get gl(){return this._gl}get size(){const t=this.dpr;return{width:this.canvas.clientWidth||this.canvas.width/t,height:this.canvas.clientHeight||this.canvas.height/t}}get resolution(){return{width:this.canvas.width,height:this.canvas.height}}get state(){return this._state}get isWebGL(){const t=this.gl;return Boolean(t&&(t instanceof WebGLRenderingContext||t.ARRAY_BUFFER===eg.A.ARRAY_BUFFER))}get isWebGL2(){const t=this.gl;return Boolean(t&&ng()&&(t instanceof WebGL2RenderingContext||t.ARRAY_BUFFER===eg.A.TEXTURE_BINDING_3D))}getExtension(t,e,i){const r=this.gl[e];if(e&&r)return r.bind(this.gl);this._extensions[t]||(this._extensions[t]=this.gl.getExtension(t));const s=this._extensions[t];return e?s?s[i].bind(s):null:s}resetState(){this.state.reset(),this.bindVertexArray(null)}resize(t,e){const i=this.canvas,r=this.dpr;i.width===t&&i.height===e||(i.width=t*r,i.height=e*r,i.style.width=`${t}px`,i.style.height=`${e}px`,this._handleResize())}dispose(){var t,e;if(window.removeEventListener("resize",this._handleResizeBind),null===(t=this._canvas)||void 0===t||t.removeEventListener("webglcontextlost",this._handleContextLost,!1),this.cache.dispose(),this._ownsCanvas){this.canvas.width=1,this.canvas.height=1;const t=null===(e=this.gl)||void 0===e?void 0:e.getExtension("WEBGL_lose_context");t&&t.loseContext()}this._gl=void 0,this._canvas=void 0,this._state.reset()}invalidateSize(){this._handleResize()}createTexture(){return new rr(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}createFramebuffer(){return new vo(this,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}createVertexShader(t){return new id(this,t)}createFragmentShader(t){return new rd(this,t)}createProgram(t){return new fd(this,t)}createMesh(t,e){return new Gd(this,t,e)}_handleResize(){this._resizeTimeout&&window.clearTimeout(this._resizeTimeout);const t=Vt(this.gl),e=this.canvas.width,i=this.canvas.height;e===this._contextSize.width&&i===this._contextSize.height&&t===this.dpr||(this._contextSize.width=e,this._contextSize.height=i,this.dpr=t,this.trigger("resize",this._contextSize))}_handleContextLost(){console.warn("[MapsGL] WebGL context lost"),this.trigger("contextlost")}},hg=class{constructor(t){this.id=t.id,this.glLayer=t,this.type="custom",this.renderingMode="2d"}onAdd(t,e){const i=this.glLayer.map;i.context||(i.context=new lg(e.canvas,{context:e}),i.context.dpr=Vt(i.context.gl));const r=i.context;this._lastContextSize={width:r.resolution.width,height:r.resolution.height},this.glLayer.onAdd(i.context);const s=this.glLayer;this._eventHandlers={move:s.onMove.bind(s),zoom:s.onZoom.bind(s),click:s.onClick.bind(s),mousemove:s.onMouseMove.bind(s),movestart:s.onMoveStart.bind(s),moveend:s.onMoveEnd.bind(s),resize:s.onResize.bind(s)},Object.keys(this._eventHandlers).forEach((e=>{t.on(e,this._eventHandlers[e])}))}onRemove(t,e){this.glLayer.onRemove(),this.renderLoop=void 0,t&&this._eventHandlers&&Object.keys(this._eventHandlers).forEach((e=>{t.off(e,this._eventHandlers[e])}))}prerender(t,e){var i;const r=this.glLayer.map,s=this.glLayer.map.context,a=this._lastContextSize,n=s.resolution;r.transform.cutoffParams=function(t){var e,i,r,s;const a=null!==(e=t.nearZ)&&void 0!==e?e:t._nearZ,n=null!==(s=null!==(r=null===(i=t.projection)||void 0===i?void 0:i.farthestPixelDistance(t))&&void 0!==r?r:t.farZ)&&void 0!==s?s:t._farZ,o=n-a,l=.2*t.height,h=a+l;return[a,n,(h-l-a)/o,(h-a)/o]}(r.map.transform),r.needsViewportUpdate&&r.updateViewport(),!a||a.width===n.width&&a.height===n.height||(s.invalidateSize(),this._lastContextSize={width:n.width,height:n.height}),s.gl.enable(s.gl.DEPTH_TEST),s.gl.depthFunc(s.gl.LEQUAL),s.gl.depthRange(0,.9669),this.glLayer.prerender(null===(i=this.renderLoop)||void 0===i?void 0:i.elapsedTime)}render(t,e){var i;if(!0===this.glLayer.isLayerMask)return;this.glLayer.render(null===(i=this.renderLoop)||void 0===i?void 0:i.elapsedTime);const r=this.glLayer.map.map;r.painter&&("function"==typeof r.painter.resetStencilClippingMasks?r.painter.resetStencilClippingMasks():(0,Hi.x)(r.painter,["currentStencilSource"])&&(r.painter.currentStencilSource=void 0))}},dg=class extends qm{get container(){return this.map.getContainer()}get libraryInfo(){var t;const e=this.map.version||(null===(t=null===window||void 0===window?void 0:window.mapboxgl)||void 0===t?void 0:t.version);return{name:"mapbox",version:{current:void 0===e?void 0:Number.parseFloat(e.replace(/-.+$/,"")),min:2}}}constructor(t,e){super(t,e),this._mapboxLayers=new Map,this._mapEventHandlers={},this._loop=new tg.A(this._tick.bind(this)),this.setupEvents({remove:"unload",resize:"resize",click:"click",dblclick:"dblclick",mousedown:"mousedown",mouseup:"mouseup",mouseover:"mouseover",mouseout:"mouseout",mousemove:"mousemove",zoom:"zoom",zoomstart:"zoom:start",zoomend:"zoom:end",move:"move",movestart:"move:start",moveend:"move:end"}),t.isStyleLoaded()?this.initialize():(this._mapEventHandlers.load=this.initialize.bind(this),this._mapEventHandlers.remove=this.dispose.bind(this),this._mapEventHandlers.resize=this._resize.bind(this),t.on("load",this._mapEventHandlers.load),t.on("remove",this._mapEventHandlers.remove),t.on("resize",this._mapEventHandlers.resize)),this._mapEventHandlers["style.load"]=()=>{setTimeout((()=>{this._mapboxLayers.forEach((e=>{let{layer:i,beforeId:r}=e;t.getLayer(i.id)||t.addLayer(i,r)}))}),500)},this._mapEventHandlers.renderstart=()=>{this.getProjection()!==this.transform.projection.type&&(this.setNeedsViewportUpdate(),this.updateViewport())},this._mapEventHandlers.move=()=>{this.setNeedsViewportUpdate()},t.on("style.load",this._mapEventHandlers["style.load"]),t.on("renderstart",this._mapEventHandlers.renderstart)}getSize(){const t=this.map.getContainer();return k(this.container)?{width:window.innerWidth,height:window.innerHeight}:{width:t.offsetWidth,height:t.offsetHeight}}setSize(t){this.setContainerSize(t)}getCenter(){const t=this.map.getCenter();return{lat:t.lat,lon:t.lng}}getNonPaddedCenter(){const t=this.getSize(),e={x:t.width/2,y:t.height/2},i=this.map.unproject([e.x,e.y]);return{lat:i.lat,lon:i.lng}}setCenter(t){this.map.setCenter({lat:t.lat,lng:t.lon})}getBounds(){const t=this.map.getBounds();return{north:t.getNorth(),south:t.getSouth(),west:t.getWest(),east:t.getEast()}}getZoom(){return this.map.getZoom()}setZoom(t){this.map.setZoom(t)}getBearing(){return this.map.getBearing()}getPitch(){return this.map.getPitch()}getFov(){return Lt(this.map.transform._fov)}redraw(){this.map.triggerRepaint()}moveLayer(t,e){super.moveLayer(t,e),this.map.moveLayer(t,e)}add(t,e){var i;if(super.add(t,e),!(null===(i=this.map)||void 0===i?void 0:i.getStyle()))return;const r=new hg(t);this.map.getLayer(t.id)||this._mapboxLayers.get(t.id)?console.warn(`[MapsGL] A WebGLLayer with id {${t.id}} already exists on the map`):(this._mapboxLayers.set(t.id,{layer:r,beforeId:e}),r.renderLoop=this._loop,this.map.addLayer(r,e),this._loop.start())}remove(t){var e;if(null===(e=this.map)||void 0===e?void 0:e.getStyle()){const e=this.map.getLayer(t.id);this.map&&e&&this.map.removeLayer(t.id)}this._mapboxLayers.delete(t.id),0===this._mapboxLayers.size&&this._loop.stop(),super.remove(t)}getTransform(t){return new Nm(this.getProjection(),this.scene)}getProjection(){var t;const e=this.map;return void 0!==e.getProjection&&"globe"===(null===(t=e.getProjection())||void 0===t?void 0:t.name)?Ie:Ce}setProjection(t){this.map.setProjection(t===Ie?{name:"globe"}:{name:"mercator"})}getViewportState(){var t,e;const i=super.getViewportState(),r=this.map.transform,s=this.map.getPadding();i.id="mapbox",i.nearZ=r._nearZ,i.farZ=null!==(e=null===(t=r.projection)||void 0===t?void 0:t.farthestPixelDistance(r))&&void 0!==e?e:r._farZ,i.padding={top:s.top,bottom:s.bottom,left:s.left,right:s.right};const a=r._camera;return(null==a?void 0:a.position)&&(i.cameraPosition=(new Se).fromArray(a.position)),i}_tick(t){super._tick(t)}_resize(){var t;null===(t=this.context)||void 0===t||t.invalidateSize()}invalidateMapSize(){this.map.resize()}dataForMapEvent(t,e){if(!e)return;let i;switch(t){case"click":case"dblclick":case"mousemove":i={target:this,originalEvent:e,coord:{lat:e.lngLat.lat,lon:e.lngLat.lng},point:{x:e.point.x,y:e.point.y}}}return i}dispose(t){this._loop.dispose(),Object.keys(this._mapEventHandlers).forEach((t=>{this.map.off(t,this._mapEventHandlers[t])})),super.dispose(t)}},cg=(t,e)=>{t.setProjection(e===Ie?{type:"globe"}:{type:"mercator"})},ug=class extends dg{get libraryInfo(){var t;const e=this.map.version||(null===(t=null===window||void 0===window?void 0:window.maplibregl)||void 0===t?void 0:t.version);return{name:"maplibre",version:{current:void 0===e?void 0:Number.parseFloat(e),min:2.3}}}constructor(t,e){super(t,e),this.projection=Ce,t.on("projectiontransition",(e=>{if(this.projection="globe"===e.newProjection?Ie:Ce,this.projection!==this.transform.projection.type){if(this.transform=this.getTransform(t),this.transform.updateOnMapViewChange){const t=this.getViewportState();this.transform.update(t)}this.placement.setTransform(this.transform)}})),this.on("fullscreenchange",(()=>{this.map.resize()}))}getFov(){return this.map.transform.fov}getTransform(t){return new Nm(this.getProjection(),this.scene)}getViewportState(){var t,e;const i=super.getViewportState(),r=this.map.transform,s=this.map.getPadding(),a=null!==(t=r.nearZ)&&void 0!==t?t:r._nearZ,n=null!==(e=r.farZ)&&void 0!==e?e:r._farZ;return Number.isFinite(a)&&(i.nearZ=a,i.farZ=n),i.id="maplibre",i.padding={top:s.top,bottom:s.bottom,left:s.left,right:s.right},i.globiness=(0,V.n)(r._globeness)?1-r._globeness:0,i}getProjection(){return this.projection}setProjection(t){const e=this.map;e.isStyleLoaded()?cg(e,t):e.on("style.load",(()=>{cg(e,t)}))}},pg=class{get libraryInfo(){return{name:"leaflet",version:{current:0,min:0}}}constructor(t){this.id=t.id,this.glLayer=t,this.type="custom",this.renderingMode="2d"}onAdd(t,e){this.glLayer.onAdd(this.glLayer.map.context);const i=this.glLayer;this._eventHandlers={move:i.onMove.bind(i),zoom:i.onZoom.bind(i),click:i.onClick.bind(i),mousemove:i.onMouseMove.bind(i),movestart:i.onMoveStart.bind(i),moveend:i.onMoveEnd.bind(i),resize:i.onResize.bind(i)},Object.keys(this._eventHandlers).forEach((e=>{t.on(e,this._eventHandlers[e])}))}onRemove(t,e){this.renderLoop=void 0,this.glLayer.onRemove(),t&&this._eventHandlers&&Object.keys(this._eventHandlers).forEach((e=>{t.off(e,this._eventHandlers[e])}))}prerender(t,e){var i;this.glLayer.prerender(null===(i=this.renderLoop)||void 0===i?void 0:i.elapsedTime)}render(t){var e;!0!==this.glLayer.isLayerMask&&this.glLayer.render(null===(e=this.renderLoop)||void 0===e?void 0:e.elapsedTime)}},mg=class extends qm{get container(){return this.map.getContainer()}constructor(t,e){super(t,e),this._glLayers=new Map,this._canvasTransform={x:0,y:0,scale:1},this._isMoving=!1,this._isZooming=!1,this._mapEventHandlers={},this.context=new lg(void 0,{premultipliedAlpha:!0,depth:!0,antialias:!(z.safari&&z.version>=15.4&&z.version<16),alpha:!0,stencil:!0}),this.context.dpr=Vt(this.context.gl),this._loop=new tg.A(this._tick.bind(this));const i=t.options.zoomAnimation,r=this.context.canvas;r.style.position="absolute",r.className="leaflet-zoom-"+(i?"animated":"hide"),t._panes.overlayPane.append(r),this._mapEventHandlers.resize=this._resize.bind(this),t.on("resize",this._mapEventHandlers.resize),this._resize(),this.setupEvents({load:"load",unload:"unload",resize:"resize",click:"click",dblclick:"dblclick",mousedown:"mousedown",mouseup:"mouseup",mouseover:"mouseover",mouseout:"mouseout",mousemove:"mousemove",zoom:"zoom",zoomstart:"zoom:start",zoomend:"zoom:end",move:"move",movestart:"move:start",moveend:"move:end",popupopen:"popupopen",popupclose:"popupclose"}),i&&(this._mapEventHandlers.zoomanim=this._animateZoom.bind(this),t.on("zoomanim",this._mapEventHandlers.zoomanim)),setTimeout((()=>this.initialize()),250)}getSize(){const t=this.container;return k(t)?{width:window.innerWidth,height:window.innerHeight}:{width:t.offsetWidth,height:t.offsetHeight}}setSize(t){this.setContainerSize(t)}getCenter(){const t=this.map.getCenter();return{lat:t.lat,lon:t.lng}}setCenter(t){this.map.setView({lat:t.lat,lng:t.lon},this.getZoom())}getBounds(){const t=this.map.getBounds();return{north:t.getNorth(),west:t.getWest(),south:t.getSouth(),east:t.getEast()}}getZoom(){return this.map.getZoom()-1}setZoom(t){this.map.setZoom(t+1)}getBearing(){return 0}getPitch(){return 0}getFov(){return zm}setProjection(t){t!==Ie?super.setProjection(Ce):console.warn("[MapsGL] Globe projection is not supported in Leaflet")}redraw(){this.needsRedraw=!0}add(t,e){super.add(t,e);const i=new pg(t);i.renderLoop=this._loop,this._glLayers.set(t.id,i),i.onAdd(this.map,this.context.gl)}remove(t){t.onRemove();const e=this._glLayers.get(t.id);e&&(e.onRemove(this.map,this.context.gl),this._glLayers.delete(e.id),this.redraw())}getViewportState(){const t=super.getViewportState();return t.id="leaflet",t}invalidateMapSize(){this.map.invalidateSize(!0),this._resize()}_resize(){const t=this.map.getSize(),e=this.context.canvas,i=this.context.dpr;e.width/i===t.x&&e.height/i===t.y||this.context.resize(t.x,t.y),this._resetCanvas()}_tick(t){super._tick(t);const e=this.context,i=e.gl;this._isMoving&&!this._isZooming?this._moveCanvas():!this._isZooming&&this._canvasNeedsReset()&&this._resetCanvas(),(this.needsRedraw||this.store.layer.orderedLayers().some((t=>t.isDirty)))&&(e.state.setBlendFunc(i.ONE,i.ONE_MINUS_SRC_ALPHA),this.store.layer.each((e=>{e.prerender(t)})),e.state.bindFramebuffer({buffer:null}),e.state.setViewport(this.context.resolution.width,this.context.resolution.height),e.state.setClearColor(new js(0,0,0,0)),e.state.clear(!0),this.store.layer.each((e=>{!1===e.isLayerMask&&e.render(t)})),e.bindVertexArray(null),e.state.setBlendFunc(i.ONE,i.ZERO))}setupEvents(t){super.setupEvents(t),this.on(qn,(()=>{this.setNeedsViewportUpdate(),this.updateViewport()})),this.on($n,(()=>{this._isMoving=!0})),this.on(to,(()=>{this._isMoving=!1})),this.on("zoom:start",(()=>{this._isZooming=!0})),this.on("zoom:end",(()=>{this._isZooming=!1,this._resetCanvas()})),this.on("fullscreenchange",(()=>{this.map.invalidateSize(!0),setTimeout((()=>{this._resetCanvas()}),300)}))}dataForMapEvent(t,e){if(!e)return;let i;switch(t){case"click":case"dblclick":case"mousemove":i={coord:{lat:e.latlng.lat,lon:e.latlng.lng},point:{x:e.containerPoint.x,y:e.containerPoint.y}}}return i}_moveCanvas(){const t=this.map.containerPointToLayerPoint([0,0]);this._transformCanvas({x:t.x,y:t.y})}_resetCanvas(){const t=this.map.containerPointToLayerPoint([0,0]);this._transformCanvas({x:t.x,y:t.y}),this._canvasTransform={x:0,y:0,scale:1},this.setNeedsViewportUpdate(),this.updateViewport()}_transformCanvas(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const i=this.context.canvas;let r=`translate(${(t=t||{x:0,y:0}).x}px, ${t.y}px)`;r+=` scale(${e})`,this._canvasTransform={x:t.x,y:t.y,scale:e},i&&(i.style.transform=r)}_animateZoom(t){const e=this.map,i=e.getZoomScale(t.zoom,e.getZoom()),r=this._unclampedLatLngBoundsToNewLayerBounds(e.getBounds(),t.zoom,t.center).min;this._transformCanvas(r,i)}_animateZoomNoLayer(t){const e=this.map,i=e.getZoomScale(t.zoom,e.getZoom()),r=e._getCenterOffset(t.center).multiplyBy(-i).subtract(e._getMapPanePos());this._transformCanvas(r,i)}_unclampedProject(t,e,i){var r;const{crs:s}=this.map.options,{R:a}=s.projection,n=Math.sin(e*(Math.PI/180)),o=new L.Point(a*(t*(Math.PI/180)),a*Math.log((1+n)/(1-n))/2),l=null!==(r=s.scale(i))&&void 0!==r?r:0;return s.transformation._transform(o,l)}_unclampedLatLngBoundsToNewLayerBounds(t,e,i){const r=this.map._getNewPixelOrigin(i,e),s=t.getNorth(),a=t.getSouth(),n=t.getWest(),o=t.getEast();return new L.Bounds([this._unclampedProject(n,a,e).subtract(r),this._unclampedProject(n,s,e).subtract(r),this._unclampedProject(o,a,e).subtract(r),this._unclampedProject(o,s,e).subtract(r)])}_canvasNeedsReset(){const t=this._canvasTransform;return 0!==t.x||0!==t.y||1!==t.scale}dispose(t){Object.keys(this._mapEventHandlers).forEach((t=>{this.map.off(t,this._mapEventHandlers[t])})),this._loop.stop(),super.dispose(t)}};var gg,fg=function(t,e,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(t):r?r.value:e.get(t)};gg=new WeakMap;const vg=class{constructor(t){gg.set(this,void 0),this.id=t.id,this.glLayer=t}onAdd(t,e){this.glLayer.onAdd(this.glLayer.map.context);const i=this.glLayer;(function(t,e,i,r,s){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,i)})(this,gg,{zoom_changed:i.onZoom.bind(i),click:i.onClick.bind(i),mousemove:i.onMouseMove.bind(i),resize:i.onResize.bind(i)}),Object.keys(fg(this,gg,"f")).forEach((e=>{t.addListener(e,fg(this,gg,"f")[e])}))}onRemove(t,e){this.renderLoop=void 0,this.glLayer.onRemove(),t&&fg(this,gg,"f")&&Object.keys(fg(this,gg,"f")).forEach((t=>{}))}prerender(t,e){var i;this.glLayer.prerender(null===(i=this.renderLoop)||void 0===i?void 0:i.elapsedTime)}render(t){var e;!0!==this.glLayer.isLayerMask&&this.glLayer.render(null===(e=this.renderLoop)||void 0===e?void 0:e.elapsedTime)}},yg=85.05113,bg=t=>{const e=t.getDiv().firstChild;return{width:e.offsetWidth,height:e.offsetHeight}},xg=(t,e)=>{const i=e?t/e:1;return(new Vo).perspective(Yt(25),i,.75,3e14)},wg=(t,e,i)=>{const r=new google.maps.Point(e,i),s=t.fromContainerPixelToLatLng(r);return[s.lng(),s.lat()]};function _g(){}const Mg=class extends O.A{constructor(t,e){super(),this._triggerContextEvent=!0,this._needsRedraw=!1,this._elapsedTime=0,this.controller=t,this.options=Object.freeze(e),this.setMap(t.map)}getViewCenter(){var t;return null===(t=this._viewState)||void 0===t?void 0:t.center}getViewZoom(){var t;return null===(t=this._viewState)||void 0===t?void 0:t.zoom}getViewBounds(){var t;const e=null===(t=this._dummyOverlay)||void 0===t?void 0:t.getProjection();if(e){const t=this.controller.map,i=t.getBounds(),r=null==i?void 0:i.getNorthEast(),s=null==i?void 0:i.getSouthWest(),a=t.getDiv().firstChild,n=t.getCenter(),o=e.getWorldWidth(),l=a.clientWidth/o*360;return{north:null==r?void 0:r.lat(),west:n.lng()-l/2,south:null==s?void 0:s.lat(),east:n.lng()+l/2}}return null}setMap(t){var e;if(t!==this._map&&(this._map&&(null===(e=this._overlay)||void 0===e||e.setMap(null),this._map=null),t)){this._map=t;const{UNINITIALIZED:e}=google.maps.RenderingType;t.getRenderingType()===e?t.addListener("renderingtype_changed",(()=>{this._createOverlay(t)})):this._createOverlay(t)}}redraw(){this._overlay instanceof google.maps.WebGLOverlayView?this._overlay.requestRedraw():this._needsRedraw=!0}onAdd(){const t=this.controller.map;if(this._overlay instanceof google.maps.OverlayView){const t=this._overlay.getPanes(),e=document.createElement("div");e.style.position="absolute",e.append(this.controller.context.canvas),this._overlayContainer=e,t.overlayLayer.append(this._overlayContainer)}else!1===this.options.interleaved&&this._mapContext&&this._mapContext.canvas.parentElement.append(this.controller.context.canvas);setTimeout((()=>{const e=t.getZoom();t.setZoom(e+.01),setTimeout((()=>t.setZoom(e)),1)}),1)}onContextRestored(t){const{gl:e}=t,i=this.controller;this._mapContext=e,i.context||(i.context=new lg(e.canvas,{context:e}),i.context.dpr=Math.min(2,Vt(e)),i.context.on("resize",(()=>{this._lastContextSize=i.context.resolution,this.onResize()})),this._lastContextSize=i.context.resolution);const{width:r,height:s}=e.canvas;e.viewport(0,0,r,s)}onStateUpdate(t){}onContextLost(){console.warn("[MapsGL] Google Maps context lost")}onRemove(){}onResize(){this._overlay instanceof google.maps.WebGLOverlayView?this._overlay.requestRedraw():this._onDrawRaster()}tick(t){if(this._elapsedTime=t,this.controller.context&&this.controller.map){if(!this.options.interleaved)return this._redraw(this.controller.context.gl),void(this._needsRedraw=!1);this.controller.layers.forEach((t=>{if(t.renderer instanceof Nc){const e=t.renderer.passes.getPass("update-particles");e&&(e.enabled=!0),t.prerender(),e&&(e.enabled=!1)}})),this.controller.context.resetState()}}_createOverlay(t){const{VECTOR:e,UNINITIALIZED:i}=google.maps.RenderingType,r=t.getRenderingType();if(r===i)return;const s=new(r===e&&google.maps.WebGLOverlayView?google.maps.WebGLOverlayView:google.maps.OverlayView);google.maps.WebGLOverlayView&&s instanceof google.maps.WebGLOverlayView?(this.options.interleaved?(s.onContextRestored=this.onContextRestored.bind(this),s.onStateUpdate=this.onStateUpdate.bind(this),s.onDraw=this._onDrawVectorInterleaved.bind(this)):(s.onContextRestored=_g,s.onStateUpdate=this.onStateUpdate.bind(this),s.onDraw=this._onDrawVectorOverlay.bind(this)),s.onContextLost=this.onContextLost.bind(this)):s instanceof google.maps.OverlayView&&(s.draw=this._onDrawRaster.bind(this)),s.onAdd=this.onAdd.bind(this),s.onRemove=this.onRemove.bind(this),this._overlay=s,this._overlay.setMap(t);const a=new google.maps.OverlayView;a.onAdd=_g,a.draw=_g,a.onRemove=_g,a.setMap(t),this._dummyOverlay=a}_prepareDrawWithTransformer(t){const e=((t,e)=>{const{width:i,height:r}=bg(t),{center:s,heading:a,tilt:n,zoom:o}=e.getCameraParams(),l=xg(i,r);return{size:{width:i,height:r},viewState:{altitude:.5*l.value[5],bearing:a,center:{lat:s.lat(),lon:s.lng()},pitch:n,projectionMatrix:l,repeat:!0,zoom:o}}})(this.controller.map,t);this._prepareDraw(e)}_prepareDraw(t){const e=this.controller;this._checkContext(),this._viewState=t.viewState,e.transform.update({size:e.getSize(),center:t.viewState.center,zoom:t.viewState.zoom-1,bounds:e.getBounds(),pitch:t.viewState.pitch,bearing:t.viewState.bearing,fov:e.getFov()})}_onDrawVectorInterleaved(t){let{gl:e,transformer:i}=t;if(!this.controller.map)return;const r=this._overlay;this._prepareDrawWithTransformer(i),this._redraw(e),r.requestRedraw()}_onDrawVectorOverlay(t){let{transformer:e}=t;this.controller.map&&(this._prepareDrawWithTransformer(e),this._redraw(this.controller.context.gl))}_onDrawRaster(){if(!this.controller.map)return;const t=this._overlay;if(!t.getProjection())return;const e=this.controller,i=((t,e)=>{const{width:i,height:r}=bg(t),s=e.getProjection(),a=t.getBounds();if(!a)return{size:{width:i,height:r},position:{x:0,y:0}};const n=a.getNorthEast(),o=a.getSouthWest(),l=s.fromLatLngToDivPixel(n),h=s.fromLatLngToDivPixel(o),d=wg(s,i/2,r/2),c=new google.maps.LatLng(0,d[0]),u=s.fromLatLngToContainerPixel(c),p=s.fromLatLngToDivPixel(c);if(!(l&&h&&p&&u))return{size:{width:i,height:r},position:{x:0,y:0}};const m=Math.round(p.x-u.x);let g=p.y-u.y;const f=wg(s,i/2,0),v=wg(s,i/2,r);let y=d[1];const b=d[0];if(Math.abs(y)>yg){y=y>0?yg:-85.05113;const t=new google.maps.LatLng(y,b);g+=s.fromLatLngToContainerPixel(t).y-r/2}g=Math.round(g);const x=(new Tr).fromArray(f).subtract((new Tr).fromArray(v));let w=180*Math.atan2(x.x,x.y)/Math.PI;w<0&&(w+=360);const _=t.getHeading()||0;let M=t.getZoom(),Z=1;if(0===w)Z=r?Math.round(h.y-l.y)/r:1;else if(w===_){const t=new Tr(l.x,l.y).subtract(new Tr(h.x,h.y)).length(),e=new Tr(i,-r).length();Z=e?t/e:1}M+=Math.log2(Z||1);const A=xg(i,r);return{size:{width:i,height:r},position:{x:m,y:g},viewState:{altitude:1e4,bearing:w,center:{lat:y,lon:b},pitch:t.getTilt(),projectionMatrix:A,repeat:!0,zoom:M}}})(e.map,t),{position:r}=i,s=e.context.canvas.parentElement.style;s.left=`${r.x}px`,s.top=`${r.y}px`,this._prepareDraw(i),this._redraw(e.context.gl)}_checkContext(){void 0===this._viewState&&this._triggerContextEvent&&(this._triggerContextEvent=!1,this.trigger("context:ready"))}_redraw(t){const e=this.controller.context,i=this._lastContextSize,r=e.resolution;!i||i.width===r.width&&i.height===r.height||(e.invalidateSize(),this._lastContextSize={width:r.width,height:r.height}),e.bindVertexArray(null),e.state.setBlendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA),this.controller.layers.forEach((t=>{t.prerender(this._elapsedTime)})),e.state.setViewport(e.resolution.width,e.resolution.height),e.state.bindFramebuffer({buffer:null}),this.options.interleaved||(t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT)),this.controller.layers.forEach(((t,e)=>{!1===t.isLayerMask&&t.render(this._elapsedTime)})),e.bindVertexArray(null),e.state.setBlendFunc(t.ONE,t.ZERO)}dispose(){const t=this._overlay;null==t||t.setMap(null),this._map=null,this._overlay=void 0,t instanceof google.maps.WebGLOverlayView?(t.onContextRestored=_g,t.onStateUpdate=_g,t.onDraw=_g,t.onContextLost=_g):t instanceof google.maps.OverlayView&&(t.draw=_g)}},Zg=class extends qm{get container(){return this.map.getDiv()}get googleLayers(){return[...this._googleLayers.values()]}get renderLoop(){return this._loop}get libraryInfo(){return{name:"google",version:{current:Number.parseFloat(google.maps.version.replaceAll(/[^\d.]/g,"")),min:3.48}}}isVector(){return this.map.getRenderingType()===google.maps.RenderingType.VECTOR}constructor(t,e){e=(0,Y.$)({interleaved:!0},e),super(t,e),this._googleLayers=new Map,this._mapEventHandlers={},this._eventState={lastZoom:0,isIdle:!0},this._loop=new tg.A(this._tick.bind(this)),this.transform.updateOnMapViewChange=!1,this.setupEvents({load:"load",remove:"unload",resize:"resize",click:"click",dblclick:"dblclick",mousedown:"mousedown",mouseup:"mouseup",mouseover:"mouseover",mouseout:"mouseout",mousemove:"mousemove",zoomstart:"zoom:start",zoom_changed:"zoom:end",bounds_changed:"move",dragstart:"move:start",dragend:"move:end"});const i=t=>{(t===r||!e.interleaved||this.libraryInfo.version.current<3.48)&&(e.interleaved=!1,this.context=new lg(void 0,{premultipliedAlpha:!0,depth:!0,antialias:!(z.safari&&z.version>=15.4),alpha:!0}),this.context.dpr=Vt(this.context.gl),this._resizeHandler=this._resize.bind(this),window.addEventListener("resize",this._resizeHandler),this._resize()),this._renderer=new Mg(this,{interleaved:e.interleaved}),this._renderer.on("context:ready",(()=>{this.initialize()}))},{RASTER:r,UNINITIALIZED:s}=google.maps.RenderingType,a=t.getRenderingType();a===s?this._mapEventHandlers.renderTypeChange=t.addListener("renderingtype_changed",(()=>{i(t.getRenderingType())})):i(a)}getSize(){const t=this.map.getDiv();return k(this.container.firstChild)?{width:window.innerWidth,height:window.innerHeight}:{width:t.offsetWidth,height:t.offsetHeight}}setSize(t){this.setContainerSize(t)}getCenter(){var t;let e=null===(t=this._renderer)||void 0===t?void 0:t.getViewCenter();if(!e){const t=this.map.getCenter();e={lat:t.lat(),lon:t.lng()}}return e}setCenter(t){this.map.setCenter({lat:t.lat,lng:t.lon})}getBounds(){var t;const e=this.map.getBounds(),i=null==e?void 0:e.getNorthEast(),r=null==e?void 0:e.getSouthWest();let s=null==r?void 0:r.lng(),a=null==i?void 0:i.lng();s>a&&(s-=360);const n=null===(t=this._renderer)||void 0===t?void 0:t.getViewBounds();return n&&(s=n.west,a=n.east),{north:null==i?void 0:i.lat(),west:s,south:null==r?void 0:r.lat(),east:a}}getZoom(){var t;let e=null===(t=this._renderer)||void 0===t?void 0:t.getViewZoom();return("number"!=typeof e||Number.isNaN(e))&&(e=this.map.getZoom()),e-1}setZoom(t){this.map.setZoom(t+1)}getBearing(){return this.map.getHeading()||0}getPitch(){return this.map.getTilt()||0}getFov(){return 25}setProjection(t){t!==Ie?super.setProjection(Ce):console.warn("[MapsGL] Globe projection is not supported in Google Maps")}redraw(){var t;null===(t=this._renderer)||void 0===t||t.redraw()}add(t,e){if(super.add(t,e),this._googleLayers.get(t.id))console.warn(`[MapsGL] A WebGLLayer with id {${t.id}} already exists on the map`);else{const e=new vg(t);e.renderLoop=this._loop,e.onAdd(this.map,this.context.gl),this._googleLayers.set(t.id,e),this._loop.start()}}remove(t){super.remove(t),t.onRemove();const e=this._googleLayers.get(t.id);this.map&&e&&(e.onRemove(this.map,this.context.gl),this._googleLayers.delete(t.id)),0===this._googleLayers.size&&(this._tick(this._loop.elapsedTime),this._loop.stop())}getViewportState(){const t=super.getViewportState();return t.id="google",t}invalidateMapSize(){this._resize()}_resize(){var t;if(!this.context)return;const e=this.getSize(),i=this.context.dpr,r=this.context.canvas;e.width===r.width/i&&e.height===r.height/i||(this.context.resize(e.width,e.height),null===(t=this._renderer)||void 0===t||t.onResize())}_tick(t){var e;super._tick(t),this.setNeedsViewportUpdate(),this.updateViewport(),null===(e=this._renderer)||void 0===e||e.tick(t)}_onIdle(){this._eventState.isIdle||(this.trigger("move:end"),this.layers.forEach((t=>{t.onMove(),t.onMoveEnd()}))),this._eventState.isIdle=!0}_onMove(){this._eventState.isIdle&&(this.trigger("move:start"),this.layers.forEach((t=>t.onMoveStart()))),this.trigger("move"),this.layers.forEach((t=>t.onMove())),this._eventState.isIdle=!1}setupEvents(t){super.setupEvents(t),this._mapEventHandlers.onMove=this.map.addListener("bounds_changed",this._onMove.bind(this)),this._mapEventHandlers.onIdle=this.map.addListener("idle",this._onIdle.bind(this)),this.isVector||this.on("fullscreenchange",this._resize.bind(this))}dataForMapEvent(t,e){if(!e)return;let i,r=e.pixel;switch(!r&&e.domEvent&&(r={x:e.domEvent.screenX,y:e.domEvent.screenY}),t){case"click":case"dblclick":case"mousemove":i={target:this,originalEvent:e,coord:{lat:e.latLng.lat(),lon:e.latLng.lng()},point:r}}return i}dispose(t){this._loop.stop(),this._renderer.dispose(),Object.keys(this._mapEventHandlers).forEach((t=>{google.maps.event.removeListener(this._mapEventHandlers[t])})),window.removeEventListener("resize",this._resizeHandler),super.dispose(t)}},Ag=`${i(8330).version}`,Tg={datasets:{},colorscales:Object.assign({},C),getColorScaleNames:N.WY,getColorScale:N.yw},Rg={browser:z},Gg={getWeatherSourceSpec:function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};console.warn("`getWeatherSourceSpec` is deprecated and will be removed in a future release. Use `MapController#weatherProvider.getWeatherLayerConfig` instead");const r=new Ms(e).getWeatherLayerConfig(t,i);if(!1===Array.isArray(r))return r.source},getWeatherLayerConfig:function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return console.warn("`getWeatherLayerConfig` is deprecated and will be removed in a future release. Use `MapController#weatherProvider.getWeatherLayerConfig` instead"),new Ms(e).getWeatherLayerConfig(t,i)},getWeatherLayerAlias:t=>(console.warn("`getWeatherLayerAlias` is deprecated and will be removed in a future release. Use `MapController#weatherProvider.getLayerAlias` instead"),new Ms(new pt("null","null")).getLayerAlias(t))},Sg=Object.assign({},I)},8164:(t,e,i)=>{i.d(e,{Ay:()=>n,dE:()=>s,hF:()=>a});var r=i(5340);const s={critical:0,high:1,warm:2},a={pending:"pending",inFlight:"in-flight",success:"success",failed:"failed",cancelled:"cancelled"},n=class{get promise(){return this.deferred.promise}constructor(t,e,i,n){this.controller=new AbortController,this.status=a.pending,this.retries=0,this.deferred=new r.cY,this.key=t,this.url=e,this.options=i,this.priority=null!=n?n:s.warm}getResponseResult(t){return e=this,s=function*(){if(t instanceof Response==0)return t;const e=t.headers.get("content-type");let i,s=this.resultType;if(!s&&e&&(s=(0,r.xm)(e)),t instanceof Response)switch(s){case"blob":i=yield t.blob();break;case"json":i=yield t.json();break;case"arrayBuffer":i=yield t.arrayBuffer();break;case"text":i=yield t.text();break;default:throw new Error(`Unsupported result type: ${this.resultType}`)}else i=t;return i},new((i=void 0)||(i=Promise))((function(t,r){function a(t){try{o(s.next(t))}catch(t){r(t)}}function n(t){try{o(s.throw(t))}catch(t){r(t)}}function o(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i((function(t){t(r)}))).then(a,n)}o((s=s.apply(e,[])).next())}));var e,i,s}}},6083:(t,e,i)=>{i.d(e,{A:()=>r});const r=class{get credentials(){}get headers(){return{}}authenticate(){return Promise.resolve({})}}},5340:(t,e,i)=>{i.d(e,{VX:()=>p,XF:()=>u,cY:()=>h,p0:()=>d,xm:()=>c});var r=i(6232),s=i(7318),a=i(2050),n=i(8164),o=i(6083),l=function(t,e,i,r){return new(i||(i=Promise))((function(s,a){function n(t){try{l(r.next(t))}catch(t){a(t)}}function o(t){try{l(r.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,o)}l((r=r.apply(t,e||[])).next())}))};class h{constructor(){this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}}function d(t){var e;try{return null!==(e=new URL(t).host)&&void 0!==e?e:"default"}catch(t){return"default"}}function c(){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(";")[0].trim();switch(t){case"image/jpeg":case"image/png":return"blob";case"application/json":return"json";case"application/octet-stream":return"arrayBuffer";case"text/plain":return"text";default:throw new Error(`Unsupported result type: ${t}`)}}function u(t,e){return Number.isFinite(t)&&t>=e[0]&&t<=e[1]}function p(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,h,d,c;const p=null!==(i=e.maxRetries)&&void 0!==i?i:0,m=null!==(h=e.retryStatusRange)&&void 0!==h?h:[500,599],g=null!==(d=t.options.authenticator)&&void 0!==d?d:new o.A,f=null!==(c=e.fetcher)&&void 0!==c?c:t=>l(this,void 0,void 0,(function*(){try{const{method:e="GET",body:i,headers:s,signal:n}=t.options;return fetch(t.url,{method:e,body:"POST"===e&&(0,r.Z)(i)?"string"==typeof i?i:JSON.stringify(i):void 0,headers:s,signal:n}).then(a.M4)}catch(t){throw console.error("Fetcher Error",t),t}}));e.taskTransformer&&(t=e.taskTransformer(t)),t.status=n.hF.inFlight;const v=()=>l(this,void 0,void 0,(function*(){var e,i,r;try{yield g.authenticate(),t.options.headers=Object.assign(Object.assign({},t.options.headers),g.headers);const i=yield f(t);if(!i||!1===i.ok)throw t.status=n.hF.failed,new Error("No response for download task");if(401===i.status)return g.authenticate().then((()=>v()));let r;t.status=n.hF.success;try{r=yield t.parse?t.parse(i):function(t,e){switch(e){case"blob":return t.blob();case"json":return t.json();case"arrayBuffer":return t.arrayBuffer();case"text":return t.text();default:throw new Error(`Invalid result type: ${e}`)}}(i,t.resultType)}catch(e){throw t.status=n.hF.failed,e}return r}catch(a){if(t.controller.signal.aborted)throw t.status=n.hF.cancelled,a;if(a instanceof s.D_)throw a;const o=null!==(r=null!==(e=null==a?void 0:a.status)&&void 0!==e?e:null===(i=null==a?void 0:a.response)||void 0===i?void 0:i.status)&&void 0!==r?r:0;if(0!==o&&!u(o,m)||!(t.retries<p))throw t.status=n.hF.failed,a;t.status=n.hF.pending,t.retries+=1;const l=100*(t.retries+1);return yield new Promise((t=>{setTimeout(t,l)})),v()}}));return v().then((e=>(t.deferred.resolve(e),e))).catch((e=>{throw t.status!==n.hF.cancelled&&(t.status=n.hF.failed,t.deferred.reject(e)),e}))}},4918:(t,e,i)=>{i.d(e,{A:()=>_});const r=.95047,s=1.08883,a=.137931034,n=.12841855,o=t=>{const{x:e,y:i,z:r}=d(t),s=116*i-16;return{l:s<0?0:s,a:500*(e-i),b:200*(i-r)}},l=t=>(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4),h=t=>t>.008856452?Math.pow(t,1/3):t/n+a,d=t=>{let{r:e,g:i,b:a}=t;return e=l(e),i=l(i),a=l(a),{x:h((.4124564*e+.3575761*i+.1804375*a)/r),y:h((.2126729*e+.7151522*i+.072175*a)/1),z:h((.0193339*e+.119192*i+.9503041*a)/s)}},c=t=>255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055),u=t=>t>.206896552?t*t*t:n*(t-a);var p,m=i(681),g=i(7411),f=i(2527),v=i(6232),y=i(9369),b=i(8854);const x={rgb:(t,e,i,r)=>({r:t.r+(e.r-t.r)*i,g:t.g+(e.g-t.g)*i,b:t.b+(e.b-t.b)*i,a:t.a+(e.a-t.a)*i}),lrgb:(t,e,i,r)=>({r:Math.sqrt(Math.pow(t.r,2)*(1-i)+Math.pow(e.r,2)*i),g:Math.sqrt(Math.pow(t.g,2)*(1-i)+Math.pow(e.g,2)*i),b:Math.sqrt(Math.pow(t.b,2)*(1-i)+Math.pow(e.b,2)*i),a:t.a+(e.a-t.a)*i}),lab:(t,e,i,a)=>{const n=o(t),l=o(e);return((t,e=1)=>{const{l:i,a:a,b:n}=t;let o,l,h;return l=(i+16)/116,o=Number.isNaN(a)?l:l+a/500,h=Number.isNaN(n)?l:l-n/200,l=1*u(l),o=r*u(o),h=s*u(h),{r:c(3.2404542*o-1.5371385*l-.4985314*h),g:c(-.969266*o+1.8760108*l+.041556*h),b:c(.0556434*o-.2040259*l+1.0572252*h),a:e}})({l:n.l+(l.l-n.l)*i,a:n.a+(l.a-n.a)*i,b:n.b+(l.b-n.b)*i},t.a+(e.a-t.a)*i)},hsl:(t,e,i,r)=>{}};class w{get colors(){return this._colors}get domain(){return this._domain}get positions(){return this._pos}get breaks(){return this._breaks}get range(){return Object.assign({},this._range)}constructor(t=[]){p.add(this),this.mode="rgb",this._range={min:0,max:1},this._domain=[0,1],this._colors=[],this._pos=[],this._cache=new Map,this._correctLightness=!1,this.setColors(t)}setColors(t){if(t=(null==t?void 0:t.length)?[...t]:["#fff","#000"],this._pos.length>0&&t.length!==this._pos.length)throw new Error(`[MapsGL] Invalid color length for color scale ${t.length}, must match current positions ${this._pos.length}`);if(Array.isArray(t)){1===t.length&&(t=[t[0],t[0]]);const e=(t=t.splice(0)).map((t=>(0,m.$)(t)));this._pos=e.map(((t,i)=>i/(e.length-1))),this._colors=e}}setDomain(t){if(!1===Array.isArray(t))throw new TypeError("invalid domain");if(this._range=Object.freeze({min:t[0],max:t.at(-1)}),this._domain=[...t],2===t.length)this._pos=this._colors.map(((t,e)=>e/(this._colors.length-1)));else{if(t.length!==this._colors.length)throw new Error(`[MapsGL] Invalid color scale domain ${t}`);this._pos=t.map((t=>(0,b.Fp)(this._range.min,this._range.max,t)))}}setBreaks(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"e";if(Array.isArray(t))this._breaks=t,this._range={min:t[0],max:t.at(-1)};else{if(t%1!=0||t<1)throw new Error(`[MapsGL] Invalid color scale breaks param ${t}`);this._breaks=(0,b.Fy)(this._domain,e,t)}this._cache.clear()}setPositions(t){if(t.length!==this._colors.length)throw new Error(`[MapsGL] Invalid position length for color scale, total positions (${t.length}) must match total colors (${this._colors.length})`);this._pos=[...t],this._cache.clear()}getColors(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y.G.linear;var i;let r=[];if(1===t)r=[this.getColor(.5)];else if(t>1){const i=this._range.min,s=this._range.max;r=Array.from({length:t},((r,a)=>{const n=e(a/(t-1));return this.getColor((0,g.C)(i,s,n))}))}else r=((null===(i=this._breaks)||void 0===i?void 0:i.length)>2?this._breaks:this._domain).map((t=>this.getColor(t)));return r}getColor(t){let e,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e=i?t:this.getPosition(t,i),e=(0,f.q)(e,0,1);const r=e,s=this._cache&&this._cache.get(r);if(s)return s;let a;for(let t=0;t<this._pos.length;t++){const i=this._pos[t];if(e<=i){a=this._colors[t];break}if(e>=i&&t===this._pos.length-1){a=this._colors[t];break}if(e>i&&e<this._pos[t+1]){a=x[n=this.mode](this._colors[t],this._colors[t+1],(e-i)/(this._pos[t+1]-i),n);break}}var n;return a&&(a.r=Math.floor(a.r),a.g=Math.floor(a.g),a.b=Math.floor(a.b),this._cache.set(r,a)),a}getColorRelative(t){return this.getColor(t,!0)}getBreak(t){const e=this._breaks;if(null==e)return 0;if(t>e.at(-1))return e.length-1;if(e[0]>t)return-1;let i=0,r=e.length-1;for(;i<r;){const s=i+r+1>>>1;e[s]<=t?i=s:r=s-1}return i}getPosition(t){const e=this._range.min,i=this._range.max;let r=t;if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])r=t;else if(this._breaks&&this._breaks.length>2){const e=this.getBreak(t);r=this._breaks[e]}else i===e&&(r=i);r=(0,f.q)(r,e,i);let s=0;for(let t=0;t<this._domain.length;t++){const e=this._domain[t];if(r<=e){s=this._pos[t];break}if(r>=e&&t===this._domain.length-1){s=this._pos[t];break}if(r>e&&r<this._domain[t+1]){s=(0,g.C)(this._pos[t],this._pos[t+1],(r-e)/(this._domain[t+1]-e));break}}return s}scale(t,e){const i=this._domain.map((i=>(0,g.C)(t,e,(0,b.Fp)(this.range.min,this.range.max,i))));this.setDomain(i)}correctLightness(t){this._correctLightness=t}clone(){const t=new w(this.colors);return t.setDomain(this.domain),this._breaks&&t.setBreaks([...this.breaks]),t.setPositions([...this._pos]),t}getRamp(t){var e,i,r;const s=null==t?void 0:t.totalColors,a=null!==(e=null==t?void 0:t.easing)&&void 0!==e?e:y.G.linear,n=null!==(i=null==t?void 0:t.interval)&&void 0!==i?i:0,o=null===(r=null==t?void 0:t.interpolate)||void 0===r||r;let l=null==t?void 0:t.range;const h=this.clone();if((0,v.E)(l)){const t=h.domain;l={min:t[0],max:t.at(-1)}}const{min:d,max:c}=null!=l?l:h.range,u=[];let p=[];if(!1===o)p=this.domain;else if(n>0||(0,v.Z)(null==t?void 0:t.breaks)){if((0,v.Z)(null==t?void 0:t.breaks))p=t.breaks;else{let t=(0,b.SG)(d,n,!0);for(d<t&&p.push(d);t<=c;)p.push(t),t+=n;p.at(-1)<c&&p.push(c)}p=p.map((t=>(0,b.SG)(t,.001)))}if(p.length>0&&h.setBreaks(p),s>1)for(let t=0;t<s;t++){const e=t/(s-1),i=p.length>0?e:a(e),r=(0,g.C)(d,c,i),n=h.getColor(r);u.push({value:r,color:n,position:e})}else(p.length>2?h.breaks:h.domain).forEach((t=>{u.push({value:t,color:h.getColor(t),position:h.getPosition(t)})}));return{range:l,stops:u.filter((t=>t.value>=d&&t.value<=c)),getValue:t=>{const e=a(t);return(0,g.C)(d,c,e)},getPosition:t=>this.getPosition(t)}}}p=new WeakSet;const _=w},8464:(t,e,i)=>{i.d(e,{R7:()=>c,WY:()=>h,yw:()=>d});var r=i(6232),s=i(6476),a=i(7411),n=i(4918),o=i(8854);const l=Object.assign(Object.assign({},{Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Inferno:["#000004","#160b39","#420a68","#6a176e","#932667","#ba3655","#ec6149","#f0882c","#f6a625"],Plasma:["#0d0887","#46039f","#7201a8","#9c179e","#bd3786","#d8576b","#ed7953","#fb9f3a","#fdca26"],Magma:["#000004","#1b0c41","#4a0c6b","#781c6d","#a52c60","#cf4446","#f1642e","#fca636","#f0f921"],Cividis:["#002350","#193B6E","#50566C","#787877","#A29A76","#D6C363","#FFE945"],Mako:["#12070B","#352446","#414283","#3579A3","#36A6AC","#79D5AF","#DBF4E3"],Rocket:["#06061C","#3D1942","#771F59","#C71F51","#EE5740","#F7A67C","#FAE9D9"],Turbo:["#331646","#4682F8","#1BD6CB","#86FA4F","#F6C339","#E74C0C","#881001"]}),{OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"],Rainbow:["#800026","#e31a1c","#fd8d3c","#feb24c","#fed976","#ffeda0","#ffffcc","#ffffe5"],Sinebow:["#0000ff","#00ff00","#ff0000","#ff00ff","#0000ff"],White:["#ffffff","#ffffff"],Black:["#000000","#000000"]}),h=()=>Object.keys(l),d=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const s=(t=>l[t])(t);if((0,r.E)(s))throw new Error(`[MapsGL] Invalid colorscale name: ${t}`);const a=[...e,...s],n=i?1e-6:0,o=(1-n)/(a.length-1),h=[];i&&h.push(0,"rgba(0, 0, 0, 0)");for(let t=0;t<a.length;t++)h.push(n+t*o,a[t]);return{stops:h,normalized:!0}},c=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=[],l=[],h=t.reduce(((t,e,i)=>(i%2==0&&t.push(Number.parseFloat(e.toString())),t)),[]),d=t.reduce(((t,e,i)=>(i%2==1&&t.push(`${e}`.replaceAll(/^\s+|\s+$/g,"")),t)),[]),c=(0,s.n)(null==e?void 0:e.min)?e.min:Number.NEGATIVE_INFINITY,u=(0,s.n)(null==e?void 0:e.max)?e.max:Number.POSITIVE_INFINITY,p=(t,e)=>{r.push(`${e}`.replaceAll(/^\s+|\s+$/g,"")),l.push(t)};if(c!==Number.NEGATIVE_INFINITY&&!h.includes(c)){let t;for(let e=0,i=h.length;e<i;e+=1)h[e]<c&&(t=d[e]);(0,s.n)(t)&&p(c,t)}let m,g;for(let e=0,r=t.length;e<r;e+=2)m=t[e],g=`${t[e+1]}`.replaceAll(/^\s+|\s+$/g,""),i&&(m=(0,a.C)(c,u,m)),m<c||m>u||((0,o.zW)(m,c)||(0,o.zW)(m,u)||m>=c&&m<=u)&&p(m,g);if(m<u&&u!==Number.POSITIVE_INFINITY&&p(u,r.at(-1)),l.length<2)throw new Error(`[MapsGL] Invalid color scale domain ${l}`);const f=new n.A(r);return f.setDomain(l),f}},2291:(t,e,i)=>{i.d(e,{j:()=>r});const r={count:0,minimal:16,low:32,normal:64,high:96,extreme:128}},9147:(t,e,i)=>{i.d(e,{BG:()=>n,lX:()=>r,o3:()=>s,uN:()=>a});const r=["r","g","b","a","rg","gb","rb","ra","ga","ba","rgb","gba","rgba"],s=["r","g","b","a"],a={none:"none",bilinear:"bilinear",bicubic:"bicubic",biquadratic:"biquadratic"},n={number:"number",vector:"vector",sum:"sum",difference:"diff",angle:"angle",custom:"custom"}},5661:(t,e,i)=>{i.d(e,{$:()=>s,p:()=>r});const r={Bevel:"bevel",Round:"round",Miter:"miter"},s={Butt:"butt",Round:"round",Square:"square"}},6219:(t,e,i)=>{i.d(e,{E:()=>s,m:()=>r});const r={raster:"raster",circle:"circle",fill:"fill",line:"line",sample:"sample",grid:"grid",heatmap:"heatmap",contour:"contour",particle:"particle",particles:"particles",symbol:"symbol",text:"text",query:"query",voronoi:"voronoi",data:"data",debug:"debug"},s={exact:"exact",high:"high",medium:"medium",normal:"normal",low:"low",minimal:"minimal"}},8708:(t,e,i)=>{i.d(e,{Fu:()=>r,e1:()=>s});const r={affects:"affects",all:":all",closest:"closest",contains:"contains",id:":id",route:"route",search:"search",within:"within"},s={image:"image",tile:"tile"}},4229:(t,e,i)=>{i.d(e,{V:()=>r,o:()=>s});const r={point:"point",line:"line",polygon:"polygon",symbol:"symbol"},s={raster:"raster",vector:"vector",geojson:"geojson",encoded:"encoded",debug:"debug"}},8937:(t,e,i)=>{i.d(e,{AF:()=>s,AI:()=>a,Ay:()=>n});class r{constructor(t){this.image=t}dispose(){var t;null===(t=this.texture)||void 0===t||t.dispose(),this.texture=void 0}}class s extends r{}class a extends r{}const n=r},9037:(t,e,i)=>{i.d(e,{A:()=>n,d:()=>a});var r=i(3564),s=i(1379);const a=8,n=class{get width(){return this.dimension+2*this.padding}get height(){return this.dimension+2*this.padding}constructor(t,e,i=0){this.stride=4,this.padding=0,this._backfilledEdges=new Set,this.padding=i,this.dimension=e;const r=Math.sqrt(t.length/this.stride),a=e+2*i;if(i>0&&r===e){const e={width:r,height:r,data:t},n=(0,s.mF)({width:a,height:a},this.stride);(0,s.L1)(e,n,0,0,i,i,{width:r,height:r}),(0,s.L1)(e,n,0,0,0,i,{width:i,height:r}),(0,s.L1)(e,n,r-i,0,i+r,i,{width:i,height:r}),(0,s.L1)(e,n,0,0,i,0,{width:r,height:i}),(0,s.L1)(e,n,0,r-i,i,i+r,{width:r,height:i}),(0,s.L1)(e,n,0,0,0,0,{width:i,height:i}),(0,s.L1)(e,n,r-i,0,i+r,0,{width:i,height:i}),(0,s.L1)(e,n,0,r-i,0,i+r,{width:i,height:i}),(0,s.L1)(e,n,r-i,r-i,i+r,i+r,{width:i,height:i}),this.rawData=n.data}else this.rawData=t}get(t,e){const i=this.rawData,r=this._idx(t,e);return{r:i[r],g:i[r+1],b:i[r+2],a:i[r+3]}}backfillEdge(t,e,i){(0,r.vA)(t.dimension===this.dimension,`EncodedData mismatch - neighbor data must have the same dimension as instance data, ${this.dimension} does not equal ${t.dimension}`);const a=`${e},${i}`;if(this._backfilledEdges.has(a))return;const n=this.padding,o=this.dimension+2*n;this._backfilledEdges.add(a);let l=n,h=n,d=n,c=n,u=n,p=n;const m=o-n;-1===e?(l=m-n,d=0):1===e&&(d=m),-1===i?(h=m-n,c=0):1===i&&(c=m),0===e&&(u=o-2*n),0===i&&(p=o-2*n),(0,s.L1)({width:o,height:o,data:t.rawData},{width:o,height:o,data:this.rawData},l,h,d,c,{width:u,height:p}),this._backfilledEdges.add(a)}_idx(t,e){const i=this.dimension+2*this.padding;if(t<-1||t>=i+1||e<-1||e>=i+1)throw new RangeError("[MapsGL] Out of range source coordinates for image bitmap");return 4*(e*i+t)}}},2208:(t,e,i)=>{i.d(e,{GG:()=>f,Or:()=>u,VI:()=>g,Yq:()=>m,ay:()=>c,y$:()=>p});var r=i(2133),s=i(8377),a=i(9688),n=i(6476);const o={second:1,minute:60,hour:3600,day:86400,week:604800,month:2592e3,year:31536e3},l={a:t=>t.getHours()<12?"am":"pm",yyyy:t=>`${t.getFullYear()}`,MMM:t=>`${t.toLocaleString("default",{month:"short"})}`,MM:t=>`${t.getMonth()+1}`.padStart(2,"0"),M:t=>`${t.getMonth()+1}`,dd:t=>`${t.getDate()}`.padStart(2,"0"),d:t=>`${t.getDate()}`,H:t=>`${t.getHours()>12?t.getHours()-12:t.getHours()}`,HH:t=>`${t.getHours()>12?t.getHours()-12:t.getHours()}`.padStart(2,"0"),hh:t=>`${t.getHours()}`.padStart(2,"0"),h:t=>`${t.getHours()}`,mm:t=>`${t.getMinutes()}`.padStart(2,"0")},h=t=>new Date(t.getTime()+60*t.getTimezoneOffset()*1e3),d=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[0-2][1-9]|[1-3]0|3[01])T(?:[01]\d|2[0-3])(?::[0-6]\d){1,2}(?:\.\d{3})?(?:[+-][0-2]\d:[0-5]\d|Z)?$/,c=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if((0,r.K)(t)&&d.test(t))return(t=>{const e=t.split(/\D+/),i=t.includes("+")?-1:1;return new Date(Date.UTC(+e[0],+e[1]-1,+e[2],+e[3]+i*(+e[7]||0),+e[4]+i*(+e[8]||0),+e[5],+e[6]||0))})(t);if((0,r.K)(t)||(0,s.E)(t)){const i=new Date(t);return e?h(i):i}return(0,a.$)(t)?t:null},u=function(){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const i=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((e=>c(e,t)));return e?i.sort(((t,e)=>t.getTime()<e.getTime()?-1:1)).filter(Boolean):i.filter(Boolean)},p=(t,e,i,r)=>{if((0,n.g)(e)||(0,n.g)(i))return[];const s=t.filter((t=>t>=e&&t<=i));if(s.length<=r)return s;const a=s.length/(r-1),o=[];for(let t=0;t<r;t++){const e=Math.min(Math.floor(t*a),s.length-1);o.push(s[e])}return o},m=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=t;if(e.endsWith("iso"))return i.toISOString();if(e.startsWith("utc:")&&(i=h(t),e=e.replace(/^utc:/,"")),"epoch"===e)return`${i.getTime()}`;const r=e.match(/^format\[([\w ,/:-]+)]/g);if(r&&r.length>0){let t=r[0].replace(/^format\[/,"").replace(/]$/,"");const s=[];let a=e;return Object.keys(l).forEach((t=>{a.includes(t)&&(s.push(t),a=a.replaceAll(t,""))})),s.forEach((e=>{const r=l[e];t=t.replace(new RegExp(e),r(i))})),t}return t.toString()},g=(t,e)=>{if("now"===e)return t;const i=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=0;if((0,s.E)(t))return e;const i=t.match(/[\d.-]+\s*\w+/g);return i&&i.length>0&&i.forEach((t=>{const i=t.match(/^([\d.-]+)\s*(\w+)$/);if(i&&i.length>=3){const t=Number.parseFloat(i[1]),r=(i[2]||"").replace(/s$/,"");e+=t*(o[r]||0)}})),e}(e),r=t.getTime()+1e3*i;return new Date(r)},f=function(t){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?t.toISOString().replace("+","%2B"):t.toISOString()}},9369:(t,e,i)=>{i.d(e,{A:()=>s,G:()=>r});const r={linear:t=>t,quadratic:t=>t*(-t*t*t+4*t*t-6*t+4),cubic:t=>t*(4*t*t-9*t+6),elastic:t=>t*(33*t*t*t*t-106*t*t*t+126*t*t-67*t+15),inQuad:t=>t*t,outQuad:t=>t*(2-t),inOutQuad:t=>t<.5?2*t*t:(4-2*t)*t-1,inCubic:t=>t*t*t,outCubic:t=>--t*t*t+1,inOutCubic:t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1,inQuart:t=>t*t*t*t,outQuart:t=>1- --t*t*t*t,inOutQuart:t=>t<.5?8*t*t*t*t:1-8*--t*t*t*t,inQuint:t=>t*t*t*t*t,outQuint:t=>1+--t*t*t*t*t,inOutQuint:t=>t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t,inSine:t=>1-Math.cos(t*(Math.PI/2)),outSine:t=>Math.sin(t*(Math.PI/2)),inOutSine:t=>-(Math.cos(Math.PI*t)-1)/2,inExpo:t=>Math.pow(2,10*(t-1)),outExpo:t=>1-Math.pow(2,-10*t),inOutExpo:t=>(t/=.5)<1?Math.pow(2,10*(t-1))/2:(t--,(2-Math.pow(2,-10*t))/2),inCirc:t=>1-Math.sqrt(1-t*t),outCirc:t=>Math.sqrt(1-(t-=1)*t),inOutCirc:t=>(t/=.5)<1?-(Math.sqrt(1-t*t)-1)/2:(t-=2,(Math.sqrt(1-t*t)+1)/2),inSquare:t=>Math.pow(t,2),outSquare:t=>1-Math.pow(1-t,2),inOutSquare:t=>t<.5?2*t*t:(4-2*t)*t-1,inSqrt:t=>1-Math.pow(1-t,.5),outSqrt:t=>Math.pow(t,.5),inOutSqrt:t=>t<.5?(1-Math.pow(1-2*t,.5))/2:(Math.pow(2*t-1,.5)+1)/2},s=(t,e,i,r)=>{const s=Number.isNaN;(s(t)||s(e)||s(i)||s(r))&&console.warn(`Cubic bezier need to have 4 numbers, example: "0.25, 0, 0.25, 1", and not [${t}, ${e}, ${i}, ${r}]`),(t<0||t>1||i<0||i>1)&&console.warn(`Cubic bezier can not have horizontals Number < 0 or > 1, but you have ${t} and ${i}`),t=Math.min(Math.max(t,0),1),i=Math.min(Math.max(i,0),1);const a=(t,e)=>1-3*e+3*t,n=(t,e)=>3*e-6*t,o=t=>3*t,l=(t,e,i)=>((a(e,i)*t+n(e,i))*t+o(e))*t;return s=>t===e&&i===r?s:l((e=>{let r=e;for(let c=0;c<4;++c){const c=(s=r,3*a(h=t,d=i)*s*s+2*n(h,d)*s+o(h));if(0===c)return r;r-=(l(r,t,i)-e)/c}var s,h,d;return r})(s),e,r)}},1379:(t,e,i)=>{function r(t,e,i){const{width:r,height:s}=t;if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==r*s*e)throw new RangeError(`mismatched image size. expected: ${i.length} but got: ${r*s*e}`)}else i=new Uint8Array(r*s*e);return{width:r,height:s,data:i}}function s(t,e,i,r,s,a,n){let o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:4;if(0===n.width||0===n.height)return e;if(n.width>t.width||n.height>t.height||i>t.width-n.width||r>t.height-n.height)throw new RangeError("[MapsGL] Out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||s>e.width-n.width||a>e.height-n.height)throw new RangeError("[MapsGL] Out of range destination coordinates for image copy");const l=t.data,h=e.data;for(let d=0;d<n.height;d++){const c=((r+d)*t.width+i)*o,u=((a+d)*e.width+s)*o;for(let t=0;t<n.width*o;t++)h[u+t]=l[c+t]}return e}i.d(e,{L1:()=>s,mF:()=>r})},2050:(t,e,i)=>{i.d(e,{Bj:()=>l,M4:()=>c,NF:()=>n,Zg:()=>o,fN:()=>p,iW:()=>u,mN:()=>d,mc:()=>g,mg:()=>h});var r=i(7318),s=i(2208);let a=1;const n=()=>a++,o=()=>!0===globalThis.__MAPSGL_SNAPSHOT_TEST__,l=t=>{const e=new Map;return function(){for(var i=arguments.length,r=new Array(i),s=0;s<i;s++)r[s]=arguments[s];const a=r.map((t=>`${t}_${typeof t}`)).join("|");if(e.has(a))return e.get(a);const n=t(...r);return e.set(a,n),n}};function h(t){let e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakMap;if(null===t||"object"!=typeof t)return t;if(i.has(t))return i.get(t);if(t instanceof Date)e=new Date(t.getTime());else if(Array.isArray(t)){e=[],i.set(t,e);for(let r=0;r<t.length;r++)e[r]=h(t[r],i)}else if(t instanceof Map)e=new Map,i.set(t,e),t.forEach(((t,r)=>{e.set(h(r,i),h(t,i))}));else if(t instanceof Set)e=new Set,i.set(t,e),t.forEach((t=>{e.add(h(t,i))}));else{e=Object.create(Object.getPrototypeOf(t)),i.set(t,e);for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=h(t[r],i))}return e}const d=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t=t.replace(/{s::([^}]+)}/,((t,e)=>{const i=e.split(",");return i[Math.round(Math.random()*(i.length-1))]})),t=t.replaceAll(/{(time|startDate|endDate)::([^}]+)}/g,((t,i,r)=>{var a;const n=null!==(a=e[i])&&void 0!==a?a:new Date;if(n instanceof Date==0)throw new TypeError("[MapsGL] Time must be a Date object");return(0,s.Yq)(n,r)})),Object.keys(e).forEach((i=>{t=t.replaceAll(new RegExp(`{${i}}`,"g"),`${e[i]}`)})),t=t.replaceAll(/{[^}]+}/g,""),t},c=t=>{var e;if(t.status>=200&&t.status<=299)return t;if(401===t.status)throw new r.D_(t.statusText);if(404!==t.status){if(t.status>=500)throw new r.tF(null!==(e=t.statusText)&&void 0!==e?e:"Invalid response",t,t.status);return t}},u=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;if(!t||0===Object.keys(t).length)return null;const i=Object.assign({},t);return i.north=Math.min(90,Math.max(-90,i.north)),i.south=Math.min(90,Math.max(-90,i.south)),(i.west<-180||i.west>180)&&(i.west-=360*Math.floor(i.west/360)),(i.east<-180||i.east>180)&&(i.east-=360*Math.ceil(i.east/360)),`${i.north.toFixed(e)},${i.west.toFixed(e)},${i.south.toFixed(e)},${i.east.toFixed(e)}`},p=(t,e)=>Object.keys(t).filter((i=>e(t[i],i))).reduce(((e,i)=>(e[i]=t[i],e)),{}),m=new Set,g=t=>{m.has(t)||(console.warn(t),m.add(t))}},7412:(t,e,i)=>{i.d(e,{TF:()=>r,o3:()=>s});const r=(t,e,i)=>{const r=Math.max(0,Math.min(1,(i-t)/(e-t)));return r*r*(3-2*r)},s=(t,e,i,r,s,a)=>(i*(1-t)+r*t)*(1-e)+(s*(1-t)+a*t)*e},8854:(t,e,i)=>{i.d(e,{Fp:()=>u,Fy:()=>n,NT:()=>a,Nq:()=>p,PL:()=>l,SG:()=>o,XM:()=>c,_b:()=>d,yT:()=>g,zW:()=>h});var r=i(7411),s=i(2050);const a=(t,e)=>{if(e<0){const i=Math.pow(10,e);return Math.round(t*i)/i}return+`${Math.round(Number(`${t}e+${e}`))}e-${e}`},n=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"e",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:7;const s=Array.isArray(t)?(t=>{const e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY,sum:0,values:[],count:0};return t.forEach((t=>(t=>{void 0===t||Number.isNaN(t)||(e.values.push(t),e.sum+=t,t<e.min&&(e.min=t),t>e.max&&(e.max=t),e.count+=1)})(t))),e.domain=[e.min,e.max],e.limits=(e,i)=>n(t,e,i),e})(t):t,{min:a,max:o,values:l}=s;if(l.sort(((t,e)=>t-e)),1===i)return[a,o];if(e.startsWith("c"))return[a,o];if(e.startsWith("e"))return Array.from({length:i+1},((t,e)=>(0,r.C)(a,o,e/i)));if(e.startsWith("l")){if(a<=0)throw new Error("Logarithmic scales are only possible for values > 0");const t=Math.log10(a),e=Math.log10(o);return Array.from({length:i+1},((s,a)=>Math.pow(10,(0,r.C)(t,e,a/i))))}return e.startsWith("q")?Array.from({length:i+1},((t,e)=>{const s=(l.length-1)*e/i,a=Math.floor(s);return a===s?l[a]:(0,r.C)(l[a],l[a+1],s-a)})):void 0},o=function(t,e){return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?Math.ceil((t+e/2)/e)*e:Math.floor((t+e/2)/e)*e},l=(t,e)=>t%e==0?t:Math.round((t+e/2)/e)*e,h=function(t,e){const i=10*(arguments.length>2&&void 0!==arguments[2]?arguments[2]:4);return Math.round(t*i)===Math.round(e*i)},d=(t,e,i,r,s)=>(t-e)*(s-r)/(i-e)+r,c=(t,e,i,r)=>t<=r&&r<=e||(t>r?r+Math.ceil((t-r)/i)*i<=e:r-Math.ceil((r-e)/i)*i>=t),u=(t,e,i)=>(i-t)/(e-t),p=(t,e,i,s)=>{const a=t.value,n=e.value,o=i.value;for(let t=0;t<16;t++)a[t]=(0,r.C)(n[t],o[t],s);return t},m=function(t){let e=1337;return()=>{e=e+1831565813>>>0;let t=Math.imul(e^e>>>15,1|e);return t^=t+Math.imul(t^t>>>7,61|t),((t^t>>>14)>>>0)/4294967296}}();function g(){return(0,s.Zg)()?m():Math.random()}},537:(t,e,i)=>{i.d(e,{HB:()=>r,et:()=>n,jz:()=>s});const r=t=>t.replaceAll("_"," ").replaceAll("-"," ").split(" ").map(((t,e)=>0===e&&t.length>0&&t[0]===t[0].toLowerCase()?t.toLowerCase():t.charAt(0).toUpperCase()+t.slice(1).toLowerCase())).join(""),s=t=>/<[^>]+>/.test(t),a=t=>{if(!t||t.startsWith("#"))return null;try{return new URL(t,window.location.origin).protocol}catch(t){return null}},n=t=>{const e=new Set(["SCRIPT","STYLE","IFRAME","OBJECT","EMBED","LINK","META"]),i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),r=[];for(;i.nextNode();){const t=i.currentNode;e.has(t.tagName)?r.push(t):[...t.attributes].forEach((e=>{const i=e.name.toLowerCase(),r=e.value.trim(),s=a(r),n=("href"===i||"src"===i||"xlink:href"===i)&&null!==s&&"http:"!==s&&"https:"!==s;(i.startsWith("on")||n)&&t.removeAttribute(e.name)}))}r.forEach((t=>t.remove()))}},2957:(t,e,i)=>{i.r(e),i.d(e,{CtoF:()=>p,CtoFUnit:()=>z,FtoC:()=>u,FtoCUnit:()=>N,UnitSystem:()=>r,Units:()=>s,convert:()=>X,dbzToMMRate:()=>O,defaultUnits:()=>n,degToDir:()=>j,equalUnits:()=>d,ftToM:()=>S,getDefaultUnit:()=>o,getDefaultUnitsForSystem:()=>l,getMeasurementType:()=>B,getSystemForUnits:()=>c,getUnitPrecision:()=>D,hgToMb:()=>M,inToM:()=>W,inToMM:()=>F,inToMMRate:()=>E,kmToM:()=>G,kmToMi:()=>C,kphToMph:()=>f,kphToMs:()=>v,mToFt:()=>A,mToIn:()=>T,mToKm:()=>Z,mToMi:()=>R,mbToHg:()=>w,mbToPa:()=>x,miToM:()=>I,mmToIn:()=>V,mmToMMRate:()=>k,mphToKph:()=>m,mphToMs:()=>g,mphToMsUnit:()=>Y,msToKph:()=>y,msToMph:()=>b,msToMphUnit:()=>L,paToMb:()=>_,resolveMeasurementForUnits:()=>a});const r={metric:"metric",imperial:"imperial",custom:"custom"},s={temperature:{C:"C",F:"F"},speed:{kmh:"km/h",mph:"mph",ms:"m/s",kts:"kts"},pressure:{mb:"mb",pa:"Pa",hPa:"hPa",hg:"inHg"},distance:{m:"m",km:"km",ft:"ft",mi:"mi"},precipitation:{mm:"mm",cm:"cm",in:"in",m:"m",ft:"ft"},direction:{deg:"°"},time:{hr:"hr",min:"min",sec:"sec",ms:"ms"},rate:{mmhr:"mm/hr",inhr:"in/hr",mms:"mm/sec",dbz:"dBZ"},concentration:{ppm:"ppm",ugm3:"ug/m^3"},ratio:{percent:"%"}},a=t=>"temperature-change"===t?"temperature":t,n={metric:{temperature:s.temperature.C,speed:s.speed.kmh,pressure:s.pressure.mb,distance:s.distance.km,height:s.distance.m,precipitation:s.precipitation.mm,snowfall:s.precipitation.cm,direction:s.direction.deg,time:s.time.hr,rate:s.rate.mmhr,intensity:s.rate.dbz,concentration:s.concentration.ugm3,ratio:s.ratio.percent},imperial:{temperature:s.temperature.F,speed:s.speed.mph,pressure:s.pressure.hg,distance:s.distance.mi,height:s.distance.ft,precipitation:s.precipitation.in,snowfall:s.precipitation.in,direction:s.direction.deg,time:s.time.hr,rate:s.rate.inhr,intensity:s.rate.dbz,concentration:s.concentration.ugm3,ratio:s.ratio.percent}},o=(t,e)=>{const i=a(t);return e===r.metric?n.metric[i]:n.imperial[i]},l=t=>t===r.metric?n.metric:n.imperial,h=(t,e)=>e!==r.custom&&Object.keys(t).every((i=>n[e][i]===t[i])),d=(t,e)=>Object.keys(t).every((i=>t[i]===e[i])),c=t=>h(t,r.metric)?r.metric:h(t,r.imperial)?r.imperial:r.custom,u=t=>5/9*(t-32),p=t=>1.8*t+32,m=t=>1.609344*t,g=t=>.45*t,f=t=>.6213712*t,v=t=>.2777777778*t,y=t=>3.6*t,b=t=>2.236936*t,x=t=>100*t,w=t=>.029529983071445*t,_=t=>.01*t,M=t=>33.86389*t,Z=t=>.001*t,A=t=>3.280839895*t,T=t=>12*A(t),R=t=>62e-5*t,G=t=>1e3*t,S=t=>.3048*t,C=t=>.62*t,I=t=>1609.34*t,V=t=>.03937*t,F=t=>25.4*t,W=t=>.0254*t,E=t=>F(t)/3600,k=t=>t/3600,z=t=>1.8*t,N=t=>.555*t,Y=t=>.45*t,L=t=>2.24*t,O=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=0;return i=Math.pow(Math.pow(10,t/10)/200,5/8),e?i/3600:i},j=t=>{t<0?t+=360:t>360&&(t-=360);const e=["↓ N","↓ NNE","↙ NE","← ENE","← E","← ESE","↖ SE","↑ SSE","↑ S","↑ SSW","↗ SW","→ WSW","→ W","→ WNW","↘ NW","↓ NNW"],i=e.length;return e[Math.floor(t/(360/i))%i]},D=t=>{switch(t){case"inHg":case"in":case"in/hr":return 2;case"cm":return 1;default:return 0}},X=(t,e,i,r)=>{switch(t){case"temperature":if("C"===i&&"F"===r)return p(e);if("F"===i&&"C"===r)return u(e);break;case"temperature-change":if("C"===i&&"F"===r)return z(e);if("F"===i&&"C"===r)return N(e);break;case"speed":if("km/h"===i&&"mph"===r)return f(e);if("mph"===i&&"km/h"===r)return m(e);if("m/s"===i&&"mph"===r)return b(e);if("m/s"===i&&"km/h"===r)return y(e);if("mph"===i&&"m/s"===r)return g(e);if("km/h"===i&&"m/s"===r)return v(e);break;case"pressure":if("mb"===i&&"hPa"===r)return x(e);if("mb"===i&&"inHg"===r)return w(e);if("hPa"===i&&"mb"===r)return _(e);if("inHg"===i&&"mb"===r)return M(e);break;case"distance":if("m"===i&&"km"===r)return Z(e);if("m"===i&&"ft"===r)return A(e);if("m"===i&&"in"===r)return T(e);if("m"===i&&"mi"===r)return R(e);if("km"===i&&"m"===r)return G(e);if("ft"===i&&"m"===r)return S(e);if("km"===i&&"mi"===r)return C(e);if("mi"===i&&"m"===r)return I(e);break;case"precipitation":case"snowfall":if("mm/sec"===i)return X(t,3600*e,"mm",r);if("in"===i&&"mm"===r)return F(e);if("in"===i&&"m"===r)return W(e);if("in"===i&&"mm/sec"===r)return E(e);if("m"===i&&"in"===r)return T(e);if("m"===i&&"cm"===r)return 100*e;if("cm"===i&&"m"===r)return e/100;if("cm"===i&&"mm"===r)return 10*e;if("mm"===i&&"mm/sec"===r)return k(e);if("mm"===i&&"in"===r)return V(e);break;case"time":if("hr"===i&&"min"===r)return 60*e;if("hr"===i&&"sec"===r)return 3600*e;if("hr"===i&&"ms"===r)return 36e5*e;if("min"===i&&"hr"===r)return e/60;if("min"===i&&"sec"===r)return 60*e;if("min"===i&&"ms"===r)return 6e4*e;if("sec"===i&&"hr"===r)return e/3600;if("sec"===i&&"min"===r)return e/60;if("sec"===i&&"ms"===r)return 1e3*e;if("ms"===i&&"hr"===r)return e/36e5;if("ms"===i&&"min"===r)return e/6e4;if("ms"===i&&"sec"===r)return e/1e3;break;case"rate":if("mm/hr"===i&&"mm/sec"===r)return e/3600;if("mm/sec"===i&&"mm/hr"===r)return 3600*e;if("mm/sec"===i&&"in/hr"===r)return 3600*e*.03937;if("in/hr"===i&&"mm/sec"===r)return e/3600/.03937;if("dbz"===i&&"mm/hr"===r)return O(e);if("dbz"===i&&"mm/sec"===r)return O(e,!0)}return e},B=t=>(t=t.replaceAll(/\s+/g,"-").replaceAll("_","-").toLowerCase(),/^(temp(erature)?|dew-?point|wind-?chill|heat-?index|feels-?like)/i.test(t)?"temperature":/^(wind-?speed|wind-?gust)/i.test(t)?"speed":/^(pressure)/i.test(t)?"pressure":/^(visibility|snow-depth)/i.test(t)?"distance":/^(precip|rain|snow(fall)?)/i.test(t)?"precipitation":/^(cloud-?cover|humidity)/i.test(t)?"ratio":void 0)},6081:(t,e,i)=>{i.r(e),i.d(e,{dewpoint:()=>h,freeze:()=>a,heatmap:()=>M,humidity:()=>d,ice_accum:()=>x,mslp:()=>c,prate:()=>v,precip_accum:()=>y,radar:()=>w,radarRate:()=>_,sky:()=>p,sleet_accum:()=>b,snowdepth:()=>m,tempChange1Hour:()=>o,tempChange24Hour:()=>n,temperature:()=>s,uvi:()=>g,uvi_categories:()=>f,visibility:()=>u,windspeed:()=>l});var r=i(2957);const s=[-90,"#bef7ff",-84.44,"#00c7fb",-78.89,"#0075b6",-73.33,"#1B0084",-67.78,"#6100FF",-62.22,"#D592FF",-56.67,"#D150FF",-51.111111111111,"#8f00ca",-45.555555555556,"#630078",-40,"#a50099",-34.444444444444,"#ed00dc",-28.888888888889,"#f671ff",-23.333333333333,"#dcc1ed",-17.777777777778,"#1b007b",-12.222222222222,"#6e51ff",-6.6666666666667,"#9bb6ff",-1.1111111111111,"#18a5fc",4.4444444444444,"#0900e7",10,"#14b000",15.555555555556,"#f5d508",21.111111111111,"#e17200",26.666666666667,"#f33300",32.222222222222,"#d00000",37.777777777778,"#720000",43.333333333333,"#ce0046",48.888888888889,"#ff4b98",54.44,"#ffadad",60,"#9f0000",65.56,"#ca4931",71.11,"#e9a696"],a=[-90,"#992BFF",-2.22,"#0046FF",0,"#73DAFC",2.22,"#73DAFC"],n=[.555*-60,"#EF90FF",.555*-50,"#D741DA",.555*-40,"#8B21DA",.555*-30,"#0013CA",.555*-20,"#0070F1",.555*-10,"#8ED4F9",-.555,"rgba(142,212,249,0)",0,"rgba(0,0,0,0)",.555,"rgba(255,217,42,0)",10*.555,"#FFD92A",20*.555,"#FF932A",30*.555,"#E2330B",40*.555,"#9D0000",50*.555,"#D00071",60*.555,"#FF698C"],o=[.555*-40,"#EF90FF",.555*-25,"#D741DA",.555*-15,"#8B21DA",.555*-10,"#0070F1",.555*-5,"#8ED4F9",-.555,"rgba(142,212,249,0)",0,"rgba(0,0,0,0)",.555,"rgba(255,217,42,0)",5*.555,"#FFD92A",10*.555,"#FF932A",15*.555,"#E2330B",19.425,"#9D0000",40*.555,"#D00071"],l=[0,"rgba(0,0,0,0)",1.1176,"#0050ff",3.3528,"#1bd3ff",4.4704,"#34ff87",5.588,"#72ff09",6.7056,"#b4ff08",7.8232,"#efff0b",8.9408,"#fee20a",11.176,"#f0b90a",13.4112,"#ed9909",15.6464,"#fd8609",17.8816,"#fd5d08",20,"#fb3706",22.352,"#c71506",26.8224,"#731005",33.081,"#D01DC7",42.91584,"#FFB1FB",49.62144,"#C8F0F4",53.64,"#36E2F4",57.65856,"#00626C"],h=[-84.44,"#fde3ff",-78.89,"#e0b6ec",-73.33,"#c38ad9",-67.78,"#a75ec6",-62.22,"#8f46b3",-56.67,"#782ea0",-51.11,"#61178e",-45.56,"#5d2d9d",-40,"#5943ac",-34.44,"#5559bc",-30.28,"#7f86dd",-26.11,"#aab4fe",-21.94,"#7f84a9",-17.78,"#555555",-13.61,"#62594f",-9.44,"#705e49",-5.28,"#816b57",-1.11,"#927865",3.06,"#a0938a",7.22,"#afafaf",10,"#5ee243",15.56,"#14b300",21.11,"#0e5e00",26.67,"#93a600",32.22,"#fff800"],d=[0,"#4b2b18",10,"#634a3b",20,"#7c695e",30,"#958881",40,"#aea7a4",50,"#c7c7c7",60,"#6aea55",70,"#18d200",80,"#14ab00",90,"#118400",100,"#0e5e00"],c=[950,"#D08AFF",960,"#9A00FF",970,"#6401FF",980,"#0300B8",990,"#084ADA",1e3,"#01CDFF",1010,"#23DC02",1020,"#FEF90B",1030,"#FE7B00",1040,"#FA0107",1050,"#970100",1060,"#DB5C5F"],u=[0,"#ffb400",(0,r.miToM)(2.5),"#ffea00",(0,r.miToM)(5),"rgba(255, 255, 173, 0.5)",(0,r.miToM)(10),"rgba(162, 162, 162, 0)"],p=[0,"rgba(50, 50, 50, 0)",50,"rgba(100, 100, 100, 0.4)",100,"rgba(242, 242, 242, 1)"],m=[(0,r.inToM)(0),"#929EA4",(0,r.inToM)(.99),"#6B7477",(0,r.inToM)(1),"#B2E4FF",(0,r.inToM)(3),"#019FFF",(0,r.inToM)(6),"#0168FF",(0,r.inToM)(11.99),"#7000D9",(0,r.inToM)(12),"#8D00D9",(0,r.inToM)(18),"#FF49C4",(0,r.inToM)(24),"#FFECF7",(0,r.inToM)(36),"#36E2F4",(0,r.inToM)(48),"#007682",(0,r.inToM)(72),"#CCCCFF",(0,r.inToM)(96),"#6018A5",(0,r.inToM)(144),"#E12020",(0,r.inToM)(216),"#E84E2B",(0,r.inToM)(312),"#F5E205"],g=[0,"rgba(0,0,0,0)",1,"#409F3F",3,"#FBFF00",6,"#DF8000",8,"#DF4000",12,"#C05FC0"],f={minimal:"#409F3F",low:"#FBFF00",moderate:"#DF8000",high:"#DF4000",very_high:"#C05FC0"},v=[0,"rgba(0,0,0,0)",(0,r.dbzToMMRate)(5.9,!0),"rgba(113,255,194,0)",(0,r.dbzToMMRate)(6,!0),"#71ffc2",(0,r.dbzToMMRate)(10,!0),"#49eb3a",(0,r.dbzToMMRate)(33,!0),"#114c00",(0,r.dbzToMMRate)(40,!0),"#e4c700",(0,r.dbzToMMRate)(50,!0),"#da0000",(0,r.dbzToMMRate)(60,!0),"#7a0009",(0,r.dbzToMMRate)(65,!0),"#9e0570"],y=[0,"#939593",(0,r.inToMMRate)(.0999999),"#6D746B",(0,r.inToMMRate)(.1),"#B8FF9C",(0,r.inToMMRate)(.5),"#30D72F",(0,r.inToMMRate)(1),"#006C00",(0,r.inToMMRate)(2),"#FFFC0B",(0,r.inToMMRate)(4),"#DF1400",(0,r.inToMMRate)(6),"#860000",(0,r.inToMMRate)(8),"#4D014B",(0,r.inToMMRate)(10),"#E501E5",(0,r.inToMMRate)(12),"#FF91FF",(0,r.inToMMRate)(14),"#D6F1F4",(0,r.inToMMRate)(16),"#36E2F4",(0,r.inToMMRate)(20),"#00626C",(0,r.inToMMRate)(25),"#F1CCC2",(0,r.inToMMRate)(30),"#9F5F51"],b=[0,"#9F9EA4",(0,r.inToMMRate)(.0499999),"#6F6E74",(0,r.inToMMRate)(.05),"#DACBFE",(0,r.inToMMRate)(.25),"#B899FF",(0,r.inToMMRate)(.5),"#9663FF",(0,r.inToMMRate)(1),"#5100C4",(0,r.inToMMRate)(2),"#008BAF",(0,r.inToMMRate)(3),"#67E0FF"],x=[0,"#959394",(0,r.inToMMRate)(.0499999),"#746E70",(0,r.inToMMRate)(.05),"#FFB4CB",(0,r.inToMMRate)(.25),"#FF3F7C",(0,r.inToMMRate)(.5),"#922447",(0,r.inToMMRate)(1),"#440977",(0,r.inToMMRate)(2),"#008BAF",(0,r.inToMMRate)(3),"#67E0FF"],w={rain:[0,"rgba(0,0,0,0)",5.99,"rgba(0,0,0,0)",6,"#8CF482",10,"#49eb3a",33,"#114c00",40,"#e4c700",50,"#da0000",60,"#7a0009",65,"#9e0570",70,"#dc42b1",80,"#dea8ff",87,"#faf3ff"],mix:[0,"rgba(0,0,0,0)",5.9,"rgba(255,163,249,0)",6,"#ffa3f9",25,"#d518be",58,"#58003c",87,"#58003c"],snow:[0,"rgba(0,0,0,0)",5.9,"rgba(124,255,255,0)",6,"#7cffff",7,"#00e8ff",25,"#0061ea",45,"#0000af",58,"#5c00f5",87,"#5c00f5"]},_={rain:[(0,r.dbzToMMRate)(0,!0),"rgba(0,0,0,0)",(0,r.dbzToMMRate)(5.99,!0),"rgba(0,0,0,0)",(0,r.dbzToMMRate)(6,!0),"#8CF482",(0,r.dbzToMMRate)(10,!0),"#49eb3a",(0,r.dbzToMMRate)(33,!0),"#114c00",(0,r.dbzToMMRate)(40,!0),"#e4c700",(0,r.dbzToMMRate)(50,!0),"#da0000",(0,r.dbzToMMRate)(60,!0),"#7a0009",(0,r.dbzToMMRate)(65,!0),"#9e0570",(0,r.dbzToMMRate)(70,!0),"#dc42b1",(0,r.dbzToMMRate)(80,!0),"#dea8ff",(0,r.dbzToMMRate)(87,!0),"#faf3ff"],mix:[(0,r.dbzToMMRate)(0,!0),"rgba(0,0,0,0)",(0,r.dbzToMMRate)(5.9,!0),"rgba(255,163,249,0)",(0,r.dbzToMMRate)(6,!0),"#ffa3f9",(0,r.dbzToMMRate)(25,!0),"#d518be",(0,r.dbzToMMRate)(58,!0),"#58003c",(0,r.dbzToMMRate)(87,!0),"#58003c"],snow:[(0,r.dbzToMMRate)(0,!0),"rgba(0,0,0,0)",(0,r.dbzToMMRate)(5.9,!0),"rgba(124,255,255,0)",(0,r.dbzToMMRate)(6,!0),"#7cffff",(0,r.dbzToMMRate)(7,!0),"#00e8ff",(0,r.dbzToMMRate)(25,!0),"#0061ea",(0,r.dbzToMMRate)(45,!0),"#0000af",(0,r.dbzToMMRate)(58,!0),"#5c00f5",(0,r.dbzToMMRate)(87,!0),"#5c00f5"]},M=[0,"rgba(0, 0, 0, 0)",.2,"rgba(0, 0, 255, 0.2)",.45,"rgba(0, 255, 0, 0.5)",.85,"rgba(255, 255, 0, 1)",1,"rgba(255, 0, 0, 1)"]},8346:(t,e,i)=>{i.d(e,{V5:()=>a,bG:()=>s,di:()=>r,wi:()=>n});const r="https://{s::a-,b-,c-,d-}prod.v1.mapsgl.api.xweather.com",s="https://www.xweather.com/docs/mapsgl/api/layers",a=9999,n={us:{north:57,west:-127,south:24,east:-59},europe:{north:72,west:-11,south:23,east:46},japan:{north:46,west:122,south:24,east:149},australia:{north:-9,west:114,south:-44,east:154},new_zealand:{north:-34,west:166,south:-47,east:179}}},7658:(t,e,i)=>{i.d(e,{$W:()=>h,BA:()=>V,DP:()=>b,Jg:()=>x,Kn:()=>g,LO:()=>o,MF:()=>l,N0:()=>E,R$:()=>F,RX:()=>y,TX:()=>c,VJ:()=>W,Wc:()=>G,X1:()=>n,XD:()=>p,Yh:()=>f,_k:()=>v,c1:()=>d,h4:()=>m,lw:()=>T,q_:()=>S,rv:()=>u,xj:()=>I});var r=i(6694),s=i(2957),a=i(3760);const n={code:"weather-surface_TMP_2-HTGL",measurement:{type:"temperature",units:s.Units.temperature.C},dataRange:{min:-62.22,max:54.44}},o={code:{u:"weather-surface_UGRD_10-HTGL",v:"weather-surface_VGRD_10-HTGL"},measurement:{type:"speed",units:s.Units.speed.ms},dataRange:{min:-53.64,max:53.64}},l=Object.assign(Object.assign({},o),{code:"weather-surface_GUST_10-HTGL",dataRange:{min:0,max:53.64}}),h={code:"weather-surface_DPT_2-HTGL",measurement:{type:"temperature",units:s.Units.temperature.C},dataRange:{min:-84.44,max:32.22}},d={code:"weather-surface_RH_2-HTGL",measurement:{type:"ratio",units:s.Units.ratio.percent},dataRange:{min:0,max:100}},c=Object.assign(Object.assign({},n),{code:"weather-surface_APTMP_2-HTGL"}),u={code:"weather-surface_PRMSL_0-MSL",measurement:{type:"pressure",units:s.Units.pressure.mb},dataRange:{min:950,max:1060}},p={code:"weather-surface_VIS_0-SFC",measurement:{type:"distance",units:s.Units.distance.m},dataRange:{min:0,max:(0,s.miToM)(10)}},m={code:"weather-surface_TCDC_0-SFC",measurement:{type:"ratio",units:s.Units.ratio.percent},dataRange:{min:0,max:100}},g={code:"weather-surface_PTYPE_0-SFC",measurement:void 0,dataRange:{min:0,max:255}},f={code:"weather-surface_PRATE_0-SFC",measurement:{type:"rate",units:s.Units.rate.mms},dataRange:{min:0,max:(0,s.inToMMRate)(5)}},v={code:"weather-surface_PRATE_0-SFC",measurement:{type:"rate",units:s.Units.rate.mms},dataRange:{min:0,max:(0,s.inToMMRate)(3)}},y={code:"weather-surface_SNOD_0-SFC",measurement:{type:"snowfall",units:s.Units.distance.m},dataRange:{min:0,max:3.6576}},b={code:"conditions_UVI_0-SFC",measurement:void 0,dataRange:{min:0,max:12}},x={code:"radar-composite_REFC_0-SFC",measurement:{type:"intensity",units:s.Units.rate.dbz},dataRange:{min:0,max:87}},w={code:"radar-composite_PRATE_0-SFC",measurement:{type:"rate",units:s.Units.rate.mms},dataRange:{min:0,max:(0,s.inToMMRate)(30)}},_={code:"radar-composite_PTYPESMPL_0-SFC",measurement:void 0,dataRange:{min:0,max:255}},M=Object.assign(Object.assign({},x),{code:"nowcast-composite_REFC_0-SFC"}),Z=Object.assign(Object.assign({},w),{code:"nowcast-composite_PRATE_0-SFC"}),A=Object.assign(Object.assign({},_),{code:"nowcast-composite_PTYPESMPL_0-SFC"}),T=Object.assign(Object.assign({},x),{code:"precip_REFC_0-SFC"}),R=Object.assign(Object.assign({},w),{code:"precip_PRATE_0-SFC"}),G=Object.assign(Object.assign({},_),{code:"precip_PTYPESMPL_0-SFC"}),S={aqiAirNow:{code:"air-quality_AQI-AirNow_0-SFC",measurement:void 0,dataRange:{min:0,max:500}},aqiHealthIndex:{code:"air-quality_AQHI-Canada_0-SFC",measurement:void 0,dataRange:{min:0,max:20}},aqiChina:{code:"air-quality_AQI-China_0-SFC",measurement:void 0,dataRange:{min:0,max:500}},aqiIndia:{code:"air-quality_AQI-India_0-SFC",measurement:void 0,dataRange:{min:0,max:500}},aqiEAQI:{code:"air-quality_AQI-EAQI_0-SFC",measurement:void 0,dataRange:{min:0,max:150}},aqiCAI:{code:"air-quality_AQI-CAI_0-SFC",measurement:void 0,dataRange:{min:0,max:500}},aqiCAQI:{code:"air-quality_AQI-CAQI_0-SFC",measurement:void 0,dataRange:{min:0,max:200}},aqiUbaDAQI:{code:"air-quality_AQI-UBA-DAQI_0-SFC",measurement:void 0,dataRange:{min:0,max:125}},aqiUkDAQI:{code:"air-quality_AQI-UK-DAQI_0-SFC",measurement:void 0,dataRange:{min:0,max:10}},co:{code:"air-quality_CO_0-SFC",measurement:{type:"concentration",units:s.Units.concentration.ugm3},dataRange:{min:0,max:1e3}},no:{code:"air-quality_NO_0-SFC",measurement:{type:"concentration",units:s.Units.concentration.ugm3},dataRange:{min:0,max:100}},no2:{code:"air-quality_NO2_0-SFC",measurement:{type:"concentration",units:s.Units.concentration.ugm3},dataRange:{min:0,max:100}},o3:{code:"air-quality_O3_0-SFC",measurement:{type:"concentration",units:s.Units.concentration.ugm3},dataRange:{min:0,max:300}},pm2p5:{code:"air-quality_PM2P5_0-SFC",measurement:{type:"concentration",units:s.Units.concentration.ugm3},dataRange:{min:0,max:300}},pm10:{code:"air-quality_PM10_0-SFC",measurement:{type:"concentration",units:s.Units.concentration.ugm3},dataRange:{min:0,max:1e3}},so2:{code:"air-quality_SO2_0-SFC",measurement:{type:"concentration",units:s.Units.concentration.ugm3},dataRange:{min:0,max:100}}},C={height:{measurement:{type:"height",units:s.Units.distance.m},dataRange:{min:0,max:15},noData:0},direction:{measurement:{type:"direction",units:s.Units.direction.deg},dataRange:{min:0,max:359},noData:0},period:{measurement:{type:"time",units:s.Units.time.sec},dataRange:{min:0,max:24},noData:0}},I={waveHeight:Object.assign({code:"marine_HTSGW_0-SFC"},C.height),waveDir:Object.assign({code:"marine_DIRPW_0-SFC"},C.direction),wavePeriod:Object.assign({code:"marine_PERPW_0-SFC"},C.period),swellHeightPrimary:Object.assign({code:"marine_SWELL_1-SEQ"},C.height),swellPeriodPrimary:Object.assign({code:"marine_SWPER_1-SEQ"},C.period),swellDirPrimary:Object.assign({code:"marine_SWDIR_1-SEQ"},C.direction),swellHeightSecondary:Object.assign({code:"marine_SWELL_2-SEQ"},C.height),swellPeriodSecondary:Object.assign({code:"marine_SWPER_2-SEQ"},C.period),swellDirSecondary:Object.assign({code:"marine_SWDIR_2-SEQ"},C.direction),swellHeightTertiary:Object.assign({code:"marine_SWELL_3-SEQ"},C.height),swellPeriodTertiary:Object.assign({code:"marine_SWPER_3-SEQ"},C.period),swellDirTertiary:Object.assign({code:"marine_SWDIR_3-SEQ"},C.direction),current:{code:{u:"marine_UOGRD_0-SFC",v:"marine_VOGRD_0-SFC"},measurement:{type:"speed",units:s.Units.speed.ms},dataRange:{min:-3.0864,max:3.0864},noData:0},sst:{code:"marine_WTMP_0-SFC",measurement:{type:"temperature",units:s.Units.temperature.C},dataRange:{min:-100,max:100},noData:0},surge:{code:"marine_SURGE_0-SFC",measurement:{type:"height",units:s.Units.distance.m},dataRange:{min:0,max:5},noData:0},tide:{code:"marine_TIDE_0-SFC",measurement:{type:"height",units:s.Units.distance.m},dataRange:{min:-12.192,max:12.192},noData:0}},V={summary:{code:"roadSeverity_0-SFC",measurement:void 0,dataRange:{min:0,max:0}},surface:{code:"roadCondition_0-SFC",measurement:void 0,dataRange:{min:0,max:0}},temperature:{code:"roadTemperature_0-SFC",measurement:{type:"temperature",units:s.Units.temperature.C},dataRange:{min:-62.22,max:54.44}},temperatureFreeze:{code:"roadTemperature_0-SFC",measurement:{type:"temperature",units:s.Units.temperature.C},dataRange:{min:-62.22,max:54.44}},riskRollover:{code:"roadRiskRollover_0-SFC",measurement:void 0,dataRange:{min:0,max:0}},riskHydroplane:{code:"hydroplaneRisk_0-SFC",measurement:void 0,dataRange:{min:0,max:0}},riskLowVizSnow:{code:"roadRiskSnow_0-SFC",measurement:void 0,dataRange:{min:0,max:0}},riskLowVizFog:{code:"roadRiskFog_0-SFC",measurement:void 0,dataRange:{min:0,max:0}}},F={size:t=>({code:`hail-threats-archive-${t}_MESH_0-SFC`,measurement:{type:"precipitation",units:s.Units.precipitation.mm},dataRange:{min:0,max:(0,s.inToMM)(4)}}),posh:t=>({code:`hail-threats-archive-${t}_POSH_0-SFC`,measurement:{type:"ratio",units:s.Units.ratio.percent},dataRange:{min:0,max:100}})},W={cg:t=>({code:`lightning-density-archive-${t}_LIGHTNING-STRIKES-CG_0-SFC`,measurement:void 0,dataRange:{min:0,max:10}}),ic:t=>({code:`lightning-density-archive-${t}_LIGHTNING-STRIKES-IC_0-EATM`,measurement:void 0,dataRange:{min:0,max:10}})},E=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({temperature:n,wind:o,windGust:l,dewpoint:h,humidity:d,feelsLike:c,mslp:u,visibility:p,cloudCover:m,precipType:g,precipRate:f,snowDepth:y,uvi:b,radarArchiveDbz:x,radarArchivePrecipRate:w,radarArchivePrecipType:_,radarNowcastDbz:M,radarNowcastPrecipRate:Z,radarNowcastPrecipType:A,radarDbz:T,radarPrecipRate:R,radarPrecipType:G},Object.entries(S).reduce(((t,e)=>{let[i,r]=e;return t[i]=r,t}),{})),Object.entries(I).reduce(((t,e)=>{let[i,r]=e;return t[i]=r,t}),{})),Object.entries(V).reduce(((t,e)=>{let[i,s]=e;return t[`road${(0,r.C)(i)}`]=s,t}),{})),Object.entries(W).reduce(((t,e)=>{let[i,s]=e;return a.Q0.forEach((e=>{let a=i.replace(/^cg/,"CloudToGround");a=a.replace(/^ic/,"IntraCloud"),t[`lightning${(0,r.C)(a)}${(0,r.C)(e).replace(/^us/i,"US")}`]=s(e)})),t}),{})),Object.entries(F).reduce(((t,e)=>{let[i,s]=e;return a.ot.forEach((e=>{t[`hail${(0,r.C)(i)}${(0,r.C)(e).replace(/^us/i,"US")}`]=s(e)})),t}),{}))},3760:(t,e,i)=>{i.d(e,{Q0:()=>s,oh:()=>a,ot:()=>r});const r=["us","europe","japan","australia"],s=["us","europe","japan","australia"],a=t=>{var e,i;if(!(null==t?void 0:t.details)||!(null==t?void 0:t.period))return 0;const r=new Date(t.details.issuedDateTimeISO),s=new Date(null!==(i=null===(e=t.period.range)||void 0===e?void 0:e.minDateTimeISO)&&void 0!==i?i:t.details.issuedDateTimeISO);return Math.floor((s.getTime()-r.getTime())/1e3/60)}},2102:(t,e,i)=>{i.d(e,{Af:()=>p,BH:()=>m,Qf:()=>d,RC:()=>c,T9:()=>u,Z:()=>g,ge:()=>f});var r=i(6232),s=i(5711),a=i(6476),n=i(6219),o=i(4229),l=i(3606),h=i(9147);const d="",c=t=>{if((0,r.E)(t))throw new Error(`[MapsGL] Invalid weather layer id: ${t}`);return t.startsWith(d)?t:`${d}${t}`},u=(t,e)=>{const{dataRange:i}=t,r=(i.max-i.min)/e;return Array.from({length:e}).map(((e,s)=>Object.assign(Object.assign({},t),{dataRange:{min:i.min+r*s,max:i.min+r*(s+1)}})))},p=function(t){return(0,s.$)({type:n.m.sample,source:t,quality:n.E.high,zoomOffset:-1,timeSeries:{mode:l.Gp.interval},paint:{sample:{interpolation:h.uN.bicubic,colorscale:{interval:0}}}},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})},m=function(t){return(0,s.$)({type:n.m.raster,source:t,timeSeries:{mode:l.Gp.interval,intervals:10,interleaved:!1},paint:{raster:{meld:!1}}},arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})},g=function(t,e,i){return(0,s.$)({},{type:n.m.query,source:t,sourceType:o.V.point,sourceLayer:"cities",paint:{text:[{value:["to-unit",["var","dataValue"],null==e?void 0:e.type,null==e?void 0:e.units,null==e?void 0:e.units,i],size:20,color:"#fff",outlineColor:"#000",weight:"bold",anchor:"center",offset:{x:0,y:-4}},{value:["get","place.name"],size:11,color:"#fff",outlineColor:"#444",weight:"bold",anchor:"top",offset:{x:0,y:8}}],symbol:{key:t=>t.place.name,rank:{property:"profile.rankScore",direction:"desc"},pitchWithMap:!1,rotateWithMap:!1,scaleWithMap:!1,allowOverlap:!1}}},arguments.length>3&&void 0!==arguments[3]?arguments[3]:{})},f=(t,e)=>t.map((t=>{const{id:i,dataMin:r,dataMax:s,outputMin:n=0,outputMax:o=255,timeOffset:l=0}=t,h={dataSetId:i,dataMin:r,dataMax:s,outputMin:n,outputMax:o,outputNoDataValue:void 0,validTimes:null==e?void 0:e.map((t=>new Date(t.getTime()+1e3*l).toISOString()))};return Object.keys(h).reduce(((t,e)=>{const i=h[e];return(0,a.n)(i)&&(t[e]=i),t}),{})}))},6339:(t,e,i)=>{i.d(e,{A:()=>r});const r={ARRAY_BUFFER:34962,TEXTURE_BINDING_3D:32874}},7290:(t,e,i)=>{i.d(e,{A:()=>u});var r,s,a,n,o,l=function(t,e,i,r,s){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?s.call(t,i):s?s.value=i:e.set(t,i),i},h=function(t,e,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(t):r?r.value:e.get(t)};const d=()=>("undefined"==typeof performance?Date:performance).now();r=new WeakMap,s=new WeakMap,a=new WeakMap,n=new WeakMap,o=new WeakMap;const c=class{constructor(t=!0){r.set(this,0),s.set(this,0),a.set(this,0),n.set(this,!1),o.set(this,!1),l(this,o,t,"f")}start(){h(this,n,"f")||(this.reset(),l(this,n,!0,"f"))}stop(){this.getElapsedTime(),l(this,n,!1,"f"),l(this,o,!1,"f")}reset(){l(this,r,d(),"f"),l(this,s,h(this,r,"f"),"f"),l(this,a,0,"f")}getElapsedTime(){return this.getDelta(),h(this,a,"f")}getDelta(){let t=0;if(h(this,o,"f")&&!h(this,n,"f"))return this.start(),0;if(h(this,n,"f")){const e=d();t=(e-h(this,s,"f"))/1e3,l(this,s,e,"f"),l(this,a,h(this,a,"f")+t,"f")}return t}},u=class{get elapsedTime(){return this._clock.getElapsedTime()}constructor(t,e=!0){this._clock=new c,this._running=!1,this._callback=()=>{const e=this._clock.getElapsedTime();t&&t(e)},e&&this.start()}start(){this.stop(),this._running=!0,this._clock.start(),this.tick()}stop(){this._running=!1,this._clock.stop(),this._handle>=0&&cancelAnimationFrame(this._handle),this._handle=-1}dispose(){this.stop(),this._callback=void 0}tick(){this._handle=requestAnimationFrame((()=>{this._running&&this.tick()})),this._callback&&this._callback()}}},3564:(t,e,i)=>{i.d(e,{$8:()=>o,C6:()=>l,Ld:()=>a,N_:()=>h,Ng:()=>d,aF:()=>c,vA:()=>n});var r=i(6339);const s={},a=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";s[t]=s[t]||1;const e=s[t];return s[t]+=1,`${t}-${e}`},n=function(t){if(!t)throw new Error(`Assert failed: ${(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||""}`)},o=t=>{throw new Error(t.replaceAll("\n"," ").replaceAll(/\s+/g," "))},l=t=>Boolean(t&&(t instanceof WebGLRenderingContext||t.ARRAY_BUFFER===r.A.ARRAY_BUFFER)),h=t=>{const e=t.match(/#define[\s*]SHADER_NAME[\s*]([\w-]+)[\s*]/);return e?e[1]:"unnamed"},d=(t,e)=>{switch(e){case t.FRAGMENT_SHADER:return"fragment";case t.VERTEX_SHADER:return"vertex";default:return"unknown type"}},c=(t,e)=>void 0!==e&&(t&e)===e},8330:t=>{t.exports=JSON.parse('{"name":"@xweather/mapsgl","version":"1.9.2","description":"An easy-to-use, highly customizable Javascript library for visualizing both weather and custom data on a variety of web mapping platforms for WebGL.","author":"Vaisala Xweather","homepage":"https://www.xweather.com","license":"BSD","private":true,"workspaces":["packages/*"],"scripts":{"postinstall":"husky install","clean":"rm -fr dist/*","clean:bundle":"rm -fr packages/main/dist/*; rm -fr packages/main/build/types/*;","dev":"yarn clean; DEPLOY_PATH=\'/dist/\' NODE_ENV=\'development\' webpack serve --config webpack.dev.js","transpile":"swc ./packages/webgl-maps/src -d output","build":"rm -fr dist; tsc --sourceMap false --outDir dist; babel --config-file ./babel-nodejs.config.js dist --out-dir dist","build:dev":"DEPLOY_PATH=\'/dist/\' webpack --config webpack.dev.js","build:prod":"yarn clean; DEPLOY_PATH=\'https://cdn.aerisapi.com/sdk/js/mapsgl/%%version%%/\' NODE_ENV=\'production\' webpack --env production --config webpack.prod.js","build:bundle":"yarn clean:bundle; NODE_ENV=\'production\' webpack --env production --config webpack.bundle.js; node scripts/buildBundle.js","build:bundle:debug":"yarn clean:bundle; NODE_ENV=\'development\' webpack --env debug --config webpack.bundle.js; node scripts/buildBundle.js --debug","build:dts":"sh scripts/build-dts.sh","build:dts-rollup":"rm -fr packages/main/build/types/*; rollup -c rollup.config.js --environment BUILD:production,MINIFY:true; node scripts/buildDts.js","build:sprite":"node assets/scripts/buildSprites.js","glsl:chunks":"node scripts/chunkNames.js","test":"jest --maxWorkers=50%","test:watch":"jest --maxWorkers=25% --watch --onlyChanged","test:ci":"jest --color --runInBand --ci","test:cypress":"yarn run cypress open","test:clear":"jest --clearCache","lint":"yarn lint:eslint","lint:all":"concurrently yarn:lint:*","lint:eslint":"eslint --ext .ts,.tsx --config .eslintrc.js \\"packages/**/src/**/*.ts\\"","lint:types":"tsc --noEmit --skipLibCheck","lint:fix":"yarn lint:eslint --fix","security:audit":"yarn security:deps && yarn security:semgrep && yarn security:gitleaks && yarn security:trivy","security:deps":"yarn audit --groups dependencies --level high","security:semgrep":"set --; for dir in packages/*/src; do if [ -d \\"$dir\\" ]; then set -- \\"$@\\" \\"$dir\\"; fi; done; semgrep scan --config p/owasp-top-ten --config p/javascript --config p/typescript --config .semgrep.yml \\"$@\\"","security:semgrep:strict":"set --; for dir in packages/*/src; do if [ -d \\"$dir\\" ]; then set -- \\"$@\\" \\"$dir\\"; fi; done; semgrep scan --config p/security-audit --config p/secrets --config p/nodejs --config p/react --config .semgrep.strict.yml \\"$@\\"","security:gitleaks":"gitleaks detect --source . --config .gitleaks.toml --verbose","security:trivy":"for dir in packages/*; do if [ -f \\"$dir/package.json\\" ]; then echo \\"[trivy] scanning $dir\\"; trivy fs --scanners vuln,secret,misconfig --ignorefile .trivyignore --severity HIGH,CRITICAL \\"$dir\\"; fi; done","commit":"git-cz","changelog":"cz changelog --dry-run","changelog:gen":"ts-node scripts/changelog-generate.ts","changelog:write":"ts-node scripts/changelog-write.ts","changelog:commit":"git add CHANGELOG.md && git commit -am \'docs: add changelog\' && git push","changelog:format":"node scripts/changelog-format.js","release":"standard-version","release:version":"standard-version --release-as 1.8.5","release:beta":"standard-version --prerelease beta","release:rc":"standard-version --prerelease rc","release:changelog":"standard-version --skip.bump --skip.commit --skip.tag","docs:code":"cd packages/webgl-core && yarn docs:code; cd ../webgl-maps && yarn docs:code","deploy":"yarn run build:prod; sh scripts/deploy.sh dist/","deploy-staging":"DEPLOY_ENV=\'staging\' yarn run build:prod; sh scripts/deploy.sh dist/","deploy-latest":"DEPLOY_VERSION=\'latest\' yarn run build:prod; sh scripts/deploy.sh dist/ --version latest","test-npm":"sh scripts/npmPublish.sh --test","deploy-npm":"sh scripts/npmPublish.sh","deploy-npm-beta":"sh scripts/npmPublish.sh --tag beta","test-npm-debug":"sh scripts/npmPublishDebug.sh --test","deploy-npm-debug":"sh scripts/npmPublishDebug.sh","strip-keys":"node scripts/stripKeys.js"},"lint-staged":{"*.{js,ts,tsx}":["yarn lint:fix"],"*.(md|html)":["yarn run strip-keys","yarn changelog:format"]},"devDependencies":{"@aerisweather/eslint-plugin":"^1.0.4","@babel/cli":"^7.24.0","@babel/core":"^7.24.0","@babel/plugin-transform-runtime":"^7.24.0","@babel/preset-env":"^7.24.0","@babel/preset-typescript":"^7.24.0","@babel/runtime":"^7.24.0","@changesets/cli":"^2.23.0","@commitlint/cli":"^17.0.2","@commitlint/config-conventional":"^17.0.2","@jutaz/spritezero":"^9.0.0","@rollup/plugin-commonjs":"^24.0.0","@rollup/plugin-json":"^6.0.0","@rollup/plugin-typescript":"^10.0.1","@stylistic/eslint-plugin":"^4.2.0","@swc/cli":"^0.3.10","@swc/core":"^1.4.11","@types/gl":"^4.1.0","@types/jest":"^27.0.0","@types/jest-image-snapshot":"^4.3.1","@types/jsdom-screenshot":"^3.2.1","@types/pngjs":"^6.0.1","@types/stats.js":"^0.17.0","@typescript-eslint/eslint-plugin":"^5.25.0","@typescript-eslint/parser":"^5.25.0","babel-eslint":"^10.1.0","babel-jest":"^27.0.6","babel-loader":"^8.2.2","babel-plugin-add-module-exports":"^1.0.4","babel-plugin-transform-import-meta":"^2.1.1","circular-dependency-plugin":"^5.2.2","clean-webpack-plugin":"^3.0.0","commitizen":"^4.2.4","concat":"^1.0.3","core-js":"^3.15.1","css-loader":"^6.7.1","cz-conventional-changelog":"^3.3.0","dotenv-webpack":"^7.1.0","eslint":"^8.57.0","eslint-config-airbnb":"^19.0.4","eslint-plugin-import":"^2.29.0","eslint-plugin-unicorn":"^51.0.0","fast-glob":"^3.2.11","file-loader":"^6.2.0","html-webpack-harddisk-plugin":"^2.0.0","html-webpack-plugin":"^5.3.2","husky":"^6.0.0","jest":"^27.0.5","jest-canvas-mock":"^2.5.0","jest-fetch-mock":"^3.0.3","jest-image-snapshot":"^6.2.1","jest-transform-stub":"^2.0.0","jest-webgl-canvas-mock":"^0.2.3","js-beautify":"^1.14.0","lint-staged":"^13.0.2","mini-css-extract-plugin":"^2.6.1","msdf-bmfont-xml":"^2.7.0","node-pandoc":"^0.3.0","pngjs":"^6.0.0","rollup":"^3.9.1","rollup-plugin-dts":"^5.1.0","rollup-plugin-terser":"^7.0.2","sass":"^1.52.3","sass-loader":"^13.0.0","sharp":"^0.34.2","standard-version":"^9.5.0","stats.js":"^0.17.0","swc-loader":"^0.2.3","terser-webpack-plugin":"^5.1.4","ts-jest":"^29.1.0","ts-loader":"^9.2.3","ts-node":"^10.9.0","ts-shader-loader":"^2.0.2","typedoc":"^0.27.0","typedoc-plugin-merge-modules":"^3.0.1","typedoc-plugin-rename-defaults":"^0.3.0","types-webpack-bundler":"^1.0.2","typescript":"^5.4.0","webpack":"^5.70.0","webpack-bundle-analyzer":"^4.4.2","webpack-cli":"^4.9.0","webpack-dev-server":"^4.0.0","webpack-glsl-minify":"^1.5.0","webpack-merge":"^5.8.0"},"packageManager":"yarn@1.22.19"}')}},r={};function s(t){var e=r[t];if(void 0!==e)return e.exports;var a=r[t]={exports:{}};return i[t].call(a.exports,a,a.exports,s),a.exports}return s.m=i,s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var i in e)s.o(e,i)&&!s.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},s.f={},s.e=t=>Promise.all(Object.keys(s.f).reduce(((e,i)=>(s.f[i](t,e),e)),[])),s.u=t=>t+".js",s.miniCssF=t=>{},s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="@xweather/mapsgl:",s.l=(i,r,a,n)=>{if(t[i])t[i].push(r);else{var o,l;if(void 0!==a)for(var h=document.getElementsByTagName("script"),d=0;d<h.length;d++){var c=h[d];if(c.getAttribute("src")==i||c.getAttribute("data-webpack")==e+a){o=c;break}}o||(l=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,s.nc&&o.setAttribute("nonce",s.nc),o.setAttribute("data-webpack",e+a),o.src=i),t[i]=[r];var u=(e,r)=>{o.onerror=o.onload=null,clearTimeout(p);var s=t[i];if(delete t[i],o.parentNode&&o.parentNode.removeChild(o),s&&s.forEach((t=>t(r))),e)return e(r)},p=setTimeout(u.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=u.bind(null,o.onerror),o.onload=u.bind(null,o.onload),l&&document.head.appendChild(o)}},s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.p='"1.9.2"',(()=>{var t={main:0};s.f.j=(e,i)=>{var r=s.o(t,e)?t[e]:void 0;if(0!==r)if(r)i.push(r[2]);else{var a=new Promise(((i,s)=>r=t[e]=[i,s]));i.push(r[2]=a);var n=s.p+s.u(e),o=new Error;s.l(n,(i=>{if(s.o(t,e)&&(0!==(r=t[e])&&(t[e]=void 0),r)){var a=i&&("load"===i.type?"missing":i.type),n=i&&i.target&&i.target.src;o.message="Loading chunk "+e+" failed.\n("+a+": "+n+")",o.name="ChunkLoadError",o.type=a,o.request=n,r[1](o)}}),"chunk-"+e,e)}};var e=(e,i)=>{var r,a,[n,o,l]=i,h=0;if(n.some((e=>0!==t[e]))){for(r in o)s.o(o,r)&&(s.m[r]=o[r]);l&&l(s)}for(e&&e(i);h<n.length;h++)s.o(t,a=n[h])&&t[a]&&t[a][0](),t[a]=0},i=self.webpackChunk_xweather_mapsgl=self.webpackChunk_xweather_mapsgl||[];i.forEach(e.bind(null,0)),i.push=e.bind(null,i.push.bind(i))})(),s(5627)})())),r((()=>(()=>{var t,e={};t=e,"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0});const i=t=>Array.isArray(t)?"array":t instanceof Date?"date":typeof t,r=t=>null==t,s=t=>!r(t),a=t=>!(t=>r(t)||(t=>{switch(i(t)){case"array":case"string":return 0===t.length;case"date":case"boolean":case"number":case"function":case"symbol":return!1;case"object":return 0===Object.keys(t).length;default:return!0}})(t))(t),n=/^(async\s+)?(function(\s+\w+)?\s*\(|\(?[\s\w,]*\)?\s*=>)/,o=["constructor","__proto__","prototype","globalThis","window","document","self","top","parent","frames","opener","location","import(","eval(","Function(","XMLHttpRequest","fetch("];let l=null,h=!1;const d=(t,e)=>{if("string"!=typeof e||!e.startsWith("_FUNC"))return e;if(l){const t=`_FUNC${l}:`;if(e.startsWith(t)){const i=e.slice(t.length);if(!n.test(i.trim()))throw new Error("[MapsGL] Rejected invalid serialized function source");return new Function(`'use strict'; return (${i}).apply(this, arguments);`)}}h||(console.warn("[MapsGL] Deserializing a function without session-token verification. This path is deprecated and will be removed in a future version."),h=!0);const i=e.replace(/^_FUNC/,"");if(!function(t){const e=t.trim();if(!e||e.length>4e3)return!1;if(!n.test(e))return!1;const i=e.toLowerCase();return!o.some((t=>i.includes(t.toLowerCase())))}(i))throw new Error("[MapsGL] Rejected unsafe serialized function source");return new Function(`'use strict'; return (${i}).apply(this, arguments);`)};class c extends Error{constructor(t){super(null!=t?t:"Unauthorized")}}Error,Error;class u extends Error{constructor(t,e,i){super(t),this.response=e,this.status=i}}const p=function(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if((t=>null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Date||t instanceof RegExp)(t))return t;if((s=t)&&"undefined"!=typeof ArrayBuffer&&s instanceof ArrayBuffer)return e&&!e.includes(t)&&e.push(t),t;var s;if(ArrayBuffer.isView(t)){const i=t;return e&&!e.includes(i.buffer)&&e.push(i.buffer),i}if(t instanceof ImageData)return e&&!e.includes(t.data.buffer)&&e.push(t.data.buffer),t;if(t instanceof ImageBitmap)return e&&!e.includes(t)&&e.push(t),t;if(Array.isArray(t)){const i=[];for(let r=0;r<t.length;r++)i.push(p(t[r],e));return i}if((t=>"object"===i(t))(t))return Object.keys(t).reduce(((i,s)=>{const a=0===r.length||r.length>0&&(r.includes(s)||((t,e)=>{let i=!1;return e.forEach((e=>{new RegExp(e).test(t)&&(i=!0)})),i})(s,r));return i[s]=a?p(t[s],e,r):t[s],i}),{});throw new Error("[MapsGL] Can't serialize object of type "+typeof t)},m=t=>"function"===i(t),g=t=>t&&"object"==typeof t,f=(t,e)=>(Object.keys(e).forEach((i=>{const r=t[i],s=e[i];t[i]=Array.isArray(r)&&Array.isArray(s)?[...r,...s]:g(r)&&g(s)?f(Object.assign({},r),s):s})),t),v=t=>{var e;if(t.status>=200&&t.status<=299)return t;if(401===t.status)throw new c(t.statusText);if(404!==t.status){if(t.status>=500)throw new u(null!==(e=t.statusText)&&void 0!==e?e:"Invalid response",t,t.status);return t}};new Set;const y=t=>"string"===i(t),b=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[0-2][1-9]|[1-3]0|3[01])T(?:[01]\d|2[0-3])(?::[0-6]\d){1,2}(?:\.\d{3})?(?:[+-][0-2]\d:[0-5]\d|Z)?$/,x=function(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];switch(t){case"hour":return i?e.getUTCHours():e.getHours();case"day":return i?e.getUTCDate():e.getDate();case"week":return i?e.getUTCDay():e.getDay();case"month":return i?e.getUTCMonth():e.getMonth();case"year":return i?e.getUTCFullYear():e.getFullYear()}},w=(t,e,i,r)=>{!1===t&&e&&(e[i]=r)},_=(t,e,i,r)=>{const s=Math.hypot(i,r);t[e+0]=s,t[e+1]=0,t[e+2]=-s},M=(t,e,i,r,s)=>{const{min:a,max:n}=s,o=4*t;let l=i;for(;l>0&&r[l-1]===r[i];)l-=1;if(i!==l)return null;let h=i;for(;h<3&&r[h+1]===r[i];)h+=1;let d=0,c=0;for(let t=l;t<=h;t++)d+=e[o+t],c+=255;return a+d/c*(n-a)},Z=(t,e,i,r)=>{const{min:s,max:a}=e,n=a-s,o=Math.max(s,Math.min(a,t));let l=Math.round(255*i*(n>0?(o-s)/n:0));if(r){for(let t=0;t<i;t++)r[t]=Math.min(255,l),l=Math.max(0,l-255);return r}const h=[];for(let t=0;t<i;t++){const t=Math.min(255,l);h.push(t),l=Math.max(0,l-255)}return h},A=(t,e)=>{let i=t;for(;i>0&&e[i-1]===e[t];)i-=1;let r=t;for(;r<3&&e[r+1]===e[t];)r+=1;return{firstBand:i,lastBand:r,numBands:r-i+1}},T=[0,0,0,0],R=(t,e,i)=>{const r="avg"===e?Uint16Array:Uint8Array;return{buffer:new r(t),cumulativeBuffer:!1===i?new r(t):null}},G=(t,e,i,r,s,a,n,o,l)=>{const{operation:h,aggregate:d}=t,{v:c,base:u}=o;if(a%4===c)return;const p=e[a]-u,m=e[a+1]-u,g=Math.hypot(p,m),f=3*n,v=s[f+0],y=l===e;switch(h){case"sum":case"avg":i[a]=e[a]+l[a],w(d,r,a,i[a]);break;case"max":(y||g>v)&&_(s,f,p,m);break;case"min":(y||g<v)&&_(s,f,p,m)}i[a]=s[f+1]+u,i[a+1]=s[f+2]+u,w(d,r,a,i[a]),w(d,r,a+1,i[a+1])},S=(t,e,i,r,s,a,n,o,l,h,d,c,u)=>{const{operation:p,shouldRemap:m}=t;switch(p){case"sum":case"avg":m&&s?((t,e,i,r,s,a,n,o,l,h,d)=>{const{dataRange:c,outputDataRange:u,aggregate:p}=t,m=M(a,e,n,t.valueColorBands,c);if(null===m)return;const g=(s[a]||0)+m*d;s[a]=g;const f=Z(g,u,l,T);for(let t=0;t<l;t++){const e=4*a+(o+t);i[e]=f[t],w(p,r,e,f[t])}})(t,e,i,r,s,o,l,h,d,0,u):((t,e,i,r,s,a,n,o,l,h,d,c)=>{const{operation:u,aggregate:p,dataRange:m}=t;if(("sum"===u||"avg"===u)&&s&&h>1){const a=M(o,e,n%4,t.valueColorBands,m);if(null!==a){const t=(s[o]||0)+a*c;s[o]=t;const e=Z(t,m,h,T);for(let t=0;t<h;t++){const s=4*o+(l+t);i[s]=e[t],w(p,r,s,e[t])}return}}let g=a[n]+e[n]*c;if(d&&g>255&&(g=255),i[n]="avg"===u?g:Math.min(g,255),w(p,r,n,i[n]),d&&h>1)for(let t=1;t<h;t++){const s=4*o+(l+t);i[s]=e[s],w(p,r,s,e[s])}})(t,e,i,r,s,a,n,o,h,d,c,u);break;case"max":i[n]=Math.max(e[n]*u,a[n]),w(t.aggregate,r,n,i[n]);break;case"min":i[n]=Math.min(e[n]*u,a[n]),w(t.aggregate,r,n,i[n])}},C=(t,e,i,r,s,a,n,o)=>{const{vectorByBand:l,operationBandByBand:h,bandRangeByBand:d}=e;for(let e=0;e<i.length;e++){const c=e%4,u=Math.floor(e/4),p=l[c];if(p){G(t,i,r,s,n,e,u,p,i);continue}const{firstBand:m,numBands:g}=d[c];if(c===m)if(h[c]&&("sum"===t.operation||"avg"===t.operation)&&a&&g>1){const e=M(u,i,c,t.valueColorBands,t.dataRange);if(null!==e){const i=e*o;a[u]=i;const n=Z(i,t.shouldRemap?t.outputDataRange:t.dataRange,g,T);for(let e=0;e<g;e++){const i=4*u+(m+e);r[i]=n[e],w(t.aggregate,s,i,n[e])}}}else for(let e=0;e<g;e++){const a=4*u+(m+e);r[a]=i[a],w(t.aggregate,s,a,i[a])}}},I=(t,e,i,r,s,a,n,o)=>{const{vectorByBand:l,operationBandByBand:h,bandRangeByBand:d}=e,{valueColorBands:c}=t;for(let e=0;e<i.length;e++){const u=e%4,p=Math.floor(e/4),m=h[u];let g=t.valueMultiplier;!1===(null==m?void 0:m.scaleValue)&&(g=1);const f=u<c.length-2&&c[u]===c[u+1],v=l[u];if(m)if(v)G(t,i,r,s,n,e,p,v,o);else{const{firstBand:n,numBands:l}=d[u];if(u!==n)continue;S(t,i,r,s,a,o,e,p,u,n,l,f,g)}else r[e]=i[e],w(t.aggregate,s,e,i[e]);"avg"!==t.operation&&(r[e]=Math.min(r[e],255),!1===t.aggregate&&s&&(s[e]=Math.min(s[e],255)))}},V=function(t,e,i,a,n,o,l){let h=arguments.length>7&&void 0!==arguments[7]&&arguments[7];const d=Object.keys(e).map(Number).sort(),c=o||{min:0,max:255},u={operation:t,operationBands:i,valueColorBands:a,vectorBands:n,aggregate:h,shouldRemap:!0===("sum"===t&&s(o)&&s(l)),dataRange:c,outputDataRange:l||c,valueMultiplier:1},p=((t,e,i)=>{var r,s;const a=[];for(let e=0;e<4;e++)a.push(A(e,t));const n=[];for(let t=0;t<4;t++){const e=null!==(r=i.find((e=>e.u===t||e.v===t)))&&void 0!==r?r:null;n.push(e)}const o=[];for(let t=0;t<4;t++){const i=null!==(s=e.find((e=>e.band===t)))&&void 0!==s?s:null;o.push(i)}return{vectorByBand:n,operationBandByBand:o,bandRangeByBand:a}})(a,i,n);let m=null,g=null,f=null,v=null,y=null;for(let i=0;i<d.length;i++){const s=d[i],a=e[s];if(r(a))console.warn("[MapsGL] Time series operation, no data found for interval",s);else{if(i>0){const t=s-d[i-1];t>1e3&&(u.valueMultiplier=t/36e5)}if(y||(y=new Float32Array(a.length/4*3)),!1===h){const e=R(a.length,t,h);m=e.buffer,g||(g=e.cumulativeBuffer)}else m||(m=R(a.length,t,h).buffer);if("sum"!==t&&"avg"!==t||f||(f=new Float32Array(a.length/4)),!0===h&&v||!1===h&&i>0){const t=!1===h?g:v;if(r(t))return;I(u,p,a,m,g,f,y,t),!0===h&&(v=m)}else C(u,p,a,m,g,f,y,u.valueMultiplier),!0===h&&(v=m);e[s]=m}}m&&((t,e,i,r)=>{if("avg"===t){for(let t=0;t<e.length;t++)e[t]=Math.round(e[t]/i.length);const t=e instanceof Uint8Array?e:new Uint8Array(e);for(let e=0;e<i.length;e++)r[i[e]]=t}})(t,m,d,e)};class F{constructor(t){this.controller=new AbortController,this._config=t}get signal(){return this.controller.signal}abort(){this.controller.abort()}run(t){return e=this,r=function*(){const{sortedIntervals:e,timeSeriesIntervals:i,maxIntervalsPerChunk:r,operation:s,valueColorBands:a,operationBands:n,vectorBands:o,originalDataRange:l,loadChunk:h}=this._config,{type:d,period:c,aggregate:u,remappedDataRange:p}=s,m=function(t,e){if(0===t.length)return[];if(t.length<=e)return[t];const i=[];for(let r=0;r<t.length;r+=e)i.push(t.slice(r,r+e));return i}(e,r),g=m.map((t=>h(t,this.controller.signal)));let f=0;const v=m.length+(m.length>0?1:0),y=t?g.map((e=>e.then((e=>(f+=1,t(f,v),e))))):g,b=yield Promise.all(y),w={};for(const t of b)for(const[e,i]of Object.entries(t))(null==i?void 0:i.rawData)&&(w[e]=i);const _=[];if("none"===c)_.push(e);else{let t=[],i=null;for(let r=0;r<e.length;r++){const s=e[r],a=x(c,new Date(s));null!==i&&a===i&&r!==e.length-1||(i=a,t.length>0&&_.push(t),t=[]),t.push(s)}t.length>0&&_.push(t)}for(const t of _){const e={};for(const i of t){const t=w[String(i)];(null==t?void 0:t.rawData)&&(e[i]=t.rawData)}V(d,e,n,a,o,l,p,u);for(const i of t){const t=w[String(i)];t&&(t.rawData=e[i])}}const M={};for(const t of Object.keys(w))i.has(Number(t))&&(M[t]=w[t]);return{data:M}},new((i=void 0)||(i=Promise))((function(t,s){function a(t){try{o(r.next(t))}catch(t){s(t)}}function n(t){try{o(r.throw(t))}catch(t){s(t)}}function o(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i((function(t){t(r)}))).then(a,n)}o((r=r.apply(e,[])).next())}));var e,i,r}}const W=["r","g","b","a"],E=t=>W.indexOf(t);function k(t,e){const i=e+273.15;let r=.75;i>271.16&&(r=1.75);let s=10+r*(271.16-i);return s=Math.max(0,Math.min(s,20)),t*s}function z(t,e){return 5===e?1:6===e?t<=-2?.9:t>2?.4:t>=0&&t<=2?Math.max(.5,Math.min(.9,.9-(t+2)/4*.4)):Math.max(.7,Math.min(.9,.9-(t+2)/2*.2)):7===e?t<=0?.65:t>=4?.2:Math.max(.2,Math.min(.65,.65-t/4*.45)):0}function N(t,e,i){if(3!==i&&4!==i&&12!==i||t<=0)return 0;if(e>2||e<-4)return 0;let r=1;return e>=0&&e<=2?r=1-e/2:e<0&&e>=-4&&(r=1+e/Math.abs(-4),r=Math.max(0,Math.min(1,r))),t*r}function Y(t,e,i){if(8!==i||t<=0)return 0;let r=1;return e>=0&&e<=2?r=1-e/2:e<0&&e>=-4&&(r=1+e/Math.abs(-4),r=Math.max(0,Math.min(1,r))),t*r}const L=new Map([["snow",(t,e)=>{const i=t.dimension+2*t.padding,r=.0254*3,s=e[0].dataMax,a=e[2].dataMin,n=e[2].dataMax;for(let e=0;e<i*i;e++){const i=4*e,o=t.rawData[i+1],l=a+t.rawData[i+2]/255*(n-a);let h=k(0+t.rawData[i+0]/255*(s-0),l);h*=z(l,o),h*=3.6,h=(h-0)/(r-0),h=Math.max(0,Math.min(h,1)),h=Math.floor(3*h*255);let d=h;for(let e=0;e<3;e++){const r=Math.min(255,d);t.rawData[i+e]=Math.round(r),d-=r}t.rawData[i+3]=255}}],["ice",(t,e)=>{const i=t.dimension+2*t.padding,r={min:0,max:e[0].dataMax},s=e[2].dataMin,a=e[2].dataMax,n=r;for(let e=0;e<i*i;e++){const i=4*e;let o=N(3600*(r.min+t.rawData[i+0]/255*(r.max-r.min)),s+t.rawData[i+2]/255*(a-s),t.rawData[i+1]);o/=3600,o=(o-n.min)/(n.max-n.min),o=Math.max(0,Math.min(o,1)),o=Math.floor(3*o*255);let l=o;for(let e=0;e<3;e++){const r=Math.min(255,l);t.rawData[i+e]=Math.round(r),l-=r}t.rawData[i+3]=255}}],["sleet",(t,e)=>{const i=t.dimension+2*t.padding,r={min:0,max:e[0].dataMax},s=e[2].dataMin,a=e[2].dataMax,n=r;for(let e=0;e<i*i;e++){const i=4*e;let o=Y(3600*(r.min+t.rawData[i+0]/255*(r.max-r.min)),s+t.rawData[i+2]/255*(a-s),t.rawData[i+1]);o/=3600,o=(o-n.min)/(n.max-n.min),o=Math.max(0,Math.min(o,1)),o=Math.floor(3*o*255);let l=o;for(let e=0;e<3;e++){const r=Math.min(255,l);t.rawData[i+e]=Math.round(r),l-=r}t.rawData[i+3]=255}}],["vpd",(t,e)=>{const i=t.dimension+2*t.padding,r=e[0].dataMin,s=e[0].dataMax,a=e[2].dataMin,n=e[2].dataMax;for(let e=0;e<i*i;e++){const i=4*e,o=a+t.rawData[i+2]/255*(n-a),l=r+t.rawData[i+0]/255*(s-r)+273.15,h=-2836.5744/Math.pow(l,2)-6.028076559*1e3/l+19.54263612-2.737830188*.01*l+1.6261698*1e-5*Math.pow(l,2)+7.0229056e-10*Math.pow(l,3)-18680009e-20*Math.pow(l,4)+2.7150305*Math.log(l);let d=(100-o)/100*Math.exp(h);d/=100,d=(d-0)/70,t.rawData[i+0]=Math.round(255*d),t.rawData[i+1]=0,t.rawData[i+2]=0,t.rawData[i+3]=255}}],["lightning-density",t=>{const e=t.dimension+2*t.padding;for(let i=0;i<e*e;i++){const e=4*i;t.rawData[e+2]=Math.min(255,t.rawData[e+0]+t.rawData[e+1])}}]]);function O(t,e,i,r,s,a,n){let o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:4;if(0===n.width||0===n.height)return e;if(n.width>t.width||n.height>t.height||i>t.width-n.width||r>t.height-n.height)throw new RangeError("[MapsGL] Out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||s>e.width-n.width||a>e.height-n.height)throw new RangeError("[MapsGL] Out of range destination coordinates for image copy");const l=t.data,h=e.data;for(let d=0;d<n.height;d++){const c=((r+d)*t.width+i)*o,u=((a+d)*e.width+s)*o;for(let t=0;t<n.width*o;t++)h[u+t]=l[c+t]}return e}const j=class{get width(){return this.dimension+2*this.padding}get height(){return this.dimension+2*this.padding}constructor(t,e,i=0){this.stride=4,this.padding=0,this._backfilledEdges=new Set,this.padding=i,this.dimension=e;const r=Math.sqrt(t.length/this.stride),s=e+2*i;if(i>0&&r===e){const e={width:r,height:r,data:t},a=function(t,e,i){const{width:r,height:s}=t;if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==r*s*e)throw new RangeError(`mismatched image size. expected: ${i.length} but got: ${r*s*e}`)}else i=new Uint8Array(r*s*e);return{width:r,height:s,data:i}}({width:s,height:s},this.stride);O(e,a,0,0,i,i,{width:r,height:r}),O(e,a,0,0,0,i,{width:i,height:r}),O(e,a,r-i,0,i+r,i,{width:i,height:r}),O(e,a,0,0,i,0,{width:r,height:i}),O(e,a,0,r-i,i,i+r,{width:r,height:i}),O(e,a,0,0,0,0,{width:i,height:i}),O(e,a,r-i,0,i+r,0,{width:i,height:i}),O(e,a,0,r-i,0,i+r,{width:i,height:i}),O(e,a,r-i,r-i,i+r,i+r,{width:i,height:i}),this.rawData=a.data}else this.rawData=t}get(t,e){const i=this.rawData,r=this._idx(t,e);return{r:i[r],g:i[r+1],b:i[r+2],a:i[r+3]}}backfillEdge(t,e,i){!function(t){if(!t)throw new Error(`Assert failed: ${(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||""}`)}(t.dimension===this.dimension,`EncodedData mismatch - neighbor data must have the same dimension as instance data, ${this.dimension} does not equal ${t.dimension}`);const r=`${e},${i}`;if(this._backfilledEdges.has(r))return;const s=this.padding,a=this.dimension+2*s;this._backfilledEdges.add(r);let n=s,o=s,l=s,h=s,d=s,c=s;const u=a-s;-1===e?(n=u-s,l=0):1===e&&(l=u),-1===i?(o=u-s,h=0):1===i&&(h=u),0===e&&(d=a-2*s),0===i&&(c=a-2*s),O({width:a,height:a,data:t.rawData},{width:a,height:a,data:this.rawData},n,o,l,h,{width:d,height:c}),this._backfilledEdges.add(r)}_idx(t,e){const i=this.dimension+2*this.padding;if(t<-1||t>=i+1||e<-1||e>=i+1)throw new RangeError("[MapsGL] Out of range source coordinates for image bitmap");return 4*(e*i+t)}},D=(Math,Math,Math,t=>Math.pow(2,t)),X=(t,e,i,r)=>`${r}:${i}/${t}/${e}`,B=t=>X(t.x,t.y,t.z,0),P=(t,e)=>(t%e+e)%e;class H{get hash(){return X(this.x,this.y,this.z,this.wrap)}get wrap(){const t=Math.pow(2,this.z);return Math.floor(this.x/t)}get isRoot(){return 0===this.z}constructor(t,e,i){this.x=e,this.y=i,this.z=t}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}normalize(){const t=Math.pow(2,this.z);return new H(this.z,P(this.x,t),P(this.y,t))}getAncestor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;const e=Math.pow(2,t);return new H(this.z-t,Math.floor(this.x/e),Math.floor(this.y/e))}getDescendants(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;const e=Math.pow(2,t),i=Array.from({length:e*e});for(let r=0;r<e;r++){const s=r*e;for(let a=0;a<e;a++)i[s+a]=new H(this.z+t,this.x*e+r,this.y*e+a)}return i}getNeighbor(t,e){const{x:i,y:r,z:s,wrap:a}=this,n=Math.pow(2,s);let o=0,l=0,h=0;return 0===s?(o=i,h=a+t):(o=i+t,l=r+e,h=i+t<0?a-1:i+t>n?a+1:a),l<0||l>=n?null:new H(s,o,l)}getNeighbors(){const[t,e,i,r,s,a]=[-1,0,1,-1,0,1];return{tl:this.getNeighbor(t,r),tc:this.getNeighbor(e,r),tr:this.getNeighbor(i,r),ml:this.getNeighbor(t,s),mc:this,mr:this.getNeighbor(i,s),bl:this.getNeighbor(t,a),bc:this.getNeighbor(e,a),br:this.getNeighbor(i,a)}}getQuadrant(){return[this.x%2,this.y%2]}isAncestorOf(t){if(this.z>=t.z)return!1;const e=Math.pow(2,t.z-this.z),i=Math.floor(t.x/e),r=Math.floor(t.y/e);return this.x===i&&this.y===r}isDescendantOf(t){return t.isAncestorOf(this)}getPosition(){const t=D(this.z);return{x:this.x/t,y:this.y/t}}getCenter(){const t=D(this.z);return{x:(this.x+.5)/t,y:(this.y+.5)/t}}toString(){return`TileCoord: ${this.z}/${this.x}/${this.y}, wrap: ${this.wrap}`}toInfo(){return{z:this.z,x:this.x,y:this.y}}static fromHash(t){const e=(t||"").replace(/^\d+:/,"").split("/").map((t=>Number.parseInt(t,10)));return new H(e[0],e[1],e[2])}}const U=H,Q=class{constructor(t,e){this.type=t,(t=>s(t)&&"object"===i(t)?Object.getOwnPropertyNames(t):[])(e=Object.assign({},e)).forEach((t=>{this[t]=e[t]}))}},K=t=>"object"==typeof t&&"type"in t,J=class{constructor({validEventTypes:t=[/.*/],triggerLastEvent:e=!1}={}){this.callbacks={},this.lastEvents={},this.validEventTypes=t,this.triggerLastEvent=e,this.callbackContext=this}setCallbackContext(t){return this.callbackContext=t,this}on(t,e,i,r){if(y(t)&&/\s+/.test(t))return t.split(" ").forEach((t=>{this.on(t,e,i,r)})),this;if(this.validateEventType(t),this.hasListener(t)||(this.callbacks[t]=new Set),this.callbacks[t].add({callback:e,context:r}),(null==i?void 0:i.triggerLastEvent)||this.triggerLastEvent){const i=this.lastEvents[t];i&&e.call(r||this.callbackContext||this,i)}return this}once(t,e,i,r){if(y(t)&&/\s+/.test(t))return t.split(" ").forEach((t=>{this.once(t,e,i,r)})),this;this.validateEventType(t);const s=i=>(this.off(t,s),e.call(r||this.callbackContext||this,i));return this.on(t,s,i,r)}off(t,e){if(y(t)&&/\s+/.test(t))return t.split(" ").forEach((t=>{this.off(t,e)})),this;if(this.validateEventType(t),!this.hasCallbacks(t))return this;if(!e)return delete this.callbacks[t],this;for(const i of this.callbacks[t])if(i.callback===e){this.callbacks[t].delete(i);break}return this}trigger(t,e){const i=K(t)?t:new Q(t,e||{}),r=K(t)?t.type:t;i.target=this,this.validateEventType(r),this.lastEvents[r]=i;const s=this.callbacksForEvent(r);if(s)return[...s].map((({callback:t,context:e})=>t.call(e||this.callbackContext||this,i)))}hasListener(t){return t in this.callbacks}clearListeners(){return this.callbacks={},this}addEventListener(t,e,i,r){return this.on(t,e,i)}removeEventListener(t,e,i){return this.off(t,e)}dispatchEvent(t,e){return this.trigger(t,e)}validateEventType(t){if(!this.isValidEvent(t)){const e=this.validEventTypes.join("|");throw new Error(`Invalid event type {${t}}.\nEvent type should be any of: ${e}.`)}}isValidEvent(t){const e=Array.isArray(t)?t:[t];let i=0;for(const r of e)for(const s of this.validEventTypes)if((s instanceof RegExp?s.test(r):t===s)&&(i+=1,i===e.length))return!0;return!1}hasCallbacks(t){return t in this.callbacks}callbacksForEvent(t){return this.callbacks[t]}},q=new Date(Date.UTC(1970,0,1));class ${constructor(t,e,i,r){this.value=t,this.list=r,e?(e.next=this,this.prev=e):this.prev=void 0,i?(i.prev=this,this.next=i):this.next=void 0}}const tt=class{constructor(){this._head=void 0,this._tail=void 0}*items(){let t=this._head||this._tail;for(;t;)yield t,t=t.next}get size(){let t=0;return this.forEach((e=>t+=1)),t}get head(){return this._head}get tail(){return this._tail}push(t){const e=new $(t,this._tail,void 0,this);return this._tail=e,this._head||(this._head=e),e}unshift(t){const e=new $(t,void 0,this._head,this);return this._head=e,this._tail||(this._tail=e),e}pop(){if(!this._tail)return;const t=this._tail;return this._tail=t.prev,this._tail?this._tail.next=void 0:this._head=void 0,t.value}shift(){if(!this._head)return;const t=this._head;return this._head=t.next,this._head?this._head.prev=void 0:this._tail=void 0,t.value}find(t){if(this.isEmpty())return;let e=this._head;for(;e;){if(t(e.value))return e;e=e.next}}isEmpty(){return!this._head}forEach(t){let e=this._head||this._tail;for(let i=0;null!==e;i++)t(e.value,i),e=e.next}pushNode(t){if(t===this._tail)return;t.list&&t.list.removeNode(t);const e=this._tail;t.list=this,t.prev=e,e&&(e.next=t),this._tail=t,this._head||(this._head=t)}unshiftNode(t){if(t===this._head)return;t.list&&t.list.removeNode(t);const e=this._head;t.list=this,t.next=e,e&&(e.prev=t),this._head=t,this._tail||(this._tail=t)}removeNode(t){if(t.list!==this)throw new Error("Removing list node which does not belong to this list.");const e=t.next,i=t.prev;e&&(e.prev=i),i&&(i.next=e),t===this._head&&(this._head=e),t===this._tail&&(this._tail=i),this._head&&(this._head.prev=void 0),this._tail&&(this._tail.next=void 0),t.next=void 0,t.prev=void 0,t.list=void 0}delete(t){let e=!1;for(;this._head&&this._head.value===t;)e=!0,this._head=this._head.next;return e}clear(){this._head=void 0,this._tail=void 0}},et=class{get size(){return this._cache.size}get cache(){return this._cache}get first(){return this._list.head.value.val}get last(){return this._list.tail.value.val}*keys(){for(const t of this._list.items())yield t.value.key}*values(){for(const t of this._list.items())yield t.value.val}*entries(){for(const t of this._list.items()){const e={key:t.value.key,val:t.value.val};yield e}}constructor({capacity:t=200,ttl:e=0,onRemove:i=(()=>{})}={}){this.capacity=20,this._ttl=0,this._cache=new Map,this._list=new tt,this.capacity=Math.max(1,t||256),this._ttl=e,this._onRemove=i}has(t){return this._cache.has(t)}get(t){const e=this._cache.get(t);if(e){if(!this._isExpired(e.value))return this._bumpAge(e.value),e.value.val;this.delete(e.value.key)}}peek(t){const e=this._cache.get(t);if(e)return e.value.val}set(t,e){const i=this._cache.get(t);if(i){const t=i.value;return t.val!==e&&(this._onRemove(t.key,t.val),t.val=e),void this._bumpAge(t)}const r={key:t,val:e,exp:Date.now()+this._ttl,node:void 0},s=this._list.unshift(r);if(this._cache.set(t,s),r.node=s,this._cache.size>this.capacity){const t=this._list.pop();this.delete(t.key)}}delete(t){const e=this._cache.get(t);if(!e)return;const i=e.value;return this._onRemove(i.key,i.val),this._cache.delete(t),this._list.removeNode(e),i.val}clear(){this.forEach((t=>{this._onRemove(t.key,t.val)})),this._cache.clear(),this._list.clear()}forEach(t){if(m(t))for(const[e,i]of this._cache)t(i.value)}_bumpAge(t){t.exp=Date.now()+this._ttl,this._list.unshiftNode(t.node)}_isExpired(t){return this._ttl>0&&t.exp<Date.now()}};class it{constructor(){this._total=0,this._completed=0,this._failed=0,this._cancelled=0}get total(){return this._total}get completed(){return this._completed}get failed(){return this._failed}get cancelled(){return this._cancelled}get progress(){return 0===this._total?0:(this._completed+this._failed+this._cancelled)/this._total}get remaining(){return this._total-this._completed-this._failed-this._cancelled}get isComplete(){return 1===this.progress}get isFailed(){return this._failed>0}incrementTotal(){this._total+=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1}decrementTotal(){0!==this._total&&(this._total-=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,this._total<0&&(this._total=0))}incrementCompleted(){0!==this._total&&(this._completed+=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1)}incrementFailed(){0!==this._total&&(this._failed+=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1)}incrementCancelled(){0!==this._total&&(this._cancelled+=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1)}set(t){this._total=t.total,this._completed=t.completed,this._failed=t.failed,this._cancelled=t.cancelled}reset(){this._completed=0,this._failed=0,this._cancelled=0,this._total=0}serialized(){return{total:this._total,completed:this._completed,failed:this._failed,cancelled:this._cancelled,progress:this.progress}}static from(t){return t.reduce(((t,e)=>(t.incrementTotal(e.total),t.incrementCompleted(e.completed),t.incrementFailed(e.failed),t.incrementCancelled(e.cancelled),t)),new it)}}const rt=it,st="load:progress";class at{constructor(){this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}}const nt="pending",ot="in-flight",lt="success",ht="failed",dt="cancelled",ct=class{get promise(){return this.deferred.promise}constructor(t,e,i,r){this.controller=new AbortController,this.status=nt,this.retries=0,this.deferred=new at,this.key=t,this.url=e,this.options=i,this.priority=null!=r?r:2}getResponseResult(t){return e=this,r=function*(){if(t instanceof Response==0)return t;const e=t.headers.get("content-type");let i,r=this.resultType;if(!r&&e&&(r=function(){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(";")[0].trim();switch(t){case"image/jpeg":case"image/png":return"blob";case"application/json":return"json";case"application/octet-stream":return"arrayBuffer";case"text/plain":return"text";default:throw new Error(`Unsupported result type: ${t}`)}}(e)),t instanceof Response)switch(r){case"blob":i=yield t.blob();break;case"json":i=yield t.json();break;case"arrayBuffer":i=yield t.arrayBuffer();break;case"text":i=yield t.text();break;default:throw new Error(`Unsupported result type: ${this.resultType}`)}else i=t;return i},new((i=void 0)||(i=Promise))((function(t,s){function a(t){try{o(r.next(t))}catch(t){s(t)}}function n(t){try{o(r.throw(t))}catch(t){s(t)}}function o(e){var r;e.done?t(e.value):(r=e.value,r instanceof i?r:new i((function(t){t(r)}))).then(a,n)}o((r=r.apply(e,[])).next())}));var e,i,r}};var ut=function(t,e,i,r){return new(i||(i=Promise))((function(s,a){function n(t){try{l(r.next(t))}catch(t){a(t)}}function o(t){try{l(r.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,o)}l((r=r.apply(t,e||[])).next())}))};const pt=class extends J{get progress(){return this.updateProgressFromStates(),this._progress}constructor(t={}){var e,i,r;super(),this.maxRetries=0,this.retryStatusRange=[500,599],this.tasks=new Map,this._progress=new rt,this.pendingByHost=new Map,this.inFlightByHost=new Map,this.taskStates=new Map,this.enqueuedTaskKeys=new Set,this._totalTasks=0,this.taskRunner=null!==(e=t.taskRunner)&&void 0!==e?e:(t,e)=>{const{method:i="GET",body:r,headers:s,signal:n}=t.options;try{return fetch(t.url,{method:i,headers:s,body:"POST"===i&&a(r)?JSON.stringify(r):void 0,signal:n}).then(v)}catch(t){throw console.error("TileRequestManager Error",t),t}},this.cache=new et,this.defaultConcurrency=null!==(i=t.defaultConcurrency)&&void 0!==i?i:16,this.perHostConcurrency=null!==(r=t.perHostConcurrency)&&void 0!==r?r:{}}has(t){return this.cache.has(t)}get(t){return this.cache.get(t)}getTask(t){return this.tasks.get(t)}setTaskRunner(t){this.taskRunner=t}setTaskTransformer(t){this.taskTransformer=t}find(t){const e=[];return this.tasks.forEach((i=>{t(i)&&e.push(i)})),e}findOne(t){for(const e of this.tasks.values())if(t(e))return e}hasTask(t){for(const e of this.tasks.values())if(t(e))return!0;return!1}enqueue(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var i,r;const s=null!==(i=t.host)&&void 0!==i?i:"default",a=null!==(r=this.pendingByHost.get(s))&&void 0!==r?r:[];this.insertTaskByPriority(a,t),this.tasks.set(t.key,t),this.pendingByHost.set(s,a),this.enqueuedTaskKeys.has(t.key)?this.taskStates.set(t.key,nt):(this.enqueuedTaskKeys.add(t.key),this.taskStates.set(t.key,t.status)),1===this.enqueuedTaskKeys.size&&this.trigger("load:start"),this.updateProgressFromStates(),this.trigger(st,{progress:this._progress.serialized()}),e&&this.run()}abort(t){var e,i,r;const s=null!==(e=t.host)&&void 0!==e?e:"default",a=null!==(i=this.pendingByHost.get(s))&&void 0!==i?i:[],n=a.indexOf(t);n>-1&&a.splice(n,1),this.pendingByHost.set(s,a),(null!==(r=this.inFlightByHost.get(s))&&void 0!==r?r:[]).includes(t)||t.status===ot?t.controller.abort():t.status===nt&&this.tasks.delete(t.key),t.status=dt,this.taskStates.set(t.key,dt),this.updateProgressFromStates(),this.trigger(st,{progress:this._progress.serialized()})}abortWhere(t){for(const e of this.tasks.values())t(e)&&this.abort(e)}abortAll(){this.tasks.forEach((t=>{this.abort(t)}))}run(){this.pendingByHost.forEach(((t,e)=>{this.runHost(e)}))}runHost(t){var e,i;const r=null!==(e=this.pendingByHost.get(t))&&void 0!==e?e:[];for(;r.length>0&&(null!==(i=this.inFlightByHost.get(t))&&void 0!==i?i:[]).length<6;){const t=r.shift();t&&this.runTask(t)}this.pendingByHost.set(t,r)}insertTaskByPriority(t,e){let i=t.length;for(let r=0;r<t.length;r++)if(t[r].priority>e.priority){i=r;break}t.splice(i,0,e)}runTask(t){return ut(this,void 0,void 0,(function*(){var e,i;if(!this.taskRunner)throw new Error("[MapsGL] Task runner not set for DownloadManager");const r=null!==(e=t.host)&&void 0!==e?e:"default",s=t.options.authenticator;t.status=ot,this.taskStates.set(t.key,ot);const a=null!==(i=this.inFlightByHost.get(r))&&void 0!==i?i:[];a.push(t),this.inFlightByHost.set(r,a),this.taskRunner(t,{maxRetries:this.maxRetries,retryStatusRange:this.retryStatusRange,taskTransformer:this.taskTransformer}).then((e=>ut(this,void 0,void 0,(function*(){if(e){if(s&&401===e.status){if(yield s.authenticate(),!this.taskRunner)throw new Error("[MapsGL] Task runner not set for DownloadManager");return this.taskRunner(t,{maxRetries:this.maxRetries,retryStatusRange:this.retryStatusRange,taskTransformer:this.taskTransformer})}if(t.status!==dt){const i=yield t.getResponseResult(e);t.status=lt,t.deferred.resolve({data:i,headers:e.headers})}}else t.status!==dt&&(t.status=ht,t.deferred.reject(new Error("[MapsGL] No response for tile request")))})))).catch((e=>{var i,r,s;if(t.controller.signal.aborted)return;const a=null!==(s=null!==(i=null==e?void 0:e.status)&&void 0!==i?i:null===(r=null==e?void 0:e.response)||void 0===r?void 0:r.status)&&void 0!==s?s:0;(0===a||function(t,e){return Number.isFinite(t)&&t>=e[0]&&t<=e[1]}(a,this.retryStatusRange))&&t.retries<this.maxRetries?(t.retries+=1,t.status=nt,setTimeout((()=>{this.enqueue(t,!0,!0)}),100*(t.retries+1))):(t.status=ht,t.deferred.reject(e))})).finally((()=>{const e=a.indexOf(t);e>-1&&a.splice(e,1),0===a.length?this.inFlightByHost.delete(r):this.inFlightByHost.set(r,a),t.status!==lt&&t.status!==ht&&t.status!==dt||this.taskStates.set(t.key,t.status),this.updateProgressFromStates(),this.trigger(st,{progress:this._progress.serialized()}),this.tasks.delete(t.key),0===this.tasks.size&&(this.trigger("load:complete"),this.clearTaskStates()),this.tasks.get(t.key)||this.tasks.delete(t.key),this.run()}))}))}updateProgressFromStates(){let t=0,e=0,i=0;this.taskStates.forEach((r=>{switch(r){case lt:t+=1;break;case ht:e+=1;break;case dt:i+=1}})),this._progress.set({total:this.enqueuedTaskKeys.size,completed:t,failed:e,cancelled:i})}clearTaskStates(){this.taskStates.clear(),this.enqueuedTaskKeys.clear(),this._progress.reset()}},mt=class extends ct{constructor(t,e,i,r,s,a){var n;s.intervals=null!==(n=null==i?void 0:i.map((t=>new Date(t))))&&void 0!==n?n:[],super(t,r,s,a),this.loadRequestId=0,this.coord=e,this.intervals=i}};var gt=function(t,e,i,r){return new(i||(i=Promise))((function(s,a){function n(t){try{l(r.next(t))}catch(t){a(t)}}function o(t){try{l(r.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(n,o)}l((r=r.apply(t,e||[])).next())}))};class ft extends mt{constructor(t,e,i,r,s,a,n){super(t,e,i,r,s,a),this.tileInfo=n,this.resultType="blob"}}const vt=class{constructor(t){this._runners={},this._runnerProgress=new rt,this._customFetcher=t;const e=this._customFetcher?t=>this._customFetcher(t.url,t.tileInfo,t.options):t=>{const{method:e="GET",body:i,headers:r,signal:s}=t.options;return fetch(t.url,{method:e,body:"POST"===e&&null!=i?"string"==typeof i?i:JSON.stringify(i):void 0,headers:r,signal:s}).then(v)};this._downloadManager=new pt({fetcher:e,taskRunner:(t,i)=>gt(this,void 0,void 0,(function*(){return e(t)})),defaultConcurrency:16})}setProgressHandler(t){this._onProgressHandler&&this._downloadManager.off(st,this._onProgressHandler),this._onProgressHandler=e=>{const i=e.progress;null==t||t(Object.assign(Object.assign({},i),{total:i.total+this._runnerProgress.total,completed:i.completed+this._runnerProgress.completed}))},this._downloadManager.on(st,this._onProgressHandler)}loadTile(t,e){var i,r;const{tile:{info:s}}=t,a=t.request,{url:n}=a,o=function(t,e){var i={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(i[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(t);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(t,r[s])&&(i[r[s]]=t[r[s]])}return i}(a,["url"]),l=new U(s.z,s.x,s.y),h=function(t){return(null==t?void 0:t.length)?t.map((t=>t instanceof Date?t.getTime():"number"==typeof t?t:new Date(t).getTime())):[]}(null==o?void 0:o.intervals),d=function(t,e){return(null==e?void 0:e.length)?`${t}::${e.map((t=>t instanceof Date?t.getTime():"number"==typeof t?t:new Date(t).getTime())).join(",")}`:t}(l.hash,null==o?void 0:o.intervals),c=null!==(i=null==o?void 0:o.priority)&&void 0!==i?i:0;let u=this._downloadManager.findOne((t=>t.key===d));return u=new ft(d,l,h,n,o,c,s),u.host=function(t){var e;try{return null!==(e=new URL(t).host)&&void 0!==e?e:"default"}catch(t){return"default"}}(n),u.options.signal=null!==(r=null==o?void 0:o.signal)&&void 0!==r?r:u.controller.signal,this._downloadManager.enqueue(u),u.promise.then((e=>{let{data:i,headers:r}=e;return this.parseTile(t.source,s,i,r)}))}parseTile(t,e,s,a){return(()=>gt(this,void 0,void 0,(function*(){var n,o;try{const l=(null==a?void 0:a.get("content-type"))||"";let h,c=s;if(!/image\/(png|jpeg|webp|gif)/i.test(l))try{const t=yield s.arrayBuffer();c=new Blob([t],{type:"image/png"})}catch(t){}try{h=yield createImageBitmap(c,{premultiplyAlpha:"none",colorSpaceConversion:"none"})}catch(t){try{const t=yield c.arrayBuffer(),e=new Blob([t],{type:"image/png"});h=yield createImageBitmap(e,{premultiplyAlpha:"none",colorSpaceConversion:"none"})}catch(e){throw console.error("[MapsGL] createImageBitmap failed",{firstErr:(null==t?void 0:t.message)||t,secondErr:(null==e?void 0:e.message)||e,size:s.size,headerContentType:l}),e}}let u=[q];const p=null==a?void 0:a.get("x-data-set-locs");if(p){const e=((t,e)=>{const i=JSON.parse(t);return{layout:{columns:0,rows:0,size:{width:0,height:0}},datasets:null==e?void 0:e.map(((t,e)=>{const{id:r,dataMin:s,dataMax:a,outputMin:n=0,outputMax:o=255,outputNoDataValue:l}=t,{animDir:h,x:d=0,y:c=0,b:u=0,validTimes:p}=i[e]||{};return{id:r,dataMin:s,dataMax:a,outputMin:n,outputMax:o,outputNoDataValue:l,maxZoom:-1,degreesPerPixel:{x:-1,y:-1},column:d,row:c,band:u,layout:"H"===h?"horizontal":"vertical",validTimes:null==p?void 0:p.map((t=>new Date(t)))}}))}})(p,t.datasets);(null==e?void 0:e.datasets)&&(u=function(){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map((e=>function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(y(t)&&b.test(t))return(t=>{const e=t.split(/\D+/),i=t.includes("+")?-1:1;return new Date(Date.UTC(+e[0],+e[1]-1,+e[2],+e[3]+i*(+e[7]||0),+e[4]+i*(+e[8]||0),+e[5],+e[6]||0))})(t);if(y(t)||(t=>"number"===i(t))(t)){const i=new Date(t);return e?(r=i,new Date(r.getTime()+60*r.getTimezoneOffset()*1e3)):i}var r;return(t=>"date"===i(t))(t)?t:null}(e,t)));return e?r.sort(((t,e)=>t.getTime()<e.getTime()?-1:1)).filter(Boolean):r.filter(Boolean)}(e.datasets[0].validTimes,!0,!1))}if("undefined"==typeof OffscreenCanvas)return{image:h,validTimes:u};let g;if(t.transformerId){const e=L.get(t.transformerId);e?g=i=>e(i,t.datasets):console.warn(`[MapsGL] Unknown tile transformer ID "${t.transformerId}"`)}else if(t.transformer){console.warn("[MapsGL] Using a serialized `transformTileData` function is deprecated. Register the transformer in `workers/transformers/` and use `transformerId` instead.");try{const e=JSON.parse(t.transformer,d);m(e)&&(g=i=>e(i,t.datasets))}catch(e){console.error("[MapsGL] Failed to deserialize tile transformer",{error:null==e?void 0:e.message,transformerLength:null===(n=t.transformer)||void 0===n?void 0:n.length,transformerSnippet:null===(o=t.transformer)||void 0===o?void 0:o.slice(0,200)})}}const f=((t,e,i,s)=>{var a;if(r(e))return console.warn("[MapsGL] Invalid raster grid array image",e),{data:{}};if(e.width%t.width!=0||e.height%t.height!=0)return console.warn("[MapsGL] Invalid raster grid array image size, does not match tile size",e.width,e.height,t),{data:{}};const n=e.height,o=Math.floor(e.width/t.width),l=(Math.floor(n/t.height),{}),h="undefined"!=typeof OffscreenCanvas;if((null==i?void 0:i.length)===o){const r=h?new OffscreenCanvas(t.width,t.height):window.document.createElement("canvas");r.width=t.width,r.height=t.height;const n=r.getContext("2d",{alpha:!0,willReadFrequently:!0,colorSpace:"srgb"});n.imageSmoothingEnabled=!1;for(let h=0;h<o;h++){const o=i[h].getTime();n.clearRect(0,0,r.width,r.height),n.drawImage(e,h*t.width,0,t.width,t.height,0,0,r.width,r.height);const d=null===(a=n.getImageData(0,0,r.width,r.height))||void 0===a?void 0:a.data,c=new j(d,r.width,8);m(s)&&s(c),l[o]={rawData:c.rawData,dimension:c.dimension,padding:c.padding}}}return{data:l}})(e.size,h,u,g);return f}catch(t){console.error(`[MapsGL] Error parsing encoded raster tile - ${null==t?void 0:t.message}`)}})))()}abortTile(t){const e=B(t);console.warn("abortTile",e),this._downloadManager.abortWhere((t=>t.key===e||t.key.startsWith(`${e}::`)));const i=this._runners[e];return i&&(i.forEach((t=>t.abort())),delete this._runners[e]),Promise.resolve()}aggregate(t,e,i,r){var s,a,n,o,l,h,d,c,u,p;const{bands:m=["r","g","b"]}=t,{tile:{info:v},source:{validTimes:y,datasets:b,effectiveDatasets:x},request:{body:w}}=e,_=B(v),M=y.map((t=>(t instanceof Date?t:new Date(t)).getTime())).sort(((t,e)=>t-e)),Z=new Set(y.map((t=>(t instanceof Date?t:new Date(t)).getTime()))),A=Math.floor(25/(null!==(s=null==b?void 0:b.length)&&void 0!==s?s:1)),T=[];null==x||x.forEach(((t,e)=>{const i=W[e%W.length];T.push(e>0&&t.id===x[e-1].id?T.at(-1):i)}));const R=m.map(((t,e)=>{const i=null==x?void 0:x[e];return i?{band:E(t),scaleValue:/RATE/.test(i.id)}:void 0})).filter((t=>void 0!==t)),G=function(){const t=[],e={u:-1,v:-1,base:127.5};return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach(((t,i)=>{const{id:r,dataMin:s,dataMax:a}=t;var n;/UGRD/.test(r)?(e.u=i,e.base=255*(.5*s+.5*a-(n=s))/(a-n)+0):/VGRD/.test(r)&&(e.v=i)})),e.u>=0&&e.v>=0&&t.push(e),t}(null===(a=e.source)||void 0===a?void 0:a.datasets);let S;if((null==x?void 0:x.length)>0&&R.length>0){const t=null!==(o=null===(n=R[0])||void 0===n?void 0:n.band)&&void 0!==o?o:0,e=null!==(h=null===(l=R.at(-1))||void 0===l?void 0:l.band)&&void 0!==h?h:0;S={min:null!==(c=null===(d=x[t])||void 0===d?void 0:d.dataMin)&&void 0!==c?c:0,max:null!==(p=null===(u=x[e])||void 0===u?void 0:u.dataMax)&&void 0!==p?p:0}}const C=w?JSON.parse(w):[],I=new F({sortedIntervals:M,timeSeriesIntervals:Z,maxIntervalsPerChunk:A,operation:t,valueColorBands:T,operationBands:R,vectorBands:G,originalDataRange:S,loadChunk:t=>gt(this,void 0,void 0,(function*(){var r;const s=Array.isArray(C)?C.map((e=>Object.assign(Object.assign({},e),{validTimes:t.map((t=>new Date(t).toISOString()))}))):C,a=yield this.loadTile(((...t)=>{if(t.length<2)throw new Error("deepMerge: this function expects at least 2 objects to be provided");if(t.some((t=>!g(t))))throw new Error('deepMerge: all values should be of type "object"');const e=t.shift();let i;for(;i=t.shift();)f(e,i);return e})({},e,{request:{body:JSON.stringify(s),intervals:t}}),i);return null!==(r=null==a?void 0:a.data)&&void 0!==r?r:{}}))});return this._runners[_]||(this._runners[_]=[]),this._runners[_].push(I.controller),this._runnerProgress.incrementTotal(1),I.run().finally((()=>{this._runners[_]&&(this._runners[_]=this._runners[_].filter((t=>t!==I.controller)),0===this._runners[_].length&&delete this._runners[_]),this._runnerProgress.incrementCompleted(1),null==r||r(Object.assign(Object.assign({},this._downloadManager.progress.serialized()),{total:this._downloadManager.progress.total+this._runnerProgress.total,completed:this._downloadManager.progress.completed+this._runnerProgress.completed})),this._runnerProgress.completed===this._runnerProgress.total&&this._runnerProgress.reset()}))}};let yt;const bt=new class{constructor(t){this._resolveRejects={},this.worker=t,this.worker.addEventListener("message",this.receive.bind(this))}send(t){const e=Math.round(1e18*Math.random()).toString(36).slice(0,10);return new Promise(((i,r)=>{this._resolveRejects[e]={resolve:i,reject:r},this.worker.postMessage(Object.assign({id:e},t))}))}receive(t){const{id:e,data:i,error:r}=t.data,s=this._resolveRejects[e];s&&(r?s.reject(r):s.resolve(i),delete this._resolveRejects[e])}abort(){this.worker.terminate()}}(self);return onmessage=t=>{var e;const i=t.data||{},{id:r,data:s}=i;if("__mapsgl_init"===i.type)return void(l=i.sessionToken);if(!s)return;const n=t=>{postMessage({type:"tileLoadProgress",data:{progress:t}})};if(yt||(yt=new vt,yt.setProgressHandler(n)),"loadTile"===s.command){const t=null===(e=s.source)||void 0===e?void 0:e.operation,i=a(t)&&"none"!==t.type;(null==s?void 0:s.tile)&&(i?yt.aggregate(t,s,bt,n):yt.loadTile(s,bt)).then((t=>{const e=[],i=p(t,e);postMessage({id:r,data:i},void 0,e)})).catch((t=>{var e,i;let s=null!==(e=null==t?void 0:t.name)&&void 0!==e?e:"EncodedTileWorkerError";const a={code:0,message:void 0};t instanceof u?(s="InvalidResponseError",a.code=t.response.status,a.message=t.response.statusText):t instanceof c&&(s="UnauthorizedError",a.code=401,a.message="Unauthorized"),postMessage({id:r,status:a,error:`${s}: ${null!==(i=null==t?void 0:t.message)&&void 0!==i?i:t}`})}))}else"abortTile"===s.command&&(null==s?void 0:s.tile)&&yt.abortTile(s.tile.info)},e})())),r((()=>(()=>{var t={4748:t=>{function e(t,e){this.x=t,this.y=e}t.exports=e,e.prototype={clone:function(){return new e(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),i=Math.sin(t),r=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=r,this},_rotateAround:function(t,e){var i=Math.cos(t),r=Math.sin(t),s=e.y+r*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-r*(this.y-e.y),this.y=s,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},e.convert=function(t){return t instanceof e?t:Array.isArray(t)?new e(t[0],t[1]):t}},4537:(t,e,i)=>{i(7054),t.exports.VectorTileFeature=i(1110),i(6241)},7054:(t,e,i)=>{var r=i(6241);function s(t,e,i){if(3===t){var s=new r(i,i.readVarint()+i.pos);s.length&&(e[s.name]=s)}}t.exports=function(t,e){this.layers=t.readFields(s,{},e)}},1110:(t,e,i)=>{var r=i(4748);function s(t,e,i,r,s){this.properties={},this.extent=i,this.type=0,this._pbf=t,this._geometry=-1,this._keys=r,this._values=s,t.readFields(a,this,e)}function a(t,e,i){1==t?e.id=i.readVarint():2==t?function(t,e){for(var i=t.readVarint()+t.pos;t.pos<i;){var r=e._keys[t.readVarint()],s=e._values[t.readVarint()];e.properties[r]=s}}(i,e):3==t?e.type=i.readVarint():4==t&&(e._geometry=i.pos)}function n(t){for(var e,i,r=0,s=0,a=t.length,n=a-1;s<a;n=s++)r+=((i=t[n]).x-(e=t[s]).x)*(e.y+i.y);return r}t.exports=s,s.types=["Unknown","Point","LineString","Polygon"],s.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,i=t.readVarint()+t.pos,s=1,a=0,n=0,o=0,l=[];t.pos<i;){if(a<=0){var h=t.readVarint();s=7&h,a=h>>3}if(a--,1===s||2===s)n+=t.readSVarint(),o+=t.readSVarint(),1===s&&(e&&l.push(e),e=[]),e.push(new r(n,o));else{if(7!==s)throw new Error("unknown command "+s);e&&e.push(e[0].clone())}}return e&&l.push(e),l},s.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,i=1,r=0,s=0,a=0,n=1/0,o=-1/0,l=1/0,h=-1/0;t.pos<e;){if(r<=0){var d=t.readVarint();i=7&d,r=d>>3}if(r--,1===i||2===i)(s+=t.readSVarint())<n&&(n=s),s>o&&(o=s),(a+=t.readSVarint())<l&&(l=a),a>h&&(h=a);else if(7!==i)throw new Error("unknown command "+i)}return[n,l,o,h]},s.prototype.toGeoJSON=function(t,e,i){var r,a,o=this.extent*Math.pow(2,i),l=this.extent*t,h=this.extent*e,d=this.loadGeometry(),c=s.types[this.type];function u(t){for(var e=0;e<t.length;e++){var i=t[e];t[e]=[360*(i.x+l)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(i.y+h)/o)*Math.PI/180))-90]}}switch(this.type){case 1:var p=[];for(r=0;r<d.length;r++)p[r]=d[r][0];u(d=p);break;case 2:for(r=0;r<d.length;r++)u(d[r]);break;case 3:for(d=function(t){var e=t.length;if(e<=1)return[t];for(var i,r,s=[],a=0;a<e;a++){var o=n(t[a]);0!==o&&(void 0===r&&(r=o<0),r===o<0?(i&&s.push(i),i=[t[a]]):i.push(t[a]))}return i&&s.push(i),s}(d),r=0;r<d.length;r++)for(a=0;a<d[r].length;a++)u(d[r][a])}1===d.length?d=d[0]:c="Multi"+c;var m={type:"Feature",geometry:{type:c,coordinates:d},properties:this.properties};return"id"in this&&(m.id=this.id),m}},6241:(t,e,i)=>{var r=i(1110);function s(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(a,this,e),this.length=this._features.length}function a(t,e,i){15===t?e.version=i.readVarint():1===t?e.name=i.readString():5===t?e.extent=i.readVarint():2===t?e._features.push(i.pos):3===t?e._keys.push(i.readString()):4===t&&e._values.push(function(t){for(var e=null,i=t.readVarint()+t.pos;t.pos<i;){var r=t.readVarint()>>3;e=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return e}(i))}t.exports=s,s.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new r(this._pbf,e,this.extent,this._keys,this._values)}},6570:t=>{function e(t,e,r){r=r||2;var a,n,o,l,c,u,m,g=e&&e.length,f=g?e[0]*r:t.length,v=i(t,0,f,r,!0),y=[];if(!v||v.next===v.prev)return y;if(g&&(v=function(t,e,r,s){var a,n,o,l=[];for(a=0,n=e.length;a<n;a++)(o=i(t,e[a]*s,a<n-1?e[a+1]*s:t.length,s,!1))===o.next&&(o.steiner=!0),l.push(p(o));for(l.sort(h),a=0;a<l.length;a++)r=d(l[a],r);return r}(t,e,v,r)),t.length>80*r){a=o=t[0],n=l=t[1];for(var b=r;b<f;b+=r)(c=t[b])<a&&(a=c),(u=t[b+1])<n&&(n=u),c>o&&(o=c),u>l&&(l=u);m=0!==(m=Math.max(o-a,l-n))?32767/m:0}return s(v,y,r,a,n,m,0),y}function i(t,e,i,r,s){var a,n;if(s===T(t,e,i,r)>0)for(a=e;a<i;a+=r)n=M(a,t[a],t[a+1],n);else for(a=i-r;a>=e;a-=r)n=M(a,t[a],t[a+1],n);return n&&v(n,n.next)&&(Z(n),n=n.next),n}function r(t,e){if(!t)return t;e||(e=t);var i,r=t;do{if(i=!1,r.steiner||!v(r,r.next)&&0!==f(r.prev,r,r.next))r=r.next;else{if(Z(r),(r=e=r.prev)===r.next)break;i=!0}}while(i||r!==e);return e}function s(t,e,i,h,d,c,p){if(t){!p&&c&&function(t,e,i,r){var s=t;do{0===s.z&&(s.z=u(s.x,s.y,e,i,r)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next}while(s!==t);s.prevZ.nextZ=null,s.prevZ=null,function(t){var e,i,r,s,a,n,o,l,h=1;do{for(i=t,t=null,a=null,n=0;i;){for(n++,r=i,o=0,e=0;e<h&&(o++,r=r.nextZ);e++);for(l=h;o>0||l>0&&r;)0!==o&&(0===l||!r||i.z<=r.z)?(s=i,i=i.nextZ,o--):(s=r,r=r.nextZ,l--),a?a.nextZ=s:t=s,s.prevZ=a,a=s;i=r}a.nextZ=null,h*=2}while(n>1)}(s)}(t,h,d,c);for(var m,g,f=t;t.prev!==t.next;)if(m=t.prev,g=t.next,c?n(t,h,d,c):a(t))e.push(m.i/i|0),e.push(t.i/i|0),e.push(g.i/i|0),Z(t),t=g.next,f=g.next;else if((t=g)===f){p?1===p?s(t=o(r(t),e,i),e,i,h,d,c,2):2===p&&l(t,e,i,h,d,c):s(r(t),e,i,h,d,c,1);break}}}function a(t){var e=t.prev,i=t,r=t.next;if(f(e,i,r)>=0)return!1;for(var s=e.x,a=i.x,n=r.x,o=e.y,l=i.y,h=r.y,d=s<a?s<n?s:n:a<n?a:n,c=o<l?o<h?o:h:l<h?l:h,u=s>a?s>n?s:n:a>n?a:n,p=o>l?o>h?o:h:l>h?l:h,g=r.next;g!==e;){if(g.x>=d&&g.x<=u&&g.y>=c&&g.y<=p&&m(s,o,a,l,n,h,g.x,g.y)&&f(g.prev,g,g.next)>=0)return!1;g=g.next}return!0}function n(t,e,i,r){var s=t.prev,a=t,n=t.next;if(f(s,a,n)>=0)return!1;for(var o=s.x,l=a.x,h=n.x,d=s.y,c=a.y,p=n.y,g=o<l?o<h?o:h:l<h?l:h,v=d<c?d<p?d:p:c<p?c:p,y=o>l?o>h?o:h:l>h?l:h,b=d>c?d>p?d:p:c>p?c:p,x=u(g,v,e,i,r),w=u(y,b,e,i,r),_=t.prevZ,M=t.nextZ;_&&_.z>=x&&M&&M.z<=w;){if(_.x>=g&&_.x<=y&&_.y>=v&&_.y<=b&&_!==s&&_!==n&&m(o,d,l,c,h,p,_.x,_.y)&&f(_.prev,_,_.next)>=0)return!1;if(_=_.prevZ,M.x>=g&&M.x<=y&&M.y>=v&&M.y<=b&&M!==s&&M!==n&&m(o,d,l,c,h,p,M.x,M.y)&&f(M.prev,M,M.next)>=0)return!1;M=M.nextZ}for(;_&&_.z>=x;){if(_.x>=g&&_.x<=y&&_.y>=v&&_.y<=b&&_!==s&&_!==n&&m(o,d,l,c,h,p,_.x,_.y)&&f(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;M&&M.z<=w;){if(M.x>=g&&M.x<=y&&M.y>=v&&M.y<=b&&M!==s&&M!==n&&m(o,d,l,c,h,p,M.x,M.y)&&f(M.prev,M,M.next)>=0)return!1;M=M.nextZ}return!0}function o(t,e,i){var s=t;do{var a=s.prev,n=s.next.next;!v(a,n)&&y(a,s,s.next,n)&&w(a,n)&&w(n,a)&&(e.push(a.i/i|0),e.push(s.i/i|0),e.push(n.i/i|0),Z(s),Z(s.next),s=t=n),s=s.next}while(s!==t);return r(s)}function l(t,e,i,a,n,o){var l=t;do{for(var h=l.next.next;h!==l.prev;){if(l.i!==h.i&&g(l,h)){var d=_(l,h);return l=r(l,l.next),d=r(d,d.next),s(l,e,i,a,n,o,0),void s(d,e,i,a,n,o,0)}h=h.next}l=l.next}while(l!==t)}function h(t,e){return t.x-e.x}function d(t,e){var i=function(t,e){var i,r=e,s=t.x,a=t.y,n=-1/0;do{if(a<=r.y&&a>=r.next.y&&r.next.y!==r.y){var o=r.x+(a-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(o<=s&&o>n&&(n=o,i=r.x<r.next.x?r:r.next,o===s))return i}r=r.next}while(r!==e);if(!i)return null;var l,h=i,d=i.x,u=i.y,p=1/0;r=i;do{s>=r.x&&r.x>=d&&s!==r.x&&m(a<u?s:n,a,d,u,a<u?n:s,a,r.x,r.y)&&(l=Math.abs(a-r.y)/(s-r.x),w(r,t)&&(l<p||l===p&&(r.x>i.x||r.x===i.x&&c(i,r)))&&(i=r,p=l)),r=r.next}while(r!==h);return i}(t,e);if(!i)return e;var s=_(i,t);return r(s,s.next),r(i,i.next)}function c(t,e){return f(t.prev,t,e.prev)<0&&f(e.next,t,t.next)<0}function u(t,e,i,r,s){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*s|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*s|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function m(t,e,i,r,s,a,n,o){return(s-n)*(e-o)>=(t-n)*(a-o)&&(t-n)*(r-o)>=(i-n)*(e-o)&&(i-n)*(a-o)>=(s-n)*(r-o)}function g(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&y(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(w(t,e)&&w(e,t)&&function(t,e){var i=t,r=!1,s=(t.x+e.x)/2,a=(t.y+e.y)/2;do{i.y>a!=i.next.y>a&&i.next.y!==i.y&&s<(i.next.x-i.x)*(a-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)&&(f(t.prev,t,e.prev)||f(t,e.prev,e))||v(t,e)&&f(t.prev,t,t.next)>0&&f(e.prev,e,e.next)>0)}function f(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function v(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,i,r){var s=x(f(t,e,i)),a=x(f(t,e,r)),n=x(f(i,r,t)),o=x(f(i,r,e));return s!==a&&n!==o||!(0!==s||!b(t,i,e))||!(0!==a||!b(t,r,e))||!(0!==n||!b(i,t,r))||!(0!==o||!b(i,e,r))}function b(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function x(t){return t>0?1:t<0?-1:0}function w(t,e){return f(t.prev,t,t.next)<0?f(t,e,t.next)>=0&&f(t,t.prev,e)>=0:f(t,e,t.prev)<0||f(t,t.next,e)<0}function _(t,e){var i=new A(t.i,t.x,t.y),r=new A(e.i,e.x,e.y),s=t.next,a=e.prev;return t.next=e,e.prev=t,i.next=s,s.prev=i,r.next=i,i.prev=r,a.next=r,r.prev=a,r}function M(t,e,i,r){var s=new A(t,e,i);return r?(s.next=r.next,s.prev=r,r.next.prev=s,r.next=s):(s.prev=s,s.next=s),s}function Z(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function A(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function T(t,e,i,r){for(var s=0,a=e,n=i-r;a<i;a+=r)s+=(t[n]-t[a])*(t[a+1]+t[n+1]),n=a;return s}t.exports=e,t.exports.default=e,e.deviation=function(t,e,i,r){var s=e&&e.length,a=Math.abs(T(t,0,s?e[0]*i:t.length,i));if(s)for(var n=0,o=e.length;n<o;n++)a-=Math.abs(T(t,e[n]*i,n<o-1?e[n+1]*i:t.length,i));var l=0;for(n=0;n<r.length;n+=3){var h=r[n]*i,d=r[n+1]*i,c=r[n+2]*i;l+=Math.abs((t[h]-t[c])*(t[d+1]-t[h+1])-(t[h]-t[d])*(t[c+1]-t[h+1]))}return 0===a&&0===l?0:Math.abs((l-a)/a)},e.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},r=0,s=0;s<t.length;s++){for(var a=0;a<t[s].length;a++)for(var n=0;n<e;n++)i.vertices.push(t[s][a][n]);s>0&&i.holes.push(r+=t[s-1].length)}return i}},251:(t,e)=>{
18
18
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
19
- e.read=function(t,e,i,r,s){var a,n,o=8*s-r-1,l=(1<<o)-1,h=l>>1,d=-7,c=i?s-1:0,u=i?-1:1,p=t[e+c];for(c+=u,a=p&(1<<-d)-1,p>>=-d,d+=o;d>0;a=256*a+t[e+c],c+=u,d-=8);for(n=a&(1<<-d)-1,a>>=-d,d+=r;d>0;n=256*n+t[e+c],c+=u,d-=8);if(0===a)a=1-h;else{if(a===l)return n?NaN:1/0*(p?-1:1);n+=Math.pow(2,r),a-=h}return(p?-1:1)*n*Math.pow(2,a-r)},e.write=function(t,e,i,r,s,a){var n,o,l,h=8*a-s-1,d=(1<<h)-1,c=d>>1,u=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:a-1,m=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,n=d):(n=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-n))<1&&(n--,l*=2),(e+=n+c>=1?u/l:u*Math.pow(2,1-c))*l>=2&&(n++,l/=2),n+c>=d?(o=0,n=d):n+c>=1?(o=(e*l-1)*Math.pow(2,s),n+=c):(o=e*Math.pow(2,c-1)*Math.pow(2,s),n=0));s>=8;t[i+p]=255&o,p+=m,o/=256,s-=8);for(n=n<<s|o,h+=s;h>0;t[i+p]=255&n,p+=m,n/=256,h-=8);t[i+p-m]|=128*g}},5335:(t,e,i)=>{t.exports=s;var r=i(251);function s(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}s.Varint=0,s.Fixed64=1,s.Bytes=2,s.Fixed32=5;var a=4294967296,n=1/a,o="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function l(t){return t.type===s.Bytes?t.readVarint()+t.pos:t.pos+1}function h(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function d(t,e,i){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(r);for(var s=i.pos-1;s>=t;s--)i.buf[s+r]=i.buf[s]}function c(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function u(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function p(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function m(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function g(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function f(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function v(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function y(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function b(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function x(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function w(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function _(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}s.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),s=r>>3,a=this.pos;this.type=7&r,t(s,e,this),this.pos===a&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=x(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=_(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=x(this.buf,this.pos)+x(this.buf,this.pos+4)*a;return this.pos+=8,t},readSFixed64:function(){var t=x(this.buf,this.pos)+_(this.buf,this.pos+4)*a;return this.pos+=8,t},readFloat:function(){var t=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,r=this.buf;return e=127&(i=r[this.pos++]),i<128?e:(e|=(127&(i=r[this.pos++]))<<7,i<128?e:(e|=(127&(i=r[this.pos++]))<<14,i<128?e:(e|=(127&(i=r[this.pos++]))<<21,i<128?e:function(t,e,i){var r,s,a=i.buf;if(r=(112&(s=a[i.pos++]))>>4,s<128)return h(t,r,e);if(r|=(127&(s=a[i.pos++]))<<3,s<128)return h(t,r,e);if(r|=(127&(s=a[i.pos++]))<<10,s<128)return h(t,r,e);if(r|=(127&(s=a[i.pos++]))<<17,s<128)return h(t,r,e);if(r|=(127&(s=a[i.pos++]))<<24,s<128)return h(t,r,e);if(r|=(1&(s=a[i.pos++]))<<31,s<128)return h(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&o?function(t,e,i){return o.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){for(var r="",s=e;s<i;){var a,n,o,l=t[s],h=null,d=l>239?4:l>223?3:l>191?2:1;if(s+d>i)break;1===d?l<128&&(h=l):2===d?128==(192&(a=t[s+1]))&&(h=(31&l)<<6|63&a)<=127&&(h=null):3===d?(n=t[s+2],128==(192&(a=t[s+1]))&&128==(192&n)&&((h=(15&l)<<12|(63&a)<<6|63&n)<=2047||h>=55296&&h<=57343)&&(h=null)):4===d&&(n=t[s+2],o=t[s+3],128==(192&(a=t[s+1]))&&128==(192&n)&&128==(192&o)&&((h=(15&l)<<18|(63&a)<<12|(63&n)<<6|63&o)<=65535||h>=1114112)&&(h=null)),null===h?(h=65533,d=1):h>65535&&(h-=65536,r+=String.fromCharCode(h>>>10&1023|55296),h=56320|1023&h),r+=String.fromCharCode(h),s+=d}return r}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==s.Bytes)return t.push(this.readVarint(e));var i=l(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==s.Bytes)return t.push(this.readSVarint());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==s.Bytes)return t.push(this.readBoolean());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==s.Bytes)return t.push(this.readFloat());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==s.Bytes)return t.push(this.readDouble());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==s.Bytes)return t.push(this.readFixed32());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==s.Bytes)return t.push(this.readSFixed32());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==s.Bytes)return t.push(this.readFixed64());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==s.Bytes)return t.push(this.readSFixed64());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===s.Varint)for(;this.buf[this.pos++]>127;);else if(e===s.Bytes)this.pos=this.readVarint()+this.pos;else if(e===s.Fixed32)this.pos+=4;else{if(e!==s.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),w(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),w(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),w(this.buf,-1&t,this.pos),w(this.buf,Math.floor(t*n),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),w(this.buf,-1&t,this.pos),w(this.buf,Math.floor(t*n),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,r;if(t>=0?(i=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,r=r+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,i.buf[i.pos]=127&(t>>>=7)}(i,0,e),function(t,e){var i=(7&t)<<4;e.buf[e.pos++]|=i|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,i){for(var r,s,a=0;a<e.length;a++){if((r=e.charCodeAt(a))>55295&&r<57344){if(!s){r>56319||a+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):s=r;continue}if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,s=r;continue}r=s-55296<<10|r-56320|65536,s=null}else s&&(t[i++]=239,t[i++]=191,t[i++]=189,s=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=63&r|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&d(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),r.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),r.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var r=this.pos-i;r>=128&&d(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,i){this.writeTag(t,s.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,c,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,u,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,m,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,v,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,y,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,b,e)},writeBytesField:function(t,e){this.writeTag(t,s.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,s.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,s.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,s.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,s.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,s.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,s.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,s.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,s.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,s.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},3841:t=>{t.exports=function(t,e,i,r){var s=t[0],a=t[1],n=!1;void 0===i&&(i=0),void 0===r&&(r=e.length);for(var o=(r-i)/2,l=0,h=o-1;l<o;h=l++){var d=e[i+2*l+0],c=e[i+2*l+1],u=e[i+2*h+1];c>a!=u>a&&s<(e[i+2*h+0]-d)*(a-c)/(u-c)+d&&(n=!n)}return n}},1476:(t,e,i)=>{var r=i(3841),s=i(1137);t.exports=function(t,e,i,a){return e.length>0&&Array.isArray(e[0])?s(t,e,i,a):r(t,e,i,a)},t.exports.nested=s,t.exports.flat=r},1137:t=>{t.exports=function(t,e,i,r){var s=t[0],a=t[1],n=!1;void 0===i&&(i=0),void 0===r&&(r=e.length);for(var o=r-i,l=0,h=o-1;l<o;h=l++){var d=e[l+i][0],c=e[l+i][1],u=e[h+i][1];c>a!=u>a&&s<(e[h+i][0]-d)*(a-c)/(u-c)+d&&(n=!n)}return n}},5341:function(t){t.exports=function(){function t(t,r,s,a,n){!function t(i,r,s,a,n){for(;a>s;){if(a-s>600){var o=a-s+1,l=r-s+1,h=Math.log(o),d=.5*Math.exp(2*h/3),c=.5*Math.sqrt(h*d*(o-d)/o)*(l-o/2<0?-1:1);t(i,r,Math.max(s,Math.floor(r-l*d/o+c)),Math.min(a,Math.floor(r+(o-l)*d/o+c)),n)}var u=i[r],p=s,m=a;for(e(i,s,r),n(i[a],u)>0&&e(i,s,a);p<m;){for(e(i,p,m),p++,m--;n(i[p],u)<0;)p++;for(;n(i[m],u)>0;)m--}0===n(i[s],u)?e(i,s,m):e(i,++m,a),m<=r&&(s=m+1),r<=m&&(a=m-1)}}(t,r,s||0,a||t.length-1,n||i)}function e(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function i(t,e){return t<e?-1:t>e?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function s(t,e,i){if(!i)return e.indexOf(t);for(var r=0;r<e.length;r++)if(i(t,e[r]))return r;return-1}function a(t,e){n(t,0,t.children.length,e,t)}function n(t,e,i,r,s){s||(s=m(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(var a=e;a<i;a++){var n=t.children[a];o(s,t.leaf?r(n):n)}return s}function o(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function h(t,e){return t.minY-e.minY}function d(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function c(t){return t.maxX-t.minX+(t.maxY-t.minY)}function u(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function p(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,i,r,s,a){for(var n=[i,r];n.length;)if(!((r=n.pop())-(i=n.pop())<=s)){var o=i+Math.ceil((r-i)/s/2)*s;t(e,o,i,r,a),n.push(i,o,o,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var e=this.data,i=[];if(!p(t,e))return i;for(var r=this.toBBox,s=[];e;){for(var a=0;a<e.children.length;a++){var n=e.children[a],o=e.leaf?r(n):n;p(t,o)&&(e.leaf?i.push(n):u(t,o)?this._all(n,i):s.push(n))}e=s.pop()}return i},r.prototype.collides=function(t){var e=this.data;if(!p(t,e))return!1;for(var i=[];e;){for(var r=0;r<e.children.length;r++){var s=e.children[r],a=e.leaf?this.toBBox(s):s;if(p(t,a)){if(e.leaf||u(t,a))return!0;i.push(s)}}e=i.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var i=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var r=this.data;this.data=i,i=r}this._insert(i,this.data.height-i.height-1,!0)}else this.data=i;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=m([]),this},r.prototype.remove=function(t,e){if(!t)return this;for(var i,r,a,n=this.data,o=this.toBBox(t),l=[],h=[];n||l.length;){if(n||(n=l.pop(),r=l[l.length-1],i=h.pop(),a=!0),n.leaf){var d=s(t,n.children,e);if(-1!==d)return n.children.splice(d,1),l.push(n),this._condense(l),this}a||n.leaf||!u(n,o)?r?(i++,n=r.children[i],a=!1):n=null:(l.push(n),h.push(i),i=0,r=n,n=n.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,e){return t.minX-e.minX},r.prototype.compareMinY=function(t,e){return t.minY-e.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,e){for(var i=[];t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},r.prototype._build=function(t,e,i,r){var s,n=i-e+1,o=this._maxEntries;if(n<=o)return a(s=m(t.slice(e,i+1)),this.toBBox),s;r||(r=Math.ceil(Math.log(n)/Math.log(o)),o=Math.ceil(n/Math.pow(o,r-1))),(s=m([])).leaf=!1,s.height=r;var l=Math.ceil(n/o),h=l*Math.ceil(Math.sqrt(o));g(t,e,i,h,this.compareMinX);for(var d=e;d<=i;d+=h){var c=Math.min(d+h-1,i);g(t,d,c,l,this.compareMinY);for(var u=d;u<=c;u+=l){var p=Math.min(u+l-1,c);s.children.push(this._build(t,u,p,r-1))}}return a(s,this.toBBox),s},r.prototype._chooseSubtree=function(t,e,i,r){for(;r.push(e),!e.leaf&&r.length-1!==i;){for(var s=1/0,a=1/0,n=void 0,o=0;o<e.children.length;o++){var l=e.children[o],h=d(l),c=(u=t,p=l,(Math.max(p.maxX,u.maxX)-Math.min(p.minX,u.minX))*(Math.max(p.maxY,u.maxY)-Math.min(p.minY,u.minY))-h);c<a?(a=c,s=h<s?h:s,n=l):c===a&&h<s&&(s=h,n=l)}e=n||e.children[0]}var u,p;return e},r.prototype._insert=function(t,e,i){var r=i?t:this.toBBox(t),s=[],a=this._chooseSubtree(r,this.data,e,s);for(a.children.push(t),o(a,r);e>=0&&s[e].children.length>this._maxEntries;)this._split(s,e),e--;this._adjustParentBBoxes(r,s,e)},r.prototype._split=function(t,e){var i=t[e],r=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,r);var n=this._chooseSplitIndex(i,s,r),o=m(i.children.splice(n,i.children.length-n));o.height=i.height,o.leaf=i.leaf,a(i,this.toBBox),a(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)},r.prototype._splitRoot=function(t,e){this.data=m([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,e,i){for(var r,s,a,o,l,h,c,u=1/0,p=1/0,m=e;m<=i-e;m++){var g=n(t,0,m,this.toBBox),f=n(t,m,i,this.toBBox),v=(s=g,a=f,o=Math.max(s.minX,a.minX),l=Math.max(s.minY,a.minY),h=Math.min(s.maxX,a.maxX),c=Math.min(s.maxY,a.maxY),Math.max(0,h-o)*Math.max(0,c-l)),y=d(g)+d(f);v<u?(u=v,r=m,p=y<p?y:p):v===u&&y<p&&(p=y,r=m)}return r||i-e},r.prototype._chooseSplitAxis=function(t,e,i){var r=t.leaf?this.compareMinX:l,s=t.leaf?this.compareMinY:h;this._allDistMargin(t,e,i,r)<this._allDistMargin(t,e,i,s)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,e,i,r){t.children.sort(r);for(var s=this.toBBox,a=n(t,0,e,s),l=n(t,i-e,i,s),h=c(a)+c(l),d=e;d<i-e;d++){var u=t.children[d];o(a,t.leaf?s(u):u),h+=c(a)}for(var p=i-e-1;p>=e;p--){var m=t.children[p];o(l,t.leaf?s(m):m),h+=c(l)}return h},r.prototype._adjustParentBBoxes=function(t,e,i){for(var r=i;r>=0;r--)o(e[r],t)},r.prototype._condense=function(t){for(var e=t.length-1,i=void 0;e>=0;e--)0===t[e].children.length?e>0?(i=t[e-1].children).splice(i.indexOf(t[e]),1):this.clear():a(t[e],this.toBBox)},r}()},3886:(t,e,i)=>{var r=i(5335),s=i(1181);function a(t){var e=new r;return function(t,e){for(var i in t.layers)e.writeMessage(3,n,t.layers[i])}(t,e),e.finish()}function n(t,e){var i;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var r={keys:[],values:[],keycache:{},valuecache:{}};for(i=0;i<t.length;i++)r.feature=t.feature(i),e.writeMessage(2,o,r);var s=r.keys;for(i=0;i<s.length;i++)e.writeStringField(3,s[i]);var a=r.values;for(i=0;i<a.length;i++)e.writeMessage(4,u,a[i])}function o(t,e){var i=t.feature;void 0!==i.id&&e.writeVarintField(1,i.id),e.writeMessage(2,l,t),e.writeVarintField(3,i.type),e.writeMessage(4,c,i)}function l(t,e){var i=t.feature,r=t.keys,s=t.values,a=t.keycache,n=t.valuecache;for(var o in i.properties){var l=i.properties[o],h=a[o];if(null!==l){void 0===h&&(r.push(o),a[o]=h=r.length-1),e.writeVarint(h);var d=typeof l;"string"!==d&&"boolean"!==d&&"number"!==d&&(l=JSON.stringify(l));var c=d+":"+l,u=n[c];void 0===u&&(s.push(l),n[c]=u=s.length-1),e.writeVarint(u)}}}function h(t,e){return(e<<3)+(7&t)}function d(t){return t<<1^t>>31}function c(t,e){for(var i=t.loadGeometry(),r=t.type,s=0,a=0,n=i.length,o=0;o<n;o++){var l=i[o],c=1;1===r&&(c=l.length),e.writeVarint(h(1,c));for(var u=3===r?l.length-1:l.length,p=0;p<u;p++){1===p&&1!==r&&e.writeVarint(h(2,u-1));var m=l[p].x-s,g=l[p].y-a;e.writeVarint(d(m)),e.writeVarint(d(g)),s+=m,a+=g}3===r&&e.writeVarint(h(7,1))}}function u(t,e){var i=typeof t;"string"===i?e.writeStringField(1,t):"boolean"===i?e.writeBooleanField(7,t):"number"===i&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}t.exports=a,t.exports.fromVectorTileJs=a,t.exports.fromGeojsonVt=function(t,e){e=e||{};var i={};for(var r in t)i[r]=new s(t[r].features,e),i[r].name=r,i[r].version=e.version,i[r].extent=e.extent;return a({layers:i})},t.exports.GeoJSONWrapper=s},1181:(t,e,i)=>{var r=i(4748),s=i(4537).VectorTileFeature;function a(t,e){this.options=e||{},this.features=t,this.length=t.length}function n(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}t.exports=a,a.prototype.feature=function(t){return new n(this.features[t],this.options.extent)},n.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var i=t[e],s=[],a=0;a<i.length;a++)s.push(new r(i[a][0],i[a][1]));this.geometry.push(s)}return this.geometry},n.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,i=-1/0,r=1/0,s=-1/0,a=0;a<t.length;a++)for(var n=t[a],o=0;o<n.length;o++){var l=n[o];e=Math.min(e,l.x),i=Math.max(i,l.x),r=Math.min(r,l.y),s=Math.max(s,l.y)}return[e,r,i,s]},n.prototype.toGeoJSON=s.prototype.toGeoJSON}},e={};function i(r){var s=e[r];if(void 0!==s)return s.exports;var a=e[r]={exports:{}};return t[r].call(a.exports,a,a.exports,i),a.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{i.r(r);class t extends Error{constructor(t){super(null!=t?t:"Unauthorized")}}Error,Error;class e extends Error{constructor(t,e,i){super(t),this.response=e,this.status=i}}const s=t=>Array.isArray(t)?"array":t instanceof Date?"date":typeof t,a=t=>"object"===s(t),n=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if((t=>null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Date||t instanceof RegExp)(t))return t;if((r=t)&&"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer)return e&&!e.includes(t)&&e.push(t),t;var r;if(ArrayBuffer.isView(t)){const i=t;return e&&!e.includes(i.buffer)&&e.push(i.buffer),i}if(t instanceof ImageData)return e&&!e.includes(t.data.buffer)&&e.push(t.data.buffer),t;if(t instanceof ImageBitmap)return e&&!e.includes(t)&&e.push(t),t;if(Array.isArray(t)){const i=[];for(let r=0;r<t.length;r++)i.push(n(t[r],e));return i}if(a(t))return Object.keys(t).reduce(((r,s)=>{const a=0===i.length||i.length>0&&(i.includes(s)||((t,e)=>{let i=!1;return e.forEach((e=>{new RegExp(e).test(t)&&(i=!0)})),i})(s,i));return r[s]=a?n(t[s],e,i):t[s],r}),{});throw new Error("[MapsGL] Can't serialize object of type "+typeof t)};function o(){let t=0,e=0;for(let i=0;i<28;i+=7){let r=this.buf[this.pos++];if(t|=(127&r)<<i,!(128&r))return this.assertBounds(),[t,e]}let i=this.buf[this.pos++];if(t|=(15&i)<<28,e=(112&i)>>4,!(128&i))return this.assertBounds(),[t,e];for(let i=3;i<=31;i+=7){let r=this.buf[this.pos++];if(e|=(127&r)<<i,!(128&r))return this.assertBounds(),[t,e]}throw new Error("invalid varint")}const l=4294967296;function h(t){let e="-"==t[0];e&&(t=t.slice(1));const i=1e6;let r=0,s=0;function a(e,a){const n=Number(t.slice(e,a));s*=i,r=r*i+n,r>=l&&(s+=r/l|0,r%=l)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),[e,r,s]}function d(t,e){if(e<=2097151)return""+(l*e+t);let i=(t>>>24|e<<8)>>>0&16777215,r=e>>16&65535,s=(16777215&t)+6777216*i+6710656*r,a=i+8147497*r,n=2*r,o=1e7;function h(t,e){let i=t?String(t):"";return e?"0000000".slice(i.length)+i:i}return s>=o&&(a+=Math.floor(s/o),s%=o),a>=o&&(n+=Math.floor(a/o),a%=o),h(n,0)+h(a,n)+h(s,1)}function c(){let t=this.buf[this.pos++],e=127&t;if(!(128&t))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(127&t)<<7,!(128&t))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(127&t)<<14,!(128&t))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(127&t)<<21,!(128&t))return this.assertBounds(),e;t=this.buf[this.pos++],e|=(15&t)<<28;for(let e=5;128&t&&e<10;e++)t=this.buf[this.pos++];if(128&t)throw new Error("invalid varint");return this.assertBounds(),e>>>0}const u=function(){const t=new DataView(new ArrayBuffer(8));return void 0!==globalThis.BigInt&&"function"==typeof t.getBigInt64&&"function"==typeof t.getBigUint64&&"function"==typeof t.setBigInt64&&"function"==typeof t.setBigUint64?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:t}:void 0}();function p(t){if(!t)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}const m=/^-?[0-9]+$/,g=4294967296;class f{constructor(t,e){this.lo=0|t,this.hi=0|e}isZero(){return 0==this.lo&&0==this.hi}toNumber(){let t=this.hi*g+(this.lo>>>0);if(!Number.isSafeInteger(t))throw new Error("cannot convert to safe number");return t}}class v extends f{static from(t){if(u)switch(typeof t){case"string":if("0"==t)return this.ZERO;if(""==t)throw new Error("string is no integer");t=u.C(t);case"number":if(0===t)return this.ZERO;t=u.C(t);case"bigint":if(!t)return this.ZERO;if(t<u.UMIN)throw new Error("signed value for ulong");if(t>u.UMAX)throw new Error("ulong too large");return u.V.setBigUint64(0,t,!0),new v(u.V.getInt32(0,!0),u.V.getInt32(4,!0))}else switch(typeof t){case"string":if("0"==t)return this.ZERO;if(t=t.trim(),!m.test(t))throw new Error("string is no integer");let[e,i,r]=h(t);if(e)throw new Error("signed value");return new v(i,r);case"number":if(0==t)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");if(t<0)throw new Error("signed value for ulong");return new v(t,t/g)}throw new Error("unknown value "+typeof t)}toString(){return u?this.toBigInt().toString():d(this.lo,this.hi)}toBigInt(){return p(u),u.V.setInt32(0,this.lo,!0),u.V.setInt32(4,this.hi,!0),u.V.getBigUint64(0,!0)}}v.ZERO=new v(0,0);class y extends f{static from(t){if(u)switch(typeof t){case"string":if("0"==t)return this.ZERO;if(""==t)throw new Error("string is no integer");t=u.C(t);case"number":if(0===t)return this.ZERO;t=u.C(t);case"bigint":if(!t)return this.ZERO;if(t<u.MIN)throw new Error("ulong too small");if(t>u.MAX)throw new Error("ulong too large");return u.V.setBigInt64(0,t,!0),new y(u.V.getInt32(0,!0),u.V.getInt32(4,!0))}else switch(typeof t){case"string":if("0"==t)return this.ZERO;if(t=t.trim(),!m.test(t))throw new Error("string is no integer");let[e,i,r]=h(t),s=new y(i,r);return e?s.negate():s;case"number":if(0==t)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");return t>0?new y(t,t/g):new y(-t,-t/g).negate()}throw new Error("unknown value "+typeof t)}isNegative(){return!!(2147483648&this.hi)}negate(){let t=~this.hi,e=this.lo;return e?e=1+~e:t+=1,new y(e,t)}toString(){if(u)return this.toBigInt().toString();if(this.isNegative()){let t=this.negate();return"-"+d(t.lo,t.hi)}return d(this.lo,this.hi)}toBigInt(){return p(u),u.V.setInt32(0,this.lo,!0),u.V.setInt32(4,this.hi,!0),u.V.getBigInt64(0,!0)}}var b,x;y.ZERO=new y(0,0),function(t){t.symbol=Symbol("protobuf-ts/unknown"),t.onRead=(i,r,s,a,n)=>{(e(r)?r[t.symbol]:r[t.symbol]=[]).push({no:s,wireType:a,data:n})},t.onWrite=(e,i,r)=>{for(let{no:e,wireType:s,data:a}of t.list(i))r.tag(e,s).raw(a)},t.list=(i,r)=>{if(e(i)){let e=i[t.symbol];return r?e.filter((t=>t.no==r)):e}return[]},t.last=(e,i)=>t.list(e,i).slice(-1)[0];const e=e=>e&&Array.isArray(e[t.symbol])}(b||(b={})),function(t){t[t.Varint=0]="Varint",t[t.Bit64=1]="Bit64",t[t.LengthDelimited=2]="LengthDelimited",t[t.StartGroup=3]="StartGroup",t[t.EndGroup=4]="EndGroup",t[t.Bit32=5]="Bit32"}(x||(x={}));const w=t=>String.fromCharCode.apply(String,t);class _{constructor(t){this.varint64=o,this.uint32=c,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),e=t>>>3,i=7&t;if(e<=0||i<0||i>5)throw new Error("illegal tag: field no "+e+" wire type "+i);return[e,i]}skip(t){let e=this.pos;switch(t){case x.Bit64:this.pos+=4;case x.Bit32:this.pos+=4;break;case x.LengthDelimited:let t=this.uint32();this.pos+=t;break;case x.Varint:for(;128&this.buf[this.pos++];);}return this.assertBounds(),this.buf.slice(e,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return 0|this.uint32()}sint32(){let t=this.uint32();return t>>>1^-(1&t)}int64(){return new y(...this.varint64())}uint64(){return new v(...this.varint64())}sint64(){let[t,e]=this.varint64(),i=-(1&t);return t=(t>>>1|(1&e)<<31)^i,e=e>>>1^i,new y(t,e)}bool(){let[t,e]=this.varint64();return 0!==t||0!==e}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new v(this.sfixed32(),this.sfixed32())}sfixed64(){return new y(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),e=this.pos;return this.pos+=t,this.assertBounds(),this.buf.slice(e,this.pos)}string(){return function(t){if(t.length<1)return"";let e,i=0,r=[],s=[],a=0,n=t.length;for(;i<n;)e=t[i++],e<128?s[a++]=e:e>191&&e<224?s[a++]=(31&e)<<6|63&t[i++]:e>239&&e<365?(e=((7&e)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++])-65536,s[a++]=55296+(e>>10),s[a++]=56320+(1023&e)):s[a++]=(15&e)<<12|(63&t[i++])<<6|63&t[i++],a>8191&&(r.push(w(s)),a=0);return r.length?(a&&r.push(w(s.slice(0,a))),r.join("")):w(s.slice(0,a))}(this.bytes())}}var M=function(t,e){this.x=t,this.y=e},Z=function(t,e){void 0===e&&(e="number"),this.longType=e,this.layers={},this.reader=new _(t);for(var i=this.reader.len;this.reader.pos<i;){this.reader.uint32();var r=new A(this.reader,this.reader.uint32()+this.reader.pos,this.longType);r.length&&(this.layers[r.name]=r)}},A=function(){function t(t,e,i){for(this.reader=t,this.longType=i,this.name="",this.version=0,this.extent=0,this.featureOffsets=[],this.keys=[],this.values=[];t.pos<e;){var r=t.tag(),s=r[0],a=r[1];15==s?this.version=t.uint32():1==s?this.name=t.string():5==s?this.extent=t.uint32():2==s?(this.featureOffsets.push(t.pos),t.skip(a)):3==s?this.keys.push(t.string()):4==s&&this.values.push(this.decodeValue())}this.length=this.featureOffsets.length}var e=t.prototype;return e.feature=function(t){if(t<0||t>=this.featureOffsets.length)throw new Error("out of bounds");this.reader.pos=this.featureOffsets[t];var e=this.reader.uint32()+this.reader.pos;return new T(this.reader,e,this.keys,this.values,this.extent)},e.decodeValue=function(){for(var t=this.reader,e=t.uint32()+t.pos,i=null;t.pos<e;){var r=t.tag()[0];i=1==r?t.string():2==r?t.float():3==r?t.double():4==r?this.convertLong(t.int64()):5==r?this.convertLong(t.uint64()):6==r?this.convertLong(t.sint64()):7==r?t.bool():null}return i},e.convertLong=function(t){switch(this.longType){case"number":return t.toNumber();case"string":return t.toString();case"bigint":return t.toBigInt()}},t}(),T=function(){function t(t,e,i,r,s){for(this.reader=t,this.extent=s,this.type=0,this.properties={},this.geometryOffset=0;t.pos<e;){var a=t.tag(),n=a[0],o=a[1];if(1==n)this.id=t.int64().toString();else if(2==n)for(var l=t.uint32()+t.pos;t.pos<l;){var h=i[t.uint32()],d=r[t.uint32()];this.properties[h]=d}else 3==n?this.type=t.uint32():4==n&&(this.geometryOffset=t.pos,t.skip(o))}}var e=t.prototype;return e.loadGeometry=function(){this.reader.pos=this.geometryOffset;for(var t=this.reader.uint32()+this.reader.pos,e=1,i=0,r=0,s=0,a=[],n=null;this.reader.pos<t;){if(i<=0){var o=this.reader.uint32();e=7&o,i=o>>>3}var l;--i,1==e||2==e?(r+=this.reader.sint32(),s+=this.reader.sint32(),1==e&&(n&&a.push(n),n=[]),null==(l=n)||l.push(new M(r,s))):7==e&&n&&n.push(new M(n[0].x,n[0].y))}return n&&a.push(n),a},e.bbox=function(){this.reader.pos=this.geometryOffset;for(var t=this.reader.uint32()+this.reader.pos,e=0,i=0,r=0,s=0,a=Number.MAX_SAFE_INTEGER,n=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;this.reader.pos<t;){if(i<=0){var h=this.reader.uint32();e=7&h,i=h>>>3}--i,1!=e&&2!=e||(r+=this.reader.sint32(),s+=this.reader.sint32(),n=Math.max(r,n),a=Math.min(r,a),l=Math.max(s,l),o=Math.min(s,o))}return[a,o,n,l]},e.toGeoJSON=function(t,e,i){var r,s=this.extent*Math.pow(2,i),a=this.extent*t,n=this.extent*e,o="",l=function(t){return t.map((function(t){return[360*(t.x+a)/s-180,360/Math.PI*Math.atan(Math.exp((180-360*(t.y+n)/s)*Math.PI/180))-90]}))};switch(this.type){case 1:o="Point",r=l(this.asPoints());break;case 2:o="LineString",r=this.asLines().map((function(t){return l(t)}));break;case 3:o="Polygon",(r=this.asPolygons()).forEach((function(t,e){t.forEach((function(t,i){r[e][i]=l(t)}))}))}1==r.length?r=r[0]:o="Multi"+o;var h={type:"Feature",geometry:{type:o,coordinates:r},properties:this.properties};return null!=this.id&&(h.id=this.id),h},e.asPoints=function(){var t=this.loadGeometry().map((function(t){return t[0]}));return 1==this.type?t:null},e.asLines=function(){return 2==this.type?this.loadGeometry():null},e.asPolygons=function(){return 3==this.type?function(t){var e=t.length;if(e<=1)return[t];for(var i=[],r=null,s=0;s<e;s++){var a,n=R(t[s]);0!=n&&(n>0?(r&&i.push(r),r=[t[s]]):null==(a=r)||a.push(t[s]))}return r&&i.push(r),i}(this.loadGeometry()):null},t}();function R(t){for(var e=0,i=0,r=t.length,s=r-1;i<r;s=i++){var a=t[i],n=t[s];e+=(n.x-a.x)*(a.y+n.y)}return e}function G(t,e,i,r){for(var s,a=r,n=i-e>>1,o=i-e,l=t[e],h=t[e+1],d=t[i],c=t[i+1],u=e+3;u<i;u+=3){var p=S(t[u],t[u+1],l,h,d,c);if(p>a)s=u,a=p;else if(p===a){var m=Math.abs(u-n);m<o&&(s=u,o=m)}}a>r&&(s-e>3&&G(t,e,s,r),t[s+2]=a,i-s>3&&G(t,s,i,r))}function S(t,e,i,r,s,a){var n=s-i,o=a-r;if(0!==n||0!==o){var l=((t-i)*n+(e-r)*o)/(n*n+o*o);l>1?(i=s,r=a):l>0&&(i+=n*l,r+=o*l)}return(n=t-i)*n+(o=e-r)*o}function C(t,e,i,r){var s={id:void 0===t?null:t,type:e,geometry:i,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,i=t.type;if("Point"===i||"MultiPoint"===i||"LineString"===i)I(t,e);else if("Polygon"===i||"MultiLineString"===i)for(var r=0;r<e.length;r++)I(t,e[r]);else if("MultiPolygon"===i)for(r=0;r<e.length;r++)for(var s=0;s<e[r].length;s++)I(t,e[r][s])}(s),s}function I(t,e){for(var i=0;i<e.length;i+=3)t.minX=Math.min(t.minX,e[i]),t.minY=Math.min(t.minY,e[i+1]),t.maxX=Math.max(t.maxX,e[i]),t.maxY=Math.max(t.maxY,e[i+1])}function V(t,e,i,r){if(e.geometry){var s=e.geometry.coordinates,a=e.geometry.type,n=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2),o=[],l=e.id;if(i.promoteId?l=e.properties[i.promoteId]:i.generateId&&(l=r||0),"Point"===a)F(s,o);else if("MultiPoint"===a)for(var h=0;h<s.length;h++)F(s[h],o);else if("LineString"===a)W(s,o,n,!1);else if("MultiLineString"===a){if(i.lineMetrics){for(h=0;h<s.length;h++)W(s[h],o=[],n,!1),t.push(C(l,"LineString",o,e.properties));return}E(s,o,n,!1)}else if("Polygon"===a)E(s,o,n,!0);else{if("MultiPolygon"!==a){if("GeometryCollection"===a){for(h=0;h<e.geometry.geometries.length;h++)V(t,{id:l,geometry:e.geometry.geometries[h],properties:e.properties},i,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(h=0;h<s.length;h++){var d=[];E(s[h],d,n,!0),o.push(d)}}t.push(C(l,a,o,e.properties))}}function F(t,e){e.push(k(t[0])),e.push(z(t[1])),e.push(0)}function W(t,e,i,r){for(var s,a,n=0,o=0;o<t.length;o++){var l=k(t[o][0]),h=z(t[o][1]);e.push(l),e.push(h),e.push(0),o>0&&(n+=r?(s*h-l*a)/2:Math.sqrt(Math.pow(l-s,2)+Math.pow(h-a,2))),s=l,a=h}var d=e.length-3;e[2]=1,G(e,0,d,i),e[d+2]=1,e.size=Math.abs(n),e.start=0,e.end=e.size}function E(t,e,i,r){for(var s=0;s<t.length;s++){var a=[];W(t[s],a,i,r),e.push(a)}}function k(t){return t/360+.5}function z(t){var e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function N(t,e,i,r,s,a,n,o){if(r/=e,a>=(i/=e)&&n<r)return t;if(n<i||a>=r)return null;for(var l=[],h=0;h<t.length;h++){var d=t[h],c=d.geometry,u=d.type,p=0===s?d.minX:d.minY,m=0===s?d.maxX:d.maxY;if(p>=i&&m<r)l.push(d);else if(!(m<i||p>=r)){var g=[];if("Point"===u||"MultiPoint"===u)Y(c,g,i,r,s);else if("LineString"===u)L(c,g,i,r,s,!1,o.lineMetrics);else if("MultiLineString"===u)j(c,g,i,r,s,!1);else if("Polygon"===u)j(c,g,i,r,s,!0);else if("MultiPolygon"===u)for(var f=0;f<c.length;f++){var v=[];j(c[f],v,i,r,s,!0),v.length&&g.push(v)}if(g.length){if(o.lineMetrics&&"LineString"===u){for(f=0;f<g.length;f++)l.push(C(d.id,u,g[f],d.tags));continue}"LineString"!==u&&"MultiLineString"!==u||(1===g.length?(u="LineString",g=g[0]):u="MultiLineString"),"Point"!==u&&"MultiPoint"!==u||(u=3===g.length?"Point":"MultiPoint"),l.push(C(d.id,u,g,d.tags))}}}return l.length?l:null}function Y(t,e,i,r,s){for(var a=0;a<t.length;a+=3){var n=t[a+s];n>=i&&n<=r&&(e.push(t[a]),e.push(t[a+1]),e.push(t[a+2]))}}function L(t,e,i,r,s,a,n){for(var o,l,h=O(t),d=0===s?X:B,c=t.start,u=0;u<t.length-3;u+=3){var p=t[u],m=t[u+1],g=t[u+2],f=t[u+3],v=t[u+4],y=0===s?p:m,b=0===s?f:v,x=!1;n&&(o=Math.sqrt(Math.pow(p-f,2)+Math.pow(m-v,2))),y<i?b>i&&(l=d(h,p,m,f,v,i),n&&(h.start=c+o*l)):y>r?b<r&&(l=d(h,p,m,f,v,r),n&&(h.start=c+o*l)):D(h,p,m,g),b<i&&y>=i&&(l=d(h,p,m,f,v,i),x=!0),b>r&&y<=r&&(l=d(h,p,m,f,v,r),x=!0),!a&&x&&(n&&(h.end=c+o*l),e.push(h),h=O(t)),n&&(c+=o)}var w=t.length-3;p=t[w],m=t[w+1],g=t[w+2],(y=0===s?p:m)>=i&&y<=r&&D(h,p,m,g),w=h.length-3,a&&w>=3&&(h[w]!==h[0]||h[w+1]!==h[1])&&D(h,h[0],h[1],h[2]),h.length&&e.push(h)}function O(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function j(t,e,i,r,s,a){for(var n=0;n<t.length;n++)L(t[n],e,i,r,s,a,!1)}function D(t,e,i,r){t.push(e),t.push(i),t.push(r)}function X(t,e,i,r,s,a){var n=(a-e)/(r-e);return t.push(a),t.push(i+(s-i)*n),t.push(1),n}function B(t,e,i,r,s,a){var n=(a-i)/(s-i);return t.push(e+(r-e)*n),t.push(a),t.push(1),n}function P(t,e){for(var i=[],r=0;r<t.length;r++){var s,a=t[r],n=a.type;if("Point"===n||"MultiPoint"===n||"LineString"===n)s=H(a.geometry,e);else if("MultiLineString"===n||"Polygon"===n){s=[];for(var o=0;o<a.geometry.length;o++)s.push(H(a.geometry[o],e))}else if("MultiPolygon"===n)for(s=[],o=0;o<a.geometry.length;o++){for(var l=[],h=0;h<a.geometry[o].length;h++)l.push(H(a.geometry[o][h],e));s.push(l)}i.push(C(a.id,n,s,a.tags))}return i}function H(t,e){var i=[];i.size=t.size,void 0!==t.start&&(i.start=t.start,i.end=t.end);for(var r=0;r<t.length;r+=3)i.push(t[r]+e,t[r+1],t[r+2]);return i}function U(t,e){if(t.transformed)return t;var i,r,s,a=1<<t.z,n=t.x,o=t.y;for(i=0;i<t.features.length;i++){var l=t.features[i],h=l.geometry,d=l.type;if(l.geometry=[],1===d)for(r=0;r<h.length;r+=2)l.geometry.push(Q(h[r],h[r+1],e,a,n,o));else for(r=0;r<h.length;r++){var c=[];for(s=0;s<h[r].length;s+=2)c.push(Q(h[r][s],h[r][s+1],e,a,n,o));l.geometry.push(c)}}return t.transformed=!0,t}function Q(t,e,i,r,s,a){return[Math.round(i*(t*r-s)),Math.round(i*(e*r-a))]}function K(t,e,i,r,s){for(var a=e===s.maxZoom?0:s.tolerance/((1<<e)*s.extent),n={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:i,y:r,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},o=0;o<t.length;o++){n.numFeatures++,J(n,t[o],a,s);var l=t[o].minX,h=t[o].minY,d=t[o].maxX,c=t[o].maxY;l<n.minX&&(n.minX=l),h<n.minY&&(n.minY=h),d>n.maxX&&(n.maxX=d),c>n.maxY&&(n.maxY=c)}return n}function J(t,e,i,r){var s=e.geometry,a=e.type,n=[];if("Point"===a||"MultiPoint"===a)for(var o=0;o<s.length;o+=3)n.push(s[o]),n.push(s[o+1]),t.numPoints++,t.numSimplified++;else if("LineString"===a)q(n,s,t,i,!1,!1);else if("MultiLineString"===a||"Polygon"===a)for(o=0;o<s.length;o++)q(n,s[o],t,i,"Polygon"===a,0===o);else if("MultiPolygon"===a)for(var l=0;l<s.length;l++){var h=s[l];for(o=0;o<h.length;o++)q(n,h[o],t,i,!0,0===o)}if(n.length){var d=e.tags||null;if("LineString"===a&&r.lineMetrics){for(var c in d={},e.tags)d[c]=e.tags[c];d.mapbox_clip_start=s.start/s.size,d.mapbox_clip_end=s.end/s.size}var u={geometry:n,type:"Polygon"===a||"MultiPolygon"===a?3:"LineString"===a||"MultiLineString"===a?2:1,tags:d};null!==e.id&&(u.id=e.id),t.features.push(u)}}function q(t,e,i,r,s,a){var n=r*r;if(r>0&&e.size<(s?n:r))i.numPoints+=e.length/3;else{for(var o=[],l=0;l<e.length;l+=3)(0===r||e[l+2]>n)&&(i.numSimplified++,o.push(e[l]),o.push(e[l+1])),i.numPoints++;s&&function(t,e){for(var i=0,r=0,s=t.length,a=s-2;r<s;a=r,r+=2)i+=(t[r]-t[a])*(t[r+1]+t[a+1]);if(i>0===e)for(r=0,s=t.length;r<s/2;r+=2){var n=t[r],o=t[r+1];t[r]=t[s-2-r],t[r+1]=t[s-1-r],t[s-2-r]=n,t[s-1-r]=o}}(o,a),t.push(o)}}function $(t,e){var i=(e=this.options=function(t,e){for(var i in e)t[i]=e[i];return t}(Object.create(this.options),e)).debug;if(i&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var r=function(t,e){var i=[];if("FeatureCollection"===t.type)for(var r=0;r<t.features.length;r++)V(i,t.features[r],e,r);else V(i,"Feature"===t.type?t:{geometry:t},e);return i}(t,e);this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.time("generate tiles"),this.stats={},this.total=0),r=function(t,e){var i=e.buffer/e.extent,r=t,s=N(t,1,-1-i,i,0,-1,2,e),a=N(t,1,1-i,2+i,0,-1,2,e);return(s||a)&&(r=N(t,1,-i,1+i,0,-1,2,e)||[],s&&(r=P(s,1).concat(r)),a&&(r=r.concat(P(a,-1)))),r}(r,e),r.length&&this.splitTile(r,0,0,0),i&&(console.timeEnd("generate tiles"),JSON.stringify(this.stats))}function tt(t,e,i){return 32*((1<<t)*i+e)+t}$.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},$.prototype.splitTile=function(t,e,i,r,s,a,n){for(var o=[t,e,i,r],l=this.options,h=l.debug;o.length;){r=o.pop(),i=o.pop(),e=o.pop(),t=o.pop();var d=1<<e,c=tt(e,i,r),u=this.tiles[c];if(!u&&(h>1&&console.time("creation"),u=this.tiles[c]=K(t,e,i,r,l),this.tileCoords.push({z:e,x:i,y:r}),h)){h>1&&console.timeEnd("creation");var p="z"+e;this.stats[p]=(this.stats[p]||0)+1,this.total++}if(u.source=t,s){if(e===l.maxZoom||e===s)continue;var m=1<<s-e;if(i!==Math.floor(a/m)||r!==Math.floor(n/m))continue}else if(e===l.indexMaxZoom||u.numPoints<=l.indexMaxPoints)continue;if(u.source=null,0!==t.length){h>1&&console.time("clipping");var g,f,v,y,b,x,w=.5*l.buffer/l.extent,_=.5-w,M=.5+w,Z=1+w;g=f=v=y=null,b=N(t,d,i-w,i+M,0,u.minX,u.maxX,l),x=N(t,d,i+_,i+Z,0,u.minX,u.maxX,l),t=null,b&&(g=N(b,d,r-w,r+M,1,u.minY,u.maxY,l),f=N(b,d,r+_,r+Z,1,u.minY,u.maxY,l),b=null),x&&(v=N(x,d,r-w,r+M,1,u.minY,u.maxY,l),y=N(x,d,r+_,r+Z,1,u.minY,u.maxY,l),x=null),h>1&&console.timeEnd("clipping"),o.push(g||[],e+1,2*i,2*r),o.push(f||[],e+1,2*i,2*r+1),o.push(v||[],e+1,2*i+1,2*r),o.push(y||[],e+1,2*i+1,2*r+1)}}},$.prototype.getTile=function(t,e,i){var r=this.options,s=r.extent,a=r.debug;if(t<0||t>24)return null;var n=1<<t,o=tt(t,e=(e%n+n)%n,i);if(this.tiles[o])return U(this.tiles[o],s);for(var l,h=t,d=e,c=i;!l&&h>0;)h--,d=Math.floor(d/2),c=Math.floor(c/2),l=this.tiles[tt(h,d,c)];return l&&l.source?(a>1&&console.time("drilling down"),this.splitTile(l.source,h,d,c,t,e,i),a>1&&console.timeEnd("drilling down"),this.tiles[o]?U(this.tiles[o],s):null):null};var et=i(3886),it=i.n(et);const rt=t=>null==t,st=t=>!rt(t),at=t=>{switch(s(t)){case"array":case"string":return 0===t.length;case"date":case"boolean":case"number":case"function":case"symbol":return!1;case"object":return 0===Object.keys(t).length;default:return!0}},nt=t=>rt(t)||at(t),ot=t=>!nt(t),lt=function(t){if(!t)throw new Error(`Assert failed: ${(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||""}`)},ht=(Math,512),dt=(Math,Math,t=>Math.pow(2,t)),ct=(t,e,i,r)=>`${r}:${i}/${t}/${e}`,ut=(t,e)=>(t%e+e)%e;class pt{get hash(){return ct(this.x,this.y,this.z,this.wrap)}get wrap(){const t=Math.pow(2,this.z);return Math.floor(this.x/t)}get isRoot(){return 0===this.z}constructor(t,e,i){this.x=e,this.y=i,this.z=t}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}normalize(){const t=Math.pow(2,this.z);return new pt(this.z,ut(this.x,t),ut(this.y,t))}getAncestor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;const e=Math.pow(2,t);return new pt(this.z-t,Math.floor(this.x/e),Math.floor(this.y/e))}getDescendants(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;const e=Math.pow(2,t),i=Array.from({length:e*e});for(let r=0;r<e;r++){const s=r*e;for(let a=0;a<e;a++)i[s+a]=new pt(this.z+t,this.x*e+r,this.y*e+a)}return i}getNeighbor(t,e){const{x:i,y:r,z:s,wrap:a}=this,n=Math.pow(2,s);let o=0,l=0,h=0;return 0===s?(o=i,h=a+t):(o=i+t,l=r+e,h=i+t<0?a-1:i+t>n?a+1:a),l<0||l>=n?null:new pt(s,o,l)}getNeighbors(){const[t,e,i,r,s,a]=[-1,0,1,-1,0,1];return{tl:this.getNeighbor(t,r),tc:this.getNeighbor(e,r),tr:this.getNeighbor(i,r),ml:this.getNeighbor(t,s),mc:this,mr:this.getNeighbor(i,s),bl:this.getNeighbor(t,a),bc:this.getNeighbor(e,a),br:this.getNeighbor(i,a)}}getQuadrant(){return[this.x%2,this.y%2]}isAncestorOf(t){if(this.z>=t.z)return!1;const e=Math.pow(2,t.z-this.z),i=Math.floor(t.x/e),r=Math.floor(t.y/e);return this.x===i&&this.y===r}isDescendantOf(t){return t.isAncestorOf(this)}getPosition(){const t=dt(this.z);return{x:this.x/t,y:this.y/t}}getCenter(){const t=dt(this.z);return{x:(this.x+.5)/t,y:(this.y+.5)/t}}toString(){return`TileCoord: ${this.z}/${this.x}/${this.y}, wrap: ${this.wrap}`}toInfo(){return{z:this.z,x:this.x,y:this.y}}static fromHash(t){const e=(t||"").replace(/^\d+:/,"").split("/").map((t=>Number.parseInt(t,10)));return new pt(e[0],e[1],e[2])}}const mt=pt,gt=i=>{var r;if(i.status>=200&&i.status<=299)return i;if(401===i.status)throw new t(i.statusText);if(404!==i.status){if(i.status>=500)throw new e(null!==(r=i.statusText)&&void 0!==r?r:"Invalid response",i,i.status);return i}};new Set;const ft=t=>"string"===s(t),vt=(t,e,i)=>{if(rt(e))return t;const r=e.split("."),s=r.length-1;let a;for(a=0;a<s;a+=1)t[r[a]]=t[r[a]]||{},t=t[r[a]];return t[r[a]]=i,t},yt=(t,e)=>{if("array"!==s(e)||nt(t)||!a(t))return!1;let i=!0;return e.forEach((e=>{!1===t.hasOwnProperty(e)&&(i=!1)})),i},bt=t=>"number"===s(t),xt=(t,e,i)=>Math.min(Math.max(t,e),i),wt=t=>{if(rt(t))return;let e=0,i=0,r=0;if(ft(t)){const s=t.replace(/^#/,""),a=s.length;3===a?(e=Number.parseInt(s.charAt(0)+s.charAt(0),16),i=Number.parseInt(s.charAt(1)+s.charAt(1),16),r=Number.parseInt(s.charAt(2)+s.charAt(2),16)):6===a&&(e=Number.parseInt(s.charAt(0)+s.charAt(1),16),i=Number.parseInt(s.charAt(2)+s.charAt(3),16),r=Number.parseInt(s.charAt(4)+s.charAt(5),16))}else{const s=Math.floor(t);e=s>>16&255,i=s>>8&255,r=255&s}return{r:e,g:i,b:r,a:1}},_t=t=>yt(t,["r","g","b"]),Mt=t=>yt(t,["h","s","l"]),Zt=t=>yt(t,["h","s","v"]),At=t=>ft(t)&&t.includes("%"),Tt=(t,e,i)=>{const r=At(t),s=i-e;return t=xt(Number.parseFloat(`${t}`),e,i),r&&(t=Number.parseInt(""+t*i,10)/100),Math.abs(t-i)<1e-6?1:t%s/s},Rt=(t,e,i)=>(i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t),Gt=t=>{if(!Mt(t))return;let e,i,r,{h:s,s:a,l:n,a:o}=t;if(s=Tt(s,0,360),a=Tt(a,0,100),n=Tt(n,0,100),o=o||1,0===a)e=i=r=n;else{const t=n<.5?n*(1+a):n+a-n*a,o=2*n-t;e=Rt(o,t,s+1/3),i=Rt(o,t,s),r=Rt(o,t,s-1/3)}return{r:Math.round(255*e),g:Math.round(255*i),b:Math.round(255*r),a:o}},St=t=>{if(!Zt(t))return;let{h:e,s:i,v:r,a:s}=t;e=6*Tt(e,0,360),i=Tt(i,0,100),r=Tt(r,0,100),s=s||1;const a=Math.floor(e),n=e-a,o=r*(1-i),l=r*(1-n*i),h=r*(1-(1-n)*i),d=a%6,c=[h,r,r,l,o,o][d],u=[o,o,h,r,r,l][d];return{r:Math.round(255*[r,l,o,o,h,r][d]),g:Math.round(255*c),b:Math.round(255*u),a:s}};var Ct=1e-6,It="undefined"!=typeof Float32Array?Float32Array:Array;function Vt(){var t=new It(4);return It!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Ft(t,e,i,r){var s=new It(4);return s[0]=t,s[1]=e,s[2]=i,s[3]=r,s}function Wt(t,e,i,r,s){return t[0]=e,t[1]=i,t[2]=r,t[3]=s,t}function Et(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t}function kt(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t}function zt(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t}function Nt(t){return Math.hypot(t[0],t[1],t[2],t[3])}function Yt(t,e){var i=e[0],r=e[1],s=e[2],a=e[3],n=i*i+r*r+s*s+a*a;return n>0&&(n=1/Math.sqrt(n)),t[0]=i*n,t[1]=r*n,t[2]=s*n,t[3]=a*n,t}function Lt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Ot(t,e){var i=t[0],r=t[1],s=t[2],a=t[3],n=e[0],o=e[1],l=e[2],h=e[3];return Math.abs(i-n)<=Ct*Math.max(1,Math.abs(i),Math.abs(n))&&Math.abs(r-o)<=Ct*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(s-l)<=Ct*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(a-h)<=Ct*Math.max(1,Math.abs(a),Math.abs(h))}Math,Math,Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),Vt();const jt=class{get value(){return null}fromArray(t){return this}toArray(){return[]}},Dt=Vt();class Xt extends jt{get value(){return this._value}get x(){return this.value[0]}set x(t){this.value[0]=t}get y(){return this.value[1]}set y(t){this.value[1]=t}get z(){return this.value[2]}set z(t){this.value[2]=t}get w(){return this.value[3]}set w(t){this.value[3]=t}get elements(){return this.value.length}constructor(t=0,e=0,i=0,r=0){super(),this._value=Ft(t,e,i,r)}fromArray(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=t[e+0],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e+0]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromObject(t){let{x:e,y:i,z:r,w:s}=t;return void 0!==e&&(this.x=e),void 0!==i&&(this.y=i),void 0!==r&&(this.z=r),void 0!==s&&(this.w=s),this}toObject(){return{x:this.x,y:this.y,z:this.z,w:this.w}}set(t,e,i,r){return Wt(this._value,t,e,i,r),this}setScalar(t){return this.set(t,t,t,t)}length(){return Nt(this.value)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this}clone(){return new Xt(this.x,this.y,this.z,this.w)}add(t){return Et(this.value,this.value,t.value),this}addScalar(t){return Wt(Dt,t,t,t,t),Et(this.value,this.value,Dt),this}subtract(t){return kt(this.value,this.value,t.value),this}subtractScalar(t){return Wt(Dt,t,t,t,t),kt(this.value,this.value,Dt),this}multiply(t){return function(t,e,i){t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t[3]=e[3]*i[3]}(this.value,this.value,t.value),this}multiplyScalar(t){return zt(this.value,this.value,t),this}divide(t){return function(t,e,i){t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t[3]=e[3]/i[3]}(this.value,this.value,t.value),this}divideScalar(t){return zt(this.value,this.value,1/t),this}distanceTo(t){return e=this.value,i=t.value,Math.hypot(i[0]-e[0],i[1]-e[1],i[2]-e[2],i[3]-e[3]);var e,i}dot(t){return Lt(this.value,t.value)}equals(t){return Ot(this.value,t.value)}lerp(t,e){return function(t,e,i,r){var s=e[0],a=e[1],n=e[2],o=e[3];t[0]=s+r*(i[0]-s),t[1]=a+r*(i[1]-a),t[2]=n+r*(i[2]-n),t[3]=o+r*(i[3]-o)}(this.value,this.value,t.value,e),this}normalize(){return Yt(this.value,this.value),this}scale(t){return zt(this.value,this.value,t),this}applyMatrix4(t){return function(t,e,i){var r=e[0],s=e[1],a=e[2],n=e[3];t[0]=i[0]*r+i[4]*s+i[8]*a+i[12]*n,t[1]=i[1]*r+i[5]*s+i[9]*a+i[13]*n,t[2]=i[2]*r+i[6]*s+i[10]*a+i[14]*n,t[3]=i[3]*r+i[7]*s+i[11]*a+i[15]*n}(this.value,this.value,t.value),this}}const Bt=Xt,Pt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ht={},Ut=new Map;class Qt{constructor(t=0,e,i,r=1){if(this.r=0,this.g=0,this.b=0,this.a=1,void 0===e&&void 0===i)if(bt(t)&&t<=255)this.setRGB(t,t,t);else if(ft(t)&&Pt[t])this.fromHex(Pt[t]);else{const e=(t=>{if(_t(t))return t;if(Mt(t))return Gt(t);if(Zt(t))return St(t);if(ft(t)){const e=/^(rgb|hsl|hsv)a?\((\d+),\s*([\d%]+),\s*([\d%]+)(?:,\s*(\d+(?:\.\d+)?))?\)$/.exec(`${t}`);if(e&&e.length>=5){const t=e[1],i=st(e[5])?Number.parseFloat(e[5]):1,r=e.slice(2,5).map((t=>At(t)?t:Number.parseInt(t,10)));if("rgb"===t||"rgba"===t)return{r:xt(r[0],0,255),g:xt(r[1],0,255),b:xt(r[2],0,255),a:i};if("hsl"===t)return Gt({h:r[0],s:r[1],l:r[2],a:i});if("hsv"===t)return St({h:r[0],s:r[1],v:r[2],a:i})}else if(/^#?([\dA-Fa-f]+)$/.test(t))return wt(t)}return bt(t)?wt(t):void 0})(t);if(e){const{r:t,g:i,b:r,a:s}=e;this.setRGBA(t,i,r,s)}}else this.setRGBA(t,e,i,r)}fromHex(t){let e=Ht[t];return e||(e=wt(t),Ht[t]=e),this.setRGBA(e.r,e.g,e.b,e.a)}fromHSL(t,e,i){const r=Gt({h:t,s:e,l:i,a:arguments.length>3&&void 0!==arguments[3]?arguments[3]:1});return this.setRGBA(r.r,r.g,r.b,r.a)}fromHSV(t,e,i){const r=St({h:t,s:e,v:i,a:arguments.length>3&&void 0!==arguments[3]?arguments[3]:1});return this.setRGBA(r.r,r.g,r.b,r.a)}setRGB(t,e,i){return this.setRGBA(t,e,i,this.a),this}setRGBA(t,e,i,r){let s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return this.r=s?t:Tt(t,0,255),this.g=s?e:Tt(e,0,255),this.b=s?i:Tt(i,0,255),this.setAlpha(r),this}setAlpha(t){return this.a=t>1?Tt(t,0,255):t,this}lighter(t){const e=t<1?t:t/100;let i=this.toHSL().l;return i+=i*e,i=Math.min(1,i),this}darker(t){const e=t<1?t:t/100;let i=this.toHSL().l;return i-=i*e,i=Math.max(0,i),this}equals(t){return this.r===t.r&&this.g===t.g&&this.b===t.b&&this.a===t.a}toHex(){return(t=>{if(_t(t))return`#${[t.r,t.g,t.b].map((t=>{const e=t.toString(16);return 1===e.length?`0${e}`:e})).join("")}`})(this.toObject(!1))}toHSL(){return(t=>{if(!_t(t))return;let{r:e,g:i,b:r}=t;e=Tt(e,0,255),i=Tt(i,0,255),r=Tt(r,0,255);const s=Math.min(e,i,r),a=Math.max(e,i,r);let n,o;const l=(a+s)/2;if(a===s)n=0,o=0;else{const t=a-s;switch(o=l>.5?t/(2-a-s):t/(a+s),a){case e:n=(i-r)/t+(i<r?6:0);break;case i:n=(r-e)/t+2;break;case r:n=(e-i)/t+4}n/=6}return{h:n,s:o,l:l}})(this.toObject(!1))}toHSV(){return(t=>{if(!_t(t))return;let{r:e,g:i,b:r}=t;e=Tt(e,0,255),i=Tt(i,0,255),r=Tt(r,0,255);const s=Math.max(e,i,r),a=Math.min(e,i,r);let n;const o=s,l=s-a,h=0===s?0:l/s;if(s===a)n=0;else{switch(s){case e:n=(i-r)/l+(i<r?6:0);break;case i:n=(r-e)/l+2;break;case r:n=(e-i)/l+4}n/=6}return{h:n,s:h,v:o}})(this.toObject(!1))}toObject(){const t=arguments.length>0&&void 0!==arguments[0]&&!arguments[0]?255:1;return{r:this.r*t,g:this.g*t,b:this.b*t,a:this.a}}toArray(){return[this.r,this.g,this.b,this.a]}toVector(){return(new Bt).fromArray(this.toArray())}toString(){return`${this.constructor.name}(${this.r}, ${this.g}, ${this.b}, ${this.a}})`}}const Kt=Qt,Jt=(t,e)=>256*(t=xt(Math.floor(t),0,255))+xt(Math.floor(e),0,255),qt=t=>[Jt(255*t.r,255*t.g),Jt(255*t.b,255*t.a)];class $t{get bytesPerElement(){throw new Error("Subclasses of StructArray must override `bytesPerElement`")}constructor(t=1,e=0){this.capacity=-1,this.length=0,this.stride=1,this.stride=t,this.resize(e)}resize(t){t=Math.ceil(t),this.length=t,this.reserve(t)}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.buffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const e=this.data;this.refresh(),e&&this.data.set(e)}}emplace(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=this.length;this.resize(i+1),this.emplaceAt(i,t,e)}emplaceAt(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=!Array.isArray(e),s=t*this.stride;i&&console.warn("emplaceAt",t,e,this.length,this.data);const a=r?1:e.length;if(a!==this.stride)throw new Error(`Element length (${a}) does not match the stride for the StructArray ${this.stride}`);if(r)this.data[s]=e;else{const t=e;for(let e=0;e<a;e++)this.data[s+e]=t[e]}}get(t){const e=t*this.stride;return this.data.slice(e,e+this.stride)}refresh(){throw new Error("Subclasses of StructArray must override `refresh`")}trim(){this.length!==this.capacity&&(this.capacity=this.length,this.buffer=this.buffer.slice(0,this.length*this.bytesPerElement),this.refresh())}clear(){this.length=0}serialize(){return this.trim(),{capacity:this.capacity,length:this.length,stride:this.stride,buffer:this.buffer}}static from(t){const e=Object.create(this.prototype);return e.stride=t.stride,e.buffer=t.buffer,e.length=t.length,e.capacity=t.length,e.refresh(),e}}class te extends $t{get bytesPerElement(){return 2*this.stride}refresh(){this.data=new Int16Array(this.buffer)}}class ee extends $t{get bytesPerElement(){return 2*this.stride}refresh(){this.data=new Uint16Array(this.buffer)}}class ie extends $t{get bytesPerElement(){return 4*this.stride}refresh(){this.data=new Float32Array(this.buffer)}}var re=i(5341),se=i.n(re),ae=i(1476),ne=i.n(ae);const oe=t=>ce/ht*t,le=function(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(3===t)return((t,e)=>{const i={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY};for(let e=0;e<t.length;e++){const r=t[e][0];for(let t=0;t<r.length;t++){const e=r[t];i.minX=Math.min(i.minX,e.x),i.minY=Math.min(i.minY,e.y),i.maxX=Math.max(i.maxX,e.x),i.maxY=Math.max(i.maxY,e.y)}}if(i.minX<ce&&i.minY<ce&&i.maxX>=0&&i.maxY>=0)return Object.assign(Object.assign({},i),{key:e})})(e,i);if(2===t);else if(1===t)return ot(r.collisionBox)?((t,e,i)=>{const r=t[0];return{minX:r.x+i.x1,minY:r.y+i.y1,maxX:r.x+i.x2,maxY:r.y+i.y2,key:e}})(e,i,r.collisionBox):function(t,e){const i=t[0],r=oe(arguments.length>2&&void 0!==arguments[2]?arguments[2]:5);return{minX:i.x-r,minY:i.y-r,maxX:i.x+r,maxY:i.y+r,key:e}}(e,i,r.radius)},he=(t,e,i)=>{const r=i[0].map((t=>[t.x,t.y]));if(ne()([t,e],r)){if(i.length>1)for(let r=1;r<i.length;r++){const s=i[r].map((t=>[t.x,t.y]));if(ne()([t,e],s))return!1}return!0}return!1},de=class{constructor(){this.tree=new(se())}populate(t){const e=[];for(let i=0,r=t.length;i<r;i++){const{type:r,geometry:s,properties:a}=t[i],n=le(r,s,i,a);st(n)&&e.push(n)}this.tree.load(e)}insert(t,e,i){if(!e)return;const r=le(t,e,i);r&&this.tree.insert(r)}query(t,e,i,r,s){const a=this.within({minX:t,minY:e,maxX:t,maxY:e}).filter((a=>{const n=s.features[a.key];if(n.geometry){if(3===n.type){for(let i=0;i<n.geometry.length;i++)if(he(t,e,n.geometry[i]))return!0;return!1}if(1===n.type){const s=n.geometry,a=1-i%1*.5,o=ot(n.properties.collisionBox)?function(t,e,i,r){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;return t>=i.x+r.x1*s&&t<=i.x+r.x2*s&&e>=i.y+r.y1*s&&e<=i.y+r.y2*s}(t,e,s[0],n.properties.collisionBox,a*r):function(t,e,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;const s=oe(arguments.length>3&&void 0!==arguments[3]?arguments[3]:5)*r;return Math.hypot(i.x-t,i.y-e)<=s}(t,e,s[0],n.properties.radius,a*r);return!!o}}return!0}));return a}within(t){return this.tree.search(t)}collides(t){return this.tree.collides(t)}},ce=8192,ue=class{get type(){throw new Error("Subclasses of VectorStore must override `type`")}get isEmpty(){return!1}get featureIndex(){return this._featureIndex}getFeatureVertexRanges(){if(null===this._featureVertexRanges){const t=this.features,e=t.length;this._featureVertexRanges=new Array(e);for(let i=0;i<e;i++)this._featureVertexRanges[i]=t[i].vertexRange}return this._featureVertexRanges}constructor(t){this.features=[],this._featureVertexRanges=null,this.options=Object.freeze(t)}populate(t,e,i){let r=[];const s={},a={},n={};let o=0;const l=i?Object.assign(Object.assign({},this.options),i):Object.assign({},this.options);for(let e=0;e<t.length;e++){const i=t[e],s=i.properties||{};for(const e in s){if(!Object.prototype.hasOwnProperty.call(s,e))continue;const i=s[e];if(!ft(i))continue;const r=i;if(r.startsWith("[")||r.startsWith("{"))try{s[e]=JSON.parse(r)}catch(t){}}s.zoom=this.options.zoom,r.push(i instanceof T?{type:i.type,featureIndex:o++,feature:i,sourceId:void 0,sourceLayerIndex:0,properties:s}:i)}(null==i?void 0:i.paint)&&(r=this.sortFeatures(r,i.paint)),this._featureVertexRanges=null;for(let t=0;t<r.length;t++){const i=this.addFeature(r[t],l);if(i){const{dependencies:t}=i;this.features.push(i),(null==t?void 0:t.glyphs)&&Object.assign(s,t.glyphs),(null==t?void 0:t.icons)&&Object.assign(a,t.icons),(null==t?void 0:t.patterns)&&Object.assign(n,t.patterns),e&&e.insert(i.type,i.geometry,i.featureIndex)}}}sortFeatures(t,e){return t}addFeature(t,e){throw new Error("Subclasses of VectorStore must override `addFeature`")}trim(){throw new Error("Subclasses of VectorStore must override `trim`")}query(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this._featureIndex||(this._featureIndex=new de,this._featureIndex.populate(this.features)),(t<1||e<1)&&(t=Math.round(t*ce),e=Math.round(e*ce));const s=this.featureIndex.query(t,e,i,r,this);if(s.length>0)return s.map((t=>this.features[t.key].properties))}serialize(){return{type:this.type,id:this.id,options:Object.assign({},this.options),layoutVertexArray:void 0,indexArray:void 0,features:[...this.features]}}static from(t){throw new Error("Subclasses of VectorStore must override `VectorStore.from`")}},pe=Math.pow(2,16)-1,me=function(t){const e=ce/(arguments.length>1&&void 0!==arguments[1]?arguments[1]:ce);return{x:Math.round(t.x*e),y:Math.round(t.y*e)}},ge=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=[],r=[],s=[];for(const a of t){if(0===a.length)continue;a!==t[0]&&i.push(r.length/2);const n=[];for(let t=0;t<a.length;t++){const e=r.length/2;r.push(a[t].x,a[t].y),n.push(e)}e&&n.push(n[0]),s.push(n)}return{flattened:r,holeIndices:i,lineList:s}},fe=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=at(t)?void 0:t.at(-1);return(!s||s.vertex.length+e>pe)&&(s={vertex:{offset:i,length:0},index:{offset:r,length:0}},t.push(s)),s},ve=(t,e)=>{const i=e.offset*t.stride;return t.data.subarray(i,i+e.length*t.stride)},ye=(t,e,i)=>{const r=i.offset*e.stride,s=i.length*e.stride;return lt(t.length>=s,"[MapsGL] Destination array is too small"),t.set(e.data.subarray(r,r+s)),t},be=(t,e)=>{const i={x:0,y:0};return["x","y"].forEach((r=>{const s=t[r];if("number"==typeof s)i[r]=s;else if("object"==typeof s){const{target:t,offset:a}=s;if(t&&/^text-\d+-(\w+)$/.test(t)){const s=Number.parseInt(t.split("-")[1],10),n=t.split("-")[2],o=e[s];if(o)if("x"===r)switch(n){case"left":i.x=o.x1+a;break;case"right":i.x=o.x2+a;break;case"center":i.x=o.x1+(o.x2-o.x1)/2+a}else switch(n){case"top":i.y=o.y1+a;break;case"bottom":i.y=o.y2+a;break;case"middle":i.y=o.y1+(o.y2-o.y1)/2+a}}}})),i},xe=(t,e)=>e instanceof Float32Array?t.FLOAT:e instanceof Uint16Array?t.UNSIGNED_SHORT:t.UNSIGNED_INT,we=class{constructor(t,e,i,r=!0,s=0,a=0,n=0){if(this.size=1,this.dynamic=!1,this.instanced=!1,this.stride=0,this.offset=0,this.divisor=0,this.needsUpdate=!1,Array.isArray(e))throw new TypeError("[Aeris GL] BufferAttribute: array should be a typed array");let o=0;void 0!==e&&(o=s?e.byteLength/s:e.length/i),this.data=e,this.size=i,this.type=xe(t,e),this.normalized=!0===r,this.stride=s,this.offset=a,this.divisor=n,this.instanced=n>0,this.count=o}},_e=class{constructor(t,e,i){if(Array.isArray(e))throw new TypeError("[Aeris GL] InterleavedBuffer: data should be a typed array");let r=0;void 0!==e&&(r=e.byteLength/i),this.data=e,this.type=xe(t,e),this.stride=i,this.count=r}},Me=class{get identifier(){return this._identifier}set identifier(t){this._identifier=t}get context(){return this._context}set context(t){this._context=t}get gl(){return this.context.gl}constructor(t){this._context=t}};function Ze(){var t=new It(3);return It!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ae(t,e,i){var r=new It(3);return r[0]=t,r[1]=e,r[2]=i,r}function Te(t,e,i,r){return t[0]=e,t[1]=i,t[2]=r,t}function Re(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}function Ge(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t}function Se(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function Ce(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Ie(t,e){var i=t[0],r=t[1],s=t[2],a=e[0],n=e[1],o=e[2],l=Math.sqrt(i*i+r*r+s*s)*Math.sqrt(a*a+n*n+o*o),h=l&&Ce(t,e)/l;return Math.acos(Math.min(Math.max(h,-1),1))}var Ve=Ge;function Fe(){var t=new It(4);return It!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}Ze();var We,Ee=Ft,ke=Lt,ze=Nt,Ne=Yt,Ye=Ot;Ze(),Ae(1,0,0),Ae(0,1,0),Fe(),Fe(),We=new It(9),It!=Float32Array&&(We[1]=0,We[2]=0,We[3]=0,We[5]=0,We[6]=0,We[7]=0),We[0]=1,We[4]=1,We[8]=1;const Le=t=>t*(180/Math.PI);class Oe{get x(){return this._value[0]}set x(t){this._value[0]=t,this.triggerChange()}get y(){return this._value[1]}set y(t){this._value[1]=t,this.triggerChange()}get z(){return this._value[2]}set z(t){this._value[2]=t,this.triggerChange()}get w(){return this._value[3]}set w(t){this._value[3]=t,this.triggerChange()}get value(){return this._value}get elements(){return this.value.length}constructor(t=0,e=0,i=0,r=0){this._changeCallbacks=[],this._value=Ee(t,e,i,r)}fromArray(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this.triggerChange(),this}toArray(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromObject(t){let{x:e,y:i,z:r,w:s}=t;return void 0!==e&&(this.x=e),void 0!==i&&(this.y=i),void 0!==r&&(this.z=r),void 0!==s&&(this.w=s),this.triggerChange(),this}toObject(){return{x:this.x,y:this.y}}fromAxisAngle(t,e){return function(t,e,i){i*=.5;var r=Math.sin(i);t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(i)}(this.value,t.value,e),this.triggerChange(),this}fromEuler(t){return function(t,e,i,r){var s=.5*Math.PI/180;e*=s,i*=s,r*=s;var a=Math.sin(e),n=Math.cos(e),o=Math.sin(i),l=Math.cos(i),h=Math.sin(r),d=Math.cos(r);t[0]=a*l*d-n*o*h,t[1]=n*o*d+a*l*h,t[2]=n*l*h-a*o*d,t[3]=n*l*d+a*o*h}(this.value,Le(t.x),Le(t.y),Le(t.z)),this.triggerChange(),this}fromRotationMatrix(){return this}set(t,e,i,r){return this._value=Ee(t,e,i,r),this.triggerChange(),this}length(){return ze(this.value)}clone(){return(new Oe).copy(this)}copy(t){let e=0;for(;e<this.value.length;)this.value[e]=t.value[e],e+=1;return this.triggerChange(),this}equals(t){return Ye(this.value,t.value)}identity(){return function(t){t[0]=0,t[1]=0,t[2]=0,t[3]=1}(this.value),this.triggerChange(),this}invert(){return function(t,e){var i=e[0],r=e[1],s=e[2],a=e[3],n=i*i+r*r+s*s+a*a,o=n?1/n:0;t[0]=-i*o,t[1]=-r*o,t[2]=-s*o,t[3]=a*o}(this.value,this.value),this.triggerChange(),this}conjugate(){return function(t,e){t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3]}(this.value,this.value),this.triggerChange(),this}normalize(){return Ne(this.value,this.value),this.triggerChange(),this}rotateX(t){return function(t,e,i){i*=.5;var r=e[0],s=e[1],a=e[2],n=e[3],o=Math.sin(i),l=Math.cos(i);t[0]=r*l+n*o,t[1]=s*l+a*o,t[2]=a*l-s*o,t[3]=n*l-r*o}(this.value,this.value,t),this.triggerChange(),this}rotateY(t){return function(t,e,i){i*=.5;var r=e[0],s=e[1],a=e[2],n=e[3],o=Math.sin(i),l=Math.cos(i);t[0]=r*l-a*o,t[1]=s*l+n*o,t[2]=a*l+r*o,t[3]=n*l-s*o}(this.value,this.value,t),this.triggerChange(),this}rotateZ(t){return function(t,e,i){i*=.5;var r=e[0],s=e[1],a=e[2],n=e[3],o=Math.sin(i),l=Math.cos(i);t[0]=r*l+s*o,t[1]=s*l-r*o,t[2]=a*l+n*o,t[3]=n*l-a*o}(this.value,this.value,t),this.triggerChange(),this}dot(t){return ke(this.value,t.value)}angleTo(t){return e=ke(this.value,t.value),Math.acos(2*e*e-1);var e}onChange(t){this._changeCallbacks.includes(t)||this._changeCallbacks.push(t)}triggerChange(){this._changeCallbacks.forEach((t=>t()))}}const je=Oe,De=Ze(),Xe=Ae(1,0,0),Be=Ze();class Pe extends jt{get value(){return this._value}get x(){return this.value[0]}set x(t){this.value[0]=t}get y(){return this.value[1]}set y(t){this.value[1]=t}get z(){return this.value[2]}set z(t){this.value[2]=t}get elements(){return this.value.length}constructor(t=0,e=0,i=0){super(),this._value=Ae(t,e,i)}fromArray(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=t[e+0],this.y=t[e+1],this.z=t[e+2],this}toArray(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e+0]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromObject(t){let{x:e,y:i,z:r}=t;return void 0!==e&&(this.x=e),void 0!==i&&(this.y=i),void 0!==r&&(this.z=r),this}toObject(){return{x:this.x,y:this.y,z:this.z}}set(t,e,i){return Te(this._value,t,e,i),this}setScalar(t){return this.set(t,t,t)}length(){return t=this.value,Math.hypot(t[0],t[1],t[2]);var t}distanceToSquared(t){return(r=(i=t.value)[0]-(e=this.value)[0])*r+(s=i[1]-e[1])*s+(a=i[2]-e[2])*a;var e,i,r,s,a}angle(){return Ie(this.value,Xe)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}clone(){return new Pe(this.x,this.y,this.z)}add(t){return Re(this.value,this.value,t.value),this}addScalar(t){return Te(Be,t,t,t),Re(this.value,this.value,Be),this}subtract(t){return Ge(this.value,this.value,t.value),this}subtractScalar(t){return Te(Be,t,t,t),Ge(this.value,this.value,Be),this}subVectors(t,e){return Ve(this.value,t.value,e.value),this}multiply(t){return function(t,e,i){t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2]}(this.value,this.value,t.value),this}multiplyScalar(t){return Se(this.value,this.value,t),this}divide(t){return function(t,e,i){t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2]}(this.value,this.value,t.value),this}divideScalar(t){return Se(this.value,this.value,1/t),this}distanceTo(t){return e=this.value,i=t.value,Math.hypot(i[0]-e[0],i[1]-e[1],i[2]-e[2]);var e,i}angleTo(t){return Ie(this.value,t.value)}dot(t){return Ce(this.value,t.value)}equals(t){return r=(e=this.value)[0],s=e[1],a=e[2],n=(i=t.value)[0],o=i[1],l=i[2],Math.abs(r-n)<=Ct*Math.max(1,Math.abs(r),Math.abs(n))&&Math.abs(s-o)<=Ct*Math.max(1,Math.abs(s),Math.abs(o))&&Math.abs(a-l)<=Ct*Math.max(1,Math.abs(a),Math.abs(l));var e,i,r,s,a,n,o,l}lerp(t,e){return function(t,e,i,r){var s=e[0],a=e[1],n=e[2];t[0]=s+r*(i[0]-s),t[1]=a+r*(i[1]-a),t[2]=n+r*(i[2]-n)}(this.value,this.value,t.value,e),this}normalize(){return function(t,e){var i=e[0],r=e[1],s=e[2],a=i*i+r*r+s*s;a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a}(this.value,this.value),this}scale(t){return Se(this.value,this.value,t),this}rotateX(t){return function(t,e,i,r){var s=[],a=[];s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],a[0]=s[0],a[1]=s[1]*Math.cos(r)-s[2]*Math.sin(r),a[2]=s[1]*Math.sin(r)+s[2]*Math.cos(r),t[0]=a[0]+i[0],t[1]=a[1]+i[1],t[2]=a[2]+i[2]}(this.value,this.value,De,t),this}rotateY(t){return function(t,e,i,r){var s=[],a=[];s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],a[0]=s[2]*Math.sin(r)+s[0]*Math.cos(r),a[1]=s[1],a[2]=s[2]*Math.cos(r)-s[0]*Math.sin(r),t[0]=a[0]+i[0],t[1]=a[1]+i[1],t[2]=a[2]+i[2]}(this.value,this.value,De,t),this}rotateZ(t){return function(t,e,i,r){var s=[],a=[];s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],a[0]=s[0]*Math.cos(r)-s[1]*Math.sin(r),a[1]=s[0]*Math.sin(r)+s[1]*Math.cos(r),a[2]=s[2],t[0]=a[0]+i[0],t[1]=a[1]+i[1],t[2]=a[2]+i[2]}(this.value,this.value,De,t),this}applyEuler(t){const e=(new je).fromEuler(t);return this.applyQuaternion(e)}applyMatrix3(t){return function(t,e,i){var r=e[0],s=e[1],a=e[2];t[0]=r*i[0]+s*i[3]+a*i[6],t[1]=r*i[1]+s*i[4]+a*i[7],t[2]=r*i[2]+s*i[5]+a*i[8]}(this.value,this.value,t.value),this}applyMatrix4(t){return function(t,e,i){var r=e[0],s=e[1],a=e[2],n=i[3]*r+i[7]*s+i[11]*a+i[15];t[0]=(i[0]*r+i[4]*s+i[8]*a+i[12])/(n=n||1),t[1]=(i[1]*r+i[5]*s+i[9]*a+i[13])/n,t[2]=(i[2]*r+i[6]*s+i[10]*a+i[14])/n}(this.value,this.value,t.value),this}applyQuaternion(t){return function(t,e,i){var r=i[0],s=i[1],a=i[2],n=e[0],o=e[1],l=e[2],h=s*l-a*o,d=a*n-r*l,c=r*o-s*n,u=s*c-a*d,p=a*h-r*c,m=r*d-s*h,g=2*i[3];d*=g,c*=g,p*=2,m*=2,t[0]=n+(h*=g)+(u*=2),t[1]=o+d+p,t[2]=l+c+m}(this.value,this.value,t.value),this}negate(){for(let t=0;t<this.elements;++t)this.value[t]=-this.value[t];return this}}const He=Pe;var Ue,Qe=function(t,e,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(t):r?r.value:e.get(t)};Ue=new WeakMap;const Ke=class{get type(){return Qe(this,Ue,"f").type}get data(){return Qe(this,Ue,"f").data}set data(t){Qe(this,Ue,"f").data=t}get count(){return Qe(this,Ue,"f").count}get buffer(){return Qe(this,Ue,"f").buffer}set buffer(t){Qe(this,Ue,"f").buffer=t}constructor(t,e,i=!0,r=0,s=0,a){this.size=1,this.dynamic=!1,this.instanced=!1,this.stride=0,this.offset=0,this.divisor=0,this.needsUpdate=!1,Ue.set(this,void 0),function(t,e,i,r,s){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,i)}(this,Ue,t),this.size=e,this.normalized=!0===i,this.stride=rt(a)?t.stride:a,this.offset=r,this.divisor=s,this.instanced=s>0}};let Je=1,qe=1;const $e=new He;class ti extends Me{get id(){return this._id}get attributes(){return this._attributes}get index(){return this.attributes.get("index")}get bounds(){return this._bounds}constructor(t,e={}){super(t),this.drawRange={start:0,count:0},this.instancedCount=0,this.isInstanced=!1,this._attributes=new Map,this._VAOs={};const i=t.gl;i||console.error("[Aeris GL] GL context not passed as first argument to Geometry"),this._id=Je,this.drawMode=t.gl.TRIANGLES,Je+=1,t.bindVertexArray(null),t.state.setActiveGeometry(null),Object.keys(e).forEach((t=>{const r=e[t];if(r instanceof we||r instanceof Ke)"index"===t?this.setIndex(r):this.addAttribute(t,r);else{const{size:e,data:s,normalized:a,stride:n,offset:o,divisor:l}=r;if(e&&s){const r=new we(i,s,e,a,n,o,l);"index"===t?this.setIndex(r):this.addAttribute(t,r)}}}))}addAttribute(t,e){const i=this.context.gl;if(e.id=qe,e.target="index"===t?i.ELEMENT_ARRAY_BUFFER:i.ARRAY_BUFFER,e.divisor=e.divisor||0,e.needsUpdate=!1,this.attributes.set(t,e),qe+=1,e.buffer||(e.buffer=i.createBuffer(),this.updateAttribute(e)),e.divisor){if(this.isInstanced=!0,this.instancedCount&&this.instancedCount!==e.count*e.divisor)return console.warn(`[Aeris GL] Geometry has multiple instanced buffers of different length - instancedCount: ${this.instancedCount}, count: ${e.count}, divisor: ${e.divisor}, attribute: ${t}`),this.instancedCount=Math.min(this.instancedCount,e.count*e.divisor),this.instancedCount;this.instancedCount=e.count*e.divisor}else"index"===t?this.drawRange.count=e.count:this.index||(this.drawRange.count=Math.max(this.drawRange.count,e.count))}getAttribute(t){return this.attributes.get(t)}setAttributeData(t,e){const i=this.getAttribute(t);i&&(i.data=e,i.needsUpdate=!0)}updateAttribute(t){const e=this.context.gl;e.bindBuffer(t.target,t.buffer),e.bufferData(t.target,t.data,e.STATIC_DRAW),t.needsUpdate=!1}removeAttribute(t){this.attributes.delete(t)}setIndex(t){if(Array.isArray(t)){const e=t.length>65535?new Uint32Array(t):new Uint16Array(t),i=new we(this.context.gl,e,1);this.addAttribute("index",i)}else t.size=1,this.addAttribute("index",t);this.drawRange.count=this.index.count}setVertices(t){const e=[];for(let i=0,r=t.length;i<r;i+=1){const r=t[i];e.push(r[0],r[1],r[2])}this.addAttribute("position",new we(this.context.gl,new Float32Array(e),3))}setNormals(t){this.addAttribute("normal",new we(this.context.gl,new Float32Array(t),2))}setUVs(t){this.addAttribute("uv",new we(this.context.gl,new Float32Array(t),2))}setColors(t){const e=[];for(let i=0,r=t.length;i<r;i+=1){let r=t[i];r instanceof Kt&&(r=r.toVector().toArray()),e.push(r[0],r[1],r[2],r[3])}this.addAttribute("color",new we(this.context.gl,new Float32Array(e),4))}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}setInstancedCount(t){this.instancedCount=t}createVAO(t){const e=t.attributeOrder,i=this.context.createVertexArray();this.context.bindVertexArray(i),this._VAOs[e]=i,this.bindAttributes(t),this.context.bindVertexArray(null)}bindAttributes(t){const e=this.context.gl;Object.keys(t.attributes).forEach((i=>{const r=this.attributes.get(i);if(!r)return;const s=t.attributes[i];e.bindBuffer(r.target,r.buffer),this.context.state.opts.boundBuffer=r.buffer;let a=1;35674===r.type&&(a=2),35675===r.type&&(a=3),35676===r.type&&(a=4);for(let t=0;t<a;t++)e.vertexAttribPointer(s+t,r.size,r.type,r.normalized,r.stride,r.offset),e.enableVertexAttribArray(s+t),this.context.vertexAttribDivisor(s+t,r.divisor)}));const i=this.attributes.get("index");i&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,i.buffer)}computeBoundingBox(){const{data:t,offset:e=0,stride:i,size:r}=this.attributes.get("position");this.bounds||(this._bounds={min:new He,max:new He,center:new He,scale:new He,radius:Number.POSITIVE_INFINITY});const s=this.bounds,a=s.min,n=s.max,o=s.center,l=s.scale;a.setScalar(+Number.POSITIVE_INFINITY),n.setScalar(Number.NEGATIVE_INFINITY);const h=i||r;for(let i=e,r=t.length;i<r;i+=h){const e=t[i+0],r=t[i+1],s=t[i+2];a.x=Math.min(e,a.x),a.y=Math.min(r,a.y),a.z=Math.min(s,a.z),n.x=Math.max(e,n.x),n.y=Math.max(r,n.y),n.z=Math.max(s,n.z)}return l.subVectors(n,a),o.add(a).add(n).divideScalar(2),s}computeBoundingSphere(){const{data:t,offset:e=0,stride:i,size:r}=this.attributes.get("position");this.bounds||this.computeBoundingBox();let s=0;const a=i||r;for(let i=e,r=t.length;i<r;i+=a)$e.fromArray([...t],i),s=Math.max(s,this.bounds.center.distanceToSquared($e));this.bounds.radius=Math.sqrt(s)}draw(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.drawMode;const i=this.context.gl,{start:r,count:s}=this.drawRange,a=`${this.id}_${t.attributeOrder}`;this.context.state.activeGeometryId!==a&&(this._VAOs[t.attributeOrder]||this.createVAO(t),t.context.bindVertexArray(this._VAOs[t.attributeOrder]),this.context.state.setActiveGeometry(a)),Object.keys(t.attributes).forEach((t=>{const e=this.getAttribute(t);e&&e.needsUpdate&&this.updateAttribute(e)})),this.isInstanced?this.index?this.context.drawElementsInstanced(e,s,this.index.type,this.index.offset+2*r,this.instancedCount):this.context.drawArraysInstanced(e,r,s,this.instancedCount):this.index?i.drawElements(e,s,this.index.type,this.index.offset+2*r):i.drawArrays(e,r,s)}clone(){const t={};this.attributes.forEach(((e,i)=>{t[i]=e}));const e=new ti(this.context,t);return e.drawMode=this.drawMode,e}dispose(){Object.keys(this._VAOs).forEach((t=>{this.context.deleteVertexArray(this._VAOs[t]),delete this._VAOs[t]})),this.attributes.forEach((t=>{this.gl.deleteBuffer(t.buffer)})),this.attributes.clear()}}const ei=ti,ii=class{constructor(){this.layoutVertexArray=new ie(2),this.colorVertexArray=new ie(2),this.indexArray=new ee(3),this.radiusArray=new ie(1),this.strokeWidthArray=new ie(1),this.segments={point:[]},this._geometry=null}get geometry(){return this._geometry}prepareGeometry(t){if(this._geometry){const t=this._geometry.getAttribute("fillColor");return void(t&&(t.needsUpdate=!0))}const e=(new Float32Array).BYTES_PER_ELEMENT,i=new _e(t.gl,this.layoutVertexArray.data,2*e),r=new _e(t.gl,this.colorVertexArray.data,4*e),s=new _e(t.gl,this.radiusArray.data,1*e),a=new _e(t.gl,this.strokeWidthArray.data,1*e),n=new ei(t,{position:{size:2,data:new Float32Array([0,1,0,0,1,0,1,1])},uv:{size:2,data:new Float32Array([0,1,0,0,1,0,1,1])},anchor:new Ke(i,2,!1,0,1),fillColor:new Ke(r,2,!1,0,1),strokeColor:new Ke(r,2,!1,2*e,1),strokeWidth:new Ke(a,1,!1,0,1,1*e),radius:new Ke(s,1,!1,0,1,1*e)});n.setIndex([0,1,2,0,2,3]),this._geometry=n}dispose(){var t;null===(t=this._geometry)||void 0===t||t.dispose(),this._geometry=null}trim(){this.layoutVertexArray.trim(),this.indexArray.trim(),this.colorVertexArray.trim(),this.radiusArray.trim(),this.strokeWidthArray.trim()}updateColorArray(t,e,i){const r=qt(i||new Kt("#000")),s=this.colorVertexArray.data,a=this.colorVertexArray.stride;for(let i=t;i<e;i++){const t=i*a;s[t]=r[0],s[t+1]=r[1]}}updateRadiusArray(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;const r=this.radiusArray.data;for(let s=t;s<e;s++)r[s]=i}updateStrokeWidthArray(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=this.strokeWidthArray.data;for(let s=t;s<e;s++)r[s]=i}};class ri extends ue{constructor(){super(...arguments),this.buffers=new ii}get type(){return"circle"}addFeature(t,e){const i=this.buffers,r=t.feature.asPoints(),s=t.feature.extent;if(!r)return;const a=i.layoutVertexArray.length,n=[];for(let t=0;t<r.length;t++){const e=r[t],o=me({x:e.x,y:e.y},s);if(r[t]=o,o.x<0||o.x>=ce||o.y<0||o.y>=ce)continue;const l=fe(i.segments.point,2,a+n.length/2,i.indexArray.length);n.push(o.x,o.y),l.vertex.length+=2,l.index.length+=1}const o=n.length/2;if(0===o)return;i.layoutVertexArray.resize(a+o);const l=i.layoutVertexArray.data,h=i.layoutVertexArray.stride;for(let t=0;t<o;t++)l[(a+t)*h]=n[2*t],l[(a+t)*h+1]=n[2*t+1];const d=2*i.layoutVertexArray.length,c=i.colorVertexArray.length;i.colorVertexArray.resize(d);const u=i.colorVertexArray.data,p=i.colorVertexArray.stride,m=qt(new Kt("#000"));for(let t=c;t<d;t++){const e=t*p;u[e]=m[0],u[e+1]=m[1]}const g=i.layoutVertexArray.length,f=i.radiusArray.length;i.radiusArray.resize(g),i.strokeWidthArray.resize(g);const v=i.radiusArray.data,y=i.strokeWidthArray.data;for(let t=f;t<g;t++)v[t]=10,y[t]=1;return{type:t.type,featureIndex:t.featureIndex,sourceId:t.sourceId,sourceLayerIndex:t.sourceLayerIndex,geometry:r,properties:t.properties,vertexRange:{start:a,end:i.layoutVertexArray.length},radius:10,strokeWidth:1}}trim(){this.buffers.trim()}dispose(){this.buffers.dispose()}serialize(){const t=this.buffers,e=super.serialize();return Object.assign(Object.assign({},e),{layoutVertexArray:t.layoutVertexArray.serialize(),colorVertexArray:t.colorVertexArray.serialize(),indexArray:t.indexArray.serialize(),radiusArray:t.radiusArray.serialize(),strokeWidthArray:t.strokeWidthArray.serialize(),segments:{point:t.segments.point}})}static from(t){const e=new ri(t.options);return at(t)?console.warn("[MapsGL] Cannot create CircleStore from invalid serialized data."):(e.features=t.features,e.buffers.segments.point=t.segments.point,e.buffers.layoutVertexArray=ie.from(t.layoutVertexArray),e.buffers.colorVertexArray=ie.from(t.colorVertexArray),e.buffers.indexArray=ee.from(t.indexArray),e.buffers.radiusArray=ie.from(t.radiusArray),e.buffers.strokeWidthArray=ie.from(t.strokeWidthArray)),e}}const si=ri,ai=(t,e,i)=>{if(null==t||rt(e)||!ft(e))return i;const r=e.split(/["'.[\]]{1,2}/),s=r.length;for(let e=0;e<s;e+=1)if(!at(r[e])&&null==(t=t[r[e]]))return i;return null==t?i:t},ni=t=>"function"===s(t),oi=class{constructor(){this.layoutVertexArray=new ie(2),this.colorVertexArray=new ie(2),this.patternVertexArray=new ie(4),this.pixelRatioArray=new ie(1),this.indexArray=new ee(3),this.indexArray2=new ee(2),this.segments={line:[],triangle:[]},this._geometry={fill:null,stroke:null}}get geometry(){return this._geometry}prepareGeometry(t,e){if(e&&this._geometry.stroke||!e&&this._geometry.fill){const t=e?this._geometry.stroke:this._geometry.fill;if(t)for(const e of t){const t=e.getAttribute("color");t&&(t.needsUpdate=!0)}return}const i=e?this.segments.line:this.segments.triangle,r=e?this.indexArray2:this.indexArray,s=[];for(let e=0;e<i.length;e++){const a=i[e],{vertex:n,index:o}=a,l=ve(this.layoutVertexArray,n),h=ve(this.colorVertexArray,n),d=ve(this.patternVertexArray,n),c=ve(this.pixelRatioArray,n),u=ye(new Uint16Array(o.length*r.stride),r,o),p=new ei(t,{position:{size:2,data:l},color:{size:2,data:h},pattern:{size:4,data:d},pixelRatio:{size:1,data:c},index:{size:1,data:u}});s.push(p)}e?this._geometry.stroke=s:this._geometry.fill=s}dispose(){var t,e;null===(t=this._geometry.fill)||void 0===t||t.forEach((t=>null==t?void 0:t.dispose())),null===(e=this._geometry.stroke)||void 0===e||e.forEach((t=>null==t?void 0:t.dispose())),this._geometry.fill=null,this._geometry.stroke=null}addVertex(t,e){this.layoutVertexArray.emplace([t,e])}trim(){this.layoutVertexArray.trim(),this.indexArray.trim(),this.indexArray2.trim(),this.colorVertexArray.trim(),this.patternVertexArray.trim(),this.pixelRatioArray.trim()}updateColorArray(t,e,i){const r=qt(i||new Kt("#000")),s=this.colorVertexArray.data,a=this.colorVertexArray.stride;for(let i=t;i<e;i++){const t=i*a;s[t]=r[0],s[t+1]=r[1]}}updatePatternArray(t,e,i,r){for(let s=t;s<e;s++)this.patternVertexArray.emplaceAt(s,i),this.pixelRatioArray.emplaceAt(s,r)}};var li=i(6570),hi=i.n(li);class di{constructor(t,e){if(e>t)throw new Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=t,this._minGranularity=e}getGranularityForZoomLevel(t){return Math.max(Math.floor(this._baseZoomGranularity/(1<<t)),this._minGranularity,1)}}class ci{constructor(t){this.fill=new di(t.fill.base,t.fill.min),this.line=new di(t.line.base,t.line.min),this.tile=new di(t.tile.base,t.tile.min),this.stencil=new di(t.stencil.base,t.stencil.min),this.circle=t.circle}}ci.noSubdivision={fill:{base:0,min:0},line:{base:0,min:0},tile:{base:0,min:0},stencil:{base:0,min:0},circle:1},ci.globeSubdivision={fill:{base:128,min:2},line:{base:512,min:0},tile:{base:128,min:32},stencil:{base:128,min:1},circle:3};class ui{constructor(t,e){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._coord=t,this._granularity=e,this._granularityCellSize=ce/e}subdividePolygonInternal(t,e){if(this._used)throw new Error("Subdivision: multiple use not allowed.");this._used=!0;const{flattened:i,holeIndices:r}=function(t){const e=[],i=[];for(const r of t)if(0!==r.length){r!==t[0]&&e.push(i.length/2);for(let t=0;t<r.length;t++)i.push(r[t].x,r[t].y)}return{flattened:i,holeIndices:e}}(t);let s;this._initializeVertices(i);try{const t=hi()(i,r),e=this._convertIndices(i,t);s=this._subdivideTrianglesScanline(e)}catch(t){console.error(t)}let a=[];return e&&(a=this._generateOutline(t)),{verticesFlattened:this._vertexBuffer,indicesTriangles:s,indicesLineList:a}}_getKey(t,e){return(t+=32768)<<16|Math.trunc(e+=32768)}_vertexToIndex(t,e){const i=Math.trunc(t),r=Math.trunc(e),s=this._getKey(i,r);if(this._vertexDictionary.has(s))return this._vertexDictionary.get(s);const a=this._vertexBuffer.length/2;return this._vertexDictionary.set(s,a),this._vertexBuffer.push(i,r),a}_initializeVertices(t){for(let e=0;e<t.length;e+=2)this._vertexToIndex(t[e],t[e+1])}_convertIndices(t,e){const i=[];for(let r=0;r<e.length;r++)i.push(this._vertexToIndex(t[2*e[r]],t[2*e[r]+1]));return i}_subdivideTrianglesScanline(t){if(this._granularity<2)return function(t,e){const i=[];for(let r=0;r<e.length;r+=3){const s=e[r],a=e[r+1],n=e[r+2],o=t[2*s],l=t[2*s+1];(t[2*a]-o)*(t[2*n+1]-l)-(t[2*a+1]-l)*(t[2*n]-o)>0?i.push(s,n,a):i.push(s,a,n)}return i}(this._vertexBuffer,t);const e=[],i=t.length;for(let r=0;r<i;r+=3){const i=[t[r+0],t[r+1],t[r+2]],s=[this._vertexBuffer[2*t[r+0]+0],this._vertexBuffer[2*t[r+0]+1],this._vertexBuffer[2*t[r+1]+0],this._vertexBuffer[2*t[r+1]+1],this._vertexBuffer[2*t[r+2]+0],this._vertexBuffer[2*t[r+2]+1]];let a=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let t=0;t<3;t++){const e=s[2*t],i=s[2*t+1];a=Math.min(a,e),o=Math.max(o,e),n=Math.min(n,i),l=Math.max(l,i)}if(a===o||n===l)continue;const h=Math.floor(a/this._granularityCellSize),d=Math.ceil(o/this._granularityCellSize),c=Math.floor(n/this._granularityCellSize),u=Math.ceil(l/this._granularityCellSize);if(h!==d||c!==u)for(let t=c;t<u;t++){const r=this._scanlineGenerateVertexRingForCellRow(t,s,i);gi(this._vertexBuffer,r,e)}else e.push(...i)}return e}_scanlineGenerateVertexRingForCellRow(t,e,i){const r=t*this._granularityCellSize,s=r+this._granularityCellSize,a=[];for(let t=0;t<3;t++){const n=e[2*t],o=e[2*t+1],l=e[2*(t+1)%6],h=e[(2*(t+1)+1)%6],d=e[2*(t+2)%6],c=e[(2*(t+2)+1)%6],u=l-n,p=h-o,m=0===u,g=0===p,f=(r-o)/p,v=(s-o)/p,y=Math.min(f,v),b=Math.max(f,v);if(!g&&(y>=1||b<=0)||g&&(o<r||o>s)){h>=r&&h<=s&&a.push(i[(t+1)%3]);continue}!g&&y>0&&a.push(this._vertexToIndex(n+u*y,o+p*y));const x=n+u*Math.max(y,0),w=n+u*Math.min(b,1);m||this._generateIntraEdgeVertices(a,n,o,l,h,x,w),!g&&b<1&&a.push(this._vertexToIndex(n+u*b,o+p*b)),(g||h>=r&&h<=s)&&a.push(i[(t+1)%3]),!g&&(h<=r||h>=s)&&this._generateInterEdgeVertices(a,n,o,l,h,d,c,w,r,s)}return a}_generateIntraEdgeVertices(t,e,i,r,s,a,n){const o=r-e,l=s-i,h=0===l,d=h?Math.min(e,r):Math.min(a,n),c=h?Math.max(e,r):Math.max(a,n),u=Math.floor(d/this._granularityCellSize)+1,p=Math.ceil(c/this._granularityCellSize)-1;if(h?e<r:a<n)for(let r=u;r<=p;r++){const s=r*this._granularityCellSize;t.push(this._vertexToIndex(s,i+l*(s-e)/o))}else for(let r=p;r>=u;r--){const s=r*this._granularityCellSize;t.push(this._vertexToIndex(s,i+l*(s-e)/o))}}_generateInterEdgeVertices(t,e,i,r,s,a,n,o,l,h){const d=s-i,c=a-r,u=n-s,p=(l-s)/u,m=(h-s)/u,g=Math.min(p,m),f=Math.max(p,m),v=r+c*g;let y=Math.floor(Math.min(v,o)/this._granularityCellSize)+1,b=Math.ceil(Math.max(v,o)/this._granularityCellSize)-1,x=o<v;const w=0===u;if(w&&(n===l||n===h))return;if(w||g>=1||f<=0){const t=i-n,r=a+(e-a)*Math.min((l-n)/t,(h-n)/t);y=Math.floor(Math.min(r,o)/this._granularityCellSize)+1,b=Math.ceil(Math.max(r,o)/this._granularityCellSize)-1,x=o<r}const _=d>0?h:l;if(x)for(let e=y;e<=b;e++)t.push(this._vertexToIndex(e*this._granularityCellSize,_));else for(let e=b;e>=y;e--)t.push(this._vertexToIndex(e*this._granularityCellSize,_))}_generateOutline(t){const e=[];for(const i of t){const t=mi(i,this._granularity,!0),r=this._pointArrayToIndices(t),s=[];for(let t=1;t<r.length;t++)s.push(r[t-1],r[t]);e.push(s)}return e}_pointArrayToIndices(t){const e=[];for(let i=0;i<t.length;i++){const r=t[i];e.push(this._vertexToIndex(r.x,r.y))}return e}}function pi(t,e,i){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return new ui(e,i).subdividePolygonInternal(t,r)}function mi(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!t||0===t.length)return[];if(t.length<2)return[];const r=t[0],s=t.at(-1),a=i&&(r.x!==s.x||r.y!==s.y);if(e<2)return a?[...t,t[0]]:[...t];const n=Math.floor(ce/e),o=[];o.push({x:t[0].x,y:t[0].y});const l=t.length,h=a?l:l-1;for(let e=0;e<h;e++){const i=t[e],r=e<l-1?t[e+1]:t[0],s=i.x,a=i.y,h=r.x,d=r.y,c=s!==h,u=a!==d;if(!c&&!u)continue;const p=h-s,m=d-a,g=Math.abs(p),f=Math.abs(m);let v=s,y=a;for(;;){const t=p>0?(Math.floor(v/n)+1)*n:(Math.ceil(v/n)-1)*n,e=m>0?(Math.floor(y/n)+1)*n:(Math.ceil(y/n)-1)*n,i=Math.abs(v-t),r=Math.abs(y-e),s=Math.abs(v-h),a=Math.abs(y-d),l=c?i/g:Number.POSITIVE_INFINITY,b=u?r/f:Number.POSITIVE_INFINITY;if((s<=i||!c)&&(a<=r||!u))break;if(l<b&&c||!u){v=t,y+=m*l;const e={x:v,y:y};o.at(-1).x===e.x&&o.at(-1).y===e.y||o.push(e)}else{v+=p*b,y=e;const t={x:v,y:y};o.at(-1).x===t.x&&o.at(-1).y===t.y||o.push(t)}}const b={x:h,y:d};o.at(-1).x===b.x&&o.at(-1).y===b.y||o.push(b)}return o}function gi(t,e,i){if(0===e.length)throw new Error("Subdivision vertex ring is empty.");let r=0,s=t[2*e[0]];for(let i=1;i<e.length;i++){const a=t[2*e[i]];a<s&&(s=a,r=i)}const a=e.length;let n=r,o=(n+1)%a;for(;;){const r=n-1>=0?n-1:a-1,s=(o+1)%a,l=t[2*e[r]],h=t[2*e[s]],d=t[2*e[n]],c=t[2*e[n]+1],u=t[2*e[o]+1];let p=!1;if(l<h)p=!0;else if(l>h)p=!1;else{const i=u-c,a=-(t[2*e[o]]-d),n=c<u?1:-1;((l-d)*i+(t[2*e[r]+1]-c)*a)*n>((h-d)*i+(t[2*e[s]+1]-c)*a)*n&&(p=!0)}if(p){const t=e[r],s=e[n],l=e[o];t!==s&&t!==l&&s!==l&&i.push(l,s,t),n-=1,n<0&&(n=a-1)}else{const t=e[s],r=e[n],l=e[o];t!==r&&t!==l&&r!==l&&i.push(l,r,t),o+=1,o>=a&&(o=0)}if(r===s)break}}class fi extends ue{constructor(){super(...arguments),this.buffers=new oi}get type(){return"fill"}sortFeatures(t,e){const i=e.fillSort();return i?t.filter((t=>ot(ai(t.properties,i.property)))).sort(((t,e)=>{const r=ai(t.properties,i.property),s=ai(e.properties,i.property);return"desc"===i.direction?s-r:r-s})):t}addFeature(t,e){var i,r,s,a,n,o;const l=t.feature.asPolygons(),h=t.feature.extent,d=this.buffers,c=null!==(i=null==e?void 0:e.tileCoord)&&void 0!==i?i:new mt(0,0,0),u=null===(r=null==e?void 0:e.paint)||void 0===r?void 0:r.config,p=null==e?void 0:e.patternDependencies,m=d.layoutVertexArray,g=d.indexArray,f=d.indexArray2,v=d.layoutVertexArray.length;if(!l)return;const y=null!==(a=null===(s=null==e?void 0:e.subdivisionGranularity)||void 0===s?void 0:s.fill.getGranularityForZoomLevel(c.z))&&void 0!==a?a:1;for(let t=0;t<l.length;t++){const e=l[t];for(let t=0;t<e.length;t++){const i=e[t];if(0!==i.length)for(let t=0;t<i.length;t++){const e=me({x:i[t].x,y:i[t].y},h);i[t]=e}}const i=pi(e,c,y),r=i.verticesFlattened,s=i.indicesTriangles,a=i.indicesLineList,n=r.length/2,o=fe(d.segments.triangle,n,m.length,g.length),u=o.vertex.length;if(s.length%3!=0)throw new Error("Invalid indices count");const p=m.length,v=g.length,b=f.length;m.resize(p+n);const x=m.data,w=m.stride;for(let t=0;t<n;t++){const e=(p+t)*w;x[e]=r[2*t],x[e+1]=r[2*t+1]}const _=s.length/3;g.resize(v+_);const M=g.data,Z=g.stride;for(let t=0;t<_;t++){const e=(v+t)*Z;M[e]=u+s[3*t+0],M[e+1]=u+s[3*t+1],M[e+2]=u+s[3*t+2]}o.vertex.length+=n,o.index.length+=_;const A=fe(d.segments.line,n,p,b),T=A.vertex.length;A.vertex.length+=n;let R=0;for(let t=0;t<a.length;t++)R+=a[t].length/2;f.resize(b+R);const G=f.data,S=f.stride;let C=0;for(let t=0;t<a.length;t++){const e=a[t];for(let t=0;t<e.length;t+=2){const i=(b+C)*S;G[i]=T+e[t],G[i+1]=T+e[t+1],C+=1}}A.index.length+=R}const b=d.layoutVertexArray.length,x=d.colorVertexArray.length;d.colorVertexArray.resize(b);const w=d.colorVertexArray.data,_=d.colorVertexArray.stride,M=qt(new Kt("#000"));for(let t=x;t<b;t++){const e=t*_;w[e]=M[0],w[e+1]=M[1]}const Z=d.patternVertexArray.length;d.patternVertexArray.resize(b),d.pixelRatioArray.resize(b);const A=d.patternVertexArray.data,T=d.pixelRatioArray.data,R=d.patternVertexArray.stride;for(let t=Z;t<b;t++){const e=t*R;A[e]=0,A[e+1]=0,A[e+2]=1,A[e+3]=1,T[t]=1}let G,S=null===(n=u.fill)||void 0===n?void 0:n.pattern;return ni(S)&&(S=S(t.properties)),S&&ot(S)&&(G="string"==typeof S?S:S.id,lt(ot(G),`[MapsGL] Icon image id was not provided for pattern: ${JSON.stringify(S)}`),p[G]="string"==typeof S||Object.assign(Object.assign({},S),{pixelRatio:null!==(o=S.pixelRatio)&&void 0!==o?o:1,pattern:!0})),{type:t.type,featureIndex:t.featureIndex,sourceId:t.sourceId,sourceLayerIndex:t.sourceLayerIndex,geometry:l,properties:t.properties,pattern:{id:G},vertexRange:{start:v,end:d.layoutVertexArray.length},dependencies:{patterns:p}}}trim(){this.buffers.trim()}dispose(){this.buffers.dispose()}serialize(){const t=this.buffers,e=super.serialize();return Object.assign(Object.assign({},e),{layoutVertexArray:t.layoutVertexArray.serialize(),colorVertexArray:t.colorVertexArray.serialize(),patternVertexArray:t.patternVertexArray.serialize(),pixelRatioArray:t.pixelRatioArray.serialize(),indexArray:t.indexArray.serialize(),index2Array:t.indexArray2.serialize(),segments:{line:t.segments.line,triangle:t.segments.triangle}})}static from(t){const e=new fi(t.options);return at(t)?console.warn("[MapsGL] Cannot create FillStore from invalid serialized data."):(e.features=t.features,e.buffers.segments.line=t.segments.line,e.buffers.segments.triangle=t.segments.triangle,e.buffers.layoutVertexArray=ie.from(t.layoutVertexArray),e.buffers.colorVertexArray=ie.from(t.colorVertexArray),e.buffers.patternVertexArray=ie.from(t.patternVertexArray),e.buffers.pixelRatioArray=ie.from(t.pixelRatioArray),e.buffers.indexArray=ee.from(t.indexArray),e.buffers.indexArray2=ee.from(t.index2Array)),e}}const vi=fi,yi=[0,1,2,0,2,3],bi=new Float32Array([0,-.5,1,-.5,1,.5,0,.5]),xi="bevel",wi="round",_i="miter",Mi="butt",Zi=class{constructor(){this.layoutVertexArray=new ie(2),this.colorVertexArray=new ie(2),this.indexArray=new ee(2),this.uvArray=new ie(2),this.previousVertexArray=new ie(2),this.nextVertexArray=new ie(2),this.sideArray=new te(1),this.widthArray=new ie(1),this.lengthArray=new ie(1),this.terminalArray=new ie(1),this.countersArray=new ie(1),this.segments={line:[]},this._geometry=null,this._capColorScratch=new Float32Array(0)}get geometry(){return this._geometry}prepareGeometry(t,e,i){var r,s,a;if(this._geometry){const t=this.colorVertexArray.data;for(const e of null!==(r=this._geometry.segments)&&void 0!==r?r:[]){if(!e)continue;const i=e.getAttribute("color");i?i.needsUpdate=!0:e.setAttributeData("color",t)}for(const e of null!==(s=this._geometry.joins)&&void 0!==s?s:[]){if(!e)continue;const i=e.getAttribute("color");i?i.needsUpdate=!0:e.setAttributeData("color",t)}const i=8*e.length;this._capColorScratch.length<i&&(this._capColorScratch=new Float32Array(i));const n=this._capColorScratch;let o=0;for(let i=0;i<e.length;i++){const{start:r,end:s}=e[i];let a=0;for(;a<2;){const e=2*(r+a);n[o++]=t[e],n[o++]=t[e+1],a+=1}for(a=1;a<=2;){const e=2*(s-a);n[o++]=t[e],n[o++]=t[e+1],a+=1}}if(o>0){const t=n.subarray(0,o);for(const e of null!==(a=this._geometry.caps)&&void 0!==a?a:[]){if(!e)continue;const i=e.getAttribute("color"),r=null==i?void 0:i.data;r&&r.length===o?(r.set(t),i.needsUpdate=!0):e.setAttributeData("color",t)}}return}const n=!1;let o=0;for(let t=0;t<e.length;t++){const{start:i,end:r}=e[t];o=Math.max(o,r-i)}const l=function(t,e,i,r){let s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=0;for(let t=0;t<i.length;t++){const{start:e,end:r}=i[t];a=Math.max(a,(r-e)/2)}const n=(new Float32Array).BYTES_PER_ELEMENT,o=e.layoutVertexArray.data,l=4*n,h={position:{size:2,data:bi},color:{size:2,data:e.colorVertexArray.data,stride:4*n,divisor:1},segments:{size:1,data:e.lengthArray.data,divisor:1},terminal:{size:1,data:e.terminalArray.data,divisor:1}};let d=1===a?i.length:e.layoutVertexArray.length/2;if(s&&a>1){const t=1===a?[0,0,2,2]:[0,4,6,10];h.pA={size:2,data:o,stride:l,offset:t[0]*n,divisor:1},h.pB={size:2,data:o,stride:l,offset:t[1]*n,divisor:1},h.pC={size:2,data:o,stride:l,offset:t[2]*n,divisor:1},h.pD={size:2,data:o,stride:l,offset:t[3]*n,divisor:1},d=(e.layoutVertexArray.length-4)/2}else h.pA={size:2,data:o,stride:l,offset:0*n,divisor:1},h.pB={size:2,data:o,stride:l,offset:2*n,divisor:1};const c=new ei(t,h);return c.setIndex(yi),c.setInstancedCount(d),c}(t,this,e,i,n),h=function(t,e,i,r){const s=e.layoutVertexArray.data,a=e.colorVertexArray.data;let n=0;for(let t=0;t<i.length;t++){const{start:e,end:r}=i[t];r-e>2&&(n+=6)}if(0===n)return;const o=new Float32Array(2*n),l=new Float32Array(2*n);let h=0;for(let t=0;t<i.length;t++){const{start:e,end:r}=i[t];if(r-e>2){let t=0;for(;t<3;){const i=e+2*t;o[h]=s[i+0],o[h+1]=s[i+1],l[h]=a[i+0],l[h+1]=a[i+1],h+=2,t+=1}for(t=1;t<=3;){const e=r-2*t;o[h]=s[e+0],o[h+1]=s[e+1],l[h]=a[e+0],l[h+1]=a[e+1],h+=2,t+=1}}}const d=(new Float32Array).BYTES_PER_ELEMENT,c=new ei(t,{position:{size:2,data:new Float32Array([0,-.5,1,-.5,1,.5,0,.5])},color:{size:2,data:l,stride:4*d,divisor:1},pA:{size:2,data:o,stride:4*d,offset:0*d,divisor:1},pB:{size:2,data:o,stride:4*d,offset:2*d,divisor:1},pC:{size:2,data:o,stride:4*d,offset:3*d,divisor:1}});return c.setInstancedCount(o.length/16),c.setIndex([0,1,2,0,2,3]),c}(t,this,e),d=o>2?function(t,e,i,r){let s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const a=r.strokeLineJoin(),n=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r={[xi]:{size:3,position:i?[1,0,0,0,1,0,0,0,1]:[0,0,0,1,0,0,0,1,0],index:void 0,id:void 0},[_i]:{size:4,position:i?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:[0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,1,0],index:[0,1,2,0,2,3],id:void 0},[wi]:{size:2,position:Array.from({length:e}).reduce(((t,i,r)=>{const s=2*Math.PI*r/e;return t.push(.5*Math.cos(s),.5*Math.sin(s)),t}),[0,0]),index:Array.from({length:e}).reduce(((t,e,i)=>(t.push(0,i+1,i+2),t)),[]),id:Array.from({length:e+2}).reduce(((t,e,i)=>(t.push(i),t)),[])}};return r[t]}(a,12),o=(new Float32Array).BYTES_PER_ELEMENT,l=2*o,h=e.layoutVertexArray.data,d=e.colorVertexArray.data,c={position:{size:n.size,data:new Float32Array(n.position)},color:{size:2,data:d,stride:l,divisor:1},pA:{size:2,data:h,stride:l,offset:0*o,divisor:1},pB:{size:2,data:h,stride:l,offset:4*o,divisor:1},pC:{size:2,data:h,stride:l,offset:8*o,divisor:1}};s&&a===wi&&(c.id={size:1,data:new Float32Array(n.id)});const u=new ei(t,c);return u.setInstancedCount(e.layoutVertexArray.length-4),s&&n.index&&u.setIndex(n.index),u}(t,this,e,i,n):void 0,c=function(t,e,i,r){const s=r.strokeLineCap(),a=function(t,e){return{butt:{},square:{size:2,position:[0,.5,0,-.5,.5,-.5,.5,.5],index:[0,1,2,0,2,3]},round:{size:2,position:(t=>{const e=[0,0];for(let t=0;t<=12;t++){const i=-.5*Math.PI+Math.PI*t/12;e.push(.5*Math.cos(i),.5*Math.sin(i))}return e})(),index:(t=>{const e=[];for(let t=0;t<12;t++)e.push(0,t+1,t+2);return e})()}}[t]}(s);if(s===Mi)return;const n=e.layoutVertexArray.data,o=e.colorVertexArray.data,l=4*i.length,h=new Float32Array(2*l),d=new Float32Array(2*l);let c=0;for(let t=0;t<i.length;t++){const{start:e,end:r}=i[t];let s=0;for(;s<2;){const t=2*e+2*s;h[c]=n[t+0],h[c+1]=n[t+1],d[c]=o[t+0],d[c+1]=o[t+1],c+=2,s+=1}for(s=1;s<=2;){const t=2*r-2*s;h[c]=n[t+0],h[c+1]=n[t+1],d[c]=o[t+0],d[c+1]=o[t+1],c+=2,s+=1}}const u=(new Float32Array).BYTES_PER_ELEMENT,p=4*u,m=new ei(t,{position:{size:a.size,data:new Float32Array(a.position)},color:{size:2,data:d,stride:p,divisor:1},pA:{size:2,data:h,stride:p,offset:0*u,divisor:1},pB:{size:2,data:h,stride:p,offset:2*u,divisor:1}});return m.setIndex(a.index),m}(t,this,e,i);this._geometry={segments:[l],terminals:[h],joins:[d],caps:[c]}}addVertex(t,e){this.layoutVertexArray.emplace([t,e])}trim(){this.layoutVertexArray.trim(),this.indexArray.trim(),this.colorVertexArray.trim(),this.uvArray.trim(),this.previousVertexArray.trim(),this.nextVertexArray.trim(),this.sideArray.trim(),this.widthArray.trim(),this.lengthArray.trim(),this.terminalArray.trim(),this.countersArray.trim()}dispose(){var t;this._geometry&&([...this._geometry.segments,...this._geometry.terminals,...null!==(t=this._geometry.joins)&&void 0!==t?t:[],...this._geometry.caps].forEach((t=>null==t?void 0:t.dispose())),this._geometry=null)}updateColorArray(t,e,i){const r=qt(i||new Kt("#000")),s=this.colorVertexArray.data,a=this.colorVertexArray.stride;for(let i=t;i<e;i++){const t=i*a;s[t]=r[0],s[t+1]=r[1]}}};function Ai(t,e){return t.x===e.x&&t.y===e.y}class Ti extends ue{constructor(){super(...arguments),this.buffers=new Zi}get type(){return"line"}addFeature(t,e){const i=this.buffers.layoutVertexArray,r=this.buffers.colorVertexArray,s=i.length;let a;if(2===t.type?a=this.addLines(t,e):3===t.type&&(a=this.addPolygons(t)),i.length===s)return;const n=(i.length-s)/2,o=r.length;r.resize(i.length);const l=r.data,h=r.stride,d=qt(new Kt("#000"));for(let t=o;t<i.length;t++){const e=t*h;l[e]=d[0],l[e+1]=d[1]}const c=this.buffers.lengthArray.length;this.buffers.lengthArray.resize(c+n);const u=this.buffers.lengthArray.data;for(let t=0;t<n;t++)u[c+t]=n;return{type:t.type,featureIndex:t.featureIndex,sourceId:t.sourceId,sourceLayerIndex:t.sourceLayerIndex,geometry:a,properties:t.properties,vertexRange:{start:s,end:i.length}}}addLines(t,e){var i,r,s;const a=null!==(i=null==e?void 0:e.tileCoord)&&void 0!==i?i:new mt(0,0,0),n=t.feature.asLines(),o=t.feature.extent,l=null!==(s=null===(r=null==e?void 0:e.subdivisionGranularity)||void 0===r?void 0:r.line.getGranularityForZoomLevel(a.z))&&void 0!==s?s:1;let h=0,d=0,c=0;for(let e=0;e<n.length;e++){const i=n[e],r=i.length;h+=r;const s=Array.from({length:r});for(let t=0;t<r;t++)s[t]=me(i[t],o);const a=mi(s,l);d+=a.length,c+=this.addLine(a,t,_i,Mi,0,0)}return n}addPolygons(t){const e=this.buffers,i=t.feature.asPolygons(),r=e.layoutVertexArray,s=e.indexArray;for(let a=0;a<i.length;a++){const n=i[a];for(let e=0;e<n.length;e++){const i=n[e];if(0!==i.length)for(let e=0;e<i.length;e++){const r=me({x:i[e].x,y:i[e].y},t.feature.extent);i[e]=r}}const{flattened:o,lineList:l}=ge(n),h=o.length/2,d=r.length;fe(e.segments.line,h,r.length,s.length).vertex.length+=h;for(let t=0;t<l.length;t++){const i=l[t];for(let t=0;t<i.length;t++){const r=i[t],s=o[2*r+0],a=o[2*r+1];e.addVertex(s,a),t>0&&t<i.length-1&&e.addVertex(s,a)}}const c=(r.length-d)/2,u=e.terminalArray.length;e.terminalArray.resize(u+c);const p=e.terminalArray.data;for(let t=0;t<c;t++){let e=0;0===t?e=1:t===c-1&&(e=2),p[u+t]=e}}return i}addLine(t,e,i,r,s,a){const n=this.buffers,o=3===e.feature.type;let l=t.length;for(;l>=2&&Ai(t[l-1],t[l-2]);)l-=1;let h=0;for(;h<l-1&&Ai(t[h],t[h+1]);)h+=1;if(l<(o?3:2))return 0;const d=fe(n.segments.line,10*l,n.layoutVertexArray.length,n.indexArray.length),c=n.layoutVertexArray.length,u=2*l-2*h-2;n.layoutVertexArray.resize(c+u);let p=0;for(let e=h;e<l;e++){const i=t[e];this.addVertex(n.layoutVertexArray,d,c+p,i),p+=1,e>h&&e<l-1&&(this.addVertex(n.layoutVertexArray,d,c+p,i),p+=1)}d.vertex.length+=t.length,d.index.length+=t.length;const m=(n.layoutVertexArray.length-c)/2,g=n.terminalArray.length;n.terminalArray.resize(g+m);const f=n.terminalArray.data;for(let t=0;t<m;t++){let e=0;1===m?e=3:0===t?e=1:t===m-1&&(e=2),f[g+t]=e}return u}addVertex(t,e,i,r){const s=i*t.stride;t.data[s+0]=r.x,t.data[s+1]=r.y,e.vertex.length+=1,e.index.length+=1}dispose(){this.buffers.dispose()}serialize(){const t=this.buffers,e=super.serialize();return Object.assign(Object.assign({},e),{layoutVertexArray:t.layoutVertexArray.serialize(),colorVertexArray:t.colorVertexArray.serialize(),indexArray:t.indexArray.serialize(),uvArray:t.uvArray.serialize(),previousVertexArray:t.previousVertexArray.serialize(),nextVertexArray:t.nextVertexArray.serialize(),sideArray:t.sideArray.serialize(),widthArray:t.widthArray.serialize(),lengthArray:t.lengthArray.serialize(),terminalArray:t.terminalArray.serialize(),countersArray:t.countersArray.serialize(),segments:{line:t.segments.line}})}static from(t){const e=new Ti(t.options);return at(t)?console.warn("[MapsGL] Cannot create LineStore from invalid serialized data."):(e.features=t.features,e.buffers.segments.line=t.segments.line,e.buffers.layoutVertexArray=ie.from(t.layoutVertexArray),e.buffers.colorVertexArray=ie.from(t.colorVertexArray),e.buffers.indexArray=ee.from(t.indexArray),e.buffers.uvArray=ie.from(t.uvArray),e.buffers.previousVertexArray=ie.from(t.previousVertexArray),e.buffers.nextVertexArray=ie.from(t.nextVertexArray),e.buffers.sideArray=te.from(t.sideArray),e.buffers.widthArray=ie.from(t.widthArray),e.buffers.lengthArray=ie.from(t.lengthArray),e.buffers.terminalArray=ie.from(t.terminalArray),e.buffers.countersArray=ie.from(t.countersArray)),e}}const Ri=Ti,Gi=(t,e,i)=>{for(let r=0;r<t.kernings[r];r++){const s=t.kernings[r];if(!(s.first<e||s.second<i))return s.first>e||s.first===e&&s.second>i?0:s.amount}return 0},Si=class{get font(){return this._config.font}constructor(t={}){this._config=Object.freeze(Object.assign({width:Number.POSITIVE_INFINITY,size:1,align:"left",letterSpacing:0,lineHeight:1.4,wordSpacing:0,wordBreak:!1},t))}generateLayout(t){const e=this.font,i=e.common.base,r=this._config.size,s=this._config.lineHeight,a=t.replaceAll(/[\n ]/g,"").length,n={position:{size:3,data:new Float32Array(4*a*3)},uv:{size:2,data:new Float32Array(4*a*2)},id:{size:4,data:new Float32Array(4*a)},index:{size:6,data:new Float32Array(6*a)}},o={position:[],uv:[],id:[],index:[],layout:[]};for(let t=0;t<a;t++)n.id.data[t]=t,n.index.data.set([4*t,4*t+2,4*t+1,4*t+1,4*t+2,4*t+3],6*t),o.id.push(t),o.index.push([4*t,4*t+2,4*t+1,4*t+1,4*t+2,4*t+3]);const l=r/i,h=e.chars.reduce(((t,e)=>(t[e.char]=e,t)),{}),d=[];let c=0,u=0,p=0;const m=()=>{const t={width:0,glyphs:[]};return d.push(t),u=c,p=0,t};let g=m();const f=/\s/,v=/\n/;let y=0;for(;c<t.length&&y<100;){y+=1;const i=t[c];if(!g.width&&f.test(i)){c+=1,u=c,p=0;continue}if(v.test(i)){c+=1,g=m();continue}const s=h[i]||h[" "];if(g.glyphs.length>0){const t=g.glyphs.at(-1)[0],i=Gi(e,s.id,t.id)*l;g.width+=i,p+=i}g.glyphs.push([s,g.width]);let a=0;if(f.test(i)?(u=c,p=0,a+=this._config.wordSpacing*r):a+=this._config.letterSpacing*r,a+=s.xadvance*l,g.width+=a,p+=a,g.width>this._config.width){if(this._config.wordBreak&&g.glyphs.length>1){g.width-=a,g.glyphs.pop(),g=m();continue}if(!this._config.wordBreak&&p!==g.width){const t=c-u+1;g.glyphs.splice(-t,t),c=u,g.width-=p,g=m();continue}}c+=1,y=0}g.width||d.pop();const b={width:Math.max(...d.map((t=>t.width))),height:d.length*r*this._config.lineHeight},{positions:x,uvs:w,layout:_}=this._populateBuffers(n,d,r,s,l,b);return o.position=x,o.uv=w,o.layout=_,{text:t,buffers:n,data:o,layout:_,numChars:a,numLines:d.length,size:b}}_populateBuffers(t,e,i,r,s,a){const n=this.font,o=n.common.scaleW,l=n.common.scaleH,h=this._config.align,d=/\s/,c=[],u=[],p=[];let m=.14*i,g=0;switch(h){case"bottom-left":case"bottom":case"bottom-right":m+=a.height;break;case"left":case"center":case"right":m+=.5*a.height}for(let a=0;a<e.length;a++){const n=e[a];let f=m;for(let e=0;e<n.glyphs.length;e++){const i=n.glyphs[e][0],r={anchor:null,offset:null,uv:null};let a=n.glyphs[e][1];switch(h){case"right":case"top-right":case"bottom-right":a-=n.width;break;case"center":case"top":case"bottom":a-=.5*n.width}if(d.test(i.char))continue;a+=i.xoffset*s,f-=i.yoffset*s;const v=i.width*s,y=i.height*s;t.position.data.set([a,f-y,0,a,f,0,a+v,f-y,0,a+v,f,0],4*g*3),c.push([a,f-y,0,a,f,0,a+v,f-y,0,a+v,f,0]),r.anchor=[a,1-f],r.offset=[v,y];const b=i.x/o,x=i.width/o,w=1-i.y/l,_=i.height/l;t.uv.data.set([b,w-_,b,w,b+x,w-_,b+x,w],4*g*2),u.push([b,w-_,b,w,b+x,w-_,b+x,w]),r.uv=[b,1-w,x,_],f=m,g+=1,p.push(r)}m-=i*r}return{positions:c,uvs:u,layout:p}}};function Ci(){var t=new It(2);return It!=Float32Array&&(t[0]=0,t[1]=0),t}function Ii(t,e){var i=new It(2);return i[0]=t,i[1]=e,i}function Vi(t,e,i){return t[0]=e,t[1]=i,t}function Fi(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t}function Wi(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}function Ei(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t}Ci();const ki=Ii(1,0),zi=Ci();class Ni extends jt{get value(){return this._value}get elements(){return this.value.length}get x(){return this.value[0]}set x(t){this.value[0]=t}get y(){return this.value[1]}set y(t){this.value[1]=t}constructor(t=0,e=0){super(),this._value=Ii(t,e)}fromArray(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=t[e],this.y=t[e+1],this}toArray(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.x,t[e+1]=this.y,t}fromObject(t){let{x:e,y:i}=t;return void 0!==e&&(this.x=e),void 0!==i&&(this.y=i),this}toObject(){return{x:this.x,y:this.y}}set(t,e){return Vi(this._value,t,e),this}setScalar(t){return this.set(t,t)}length(){return t=this.value,Math.hypot(t[0],t[1]);var t}angle(){return i=(t=this.value)[0],r=t[1],s=(e=ki)[0],a=e[1],n=Math.sqrt(i*i+r*r)*Math.sqrt(s*s+a*a),Math.acos(Math.min(Math.max(n&&(i*s+r*a)/n,-1),1));var t,e,i,r,s,a,n}copy(t){return this.x=t.x,this.y=t.y,this}clone(){return new Ni(this.x,this.y)}add(t){return Fi(this.value,this.value,t.value),this}addScalar(t){return Vi(zi,t,t),Fi(this.value,this.value,zi),this}subtract(t){return Wi(this.value,this.value,t.value),this}subtractScalar(t){return Vi(zi,t,t),Wi(this.value,this.value,zi),this}multiply(t){return function(t,e,i){t[0]=e[0]*i[0],t[1]=e[1]*i[1]}(this.value,this.value,t.value),this}multiplyScalar(t){return Ei(this.value,this.value,t),this}divide(t){return function(t,e,i){t[0]=e[0]/i[0],t[1]=e[1]/i[1]}(this.value,this.value,t.value),this}divideScalar(t){return Ei(this.value,this.value,1/t),this}distanceTo(t){return e=this.value,i=t.value,Math.hypot(i[0]-e[0],i[1]-e[1]);var e,i}dot(t){return(e=this.value)[0]*(i=t.value)[0]+e[1]*i[1];var e,i}equals(t){return r=(e=this.value)[0],s=e[1],a=(i=t.value)[0],n=i[1],Math.abs(r-a)<=Ct*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(s-n)<=Ct*Math.max(1,Math.abs(s),Math.abs(n));var e,i,r,s,a,n}lerp(t,e){return function(t,e,i,r){var s=e[0],a=e[1];t[0]=s+r*(i[0]-s),t[1]=a+r*(i[1]-a)}(this.value,this.value,t.value,e),this}normalize(){return function(t,e){var i=e[0],r=e[1],s=i*i+r*r;s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s}(this.value,this.value),this}scale(t){return Ei(this.value,this.value,t),this}applyMatrix3(t){return function(t,e,i){var r=e[0],s=e[1];t[0]=i[0]*r+i[3]*s+i[6],t[1]=i[1]*r+i[4]*s+i[7]}(this.value,this.value,t.value),this}applyMatrix4(t){return function(t,e,i){var r=e[0],s=e[1];t[0]=i[0]*r+i[4]*s+i[12],t[1]=i[1]*r+i[5]*s+i[13]}(this.value,this.value,t.value),this}}const Yi=Ni,Li=t=>{const e={x:0,y:0};switch(t){case"right":case"top-right":case"bottom-right":e.x=-.5;break;case"left":case"top-left":case"bottom-left":e.x=.5}switch(t){case"bottom":case"bottom-right":case"bottom-left":e.y=-.5;break;case"top":case"top-right":case"top-left":e.y=.5}return new Yi(e.x,e.y)},Oi=new Kt(0,0,0,1),ji=new Kt(0,0,0,0),Di=class{constructor(){this.layoutVertexArray=new ie(13),this.indexArray=new ee(3),this.opacityVertexArray=new ie(1),this.styleVertexArray=new ie(10),this.segments=[]}get geometry(){return this._geometry}prepareGeometry(t){var e;if(this._geometry){const t=this._geometry.getAttribute("fillColor");t&&(t.needsUpdate=!0);const i=this._geometry.getAttribute("strokeColor");i&&(i.needsUpdate=!0);const r=null!==(e=this._geometry.getAttribute("texCoordOffset"))&&void 0!==e?e:this._geometry.getAttribute("anchor");r&&(r.needsUpdate=!0);const s=this._geometry.getAttribute("opacity");return void(s&&(s.needsUpdate=!0))}const i=this.layoutVertexArray,r=this.opacityVertexArray,s=this.styleVertexArray,a=(new Float32Array).BYTES_PER_ELEMENT,n=new _e(t.gl,i.data,i.stride*a),o=new _e(t.gl,r.data,r.stride*a),l=new _e(t.gl,s.data,s.stride*a),h=new ei(t,{position:{size:2,data:new Float32Array([0,1,0,0,1,0,1,1])},uv:{size:2,data:new Float32Array([0,1,0,0,1,0,1,1])},anchor:new Ke(n,2,!1,0,1),glyph:new Ke(n,4,!1,2*a,1),texCoordOffset:new Ke(n,4,!1,6*a,1),reference:new Ke(n,1,!1,10*a,1),gridPosition:new Ke(n,2,!1,11*a,1),fillColor:new Ke(l,2,!1,0,1),strokeColor:new Ke(l,2,!1,2*a,1),strokeWidth:new Ke(l,1,!1,4*a,1),size:new Ke(l,1,!1,5*a,1),rotation:new Ke(l,1,!1,6*a,1),factor:new Ke(l,1,!1,7*a,1),random:new Ke(l,1,!1,8*a,1),atlasIndex:new Ke(l,1,!1,9*a,1),opacity:new Ke(o,1,!1,0,1)});h.setIndex([0,1,2,0,2,3]),this._geometry=h}trim(){this.layoutVertexArray.trim(),this.indexArray.trim(),this.opacityVertexArray.trim(),this.styleVertexArray.trim()}dispose(){var t;null===(t=this._geometry)||void 0===t||t.dispose(),this._geometry=null}updateTexturePositionArray(t,e,i){for(let r=t;r<e;r++){const t=r*this.layoutVertexArray.stride+6;for(let e=0;e<4;e++)this.layoutVertexArray.data[t+e]=i[e]}}updateOpacityArray(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];var s;if(e<=t)return;const a=this.opacityVertexArray.data,n=this.opacityVertexArray.stride;for(let r=t;r<e;r++)a[r*n]=i;r&&(null===(s=this.geometry)||void 0===s||s.setAttributeData("opacity",this.opacityVertexArray.data))}updateStyleArray(t,e,i,r,s,a,n,o,l,h){if(e<=t)return;const d=qt(i||Oi),c=qt(r||ji),u=this.styleVertexArray.data,p=this.styleVertexArray.stride,m=d[0],g=d[1],f=c[0],v=c[1];for(let i=t;i<e;i++){const t=i*p;u[t+0]=m,u[t+1]=g,u[t+2]=f,u[t+3]=v,u[t+4]=s,u[t+5]=a,u[t+6]=n,u[t+7]=o,u[t+8]=l,u[t+9]=h}}};class Xi extends ue{get type(){return"symbol"}constructor(t){super(t),this.includesSDFIcons=!1,this.text=new Di,this.icon=new Di,this.collisionArrays=[]}addFeature(t,e){var i,r;e=Object.assign({glyphDependencies:{},iconDependencies:{}},e);const s=t.feature.asPoints(),a=t.feature.extent,n=null==e?void 0:e.paint,o=null===(i=null==e?void 0:e.paint)||void 0===i?void 0:i.config,l=[];let h;const d=null===(r=null==o?void 0:o.icon)||void 0===r?void 0:r.shader,c=null==n?void 0:n.textLineCount();for(let e=0;e<c;e++){let i=null==n?void 0:n.textValue(t.properties,e);ot(i)?("number"==typeof i&&(i=`${i}`),"string"==typeof i&&l.push(i)):l.push("")}if((null==o?void 0:o.icon)&&(h=o.icon.type||o.icon.image||o.icon.shader||o.icon.atlas,ni(h)&&(h=h(t.properties))),!s||!0!==e.includeEmptySymbolData&&0===(null==l?void 0:l.length)&&!h&&!d)return;let u,p,m;const g=e.glyphDependencies,f=e.iconDependencies;for(let i=0;i<s.length;i++){const r=s[i],n=me({x:r.x,y:r.y},a);if(s[i]=n,n.x<0||n.x>=ce||n.y<0||n.y>=ce)continue;m={x:n.x,y:n.y};const o=this.features.find((t=>{var e;return t.anchor.x===m.x&&t.anchor.y===m.y&&(null===(e=t.text)||void 0===e?void 0:e.length)>0&&t.text[0].value===l[0]}));if((null==l?void 0:l.length)>0&&!o){const{symbol:i,glyphDependencies:r}=this.addSymbolAtAnchor(m,Object.assign(Object.assign({},t),{anchor:m,geometry:s,paint:e.paint,text:l.map(((t,e)=>({value:t,index:e,anchor:m,padding:[0,0],offset:[0,0],vertexRange:void 0,atlasIndex:void 0,collisionBox:void 0}))),icon:null}),e);u=i.text,r&&Object.assign(g,r)}if(ot(h)){const{symbol:i,iconDependencies:r}=this.addSymbolAtAnchor(m,Object.assign(Object.assign({},t),{anchor:m,geometry:s,paint:e.paint,text:void 0,icon:{image:h,anchor:m,padding:[0,0],offset:[0,0],vertexRange:void 0,atlasIndex:void 0,collisionBox:void 0},collisionBox:void 0}),e);p=i.icon,r&&Object.assign(f,r)}}return!0===e.includeEmptySymbolData||u||p?{key:n.symbolKey(t.properties),type:t.type,featureIndex:t.featureIndex,sourceId:t.sourceId,sourceLayerIndex:t.sourceLayerIndex,geometry:s,anchor:m,properties:t.properties,vertexRange:void 0,paint:e.paint,text:u,icon:p,dependencies:{glyphs:g,icons:f}}:void 0}addSymbolAtAnchor(t,e,i){if(!(t.x<0||t.x>=ce||t.y<0||t.y>=ce))return e.icon?this.addIcon(t,e,i.iconDependencies):e.text?this.addText(t,e,i.glyphDependencies):void 0}addSymbols(t,e,i,r,s,a){const n=e.layoutVertexArray,o=e.opacityVertexArray,l=e.styleVertexArray,h=fe(e.segments,4*i.length,n.length,e.indexArray.length);for(let e=0;e<i.length;e++){const{offset:d,texture:c,style:u}=i[e],{strokeWidth:p,size:m,opacity:g,rotation:f,factor:v}=u;n.emplace([t.x,t.y,d.x,d.y,d.w,d.h,c.x,c.y,c.w,c.h,r,s,a]),o.emplace(g),l.emplace([0,0,0,0,p,m,f,v,Math.random(),u.atlasIndex]),h.vertex.length+=2,h.index.length+=1}}addIcon(t,e,i){var r;const s=e.properties,a=e.paint,n=a.iconImage(s),o=a.iconShader(s);if(ot(n)){const t="string"==typeof n?n:n.id;lt(ot(t),`[MapsGL] Icon image id was not provided for symbol: ${JSON.stringify(n)}`),i[t]="string"==typeof n||Object.assign(Object.assign({},n),{pixelRatio:null!==(r=n.pixelRatio)&&void 0!==r?r:1}),e.icon.image=t}return e.icon.vertexRange={start:0,end:0},ot(o)&&this.layoutIcon(e,{}),{symbol:e,iconDependencies:i}}addText(t,e,i){const r=e.properties,s=e.paint;for(let t=0;t<e.text.length;t++){const a=e.text[t].value||"",n=s.textFont(r,t)||"Inter-Regular",o=s.textTransform(r,t)||"none";let l=a;"none"!==o&&("uppercase"===o?l=l.toUpperCase():"lowercase"===o?l=l.toLowerCase():"capitalize"===o&&(l=l.replaceAll(/\b\w/g,(t=>t.toUpperCase())))),void 0===i[n]&&(i[n]=[]);const h=i[n];for(let t=0;t<l.length;t++)a.charAt(t),h.push(a.charCodeAt(t));e.text[t].value=l,e.text[t].vertexRange={start:0,end:0}}return{symbol:e,glyphDependencies:i}}layoutSymbols(t,e){for(let i=0;i<this.features.length;i++){const r=this.features[i],s=r.text,a=r.icon,n={x1:Number.POSITIVE_INFINITY,y1:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY,anchorPointX:r.anchor.x,anchorPointY:r.anchor.y};if(s){this.layoutText(r,e);for(let t=0;t<s.length;t++){const e=s[t];e.collisionBox&&(n.x1=Math.min(n.x1,e.collisionBox.x1),n.y1=Math.min(n.y1,e.collisionBox.y1),n.x2=Math.max(n.x2,e.collisionBox.x2),n.y2=Math.max(n.y2,e.collisionBox.y2))}}((null==a?void 0:a.image)||(null==a?void 0:a.shader))&&(this.layoutIcon(r,t),a.collisionBox&&(n.x1=Math.min(n.x1,a.collisionBox.x1),n.y1=Math.min(n.y1,a.collisionBox.y1),n.x2=Math.max(n.x2,a.collisionBox.x2),n.y2=Math.max(n.y2,a.collisionBox.y2))),r.collisionBox=n}}layoutText(t,e){var i,r,s;const a=t.properties,n=this.text,o=[];for(let l=0;l<t.text.length;l++){const h=t.text[l].value,d=t.paint,c=t.text[l].anchor,u=ce/ht,p=d.textFont(a,l)||"Inter-Regular",m=d.textSize(a,l)||12,g=d.textAlign(a,l)||"center",f=Li(d.textAnchor(a,l)||"center"),v=d.textLineHeight(a,l)||1,y=d.textLetterSpacing(a,l)||0,b=d.textMaxWidth(a,l)||100,x=d.textOffset(a,l),w=d.textRotation(a,l)||0,_=d.symbolAllowOverlap()||!1,M=(d.symbolFadeOpacity(a),d.iconFactor(a)),Z={x:0,y:0};if(x){const{x:t,y:e}=be(x,o);Z.x=t,Z.y=e}const A=null===(r=null===(i=e[p])||void 0===i?void 0:i.ranges)||void 0===r?void 0:r[0];if(nt(A))return;const T=A.spec;if(!T)throw new Error(`[MapsGL] Missing font spec for font "${p}"`);const R=new Si({font:T,size:m,width:b,align:g,lineHeight:Math.max(0,v),letterSpacing:y}).generateLayout(`${h}`),{position:G,layout:S}=R.data,C=[],I={x1:Number.POSITIVE_INFINITY,y1:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY,anchorPointX:c.x,anchorPointY:c.y};for(let t=0;t<G.length;t++){const e=S[t],i={box:{tl:{x:e.anchor[0],y:e.anchor[1]},tr:{x:e.anchor[0]+e.offset[0],y:e.anchor[1]},bl:{x:e.anchor[0],y:e.anchor[1]+e.offset[1]},br:{x:e.anchor[0]+e.offset[0],y:e.anchor[1]+e.offset[1]}},offset:{x:e.anchor[0]+Z.x,y:e.anchor[1]+Z.y,w:e.offset[0],h:e.offset[1]},texture:{x:e.uv[0],y:e.uv[1],w:e.uv[2],h:e.uv[3]},style:{fillColor:d.fillColor(a)||new Kt("#000"),strokeColor:d.strokeColor(a)||new Kt("#000"),strokeWidth:d.strokeThickness(a)||0,size:m,opacity:_?1:0,rotation:w||0,factor:st(M)?M:0,atlasIndex:0}};I.x1=Math.min(I.x1,e.anchor[0]),I.y1=Math.min(I.y1,e.anchor[1]),I.x2=Math.max(I.x2,e.anchor[0]+e.offset[0]),I.y2=Math.max(I.y2,e.anchor[1]+e.offset[1]),C.push(i)}const V=I.x2-I.x1,F=I.y2-I.y1;C.forEach((t=>{t.offset.x+=V*f.x,t.offset.y+=F*f.y,I.x1=Math.min(I.x1,t.offset.x),I.y1=Math.min(I.y1,t.offset.y),I.x2=Math.max(I.x2,t.offset.x+t.offset.w),I.y2=Math.max(I.y2,t.offset.y+t.offset.h)}));const W=n.layoutVertexArray.length;this.addSymbols(c,n,C,t.featureIndex,0,0),t.text[l].vertexRange={start:W,end:n.layoutVertexArray.length},t.text[l].atlasIndex=null===(s=A.atlas)||void 0===s?void 0:s.index,o.push(Object.assign({},I)),I.x1*=u,I.y1*=u,I.x2*=u,I.y2*=u,t.text[l].collisionBox=I}this.collisionArrays.push({textBox:t.text[0].collisionBox,textFeatureIndex:t.featureIndex})}layoutIcon(t,e){var i,r;const s=t.properties,a=this.icon,n=e[t.icon.image]||{size:{width:20,height:20},position:{x:0,y:0,w:1,h:1},pixelRatio:1,sdf:!1},o=ce/ht,l=n.pixelRatio||1,h=t.paint,d=t.icon.anchor,c=h.iconSize(s)||{width:n.size.width/l,height:n.size.height/l},u=h.iconRotation(s),p=h.iconOffset(s),m=Li(h.iconAnchor(s)||"center"),g=h.iconFactor(s),f=[],v=c.width,y=c.height,b=c.width/(n.size.width/l),x={x1:Number.POSITIVE_INFINITY,y1:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY,anchorPointX:d.x,anchorPointY:d.y};n.position||console.warn("[MapsGL] Missing icon position for icon:",t.icon.image,e),n.sdf&&(this.includesSDFIcons=!0);const w={box:{tl:{x:d.x,y:d.y},tr:{x:d.x+v,y:d.y},bl:{x:d.x,y:d.y+y},br:{x:d.x+v,y:d.y+y}},offset:{x:-v/2+p.x,y:-y/2+p.y,w:v,h:y},texture:n.position?{x:n.position.x,y:n.position.y,w:n.position.w,h:n.position.h}:{x:0,y:0,w:1,h:1},style:{fillColor:h.fillColor(s)||new Kt("#000"),strokeColor:h.strokeColor(s)||new Kt("#000"),strokeWidth:h.strokeThickness(s)||0,size:b,opacity:1,rotation:u||0,factor:st(g)?g:0,atlasIndex:0}};w.offset.x+=v*m.x,w.offset.y+=y*m.y,f.push(w),x.x1=Math.min(x.x1,w.offset.x),x.y1=Math.min(x.y1,w.offset.y),x.x2=Math.max(x.x2,w.offset.x+w.offset.w),x.y2=Math.max(x.y2,w.offset.y+w.offset.h);const _=null!==(i=t.properties.gridRow)&&void 0!==i?i:0,M=null!==(r=t.properties.gridCol)&&void 0!==r?r:0,Z=a.layoutVertexArray.length;this.addSymbols(d,a,f,t.featureIndex,_,M),t.icon.vertexRange={start:Z,end:a.layoutVertexArray.length},x.x1*=o,x.y1*=o,x.x2*=o,x.y2*=o,t.icon.collisionBox=x,this.collisionArrays.push({iconBox:x,iconFeatureIndex:t.featureIndex})}trim(){this.text.trim(),this.icon.trim()}dispose(){this.text.dispose(),this.icon.dispose()}serialize(){const t=super.serialize();return Object.assign({features:this.features.map((t=>(t.paint=void 0,t))),text:{layoutVertexArray:this.text.layoutVertexArray.serialize(),indexArray:this.text.indexArray.serialize(),opacityVertexArray:this.text.opacityVertexArray.serialize(),styleVertexArray:this.text.styleVertexArray.serialize(),segments:[...this.text.segments]},icon:{layoutVertexArray:this.icon.layoutVertexArray.serialize(),indexArray:this.icon.indexArray.serialize(),opacityVertexArray:this.icon.opacityVertexArray.serialize(),styleVertexArray:this.icon.styleVertexArray.serialize(),segments:[...this.icon.segments]},collisionArrays:[...this.collisionArrays],includesSDFIcons:this.includesSDFIcons},t)}static from(t){const e=new Xi(t.options);if(e.id=t.id,e.includesSDFIcons=t.includesSDFIcons,at(t))console.warn("[MapsGL] Cannot create SymbolStore from invalid serialized data.");else{const i=new Di;i.layoutVertexArray=ie.from(t.text.layoutVertexArray),i.indexArray=ee.from(t.text.indexArray),i.opacityVertexArray=ie.from(t.text.opacityVertexArray),i.styleVertexArray=ie.from(t.text.styleVertexArray),i.segments=t.text.segments,e.text=i;const r=new Di;r.layoutVertexArray=ie.from(t.icon.layoutVertexArray),r.indexArray=ee.from(t.icon.indexArray),r.opacityVertexArray=ie.from(t.icon.opacityVertexArray),r.styleVertexArray=ie.from(t.icon.styleVertexArray),r.segments=t.icon.segments,e.icon=r,e.collisionArrays=t.collisionArrays,e.features=t.features}return e}}const Bi=Xi;class Pi extends ue{get type(){return"empty"}static from(t){return new Pi({tile:t.options.tile,sourceLayerIndex:t.options.sourceLayerIndex,sourceId:t.options.sourceId,zoom:t.options.zoom})}}const Hi=Pi,Ui=t=>ot(t)&&ft(t)?t.replace(/(?:^|\s)\S/g,(t=>t.toUpperCase())):"",Qi=/^(async\s+)?(function(\s+\w+)?\s*\(|\(?[\s\w,]*\)?\s*=>)/,Ki=["constructor","__proto__","prototype","globalThis","window","document","self","top","parent","frames","opener","location","import(","eval(","Function(","XMLHttpRequest","fetch("];let Ji=null,qi=!1,$i=!1;function tr(){$i||(console.warn("[MapsGL] Style functions are deprecated as of v1.9.0. Use style expressions instead. Support for style functions will be removed in a future release."),$i=!0)}const er=t=>{let e=t.toString().replaceAll("://",":\\/\\/").replaceAll(/\/{2}.*/g,"").replaceAll("\n","").replaceAll("\t","").replaceAll(/\s+/g," ").trim();return e=function(t){const e=t.match(/^(.*?=>)\s*([^{].*)$/);if(!e)return t;const[,i,r]=e,s=r.trim();return s?`${i} { return ${s}; }`:t}(e),t.name&&new RegExp(`^\\s*${t.name}\\s*([(])`).test(e)&&(e=`function ${e}`),JSON.stringify(`${Ji?`_FUNC${Ji}:`:"_FUNC"}${e}`)},ir=(t,e)=>{if("string"!=typeof e||!e.startsWith("_FUNC"))return e;if(Ji){const t=`_FUNC${Ji}:`;if(e.startsWith(t)){const i=e.slice(t.length);if(!Qi.test(i.trim()))throw new Error("[MapsGL] Rejected invalid serialized function source");return new Function(`'use strict'; return (${i}).apply(this, arguments);`)}}qi||(console.warn("[MapsGL] Deserializing a function without session-token verification. This path is deprecated and will be removed in a future version."),qi=!0);const i=e.replace(/^_FUNC/,"");if(!function(t){const e=t.trim();if(!e||e.length>4e3)return!1;if(!Qi.test(e))return!1;const i=e.toLowerCase();return!Ki.some((t=>i.includes(t.toLowerCase())))}(i))throw new Error("[MapsGL] Rejected unsafe serialized function source");return new Function(`'use strict'; return (${i}).apply(this, arguments);`)},rr=(t,e)=>{null!=e&&Object.keys(e).forEach((i=>{if(null!=(r=e[i])&&"object"==typeof r&&"function"==typeof r.resolve)if(t[i]=e[i].getRaw(),a(t[i])){const e={};rr(e,t[i]),t[i]=e}else ni(t[i])&&(tr(),t[i]=er(t[i]));else Array.isArray(e[i])?t[i]=e[i].map((t=>{if(a(t)){const e={};return rr(e,t),e}return ni(t)?(tr(),er(t)):t})):a(e[i])?(t[i]={},rr(t[i],e[i])):ni(e[i])?["value","transform","key","rank","size","factor","offset","image","pattern"].includes(i)&&(tr(),t[i]=er(e[i])):t[i]=e[i];var r}))},sr=(t,e)=>{if(rt(e))throw new Error("[MapsGL] Serialized style is null or undefined");Object.keys(e).forEach((i=>{if(Array.isArray(e[i]))t[i]=e[i].map((t=>{if(st(t)&&a(t)){const e={};return sr(e,t),e}return/_FUNC/.test(t)?JSON.parse(t,ir):t}));else if(a(e[i]))t[i]={},sr(t[i],e[i]);else if(/_FUNC/.test(e[i]))try{t[i]=JSON.parse(e[i],ir)}catch(t){console.error(`[MapsGL] Failed to deserialize paint style function '${i}':`,t)}else t[i]=e[i]}))},ar=(t,e,i,r)=>{let s=r;if(i=i||{},rt(e))return s;if(function(t){return a(t)&&"function"==typeof t.resolve}(e))s=e.resolve(i);else if(a(e)){if("object"===t||"any"===t)return e;if("color"===t&&e instanceof Kt)return e;if(e.property)if(e.mapping){const t=ai(i,e.property);s=e.mapping[t]}else s=ai(i,e.property)}else s=ni(e)?e(i):e;if("color"===t){if(s instanceof Kt)return s;s=bt(n=s)||ft(n)?function(t){const e="string"==typeof t?`s:${t.trim().toLowerCase()}`:`n:${t}`,i=Ut.get(e);if(i)return new Qt(i.r,i.g,i.b,i.a||1);const r=new Qt(t).toObject(!1);if(Ut.size>=256){const t=Ut.keys().next().value;t&&Ut.delete(t)}return Ut.set(e,r),new Qt(r.r,r.g,r.b,r.a||1)}(n):n instanceof Qt?n:a(n)&&st(n.r)&&st(n.g)&&st(n.b)&&st(n.a)?new Qt(n.r,n.g,n.b,n.a):null}var n;return s},nr=t=>3.280839895*t,or=t=>12*nr(t),lr=t=>25.4*t,hr=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=0;return i=Math.pow(Math.pow(10,t/10)/200,5/8),e?i/3600:i},dr=t=>{switch(t){case"inHg":case"in":case"in/hr":return 2;case"cm":return 1;default:return 0}},cr=(t,e,i,r)=>{switch(t){case"temperature":if("C"===i&&"F"===r)return 1.8*e+32;if("F"===i&&"C"===r)return 5/9*(e-32);break;case"temperature-change":if("C"===i&&"F"===r)return 1.8*e;if("F"===i&&"C"===r)return.555*e;break;case"speed":if("km/h"===i&&"mph"===r)return.6213712*e;if("mph"===i&&"km/h"===r)return 1.609344*e;if("m/s"===i&&"mph"===r)return 2.236936*e;if("m/s"===i&&"km/h"===r)return 3.6*e;if("mph"===i&&"m/s"===r)return.45*e;if("km/h"===i&&"m/s"===r)return.2777777778*e;break;case"pressure":if("mb"===i&&"hPa"===r)return 100*e;if("mb"===i&&"inHg"===r)return.029529983071445*e;if("hPa"===i&&"mb"===r)return.01*e;if("inHg"===i&&"mb"===r)return 33.86389*e;break;case"distance":if("m"===i&&"km"===r)return.001*e;if("m"===i&&"ft"===r)return nr(e);if("m"===i&&"in"===r)return or(e);if("m"===i&&"mi"===r)return 62e-5*e;if("km"===i&&"m"===r)return 1e3*e;if("ft"===i&&"m"===r)return.3048*e;if("km"===i&&"mi"===r)return.62*e;if("mi"===i&&"m"===r)return 1609.34*e;break;case"precipitation":case"snowfall":if("mm/sec"===i)return cr(t,3600*e,"mm",r);if("in"===i&&"mm"===r)return lr(e);if("in"===i&&"m"===r)return.0254*e;if("in"===i&&"mm/sec"===r)return lr(e)/3600;if("m"===i&&"in"===r)return or(e);if("m"===i&&"cm"===r)return 100*e;if("cm"===i&&"m"===r)return e/100;if("cm"===i&&"mm"===r)return 10*e;if("mm"===i&&"mm/sec"===r)return e/3600;if("mm"===i&&"in"===r)return.03937*e;break;case"time":if("hr"===i&&"min"===r)return 60*e;if("hr"===i&&"sec"===r)return 3600*e;if("hr"===i&&"ms"===r)return 36e5*e;if("min"===i&&"hr"===r)return e/60;if("min"===i&&"sec"===r)return 60*e;if("min"===i&&"ms"===r)return 6e4*e;if("sec"===i&&"hr"===r)return e/3600;if("sec"===i&&"min"===r)return e/60;if("sec"===i&&"ms"===r)return 1e3*e;if("ms"===i&&"hr"===r)return e/36e5;if("ms"===i&&"min"===r)return e/6e4;if("ms"===i&&"sec"===r)return e/1e3;break;case"rate":if("mm/hr"===i&&"mm/sec"===r)return e/3600;if("mm/sec"===i&&"mm/hr"===r)return 3600*e;if("mm/sec"===i&&"in/hr"===r)return 3600*e*.03937;if("in/hr"===i&&"mm/sec"===r)return e/3600/.03937;if("dbz"===i&&"mm/hr"===r)return hr(e);if("dbz"===i&&"mm/sec"===r)return hr(e,!0)}return e},ur=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[0-2][1-9]|[1-3]0|3[01])T(?:[01]\d|2[0-3])(?::[0-6]\d){1,2}(?:\.\d{3})?(?:[+-][0-2]\d:[0-5]\d|Z)?$/,pr=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(ft(t)&&ur.test(t))return(t=>{const e=t.split(/\D+/),i=t.includes("+")?-1:1;return new Date(Date.UTC(+e[0],+e[1]-1,+e[2],+e[3]+i*(+e[7]||0),+e[4]+i*(+e[8]||0),+e[5],+e[6]||0))})(t);if(ft(t)||bt(t)){const r=new Date(t);return e?(i=r,new Date(i.getTime()+60*i.getTimezoneOffset()*1e3)):r}var i;return(t=>"date"===s(t))(t)?t:null},mr={literal:"literal",get:"get",has:"has",var:"var",properties:"properties",zoom:"zoom",coalesce:"coalesce",eq:"==",neq:"!=",lt:"<",lte:"<=",gt:">",gte:">=",not:"!",all:"all",any:"any",toNumber:"to-number",toString:"to-string",toDate:"to-date",toLocaleString:"to-locale-string",toUnit:"to-unit",toBoolean:"to-boolean",typeOf:"typeof",number:"number",string:"string",boolean:"boolean",object:"object",add:"+",subtract:"-",mod:"%",pow:"^",multiply:"*",divide:"/",abs:"abs",ceil:"ceil",floor:"floor",round:"round",min:"min",max:"max",sqrt:"sqrt",ln:"ln",ln2:"ln2",log2:"log2",log10:"log10",sin:"sin",cos:"cos",tan:"tan",asin:"asin",acos:"acos",atan:"atan",e:"e",pi:"pi",at:"at",in:"in",regex:"regex",indexOf:"index-of",length:"length",slice:"slice",concat:"concat",downcase:"downcase",upcase:"upcase",step:"step",interpolate:"interpolate",case:"case",match:"match",let:"let",mapTime:"map-time",time:"time",now:"now"},gr=new Set(Object.values(mr)),fr=(new Set([mr.mapTime,mr.time,mr.now]),new Map),vr=new Map,yr=128;function br(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&gr.has(t[0])}new Set([mr.eq,mr.neq,mr.lt,mr.lte,mr.gt,mr.gte]);let xr=0;function wr(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&Object.getPrototypeOf(t)===Object.prototype}function _r(t,e,i){const r={};for(const s of Object.keys(t)){const a=t[s];r[s]=br(a)?Mr(a,e,i):wr(a)?_r(a,e,i):a}return r}function Mr(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var r,s;if(!Array.isArray(t))return"string"==typeof t&&t.startsWith("$")?i[t.slice(1)]:wr(t)?_r(t,e,i):t;const a=t,n=a[0],o=a.length-1;switch(n){case mr.literal:return a[1];case mr.get:{const t=o>=2?Mr(a[2],e,i):e;return Rr(a[1],null!=t?t:{})}case mr.has:{const t=o>=2?Mr(a[2],e,i):e;return"string"==typeof a[1]&&a[1]in(null!=t?t:{})}case mr.var:return i["string"==typeof a[1]?a[1]:Mr(a[1],e,i)];case mr.properties:return e;case mr.zoom:return null!==(s=null!==(r=e.$zoom)&&void 0!==r?r:e.zoom)&&void 0!==s?s:0;case mr.mapTime:case mr.time:return xr;case mr.now:return Date.now();case mr.coalesce:for(let t=1;t<=o;t++){const r=Mr(a[t],e,i);if(null!=r)return r}return null;case mr.eq:return Tr(a,e,i,1);case mr.neq:return!Tr(a,e,i,1);case mr.lt:return Ar(a[1],e,i,!0)<Ar(a[2],e,i,!1);case mr.lte:return Ar(a[1],e,i,!0)<=Ar(a[2],e,i,!1);case mr.gt:return Ar(a[1],e,i,!0)>Ar(a[2],e,i,!1);case mr.gte:return Ar(a[1],e,i,!0)>=Ar(a[2],e,i,!1);case mr.not:return!Mr(a[1],e,i);case mr.all:for(let t=1;t<=o;t++)if(!Mr(a[t],e,i))return!1;return!0;case mr.any:for(let t=1;t<=o;t++)if(Mr(a[t],e,i))return!0;return!1;case mr.toNumber:for(let t=1;t<=o;t++){const r=Mr(a[t],e,i),s=Number(r);if(!Number.isNaN(s))return s}return Number.NaN;case mr.toString:return String(Mr(a[1],e,i));case mr.toDate:{const t=Mr(a[1],e,i);return pr(t)}case mr.toLocaleString:{const t=Mr(a[1],e,i),r=o>=2?String(Mr(a[2],e,i)):"en-US",s=Number(t);return Number.isNaN(s)?String(t):s.toLocaleString(r)}case mr.toUnit:{let t=Mr(a[1],e,i);if(rt(t)||Number.isNaN(t))return null;t=Number(t);const r=String(Mr(a[2],e,i)),s=String(Mr(a[3],e,i)),n=o>=4?String(Mr(a[4],e,i)):s,l=o>=5?Number(Mr(a[5],e,i)):dr(n);let h;return h=s===n?Zr(t,l):Zr(cr(r,t,s,n),Number.isNaN(l)?0:l),h.toFixed(Number.isNaN(l)?0:l)}case mr.toBoolean:{const t=Mr(a[1],e,i);return""!==t&&0!==t&&!1!==t&&null!=t&&!Number.isNaN(t)}case mr.typeOf:return typeof Mr(a[1],e,i);case mr.number:for(let t=1;t<=o;t++){const r=Mr(a[t],e,i);if("number"==typeof r&&!Number.isNaN(r))return r}throw new Error("number assertion failed");case mr.string:for(let t=1;t<=o;t++){const r=Mr(a[t],e,i);if("string"==typeof r)return r}throw new Error("string assertion failed");case mr.boolean:for(let t=1;t<=o;t++){const r=Mr(a[t],e,i);if("boolean"==typeof r)return r}throw new Error("boolean assertion failed");case mr.object:for(let t=1;t<=o;t++){const r=Mr(a[t],e,i);if(null!=r&&"object"==typeof r&&!Array.isArray(r))return r}throw new Error("object assertion failed");case mr.add:{let t=0;for(let r=1;r<=o;r++)t+=Mr(a[r],e,i);return t}case mr.subtract:{const t=Mr(a[1],e,i);return 1===o?0-Number(t):t-Mr(a[2],e,i)}case mr.mod:return Mr(a[1],e,i)%Mr(a[2],e,i);case mr.pow:{const t=Mr(a[1],e,i),r=Mr(a[2],e,i);return Math.pow(t,r)}case mr.multiply:return Mr(a[1],e,i)*Mr(a[2],e,i);case mr.divide:return Mr(a[1],e,i)/Mr(a[2],e,i);case mr.abs:return Math.abs(Mr(a[1],e,i));case mr.ceil:return Math.ceil(Mr(a[1],e,i));case mr.floor:return Math.floor(Mr(a[1],e,i));case mr.round:return Math.round(Mr(a[1],e,i));case mr.min:{if(0===o)return Number.POSITIVE_INFINITY;let t=Number(Mr(a[1],e,i));for(let r=2;r<=o;r++){const s=Number(Mr(a[r],e,i));s<t&&(t=s)}return t}case mr.max:{if(0===o)return Number.NEGATIVE_INFINITY;let t=Number(Mr(a[1],e,i));for(let r=2;r<=o;r++){const s=Number(Mr(a[r],e,i));s>t&&(t=s)}return t}case mr.sqrt:return Math.sqrt(Mr(a[1],e,i));case mr.ln:return Math.log(Mr(a[1],e,i));case mr.ln2:return Math.LN2;case mr.log2:return Math.log2(Mr(a[1],e,i));case mr.log10:return Math.log10(Mr(a[1],e,i));case mr.sin:return Math.sin(Mr(a[1],e,i));case mr.cos:return Math.cos(Mr(a[1],e,i));case mr.tan:return Math.tan(Mr(a[1],e,i));case mr.asin:return Math.asin(Mr(a[1],e,i));case mr.acos:return Math.acos(Mr(a[1],e,i));case mr.atan:return Math.atan(Mr(a[1],e,i));case mr.e:return Math.E;case mr.pi:return Math.PI;case mr.at:{const t=Mr(a[1],e,i),r=Mr(a[2],e,i);if(!Array.isArray(r))throw new Error("at: second argument must be an array");return r[t]}case mr.in:{const t=Mr(a[1],e,i),r=Mr(a[2],e,i);return"string"==typeof r?r.includes(String(t)):!!Array.isArray(r)&&r.includes(t)}case mr.regex:{const r=Mr(a[1],e,i),s=o>=3,n=s?Mr(a[2],e,i):void 0,l=Mr(a[s?3:2],e,i);if("string"!=typeof l||"string"!=typeof r)return!1;try{const t=`${r}::${"string"==typeof n?n:""}`;let e=vr.get(t);if(!e){if(e="string"==typeof n?new RegExp(r,n):new RegExp(r),vr.size>=yr){const t=vr.keys().next().value;t&&vr.delete(t)}vr.set(t,e)}return e.test(l)}catch(t){return!1}}case mr.indexOf:{const t=Mr(a[1],e,i),r=Mr(a[2],e,i),s=o>=3?Mr(a[3],e,i):0;return"string"==typeof r?r.indexOf(String(t),s):Array.isArray(r)?r.indexOf(t,s):-1}case mr.length:{const t=Mr(a[1],e,i);return"string"==typeof t||Array.isArray(t)?t.length:0}case mr.slice:{const t=Mr(a[1],e,i),r=Mr(a[2],e,i),s=o>=3?Mr(a[3],e,i):void 0;return"string"==typeof t||Array.isArray(t)?void 0===s?t.slice(r):t.slice(r,s):[]}case mr.concat:{let t="";for(let r=1;r<=o;r++)t+=String(Mr(a[r],e,i));return t}case mr.downcase:return String(Mr(a[1],e,i)).toLowerCase();case mr.upcase:return String(Mr(a[1],e,i)).toUpperCase();case mr.step:return function(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const s=t.length-r;if(s<2)throw new Error("step: expected at least input and default output");if(s>2&&s%2!=0)throw new Error("step: expected stop_input/stop_output pairs");const a=Number(Mr(t[r],e,i));if(Number.isNaN(a))throw new Error("step: input must evaluate to a number");const n=t[r+1];if(2===s)return Mr(n,e,i);let o=Number.NEGATIVE_INFINITY,l=n;for(let e=r+2;e<t.length;e+=2){const i=t[e];if("number"!=typeof i||Number.isNaN(i))throw new TypeError("[MapsGL] step: stop inputs must be numeric literals");if(i<=o)throw new Error("[MapsGL] step: stop inputs must be strictly ascending");if(a<i)break;l=t[e+1],o=i}return Mr(l,e,i)}(a,e,i,1);case mr.interpolate:return function(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;var s;const a=t[r],n=a[0],o=null!==(s=a[1])&&void 0!==s?s:1,l=Mr(t[r+1],e,i);for(let s=r+2;s<t.length-2;s+=2){const r=t[s],a=Mr(t[s+1],e,i),h=t[s+2],d=Mr(t[s+3],e,i);if(l>=r&&l<h){const t=(l-r)/(h-r);return a+(d-a)*("exponential"===n?Math.pow(t,o):t)}}return Mr(t.at(-1),e,i)}(a,e,i,1);case mr.case:return function(t,e,i){for(let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;r<t.length-1;r+=2)if(Mr(t[r],e,i))return Mr(t[r+1],e,i);return Mr(t.at(-1),e,i)}(a,e,i,1);case mr.match:return function(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const s=Mr(t[r],e,i);for(let a=r+1;a<t.length-1;a+=2){const r=t[a],n=t[a+1];if(Array.isArray(r)?r.includes(s):s===r)return Mr(n,e,i)}return Mr(t.at(-1),e,i)}(a,e,i,1);case mr.let:return function(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const s=t.length-r;if(s<1)throw new Error("let: expected at least one argument (result expression)");if(s%2==0)throw new Error("let: expected zero or more [name, value] pairs followed by one result expression");const a=Object.create(i);for(let i=r;i<t.length-1;i+=2){const r=t[i];if("string"!=typeof r)throw new TypeError("let: binding names must be strings");const s=Mr(t[i+1],e,a);a[r]=s}return Mr(t.at(-1),e,a)}(a,e,i,1);default:throw new Error(`Unsupported expression: ${n}`)}}function Zr(t,e){const i=Math.max(0,Math.floor(Number(e)||0));if(0===i)return Math.round(t);const r=Math.pow(10,i);return Math.round(t*r)/r}function Ar(t,e,i,r){return r&&"string"==typeof t&&!t.startsWith("$")?Rr(t,e):Mr(t,e,i)}function Tr(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Ar(t[r],e,i,!0)===Ar(t[r+1],e,i,!1)}function Rr(t,e){if("string"==typeof t){if(t.includes(".")){let i=fr.get(t);i||(i=t.split("."),fr.set(t,i));let r=e;for(let t=0;t<i.length;t++)r=null==r?void 0:r[i[t]];return r}return e[t]}return t.reduce(((t,e)=>null==t?void 0:t[e]),e)}new Set,new Map;const Gr=class{constructor(t,e=!1){this.expression=t,e&&(this.cache=new Map)}evaluate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.cache){const e=JSON.stringify(t);if(this.cache.has(e))return this.cache.get(e);const i=Mr(this.expression,t);return this.cache.set(e,i),i}return Mr(this.expression,t)}toArray(){return this.expressionToArray(this.expression)}expressionToArray(t){return Array.isArray(t)?t.map((t=>this.expressionToArray(t))):t}};class Sr{constructor(t){this.constant=null,this.expression=null,this.fn=null,Array.isArray(t)?br(t)?this.expression=new Gr(t):this.constant=t:"function"==typeof t?this.fn=t:this.constant=t}isExpression(){return null!==this.expression}resolve(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.expression?this.expression.evaluate(t):this.fn?this.fn(t):this.constant}getRaw(){return this.fn?this.fn:this.expression?this.expression.toArray():this.constant?this.constant:null}}class Cr extends Sr{constructor(t){if(Array.isArray(t)&&br(t))throw new TypeError(`ConstantStyleValue does not support expressions: ${JSON.stringify(t)}`);if("function"==typeof t)throw new TypeError(`ConstantStyleValue does not support function evaulation: ${JSON.stringify(t)}`);"object"==typeof t&&t.constant&&(t=t.constant),super(t)}}class Ir extends Sr{}const Vr=(t,e)=>{if(null==t?void 0:t.text)return Array.isArray(t.text)?t.text[e]:t.text},Fr=t=>(null==t?void 0:t.icon)||(null==t?void 0:t.symbol),Wr={"":["opacity","animated"],raster:["opacity"],fill:["color","pattern","opacity"],stroke:["color","opacity","thickness","lineJoin","lineCap"],circle:["radius"],grid:["spacing"],heatmap:["radius","blur","intensity","weight","color"],contour:["interval","majorInterval","width","majorWidth","scale","offset"],symbol:["key","sortKey","size","anchor","offset","padding","rotation","shader","factor"],icon:["image","size","anchor","offset","padding","rotation","shader","factor"],text:["value","size","font","weight","color","outlineColor","opacity","align","transform","anchor","offset","padding","rotation","letterSpacing","lineHeight","maxWidth"]},Er=new Set(["raster","fill","stroke","circle","grid","sample","particle","heatmap","contour","symbol","icon","text"]);function kr(t,e){if(null==e||!a(e))return e;const i=Wr[t],r={};return Object.keys(e).forEach((t=>{const s=e[t];var n;r[t]=i&&i.includes(t)?null==(n=s)||function(t){return null!=t&&"object"==typeof t&&"function"==typeof t.resolve}(n)?n:function(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]}(n)||"function"==typeof n?new Ir(n):new Cr(n):Er.has(t)&&a(s)&&!Array.isArray(s)?kr(t,s):"text"===t&&Array.isArray(s)?s.map((t=>a(t)?kr("text",t):t)):s})),r}class zr{constructor(t={}){if(this._cachedSerialized=null,"function"==typeof t)this.config=t;else{const e=Object.assign({},t);if(e.symbol){e.symbol=Object.assign({},e.symbol);const t=new Set(["key","rank","fadeOpacity","pitchWithMap","rotateWithMap","scaleWithMap","sizeAttenuation","allowOverlap"]),i=Object.keys(e.symbol);e.icon=e.icon?Object.assign({},e.icon):{},i.forEach((i=>{t.has(i)||("icon"!==i&&(e.icon[i]=e.symbol[i]),delete e.symbol[i])}))}this.config=function(t){var e;return null!==(e=kr("",t))&&void 0!==e?e:{}}(e)}}opacity(t){const e=ar("number",this.provider(t).opacity,t,1);return rt(e)?1:e}animated(t){return ar("boolean",this.provider(t).animated,t,!1)}rasterMeld(t){var e;return ar("boolean",null===(e=this.provider(t).raster)||void 0===e?void 0:e.meld,t,!1)}rasterOpacity(t){var e;const i=ar("number",null===(e=this.provider(t).raster)||void 0===e?void 0:e.opacity,t);return rt(i)?this.opacity(t):i}fillColor(t){var e;const i=this.fillPattern(t);let r=ar("color",null===(e=this.provider(t).fill)||void 0===e?void 0:e.color,t);return i&&(r=new Kt(0,0,0,1)),r&&(r.a*=this.fillOpacity(t)),r}fillPattern(t){var e;const i=ar("any",null===(e=this.provider(t).fill)||void 0===e?void 0:e.pattern,t);if("string"==typeof i&&/^https?:\/\//.test(i))throw new Error(`[MapsGL] Remote icon images must contain a unique id and provided as { id: string; url: string; }, not ${i}.`);return i}fillOpacity(t){var e;const i=ar("number",null===(e=this.provider(t).fill)||void 0===e?void 0:e.opacity,t,1);return rt(i)?1:i}fillSort(t){var e;const i=null===(e=this.provider(t).fill)||void 0===e?void 0:e.sort;return"string"==typeof i?{property:i}:i}strokeColor(t){var e;const i=ar("color",null===(e=this.provider(t).stroke)||void 0===e?void 0:e.color,t);return i&&(i.a=this.strokeOpacity(t)),i}strokeOpacity(t){var e;const i=ar("number",null===(e=this.provider(t).stroke)||void 0===e?void 0:e.opacity,t,1);return rt(i)?1:i}strokeThickness(t){var e;const i=ar("number",null===(e=this.provider(t).stroke)||void 0===e?void 0:e.thickness,t);return rt(i)?0:i}strokeLineJoin(t){var e;const i=ar("string",null===(e=this.provider(t).stroke)||void 0===e?void 0:e.lineJoin,t);return rt(i)?wi:i}strokeLineCap(t){var e;const i=ar("string",null===(e=this.provider(t).stroke)||void 0===e?void 0:e.lineCap,t);return rt(i)?"round":i}radius(t){var e,i;const r=(null===(e=this.provider(t).circle)||void 0===e?void 0:e.radius)||(null===(i=this.provider(t).heatmap)||void 0===i?void 0:i.radius);return ar("number",r,t,10)}sampleExpression(t){var e;const i=null===(e=this.provider(t).sample)||void 0===e?void 0:e.expression;return ar("string",i,t,"number")}sampleExpressionOperation(t){var e;return ar("object",null===(e=this.provider(t).sample)||void 0===e?void 0:e.expressionOperation,t)}sampleChannel(t){var e;return ar("string",null===(e=this.provider(t).sample)||void 0===e?void 0:e.channel,t)}sampleColorScale(t){var e;return ar("object",null===(e=this.provider(t).sample)||void 0===e?void 0:e.colorscale,t)}sampleInterpolation(t){var e;const i=null===(e=this.provider(t).sample)||void 0===e?void 0:e.interpolation;return ar("string",i,t)}sampleOpacity(t){return console.warn("[MapsGL] `sample.opacity` is deprecated. Use `opacity` instead."),1}sampleSmoothing(t){var e;return ar("number",null===(e=this.provider(t).sample)||void 0===e?void 0:e.smoothing,t,0)}sampleOffset(t){var e;return ar("number",null===(e=this.provider(t).sample)||void 0===e?void 0:e.offset,t,0)}sampleMeld(t){var e;return ar("boolean",null===(e=this.provider(t).sample)||void 0===e?void 0:e.meld,t,!0)}sampleDataRange(t){var e;return ar("object",null===(e=this.provider(t).sample)||void 0===e?void 0:e.dataRange,t)}sampleDrawRange(t){var e;return ar("object",null===(e=this.provider(t).sample)||void 0===e?void 0:e.drawRange,t)}gridSpacing(t){var e;return ar("number",null===(e=this.provider(t).grid)||void 0===e?void 0:e.spacing,t,30)}particleType(t){var e;return ar("string",null===(e=this.provider(t).particle)||void 0===e?void 0:e.type,t)}particleCount(t){var e;return ar("number",null===(e=this.provider(t).particle)||void 0===e?void 0:e.count,t)}particleDensity(t){var e;return ar("number",null===(e=this.provider(t).particle)||void 0===e?void 0:e.density,t,0)}particleSpeed(t){var e,i;const r=(null===(e=this.provider(t).particle)||void 0===e?void 0:e.speedFactor)||(null===(i=this.provider(t).particle)||void 0===i?void 0:i.speed);return ar("number",r,t,1)}particleSize(t){var e,i,r;if(bt(null===(e=this.config.particle)||void 0===e?void 0:e.size)){const e=ar("number",null===(i=this.provider(t).particle)||void 0===i?void 0:i.size,t,0);return{width:e,height:e}}return ar("object",null===(r=this.provider(t).particle)||void 0===r?void 0:r.size,t,{width:2,height:2})}particleTrails(t){var e;return ar("boolean",null===(e=this.provider(t).particle)||void 0===e?void 0:e.trails,t)}particleTrailsFade(t){var e,i;const r=(null===(e=this.provider(t).particle)||void 0===e?void 0:e.trailsFadeFactor)||(null===(i=this.provider(t).particle)||void 0===i?void 0:i.trailsFade);return ar("number",r,t)}particleDropRate(t){var e;return ar("number",null===(e=this.provider(t).particle)||void 0===e?void 0:e.dropRate,t)}particleDropRateBump(t){var e;return ar("number",null===(e=this.provider(t).particle)||void 0===e?void 0:e.dropRateBump,t)}heatmapColor(t){var e;return ar("colorscale",null===(e=this.provider(t).heatmap)||void 0===e?void 0:e.color,t)}heatmapRadius(t){var e;return ar("number",null===(e=this.provider(t).heatmap)||void 0===e?void 0:e.radius,t,10)}heatmapBlur(t){var e;return ar("number",null===(e=this.provider(t).heatmap)||void 0===e?void 0:e.blur,t,1)}heatmapIntensity(t){var e;return ar("number",null===(e=this.provider(t).heatmap)||void 0===e?void 0:e.intensity,t)}heatmapWeight(t){var e;return ar("number",null===(e=this.provider(t).heatmap)||void 0===e?void 0:e.weight,t,1)}heatmapOpacity(t){return console.warn("[MapsGL] `heatmap.opacity` is deprecated. Use `opacity` instead."),1}contourInterval(t){var e;return ar("number",null===(e=this.provider(t).contour)||void 0===e?void 0:e.interval,t,1)}contourMajorInterval(t){var e;return ar("number",null===(e=this.provider(t).contour)||void 0===e?void 0:e.majorInterval,t,0)}contourWidth(t){var e;return ar("number",null===(e=this.provider(t).contour)||void 0===e?void 0:e.width,t,1)}contourMajorWidth(t){var e;return ar("number",null===(e=this.provider(t).contour)||void 0===e?void 0:e.majorWidth,t,2)}contourScale(t){var e;return ar("number",null===(e=this.provider(t).contour)||void 0===e?void 0:e.scale,t,1)}contourOffset(t){var e;return ar("number",null===(e=this.provider(t).contour)||void 0===e?void 0:e.offset,t,0)}symbolKey(t){var e;return ar("string",null===(e=this.provider(t).symbol)||void 0===e?void 0:e.key,t)}symbolRank(t){var e;return null===(e=this.provider(t).symbol)||void 0===e?void 0:e.rank}symbolRotateWithMap(t){var e;return ar("boolean",null===(e=this.provider(t).symbol)||void 0===e?void 0:e.rotateWithMap,t,!0)}symbolPitchWithMap(t){var e;return ar("boolean",null===(e=this.provider(t).symbol)||void 0===e?void 0:e.pitchWithMap,t,!0)}symbolScaleWithMap(t){var e;return ar("boolean",null===(e=this.provider(t).symbol)||void 0===e?void 0:e.scaleWithMap,t,!1)}symbolSizeAttenuation(t){var e;return ar("boolean",null===(e=this.provider(t).symbol)||void 0===e?void 0:e.sizeAttenuation,t,!1)}symbolAllowOverlap(t){var e;return ar("boolean",null===(e=this.provider(t).symbol)||void 0===e?void 0:e.allowOverlap,t,!0)}symbolOverlapMode(t){var e;return ar("string",null===(e=this.provider(t).symbol)||void 0===e?void 0:e.overlapMode,t,"layer")}symbolFadeOpacity(t){var e;return ar("boolean",null===(e=this.provider(t).symbol)||void 0===e?void 0:e.fadeOpacity,t,!0)}iconType(t){var e;return ar("string",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.type,t)}iconImage(t){var e,i;const r=ar("any",null===(e=this.provider(t).icon)||void 0===e?void 0:e.image,t);if("string"==typeof r&&/^https?:\/\//.test(r))throw new Error(`[MapsGL] Remote icon images must contain a unique id and provided as { id: string; url: string; }, not ${r}.`);const s=this.iconAtlas(t);return!r&&(null===(i=null==s?void 0:s.ids)||void 0===i?void 0:i.length)>0?s.ids[0]:r}iconShader(t){var e;return ar("string",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.shader,t)}iconUniforms(t){var e;return ar("object",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.uniforms,t)}iconSize(t){var e;return ar("object",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.size,t)}iconAnchor(t){var e;return ar("string",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.anchor,t,"center")}iconOffset(t){var e;return ar("object",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.offset,t,{x:0,y:0})}iconPadding(t){var e;const i=ar("object",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.padding,t,6);return Array.isArray(i)?i:[i,i]}iconRotation(t){var e;return ar("number",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.rotation,t,0)}iconBlending(t){var e;return ar("number",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.blending,t)}iconAnimated(t){var e;return ar("boolean",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.animated,t,!1)}iconFactor(t){var e;return ar("number",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.factor,t,1)}iconAtlas(t){var e;return ar("object",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.atlas,t)}textValue(t){var e;return ar("any",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.value,t)}textTransform(t){var e;return ar("string",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.transform,t,"none")}textFont(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;var i,r;const s=ar("string",null===(i=Vr(this.config,e))||void 0===i?void 0:i.font,t,"Inter");let a=ar("string",null===(r=Vr(this.config,e))||void 0===r?void 0:r.weight,t,"normal");return"normal"===a&&(a="regular"),`${Ui(s)}-${Ui(a)}`}textSize(t){var e;return ar("object",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.size,t,12)}textColor(t){var e;const i=ar("color",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.color,t,new Kt("#000"));return i&&(i.a=this.textOpacity(t)),i}textOutlineColor(t){var e;const i=ar("color",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.outlineColor,t);return i&&(i.a=this.textOpacity(t)),i}textOpacity(t){var e;const i=ar("number",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.opacity,t,1);return rt(i)?1:i}textAlign(t){var e;return ar("string",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.align,t,"center")}textAnchor(t){var e;return ar("string",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.anchor,t,"center")}textOffset(t){var e;return ar("object",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.offset,t,{x:0,y:0})}textPadding(t){var e;const i=ar("object",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.padding,t,6);return Array.isArray(i)?i:[i,i]}textRotation(t){var e;return ar("number",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.rotation,t,0)}textLetterSpacing(t){var e;return ar("number",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.letterSpacing,t,0)}textLineHeight(t){var e;return ar("number",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.lineHeight,t,1)}textMaxWidth(t){var e;return ar("number",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.maxWidth,t,140)}textLineCount(t){var e;const i=null===(e=this.config)||void 0===e?void 0:e.text;return i?Array.isArray(i)?i.length:1:0}getProperty(t){return ai(this.config,t)}setProperty(t,e){const i=t.match(/\[\d+]/);if((null==i?void 0:i.length)>0){const r=Number.parseInt(i[0].replaceAll(/\D/g,""),10),s=t.split(i[0]),a=ai(this.config,s[0]),n=s[1].replace(/^\./,"");Array.isArray(a)&&vt(a[r],n,e)}else vt(this.config,t,e);this._cachedSerialized=null}serialized(){if(this._cachedSerialized)return this._cachedSerialized;const t={};return rr(t,this.config),this._cachedSerialized=t,t}provider(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(ni(this.config)?this.config(t):this.config)||{}}static fromSerialized(t){const e={};return sr(e,t),new zr(e)}}const Nr=zr;class Yr extends ue{get type(){return"data"}addFeature(t,e){const i=t.feature.asPoints(),r=(t.feature.asPolygons(),t.feature.extent);for(let t=0;t<i.length;t++){const e=i[t],s=me({x:e.x,y:e.y},r);i[t]=s}return{type:t.type,featureIndex:t.featureIndex,sourceId:t.sourceId,sourceLayerIndex:t.sourceLayerIndex,geometry:i,properties:t.properties,vertexRange:{start:null,end:null}}}static from(t){const e=new Yr(t.options);return at(t)?console.warn("[MapsGL] Cannot create FeatureStore from invalid serialized data."):e.features=t.features,e}}const Lr=Yr;function Or(t){if("string"!=typeof t)return!1;const e=t.trim();return e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]")}function jr(t,e){if(!Or(t=t.trim()))return e;try{return JSON.parse(t)}catch(i){return console.error("[MapsGL] Failed to parse JSON string:",i,t),e}}const Dr=(t,e)=>{if("fill"===t)return new vi(e);if("line"===t)return new Ri(e);if("circle"===t||"heatmap"===t||"voronoi"===t)return new si(e);if("symbol"===t||"text"===t)return new Bi(e);if("data"===t)return new Lr(e);throw new Error(`[MapsGL] Invalid data store type ${t}`)};function Xr(t){if(!t)return{};const e=Object.assign({},t);return Object.keys(e).forEach((i=>{if(ft(e[i])){const r=t[i];if(Or(r)){if(e[i]=jr(r),Array.isArray(e[i]))e[i]=e[i].map((t=>Or(t)?jr(t):t));else if(a(t[i])){const r=Object.assign({},t[i]);Object.keys(r).forEach((t=>{r[t]=Xr(r[t])})),e[i]=r}}else e[i]=r}})),e}const Br=class{constructor(t,e={}){this.coord=new mt(t.z,t.x,t.y),this.actor=e.actor,ot(e.granularity)&&(this.subdivisionGranularity=new ci(e.granularity))}parse(t,e){return i=this,s=function*(){var i;const r={};if(nt(null==t?void 0:t.layers))return this.parseEmptyTile(e);const s=Object.keys(t.layers),a=e.reduce(((e,i)=>{const{sourceLayerId:r=s[0]}=i;return i.sourceLayerId=r,t.layers[r]&&(e[r]||(e[r]=[]),e[r].push(i)),e}),{}),n=Object.keys(a),o={},l={},h={};n.forEach((e=>{const i=a[e],s=[],n=t.layers[e];if(n){for(let t=0,e=n.length;t<e;t++){const e=n.feature(t),i=e.properties||{},r={};Object.keys(i).forEach((t=>{vt(r,t,i[t])})),e.properties=r,s.push(e)}for(let t=0,e=i.length;t<e;t++){const{type:e,layerId:a,sourceLayerType:n,filter:d,paint:c,options:u}=i[t],p=Dr(e,Object.assign(Object.assign({},u),{tile:this.coord.toInfo(),sourceId:"",sourceLayerIndex:0,zoom:this.coord.z})),m=Nr.fromSerialized(c);if(p){p.id=`${a}:${this.coord.hash}`,r[a]=p;let t=s.filter((t=>rt(n)||"point"===n&&1===t.type||"line"===n&&2===t.type||"polygon"===n&&3===t.type)),e=t;if(t=t.map((t=>(t.properties=Xr(t.properties),t))),Array.isArray(d)&&(null==d?void 0:d.length)>=1){const i=new Gr(d),r=this.coord.z;e=t.filter((t=>{const e=Object.assign(Object.assign({},t.properties),{$zoom:r});return Boolean(i.evaluate(e))}))}p.populate(e,void 0,{tileCoord:this.coord,paint:m,includeEmptySymbolData:"data"===p.type,subdivisionGranularity:this.subdivisionGranularity,glyphDependencies:o,iconDependencies:l,patternDependencies:h})}}}else for(let t=0,e=i.length;t<e;t++){const{layerId:e}=i[t];r[e]=new Hi({tile:this.coord.toInfo(),sourceLayerIndex:0,sourceId:"",zoom:this.coord.z})}}));let d=(null===(i=this.dependencies)||void 0===i?void 0:i.glyphs)||{},c={};if(ot(o)){const t=Object.keys(d),e=Object.keys(o).filter((e=>{var i;return!t.includes(e)||nt(null===(i=d[e])||void 0===i?void 0:i.ranges)}));e.length>0&&Object.keys(o).reduce(((t,e)=>{const i=d[e]||{},r=o[e];if(nt(i))t.push(...r);else{const e=Object.values((null==i?void 0:i.ranges)||{});for(const i of r)for(const r of e)if(i>=r.start&&i<=r.end){t.push(i);break}}return t}),[]).length>0&&(d=yield this.actor.send({type:"getGlyphs",data:o}))}const u=Object.assign(Object.assign({},l),h);if(ot(u)){const t=Object.keys(u).filter((t=>yt(u[t],["url"]))).reduce(((t,e)=>{var i,r,s;return t.push({id:e,url:u[e].url,pixelRatio:null!==(i=u[e].pixelRatio)&&void 0!==i?i:1,sdf:null!==(r=u[e].sdf)&&void 0!==r&&r,pattern:null!==(s=u[e].pattern)&&void 0!==s&&s}),t}),[]);t.length>0&&(yield this.actor.send({type:"loadImages",data:t})),c=yield this.actor.send({type:"getImages",data:u})}return(ot(d)||ot(c))&&Object.values(r).forEach((t=>{t instanceof Bi&&t.layoutSymbols(c,d)})),new Promise(((t,e)=>{t({stores:Object.keys(r).reduce(((t,e)=>{const i=r[e];return st(i)&&!i.isEmpty&&(t[e]=i),t}),{}),dependencies:{glyphs:d,icons:c}})}))},new((r=void 0)||(r=Promise))((function(t,e){function a(t){try{o(s.next(t))}catch(t){e(t)}}function n(t){try{o(s.throw(t))}catch(t){e(t)}}function o(e){var i;e.done?t(e.value):(i=e.value,i instanceof r?i:new r((function(t){t(i)}))).then(a,n)}o((s=s.apply(i,[])).next())}));var i,r,s}abort(){}parseEmptyTile(t){const e={};return t.forEach((t=>{e[t.layerId]=new Hi({tile:this.coord.toInfo(),sourceLayerIndex:0,sourceId:"",zoom:this.coord.z})})),Promise.resolve({stores:e,dependencies:{glyphs:{},icons:{}}})}};function Pr(t,e){var i;const r=ct(t.x,t.y,t.z,0),s=null==e?void 0:e.time;if(null==s)return r;const a="number"==typeof s?s:null===(i=null==s?void 0:s.getTime)||void 0===i?void 0:i.call(s);return null==a?r:`${r}-${a}`}const Hr=(t,e,i)=>{const{headers:r,body:s}=e||{};return fetch(t,{headers:r,body:s?"string"==typeof s?s:JSON.stringify(s):void 0}).then(gt).then((t=>{if((t=>st(t)&&t.status>=200&&t.status<=299)(t))return t.arrayBuffer()})).then((t=>{if(st(t))try{return{vectorTile:new Z(new Uint8Array(t))}}catch(t){console.error("Error parsing vector tile",t)}}))},Ur=class{constructor(t){this.onTileError=()=>{},this.loading={},this.loaded=new Map,this.dependencies={glyphs:void 0,icons:void 0},this.tileLoader=t||Hr}setLoaded(t,e){if(this.loaded.size>=256){const t=this.loaded.keys().next().value;this.loaded.delete(t)}this.loaded.set(t,e)}loadTile(t,e){var i;const{tile:{info:r},request:{url:s,headers:a,body:n,reload:o=!1,params:l}}=t,h=Pr(r,l);this.loading=null!==(i=this.loading)&&void 0!==i?i:{};const d=this.loaded.get(h);if(d&&!0!==o)return d.parse(d.vectorTile,t.layers).then((t=>t)).catch((t=>{console.error(t)}));const c=new Br(r,{actor:e,granularity:t.granularity});return this.loading[h]=c,this.tileLoader(s,{headers:a,body:n},r).then((e=>{const i=!this.loading[h];if(delete this.loading[h],st(e)&&(c.vectorTile=e.vectorTile),!i)return rt(e)?c.parseEmptyTile(t.layers):(c.dependencies=this.dependencies,c.parse(e.vectorTile,t.layers))})).then((t=>(this.setLoaded(h,c),(null==t?void 0:t.dependencies)&&(this.dependencies=t.dependencies),t))).catch((t=>{console.error(t)}))}reloadTile(t,e){const{tile:{info:i},request:r}=t,s=Pr(i,null==r?void 0:r.params),a=this.loaded.get(s);return(null==a?void 0:a.vectorTile)?a.parse(a.vectorTile,t.layers):Promise.resolve(null)}abortTile(t){if(this.loading){const e=this.loading[t];e&&(e.abort(),delete this.loading[t])}return Promise.resolve()}clearTiles(){this.loading={},this.loaded=new Map}},Qr=t=>(180+t)/360,Kr=t=>(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360,Jr=4096,qr=64/4096;function $r(t){const{id:e,geometry:i,properties:r}=t;if(!i)return null;if("GeometryCollection"===i.type)throw new Error("GeometryCollection not supported in dynamic mode.");const s={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY},a=function(t,e){const{type:i,coordinates:r}=t;switch(i){case"Point":return function(t,e){const i=[];return es(t,i,e),i}(r,e);case"MultiPoint":return function(t,e){const i=[];return t.forEach((t=>{es(t,i,e)})),i}(r,e);case"LineString":return function(t,e){return[is(t,e,!1)]}(r,e);case"MultiLineString":return function(t,e){return t.map((t=>is(t,e,!1)))}(r,e);case"Polygon":return function(t,e){return t.map(((t,i)=>is(t,e,!0,0===i)))}(r,e);case"MultiPolygon":return function(t,e){const i=[];return t.forEach((t=>{t.forEach(((t,r)=>{i.push(is(t,e,!0,0===r))}))})),i}(r,e);default:throw new Error("Input data is not a valid GeoJSON object.")}}(i,s);return a?Object.assign({id:e,properties:r||{},geometryType:ts(i.type),coordinates:a},s):null}function ts(t){if("Point"===t||"MultiPoint"===t)return 1;if("LineString"===t||"MultiLineString"===t)return 2;if("Polygon"===t||"MultiPolygon"===t)return 3;throw new Error(`Unsupported geometry type: ${t}`)}function es(t,e,i){let[r,s]=t;const a=Qr(r),n=Math.max(0,Math.min(1,Kr(s)));e.push(a,n),i.minX=Math.min(i.minX,a),i.minY=Math.min(i.minY,n),i.maxX=Math.max(i.maxX,a),i.maxY=Math.max(i.maxY,n)}function is(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const s=[];return t.forEach((t=>{es(t,s,e)})),i&&function(t,e){const i=function(t){let e=0;const i=t.length/2;for(let r=0;r<i;r++){const s=2*r,a=(r+1)%i*2;e+=(t[a]-t[s])*(t[a+1]+t[s+1])}return e}(t);i>0!==e&&function(t){const e=t.length/2,i=e/2;for(let r=0;r<i;r++){const i=2*r,s=2*(e-1-r),a=t[i],n=t[i+1];t[i]=t[s],t[i+1]=t[s+1],t[s]=a,t[s+1]=n}}(t)}(s,r),s}function rs(t,e,i,r,s,a,n,o){let l=t,h=e,d=i,c=r;return l<n&&d<n?null:(l<n&&(h+=Math.round(a*(n-l)/s),l=n),d<n&&(c=h+Math.round(a*(n-l)/s),d=n),h<n&&c<n?null:(h<n&&(l+=Math.round(s*(n-h)/a),h=n),c<n&&(d=l+Math.round(s*(n-h)/a),c=n),l>=o&&d>=o?null:(l>=o&&(h+=Math.round(a*(o-l)/s),l=o),d>=o&&(c=h+Math.round(a*(o-l)/s),d=o),h>=o&&c>=o?null:(h>=o&&(l+=Math.round(s*(o-h)/a),h=o),c>=o&&(d=l+Math.round(s*(o-h)/a),c=o),[l,h,d,c]))))}function ss(t,e,i){const r=[],s=t.length;let a=t[s-2],n=t[s-1],o="left"===e.side||"right"===e.side?!e.test(a):!e.test(n);for(let l=0;l<s;l+=2){const s=t[l],h=t[l+1],d="left"===e.side||"right"===e.side?!e.test(s):!e.test(h);if(d!==o){const[t,o]=e.intersect(a,n,s,h,i);r.push(t,o)}d&&r.push(s,h),a=s,n=h,o=d}return r}function as(t,e,i,r,s){return[s.minX,e+(s.minX-t)/(i-t)*(r-e)]}function ns(t,e,i,r,s){return[t+(s.minY-e)/(r-e)*(i-t),s.minY]}function os(t,e,i,r,s){return[s.maxX,e+(s.maxX-t)/(i-t)*(r-e)]}function ls(t,e,i,r,s){return[t+(s.maxY-e)/(r-e)*(i-t),s.maxY]}const hs=class{constructor(){this.tileCache=new Map,this.featureCache=new Map}clear(){this.featureCache.clear(),this.tileCache.clear()}setData(t){this.featureCache.clear(),this.tileCache.clear(),(null==t?void 0:t.features)&&t.features.forEach((t=>{const e=t.id;if(null!=e)if(t.geometry){const i=$r(t);i&&this.featureCache.set(e,i)}else this.featureCache.delete(e)}))}updateProperties(t){(null==t?void 0:t.features)?(this.tileCache.clear(),t.features.forEach((t=>{const e=t.id;if(null==e)return void console.warn("feature has no id");const i=this.featureCache.get(e);if(t.geometry)if(i)if(function(t,e){return JSON.stringify(t.coordinates)!==JSON.stringify(e.coordinates)}(i,t.geometry)){const i=$r(t);i&&this.featureCache.set(e,i)}else i.properties=Object.assign({},t.properties);else{const i=$r(t);i&&this.featureCache.set(e,i)}else this.featureCache.delete(e)}))):console.warn("newData has no features")}getTile(t,e,i){const r=`${t}/${e}/${i}`;if(this.tileCache.has(r))return this.tileCache.get(r);const s=Math.pow(2,t),a=[];this.featureCache.forEach((t=>{(function(t,e,i,r){return t.minX<(i+1+qr)/e&&t.minY<(r+1+qr)/e&&t.maxX>(i-qr)/e&&t.maxY>(r-qr)/e})(t,s,e,i)&&a.push(function(t,e,i,r){const{id:s,geometryType:a,coordinates:n,properties:o}=t,l=[];return 1===a?function(t,e,i,r,s){for(let a=0;a<t.length;a+=2){const n=t[a+1],o=Math.round(Jr*(t[a]*e-i)),l=Math.round(Jr*(n*e-r));s.push([o,l])}}(n,e,i,r,l):2===a?n.forEach((t=>{!function(t,e,i,r,s){let a=null;for(let n=0;n<t.length-2;n+=2){const o=Math.round(Jr*(t[n]*e-i)),l=Math.round(Jr*(t[n+1]*e-r)),h=Math.round(Jr*(t[n+2]*e-i)),d=Math.round(Jr*(t[n+3]*e-r)),c=rs(o,l,h,d,h-o,d-l,-128,4224);if(!c)continue;const[u,p,m,g]=c;(!a||0===a.length||a.at(-1)[0]!==u||a.at(-1)[1]!==p)&&(a=[[u,p]],s.push(a)),a.push([m,g])}}(t,e,i,r,l)})):3===a&&n.forEach((t=>{!function(t,e,i,r,s){const a={minX:(i-qr)/e,minY:(r-qr)/e,maxX:(i+1+qr)/e,maxY:(r+1+qr)/e};let n=[...t];const o=[{side:"left",test:t=>t<a.minX,intersect:as},{side:"top",test:t=>t<a.minY,intersect:ns},{side:"right",test:t=>t>a.maxX,intersect:os},{side:"bottom",test:t=>t>a.maxY,intersect:ls}];for(const t of o){if(0===n.length)break;n=ss(n,t,a)}if(n.length>0){const t=[];for(let s=0;s<n.length;s+=2){const a=Math.round(Jr*(n[s]*e-i)),o=Math.round(Jr*(n[s+1]*e-r));t.push([a,o])}s.push(t)}}(t,e,i,r,l)})),{id:s,type:a,geometry:l,tags:o}}(t,s,e,i))}));const n=a.length>0?{features:a}:null;return this.tileCache.set(r,n),n}getFeatures(){return[...this.featureCache.values()]}};function ds(t,e){if(t===e)return!0;if(null==t||null==e)return t===e;if("object"!=typeof t)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!ds(t[i],e[i]))return!1;return!0}const i=Object.keys(t),r=Object.keys(e);if(i.length!==r.length)return!1;for(const r of i)if(!ds(t[r],e[r]))return!1;return!0}const cs=(t,e)=>fetch(t,e),us=class extends Ur{get geojson(){return this._geojson}constructor(t,e){super(t||((t,e,i)=>((t,e)=>new Promise(((i,r)=>{const s=t.getTile(e.z,e.x,e.y);if(rt(null==s?void 0:s.features))return void i(null);const a=new et.GeoJSONWrapper(s.features);a.name="geojsonTileLayer",a.version=2;let n=it().fromGeojsonVt({geojsonTileLayer:a});0===n.byteOffset&&n.byteLength===n.buffer.byteLength||(n=new Uint8Array(n)),i({vectorTile:new Z(new Uint8Array(n))})})))(this._geojsonIndex,i))),this.dynamic=!1,this._loadingCallbacks=[],this._geojsonRT=null,this._useRT=!1,this._loadingData=!1,this._revision=0,this._dataLoader=e||cs}hasOnlyPropertyChanges(t){if(!(this._geojson&&t&&t.features&&this._geojson.features))return!1;const e=this._geojson.features,i=t.features;if(e.length!==i.length)return!1;for(let t=0;t<e.length;t++)if(!ds(e[t].geometry,i[t].geometry))return!1;return!0}ensureFeatureIds(t){if(!(null==t?void 0:t.features)||!Array.isArray(t.features))return;const e=t.features;for(let t=0;t<e.length;t++)null==e[t].id&&(e[t].id=t)}setData(t,e){if("number"==typeof e?this._revision=e:this._revision+=1,this.ensureFeatureIds(t),this.hasOnlyPropertyChanges(t)&&this._geojsonRT)return this._geojsonRT.updateProperties(t),this._geojson=t,void this.clearTiles();this.clearTiles(),this._geojson=t,ot(t)&&(this.dynamic?(this._geojsonRT||(this._geojsonRT=new hs),this._geojsonRT.setData(t),this._geojsonIndex=this._geojsonRT,this._useRT=!0):(this._geojsonIndex=function(t,e){return new $(t,{})}(t),this._geojsonRT=null,this._useRT=!1))}loadData(t,i){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return new Promise(((s,a)=>{this._geojsonIndex&&!0!==r?s():this._loadingData?this._loadingCallbacks.push((()=>s())):(this._loadingData=!0,lt(ot(t),"[MapsGL] GeoJSONWorker: Invalid URL provided for data load"),this._dataLoader(t,{}).then((t=>{if(200===t.status)return t.json();throw new e("Invalid response",t,t.status)})).then((t=>{return e=this,s=function*(){const e=yield i.send({type:"transformGeoJSON",data:{data:t}});return this.setData(e)},new((r=void 0)||(r=Promise))((function(t,i){function a(t){try{o(s.next(t))}catch(t){i(t)}}function n(t){try{o(s.throw(t))}catch(t){i(t)}}function o(e){var i;e.done?t(e.value):(i=e.value,i instanceof r?i:new r((function(t){t(i)}))).then(a,n)}o((s=s.apply(e,[])).next())}));var e,r,s})).then((()=>{this._loadingData=!1,s(),this._loadingCallbacks.forEach((t=>t())),this._loadingCallbacks=[]})))}))}loadTile(t,e){const{request:{url:i,reload:r=!1}}=t;return(ot(i)&&nt(this._geojson)?this.loadData(i,e,r):Promise.resolve()).then((()=>{if(st(this._geojsonIndex))return super.loadTile(t,e)}))}reloadTile(t,e){return this.loadTile(Object.assign(Object.assign({},t),{request:Object.assign(Object.assign({},t.request),{reload:!0})}),e)}};let ps;const ms=new class{constructor(t){this._resolveRejects={},this.worker=t,this.worker.addEventListener("message",this.receive.bind(this))}send(t){const e=Math.round(1e18*Math.random()).toString(36).slice(0,10);return new Promise(((i,r)=>{this._resolveRejects[e]={resolve:i,reject:r},this.worker.postMessage(Object.assign({id:e},t))}))}receive(t){const{id:e,data:i,error:r}=t.data,s=this._resolveRejects[e];s&&(r?s.reject(r):s.resolve(i),delete this._resolveRejects[e])}abort(){this.worker.terminate()}}(self);onmessage=i=>{var r,s,a,o,l;const h=i.data||{},{id:d,type:c,action:u,data:p={}}=h;if("__mapsgl_init"!==c){if(!["getGlyphs","transformGeoJSON","getImages","loadImages"].includes(c))return ps||(ps="geojson"===c?new us:new Ur,ps.id=p.id),ps instanceof us&&"setData"===u?(ps.dynamic=null!==(s=null===(r=p.data)||void 0===r?void 0:r.dynamic)&&void 0!==s&&s,ps.setData(null===(a=p.data)||void 0===a?void 0:a.geojson,null===(o=p.data)||void 0===o?void 0:o.revision),void postMessage({id:d,data:{revision:null===(l=p.data)||void 0===l?void 0:l.revision},error:null})):void("reloadTile"===u?ps.reloadTile(p,ms):ps.loadTile(p,ms)).then((t=>{const e=[],i=(null==t?void 0:t.stores)?Object.keys(t.stores).reduce(((i,r)=>{const s=t.stores[r],a=n(s.serialize(),e,[".+Array","buffer"]);return a.type=s.type,i[r]=a,i}),{}):{};postMessage({id:d,data:{stores:i,dependencies:null==t?void 0:t.dependencies,geojson:ps instanceof us?ps.geojson:void 0}},void 0,e)})).catch((i=>{var r;let s=null!==(r=null==i?void 0:i.name)&&void 0!==r?r:"VectorTileWorkerError";const a={code:0,message:void 0};console.error("[MapsGL] Worker error:",i),i instanceof e?(s="InvalidResponseError",a.code=i.response.status,a.message=i.response.statusText):i instanceof t&&(s="UnauthorizedError",a.code=401,a.message="Unauthorized"),postMessage({id:d,status:a,error:`${s}: ${null==i?void 0:i.message}`})}))}else Ji=h.sessionToken}})(),r})())),(self.webpackChunk_xweather_mapsgl=self.webpackChunk_xweather_mapsgl||[]).push([["weather"],{6429:(t,e,i)=>{i.r(e),i.d(e,{default:()=>ni});var r={};i.r(r),i.d(r,{aqi:()=>yt,aqiCategories:()=>bt,cai:()=>Zt,caqi:()=>At,categories:()=>vt,china:()=>wt,co:()=>Ft,eaqi:()=>Mt,health:()=>xt,india:()=>_t,no:()=>It,no2:()=>Vt,o3:()=>Wt,pm10:()=>St,pm2p5:()=>Gt,points:()=>ft,pollutant:()=>Et,so2:()=>Ct,uba_daqi:()=>Tt,uk_daqi:()=>Rt});var s={};i.r(s),i.d(s,{aqhi:()=>Yt,aqi:()=>Nt,cai:()=>Dt,caqi:()=>Xt,china:()=>Lt,co:()=>Qt,eaqi:()=>jt,india:()=>Ot,no:()=>Kt,no2:()=>Jt,o3:()=>qt,pm10:()=>Ut,pm2p5:()=>Ht,points:()=>zt,so2:()=>$t,ubaDaqi:()=>Bt,ukDaqi:()=>Pt});var a={};i.r(a),i.d(a,{risk:()=>ue,summary:()=>de,surface:()=>ce});var n={};i.r(n),i.d(n,{riskHydroplane:()=>be,riskLowVizFog:()=>we,riskLowVizSnow:()=>xe,riskRollover:()=>ye,summary:()=>me,surface:()=>ge,temperature:()=>fe,temperatureFreeze:()=>ve});var o=i(8708);const l=class{constructor(t){this.variables=t}formattedForRequest(){return this.variables.reduce(((t,e)=>{var i,r;const s={measurement:e.measurement,dataMin:e.dataRange.min,dataMax:e.dataRange.max,noData:e.noData,outputMin:null===(i=e.outputRange)||void 0===i?void 0:i.min,outputMax:null===(r=e.outputRange)||void 0===r?void 0:r.max,timeOffset:e.timeOffset};return"string"==typeof e.code?t.push(Object.assign({id:e.code},s)):t.push(Object.assign({id:e.code.u},s),Object.assign({id:e.code.v},s)),t}),[])}};var h=i(7658),d=i(8346),c=i(4229),u=i(2102),p=i(3760),m=i(5711),g=i(2957),f=i(6081),v=i(9369),y=i(8854);const b={bar:{height:14,rounded:!0,labels:{every:10,placement:"middle",marks:"none"}},text:{color:"#fff",stroke:{color:"#000",width:1},shadow:{color:"#000"}}},x={points:{radius:4}},w=(t,e,i)=>(0,g.convert)("temperature",t,e,i),_=(t,e,i)=>(0,g.convert)("temperature-change",t,e,i),M=(t,e,i)=>(0,g.convert)("speed",t,e,i),Z=(t,e,i)=>(0,g.convert)("pressure",t,e,i),A=(t,e,i)=>(0,g.convert)("precipitation",t,e,i),T=(t,e,i)=>(0,g.convert)("distance",t,e,i),R=(t,e)=>(e.type="bar",e.title=t,(0,m.$)({},b,e)),G=(t,e)=>(e.type="point",e.title=t,(0,m.$)({},x,e));var S=i(6219),C=i(2208),I=i(5661),V=i(2050);const F={LO:"#4875FB",I:"#4875FB",TD:"#FFE700",TS:"#FEA800",H1:"#DD0002",H2:"#FF0491",H3:"#DD00FD",H4:"#FEAFFF",H5:"#EFEFEF",TY:"#DD0002",STY:"#EFEFEF"},W={"TR.A":"#FFE403","TR.W":"#FF9100","HU.A":"#FF00D2","HU.W":"#FF0018"},E=["case",[">",["at",1,["coalesce",["get","location.coordinates"],["literal",[]]]],0],1,-1],k=function(t){return{point:{type:S.m.circle,sourceType:c.V.point,paint:{fill:{color:["match",["upcase",["get","details.stormCat"]],"LO",t.LO,"I",t.I,"TD",t.TD,"TS",t.TS,"H1",t.H1,"H2",t.H2,"H3",t.H3,"H4",t.H4,"H5",t.H5,"TY",t.TY,"STY",t.STY,"#000000"]},stroke:{color:"#fff",thickness:3},circle:{radius:8}}},symbol:{type:S.m.symbol,sourceType:c.V.point,paint:{fill:{color:["match",["upcase",["get","details.stormCat"]],"LO",t.LO,"I",t.I,"TD",t.TD,"TS",t.TS,"H1",t.H1,"H2",t.H2,"H3",t.H3,"H4",t.H4,"H5",t.H5,"TY",t.TY,"STY",t.STY,"#000000"]},stroke:{color:"#fff",thickness:1},icon:{image:["match",["upcase",["get","details.stormCat"]],["H","TY","TC","STY"],"mapsgl:hurricane","TS","mapsgl:tropical-storm","TD","mapsgl:tropical-depression","mapsgl:tropical-low"],size:["case",["<",["zoom"],4],{width:20,height:20},{width:36,height:36}],factor:["match",["get","details.stormType"],["H","TY","STY","TS","TD"],E,0]},text:[{value:["case",["<",["zoom"],4],null,["regex","^H\\d$",["get","details.stormCat"]],["slice",["get","details.stormCat"],1],["==",["get","details.stormCat"],"STY"],"S",null],size:12,color:"#fff",outlineColor:"#444",weight:"bold",anchor:"center",offset:{x:0,y:-3}}]}},track:{type:S.m.line,paint:{stroke:{color:["match",["upcase",["get","details.stormCat"]],"LO",t.LO,"I",t.I,"TD",t.TD,"TS",t.TS,"H1",t.H1,"H2",t.H2,"H3",t.H3,"H4",t.H4,"H5",t.H5,"TY",t.TY,"STY",t.STY,"#000000"],thickness:3}}},name:{type:"text",paint:{text:{value:["get","details.stormShortName"],size:["case",["<",["zoom"],4],12,14],color:"#fff",outlineColor:"#444",weight:"bold",anchor:"top",offset:["case",["<",["zoom"],4],{x:0,y:8},{x:0,y:12}]},symbol:{fadeOpacity:!1,pitchWithMap:!1,rotateWithMap:!1,allowOverlap:!0}}}}}(F),z=G("Tropical Cyclones",function(t){return{id:"tropical-cyclones",points:{values:[{color:t.LO,label:"Low"},{color:t.TD,label:"Depression"},{color:t.TS,label:"Storm"},{color:t.H1,label:"Cat 1"},{color:t.H2,label:"Cat 2"},{color:t.H3,label:"Cat 3"},{color:t.H4,label:"Cat 4"},{color:t.H5,label:"Cat 5"},{color:t.TY,label:"Typhoon"},{color:t.STY,label:"Super Typhoon"}]}}}(F)),N=G("Tropical Cyclone Breakpoints",function(t){return{id:"tropical-breakpoints",points:{values:[{color:t["TR.A"],label:"Tropical Storm Watch"},{color:t["TR.W"],label:"Tropical Storm Warning"},{color:t["HU.A"],label:"Hurricane Watch"},{color:t["HU.W"],label:"Hurricane Warning"}]}}}(W)),Y={title:t=>{var e,i,r;const s=null===(e=t.features)||void 0===e?void 0:e[0];return null===(r=null===(i=null==s?void 0:s.details)||void 0===i?void 0:i.stormShortName)||void 0===r?void 0:r.replace(/(-\w)$/,(t=>t.toUpperCase()))},fn:t=>{var e,i,r,s,a,n;const o=null===(e=t.features)||void 0===e?void 0:e[0];if(!o||"errorCone"===o.featureType)return"";const l=(null==o?void 0:o.timestamp)||Date.now()/1e3,h=(0,C.Yq)(new Date(1e3*l),"format[MMM d, yyyy H:mm a]"),d=[],c=null===(i=null==o?void 0:o.details)||void 0===i?void 0:i.windSpeedMPH,u=null===(r=null==o?void 0:o.details)||void 0===r?void 0:r.windSpeedKPH,p=null===(s=null==o?void 0:o.details)||void 0===s?void 0:s.windSpeedKTS;let m=null===(a=null==o?void 0:o.details)||void 0===a?void 0:a.stormCat;if(d.push("forecastPoint"===o.featureType?"Forecast":`Advisory #${null===(n=null==o?void 0:o.details)||void 0===n?void 0:n.advisoryNumber}`,`${h}`),m){switch(m=m.replace(/^H(\d)/,"Cat $1 Hurricane"),m){case"LO":m="Low";break;case"I":m="Invest";break;case"TD":m="Tropical Depression";break;case"TS":m="Tropical Storm";break;case"TY":m="Typhoon";break;case"STY":m="Super Typhoon"}d.push(`${m}`)}return c&&p&&d.push(`${p} knots, ${u} kph, ${c} mph`),d.join("<br>")}};function L(t,e){let{lat:i,lon:r}=t,{lat:s,lon:a}=e;if(Math.abs(r-a)<=180)return null;r>0&&a<0?a+=360:r<0&&a>0&&(r+=360);const n=(180-r)/(a-r);return n<0||n>1?null:i+n*(s-i)}function O(t,e,i){return{type:"Feature",geometry:{type:"LineString",coordinates:[t,e]},properties:(0,V.mg)(i)}}function j(t){const e=new Set,i=[],r=[],s=[];return t.features.forEach((t=>{const a=`${t.id}`.replace(/-trackPoint-.*$/,"").replace(/-forecastPoint-.*$/,"").replace(/-Position$/,"");`${t.id}`.includes("-Position")&&(e.add(a),i.push(t)),`${t.id}`.includes("-trackPoint")&&(e.add(a),r.push(t)),`${t.id}`.includes("-forecastPoint")&&(e.add(a),s.push(t))})),[...e].forEach((e=>{const a=i.find((t=>`${t.id}`.startsWith(e))),n=r.filter((t=>`${t.id}`.startsWith(e))),o=s.filter((t=>`${t.id}`.startsWith(e)));if(a){if(n.length>0){const t=n[0].geometry.coordinates;a.geometry.coordinates.toString()!==t.toString()&&n.push(a)}o.length>0&&o.unshift(a)}[n,o].forEach(((i,r)=>{const s=0===r?"trackLine":"forecastLine";for(let r=0;r<i.length;r++)if(r>0){const a=String(r-1).padStart(3,"0"),n=i[r-1];let o=n.geometry.coordinates;const l=i[r].geometry.coordinates;if(Math.abs(o[0]-l[0])>180){const i=o[0]-l[0]>0?-1:1,r=L({lat:o[1],lon:o[0]},{lat:l[1],lon:l[0]}),h=O(o,[-180*i,r],n.properties);h.id=`${e}-${s}String-${a}`,h.properties.featureType=s,t.features.push(h),o=[180*i,r]}const h=O(o,l,n.properties);h.id=`${e}-${s}String-${a}`,h.properties.featureType=s,t.features.push(h)}})),t.features=t.features.filter((t=>!/-trackLineString(-(NEG|POS))?$/.test(`${t.id}`)&&!`${t.id}`.endsWith("-forecastLineString")))})),t}function D(t,e){const i=e+273.15;let r=.75;i>271.16&&(r=1.75);let s=10+r*(271.16-i);return s=Math.max(0,Math.min(s,20)),t*s}function X(t,e){return 5===e?1:6===e?t<=-2?.9:t>2?.4:t>=0&&t<=2?Math.max(.5,Math.min(.9,.9-(t+2)/4*.4)):Math.max(.7,Math.min(.9,.9-(t+2)/2*.2)):7===e?t<=0?.65:t>=4?.2:Math.max(.2,Math.min(.65,.65-t/4*.45)):0}function B(t,e,i){if(3!==i&&4!==i&&12!==i||t<=0)return 0;if(e>2||e<-4)return 0;let r=1;return e>=0&&e<=2?r=1-e/2:e<0&&e>=-4&&(r=1+e/Math.abs(-4),r=Math.max(0,Math.min(1,r))),t*r}function P(t,e,i){if(8!==i||t<=0)return 0;let r=1;return e>=0&&e<=2?r=1-e/2:e<0&&e>=-4&&(r=1+e/Math.abs(-4),r=Math.max(0,Math.min(1,r))),t*r}const H="snow",U="sleet",Q="lightning-density";function K(t,e){return t.replace("{region}",e)}new Map([[H,(t,e)=>{const i=t.dimension+2*t.padding,r=.0254*3,s=e[0].dataMax,a=e[2].dataMin,n=e[2].dataMax;for(let e=0;e<i*i;e++){const i=4*e,o=t.rawData[i+1],l=a+t.rawData[i+2]/255*(n-a);let h=D(0+t.rawData[i+0]/255*(s-0),l);h*=X(l,o),h*=3.6,h=(h-0)/(r-0),h=Math.max(0,Math.min(h,1)),h=Math.floor(3*h*255);let d=h;for(let e=0;e<3;e++){const r=Math.min(255,d);t.rawData[i+e]=Math.round(r),d-=r}t.rawData[i+3]=255}}],["ice",(t,e)=>{const i=t.dimension+2*t.padding,r={min:0,max:e[0].dataMax},s=e[2].dataMin,a=e[2].dataMax,n=r;for(let e=0;e<i*i;e++){const i=4*e;let o=B(3600*(r.min+t.rawData[i+0]/255*(r.max-r.min)),s+t.rawData[i+2]/255*(a-s),t.rawData[i+1]);o/=3600,o=(o-n.min)/(n.max-n.min),o=Math.max(0,Math.min(o,1)),o=Math.floor(3*o*255);let l=o;for(let e=0;e<3;e++){const r=Math.min(255,l);t.rawData[i+e]=Math.round(r),l-=r}t.rawData[i+3]=255}}],[U,(t,e)=>{const i=t.dimension+2*t.padding,r={min:0,max:e[0].dataMax},s=e[2].dataMin,a=e[2].dataMax,n=r;for(let e=0;e<i*i;e++){const i=4*e;let o=P(3600*(r.min+t.rawData[i+0]/255*(r.max-r.min)),s+t.rawData[i+2]/255*(a-s),t.rawData[i+1]);o/=3600,o=(o-n.min)/(n.max-n.min),o=Math.max(0,Math.min(o,1)),o=Math.floor(3*o*255);let l=o;for(let e=0;e<3;e++){const r=Math.min(255,l);t.rawData[i+e]=Math.round(r),l-=r}t.rawData[i+3]=255}}],["vpd",(t,e)=>{const i=t.dimension+2*t.padding,r=e[0].dataMin,s=e[0].dataMax,a=e[2].dataMin,n=e[2].dataMax;for(let e=0;e<i*i;e++){const i=4*e,o=a+t.rawData[i+2]/255*(n-a),l=r+t.rawData[i+0]/255*(s-r)+273.15,h=-2836.5744/Math.pow(l,2)-6.028076559*1e3/l+19.54263612-2.737830188*.01*l+1.6261698*1e-5*Math.pow(l,2)+7.0229056e-10*Math.pow(l,3)-18680009e-20*Math.pow(l,4)+2.7150305*Math.log(l);let d=(100-o)/100*Math.exp(h);d/=100,d=(d-0)/70,t.rawData[i+0]=Math.round(255*d),t.rawData[i+1]=0,t.rawData[i+2]=0,t.rawData[i+3]=255}}],[Q,t=>{const e=t.dimension+2*t.padding;for(let i=0;i<e*e;i++){const e=4*i;t.rawData[e+2]=Math.min(255,t.rawData[e+0]+t.rawData[e+1])}}]]);const J={base_osm:"base.osm",base_osm_power:"base.osm.power",base_cities:"base.cities",conditions_TMP_UGRD_VGRD:"conditions.TMP_2:UGRD_10:VGRD_10",conditions_TMP_DPT_RH:"conditions.TMP_2:DPT_2:RH_2",conditions_TMP_DELTA:"conditions.TMP_2:DELTA",conditions_APTMP_DPT_RH:"conditions.APTMP_2:DPT_2:RH_2",conditions_PRMSL_VIS_GUST:"conditions.PRMSL_0:VIS_0:GUST_10",conditions_SKY_PRECIP_UVI:"conditions.TCDC_0:PRECIP_0:UVI_0",conditions_PTYPE_PRECIP_TMP:"conditions.PTYPE_0:PRECIP_0:TMP_2",conditions_PRECIP:"conditions.PRECIP_0",conditions_SNOW_DERIVED:"conditions.SNOW-PRECIP_0:TMP_2",conditions_ICE_DERIVED:"conditions.ICE-PRECIP_0:TMP_2",conditions_SLEET_DERIVED:"conditions.SLEET-PRECIP_0:TMP_2",conditions_SNOD:"conditions.SNOD_0",conditions_VPD:"conditions.VPD_0",radar_REFC_PRATE_PTYPE:"radar.REFC_0:PRATE_0:PTYPESMPL_0",forecast_REFC_PRATE_PTYPE:"forecast.REFC_0:PRATE_0:PTYPESMPL_0",airquality_AQI_PM2P5_PM10:"airquality.AQI-AirNow:PM2P5_0:PM10_0",airquality_AQI_HI_China_India:"airquality.AQI-AQHI:AQI-China:AQI-India",airquality_AQI_EAQI_UBA_UK:"airquality.AQI-EAQI:AQI-UBA_DAQI:AQI-UK_DAQI",airquality_AQI_CAI_CAQI:"airquality.AQI-CAI:AQI-CAQI",airquality_CO_NO_NO2:"airquality.CO_0:NO_0:NO2_0",airquality_O3_SO2:"airquality.O3_0:SO2_0",airquality_points:"airquality.points",maritime_WAVE:"maritime.HTSGW_0:DIRPW_0:PERPW_0",maritime_SWELL1:"maritime.SWELL_1:SWPER_1:SWDIR_1",maritime_SWELL2:"maritime.SWELL_2:SWPER_2:SWDIR_2",maritime_SWELL3:"maritime.SWELL_3:SWPER_3:SWDIR_3",maritime_WTMP_UOGRD_VOGRD:"maritime.WTMP_0:UOGRD_0:VOGRD_0",maritime_SURGE_TIDE:"maritime.SURGE_0:TIDE_0",severe_alerts:"severe.alerts",severe_stormcells:"severe.stormcells",severe_stormreports:"severe.stormreports",severe_lightning:"severe.lightning",severe_lightning_all:"severe.lightning.all",severe_lightning_flash:"severe.lightning.flash",severe_lightning_threats:"severe.lightning.threats",severe_lightning_LGTIC_LGTCG:"severe.lightning.LGT-IC:LGT-CG.{region}",severe_hail_threats:"severe.hail.threats",severe_hail_MESH_POSH:"severe.hail.MESH:POSH.{region}",severe_convective:"severe.convective",fires_obs:"fires.obs",fires_perimeter:"fires.perimeter",fires_outlook:"fires.outlook",drought:"drought",earthquakes:"earthquakes",rivers:"rivers",tropical_active:"tropical.active",tropical_archive:"tropical.archive",tropical_invests:"tropical.invests",roadweather_nowcast_us:"roadweather.nowcast.us",roadweather_nowcast_europe:"roadweather.nowcast.europe",roadweather_nowcast_japan:"roadweather.nowcast.japan",roadweather_nowcast_australia:"roadweather.nowcast.australia",roadweather_nowcast_new_zealand:"roadweather.nowcast.new_zealand",roadweather_forecast_us:"roadweather.forecast.us",roadweather_forecast_europe:"roadweather.forecast.europe",roadweather_forecast_japan:"roadweather.forecast.japan",roadweather_forecast_australia:"roadweather.forecast.australia",roadweather_forecast_new_zealand:"roadweather.forecast.new_zealand",satellite_infrared:"satellite.infrared",satellite_infrared_color:"satellite.infrared_color",satellite_visible:"satellite.visible",satellite_water_vapor:"satellite.water_vapor",satellite_geocolor:"satellite.geocolor"},q=(t,e)=>Object.assign(Object.assign(Object.assign({[J.base_osm]:()=>t.getVectorTileSourceConfig("open-street-map",e),[J.base_osm_power]:()=>t.getVectorTileSourceConfig("open-street-map-power-infrastructure",e),[J.base_cities]:()=>({type:c.o.vector,url:"https://cdn.aerisapi.com/sdk/js/mapsgl/data/cities/{z}/{x}/{y}.pbf",maxZoom:14}),[J.conditions_TMP_UGRD_VGRD]:()=>t.getEncodedSourceConfig(new l([h.X1,h.LO]),e),[J.conditions_TMP_DELTA]:()=>t.getEncodedSourceConfig(new l([h.X1,Object.assign(Object.assign({},h.X1),{timeOffset:-86400}),Object.assign(Object.assign({},h.X1),{timeOffset:-3600})]),e),[J.conditions_TMP_DPT_RH]:()=>t.getEncodedSourceConfig(new l([h.X1,h.$W,h.c1]),e),[J.conditions_APTMP_DPT_RH]:()=>t.getEncodedSourceConfig(new l([h.TX,h.$W,h.c1]),e),[J.conditions_PRMSL_VIS_GUST]:()=>t.getEncodedSourceConfig(new l([h.rv,h.XD,h.MF]),e),[J.conditions_SNOD]:()=>t.getEncodedSourceConfig(new l([h.RX]),e),[J.conditions_SKY_PRECIP_UVI]:()=>t.getEncodedSourceConfig(new l([h.h4,h.Yh,h.DP]),e),[J.conditions_PTYPE_PRECIP_TMP]:()=>t.getEncodedSourceConfig(new l([h.Kn,h.Yh,h.X1]),e),[J.conditions_PRECIP]:()=>Object.assign({},t.getEncodedSourceConfig(new l((0,u.T9)(h.Yh,3)),e)),[J.conditions_SNOW_DERIVED]:()=>Object.assign(Object.assign({},t.getEncodedSourceConfig(new l([h._k,h.Kn,h.X1]),e)),{effectiveDatasets:new l([...(0,u.T9)({code:"weather-surface_PRATE_0-SFC",measurement:{type:"snowfall",units:"m"},dataRange:{min:0,max:.0254*3}},3)]).formattedForRequest(),transformerId:H}),[J.conditions_ICE_DERIVED]:()=>Object.assign(Object.assign({},t.getEncodedSourceConfig(new l([h._k,h.Kn,h.X1]),e)),{effectiveDatasets:new l([...(0,u.T9)({code:"weather-surface_PRATE_0-SFC",measurement:{type:"rate",units:"mm/sec"},dataRange:{min:0,max:.0211666667}},3)]).formattedForRequest(),transformerId:"ice"}),[J.conditions_SLEET_DERIVED]:()=>Object.assign(Object.assign({},t.getEncodedSourceConfig(new l([h._k,h.Kn,h.X1]),e)),{effectiveDatasets:new l([...(0,u.T9)({code:"weather-surface_PRATE_0-SFC",measurement:{type:"rate",units:"mm/sec"},dataRange:{min:0,max:.0211666667}},3)]).formattedForRequest(),transformerId:U}),[J.conditions_VPD]:()=>Object.assign(Object.assign({},t.getEncodedSourceConfig(new l([h.X1,h.$W,h.c1]),e)),{transformerId:"vpd"}),[J.radar_REFC_PRATE_PTYPE]:()=>t.getEncodedSourceConfig(new l([h.lw,h.Wc,h.Jg]),e),[J.airquality_points]:()=>t.getVectorSourceConfig("air-quality"),[J.airquality_AQI_PM2P5_PM10]:()=>t.getEncodedSourceConfig(new l([h.q_.aqiAirNow,h.q_.pm2p5,h.q_.pm10]),e),[J.airquality_AQI_HI_China_India]:()=>t.getEncodedSourceConfig(new l([h.q_.aqiHealthIndex,h.q_.aqiChina,h.q_.aqiIndia]),e),[J.airquality_AQI_EAQI_UBA_UK]:()=>t.getEncodedSourceConfig(new l([h.q_.aqiEAQI,h.q_.aqiUbaDAQI,h.q_.aqiUkDAQI]),e),[J.airquality_AQI_CAI_CAQI]:()=>t.getEncodedSourceConfig(new l([h.q_.aqiCAI,h.q_.aqiCAQI]),e),[J.airquality_CO_NO_NO2]:()=>t.getEncodedSourceConfig(new l([h.q_.co,h.q_.no,h.q_.no2]),e),[J.airquality_O3_SO2]:()=>t.getEncodedSourceConfig(new l([h.q_.o3,h.q_.so2]),e),[J.maritime_WAVE]:()=>t.getEncodedSourceConfig(new l([h.xj.waveHeight,h.xj.wavePeriod,h.xj.waveDir]),e),[J.maritime_SWELL1]:()=>t.getEncodedSourceConfig(new l([h.xj.swellHeightPrimary,h.xj.swellPeriodPrimary,h.xj.swellDirPrimary]),e),[J.maritime_SWELL2]:()=>t.getEncodedSourceConfig(new l([h.xj.swellHeightSecondary,h.xj.swellPeriodSecondary,h.xj.swellDirSecondary]),e),[J.maritime_SWELL3]:()=>t.getEncodedSourceConfig(new l([h.xj.swellHeightTertiary,h.xj.swellPeriodTertiary,h.xj.swellDirTertiary]),e),[J.maritime_WTMP_UOGRD_VOGRD]:()=>t.getEncodedSourceConfig(new l([h.xj.sst,h.xj.current]),e),[J.maritime_SURGE_TIDE]:()=>t.getEncodedSourceConfig(new l([h.xj.surge,h.xj.tide]),e),[J.severe_alerts]:()=>t.getVectorSourceConfig("alerts"),[J.severe_stormcells]:()=>t.getVectorSourceConfig("stormcells"),[J.severe_stormreports]:()=>t.getVectorSourceConfig("stormreports"),[J.severe_lightning]:()=>t.getVectorSourceConfig("lightning-strikes"),[J.severe_lightning_all]:()=>t.getVectorSourceConfig("lightning-all"),[J.severe_lightning_flash]:()=>t.getVectorSourceConfig("lightning-flash"),[J.severe_lightning_threats]:()=>t.getVectorTileSourceConfig("lightning-threat-zones",e),[J.severe_hail_threats]:()=>t.getVectorTileSourceConfig("hail-threats-nowcast",e),[J.severe_convective]:function(){let{timeline:e,params:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{from:r,to:s}=$(e);return t.getGeoJSONSourceConfig("convective/outlook",void 0,Object.assign({from:r,to:s,filter:"cat"},i))}},p.ot.reduce(((i,r)=>{const s="us"===r?"conus":r;return i[K(J.severe_hail_MESH_POSH,r)]=()=>t.getEncodedSourceConfig(new l([h.R$.size(s),h.R$.posh(s)]),e,{bounds:d.wi[r]}),i}),{})),p.Q0.reduce(((i,r)=>{const s="us"===r?"conus":r;return i[K(J.severe_lightning_LGTIC_LGTCG,r)]=()=>Object.assign(Object.assign({},t.getEncodedSourceConfig(new l([h.VJ.cg(s),h.VJ.ic(s),h.VJ.cg(s)]),e,{bounds:d.wi[r]})),{transformerId:Q}),i}),{})),{[J.fires_obs]:function(){return t.getVectorSourceConfig("fires-obs-points")},[J.fires_perimeter]:function(){let{timeline:e,params:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{from:r,to:s}=$(e);return t.getGeoJSONSourceConfig("fires",void 0,Object.assign({from:r,to:s,query:"area:1",filter:"all,geo",limit:1e3},i))},[J.fires_outlook]:function(){let{timeline:e,params:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{from:r,to:s}=$(e);return t.getGeoJSONSourceConfig("fires/outlook",void 0,Object.assign({from:r,to:s,filter:"firewx"},i))},[J.drought]:function(){let{timeline:e,params:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{from:r,to:s}=$(e);return t.getGeoJSONSourceConfig("droughts/monitor",void 0,Object.assign({from:r,to:s,filter:"all,geo",sort:"code"},i))},[J.earthquakes]:function(){let{timeline:e,params:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{from:r,to:s}=$(e);return t.getGeoJSONSourceConfig("earthquakes",void 0,Object.assign({from:r,to:s,query:"mag:0",limit:1e3},i))},[J.rivers]:()=>t.getVectorSourceConfig("river-observations"),[J.tropical_active]:function(){let{timeline:e,params:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{from:r,to:s}=$(e);return t.getGeoJSONSourceConfig("tropicalcyclones/archive",o.Fu.search,Object.assign({filter:"active,dateline",limit:1e3,from:r,to:s},i),{transformGeoJSON:(t,e)=>j(e)})},[J.tropical_archive]:function(){let{timeline:e,params:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{from:r,to:s}=$(e);return t.getGeoJSONSourceConfig("tropicalcyclones/archive",o.Fu.search,Object.assign({filter:"active;notactive,dateline",limit:1e3,from:r,to:s},i),{transformGeoJSON:(t,e)=>{const i=[];let r,s,a;return e.features.forEach(((t,e)=>{if(/-trackPoint-/.test(`${t.id}`)){const e=t.properties.id;r&&e===r||(s&&(s.properties.details=a.properties.details,i.push(s)),s=Object.assign(Object.assign({},t),{id:`${t.id}`.replace(/-trackPoint-.*$/,"-Position"),properties:Object.assign(Object.assign({},t.properties),{id:r,featureType:"position"})}),r=e),a=t}else`${t.id}`.endsWith("-Position")&&(s=void 0)})),e.features=[...e.features,...i],j(e)}})},[J.tropical_invests]:function(){let{timeline:e,params:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{from:r,to:s}=$(e);return t.getGeoJSONSourceConfig("tropicalcyclones/archive",o.Fu.search,Object.assign({filter:"invests",from:r,to:s},i))},[J.roadweather_nowcast_us]:()=>t.getVectorTileSourceConfig("road-wx-nowcast-us",e,{bounds:d.wi.us}),[J.roadweather_nowcast_europe]:()=>t.getVectorTileSourceConfig("road-wx-nowcast-europe",e,{bounds:d.wi.europe}),[J.roadweather_nowcast_japan]:()=>t.getVectorTileSourceConfig("road-wx-nowcast-japan",e,{bounds:d.wi.japan}),[J.roadweather_nowcast_australia]:()=>t.getVectorTileSourceConfig("road-wx-nowcast-australia",e,{bounds:d.wi.australia}),[J.roadweather_nowcast_new_zealand]:()=>t.getVectorTileSourceConfig("road-wx-nowcast-new-zealand",e,{bounds:d.wi.new_zealand}),[J.roadweather_forecast_us]:()=>t.getVectorTileSourceConfig("road-wx-forecast-us",e,{bounds:d.wi.us}),[J.roadweather_forecast_europe]:()=>t.getVectorTileSourceConfig("road-wx-forecast-europe",e,{bounds:d.wi.europe}),[J.roadweather_forecast_japan]:()=>t.getVectorTileSourceConfig("road-wx-forecast-japan",e,{bounds:d.wi.japan}),[J.roadweather_forecast_australia]:()=>t.getVectorTileSourceConfig("road-wx-forecast-australia",e,{bounds:d.wi.australia}),[J.roadweather_forecast_new_zealand]:()=>t.getVectorTileSourceConfig("road-wx-forecast-new-zealand",e,{bounds:d.wi.australia}),[J.satellite_infrared]:()=>t.getRasterSourceConfig("satellite"),[J.satellite_infrared_color]:()=>t.getRasterSourceConfig("satellite-infrared-color"),[J.satellite_visible]:()=>t.getRasterSourceConfig("satellite-visible"),[J.satellite_water_vapor]:()=>t.getRasterSourceConfig("satellite-water-vapor"),[J.satellite_geocolor]:()=>t.getRasterSourceConfig("satellite-geocolor")}),$=t=>{var e,i;return{from:null!==(e=null==t?void 0:t.startDate)&&void 0!==e?e:new Date,to:null!==(i=null==t?void 0:t.endDate)&&void 0!==i?i:new Date}},tt={temperature:{title:"Temperature",fn:t=>`${t.value.toFixed(2)}&deg;C, ${g.CtoF(t.value).toFixed(2)}&deg;F`},temperature_change:{title:"Temp Change",fn:t=>{const e=t.value>0?"+":"";return`${e}${t.value.toFixed(2)}&deg;C, ${e}${g.CtoFUnit(t.value).toFixed(2)}&deg;F`}},winds:{title:"Winds",fn:t=>{if(Number.isNaN(null==t?void 0:t.value))return;const e=t.value;return`${g.degToDir(t.angle-180)} ${g.msToKph(e).toFixed(1)} kph, ${g.msToMph(e).toFixed(1)} mph`}},wind_gusts:{title:"Wind Gusts",fn:t=>`${g.msToKph(t.value).toFixed(1)} kph, ${g.msToMph(t.value).toFixed(1)} mph`},humidity:{title:"Humidity",fn:t=>`${Math.round(t.value)}%`},pressure_msl:{title:"Surface Pressure",fn:t=>`${t.value.toFixed(1)} mb, ${g.mbToHg(t.value).toFixed(2)} in`},visibility:{title:"Visibility",fn:t=>`${g.mToKm(t.value).toFixed(1)} km, ${g.mToMi(t.value).toFixed(1)} mi`},wave_height:{title:"Wave Height",fn:t=>`${t.value.toFixed(1)} m, ${g.mToFt(t.value).toFixed(1)} ft`},angle:{title:"Direction",fn:t=>`${g.degToDir(t.value-180)}`},angle_reversed:{title:"Direction",fn:t=>{let e=t.value-180-180;return e<0&&(e+=360),`${g.degToDir(e)}`}},period:{title:"Period",fn:t=>`${Math.round(t.value)} sec`},height_change:{title:"Height Change",fn:t=>{const e=t.value>0?"+":"";return`${e}${t.value.toFixed(2)} m, ${e}${g.mToFt(t.value).toFixed(1)} ft`}},radar:{title:"Radar",fn:t=>{if(t.value<5)return"";let e="Very Light";return t.value>=60?e="Extreme/Hail":t.value>=55?e="Intense":t.value>=45?e="Heavy":t.value>=35?e="Moderate":t.value>=25&&(e="Light"),`${e}: ${t.value.toFixed(2)} dbz`}},accum_precip:{title:"Accum Precip",fn:t=>{const e=3600*t.value;return`${e.toFixed(1)} mm, ${g.mmToIn(e).toFixed(2)} in`}}},et=function(t,e){return(0,m.$)({},{id:t,layer:{type:S.m.line,source:J.base_osm,sourceLayer:"boundary",paint:{stroke:{color:"#000",thickness:1,lineJoin:I.p.Round,lineCap:I.$.Round}}}},{layer:{filter:e,paint:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}}})},it=function(t,e){return(0,m.$)({},{id:t,layer:{type:S.m.line,source:J.base_osm,sourceType:c.V.line,sourceLayer:"transportation",paint:{stroke:{color:"#000",thickness:3,lineJoin:I.p.Round,lineCap:I.$.Round}}}},{layer:{filter:e,paint:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}}})},rt=function(t,e){return(0,m.$)({},{id:t,layer:{type:S.m.symbol,source:J.base_osm,sourceType:c.V.point,sourceLayer:"place",paint:{text:{value:["coalesce",["get","name:en"],["get","name"]],weight:"normal",size:12,color:"#333",outlineColor:"#fff"},symbol:{rank:{property:"rank",direction:"asc"},pitchWithMap:!1,rotateWithMap:!1,scaleWithMap:!1,allowOverlap:!1,overlapMode:"map"}}}},{layer:{filter:e,paint:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}}})},st=function(t,e){return(0,m.$)({},{id:t,layer:{type:S.m.line,source:J.base_osm,sourceType:c.V.polygon,sourceLayer:"water",paint:{fill:{color:"#333"}}}},{layer:{filter:e,paint:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}}})},at={gas:"#E83B1F",oil:"#555",wind:"#009EFF",solar:"#FFB300"},nt=t=>G("Power Generators",{id:(0,u.RC)("power-generators"),points:{values:[{color:t.gas,label:"Gas"},{color:t.oil,label:"Oil"},{color:t.wind,label:"Wind"},{color:t.solar,label:"Solar"}]}});var ot=i(2291),lt=i(9147);const ht=(t,e,i)=>{if(i>0){const r=(0,y.SG)(Math.round((0,g.CtoF)(t)),i),s=Math.round((0,g.CtoF)(e)),a=Array.from({length:Math.ceil((s-r)/i)},((t,e)=>(0,g.FtoC)(r+e*i)));return a.push(e),a}},dt=t=>.0039215686*t,ct={type:"water"},ut={type:"land"},pt={current:[0,"rgba(16,145,253,0)",.5144,"#1091FD",.7716,"#37FF84",1.0288,"#B6FF06",1.286,"#FEE10A",1.5432,"#EFB80C",1.8004,"#FD8408",2.0576,"#F43305",2.3148,"#AB1406",2.572,"#931537",3.0864,"#A4168A"],wave_height:[0,"#091597",2.43,"#04C9FC",4.88,"#8CFB37",6.09,"#FCFA3A",7.3,"#FF6116",8.53,"#FF040B",10.36,"#79003C",12.19,"#FF2391",14.26,"#FFE0FF"],surge:[0,"#091597",.6096,"#04C9FC",1.2192,"#8CFB37",1.8288,"#FCFA3A",2.4384,"#FF6116",3.048,"#FF040B",3.6576,"#79003C",4.2672,"#FF2391",4.8768,"#FFE0FF"],period:[2,"#091597",6,"#0030AE",10,"#04C9FC",14,"#8CFB37",16,"#FCFA3A",18,"#FF6116",20,"#FF040B",22,"#79003C",24,"#FF2391"],height_diff:[-12.192,"#EF90FF",-9.144,"#D741DA",-6.096,"#8B21DA",-4.572,"#0013CA",-3.048,"#0070F1",-1.524,"#8ED4F9",-.6096,"rgba(142,212,249,0)",0,"rgba(0,0,0,0)",.6096,"rgba(255,217,42,0)",1.524,"#FFD92A",3.048,"#FF932A",4.572,"#E2330B",6.096,"#9D0000",9.144,"#D00071",12.192,"#FF698C"]},mt={current:R("Ocean Currents",{id:"current",bar:{measurement:Object.assign(Object.assign({},h.xj.current.measurement),{converter:M}),colorscale:{range:{min:0,max:h.xj.current.dataRange.max},stops:pt.current},labels:{every:t=>1,formatter:(t,e,i)=>0===e?`${Math.round(t)} %%units%%`:`${Math.round(t)}`}}}),wave_height:R("Wave/Swell Height",{id:"wave-height",bar:{measurement:Object.assign(Object.assign({},h.xj.swellHeightPrimary.measurement),{converter:T}),colorscale:{range:h.xj.waveHeight.dataRange,stops:pt.wave_height},labels:{every:t=>"m"===t?1:5,formatter:(t,e,i)=>0===e?`${Math.round(t)} %%units%%`:`${Math.round(t)}`}}}),period:R("Wave/Swell Period",{id:"period",bar:{measurement:Object.assign(Object.assign({},h.xj.swellPeriodPrimary.measurement),{converter:(t,e,i)=>(0,g.convert)("time",t,e,i)}),colorscale:{range:h.xj.wavePeriod.dataRange,stops:pt.period},labels:{every:2,formatter:(t,e,i)=>0===e?`${Math.round(t)} %%units%%`:`${Math.round(t)}`}}}),surge:R("Storm Surge",{id:"surge",bar:{measurement:Object.assign(Object.assign({},h.xj.surge.measurement),{converter:T}),colorscale:{range:h.xj.surge.dataRange,stops:pt.surge},labels:{every:t=>"m"===t?.2:1,formatter:(t,e,i)=>{const r=i.metric?t.toFixed(1):Math.round(t);return 0===e?`${r} %%units%%`:`${r}`}}}}),tide_height:R("Tide Height",{id:"tide-height",bar:{measurement:Object.assign(Object.assign({},h.xj.tide.measurement),{converter:T}),colorscale:{range:h.xj.tide.dataRange,stops:pt.height_diff},labels:{every:t=>"m"===t?.5:2,formatter:(t,e,i)=>{const r=`${t>0?"+":""}${Math.round(t)}`;return 0===e?`${r}°%%units%%`:`${r}`}}}})};var gt=i(6476);const ft={good:"#29e11f",moderate:"#f8f92a",usg:"#f9681b",unhealthy:"#f60115",very_unhealthy:"#7a2c83",hazardous:"#65001b"},vt={health:{low:"#0000ff",moderate:"#00ff00",high:"#ffff00",very_high:"#ff0000"},china:{excellent:"#00ff00",good:"#ffff00",light:"#ff9900",moderate:"#ff0000",heavy:"#540099",severe:"#800000"},india:{good:"#00cc00",satisfactory:"#66cc00",moderate:"#ffff00",poor:"#ff9900",severe:"#ff0000",hazardous:"#a52a2a"},eaqi:{good:"#50f0e6",fair:"#50ccaa",moderate:"#f0e641",poor:"#ff5050",very_poor:"#960032",extremely_poor:"#7d2181"},cai:{good:"#0000ff",moderate:"#00ff00",unhealthy:"#ffff00",very_unhealthy:"#ff0000"},caqi:{very_low:"#79bc6a",low:"#bbcf4c",medium:"#eec20b",high:"#f29305",very_high:"#e8416f"},uba_daqi:{very_good:"#50f0e6",good:"#50cdaa",moderate:"#f0e641",poor:"#ff5050",very_poor:"#960032"},uk_daqi:{low:"#009900",moderate:"#ff9900",high:"#ff0000",very_high:"#990099"}},yt=[0,ft.good,25,ft.good,75,ft.moderate,125,ft.usg,175,ft.unhealthy,251,ft.very_unhealthy,301,ft.hazardous,500,ft.hazardous],bt=[0,ft.good,51,ft.moderate,101,ft.usg,151,ft.unhealthy,200,ft.very_unhealthy,301,ft.hazardous],xt=[0,vt.health.low,3.5,vt.health.moderate,6.5,vt.health.high,10.5,vt.health.very_high],wt=[0,vt.china.excellent,51,vt.china.good,101,vt.china.light,151,vt.china.moderate,201,vt.china.heavy,301,vt.china.severe],_t=[0,vt.india.good,51,vt.india.satisfactory,101,vt.india.moderate,201,vt.india.poor,301,vt.india.severe,401,vt.india.hazardous],Mt=[0,vt.eaqi.good,26,vt.eaqi.fair,51,vt.eaqi.moderate,76,vt.eaqi.poor,101,vt.eaqi.very_poor,126,vt.eaqi.extremely_poor],Zt=[0,vt.cai.good,51,vt.cai.moderate,101,vt.cai.unhealthy,251,vt.cai.very_unhealthy],At=[0,vt.caqi.very_low,26,vt.caqi.low,51,vt.caqi.medium,76,vt.caqi.high,101,vt.caqi.very_high],Tt=[0,vt.uba_daqi.very_good,26,vt.uba_daqi.good,51,vt.uba_daqi.moderate,76,vt.uba_daqi.poor,101,vt.uba_daqi.very_poor],Rt=[0,vt.uk_daqi.low,1.5,vt.uk_daqi.moderate,4.5,vt.uk_daqi.high,7.5,vt.uk_daqi.very_high],Gt=[0,"rgb(7, 54, 161, 0)",25,"#0B8ACE",50,"#F2D538",100,"#F28012",200,"#DF0612",300,"#980657"],St=[0,"rgb(7, 54, 161, 0)",50,"#0B8ACE",100,"#F2D538",250,"#F28012",500,"#DF0612",1e3,"#980657"],Ct=[0,"rgb(7, 54, 161, 0)",5,"#0B8ACE",10,"#F2D538",25,"#F28012",50,"#DF0612",100,"#980657"],It=[0,"rgb(7, 54, 161, 0)",5,"#0B8ACE",25,"#F2D538",50,"#F28012",100,"#DF0612"],Vt=[0,"rgb(7, 54, 161, 0)",10,"#0B8ACE",20,"#F2D538",30,"#F28012",50,"#DF0612",100,"#980657"],Ft=[0,"rgb(7, 54, 161, 0)",500,"#0B8ACE",650,"#F2D538",800,"#F28012",900,"#DF0612",1e3,"#980657"],Wt=[0,"rgb(7, 54, 161, 0)",50,"#0B8ACE",100,"#F2D538",150,"#F28012",200,"#DF0612",300,"#980657"],Et=[0,"#0043D3",.2,"#3AADF3",.4,"#FAF530",.6,"#FF8418",.8,"#DE1C06",1,"#650D03"],kt={type:"concentration",units:"µg/m³"},zt=G("Air Quality",{id:"airquality-aqi-categories",points:{values:[{color:ft.good,label:"Good"},{color:ft.moderate,label:"Moderate"},{color:ft.usg,label:"Sensitive Groups"},{color:ft.unhealthy,label:"Unhealthy"},{color:ft.very_unhealthy,label:"Very Unhealthy"},{color:ft.hazardous,label:"Hazardous"}]}}),Nt=R("Air Quality Index (AQI)",{id:"airquality-aqi",bar:{colorscale:{range:h.q_.aqiAirNow.dataRange,stops:yt,positions:[0,.1,.2,.4,.6,.8,.95,1]},labels:{values:[0,50,100,150,200,300,400,500]}}}),Yt=G("Air Quality Health Index (AQHI)",{id:"airquality-aqhi",points:{values:[{color:vt.health.low,label:"Low"},{color:vt.health.moderate,label:"Moderate"},{color:vt.health.high,label:"High"},{color:vt.health.very_high,label:"Very High"}]}}),Lt=G("Air Quality Index (China)",{id:"airquality-aqi-china",points:{values:[{color:vt.china.excellent,label:"Excellent"},{color:vt.china.good,label:"Good"},{color:vt.china.light,label:"Lightly Polluted"},{color:vt.china.moderate,label:"Moderately Polluted"},{color:vt.china.heavy,label:"Heavily Polluted"},{color:vt.china.severe,label:"Severely Polluted"}]}}),Ot=G("Air Quality Index (India)",{id:"airquality-aqi-india",points:{values:[{color:vt.india.good,label:"Good"},{color:vt.india.satisfactory,label:"Satisfactory"},{color:vt.india.moderate,label:"Moderate"},{color:vt.india.poor,label:"Poor"},{color:vt.india.severe,label:"Severe"},{color:vt.india.hazardous,label:"Hazardous"}]}}),jt=G("Air Quality Index (European)",{id:"airquality-aqi-eaqi",points:{values:[{color:vt.eaqi.good,label:"Good"},{color:vt.eaqi.fair,label:"Fair"},{color:vt.eaqi.moderate,label:"Moderate"},{color:vt.eaqi.poor,label:"Poor"},{color:vt.eaqi.very_poor,label:"Very Poor"},{color:vt.eaqi.extremely_poor,label:"Extremely Poor"}]}}),Dt=G("Air Quality Index (Korean)",{id:"airquality-aqi-cai",points:{values:[{color:vt.cai.good,label:"Good"},{color:vt.cai.moderate,label:"Moderate"},{color:vt.cai.unhealthy,label:"Unhealthy"},{color:vt.cai.very_unhealthy,label:"Very Unhealthy"}]}}),Xt=G("Air Quality Index (Common)",{id:"airquality-aqi-caqi",points:{values:[{color:vt.caqi.very_low,label:"Very Low"},{color:vt.caqi.low,label:"Low"},{color:vt.caqi.medium,label:"Medium"},{color:vt.caqi.high,label:"High"},{color:vt.caqi.very_high,label:"Very High"}]}}),Bt=G("Air Quality Index (German)",{id:"airquality-aqi-uba-daqi",points:{values:[{color:vt.uba_daqi.very_good,label:"Very Good"},{color:vt.uba_daqi.good,label:"Good"},{color:vt.uba_daqi.moderate,label:"Moderate"},{color:vt.uba_daqi.poor,label:"Poor"},{color:vt.uba_daqi.very_poor,label:"Very Poor"}]}}),Pt=G("Air Quality Index (UK)",{id:"airquality-aqi-uk-daqi",points:{values:[{color:vt.uk_daqi.low,label:"Low"},{color:vt.uk_daqi.moderate,label:"Moderate"},{color:vt.uk_daqi.high,label:"High"},{color:vt.uk_daqi.very_high,label:"Very High"}]}}),Ht=R("Particle Pollution (PM2.5)",{id:"airquality-pm2p5",bar:{measurement:Object.assign({},kt),colorscale:{range:h.q_.pm2p5.dataRange,stops:Gt,resample:(0,v.A)(.65,0,.85,1)},labels:{values:[0,10,25,50,100,200,300],formatter:(t,e,i)=>0===e?`${Math.round(t)} %%units%%`:`${Math.round(t)}`}}}),Ut=R("Particle Pollution (PM10)",{id:"airquality-pm10",bar:{measurement:Object.assign({},kt),colorscale:{range:h.q_.pm10.dataRange,stops:St,resample:v.G.inCubic},labels:{values:[0,10,25,50,100,250,500,1e3],formatter:(t,e,i)=>0===e?`${Math.round(t)} %%units%%`:`${Math.round(t)}`}}}),Qt=R("Carbon Monoxide (CO)",{id:"airquality-co",bar:{measurement:Object.assign({},kt),colorscale:{range:h.q_.co.dataRange,stops:Ft,resample:v.G.inOutSqrt},labels:{values:[0,125,250,500,750,1e3],formatter:(t,e,i)=>0===e?`${Math.round(t)} %%units%%`:`${Math.round(t)}`}}}),Kt=R("Nitrogen Monoxide (NO)",{id:"airquality-no",bar:{measurement:Object.assign({},kt),colorscale:{range:h.q_.no.dataRange,stops:It,resample:v.G.inSine},labels:{values:[0,5,10,25,50,100],formatter:(t,e,i)=>0===e?`${Math.round(t)} %%units%%`:`${Math.round(t)}`}}}),Jt=R("Nitrogen Dioxide (NO2)",{id:"airquality-no2",bar:{measurement:Object.assign({},kt),colorscale:{range:h.q_.no2.dataRange,stops:Vt,resample:v.G.inSqrt},labels:{values:[0,10,20,30,50,100],formatter:(t,e,i)=>0===e?`${Math.round(t)} %%units%%`:`${Math.round(t)}`}}}),qt=R("Ozone (03)",{id:"airquality-o3",bar:{measurement:Object.assign({},kt),colorscale:{range:h.q_.o3.dataRange,stops:Wt,resample:v.G.inSqrt},labels:{values:[0,50,100,150,225,300],formatter:(t,e,i)=>0===e?`${Math.round(t)} %%units%%`:`${Math.round(t)}`}}}),$t=R("Sulfur Dioxide (SO2)",{id:"airquality-so2",bar:{measurement:Object.assign({},kt),colorscale:{range:h.q_.so2.dataRange,stops:Ct,resample:v.G.inSqrt},labels:{values:[0,5,10,25,50,100],formatter:(t,e,i)=>0===e?`${Math.round(t)} %%units%%`:`${Math.round(t)}`}}});var te=i(6694);const ee={title:"AQI",fn:t=>`${Math.round(t.value)}`},ie={title:"Air Quality",fn:t=>{var e;const i=null===(e=t.features)||void 0===e?void 0:e[0];if(null==i?void 0:i.periods){const t=i.periods[0];return`${(0,te.C)(i.place.name)}: ${t.aqi||"N/A"}${t.dominant?` (${t.dominant.toUpperCase()})`:""}`}return""}},re={title:"",fn:t=>{const e="ug/m^3";if("number"==typeof t.value)return`${Math.round(t.value)}${e?` ${e}`:""}`}};var se=i(537),ae=i(3606);const ne=["us","europe","japan","australia","new-zealand"],oe=Object.keys(h.BA),le={primary:{filter:["in",["get","class"],["literal",["motorway","motorway_link","motorway_junction","trunk","trunk_link"]]]},secondary:{filter:["in",["get","class"],["literal",["primary","primary_link","secondary","secondary_link","tertiary","tertiary_link"]]]},bridges:{type:"bridge",filter:["all",["==",["get","brunnel"],"bridge"],["in",["get","class"],["literal",["motorway","motorway_link","motorway_junction","trunk","trunk_link","primary","primary_link"]]]]}},he=Object.keys(le),de={green:"#00C500",yellow:"#FFCE00",red:"#FF0000",unknown:"#666"},ce={dry:"#bbb",moist:"#3B960F",wet:"#00E300",slush:"#B643FF",snow:"#0043FF",ice:"#FF00A6",unknown:"#666"},ue={minimal:"#bbb",low:"#FFEB00",moderate:"#FF9C00",high:"#E00200",major:"#9A00B8"};function pe(t){return G(t,{id:"roadweather-risk",points:{values:[{key:"minimal",color:ue.minimal,label:"Minimal"},{key:"low",color:ue.low,label:"Low"},{key:"moderate",color:ue.moderate,label:"Moderate"},{key:"high",color:ue.high,label:"High"},{key:"major",color:ue.major,label:"Major"}]}})}const me=G("Road Summary",{id:"roadweather-summary",points:{values:[{key:"green",color:de.green,label:"Low Risk"},{key:"yellow",color:de.yellow,label:"Moderate Risk"},{key:"red",color:de.red,label:"High Risk"},{key:"unknown",color:de.unknown,label:"Unknown"}]}}),ge=G("Road Surface",{id:"roadweather-surface",points:{values:[{key:"dry",color:ce.dry,label:"Dry"},{key:"moist",color:ce.moist,label:"Moist"},{key:"wet",color:ce.wet,label:"Wet"},{key:"slush",color:ce.slush,label:"Slush"},{key:"snow",color:ce.snow,label:"Snow"},{key:"ice",color:ce.ice,label:"Ice"},{key:"unknown",color:ce.unknown,label:"Unknown"}]}}),fe=R("Road Temperature",{id:"roadweather-temperature",bar:{measurement:{type:"temperature",units:g.Units.temperature.C,converter:w},colorscale:{range:{min:-40,max:71.11},stops:f.temperature,interval:(0,g.FtoCUnit)(10)},labels:{every:t=>20,formatter:(t,e,i)=>0===e?`${Math.round(t)}°%%units%%`:`${Math.round(t)}`}}}),ve=G("Road Temperature - Freeze",{id:"roadweather-temperature-freeze",points:{values:[{color:"#992BFF",label:"Hard Freeze"},{color:"#0046FF",label:"Freeze"},{color:"#73DAFC",label:"Near Freeze"}]}}),ye=G("Road Rollover Risk",Object.assign({id:"roadweather-risk-rollover"},pe("Road Rollover Risk"))),be=G("Road Hydroplane Risk",Object.assign({id:"roadweather-risk-hydroplane"},pe("Road Hydroplane Risk"))),xe=G("Road Snow Visibility Risk",Object.assign({id:"roadweather-risk-snow"},pe("Road Snow Visibility Risk"))),we=G("Road Fog Visibility Risk",Object.assign({id:"roadweather-risk-fog"},pe("Road Fog Visibility Risk")));function _e(t,e){return{type:e,sourceType:c.V.point,timeSeries:{mode:ae.Gp.interval},paint:Object.assign(Object.assign({fill:{color:e=>{const i=h.BA[t].code;if("temperature"===t){const t=f.temperature,r=e[i];let s;for(let e=0;e<t.length;e+=2)r>=t[e]&&r<t[e+2]&&(s=t[e+1]);return s||"#ccc"}if("temperatureFreeze"===t){const t=f.freeze,r=e[i];let s;for(let e=0;e<t.length;e+=2)r>=t[e]&&r<t[e+2]&&(s=t[e+1]);return s||"#ccc"}if(/(rollover|fog|snow|hydroplane)/i.test(t)){const t=e[i];return t>=.8?ue.major:t>=.6?ue.high:t>=.4?ue.moderate:t>=.2?ue.low:ue.minimal}const r=(e[i]||"unknown").toLowerCase();return a[t][r]||"#ccc"}}},e===S.m.circle?{circle:{radius:4},stroke:{color:"#222",thickness:1}}:{}),{symbol:{rotateWithMap:!0,pitchWithMap:!0,scaleWithMap:e===S.m.voronoi}})}}var Me=i(4918);const Ze={general:"#2ED300",hail:"#EBE100",rotating:"#F17200",tornado:"#FF2600"},Ae={avalanche:"#629FEC",blizzard:"#4100E2",fire:"#E66300",flood:"#117D01",fog:"#767676",ice:"#B300E2",hail:"#61DEF7",lightning:"#8C8C8C",rain:"#39E600",snow:"#165CEF",tides:"#40DB83",tornado:"#C50000",wind:"#D8CC03",tropical:"#FF59B3",other:"#999"},Te={general:"#b3e6b1",marginal:"#6cbd69",slight:"#f4f964",enhanced:"#e0b767",moderate:"#e0686a",high:"#fe59ff"},Re={age60:"#eeeeee",age300:"#F8E203",age600:"#F97000",ageOld:"#C4150D",typeIC:"#999"},Ge=(()=>{const t=new Me.A(["#F1DE00","#DE2900"]);return t.setDomain([0,60]),[0,10,20,30,40,50,60].reduce(((e,i)=>{const r=t.getColor(i);return e[`lead${i}`]=`rgba(${r.r}, ${r.g}, ${r.b}, ${r.a})`,e}),{})})(),Se=[0,"rgba(255,235,122,0)",1,"#FFD800",3,"#FF7E00",6,"#ED0000",8,"#E400F0",10,"#EEC5F0"],Ce=(()=>{const t=new Me.A(["#DF0ED3","#520BAE"]);return t.setDomain([0,60]),[0,10,20,30,40,50,60].reduce(((e,i)=>{const r=t.getColor(i);return e[`lead${i}`]=`rgba(${r.r}, ${r.g}, ${r.b}, ${r.a})`,e}),{})})(),Ie=((0,g.inToMM)(.5),(0,g.inToMM)(1),(0,g.inToMM)(1.5),(0,g.inToMM)(2),(0,g.inToMM)(2.5),(0,g.inToMM)(3),[0,"rgba(37,61,156,1)",.2,"#253D9C",.4,"#1D6AA2",.6,"#09BB93",.8,"#FEF112",1,"#FE5412"]);var Ve=i(7922),Fe=i(8464);const We=t=>{let e=t.toLowerCase();return e=e.replace(/thunderstorm/,"t-storm"),e=e.replace(/temperature/,"temp"),e=e.replace(/fog \(marine\)/,"fog"),(0,te.C)(e)},Ee=t=>G("Alerts",{id:"alerts",points:{layerId:`^${u.Qf}alerts(-outline|-short-fuse)?`,values:e=>new Promise(((i,r)=>{const s=[],a=[];if(e.features)e.features.forEach((t=>{const{ADVISORY:e,COLOR:i="#000000"}=t.properties;a.includes(e)||(s.push({color:i.startsWith("#")?i:`#${i}`,label:We(e)}),a.push(e))})),i(s.sort(((t,e)=>t.label.localeCompare(e.label))));else if((0,Ve.I)(e.bounds)){const r=Object.assign({},e.bounds);if(t.canAccess("advisories_summary"),(0,Ve.I)(r))return void console.warn("[MapsGL] Cannot load data for alerts legend, coordinate bounds not provided");const n=Math.abs(r.east-r.west),l=Math.floor(n/360),h=t.api().action(o.Fu.within);e.time&&h.from(e.time),l>0?(r.west=-180,r.east=180):(r.west<-180||r.west>180)&&(r.west+=360*Math.floor(r.west/360)),h.bounds(r),h.get().then((t=>{var e,r;if((null===(e=t.data)||void 0===e?void 0:e.length)>0){const e=null===(r=t.data[0].summary)||void 0===r?void 0:r.types;if(e&&Array.isArray(e))return e.forEach((t=>{let{type:e,color:i="#000000"}=t;a.includes(e)||(s.push({color:i.startsWith("#")?i:`#${i}`,label:We(e)}),a.push(e))})),void i(s)}i([])}))}}))}}),ke=G("Storm Cells",{id:"stormcells",points:{values:[{color:Ze.general,label:"General"},{color:Ze.hail,label:"Hail"},{color:Ze.rotating,label:"Rotating"},{color:Ze.tornado,label:"Tornadic"}]}}),ze=G("Storm Reports",{id:"stormreports",points:{values:[{color:Ae.avalanche,label:"Avalanche"},{color:Ae.blizzard,label:"Blizzard"},{color:Ae.fire,label:"Fire"},{color:Ae.flood,label:"Flood"},{color:Ae.fog,label:"Fog"},{color:Ae.ice,label:"Ice"},{color:Ae.hail,label:"Hail"},{color:Ae.lightning,label:"Lightning"},{color:Ae.rain,label:"Rain"},{color:Ae.snow,label:"Snow"},{color:Ae.tides,label:"Tides"},{color:Ae.tornado,label:"Tornado"},{color:Ae.wind,label:"Wind"},{color:Ae.tropical,label:"Tropical"},{color:Ae.other,label:"Other"}]}}),Ne=G("Lightning Strikes",{id:"lightning-all",points:{values:[{color:Re.age60,label:"< 1 minute"},{color:Re.age300,label:"1-5 minutes"},{color:Re.age600,label:"5-10 minutes"},{color:Re.ageOld,label:"> 10 minutes"},{color:Re.typeIC,label:"Intra-cloud"}]}}),Ye=R("Lightning Threats (lead time)",{id:"lightning-threats",bar:{colorscale:{range:{min:0,max:70},stops:Object.values(Ge).reduce(((t,e,i)=>(t.push(10*i,e),t)),[]),interpolate:!1},labels:{formatter:(t,e,i)=>0===e?`${Math.round(t)} min`:`${Math.round(t)}`}}}),Le=R("Lightning Density",{id:"lightning-density",bar:{measurement:Object.assign({},h.VJ.ic("conus").measurement),colorscale:{range:{min:0,max:10},stops:Se},labels:{every:1,formatter:(t,e,i)=>`${Math.round(t)}`}}}),Oe=R("Hail Threats (lead time)",{id:"hail-threats",bar:{colorscale:{range:{min:0,max:70},stops:Object.values(Ce).reduce(((t,e,i)=>(t.push(10*i,e),t)),[]),interpolate:!1},labels:{formatter:(t,e,i)=>0===e?`${Math.round(t)} min`:`${Math.round(t)}`}}}),je=R("Hail Size",{id:"hail-size",bar:{measurement:Object.assign(Object.assign({},h.R$.size("conus").measurement),{converter:A}),colorscale:Object.assign({range:{min:0,max:(0,g.inToMM)(3)},interval:1},(0,Fe.yw)("Viridis")),labels:{every:t=>"mm"===t?5:.5,formatter:(t,e,i)=>{const r="in"===i.units?t.toFixed(1):Math.round(t);return 0===e?`${r} %%units%%`:`${r}`}}}}),De=R("Severe Hail Probability",{id:"hail-posh",bar:{measurement:Object.assign({},h.R$.posh("conus").measurement),colorscale:Object.assign({range:{min:0,max:100}},(0,Fe.yw)("Viridis")),labels:{every:10,formatter:(t,e,i)=>0===e?`${Math.round(t)}%`:`${Math.round(t)}`}}}),Xe=G("Convective Outlook",{id:"convective",points:{values:[{color:Te.general,label:"General"},{color:Te.marginal,label:"Marginal"},{color:Te.slight,label:"Slight"},{color:Te.enhanced,label:"Enhanced"},{color:Te.moderate,label:"Moderate"},{color:Te.high,label:"High"}]}});var Be=i(5627);const Pe={title:"Alerts",fn:t=>{var e;const i=[];return null===(e=t.features)||void 0===e||e.reduce(((t,e)=>{const r=(0,te.C)(e.ADVISORY.toLowerCase());return t.includes(r)||(t.push(r),i.push({name:r,color:e.COLOR.startsWith("#")?e.COLOR:`#${e.COLOR}`})),t}),[]),0===i.length?"":(i.sort(((t,e)=>t.name.localeCompare(e.name))),`\n <div class="awxgl-tooltip-items">\n ${i.map((t=>`\n <div class="awxgl-tooltip-item">\n <span class="awxgl-tooltip-item-color" style="background-color: ${t.color};"></span>\n <span>${t.name}</span>\n </div>\n `)).join("")}\n </div>\n `)}},He={title:"Storm Cells",fn:t=>{var e,i,r,s;const a=null===(e=t.features)||void 0===e?void 0:e[0];if(null==a?void 0:a.ob){const t=null===(r=null===(i=a.ob)||void 0===i?void 0:i.movement)||void 0===r?void 0:r.dirTo;return`${(0,te.C)(null===(s=a.traits)||void 0===s?void 0:s.type)}${t?`, moving ${t}`:""}`}return""}},Ue={title:"Lightning Threat",fn:t=>{var e;const i=null===(e=t.features)||void 0===e?void 0:e.at(-1);if(!i)return"";const r=i.details.movement,s=i.period,a=[];if(r&&s){const t=(0,C.Yq)(new Date(1e3*s.range.minTimestamp),"format[MMM d, yyyy H:mm a]"),e=r.dirTo,n=(0,p.oh)(i);a.push(t),n>0&&a.push(`+${n} minute lead time`),a.push(`Moving ${e} at ${r.speedKPH} kph (${r.speedMPH} mph)`)}return a.join("<br>")}},Qe={title:"Hail Size",fn:t=>`${Math.round(t.value)} mm, ${Be.units.mmToIn(t.value).toFixed(1)} in`},Ke={title:"Severe Hail Prob",fn:t=>`${Math.round(t.value)}%`},Je={title:"Convective Outlook",fn:t=>{var e,i,r;const s=null===(e=t.features)||void 0===e?void 0:e.at(-1);return(null==s?void 0:s.details)?`${(0,te.C)(null===(r=null===(i=s.details)||void 0===i?void 0:i.risk)||void 0===r?void 0:r.type)}`:""}},qe={title:"Lightning Density",fn:t=>{const e=Math.max(1,Math.round(t.value));return`${e} strike${1===e?"":"s"}/hr`}},$e={drought:{d0:"#ffff00",d1:"#fccc66",d2:"#ff9b00",d3:"#e10000",d4:"#600000"},fire_obs:{contained:"#6C6461",active:"#E88900",new:"#E83A00"},fire_outlook:{elevated:"#FFB268",critical:"#FE666A",extreme:"#FE58FF"},earthquakes:{mini:"#6fb314",minor:"#dfcb01",light:"#ce8f00",moderate:"#ff5d01",strong:"#e90004",major:"#ce0052",great:"#b90285",catastrophic:"#f500ff"},rivers:{out_of_service:"#535353",obs_not_current:"#AFB6AD",not_defined:"#5F9CE6",low_threshold:"#7F5013",no_flooding:"#0EFF00",action:"#FFFF00",minor:"#FE8700",moderate:"#FF0100",major:"#C000FF"},vpd:[0,"rgba(255,217,42,0)",10,"#FFD92A",20,"#FF932A",30,"#E2330B",40,"#9D0000",50,"#D00071",60,"#FF698C",70,"#FFE9FF"]},ti=["case",["==",["get","report.perContained"],100],["literal",$e.fire_obs.contained],["<",["-",["now"],["to-number",["to-date",["get","report.startDateISO"]]]],864e5],["literal",$e.fire_obs.new],["literal",$e.fire_obs.active]],ei=["case",["==",["get","report.perContained"],100],["min",15,["*",["round",["+",5,["*",10,["/",["*",["max",1,["coalesce",["get","report.areaAC"],1]],.75],2e4]]]],.75]],["min",15,["round",["+",5,["*",10,["/",["max",1,["coalesce",["get","report.areaAC"],1]],2e4]]]]]],ii=["case",["has","report"],["let","contained",["coalesce",["get","report.perContained"],0],"level",["max",1,["min",5,["floor",["+",1,["*",4,["/",["-",["var","contained"],50],50]]]]]],["concat","mapsgl:fire-",["to-string",["var","level"]]]],"fire"],ri=["case",["has","report"],["let","area",["max",1,["get","report.areaAC"]],"factor",["max",0,["min",1,["/",["var","area"],2e4]]],"size",["min",40,["round",["+",18,["*",22,["var","factor"]]]]],{width:["var","size"],height:["var","size"]}],{width:20,height:20}],si={title:"Fires",fn:t=>{var e,i,r;const s=null===(e=t.features)||void 0===e?void 0:e[0];if(null==s?void 0:s.report){const t=s.report,e=Math.round(Math.max(1,null!==(r=null===(i=s.perimeter)||void 0===i?void 0:i.areaAC)&&void 0!==r?r:t.areaAC)),a=t.perContained,n=`${t.name}`,o=[];return e&&!1===Number.isNaN(e)&&o.push(`${e.toLocaleString("en-US")} acre${e>1?"s":""}`),a&&o.push(`(${t.perContained}% contained)`),`${n}${o.length>0?` - ${o.join(" ")}`:""}`}return""}},ai=t=>{const e={temperature:R("Temperatures",{id:"temperature",bar:{measurement:Object.assign(Object.assign({},h.X1.measurement),{converter:w}),colorscale:{range:h.X1.dataRange,stops:f.temperature},labels:{every:t=>20,formatter:(t,e,i)=>0===e?`${Math.floor(t)}°%%units%%`:`${Math.floor(t)}`}}}),temperature_change_24hr:R("24-Hour Temp Change",{id:"temperature-change-24hr",bar:{measurement:Object.assign(Object.assign({},h.X1.measurement),{converter:_}),colorscale:{range:{min:(0,g.FtoCUnit)(-50),max:(0,g.FtoCUnit)(50)},stops:f.tempChange24Hour},labels:{every:t=>"C"===t?10:20,formatter:(t,e,i)=>{const r=`${t>0?"+":""}${Math.floor(t)}`;return 0===e?`${r}°%%units%%`:`${r}`}}}}),temperature_change_1hr:R("1-Hour Temp Change",{id:"temperature-change-1hr",bar:{measurement:Object.assign(Object.assign({},h.X1.measurement),{converter:_}),colorscale:{range:{min:(0,g.FtoCUnit)(-40),max:(0,g.FtoCUnit)(40)},stops:f.tempChange1Hour},labels:{every:t=>10,formatter:(t,e,i)=>{const r=`${t>0?"+":""}${Math.floor(t)}`;return 0===e?`${r}°%%units%%`:`${r}`}}}}),dewpoint:R("Dew Point",{id:"dew-point",bar:{measurement:Object.assign(Object.assign({},h.X1.measurement),{converter:w}),colorscale:{range:h.$W.dataRange,stops:f.dewpoint},labels:{every:t=>20,formatter:(t,e,i)=>0===e?`${Math.floor(t)}°%%units%%`:`${Math.floor(t)}`}}}),humidity:R("Humidity",{id:"humidity",bar:{measurement:Object.assign({},h.c1.measurement),colorscale:{range:h.c1.dataRange,stops:f.temperature},labels:{every:20,formatter:(t,e,i)=>0===e?`${Math.floor(t)}%`:`${Math.floor(t)}`}}}),pressure_msl:R("Surface Pressure",{id:"mslp",bar:{measurement:Object.assign(Object.assign({},h.rv.measurement),{converter:Z}),colorscale:{range:h.rv.dataRange,stops:f.mslp},labels:{every:t=>"mb"===t?20:1,formatter:(t,e,i)=>{const r=i.metric?Math.floor(t):t.toFixed(2);return 0===e?`${r} %%units%%`:`${r}`}}}}),heatindex:R("Heat Index",{id:"heat-index",bar:{measurement:Object.assign(Object.assign({},h.X1.measurement),{converter:w}),colorscale:{range:{min:(0,g.FtoC)(80),max:h.X1.dataRange.max},stops:f.temperature},labels:{every:t=>"C"===t?5:10,formatter:(t,e,i)=>0===e?`${Math.floor(t)}°%%units%%`:`${Math.floor(t)}`}}}),windchill:R("Wind Chill",{id:"wind-chill",bar:{measurement:Object.assign(Object.assign({},h.X1.measurement),{converter:w}),colorscale:{range:{min:h.X1.dataRange.min,max:(0,g.FtoC)(40)},stops:f.temperature},labels:{every:t=>"C"===t?10:20,formatter:(t,e,i)=>0===e?`${Math.floor(t)}°%%units%%`:`${Math.floor(t)}`}}}),windspeed:R("Wind Speeds",{id:"windspeed",bar:{measurement:Object.assign(Object.assign({},h.LO.measurement),{converter:M}),colorscale:{range:{min:0,max:h.LO.dataRange.max},stops:f.windspeed},labels:{every:t=>"kmh"===t?20:10,formatter:(t,e,i)=>0===e?`${Math.floor(t)} %%units%%`:`${Math.floor(t)}`}}}),cloud_cover:R("Cloud Cover",{id:"cloud-cover",bar:{colorscale:{range:h.h4.dataRange,stops:f.sky},labels:{every:20,formatter:(t,e,i)=>0===e?`${Math.floor(t)}%`:`${Math.floor(t)}`}}}),visibility:R("Visibility",{id:"visibility",bar:{measurement:Object.assign(Object.assign({},h.XD.measurement),{converter:T}),colorscale:{range:h.XD.dataRange,stops:f.visibility},labels:{every:t=>"km"===t?2:1,formatter:(t,e,i)=>0===e?`${Math.floor(t)} %%units%%`:`${Math.floor(t)}`}}}),radar:{id:"radar",type:"bar",title:"Radar",bar:[(0,m.$)({},b.bar,{colorscale:{range:{min:6,max:h.Jg.dataRange.max},stops:f.radar.rain},labels:{values:[{value:0,label:"Light"},{value:.5,label:"RAIN"},{value:1,label:"Heavy"}],normalized:!0}}),(0,m.$)({},b.bar,{colorscale:{range:{min:6,max:h.Jg.dataRange.max},stops:f.radar.mix},labels:{values:[{value:0,label:"Light"},{value:.5,label:"MIX"},{value:1,label:"Heavy"}],normalized:!0}}),(0,m.$)({},b.bar,{colorscale:{range:{min:6,max:h.Jg.dataRange.max},stops:f.radar.snow},labels:{values:[{value:0,label:"Light"},{value:.5,label:"SNOW"},{value:1,label:"Heavy"}],normalized:!0}})],text:b.text,onBeforeUpdate:t=>{var e;const i=t.bar,r={min:6,max:h.Jg.dataRange.max},s=["RAIN","MIX","SNOW"];return Array.isArray(i)?i.forEach(((t,e)=>{var i;if(t.colorscale&&(t.colorscale.range=r),Array.isArray(null===(i=t.labels)||void 0===i?void 0:i.values)){const i=s[e];t.labels.values.forEach(((t,e)=>{"object"==typeof t&&.5===t.value&&(t.label=i)}))}})):(i.colorscale&&(i.colorscale.range=r),Array.isArray(null===(e=i.labels)||void 0===e?void 0:e.values)&&i.labels.values.forEach(((t,e)=>{"object"==typeof t&&.5===t.value&&(t.label="Moderate")}))),t}},hour_precip:R("1-Hour Precipitation",{id:"1hr-precip",bar:{measurement:{type:"precipitation",units:g.Units.rate.mms,converter:A},colorscale:{range:{min:(0,g.inToMMRate)(.01),max:h.Yh.dataRange.max},resample:v.G.inSine},labels:{values:t=>"in"===t?[.01,.1,.5,1,2,3,4,5]:[1,2,5,10,25,50,75,100,125],formatter:(t,e,i)=>{const r=(0,y.NT)(t,2);return 0===e?`${r} %%units%%`:`${r}`}}}}),accum_precip:R("Accumulated Precipitation",{id:"accum-precip",bar:{measurement:{type:"precipitation",units:g.Units.rate.mms,converter:A},colorscale:{range:{min:(0,g.inToMMRate)(.01),max:(0,g.inToMMRate)(20)}},labels:{values:t=>"in"===t?[.01,.1,.5,1,2,3,4,5,6,7,8,10,12,14,16,18,20,25,30]:[1,2,5,10,20,25,30,40,50,60,75,100,125,150,200,250,300,400,500,600,700],formatter:(t,e,i)=>{const r=(0,y.NT)(t,2);return 0===e?`${r} %%units%%`:`${r}`}}}}),hour_snow:R("1-Hour Snowfall",{id:"hour-snow",bar:{measurement:{type:"snowfall",units:g.Units.precipitation.m,converter:A},colorscale:{range:{min:(0,g.inToM)(.1),max:(0,g.inToM)(12)},stops:f.snowdepth,resample:v.G.inSine},labels:{values:t=>"in"===t?[.1,.5,1,2,4,6,8,10,12]:[.3,1,3,5,10,20,30],formatter:(t,e,i)=>{const r=(0,y.NT)(t,2);return 0===e?`${r} %%units%%`:`${r}`}}}}),accum_snow:R("Accumulated Snowfall",{id:"accum-snow",bar:{measurement:{type:"snowfall",units:g.Units.precipitation.m,converter:A},colorscale:{range:{min:(0,g.inToM)(.1),max:(0,g.inToM)(60)},stops:f.snowdepth,resample:(0,v.A)(.55,.09,1,.75)},labels:{values:t=>"in"===t?[.1,1,3,6,9,12,18,24,36,48,60]:[.5,3,5,10,15,25,50,75,100,150],formatter:(t,e,i)=>{const r=(0,y.NT)(t,2);return 0===e?`${r} %%units%%`:`${r}`}}}}),hour_sleet:R("1-Hour Sleet",{id:"hour-sleet",bar:{measurement:{type:"precipitation",units:g.Units.rate.mms,converter:A},colorscale:{range:{min:(0,g.inToMMRate)(.01),max:h._k.dataRange.max},resample:v.G.inSine},labels:{values:t=>"in"===t?[.01,.1,.5,1,2,3]:[1,2,5,10,25,50,75],formatter:(t,e,i)=>{const r=(0,y.NT)(t,2);return 0===e?`${r} %%units%%`:`${r}`}}}}),accum_sleet:R("Accumulated Sleet",{id:"accum-sleet",bar:{measurement:{type:"precipitation",units:g.Units.rate.mms,converter:A},colorscale:{range:{min:(0,g.inToMMRate)(.01),max:h._k.dataRange.max},resample:v.G.inSine},labels:{values:t=>"in"===t?[.01,.1,.5,1,2,3]:[1,2,5,10,25,50,75],formatter:(t,e,i)=>{const r=(0,y.NT)(t,2);return 0===e?`${r} %%units%%`:`${r}`}}}}),hour_ice:R("1-Hour Ice",{id:"hour-ice",bar:{measurement:{type:"precipitation",units:g.Units.rate.mms,converter:A},colorscale:{range:{min:(0,g.inToMMRate)(.01),max:h._k.dataRange.max},resample:v.G.inSine},labels:{values:t=>"in"===t?[.01,.1,.5,1,2,3]:[1,2,5,10,25,50,75],formatter:(t,e,i)=>{const r=(0,y.NT)(t,2);return 0===e?`${r} %%units%%`:`${r}`}}}}),accum_ice:R("Accumulated Ice",{id:"accum-ice",bar:{measurement:{type:"precipitation",units:g.Units.rate.mms,converter:A},colorscale:{range:{min:(0,g.inToMMRate)(.01),max:h._k.dataRange.max},resample:v.G.inSine},labels:{values:t=>"in"===t?[.01,.1,.5,1,2,3]:[1,2,5,10,25,50,75],formatter:(t,e,i)=>{const r=(0,y.NT)(t,2);return 0===e?`${r} %%units%%`:`${r}`}}}}),snow_depth:R("Snow Depth",{id:"snow-depth",bar:{measurement:{type:"snowfall",units:g.Units.precipitation.m,converter:A},colorscale:{range:{min:(0,g.inToM)(1),max:h.RX.dataRange.max},stops:f.snowdepth,resample:(0,v.A)(.7,0,1,.6)},labels:{values:t=>"in"===t?[1,3,6,12,18,24,36,48,72,96,120,168,216,300]:[3,5,10,25,50,100,200,350,500,700],formatter:(t,e,i)=>{const r=(0,y.NT)(t,2);return 0===e?`${r} %%units%%`:`${r}`}}}}),uvi:R("Ultraviolet Index (UVI)",{id:"uvi",bar:{colorscale:{range:{min:1,max:12},stops:f.uvi,interval:1},labels:{every:1,formatter:(t,e,i)=>`${Math.floor(t)}`}}})};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},{water:{id:"base.water.fill",layer:{type:S.m.fill,source:J.base_osm,sourceType:c.V.polygon,sourceLayer:"water",paint:{fill:{color:"#333"}}}},"admin-2-boundaries":et("base.admin_2_boundaries.line",["all",["==",["get","admin_level"],2],["!=",["get","maritime"],1]],{stroke:{color:"#333",thickness:t=>t.zoom<2?1:2,opacity:.85}}),"admin-3-4-boundaries":et("base.admin_3_4_boundaries.line",["all",[">=",["get","admin_level"],3],["<=",["get","admin_level"],4],["!=",["get","maritime"],1]],{stroke:{color:"#333",opacity:t=>t.zoom<2?.5:.75}}),"admin-5-6-boundaries":et("base.admin_5_6_boundaries.line",["all",[">=",["get","admin_level"],5],["<=",["get","admin_level"],6],["!=",["get","maritime"],1]],{stroke:{color:"#333",opacity:.6}}),"waterway-ocean-boundaries":st("base.waterway_ocean.line",["==","class","ocean"],{stroke:{color:"#333",thickness:t=>t.zoom<2?1:2,opacity:.85}}),"waterway-lake-river-boundaries":st("base.waterway_lake.line",["any",["==",["get","class"],"river"],["==",["get","class"],"lake"]],{stroke:{color:"#333",thickness:1,opacity:.7}}),boundaries:["admin-2-boundaries","admin-3-4-boundaries","admin-5-6-boundaries","waterway-ocean-boundaries","waterway-lake-river-boundaries"],"place-city":rt("base.place_city.text",["in",["get","class"],["literal",["city","town"]]],{text:{size:t=>{const e=t.rank,i=t.zoom;return"city"===t.class?i<4?10:i<6?12:i<8?e<5?16:12:i<11?e<5?20:16:22:i>10?16:12}}}),"place-neighborhood":rt("base.place_neighborhood.text",["in",["get","class"],["literal",["village","neighbourhood","hamlet","suburb"]]],{text:{size:t=>t.zoom<13?11:14}}),"place-state":rt("base.place_state.text",["in",["get","class"],["literal",["state","province"]]],{text:{size:t=>t.zoom<4?10:12,color:"#999",weight:"bold",transform:"uppercase",letterSpacing:.1}}),"place-country":rt("base.place_country.text",["in",["get","class"],["literal",["country","continent"]]],{text:{size:t=>{const e=t.zoom;return e<2?13:e<4?16:20},color:"#666"}}),places:["place-country","place-state","place-city","place-neighborhood"],"waterways-text":{id:"base.waterways.text",layer:{type:S.m.symbol,source:J.base_osm,sourceType:c.V.point,sourceLayer:"water_name",paint:{text:{value:["coalesce",["get","name:en"],["get","name"]],weight:t=>"ocean"===t.class?"bold":"normal",size:t=>{const e=t.zoom;return"ocean"===t.class?e<3?13:20:"sea"===t.class&&e<4?10:12},letterSpacing:t=>"ocean"===t.class?.1:0,color:"#999"},symbol:{rank:{property:"rank",direction:"asc"},pitchWithMap:!1,rotateWithMap:!1,allowOverlap:!1}}}},"road-all":it("admin.road_all.line"),"road-motorway":it("admin.road_motorway.line",["==",["get","class"],"motorway"],{stroke:{thickness:t=>{const e=t.zoom;return e<5?1:e<10?2:e<15?4:10}}}),"road-trunk":it("admin.road_trunk.line",["==",["get","class"],"trunk"],{stroke:{thickness:t=>t.zoom<10?1:2,opacity:t=>{const e=t.zoom;return e<5?0:e<10?.5:1}}}),"road-primary":it("admin.road_primary.line",["==",["get","class"],"primary"],{stroke:{thickness:1,color:t=>t.zoom<10?"#999":"#000",opacity:t=>t.zoom<5?0:1}}),"road-secondary-tertiary":it("admin.road_secondary_tertiary.line",["in",["get","class"],["literal",["secondary","tertiary"]]],{stroke:{thickness:t=>t.zoom<12?1:2,opacity:t=>{const e=t.zoom;return e<8?0:e<12?.5:1}}}),"road-street":it("admin.road_street.line",["in",["get","class"],["literal",["minor","service"]]],{stroke:{thickness:1,opacity:.6}}),roads:["road-motorway","road-trunk","road-primary","road-secondary-tertiary","road-street"],"power-lines":{id:"base.power_lines.line",layer:{type:S.m.line,source:J.base_osm_power,sourceLayer:"power_lines",paint:{stroke:{color:"#B9713E",thickness:2,lineJoin:I.p.Round,lineCap:I.$.Round}}}},"power-plants":{id:"base.power_plants.fill",layer:{type:S.m.fill,source:J.base_osm_power,sourceLayer:"power_plants",paint:{fill:{color:"#895D3E"}}}},"power-generators":function(t,e){return{id:"base.power_generators.fill",layer:{type:S.m.circle,source:J.base_osm_power,sourceLayer:"power_generators",filter:["in",["get","energy_source"],["literal",["gas","oil","wind","solar"]]],paint:{fill:{color:e=>{var i,r;const s=null===(i=e.energy_source)||void 0===i?void 0:i.toLowerCase();return s&&null!==(r=t[s])&&void 0!==r?r:"#333"}},stroke:{color:"#fff",thickness:2},circle:{radius:6}}},legend:e(t)}}(at,nt),"power-generator-boundaries":function(t,e){return{id:"base.power_generator_boundaries.fill",layer:{type:S.m.fill,source:J.base_osm_power,sourceLayer:"power_generator_bounds",filter:["in",["get","energy_source"],["literal",["gas","oil","wind","solar"]]],paint:{fill:{color:e=>{var i,r;const s=null===(i=e.energy_source)||void 0===i?void 0:i.toLowerCase();return s&&null!==(r=t[s])&&void 0!==r?r:"#333"},opacity:.5},stroke:{color:e=>{var i,r;const s=null===(i=e.energy_source)||void 0===i?void 0:i.toLowerCase();return s&&null!==(r=t[s])&&void 0!==r?r:"#333"},thickness:2}}},legend:e(t)}}(at,nt),"power-generator-centroids":function(t,e){return{id:"base.power_generator_centroids.circle",layer:{type:S.m.circle,source:J.base_osm_power,sourceLayer:"power_generator_centroids",filter:["in",["get","energy_source"],["literal",["gas","oil","wind","solar"]]],paint:{fill:{color:e=>{var i,r;const s=null===(i=e.energy_source)||void 0===i?void 0:i.toLowerCase();return s&&null!==(r=t[s])&&void 0!==r?r:"#333"}},stroke:{color:"#fff",thickness:2},circle:{radius:6}}},legend:e(t)}}(at,nt),"cities-points":{id:"base.cities.points",layer:{type:S.m.circle,source:J.base_cities,sourceType:c.V.point,sourceLayer:"cities",paint:{fill:{color:"#000"},circle:{radius:3}}}}}),[{id:"conditions.radar.fill",code:"radar",source:J.radar_REFC_PRATE_PTYPE}].reduce(((t,i)=>{let{id:r,code:s,source:a}=i;return t[s]={id:r,layer:(0,u.Af)(a,{quality:S.E.exact,zoomOffset:0,paint:{sample:{channel:"r",colorscale:{masks:[{channel:"g",value:1,drawRange:{min:10},colorscale:{range:{min:0,max:87},stops:f.radar.rain}},{channel:"g",value:3,colorscale:{range:{min:0,max:87},stops:f.radar.mix}},{channel:"g",value:2,colorscale:{range:{min:0,max:87},stops:f.radar.snow}}]}}}}),legend:e.radar,evaluator:tt.radar},t}),{})),((t,e,i)=>{const r={temperatures:{id:(0,u.RC)("conditions.temperature.fill"),layer:(0,u.Af)(J.conditions_TMP_UGRD_VGRD,{paint:{sample:{channel:"r",colorscale:{stops:f.temperature,breaks:ht}}}}),legend:e.temperature,evaluator:i.temperature},"temperatures-contour":{id:(0,u.RC)("conditions.temperature.contour"),layer:(0,u.Af)(J.conditions_TMP_UGRD_VGRD,{type:S.m.contour,paint:{sample:{channel:"r",smoothing:1,colorscale:{stops:f.temperature,interval:1,breaks:ht}},contour:{interval:(0,g.FtoCUnit)(2),majorInterval:(0,g.FtoCUnit)(10)}}}),legend:e.temperature,evaluator:i.temperature},"temperatures-24hr-change":{id:(0,u.RC)("conditions.temperature_24hr_change.fill"),layer:(0,u.Af)(J.conditions_TMP_DELTA,{measurement:{type:"temperature-change",units:g.Units.temperature.C},paint:{sample:{expression:lt.BG.difference,channel:"rg",offset:.5,colorscale:{range:{min:(0,g.FtoCUnit)(-50),max:(0,g.FtoCUnit)(50)},stops:f.tempChange24Hour}}}}),legend:e.temperature_change_24hr,evaluator:i.temperature_change},"temperatures-1hr-change":{id:(0,u.RC)("conditions.temperature_1hr_change.fill"),layer:(0,u.Af)(J.conditions_TMP_DELTA,{measurement:{type:"temperature-change",units:g.Units.temperature.C},paint:{sample:{expression:lt.BG.difference,channel:"rb",offset:.5,colorscale:{range:{min:(0,g.FtoCUnit)(-40),max:(0,g.FtoCUnit)(40)},stops:f.tempChange1Hour}}}}),legend:e.temperature_change_1hr,evaluator:i.temperature_change},"wind-speeds":{id:(0,u.RC)("conditions.wind_speed.fill"),layer:(0,u.Af)(J.conditions_TMP_UGRD_VGRD,{paint:{sample:{channel:"gb",expression:lt.BG.vector,colorscale:{range:{min:0,max:h.LO.dataRange.max},stops:f.windspeed}}}}),legend:e.windspeed,evaluator:i.winds},"wind-speeds-contour":{id:(0,u.RC)("conditions.wind_speed.contour"),layer:(0,u.Af)(J.conditions_TMP_UGRD_VGRD,{type:S.m.contour,paint:{sample:{channel:"gb",expression:lt.BG.vector,smoothing:1,colorscale:{range:{min:0,max:h.LO.dataRange.max},stops:f.windspeed,interval:(0,g.mphToMsUnit)(5)}},contour:{interval:(0,g.mphToMsUnit)(5),majorInterval:(0,g.mphToMsUnit)(25)}}}),legend:e.windspeed,evaluator:i.winds},"wind-dir":{id:(0,u.RC)("conditions.wind_speed.arrow"),layer:(0,u.Af)(J.conditions_TMP_UGRD_VGRD,{type:S.m.grid,paint:{sample:{channel:"gb",expression:lt.BG.vector,interpolation:lt.uN.bilinear,smoothing:1,colorscale:{range:{min:0,max:h.LO.dataRange.max},stops:f.windspeed}},grid:{spacing:30},icon:{type:"arrow",size:{width:40,height:20},anchor:"left"},symbol:{rotateWithMap:!0,pitchWithMap:!0}}}),legend:e.windspeed,evaluator:i.winds},"wind-barbs":{id:(0,u.RC)("conditions.wind_speed.barb"),layer:(0,u.Af)(J.conditions_TMP_UGRD_VGRD,{type:S.m.grid,paint:{sample:{channel:"gb",expression:lt.BG.vector,interpolation:lt.uN.bilinear,smoothing:1,colorscale:{range:{min:0,max:h.LO.dataRange.max},stops:f.windspeed}},fill:{color:"#fff"},grid:{spacing:30},icon:{atlas:{ids:[0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100].map((t=>`mapsgl:wind-barb-${t}`)),interval:2.572222},size:{width:40,height:40},anchor:"bottom",offset:{x:0,y:5},rotation:-90},symbol:{rotateWithMap:!0,pitchWithMap:!0}}}),legend:e.windspeed,evaluator:i.winds},"wind-particles":{id:(0,u.RC)("conditions.wind_speed.particle"),layer:(0,u.Af)(J.conditions_TMP_UGRD_VGRD,{type:S.m.particle,paint:{sample:{channel:"gb",expression:lt.BG.vector,interpolation:lt.uN.bilinear,smoothing:1,colorscale:{range:{min:0,max:h.LO.dataRange.max},stops:f.windspeed}},particle:{density:ot.j.normal,size:2},symbol:{sizeAttenuation:!0,rotateWithMap:!0,pitchWithMap:!0}}}),legend:e.windspeed,evaluator:i.winds},"wind-gusts":{id:(0,u.RC)("conditions.wind_gust.fill"),layer:(0,u.Af)(J.conditions_PRMSL_VIS_GUST,{paint:{sample:{channel:"b",colorscale:{range:{min:0,max:h.LO.dataRange.max},stops:f.windspeed}}}}),legend:e.windspeed,evaluator:i.wind_gusts},"feels-like":{id:(0,u.RC)("conditions.feels_like.fill"),layer:(0,u.Af)(J.conditions_APTMP_DPT_RH,{paint:{sample:{channel:"r",colorscale:{stops:f.temperature,breaks:ht}}}}),legend:e.temperature,evaluator:Object.assign(Object.assign({},i.temperature),{title:"Feels Like"})},"wind-chill":{id:(0,u.RC)("conditions.wind_chill.fill"),layer:(0,u.Af)(J.conditions_APTMP_DPT_RH,{paint:{sample:{channel:"r",drawRange:{max:(0,g.FtoC)(40)},colorscale:{stops:f.temperature,breaks:ht}}}}),legend:e.windchill,evaluator:Object.assign(Object.assign({},i.temperature),{title:"Wind Chill"})},"heat-index":{id:(0,u.RC)("conditions.heat_index.fill"),layer:(0,u.Af)(J.conditions_APTMP_DPT_RH,{paint:{sample:{channel:"r",drawRange:{min:(0,g.FtoC)(80)},colorscale:{stops:f.temperature,breaks:ht}}}}),legend:e.heatindex,evaluator:Object.assign(Object.assign({},i.temperature),{title:"Heat Index"})},"dew-points":{id:(0,u.RC)("conditions.dew_point.fill"),layer:(0,u.Af)(J.conditions_APTMP_DPT_RH,{paint:{sample:{channel:"g",colorscale:{stops:f.dewpoint,breaks:ht}}}}),legend:e.dewpoint,evaluator:Object.assign(Object.assign({},i.temperature),{title:"Dew Point"})},humidity:{id:(0,u.RC)("conditions.humidity.fill"),layer:(0,u.Af)(J.conditions_APTMP_DPT_RH,{paint:{sample:{channel:"b",colorscale:{stops:f.humidity}}}}),legend:e.humidity,evaluator:i.humidity},"pressure-msl":{id:(0,u.RC)("conditions.pressure_msl.fill"),layer:(0,u.Af)(J.conditions_PRMSL_VIS_GUST,{quality:S.E.low,paint:{sample:{channel:"r",colorscale:{stops:f.mslp}}}}),legend:e.pressure_msl,evaluator:i.pressure_msl},"pressure-msl-contour":{id:(0,u.RC)("conditions.pressure_msl.contour"),layer:(0,u.Af)(J.conditions_PRMSL_VIS_GUST,{type:S.m.contour,quality:S.E.low,paint:{sample:{channel:"r",smoothing:.5,colorscale:{stops:f.mslp,interval:1}},contour:{interval:1,majorInterval:10}}}),legend:e.pressure_msl,evaluator:i.pressure_msl},"cloud-cover":{id:(0,u.RC)("conditions.cloud_cover.fill"),layer:(0,u.Af)(J.conditions_SKY_PRECIP_UVI,{paint:{sample:{channel:"r",colorscale:{stops:f.sky}}}}),legend:e.cloud_cover},precip:{id:(0,u.RC)("conditions.precip.fill"),layer:(0,u.Af)(J.conditions_PRECIP,{quality:S.E.high,paint:{sample:{channel:"rgb",colorscale:{range:{min:0,max:g.inToMMRate(5)},stops:f.precip_accum},drawRange:{min:g.inToMMRate(.01)}}}}),legend:e.hour_precip,evaluator:Object.assign(Object.assign({},i.accum_precip),{title:"1-Hour Precip"})},"precip-rate":{id:(0,u.RC)("conditions.precip_rate.fill"),layer:(0,u.Af)(J.conditions_SKY_PRECIP_UVI,{paint:{sample:{channel:"g",colorscale:{range:{min:0,max:g.inToMMRate(25)},stops:f.prate}}}}),legend:e.radar,evaluator:Object.assign(Object.assign({},i.radar),{title:"Precip Rate"})},snow:{id:(0,u.RC)("conditions.snow.fill"),layer:(0,u.Af)(J.conditions_SNOW_DERIVED,{quality:S.E.high,paint:{sample:{channel:"rgb",colorscale:{stops:f.snowdepth},dataRange:{min:0,max:g.inToM(12)},drawRange:{min:g.inToM(.1)}}}}),legend:e.hour_snow,evaluator:{title:"1-Hour Snowfall",fn:t=>`${(100*t.value).toFixed(1)} cm, ${g.mToIn(t.value).toFixed(1)} in`}},sleet:{id:(0,u.RC)("conditions.sleet.fill"),layer:(0,u.Af)(J.conditions_SLEET_DERIVED,{quality:S.E.high,paint:{sample:{channel:"rgb",colorscale:{range:{min:0,max:g.inToMMRate(3)},stops:f.sleet_accum},drawRange:{min:g.inToMMRate(.01)}}}}),legend:e.hour_sleet,evaluator:{title:"1-Hour Sleet",fn:t=>{const e=3600*t.value;return`${(e/10).toFixed(1)} cm, ${g.mmToIn(e).toFixed(2)} in`}}},ice:{id:(0,u.RC)("conditions.ice.fill"),layer:(0,u.Af)(J.conditions_ICE_DERIVED,{quality:S.E.high,paint:{sample:{channel:"rgb",colorscale:{range:{min:0,max:g.inToMMRate(3)},stops:f.ice_accum},drawRange:{min:g.inToMMRate(.01)}}}}),legend:e.hour_ice,evaluator:Object.assign(Object.assign({},i.accum_precip),{title:"1-Hour Ice"})},"snow-depth":{id:(0,u.RC)("conditions.snow_depth.fill"),layer:(0,u.Af)(J.conditions_SNOD,{quality:S.E.high,paint:{sample:{channel:"r",colorscale:{stops:f.snowdepth},drawRange:{min:g.inToM(.1)}}}}),legend:e.snow_depth,evaluator:{title:"Snow Depth",fn:t=>`${t.value.toFixed(1)} m, ${g.mToIn(t.value).toFixed(1)} in`}},weather:{id:(0,u.RC)("conditions.weather.fill"),layer:(0,u.Af)(J.conditions_PTYPE_PRECIP_TMP,{quality:S.E.exact,timeSeries:{intervals:200},paint:{sample:{channel:"r",interpolation:lt.uN.none,colorscale:{range:{min:0,max:255},stops:[0,"#000",dt(1),"#00A91E",dt(2),"#C50000",dt(3),"#F45F61",dt(4),"#DB73E6",dt(5),"#D0ECF4",dt(6),"#757AF4",dt(7),"#B175F4",dt(8),"#e6738e",dt(9),"#40e0d0",dt(10),"#ff00ff",dt(11),"#8BF291",dt(12),"#F4A8A9",1,"#ffffff"],normalized:!0},drawRange:{min:1,max:255},meld:!1}}}),legend:G("Weather Type",{id:(0,u.RC)("weather-type"),points:{values:[{color:"#8BF291",label:"Drizzle"},{color:"#00A91E",label:"Rain"},{color:"#C50000",label:"Thunderstorms"},{color:"#F4A8A9",label:"Freezing Drizzle"},{color:"#F45F61",label:"Freezing Rain"},{color:"#DB73E6",label:"Mixed Ice"},{color:"#e6738e",label:"Sleet"},{color:"#D0ECF4",label:"Snow"},{color:"#757AF4",label:"Wet Snow"},{color:"#B175F4",label:"Rain/Snow Mix"},{color:"#40e0d0",label:"Graupel"},{color:"#ff00ff",label:"Hail"}]}})},visibility:{id:(0,u.RC)("conditions.visibility.fill"),layer:(0,u.Af)(J.conditions_PRMSL_VIS_GUST,{paint:{sample:{channel:"g",colorscale:{stops:f.visibility}}}}),legend:e.visibility,evaluator:i.visibility},uvi:{id:(0,u.RC)("conditions.uvi.fill"),layer:(0,u.Af)(J.conditions_SKY_PRECIP_UVI,{quality:S.E.low,paint:{sample:{channel:"b",smoothing:1,colorscale:{stops:f.uvi,interval:1}}}}),legend:e.uvi,evaluator:{title:"UV Index",fn:t=>`${Math.round(t.value)}`}}};return r["wind-particles-arrow"]=(0,m.$)({},r["wind-particles"],{id:(0,u.RC)("conditions.wind_speed.particle_arrow"),layer:{paint:{particle:{type:"arrow",density:ot.j.low,size:{width:20,height:10},speed:2,trails:!1}}}}),r["precip-accum"]=(0,m.$)({},r.precip,{id:(0,u.RC)("conditions.precip_accum.fill"),operation:{type:"sum",remappedDataRange:{min:0,max:g.inToMMRate(20)}},layer:{paint:{sample:{colorscale:{range:{min:0,max:g.inToMMRate(20)}},dataRange:{min:0,max:g.inToMMRate(20)}}}},legend:e.accum_precip,evaluator:Object.assign(Object.assign({},i.accum_precip),{title:"Accumulated Precip"})}),r["snow-accum"]=(0,m.$)({},r.snow,{id:(0,u.RC)("conditions.snow_accum.fill"),operation:{type:"sum",remappedDataRange:{min:0,max:g.inToM(60)}},layer:{paint:{sample:{colorscale:{range:{min:0,max:g.inToM(60)}},dataRange:{min:0,max:g.inToM(60)}}}},legend:e.accum_snow,evaluator:Object.assign(Object.assign({},i.accum_snow),{title:"Accumulated Snowfall"})}),r["sleet-accum"]=(0,m.$)({},r.sleet,{id:(0,u.RC)("conditions.sleet_accum.fill"),operation:{type:"sum"},legend:e.accum_sleet,evaluator:Object.assign(Object.assign({},i.accum_precip),{title:"Accumulated Sleet"})}),r["ice-accum"]=(0,m.$)({},r.ice,{id:(0,u.RC)("conditions.ice_accum.fill"),operation:{type:"sum"},layer:{},legend:e.accum_ice,evaluator:Object.assign(Object.assign({},i.accum_precip),{title:"Accumulated Ice"})}),r["temperatures-max"]=Object.assign(Object.assign({},r.temperatures),{id:(0,u.RC)("conditions.temperature_max.fill"),operation:{type:"max"}}),r["temperatures-min"]=Object.assign(Object.assign({},r.temperatures),{id:(0,u.RC)("conditions.temperature_min.fill"),operation:{type:"min"}}),r["wind-speeds-max"]=Object.assign(Object.assign({},r["wind-speeds"]),{id:(0,u.RC)("conditions.wind_speed_max.fill"),operation:{type:"max"}}),r["wind-gusts-max"]=Object.assign(Object.assign({},r["wind-gusts"]),{id:(0,u.RC)("conditions.wind_gust_max.fill"),operation:{type:"max"}}),Object.keys(r).forEach((t=>{const e=r[t];e.layer.type===S.m.sample&&(r[`${t}-text`]={id:e.id.replace(/\.\w+$/,".text"),layer:(0,u.Z)(J.base_cities),query:{layerId:t,hidden:!0}})})),r})(0,e,tt)),((t,e,i)=>Object.assign(Object.assign({sst:{id:(0,u.RC)("maritime.sst.fill"),layer:(0,u.Af)(J.maritime_WTMP_UOGRD_VOGRD,{paint:{sample:{channel:"r",colorscale:{stops:f.temperature}}}}),mask:ct,legend:e.temperature,evaluator:i.temperature},"ocean-currents":{id:(0,u.RC)("maritime.ocean_current.fill"),layer:(0,u.Af)(J.maritime_WTMP_UOGRD_VOGRD,{paint:{sample:{channel:"gb",expression:lt.BG.vector,colorscale:{range:{min:0,max:h.xj.current.dataRange.max},stops:pt.current}}}}),mask:ct,legend:mt.current,evaluator:Object.assign(Object.assign({},i.winds),{title:"Ocean Current"})},"ocean-currents-particles":{id:(0,u.RC)("maritime.ocean_current.particle"),layer:(0,u.Af)(J.maritime_WTMP_UOGRD_VOGRD,{type:S.m.particle,paint:{sample:{channel:"gb",expression:lt.BG.vector,interpolation:lt.uN.bilinear,colorscale:{range:{min:0,max:h.xj.current.dataRange.max},stops:pt.current}},particle:{density:ot.j.normal,size:2,speed:10}}}),mask:ct,legend:mt.current,evaluator:Object.assign(Object.assign({},i.winds),{title:"Ocean Current"})}},[{prefix:"wave",dataset:J.maritime_WAVE,title:"Wave"},{prefix:"swell",dataset:J.maritime_SWELL1,title:"Swell"},{prefix:"swell2",dataset:J.maritime_SWELL2,title:"Swell 2"},{prefix:"swell3",dataset:J.maritime_SWELL3,title:"Swell 3"}].reduce(((t,e)=>{let{prefix:r,dataset:s,title:a}=e;return t[`${r}-heights`]={id:(0,u.RC)(`maritime.${r}_height.fill`),layer:(0,u.Af)(s,{paint:{sample:{channel:"r",colorscale:{stops:pt.wave_height}}}}),mask:ct,legend:mt.wave_height,evaluator:Object.assign(Object.assign({},i.wave_height),{title:`${a} Height`})},t[`${r}-periods`]={id:(0,u.RC)(`maritime.${r}_period.fill`),layer:(0,u.Af)(s,{paint:{sample:{channel:"g",colorscale:{stops:pt.period,interval:1}}}}),mask:ct,legend:mt.period,evaluator:Object.assign(Object.assign({},i.period),{title:`${a} Period`})},t[`${r}-dir`]={id:(0,u.RC)(`maritime.${r}_dir.fill`),layer:(0,u.Af)(s,{type:S.m.grid,paint:{sample:{channel:"b",expression:lt.BG.angle,interpolation:lt.uN.bilinear,colorscale:{range:{min:0,max:359},stops:[0,"#ffffff",1,"#ffffff"],normalized:!0}},grid:{spacing:30},icon:{type:"arrow",size:{width:40,height:20},anchor:"left"}}}),mask:ct,evaluator:Object.assign(Object.assign({},i.angle_reversed),{title:`${a} Direction`})},t[`${r}-particles`]={id:(0,u.RC)(`maritime.${r}_dir.particle`),layer:(0,u.Af)(s,{type:S.m.particle,paint:{sample:{channel:"b",expression:lt.BG.angle,interpolation:lt.uN.bilinear,colorscale:{range:{min:0,max:359},stops:[0,"#ffffff",1,"#ffffff"],normalized:!0}},particle:{type:"bar",size:{width:8,height:1},speed:3,trails:!0,trailsFade:.94}}}),mask:ct,evaluator:Object.assign(Object.assign({},i.angle_reversed),{title:`${a} Direction`})},t}),{})),{"storm-surge":{id:(0,u.RC)("maritime.storm_surge.fill"),layer:(0,u.Af)(J.maritime_SURGE_TIDE,{paint:{sample:{channel:"r",colorscale:{stops:pt.surge}}}}),mask:ct,legend:mt.surge,evaluator:Object.assign(Object.assign({},i.wave_height),{title:"Storm Surge"})},"tide-heights":{id:(0,u.RC)("maritime.tide_height.fill"),layer:(0,u.Af)(J.maritime_SURGE_TIDE,{paint:{sample:{channel:"g",colorscale:{stops:pt.height_diff}}}}),mask:ct,legend:mt.tide_height,evaluator:Object.assign(Object.assign({},i.height_change),{title:"Tide Height"})}}))(0,e,tt)),Object.assign(Object.assign({"air-quality":{id:(0,u.RC)("air_quality.point"),layer:{type:S.m.circle,source:J.airquality_points,sourceType:c.V.point,paint:{fill:{color:t=>{var e,i;if((0,gt.g)(null==t?void 0:t.periods)||0===(null===(e=null==t?void 0:t.periods)||void 0===e?void 0:e.length))return;const r=null===(i=t.periods[0].category)||void 0===i?void 0:i.replace(/[\s-]/,"_").toLowerCase();return ft[r]||"#000000"}},stroke:{color:"#fff",thickness:3},circle:{radius:8}}},legend:zt,evaluator:ie},"air-quality-index":{id:(0,u.RC)("air_quality.index.fill"),layer:(0,u.Af)(J.airquality_AQI_PM2P5_PM10,{paint:{sample:{channel:"r",colorscale:{stops:yt}}}}),legend:Nt,evaluator:Object.assign(Object.assign({},ee),{title:"AQI"})},"air-quality-index-text":{id:(0,u.RC)("air_quality.index.text"),layer:(0,u.Z)(J.base_cities),query:{layerId:"air-quality-index",hidden:!0}},"air-quality-index-categories":{id:(0,u.RC)("air_quality.index_categories.fill"),layer:(0,u.Af)(J.airquality_AQI_PM2P5_PM10,{paint:{sample:{channel:"r",colorscale:{stops:bt,interpolate:!1}}}}),legend:zt,evaluator:Object.assign(Object.assign({},ee),{title:"AQI"})},"air-quality-health-index-categories":{id:(0,u.RC)("air_quality.aqhi.fill"),layer:(0,u.Af)(J.airquality_AQI_HI_China_India,{paint:{sample:{channel:"r",colorscale:{stops:xt,interpolate:!1}}}}),legend:Yt,evaluator:Object.assign(Object.assign({},ee),{title:"Health Index"})}},[{source:J.airquality_AQI_HI_China_India,items:["china","india"],channels:["g","b"]},{source:J.airquality_AQI_EAQI_UBA_UK,items:["eaqi","uba_daqi","uk_daqi"],channels:["r","g","b"]},{source:J.airquality_AQI_CAI_CAQI,items:["cai","caqi"],channels:["r","g"]}].reduce(((t,e)=>{let{source:i,items:a,channels:n}=e;return a.forEach(((e,a)=>{const o=e.replace(/_/,"-"),l=(0,se.HB)(e);t[`air-quality-index-${o}-categories`]={id:(0,u.RC)(`air_quality.${e}.fill`),layer:(0,u.Af)(i,{paint:{sample:{channel:n[a],colorscale:{stops:r[e],interpolate:!1}}}}),legend:s[l],evaluator:Object.assign(Object.assign({},ee),{title:"AQI"})},t[`air-quality-index-${o}-text`]={id:(0,u.RC)(`air_quality.${e}.text`),layer:(0,u.Z)(J.base_cities),query:{layerId:`air-quality-index-${o}-categories`,hidden:!0}}})),t}),{})),[{source:J.airquality_AQI_PM2P5_PM10,items:["pm2p5","pm10"],channels:["g","b"]},{source:J.airquality_CO_NO_NO2,items:["co","no","no2"],channels:["r","g","b"]},{source:J.airquality_O3_SO2,items:["o3","so2"],channels:["r","g"]}].reduce(((t,e)=>{let{source:i,items:a,channels:n}=e;return a.forEach(((e,a)=>{t[`air-quality-${e}`]={id:(0,u.RC)(`air_quality.${e}.fill`),layer:(0,u.Af)(i,{paint:{sample:{channel:n[a],colorscale:{stops:r[e]}}}}),legend:s[e],evaluator:Object.assign(Object.assign({},re),{title:e.toUpperCase()})},t[`air-quality-${e}-text`]={id:(0,u.RC)(`air_quality.${e}.text`),layer:(0,u.Z)(J.base_cities),query:{layerId:`air-quality-${e}`,hidden:!0}}})),t}),{}))),[{sourceType:"nowcast",prefix:""},{sourceType:"forecast",prefix:"f"}].reduce(((t,e)=>{let{sourceType:i,prefix:r}=e;return ne.forEach((e=>{let s;switch(e){case"us":s="forecast"===i?J.roadweather_forecast_us:J.roadweather_nowcast_us;break;case"europe":s="forecast"===i?J.roadweather_forecast_europe:J.roadweather_nowcast_europe;break;case"japan":s="forecast"===i?J.roadweather_forecast_japan:J.roadweather_nowcast_japan;break;case"australia":s="forecast"===i?J.roadweather_forecast_australia:J.roadweather_nowcast_australia;break;case"new-zealand":s="forecast"===i?J.roadweather_forecast_new_zealand:J.roadweather_nowcast_new_zealand}oe.forEach((a=>{const o=a.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),l=`${r}road-weather-${o}-${e}`;he.forEach((r=>{const{type:h=r,filter:d}=le[r];t[`${l}-${r}-points`]={id:(0,u.RC)(`road_weather.${o}.${e}.${r}.point`),layer:Object.assign(Object.assign({},_e(a,S.m.circle)),{source:s,sourceLayer:`road-wx-${i}`,filter:["==",["get","roadType_0-SFC"],h]}),legend:n[`${a}`]},t[`${l}-${r}`]={id:(0,u.RC)(`road_weather.${o}.${e}.${r}.fill`),layer:Object.assign(Object.assign({},_e(a,S.m.voronoi)),{source:s,sourceLayer:`road-wx-${i}`,filter:["==",["get","roadType_0-SFC"],h]}),mask:{layers:[{id:"road-all",overrides:{filter:d,paint:{stroke:"bridges"===r?{color:"#fff",thickness:6,lineJoin:"round",lineCap:"square"}:{color:"#fff",thickness:"secondary"===h?2:4}}}}]},legend:n[`${a}`]}})),t[`${l}-points`]={id:(0,u.RC)(`road_weather.${o}.${e}.point`),layer:Object.assign(Object.assign({},_e(a,S.m.circle)),{source:s,sourceLayer:`road-wx-${i}`}),legend:n[`${a}`]},t[l]=he.map((t=>`${l}-${t}`))}))})),t}),{})),((t,e,i)=>{const r=Object.assign(Object.assign({alerts:{id:(0,u.RC)("severe.alerts.fill"),layer:{type:S.m.fill,source:J.severe_alerts,timeSeries:{mode:ae.Gp.interval},paint:{fill:{color:["get","COLOR"]},stroke:{color:"#000"}}},legend:Ee(t),evaluator:Pe},"alerts-outline":{id:(0,u.RC)("severe.alerts.line"),layer:{type:S.m.line,source:J.severe_alerts,timeSeries:{mode:ae.Gp.interval},paint:{stroke:{color:["get","COLOR"],thickness:3,lineJoin:I.p.Round,lineCap:I.$.Round}}},legend:Ee(t),evaluator:Pe},"stormcells-positions":{id:(0,u.RC)("severe.stormcells.position.circle"),layer:{type:S.m.circle,source:J.severe_stormcells,sourceType:c.V.point,timeSeries:{mode:ae.Gp.interval},paint:{fill:{color:function(t){return["match",["downcase",["get","traits.type"]],"general",t.general,"hail",t.hail,"rotating",t.rotating,"tornado",t.tornado,"#000000"]}(Ze)},stroke:{color:"#fff",thickness:3},circle:{radius:7}}},legend:ke,evaluator:He},"stormcells-tracks":{id:(0,u.RC)("severe.stormcells.track.line"),layer:{type:S.m.line,source:J.severe_stormcells,sourceType:c.V.line,timeSeries:{mode:ae.Gp.any},paint:{stroke:{color:"#fff",thickness:3,lineCap:I.$.Round}}},evaluator:He},"stormcells-cones":{id:(0,u.RC)("severe.stormcells.cone.line"),layer:{type:S.m.fill,source:J.severe_stormcells,timeSeries:{mode:ae.Gp.interval},paint:{fill:{color:function(t){return["match",["downcase",["get","traits.type"]],"general",t.general,"hail",t.hail,"rotating",t.rotating,"tornado",t.tornado,"#000000"]}(Ze),opacity:.5}}},legend:ke,evaluator:He},stormcells:["stormcells-cones","stormcells-tracks","stormcells-positions"],"stormcells-heat":{id:(0,u.RC)("severe.stormcells.heat"),layer:{type:S.m.heatmap,source:J.severe_stormcells,sourceType:c.V.point,timeSeries:{mode:ae.Gp.interval},paint:{heatmap:{radius:20,color:f.heatmap}}}},stormreports:{id:(0,u.RC)("severe.stormreports.circle"),layer:{type:S.m.circle,source:J.severe_stormreports,sourceType:c.V.point,timeSeries:{mode:ae.Gp.interval},paint:{fill:{color:function(t){return["match",["downcase",["get","report.cat"]],"avalanche",t.avalanche,"blizzard",t.blizzard,"fire",t.fire,"flood",t.flood,"fog",t.fog,"ice",t.ice,"hail",t.hail,"lightning",t.lightning,"rain",t.rain,"snow",t.snow,"tides",t.tides,"tornado",t.tornado,"wind",t.wind,"tropical",t.tropical,"other",t.other,"#000000"]}(Ae)},stroke:{color:"#fff",thickness:3},circle:{radius:8}}},legend:ze,evaluator:{title:"Storm Reports",fn:t=>{var e;const i=null===(e=t.features)||void 0===e?void 0:e[0];return(null==i?void 0:i.report)?`${(0,te.C)(i.report.type)}`:""}}},"stormreports-heat":{id:(0,u.RC)("severe.stormreports.heat"),layer:{type:S.m.heatmap,source:J.severe_stormreports,sourceType:c.V.point,timeSeries:{mode:ae.Gp.interval},paint:{heatmap:{radius:20,color:f.heatmap}}}},"lightning-strikes":{id:(0,u.RC)("severe.lightning.circle"),layer:{type:S.m.circle,source:J.severe_lightning,sourceType:c.V.point,timeSeries:{mode:ae.Gp.interval},paint:{fill:{color:function(t){return["step",["get","age"],t.age60,60,t.age300,300,t.age600,600,t.ageOld]}(Re)},stroke:{color:"#333",thickness:2},circle:{radius:6}}},legend:Ne},"lightning-flash":{id:(0,u.RC)("severe.lightning_flash.circle"),layer:{type:S.m.circle,source:J.severe_lightning_flash,sourceType:c.V.point,timeSeries:{mode:ae.Gp.interval},paint:{fill:{color:Re.typeIC},stroke:{color:"#333",thickness:2},circle:{radius:4}}}},"lightning-all":["lightning-flash","lightning-strikes"],"lightning-threats-polygons":{id:(0,u.RC)("severe.lightning.threats.fill"),layer:{type:S.m.fill,source:J.severe_lightning_threats,timeSeries:{mode:ae.Gp.interval},paint:{fill:{color:function(t){return["step",["floor",["/",["-",["get","period.range.minTimestamp"],["get","details.issuedTimestamp"]],60]],t.lead0,10,t.lead10,20,t.lead20,30,t.lead30,40,t.lead40,50,t.lead50,60,t.lead60]}(Ge),sort:{property:"period.range.minTimestamp",direction:"desc"}}}},legend:Ye,evaluator:Ue},"lightning-threats-tracks":{id:(0,u.RC)("severe.lightning.threats.line"),layer:{type:S.m.line,source:J.severe_lightning_threats,timeSeries:{mode:ae.Gp.interval},filter:["all",["==","featureType","forecastPath"],["==",["get","reliability",["get","movement",["get","details"]]],"HIGH"],[">",["get","totalPeriods",["get","details"]],1]],paint:{stroke:{color:"#DE2900"}}}},"lightning-threats-points":{id:(0,u.RC)("severe.lightning.threats.circle"),layer:{type:S.m.circle,source:J.severe_lightning_threats,timeSeries:{mode:ae.Gp.interval},paint:{fill:{color:"#DE2900"},stroke:{color:"#fff",thickness:2},circle:{radius:4}}},evaluator:Ue},"lightning-threats":["lightning-threats-polygons","lightning-threats-tracks","lightning-threats-points"],"lightning-strikes-heat":{id:(0,u.RC)("severe.lightning.heat"),layer:{type:S.m.heatmap,source:J.severe_lightning,sourceType:c.V.point,timeSeries:{mode:ae.Gp.any},paint:{heatmap:{radius:20,color:f.heatmap}}}},convective:{id:(0,u.RC)("severe.convective.fill"),layer:{type:S.m.fill,source:J.severe_convective,paint:{fill:{color:t=>{var e;const i=null===(e=t.details.risk.type)||void 0===e?void 0:e.toLowerCase();return Te[i]||"#000000"},opacity:.9}}},legend:Xe,evaluator:Je},"convective-outline":{id:(0,u.RC)("severe.convective.line"),layer:{type:S.m.line,source:J.severe_convective,paint:{stroke:{color:t=>{var e;const i=null===(e=t.details.risk.type)||void 0===e?void 0:e.toLowerCase();return Te[i]||"#000000"},thickness:3}}},legend:Xe,evaluator:Je},"hail-threats-polygons":{id:(0,u.RC)("severe.hail.threats.fill"),layer:{type:S.m.fill,source:J.severe_hail_threats,timeSeries:{mode:ae.Gp.interval},paint:{fill:{color:t=>{const{details:e,period:i}=t;if(!e||!i)return"#000000";const r=(0,p.oh)(t),s=Math.max(0,10*Math.floor(r/10));return Ce[`lead${s}`]||"#000000"},sort:{property:"period.range.minTimestamp",direction:"desc"}}}},legend:Oe,evaluator:Object.assign(Object.assign({},Ue),{title:"Hail Threat"})},"hail-threats-tracks":{id:(0,u.RC)("severe.hail.threats.line"),layer:{type:S.m.line,source:J.severe_hail_threats,timeSeries:{mode:ae.Gp.interval},filter:["==",["get","featureType"],"forecastPath"],paint:{stroke:{color:"#520BAE"}}}},"hail-threats-points":{id:(0,u.RC)("severe.hail.threats.circle"),layer:{type:S.m.circle,source:J.severe_hail_threats,timeSeries:{mode:ae.Gp.interval},paint:{fill:{color:"#520BAE",opacity:.5},stroke:{color:"#fff",thickness:2},circle:{radius:4}}}},"hail-threats":["hail-threats-polygons","hail-threats-tracks","hail-threats-points"]},p.ot.reduce(((t,e)=>{const i=K(J.severe_hail_MESH_POSH,e);return t[`hail-size-${e}`]={id:(0,u.RC)(`severe.hail.size.${e}`),layer:(0,u.Af)(i,{quality:S.E.exact,paint:{sample:{channel:"r",colorscale:{range:{min:0,max:(0,g.inToMM)(3)},stops:[0,"rgba(132,0,170,0)",1,"#372497",(0,g.inToMM)(.5),"#1D6AA2",(0,g.inToMM)(.999),"#089E9A",(0,g.inToMM)(1),"#09BB93",(0,g.inToMM)(2),"#FEF112",(0,g.inToMM)(3),"#FE5412"],interval:1},drawRange:{min:1}}}}),legend:je,evaluator:Qe},t[`hail-severe-probability-${e}`]={id:(0,u.RC)(`severe.hail.posh.${e}`),layer:(0,u.Af)(i,{quality:S.E.exact,paint:{sample:{channel:"g",colorscale:{range:{min:0,max:100},stops:Ie,normalized:!0},drawRange:{min:10}}}}),legend:De,evaluator:Ke},t[`hail-size-max-${e}`]=Object.assign(Object.assign({},t[`hail-size-${e}`]),{id:(0,u.RC)(`severe.hail.size_max.${e}`),operation:{type:"max"}}),t[`hail-severe-probability-max-${e}`]=Object.assign(Object.assign({},t[`hail-severe-probability-${e}`]),{id:(0,u.RC)(`severe.hail.posh_max.${e}`),operation:{type:"max"}}),t}),{})),p.Q0.reduce(((t,e)=>{const i=K(J.severe_lightning_LGTIC_LGTCG,e);return t[`lightning-density-${e}`]={id:(0,u.RC)(`severe.lightning.density.${e}.all`),layer:(0,u.Af)(i,{quality:S.E.exact,paint:{sample:{channel:"b",colorscale:{range:{min:0,max:10},stops:Se},drawRange:{min:.1}}}}),legend:Le,evaluator:Object.assign(Object.assign({},qe),{title:"Lightning Density"})},t[`lightning-density-cloud-to-ground-${e}`]={id:(0,u.RC)(`severe.lightning.density.${e}.cg`),layer:(0,u.Af)(i,{quality:S.E.exact,paint:{sample:{channel:"r",colorscale:{range:{min:0,max:10},stops:Se},drawRange:{min:.1}}}}),legend:Le,evaluator:Object.assign(Object.assign({},qe),{title:"Lightning Density (CG)"})},t[`lightning-density-intracloud-${e}`]={id:(0,u.RC)(`severe.lightning.density.${e}.ic`),layer:(0,u.Af)(i,{quality:S.E.exact,paint:{sample:{channel:"g",colorscale:{range:{min:0,max:10},stops:Se},drawRange:{min:.1}}}}),legend:Le,evaluator:Object.assign(Object.assign({},qe),{title:"Lightning Density (IC)"})},t[`lightning-density-accum-${e}`]=Object.assign(Object.assign({},t[`lightning-density-${e}`]),{id:(0,u.RC)(`severe.lightning.density_accum.${e}.all`),operation:{type:"sum"}}),t[`lightning-density-cloud-to-ground-accum-${e}`]=Object.assign(Object.assign({},t[`lightning-density-${e}`]),{id:(0,u.RC)(`severe.lightning.density_accum.${e}.cg`),operation:{type:"sum"}}),t[`lightning-density-intracloud-accum-${e}`]=Object.assign(Object.assign({},t[`lightning-density-intracloud-${e}`]),{id:(0,u.RC)(`severe.lightning.density_accum.${e}.ic`),operation:{type:"sum"}}),t}),{}));return r["lightning-strikes-icons"]=(0,m.$)({},r["lightning-strikes"],{id:(0,u.RC)("severe.lightning.symbol"),layer:{type:S.m.symbol,paint:{stroke:{thickness:1},icon:{image:"mapsgl:lightning-bolt",size:{width:30,height:30}}}}}),r["lightning-all-icons"]=["lightning-flash","lightning-strikes-icons"],r["lightning-strikes-pulse"]=(0,m.$)({},r["lightning-strikes"],{id:(0,u.RC)("severe.lightning.pulse"),layer:{type:S.m.symbol,paint:{icon:{shader:"\n#extension GL_OES_standard_derivatives : enable\n\nprecision mediump float;\n\nuniform vec2 resolution;\nuniform float dpr;\nuniform float time;\n\nvarying vec2 vUv;\nvarying vec2 vPosition;\nvarying float vFactor;\nvarying float vRandom;\n\nvarying float vEnvelope;\nvarying float vInvRadius;\nvarying float vInvRadiusEdge;\nvarying float vIntensity;\n\nvoid main() {\n float envelope = vEnvelope;\n\n // --- Spatial falloff (radial glow) ----------------------------------------\n // Keep glow circular in screen-space: correct for aspect.\n float aspect = resolution.x / max(resolution.y, 1.0);\n vec2 p = vUv - vec2(0.5);\n float r = length(p);\n float q = r * vInvRadius; // normalized radius r / radius\n\n // Radius is in icon-UV units now: 0.5 touches the quad's edge.\n float radius = 0.45; // fills the icon with a small margin\n\n // Soft core + long, soft edge (use precomputed inverses for perf)\n // float core = 1.0 / (1.0 + 8.0 * pow(r / max(radius, 1e-4), 2.0));\n // float core = 1.0 / (1.0 + 18.0 * (q * q)); // tighter core than before\n // // long fade from ~55% of radius to edge (q = 0.55..1.0)\n // float edge = 1.0 - smoothstep(0.7, 1.0, q);\n // float spatial = core * edge;\n\n // Two-term isotropic falloff: tight core + broad halo (both circular)\n float core = 1.0 / (1.0 + 20.0 * (q * q)); // small hot center\n float halo = 1.0 / (1.0 + 4.0 * (q * q)); // wide soft halo\n\n // Limit contribution near the very edge for a clean terminator\n float edgeMask = 1.0 - smoothstep(0.9, 1.0, q);\n\n // // Combined spatial term (circular symmetry)\n // float spatial = (0.55 * core + 0.80 * halo) * edgeMask;\n\n\n // // --- Edge-to-core color grading ---\n // // Keep edges slightly bluish, center approaches white\n // vec3 edgeColor = vec3(0.7, 0.80, 1.00); // icier blue at the outskirts\n // float coreMix = smoothstep(0.1, 0.9, core); // slower transition to white\n\n // // Boost the core so it burns white under additive blending\n // float coreBoost = mix(1.0, 2.2, coreMix);\n // vec3 glowColor = mix(edgeColor, vec3(1.0), coreMix);\n\n\n // Combine: keep some core but emphasize a wide halo\n float spatial = (0.55 * core + 0.80 * halo) * edgeMask;\n\n // --- Edge-to-core color grading -----------------------------------------\n // Bluish edges (halo), hot white core\n vec3 edgeColor = vec3(0.6, 0.65, 1.00);\n\n // Weight toward white near center; toward blue in the halo\n float coreMix = smoothstep(0.35, 0.80, core); // 0 at edge, 1 near center\n float haloMix = smoothstep(0.15, 0.80, halo); // 0 outside, 1 within halo\n\n // Final glow tint: mostly blue in the wings, white in the core\n vec3 glowColor = mix(edgeColor, vec3(1.0), coreMix);\n\n // Slightly lift halo blueness even when core is strong\n glowColor = mix(glowColor, edgeColor, (1.0 - coreMix) * 0.35 * haloMix); // 0.35 is the weight\n\n // Reduce center boost so the core doesn't dominate; additive will bloom it anyway\n float coreBoost = mix(1.0, 1.35, coreMix);\n\n\n // --- Color & output --------------------------------------------------------\n float intensity = vIntensity;\n vec3 color = glowColor * (intensity * coreBoost) * envelope * spatial;\n\n // Additive-friendly output (premult not needed here).\n gl_FragColor = vec4(color, clamp(envelope * spatial, 0.0, 0.8));\n}\n",shaderOnBeforeCompile:t=>{t.vertex=t.vertex.replace("#include <project_vertex>","\n#include <project_vertex>\n\nvarying float vEnvelope;\nvarying float vInvRadius;\nvarying float vInvRadiusEdge;\nvarying float vIntensity;\n\n/* Quick-rise / slow-decay impulse.\n Larger k => narrower, punchier impulse with a fast attack and slower tail. */\nfloat expImpulse(float k, float x) {\n float y = k * x;\n return y * exp(1.0 - y);\n}\n\n/* Tiny hash for flicker without textures. */\nfloat hash11(float x) {\n // one sin + fract -> cheap, stable per-frame noise when driven by time\n return fract(sin(x) * 43758.5453123);\n}\n"),t.vertex=t.vertex.replace("#include <symbol_vert_position>","\n#include <symbol_vert_position>\n\n// --- Temporal envelope ----------------------------------------------------\n// Use vFactor only for the gap between pulses; pulse is always ~1s.\nfloat repeatFactor = clamp(vFactor, 0.0, 1.0);\n\n// // Ensure zero/near-zero factors still differ per-instance (avoid beat sync)\n// float tinyBias = 0.01 * (0.5 + hash11(vRandom * 12345.0)); // ~0.0015..0.003\n// repeatFactor = max(repeatFactor, tinyBias);\n\n// --- Timing model: fixed ~1s pulse, variable gap controlled by vFactor ---\n// A single pulse (fast attack, slow decay) lasts ~1.0s.\n// After that, a gap occurs; higher vFactor => shorter gap (faster repeat).\nfloat pulseDuration = 2.0; // seconds for burst+decay\nfloat minGap = 0.50; // fastest re-strike gap (s)\nfloat maxGap = 5.00; // slowest re-strike gap (s)\nfloat gap = mix(maxGap, minGap, repeatFactor);\n\nfloat nominalPeriod = pulseDuration + gap;\n\n// Instance-staggered time and integer cycle under the *nominal* period\nfloat t0 = time + 10.0 + vRandom * 13.37;\nfloat cycle = floor(t0 / max(nominalPeriod, 1e-3));\n\n// Per-cycle gap variation (random short/long pauses)\nfloat gapJitter = mix(0.6, 1.4, hash11(cycle * 17.0 + vRandom * 123.0));\nfloat basePeriod = pulseDuration + gap * gapJitter;\n\n// Time within the current cycle (under nominal schedule)\nfloat tIn = t0 - cycle * nominalPeriod;\n\n// Normalized phase inside the *jittered* period\nfloat phaseBase = clamp(tIn / max(basePeriod, 1e-3), 0.0, 1.0);\n\n// Additional per-cycle phase jitter to break residual sync\nfloat phaseJitter = hash11(cycle + vRandom * 4096.0);\nfloat phase = fract(phaseBase + (phaseJitter - 0.5) * 0.6); // +/-0.3 cycle shift\n\n// Active portion of the cycle is the initial pulseDuration window\nfloat activeFrac = pulseDuration / basePeriod; // portion of period that is the pulse\nfloat localPhase = clamp(phase / max(activeFrac, 1e-3), 0.0, 1.0);\n\n// Shape: quick rise, slower decay\nfloat k = 14.0; // higher => snappier attack, longer tail\nfloat burst = expImpulse(k, localPhase); // 0..~1 over the 1s window\n\n// Gate the envelope so it is zero during the gap (branch-free)\nfloat gate = step(phase, activeFrac); // 1 in pulse window, 0 in gap\n\n// Subtle micro-flicker only during the burst, reduced amplitude\nfloat flickSeed = floor(time * 180.0 + vRandom * 997.0);\nfloat flick = 0.08 * burst * (hash11(flickSeed) * 2.0 - 1.0);\n\nfloat envelope = max(burst * gate + flick, 0.0);\nfloat radius = 0.45;\n\nvEnvelope = envelope;\n\n// --------- precompute spatial constants ----------\nvInvRadius = 1.0 / max(radius, 1e-4);\nvInvRadiusEdge = 1.0 / (radius * 1.6);\n\n// --------- pack intensity once ----------\nvIntensity = 1.0;\n")},size:t=>{const e=t.zoom,i=Math.max(0,(900-t.age)/900)*(e/5),r=Math.round(20+40*i);return{width:r,height:r}},animated:!0,blending:2,factor:t=>Math.max(0,(900-t.age)/900)},symbol:{pitchWithMap:!0,allowOverlap:!0}}},legend:null}),r["alerts-short-fuse"]=(0,m.$)({},r["alerts-outline"],{id:(0,u.RC)("severe.alerts.short_fuse"),layer:{paint:{animated:!0,opacity:t=>{let{time:e}=t;return Math.min(1,Math.max(0,.5*Math.sin(8*e)+.5))},stroke:{thickness:4}},filter:["in",["get","VTEC"],["literal",["SV.W","TO.W","FF.W","MA.W"]]]}}),r["hail-size"]=p.ot.map((t=>`hail-size-${t}`)),r["hail-size-max"]=p.ot.map((t=>`hail-size-max-${t}`)),r["hail-severe-probability"]=p.ot.map((t=>`hail-severe-probability-${t}`)),r["hail-severe-probability-max"]=p.ot.map((t=>`hail-severe-probability-max-${t}`)),r["lightning-density"]=p.Q0.map((t=>`lightning-density-${t}`)),r["lightning-density-accum"]=p.Q0.map((t=>`lightning-density-accum-${t}`)),r["lightning-density-cloud-to-ground"]=p.Q0.map((t=>`lightning-density-cloud-to-ground-${t}`)),r["lightning-density-cloud-to-ground-accum"]=p.Q0.map((t=>`lightning-density-cloud-to-ground-accum-${t}`)),r["lightning-density-intracloud"]=p.Q0.map((t=>`lightning-density-intracloud-${t}`)),r["lightning-density-intracloud-accum"]=p.Q0.map((t=>`lightning-density-intracloud-accum-${t}`)),r})(t)),Object.assign(Object.assign({},["active","notactive","invests"].reduce(((t,e)=>{const i="tropical-cyclones-";let r="",s="",a=J.tropical_active,n=!1;switch(e){case"active":s="_active";break;case"notactive":r="-archive",s="_archive",a=J.tropical_archive,n=!0;break;case"invests":r="-invests",s="_invests",a=J.tropical_invests}const o=["<=",["get","timestamp"],["map-time"]],l=["all",["==",["get","featureType"],"position"],o],h=["all",["==",["get","featureType"],"trackPoint"],o],d=["all",["==",["get","featureType"],"trackLine"],o];return t[`${i}track-points${r}`]={id:(0,u.RC)(`tropical.track${s}.circle`),layer:Object.assign(Object.assign({},k.point),{source:a,filter:h}),legend:z,evaluator:Y},t[`${i}track-point-icons${r}`]={id:(0,u.RC)(`tropical.track${s}.symbol`),layer:Object.assign(Object.assign({},k.symbol),{source:a,filter:h}),legend:z,evaluator:Y},t[`${i}track-lines${r}`]={id:(0,u.RC)(`tropical.track${s}.line`),layer:Object.assign(Object.assign({},k.track),{source:a,filter:d}),legend:z},t[`${i}names${r}`]={id:(0,u.RC)(`tropical.names${s}.text`),layer:Object.assign(Object.assign({},k.name),{source:a,sourceType:c.V.point,filter:l})},"active"===e||"invests"===e?(t[`${i}positions${r}`]={id:(0,u.RC)(`tropical.positions${s}.circle`),layer:Object.assign(Object.assign({},k.point),{source:a,filter:l}),legend:z,evaluator:Y},t[`${i}position-icons${r}`]={id:(0,u.RC)(`tropical.positions${s}.symbol`),layer:(0,m.$)({},k.symbol,{source:a,filter:l,paint:{icon:{size:t=>t.zoom<4?{width:28,height:28}:{width:44,height:44},shaderOnBeforeCompile:t=>{t.vertex=t.vertex.replace("#include <symbol_vert_position>","\n symbolAngle += (time * -PI * 2.0) * 0.5 * factor;\n #include <symbol_vert_position>\n ")},animated:!0}}}),legend:z,evaluator:Y},t[`${i}forecast-points${r}`]={id:(0,u.RC)(`tropical.forecast${s}.circle`),layer:Object.assign(Object.assign({},k.point),{source:a,filter:["==",["get","featureType"],"forecastPoint"]}),legend:z,evaluator:Y},t[`${i}forecast-point-icons${r}`]={id:(0,u.RC)("tropical.forecast.symbol"),layer:Object.assign(Object.assign({},k.symbol),{source:a,filter:["==",["get","featureType"],"forecastPoint"]}),legend:z,evaluator:Y},t[`${i}forecast-lines${r}`]={id:(0,u.RC)(`tropical.forecast${s}.line`),layer:Object.assign(Object.assign({},k.track),{source:a,filter:["==",["get","featureType"],"forecastLine"]})},"invests"===e?(t[`tropical-cyclones${r}`]=["track-lines","track-points","positions","names"].map((t=>{const e=t.startsWith("forecast-")?"":r;return`${i}${t}${e}`})),t[`tropical-cyclones${r}-icons`]=["track-lines","track-point-icons","position-icons","names"].map((t=>{const e=t.startsWith("forecast-")?"":r;return`${i}${t}${e}`}))):(t[`tropical-cyclones${r}`]=["forecast-error-cones","track-lines","forecast-lines","track-points","forecast-points","positions","names"].map((t=>{const e=t.startsWith("forecast-")?"":r;return`${i}${t}${e}`})),t[`tropical-cyclones${r}-icons`]=["forecast-error-cones","track-lines","forecast-lines","track-point-icons","forecast-point-icons","position-icons","names"].map((t=>{const e=t.startsWith("forecast-")?"":r;return`${i}${t}${e}`})))):(t[`tropical-cyclones${r}`]=["forecast-error-cones","track-lines-archive","forecast-lines","track-points-archive","forecast-points","names-archive"].map((t=>`${i}${t}`)),t[`tropical-cyclones${r}-icons`]=["forecast-error-cones","track-lines-archive","forecast-lines","track-point-icons-archive","forecast-point-icons","position-icons","names-archive"].map((t=>`${i}${t}`))),t}),{})),{"tropical-cyclones-forecast-error-cones":{id:(0,u.RC)("tropical.cone.fill"),layer:{type:S.m.fill,source:J.tropical_active,paint:{fill:{color:"#ff0000",opacity:.5},stroke:{color:"#ff0000",thickness:1}}}},"tropical-cyclones-break-points":{id:(0,u.RC)("tropical.active.breakpoints"),layer:{type:S.m.line,source:J.tropical_active,filter:["==",["get","featureType"],"breakPointAlert"],paint:{stroke:{color:t=>{var e;const i=null===(e=t.alertType)||void 0===e?void 0:e.toUpperCase();return W[i]||"#999"},thickness:t=>{var e;switch(null===(e=t.alertType)||void 0===e?void 0:e.toUpperCase()){case"TR.W":case"HU.W":return 8;default:return 4}},lineJoin:I.p.Round,lineCap:I.$.Round}}},legend:N}})),{"fires-obs":function(t){return{id:(0,u.RC)("climate.fire_obs.point"),layer:{type:S.m.circle,source:J.fires_obs,timeSeries:{mode:ae.Gp.interval},paint:{fill:{color:ti},stroke:{color:"#fff",thickness:2},circle:{radius:ei}}},legend:G("Fires",{id:(0,u.RC)("fire-obs"),points:{values:[{color:t.new,label:"New"},{color:t.active,label:"Active"},{color:t.contained,label:"Contained"}]}}),evaluator:si}}($e.fire_obs),"fires-obs-icons":{id:(0,u.RC)("climate.fire_obs.icons"),layer:{type:S.m.symbol,source:J.fires_obs,timeSeries:{mode:ae.Gp.interval},paint:{icon:{image:ii,size:ri,anchor:"bottom",offset:{x:0,y:2}},symbol:{rotateWithMap:!1,pitchWithMap:!1}}},evaluator:si},"fires-obs-names":{id:(0,u.RC)("climate.fire_obs.names"),layer:{type:S.m.symbol,source:J.fires_obs,timeSeries:{mode:ae.Gp.interval},paint:{text:[{value:["case",["all",["has","report"],[">=",["zoom"],7]],["get","report.name"],null],size:14,color:"#fff",outlineColor:"#444",weight:"bold",anchor:"top",offset:["case",["has","report"],{x:0,y:4},null]},{value:["let","areaAC",["round",["max",1,["coalesce",["get","perimeter.areaAC"],["get","report.areaAC"]]]],["case",["all",["has","report"],[">=",["zoom"],7]],["concat",["to-locale-string",["var","areaAC"],"en-US"],["case",["==",["var","areaAC"],1]," acre"," acres"]],null]],size:11,color:"#fff",outlineColor:"#444",anchor:"top",offset:{x:0,y:{target:"text-0-bottom",offset:0}}}],symbol:{allowOverlap:!1,rotateWithMap:!1,pitchWithMap:!1}}}},"fires-obs-heat":{id:(0,u.RC)("climate.fire_obs.heat"),layer:{type:S.m.heatmap,source:J.fires_obs,timeSeries:{mode:ae.Gp.range},paint:{heatmap:{radius:20,color:f.heatmap}}}},"fires-perimeter":{id:(0,u.RC)("climate.fire_obs.perimeter"),layer:{type:S.m.fill,source:J.fires_perimeter,timeSeries:{mode:ae.Gp.range},paint:{fill:{color:"#ff0000",opacity:.6},stroke:{color:"#ff0000"}}},evaluator:si},fires:["fires-perimeter","fires-obs","fires-obs-names"],"fires-icons":["fires-perimeter","fires-obs-icons","fires-obs-names"],"fires-outlook":function(t){return{id:(0,u.RC)("climate.fire_outlook.fill"),layer:{type:S.m.fill,source:J.fires_outlook,paint:{fill:{color:["match",["downcase",["get","details.risk.type"]],"elevated",t.elevated,"critical",t.critical,"extreme",t.extreme,"#FFB268"],opacity:.9}}},legend:G("Fire Outlook",{id:(0,u.RC)("fire-outlook"),points:{values:[{color:t.elevated,label:"Elevated"},{color:t.critical,label:"Critical"},{color:t.extreme,label:"Extreme"}]}}),evaluator:{title:"Fire Outlook",fn:t=>{var e,i,r;const s=null===(e=t.features)||void 0===e?void 0:e.at(-1);return(null==s?void 0:s.details)?`${(0,te.C)(null===(r=null===(i=s.details)||void 0===i?void 0:i.risk)||void 0===r?void 0:r.type)}`:""}}}}($e.fire_outlook),"fires-vpd":{id:(0,u.RC)("climate.fires_vpd.fill"),layer:(0,u.Af)(J.conditions_VPD,{paint:{sample:{channel:"r",dataRange:{min:0,max:70},colorscale:{stops:$e.vpd}}}}),mask:ut,legend:R("Vapor Pressure Deficit (VPD)",{id:(0,u.RC)("fires-vpd"),bar:{measurement:{type:"pressure",units:g.Units.pressure.hPa},colorscale:{range:{min:0,max:70},stops:$e.vpd},labels:{every:t=>20,formatter:(t,e,i)=>0===e?`${Math.round(t)} %%units%%`:`${Math.round(t)}`}}}),evaluator:{title:"Vapor Pressure Deficit (VPD)",fn:t=>`${t.value.toFixed(2)} hPa`}},"drought-monitor":function(t){return{id:(0,u.RC)("climate.drought_monitor.fill"),layer:{type:S.m.fill,source:J.drought,paint:{fill:{color:["match",["downcase",["get","details.category"]],"d0",t.d0,"d1",t.d1,"d2",t.d2,"d3",t.d3,"d4",t.d4,"#000000"]}}},legend:G("Drought Monitor",{id:(0,u.RC)("drought"),points:{values:[{color:t.d0,label:"Abnormally Dry"},{color:t.d1,label:"Moderate"},{color:t.d2,label:"Severe"},{color:t.d3,label:"Extreme"},{color:t.d4,label:"Exceptional"}]}}),evaluator:{title:"Drought Monitor",fn:t=>{var e,i,r;const s=null===(e=t.features)||void 0===e?void 0:e[0];return(null==s?void 0:s.details)?`${(0,te.C)(null===(r=null===(i=s.details)||void 0===i?void 0:i.risk)||void 0===r?void 0:r.name)}`:""}}}}($e.drought),"drought-monitor-outline":function(t){return{id:(0,u.RC)("climate.drought_monitor.outline"),layer:{type:S.m.line,source:J.drought,paint:{stroke:{color:["match",["downcase",["get","details.category"]],"d0",t.d0,"d1",t.d1,"d2",t.d2,"d3",t.d3,"d4",t.d4,"#000000"],thickness:3}}}}}($e.drought),earthquakes:function(t){return{id:(0,u.RC)("climate.earthquakes.point"),layer:{type:S.m.circle,source:J.earthquakes,paint:{fill:{color:["match",["downcase",["get","report.type"]],"mini",t.mini,"minor",t.minor,"light",t.light,"moderate",t.moderate,"strong",t.strong,"major",t.major,"great",t.great,"catastrophic",t.catastrophic,"#000000"]},stroke:{color:"#fff",thickness:2},circle:{radius:["/",["match",["downcase",["get","report.type"]],"mini",12,"minor",18,"light",20,"moderate",22,"strong",26,"major",30,"great",36,"catastrophic",42,12],2]},symbol:{rotateWithMap:!0,pitchWithMap:!0}}},legend:G("Earthquakes",{id:(0,u.RC)("earthquakes"),points:{values:[{color:t.mini,label:"Mini"},{color:t.minor,label:"Minor"},{color:t.light,label:"Light"},{color:t.moderate,label:"Moderate"},{color:t.strong,label:"Strong"},{color:t.major,label:"Major"},{color:t.great,label:"Great"},{color:t.catastrophic,label:"Catastrophic"}]}}),evaluator:{title:"Earthquakes",fn:t=>{var e,i,r,s;const a=null===(e=t.features)||void 0===e?void 0:e[0];return(null==a?void 0:a.report)?`${null===(i=a.report)||void 0===i?void 0:i.mag} (${null===(r=a.report)||void 0===r?void 0:r.type}) - ${(null===(s=a.report)||void 0===s?void 0:s.location)||""}`:""}}}}($e.earthquakes),"earthquakes-heat":{id:(0,u.RC)("climate.earthquakes.heat"),layer:{type:S.m.heatmap,source:J.earthquakes,paint:{heatmap:{radius:20,color:f.heatmap},symbol:{rotateWithMap:!0,pitchWithMap:!0}}}},"river-observations":function(t){return{id:(0,u.RC)("climate.river_obs.point"),layer:{type:S.m.circle,source:J.rivers,sourceType:c.V.point,paint:{fill:{color:["match",["downcase",["get","ob.status"]],"out_of_service",t.out_of_service,"obs_not_current",t.obs_not_current,"not_defined",t.not_defined,"low_threshold",t.low_threshold,"no_flooding",t.no_flooding,"action",t.action,"minor",t.minor,"moderate",t.moderate,"major",t.major,"#000000"]},stroke:{color:"#fff",thickness:3},circle:{radius:8}}},legend:G("River Observations",{id:(0,u.RC)("rivers"),points:{values:[{color:t.out_of_service,label:"Out of Service"},{color:t.obs_not_current,label:"Old Data"},{color:t.not_defined,label:"Unavailable"},{color:t.low_threshold,label:"Low Threshold"},{color:t.no_flooding,label:"No Flooding"},{color:t.action,label:"Action"},{color:t.minor,label:"Minor"},{color:t.moderate,label:"Moderate"},{color:t.major,label:"Major"}]}}),evaluator:{title:"River Obs",fn:t=>{var e,i;const r=null===(e=t.features)||void 0===e?void 0:e[0];if(null==r?void 0:r.ob){let t="";return(null===(i=null==r?void 0:r.profile)||void 0===i?void 0:i.waterbody)&&(t+=`${(0,te.C)(r.profile.waterbody)} - `),t+=(0,te.C)(r.ob.status.replace(/_/," ")),t}return""}}}}($e.rivers)}),{satellite:{id:"raster.satellite.infrared",layer:(0,u.BH)(J.satellite_infrared)},"satellite-geocolor":{id:"raster.satellite.geocolor",layer:(0,u.BH)(J.satellite_geocolor)},"satellite-visible":{id:"raster.satellite.visible",layer:(0,u.BH)(J.satellite_visible)},"satellite-infrared-color":{id:"raster.satellite.infrared-color",layer:(0,u.BH)(J.satellite_infrared_color)},"satellite-water-vapor":{id:"raster.satellite.water-vapor",layer:(0,u.BH)(J.satellite_water_vapor)}})},ni=(t,e)=>({sources:q(e),layers:ai(t)})}}]),e}));
19
+ e.read=function(t,e,i,r,s){var a,n,o=8*s-r-1,l=(1<<o)-1,h=l>>1,d=-7,c=i?s-1:0,u=i?-1:1,p=t[e+c];for(c+=u,a=p&(1<<-d)-1,p>>=-d,d+=o;d>0;a=256*a+t[e+c],c+=u,d-=8);for(n=a&(1<<-d)-1,a>>=-d,d+=r;d>0;n=256*n+t[e+c],c+=u,d-=8);if(0===a)a=1-h;else{if(a===l)return n?NaN:1/0*(p?-1:1);n+=Math.pow(2,r),a-=h}return(p?-1:1)*n*Math.pow(2,a-r)},e.write=function(t,e,i,r,s,a){var n,o,l,h=8*a-s-1,d=(1<<h)-1,c=d>>1,u=23===s?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:a-1,m=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,n=d):(n=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-n))<1&&(n--,l*=2),(e+=n+c>=1?u/l:u*Math.pow(2,1-c))*l>=2&&(n++,l/=2),n+c>=d?(o=0,n=d):n+c>=1?(o=(e*l-1)*Math.pow(2,s),n+=c):(o=e*Math.pow(2,c-1)*Math.pow(2,s),n=0));s>=8;t[i+p]=255&o,p+=m,o/=256,s-=8);for(n=n<<s|o,h+=s;h>0;t[i+p]=255&n,p+=m,n/=256,h-=8);t[i+p-m]|=128*g}},5335:(t,e,i)=>{t.exports=s;var r=i(251);function s(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}s.Varint=0,s.Fixed64=1,s.Bytes=2,s.Fixed32=5;var a=4294967296,n=1/a,o="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function l(t){return t.type===s.Bytes?t.readVarint()+t.pos:t.pos+1}function h(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function d(t,e,i){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(r);for(var s=i.pos-1;s>=t;s--)i.buf[s+r]=i.buf[s]}function c(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function u(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function p(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function m(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function g(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function f(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function v(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function y(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function b(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function x(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function w(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function _(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}s.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),s=r>>3,a=this.pos;this.type=7&r,t(s,e,this),this.pos===a&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=x(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=_(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=x(this.buf,this.pos)+x(this.buf,this.pos+4)*a;return this.pos+=8,t},readSFixed64:function(){var t=x(this.buf,this.pos)+_(this.buf,this.pos+4)*a;return this.pos+=8,t},readFloat:function(){var t=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,r=this.buf;return e=127&(i=r[this.pos++]),i<128?e:(e|=(127&(i=r[this.pos++]))<<7,i<128?e:(e|=(127&(i=r[this.pos++]))<<14,i<128?e:(e|=(127&(i=r[this.pos++]))<<21,i<128?e:function(t,e,i){var r,s,a=i.buf;if(r=(112&(s=a[i.pos++]))>>4,s<128)return h(t,r,e);if(r|=(127&(s=a[i.pos++]))<<3,s<128)return h(t,r,e);if(r|=(127&(s=a[i.pos++]))<<10,s<128)return h(t,r,e);if(r|=(127&(s=a[i.pos++]))<<17,s<128)return h(t,r,e);if(r|=(127&(s=a[i.pos++]))<<24,s<128)return h(t,r,e);if(r|=(1&(s=a[i.pos++]))<<31,s<128)return h(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&o?function(t,e,i){return o.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){for(var r="",s=e;s<i;){var a,n,o,l=t[s],h=null,d=l>239?4:l>223?3:l>191?2:1;if(s+d>i)break;1===d?l<128&&(h=l):2===d?128==(192&(a=t[s+1]))&&(h=(31&l)<<6|63&a)<=127&&(h=null):3===d?(n=t[s+2],128==(192&(a=t[s+1]))&&128==(192&n)&&((h=(15&l)<<12|(63&a)<<6|63&n)<=2047||h>=55296&&h<=57343)&&(h=null)):4===d&&(n=t[s+2],o=t[s+3],128==(192&(a=t[s+1]))&&128==(192&n)&&128==(192&o)&&((h=(15&l)<<18|(63&a)<<12|(63&n)<<6|63&o)<=65535||h>=1114112)&&(h=null)),null===h?(h=65533,d=1):h>65535&&(h-=65536,r+=String.fromCharCode(h>>>10&1023|55296),h=56320|1023&h),r+=String.fromCharCode(h),s+=d}return r}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==s.Bytes)return t.push(this.readVarint(e));var i=l(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==s.Bytes)return t.push(this.readSVarint());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==s.Bytes)return t.push(this.readBoolean());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==s.Bytes)return t.push(this.readFloat());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==s.Bytes)return t.push(this.readDouble());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==s.Bytes)return t.push(this.readFixed32());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==s.Bytes)return t.push(this.readSFixed32());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==s.Bytes)return t.push(this.readFixed64());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==s.Bytes)return t.push(this.readSFixed64());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===s.Varint)for(;this.buf[this.pos++]>127;);else if(e===s.Bytes)this.pos=this.readVarint()+this.pos;else if(e===s.Fixed32)this.pos+=4;else{if(e!==s.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),w(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),w(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),w(this.buf,-1&t,this.pos),w(this.buf,Math.floor(t*n),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),w(this.buf,-1&t,this.pos),w(this.buf,Math.floor(t*n),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,r;if(t>=0?(i=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,r=r+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,i.buf[i.pos]=127&(t>>>=7)}(i,0,e),function(t,e){var i=(7&t)<<4;e.buf[e.pos++]|=i|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,i){for(var r,s,a=0;a<e.length;a++){if((r=e.charCodeAt(a))>55295&&r<57344){if(!s){r>56319||a+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):s=r;continue}if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,s=r;continue}r=s-55296<<10|r-56320|65536,s=null}else s&&(t[i++]=239,t[i++]=191,t[i++]=189,s=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=63&r|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&d(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),r.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),r.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var r=this.pos-i;r>=128&&d(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,i){this.writeTag(t,s.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,c,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,u,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,m,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,v,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,y,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,b,e)},writeBytesField:function(t,e){this.writeTag(t,s.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,s.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,s.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,s.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,s.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,s.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,s.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,s.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,s.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,s.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},3841:t=>{t.exports=function(t,e,i,r){var s=t[0],a=t[1],n=!1;void 0===i&&(i=0),void 0===r&&(r=e.length);for(var o=(r-i)/2,l=0,h=o-1;l<o;h=l++){var d=e[i+2*l+0],c=e[i+2*l+1],u=e[i+2*h+1];c>a!=u>a&&s<(e[i+2*h+0]-d)*(a-c)/(u-c)+d&&(n=!n)}return n}},1476:(t,e,i)=>{var r=i(3841),s=i(1137);t.exports=function(t,e,i,a){return e.length>0&&Array.isArray(e[0])?s(t,e,i,a):r(t,e,i,a)},t.exports.nested=s,t.exports.flat=r},1137:t=>{t.exports=function(t,e,i,r){var s=t[0],a=t[1],n=!1;void 0===i&&(i=0),void 0===r&&(r=e.length);for(var o=r-i,l=0,h=o-1;l<o;h=l++){var d=e[l+i][0],c=e[l+i][1],u=e[h+i][1];c>a!=u>a&&s<(e[h+i][0]-d)*(a-c)/(u-c)+d&&(n=!n)}return n}},5341:function(t){t.exports=function(){function t(t,r,s,a,n){!function t(i,r,s,a,n){for(;a>s;){if(a-s>600){var o=a-s+1,l=r-s+1,h=Math.log(o),d=.5*Math.exp(2*h/3),c=.5*Math.sqrt(h*d*(o-d)/o)*(l-o/2<0?-1:1);t(i,r,Math.max(s,Math.floor(r-l*d/o+c)),Math.min(a,Math.floor(r+(o-l)*d/o+c)),n)}var u=i[r],p=s,m=a;for(e(i,s,r),n(i[a],u)>0&&e(i,s,a);p<m;){for(e(i,p,m),p++,m--;n(i[p],u)<0;)p++;for(;n(i[m],u)>0;)m--}0===n(i[s],u)?e(i,s,m):e(i,++m,a),m<=r&&(s=m+1),r<=m&&(a=m-1)}}(t,r,s||0,a||t.length-1,n||i)}function e(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function i(t,e){return t<e?-1:t>e?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function s(t,e,i){if(!i)return e.indexOf(t);for(var r=0;r<e.length;r++)if(i(t,e[r]))return r;return-1}function a(t,e){n(t,0,t.children.length,e,t)}function n(t,e,i,r,s){s||(s=m(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(var a=e;a<i;a++){var n=t.children[a];o(s,t.leaf?r(n):n)}return s}function o(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function h(t,e){return t.minY-e.minY}function d(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function c(t){return t.maxX-t.minX+(t.maxY-t.minY)}function u(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function p(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,i,r,s,a){for(var n=[i,r];n.length;)if(!((r=n.pop())-(i=n.pop())<=s)){var o=i+Math.ceil((r-i)/s/2)*s;t(e,o,i,r,a),n.push(i,o,o,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var e=this.data,i=[];if(!p(t,e))return i;for(var r=this.toBBox,s=[];e;){for(var a=0;a<e.children.length;a++){var n=e.children[a],o=e.leaf?r(n):n;p(t,o)&&(e.leaf?i.push(n):u(t,o)?this._all(n,i):s.push(n))}e=s.pop()}return i},r.prototype.collides=function(t){var e=this.data;if(!p(t,e))return!1;for(var i=[];e;){for(var r=0;r<e.children.length;r++){var s=e.children[r],a=e.leaf?this.toBBox(s):s;if(p(t,a)){if(e.leaf||u(t,a))return!0;i.push(s)}}e=i.pop()}return!1},r.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var i=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===i.height)this._splitRoot(this.data,i);else{if(this.data.height<i.height){var r=this.data;this.data=i,i=r}this._insert(i,this.data.height-i.height-1,!0)}else this.data=i;return this},r.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},r.prototype.clear=function(){return this.data=m([]),this},r.prototype.remove=function(t,e){if(!t)return this;for(var i,r,a,n=this.data,o=this.toBBox(t),l=[],h=[];n||l.length;){if(n||(n=l.pop(),r=l[l.length-1],i=h.pop(),a=!0),n.leaf){var d=s(t,n.children,e);if(-1!==d)return n.children.splice(d,1),l.push(n),this._condense(l),this}a||n.leaf||!u(n,o)?r?(i++,n=r.children[i],a=!1):n=null:(l.push(n),h.push(i),i=0,r=n,n=n.children[0])}return this},r.prototype.toBBox=function(t){return t},r.prototype.compareMinX=function(t,e){return t.minX-e.minX},r.prototype.compareMinY=function(t,e){return t.minY-e.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(t){return this.data=t,this},r.prototype._all=function(t,e){for(var i=[];t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},r.prototype._build=function(t,e,i,r){var s,n=i-e+1,o=this._maxEntries;if(n<=o)return a(s=m(t.slice(e,i+1)),this.toBBox),s;r||(r=Math.ceil(Math.log(n)/Math.log(o)),o=Math.ceil(n/Math.pow(o,r-1))),(s=m([])).leaf=!1,s.height=r;var l=Math.ceil(n/o),h=l*Math.ceil(Math.sqrt(o));g(t,e,i,h,this.compareMinX);for(var d=e;d<=i;d+=h){var c=Math.min(d+h-1,i);g(t,d,c,l,this.compareMinY);for(var u=d;u<=c;u+=l){var p=Math.min(u+l-1,c);s.children.push(this._build(t,u,p,r-1))}}return a(s,this.toBBox),s},r.prototype._chooseSubtree=function(t,e,i,r){for(;r.push(e),!e.leaf&&r.length-1!==i;){for(var s=1/0,a=1/0,n=void 0,o=0;o<e.children.length;o++){var l=e.children[o],h=d(l),c=(u=t,p=l,(Math.max(p.maxX,u.maxX)-Math.min(p.minX,u.minX))*(Math.max(p.maxY,u.maxY)-Math.min(p.minY,u.minY))-h);c<a?(a=c,s=h<s?h:s,n=l):c===a&&h<s&&(s=h,n=l)}e=n||e.children[0]}var u,p;return e},r.prototype._insert=function(t,e,i){var r=i?t:this.toBBox(t),s=[],a=this._chooseSubtree(r,this.data,e,s);for(a.children.push(t),o(a,r);e>=0&&s[e].children.length>this._maxEntries;)this._split(s,e),e--;this._adjustParentBBoxes(r,s,e)},r.prototype._split=function(t,e){var i=t[e],r=i.children.length,s=this._minEntries;this._chooseSplitAxis(i,s,r);var n=this._chooseSplitIndex(i,s,r),o=m(i.children.splice(n,i.children.length-n));o.height=i.height,o.leaf=i.leaf,a(i,this.toBBox),a(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)},r.prototype._splitRoot=function(t,e){this.data=m([t,e]),this.data.height=t.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,e,i){for(var r,s,a,o,l,h,c,u=1/0,p=1/0,m=e;m<=i-e;m++){var g=n(t,0,m,this.toBBox),f=n(t,m,i,this.toBBox),v=(s=g,a=f,o=Math.max(s.minX,a.minX),l=Math.max(s.minY,a.minY),h=Math.min(s.maxX,a.maxX),c=Math.min(s.maxY,a.maxY),Math.max(0,h-o)*Math.max(0,c-l)),y=d(g)+d(f);v<u?(u=v,r=m,p=y<p?y:p):v===u&&y<p&&(p=y,r=m)}return r||i-e},r.prototype._chooseSplitAxis=function(t,e,i){var r=t.leaf?this.compareMinX:l,s=t.leaf?this.compareMinY:h;this._allDistMargin(t,e,i,r)<this._allDistMargin(t,e,i,s)&&t.children.sort(r)},r.prototype._allDistMargin=function(t,e,i,r){t.children.sort(r);for(var s=this.toBBox,a=n(t,0,e,s),l=n(t,i-e,i,s),h=c(a)+c(l),d=e;d<i-e;d++){var u=t.children[d];o(a,t.leaf?s(u):u),h+=c(a)}for(var p=i-e-1;p>=e;p--){var m=t.children[p];o(l,t.leaf?s(m):m),h+=c(l)}return h},r.prototype._adjustParentBBoxes=function(t,e,i){for(var r=i;r>=0;r--)o(e[r],t)},r.prototype._condense=function(t){for(var e=t.length-1,i=void 0;e>=0;e--)0===t[e].children.length?e>0?(i=t[e-1].children).splice(i.indexOf(t[e]),1):this.clear():a(t[e],this.toBBox)},r}()},3886:(t,e,i)=>{var r=i(5335),s=i(1181);function a(t){var e=new r;return function(t,e){for(var i in t.layers)e.writeMessage(3,n,t.layers[i])}(t,e),e.finish()}function n(t,e){var i;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var r={keys:[],values:[],keycache:{},valuecache:{}};for(i=0;i<t.length;i++)r.feature=t.feature(i),e.writeMessage(2,o,r);var s=r.keys;for(i=0;i<s.length;i++)e.writeStringField(3,s[i]);var a=r.values;for(i=0;i<a.length;i++)e.writeMessage(4,u,a[i])}function o(t,e){var i=t.feature;void 0!==i.id&&e.writeVarintField(1,i.id),e.writeMessage(2,l,t),e.writeVarintField(3,i.type),e.writeMessage(4,c,i)}function l(t,e){var i=t.feature,r=t.keys,s=t.values,a=t.keycache,n=t.valuecache;for(var o in i.properties){var l=i.properties[o],h=a[o];if(null!==l){void 0===h&&(r.push(o),a[o]=h=r.length-1),e.writeVarint(h);var d=typeof l;"string"!==d&&"boolean"!==d&&"number"!==d&&(l=JSON.stringify(l));var c=d+":"+l,u=n[c];void 0===u&&(s.push(l),n[c]=u=s.length-1),e.writeVarint(u)}}}function h(t,e){return(e<<3)+(7&t)}function d(t){return t<<1^t>>31}function c(t,e){for(var i=t.loadGeometry(),r=t.type,s=0,a=0,n=i.length,o=0;o<n;o++){var l=i[o],c=1;1===r&&(c=l.length),e.writeVarint(h(1,c));for(var u=3===r?l.length-1:l.length,p=0;p<u;p++){1===p&&1!==r&&e.writeVarint(h(2,u-1));var m=l[p].x-s,g=l[p].y-a;e.writeVarint(d(m)),e.writeVarint(d(g)),s+=m,a+=g}3===r&&e.writeVarint(h(7,1))}}function u(t,e){var i=typeof t;"string"===i?e.writeStringField(1,t):"boolean"===i?e.writeBooleanField(7,t):"number"===i&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}t.exports=a,t.exports.fromVectorTileJs=a,t.exports.fromGeojsonVt=function(t,e){e=e||{};var i={};for(var r in t)i[r]=new s(t[r].features,e),i[r].name=r,i[r].version=e.version,i[r].extent=e.extent;return a({layers:i})},t.exports.GeoJSONWrapper=s},1181:(t,e,i)=>{var r=i(4748),s=i(4537).VectorTileFeature;function a(t,e){this.options=e||{},this.features=t,this.length=t.length}function n(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}t.exports=a,a.prototype.feature=function(t){return new n(this.features[t],this.options.extent)},n.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var i=t[e],s=[],a=0;a<i.length;a++)s.push(new r(i[a][0],i[a][1]));this.geometry.push(s)}return this.geometry},n.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,i=-1/0,r=1/0,s=-1/0,a=0;a<t.length;a++)for(var n=t[a],o=0;o<n.length;o++){var l=n[o];e=Math.min(e,l.x),i=Math.max(i,l.x),r=Math.min(r,l.y),s=Math.max(s,l.y)}return[e,r,i,s]},n.prototype.toGeoJSON=s.prototype.toGeoJSON}},e={};function i(r){var s=e[r];if(void 0!==s)return s.exports;var a=e[r]={exports:{}};return t[r].call(a.exports,a,a.exports,i),a.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var r in e)i.o(e,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{i.r(r);class t extends Error{constructor(t){super(null!=t?t:"Unauthorized")}}Error,Error;class e extends Error{constructor(t,e,i){super(t),this.response=e,this.status=i}}const s=t=>Array.isArray(t)?"array":t instanceof Date?"date":typeof t,a=t=>"object"===s(t),n=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if((t=>null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Date||t instanceof RegExp)(t))return t;if((r=t)&&"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer)return e&&!e.includes(t)&&e.push(t),t;var r;if(ArrayBuffer.isView(t)){const i=t;return e&&!e.includes(i.buffer)&&e.push(i.buffer),i}if(t instanceof ImageData)return e&&!e.includes(t.data.buffer)&&e.push(t.data.buffer),t;if(t instanceof ImageBitmap)return e&&!e.includes(t)&&e.push(t),t;if(Array.isArray(t)){const i=[];for(let r=0;r<t.length;r++)i.push(n(t[r],e));return i}if(a(t))return Object.keys(t).reduce(((r,s)=>{const a=0===i.length||i.length>0&&(i.includes(s)||((t,e)=>{let i=!1;return e.forEach((e=>{new RegExp(e).test(t)&&(i=!0)})),i})(s,i));return r[s]=a?n(t[s],e,i):t[s],r}),{});throw new Error("[MapsGL] Can't serialize object of type "+typeof t)};function o(){let t=0,e=0;for(let i=0;i<28;i+=7){let r=this.buf[this.pos++];if(t|=(127&r)<<i,!(128&r))return this.assertBounds(),[t,e]}let i=this.buf[this.pos++];if(t|=(15&i)<<28,e=(112&i)>>4,!(128&i))return this.assertBounds(),[t,e];for(let i=3;i<=31;i+=7){let r=this.buf[this.pos++];if(e|=(127&r)<<i,!(128&r))return this.assertBounds(),[t,e]}throw new Error("invalid varint")}const l=4294967296;function h(t){let e="-"==t[0];e&&(t=t.slice(1));const i=1e6;let r=0,s=0;function a(e,a){const n=Number(t.slice(e,a));s*=i,r=r*i+n,r>=l&&(s+=r/l|0,r%=l)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),[e,r,s]}function d(t,e){if(e<=2097151)return""+(l*e+t);let i=(t>>>24|e<<8)>>>0&16777215,r=e>>16&65535,s=(16777215&t)+6777216*i+6710656*r,a=i+8147497*r,n=2*r,o=1e7;function h(t,e){let i=t?String(t):"";return e?"0000000".slice(i.length)+i:i}return s>=o&&(a+=Math.floor(s/o),s%=o),a>=o&&(n+=Math.floor(a/o),a%=o),h(n,0)+h(a,n)+h(s,1)}function c(){let t=this.buf[this.pos++],e=127&t;if(!(128&t))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(127&t)<<7,!(128&t))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(127&t)<<14,!(128&t))return this.assertBounds(),e;if(t=this.buf[this.pos++],e|=(127&t)<<21,!(128&t))return this.assertBounds(),e;t=this.buf[this.pos++],e|=(15&t)<<28;for(let e=5;128&t&&e<10;e++)t=this.buf[this.pos++];if(128&t)throw new Error("invalid varint");return this.assertBounds(),e>>>0}const u=function(){const t=new DataView(new ArrayBuffer(8));return void 0!==globalThis.BigInt&&"function"==typeof t.getBigInt64&&"function"==typeof t.getBigUint64&&"function"==typeof t.setBigInt64&&"function"==typeof t.setBigUint64?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:t}:void 0}();function p(t){if(!t)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}const m=/^-?[0-9]+$/,g=4294967296;class f{constructor(t,e){this.lo=0|t,this.hi=0|e}isZero(){return 0==this.lo&&0==this.hi}toNumber(){let t=this.hi*g+(this.lo>>>0);if(!Number.isSafeInteger(t))throw new Error("cannot convert to safe number");return t}}class v extends f{static from(t){if(u)switch(typeof t){case"string":if("0"==t)return this.ZERO;if(""==t)throw new Error("string is no integer");t=u.C(t);case"number":if(0===t)return this.ZERO;t=u.C(t);case"bigint":if(!t)return this.ZERO;if(t<u.UMIN)throw new Error("signed value for ulong");if(t>u.UMAX)throw new Error("ulong too large");return u.V.setBigUint64(0,t,!0),new v(u.V.getInt32(0,!0),u.V.getInt32(4,!0))}else switch(typeof t){case"string":if("0"==t)return this.ZERO;if(t=t.trim(),!m.test(t))throw new Error("string is no integer");let[e,i,r]=h(t);if(e)throw new Error("signed value");return new v(i,r);case"number":if(0==t)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");if(t<0)throw new Error("signed value for ulong");return new v(t,t/g)}throw new Error("unknown value "+typeof t)}toString(){return u?this.toBigInt().toString():d(this.lo,this.hi)}toBigInt(){return p(u),u.V.setInt32(0,this.lo,!0),u.V.setInt32(4,this.hi,!0),u.V.getBigUint64(0,!0)}}v.ZERO=new v(0,0);class y extends f{static from(t){if(u)switch(typeof t){case"string":if("0"==t)return this.ZERO;if(""==t)throw new Error("string is no integer");t=u.C(t);case"number":if(0===t)return this.ZERO;t=u.C(t);case"bigint":if(!t)return this.ZERO;if(t<u.MIN)throw new Error("ulong too small");if(t>u.MAX)throw new Error("ulong too large");return u.V.setBigInt64(0,t,!0),new y(u.V.getInt32(0,!0),u.V.getInt32(4,!0))}else switch(typeof t){case"string":if("0"==t)return this.ZERO;if(t=t.trim(),!m.test(t))throw new Error("string is no integer");let[e,i,r]=h(t),s=new y(i,r);return e?s.negate():s;case"number":if(0==t)return this.ZERO;if(!Number.isSafeInteger(t))throw new Error("number is no integer");return t>0?new y(t,t/g):new y(-t,-t/g).negate()}throw new Error("unknown value "+typeof t)}isNegative(){return!!(2147483648&this.hi)}negate(){let t=~this.hi,e=this.lo;return e?e=1+~e:t+=1,new y(e,t)}toString(){if(u)return this.toBigInt().toString();if(this.isNegative()){let t=this.negate();return"-"+d(t.lo,t.hi)}return d(this.lo,this.hi)}toBigInt(){return p(u),u.V.setInt32(0,this.lo,!0),u.V.setInt32(4,this.hi,!0),u.V.getBigInt64(0,!0)}}var b,x;y.ZERO=new y(0,0),function(t){t.symbol=Symbol("protobuf-ts/unknown"),t.onRead=(i,r,s,a,n)=>{(e(r)?r[t.symbol]:r[t.symbol]=[]).push({no:s,wireType:a,data:n})},t.onWrite=(e,i,r)=>{for(let{no:e,wireType:s,data:a}of t.list(i))r.tag(e,s).raw(a)},t.list=(i,r)=>{if(e(i)){let e=i[t.symbol];return r?e.filter((t=>t.no==r)):e}return[]},t.last=(e,i)=>t.list(e,i).slice(-1)[0];const e=e=>e&&Array.isArray(e[t.symbol])}(b||(b={})),function(t){t[t.Varint=0]="Varint",t[t.Bit64=1]="Bit64",t[t.LengthDelimited=2]="LengthDelimited",t[t.StartGroup=3]="StartGroup",t[t.EndGroup=4]="EndGroup",t[t.Bit32=5]="Bit32"}(x||(x={}));const w=t=>String.fromCharCode.apply(String,t);class _{constructor(t){this.varint64=o,this.uint32=c,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){let t=this.uint32(),e=t>>>3,i=7&t;if(e<=0||i<0||i>5)throw new Error("illegal tag: field no "+e+" wire type "+i);return[e,i]}skip(t){let e=this.pos;switch(t){case x.Bit64:this.pos+=4;case x.Bit32:this.pos+=4;break;case x.LengthDelimited:let t=this.uint32();this.pos+=t;break;case x.Varint:for(;128&this.buf[this.pos++];);}return this.assertBounds(),this.buf.slice(e,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return 0|this.uint32()}sint32(){let t=this.uint32();return t>>>1^-(1&t)}int64(){return new y(...this.varint64())}uint64(){return new v(...this.varint64())}sint64(){let[t,e]=this.varint64(),i=-(1&t);return t=(t>>>1|(1&e)<<31)^i,e=e>>>1^i,new y(t,e)}bool(){let[t,e]=this.varint64();return 0!==t||0!==e}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return new v(this.sfixed32(),this.sfixed32())}sfixed64(){return new y(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),e=this.pos;return this.pos+=t,this.assertBounds(),this.buf.slice(e,this.pos)}string(){return function(t){if(t.length<1)return"";let e,i=0,r=[],s=[],a=0,n=t.length;for(;i<n;)e=t[i++],e<128?s[a++]=e:e>191&&e<224?s[a++]=(31&e)<<6|63&t[i++]:e>239&&e<365?(e=((7&e)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++])-65536,s[a++]=55296+(e>>10),s[a++]=56320+(1023&e)):s[a++]=(15&e)<<12|(63&t[i++])<<6|63&t[i++],a>8191&&(r.push(w(s)),a=0);return r.length?(a&&r.push(w(s.slice(0,a))),r.join("")):w(s.slice(0,a))}(this.bytes())}}var M=function(t,e){this.x=t,this.y=e},Z=function(t,e){void 0===e&&(e="number"),this.longType=e,this.layers={},this.reader=new _(t);for(var i=this.reader.len;this.reader.pos<i;){this.reader.uint32();var r=new A(this.reader,this.reader.uint32()+this.reader.pos,this.longType);r.length&&(this.layers[r.name]=r)}},A=function(){function t(t,e,i){for(this.reader=t,this.longType=i,this.name="",this.version=0,this.extent=0,this.featureOffsets=[],this.keys=[],this.values=[];t.pos<e;){var r=t.tag(),s=r[0],a=r[1];15==s?this.version=t.uint32():1==s?this.name=t.string():5==s?this.extent=t.uint32():2==s?(this.featureOffsets.push(t.pos),t.skip(a)):3==s?this.keys.push(t.string()):4==s&&this.values.push(this.decodeValue())}this.length=this.featureOffsets.length}var e=t.prototype;return e.feature=function(t){if(t<0||t>=this.featureOffsets.length)throw new Error("out of bounds");this.reader.pos=this.featureOffsets[t];var e=this.reader.uint32()+this.reader.pos;return new T(this.reader,e,this.keys,this.values,this.extent)},e.decodeValue=function(){for(var t=this.reader,e=t.uint32()+t.pos,i=null;t.pos<e;){var r=t.tag()[0];i=1==r?t.string():2==r?t.float():3==r?t.double():4==r?this.convertLong(t.int64()):5==r?this.convertLong(t.uint64()):6==r?this.convertLong(t.sint64()):7==r?t.bool():null}return i},e.convertLong=function(t){switch(this.longType){case"number":return t.toNumber();case"string":return t.toString();case"bigint":return t.toBigInt()}},t}(),T=function(){function t(t,e,i,r,s){for(this.reader=t,this.extent=s,this.type=0,this.properties={},this.geometryOffset=0;t.pos<e;){var a=t.tag(),n=a[0],o=a[1];if(1==n)this.id=t.int64().toString();else if(2==n)for(var l=t.uint32()+t.pos;t.pos<l;){var h=i[t.uint32()],d=r[t.uint32()];this.properties[h]=d}else 3==n?this.type=t.uint32():4==n&&(this.geometryOffset=t.pos,t.skip(o))}}var e=t.prototype;return e.loadGeometry=function(){this.reader.pos=this.geometryOffset;for(var t=this.reader.uint32()+this.reader.pos,e=1,i=0,r=0,s=0,a=[],n=null;this.reader.pos<t;){if(i<=0){var o=this.reader.uint32();e=7&o,i=o>>>3}var l;--i,1==e||2==e?(r+=this.reader.sint32(),s+=this.reader.sint32(),1==e&&(n&&a.push(n),n=[]),null==(l=n)||l.push(new M(r,s))):7==e&&n&&n.push(new M(n[0].x,n[0].y))}return n&&a.push(n),a},e.bbox=function(){this.reader.pos=this.geometryOffset;for(var t=this.reader.uint32()+this.reader.pos,e=0,i=0,r=0,s=0,a=Number.MAX_SAFE_INTEGER,n=Number.MIN_SAFE_INTEGER,o=Number.MAX_SAFE_INTEGER,l=Number.MIN_SAFE_INTEGER;this.reader.pos<t;){if(i<=0){var h=this.reader.uint32();e=7&h,i=h>>>3}--i,1!=e&&2!=e||(r+=this.reader.sint32(),s+=this.reader.sint32(),n=Math.max(r,n),a=Math.min(r,a),l=Math.max(s,l),o=Math.min(s,o))}return[a,o,n,l]},e.toGeoJSON=function(t,e,i){var r,s=this.extent*Math.pow(2,i),a=this.extent*t,n=this.extent*e,o="",l=function(t){return t.map((function(t){return[360*(t.x+a)/s-180,360/Math.PI*Math.atan(Math.exp((180-360*(t.y+n)/s)*Math.PI/180))-90]}))};switch(this.type){case 1:o="Point",r=l(this.asPoints());break;case 2:o="LineString",r=this.asLines().map((function(t){return l(t)}));break;case 3:o="Polygon",(r=this.asPolygons()).forEach((function(t,e){t.forEach((function(t,i){r[e][i]=l(t)}))}))}1==r.length?r=r[0]:o="Multi"+o;var h={type:"Feature",geometry:{type:o,coordinates:r},properties:this.properties};return null!=this.id&&(h.id=this.id),h},e.asPoints=function(){var t=this.loadGeometry().map((function(t){return t[0]}));return 1==this.type?t:null},e.asLines=function(){return 2==this.type?this.loadGeometry():null},e.asPolygons=function(){return 3==this.type?function(t){var e=t.length;if(e<=1)return[t];for(var i=[],r=null,s=0;s<e;s++){var a,n=R(t[s]);0!=n&&(n>0?(r&&i.push(r),r=[t[s]]):null==(a=r)||a.push(t[s]))}return r&&i.push(r),i}(this.loadGeometry()):null},t}();function R(t){for(var e=0,i=0,r=t.length,s=r-1;i<r;s=i++){var a=t[i],n=t[s];e+=(n.x-a.x)*(a.y+n.y)}return e}function G(t,e,i,r){for(var s,a=r,n=i-e>>1,o=i-e,l=t[e],h=t[e+1],d=t[i],c=t[i+1],u=e+3;u<i;u+=3){var p=S(t[u],t[u+1],l,h,d,c);if(p>a)s=u,a=p;else if(p===a){var m=Math.abs(u-n);m<o&&(s=u,o=m)}}a>r&&(s-e>3&&G(t,e,s,r),t[s+2]=a,i-s>3&&G(t,s,i,r))}function S(t,e,i,r,s,a){var n=s-i,o=a-r;if(0!==n||0!==o){var l=((t-i)*n+(e-r)*o)/(n*n+o*o);l>1?(i=s,r=a):l>0&&(i+=n*l,r+=o*l)}return(n=t-i)*n+(o=e-r)*o}function C(t,e,i,r){var s={id:void 0===t?null:t,type:e,geometry:i,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,i=t.type;if("Point"===i||"MultiPoint"===i||"LineString"===i)I(t,e);else if("Polygon"===i||"MultiLineString"===i)for(var r=0;r<e.length;r++)I(t,e[r]);else if("MultiPolygon"===i)for(r=0;r<e.length;r++)for(var s=0;s<e[r].length;s++)I(t,e[r][s])}(s),s}function I(t,e){for(var i=0;i<e.length;i+=3)t.minX=Math.min(t.minX,e[i]),t.minY=Math.min(t.minY,e[i+1]),t.maxX=Math.max(t.maxX,e[i]),t.maxY=Math.max(t.maxY,e[i+1])}function V(t,e,i,r){if(e.geometry){var s=e.geometry.coordinates,a=e.geometry.type,n=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2),o=[],l=e.id;if(i.promoteId?l=e.properties[i.promoteId]:i.generateId&&(l=r||0),"Point"===a)F(s,o);else if("MultiPoint"===a)for(var h=0;h<s.length;h++)F(s[h],o);else if("LineString"===a)W(s,o,n,!1);else if("MultiLineString"===a){if(i.lineMetrics){for(h=0;h<s.length;h++)W(s[h],o=[],n,!1),t.push(C(l,"LineString",o,e.properties));return}E(s,o,n,!1)}else if("Polygon"===a)E(s,o,n,!0);else{if("MultiPolygon"!==a){if("GeometryCollection"===a){for(h=0;h<e.geometry.geometries.length;h++)V(t,{id:l,geometry:e.geometry.geometries[h],properties:e.properties},i,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(h=0;h<s.length;h++){var d=[];E(s[h],d,n,!0),o.push(d)}}t.push(C(l,a,o,e.properties))}}function F(t,e){e.push(k(t[0])),e.push(z(t[1])),e.push(0)}function W(t,e,i,r){for(var s,a,n=0,o=0;o<t.length;o++){var l=k(t[o][0]),h=z(t[o][1]);e.push(l),e.push(h),e.push(0),o>0&&(n+=r?(s*h-l*a)/2:Math.sqrt(Math.pow(l-s,2)+Math.pow(h-a,2))),s=l,a=h}var d=e.length-3;e[2]=1,G(e,0,d,i),e[d+2]=1,e.size=Math.abs(n),e.start=0,e.end=e.size}function E(t,e,i,r){for(var s=0;s<t.length;s++){var a=[];W(t[s],a,i,r),e.push(a)}}function k(t){return t/360+.5}function z(t){var e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function N(t,e,i,r,s,a,n,o){if(r/=e,a>=(i/=e)&&n<r)return t;if(n<i||a>=r)return null;for(var l=[],h=0;h<t.length;h++){var d=t[h],c=d.geometry,u=d.type,p=0===s?d.minX:d.minY,m=0===s?d.maxX:d.maxY;if(p>=i&&m<r)l.push(d);else if(!(m<i||p>=r)){var g=[];if("Point"===u||"MultiPoint"===u)Y(c,g,i,r,s);else if("LineString"===u)L(c,g,i,r,s,!1,o.lineMetrics);else if("MultiLineString"===u)j(c,g,i,r,s,!1);else if("Polygon"===u)j(c,g,i,r,s,!0);else if("MultiPolygon"===u)for(var f=0;f<c.length;f++){var v=[];j(c[f],v,i,r,s,!0),v.length&&g.push(v)}if(g.length){if(o.lineMetrics&&"LineString"===u){for(f=0;f<g.length;f++)l.push(C(d.id,u,g[f],d.tags));continue}"LineString"!==u&&"MultiLineString"!==u||(1===g.length?(u="LineString",g=g[0]):u="MultiLineString"),"Point"!==u&&"MultiPoint"!==u||(u=3===g.length?"Point":"MultiPoint"),l.push(C(d.id,u,g,d.tags))}}}return l.length?l:null}function Y(t,e,i,r,s){for(var a=0;a<t.length;a+=3){var n=t[a+s];n>=i&&n<=r&&(e.push(t[a]),e.push(t[a+1]),e.push(t[a+2]))}}function L(t,e,i,r,s,a,n){for(var o,l,h=O(t),d=0===s?X:B,c=t.start,u=0;u<t.length-3;u+=3){var p=t[u],m=t[u+1],g=t[u+2],f=t[u+3],v=t[u+4],y=0===s?p:m,b=0===s?f:v,x=!1;n&&(o=Math.sqrt(Math.pow(p-f,2)+Math.pow(m-v,2))),y<i?b>i&&(l=d(h,p,m,f,v,i),n&&(h.start=c+o*l)):y>r?b<r&&(l=d(h,p,m,f,v,r),n&&(h.start=c+o*l)):D(h,p,m,g),b<i&&y>=i&&(l=d(h,p,m,f,v,i),x=!0),b>r&&y<=r&&(l=d(h,p,m,f,v,r),x=!0),!a&&x&&(n&&(h.end=c+o*l),e.push(h),h=O(t)),n&&(c+=o)}var w=t.length-3;p=t[w],m=t[w+1],g=t[w+2],(y=0===s?p:m)>=i&&y<=r&&D(h,p,m,g),w=h.length-3,a&&w>=3&&(h[w]!==h[0]||h[w+1]!==h[1])&&D(h,h[0],h[1],h[2]),h.length&&e.push(h)}function O(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function j(t,e,i,r,s,a){for(var n=0;n<t.length;n++)L(t[n],e,i,r,s,a,!1)}function D(t,e,i,r){t.push(e),t.push(i),t.push(r)}function X(t,e,i,r,s,a){var n=(a-e)/(r-e);return t.push(a),t.push(i+(s-i)*n),t.push(1),n}function B(t,e,i,r,s,a){var n=(a-i)/(s-i);return t.push(e+(r-e)*n),t.push(a),t.push(1),n}function P(t,e){for(var i=[],r=0;r<t.length;r++){var s,a=t[r],n=a.type;if("Point"===n||"MultiPoint"===n||"LineString"===n)s=H(a.geometry,e);else if("MultiLineString"===n||"Polygon"===n){s=[];for(var o=0;o<a.geometry.length;o++)s.push(H(a.geometry[o],e))}else if("MultiPolygon"===n)for(s=[],o=0;o<a.geometry.length;o++){for(var l=[],h=0;h<a.geometry[o].length;h++)l.push(H(a.geometry[o][h],e));s.push(l)}i.push(C(a.id,n,s,a.tags))}return i}function H(t,e){var i=[];i.size=t.size,void 0!==t.start&&(i.start=t.start,i.end=t.end);for(var r=0;r<t.length;r+=3)i.push(t[r]+e,t[r+1],t[r+2]);return i}function U(t,e){if(t.transformed)return t;var i,r,s,a=1<<t.z,n=t.x,o=t.y;for(i=0;i<t.features.length;i++){var l=t.features[i],h=l.geometry,d=l.type;if(l.geometry=[],1===d)for(r=0;r<h.length;r+=2)l.geometry.push(Q(h[r],h[r+1],e,a,n,o));else for(r=0;r<h.length;r++){var c=[];for(s=0;s<h[r].length;s+=2)c.push(Q(h[r][s],h[r][s+1],e,a,n,o));l.geometry.push(c)}}return t.transformed=!0,t}function Q(t,e,i,r,s,a){return[Math.round(i*(t*r-s)),Math.round(i*(e*r-a))]}function K(t,e,i,r,s){for(var a=e===s.maxZoom?0:s.tolerance/((1<<e)*s.extent),n={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:i,y:r,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},o=0;o<t.length;o++){n.numFeatures++,J(n,t[o],a,s);var l=t[o].minX,h=t[o].minY,d=t[o].maxX,c=t[o].maxY;l<n.minX&&(n.minX=l),h<n.minY&&(n.minY=h),d>n.maxX&&(n.maxX=d),c>n.maxY&&(n.maxY=c)}return n}function J(t,e,i,r){var s=e.geometry,a=e.type,n=[];if("Point"===a||"MultiPoint"===a)for(var o=0;o<s.length;o+=3)n.push(s[o]),n.push(s[o+1]),t.numPoints++,t.numSimplified++;else if("LineString"===a)q(n,s,t,i,!1,!1);else if("MultiLineString"===a||"Polygon"===a)for(o=0;o<s.length;o++)q(n,s[o],t,i,"Polygon"===a,0===o);else if("MultiPolygon"===a)for(var l=0;l<s.length;l++){var h=s[l];for(o=0;o<h.length;o++)q(n,h[o],t,i,!0,0===o)}if(n.length){var d=e.tags||null;if("LineString"===a&&r.lineMetrics){for(var c in d={},e.tags)d[c]=e.tags[c];d.mapbox_clip_start=s.start/s.size,d.mapbox_clip_end=s.end/s.size}var u={geometry:n,type:"Polygon"===a||"MultiPolygon"===a?3:"LineString"===a||"MultiLineString"===a?2:1,tags:d};null!==e.id&&(u.id=e.id),t.features.push(u)}}function q(t,e,i,r,s,a){var n=r*r;if(r>0&&e.size<(s?n:r))i.numPoints+=e.length/3;else{for(var o=[],l=0;l<e.length;l+=3)(0===r||e[l+2]>n)&&(i.numSimplified++,o.push(e[l]),o.push(e[l+1])),i.numPoints++;s&&function(t,e){for(var i=0,r=0,s=t.length,a=s-2;r<s;a=r,r+=2)i+=(t[r]-t[a])*(t[r+1]+t[a+1]);if(i>0===e)for(r=0,s=t.length;r<s/2;r+=2){var n=t[r],o=t[r+1];t[r]=t[s-2-r],t[r+1]=t[s-1-r],t[s-2-r]=n,t[s-1-r]=o}}(o,a),t.push(o)}}function $(t,e){var i=(e=this.options=function(t,e){for(var i in e)t[i]=e[i];return t}(Object.create(this.options),e)).debug;if(i&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var r=function(t,e){var i=[];if("FeatureCollection"===t.type)for(var r=0;r<t.features.length;r++)V(i,t.features[r],e,r);else V(i,"Feature"===t.type?t:{geometry:t},e);return i}(t,e);this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.time("generate tiles"),this.stats={},this.total=0),r=function(t,e){var i=e.buffer/e.extent,r=t,s=N(t,1,-1-i,i,0,-1,2,e),a=N(t,1,1-i,2+i,0,-1,2,e);return(s||a)&&(r=N(t,1,-i,1+i,0,-1,2,e)||[],s&&(r=P(s,1).concat(r)),a&&(r=r.concat(P(a,-1)))),r}(r,e),r.length&&this.splitTile(r,0,0,0),i&&(console.timeEnd("generate tiles"),JSON.stringify(this.stats))}function tt(t,e,i){return 32*((1<<t)*i+e)+t}$.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},$.prototype.splitTile=function(t,e,i,r,s,a,n){for(var o=[t,e,i,r],l=this.options,h=l.debug;o.length;){r=o.pop(),i=o.pop(),e=o.pop(),t=o.pop();var d=1<<e,c=tt(e,i,r),u=this.tiles[c];if(!u&&(h>1&&console.time("creation"),u=this.tiles[c]=K(t,e,i,r,l),this.tileCoords.push({z:e,x:i,y:r}),h)){h>1&&console.timeEnd("creation");var p="z"+e;this.stats[p]=(this.stats[p]||0)+1,this.total++}if(u.source=t,s){if(e===l.maxZoom||e===s)continue;var m=1<<s-e;if(i!==Math.floor(a/m)||r!==Math.floor(n/m))continue}else if(e===l.indexMaxZoom||u.numPoints<=l.indexMaxPoints)continue;if(u.source=null,0!==t.length){h>1&&console.time("clipping");var g,f,v,y,b,x,w=.5*l.buffer/l.extent,_=.5-w,M=.5+w,Z=1+w;g=f=v=y=null,b=N(t,d,i-w,i+M,0,u.minX,u.maxX,l),x=N(t,d,i+_,i+Z,0,u.minX,u.maxX,l),t=null,b&&(g=N(b,d,r-w,r+M,1,u.minY,u.maxY,l),f=N(b,d,r+_,r+Z,1,u.minY,u.maxY,l),b=null),x&&(v=N(x,d,r-w,r+M,1,u.minY,u.maxY,l),y=N(x,d,r+_,r+Z,1,u.minY,u.maxY,l),x=null),h>1&&console.timeEnd("clipping"),o.push(g||[],e+1,2*i,2*r),o.push(f||[],e+1,2*i,2*r+1),o.push(v||[],e+1,2*i+1,2*r),o.push(y||[],e+1,2*i+1,2*r+1)}}},$.prototype.getTile=function(t,e,i){var r=this.options,s=r.extent,a=r.debug;if(t<0||t>24)return null;var n=1<<t,o=tt(t,e=(e%n+n)%n,i);if(this.tiles[o])return U(this.tiles[o],s);for(var l,h=t,d=e,c=i;!l&&h>0;)h--,d=Math.floor(d/2),c=Math.floor(c/2),l=this.tiles[tt(h,d,c)];return l&&l.source?(a>1&&console.time("drilling down"),this.splitTile(l.source,h,d,c,t,e,i),a>1&&console.timeEnd("drilling down"),this.tiles[o]?U(this.tiles[o],s):null):null};var et=i(3886),it=i.n(et);const rt=t=>null==t,st=t=>!rt(t),at=t=>{switch(s(t)){case"array":case"string":return 0===t.length;case"date":case"boolean":case"number":case"function":case"symbol":return!1;case"object":return 0===Object.keys(t).length;default:return!0}},nt=t=>rt(t)||at(t),ot=t=>!nt(t),lt=function(t){if(!t)throw new Error(`Assert failed: ${(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||""}`)},ht=(Math,512),dt=(Math,Math,t=>Math.pow(2,t)),ct=(t,e,i,r)=>`${r}:${i}/${t}/${e}`,ut=(t,e)=>(t%e+e)%e;class pt{get hash(){return ct(this.x,this.y,this.z,this.wrap)}get wrap(){const t=Math.pow(2,this.z);return Math.floor(this.x/t)}get isRoot(){return 0===this.z}constructor(t,e,i){this.x=e,this.y=i,this.z=t}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}normalize(){const t=Math.pow(2,this.z);return new pt(this.z,ut(this.x,t),ut(this.y,t))}getAncestor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;const e=Math.pow(2,t);return new pt(this.z-t,Math.floor(this.x/e),Math.floor(this.y/e))}getDescendants(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;const e=Math.pow(2,t),i=Array.from({length:e*e});for(let r=0;r<e;r++){const s=r*e;for(let a=0;a<e;a++)i[s+a]=new pt(this.z+t,this.x*e+r,this.y*e+a)}return i}getNeighbor(t,e){const{x:i,y:r,z:s,wrap:a}=this,n=Math.pow(2,s);let o=0,l=0,h=0;return 0===s?(o=i,h=a+t):(o=i+t,l=r+e,h=i+t<0?a-1:i+t>n?a+1:a),l<0||l>=n?null:new pt(s,o,l)}getNeighbors(){const[t,e,i,r,s,a]=[-1,0,1,-1,0,1];return{tl:this.getNeighbor(t,r),tc:this.getNeighbor(e,r),tr:this.getNeighbor(i,r),ml:this.getNeighbor(t,s),mc:this,mr:this.getNeighbor(i,s),bl:this.getNeighbor(t,a),bc:this.getNeighbor(e,a),br:this.getNeighbor(i,a)}}getQuadrant(){return[this.x%2,this.y%2]}isAncestorOf(t){if(this.z>=t.z)return!1;const e=Math.pow(2,t.z-this.z),i=Math.floor(t.x/e),r=Math.floor(t.y/e);return this.x===i&&this.y===r}isDescendantOf(t){return t.isAncestorOf(this)}getPosition(){const t=dt(this.z);return{x:this.x/t,y:this.y/t}}getCenter(){const t=dt(this.z);return{x:(this.x+.5)/t,y:(this.y+.5)/t}}toString(){return`TileCoord: ${this.z}/${this.x}/${this.y}, wrap: ${this.wrap}`}toInfo(){return{z:this.z,x:this.x,y:this.y}}static fromHash(t){const e=(t||"").replace(/^\d+:/,"").split("/").map((t=>Number.parseInt(t,10)));return new pt(e[0],e[1],e[2])}}const mt=pt,gt=i=>{var r;if(i.status>=200&&i.status<=299)return i;if(401===i.status)throw new t(i.statusText);if(404!==i.status){if(i.status>=500)throw new e(null!==(r=i.statusText)&&void 0!==r?r:"Invalid response",i,i.status);return i}};new Set;const ft=t=>"string"===s(t),vt=(t,e,i)=>{if(rt(e))return t;const r=e.split("."),s=r.length-1;let a;for(a=0;a<s;a+=1)t[r[a]]=t[r[a]]||{},t=t[r[a]];return t[r[a]]=i,t},yt=(t,e)=>{if("array"!==s(e)||nt(t)||!a(t))return!1;let i=!0;return e.forEach((e=>{!1===t.hasOwnProperty(e)&&(i=!1)})),i},bt=t=>"number"===s(t),xt=(t,e,i)=>Math.min(Math.max(t,e),i),wt=t=>{if(rt(t))return;let e=0,i=0,r=0;if(ft(t)){const s=t.replace(/^#/,""),a=s.length;3===a?(e=Number.parseInt(s.charAt(0)+s.charAt(0),16),i=Number.parseInt(s.charAt(1)+s.charAt(1),16),r=Number.parseInt(s.charAt(2)+s.charAt(2),16)):6===a&&(e=Number.parseInt(s.charAt(0)+s.charAt(1),16),i=Number.parseInt(s.charAt(2)+s.charAt(3),16),r=Number.parseInt(s.charAt(4)+s.charAt(5),16))}else{const s=Math.floor(t);e=s>>16&255,i=s>>8&255,r=255&s}return{r:e,g:i,b:r,a:1}},_t=t=>yt(t,["r","g","b"]),Mt=t=>yt(t,["h","s","l"]),Zt=t=>yt(t,["h","s","v"]),At=t=>ft(t)&&t.includes("%"),Tt=(t,e,i)=>{const r=At(t),s=i-e;return t=xt(Number.parseFloat(`${t}`),e,i),r&&(t=Number.parseInt(""+t*i,10)/100),Math.abs(t-i)<1e-6?1:t%s/s},Rt=(t,e,i)=>(i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t),Gt=t=>{if(!Mt(t))return;let e,i,r,{h:s,s:a,l:n,a:o}=t;if(s=Tt(s,0,360),a=Tt(a,0,100),n=Tt(n,0,100),o=o||1,0===a)e=i=r=n;else{const t=n<.5?n*(1+a):n+a-n*a,o=2*n-t;e=Rt(o,t,s+1/3),i=Rt(o,t,s),r=Rt(o,t,s-1/3)}return{r:Math.round(255*e),g:Math.round(255*i),b:Math.round(255*r),a:o}},St=t=>{if(!Zt(t))return;let{h:e,s:i,v:r,a:s}=t;e=6*Tt(e,0,360),i=Tt(i,0,100),r=Tt(r,0,100),s=s||1;const a=Math.floor(e),n=e-a,o=r*(1-i),l=r*(1-n*i),h=r*(1-(1-n)*i),d=a%6,c=[h,r,r,l,o,o][d],u=[o,o,h,r,r,l][d];return{r:Math.round(255*[r,l,o,o,h,r][d]),g:Math.round(255*c),b:Math.round(255*u),a:s}};var Ct=1e-6,It="undefined"!=typeof Float32Array?Float32Array:Array;function Vt(){var t=new It(4);return It!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Ft(t,e,i,r){var s=new It(4);return s[0]=t,s[1]=e,s[2]=i,s[3]=r,s}function Wt(t,e,i,r,s){return t[0]=e,t[1]=i,t[2]=r,t[3]=s,t}function Et(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t}function kt(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t[3]=e[3]-i[3],t}function zt(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t}function Nt(t){return Math.hypot(t[0],t[1],t[2],t[3])}function Yt(t,e){var i=e[0],r=e[1],s=e[2],a=e[3],n=i*i+r*r+s*s+a*a;return n>0&&(n=1/Math.sqrt(n)),t[0]=i*n,t[1]=r*n,t[2]=s*n,t[3]=a*n,t}function Lt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function Ot(t,e){var i=t[0],r=t[1],s=t[2],a=t[3],n=e[0],o=e[1],l=e[2],h=e[3];return Math.abs(i-n)<=Ct*Math.max(1,Math.abs(i),Math.abs(n))&&Math.abs(r-o)<=Ct*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(s-l)<=Ct*Math.max(1,Math.abs(s),Math.abs(l))&&Math.abs(a-h)<=Ct*Math.max(1,Math.abs(a),Math.abs(h))}Math,Math,Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)}),Vt();const jt=class{get value(){return null}fromArray(t){return this}toArray(){return[]}},Dt=Vt();class Xt extends jt{get value(){return this._value}get x(){return this.value[0]}set x(t){this.value[0]=t}get y(){return this.value[1]}set y(t){this.value[1]=t}get z(){return this.value[2]}set z(t){this.value[2]=t}get w(){return this.value[3]}set w(t){this.value[3]=t}get elements(){return this.value.length}constructor(t=0,e=0,i=0,r=0){super(),this._value=Ft(t,e,i,r)}fromArray(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=t[e+0],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e+0]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromObject(t){let{x:e,y:i,z:r,w:s}=t;return void 0!==e&&(this.x=e),void 0!==i&&(this.y=i),void 0!==r&&(this.z=r),void 0!==s&&(this.w=s),this}toObject(){return{x:this.x,y:this.y,z:this.z,w:this.w}}set(t,e,i,r){return Wt(this._value,t,e,i,r),this}setScalar(t){return this.set(t,t,t,t)}length(){return Nt(this.value)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this}clone(){return new Xt(this.x,this.y,this.z,this.w)}add(t){return Et(this.value,this.value,t.value),this}addScalar(t){return Wt(Dt,t,t,t,t),Et(this.value,this.value,Dt),this}subtract(t){return kt(this.value,this.value,t.value),this}subtractScalar(t){return Wt(Dt,t,t,t,t),kt(this.value,this.value,Dt),this}multiply(t){return function(t,e,i){t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t[3]=e[3]*i[3]}(this.value,this.value,t.value),this}multiplyScalar(t){return zt(this.value,this.value,t),this}divide(t){return function(t,e,i){t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2],t[3]=e[3]/i[3]}(this.value,this.value,t.value),this}divideScalar(t){return zt(this.value,this.value,1/t),this}distanceTo(t){return e=this.value,i=t.value,Math.hypot(i[0]-e[0],i[1]-e[1],i[2]-e[2],i[3]-e[3]);var e,i}dot(t){return Lt(this.value,t.value)}equals(t){return Ot(this.value,t.value)}lerp(t,e){return function(t,e,i,r){var s=e[0],a=e[1],n=e[2],o=e[3];t[0]=s+r*(i[0]-s),t[1]=a+r*(i[1]-a),t[2]=n+r*(i[2]-n),t[3]=o+r*(i[3]-o)}(this.value,this.value,t.value,e),this}normalize(){return Yt(this.value,this.value),this}scale(t){return zt(this.value,this.value,t),this}applyMatrix4(t){return function(t,e,i){var r=e[0],s=e[1],a=e[2],n=e[3];t[0]=i[0]*r+i[4]*s+i[8]*a+i[12]*n,t[1]=i[1]*r+i[5]*s+i[9]*a+i[13]*n,t[2]=i[2]*r+i[6]*s+i[10]*a+i[14]*n,t[3]=i[3]*r+i[7]*s+i[11]*a+i[15]*n}(this.value,this.value,t.value),this}}const Bt=Xt,Pt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Ht={},Ut=new Map;class Qt{constructor(t=0,e,i,r=1){if(this.r=0,this.g=0,this.b=0,this.a=1,void 0===e&&void 0===i)if(bt(t)&&t<=255)this.setRGB(t,t,t);else if(ft(t)&&Pt[t])this.fromHex(Pt[t]);else{const e=(t=>{if(_t(t))return t;if(Mt(t))return Gt(t);if(Zt(t))return St(t);if(ft(t)){const e=/^(rgb|hsl|hsv)a?\((\d+),\s*([\d%]+),\s*([\d%]+)(?:,\s*(\d+(?:\.\d+)?))?\)$/.exec(`${t}`);if(e&&e.length>=5){const t=e[1],i=st(e[5])?Number.parseFloat(e[5]):1,r=e.slice(2,5).map((t=>At(t)?t:Number.parseInt(t,10)));if("rgb"===t||"rgba"===t)return{r:xt(r[0],0,255),g:xt(r[1],0,255),b:xt(r[2],0,255),a:i};if("hsl"===t)return Gt({h:r[0],s:r[1],l:r[2],a:i});if("hsv"===t)return St({h:r[0],s:r[1],v:r[2],a:i})}else if(/^#?([\dA-Fa-f]+)$/.test(t))return wt(t)}return bt(t)?wt(t):void 0})(t);if(e){const{r:t,g:i,b:r,a:s}=e;this.setRGBA(t,i,r,s)}}else this.setRGBA(t,e,i,r)}fromHex(t){let e=Ht[t];return e||(e=wt(t),Ht[t]=e),this.setRGBA(e.r,e.g,e.b,e.a)}fromHSL(t,e,i){const r=Gt({h:t,s:e,l:i,a:arguments.length>3&&void 0!==arguments[3]?arguments[3]:1});return this.setRGBA(r.r,r.g,r.b,r.a)}fromHSV(t,e,i){const r=St({h:t,s:e,v:i,a:arguments.length>3&&void 0!==arguments[3]?arguments[3]:1});return this.setRGBA(r.r,r.g,r.b,r.a)}setRGB(t,e,i){return this.setRGBA(t,e,i,this.a),this}setRGBA(t,e,i,r){let s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return this.r=s?t:Tt(t,0,255),this.g=s?e:Tt(e,0,255),this.b=s?i:Tt(i,0,255),this.setAlpha(r),this}setAlpha(t){return this.a=t>1?Tt(t,0,255):t,this}lighter(t){const e=t<1?t:t/100;let i=this.toHSL().l;return i+=i*e,i=Math.min(1,i),this}darker(t){const e=t<1?t:t/100;let i=this.toHSL().l;return i-=i*e,i=Math.max(0,i),this}equals(t){return this.r===t.r&&this.g===t.g&&this.b===t.b&&this.a===t.a}toHex(){return(t=>{if(_t(t))return`#${[t.r,t.g,t.b].map((t=>{const e=t.toString(16);return 1===e.length?`0${e}`:e})).join("")}`})(this.toObject(!1))}toHSL(){return(t=>{if(!_t(t))return;let{r:e,g:i,b:r}=t;e=Tt(e,0,255),i=Tt(i,0,255),r=Tt(r,0,255);const s=Math.min(e,i,r),a=Math.max(e,i,r);let n,o;const l=(a+s)/2;if(a===s)n=0,o=0;else{const t=a-s;switch(o=l>.5?t/(2-a-s):t/(a+s),a){case e:n=(i-r)/t+(i<r?6:0);break;case i:n=(r-e)/t+2;break;case r:n=(e-i)/t+4}n/=6}return{h:n,s:o,l:l}})(this.toObject(!1))}toHSV(){return(t=>{if(!_t(t))return;let{r:e,g:i,b:r}=t;e=Tt(e,0,255),i=Tt(i,0,255),r=Tt(r,0,255);const s=Math.max(e,i,r),a=Math.min(e,i,r);let n;const o=s,l=s-a,h=0===s?0:l/s;if(s===a)n=0;else{switch(s){case e:n=(i-r)/l+(i<r?6:0);break;case i:n=(r-e)/l+2;break;case r:n=(e-i)/l+4}n/=6}return{h:n,s:h,v:o}})(this.toObject(!1))}toObject(){const t=arguments.length>0&&void 0!==arguments[0]&&!arguments[0]?255:1;return{r:this.r*t,g:this.g*t,b:this.b*t,a:this.a}}toArray(){return[this.r,this.g,this.b,this.a]}toVector(){return(new Bt).fromArray(this.toArray())}toString(){return`${this.constructor.name}(${this.r}, ${this.g}, ${this.b}, ${this.a}})`}}const Kt=Qt,Jt=(t,e)=>256*(t=xt(Math.floor(t),0,255))+xt(Math.floor(e),0,255),qt=t=>[Jt(255*t.r,255*t.g),Jt(255*t.b,255*t.a)];class $t{get bytesPerElement(){throw new Error("Subclasses of StructArray must override `bytesPerElement`")}constructor(t=1,e=0){this.capacity=-1,this.length=0,this.stride=1,this.stride=t,this.resize(e)}resize(t){t=Math.ceil(t),this.length=t,this.reserve(t)}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.buffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const e=this.data;this.refresh(),e&&this.data.set(e)}}emplace(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=this.length;this.resize(i+1),this.emplaceAt(i,t,e)}emplaceAt(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=!Array.isArray(e),s=t*this.stride;i&&console.warn("emplaceAt",t,e,this.length,this.data);const a=r?1:e.length;if(a!==this.stride)throw new Error(`Element length (${a}) does not match the stride for the StructArray ${this.stride}`);if(r)this.data[s]=e;else{const t=e;for(let e=0;e<a;e++)this.data[s+e]=t[e]}}get(t){const e=t*this.stride;return this.data.slice(e,e+this.stride)}refresh(){throw new Error("Subclasses of StructArray must override `refresh`")}trim(){this.length!==this.capacity&&(this.capacity=this.length,this.buffer=this.buffer.slice(0,this.length*this.bytesPerElement),this.refresh())}clear(){this.length=0}serialize(){return this.trim(),{capacity:this.capacity,length:this.length,stride:this.stride,buffer:this.buffer}}static from(t){const e=Object.create(this.prototype);return e.stride=t.stride,e.buffer=t.buffer,e.length=t.length,e.capacity=t.length,e.refresh(),e}}class te extends $t{get bytesPerElement(){return 2*this.stride}refresh(){this.data=new Int16Array(this.buffer)}}class ee extends $t{get bytesPerElement(){return 2*this.stride}refresh(){this.data=new Uint16Array(this.buffer)}}class ie extends $t{get bytesPerElement(){return 4*this.stride}refresh(){this.data=new Float32Array(this.buffer)}}var re=i(5341),se=i.n(re),ae=i(1476),ne=i.n(ae);const oe=t=>ce/ht*t,le=function(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(3===t)return((t,e)=>{const i={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY};for(let e=0;e<t.length;e++){const r=t[e][0];for(let t=0;t<r.length;t++){const e=r[t];i.minX=Math.min(i.minX,e.x),i.minY=Math.min(i.minY,e.y),i.maxX=Math.max(i.maxX,e.x),i.maxY=Math.max(i.maxY,e.y)}}if(i.minX<ce&&i.minY<ce&&i.maxX>=0&&i.maxY>=0)return Object.assign(Object.assign({},i),{key:e})})(e,i);if(2===t);else if(1===t)return ot(r.collisionBox)?((t,e,i)=>{const r=t[0];return{minX:r.x+i.x1,minY:r.y+i.y1,maxX:r.x+i.x2,maxY:r.y+i.y2,key:e}})(e,i,r.collisionBox):function(t,e){const i=t[0],r=oe(arguments.length>2&&void 0!==arguments[2]?arguments[2]:5);return{minX:i.x-r,minY:i.y-r,maxX:i.x+r,maxY:i.y+r,key:e}}(e,i,r.radius)},he=(t,e,i)=>{const r=i[0].map((t=>[t.x,t.y]));if(ne()([t,e],r)){if(i.length>1)for(let r=1;r<i.length;r++){const s=i[r].map((t=>[t.x,t.y]));if(ne()([t,e],s))return!1}return!0}return!1},de=class{constructor(){this.tree=new(se())}populate(t){const e=[];for(let i=0,r=t.length;i<r;i++){const{type:r,geometry:s,properties:a}=t[i],n=le(r,s,i,a);st(n)&&e.push(n)}this.tree.load(e)}insert(t,e,i){if(!e)return;const r=le(t,e,i);r&&this.tree.insert(r)}query(t,e,i,r,s){const a=this.within({minX:t,minY:e,maxX:t,maxY:e}).filter((a=>{const n=s.features[a.key];if(n.geometry){if(3===n.type){for(let i=0;i<n.geometry.length;i++)if(he(t,e,n.geometry[i]))return!0;return!1}if(1===n.type){const s=n.geometry,a=1-i%1*.5,o=ot(n.properties.collisionBox)?function(t,e,i,r){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;return t>=i.x+r.x1*s&&t<=i.x+r.x2*s&&e>=i.y+r.y1*s&&e<=i.y+r.y2*s}(t,e,s[0],n.properties.collisionBox,a*r):function(t,e,i){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1;const s=oe(arguments.length>3&&void 0!==arguments[3]?arguments[3]:5)*r;return Math.hypot(i.x-t,i.y-e)<=s}(t,e,s[0],n.properties.radius,a*r);return!!o}}return!0}));return a}within(t){return this.tree.search(t)}collides(t){return this.tree.collides(t)}},ce=8192,ue=class{get type(){throw new Error("Subclasses of VectorStore must override `type`")}get isEmpty(){return!1}get featureIndex(){return this._featureIndex}getFeatureVertexRanges(){if(null===this._featureVertexRanges){const t=this.features,e=t.length;this._featureVertexRanges=new Array(e);for(let i=0;i<e;i++)this._featureVertexRanges[i]=t[i].vertexRange}return this._featureVertexRanges}constructor(t){this.features=[],this._featureVertexRanges=null,this.options=Object.freeze(t)}populate(t,e,i){let r=[];const s={},a={},n={};let o=0;const l=i?Object.assign(Object.assign({},this.options),i):Object.assign({},this.options);for(let e=0;e<t.length;e++){const i=t[e],s=i.properties||{};for(const e in s){if(!Object.prototype.hasOwnProperty.call(s,e))continue;const i=s[e];if(!ft(i))continue;const r=i;if(r.startsWith("[")||r.startsWith("{"))try{s[e]=JSON.parse(r)}catch(t){}}s.zoom=this.options.zoom,r.push(i instanceof T?{type:i.type,featureIndex:o++,feature:i,sourceId:void 0,sourceLayerIndex:0,properties:s}:i)}(null==i?void 0:i.paint)&&(r=this.sortFeatures(r,i.paint)),this._featureVertexRanges=null;for(let t=0;t<r.length;t++){const i=this.addFeature(r[t],l);if(i){const{dependencies:t}=i;this.features.push(i),(null==t?void 0:t.glyphs)&&Object.assign(s,t.glyphs),(null==t?void 0:t.icons)&&Object.assign(a,t.icons),(null==t?void 0:t.patterns)&&Object.assign(n,t.patterns),e&&e.insert(i.type,i.geometry,i.featureIndex)}}}sortFeatures(t,e){return t}addFeature(t,e){throw new Error("Subclasses of VectorStore must override `addFeature`")}trim(){throw new Error("Subclasses of VectorStore must override `trim`")}query(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;this._featureIndex||(this._featureIndex=new de,this._featureIndex.populate(this.features)),(t<1||e<1)&&(t=Math.round(t*ce),e=Math.round(e*ce));const s=this.featureIndex.query(t,e,i,r,this);if(s.length>0)return s.map((t=>this.features[t.key].properties))}serialize(){return{type:this.type,id:this.id,options:Object.assign({},this.options),layoutVertexArray:void 0,indexArray:void 0,features:[...this.features]}}static from(t){throw new Error("Subclasses of VectorStore must override `VectorStore.from`")}},pe=Math.pow(2,16)-1,me=function(t){const e=ce/(arguments.length>1&&void 0!==arguments[1]?arguments[1]:ce);return{x:Math.round(t.x*e),y:Math.round(t.y*e)}},ge=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const i=[],r=[],s=[];for(const a of t){if(0===a.length)continue;a!==t[0]&&i.push(r.length/2);const n=[];for(let t=0;t<a.length;t++){const e=r.length/2;r.push(a[t].x,a[t].y),n.push(e)}e&&n.push(n[0]),s.push(n)}return{flattened:r,holeIndices:i,lineList:s}},fe=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,s=at(t)?void 0:t.at(-1);return(!s||s.vertex.length+e>pe)&&(s={vertex:{offset:i,length:0},index:{offset:r,length:0}},t.push(s)),s},ve=(t,e)=>{const i=e.offset*t.stride;return t.data.subarray(i,i+e.length*t.stride)},ye=(t,e,i)=>{const r=i.offset*e.stride,s=i.length*e.stride;return lt(t.length>=s,"[MapsGL] Destination array is too small"),t.set(e.data.subarray(r,r+s)),t},be=(t,e)=>{const i={x:0,y:0};return["x","y"].forEach((r=>{const s=t[r];if("number"==typeof s)i[r]=s;else if("object"==typeof s){const{target:t,offset:a}=s;if(t&&/^text-\d+-(\w+)$/.test(t)){const s=Number.parseInt(t.split("-")[1],10),n=t.split("-")[2],o=e[s];if(o)if("x"===r)switch(n){case"left":i.x=o.x1+a;break;case"right":i.x=o.x2+a;break;case"center":i.x=o.x1+(o.x2-o.x1)/2+a}else switch(n){case"top":i.y=o.y1+a;break;case"bottom":i.y=o.y2+a;break;case"middle":i.y=o.y1+(o.y2-o.y1)/2+a}}}})),i},xe=(t,e)=>e instanceof Float32Array?t.FLOAT:e instanceof Uint16Array?t.UNSIGNED_SHORT:t.UNSIGNED_INT,we=class{constructor(t,e,i,r=!0,s=0,a=0,n=0){if(this.size=1,this.dynamic=!1,this.instanced=!1,this.stride=0,this.offset=0,this.divisor=0,this.needsUpdate=!1,Array.isArray(e))throw new TypeError("[Aeris GL] BufferAttribute: array should be a typed array");let o=0;void 0!==e&&(o=s?e.byteLength/s:e.length/i),this.data=e,this.size=i,this.type=xe(t,e),this.normalized=!0===r,this.stride=s,this.offset=a,this.divisor=n,this.instanced=n>0,this.count=o}},_e=class{constructor(t,e,i){if(Array.isArray(e))throw new TypeError("[Aeris GL] InterleavedBuffer: data should be a typed array");let r=0;void 0!==e&&(r=e.byteLength/i),this.data=e,this.type=xe(t,e),this.stride=i,this.count=r}},Me=class{get identifier(){return this._identifier}set identifier(t){this._identifier=t}get context(){return this._context}set context(t){this._context=t}get gl(){return this.context.gl}constructor(t){this._context=t}};function Ze(){var t=new It(3);return It!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Ae(t,e,i){var r=new It(3);return r[0]=t,r[1]=e,r[2]=i,r}function Te(t,e,i,r){return t[0]=e,t[1]=i,t[2]=r,t}function Re(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}function Ge(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t}function Se(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t}function Ce(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Ie(t,e){var i=t[0],r=t[1],s=t[2],a=e[0],n=e[1],o=e[2],l=Math.sqrt(i*i+r*r+s*s)*Math.sqrt(a*a+n*n+o*o),h=l&&Ce(t,e)/l;return Math.acos(Math.min(Math.max(h,-1),1))}var Ve=Ge;function Fe(){var t=new It(4);return It!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}Ze();var We,Ee=Ft,ke=Lt,ze=Nt,Ne=Yt,Ye=Ot;Ze(),Ae(1,0,0),Ae(0,1,0),Fe(),Fe(),We=new It(9),It!=Float32Array&&(We[1]=0,We[2]=0,We[3]=0,We[5]=0,We[6]=0,We[7]=0),We[0]=1,We[4]=1,We[8]=1;const Le=t=>t*(180/Math.PI);class Oe{get x(){return this._value[0]}set x(t){this._value[0]=t,this.triggerChange()}get y(){return this._value[1]}set y(t){this._value[1]=t,this.triggerChange()}get z(){return this._value[2]}set z(t){this._value[2]=t,this.triggerChange()}get w(){return this._value[3]}set w(t){this._value[3]=t,this.triggerChange()}get value(){return this._value}get elements(){return this.value.length}constructor(t=0,e=0,i=0,r=0){this._changeCallbacks=[],this._value=Ee(t,e,i,r)}fromArray(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this.triggerChange(),this}toArray(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromObject(t){let{x:e,y:i,z:r,w:s}=t;return void 0!==e&&(this.x=e),void 0!==i&&(this.y=i),void 0!==r&&(this.z=r),void 0!==s&&(this.w=s),this.triggerChange(),this}toObject(){return{x:this.x,y:this.y}}fromAxisAngle(t,e){return function(t,e,i){i*=.5;var r=Math.sin(i);t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(i)}(this.value,t.value,e),this.triggerChange(),this}fromEuler(t){return function(t,e,i,r){var s=.5*Math.PI/180;e*=s,i*=s,r*=s;var a=Math.sin(e),n=Math.cos(e),o=Math.sin(i),l=Math.cos(i),h=Math.sin(r),d=Math.cos(r);t[0]=a*l*d-n*o*h,t[1]=n*o*d+a*l*h,t[2]=n*l*h-a*o*d,t[3]=n*l*d+a*o*h}(this.value,Le(t.x),Le(t.y),Le(t.z)),this.triggerChange(),this}fromRotationMatrix(){return this}set(t,e,i,r){return this._value=Ee(t,e,i,r),this.triggerChange(),this}length(){return ze(this.value)}clone(){return(new Oe).copy(this)}copy(t){let e=0;for(;e<this.value.length;)this.value[e]=t.value[e],e+=1;return this.triggerChange(),this}equals(t){return Ye(this.value,t.value)}identity(){return function(t){t[0]=0,t[1]=0,t[2]=0,t[3]=1}(this.value),this.triggerChange(),this}invert(){return function(t,e){var i=e[0],r=e[1],s=e[2],a=e[3],n=i*i+r*r+s*s+a*a,o=n?1/n:0;t[0]=-i*o,t[1]=-r*o,t[2]=-s*o,t[3]=a*o}(this.value,this.value),this.triggerChange(),this}conjugate(){return function(t,e){t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3]}(this.value,this.value),this.triggerChange(),this}normalize(){return Ne(this.value,this.value),this.triggerChange(),this}rotateX(t){return function(t,e,i){i*=.5;var r=e[0],s=e[1],a=e[2],n=e[3],o=Math.sin(i),l=Math.cos(i);t[0]=r*l+n*o,t[1]=s*l+a*o,t[2]=a*l-s*o,t[3]=n*l-r*o}(this.value,this.value,t),this.triggerChange(),this}rotateY(t){return function(t,e,i){i*=.5;var r=e[0],s=e[1],a=e[2],n=e[3],o=Math.sin(i),l=Math.cos(i);t[0]=r*l-a*o,t[1]=s*l+n*o,t[2]=a*l+r*o,t[3]=n*l-s*o}(this.value,this.value,t),this.triggerChange(),this}rotateZ(t){return function(t,e,i){i*=.5;var r=e[0],s=e[1],a=e[2],n=e[3],o=Math.sin(i),l=Math.cos(i);t[0]=r*l+s*o,t[1]=s*l-r*o,t[2]=a*l+n*o,t[3]=n*l-a*o}(this.value,this.value,t),this.triggerChange(),this}dot(t){return ke(this.value,t.value)}angleTo(t){return e=ke(this.value,t.value),Math.acos(2*e*e-1);var e}onChange(t){this._changeCallbacks.includes(t)||this._changeCallbacks.push(t)}triggerChange(){this._changeCallbacks.forEach((t=>t()))}}const je=Oe,De=Ze(),Xe=Ae(1,0,0),Be=Ze();class Pe extends jt{get value(){return this._value}get x(){return this.value[0]}set x(t){this.value[0]=t}get y(){return this.value[1]}set y(t){this.value[1]=t}get z(){return this.value[2]}set z(t){this.value[2]=t}get elements(){return this.value.length}constructor(t=0,e=0,i=0){super(),this._value=Ae(t,e,i)}fromArray(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=t[e+0],this.y=t[e+1],this.z=t[e+2],this}toArray(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e+0]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromObject(t){let{x:e,y:i,z:r}=t;return void 0!==e&&(this.x=e),void 0!==i&&(this.y=i),void 0!==r&&(this.z=r),this}toObject(){return{x:this.x,y:this.y,z:this.z}}set(t,e,i){return Te(this._value,t,e,i),this}setScalar(t){return this.set(t,t,t)}length(){return t=this.value,Math.hypot(t[0],t[1],t[2]);var t}distanceToSquared(t){return(r=(i=t.value)[0]-(e=this.value)[0])*r+(s=i[1]-e[1])*s+(a=i[2]-e[2])*a;var e,i,r,s,a}angle(){return Ie(this.value,Xe)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}clone(){return new Pe(this.x,this.y,this.z)}add(t){return Re(this.value,this.value,t.value),this}addScalar(t){return Te(Be,t,t,t),Re(this.value,this.value,Be),this}subtract(t){return Ge(this.value,this.value,t.value),this}subtractScalar(t){return Te(Be,t,t,t),Ge(this.value,this.value,Be),this}subVectors(t,e){return Ve(this.value,t.value,e.value),this}multiply(t){return function(t,e,i){t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2]}(this.value,this.value,t.value),this}multiplyScalar(t){return Se(this.value,this.value,t),this}divide(t){return function(t,e,i){t[0]=e[0]/i[0],t[1]=e[1]/i[1],t[2]=e[2]/i[2]}(this.value,this.value,t.value),this}divideScalar(t){return Se(this.value,this.value,1/t),this}distanceTo(t){return e=this.value,i=t.value,Math.hypot(i[0]-e[0],i[1]-e[1],i[2]-e[2]);var e,i}angleTo(t){return Ie(this.value,t.value)}dot(t){return Ce(this.value,t.value)}equals(t){return r=(e=this.value)[0],s=e[1],a=e[2],n=(i=t.value)[0],o=i[1],l=i[2],Math.abs(r-n)<=Ct*Math.max(1,Math.abs(r),Math.abs(n))&&Math.abs(s-o)<=Ct*Math.max(1,Math.abs(s),Math.abs(o))&&Math.abs(a-l)<=Ct*Math.max(1,Math.abs(a),Math.abs(l));var e,i,r,s,a,n,o,l}lerp(t,e){return function(t,e,i,r){var s=e[0],a=e[1],n=e[2];t[0]=s+r*(i[0]-s),t[1]=a+r*(i[1]-a),t[2]=n+r*(i[2]-n)}(this.value,this.value,t.value,e),this}normalize(){return function(t,e){var i=e[0],r=e[1],s=e[2],a=i*i+r*r+s*s;a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a}(this.value,this.value),this}scale(t){return Se(this.value,this.value,t),this}rotateX(t){return function(t,e,i,r){var s=[],a=[];s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],a[0]=s[0],a[1]=s[1]*Math.cos(r)-s[2]*Math.sin(r),a[2]=s[1]*Math.sin(r)+s[2]*Math.cos(r),t[0]=a[0]+i[0],t[1]=a[1]+i[1],t[2]=a[2]+i[2]}(this.value,this.value,De,t),this}rotateY(t){return function(t,e,i,r){var s=[],a=[];s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],a[0]=s[2]*Math.sin(r)+s[0]*Math.cos(r),a[1]=s[1],a[2]=s[2]*Math.cos(r)-s[0]*Math.sin(r),t[0]=a[0]+i[0],t[1]=a[1]+i[1],t[2]=a[2]+i[2]}(this.value,this.value,De,t),this}rotateZ(t){return function(t,e,i,r){var s=[],a=[];s[0]=e[0]-i[0],s[1]=e[1]-i[1],s[2]=e[2]-i[2],a[0]=s[0]*Math.cos(r)-s[1]*Math.sin(r),a[1]=s[0]*Math.sin(r)+s[1]*Math.cos(r),a[2]=s[2],t[0]=a[0]+i[0],t[1]=a[1]+i[1],t[2]=a[2]+i[2]}(this.value,this.value,De,t),this}applyEuler(t){const e=(new je).fromEuler(t);return this.applyQuaternion(e)}applyMatrix3(t){return function(t,e,i){var r=e[0],s=e[1],a=e[2];t[0]=r*i[0]+s*i[3]+a*i[6],t[1]=r*i[1]+s*i[4]+a*i[7],t[2]=r*i[2]+s*i[5]+a*i[8]}(this.value,this.value,t.value),this}applyMatrix4(t){return function(t,e,i){var r=e[0],s=e[1],a=e[2],n=i[3]*r+i[7]*s+i[11]*a+i[15];t[0]=(i[0]*r+i[4]*s+i[8]*a+i[12])/(n=n||1),t[1]=(i[1]*r+i[5]*s+i[9]*a+i[13])/n,t[2]=(i[2]*r+i[6]*s+i[10]*a+i[14])/n}(this.value,this.value,t.value),this}applyQuaternion(t){return function(t,e,i){var r=i[0],s=i[1],a=i[2],n=e[0],o=e[1],l=e[2],h=s*l-a*o,d=a*n-r*l,c=r*o-s*n,u=s*c-a*d,p=a*h-r*c,m=r*d-s*h,g=2*i[3];d*=g,c*=g,p*=2,m*=2,t[0]=n+(h*=g)+(u*=2),t[1]=o+d+p,t[2]=l+c+m}(this.value,this.value,t.value),this}negate(){for(let t=0;t<this.elements;++t)this.value[t]=-this.value[t];return this}}const He=Pe;var Ue,Qe=function(t,e,i,r){if("a"===i&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?r:"a"===i?r.call(t):r?r.value:e.get(t)};Ue=new WeakMap;const Ke=class{get type(){return Qe(this,Ue,"f").type}get data(){return Qe(this,Ue,"f").data}set data(t){Qe(this,Ue,"f").data=t}get count(){return Qe(this,Ue,"f").count}get buffer(){return Qe(this,Ue,"f").buffer}set buffer(t){Qe(this,Ue,"f").buffer=t}constructor(t,e,i=!0,r=0,s=0,a){this.size=1,this.dynamic=!1,this.instanced=!1,this.stride=0,this.offset=0,this.divisor=0,this.needsUpdate=!1,Ue.set(this,void 0),function(t,e,i,r,s){if("function"==typeof e||!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");e.set(t,i)}(this,Ue,t),this.size=e,this.normalized=!0===i,this.stride=rt(a)?t.stride:a,this.offset=r,this.divisor=s,this.instanced=s>0}};let Je=1,qe=1;const $e=new He;class ti extends Me{get id(){return this._id}get attributes(){return this._attributes}get index(){return this.attributes.get("index")}get bounds(){return this._bounds}constructor(t,e={}){super(t),this.drawRange={start:0,count:0},this.instancedCount=0,this.isInstanced=!1,this._attributes=new Map,this._VAOs={};const i=t.gl;i||console.error("[Aeris GL] GL context not passed as first argument to Geometry"),this._id=Je,this.drawMode=t.gl.TRIANGLES,Je+=1,t.bindVertexArray(null),t.state.setActiveGeometry(null),Object.keys(e).forEach((t=>{const r=e[t];if(r instanceof we||r instanceof Ke)"index"===t?this.setIndex(r):this.addAttribute(t,r);else{const{size:e,data:s,normalized:a,stride:n,offset:o,divisor:l}=r;if(e&&s){const r=new we(i,s,e,a,n,o,l);"index"===t?this.setIndex(r):this.addAttribute(t,r)}}}))}addAttribute(t,e){const i=this.context.gl;if(e.id=qe,e.target="index"===t?i.ELEMENT_ARRAY_BUFFER:i.ARRAY_BUFFER,e.divisor=e.divisor||0,e.needsUpdate=!1,this.attributes.set(t,e),qe+=1,e.buffer||(e.buffer=i.createBuffer(),this.updateAttribute(e)),e.divisor){if(this.isInstanced=!0,this.instancedCount&&this.instancedCount!==e.count*e.divisor)return console.warn(`[Aeris GL] Geometry has multiple instanced buffers of different length - instancedCount: ${this.instancedCount}, count: ${e.count}, divisor: ${e.divisor}, attribute: ${t}`),this.instancedCount=Math.min(this.instancedCount,e.count*e.divisor),this.instancedCount;this.instancedCount=e.count*e.divisor}else"index"===t?this.drawRange.count=e.count:this.index||(this.drawRange.count=Math.max(this.drawRange.count,e.count))}getAttribute(t){return this.attributes.get(t)}setAttributeData(t,e){const i=this.getAttribute(t);i&&(i.data=e,i.needsUpdate=!0)}updateAttribute(t){const e=this.context.gl;e.bindBuffer(t.target,t.buffer),e.bufferData(t.target,t.data,e.STATIC_DRAW),t.needsUpdate=!1}removeAttribute(t){this.attributes.delete(t)}setIndex(t){if(Array.isArray(t)){const e=t.length>65535?new Uint32Array(t):new Uint16Array(t),i=new we(this.context.gl,e,1);this.addAttribute("index",i)}else t.size=1,this.addAttribute("index",t);this.drawRange.count=this.index.count}setVertices(t){const e=[];for(let i=0,r=t.length;i<r;i+=1){const r=t[i];e.push(r[0],r[1],r[2])}this.addAttribute("position",new we(this.context.gl,new Float32Array(e),3))}setNormals(t){this.addAttribute("normal",new we(this.context.gl,new Float32Array(t),2))}setUVs(t){this.addAttribute("uv",new we(this.context.gl,new Float32Array(t),2))}setColors(t){const e=[];for(let i=0,r=t.length;i<r;i+=1){let r=t[i];r instanceof Kt&&(r=r.toVector().toArray()),e.push(r[0],r[1],r[2],r[3])}this.addAttribute("color",new we(this.context.gl,new Float32Array(e),4))}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}setInstancedCount(t){this.instancedCount=t}createVAO(t){const e=t.attributeOrder,i=this.context.createVertexArray();this.context.bindVertexArray(i),this._VAOs[e]=i,this.bindAttributes(t),this.context.bindVertexArray(null)}bindAttributes(t){const e=this.context.gl;Object.keys(t.attributes).forEach((i=>{const r=this.attributes.get(i);if(!r)return;const s=t.attributes[i];e.bindBuffer(r.target,r.buffer),this.context.state.opts.boundBuffer=r.buffer;let a=1;35674===r.type&&(a=2),35675===r.type&&(a=3),35676===r.type&&(a=4);for(let t=0;t<a;t++)e.vertexAttribPointer(s+t,r.size,r.type,r.normalized,r.stride,r.offset),e.enableVertexAttribArray(s+t),this.context.vertexAttribDivisor(s+t,r.divisor)}));const i=this.attributes.get("index");i&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,i.buffer)}computeBoundingBox(){const{data:t,offset:e=0,stride:i,size:r}=this.attributes.get("position");this.bounds||(this._bounds={min:new He,max:new He,center:new He,scale:new He,radius:Number.POSITIVE_INFINITY});const s=this.bounds,a=s.min,n=s.max,o=s.center,l=s.scale;a.setScalar(+Number.POSITIVE_INFINITY),n.setScalar(Number.NEGATIVE_INFINITY);const h=i||r;for(let i=e,r=t.length;i<r;i+=h){const e=t[i+0],r=t[i+1],s=t[i+2];a.x=Math.min(e,a.x),a.y=Math.min(r,a.y),a.z=Math.min(s,a.z),n.x=Math.max(e,n.x),n.y=Math.max(r,n.y),n.z=Math.max(s,n.z)}return l.subVectors(n,a),o.add(a).add(n).divideScalar(2),s}computeBoundingSphere(){const{data:t,offset:e=0,stride:i,size:r}=this.attributes.get("position");this.bounds||this.computeBoundingBox();let s=0;const a=i||r;for(let i=e,r=t.length;i<r;i+=a)$e.fromArray([...t],i),s=Math.max(s,this.bounds.center.distanceToSquared($e));this.bounds.radius=Math.sqrt(s)}draw(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.drawMode;const i=this.context.gl,{start:r,count:s}=this.drawRange,a=`${this.id}_${t.attributeOrder}`;this.context.state.activeGeometryId!==a&&(this._VAOs[t.attributeOrder]||this.createVAO(t),t.context.bindVertexArray(this._VAOs[t.attributeOrder]),this.context.state.setActiveGeometry(a)),Object.keys(t.attributes).forEach((t=>{const e=this.getAttribute(t);e&&e.needsUpdate&&this.updateAttribute(e)})),this.isInstanced?this.index?this.context.drawElementsInstanced(e,s,this.index.type,this.index.offset+2*r,this.instancedCount):this.context.drawArraysInstanced(e,r,s,this.instancedCount):this.index?i.drawElements(e,s,this.index.type,this.index.offset+2*r):i.drawArrays(e,r,s)}clone(){const t={};this.attributes.forEach(((e,i)=>{t[i]=e}));const e=new ti(this.context,t);return e.drawMode=this.drawMode,e}dispose(){Object.keys(this._VAOs).forEach((t=>{this.context.deleteVertexArray(this._VAOs[t]),delete this._VAOs[t]})),this.attributes.forEach((t=>{this.gl.deleteBuffer(t.buffer)})),this.attributes.clear()}}const ei=ti,ii=class{constructor(){this.layoutVertexArray=new ie(2),this.colorVertexArray=new ie(2),this.indexArray=new ee(3),this.radiusArray=new ie(1),this.strokeWidthArray=new ie(1),this.segments={point:[]},this._geometry=null}get geometry(){return this._geometry}prepareGeometry(t){if(this._geometry){const t=this._geometry.getAttribute("fillColor");return void(t&&(t.needsUpdate=!0))}const e=(new Float32Array).BYTES_PER_ELEMENT,i=new _e(t.gl,this.layoutVertexArray.data,2*e),r=new _e(t.gl,this.colorVertexArray.data,4*e),s=new _e(t.gl,this.radiusArray.data,1*e),a=new _e(t.gl,this.strokeWidthArray.data,1*e),n=new ei(t,{position:{size:2,data:new Float32Array([0,1,0,0,1,0,1,1])},uv:{size:2,data:new Float32Array([0,1,0,0,1,0,1,1])},anchor:new Ke(i,2,!1,0,1),fillColor:new Ke(r,2,!1,0,1),strokeColor:new Ke(r,2,!1,2*e,1),strokeWidth:new Ke(a,1,!1,0,1,1*e),radius:new Ke(s,1,!1,0,1,1*e)});n.setIndex([0,1,2,0,2,3]),this._geometry=n}dispose(){var t;null===(t=this._geometry)||void 0===t||t.dispose(),this._geometry=null}trim(){this.layoutVertexArray.trim(),this.indexArray.trim(),this.colorVertexArray.trim(),this.radiusArray.trim(),this.strokeWidthArray.trim()}updateColorArray(t,e,i){const r=qt(i||new Kt("#000")),s=this.colorVertexArray.data,a=this.colorVertexArray.stride;for(let i=t;i<e;i++){const t=i*a;s[t]=r[0],s[t+1]=r[1]}}updateRadiusArray(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;const r=this.radiusArray.data;for(let s=t;s<e;s++)r[s]=i}updateStrokeWidthArray(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const r=this.strokeWidthArray.data;for(let s=t;s<e;s++)r[s]=i}};class ri extends ue{constructor(){super(...arguments),this.buffers=new ii}get type(){return"circle"}addFeature(t,e){const i=this.buffers,r=t.feature.asPoints(),s=t.feature.extent;if(!r)return;const a=i.layoutVertexArray.length,n=[];for(let t=0;t<r.length;t++){const e=r[t],o=me({x:e.x,y:e.y},s);if(r[t]=o,o.x<0||o.x>=ce||o.y<0||o.y>=ce)continue;const l=fe(i.segments.point,2,a+n.length/2,i.indexArray.length);n.push(o.x,o.y),l.vertex.length+=2,l.index.length+=1}const o=n.length/2;if(0===o)return;i.layoutVertexArray.resize(a+o);const l=i.layoutVertexArray.data,h=i.layoutVertexArray.stride;for(let t=0;t<o;t++)l[(a+t)*h]=n[2*t],l[(a+t)*h+1]=n[2*t+1];const d=2*i.layoutVertexArray.length,c=i.colorVertexArray.length;i.colorVertexArray.resize(d);const u=i.colorVertexArray.data,p=i.colorVertexArray.stride,m=qt(new Kt("#000"));for(let t=c;t<d;t++){const e=t*p;u[e]=m[0],u[e+1]=m[1]}const g=i.layoutVertexArray.length,f=i.radiusArray.length;i.radiusArray.resize(g),i.strokeWidthArray.resize(g);const v=i.radiusArray.data,y=i.strokeWidthArray.data;for(let t=f;t<g;t++)v[t]=10,y[t]=1;return{type:t.type,featureIndex:t.featureIndex,sourceId:t.sourceId,sourceLayerIndex:t.sourceLayerIndex,geometry:r,properties:t.properties,vertexRange:{start:a,end:i.layoutVertexArray.length},radius:10,strokeWidth:1}}trim(){this.buffers.trim()}dispose(){this.buffers.dispose()}serialize(){const t=this.buffers,e=super.serialize();return Object.assign(Object.assign({},e),{layoutVertexArray:t.layoutVertexArray.serialize(),colorVertexArray:t.colorVertexArray.serialize(),indexArray:t.indexArray.serialize(),radiusArray:t.radiusArray.serialize(),strokeWidthArray:t.strokeWidthArray.serialize(),segments:{point:t.segments.point}})}static from(t){const e=new ri(t.options);return at(t)?console.warn("[MapsGL] Cannot create CircleStore from invalid serialized data."):(e.features=t.features,e.buffers.segments.point=t.segments.point,e.buffers.layoutVertexArray=ie.from(t.layoutVertexArray),e.buffers.colorVertexArray=ie.from(t.colorVertexArray),e.buffers.indexArray=ee.from(t.indexArray),e.buffers.radiusArray=ie.from(t.radiusArray),e.buffers.strokeWidthArray=ie.from(t.strokeWidthArray)),e}}const si=ri,ai=(t,e,i)=>{if(null==t||rt(e)||!ft(e))return i;const r=e.split(/["'.[\]]{1,2}/),s=r.length;for(let e=0;e<s;e+=1)if(!at(r[e])&&null==(t=t[r[e]]))return i;return null==t?i:t},ni=t=>"function"===s(t),oi=class{constructor(){this.layoutVertexArray=new ie(2),this.colorVertexArray=new ie(2),this.patternVertexArray=new ie(4),this.pixelRatioArray=new ie(1),this.indexArray=new ee(3),this.indexArray2=new ee(2),this.segments={line:[],triangle:[]},this._geometry={fill:null,stroke:null}}get geometry(){return this._geometry}prepareGeometry(t,e){if(e&&this._geometry.stroke||!e&&this._geometry.fill){const t=e?this._geometry.stroke:this._geometry.fill;if(t)for(const e of t){const t=e.getAttribute("color");t&&(t.needsUpdate=!0)}return}const i=e?this.segments.line:this.segments.triangle,r=e?this.indexArray2:this.indexArray,s=[];for(let e=0;e<i.length;e++){const a=i[e],{vertex:n,index:o}=a,l=ve(this.layoutVertexArray,n),h=ve(this.colorVertexArray,n),d=ve(this.patternVertexArray,n),c=ve(this.pixelRatioArray,n),u=ye(new Uint16Array(o.length*r.stride),r,o),p=new ei(t,{position:{size:2,data:l},color:{size:2,data:h},pattern:{size:4,data:d},pixelRatio:{size:1,data:c},index:{size:1,data:u}});s.push(p)}e?this._geometry.stroke=s:this._geometry.fill=s}dispose(){var t,e;null===(t=this._geometry.fill)||void 0===t||t.forEach((t=>null==t?void 0:t.dispose())),null===(e=this._geometry.stroke)||void 0===e||e.forEach((t=>null==t?void 0:t.dispose())),this._geometry.fill=null,this._geometry.stroke=null}addVertex(t,e){this.layoutVertexArray.emplace([t,e])}trim(){this.layoutVertexArray.trim(),this.indexArray.trim(),this.indexArray2.trim(),this.colorVertexArray.trim(),this.patternVertexArray.trim(),this.pixelRatioArray.trim()}updateColorArray(t,e,i){const r=qt(i||new Kt("#000")),s=this.colorVertexArray.data,a=this.colorVertexArray.stride;for(let i=t;i<e;i++){const t=i*a;s[t]=r[0],s[t+1]=r[1]}}updatePatternArray(t,e,i,r){for(let s=t;s<e;s++)this.patternVertexArray.emplaceAt(s,i),this.pixelRatioArray.emplaceAt(s,r)}};var li=i(6570),hi=i.n(li);class di{constructor(t,e){if(e>t)throw new Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=t,this._minGranularity=e}getGranularityForZoomLevel(t){return Math.max(Math.floor(this._baseZoomGranularity/(1<<t)),this._minGranularity,1)}}class ci{constructor(t){this.fill=new di(t.fill.base,t.fill.min),this.line=new di(t.line.base,t.line.min),this.tile=new di(t.tile.base,t.tile.min),this.stencil=new di(t.stencil.base,t.stencil.min),this.circle=t.circle}}ci.noSubdivision={fill:{base:0,min:0},line:{base:0,min:0},tile:{base:0,min:0},stencil:{base:0,min:0},circle:1},ci.globeSubdivision={fill:{base:128,min:2},line:{base:512,min:0},tile:{base:128,min:32},stencil:{base:128,min:1},circle:3};class ui{constructor(t,e){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._coord=t,this._granularity=e,this._granularityCellSize=ce/e}subdividePolygonInternal(t,e){if(this._used)throw new Error("Subdivision: multiple use not allowed.");this._used=!0;const{flattened:i,holeIndices:r}=function(t){const e=[],i=[];for(const r of t)if(0!==r.length){r!==t[0]&&e.push(i.length/2);for(let t=0;t<r.length;t++)i.push(r[t].x,r[t].y)}return{flattened:i,holeIndices:e}}(t);let s;this._initializeVertices(i);try{const t=hi()(i,r),e=this._convertIndices(i,t);s=this._subdivideTrianglesScanline(e)}catch(t){console.error(t)}let a=[];return e&&(a=this._generateOutline(t)),{verticesFlattened:this._vertexBuffer,indicesTriangles:s,indicesLineList:a}}_getKey(t,e){return(t+=32768)<<16|Math.trunc(e+=32768)}_vertexToIndex(t,e){const i=Math.trunc(t),r=Math.trunc(e),s=this._getKey(i,r);if(this._vertexDictionary.has(s))return this._vertexDictionary.get(s);const a=this._vertexBuffer.length/2;return this._vertexDictionary.set(s,a),this._vertexBuffer.push(i,r),a}_initializeVertices(t){for(let e=0;e<t.length;e+=2)this._vertexToIndex(t[e],t[e+1])}_convertIndices(t,e){const i=[];for(let r=0;r<e.length;r++)i.push(this._vertexToIndex(t[2*e[r]],t[2*e[r]+1]));return i}_subdivideTrianglesScanline(t){if(this._granularity<2)return function(t,e){const i=[];for(let r=0;r<e.length;r+=3){const s=e[r],a=e[r+1],n=e[r+2],o=t[2*s],l=t[2*s+1];(t[2*a]-o)*(t[2*n+1]-l)-(t[2*a+1]-l)*(t[2*n]-o)>0?i.push(s,n,a):i.push(s,a,n)}return i}(this._vertexBuffer,t);const e=[],i=t.length;for(let r=0;r<i;r+=3){const i=[t[r+0],t[r+1],t[r+2]],s=[this._vertexBuffer[2*t[r+0]+0],this._vertexBuffer[2*t[r+0]+1],this._vertexBuffer[2*t[r+1]+0],this._vertexBuffer[2*t[r+1]+1],this._vertexBuffer[2*t[r+2]+0],this._vertexBuffer[2*t[r+2]+1]];let a=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let t=0;t<3;t++){const e=s[2*t],i=s[2*t+1];a=Math.min(a,e),o=Math.max(o,e),n=Math.min(n,i),l=Math.max(l,i)}if(a===o||n===l)continue;const h=Math.floor(a/this._granularityCellSize),d=Math.ceil(o/this._granularityCellSize),c=Math.floor(n/this._granularityCellSize),u=Math.ceil(l/this._granularityCellSize);if(h!==d||c!==u)for(let t=c;t<u;t++){const r=this._scanlineGenerateVertexRingForCellRow(t,s,i);gi(this._vertexBuffer,r,e)}else e.push(...i)}return e}_scanlineGenerateVertexRingForCellRow(t,e,i){const r=t*this._granularityCellSize,s=r+this._granularityCellSize,a=[];for(let t=0;t<3;t++){const n=e[2*t],o=e[2*t+1],l=e[2*(t+1)%6],h=e[(2*(t+1)+1)%6],d=e[2*(t+2)%6],c=e[(2*(t+2)+1)%6],u=l-n,p=h-o,m=0===u,g=0===p,f=(r-o)/p,v=(s-o)/p,y=Math.min(f,v),b=Math.max(f,v);if(!g&&(y>=1||b<=0)||g&&(o<r||o>s)){h>=r&&h<=s&&a.push(i[(t+1)%3]);continue}!g&&y>0&&a.push(this._vertexToIndex(n+u*y,o+p*y));const x=n+u*Math.max(y,0),w=n+u*Math.min(b,1);m||this._generateIntraEdgeVertices(a,n,o,l,h,x,w),!g&&b<1&&a.push(this._vertexToIndex(n+u*b,o+p*b)),(g||h>=r&&h<=s)&&a.push(i[(t+1)%3]),!g&&(h<=r||h>=s)&&this._generateInterEdgeVertices(a,n,o,l,h,d,c,w,r,s)}return a}_generateIntraEdgeVertices(t,e,i,r,s,a,n){const o=r-e,l=s-i,h=0===l,d=h?Math.min(e,r):Math.min(a,n),c=h?Math.max(e,r):Math.max(a,n),u=Math.floor(d/this._granularityCellSize)+1,p=Math.ceil(c/this._granularityCellSize)-1;if(h?e<r:a<n)for(let r=u;r<=p;r++){const s=r*this._granularityCellSize;t.push(this._vertexToIndex(s,i+l*(s-e)/o))}else for(let r=p;r>=u;r--){const s=r*this._granularityCellSize;t.push(this._vertexToIndex(s,i+l*(s-e)/o))}}_generateInterEdgeVertices(t,e,i,r,s,a,n,o,l,h){const d=s-i,c=a-r,u=n-s,p=(l-s)/u,m=(h-s)/u,g=Math.min(p,m),f=Math.max(p,m),v=r+c*g;let y=Math.floor(Math.min(v,o)/this._granularityCellSize)+1,b=Math.ceil(Math.max(v,o)/this._granularityCellSize)-1,x=o<v;const w=0===u;if(w&&(n===l||n===h))return;if(w||g>=1||f<=0){const t=i-n,r=a+(e-a)*Math.min((l-n)/t,(h-n)/t);y=Math.floor(Math.min(r,o)/this._granularityCellSize)+1,b=Math.ceil(Math.max(r,o)/this._granularityCellSize)-1,x=o<r}const _=d>0?h:l;if(x)for(let e=y;e<=b;e++)t.push(this._vertexToIndex(e*this._granularityCellSize,_));else for(let e=b;e>=y;e--)t.push(this._vertexToIndex(e*this._granularityCellSize,_))}_generateOutline(t){const e=[];for(const i of t){const t=mi(i,this._granularity,!0),r=this._pointArrayToIndices(t),s=[];for(let t=1;t<r.length;t++)s.push(r[t-1],r[t]);e.push(s)}return e}_pointArrayToIndices(t){const e=[];for(let i=0;i<t.length;i++){const r=t[i];e.push(this._vertexToIndex(r.x,r.y))}return e}}function pi(t,e,i){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return new ui(e,i).subdividePolygonInternal(t,r)}function mi(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!t||0===t.length)return[];if(t.length<2)return[];const r=t[0],s=t.at(-1),a=i&&(r.x!==s.x||r.y!==s.y);if(e<2)return a?[...t,t[0]]:[...t];const n=Math.floor(ce/e),o=[];o.push({x:t[0].x,y:t[0].y});const l=t.length,h=a?l:l-1;for(let e=0;e<h;e++){const i=t[e],r=e<l-1?t[e+1]:t[0],s=i.x,a=i.y,h=r.x,d=r.y,c=s!==h,u=a!==d;if(!c&&!u)continue;const p=h-s,m=d-a,g=Math.abs(p),f=Math.abs(m);let v=s,y=a;for(;;){const t=p>0?(Math.floor(v/n)+1)*n:(Math.ceil(v/n)-1)*n,e=m>0?(Math.floor(y/n)+1)*n:(Math.ceil(y/n)-1)*n,i=Math.abs(v-t),r=Math.abs(y-e),s=Math.abs(v-h),a=Math.abs(y-d),l=c?i/g:Number.POSITIVE_INFINITY,b=u?r/f:Number.POSITIVE_INFINITY;if((s<=i||!c)&&(a<=r||!u))break;if(l<b&&c||!u){v=t,y+=m*l;const e={x:v,y:y};o.at(-1).x===e.x&&o.at(-1).y===e.y||o.push(e)}else{v+=p*b,y=e;const t={x:v,y:y};o.at(-1).x===t.x&&o.at(-1).y===t.y||o.push(t)}}const b={x:h,y:d};o.at(-1).x===b.x&&o.at(-1).y===b.y||o.push(b)}return o}function gi(t,e,i){if(0===e.length)throw new Error("Subdivision vertex ring is empty.");let r=0,s=t[2*e[0]];for(let i=1;i<e.length;i++){const a=t[2*e[i]];a<s&&(s=a,r=i)}const a=e.length;let n=r,o=(n+1)%a;for(;;){const r=n-1>=0?n-1:a-1,s=(o+1)%a,l=t[2*e[r]],h=t[2*e[s]],d=t[2*e[n]],c=t[2*e[n]+1],u=t[2*e[o]+1];let p=!1;if(l<h)p=!0;else if(l>h)p=!1;else{const i=u-c,a=-(t[2*e[o]]-d),n=c<u?1:-1;((l-d)*i+(t[2*e[r]+1]-c)*a)*n>((h-d)*i+(t[2*e[s]+1]-c)*a)*n&&(p=!0)}if(p){const t=e[r],s=e[n],l=e[o];t!==s&&t!==l&&s!==l&&i.push(l,s,t),n-=1,n<0&&(n=a-1)}else{const t=e[s],r=e[n],l=e[o];t!==r&&t!==l&&r!==l&&i.push(l,r,t),o+=1,o>=a&&(o=0)}if(r===s)break}}class fi extends ue{constructor(){super(...arguments),this.buffers=new oi}get type(){return"fill"}sortFeatures(t,e){const i=e.fillSort();return i?t.filter((t=>ot(ai(t.properties,i.property)))).sort(((t,e)=>{const r=ai(t.properties,i.property),s=ai(e.properties,i.property);return"desc"===i.direction?s-r:r-s})):t}addFeature(t,e){var i,r,s,a,n,o;const l=t.feature.asPolygons(),h=t.feature.extent,d=this.buffers,c=null!==(i=null==e?void 0:e.tileCoord)&&void 0!==i?i:new mt(0,0,0),u=null===(r=null==e?void 0:e.paint)||void 0===r?void 0:r.config,p=null==e?void 0:e.patternDependencies,m=d.layoutVertexArray,g=d.indexArray,f=d.indexArray2,v=d.layoutVertexArray.length;if(!l)return;const y=null!==(a=null===(s=null==e?void 0:e.subdivisionGranularity)||void 0===s?void 0:s.fill.getGranularityForZoomLevel(c.z))&&void 0!==a?a:1;for(let t=0;t<l.length;t++){const e=l[t];for(let t=0;t<e.length;t++){const i=e[t];if(0!==i.length)for(let t=0;t<i.length;t++){const e=me({x:i[t].x,y:i[t].y},h);i[t]=e}}const i=pi(e,c,y),r=i.verticesFlattened,s=i.indicesTriangles,a=i.indicesLineList,n=r.length/2,o=fe(d.segments.triangle,n,m.length,g.length),u=o.vertex.length;if(s.length%3!=0)throw new Error("Invalid indices count");const p=m.length,v=g.length,b=f.length;m.resize(p+n);const x=m.data,w=m.stride;for(let t=0;t<n;t++){const e=(p+t)*w;x[e]=r[2*t],x[e+1]=r[2*t+1]}const _=s.length/3;g.resize(v+_);const M=g.data,Z=g.stride;for(let t=0;t<_;t++){const e=(v+t)*Z;M[e]=u+s[3*t+0],M[e+1]=u+s[3*t+1],M[e+2]=u+s[3*t+2]}o.vertex.length+=n,o.index.length+=_;const A=fe(d.segments.line,n,p,b),T=A.vertex.length;A.vertex.length+=n;let R=0;for(let t=0;t<a.length;t++)R+=a[t].length/2;f.resize(b+R);const G=f.data,S=f.stride;let C=0;for(let t=0;t<a.length;t++){const e=a[t];for(let t=0;t<e.length;t+=2){const i=(b+C)*S;G[i]=T+e[t],G[i+1]=T+e[t+1],C+=1}}A.index.length+=R}const b=d.layoutVertexArray.length,x=d.colorVertexArray.length;d.colorVertexArray.resize(b);const w=d.colorVertexArray.data,_=d.colorVertexArray.stride,M=qt(new Kt("#000"));for(let t=x;t<b;t++){const e=t*_;w[e]=M[0],w[e+1]=M[1]}const Z=d.patternVertexArray.length;d.patternVertexArray.resize(b),d.pixelRatioArray.resize(b);const A=d.patternVertexArray.data,T=d.pixelRatioArray.data,R=d.patternVertexArray.stride;for(let t=Z;t<b;t++){const e=t*R;A[e]=0,A[e+1]=0,A[e+2]=1,A[e+3]=1,T[t]=1}let G,S=null===(n=u.fill)||void 0===n?void 0:n.pattern;return ni(S)&&(S=S(t.properties)),S&&ot(S)&&(G="string"==typeof S?S:S.id,lt(ot(G),`[MapsGL] Icon image id was not provided for pattern: ${JSON.stringify(S)}`),p[G]="string"==typeof S||Object.assign(Object.assign({},S),{pixelRatio:null!==(o=S.pixelRatio)&&void 0!==o?o:1,pattern:!0})),{type:t.type,featureIndex:t.featureIndex,sourceId:t.sourceId,sourceLayerIndex:t.sourceLayerIndex,geometry:l,properties:t.properties,pattern:{id:G},vertexRange:{start:v,end:d.layoutVertexArray.length},dependencies:{patterns:p}}}trim(){this.buffers.trim()}dispose(){this.buffers.dispose()}serialize(){const t=this.buffers,e=super.serialize();return Object.assign(Object.assign({},e),{layoutVertexArray:t.layoutVertexArray.serialize(),colorVertexArray:t.colorVertexArray.serialize(),patternVertexArray:t.patternVertexArray.serialize(),pixelRatioArray:t.pixelRatioArray.serialize(),indexArray:t.indexArray.serialize(),index2Array:t.indexArray2.serialize(),segments:{line:t.segments.line,triangle:t.segments.triangle}})}static from(t){const e=new fi(t.options);return at(t)?console.warn("[MapsGL] Cannot create FillStore from invalid serialized data."):(e.features=t.features,e.buffers.segments.line=t.segments.line,e.buffers.segments.triangle=t.segments.triangle,e.buffers.layoutVertexArray=ie.from(t.layoutVertexArray),e.buffers.colorVertexArray=ie.from(t.colorVertexArray),e.buffers.patternVertexArray=ie.from(t.patternVertexArray),e.buffers.pixelRatioArray=ie.from(t.pixelRatioArray),e.buffers.indexArray=ee.from(t.indexArray),e.buffers.indexArray2=ee.from(t.index2Array)),e}}const vi=fi,yi=[0,1,2,0,2,3],bi=new Float32Array([0,-.5,1,-.5,1,.5,0,.5]),xi="bevel",wi="round",_i="miter",Mi="butt",Zi=class{constructor(){this.layoutVertexArray=new ie(2),this.colorVertexArray=new ie(2),this.indexArray=new ee(2),this.uvArray=new ie(2),this.previousVertexArray=new ie(2),this.nextVertexArray=new ie(2),this.sideArray=new te(1),this.widthArray=new ie(1),this.lengthArray=new ie(1),this.terminalArray=new ie(1),this.countersArray=new ie(1),this.segments={line:[]},this._geometry=null,this._capColorScratch=new Float32Array(0)}get geometry(){return this._geometry}prepareGeometry(t,e,i){var r,s,a;if(this._geometry){const t=this.colorVertexArray.data;for(const e of null!==(r=this._geometry.segments)&&void 0!==r?r:[]){if(!e)continue;const i=e.getAttribute("color");i?i.needsUpdate=!0:e.setAttributeData("color",t)}for(const e of null!==(s=this._geometry.joins)&&void 0!==s?s:[]){if(!e)continue;const i=e.getAttribute("color");i?i.needsUpdate=!0:e.setAttributeData("color",t)}const i=8*e.length;this._capColorScratch.length<i&&(this._capColorScratch=new Float32Array(i));const n=this._capColorScratch;let o=0;for(let i=0;i<e.length;i++){const{start:r,end:s}=e[i];let a=0;for(;a<2;){const e=2*(r+a);n[o++]=t[e],n[o++]=t[e+1],a+=1}for(a=1;a<=2;){const e=2*(s-a);n[o++]=t[e],n[o++]=t[e+1],a+=1}}if(o>0){const t=n.subarray(0,o);for(const e of null!==(a=this._geometry.caps)&&void 0!==a?a:[]){if(!e)continue;const i=e.getAttribute("color"),r=null==i?void 0:i.data;r&&r.length===o?(r.set(t),i.needsUpdate=!0):e.setAttributeData("color",t)}}return}const n=!1;let o=0;for(let t=0;t<e.length;t++){const{start:i,end:r}=e[t];o=Math.max(o,r-i)}const l=function(t,e,i,r){let s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=0;for(let t=0;t<i.length;t++){const{start:e,end:r}=i[t];a=Math.max(a,(r-e)/2)}const n=(new Float32Array).BYTES_PER_ELEMENT,o=e.layoutVertexArray.data,l=4*n,h={position:{size:2,data:bi},color:{size:2,data:e.colorVertexArray.data,stride:4*n,divisor:1},segments:{size:1,data:e.lengthArray.data,divisor:1},terminal:{size:1,data:e.terminalArray.data,divisor:1}};let d=1===a?i.length:e.layoutVertexArray.length/2;if(s&&a>1){const t=1===a?[0,0,2,2]:[0,4,6,10];h.pA={size:2,data:o,stride:l,offset:t[0]*n,divisor:1},h.pB={size:2,data:o,stride:l,offset:t[1]*n,divisor:1},h.pC={size:2,data:o,stride:l,offset:t[2]*n,divisor:1},h.pD={size:2,data:o,stride:l,offset:t[3]*n,divisor:1},d=(e.layoutVertexArray.length-4)/2}else h.pA={size:2,data:o,stride:l,offset:0*n,divisor:1},h.pB={size:2,data:o,stride:l,offset:2*n,divisor:1};const c=new ei(t,h);return c.setIndex(yi),c.setInstancedCount(d),c}(t,this,e,i,n),h=function(t,e,i,r){const s=e.layoutVertexArray.data,a=e.colorVertexArray.data;let n=0;for(let t=0;t<i.length;t++){const{start:e,end:r}=i[t];r-e>2&&(n+=6)}if(0===n)return;const o=new Float32Array(2*n),l=new Float32Array(2*n);let h=0;for(let t=0;t<i.length;t++){const{start:e,end:r}=i[t];if(r-e>2){let t=0;for(;t<3;){const i=e+2*t;o[h]=s[i+0],o[h+1]=s[i+1],l[h]=a[i+0],l[h+1]=a[i+1],h+=2,t+=1}for(t=1;t<=3;){const e=r-2*t;o[h]=s[e+0],o[h+1]=s[e+1],l[h]=a[e+0],l[h+1]=a[e+1],h+=2,t+=1}}}const d=(new Float32Array).BYTES_PER_ELEMENT,c=new ei(t,{position:{size:2,data:new Float32Array([0,-.5,1,-.5,1,.5,0,.5])},color:{size:2,data:l,stride:4*d,divisor:1},pA:{size:2,data:o,stride:4*d,offset:0*d,divisor:1},pB:{size:2,data:o,stride:4*d,offset:2*d,divisor:1},pC:{size:2,data:o,stride:4*d,offset:3*d,divisor:1}});return c.setInstancedCount(o.length/16),c.setIndex([0,1,2,0,2,3]),c}(t,this,e),d=o>2?function(t,e,i,r){let s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const a=r.strokeLineJoin(),n=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r={[xi]:{size:3,position:i?[1,0,0,0,1,0,0,0,1]:[0,0,0,1,0,0,0,1,0],index:void 0,id:void 0},[_i]:{size:4,position:i?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:[0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,1,0],index:[0,1,2,0,2,3],id:void 0},[wi]:{size:2,position:Array.from({length:e}).reduce(((t,i,r)=>{const s=2*Math.PI*r/e;return t.push(.5*Math.cos(s),.5*Math.sin(s)),t}),[0,0]),index:Array.from({length:e}).reduce(((t,e,i)=>(t.push(0,i+1,i+2),t)),[]),id:Array.from({length:e+2}).reduce(((t,e,i)=>(t.push(i),t)),[])}};return r[t]}(a,12),o=(new Float32Array).BYTES_PER_ELEMENT,l=2*o,h=e.layoutVertexArray.data,d=e.colorVertexArray.data,c={position:{size:n.size,data:new Float32Array(n.position)},color:{size:2,data:d,stride:l,divisor:1},pA:{size:2,data:h,stride:l,offset:0*o,divisor:1},pB:{size:2,data:h,stride:l,offset:4*o,divisor:1},pC:{size:2,data:h,stride:l,offset:8*o,divisor:1}};s&&a===wi&&(c.id={size:1,data:new Float32Array(n.id)});const u=new ei(t,c);return u.setInstancedCount(e.layoutVertexArray.length-4),s&&n.index&&u.setIndex(n.index),u}(t,this,e,i,n):void 0,c=function(t,e,i,r){const s=r.strokeLineCap(),a=function(t,e){return{butt:{},square:{size:2,position:[0,.5,0,-.5,.5,-.5,.5,.5],index:[0,1,2,0,2,3]},round:{size:2,position:(t=>{const e=[0,0];for(let t=0;t<=12;t++){const i=-.5*Math.PI+Math.PI*t/12;e.push(.5*Math.cos(i),.5*Math.sin(i))}return e})(),index:(t=>{const e=[];for(let t=0;t<12;t++)e.push(0,t+1,t+2);return e})()}}[t]}(s);if(s===Mi)return;const n=e.layoutVertexArray.data,o=e.colorVertexArray.data,l=4*i.length,h=new Float32Array(2*l),d=new Float32Array(2*l);let c=0;for(let t=0;t<i.length;t++){const{start:e,end:r}=i[t];let s=0;for(;s<2;){const t=2*e+2*s;h[c]=n[t+0],h[c+1]=n[t+1],d[c]=o[t+0],d[c+1]=o[t+1],c+=2,s+=1}for(s=1;s<=2;){const t=2*r-2*s;h[c]=n[t+0],h[c+1]=n[t+1],d[c]=o[t+0],d[c+1]=o[t+1],c+=2,s+=1}}const u=(new Float32Array).BYTES_PER_ELEMENT,p=4*u,m=new ei(t,{position:{size:a.size,data:new Float32Array(a.position)},color:{size:2,data:d,stride:p,divisor:1},pA:{size:2,data:h,stride:p,offset:0*u,divisor:1},pB:{size:2,data:h,stride:p,offset:2*u,divisor:1}});return m.setIndex(a.index),m}(t,this,e,i);this._geometry={segments:[l],terminals:[h],joins:[d],caps:[c]}}addVertex(t,e){this.layoutVertexArray.emplace([t,e])}trim(){this.layoutVertexArray.trim(),this.indexArray.trim(),this.colorVertexArray.trim(),this.uvArray.trim(),this.previousVertexArray.trim(),this.nextVertexArray.trim(),this.sideArray.trim(),this.widthArray.trim(),this.lengthArray.trim(),this.terminalArray.trim(),this.countersArray.trim()}dispose(){var t;this._geometry&&([...this._geometry.segments,...this._geometry.terminals,...null!==(t=this._geometry.joins)&&void 0!==t?t:[],...this._geometry.caps].forEach((t=>null==t?void 0:t.dispose())),this._geometry=null)}updateColorArray(t,e,i){const r=qt(i||new Kt("#000")),s=this.colorVertexArray.data,a=this.colorVertexArray.stride;for(let i=t;i<e;i++){const t=i*a;s[t]=r[0],s[t+1]=r[1]}}};function Ai(t,e){return t.x===e.x&&t.y===e.y}class Ti extends ue{constructor(){super(...arguments),this.buffers=new Zi}get type(){return"line"}addFeature(t,e){const i=this.buffers.layoutVertexArray,r=this.buffers.colorVertexArray,s=i.length;let a;if(2===t.type?a=this.addLines(t,e):3===t.type&&(a=this.addPolygons(t)),i.length===s)return;const n=(i.length-s)/2,o=r.length;r.resize(i.length);const l=r.data,h=r.stride,d=qt(new Kt("#000"));for(let t=o;t<i.length;t++){const e=t*h;l[e]=d[0],l[e+1]=d[1]}const c=this.buffers.lengthArray.length;this.buffers.lengthArray.resize(c+n);const u=this.buffers.lengthArray.data;for(let t=0;t<n;t++)u[c+t]=n;return{type:t.type,featureIndex:t.featureIndex,sourceId:t.sourceId,sourceLayerIndex:t.sourceLayerIndex,geometry:a,properties:t.properties,vertexRange:{start:s,end:i.length}}}addLines(t,e){var i,r,s;const a=null!==(i=null==e?void 0:e.tileCoord)&&void 0!==i?i:new mt(0,0,0),n=t.feature.asLines(),o=t.feature.extent,l=null!==(s=null===(r=null==e?void 0:e.subdivisionGranularity)||void 0===r?void 0:r.line.getGranularityForZoomLevel(a.z))&&void 0!==s?s:1;let h=0,d=0,c=0;for(let e=0;e<n.length;e++){const i=n[e],r=i.length;h+=r;const s=Array.from({length:r});for(let t=0;t<r;t++)s[t]=me(i[t],o);const a=mi(s,l);d+=a.length,c+=this.addLine(a,t,_i,Mi,0,0)}return n}addPolygons(t){const e=this.buffers,i=t.feature.asPolygons(),r=e.layoutVertexArray,s=e.indexArray;for(let a=0;a<i.length;a++){const n=i[a];for(let e=0;e<n.length;e++){const i=n[e];if(0!==i.length)for(let e=0;e<i.length;e++){const r=me({x:i[e].x,y:i[e].y},t.feature.extent);i[e]=r}}const{flattened:o,lineList:l}=ge(n),h=o.length/2,d=r.length;fe(e.segments.line,h,r.length,s.length).vertex.length+=h;for(let t=0;t<l.length;t++){const i=l[t];for(let t=0;t<i.length;t++){const r=i[t],s=o[2*r+0],a=o[2*r+1];e.addVertex(s,a),t>0&&t<i.length-1&&e.addVertex(s,a)}}const c=(r.length-d)/2,u=e.terminalArray.length;e.terminalArray.resize(u+c);const p=e.terminalArray.data;for(let t=0;t<c;t++){let e=0;0===t?e=1:t===c-1&&(e=2),p[u+t]=e}}return i}addLine(t,e,i,r,s,a){const n=this.buffers,o=3===e.feature.type;let l=t.length;for(;l>=2&&Ai(t[l-1],t[l-2]);)l-=1;let h=0;for(;h<l-1&&Ai(t[h],t[h+1]);)h+=1;if(l<(o?3:2))return 0;const d=fe(n.segments.line,10*l,n.layoutVertexArray.length,n.indexArray.length),c=n.layoutVertexArray.length,u=2*l-2*h-2;n.layoutVertexArray.resize(c+u);let p=0;for(let e=h;e<l;e++){const i=t[e];this.addVertex(n.layoutVertexArray,d,c+p,i),p+=1,e>h&&e<l-1&&(this.addVertex(n.layoutVertexArray,d,c+p,i),p+=1)}d.vertex.length+=t.length,d.index.length+=t.length;const m=(n.layoutVertexArray.length-c)/2,g=n.terminalArray.length;n.terminalArray.resize(g+m);const f=n.terminalArray.data;for(let t=0;t<m;t++){let e=0;1===m?e=3:0===t?e=1:t===m-1&&(e=2),f[g+t]=e}return u}addVertex(t,e,i,r){const s=i*t.stride;t.data[s+0]=r.x,t.data[s+1]=r.y,e.vertex.length+=1,e.index.length+=1}dispose(){this.buffers.dispose()}serialize(){const t=this.buffers,e=super.serialize();return Object.assign(Object.assign({},e),{layoutVertexArray:t.layoutVertexArray.serialize(),colorVertexArray:t.colorVertexArray.serialize(),indexArray:t.indexArray.serialize(),uvArray:t.uvArray.serialize(),previousVertexArray:t.previousVertexArray.serialize(),nextVertexArray:t.nextVertexArray.serialize(),sideArray:t.sideArray.serialize(),widthArray:t.widthArray.serialize(),lengthArray:t.lengthArray.serialize(),terminalArray:t.terminalArray.serialize(),countersArray:t.countersArray.serialize(),segments:{line:t.segments.line}})}static from(t){const e=new Ti(t.options);return at(t)?console.warn("[MapsGL] Cannot create LineStore from invalid serialized data."):(e.features=t.features,e.buffers.segments.line=t.segments.line,e.buffers.layoutVertexArray=ie.from(t.layoutVertexArray),e.buffers.colorVertexArray=ie.from(t.colorVertexArray),e.buffers.indexArray=ee.from(t.indexArray),e.buffers.uvArray=ie.from(t.uvArray),e.buffers.previousVertexArray=ie.from(t.previousVertexArray),e.buffers.nextVertexArray=ie.from(t.nextVertexArray),e.buffers.sideArray=te.from(t.sideArray),e.buffers.widthArray=ie.from(t.widthArray),e.buffers.lengthArray=ie.from(t.lengthArray),e.buffers.terminalArray=ie.from(t.terminalArray),e.buffers.countersArray=ie.from(t.countersArray)),e}}const Ri=Ti,Gi=(t,e,i)=>{for(let r=0;r<t.kernings[r];r++){const s=t.kernings[r];if(!(s.first<e||s.second<i))return s.first>e||s.first===e&&s.second>i?0:s.amount}return 0},Si=class{get font(){return this._config.font}constructor(t={}){this._config=Object.freeze(Object.assign({width:Number.POSITIVE_INFINITY,size:1,align:"left",letterSpacing:0,lineHeight:1.4,wordSpacing:0,wordBreak:!1},t))}generateLayout(t){const e=this.font,i=e.common.base,r=this._config.size,s=this._config.lineHeight,a=t.replaceAll(/[\n ]/g,"").length,n={position:{size:3,data:new Float32Array(4*a*3)},uv:{size:2,data:new Float32Array(4*a*2)},id:{size:4,data:new Float32Array(4*a)},index:{size:6,data:new Float32Array(6*a)}},o={position:[],uv:[],id:[],index:[],layout:[]};for(let t=0;t<a;t++)n.id.data[t]=t,n.index.data.set([4*t,4*t+2,4*t+1,4*t+1,4*t+2,4*t+3],6*t),o.id.push(t),o.index.push([4*t,4*t+2,4*t+1,4*t+1,4*t+2,4*t+3]);const l=r/i,h=e.chars.reduce(((t,e)=>(t[e.char]=e,t)),{}),d=[];let c=0,u=0,p=0;const m=()=>{const t={width:0,glyphs:[]};return d.push(t),u=c,p=0,t};let g=m();const f=/\s/,v=/\n/;let y=0;for(;c<t.length&&y<100;){y+=1;const i=t[c];if(!g.width&&f.test(i)){c+=1,u=c,p=0;continue}if(v.test(i)){c+=1,g=m();continue}const s=h[i]||h[" "];if(g.glyphs.length>0){const t=g.glyphs.at(-1)[0],i=Gi(e,s.id,t.id)*l;g.width+=i,p+=i}g.glyphs.push([s,g.width]);let a=0;if(f.test(i)?(u=c,p=0,a+=this._config.wordSpacing*r):a+=this._config.letterSpacing*r,a+=s.xadvance*l,g.width+=a,p+=a,g.width>this._config.width){if(this._config.wordBreak&&g.glyphs.length>1){g.width-=a,g.glyphs.pop(),g=m();continue}if(!this._config.wordBreak&&p!==g.width){const t=c-u+1;g.glyphs.splice(-t,t),c=u,g.width-=p,g=m();continue}}c+=1,y=0}g.width||d.pop();const b={width:Math.max(...d.map((t=>t.width))),height:d.length*r*this._config.lineHeight},{positions:x,uvs:w,layout:_}=this._populateBuffers(n,d,r,s,l,b);return o.position=x,o.uv=w,o.layout=_,{text:t,buffers:n,data:o,layout:_,numChars:a,numLines:d.length,size:b}}_populateBuffers(t,e,i,r,s,a){const n=this.font,o=n.common.scaleW,l=n.common.scaleH,h=this._config.align,d=/\s/,c=[],u=[],p=[];let m=.14*i,g=0;switch(h){case"bottom-left":case"bottom":case"bottom-right":m+=a.height;break;case"left":case"center":case"right":m+=.5*a.height}for(let a=0;a<e.length;a++){const n=e[a];let f=m;for(let e=0;e<n.glyphs.length;e++){const i=n.glyphs[e][0],r={anchor:null,offset:null,uv:null};let a=n.glyphs[e][1];switch(h){case"right":case"top-right":case"bottom-right":a-=n.width;break;case"center":case"top":case"bottom":a-=.5*n.width}if(d.test(i.char))continue;a+=i.xoffset*s,f-=i.yoffset*s;const v=i.width*s,y=i.height*s;t.position.data.set([a,f-y,0,a,f,0,a+v,f-y,0,a+v,f,0],4*g*3),c.push([a,f-y,0,a,f,0,a+v,f-y,0,a+v,f,0]),r.anchor=[a,1-f],r.offset=[v,y];const b=i.x/o,x=i.width/o,w=1-i.y/l,_=i.height/l;t.uv.data.set([b,w-_,b,w,b+x,w-_,b+x,w],4*g*2),u.push([b,w-_,b,w,b+x,w-_,b+x,w]),r.uv=[b,1-w,x,_],f=m,g+=1,p.push(r)}m-=i*r}return{positions:c,uvs:u,layout:p}}};function Ci(){var t=new It(2);return It!=Float32Array&&(t[0]=0,t[1]=0),t}function Ii(t,e){var i=new It(2);return i[0]=t,i[1]=e,i}function Vi(t,e,i){return t[0]=e,t[1]=i,t}function Fi(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t}function Wi(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}function Ei(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t}Ci();const ki=Ii(1,0),zi=Ci();class Ni extends jt{get value(){return this._value}get elements(){return this.value.length}get x(){return this.value[0]}set x(t){this.value[0]=t}get y(){return this.value[1]}set y(t){this.value[1]=t}constructor(t=0,e=0){super(),this._value=Ii(t,e)}fromArray(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.x=t[e],this.y=t[e+1],this}toArray(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t[e]=this.x,t[e+1]=this.y,t}fromObject(t){let{x:e,y:i}=t;return void 0!==e&&(this.x=e),void 0!==i&&(this.y=i),this}toObject(){return{x:this.x,y:this.y}}set(t,e){return Vi(this._value,t,e),this}setScalar(t){return this.set(t,t)}length(){return t=this.value,Math.hypot(t[0],t[1]);var t}angle(){return i=(t=this.value)[0],r=t[1],s=(e=ki)[0],a=e[1],n=Math.sqrt(i*i+r*r)*Math.sqrt(s*s+a*a),Math.acos(Math.min(Math.max(n&&(i*s+r*a)/n,-1),1));var t,e,i,r,s,a,n}copy(t){return this.x=t.x,this.y=t.y,this}clone(){return new Ni(this.x,this.y)}add(t){return Fi(this.value,this.value,t.value),this}addScalar(t){return Vi(zi,t,t),Fi(this.value,this.value,zi),this}subtract(t){return Wi(this.value,this.value,t.value),this}subtractScalar(t){return Vi(zi,t,t),Wi(this.value,this.value,zi),this}multiply(t){return function(t,e,i){t[0]=e[0]*i[0],t[1]=e[1]*i[1]}(this.value,this.value,t.value),this}multiplyScalar(t){return Ei(this.value,this.value,t),this}divide(t){return function(t,e,i){t[0]=e[0]/i[0],t[1]=e[1]/i[1]}(this.value,this.value,t.value),this}divideScalar(t){return Ei(this.value,this.value,1/t),this}distanceTo(t){return e=this.value,i=t.value,Math.hypot(i[0]-e[0],i[1]-e[1]);var e,i}dot(t){return(e=this.value)[0]*(i=t.value)[0]+e[1]*i[1];var e,i}equals(t){return r=(e=this.value)[0],s=e[1],a=(i=t.value)[0],n=i[1],Math.abs(r-a)<=Ct*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(s-n)<=Ct*Math.max(1,Math.abs(s),Math.abs(n));var e,i,r,s,a,n}lerp(t,e){return function(t,e,i,r){var s=e[0],a=e[1];t[0]=s+r*(i[0]-s),t[1]=a+r*(i[1]-a)}(this.value,this.value,t.value,e),this}normalize(){return function(t,e){var i=e[0],r=e[1],s=i*i+r*r;s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s}(this.value,this.value),this}scale(t){return Ei(this.value,this.value,t),this}applyMatrix3(t){return function(t,e,i){var r=e[0],s=e[1];t[0]=i[0]*r+i[3]*s+i[6],t[1]=i[1]*r+i[4]*s+i[7]}(this.value,this.value,t.value),this}applyMatrix4(t){return function(t,e,i){var r=e[0],s=e[1];t[0]=i[0]*r+i[4]*s+i[12],t[1]=i[1]*r+i[5]*s+i[13]}(this.value,this.value,t.value),this}}const Yi=Ni,Li=t=>{const e={x:0,y:0};switch(t){case"right":case"top-right":case"bottom-right":e.x=-.5;break;case"left":case"top-left":case"bottom-left":e.x=.5}switch(t){case"bottom":case"bottom-right":case"bottom-left":e.y=-.5;break;case"top":case"top-right":case"top-left":e.y=.5}return new Yi(e.x,e.y)},Oi=new Kt(0,0,0,1),ji=new Kt(0,0,0,0),Di=class{constructor(){this.layoutVertexArray=new ie(13),this.indexArray=new ee(3),this.opacityVertexArray=new ie(1),this.styleVertexArray=new ie(10),this.segments=[]}get geometry(){return this._geometry}prepareGeometry(t){var e;if(this._geometry){const t=this._geometry.getAttribute("fillColor");t&&(t.needsUpdate=!0);const i=this._geometry.getAttribute("strokeColor");i&&(i.needsUpdate=!0);const r=null!==(e=this._geometry.getAttribute("texCoordOffset"))&&void 0!==e?e:this._geometry.getAttribute("anchor");r&&(r.needsUpdate=!0);const s=this._geometry.getAttribute("opacity");return void(s&&(s.needsUpdate=!0))}const i=this.layoutVertexArray,r=this.opacityVertexArray,s=this.styleVertexArray,a=(new Float32Array).BYTES_PER_ELEMENT,n=new _e(t.gl,i.data,i.stride*a),o=new _e(t.gl,r.data,r.stride*a),l=new _e(t.gl,s.data,s.stride*a),h=new ei(t,{position:{size:2,data:new Float32Array([0,1,0,0,1,0,1,1])},uv:{size:2,data:new Float32Array([0,1,0,0,1,0,1,1])},anchor:new Ke(n,2,!1,0,1),glyph:new Ke(n,4,!1,2*a,1),texCoordOffset:new Ke(n,4,!1,6*a,1),reference:new Ke(n,1,!1,10*a,1),gridPosition:new Ke(n,2,!1,11*a,1),fillColor:new Ke(l,2,!1,0,1),strokeColor:new Ke(l,2,!1,2*a,1),strokeWidth:new Ke(l,1,!1,4*a,1),size:new Ke(l,1,!1,5*a,1),rotation:new Ke(l,1,!1,6*a,1),factor:new Ke(l,1,!1,7*a,1),random:new Ke(l,1,!1,8*a,1),atlasIndex:new Ke(l,1,!1,9*a,1),opacity:new Ke(o,1,!1,0,1)});h.setIndex([0,1,2,0,2,3]),this._geometry=h}trim(){this.layoutVertexArray.trim(),this.indexArray.trim(),this.opacityVertexArray.trim(),this.styleVertexArray.trim()}dispose(){var t;null===(t=this._geometry)||void 0===t||t.dispose(),this._geometry=null}updateTexturePositionArray(t,e,i){for(let r=t;r<e;r++){const t=r*this.layoutVertexArray.stride+6;for(let e=0;e<4;e++)this.layoutVertexArray.data[t+e]=i[e]}}updateOpacityArray(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];var s;if(e<=t)return;const a=this.opacityVertexArray.data,n=this.opacityVertexArray.stride;for(let r=t;r<e;r++)a[r*n]=i;r&&(null===(s=this.geometry)||void 0===s||s.setAttributeData("opacity",this.opacityVertexArray.data))}updateStyleArray(t,e,i,r,s,a,n,o,l,h){if(e<=t)return;const d=qt(i||Oi),c=qt(r||ji),u=this.styleVertexArray.data,p=this.styleVertexArray.stride,m=d[0],g=d[1],f=c[0],v=c[1];for(let i=t;i<e;i++){const t=i*p;u[t+0]=m,u[t+1]=g,u[t+2]=f,u[t+3]=v,u[t+4]=s,u[t+5]=a,u[t+6]=n,u[t+7]=o,u[t+8]=l,u[t+9]=h}}};class Xi extends ue{get type(){return"symbol"}constructor(t){super(t),this.includesSDFIcons=!1,this.text=new Di,this.icon=new Di,this.collisionArrays=[]}addFeature(t,e){var i,r;e=Object.assign({glyphDependencies:{},iconDependencies:{}},e);const s=t.feature.asPoints(),a=t.feature.extent,n=null==e?void 0:e.paint,o=null===(i=null==e?void 0:e.paint)||void 0===i?void 0:i.config,l=[];let h;const d=null===(r=null==o?void 0:o.icon)||void 0===r?void 0:r.shader,c=null==n?void 0:n.textLineCount();for(let e=0;e<c;e++){let i=null==n?void 0:n.textValue(t.properties,e);ot(i)?("number"==typeof i&&(i=`${i}`),"string"==typeof i&&l.push(i)):l.push("")}if((null==o?void 0:o.icon)&&(h=o.icon.type||o.icon.image||o.icon.shader||o.icon.atlas,ni(h)&&(h=h(t.properties))),!s||!0!==e.includeEmptySymbolData&&0===(null==l?void 0:l.length)&&!h&&!d)return;let u,p,m;const g=e.glyphDependencies,f=e.iconDependencies;for(let i=0;i<s.length;i++){const r=s[i],n=me({x:r.x,y:r.y},a);if(s[i]=n,n.x<0||n.x>=ce||n.y<0||n.y>=ce)continue;m={x:n.x,y:n.y};const o=this.features.find((t=>{var e;return t.anchor.x===m.x&&t.anchor.y===m.y&&(null===(e=t.text)||void 0===e?void 0:e.length)>0&&t.text[0].value===l[0]}));if((null==l?void 0:l.length)>0&&!o){const{symbol:i,glyphDependencies:r}=this.addSymbolAtAnchor(m,Object.assign(Object.assign({},t),{anchor:m,geometry:s,paint:e.paint,text:l.map(((t,e)=>({value:t,index:e,anchor:m,padding:[0,0],offset:[0,0],vertexRange:void 0,atlasIndex:void 0,collisionBox:void 0}))),icon:null}),e);u=i.text,r&&Object.assign(g,r)}if(ot(h)){const{symbol:i,iconDependencies:r}=this.addSymbolAtAnchor(m,Object.assign(Object.assign({},t),{anchor:m,geometry:s,paint:e.paint,text:void 0,icon:{image:h,anchor:m,padding:[0,0],offset:[0,0],vertexRange:void 0,atlasIndex:void 0,collisionBox:void 0},collisionBox:void 0}),e);p=i.icon,r&&Object.assign(f,r)}}return!0===e.includeEmptySymbolData||u||p?{key:n.symbolKey(t.properties),type:t.type,featureIndex:t.featureIndex,sourceId:t.sourceId,sourceLayerIndex:t.sourceLayerIndex,geometry:s,anchor:m,properties:t.properties,vertexRange:void 0,paint:e.paint,text:u,icon:p,dependencies:{glyphs:g,icons:f}}:void 0}addSymbolAtAnchor(t,e,i){if(!(t.x<0||t.x>=ce||t.y<0||t.y>=ce))return e.icon?this.addIcon(t,e,i.iconDependencies):e.text?this.addText(t,e,i.glyphDependencies):void 0}addSymbols(t,e,i,r,s,a){const n=e.layoutVertexArray,o=e.opacityVertexArray,l=e.styleVertexArray,h=fe(e.segments,4*i.length,n.length,e.indexArray.length);for(let e=0;e<i.length;e++){const{offset:d,texture:c,style:u}=i[e],{strokeWidth:p,size:m,opacity:g,rotation:f,factor:v}=u;n.emplace([t.x,t.y,d.x,d.y,d.w,d.h,c.x,c.y,c.w,c.h,r,s,a]),o.emplace(g),l.emplace([0,0,0,0,p,m,f,v,Math.random(),u.atlasIndex]),h.vertex.length+=2,h.index.length+=1}}addIcon(t,e,i){var r;const s=e.properties,a=e.paint,n=a.iconImage(s),o=a.iconShader(s);if(ot(n)){const t="string"==typeof n?n:n.id;lt(ot(t),`[MapsGL] Icon image id was not provided for symbol: ${JSON.stringify(n)}`),i[t]="string"==typeof n||Object.assign(Object.assign({},n),{pixelRatio:null!==(r=n.pixelRatio)&&void 0!==r?r:1}),e.icon.image=t}return e.icon.vertexRange={start:0,end:0},ot(o)&&this.layoutIcon(e,{}),{symbol:e,iconDependencies:i}}addText(t,e,i){const r=e.properties,s=e.paint;for(let t=0;t<e.text.length;t++){const a=e.text[t].value||"",n=s.textFont(r,t)||"Inter-Regular",o=s.textTransform(r,t)||"none";let l=a;"none"!==o&&("uppercase"===o?l=l.toUpperCase():"lowercase"===o?l=l.toLowerCase():"capitalize"===o&&(l=l.replaceAll(/\b\w/g,(t=>t.toUpperCase())))),void 0===i[n]&&(i[n]=[]);const h=i[n];for(let t=0;t<l.length;t++)a.charAt(t),h.push(a.charCodeAt(t));e.text[t].value=l,e.text[t].vertexRange={start:0,end:0}}return{symbol:e,glyphDependencies:i}}layoutSymbols(t,e){for(let i=0;i<this.features.length;i++){const r=this.features[i],s=r.text,a=r.icon,n={x1:Number.POSITIVE_INFINITY,y1:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY,anchorPointX:r.anchor.x,anchorPointY:r.anchor.y};if(s){this.layoutText(r,e);for(let t=0;t<s.length;t++){const e=s[t];e.collisionBox&&(n.x1=Math.min(n.x1,e.collisionBox.x1),n.y1=Math.min(n.y1,e.collisionBox.y1),n.x2=Math.max(n.x2,e.collisionBox.x2),n.y2=Math.max(n.y2,e.collisionBox.y2))}}((null==a?void 0:a.image)||(null==a?void 0:a.shader))&&(this.layoutIcon(r,t),a.collisionBox&&(n.x1=Math.min(n.x1,a.collisionBox.x1),n.y1=Math.min(n.y1,a.collisionBox.y1),n.x2=Math.max(n.x2,a.collisionBox.x2),n.y2=Math.max(n.y2,a.collisionBox.y2))),r.collisionBox=n}}layoutText(t,e){var i,r,s;const a=t.properties,n=this.text,o=[];for(let l=0;l<t.text.length;l++){const h=t.text[l].value,d=t.paint,c=t.text[l].anchor,u=ce/ht,p=d.textFont(a,l)||"Inter-Regular",m=d.textSize(a,l)||12,g=d.textAlign(a,l)||"center",f=Li(d.textAnchor(a,l)||"center"),v=d.textLineHeight(a,l)||1,y=d.textLetterSpacing(a,l)||0,b=d.textMaxWidth(a,l)||100,x=d.textOffset(a,l),w=d.textRotation(a,l)||0,_=d.symbolAllowOverlap()||!1,M=(d.symbolFadeOpacity(a),d.iconFactor(a)),Z={x:0,y:0};if(x){const{x:t,y:e}=be(x,o);Z.x=t,Z.y=e}const A=null===(r=null===(i=e[p])||void 0===i?void 0:i.ranges)||void 0===r?void 0:r[0];if(nt(A))return;const T=A.spec;if(!T)throw new Error(`[MapsGL] Missing font spec for font "${p}"`);const R=new Si({font:T,size:m,width:b,align:g,lineHeight:Math.max(0,v),letterSpacing:y}).generateLayout(`${h}`),{position:G,layout:S}=R.data,C=[],I={x1:Number.POSITIVE_INFINITY,y1:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY,anchorPointX:c.x,anchorPointY:c.y};for(let t=0;t<G.length;t++){const e=S[t],i={box:{tl:{x:e.anchor[0],y:e.anchor[1]},tr:{x:e.anchor[0]+e.offset[0],y:e.anchor[1]},bl:{x:e.anchor[0],y:e.anchor[1]+e.offset[1]},br:{x:e.anchor[0]+e.offset[0],y:e.anchor[1]+e.offset[1]}},offset:{x:e.anchor[0]+Z.x,y:e.anchor[1]+Z.y,w:e.offset[0],h:e.offset[1]},texture:{x:e.uv[0],y:e.uv[1],w:e.uv[2],h:e.uv[3]},style:{fillColor:d.fillColor(a)||new Kt("#000"),strokeColor:d.strokeColor(a)||new Kt("#000"),strokeWidth:d.strokeThickness(a)||0,size:m,opacity:_?1:0,rotation:w||0,factor:st(M)?M:0,atlasIndex:0}};I.x1=Math.min(I.x1,e.anchor[0]),I.y1=Math.min(I.y1,e.anchor[1]),I.x2=Math.max(I.x2,e.anchor[0]+e.offset[0]),I.y2=Math.max(I.y2,e.anchor[1]+e.offset[1]),C.push(i)}const V=I.x2-I.x1,F=I.y2-I.y1;C.forEach((t=>{t.offset.x+=V*f.x,t.offset.y+=F*f.y,I.x1=Math.min(I.x1,t.offset.x),I.y1=Math.min(I.y1,t.offset.y),I.x2=Math.max(I.x2,t.offset.x+t.offset.w),I.y2=Math.max(I.y2,t.offset.y+t.offset.h)}));const W=n.layoutVertexArray.length;this.addSymbols(c,n,C,t.featureIndex,0,0),t.text[l].vertexRange={start:W,end:n.layoutVertexArray.length},t.text[l].atlasIndex=null===(s=A.atlas)||void 0===s?void 0:s.index,o.push(Object.assign({},I)),I.x1*=u,I.y1*=u,I.x2*=u,I.y2*=u,t.text[l].collisionBox=I}this.collisionArrays.push({textBox:t.text[0].collisionBox,textFeatureIndex:t.featureIndex})}layoutIcon(t,e){var i,r;const s=t.properties,a=this.icon,n=e[t.icon.image]||{size:{width:20,height:20},position:{x:0,y:0,w:1,h:1},pixelRatio:1,sdf:!1},o=ce/ht,l=n.pixelRatio||1,h=t.paint,d=t.icon.anchor,c=h.iconSize(s)||{width:n.size.width/l,height:n.size.height/l},u=h.iconRotation(s),p=h.iconOffset(s),m=Li(h.iconAnchor(s)||"center"),g=h.iconFactor(s),f=[],v=c.width,y=c.height,b=c.width/(n.size.width/l),x={x1:Number.POSITIVE_INFINITY,y1:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY,anchorPointX:d.x,anchorPointY:d.y};n.position||console.warn("[MapsGL] Missing icon position for icon:",t.icon.image,e),n.sdf&&(this.includesSDFIcons=!0);const w={box:{tl:{x:d.x,y:d.y},tr:{x:d.x+v,y:d.y},bl:{x:d.x,y:d.y+y},br:{x:d.x+v,y:d.y+y}},offset:{x:-v/2+p.x,y:-y/2+p.y,w:v,h:y},texture:n.position?{x:n.position.x,y:n.position.y,w:n.position.w,h:n.position.h}:{x:0,y:0,w:1,h:1},style:{fillColor:h.fillColor(s)||new Kt("#000"),strokeColor:h.strokeColor(s)||new Kt("#000"),strokeWidth:h.strokeThickness(s)||0,size:b,opacity:1,rotation:u||0,factor:st(g)?g:0,atlasIndex:0}};w.offset.x+=v*m.x,w.offset.y+=y*m.y,f.push(w),x.x1=Math.min(x.x1,w.offset.x),x.y1=Math.min(x.y1,w.offset.y),x.x2=Math.max(x.x2,w.offset.x+w.offset.w),x.y2=Math.max(x.y2,w.offset.y+w.offset.h);const _=null!==(i=t.properties.gridRow)&&void 0!==i?i:0,M=null!==(r=t.properties.gridCol)&&void 0!==r?r:0,Z=a.layoutVertexArray.length;this.addSymbols(d,a,f,t.featureIndex,_,M),t.icon.vertexRange={start:Z,end:a.layoutVertexArray.length},x.x1*=o,x.y1*=o,x.x2*=o,x.y2*=o,t.icon.collisionBox=x,this.collisionArrays.push({iconBox:x,iconFeatureIndex:t.featureIndex})}trim(){this.text.trim(),this.icon.trim()}dispose(){this.text.dispose(),this.icon.dispose()}serialize(){const t=super.serialize();return Object.assign({features:this.features.map((t=>(t.paint=void 0,t))),text:{layoutVertexArray:this.text.layoutVertexArray.serialize(),indexArray:this.text.indexArray.serialize(),opacityVertexArray:this.text.opacityVertexArray.serialize(),styleVertexArray:this.text.styleVertexArray.serialize(),segments:[...this.text.segments]},icon:{layoutVertexArray:this.icon.layoutVertexArray.serialize(),indexArray:this.icon.indexArray.serialize(),opacityVertexArray:this.icon.opacityVertexArray.serialize(),styleVertexArray:this.icon.styleVertexArray.serialize(),segments:[...this.icon.segments]},collisionArrays:[...this.collisionArrays],includesSDFIcons:this.includesSDFIcons},t)}static from(t){const e=new Xi(t.options);if(e.id=t.id,e.includesSDFIcons=t.includesSDFIcons,at(t))console.warn("[MapsGL] Cannot create SymbolStore from invalid serialized data.");else{const i=new Di;i.layoutVertexArray=ie.from(t.text.layoutVertexArray),i.indexArray=ee.from(t.text.indexArray),i.opacityVertexArray=ie.from(t.text.opacityVertexArray),i.styleVertexArray=ie.from(t.text.styleVertexArray),i.segments=t.text.segments,e.text=i;const r=new Di;r.layoutVertexArray=ie.from(t.icon.layoutVertexArray),r.indexArray=ee.from(t.icon.indexArray),r.opacityVertexArray=ie.from(t.icon.opacityVertexArray),r.styleVertexArray=ie.from(t.icon.styleVertexArray),r.segments=t.icon.segments,e.icon=r,e.collisionArrays=t.collisionArrays,e.features=t.features}return e}}const Bi=Xi;class Pi extends ue{get type(){return"empty"}static from(t){return new Pi({tile:t.options.tile,sourceLayerIndex:t.options.sourceLayerIndex,sourceId:t.options.sourceId,zoom:t.options.zoom})}}const Hi=Pi,Ui=t=>ot(t)&&ft(t)?t.replace(/(?:^|\s)\S/g,(t=>t.toUpperCase())):"",Qi=/^(async\s+)?(function(\s+\w+)?\s*\(|\(?[\s\w,]*\)?\s*=>)/,Ki=["constructor","__proto__","prototype","globalThis","window","document","self","top","parent","frames","opener","location","import(","eval(","Function(","XMLHttpRequest","fetch("];let Ji=null,qi=!1,$i=!1;function tr(){$i||(console.warn("[MapsGL] Style functions are deprecated as of v1.9.0. Use style expressions instead. Support for style functions will be removed in a future release."),$i=!0)}const er=t=>{let e=t.toString().replaceAll("://",":\\/\\/").replaceAll(/\/{2}.*/g,"").replaceAll("\n","").replaceAll("\t","").replaceAll(/\s+/g," ").trim();return e=function(t){const e=t.match(/^(.*?=>)\s*([^{].*)$/);if(!e)return t;const[,i,r]=e,s=r.trim();return s?`${i} { return ${s}; }`:t}(e),t.name&&new RegExp(`^\\s*${t.name}\\s*([(])`).test(e)&&(e=`function ${e}`),JSON.stringify(`${Ji?`_FUNC${Ji}:`:"_FUNC"}${e}`)},ir=(t,e)=>{if("string"!=typeof e||!e.startsWith("_FUNC"))return e;if(Ji){const t=`_FUNC${Ji}:`;if(e.startsWith(t)){const i=e.slice(t.length);if(!Qi.test(i.trim()))throw new Error("[MapsGL] Rejected invalid serialized function source");return new Function(`'use strict'; return (${i}).apply(this, arguments);`)}}qi||(console.warn("[MapsGL] Deserializing a function without session-token verification. This path is deprecated and will be removed in a future version."),qi=!0);const i=e.replace(/^_FUNC/,"");if(!function(t){const e=t.trim();if(!e||e.length>4e3)return!1;if(!Qi.test(e))return!1;const i=e.toLowerCase();return!Ki.some((t=>i.includes(t.toLowerCase())))}(i))throw new Error("[MapsGL] Rejected unsafe serialized function source");return new Function(`'use strict'; return (${i}).apply(this, arguments);`)},rr=(t,e)=>{null!=e&&Object.keys(e).forEach((i=>{if(null!=(r=e[i])&&"object"==typeof r&&"function"==typeof r.resolve)if(t[i]=e[i].getRaw(),a(t[i])){const e={};rr(e,t[i]),t[i]=e}else ni(t[i])&&(tr(),t[i]=er(t[i]));else Array.isArray(e[i])?t[i]=e[i].map((t=>{if(a(t)){const e={};return rr(e,t),e}return ni(t)?(tr(),er(t)):t})):a(e[i])?(t[i]={},rr(t[i],e[i])):ni(e[i])?["value","transform","key","rank","size","factor","offset","image","pattern"].includes(i)&&(tr(),t[i]=er(e[i])):t[i]=e[i];var r}))},sr=(t,e)=>{if(rt(e))throw new Error("[MapsGL] Serialized style is null or undefined");Object.keys(e).forEach((i=>{if(Array.isArray(e[i]))t[i]=e[i].map((t=>{if(st(t)&&a(t)){const e={};return sr(e,t),e}return/_FUNC/.test(t)?JSON.parse(t,ir):t}));else if(a(e[i]))t[i]={},sr(t[i],e[i]);else if(/_FUNC/.test(e[i]))try{t[i]=JSON.parse(e[i],ir)}catch(t){console.error(`[MapsGL] Failed to deserialize paint style function '${i}':`,t)}else t[i]=e[i]}))},ar=(t,e,i,r)=>{let s=r;if(i=i||{},rt(e))return s;if(function(t){return a(t)&&"function"==typeof t.resolve}(e))s=e.resolve(i);else if(a(e)){if("object"===t||"any"===t)return e;if("color"===t&&e instanceof Kt)return e;if(e.property)if(e.mapping){const t=ai(i,e.property);s=e.mapping[t]}else s=ai(i,e.property)}else s=ni(e)?e(i):e;if("color"===t){if(s instanceof Kt)return s;s=bt(n=s)||ft(n)?function(t){const e="string"==typeof t?`s:${t.trim().toLowerCase()}`:`n:${t}`,i=Ut.get(e);if(i)return new Qt(i.r,i.g,i.b,i.a||1);const r=new Qt(t).toObject(!1);if(Ut.size>=256){const t=Ut.keys().next().value;t&&Ut.delete(t)}return Ut.set(e,r),new Qt(r.r,r.g,r.b,r.a||1)}(n):n instanceof Qt?n:a(n)&&st(n.r)&&st(n.g)&&st(n.b)&&st(n.a)?new Qt(n.r,n.g,n.b,n.a):null}var n;return s},nr=t=>3.280839895*t,or=t=>12*nr(t),lr=t=>25.4*t,hr=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=0;return i=Math.pow(Math.pow(10,t/10)/200,5/8),e?i/3600:i},dr=t=>{switch(t){case"inHg":case"in":case"in/hr":return 2;case"cm":return 1;default:return 0}},cr=(t,e,i,r)=>{switch(t){case"temperature":if("C"===i&&"F"===r)return 1.8*e+32;if("F"===i&&"C"===r)return 5/9*(e-32);break;case"temperature-change":if("C"===i&&"F"===r)return 1.8*e;if("F"===i&&"C"===r)return.555*e;break;case"speed":if("km/h"===i&&"mph"===r)return.6213712*e;if("mph"===i&&"km/h"===r)return 1.609344*e;if("m/s"===i&&"mph"===r)return 2.236936*e;if("m/s"===i&&"km/h"===r)return 3.6*e;if("mph"===i&&"m/s"===r)return.45*e;if("km/h"===i&&"m/s"===r)return.2777777778*e;break;case"pressure":if("mb"===i&&"hPa"===r)return 100*e;if("mb"===i&&"inHg"===r)return.029529983071445*e;if("hPa"===i&&"mb"===r)return.01*e;if("inHg"===i&&"mb"===r)return 33.86389*e;break;case"distance":if("m"===i&&"km"===r)return.001*e;if("m"===i&&"ft"===r)return nr(e);if("m"===i&&"in"===r)return or(e);if("m"===i&&"mi"===r)return 62e-5*e;if("km"===i&&"m"===r)return 1e3*e;if("ft"===i&&"m"===r)return.3048*e;if("km"===i&&"mi"===r)return.62*e;if("mi"===i&&"m"===r)return 1609.34*e;break;case"precipitation":case"snowfall":if("mm/sec"===i)return cr(t,3600*e,"mm",r);if("in"===i&&"mm"===r)return lr(e);if("in"===i&&"m"===r)return.0254*e;if("in"===i&&"mm/sec"===r)return lr(e)/3600;if("m"===i&&"in"===r)return or(e);if("m"===i&&"cm"===r)return 100*e;if("cm"===i&&"m"===r)return e/100;if("cm"===i&&"mm"===r)return 10*e;if("mm"===i&&"mm/sec"===r)return e/3600;if("mm"===i&&"in"===r)return.03937*e;break;case"time":if("hr"===i&&"min"===r)return 60*e;if("hr"===i&&"sec"===r)return 3600*e;if("hr"===i&&"ms"===r)return 36e5*e;if("min"===i&&"hr"===r)return e/60;if("min"===i&&"sec"===r)return 60*e;if("min"===i&&"ms"===r)return 6e4*e;if("sec"===i&&"hr"===r)return e/3600;if("sec"===i&&"min"===r)return e/60;if("sec"===i&&"ms"===r)return 1e3*e;if("ms"===i&&"hr"===r)return e/36e5;if("ms"===i&&"min"===r)return e/6e4;if("ms"===i&&"sec"===r)return e/1e3;break;case"rate":if("mm/hr"===i&&"mm/sec"===r)return e/3600;if("mm/sec"===i&&"mm/hr"===r)return 3600*e;if("mm/sec"===i&&"in/hr"===r)return 3600*e*.03937;if("in/hr"===i&&"mm/sec"===r)return e/3600/.03937;if("dbz"===i&&"mm/hr"===r)return hr(e);if("dbz"===i&&"mm/sec"===r)return hr(e,!0)}return e},ur=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[0-2][1-9]|[1-3]0|3[01])T(?:[01]\d|2[0-3])(?::[0-6]\d){1,2}(?:\.\d{3})?(?:[+-][0-2]\d:[0-5]\d|Z)?$/,pr=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(ft(t)&&ur.test(t))return(t=>{const e=t.split(/\D+/),i=t.includes("+")?-1:1;return new Date(Date.UTC(+e[0],+e[1]-1,+e[2],+e[3]+i*(+e[7]||0),+e[4]+i*(+e[8]||0),+e[5],+e[6]||0))})(t);if(ft(t)||bt(t)){const r=new Date(t);return e?(i=r,new Date(i.getTime()+60*i.getTimezoneOffset()*1e3)):r}var i;return(t=>"date"===s(t))(t)?t:null},mr={literal:"literal",get:"get",has:"has",var:"var",properties:"properties",zoom:"zoom",coalesce:"coalesce",eq:"==",neq:"!=",lt:"<",lte:"<=",gt:">",gte:">=",not:"!",all:"all",any:"any",toNumber:"to-number",toString:"to-string",toDate:"to-date",toLocaleString:"to-locale-string",toUnit:"to-unit",toBoolean:"to-boolean",typeOf:"typeof",number:"number",string:"string",boolean:"boolean",object:"object",add:"+",subtract:"-",mod:"%",pow:"^",multiply:"*",divide:"/",abs:"abs",ceil:"ceil",floor:"floor",round:"round",min:"min",max:"max",sqrt:"sqrt",ln:"ln",ln2:"ln2",log2:"log2",log10:"log10",sin:"sin",cos:"cos",tan:"tan",asin:"asin",acos:"acos",atan:"atan",e:"e",pi:"pi",at:"at",in:"in",regex:"regex",indexOf:"index-of",length:"length",slice:"slice",concat:"concat",downcase:"downcase",upcase:"upcase",step:"step",interpolate:"interpolate",case:"case",match:"match",let:"let",mapTime:"map-time",time:"time",now:"now"},gr=new Set(Object.values(mr)),fr=(new Set([mr.mapTime,mr.time,mr.now]),new Map),vr=new Map,yr=128;function br(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&gr.has(t[0])}new Set([mr.eq,mr.neq,mr.lt,mr.lte,mr.gt,mr.gte]);let xr=0;function wr(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)&&Object.getPrototypeOf(t)===Object.prototype}function _r(t,e,i){const r={};for(const s of Object.keys(t)){const a=t[s];r[s]=br(a)?Mr(a,e,i):wr(a)?_r(a,e,i):a}return r}function Mr(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var r,s;if(!Array.isArray(t))return"string"==typeof t&&t.startsWith("$")?i[t.slice(1)]:wr(t)?_r(t,e,i):t;const a=t,n=a[0],o=a.length-1;switch(n){case mr.literal:return a[1];case mr.get:{const t=o>=2?Mr(a[2],e,i):e;return Rr(a[1],null!=t?t:{})}case mr.has:{const t=o>=2?Mr(a[2],e,i):e;return"string"==typeof a[1]&&a[1]in(null!=t?t:{})}case mr.var:return i["string"==typeof a[1]?a[1]:Mr(a[1],e,i)];case mr.properties:return e;case mr.zoom:return null!==(s=null!==(r=e.$zoom)&&void 0!==r?r:e.zoom)&&void 0!==s?s:0;case mr.mapTime:case mr.time:return xr;case mr.now:return Date.now();case mr.coalesce:for(let t=1;t<=o;t++){const r=Mr(a[t],e,i);if(null!=r)return r}return null;case mr.eq:return Tr(a,e,i,1);case mr.neq:return!Tr(a,e,i,1);case mr.lt:return Ar(a[1],e,i,!0)<Ar(a[2],e,i,!1);case mr.lte:return Ar(a[1],e,i,!0)<=Ar(a[2],e,i,!1);case mr.gt:return Ar(a[1],e,i,!0)>Ar(a[2],e,i,!1);case mr.gte:return Ar(a[1],e,i,!0)>=Ar(a[2],e,i,!1);case mr.not:return!Mr(a[1],e,i);case mr.all:for(let t=1;t<=o;t++)if(!Mr(a[t],e,i))return!1;return!0;case mr.any:for(let t=1;t<=o;t++)if(Mr(a[t],e,i))return!0;return!1;case mr.toNumber:for(let t=1;t<=o;t++){const r=Mr(a[t],e,i),s=Number(r);if(!Number.isNaN(s))return s}return Number.NaN;case mr.toString:return String(Mr(a[1],e,i));case mr.toDate:{const t=Mr(a[1],e,i);return pr(t)}case mr.toLocaleString:{const t=Mr(a[1],e,i),r=o>=2?String(Mr(a[2],e,i)):"en-US",s=Number(t);return Number.isNaN(s)?String(t):s.toLocaleString(r)}case mr.toUnit:{let t=Mr(a[1],e,i);if(rt(t)||Number.isNaN(t))return null;t=Number(t);const r=String(Mr(a[2],e,i)),s=String(Mr(a[3],e,i)),n=o>=4?String(Mr(a[4],e,i)):s,l=o>=5?Number(Mr(a[5],e,i)):dr(n);let h;return h=s===n?Zr(t,l):Zr(cr(r,t,s,n),Number.isNaN(l)?0:l),h.toFixed(Number.isNaN(l)?0:l)}case mr.toBoolean:{const t=Mr(a[1],e,i);return""!==t&&0!==t&&!1!==t&&null!=t&&!Number.isNaN(t)}case mr.typeOf:return typeof Mr(a[1],e,i);case mr.number:for(let t=1;t<=o;t++){const r=Mr(a[t],e,i);if("number"==typeof r&&!Number.isNaN(r))return r}throw new Error("number assertion failed");case mr.string:for(let t=1;t<=o;t++){const r=Mr(a[t],e,i);if("string"==typeof r)return r}throw new Error("string assertion failed");case mr.boolean:for(let t=1;t<=o;t++){const r=Mr(a[t],e,i);if("boolean"==typeof r)return r}throw new Error("boolean assertion failed");case mr.object:for(let t=1;t<=o;t++){const r=Mr(a[t],e,i);if(null!=r&&"object"==typeof r&&!Array.isArray(r))return r}throw new Error("object assertion failed");case mr.add:{let t=0;for(let r=1;r<=o;r++)t+=Mr(a[r],e,i);return t}case mr.subtract:{const t=Mr(a[1],e,i);return 1===o?0-Number(t):t-Mr(a[2],e,i)}case mr.mod:return Mr(a[1],e,i)%Mr(a[2],e,i);case mr.pow:{const t=Mr(a[1],e,i),r=Mr(a[2],e,i);return Math.pow(t,r)}case mr.multiply:return Mr(a[1],e,i)*Mr(a[2],e,i);case mr.divide:return Mr(a[1],e,i)/Mr(a[2],e,i);case mr.abs:return Math.abs(Mr(a[1],e,i));case mr.ceil:return Math.ceil(Mr(a[1],e,i));case mr.floor:return Math.floor(Mr(a[1],e,i));case mr.round:return Math.round(Mr(a[1],e,i));case mr.min:{if(0===o)return Number.POSITIVE_INFINITY;let t=Number(Mr(a[1],e,i));for(let r=2;r<=o;r++){const s=Number(Mr(a[r],e,i));s<t&&(t=s)}return t}case mr.max:{if(0===o)return Number.NEGATIVE_INFINITY;let t=Number(Mr(a[1],e,i));for(let r=2;r<=o;r++){const s=Number(Mr(a[r],e,i));s>t&&(t=s)}return t}case mr.sqrt:return Math.sqrt(Mr(a[1],e,i));case mr.ln:return Math.log(Mr(a[1],e,i));case mr.ln2:return Math.LN2;case mr.log2:return Math.log2(Mr(a[1],e,i));case mr.log10:return Math.log10(Mr(a[1],e,i));case mr.sin:return Math.sin(Mr(a[1],e,i));case mr.cos:return Math.cos(Mr(a[1],e,i));case mr.tan:return Math.tan(Mr(a[1],e,i));case mr.asin:return Math.asin(Mr(a[1],e,i));case mr.acos:return Math.acos(Mr(a[1],e,i));case mr.atan:return Math.atan(Mr(a[1],e,i));case mr.e:return Math.E;case mr.pi:return Math.PI;case mr.at:{const t=Mr(a[1],e,i),r=Mr(a[2],e,i);if(!Array.isArray(r))throw new Error("at: second argument must be an array");return r[t]}case mr.in:{const t=Mr(a[1],e,i),r=Mr(a[2],e,i);return"string"==typeof r?r.includes(String(t)):!!Array.isArray(r)&&r.includes(t)}case mr.regex:{const r=Mr(a[1],e,i),s=o>=3,n=s?Mr(a[2],e,i):void 0,l=Mr(a[s?3:2],e,i);if("string"!=typeof l||"string"!=typeof r)return!1;try{const t=`${r}::${"string"==typeof n?n:""}`;let e=vr.get(t);if(!e){if(e="string"==typeof n?new RegExp(r,n):new RegExp(r),vr.size>=yr){const t=vr.keys().next().value;t&&vr.delete(t)}vr.set(t,e)}return e.test(l)}catch(t){return!1}}case mr.indexOf:{const t=Mr(a[1],e,i),r=Mr(a[2],e,i),s=o>=3?Mr(a[3],e,i):0;return"string"==typeof r?r.indexOf(String(t),s):Array.isArray(r)?r.indexOf(t,s):-1}case mr.length:{const t=Mr(a[1],e,i);return"string"==typeof t||Array.isArray(t)?t.length:0}case mr.slice:{const t=Mr(a[1],e,i),r=Mr(a[2],e,i),s=o>=3?Mr(a[3],e,i):void 0;return"string"==typeof t||Array.isArray(t)?void 0===s?t.slice(r):t.slice(r,s):[]}case mr.concat:{let t="";for(let r=1;r<=o;r++)t+=String(Mr(a[r],e,i));return t}case mr.downcase:return String(Mr(a[1],e,i)).toLowerCase();case mr.upcase:return String(Mr(a[1],e,i)).toUpperCase();case mr.step:return function(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const s=t.length-r;if(s<2)throw new Error("step: expected at least input and default output");if(s>2&&s%2!=0)throw new Error("step: expected stop_input/stop_output pairs");const a=Number(Mr(t[r],e,i));if(Number.isNaN(a))throw new Error("step: input must evaluate to a number");const n=t[r+1];if(2===s)return Mr(n,e,i);let o=Number.NEGATIVE_INFINITY,l=n;for(let e=r+2;e<t.length;e+=2){const i=t[e];if("number"!=typeof i||Number.isNaN(i))throw new TypeError("[MapsGL] step: stop inputs must be numeric literals");if(i<=o)throw new Error("[MapsGL] step: stop inputs must be strictly ascending");if(a<i)break;l=t[e+1],o=i}return Mr(l,e,i)}(a,e,i,1);case mr.interpolate:return function(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;var s;const a=t[r],n=a[0],o=null!==(s=a[1])&&void 0!==s?s:1,l=Mr(t[r+1],e,i);for(let s=r+2;s<t.length-2;s+=2){const r=t[s],a=Mr(t[s+1],e,i),h=t[s+2],d=Mr(t[s+3],e,i);if(l>=r&&l<h){const t=(l-r)/(h-r);return a+(d-a)*("exponential"===n?Math.pow(t,o):t)}}return Mr(t.at(-1),e,i)}(a,e,i,1);case mr.case:return function(t,e,i){for(let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;r<t.length-1;r+=2)if(Mr(t[r],e,i))return Mr(t[r+1],e,i);return Mr(t.at(-1),e,i)}(a,e,i,1);case mr.match:return function(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const s=Mr(t[r],e,i);for(let a=r+1;a<t.length-1;a+=2){const r=t[a],n=t[a+1];if(Array.isArray(r)?r.includes(s):s===r)return Mr(n,e,i)}return Mr(t.at(-1),e,i)}(a,e,i,1);case mr.let:return function(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const s=t.length-r;if(s<1)throw new Error("let: expected at least one argument (result expression)");if(s%2==0)throw new Error("let: expected zero or more [name, value] pairs followed by one result expression");const a=Object.create(i);for(let i=r;i<t.length-1;i+=2){const r=t[i];if("string"!=typeof r)throw new TypeError("let: binding names must be strings");const s=Mr(t[i+1],e,a);a[r]=s}return Mr(t.at(-1),e,a)}(a,e,i,1);default:throw new Error(`Unsupported expression: ${n}`)}}function Zr(t,e){const i=Math.max(0,Math.floor(Number(e)||0));if(0===i)return Math.round(t);const r=Math.pow(10,i);return Math.round(t*r)/r}function Ar(t,e,i,r){return r&&"string"==typeof t&&!t.startsWith("$")?Rr(t,e):Mr(t,e,i)}function Tr(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return Ar(t[r],e,i,!0)===Ar(t[r+1],e,i,!1)}function Rr(t,e){if("string"==typeof t){if(t.includes(".")){let i=fr.get(t);i||(i=t.split("."),fr.set(t,i));let r=e;for(let t=0;t<i.length;t++)r=null==r?void 0:r[i[t]];return r}return e[t]}return t.reduce(((t,e)=>null==t?void 0:t[e]),e)}new Set,new Map;const Gr=class{constructor(t,e=!1){this.expression=t,e&&(this.cache=new Map)}evaluate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this.cache){const e=JSON.stringify(t);if(this.cache.has(e))return this.cache.get(e);const i=Mr(this.expression,t);return this.cache.set(e,i),i}return Mr(this.expression,t)}toArray(){return this.expressionToArray(this.expression)}expressionToArray(t){return Array.isArray(t)?t.map((t=>this.expressionToArray(t))):t}};class Sr{constructor(t){this.constant=null,this.expression=null,this.fn=null,Array.isArray(t)?br(t)?this.expression=new Gr(t):this.constant=t:"function"==typeof t?this.fn=t:this.constant=t}isExpression(){return null!==this.expression}resolve(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.expression?this.expression.evaluate(t):this.fn?this.fn(t):this.constant}getRaw(){return this.fn?this.fn:this.expression?this.expression.toArray():this.constant?this.constant:null}}class Cr extends Sr{constructor(t){if(Array.isArray(t)&&br(t))throw new TypeError(`ConstantStyleValue does not support expressions: ${JSON.stringify(t)}`);if("function"==typeof t)throw new TypeError(`ConstantStyleValue does not support function evaulation: ${JSON.stringify(t)}`);"object"==typeof t&&t.constant&&(t=t.constant),super(t)}}class Ir extends Sr{}const Vr=(t,e)=>{if(null==t?void 0:t.text)return Array.isArray(t.text)?t.text[e]:t.text},Fr=t=>(null==t?void 0:t.icon)||(null==t?void 0:t.symbol),Wr={"":["opacity","animated"],raster:["opacity"],fill:["color","pattern","opacity"],stroke:["color","opacity","thickness","lineJoin","lineCap"],circle:["radius"],grid:["spacing"],heatmap:["radius","blur","intensity","weight","color"],contour:["interval","majorInterval","width","majorWidth","scale","offset"],symbol:["key","sortKey","size","anchor","offset","padding","rotation","shader","factor"],icon:["image","size","anchor","offset","padding","rotation","shader","factor"],text:["value","size","font","weight","color","outlineColor","opacity","align","transform","anchor","offset","padding","rotation","letterSpacing","lineHeight","maxWidth"]},Er=new Set(["raster","fill","stroke","circle","grid","sample","particle","heatmap","contour","symbol","icon","text"]);function kr(t,e){if(null==e||!a(e))return e;const i=Wr[t],r={};return Object.keys(e).forEach((t=>{const s=e[t];var n;r[t]=i&&i.includes(t)?null==(n=s)||function(t){return null!=t&&"object"==typeof t&&"function"==typeof t.resolve}(n)?n:function(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]}(n)||"function"==typeof n?new Ir(n):new Cr(n):Er.has(t)&&a(s)&&!Array.isArray(s)?kr(t,s):"text"===t&&Array.isArray(s)?s.map((t=>a(t)?kr("text",t):t)):s})),r}class zr{constructor(t={}){if(this._cachedSerialized=null,"function"==typeof t)this.config=t;else{const e=Object.assign({},t);if(e.symbol){e.symbol=Object.assign({},e.symbol);const t=new Set(["key","rank","fadeOpacity","pitchWithMap","rotateWithMap","scaleWithMap","sizeAttenuation","allowOverlap"]),i=Object.keys(e.symbol);e.icon=e.icon?Object.assign({},e.icon):{},i.forEach((i=>{t.has(i)||("icon"!==i&&(e.icon[i]=e.symbol[i]),delete e.symbol[i])}))}this.config=function(t){var e;return null!==(e=kr("",t))&&void 0!==e?e:{}}(e)}}opacity(t){const e=ar("number",this.provider(t).opacity,t,1);return rt(e)?1:e}animated(t){return ar("boolean",this.provider(t).animated,t,!1)}rasterMeld(t){var e;return ar("boolean",null===(e=this.provider(t).raster)||void 0===e?void 0:e.meld,t,!1)}rasterOpacity(t){var e;const i=ar("number",null===(e=this.provider(t).raster)||void 0===e?void 0:e.opacity,t);return rt(i)?this.opacity(t):i}fillColor(t){var e;const i=this.fillPattern(t);let r=ar("color",null===(e=this.provider(t).fill)||void 0===e?void 0:e.color,t);return i&&(r=new Kt(0,0,0,1)),r&&(r.a*=this.fillOpacity(t)),r}fillPattern(t){var e;const i=ar("any",null===(e=this.provider(t).fill)||void 0===e?void 0:e.pattern,t);if("string"==typeof i&&/^https?:\/\//.test(i))throw new Error(`[MapsGL] Remote icon images must contain a unique id and provided as { id: string; url: string; }, not ${i}.`);return i}fillOpacity(t){var e;const i=ar("number",null===(e=this.provider(t).fill)||void 0===e?void 0:e.opacity,t,1);return rt(i)?1:i}fillSort(t){var e;const i=null===(e=this.provider(t).fill)||void 0===e?void 0:e.sort;return"string"==typeof i?{property:i}:i}strokeColor(t){var e;const i=ar("color",null===(e=this.provider(t).stroke)||void 0===e?void 0:e.color,t);return i&&(i.a=this.strokeOpacity(t)),i}strokeOpacity(t){var e;const i=ar("number",null===(e=this.provider(t).stroke)||void 0===e?void 0:e.opacity,t,1);return rt(i)?1:i}strokeThickness(t){var e;const i=ar("number",null===(e=this.provider(t).stroke)||void 0===e?void 0:e.thickness,t);return rt(i)?0:i}strokeLineJoin(t){var e;const i=ar("string",null===(e=this.provider(t).stroke)||void 0===e?void 0:e.lineJoin,t);return rt(i)?wi:i}strokeLineCap(t){var e;const i=ar("string",null===(e=this.provider(t).stroke)||void 0===e?void 0:e.lineCap,t);return rt(i)?"round":i}radius(t){var e,i;const r=(null===(e=this.provider(t).circle)||void 0===e?void 0:e.radius)||(null===(i=this.provider(t).heatmap)||void 0===i?void 0:i.radius);return ar("number",r,t,10)}sampleExpression(t){var e;const i=null===(e=this.provider(t).sample)||void 0===e?void 0:e.expression;return ar("string",i,t,"number")}sampleExpressionOperation(t){var e;return ar("object",null===(e=this.provider(t).sample)||void 0===e?void 0:e.expressionOperation,t)}sampleChannel(t){var e;return ar("string",null===(e=this.provider(t).sample)||void 0===e?void 0:e.channel,t)}sampleColorScale(t){var e;return ar("object",null===(e=this.provider(t).sample)||void 0===e?void 0:e.colorscale,t)}sampleInterpolation(t){var e;const i=null===(e=this.provider(t).sample)||void 0===e?void 0:e.interpolation;return ar("string",i,t)}sampleOpacity(t){return console.warn("[MapsGL] `sample.opacity` is deprecated. Use `opacity` instead."),1}sampleSmoothing(t){var e;return ar("number",null===(e=this.provider(t).sample)||void 0===e?void 0:e.smoothing,t,0)}sampleOffset(t){var e;return ar("number",null===(e=this.provider(t).sample)||void 0===e?void 0:e.offset,t,0)}sampleMeld(t){var e;return ar("boolean",null===(e=this.provider(t).sample)||void 0===e?void 0:e.meld,t,!0)}sampleDataRange(t){var e;return ar("object",null===(e=this.provider(t).sample)||void 0===e?void 0:e.dataRange,t)}sampleDrawRange(t){var e;return ar("object",null===(e=this.provider(t).sample)||void 0===e?void 0:e.drawRange,t)}gridSpacing(t){var e;return ar("number",null===(e=this.provider(t).grid)||void 0===e?void 0:e.spacing,t,30)}particleType(t){var e;return ar("string",null===(e=this.provider(t).particle)||void 0===e?void 0:e.type,t)}particleCount(t){var e;return ar("number",null===(e=this.provider(t).particle)||void 0===e?void 0:e.count,t)}particleDensity(t){var e;return ar("number",null===(e=this.provider(t).particle)||void 0===e?void 0:e.density,t,0)}particleSpeed(t){var e,i;const r=(null===(e=this.provider(t).particle)||void 0===e?void 0:e.speedFactor)||(null===(i=this.provider(t).particle)||void 0===i?void 0:i.speed);return ar("number",r,t,1)}particleSize(t){var e,i,r;if(bt(null===(e=this.config.particle)||void 0===e?void 0:e.size)){const e=ar("number",null===(i=this.provider(t).particle)||void 0===i?void 0:i.size,t,0);return{width:e,height:e}}return ar("object",null===(r=this.provider(t).particle)||void 0===r?void 0:r.size,t,{width:2,height:2})}particleTrails(t){var e;return ar("boolean",null===(e=this.provider(t).particle)||void 0===e?void 0:e.trails,t)}particleTrailsFade(t){var e,i;const r=(null===(e=this.provider(t).particle)||void 0===e?void 0:e.trailsFadeFactor)||(null===(i=this.provider(t).particle)||void 0===i?void 0:i.trailsFade);return ar("number",r,t)}particleDropRate(t){var e;return ar("number",null===(e=this.provider(t).particle)||void 0===e?void 0:e.dropRate,t)}particleDropRateBump(t){var e;return ar("number",null===(e=this.provider(t).particle)||void 0===e?void 0:e.dropRateBump,t)}heatmapColor(t){var e;return ar("colorscale",null===(e=this.provider(t).heatmap)||void 0===e?void 0:e.color,t)}heatmapRadius(t){var e;return ar("number",null===(e=this.provider(t).heatmap)||void 0===e?void 0:e.radius,t,10)}heatmapBlur(t){var e;return ar("number",null===(e=this.provider(t).heatmap)||void 0===e?void 0:e.blur,t,1)}heatmapIntensity(t){var e;return ar("number",null===(e=this.provider(t).heatmap)||void 0===e?void 0:e.intensity,t)}heatmapWeight(t){var e;return ar("number",null===(e=this.provider(t).heatmap)||void 0===e?void 0:e.weight,t,1)}heatmapOpacity(t){return console.warn("[MapsGL] `heatmap.opacity` is deprecated. Use `opacity` instead."),1}contourInterval(t){var e;return ar("number",null===(e=this.provider(t).contour)||void 0===e?void 0:e.interval,t,1)}contourMajorInterval(t){var e;return ar("number",null===(e=this.provider(t).contour)||void 0===e?void 0:e.majorInterval,t,0)}contourWidth(t){var e;return ar("number",null===(e=this.provider(t).contour)||void 0===e?void 0:e.width,t,1)}contourMajorWidth(t){var e;return ar("number",null===(e=this.provider(t).contour)||void 0===e?void 0:e.majorWidth,t,2)}contourScale(t){var e;return ar("number",null===(e=this.provider(t).contour)||void 0===e?void 0:e.scale,t,1)}contourOffset(t){var e;return ar("number",null===(e=this.provider(t).contour)||void 0===e?void 0:e.offset,t,0)}symbolKey(t){var e;return ar("string",null===(e=this.provider(t).symbol)||void 0===e?void 0:e.key,t)}symbolRank(t){var e;return null===(e=this.provider(t).symbol)||void 0===e?void 0:e.rank}symbolRotateWithMap(t){var e;return ar("boolean",null===(e=this.provider(t).symbol)||void 0===e?void 0:e.rotateWithMap,t,!0)}symbolPitchWithMap(t){var e;return ar("boolean",null===(e=this.provider(t).symbol)||void 0===e?void 0:e.pitchWithMap,t,!0)}symbolScaleWithMap(t){var e;return ar("boolean",null===(e=this.provider(t).symbol)||void 0===e?void 0:e.scaleWithMap,t,!1)}symbolSizeAttenuation(t){var e;return ar("boolean",null===(e=this.provider(t).symbol)||void 0===e?void 0:e.sizeAttenuation,t,!1)}symbolAllowOverlap(t){var e;return ar("boolean",null===(e=this.provider(t).symbol)||void 0===e?void 0:e.allowOverlap,t,!0)}symbolOverlapMode(t){var e;return ar("string",null===(e=this.provider(t).symbol)||void 0===e?void 0:e.overlapMode,t,"layer")}symbolFadeOpacity(t){var e;return ar("boolean",null===(e=this.provider(t).symbol)||void 0===e?void 0:e.fadeOpacity,t,!0)}iconType(t){var e;return ar("string",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.type,t)}iconImage(t){var e,i;const r=ar("any",null===(e=this.provider(t).icon)||void 0===e?void 0:e.image,t);if("string"==typeof r&&/^https?:\/\//.test(r))throw new Error(`[MapsGL] Remote icon images must contain a unique id and provided as { id: string; url: string; }, not ${r}.`);const s=this.iconAtlas(t);return!r&&(null===(i=null==s?void 0:s.ids)||void 0===i?void 0:i.length)>0?s.ids[0]:r}iconShader(t){var e;return ar("string",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.shader,t)}iconUniforms(t){var e;return ar("object",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.uniforms,t)}iconSize(t){var e;return ar("object",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.size,t)}iconAnchor(t){var e;return ar("string",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.anchor,t,"center")}iconOffset(t){var e;return ar("object",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.offset,t,{x:0,y:0})}iconPadding(t){var e;const i=ar("object",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.padding,t,6);return Array.isArray(i)?i:[i,i]}iconRotation(t){var e;return ar("number",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.rotation,t,0)}iconBlending(t){var e;return ar("number",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.blending,t)}iconAnimated(t){var e;return ar("boolean",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.animated,t,!1)}iconFactor(t){var e;return ar("number",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.factor,t,1)}iconAtlas(t){var e;return ar("object",null===(e=Fr(this.provider(t)))||void 0===e?void 0:e.atlas,t)}textValue(t){var e;return ar("any",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.value,t)}textTransform(t){var e;return ar("string",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.transform,t,"none")}textFont(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;var i,r;const s=ar("string",null===(i=Vr(this.config,e))||void 0===i?void 0:i.font,t,"Inter");let a=ar("string",null===(r=Vr(this.config,e))||void 0===r?void 0:r.weight,t,"normal");return"normal"===a&&(a="regular"),`${Ui(s)}-${Ui(a)}`}textSize(t){var e;return ar("object",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.size,t,12)}textColor(t){var e;const i=ar("color",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.color,t,new Kt("#000"));return i&&(i.a=this.textOpacity(t)),i}textOutlineColor(t){var e;const i=ar("color",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.outlineColor,t);return i&&(i.a=this.textOpacity(t)),i}textOpacity(t){var e;const i=ar("number",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.opacity,t,1);return rt(i)?1:i}textAlign(t){var e;return ar("string",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.align,t,"center")}textAnchor(t){var e;return ar("string",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.anchor,t,"center")}textOffset(t){var e;return ar("object",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.offset,t,{x:0,y:0})}textPadding(t){var e;const i=ar("object",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.padding,t,6);return Array.isArray(i)?i:[i,i]}textRotation(t){var e;return ar("number",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.rotation,t,0)}textLetterSpacing(t){var e;return ar("number",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.letterSpacing,t,0)}textLineHeight(t){var e;return ar("number",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.lineHeight,t,1)}textMaxWidth(t){var e;return ar("number",null===(e=Vr(this.config,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0))||void 0===e?void 0:e.maxWidth,t,140)}textLineCount(t){var e;const i=null===(e=this.config)||void 0===e?void 0:e.text;return i?Array.isArray(i)?i.length:1:0}getProperty(t){return ai(this.config,t)}setProperty(t,e){const i=t.match(/\[\d+]/);if((null==i?void 0:i.length)>0){const r=Number.parseInt(i[0].replaceAll(/\D/g,""),10),s=t.split(i[0]),a=ai(this.config,s[0]),n=s[1].replace(/^\./,"");Array.isArray(a)&&vt(a[r],n,e)}else vt(this.config,t,e);this._cachedSerialized=null}serialized(){if(this._cachedSerialized)return this._cachedSerialized;const t={};return rr(t,this.config),this._cachedSerialized=t,t}provider(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(ni(this.config)?this.config(t):this.config)||{}}static fromSerialized(t){const e={};return sr(e,t),new zr(e)}}const Nr=zr;class Yr extends ue{get type(){return"data"}addFeature(t,e){const i=t.feature.asPoints(),r=(t.feature.asPolygons(),t.feature.extent);for(let t=0;t<i.length;t++){const e=i[t],s=me({x:e.x,y:e.y},r);i[t]=s}return{type:t.type,featureIndex:t.featureIndex,sourceId:t.sourceId,sourceLayerIndex:t.sourceLayerIndex,geometry:i,properties:t.properties,vertexRange:{start:null,end:null}}}static from(t){const e=new Yr(t.options);return at(t)?console.warn("[MapsGL] Cannot create FeatureStore from invalid serialized data."):e.features=t.features,e}}const Lr=Yr;function Or(t){if("string"!=typeof t)return!1;const e=t.trim();return e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]")}function jr(t,e){if(!Or(t=t.trim()))return e;try{return JSON.parse(t)}catch(i){return console.error("[MapsGL] Failed to parse JSON string:",i,t),e}}const Dr=(t,e)=>{if("fill"===t)return new vi(e);if("line"===t)return new Ri(e);if("circle"===t||"heatmap"===t||"voronoi"===t)return new si(e);if("symbol"===t||"text"===t)return new Bi(e);if("data"===t)return new Lr(e);throw new Error(`[MapsGL] Invalid data store type ${t}`)};function Xr(t){if(!t)return{};const e=Object.assign({},t);return Object.keys(e).forEach((i=>{if(ft(e[i])){const r=t[i];if(Or(r)){if(e[i]=jr(r),Array.isArray(e[i]))e[i]=e[i].map((t=>Or(t)?jr(t):t));else if(a(t[i])){const r=Object.assign({},t[i]);Object.keys(r).forEach((t=>{r[t]=Xr(r[t])})),e[i]=r}}else e[i]=r}})),e}const Br=class{constructor(t,e={}){this.coord=new mt(t.z,t.x,t.y),this.actor=e.actor,ot(e.granularity)&&(this.subdivisionGranularity=new ci(e.granularity))}parse(t,e){return i=this,s=function*(){var i;const r={};if(nt(null==t?void 0:t.layers))return this.parseEmptyTile(e);const s=Object.keys(t.layers),a=e.reduce(((e,i)=>{const{sourceLayerId:r=s[0]}=i;return i.sourceLayerId=r,t.layers[r]&&(e[r]||(e[r]=[]),e[r].push(i)),e}),{}),n=Object.keys(a),o={},l={},h={};n.forEach((e=>{const i=a[e],s=[],n=t.layers[e];if(n){for(let t=0,e=n.length;t<e;t++){const e=n.feature(t),i=e.properties||{},r={};Object.keys(i).forEach((t=>{vt(r,t,i[t])})),e.properties=r,s.push(e)}for(let t=0,e=i.length;t<e;t++){const{type:e,layerId:a,sourceLayerType:n,filter:d,paint:c,options:u}=i[t],p=Dr(e,Object.assign(Object.assign({},u),{tile:this.coord.toInfo(),sourceId:"",sourceLayerIndex:0,zoom:this.coord.z})),m=Nr.fromSerialized(c);if(p){p.id=`${a}:${this.coord.hash}`,r[a]=p;let t=s.filter((t=>rt(n)||"point"===n&&1===t.type||"line"===n&&2===t.type||"polygon"===n&&3===t.type)),e=t;if(t=t.map((t=>(t.properties=Xr(t.properties),t))),Array.isArray(d)&&(null==d?void 0:d.length)>=1){const i=new Gr(d),r=this.coord.z;e=t.filter((t=>{const e=Object.assign(Object.assign({},t.properties),{$zoom:r});return Boolean(i.evaluate(e))}))}p.populate(e,void 0,{tileCoord:this.coord,paint:m,includeEmptySymbolData:"data"===p.type,subdivisionGranularity:this.subdivisionGranularity,glyphDependencies:o,iconDependencies:l,patternDependencies:h})}}}else for(let t=0,e=i.length;t<e;t++){const{layerId:e}=i[t];r[e]=new Hi({tile:this.coord.toInfo(),sourceLayerIndex:0,sourceId:"",zoom:this.coord.z})}}));let d=(null===(i=this.dependencies)||void 0===i?void 0:i.glyphs)||{},c={};if(ot(o)){const t=Object.keys(d),e=Object.keys(o).filter((e=>{var i;return!t.includes(e)||nt(null===(i=d[e])||void 0===i?void 0:i.ranges)}));e.length>0&&Object.keys(o).reduce(((t,e)=>{const i=d[e]||{},r=o[e];if(nt(i))t.push(...r);else{const e=Object.values((null==i?void 0:i.ranges)||{});for(const i of r)for(const r of e)if(i>=r.start&&i<=r.end){t.push(i);break}}return t}),[]).length>0&&(d=yield this.actor.send({type:"getGlyphs",data:o}))}const u=Object.assign(Object.assign({},l),h);if(ot(u)){const t=Object.keys(u).filter((t=>yt(u[t],["url"]))).reduce(((t,e)=>{var i,r,s;return t.push({id:e,url:u[e].url,pixelRatio:null!==(i=u[e].pixelRatio)&&void 0!==i?i:1,sdf:null!==(r=u[e].sdf)&&void 0!==r&&r,pattern:null!==(s=u[e].pattern)&&void 0!==s&&s}),t}),[]);t.length>0&&(yield this.actor.send({type:"loadImages",data:t})),c=yield this.actor.send({type:"getImages",data:u})}return(ot(d)||ot(c))&&Object.values(r).forEach((t=>{t instanceof Bi&&t.layoutSymbols(c,d)})),new Promise(((t,e)=>{t({stores:Object.keys(r).reduce(((t,e)=>{const i=r[e];return st(i)&&!i.isEmpty&&(t[e]=i),t}),{}),dependencies:{glyphs:d,icons:c}})}))},new((r=void 0)||(r=Promise))((function(t,e){function a(t){try{o(s.next(t))}catch(t){e(t)}}function n(t){try{o(s.throw(t))}catch(t){e(t)}}function o(e){var i;e.done?t(e.value):(i=e.value,i instanceof r?i:new r((function(t){t(i)}))).then(a,n)}o((s=s.apply(i,[])).next())}));var i,r,s}abort(){}parseEmptyTile(t){const e={};return t.forEach((t=>{e[t.layerId]=new Hi({tile:this.coord.toInfo(),sourceLayerIndex:0,sourceId:"",zoom:this.coord.z})})),Promise.resolve({stores:e,dependencies:{glyphs:{},icons:{}}})}};function Pr(t,e){var i;const r=ct(t.x,t.y,t.z,0),s=null==e?void 0:e.time;if(null==s)return r;const a="number"==typeof s?s:null===(i=null==s?void 0:s.getTime)||void 0===i?void 0:i.call(s);return null==a?r:`${r}-${a}`}const Hr=(t,e,i)=>{const{headers:r,body:s}=e||{};return fetch(t,{headers:r,body:s?"string"==typeof s?s:JSON.stringify(s):void 0}).then(gt).then((t=>{if((t=>st(t)&&t.status>=200&&t.status<=299)(t))return t.arrayBuffer()})).then((t=>{if(st(t))try{return{vectorTile:new Z(new Uint8Array(t))}}catch(t){console.error("Error parsing vector tile",t)}}))},Ur=class{constructor(t){this.onTileError=()=>{},this.loading={},this.loaded=new Map,this.dependencies={glyphs:void 0,icons:void 0},this.tileLoader=t||Hr}setLoaded(t,e){if(this.loaded.size>=256){const t=this.loaded.keys().next().value;this.loaded.delete(t)}this.loaded.set(t,e)}loadTile(t,e){var i;const{tile:{info:r},request:{url:s,headers:a,body:n,reload:o=!1,params:l}}=t,h=Pr(r,l);this.loading=null!==(i=this.loading)&&void 0!==i?i:{};const d=this.loaded.get(h);if(d&&!0!==o)return d.parse(d.vectorTile,t.layers).then((t=>t)).catch((t=>{console.error(t)}));const c=new Br(r,{actor:e,granularity:t.granularity});return this.loading[h]=c,this.tileLoader(s,{headers:a,body:n},r).then((e=>{const i=!this.loading[h];if(delete this.loading[h],st(e)&&(c.vectorTile=e.vectorTile),!i)return rt(e)?c.parseEmptyTile(t.layers):(c.dependencies=this.dependencies,c.parse(e.vectorTile,t.layers))})).then((t=>(this.setLoaded(h,c),(null==t?void 0:t.dependencies)&&(this.dependencies=t.dependencies),t))).catch((t=>{console.error(t)}))}reloadTile(t,e){const{tile:{info:i},request:r}=t,s=Pr(i,null==r?void 0:r.params),a=this.loaded.get(s);return(null==a?void 0:a.vectorTile)?a.parse(a.vectorTile,t.layers):Promise.resolve(null)}abortTile(t){if(this.loading){const e=this.loading[t];e&&(e.abort(),delete this.loading[t])}return Promise.resolve()}clearTiles(){this.loading={},this.loaded=new Map}},Qr=t=>(180+t)/360,Kr=t=>(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360,Jr=4096,qr=64/4096;function $r(t){const{id:e,geometry:i,properties:r}=t;if(!i)return null;if("GeometryCollection"===i.type)throw new Error("GeometryCollection not supported in dynamic mode.");const s={minX:Number.POSITIVE_INFINITY,minY:Number.POSITIVE_INFINITY,maxX:Number.NEGATIVE_INFINITY,maxY:Number.NEGATIVE_INFINITY},a=function(t,e){const{type:i,coordinates:r}=t;switch(i){case"Point":return function(t,e){const i=[];return es(t,i,e),i}(r,e);case"MultiPoint":return function(t,e){const i=[];return t.forEach((t=>{es(t,i,e)})),i}(r,e);case"LineString":return function(t,e){return[is(t,e,!1)]}(r,e);case"MultiLineString":return function(t,e){return t.map((t=>is(t,e,!1)))}(r,e);case"Polygon":return function(t,e){return t.map(((t,i)=>is(t,e,!0,0===i)))}(r,e);case"MultiPolygon":return function(t,e){const i=[];return t.forEach((t=>{t.forEach(((t,r)=>{i.push(is(t,e,!0,0===r))}))})),i}(r,e);default:throw new Error("Input data is not a valid GeoJSON object.")}}(i,s);return a?Object.assign({id:e,properties:r||{},geometryType:ts(i.type),coordinates:a},s):null}function ts(t){if("Point"===t||"MultiPoint"===t)return 1;if("LineString"===t||"MultiLineString"===t)return 2;if("Polygon"===t||"MultiPolygon"===t)return 3;throw new Error(`Unsupported geometry type: ${t}`)}function es(t,e,i){let[r,s]=t;const a=Qr(r),n=Math.max(0,Math.min(1,Kr(s)));e.push(a,n),i.minX=Math.min(i.minX,a),i.minY=Math.min(i.minY,n),i.maxX=Math.max(i.maxX,a),i.maxY=Math.max(i.maxY,n)}function is(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const s=[];return t.forEach((t=>{es(t,s,e)})),i&&function(t,e){const i=function(t){let e=0;const i=t.length/2;for(let r=0;r<i;r++){const s=2*r,a=(r+1)%i*2;e+=(t[a]-t[s])*(t[a+1]+t[s+1])}return e}(t);i>0!==e&&function(t){const e=t.length/2,i=e/2;for(let r=0;r<i;r++){const i=2*r,s=2*(e-1-r),a=t[i],n=t[i+1];t[i]=t[s],t[i+1]=t[s+1],t[s]=a,t[s+1]=n}}(t)}(s,r),s}function rs(t,e,i,r,s,a,n,o){let l=t,h=e,d=i,c=r;return l<n&&d<n?null:(l<n&&(h+=Math.round(a*(n-l)/s),l=n),d<n&&(c=h+Math.round(a*(n-l)/s),d=n),h<n&&c<n?null:(h<n&&(l+=Math.round(s*(n-h)/a),h=n),c<n&&(d=l+Math.round(s*(n-h)/a),c=n),l>=o&&d>=o?null:(l>=o&&(h+=Math.round(a*(o-l)/s),l=o),d>=o&&(c=h+Math.round(a*(o-l)/s),d=o),h>=o&&c>=o?null:(h>=o&&(l+=Math.round(s*(o-h)/a),h=o),c>=o&&(d=l+Math.round(s*(o-h)/a),c=o),[l,h,d,c]))))}function ss(t,e,i){const r=[],s=t.length;let a=t[s-2],n=t[s-1],o="left"===e.side||"right"===e.side?!e.test(a):!e.test(n);for(let l=0;l<s;l+=2){const s=t[l],h=t[l+1],d="left"===e.side||"right"===e.side?!e.test(s):!e.test(h);if(d!==o){const[t,o]=e.intersect(a,n,s,h,i);r.push(t,o)}d&&r.push(s,h),a=s,n=h,o=d}return r}function as(t,e,i,r,s){return[s.minX,e+(s.minX-t)/(i-t)*(r-e)]}function ns(t,e,i,r,s){return[t+(s.minY-e)/(r-e)*(i-t),s.minY]}function os(t,e,i,r,s){return[s.maxX,e+(s.maxX-t)/(i-t)*(r-e)]}function ls(t,e,i,r,s){return[t+(s.maxY-e)/(r-e)*(i-t),s.maxY]}const hs=class{constructor(){this.tileCache=new Map,this.featureCache=new Map}clear(){this.featureCache.clear(),this.tileCache.clear()}setData(t){this.featureCache.clear(),this.tileCache.clear(),(null==t?void 0:t.features)&&t.features.forEach((t=>{const e=t.id;if(null!=e)if(t.geometry){const i=$r(t);i&&this.featureCache.set(e,i)}else this.featureCache.delete(e)}))}updateProperties(t){(null==t?void 0:t.features)?(this.tileCache.clear(),t.features.forEach((t=>{const e=t.id;if(null==e)return void console.warn("feature has no id");const i=this.featureCache.get(e);if(t.geometry)if(i)if(function(t,e){return JSON.stringify(t.coordinates)!==JSON.stringify(e.coordinates)}(i,t.geometry)){const i=$r(t);i&&this.featureCache.set(e,i)}else i.properties=Object.assign({},t.properties);else{const i=$r(t);i&&this.featureCache.set(e,i)}else this.featureCache.delete(e)}))):console.warn("newData has no features")}getTile(t,e,i){const r=`${t}/${e}/${i}`;if(this.tileCache.has(r))return this.tileCache.get(r);const s=Math.pow(2,t),a=[];this.featureCache.forEach((t=>{(function(t,e,i,r){return t.minX<(i+1+qr)/e&&t.minY<(r+1+qr)/e&&t.maxX>(i-qr)/e&&t.maxY>(r-qr)/e})(t,s,e,i)&&a.push(function(t,e,i,r){const{id:s,geometryType:a,coordinates:n,properties:o}=t,l=[];return 1===a?function(t,e,i,r,s){for(let a=0;a<t.length;a+=2){const n=t[a+1],o=Math.round(Jr*(t[a]*e-i)),l=Math.round(Jr*(n*e-r));s.push([o,l])}}(n,e,i,r,l):2===a?n.forEach((t=>{!function(t,e,i,r,s){let a=null;for(let n=0;n<t.length-2;n+=2){const o=Math.round(Jr*(t[n]*e-i)),l=Math.round(Jr*(t[n+1]*e-r)),h=Math.round(Jr*(t[n+2]*e-i)),d=Math.round(Jr*(t[n+3]*e-r)),c=rs(o,l,h,d,h-o,d-l,-128,4224);if(!c)continue;const[u,p,m,g]=c;(!a||0===a.length||a.at(-1)[0]!==u||a.at(-1)[1]!==p)&&(a=[[u,p]],s.push(a)),a.push([m,g])}}(t,e,i,r,l)})):3===a&&n.forEach((t=>{!function(t,e,i,r,s){const a={minX:(i-qr)/e,minY:(r-qr)/e,maxX:(i+1+qr)/e,maxY:(r+1+qr)/e};let n=[...t];const o=[{side:"left",test:t=>t<a.minX,intersect:as},{side:"top",test:t=>t<a.minY,intersect:ns},{side:"right",test:t=>t>a.maxX,intersect:os},{side:"bottom",test:t=>t>a.maxY,intersect:ls}];for(const t of o){if(0===n.length)break;n=ss(n,t,a)}if(n.length>0){const t=[];for(let s=0;s<n.length;s+=2){const a=Math.round(Jr*(n[s]*e-i)),o=Math.round(Jr*(n[s+1]*e-r));t.push([a,o])}s.push(t)}}(t,e,i,r,l)})),{id:s,type:a,geometry:l,tags:o}}(t,s,e,i))}));const n=a.length>0?{features:a}:null;return this.tileCache.set(r,n),n}getFeatures(){return[...this.featureCache.values()]}};function ds(t,e){if(t===e)return!0;if(null==t||null==e)return t===e;if("object"!=typeof t)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!ds(t[i],e[i]))return!1;return!0}const i=Object.keys(t),r=Object.keys(e);if(i.length!==r.length)return!1;for(const r of i)if(!ds(t[r],e[r]))return!1;return!0}const cs=(t,e)=>fetch(t,e),us=class extends Ur{get geojson(){return this._geojson}constructor(t,e){super(t||((t,e,i)=>((t,e)=>new Promise(((i,r)=>{const s=t.getTile(e.z,e.x,e.y);if(rt(null==s?void 0:s.features))return void i(null);const a=new et.GeoJSONWrapper(s.features);a.name="geojsonTileLayer",a.version=2;let n=it().fromGeojsonVt({geojsonTileLayer:a});0===n.byteOffset&&n.byteLength===n.buffer.byteLength||(n=new Uint8Array(n)),i({vectorTile:new Z(new Uint8Array(n))})})))(this._geojsonIndex,i))),this.dynamic=!1,this._loadingCallbacks=[],this._geojsonRT=null,this._useRT=!1,this._loadingData=!1,this._revision=0,this._dataLoader=e||cs}hasOnlyPropertyChanges(t){if(!(this._geojson&&t&&t.features&&this._geojson.features))return!1;const e=this._geojson.features,i=t.features;if(e.length!==i.length)return!1;for(let t=0;t<e.length;t++)if(!ds(e[t].geometry,i[t].geometry))return!1;return!0}ensureFeatureIds(t){if(!(null==t?void 0:t.features)||!Array.isArray(t.features))return;const e=t.features;for(let t=0;t<e.length;t++)null==e[t].id&&(e[t].id=t)}setData(t,e){if("number"==typeof e?this._revision=e:this._revision+=1,this.ensureFeatureIds(t),this.hasOnlyPropertyChanges(t)&&this._geojsonRT)return this._geojsonRT.updateProperties(t),this._geojson=t,void this.clearTiles();this.clearTiles(),this._geojson=t,ot(t)&&(this.dynamic?(this._geojsonRT||(this._geojsonRT=new hs),this._geojsonRT.setData(t),this._geojsonIndex=this._geojsonRT,this._useRT=!0):(this._geojsonIndex=function(t,e){return new $(t,{})}(t),this._geojsonRT=null,this._useRT=!1))}loadData(t,i){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return new Promise(((s,a)=>{this._geojsonIndex&&!0!==r?s():this._loadingData?this._loadingCallbacks.push((()=>s())):(this._loadingData=!0,lt(ot(t),"[MapsGL] GeoJSONWorker: Invalid URL provided for data load"),this._dataLoader(t,{}).then((t=>{if(200===t.status)return t.json();throw new e("Invalid response",t,t.status)})).then((t=>{return e=this,s=function*(){const e=yield i.send({type:"transformGeoJSON",data:{data:t}});return this.setData(e)},new((r=void 0)||(r=Promise))((function(t,i){function a(t){try{o(s.next(t))}catch(t){i(t)}}function n(t){try{o(s.throw(t))}catch(t){i(t)}}function o(e){var i;e.done?t(e.value):(i=e.value,i instanceof r?i:new r((function(t){t(i)}))).then(a,n)}o((s=s.apply(e,[])).next())}));var e,r,s})).then((()=>{this._loadingData=!1,s(),this._loadingCallbacks.forEach((t=>t())),this._loadingCallbacks=[]})))}))}loadTile(t,e){const{request:{url:i,reload:r=!1}}=t;return(ot(i)&&nt(this._geojson)?this.loadData(i,e,r):Promise.resolve()).then((()=>{if(st(this._geojsonIndex))return super.loadTile(t,e)}))}reloadTile(t,e){return this.loadTile(Object.assign(Object.assign({},t),{request:Object.assign(Object.assign({},t.request),{reload:!0})}),e)}};let ps;const ms=new class{constructor(t){this._resolveRejects={},this.worker=t,this.worker.addEventListener("message",this.receive.bind(this))}send(t){const e=Math.round(1e18*Math.random()).toString(36).slice(0,10);return new Promise(((i,r)=>{this._resolveRejects[e]={resolve:i,reject:r},this.worker.postMessage(Object.assign({id:e},t))}))}receive(t){const{id:e,data:i,error:r}=t.data,s=this._resolveRejects[e];s&&(r?s.reject(r):s.resolve(i),delete this._resolveRejects[e])}abort(){this.worker.terminate()}}(self);onmessage=i=>{var r,s,a,o,l;const h=i.data||{},{id:d,type:c,action:u,data:p={}}=h;if("__mapsgl_init"!==c){if(!["getGlyphs","transformGeoJSON","getImages","loadImages"].includes(c))return ps||(ps="geojson"===c?new us:new Ur,ps.id=p.id),ps instanceof us&&"setData"===u?(ps.dynamic=null!==(s=null===(r=p.data)||void 0===r?void 0:r.dynamic)&&void 0!==s&&s,ps.setData(null===(a=p.data)||void 0===a?void 0:a.geojson,null===(o=p.data)||void 0===o?void 0:o.revision),void postMessage({id:d,data:{revision:null===(l=p.data)||void 0===l?void 0:l.revision},error:null})):void("reloadTile"===u?ps.reloadTile(p,ms):ps.loadTile(p,ms)).then((t=>{const e=[],i=(null==t?void 0:t.stores)?Object.keys(t.stores).reduce(((i,r)=>{const s=t.stores[r],a=n(s.serialize(),e,[".+Array","buffer"]);return a.type=s.type,i[r]=a,i}),{}):{};postMessage({id:d,data:{stores:i,dependencies:null==t?void 0:t.dependencies,geojson:ps instanceof us?ps.geojson:void 0}},void 0,e)})).catch((i=>{var r;let s=null!==(r=null==i?void 0:i.name)&&void 0!==r?r:"VectorTileWorkerError";const a={code:0,message:void 0};console.error("[MapsGL] Worker error:",i),i instanceof e?(s="InvalidResponseError",a.code=i.response.status,a.message=i.response.statusText):i instanceof t&&(s="UnauthorizedError",a.code=401,a.message="Unauthorized"),postMessage({id:d,status:a,error:`${s}: ${null==i?void 0:i.message}`})}))}else Ji=h.sessionToken}})(),r})())),(self.webpackChunk_xweather_mapsgl=self.webpackChunk_xweather_mapsgl||[]).push([["weather"],{6429:(t,e,i)=>{i.r(e),i.d(e,{default:()=>ni});var r={};i.r(r),i.d(r,{aqi:()=>yt,aqiCategories:()=>bt,cai:()=>Zt,caqi:()=>At,categories:()=>vt,china:()=>wt,co:()=>Ft,eaqi:()=>Mt,health:()=>xt,india:()=>_t,no:()=>It,no2:()=>Vt,o3:()=>Wt,pm10:()=>St,pm2p5:()=>Gt,points:()=>ft,pollutant:()=>Et,so2:()=>Ct,uba_daqi:()=>Tt,uk_daqi:()=>Rt});var s={};i.r(s),i.d(s,{aqhi:()=>Yt,aqi:()=>Nt,cai:()=>Dt,caqi:()=>Xt,china:()=>Lt,co:()=>Qt,eaqi:()=>jt,india:()=>Ot,no:()=>Kt,no2:()=>Jt,o3:()=>qt,pm10:()=>Ut,pm2p5:()=>Ht,points:()=>zt,so2:()=>$t,ubaDaqi:()=>Bt,ukDaqi:()=>Pt});var a={};i.r(a),i.d(a,{risk:()=>ue,summary:()=>de,surface:()=>ce});var n={};i.r(n),i.d(n,{riskHydroplane:()=>be,riskLowVizFog:()=>we,riskLowVizSnow:()=>xe,riskRollover:()=>ye,summary:()=>me,surface:()=>ge,temperature:()=>fe,temperatureFreeze:()=>ve});var o=i(8708);const l=class{constructor(t){this.variables=t}formattedForRequest(){return this.variables.reduce(((t,e)=>{var i,r;const s={measurement:e.measurement,dataMin:e.dataRange.min,dataMax:e.dataRange.max,noData:e.noData,outputMin:null===(i=e.outputRange)||void 0===i?void 0:i.min,outputMax:null===(r=e.outputRange)||void 0===r?void 0:r.max,timeOffset:e.timeOffset};return"string"==typeof e.code?t.push(Object.assign({id:e.code},s)):t.push(Object.assign({id:e.code.u},s),Object.assign({id:e.code.v},s)),t}),[])}};var h=i(7658),d=i(8346),c=i(4229),u=i(2102),p=i(3760),m=i(5711),g=i(2957),f=i(6081),v=i(9369),y=i(8854);const b={bar:{height:14,rounded:!0,labels:{every:10,placement:"middle",marks:"none"}},text:{color:"#fff",stroke:{color:"#000",width:1},shadow:{color:"#000"}}},x={points:{radius:4}},w=(t,e,i)=>(0,g.convert)("temperature",t,e,i),_=(t,e,i)=>(0,g.convert)("temperature-change",t,e,i),M=(t,e,i)=>(0,g.convert)("speed",t,e,i),Z=(t,e,i)=>(0,g.convert)("pressure",t,e,i),A=(t,e,i)=>(0,g.convert)("precipitation",t,e,i),T=(t,e,i)=>(0,g.convert)("distance",t,e,i),R=(t,e)=>(e.type="bar",e.title=t,(0,m.$)({},b,e)),G=(t,e)=>(e.type="point",e.title=t,(0,m.$)({},x,e));var S=i(6219),C=i(2208),I=i(5661),V=i(2050);const F={LO:"#4875FB",I:"#4875FB",TD:"#FFE700",TS:"#FEA800",H1:"#DD0002",H2:"#FF0491",H3:"#DD00FD",H4:"#FEAFFF",H5:"#EFEFEF",TY:"#DD0002",STY:"#EFEFEF"},W={"TR.A":"#FFE403","TR.W":"#FF9100","HU.A":"#FF00D2","HU.W":"#FF0018"},E=["case",[">",["at",1,["coalesce",["get","location.coordinates"],["literal",[]]]],0],1,-1],k=function(t){return{point:{type:S.m.circle,sourceType:c.V.point,paint:{fill:{color:["match",["upcase",["get","details.stormCat"]],"LO",t.LO,"I",t.I,"TD",t.TD,"TS",t.TS,"H1",t.H1,"H2",t.H2,"H3",t.H3,"H4",t.H4,"H5",t.H5,"TY",t.TY,"STY",t.STY,"#000000"]},stroke:{color:"#fff",thickness:3},circle:{radius:8}}},symbol:{type:S.m.symbol,sourceType:c.V.point,paint:{fill:{color:["match",["upcase",["get","details.stormCat"]],"LO",t.LO,"I",t.I,"TD",t.TD,"TS",t.TS,"H1",t.H1,"H2",t.H2,"H3",t.H3,"H4",t.H4,"H5",t.H5,"TY",t.TY,"STY",t.STY,"#000000"]},stroke:{color:"#fff",thickness:1},icon:{image:["match",["upcase",["get","details.stormType"]],["H","TY","TC","STY"],"mapsgl:hurricane","TS","mapsgl:tropical-storm","TD","mapsgl:tropical-depression","mapsgl:tropical-low"],size:["case",["<",["zoom"],4],{width:20,height:20},{width:36,height:36}],factor:["match",["get","details.stormType"],["H","TY","STY","TS","TD"],E,0]},text:[{value:["case",["<",["zoom"],4],null,["regex","^H\\d$",["get","details.stormCat"]],["slice",["get","details.stormCat"],1],["==",["get","details.stormCat"],"STY"],"S",null],size:12,color:"#fff",outlineColor:"#444",weight:"bold",anchor:"center",offset:{x:0,y:-3}}]}},track:{type:S.m.line,paint:{stroke:{color:["match",["upcase",["get","details.stormCat"]],"LO",t.LO,"I",t.I,"TD",t.TD,"TS",t.TS,"H1",t.H1,"H2",t.H2,"H3",t.H3,"H4",t.H4,"H5",t.H5,"TY",t.TY,"STY",t.STY,"#000000"],thickness:3}}},name:{type:"text",paint:{text:{value:["get","details.stormShortName"],size:["case",["<",["zoom"],4],12,14],color:"#fff",outlineColor:"#444",weight:"bold",anchor:"top",offset:["case",["<",["zoom"],4],{x:0,y:8},{x:0,y:12}]},symbol:{fadeOpacity:!1,pitchWithMap:!1,rotateWithMap:!1,allowOverlap:!0}}}}}(F),z=G("Tropical Cyclones",function(t){return{id:"tropical-cyclones",points:{values:[{color:t.LO,label:"Low"},{color:t.TD,label:"Depression"},{color:t.TS,label:"Storm"},{color:t.H1,label:"Cat 1"},{color:t.H2,label:"Cat 2"},{color:t.H3,label:"Cat 3"},{color:t.H4,label:"Cat 4"},{color:t.H5,label:"Cat 5"},{color:t.TY,label:"Typhoon"},{color:t.STY,label:"Super Typhoon"}]}}}(F)),N=G("Tropical Cyclone Breakpoints",function(t){return{id:"tropical-breakpoints",points:{values:[{color:t["TR.A"],label:"Tropical Storm Watch"},{color:t["TR.W"],label:"Tropical Storm Warning"},{color:t["HU.A"],label:"Hurricane Watch"},{color:t["HU.W"],label:"Hurricane Warning"}]}}}(W)),Y={title:t=>{var e,i,r;const s=null===(e=t.features)||void 0===e?void 0:e[0];return null===(r=null===(i=null==s?void 0:s.details)||void 0===i?void 0:i.stormShortName)||void 0===r?void 0:r.replace(/(-\w)$/,(t=>t.toUpperCase()))},fn:t=>{var e,i,r,s,a,n;const o=null===(e=t.features)||void 0===e?void 0:e[0];if(!o||"errorCone"===o.featureType)return"";const l=(null==o?void 0:o.timestamp)||Date.now()/1e3,h=(0,C.Yq)(new Date(1e3*l),"format[MMM d, yyyy H:mm a]"),d=[],c=null===(i=null==o?void 0:o.details)||void 0===i?void 0:i.windSpeedMPH,u=null===(r=null==o?void 0:o.details)||void 0===r?void 0:r.windSpeedKPH,p=null===(s=null==o?void 0:o.details)||void 0===s?void 0:s.windSpeedKTS;let m=null===(a=null==o?void 0:o.details)||void 0===a?void 0:a.stormCat;if(d.push("forecastPoint"===o.featureType?"Forecast":`Advisory #${null===(n=null==o?void 0:o.details)||void 0===n?void 0:n.advisoryNumber}`,`${h}`),m){switch(m=m.replace(/^H(\d)/,"Cat $1 Hurricane"),m){case"LO":m="Low";break;case"I":m="Invest";break;case"TD":m="Tropical Depression";break;case"TS":m="Tropical Storm";break;case"TY":m="Typhoon";break;case"STY":m="Super Typhoon"}d.push(`${m}`)}return c&&p&&d.push(`${p} knots, ${u} kph, ${c} mph`),d.join("<br>")}};function L(t,e){let{lat:i,lon:r}=t,{lat:s,lon:a}=e;if(Math.abs(r-a)<=180)return null;r>0&&a<0?a+=360:r<0&&a>0&&(r+=360);const n=(180-r)/(a-r);return n<0||n>1?null:i+n*(s-i)}function O(t,e,i){return{type:"Feature",geometry:{type:"LineString",coordinates:[t,e]},properties:(0,V.mg)(i)}}function j(t){const e=new Set,i=[],r=[],s=[];return t.features.forEach((t=>{const a=`${t.id}`.replace(/-trackPoint-.*$/,"").replace(/-forecastPoint-.*$/,"").replace(/-Position$/,"");`${t.id}`.includes("-Position")&&(e.add(a),i.push(t)),`${t.id}`.includes("-trackPoint")&&(e.add(a),r.push(t)),`${t.id}`.includes("-forecastPoint")&&(e.add(a),s.push(t))})),[...e].forEach((e=>{const a=i.find((t=>`${t.id}`.startsWith(e))),n=r.filter((t=>`${t.id}`.startsWith(e))),o=s.filter((t=>`${t.id}`.startsWith(e)));if(a){if(n.length>0){const t=n[0].geometry.coordinates;a.geometry.coordinates.toString()!==t.toString()&&n.push(a)}o.length>0&&o.unshift(a)}[n,o].forEach(((i,r)=>{const s=0===r?"trackLine":"forecastLine";for(let r=0;r<i.length;r++)if(r>0){const a=String(r-1).padStart(3,"0"),n=i[r-1];let o=n.geometry.coordinates;const l=i[r].geometry.coordinates;if(Math.abs(o[0]-l[0])>180){const i=o[0]-l[0]>0?-1:1,r=L({lat:o[1],lon:o[0]},{lat:l[1],lon:l[0]}),h=O(o,[-180*i,r],n.properties);h.id=`${e}-${s}String-${a}`,h.properties.featureType=s,t.features.push(h),o=[180*i,r]}const h=O(o,l,n.properties);h.id=`${e}-${s}String-${a}`,h.properties.featureType=s,t.features.push(h)}})),t.features=t.features.filter((t=>!/-trackLineString(-(NEG|POS))?$/.test(`${t.id}`)&&!`${t.id}`.endsWith("-forecastLineString")))})),t}function D(t,e){const i=e+273.15;let r=.75;i>271.16&&(r=1.75);let s=10+r*(271.16-i);return s=Math.max(0,Math.min(s,20)),t*s}function X(t,e){return 5===e?1:6===e?t<=-2?.9:t>2?.4:t>=0&&t<=2?Math.max(.5,Math.min(.9,.9-(t+2)/4*.4)):Math.max(.7,Math.min(.9,.9-(t+2)/2*.2)):7===e?t<=0?.65:t>=4?.2:Math.max(.2,Math.min(.65,.65-t/4*.45)):0}function B(t,e,i){if(3!==i&&4!==i&&12!==i||t<=0)return 0;if(e>2||e<-4)return 0;let r=1;return e>=0&&e<=2?r=1-e/2:e<0&&e>=-4&&(r=1+e/Math.abs(-4),r=Math.max(0,Math.min(1,r))),t*r}function P(t,e,i){if(8!==i||t<=0)return 0;let r=1;return e>=0&&e<=2?r=1-e/2:e<0&&e>=-4&&(r=1+e/Math.abs(-4),r=Math.max(0,Math.min(1,r))),t*r}const H="snow",U="sleet",Q="lightning-density";function K(t,e){return t.replace("{region}",e)}new Map([[H,(t,e)=>{const i=t.dimension+2*t.padding,r=.0254*3,s=e[0].dataMax,a=e[2].dataMin,n=e[2].dataMax;for(let e=0;e<i*i;e++){const i=4*e,o=t.rawData[i+1],l=a+t.rawData[i+2]/255*(n-a);let h=D(0+t.rawData[i+0]/255*(s-0),l);h*=X(l,o),h*=3.6,h=(h-0)/(r-0),h=Math.max(0,Math.min(h,1)),h=Math.floor(3*h*255);let d=h;for(let e=0;e<3;e++){const r=Math.min(255,d);t.rawData[i+e]=Math.round(r),d-=r}t.rawData[i+3]=255}}],["ice",(t,e)=>{const i=t.dimension+2*t.padding,r={min:0,max:e[0].dataMax},s=e[2].dataMin,a=e[2].dataMax,n=r;for(let e=0;e<i*i;e++){const i=4*e;let o=B(3600*(r.min+t.rawData[i+0]/255*(r.max-r.min)),s+t.rawData[i+2]/255*(a-s),t.rawData[i+1]);o/=3600,o=(o-n.min)/(n.max-n.min),o=Math.max(0,Math.min(o,1)),o=Math.floor(3*o*255);let l=o;for(let e=0;e<3;e++){const r=Math.min(255,l);t.rawData[i+e]=Math.round(r),l-=r}t.rawData[i+3]=255}}],[U,(t,e)=>{const i=t.dimension+2*t.padding,r={min:0,max:e[0].dataMax},s=e[2].dataMin,a=e[2].dataMax,n=r;for(let e=0;e<i*i;e++){const i=4*e;let o=P(3600*(r.min+t.rawData[i+0]/255*(r.max-r.min)),s+t.rawData[i+2]/255*(a-s),t.rawData[i+1]);o/=3600,o=(o-n.min)/(n.max-n.min),o=Math.max(0,Math.min(o,1)),o=Math.floor(3*o*255);let l=o;for(let e=0;e<3;e++){const r=Math.min(255,l);t.rawData[i+e]=Math.round(r),l-=r}t.rawData[i+3]=255}}],["vpd",(t,e)=>{const i=t.dimension+2*t.padding,r=e[0].dataMin,s=e[0].dataMax,a=e[2].dataMin,n=e[2].dataMax;for(let e=0;e<i*i;e++){const i=4*e,o=a+t.rawData[i+2]/255*(n-a),l=r+t.rawData[i+0]/255*(s-r)+273.15,h=-2836.5744/Math.pow(l,2)-6.028076559*1e3/l+19.54263612-2.737830188*.01*l+1.6261698*1e-5*Math.pow(l,2)+7.0229056e-10*Math.pow(l,3)-18680009e-20*Math.pow(l,4)+2.7150305*Math.log(l);let d=(100-o)/100*Math.exp(h);d/=100,d=(d-0)/70,t.rawData[i+0]=Math.round(255*d),t.rawData[i+1]=0,t.rawData[i+2]=0,t.rawData[i+3]=255}}],[Q,t=>{const e=t.dimension+2*t.padding;for(let i=0;i<e*e;i++){const e=4*i;t.rawData[e+2]=Math.min(255,t.rawData[e+0]+t.rawData[e+1])}}]]);const J={base_osm:"base.osm",base_osm_power:"base.osm.power",base_cities:"base.cities",conditions_TMP_UGRD_VGRD:"conditions.TMP_2:UGRD_10:VGRD_10",conditions_TMP_DPT_RH:"conditions.TMP_2:DPT_2:RH_2",conditions_TMP_DELTA:"conditions.TMP_2:DELTA",conditions_APTMP_DPT_RH:"conditions.APTMP_2:DPT_2:RH_2",conditions_PRMSL_VIS_GUST:"conditions.PRMSL_0:VIS_0:GUST_10",conditions_SKY_PRECIP_UVI:"conditions.TCDC_0:PRECIP_0:UVI_0",conditions_PTYPE_PRECIP_TMP:"conditions.PTYPE_0:PRECIP_0:TMP_2",conditions_PRECIP:"conditions.PRECIP_0",conditions_SNOW_DERIVED:"conditions.SNOW-PRECIP_0:TMP_2",conditions_ICE_DERIVED:"conditions.ICE-PRECIP_0:TMP_2",conditions_SLEET_DERIVED:"conditions.SLEET-PRECIP_0:TMP_2",conditions_SNOD:"conditions.SNOD_0",conditions_VPD:"conditions.VPD_0",radar_REFC_PRATE_PTYPE:"radar.REFC_0:PRATE_0:PTYPESMPL_0",forecast_REFC_PRATE_PTYPE:"forecast.REFC_0:PRATE_0:PTYPESMPL_0",airquality_AQI_PM2P5_PM10:"airquality.AQI-AirNow:PM2P5_0:PM10_0",airquality_AQI_HI_China_India:"airquality.AQI-AQHI:AQI-China:AQI-India",airquality_AQI_EAQI_UBA_UK:"airquality.AQI-EAQI:AQI-UBA_DAQI:AQI-UK_DAQI",airquality_AQI_CAI_CAQI:"airquality.AQI-CAI:AQI-CAQI",airquality_CO_NO_NO2:"airquality.CO_0:NO_0:NO2_0",airquality_O3_SO2:"airquality.O3_0:SO2_0",airquality_points:"airquality.points",maritime_WAVE:"maritime.HTSGW_0:DIRPW_0:PERPW_0",maritime_SWELL1:"maritime.SWELL_1:SWPER_1:SWDIR_1",maritime_SWELL2:"maritime.SWELL_2:SWPER_2:SWDIR_2",maritime_SWELL3:"maritime.SWELL_3:SWPER_3:SWDIR_3",maritime_WTMP_UOGRD_VOGRD:"maritime.WTMP_0:UOGRD_0:VOGRD_0",maritime_SURGE_TIDE:"maritime.SURGE_0:TIDE_0",severe_alerts:"severe.alerts",severe_stormcells:"severe.stormcells",severe_stormreports:"severe.stormreports",severe_lightning:"severe.lightning",severe_lightning_all:"severe.lightning.all",severe_lightning_flash:"severe.lightning.flash",severe_lightning_threats:"severe.lightning.threats",severe_lightning_LGTIC_LGTCG:"severe.lightning.LGT-IC:LGT-CG.{region}",severe_hail_threats:"severe.hail.threats",severe_hail_MESH_POSH:"severe.hail.MESH:POSH.{region}",severe_convective:"severe.convective",fires_obs:"fires.obs",fires_perimeter:"fires.perimeter",fires_outlook:"fires.outlook",drought:"drought",earthquakes:"earthquakes",rivers:"rivers",tropical_active:"tropical.active",tropical_archive:"tropical.archive",tropical_invests:"tropical.invests",roadweather_nowcast_us:"roadweather.nowcast.us",roadweather_nowcast_europe:"roadweather.nowcast.europe",roadweather_nowcast_japan:"roadweather.nowcast.japan",roadweather_nowcast_australia:"roadweather.nowcast.australia",roadweather_nowcast_new_zealand:"roadweather.nowcast.new_zealand",roadweather_forecast_us:"roadweather.forecast.us",roadweather_forecast_europe:"roadweather.forecast.europe",roadweather_forecast_japan:"roadweather.forecast.japan",roadweather_forecast_australia:"roadweather.forecast.australia",roadweather_forecast_new_zealand:"roadweather.forecast.new_zealand",satellite_infrared:"satellite.infrared",satellite_infrared_color:"satellite.infrared_color",satellite_visible:"satellite.visible",satellite_water_vapor:"satellite.water_vapor",satellite_geocolor:"satellite.geocolor"},q=(t,e)=>Object.assign(Object.assign(Object.assign({[J.base_osm]:()=>t.getVectorTileSourceConfig("open-street-map",e),[J.base_osm_power]:()=>t.getVectorTileSourceConfig("open-street-map-power-infrastructure",e),[J.base_cities]:()=>({type:c.o.vector,url:"https://cdn.aerisapi.com/sdk/js/mapsgl/data/cities/{z}/{x}/{y}.pbf",maxZoom:14}),[J.conditions_TMP_UGRD_VGRD]:()=>t.getEncodedSourceConfig(new l([h.X1,h.LO]),e),[J.conditions_TMP_DELTA]:()=>t.getEncodedSourceConfig(new l([h.X1,Object.assign(Object.assign({},h.X1),{timeOffset:-86400}),Object.assign(Object.assign({},h.X1),{timeOffset:-3600})]),e),[J.conditions_TMP_DPT_RH]:()=>t.getEncodedSourceConfig(new l([h.X1,h.$W,h.c1]),e),[J.conditions_APTMP_DPT_RH]:()=>t.getEncodedSourceConfig(new l([h.TX,h.$W,h.c1]),e),[J.conditions_PRMSL_VIS_GUST]:()=>t.getEncodedSourceConfig(new l([h.rv,h.XD,h.MF]),e),[J.conditions_SNOD]:()=>t.getEncodedSourceConfig(new l([h.RX]),e),[J.conditions_SKY_PRECIP_UVI]:()=>t.getEncodedSourceConfig(new l([h.h4,h.Yh,h.DP]),e),[J.conditions_PTYPE_PRECIP_TMP]:()=>t.getEncodedSourceConfig(new l([h.Kn,h.Yh,h.X1]),e),[J.conditions_PRECIP]:()=>Object.assign({},t.getEncodedSourceConfig(new l((0,u.T9)(h.Yh,3)),e)),[J.conditions_SNOW_DERIVED]:()=>Object.assign(Object.assign({},t.getEncodedSourceConfig(new l([h._k,h.Kn,h.X1]),e)),{effectiveDatasets:new l([...(0,u.T9)({code:"weather-surface_PRATE_0-SFC",measurement:{type:"snowfall",units:"m"},dataRange:{min:0,max:.0254*3}},3)]).formattedForRequest(),transformerId:H}),[J.conditions_ICE_DERIVED]:()=>Object.assign(Object.assign({},t.getEncodedSourceConfig(new l([h._k,h.Kn,h.X1]),e)),{effectiveDatasets:new l([...(0,u.T9)({code:"weather-surface_PRATE_0-SFC",measurement:{type:"rate",units:"mm/sec"},dataRange:{min:0,max:.0211666667}},3)]).formattedForRequest(),transformerId:"ice"}),[J.conditions_SLEET_DERIVED]:()=>Object.assign(Object.assign({},t.getEncodedSourceConfig(new l([h._k,h.Kn,h.X1]),e)),{effectiveDatasets:new l([...(0,u.T9)({code:"weather-surface_PRATE_0-SFC",measurement:{type:"rate",units:"mm/sec"},dataRange:{min:0,max:.0211666667}},3)]).formattedForRequest(),transformerId:U}),[J.conditions_VPD]:()=>Object.assign(Object.assign({},t.getEncodedSourceConfig(new l([h.X1,h.$W,h.c1]),e)),{transformerId:"vpd"}),[J.radar_REFC_PRATE_PTYPE]:()=>t.getEncodedSourceConfig(new l([h.lw,h.Wc,h.Jg]),e),[J.airquality_points]:()=>t.getVectorSourceConfig("air-quality"),[J.airquality_AQI_PM2P5_PM10]:()=>t.getEncodedSourceConfig(new l([h.q_.aqiAirNow,h.q_.pm2p5,h.q_.pm10]),e),[J.airquality_AQI_HI_China_India]:()=>t.getEncodedSourceConfig(new l([h.q_.aqiHealthIndex,h.q_.aqiChina,h.q_.aqiIndia]),e),[J.airquality_AQI_EAQI_UBA_UK]:()=>t.getEncodedSourceConfig(new l([h.q_.aqiEAQI,h.q_.aqiUbaDAQI,h.q_.aqiUkDAQI]),e),[J.airquality_AQI_CAI_CAQI]:()=>t.getEncodedSourceConfig(new l([h.q_.aqiCAI,h.q_.aqiCAQI]),e),[J.airquality_CO_NO_NO2]:()=>t.getEncodedSourceConfig(new l([h.q_.co,h.q_.no,h.q_.no2]),e),[J.airquality_O3_SO2]:()=>t.getEncodedSourceConfig(new l([h.q_.o3,h.q_.so2]),e),[J.maritime_WAVE]:()=>t.getEncodedSourceConfig(new l([h.xj.waveHeight,h.xj.wavePeriod,h.xj.waveDir]),e),[J.maritime_SWELL1]:()=>t.getEncodedSourceConfig(new l([h.xj.swellHeightPrimary,h.xj.swellPeriodPrimary,h.xj.swellDirPrimary]),e),[J.maritime_SWELL2]:()=>t.getEncodedSourceConfig(new l([h.xj.swellHeightSecondary,h.xj.swellPeriodSecondary,h.xj.swellDirSecondary]),e),[J.maritime_SWELL3]:()=>t.getEncodedSourceConfig(new l([h.xj.swellHeightTertiary,h.xj.swellPeriodTertiary,h.xj.swellDirTertiary]),e),[J.maritime_WTMP_UOGRD_VOGRD]:()=>t.getEncodedSourceConfig(new l([h.xj.sst,h.xj.current]),e),[J.maritime_SURGE_TIDE]:()=>t.getEncodedSourceConfig(new l([h.xj.surge,h.xj.tide]),e),[J.severe_alerts]:()=>t.getVectorSourceConfig("alerts"),[J.severe_stormcells]:()=>t.getVectorSourceConfig("stormcells"),[J.severe_stormreports]:()=>t.getVectorSourceConfig("stormreports"),[J.severe_lightning]:()=>t.getVectorSourceConfig("lightning-strikes"),[J.severe_lightning_all]:()=>t.getVectorSourceConfig("lightning-all"),[J.severe_lightning_flash]:()=>t.getVectorSourceConfig("lightning-flash"),[J.severe_lightning_threats]:()=>t.getVectorTileSourceConfig("lightning-threat-zones",e),[J.severe_hail_threats]:()=>t.getVectorTileSourceConfig("hail-threats-nowcast",e),[J.severe_convective]:function(){let{timeline:e,params:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{from:r,to:s}=$(e);return t.getGeoJSONSourceConfig("convective/outlook",void 0,Object.assign({from:r,to:s,filter:"cat"},i))}},p.ot.reduce(((i,r)=>{const s="us"===r?"conus":r;return i[K(J.severe_hail_MESH_POSH,r)]=()=>t.getEncodedSourceConfig(new l([h.R$.size(s),h.R$.posh(s)]),e,{bounds:d.wi[r]}),i}),{})),p.Q0.reduce(((i,r)=>{const s="us"===r?"conus":r;return i[K(J.severe_lightning_LGTIC_LGTCG,r)]=()=>Object.assign(Object.assign({},t.getEncodedSourceConfig(new l([h.VJ.cg(s),h.VJ.ic(s),h.VJ.cg(s)]),e,{bounds:d.wi[r]})),{transformerId:Q}),i}),{})),{[J.fires_obs]:function(){return t.getVectorSourceConfig("fires-obs-points")},[J.fires_perimeter]:function(){let{timeline:e,params:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{from:r,to:s}=$(e);return t.getGeoJSONSourceConfig("fires",void 0,Object.assign({from:r,to:s,query:"area:1",filter:"all,geo",limit:1e3},i))},[J.fires_outlook]:function(){let{timeline:e,params:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{from:r,to:s}=$(e);return t.getGeoJSONSourceConfig("fires/outlook",void 0,Object.assign({from:r,to:s,filter:"firewx"},i))},[J.drought]:function(){let{timeline:e,params:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{from:r,to:s}=$(e);return t.getGeoJSONSourceConfig("droughts/monitor",void 0,Object.assign({from:r,to:s,filter:"all,geo",sort:"code"},i))},[J.earthquakes]:function(){let{timeline:e,params:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{from:r,to:s}=$(e);return t.getGeoJSONSourceConfig("earthquakes",void 0,Object.assign({from:r,to:s,query:"mag:0",limit:1e3},i))},[J.rivers]:()=>t.getVectorSourceConfig("river-observations"),[J.tropical_active]:function(){let{timeline:e,params:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{from:r,to:s}=$(e);return t.getGeoJSONSourceConfig("tropicalcyclones/archive",o.Fu.search,Object.assign({filter:"active,dateline",limit:1e3,from:r,to:s},i),{transformGeoJSON:(t,e)=>j(e)})},[J.tropical_archive]:function(){let{timeline:e,params:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{from:r,to:s}=$(e);return t.getGeoJSONSourceConfig("tropicalcyclones/archive",o.Fu.search,Object.assign({filter:"active;notactive,dateline",limit:1e3,from:r,to:s},i),{transformGeoJSON:(t,e)=>{const i=[];let r,s,a;return e.features.forEach(((t,e)=>{if(/-trackPoint-/.test(`${t.id}`)){const e=t.properties.id;r&&e===r||(s&&(s.properties.details=a.properties.details,i.push(s)),s=Object.assign(Object.assign({},t),{id:`${t.id}`.replace(/-trackPoint-.*$/,"-Position"),properties:Object.assign(Object.assign({},t.properties),{id:r,featureType:"position"})}),r=e),a=t}else`${t.id}`.endsWith("-Position")&&(s=void 0)})),e.features=[...e.features,...i],j(e)}})},[J.tropical_invests]:function(){let{timeline:e,params:i}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{from:r,to:s}=$(e);return t.getGeoJSONSourceConfig("tropicalcyclones/archive",o.Fu.search,Object.assign({filter:"invests",from:r,to:s},i))},[J.roadweather_nowcast_us]:()=>t.getVectorTileSourceConfig("road-wx-nowcast-us",e,{bounds:d.wi.us}),[J.roadweather_nowcast_europe]:()=>t.getVectorTileSourceConfig("road-wx-nowcast-europe",e,{bounds:d.wi.europe}),[J.roadweather_nowcast_japan]:()=>t.getVectorTileSourceConfig("road-wx-nowcast-japan",e,{bounds:d.wi.japan}),[J.roadweather_nowcast_australia]:()=>t.getVectorTileSourceConfig("road-wx-nowcast-australia",e,{bounds:d.wi.australia}),[J.roadweather_nowcast_new_zealand]:()=>t.getVectorTileSourceConfig("road-wx-nowcast-new-zealand",e,{bounds:d.wi.new_zealand}),[J.roadweather_forecast_us]:()=>t.getVectorTileSourceConfig("road-wx-forecast-us",e,{bounds:d.wi.us}),[J.roadweather_forecast_europe]:()=>t.getVectorTileSourceConfig("road-wx-forecast-europe",e,{bounds:d.wi.europe}),[J.roadweather_forecast_japan]:()=>t.getVectorTileSourceConfig("road-wx-forecast-japan",e,{bounds:d.wi.japan}),[J.roadweather_forecast_australia]:()=>t.getVectorTileSourceConfig("road-wx-forecast-australia",e,{bounds:d.wi.australia}),[J.roadweather_forecast_new_zealand]:()=>t.getVectorTileSourceConfig("road-wx-forecast-new-zealand",e,{bounds:d.wi.australia}),[J.satellite_infrared]:()=>t.getRasterSourceConfig("satellite"),[J.satellite_infrared_color]:()=>t.getRasterSourceConfig("satellite-infrared-color"),[J.satellite_visible]:()=>t.getRasterSourceConfig("satellite-visible"),[J.satellite_water_vapor]:()=>t.getRasterSourceConfig("satellite-water-vapor"),[J.satellite_geocolor]:()=>t.getRasterSourceConfig("satellite-geocolor")}),$=t=>{var e,i;return{from:null!==(e=null==t?void 0:t.startDate)&&void 0!==e?e:new Date,to:null!==(i=null==t?void 0:t.endDate)&&void 0!==i?i:new Date}},tt={temperature:{title:"Temperature",fn:t=>`${t.value.toFixed(2)}&deg;C, ${g.CtoF(t.value).toFixed(2)}&deg;F`},temperature_change:{title:"Temp Change",fn:t=>{const e=t.value>0?"+":"";return`${e}${t.value.toFixed(2)}&deg;C, ${e}${g.CtoFUnit(t.value).toFixed(2)}&deg;F`}},winds:{title:"Winds",fn:t=>{if(Number.isNaN(null==t?void 0:t.value))return;const e=t.value;return`${g.degToDir(t.angle-180)} ${g.msToKph(e).toFixed(1)} kph, ${g.msToMph(e).toFixed(1)} mph`}},wind_gusts:{title:"Wind Gusts",fn:t=>`${g.msToKph(t.value).toFixed(1)} kph, ${g.msToMph(t.value).toFixed(1)} mph`},humidity:{title:"Humidity",fn:t=>`${Math.round(t.value)}%`},pressure_msl:{title:"Surface Pressure",fn:t=>`${t.value.toFixed(1)} mb, ${g.mbToHg(t.value).toFixed(2)} in`},visibility:{title:"Visibility",fn:t=>`${g.mToKm(t.value).toFixed(1)} km, ${g.mToMi(t.value).toFixed(1)} mi`},wave_height:{title:"Wave Height",fn:t=>`${t.value.toFixed(1)} m, ${g.mToFt(t.value).toFixed(1)} ft`},angle:{title:"Direction",fn:t=>`${g.degToDir(t.value-180)}`},angle_reversed:{title:"Direction",fn:t=>{let e=t.value-180-180;return e<0&&(e+=360),`${g.degToDir(e)}`}},period:{title:"Period",fn:t=>`${Math.round(t.value)} sec`},height_change:{title:"Height Change",fn:t=>{const e=t.value>0?"+":"";return`${e}${t.value.toFixed(2)} m, ${e}${g.mToFt(t.value).toFixed(1)} ft`}},radar:{title:"Radar",fn:t=>{if(t.value<5)return"";let e="Very Light";return t.value>=60?e="Extreme/Hail":t.value>=55?e="Intense":t.value>=45?e="Heavy":t.value>=35?e="Moderate":t.value>=25&&(e="Light"),`${e}: ${t.value.toFixed(2)} dbz`}},accum_precip:{title:"Accum Precip",fn:t=>{const e=3600*t.value;return`${e.toFixed(1)} mm, ${g.mmToIn(e).toFixed(2)} in`}}},et=function(t,e){return(0,m.$)({},{id:t,layer:{type:S.m.line,source:J.base_osm,sourceLayer:"boundary",paint:{stroke:{color:"#000",thickness:1,lineJoin:I.p.Round,lineCap:I.$.Round}}}},{layer:{filter:e,paint:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}}})},it=function(t,e){return(0,m.$)({},{id:t,layer:{type:S.m.line,source:J.base_osm,sourceType:c.V.line,sourceLayer:"transportation",paint:{stroke:{color:"#000",thickness:3,lineJoin:I.p.Round,lineCap:I.$.Round}}}},{layer:{filter:e,paint:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}}})},rt=function(t,e){return(0,m.$)({},{id:t,layer:{type:S.m.symbol,source:J.base_osm,sourceType:c.V.point,sourceLayer:"place",paint:{text:{value:["coalesce",["get","name:en"],["get","name"]],weight:"normal",size:12,color:"#333",outlineColor:"#fff"},symbol:{rank:{property:"rank",direction:"asc"},pitchWithMap:!1,rotateWithMap:!1,scaleWithMap:!1,allowOverlap:!1,overlapMode:"map"}}}},{layer:{filter:e,paint:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}}})},st=function(t,e){return(0,m.$)({},{id:t,layer:{type:S.m.line,source:J.base_osm,sourceType:c.V.polygon,sourceLayer:"water",paint:{fill:{color:"#333"}}}},{layer:{filter:e,paint:arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}}})},at={gas:"#E83B1F",oil:"#555",wind:"#009EFF",solar:"#FFB300"},nt=t=>G("Power Generators",{id:(0,u.RC)("power-generators"),points:{values:[{color:t.gas,label:"Gas"},{color:t.oil,label:"Oil"},{color:t.wind,label:"Wind"},{color:t.solar,label:"Solar"}]}});var ot=i(2291),lt=i(9147);const ht=(t,e,i)=>{if(i>0){const r=(0,y.SG)(Math.round((0,g.CtoF)(t)),i),s=Math.round((0,g.CtoF)(e)),a=Array.from({length:Math.ceil((s-r)/i)},((t,e)=>(0,g.FtoC)(r+e*i)));return a.push(e),a}},dt=t=>.0039215686*t,ct={type:"water"},ut={type:"land"},pt={current:[0,"rgba(16,145,253,0)",.5144,"#1091FD",.7716,"#37FF84",1.0288,"#B6FF06",1.286,"#FEE10A",1.5432,"#EFB80C",1.8004,"#FD8408",2.0576,"#F43305",2.3148,"#AB1406",2.572,"#931537",3.0864,"#A4168A"],wave_height:[0,"#091597",2.43,"#04C9FC",4.88,"#8CFB37",6.09,"#FCFA3A",7.3,"#FF6116",8.53,"#FF040B",10.36,"#79003C",12.19,"#FF2391",14.26,"#FFE0FF"],surge:[0,"#091597",.6096,"#04C9FC",1.2192,"#8CFB37",1.8288,"#FCFA3A",2.4384,"#FF6116",3.048,"#FF040B",3.6576,"#79003C",4.2672,"#FF2391",4.8768,"#FFE0FF"],period:[2,"#091597",6,"#0030AE",10,"#04C9FC",14,"#8CFB37",16,"#FCFA3A",18,"#FF6116",20,"#FF040B",22,"#79003C",24,"#FF2391"],height_diff:[-12.192,"#EF90FF",-9.144,"#D741DA",-6.096,"#8B21DA",-4.572,"#0013CA",-3.048,"#0070F1",-1.524,"#8ED4F9",-.6096,"rgba(142,212,249,0)",0,"rgba(0,0,0,0)",.6096,"rgba(255,217,42,0)",1.524,"#FFD92A",3.048,"#FF932A",4.572,"#E2330B",6.096,"#9D0000",9.144,"#D00071",12.192,"#FF698C"]},mt={current:R("Ocean Currents",{id:"current",bar:{measurement:Object.assign(Object.assign({},h.xj.current.measurement),{converter:M}),colorscale:{range:{min:0,max:h.xj.current.dataRange.max},stops:pt.current},labels:{every:t=>1,formatter:(t,e,i)=>0===e?`${Math.round(t)} %%units%%`:`${Math.round(t)}`}}}),wave_height:R("Wave/Swell Height",{id:"wave-height",bar:{measurement:Object.assign(Object.assign({},h.xj.swellHeightPrimary.measurement),{converter:T}),colorscale:{range:h.xj.waveHeight.dataRange,stops:pt.wave_height},labels:{every:t=>"m"===t?1:5,formatter:(t,e,i)=>0===e?`${Math.round(t)} %%units%%`:`${Math.round(t)}`}}}),period:R("Wave/Swell Period",{id:"period",bar:{measurement:Object.assign(Object.assign({},h.xj.swellPeriodPrimary.measurement),{converter:(t,e,i)=>(0,g.convert)("time",t,e,i)}),colorscale:{range:h.xj.wavePeriod.dataRange,stops:pt.period},labels:{every:2,formatter:(t,e,i)=>0===e?`${Math.round(t)} %%units%%`:`${Math.round(t)}`}}}),surge:R("Storm Surge",{id:"surge",bar:{measurement:Object.assign(Object.assign({},h.xj.surge.measurement),{converter:T}),colorscale:{range:h.xj.surge.dataRange,stops:pt.surge},labels:{every:t=>"m"===t?.2:1,formatter:(t,e,i)=>{const r=i.metric?t.toFixed(1):Math.round(t);return 0===e?`${r} %%units%%`:`${r}`}}}}),tide_height:R("Tide Height",{id:"tide-height",bar:{measurement:Object.assign(Object.assign({},h.xj.tide.measurement),{converter:T}),colorscale:{range:h.xj.tide.dataRange,stops:pt.height_diff},labels:{every:t=>"m"===t?.5:2,formatter:(t,e,i)=>{const r=`${t>0?"+":""}${Math.round(t)}`;return 0===e?`${r}°%%units%%`:`${r}`}}}})};var gt=i(6476);const ft={good:"#29e11f",moderate:"#f8f92a",usg:"#f9681b",unhealthy:"#f60115",very_unhealthy:"#7a2c83",hazardous:"#65001b"},vt={health:{low:"#0000ff",moderate:"#00ff00",high:"#ffff00",very_high:"#ff0000"},china:{excellent:"#00ff00",good:"#ffff00",light:"#ff9900",moderate:"#ff0000",heavy:"#540099",severe:"#800000"},india:{good:"#00cc00",satisfactory:"#66cc00",moderate:"#ffff00",poor:"#ff9900",severe:"#ff0000",hazardous:"#a52a2a"},eaqi:{good:"#50f0e6",fair:"#50ccaa",moderate:"#f0e641",poor:"#ff5050",very_poor:"#960032",extremely_poor:"#7d2181"},cai:{good:"#0000ff",moderate:"#00ff00",unhealthy:"#ffff00",very_unhealthy:"#ff0000"},caqi:{very_low:"#79bc6a",low:"#bbcf4c",medium:"#eec20b",high:"#f29305",very_high:"#e8416f"},uba_daqi:{very_good:"#50f0e6",good:"#50cdaa",moderate:"#f0e641",poor:"#ff5050",very_poor:"#960032"},uk_daqi:{low:"#009900",moderate:"#ff9900",high:"#ff0000",very_high:"#990099"}},yt=[0,ft.good,25,ft.good,75,ft.moderate,125,ft.usg,175,ft.unhealthy,251,ft.very_unhealthy,301,ft.hazardous,500,ft.hazardous],bt=[0,ft.good,51,ft.moderate,101,ft.usg,151,ft.unhealthy,200,ft.very_unhealthy,301,ft.hazardous],xt=[0,vt.health.low,3.5,vt.health.moderate,6.5,vt.health.high,10.5,vt.health.very_high],wt=[0,vt.china.excellent,51,vt.china.good,101,vt.china.light,151,vt.china.moderate,201,vt.china.heavy,301,vt.china.severe],_t=[0,vt.india.good,51,vt.india.satisfactory,101,vt.india.moderate,201,vt.india.poor,301,vt.india.severe,401,vt.india.hazardous],Mt=[0,vt.eaqi.good,26,vt.eaqi.fair,51,vt.eaqi.moderate,76,vt.eaqi.poor,101,vt.eaqi.very_poor,126,vt.eaqi.extremely_poor],Zt=[0,vt.cai.good,51,vt.cai.moderate,101,vt.cai.unhealthy,251,vt.cai.very_unhealthy],At=[0,vt.caqi.very_low,26,vt.caqi.low,51,vt.caqi.medium,76,vt.caqi.high,101,vt.caqi.very_high],Tt=[0,vt.uba_daqi.very_good,26,vt.uba_daqi.good,51,vt.uba_daqi.moderate,76,vt.uba_daqi.poor,101,vt.uba_daqi.very_poor],Rt=[0,vt.uk_daqi.low,1.5,vt.uk_daqi.moderate,4.5,vt.uk_daqi.high,7.5,vt.uk_daqi.very_high],Gt=[0,"rgb(7, 54, 161, 0)",25,"#0B8ACE",50,"#F2D538",100,"#F28012",200,"#DF0612",300,"#980657"],St=[0,"rgb(7, 54, 161, 0)",50,"#0B8ACE",100,"#F2D538",250,"#F28012",500,"#DF0612",1e3,"#980657"],Ct=[0,"rgb(7, 54, 161, 0)",5,"#0B8ACE",10,"#F2D538",25,"#F28012",50,"#DF0612",100,"#980657"],It=[0,"rgb(7, 54, 161, 0)",5,"#0B8ACE",25,"#F2D538",50,"#F28012",100,"#DF0612"],Vt=[0,"rgb(7, 54, 161, 0)",10,"#0B8ACE",20,"#F2D538",30,"#F28012",50,"#DF0612",100,"#980657"],Ft=[0,"rgb(7, 54, 161, 0)",500,"#0B8ACE",650,"#F2D538",800,"#F28012",900,"#DF0612",1e3,"#980657"],Wt=[0,"rgb(7, 54, 161, 0)",50,"#0B8ACE",100,"#F2D538",150,"#F28012",200,"#DF0612",300,"#980657"],Et=[0,"#0043D3",.2,"#3AADF3",.4,"#FAF530",.6,"#FF8418",.8,"#DE1C06",1,"#650D03"],kt={type:"concentration",units:"µg/m³"},zt=G("Air Quality",{id:"airquality-aqi-categories",points:{values:[{color:ft.good,label:"Good"},{color:ft.moderate,label:"Moderate"},{color:ft.usg,label:"Sensitive Groups"},{color:ft.unhealthy,label:"Unhealthy"},{color:ft.very_unhealthy,label:"Very Unhealthy"},{color:ft.hazardous,label:"Hazardous"}]}}),Nt=R("Air Quality Index (AQI)",{id:"airquality-aqi",bar:{colorscale:{range:h.q_.aqiAirNow.dataRange,stops:yt,positions:[0,.1,.2,.4,.6,.8,.95,1]},labels:{values:[0,50,100,150,200,300,400,500]}}}),Yt=G("Air Quality Health Index (AQHI)",{id:"airquality-aqhi",points:{values:[{color:vt.health.low,label:"Low"},{color:vt.health.moderate,label:"Moderate"},{color:vt.health.high,label:"High"},{color:vt.health.very_high,label:"Very High"}]}}),Lt=G("Air Quality Index (China)",{id:"airquality-aqi-china",points:{values:[{color:vt.china.excellent,label:"Excellent"},{color:vt.china.good,label:"Good"},{color:vt.china.light,label:"Lightly Polluted"},{color:vt.china.moderate,label:"Moderately Polluted"},{color:vt.china.heavy,label:"Heavily Polluted"},{color:vt.china.severe,label:"Severely Polluted"}]}}),Ot=G("Air Quality Index (India)",{id:"airquality-aqi-india",points:{values:[{color:vt.india.good,label:"Good"},{color:vt.india.satisfactory,label:"Satisfactory"},{color:vt.india.moderate,label:"Moderate"},{color:vt.india.poor,label:"Poor"},{color:vt.india.severe,label:"Severe"},{color:vt.india.hazardous,label:"Hazardous"}]}}),jt=G("Air Quality Index (European)",{id:"airquality-aqi-eaqi",points:{values:[{color:vt.eaqi.good,label:"Good"},{color:vt.eaqi.fair,label:"Fair"},{color:vt.eaqi.moderate,label:"Moderate"},{color:vt.eaqi.poor,label:"Poor"},{color:vt.eaqi.very_poor,label:"Very Poor"},{color:vt.eaqi.extremely_poor,label:"Extremely Poor"}]}}),Dt=G("Air Quality Index (Korean)",{id:"airquality-aqi-cai",points:{values:[{color:vt.cai.good,label:"Good"},{color:vt.cai.moderate,label:"Moderate"},{color:vt.cai.unhealthy,label:"Unhealthy"},{color:vt.cai.very_unhealthy,label:"Very Unhealthy"}]}}),Xt=G("Air Quality Index (Common)",{id:"airquality-aqi-caqi",points:{values:[{color:vt.caqi.very_low,label:"Very Low"},{color:vt.caqi.low,label:"Low"},{color:vt.caqi.medium,label:"Medium"},{color:vt.caqi.high,label:"High"},{color:vt.caqi.very_high,label:"Very High"}]}}),Bt=G("Air Quality Index (German)",{id:"airquality-aqi-uba-daqi",points:{values:[{color:vt.uba_daqi.very_good,label:"Very Good"},{color:vt.uba_daqi.good,label:"Good"},{color:vt.uba_daqi.moderate,label:"Moderate"},{color:vt.uba_daqi.poor,label:"Poor"},{color:vt.uba_daqi.very_poor,label:"Very Poor"}]}}),Pt=G("Air Quality Index (UK)",{id:"airquality-aqi-uk-daqi",points:{values:[{color:vt.uk_daqi.low,label:"Low"},{color:vt.uk_daqi.moderate,label:"Moderate"},{color:vt.uk_daqi.high,label:"High"},{color:vt.uk_daqi.very_high,label:"Very High"}]}}),Ht=R("Particle Pollution (PM2.5)",{id:"airquality-pm2p5",bar:{measurement:Object.assign({},kt),colorscale:{range:h.q_.pm2p5.dataRange,stops:Gt,resample:(0,v.A)(.65,0,.85,1)},labels:{values:[0,10,25,50,100,200,300],formatter:(t,e,i)=>0===e?`${Math.round(t)} %%units%%`:`${Math.round(t)}`}}}),Ut=R("Particle Pollution (PM10)",{id:"airquality-pm10",bar:{measurement:Object.assign({},kt),colorscale:{range:h.q_.pm10.dataRange,stops:St,resample:v.G.inCubic},labels:{values:[0,10,25,50,100,250,500,1e3],formatter:(t,e,i)=>0===e?`${Math.round(t)} %%units%%`:`${Math.round(t)}`}}}),Qt=R("Carbon Monoxide (CO)",{id:"airquality-co",bar:{measurement:Object.assign({},kt),colorscale:{range:h.q_.co.dataRange,stops:Ft,resample:v.G.inOutSqrt},labels:{values:[0,125,250,500,750,1e3],formatter:(t,e,i)=>0===e?`${Math.round(t)} %%units%%`:`${Math.round(t)}`}}}),Kt=R("Nitrogen Monoxide (NO)",{id:"airquality-no",bar:{measurement:Object.assign({},kt),colorscale:{range:h.q_.no.dataRange,stops:It,resample:v.G.inSine},labels:{values:[0,5,10,25,50,100],formatter:(t,e,i)=>0===e?`${Math.round(t)} %%units%%`:`${Math.round(t)}`}}}),Jt=R("Nitrogen Dioxide (NO2)",{id:"airquality-no2",bar:{measurement:Object.assign({},kt),colorscale:{range:h.q_.no2.dataRange,stops:Vt,resample:v.G.inSqrt},labels:{values:[0,10,20,30,50,100],formatter:(t,e,i)=>0===e?`${Math.round(t)} %%units%%`:`${Math.round(t)}`}}}),qt=R("Ozone (03)",{id:"airquality-o3",bar:{measurement:Object.assign({},kt),colorscale:{range:h.q_.o3.dataRange,stops:Wt,resample:v.G.inSqrt},labels:{values:[0,50,100,150,225,300],formatter:(t,e,i)=>0===e?`${Math.round(t)} %%units%%`:`${Math.round(t)}`}}}),$t=R("Sulfur Dioxide (SO2)",{id:"airquality-so2",bar:{measurement:Object.assign({},kt),colorscale:{range:h.q_.so2.dataRange,stops:Ct,resample:v.G.inSqrt},labels:{values:[0,5,10,25,50,100],formatter:(t,e,i)=>0===e?`${Math.round(t)} %%units%%`:`${Math.round(t)}`}}});var te=i(6694);const ee={title:"AQI",fn:t=>`${Math.round(t.value)}`},ie={title:"Air Quality",fn:t=>{var e;const i=null===(e=t.features)||void 0===e?void 0:e[0];if(null==i?void 0:i.periods){const t=i.periods[0];return`${(0,te.C)(i.place.name)}: ${t.aqi||"N/A"}${t.dominant?` (${t.dominant.toUpperCase()})`:""}`}return""}},re={title:"",fn:t=>{const e="ug/m^3";if("number"==typeof t.value)return`${Math.round(t.value)}${e?` ${e}`:""}`}};var se=i(537),ae=i(3606);const ne=["us","europe","japan","australia","new-zealand"],oe=Object.keys(h.BA),le={primary:{filter:["in",["get","class"],["literal",["motorway","motorway_link","motorway_junction","trunk","trunk_link"]]]},secondary:{filter:["in",["get","class"],["literal",["primary","primary_link","secondary","secondary_link","tertiary","tertiary_link"]]]},bridges:{type:"bridge",filter:["all",["==",["get","brunnel"],"bridge"],["in",["get","class"],["literal",["motorway","motorway_link","motorway_junction","trunk","trunk_link","primary","primary_link"]]]]}},he=Object.keys(le),de={green:"#00C500",yellow:"#FFCE00",red:"#FF0000",unknown:"#666"},ce={dry:"#bbb",moist:"#3B960F",wet:"#00E300",slush:"#B643FF",snow:"#0043FF",ice:"#FF00A6",unknown:"#666"},ue={minimal:"#bbb",low:"#FFEB00",moderate:"#FF9C00",high:"#E00200",major:"#9A00B8"};function pe(t){return G(t,{id:"roadweather-risk",points:{values:[{key:"minimal",color:ue.minimal,label:"Minimal"},{key:"low",color:ue.low,label:"Low"},{key:"moderate",color:ue.moderate,label:"Moderate"},{key:"high",color:ue.high,label:"High"},{key:"major",color:ue.major,label:"Major"}]}})}const me=G("Road Summary",{id:"roadweather-summary",points:{values:[{key:"green",color:de.green,label:"Low Risk"},{key:"yellow",color:de.yellow,label:"Moderate Risk"},{key:"red",color:de.red,label:"High Risk"},{key:"unknown",color:de.unknown,label:"Unknown"}]}}),ge=G("Road Surface",{id:"roadweather-surface",points:{values:[{key:"dry",color:ce.dry,label:"Dry"},{key:"moist",color:ce.moist,label:"Moist"},{key:"wet",color:ce.wet,label:"Wet"},{key:"slush",color:ce.slush,label:"Slush"},{key:"snow",color:ce.snow,label:"Snow"},{key:"ice",color:ce.ice,label:"Ice"},{key:"unknown",color:ce.unknown,label:"Unknown"}]}}),fe=R("Road Temperature",{id:"roadweather-temperature",bar:{measurement:{type:"temperature",units:g.Units.temperature.C,converter:w},colorscale:{range:{min:-40,max:71.11},stops:f.temperature,interval:(0,g.FtoCUnit)(10)},labels:{every:t=>20,formatter:(t,e,i)=>0===e?`${Math.round(t)}°%%units%%`:`${Math.round(t)}`}}}),ve=G("Road Temperature - Freeze",{id:"roadweather-temperature-freeze",points:{values:[{color:"#992BFF",label:"Hard Freeze"},{color:"#0046FF",label:"Freeze"},{color:"#73DAFC",label:"Near Freeze"}]}}),ye=G("Road Rollover Risk",Object.assign({id:"roadweather-risk-rollover"},pe("Road Rollover Risk"))),be=G("Road Hydroplane Risk",Object.assign({id:"roadweather-risk-hydroplane"},pe("Road Hydroplane Risk"))),xe=G("Road Snow Visibility Risk",Object.assign({id:"roadweather-risk-snow"},pe("Road Snow Visibility Risk"))),we=G("Road Fog Visibility Risk",Object.assign({id:"roadweather-risk-fog"},pe("Road Fog Visibility Risk")));function _e(t,e){return{type:e,sourceType:c.V.point,timeSeries:{mode:ae.Gp.interval},paint:Object.assign(Object.assign({fill:{color:e=>{const i=h.BA[t].code;if("temperature"===t){const t=f.temperature,r=e[i];let s;for(let e=0;e<t.length;e+=2)r>=t[e]&&r<t[e+2]&&(s=t[e+1]);return s||"#ccc"}if("temperatureFreeze"===t){const t=f.freeze,r=e[i];let s;for(let e=0;e<t.length;e+=2)r>=t[e]&&r<t[e+2]&&(s=t[e+1]);return s||"#ccc"}if(/(rollover|fog|snow|hydroplane)/i.test(t)){const t=e[i];return t>=.8?ue.major:t>=.6?ue.high:t>=.4?ue.moderate:t>=.2?ue.low:ue.minimal}const r=(e[i]||"unknown").toLowerCase();return a[t][r]||"#ccc"}}},e===S.m.circle?{circle:{radius:4},stroke:{color:"#222",thickness:1}}:{}),{symbol:{rotateWithMap:!0,pitchWithMap:!0,scaleWithMap:e===S.m.voronoi}})}}var Me=i(4918);const Ze={general:"#2ED300",hail:"#EBE100",rotating:"#F17200",tornado:"#FF2600"},Ae={avalanche:"#629FEC",blizzard:"#4100E2",fire:"#E66300",flood:"#117D01",fog:"#767676",ice:"#B300E2",hail:"#61DEF7",lightning:"#8C8C8C",rain:"#39E600",snow:"#165CEF",tides:"#40DB83",tornado:"#C50000",wind:"#D8CC03",tropical:"#FF59B3",other:"#999"},Te={general:"#b3e6b1",marginal:"#6cbd69",slight:"#f4f964",enhanced:"#e0b767",moderate:"#e0686a",high:"#fe59ff"},Re={age60:"#eeeeee",age300:"#F8E203",age600:"#F97000",ageOld:"#C4150D",typeIC:"#999"},Ge=(()=>{const t=new Me.A(["#F1DE00","#DE2900"]);return t.setDomain([0,60]),[0,10,20,30,40,50,60].reduce(((e,i)=>{const r=t.getColor(i);return e[`lead${i}`]=`rgba(${r.r}, ${r.g}, ${r.b}, ${r.a})`,e}),{})})(),Se=[0,"rgba(255,235,122,0)",1,"#FFD800",3,"#FF7E00",6,"#ED0000",8,"#E400F0",10,"#EEC5F0"],Ce=(()=>{const t=new Me.A(["#DF0ED3","#520BAE"]);return t.setDomain([0,60]),[0,10,20,30,40,50,60].reduce(((e,i)=>{const r=t.getColor(i);return e[`lead${i}`]=`rgba(${r.r}, ${r.g}, ${r.b}, ${r.a})`,e}),{})})(),Ie=((0,g.inToMM)(.5),(0,g.inToMM)(1),(0,g.inToMM)(1.5),(0,g.inToMM)(2),(0,g.inToMM)(2.5),(0,g.inToMM)(3),[0,"rgba(37,61,156,1)",.2,"#253D9C",.4,"#1D6AA2",.6,"#09BB93",.8,"#FEF112",1,"#FE5412"]);var Ve=i(7922),Fe=i(8464);const We=t=>{let e=t.toLowerCase();return e=e.replace(/thunderstorm/,"t-storm"),e=e.replace(/temperature/,"temp"),e=e.replace(/fog \(marine\)/,"fog"),(0,te.C)(e)},Ee=t=>G("Alerts",{id:"alerts",points:{layerId:`^${u.Qf}alerts(-outline|-short-fuse)?`,values:e=>new Promise(((i,r)=>{const s=[],a=[];if(e.features)e.features.forEach((t=>{const{ADVISORY:e,COLOR:i="#000000"}=t.properties;a.includes(e)||(s.push({color:i.startsWith("#")?i:`#${i}`,label:We(e)}),a.push(e))})),i(s.sort(((t,e)=>t.label.localeCompare(e.label))));else if((0,Ve.I)(e.bounds)){const r=Object.assign({},e.bounds);if(t.canAccess("advisories_summary"),(0,Ve.I)(r))return void console.warn("[MapsGL] Cannot load data for alerts legend, coordinate bounds not provided");const n=Math.abs(r.east-r.west),l=Math.floor(n/360),h=t.api().action(o.Fu.within);e.time&&h.from(e.time),l>0?(r.west=-180,r.east=180):(r.west<-180||r.west>180)&&(r.west+=360*Math.floor(r.west/360)),h.bounds(r),h.get().then((t=>{var e,r;if((null===(e=t.data)||void 0===e?void 0:e.length)>0){const e=null===(r=t.data[0].summary)||void 0===r?void 0:r.types;if(e&&Array.isArray(e))return e.forEach((t=>{let{type:e,color:i="#000000"}=t;a.includes(e)||(s.push({color:i.startsWith("#")?i:`#${i}`,label:We(e)}),a.push(e))})),void i(s)}i([])}))}}))}}),ke=G("Storm Cells",{id:"stormcells",points:{values:[{color:Ze.general,label:"General"},{color:Ze.hail,label:"Hail"},{color:Ze.rotating,label:"Rotating"},{color:Ze.tornado,label:"Tornadic"}]}}),ze=G("Storm Reports",{id:"stormreports",points:{values:[{color:Ae.avalanche,label:"Avalanche"},{color:Ae.blizzard,label:"Blizzard"},{color:Ae.fire,label:"Fire"},{color:Ae.flood,label:"Flood"},{color:Ae.fog,label:"Fog"},{color:Ae.ice,label:"Ice"},{color:Ae.hail,label:"Hail"},{color:Ae.lightning,label:"Lightning"},{color:Ae.rain,label:"Rain"},{color:Ae.snow,label:"Snow"},{color:Ae.tides,label:"Tides"},{color:Ae.tornado,label:"Tornado"},{color:Ae.wind,label:"Wind"},{color:Ae.tropical,label:"Tropical"},{color:Ae.other,label:"Other"}]}}),Ne=G("Lightning Strikes",{id:"lightning-all",points:{values:[{color:Re.age60,label:"< 1 minute"},{color:Re.age300,label:"1-5 minutes"},{color:Re.age600,label:"5-10 minutes"},{color:Re.ageOld,label:"> 10 minutes"},{color:Re.typeIC,label:"Intra-cloud"}]}}),Ye=R("Lightning Threats (lead time)",{id:"lightning-threats",bar:{colorscale:{range:{min:0,max:70},stops:Object.values(Ge).reduce(((t,e,i)=>(t.push(10*i,e),t)),[]),interpolate:!1},labels:{formatter:(t,e,i)=>0===e?`${Math.round(t)} min`:`${Math.round(t)}`}}}),Le=R("Lightning Density",{id:"lightning-density",bar:{measurement:Object.assign({},h.VJ.ic("conus").measurement),colorscale:{range:{min:0,max:10},stops:Se},labels:{every:1,formatter:(t,e,i)=>`${Math.round(t)}`}}}),Oe=R("Hail Threats (lead time)",{id:"hail-threats",bar:{colorscale:{range:{min:0,max:70},stops:Object.values(Ce).reduce(((t,e,i)=>(t.push(10*i,e),t)),[]),interpolate:!1},labels:{formatter:(t,e,i)=>0===e?`${Math.round(t)} min`:`${Math.round(t)}`}}}),je=R("Hail Size",{id:"hail-size",bar:{measurement:Object.assign(Object.assign({},h.R$.size("conus").measurement),{converter:A}),colorscale:Object.assign({range:{min:0,max:(0,g.inToMM)(3)},interval:1},(0,Fe.yw)("Viridis")),labels:{every:t=>"mm"===t?5:.5,formatter:(t,e,i)=>{const r="in"===i.units?t.toFixed(1):Math.round(t);return 0===e?`${r} %%units%%`:`${r}`}}}}),De=R("Severe Hail Probability",{id:"hail-posh",bar:{measurement:Object.assign({},h.R$.posh("conus").measurement),colorscale:Object.assign({range:{min:0,max:100}},(0,Fe.yw)("Viridis")),labels:{every:10,formatter:(t,e,i)=>0===e?`${Math.round(t)}%`:`${Math.round(t)}`}}}),Xe=G("Convective Outlook",{id:"convective",points:{values:[{color:Te.general,label:"General"},{color:Te.marginal,label:"Marginal"},{color:Te.slight,label:"Slight"},{color:Te.enhanced,label:"Enhanced"},{color:Te.moderate,label:"Moderate"},{color:Te.high,label:"High"}]}});var Be=i(5627);const Pe={title:"Alerts",fn:t=>{var e;const i=[];return null===(e=t.features)||void 0===e||e.reduce(((t,e)=>{const r=(0,te.C)(e.ADVISORY.toLowerCase());return t.includes(r)||(t.push(r),i.push({name:r,color:e.COLOR.startsWith("#")?e.COLOR:`#${e.COLOR}`})),t}),[]),0===i.length?"":(i.sort(((t,e)=>t.name.localeCompare(e.name))),`\n <div class="awxgl-tooltip-items">\n ${i.map((t=>`\n <div class="awxgl-tooltip-item">\n <span class="awxgl-tooltip-item-color" style="background-color: ${t.color};"></span>\n <span>${t.name}</span>\n </div>\n `)).join("")}\n </div>\n `)}},He={title:"Storm Cells",fn:t=>{var e,i,r,s;const a=null===(e=t.features)||void 0===e?void 0:e[0];if(null==a?void 0:a.ob){const t=null===(r=null===(i=a.ob)||void 0===i?void 0:i.movement)||void 0===r?void 0:r.dirTo;return`${(0,te.C)(null===(s=a.traits)||void 0===s?void 0:s.type)}${t?`, moving ${t}`:""}`}return""}},Ue={title:"Lightning Threat",fn:t=>{var e;const i=null===(e=t.features)||void 0===e?void 0:e.at(-1);if(!i)return"";const r=i.details.movement,s=i.period,a=[];if(r&&s){const t=(0,C.Yq)(new Date(1e3*s.range.minTimestamp),"format[MMM d, yyyy H:mm a]"),e=r.dirTo,n=(0,p.oh)(i);a.push(t),n>0&&a.push(`+${n} minute lead time`),a.push(`Moving ${e} at ${r.speedKPH} kph (${r.speedMPH} mph)`)}return a.join("<br>")}},Qe={title:"Hail Size",fn:t=>`${Math.round(t.value)} mm, ${Be.units.mmToIn(t.value).toFixed(1)} in`},Ke={title:"Severe Hail Prob",fn:t=>`${Math.round(t.value)}%`},Je={title:"Convective Outlook",fn:t=>{var e,i,r;const s=null===(e=t.features)||void 0===e?void 0:e.at(-1);return(null==s?void 0:s.details)?`${(0,te.C)(null===(r=null===(i=s.details)||void 0===i?void 0:i.risk)||void 0===r?void 0:r.type)}`:""}},qe={title:"Lightning Density",fn:t=>{const e=Math.max(1,Math.round(t.value));return`${e} strike${1===e?"":"s"}/hr`}},$e={drought:{d0:"#ffff00",d1:"#fccc66",d2:"#ff9b00",d3:"#e10000",d4:"#600000"},fire_obs:{contained:"#6C6461",active:"#E88900",new:"#E83A00"},fire_outlook:{elevated:"#FFB268",critical:"#FE666A",extreme:"#FE58FF"},earthquakes:{mini:"#6fb314",minor:"#dfcb01",light:"#ce8f00",moderate:"#ff5d01",strong:"#e90004",major:"#ce0052",great:"#b90285",catastrophic:"#f500ff"},rivers:{out_of_service:"#535353",obs_not_current:"#AFB6AD",not_defined:"#5F9CE6",low_threshold:"#7F5013",no_flooding:"#0EFF00",action:"#FFFF00",minor:"#FE8700",moderate:"#FF0100",major:"#C000FF"},vpd:[0,"rgba(255,217,42,0)",10,"#FFD92A",20,"#FF932A",30,"#E2330B",40,"#9D0000",50,"#D00071",60,"#FF698C",70,"#FFE9FF"]},ti=["case",["==",["get","report.perContained"],100],["literal",$e.fire_obs.contained],["<",["-",["now"],["to-number",["to-date",["get","report.startDateISO"]]]],864e5],["literal",$e.fire_obs.new],["literal",$e.fire_obs.active]],ei=["case",["==",["get","report.perContained"],100],["min",15,["*",["round",["+",5,["*",10,["/",["*",["max",1,["coalesce",["get","report.areaAC"],1]],.75],2e4]]]],.75]],["min",15,["round",["+",5,["*",10,["/",["max",1,["coalesce",["get","report.areaAC"],1]],2e4]]]]]],ii=["case",["has","report"],["let","contained",["coalesce",["get","report.perContained"],0],"level",["max",1,["min",5,["floor",["+",1,["*",4,["/",["-",["var","contained"],50],50]]]]]],["concat","mapsgl:fire-",["to-string",["var","level"]]]],"fire"],ri=["case",["has","report"],["let","area",["max",1,["get","report.areaAC"]],"factor",["max",0,["min",1,["/",["var","area"],2e4]]],"size",["min",40,["round",["+",18,["*",22,["var","factor"]]]]],{width:["var","size"],height:["var","size"]}],{width:20,height:20}],si={title:"Fires",fn:t=>{var e,i,r;const s=null===(e=t.features)||void 0===e?void 0:e[0];if(null==s?void 0:s.report){const t=s.report,e=Math.round(Math.max(1,null!==(r=null===(i=s.perimeter)||void 0===i?void 0:i.areaAC)&&void 0!==r?r:t.areaAC)),a=t.perContained,n=`${t.name}`,o=[];return e&&!1===Number.isNaN(e)&&o.push(`${e.toLocaleString("en-US")} acre${e>1?"s":""}`),a&&o.push(`(${t.perContained}% contained)`),`${n}${o.length>0?` - ${o.join(" ")}`:""}`}return""}},ai=t=>{const e={temperature:R("Temperatures",{id:"temperature",bar:{measurement:Object.assign(Object.assign({},h.X1.measurement),{converter:w}),colorscale:{range:h.X1.dataRange,stops:f.temperature},labels:{every:t=>20,formatter:(t,e,i)=>0===e?`${Math.floor(t)}°%%units%%`:`${Math.floor(t)}`}}}),temperature_change_24hr:R("24-Hour Temp Change",{id:"temperature-change-24hr",bar:{measurement:Object.assign(Object.assign({},h.X1.measurement),{converter:_}),colorscale:{range:{min:(0,g.FtoCUnit)(-50),max:(0,g.FtoCUnit)(50)},stops:f.tempChange24Hour},labels:{every:t=>"C"===t?10:20,formatter:(t,e,i)=>{const r=`${t>0?"+":""}${Math.floor(t)}`;return 0===e?`${r}°%%units%%`:`${r}`}}}}),temperature_change_1hr:R("1-Hour Temp Change",{id:"temperature-change-1hr",bar:{measurement:Object.assign(Object.assign({},h.X1.measurement),{converter:_}),colorscale:{range:{min:(0,g.FtoCUnit)(-40),max:(0,g.FtoCUnit)(40)},stops:f.tempChange1Hour},labels:{every:t=>10,formatter:(t,e,i)=>{const r=`${t>0?"+":""}${Math.floor(t)}`;return 0===e?`${r}°%%units%%`:`${r}`}}}}),dewpoint:R("Dew Point",{id:"dew-point",bar:{measurement:Object.assign(Object.assign({},h.X1.measurement),{converter:w}),colorscale:{range:h.$W.dataRange,stops:f.dewpoint},labels:{every:t=>20,formatter:(t,e,i)=>0===e?`${Math.floor(t)}°%%units%%`:`${Math.floor(t)}`}}}),humidity:R("Humidity",{id:"humidity",bar:{measurement:Object.assign({},h.c1.measurement),colorscale:{range:h.c1.dataRange,stops:f.temperature},labels:{every:20,formatter:(t,e,i)=>0===e?`${Math.floor(t)}%`:`${Math.floor(t)}`}}}),pressure_msl:R("Surface Pressure",{id:"mslp",bar:{measurement:Object.assign(Object.assign({},h.rv.measurement),{converter:Z}),colorscale:{range:h.rv.dataRange,stops:f.mslp},labels:{every:t=>"mb"===t?20:1,formatter:(t,e,i)=>{const r=i.metric?Math.floor(t):t.toFixed(2);return 0===e?`${r} %%units%%`:`${r}`}}}}),heatindex:R("Heat Index",{id:"heat-index",bar:{measurement:Object.assign(Object.assign({},h.X1.measurement),{converter:w}),colorscale:{range:{min:(0,g.FtoC)(80),max:h.X1.dataRange.max},stops:f.temperature},labels:{every:t=>"C"===t?5:10,formatter:(t,e,i)=>0===e?`${Math.floor(t)}°%%units%%`:`${Math.floor(t)}`}}}),windchill:R("Wind Chill",{id:"wind-chill",bar:{measurement:Object.assign(Object.assign({},h.X1.measurement),{converter:w}),colorscale:{range:{min:h.X1.dataRange.min,max:(0,g.FtoC)(40)},stops:f.temperature},labels:{every:t=>"C"===t?10:20,formatter:(t,e,i)=>0===e?`${Math.floor(t)}°%%units%%`:`${Math.floor(t)}`}}}),windspeed:R("Wind Speeds",{id:"windspeed",bar:{measurement:Object.assign(Object.assign({},h.LO.measurement),{converter:M}),colorscale:{range:{min:0,max:h.LO.dataRange.max},stops:f.windspeed},labels:{every:t=>"kmh"===t?20:10,formatter:(t,e,i)=>0===e?`${Math.floor(t)} %%units%%`:`${Math.floor(t)}`}}}),cloud_cover:R("Cloud Cover",{id:"cloud-cover",bar:{colorscale:{range:h.h4.dataRange,stops:f.sky},labels:{every:20,formatter:(t,e,i)=>0===e?`${Math.floor(t)}%`:`${Math.floor(t)}`}}}),visibility:R("Visibility",{id:"visibility",bar:{measurement:Object.assign(Object.assign({},h.XD.measurement),{converter:T}),colorscale:{range:h.XD.dataRange,stops:f.visibility},labels:{every:t=>"km"===t?2:1,formatter:(t,e,i)=>0===e?`${Math.floor(t)} %%units%%`:`${Math.floor(t)}`}}}),radar:{id:"radar",type:"bar",title:"Radar",bar:[(0,m.$)({},b.bar,{colorscale:{range:{min:6,max:h.Jg.dataRange.max},stops:f.radar.rain},labels:{values:[{value:0,label:"Light"},{value:.5,label:"RAIN"},{value:1,label:"Heavy"}],normalized:!0}}),(0,m.$)({},b.bar,{colorscale:{range:{min:6,max:h.Jg.dataRange.max},stops:f.radar.mix},labels:{values:[{value:0,label:"Light"},{value:.5,label:"MIX"},{value:1,label:"Heavy"}],normalized:!0}}),(0,m.$)({},b.bar,{colorscale:{range:{min:6,max:h.Jg.dataRange.max},stops:f.radar.snow},labels:{values:[{value:0,label:"Light"},{value:.5,label:"SNOW"},{value:1,label:"Heavy"}],normalized:!0}})],text:b.text,onBeforeUpdate:t=>{var e;const i=t.bar,r={min:6,max:h.Jg.dataRange.max},s=["RAIN","MIX","SNOW"];return Array.isArray(i)?i.forEach(((t,e)=>{var i;if(t.colorscale&&(t.colorscale.range=r),Array.isArray(null===(i=t.labels)||void 0===i?void 0:i.values)){const i=s[e];t.labels.values.forEach(((t,e)=>{"object"==typeof t&&.5===t.value&&(t.label=i)}))}})):(i.colorscale&&(i.colorscale.range=r),Array.isArray(null===(e=i.labels)||void 0===e?void 0:e.values)&&i.labels.values.forEach(((t,e)=>{"object"==typeof t&&.5===t.value&&(t.label="Moderate")}))),t}},hour_precip:R("1-Hour Precipitation",{id:"1hr-precip",bar:{measurement:{type:"precipitation",units:g.Units.rate.mms,converter:A},colorscale:{range:{min:(0,g.inToMMRate)(.01),max:h.Yh.dataRange.max},resample:v.G.inSine},labels:{values:t=>"in"===t?[.01,.1,.5,1,2,3,4,5]:[1,2,5,10,25,50,75,100,125],formatter:(t,e,i)=>{const r=(0,y.NT)(t,2);return 0===e?`${r} %%units%%`:`${r}`}}}}),accum_precip:R("Accumulated Precipitation",{id:"accum-precip",bar:{measurement:{type:"precipitation",units:g.Units.rate.mms,converter:A},colorscale:{range:{min:(0,g.inToMMRate)(.01),max:(0,g.inToMMRate)(20)}},labels:{values:t=>"in"===t?[.01,.1,.5,1,2,3,4,5,6,7,8,10,12,14,16,18,20,25,30]:[1,2,5,10,20,25,30,40,50,60,75,100,125,150,200,250,300,400,500,600,700],formatter:(t,e,i)=>{const r=(0,y.NT)(t,2);return 0===e?`${r} %%units%%`:`${r}`}}}}),hour_snow:R("1-Hour Snowfall",{id:"hour-snow",bar:{measurement:{type:"snowfall",units:g.Units.precipitation.m,converter:A},colorscale:{range:{min:(0,g.inToM)(.1),max:(0,g.inToM)(12)},stops:f.snowdepth,resample:v.G.inSine},labels:{values:t=>"in"===t?[.1,.5,1,2,4,6,8,10,12]:[.3,1,3,5,10,20,30],formatter:(t,e,i)=>{const r=(0,y.NT)(t,2);return 0===e?`${r} %%units%%`:`${r}`}}}}),accum_snow:R("Accumulated Snowfall",{id:"accum-snow",bar:{measurement:{type:"snowfall",units:g.Units.precipitation.m,converter:A},colorscale:{range:{min:(0,g.inToM)(.1),max:(0,g.inToM)(60)},stops:f.snowdepth,resample:(0,v.A)(.55,.09,1,.75)},labels:{values:t=>"in"===t?[.1,1,3,6,9,12,18,24,36,48,60]:[.5,3,5,10,15,25,50,75,100,150],formatter:(t,e,i)=>{const r=(0,y.NT)(t,2);return 0===e?`${r} %%units%%`:`${r}`}}}}),hour_sleet:R("1-Hour Sleet",{id:"hour-sleet",bar:{measurement:{type:"precipitation",units:g.Units.rate.mms,converter:A},colorscale:{range:{min:(0,g.inToMMRate)(.01),max:h._k.dataRange.max},resample:v.G.inSine},labels:{values:t=>"in"===t?[.01,.1,.5,1,2,3]:[1,2,5,10,25,50,75],formatter:(t,e,i)=>{const r=(0,y.NT)(t,2);return 0===e?`${r} %%units%%`:`${r}`}}}}),accum_sleet:R("Accumulated Sleet",{id:"accum-sleet",bar:{measurement:{type:"precipitation",units:g.Units.rate.mms,converter:A},colorscale:{range:{min:(0,g.inToMMRate)(.01),max:h._k.dataRange.max},resample:v.G.inSine},labels:{values:t=>"in"===t?[.01,.1,.5,1,2,3]:[1,2,5,10,25,50,75],formatter:(t,e,i)=>{const r=(0,y.NT)(t,2);return 0===e?`${r} %%units%%`:`${r}`}}}}),hour_ice:R("1-Hour Ice",{id:"hour-ice",bar:{measurement:{type:"precipitation",units:g.Units.rate.mms,converter:A},colorscale:{range:{min:(0,g.inToMMRate)(.01),max:h._k.dataRange.max},resample:v.G.inSine},labels:{values:t=>"in"===t?[.01,.1,.5,1,2,3]:[1,2,5,10,25,50,75],formatter:(t,e,i)=>{const r=(0,y.NT)(t,2);return 0===e?`${r} %%units%%`:`${r}`}}}}),accum_ice:R("Accumulated Ice",{id:"accum-ice",bar:{measurement:{type:"precipitation",units:g.Units.rate.mms,converter:A},colorscale:{range:{min:(0,g.inToMMRate)(.01),max:h._k.dataRange.max},resample:v.G.inSine},labels:{values:t=>"in"===t?[.01,.1,.5,1,2,3]:[1,2,5,10,25,50,75],formatter:(t,e,i)=>{const r=(0,y.NT)(t,2);return 0===e?`${r} %%units%%`:`${r}`}}}}),snow_depth:R("Snow Depth",{id:"snow-depth",bar:{measurement:{type:"snowfall",units:g.Units.precipitation.m,converter:A},colorscale:{range:{min:(0,g.inToM)(1),max:h.RX.dataRange.max},stops:f.snowdepth,resample:(0,v.A)(.7,0,1,.6)},labels:{values:t=>"in"===t?[1,3,6,12,18,24,36,48,72,96,120,168,216,300]:[3,5,10,25,50,100,200,350,500,700],formatter:(t,e,i)=>{const r=(0,y.NT)(t,2);return 0===e?`${r} %%units%%`:`${r}`}}}}),uvi:R("Ultraviolet Index (UVI)",{id:"uvi",bar:{colorscale:{range:{min:1,max:12},stops:f.uvi,interval:1},labels:{every:1,formatter:(t,e,i)=>`${Math.floor(t)}`}}})};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},{water:{id:"base.water.fill",layer:{type:S.m.fill,source:J.base_osm,sourceType:c.V.polygon,sourceLayer:"water",paint:{fill:{color:"#333"}}}},"admin-2-boundaries":et("base.admin_2_boundaries.line",["all",["==",["get","admin_level"],2],["!=",["get","maritime"],1]],{stroke:{color:"#333",thickness:t=>t.zoom<2?1:2,opacity:.85}}),"admin-3-4-boundaries":et("base.admin_3_4_boundaries.line",["all",[">=",["get","admin_level"],3],["<=",["get","admin_level"],4],["!=",["get","maritime"],1]],{stroke:{color:"#333",opacity:t=>t.zoom<2?.5:.75}}),"admin-5-6-boundaries":et("base.admin_5_6_boundaries.line",["all",[">=",["get","admin_level"],5],["<=",["get","admin_level"],6],["!=",["get","maritime"],1]],{stroke:{color:"#333",opacity:.6}}),"waterway-ocean-boundaries":st("base.waterway_ocean.line",["==","class","ocean"],{stroke:{color:"#333",thickness:t=>t.zoom<2?1:2,opacity:.85}}),"waterway-lake-river-boundaries":st("base.waterway_lake.line",["any",["==",["get","class"],"river"],["==",["get","class"],"lake"]],{stroke:{color:"#333",thickness:1,opacity:.7}}),boundaries:["admin-2-boundaries","admin-3-4-boundaries","admin-5-6-boundaries","waterway-ocean-boundaries","waterway-lake-river-boundaries"],"place-city":rt("base.place_city.text",["in",["get","class"],["literal",["city","town"]]],{text:{size:t=>{const e=t.rank,i=t.zoom;return"city"===t.class?i<4?10:i<6?12:i<8?e<5?16:12:i<11?e<5?20:16:22:i>10?16:12}}}),"place-neighborhood":rt("base.place_neighborhood.text",["in",["get","class"],["literal",["village","neighbourhood","hamlet","suburb"]]],{text:{size:t=>t.zoom<13?11:14}}),"place-state":rt("base.place_state.text",["in",["get","class"],["literal",["state","province"]]],{text:{size:t=>t.zoom<4?10:12,color:"#999",weight:"bold",transform:"uppercase",letterSpacing:.1}}),"place-country":rt("base.place_country.text",["in",["get","class"],["literal",["country","continent"]]],{text:{size:t=>{const e=t.zoom;return e<2?13:e<4?16:20},color:"#666"}}),places:["place-country","place-state","place-city","place-neighborhood"],"waterways-text":{id:"base.waterways.text",layer:{type:S.m.symbol,source:J.base_osm,sourceType:c.V.point,sourceLayer:"water_name",paint:{text:{value:["coalesce",["get","name:en"],["get","name"]],weight:t=>"ocean"===t.class?"bold":"normal",size:t=>{const e=t.zoom;return"ocean"===t.class?e<3?13:20:"sea"===t.class&&e<4?10:12},letterSpacing:t=>"ocean"===t.class?.1:0,color:"#999"},symbol:{rank:{property:"rank",direction:"asc"},pitchWithMap:!1,rotateWithMap:!1,allowOverlap:!1}}}},"road-all":it("admin.road_all.line"),"road-motorway":it("admin.road_motorway.line",["==",["get","class"],"motorway"],{stroke:{thickness:t=>{const e=t.zoom;return e<5?1:e<10?2:e<15?4:10}}}),"road-trunk":it("admin.road_trunk.line",["==",["get","class"],"trunk"],{stroke:{thickness:t=>t.zoom<10?1:2,opacity:t=>{const e=t.zoom;return e<5?0:e<10?.5:1}}}),"road-primary":it("admin.road_primary.line",["==",["get","class"],"primary"],{stroke:{thickness:1,color:t=>t.zoom<10?"#999":"#000",opacity:t=>t.zoom<5?0:1}}),"road-secondary-tertiary":it("admin.road_secondary_tertiary.line",["in",["get","class"],["literal",["secondary","tertiary"]]],{stroke:{thickness:t=>t.zoom<12?1:2,opacity:t=>{const e=t.zoom;return e<8?0:e<12?.5:1}}}),"road-street":it("admin.road_street.line",["in",["get","class"],["literal",["minor","service"]]],{stroke:{thickness:1,opacity:.6}}),roads:["road-motorway","road-trunk","road-primary","road-secondary-tertiary","road-street"],"power-lines":{id:"base.power_lines.line",layer:{type:S.m.line,source:J.base_osm_power,sourceLayer:"power_lines",paint:{stroke:{color:"#B9713E",thickness:2,lineJoin:I.p.Round,lineCap:I.$.Round}}}},"power-plants":{id:"base.power_plants.fill",layer:{type:S.m.fill,source:J.base_osm_power,sourceLayer:"power_plants",paint:{fill:{color:"#895D3E"}}}},"power-generators":function(t,e){return{id:"base.power_generators.fill",layer:{type:S.m.circle,source:J.base_osm_power,sourceLayer:"power_generators",filter:["in",["get","energy_source"],["literal",["gas","oil","wind","solar"]]],paint:{fill:{color:e=>{var i,r;const s=null===(i=e.energy_source)||void 0===i?void 0:i.toLowerCase();return s&&null!==(r=t[s])&&void 0!==r?r:"#333"}},stroke:{color:"#fff",thickness:2},circle:{radius:6}}},legend:e(t)}}(at,nt),"power-generator-boundaries":function(t,e){return{id:"base.power_generator_boundaries.fill",layer:{type:S.m.fill,source:J.base_osm_power,sourceLayer:"power_generator_bounds",filter:["in",["get","energy_source"],["literal",["gas","oil","wind","solar"]]],paint:{fill:{color:e=>{var i,r;const s=null===(i=e.energy_source)||void 0===i?void 0:i.toLowerCase();return s&&null!==(r=t[s])&&void 0!==r?r:"#333"},opacity:.5},stroke:{color:e=>{var i,r;const s=null===(i=e.energy_source)||void 0===i?void 0:i.toLowerCase();return s&&null!==(r=t[s])&&void 0!==r?r:"#333"},thickness:2}}},legend:e(t)}}(at,nt),"power-generator-centroids":function(t,e){return{id:"base.power_generator_centroids.circle",layer:{type:S.m.circle,source:J.base_osm_power,sourceLayer:"power_generator_centroids",filter:["in",["get","energy_source"],["literal",["gas","oil","wind","solar"]]],paint:{fill:{color:e=>{var i,r;const s=null===(i=e.energy_source)||void 0===i?void 0:i.toLowerCase();return s&&null!==(r=t[s])&&void 0!==r?r:"#333"}},stroke:{color:"#fff",thickness:2},circle:{radius:6}}},legend:e(t)}}(at,nt),"cities-points":{id:"base.cities.points",layer:{type:S.m.circle,source:J.base_cities,sourceType:c.V.point,sourceLayer:"cities",paint:{fill:{color:"#000"},circle:{radius:3}}}}}),[{id:"conditions.radar.fill",code:"radar",source:J.radar_REFC_PRATE_PTYPE}].reduce(((t,i)=>{let{id:r,code:s,source:a}=i;return t[s]={id:r,layer:(0,u.Af)(a,{quality:S.E.exact,zoomOffset:0,paint:{sample:{channel:"r",colorscale:{masks:[{channel:"g",value:1,drawRange:{min:10},colorscale:{range:{min:0,max:87},stops:f.radar.rain}},{channel:"g",value:3,colorscale:{range:{min:0,max:87},stops:f.radar.mix}},{channel:"g",value:2,colorscale:{range:{min:0,max:87},stops:f.radar.snow}}]}}}}),legend:e.radar,evaluator:tt.radar},t}),{})),((t,e,i)=>{const r={temperatures:{id:(0,u.RC)("conditions.temperature.fill"),layer:(0,u.Af)(J.conditions_TMP_UGRD_VGRD,{paint:{sample:{channel:"r",colorscale:{stops:f.temperature,breaks:ht}}}}),legend:e.temperature,evaluator:i.temperature},"temperatures-contour":{id:(0,u.RC)("conditions.temperature.contour"),layer:(0,u.Af)(J.conditions_TMP_UGRD_VGRD,{type:S.m.contour,paint:{sample:{channel:"r",smoothing:1,colorscale:{stops:f.temperature,interval:1,breaks:ht}},contour:{interval:(0,g.FtoCUnit)(2),majorInterval:(0,g.FtoCUnit)(10)}}}),legend:e.temperature,evaluator:i.temperature},"temperatures-24hr-change":{id:(0,u.RC)("conditions.temperature_24hr_change.fill"),layer:(0,u.Af)(J.conditions_TMP_DELTA,{measurement:{type:"temperature-change",units:g.Units.temperature.C},paint:{sample:{expression:lt.BG.difference,channel:"rg",offset:.5,colorscale:{range:{min:(0,g.FtoCUnit)(-50),max:(0,g.FtoCUnit)(50)},stops:f.tempChange24Hour}}}}),legend:e.temperature_change_24hr,evaluator:i.temperature_change},"temperatures-1hr-change":{id:(0,u.RC)("conditions.temperature_1hr_change.fill"),layer:(0,u.Af)(J.conditions_TMP_DELTA,{measurement:{type:"temperature-change",units:g.Units.temperature.C},paint:{sample:{expression:lt.BG.difference,channel:"rb",offset:.5,colorscale:{range:{min:(0,g.FtoCUnit)(-40),max:(0,g.FtoCUnit)(40)},stops:f.tempChange1Hour}}}}),legend:e.temperature_change_1hr,evaluator:i.temperature_change},"wind-speeds":{id:(0,u.RC)("conditions.wind_speed.fill"),layer:(0,u.Af)(J.conditions_TMP_UGRD_VGRD,{paint:{sample:{channel:"gb",expression:lt.BG.vector,colorscale:{range:{min:0,max:h.LO.dataRange.max},stops:f.windspeed}}}}),legend:e.windspeed,evaluator:i.winds},"wind-speeds-contour":{id:(0,u.RC)("conditions.wind_speed.contour"),layer:(0,u.Af)(J.conditions_TMP_UGRD_VGRD,{type:S.m.contour,paint:{sample:{channel:"gb",expression:lt.BG.vector,smoothing:1,colorscale:{range:{min:0,max:h.LO.dataRange.max},stops:f.windspeed,interval:(0,g.mphToMsUnit)(5)}},contour:{interval:(0,g.mphToMsUnit)(5),majorInterval:(0,g.mphToMsUnit)(25)}}}),legend:e.windspeed,evaluator:i.winds},"wind-dir":{id:(0,u.RC)("conditions.wind_speed.arrow"),layer:(0,u.Af)(J.conditions_TMP_UGRD_VGRD,{type:S.m.grid,paint:{sample:{channel:"gb",expression:lt.BG.vector,interpolation:lt.uN.bilinear,smoothing:1,colorscale:{range:{min:0,max:h.LO.dataRange.max},stops:f.windspeed}},grid:{spacing:30},icon:{type:"arrow",size:{width:40,height:20},anchor:"left"},symbol:{rotateWithMap:!0,pitchWithMap:!0}}}),legend:e.windspeed,evaluator:i.winds},"wind-barbs":{id:(0,u.RC)("conditions.wind_speed.barb"),layer:(0,u.Af)(J.conditions_TMP_UGRD_VGRD,{type:S.m.grid,paint:{sample:{channel:"gb",expression:lt.BG.vector,interpolation:lt.uN.bilinear,smoothing:1,colorscale:{range:{min:0,max:h.LO.dataRange.max},stops:f.windspeed}},fill:{color:"#fff"},grid:{spacing:30},icon:{atlas:{ids:[0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100].map((t=>`mapsgl:wind-barb-${t}`)),interval:2.572222},size:{width:40,height:40},anchor:"bottom",offset:{x:0,y:5},rotation:-90},symbol:{rotateWithMap:!0,pitchWithMap:!0}}}),legend:e.windspeed,evaluator:i.winds},"wind-particles":{id:(0,u.RC)("conditions.wind_speed.particle"),layer:(0,u.Af)(J.conditions_TMP_UGRD_VGRD,{type:S.m.particle,paint:{sample:{channel:"gb",expression:lt.BG.vector,interpolation:lt.uN.bilinear,smoothing:1,colorscale:{range:{min:0,max:h.LO.dataRange.max},stops:f.windspeed}},particle:{density:ot.j.normal,size:2},symbol:{sizeAttenuation:!0,rotateWithMap:!0,pitchWithMap:!0}}}),legend:e.windspeed,evaluator:i.winds},"wind-gusts":{id:(0,u.RC)("conditions.wind_gust.fill"),layer:(0,u.Af)(J.conditions_PRMSL_VIS_GUST,{paint:{sample:{channel:"b",colorscale:{range:{min:0,max:h.LO.dataRange.max},stops:f.windspeed}}}}),legend:e.windspeed,evaluator:i.wind_gusts},"feels-like":{id:(0,u.RC)("conditions.feels_like.fill"),layer:(0,u.Af)(J.conditions_APTMP_DPT_RH,{paint:{sample:{channel:"r",colorscale:{stops:f.temperature,breaks:ht}}}}),legend:e.temperature,evaluator:Object.assign(Object.assign({},i.temperature),{title:"Feels Like"})},"wind-chill":{id:(0,u.RC)("conditions.wind_chill.fill"),layer:(0,u.Af)(J.conditions_APTMP_DPT_RH,{paint:{sample:{channel:"r",drawRange:{max:(0,g.FtoC)(40)},colorscale:{stops:f.temperature,breaks:ht}}}}),legend:e.windchill,evaluator:Object.assign(Object.assign({},i.temperature),{title:"Wind Chill"})},"heat-index":{id:(0,u.RC)("conditions.heat_index.fill"),layer:(0,u.Af)(J.conditions_APTMP_DPT_RH,{paint:{sample:{channel:"r",drawRange:{min:(0,g.FtoC)(80)},colorscale:{stops:f.temperature,breaks:ht}}}}),legend:e.heatindex,evaluator:Object.assign(Object.assign({},i.temperature),{title:"Heat Index"})},"dew-points":{id:(0,u.RC)("conditions.dew_point.fill"),layer:(0,u.Af)(J.conditions_APTMP_DPT_RH,{paint:{sample:{channel:"g",colorscale:{stops:f.dewpoint,breaks:ht}}}}),legend:e.dewpoint,evaluator:Object.assign(Object.assign({},i.temperature),{title:"Dew Point"})},humidity:{id:(0,u.RC)("conditions.humidity.fill"),layer:(0,u.Af)(J.conditions_APTMP_DPT_RH,{paint:{sample:{channel:"b",colorscale:{stops:f.humidity}}}}),legend:e.humidity,evaluator:i.humidity},"pressure-msl":{id:(0,u.RC)("conditions.pressure_msl.fill"),layer:(0,u.Af)(J.conditions_PRMSL_VIS_GUST,{quality:S.E.low,paint:{sample:{channel:"r",colorscale:{stops:f.mslp}}}}),legend:e.pressure_msl,evaluator:i.pressure_msl},"pressure-msl-contour":{id:(0,u.RC)("conditions.pressure_msl.contour"),layer:(0,u.Af)(J.conditions_PRMSL_VIS_GUST,{type:S.m.contour,quality:S.E.low,paint:{sample:{channel:"r",smoothing:.5,colorscale:{stops:f.mslp,interval:1}},contour:{interval:1,majorInterval:10}}}),legend:e.pressure_msl,evaluator:i.pressure_msl},"cloud-cover":{id:(0,u.RC)("conditions.cloud_cover.fill"),layer:(0,u.Af)(J.conditions_SKY_PRECIP_UVI,{paint:{sample:{channel:"r",colorscale:{stops:f.sky}}}}),legend:e.cloud_cover},precip:{id:(0,u.RC)("conditions.precip.fill"),layer:(0,u.Af)(J.conditions_PRECIP,{quality:S.E.high,paint:{sample:{channel:"rgb",colorscale:{range:{min:0,max:g.inToMMRate(5)},stops:f.precip_accum},drawRange:{min:g.inToMMRate(.01)}}}}),legend:e.hour_precip,evaluator:Object.assign(Object.assign({},i.accum_precip),{title:"1-Hour Precip"})},"precip-rate":{id:(0,u.RC)("conditions.precip_rate.fill"),layer:(0,u.Af)(J.conditions_SKY_PRECIP_UVI,{paint:{sample:{channel:"g",colorscale:{range:{min:0,max:g.inToMMRate(25)},stops:f.prate}}}}),legend:e.radar,evaluator:Object.assign(Object.assign({},i.radar),{title:"Precip Rate"})},snow:{id:(0,u.RC)("conditions.snow.fill"),layer:(0,u.Af)(J.conditions_SNOW_DERIVED,{quality:S.E.high,paint:{sample:{channel:"rgb",colorscale:{stops:f.snowdepth},dataRange:{min:0,max:g.inToM(12)},drawRange:{min:g.inToM(.1)}}}}),legend:e.hour_snow,evaluator:{title:"1-Hour Snowfall",fn:t=>`${(100*t.value).toFixed(1)} cm, ${g.mToIn(t.value).toFixed(1)} in`}},sleet:{id:(0,u.RC)("conditions.sleet.fill"),layer:(0,u.Af)(J.conditions_SLEET_DERIVED,{quality:S.E.high,paint:{sample:{channel:"rgb",colorscale:{range:{min:0,max:g.inToMMRate(3)},stops:f.sleet_accum},drawRange:{min:g.inToMMRate(.01)}}}}),legend:e.hour_sleet,evaluator:{title:"1-Hour Sleet",fn:t=>{const e=3600*t.value;return`${(e/10).toFixed(1)} cm, ${g.mmToIn(e).toFixed(2)} in`}}},ice:{id:(0,u.RC)("conditions.ice.fill"),layer:(0,u.Af)(J.conditions_ICE_DERIVED,{quality:S.E.high,paint:{sample:{channel:"rgb",colorscale:{range:{min:0,max:g.inToMMRate(3)},stops:f.ice_accum},drawRange:{min:g.inToMMRate(.01)}}}}),legend:e.hour_ice,evaluator:Object.assign(Object.assign({},i.accum_precip),{title:"1-Hour Ice"})},"snow-depth":{id:(0,u.RC)("conditions.snow_depth.fill"),layer:(0,u.Af)(J.conditions_SNOD,{quality:S.E.high,paint:{sample:{channel:"r",colorscale:{stops:f.snowdepth},drawRange:{min:g.inToM(.1)}}}}),legend:e.snow_depth,evaluator:{title:"Snow Depth",fn:t=>`${t.value.toFixed(1)} m, ${g.mToIn(t.value).toFixed(1)} in`}},weather:{id:(0,u.RC)("conditions.weather.fill"),layer:(0,u.Af)(J.conditions_PTYPE_PRECIP_TMP,{quality:S.E.exact,timeSeries:{intervals:200},paint:{sample:{channel:"r",interpolation:lt.uN.none,colorscale:{range:{min:0,max:255},stops:[0,"#000",dt(1),"#00A91E",dt(2),"#C50000",dt(3),"#F45F61",dt(4),"#DB73E6",dt(5),"#D0ECF4",dt(6),"#757AF4",dt(7),"#B175F4",dt(8),"#e6738e",dt(9),"#40e0d0",dt(10),"#ff00ff",dt(11),"#8BF291",dt(12),"#F4A8A9",1,"#ffffff"],normalized:!0},drawRange:{min:1,max:255},meld:!1}}}),legend:G("Weather Type",{id:(0,u.RC)("weather-type"),points:{values:[{color:"#8BF291",label:"Drizzle"},{color:"#00A91E",label:"Rain"},{color:"#C50000",label:"Thunderstorms"},{color:"#F4A8A9",label:"Freezing Drizzle"},{color:"#F45F61",label:"Freezing Rain"},{color:"#DB73E6",label:"Mixed Ice"},{color:"#e6738e",label:"Sleet"},{color:"#D0ECF4",label:"Snow"},{color:"#757AF4",label:"Wet Snow"},{color:"#B175F4",label:"Rain/Snow Mix"},{color:"#40e0d0",label:"Graupel"},{color:"#ff00ff",label:"Hail"}]}})},visibility:{id:(0,u.RC)("conditions.visibility.fill"),layer:(0,u.Af)(J.conditions_PRMSL_VIS_GUST,{paint:{sample:{channel:"g",colorscale:{stops:f.visibility}}}}),legend:e.visibility,evaluator:i.visibility},uvi:{id:(0,u.RC)("conditions.uvi.fill"),layer:(0,u.Af)(J.conditions_SKY_PRECIP_UVI,{quality:S.E.low,paint:{sample:{channel:"b",smoothing:1,colorscale:{stops:f.uvi,interval:1}}}}),legend:e.uvi,evaluator:{title:"UV Index",fn:t=>`${Math.round(t.value)}`}}};return r["wind-particles-arrow"]=(0,m.$)({},r["wind-particles"],{id:(0,u.RC)("conditions.wind_speed.particle_arrow"),layer:{paint:{particle:{type:"arrow",density:ot.j.low,size:{width:20,height:10},speed:2,trails:!1}}}}),r["precip-accum"]=(0,m.$)({},r.precip,{id:(0,u.RC)("conditions.precip_accum.fill"),operation:{type:"sum",remappedDataRange:{min:0,max:g.inToMMRate(20)}},layer:{paint:{sample:{colorscale:{range:{min:0,max:g.inToMMRate(20)}},dataRange:{min:0,max:g.inToMMRate(20)}}}},legend:e.accum_precip,evaluator:Object.assign(Object.assign({},i.accum_precip),{title:"Accumulated Precip"})}),r["snow-accum"]=(0,m.$)({},r.snow,{id:(0,u.RC)("conditions.snow_accum.fill"),operation:{type:"sum",remappedDataRange:{min:0,max:g.inToM(60)}},layer:{paint:{sample:{colorscale:{range:{min:0,max:g.inToM(60)}},dataRange:{min:0,max:g.inToM(60)}}}},legend:e.accum_snow,evaluator:Object.assign(Object.assign({},i.accum_snow),{title:"Accumulated Snowfall"})}),r["sleet-accum"]=(0,m.$)({},r.sleet,{id:(0,u.RC)("conditions.sleet_accum.fill"),operation:{type:"sum"},legend:e.accum_sleet,evaluator:Object.assign(Object.assign({},i.accum_precip),{title:"Accumulated Sleet"})}),r["ice-accum"]=(0,m.$)({},r.ice,{id:(0,u.RC)("conditions.ice_accum.fill"),operation:{type:"sum"},layer:{},legend:e.accum_ice,evaluator:Object.assign(Object.assign({},i.accum_precip),{title:"Accumulated Ice"})}),r["temperatures-max"]=Object.assign(Object.assign({},r.temperatures),{id:(0,u.RC)("conditions.temperature_max.fill"),operation:{type:"max"}}),r["temperatures-min"]=Object.assign(Object.assign({},r.temperatures),{id:(0,u.RC)("conditions.temperature_min.fill"),operation:{type:"min"}}),r["wind-speeds-max"]=Object.assign(Object.assign({},r["wind-speeds"]),{id:(0,u.RC)("conditions.wind_speed_max.fill"),operation:{type:"max"}}),r["wind-gusts-max"]=Object.assign(Object.assign({},r["wind-gusts"]),{id:(0,u.RC)("conditions.wind_gust_max.fill"),operation:{type:"max"}}),Object.keys(r).forEach((t=>{const e=r[t];e.layer.type===S.m.sample&&(r[`${t}-text`]={id:e.id.replace(/\.\w+$/,".text"),layer:(0,u.Z)(J.base_cities),query:{layerId:t,hidden:!0}})})),r})(0,e,tt)),((t,e,i)=>Object.assign(Object.assign({sst:{id:(0,u.RC)("maritime.sst.fill"),layer:(0,u.Af)(J.maritime_WTMP_UOGRD_VOGRD,{paint:{sample:{channel:"r",colorscale:{stops:f.temperature}}}}),mask:ct,legend:e.temperature,evaluator:i.temperature},"ocean-currents":{id:(0,u.RC)("maritime.ocean_current.fill"),layer:(0,u.Af)(J.maritime_WTMP_UOGRD_VOGRD,{paint:{sample:{channel:"gb",expression:lt.BG.vector,colorscale:{range:{min:0,max:h.xj.current.dataRange.max},stops:pt.current}}}}),mask:ct,legend:mt.current,evaluator:Object.assign(Object.assign({},i.winds),{title:"Ocean Current"})},"ocean-currents-particles":{id:(0,u.RC)("maritime.ocean_current.particle"),layer:(0,u.Af)(J.maritime_WTMP_UOGRD_VOGRD,{type:S.m.particle,paint:{sample:{channel:"gb",expression:lt.BG.vector,interpolation:lt.uN.bilinear,colorscale:{range:{min:0,max:h.xj.current.dataRange.max},stops:pt.current}},particle:{density:ot.j.normal,size:2,speed:10}}}),mask:ct,legend:mt.current,evaluator:Object.assign(Object.assign({},i.winds),{title:"Ocean Current"})}},[{prefix:"wave",dataset:J.maritime_WAVE,title:"Wave"},{prefix:"swell",dataset:J.maritime_SWELL1,title:"Swell"},{prefix:"swell2",dataset:J.maritime_SWELL2,title:"Swell 2"},{prefix:"swell3",dataset:J.maritime_SWELL3,title:"Swell 3"}].reduce(((t,e)=>{let{prefix:r,dataset:s,title:a}=e;return t[`${r}-heights`]={id:(0,u.RC)(`maritime.${r}_height.fill`),layer:(0,u.Af)(s,{paint:{sample:{channel:"r",colorscale:{stops:pt.wave_height}}}}),mask:ct,legend:mt.wave_height,evaluator:Object.assign(Object.assign({},i.wave_height),{title:`${a} Height`})},t[`${r}-periods`]={id:(0,u.RC)(`maritime.${r}_period.fill`),layer:(0,u.Af)(s,{paint:{sample:{channel:"g",colorscale:{stops:pt.period,interval:1}}}}),mask:ct,legend:mt.period,evaluator:Object.assign(Object.assign({},i.period),{title:`${a} Period`})},t[`${r}-dir`]={id:(0,u.RC)(`maritime.${r}_dir.fill`),layer:(0,u.Af)(s,{type:S.m.grid,paint:{sample:{channel:"b",expression:lt.BG.angle,interpolation:lt.uN.bilinear,colorscale:{range:{min:0,max:359},stops:[0,"#ffffff",1,"#ffffff"],normalized:!0}},grid:{spacing:30},icon:{type:"arrow",size:{width:40,height:20},anchor:"left"}}}),mask:ct,evaluator:Object.assign(Object.assign({},i.angle_reversed),{title:`${a} Direction`})},t[`${r}-particles`]={id:(0,u.RC)(`maritime.${r}_dir.particle`),layer:(0,u.Af)(s,{type:S.m.particle,paint:{sample:{channel:"b",expression:lt.BG.angle,interpolation:lt.uN.bilinear,colorscale:{range:{min:0,max:359},stops:[0,"#ffffff",1,"#ffffff"],normalized:!0}},particle:{type:"bar",size:{width:8,height:1},speed:3,trails:!0,trailsFade:.94}}}),mask:ct,evaluator:Object.assign(Object.assign({},i.angle_reversed),{title:`${a} Direction`})},t}),{})),{"storm-surge":{id:(0,u.RC)("maritime.storm_surge.fill"),layer:(0,u.Af)(J.maritime_SURGE_TIDE,{paint:{sample:{channel:"r",colorscale:{stops:pt.surge}}}}),mask:ct,legend:mt.surge,evaluator:Object.assign(Object.assign({},i.wave_height),{title:"Storm Surge"})},"tide-heights":{id:(0,u.RC)("maritime.tide_height.fill"),layer:(0,u.Af)(J.maritime_SURGE_TIDE,{paint:{sample:{channel:"g",colorscale:{stops:pt.height_diff}}}}),mask:ct,legend:mt.tide_height,evaluator:Object.assign(Object.assign({},i.height_change),{title:"Tide Height"})}}))(0,e,tt)),Object.assign(Object.assign({"air-quality":{id:(0,u.RC)("air_quality.point"),layer:{type:S.m.circle,source:J.airquality_points,sourceType:c.V.point,paint:{fill:{color:t=>{var e,i;if((0,gt.g)(null==t?void 0:t.periods)||0===(null===(e=null==t?void 0:t.periods)||void 0===e?void 0:e.length))return;const r=null===(i=t.periods[0].category)||void 0===i?void 0:i.replace(/[\s-]/,"_").toLowerCase();return ft[r]||"#000000"}},stroke:{color:"#fff",thickness:3},circle:{radius:8}}},legend:zt,evaluator:ie},"air-quality-index":{id:(0,u.RC)("air_quality.index.fill"),layer:(0,u.Af)(J.airquality_AQI_PM2P5_PM10,{paint:{sample:{channel:"r",colorscale:{stops:yt}}}}),legend:Nt,evaluator:Object.assign(Object.assign({},ee),{title:"AQI"})},"air-quality-index-text":{id:(0,u.RC)("air_quality.index.text"),layer:(0,u.Z)(J.base_cities),query:{layerId:"air-quality-index",hidden:!0}},"air-quality-index-categories":{id:(0,u.RC)("air_quality.index_categories.fill"),layer:(0,u.Af)(J.airquality_AQI_PM2P5_PM10,{paint:{sample:{channel:"r",colorscale:{stops:bt,interpolate:!1}}}}),legend:zt,evaluator:Object.assign(Object.assign({},ee),{title:"AQI"})},"air-quality-health-index-categories":{id:(0,u.RC)("air_quality.aqhi.fill"),layer:(0,u.Af)(J.airquality_AQI_HI_China_India,{paint:{sample:{channel:"r",colorscale:{stops:xt,interpolate:!1}}}}),legend:Yt,evaluator:Object.assign(Object.assign({},ee),{title:"Health Index"})}},[{source:J.airquality_AQI_HI_China_India,items:["china","india"],channels:["g","b"]},{source:J.airquality_AQI_EAQI_UBA_UK,items:["eaqi","uba_daqi","uk_daqi"],channels:["r","g","b"]},{source:J.airquality_AQI_CAI_CAQI,items:["cai","caqi"],channels:["r","g"]}].reduce(((t,e)=>{let{source:i,items:a,channels:n}=e;return a.forEach(((e,a)=>{const o=e.replace(/_/,"-"),l=(0,se.HB)(e);t[`air-quality-index-${o}-categories`]={id:(0,u.RC)(`air_quality.${e}.fill`),layer:(0,u.Af)(i,{paint:{sample:{channel:n[a],colorscale:{stops:r[e],interpolate:!1}}}}),legend:s[l],evaluator:Object.assign(Object.assign({},ee),{title:"AQI"})},t[`air-quality-index-${o}-text`]={id:(0,u.RC)(`air_quality.${e}.text`),layer:(0,u.Z)(J.base_cities),query:{layerId:`air-quality-index-${o}-categories`,hidden:!0}}})),t}),{})),[{source:J.airquality_AQI_PM2P5_PM10,items:["pm2p5","pm10"],channels:["g","b"]},{source:J.airquality_CO_NO_NO2,items:["co","no","no2"],channels:["r","g","b"]},{source:J.airquality_O3_SO2,items:["o3","so2"],channels:["r","g"]}].reduce(((t,e)=>{let{source:i,items:a,channels:n}=e;return a.forEach(((e,a)=>{t[`air-quality-${e}`]={id:(0,u.RC)(`air_quality.${e}.fill`),layer:(0,u.Af)(i,{paint:{sample:{channel:n[a],colorscale:{stops:r[e]}}}}),legend:s[e],evaluator:Object.assign(Object.assign({},re),{title:e.toUpperCase()})},t[`air-quality-${e}-text`]={id:(0,u.RC)(`air_quality.${e}.text`),layer:(0,u.Z)(J.base_cities),query:{layerId:`air-quality-${e}`,hidden:!0}}})),t}),{}))),[{sourceType:"nowcast",prefix:""},{sourceType:"forecast",prefix:"f"}].reduce(((t,e)=>{let{sourceType:i,prefix:r}=e;return ne.forEach((e=>{let s;switch(e){case"us":s="forecast"===i?J.roadweather_forecast_us:J.roadweather_nowcast_us;break;case"europe":s="forecast"===i?J.roadweather_forecast_europe:J.roadweather_nowcast_europe;break;case"japan":s="forecast"===i?J.roadweather_forecast_japan:J.roadweather_nowcast_japan;break;case"australia":s="forecast"===i?J.roadweather_forecast_australia:J.roadweather_nowcast_australia;break;case"new-zealand":s="forecast"===i?J.roadweather_forecast_new_zealand:J.roadweather_nowcast_new_zealand}oe.forEach((a=>{const o=a.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),l=`${r}road-weather-${o}-${e}`;he.forEach((r=>{const{type:h=r,filter:d}=le[r];t[`${l}-${r}-points`]={id:(0,u.RC)(`road_weather.${o}.${e}.${r}.point`),layer:Object.assign(Object.assign({},_e(a,S.m.circle)),{source:s,sourceLayer:`road-wx-${i}`,filter:["==",["get","roadType_0-SFC"],h]}),legend:n[`${a}`]},t[`${l}-${r}`]={id:(0,u.RC)(`road_weather.${o}.${e}.${r}.fill`),layer:Object.assign(Object.assign({},_e(a,S.m.voronoi)),{source:s,sourceLayer:`road-wx-${i}`,filter:["==",["get","roadType_0-SFC"],h]}),mask:{layers:[{id:"road-all",overrides:{filter:d,paint:{stroke:"bridges"===r?{color:"#fff",thickness:6,lineJoin:"round",lineCap:"square"}:{color:"#fff",thickness:"secondary"===h?2:4}}}}]},legend:n[`${a}`]}})),t[`${l}-points`]={id:(0,u.RC)(`road_weather.${o}.${e}.point`),layer:Object.assign(Object.assign({},_e(a,S.m.circle)),{source:s,sourceLayer:`road-wx-${i}`}),legend:n[`${a}`]},t[l]=he.map((t=>`${l}-${t}`))}))})),t}),{})),((t,e,i)=>{const r=Object.assign(Object.assign({alerts:{id:(0,u.RC)("severe.alerts.fill"),layer:{type:S.m.fill,source:J.severe_alerts,timeSeries:{mode:ae.Gp.interval},paint:{fill:{color:["get","COLOR"]},stroke:{color:"#000"}}},legend:Ee(t),evaluator:Pe},"alerts-outline":{id:(0,u.RC)("severe.alerts.line"),layer:{type:S.m.line,source:J.severe_alerts,timeSeries:{mode:ae.Gp.interval},paint:{stroke:{color:["get","COLOR"],thickness:3,lineJoin:I.p.Round,lineCap:I.$.Round}}},legend:Ee(t),evaluator:Pe},"stormcells-positions":{id:(0,u.RC)("severe.stormcells.position.circle"),layer:{type:S.m.circle,source:J.severe_stormcells,sourceType:c.V.point,timeSeries:{mode:ae.Gp.interval},paint:{fill:{color:function(t){return["match",["downcase",["get","traits.type"]],"general",t.general,"hail",t.hail,"rotating",t.rotating,"tornado",t.tornado,"#000000"]}(Ze)},stroke:{color:"#fff",thickness:3},circle:{radius:7}}},legend:ke,evaluator:He},"stormcells-tracks":{id:(0,u.RC)("severe.stormcells.track.line"),layer:{type:S.m.line,source:J.severe_stormcells,sourceType:c.V.line,timeSeries:{mode:ae.Gp.any},paint:{stroke:{color:"#fff",thickness:3,lineCap:I.$.Round}}},evaluator:He},"stormcells-cones":{id:(0,u.RC)("severe.stormcells.cone.line"),layer:{type:S.m.fill,source:J.severe_stormcells,timeSeries:{mode:ae.Gp.interval},paint:{fill:{color:function(t){return["match",["downcase",["get","traits.type"]],"general",t.general,"hail",t.hail,"rotating",t.rotating,"tornado",t.tornado,"#000000"]}(Ze),opacity:.5}}},legend:ke,evaluator:He},stormcells:["stormcells-cones","stormcells-tracks","stormcells-positions"],"stormcells-heat":{id:(0,u.RC)("severe.stormcells.heat"),layer:{type:S.m.heatmap,source:J.severe_stormcells,sourceType:c.V.point,timeSeries:{mode:ae.Gp.interval},paint:{heatmap:{radius:20,color:f.heatmap}}}},stormreports:{id:(0,u.RC)("severe.stormreports.circle"),layer:{type:S.m.circle,source:J.severe_stormreports,sourceType:c.V.point,timeSeries:{mode:ae.Gp.interval},paint:{fill:{color:function(t){return["match",["downcase",["get","report.cat"]],"avalanche",t.avalanche,"blizzard",t.blizzard,"fire",t.fire,"flood",t.flood,"fog",t.fog,"ice",t.ice,"hail",t.hail,"lightning",t.lightning,"rain",t.rain,"snow",t.snow,"tides",t.tides,"tornado",t.tornado,"wind",t.wind,"tropical",t.tropical,"other",t.other,"#000000"]}(Ae)},stroke:{color:"#fff",thickness:3},circle:{radius:8}}},legend:ze,evaluator:{title:"Storm Reports",fn:t=>{var e;const i=null===(e=t.features)||void 0===e?void 0:e[0];return(null==i?void 0:i.report)?`${(0,te.C)(i.report.type)}`:""}}},"stormreports-heat":{id:(0,u.RC)("severe.stormreports.heat"),layer:{type:S.m.heatmap,source:J.severe_stormreports,sourceType:c.V.point,timeSeries:{mode:ae.Gp.interval},paint:{heatmap:{radius:20,color:f.heatmap}}}},"lightning-strikes":{id:(0,u.RC)("severe.lightning.circle"),layer:{type:S.m.circle,source:J.severe_lightning,sourceType:c.V.point,timeSeries:{mode:ae.Gp.interval},paint:{fill:{color:function(t){return["step",["get","age"],t.age60,60,t.age300,300,t.age600,600,t.ageOld]}(Re)},stroke:{color:"#333",thickness:2},circle:{radius:6}}},legend:Ne},"lightning-flash":{id:(0,u.RC)("severe.lightning_flash.circle"),layer:{type:S.m.circle,source:J.severe_lightning_flash,sourceType:c.V.point,timeSeries:{mode:ae.Gp.interval},paint:{fill:{color:Re.typeIC},stroke:{color:"#333",thickness:2},circle:{radius:4}}}},"lightning-all":["lightning-flash","lightning-strikes"],"lightning-threats-polygons":{id:(0,u.RC)("severe.lightning.threats.fill"),layer:{type:S.m.fill,source:J.severe_lightning_threats,timeSeries:{mode:ae.Gp.interval},paint:{fill:{color:function(t){return["step",["floor",["/",["-",["get","period.range.minTimestamp"],["get","details.issuedTimestamp"]],60]],t.lead0,10,t.lead10,20,t.lead20,30,t.lead30,40,t.lead40,50,t.lead50,60,t.lead60]}(Ge),sort:{property:"period.range.minTimestamp",direction:"desc"}}}},legend:Ye,evaluator:Ue},"lightning-threats-tracks":{id:(0,u.RC)("severe.lightning.threats.line"),layer:{type:S.m.line,source:J.severe_lightning_threats,timeSeries:{mode:ae.Gp.interval},filter:["all",["==","featureType","forecastPath"],["==",["get","reliability",["get","movement",["get","details"]]],"HIGH"],[">",["get","totalPeriods",["get","details"]],1]],paint:{stroke:{color:"#DE2900"}}}},"lightning-threats-points":{id:(0,u.RC)("severe.lightning.threats.circle"),layer:{type:S.m.circle,source:J.severe_lightning_threats,timeSeries:{mode:ae.Gp.interval},paint:{fill:{color:"#DE2900"},stroke:{color:"#fff",thickness:2},circle:{radius:4}}},evaluator:Ue},"lightning-threats":["lightning-threats-polygons","lightning-threats-tracks","lightning-threats-points"],"lightning-strikes-heat":{id:(0,u.RC)("severe.lightning.heat"),layer:{type:S.m.heatmap,source:J.severe_lightning,sourceType:c.V.point,timeSeries:{mode:ae.Gp.any},paint:{heatmap:{radius:20,color:f.heatmap}}}},convective:{id:(0,u.RC)("severe.convective.fill"),layer:{type:S.m.fill,source:J.severe_convective,paint:{fill:{color:t=>{var e;const i=null===(e=t.details.risk.type)||void 0===e?void 0:e.toLowerCase();return Te[i]||"#000000"},opacity:.9}}},legend:Xe,evaluator:Je},"convective-outline":{id:(0,u.RC)("severe.convective.line"),layer:{type:S.m.line,source:J.severe_convective,paint:{stroke:{color:t=>{var e;const i=null===(e=t.details.risk.type)||void 0===e?void 0:e.toLowerCase();return Te[i]||"#000000"},thickness:3}}},legend:Xe,evaluator:Je},"hail-threats-polygons":{id:(0,u.RC)("severe.hail.threats.fill"),layer:{type:S.m.fill,source:J.severe_hail_threats,timeSeries:{mode:ae.Gp.interval},paint:{fill:{color:t=>{const{details:e,period:i}=t;if(!e||!i)return"#000000";const r=(0,p.oh)(t),s=Math.max(0,10*Math.floor(r/10));return Ce[`lead${s}`]||"#000000"},sort:{property:"period.range.minTimestamp",direction:"desc"}}}},legend:Oe,evaluator:Object.assign(Object.assign({},Ue),{title:"Hail Threat"})},"hail-threats-tracks":{id:(0,u.RC)("severe.hail.threats.line"),layer:{type:S.m.line,source:J.severe_hail_threats,timeSeries:{mode:ae.Gp.interval},filter:["==",["get","featureType"],"forecastPath"],paint:{stroke:{color:"#520BAE"}}}},"hail-threats-points":{id:(0,u.RC)("severe.hail.threats.circle"),layer:{type:S.m.circle,source:J.severe_hail_threats,timeSeries:{mode:ae.Gp.interval},paint:{fill:{color:"#520BAE",opacity:.5},stroke:{color:"#fff",thickness:2},circle:{radius:4}}}},"hail-threats":["hail-threats-polygons","hail-threats-tracks","hail-threats-points"]},p.ot.reduce(((t,e)=>{const i=K(J.severe_hail_MESH_POSH,e);return t[`hail-size-${e}`]={id:(0,u.RC)(`severe.hail.size.${e}`),layer:(0,u.Af)(i,{quality:S.E.exact,paint:{sample:{channel:"r",colorscale:{range:{min:0,max:(0,g.inToMM)(3)},stops:[0,"rgba(132,0,170,0)",1,"#372497",(0,g.inToMM)(.5),"#1D6AA2",(0,g.inToMM)(.999),"#089E9A",(0,g.inToMM)(1),"#09BB93",(0,g.inToMM)(2),"#FEF112",(0,g.inToMM)(3),"#FE5412"],interval:1},drawRange:{min:1}}}}),legend:je,evaluator:Qe},t[`hail-severe-probability-${e}`]={id:(0,u.RC)(`severe.hail.posh.${e}`),layer:(0,u.Af)(i,{quality:S.E.exact,paint:{sample:{channel:"g",colorscale:{range:{min:0,max:100},stops:Ie,normalized:!0},drawRange:{min:10}}}}),legend:De,evaluator:Ke},t[`hail-size-max-${e}`]=Object.assign(Object.assign({},t[`hail-size-${e}`]),{id:(0,u.RC)(`severe.hail.size_max.${e}`),operation:{type:"max"}}),t[`hail-severe-probability-max-${e}`]=Object.assign(Object.assign({},t[`hail-severe-probability-${e}`]),{id:(0,u.RC)(`severe.hail.posh_max.${e}`),operation:{type:"max"}}),t}),{})),p.Q0.reduce(((t,e)=>{const i=K(J.severe_lightning_LGTIC_LGTCG,e);return t[`lightning-density-${e}`]={id:(0,u.RC)(`severe.lightning.density.${e}.all`),layer:(0,u.Af)(i,{quality:S.E.exact,paint:{sample:{channel:"b",colorscale:{range:{min:0,max:10},stops:Se},drawRange:{min:.1}}}}),legend:Le,evaluator:Object.assign(Object.assign({},qe),{title:"Lightning Density"})},t[`lightning-density-cloud-to-ground-${e}`]={id:(0,u.RC)(`severe.lightning.density.${e}.cg`),layer:(0,u.Af)(i,{quality:S.E.exact,paint:{sample:{channel:"r",colorscale:{range:{min:0,max:10},stops:Se},drawRange:{min:.1}}}}),legend:Le,evaluator:Object.assign(Object.assign({},qe),{title:"Lightning Density (CG)"})},t[`lightning-density-intracloud-${e}`]={id:(0,u.RC)(`severe.lightning.density.${e}.ic`),layer:(0,u.Af)(i,{quality:S.E.exact,paint:{sample:{channel:"g",colorscale:{range:{min:0,max:10},stops:Se},drawRange:{min:.1}}}}),legend:Le,evaluator:Object.assign(Object.assign({},qe),{title:"Lightning Density (IC)"})},t[`lightning-density-accum-${e}`]=Object.assign(Object.assign({},t[`lightning-density-${e}`]),{id:(0,u.RC)(`severe.lightning.density_accum.${e}.all`),operation:{type:"sum"}}),t[`lightning-density-cloud-to-ground-accum-${e}`]=Object.assign(Object.assign({},t[`lightning-density-${e}`]),{id:(0,u.RC)(`severe.lightning.density_accum.${e}.cg`),operation:{type:"sum"}}),t[`lightning-density-intracloud-accum-${e}`]=Object.assign(Object.assign({},t[`lightning-density-intracloud-${e}`]),{id:(0,u.RC)(`severe.lightning.density_accum.${e}.ic`),operation:{type:"sum"}}),t}),{}));return r["lightning-strikes-icons"]=(0,m.$)({},r["lightning-strikes"],{id:(0,u.RC)("severe.lightning.symbol"),layer:{type:S.m.symbol,paint:{stroke:{thickness:1},icon:{image:"mapsgl:lightning-bolt",size:{width:30,height:30}}}}}),r["lightning-all-icons"]=["lightning-flash","lightning-strikes-icons"],r["lightning-strikes-pulse"]=(0,m.$)({},r["lightning-strikes"],{id:(0,u.RC)("severe.lightning.pulse"),layer:{type:S.m.symbol,paint:{icon:{shader:"\n#extension GL_OES_standard_derivatives : enable\n\nprecision mediump float;\n\nuniform vec2 resolution;\nuniform float dpr;\nuniform float time;\n\nvarying vec2 vUv;\nvarying vec2 vPosition;\nvarying float vFactor;\nvarying float vRandom;\n\nvarying float vEnvelope;\nvarying float vInvRadius;\nvarying float vInvRadiusEdge;\nvarying float vIntensity;\n\nvoid main() {\n float envelope = vEnvelope;\n\n // --- Spatial falloff (radial glow) ----------------------------------------\n // Keep glow circular in screen-space: correct for aspect.\n float aspect = resolution.x / max(resolution.y, 1.0);\n vec2 p = vUv - vec2(0.5);\n float r = length(p);\n float q = r * vInvRadius; // normalized radius r / radius\n\n // Radius is in icon-UV units now: 0.5 touches the quad's edge.\n float radius = 0.45; // fills the icon with a small margin\n\n // Soft core + long, soft edge (use precomputed inverses for perf)\n // float core = 1.0 / (1.0 + 8.0 * pow(r / max(radius, 1e-4), 2.0));\n // float core = 1.0 / (1.0 + 18.0 * (q * q)); // tighter core than before\n // // long fade from ~55% of radius to edge (q = 0.55..1.0)\n // float edge = 1.0 - smoothstep(0.7, 1.0, q);\n // float spatial = core * edge;\n\n // Two-term isotropic falloff: tight core + broad halo (both circular)\n float core = 1.0 / (1.0 + 20.0 * (q * q)); // small hot center\n float halo = 1.0 / (1.0 + 4.0 * (q * q)); // wide soft halo\n\n // Limit contribution near the very edge for a clean terminator\n float edgeMask = 1.0 - smoothstep(0.9, 1.0, q);\n\n // // Combined spatial term (circular symmetry)\n // float spatial = (0.55 * core + 0.80 * halo) * edgeMask;\n\n\n // // --- Edge-to-core color grading ---\n // // Keep edges slightly bluish, center approaches white\n // vec3 edgeColor = vec3(0.7, 0.80, 1.00); // icier blue at the outskirts\n // float coreMix = smoothstep(0.1, 0.9, core); // slower transition to white\n\n // // Boost the core so it burns white under additive blending\n // float coreBoost = mix(1.0, 2.2, coreMix);\n // vec3 glowColor = mix(edgeColor, vec3(1.0), coreMix);\n\n\n // Combine: keep some core but emphasize a wide halo\n float spatial = (0.55 * core + 0.80 * halo) * edgeMask;\n\n // --- Edge-to-core color grading -----------------------------------------\n // Bluish edges (halo), hot white core\n vec3 edgeColor = vec3(0.6, 0.65, 1.00);\n\n // Weight toward white near center; toward blue in the halo\n float coreMix = smoothstep(0.35, 0.80, core); // 0 at edge, 1 near center\n float haloMix = smoothstep(0.15, 0.80, halo); // 0 outside, 1 within halo\n\n // Final glow tint: mostly blue in the wings, white in the core\n vec3 glowColor = mix(edgeColor, vec3(1.0), coreMix);\n\n // Slightly lift halo blueness even when core is strong\n glowColor = mix(glowColor, edgeColor, (1.0 - coreMix) * 0.35 * haloMix); // 0.35 is the weight\n\n // Reduce center boost so the core doesn't dominate; additive will bloom it anyway\n float coreBoost = mix(1.0, 1.35, coreMix);\n\n\n // --- Color & output --------------------------------------------------------\n float intensity = vIntensity;\n vec3 color = glowColor * (intensity * coreBoost) * envelope * spatial;\n\n // Additive-friendly output (premult not needed here).\n gl_FragColor = vec4(color, clamp(envelope * spatial, 0.0, 0.8));\n}\n",shaderOnBeforeCompile:t=>{t.vertex=t.vertex.replace("#include <project_vertex>","\n#include <project_vertex>\n\nvarying float vEnvelope;\nvarying float vInvRadius;\nvarying float vInvRadiusEdge;\nvarying float vIntensity;\n\n/* Quick-rise / slow-decay impulse.\n Larger k => narrower, punchier impulse with a fast attack and slower tail. */\nfloat expImpulse(float k, float x) {\n float y = k * x;\n return y * exp(1.0 - y);\n}\n\n/* Tiny hash for flicker without textures. */\nfloat hash11(float x) {\n // one sin + fract -> cheap, stable per-frame noise when driven by time\n return fract(sin(x) * 43758.5453123);\n}\n"),t.vertex=t.vertex.replace("#include <symbol_vert_position>","\n#include <symbol_vert_position>\n\n// --- Temporal envelope ----------------------------------------------------\n// Use vFactor only for the gap between pulses; pulse is always ~1s.\nfloat repeatFactor = clamp(vFactor, 0.0, 1.0);\n\n// // Ensure zero/near-zero factors still differ per-instance (avoid beat sync)\n// float tinyBias = 0.01 * (0.5 + hash11(vRandom * 12345.0)); // ~0.0015..0.003\n// repeatFactor = max(repeatFactor, tinyBias);\n\n// --- Timing model: fixed ~1s pulse, variable gap controlled by vFactor ---\n// A single pulse (fast attack, slow decay) lasts ~1.0s.\n// After that, a gap occurs; higher vFactor => shorter gap (faster repeat).\nfloat pulseDuration = 2.0; // seconds for burst+decay\nfloat minGap = 0.50; // fastest re-strike gap (s)\nfloat maxGap = 5.00; // slowest re-strike gap (s)\nfloat gap = mix(maxGap, minGap, repeatFactor);\n\nfloat nominalPeriod = pulseDuration + gap;\n\n// Instance-staggered time and integer cycle under the *nominal* period\nfloat t0 = time + 10.0 + vRandom * 13.37;\nfloat cycle = floor(t0 / max(nominalPeriod, 1e-3));\n\n// Per-cycle gap variation (random short/long pauses)\nfloat gapJitter = mix(0.6, 1.4, hash11(cycle * 17.0 + vRandom * 123.0));\nfloat basePeriod = pulseDuration + gap * gapJitter;\n\n// Time within the current cycle (under nominal schedule)\nfloat tIn = t0 - cycle * nominalPeriod;\n\n// Normalized phase inside the *jittered* period\nfloat phaseBase = clamp(tIn / max(basePeriod, 1e-3), 0.0, 1.0);\n\n// Additional per-cycle phase jitter to break residual sync\nfloat phaseJitter = hash11(cycle + vRandom * 4096.0);\nfloat phase = fract(phaseBase + (phaseJitter - 0.5) * 0.6); // +/-0.3 cycle shift\n\n// Active portion of the cycle is the initial pulseDuration window\nfloat activeFrac = pulseDuration / basePeriod; // portion of period that is the pulse\nfloat localPhase = clamp(phase / max(activeFrac, 1e-3), 0.0, 1.0);\n\n// Shape: quick rise, slower decay\nfloat k = 14.0; // higher => snappier attack, longer tail\nfloat burst = expImpulse(k, localPhase); // 0..~1 over the 1s window\n\n// Gate the envelope so it is zero during the gap (branch-free)\nfloat gate = step(phase, activeFrac); // 1 in pulse window, 0 in gap\n\n// Subtle micro-flicker only during the burst, reduced amplitude\nfloat flickSeed = floor(time * 180.0 + vRandom * 997.0);\nfloat flick = 0.08 * burst * (hash11(flickSeed) * 2.0 - 1.0);\n\nfloat envelope = max(burst * gate + flick, 0.0);\nfloat radius = 0.45;\n\nvEnvelope = envelope;\n\n// --------- precompute spatial constants ----------\nvInvRadius = 1.0 / max(radius, 1e-4);\nvInvRadiusEdge = 1.0 / (radius * 1.6);\n\n// --------- pack intensity once ----------\nvIntensity = 1.0;\n")},size:t=>{const e=t.zoom,i=Math.max(0,(900-t.age)/900)*(e/5),r=Math.round(20+40*i);return{width:r,height:r}},animated:!0,blending:2,factor:t=>Math.max(0,(900-t.age)/900)},symbol:{pitchWithMap:!0,allowOverlap:!0}}},legend:null}),r["alerts-short-fuse"]=(0,m.$)({},r["alerts-outline"],{id:(0,u.RC)("severe.alerts.short_fuse"),layer:{paint:{animated:!0,opacity:t=>{let{time:e}=t;return Math.min(1,Math.max(0,.5*Math.sin(8*e)+.5))},stroke:{thickness:4}},filter:["in",["get","VTEC"],["literal",["SV.W","TO.W","FF.W","MA.W"]]]}}),r["hail-size"]=p.ot.map((t=>`hail-size-${t}`)),r["hail-size-max"]=p.ot.map((t=>`hail-size-max-${t}`)),r["hail-severe-probability"]=p.ot.map((t=>`hail-severe-probability-${t}`)),r["hail-severe-probability-max"]=p.ot.map((t=>`hail-severe-probability-max-${t}`)),r["lightning-density"]=p.Q0.map((t=>`lightning-density-${t}`)),r["lightning-density-accum"]=p.Q0.map((t=>`lightning-density-accum-${t}`)),r["lightning-density-cloud-to-ground"]=p.Q0.map((t=>`lightning-density-cloud-to-ground-${t}`)),r["lightning-density-cloud-to-ground-accum"]=p.Q0.map((t=>`lightning-density-cloud-to-ground-accum-${t}`)),r["lightning-density-intracloud"]=p.Q0.map((t=>`lightning-density-intracloud-${t}`)),r["lightning-density-intracloud-accum"]=p.Q0.map((t=>`lightning-density-intracloud-accum-${t}`)),r})(t)),Object.assign(Object.assign({},["active","notactive","invests"].reduce(((t,e)=>{const i="tropical-cyclones-";let r="",s="",a=J.tropical_active,n=!1;switch(e){case"active":s="_active";break;case"notactive":r="-archive",s="_archive",a=J.tropical_archive,n=!0;break;case"invests":r="-invests",s="_invests",a=J.tropical_invests}const o=["<=",["get","timestamp"],["map-time"]],l=["all",["==",["get","featureType"],"position"],o],h=["all",["==",["get","featureType"],"trackPoint"],o],d=["all",["==",["get","featureType"],"trackLine"],o];return t[`${i}track-points${r}`]={id:(0,u.RC)(`tropical.track${s}.circle`),layer:Object.assign(Object.assign({},k.point),{source:a,filter:h}),legend:z,evaluator:Y},t[`${i}track-point-icons${r}`]={id:(0,u.RC)(`tropical.track${s}.symbol`),layer:Object.assign(Object.assign({},k.symbol),{source:a,filter:h}),legend:z,evaluator:Y},t[`${i}track-lines${r}`]={id:(0,u.RC)(`tropical.track${s}.line`),layer:Object.assign(Object.assign({},k.track),{source:a,filter:d}),legend:z},t[`${i}names${r}`]={id:(0,u.RC)(`tropical.names${s}.text`),layer:Object.assign(Object.assign({},k.name),{source:a,sourceType:c.V.point,filter:l})},"active"===e||"invests"===e?(t[`${i}positions${r}`]={id:(0,u.RC)(`tropical.positions${s}.circle`),layer:Object.assign(Object.assign({},k.point),{source:a,filter:l}),legend:z,evaluator:Y},t[`${i}position-icons${r}`]={id:(0,u.RC)(`tropical.positions${s}.symbol`),layer:(0,m.$)({},k.symbol,{source:a,filter:l,paint:{icon:{size:t=>t.zoom<4?{width:28,height:28}:{width:44,height:44},shaderOnBeforeCompile:t=>{t.vertex=t.vertex.replace("#include <symbol_vert_position>","\n symbolAngle += (time * -PI * 2.0) * 0.5 * factor;\n #include <symbol_vert_position>\n ")},animated:!0}}}),legend:z,evaluator:Y},t[`${i}forecast-points${r}`]={id:(0,u.RC)(`tropical.forecast${s}.circle`),layer:Object.assign(Object.assign({},k.point),{source:a,filter:["==",["get","featureType"],"forecastPoint"]}),legend:z,evaluator:Y},t[`${i}forecast-point-icons${r}`]={id:(0,u.RC)("tropical.forecast.symbol"),layer:Object.assign(Object.assign({},k.symbol),{source:a,filter:["==",["get","featureType"],"forecastPoint"]}),legend:z,evaluator:Y},t[`${i}forecast-lines${r}`]={id:(0,u.RC)(`tropical.forecast${s}.line`),layer:Object.assign(Object.assign({},k.track),{source:a,filter:["==",["get","featureType"],"forecastLine"]})},"invests"===e?(t[`tropical-cyclones${r}`]=["track-lines","track-points","positions","names"].map((t=>{const e=t.startsWith("forecast-")?"":r;return`${i}${t}${e}`})),t[`tropical-cyclones${r}-icons`]=["track-lines","track-point-icons","position-icons","names"].map((t=>{const e=t.startsWith("forecast-")?"":r;return`${i}${t}${e}`}))):(t[`tropical-cyclones${r}`]=["forecast-error-cones","track-lines","forecast-lines","track-points","forecast-points","positions","names"].map((t=>{const e=t.startsWith("forecast-")?"":r;return`${i}${t}${e}`})),t[`tropical-cyclones${r}-icons`]=["forecast-error-cones","track-lines","forecast-lines","track-point-icons","forecast-point-icons","position-icons","names"].map((t=>{const e=t.startsWith("forecast-")?"":r;return`${i}${t}${e}`})))):(t[`tropical-cyclones${r}`]=["forecast-error-cones","track-lines-archive","forecast-lines","track-points-archive","forecast-points","names-archive"].map((t=>`${i}${t}`)),t[`tropical-cyclones${r}-icons`]=["forecast-error-cones","track-lines-archive","forecast-lines","track-point-icons-archive","forecast-point-icons","position-icons","names-archive"].map((t=>`${i}${t}`))),t}),{})),{"tropical-cyclones-forecast-error-cones":{id:(0,u.RC)("tropical.cone.fill"),layer:{type:S.m.fill,source:J.tropical_active,paint:{fill:{color:"#ff0000",opacity:.5},stroke:{color:"#ff0000",thickness:1}}}},"tropical-cyclones-break-points":{id:(0,u.RC)("tropical.active.breakpoints"),layer:{type:S.m.line,source:J.tropical_active,filter:["==",["get","featureType"],"breakPointAlert"],paint:{stroke:{color:t=>{var e;const i=null===(e=t.alertType)||void 0===e?void 0:e.toUpperCase();return W[i]||"#999"},thickness:t=>{var e;switch(null===(e=t.alertType)||void 0===e?void 0:e.toUpperCase()){case"TR.W":case"HU.W":return 8;default:return 4}},lineJoin:I.p.Round,lineCap:I.$.Round}}},legend:N}})),{"fires-obs":function(t){return{id:(0,u.RC)("climate.fire_obs.point"),layer:{type:S.m.circle,source:J.fires_obs,timeSeries:{mode:ae.Gp.interval},paint:{fill:{color:ti},stroke:{color:"#fff",thickness:2},circle:{radius:ei}}},legend:G("Fires",{id:(0,u.RC)("fire-obs"),points:{values:[{color:t.new,label:"New"},{color:t.active,label:"Active"},{color:t.contained,label:"Contained"}]}}),evaluator:si}}($e.fire_obs),"fires-obs-icons":{id:(0,u.RC)("climate.fire_obs.icons"),layer:{type:S.m.symbol,source:J.fires_obs,timeSeries:{mode:ae.Gp.interval},paint:{icon:{image:ii,size:ri,anchor:"bottom",offset:{x:0,y:2}},symbol:{rotateWithMap:!1,pitchWithMap:!1}}},evaluator:si},"fires-obs-names":{id:(0,u.RC)("climate.fire_obs.names"),layer:{type:S.m.symbol,source:J.fires_obs,timeSeries:{mode:ae.Gp.interval},paint:{text:[{value:["case",["all",["has","report"],[">=",["zoom"],7]],["get","report.name"],null],size:14,color:"#fff",outlineColor:"#444",weight:"bold",anchor:"top",offset:["case",["has","report"],{x:0,y:4},null]},{value:["let","areaAC",["round",["max",1,["coalesce",["get","perimeter.areaAC"],["get","report.areaAC"]]]],["case",["all",["has","report"],[">=",["zoom"],7]],["concat",["to-locale-string",["var","areaAC"],"en-US"],["case",["==",["var","areaAC"],1]," acre"," acres"]],null]],size:11,color:"#fff",outlineColor:"#444",anchor:"top",offset:{x:0,y:{target:"text-0-bottom",offset:0}}}],symbol:{allowOverlap:!1,rotateWithMap:!1,pitchWithMap:!1}}}},"fires-obs-heat":{id:(0,u.RC)("climate.fire_obs.heat"),layer:{type:S.m.heatmap,source:J.fires_obs,timeSeries:{mode:ae.Gp.range},paint:{heatmap:{radius:20,color:f.heatmap}}}},"fires-perimeter":{id:(0,u.RC)("climate.fire_obs.perimeter"),layer:{type:S.m.fill,source:J.fires_perimeter,timeSeries:{mode:ae.Gp.range},paint:{fill:{color:"#ff0000",opacity:.6},stroke:{color:"#ff0000"}}},evaluator:si},fires:["fires-perimeter","fires-obs","fires-obs-names"],"fires-icons":["fires-perimeter","fires-obs-icons","fires-obs-names"],"fires-outlook":function(t){return{id:(0,u.RC)("climate.fire_outlook.fill"),layer:{type:S.m.fill,source:J.fires_outlook,paint:{fill:{color:["match",["downcase",["get","details.risk.type"]],"elevated",t.elevated,"critical",t.critical,"extreme",t.extreme,"#FFB268"],opacity:.9}}},legend:G("Fire Outlook",{id:(0,u.RC)("fire-outlook"),points:{values:[{color:t.elevated,label:"Elevated"},{color:t.critical,label:"Critical"},{color:t.extreme,label:"Extreme"}]}}),evaluator:{title:"Fire Outlook",fn:t=>{var e,i,r;const s=null===(e=t.features)||void 0===e?void 0:e.at(-1);return(null==s?void 0:s.details)?`${(0,te.C)(null===(r=null===(i=s.details)||void 0===i?void 0:i.risk)||void 0===r?void 0:r.type)}`:""}}}}($e.fire_outlook),"fires-vpd":{id:(0,u.RC)("climate.fires_vpd.fill"),layer:(0,u.Af)(J.conditions_VPD,{paint:{sample:{channel:"r",dataRange:{min:0,max:70},colorscale:{stops:$e.vpd}}}}),mask:ut,legend:R("Vapor Pressure Deficit (VPD)",{id:(0,u.RC)("fires-vpd"),bar:{measurement:{type:"pressure",units:g.Units.pressure.hPa},colorscale:{range:{min:0,max:70},stops:$e.vpd},labels:{every:t=>20,formatter:(t,e,i)=>0===e?`${Math.round(t)} %%units%%`:`${Math.round(t)}`}}}),evaluator:{title:"Vapor Pressure Deficit (VPD)",fn:t=>`${t.value.toFixed(2)} hPa`}},"drought-monitor":function(t){return{id:(0,u.RC)("climate.drought_monitor.fill"),layer:{type:S.m.fill,source:J.drought,paint:{fill:{color:["match",["downcase",["get","details.category"]],"d0",t.d0,"d1",t.d1,"d2",t.d2,"d3",t.d3,"d4",t.d4,"#000000"]}}},legend:G("Drought Monitor",{id:(0,u.RC)("drought"),points:{values:[{color:t.d0,label:"Abnormally Dry"},{color:t.d1,label:"Moderate"},{color:t.d2,label:"Severe"},{color:t.d3,label:"Extreme"},{color:t.d4,label:"Exceptional"}]}}),evaluator:{title:"Drought Monitor",fn:t=>{var e,i,r;const s=null===(e=t.features)||void 0===e?void 0:e[0];return(null==s?void 0:s.details)?`${(0,te.C)(null===(r=null===(i=s.details)||void 0===i?void 0:i.risk)||void 0===r?void 0:r.name)}`:""}}}}($e.drought),"drought-monitor-outline":function(t){return{id:(0,u.RC)("climate.drought_monitor.outline"),layer:{type:S.m.line,source:J.drought,paint:{stroke:{color:["match",["downcase",["get","details.category"]],"d0",t.d0,"d1",t.d1,"d2",t.d2,"d3",t.d3,"d4",t.d4,"#000000"],thickness:3}}}}}($e.drought),earthquakes:function(t){return{id:(0,u.RC)("climate.earthquakes.point"),layer:{type:S.m.circle,source:J.earthquakes,paint:{fill:{color:["match",["downcase",["get","report.type"]],"mini",t.mini,"minor",t.minor,"light",t.light,"moderate",t.moderate,"strong",t.strong,"major",t.major,"great",t.great,"catastrophic",t.catastrophic,"#000000"]},stroke:{color:"#fff",thickness:2},circle:{radius:["/",["match",["downcase",["get","report.type"]],"mini",12,"minor",18,"light",20,"moderate",22,"strong",26,"major",30,"great",36,"catastrophic",42,12],2]},symbol:{rotateWithMap:!0,pitchWithMap:!0}}},legend:G("Earthquakes",{id:(0,u.RC)("earthquakes"),points:{values:[{color:t.mini,label:"Mini"},{color:t.minor,label:"Minor"},{color:t.light,label:"Light"},{color:t.moderate,label:"Moderate"},{color:t.strong,label:"Strong"},{color:t.major,label:"Major"},{color:t.great,label:"Great"},{color:t.catastrophic,label:"Catastrophic"}]}}),evaluator:{title:"Earthquakes",fn:t=>{var e,i,r,s;const a=null===(e=t.features)||void 0===e?void 0:e[0];return(null==a?void 0:a.report)?`${null===(i=a.report)||void 0===i?void 0:i.mag} (${null===(r=a.report)||void 0===r?void 0:r.type}) - ${(null===(s=a.report)||void 0===s?void 0:s.location)||""}`:""}}}}($e.earthquakes),"earthquakes-heat":{id:(0,u.RC)("climate.earthquakes.heat"),layer:{type:S.m.heatmap,source:J.earthquakes,paint:{heatmap:{radius:20,color:f.heatmap},symbol:{rotateWithMap:!0,pitchWithMap:!0}}}},"river-observations":function(t){return{id:(0,u.RC)("climate.river_obs.point"),layer:{type:S.m.circle,source:J.rivers,sourceType:c.V.point,paint:{fill:{color:["match",["downcase",["get","ob.status"]],"out_of_service",t.out_of_service,"obs_not_current",t.obs_not_current,"not_defined",t.not_defined,"low_threshold",t.low_threshold,"no_flooding",t.no_flooding,"action",t.action,"minor",t.minor,"moderate",t.moderate,"major",t.major,"#000000"]},stroke:{color:"#fff",thickness:3},circle:{radius:8}}},legend:G("River Observations",{id:(0,u.RC)("rivers"),points:{values:[{color:t.out_of_service,label:"Out of Service"},{color:t.obs_not_current,label:"Old Data"},{color:t.not_defined,label:"Unavailable"},{color:t.low_threshold,label:"Low Threshold"},{color:t.no_flooding,label:"No Flooding"},{color:t.action,label:"Action"},{color:t.minor,label:"Minor"},{color:t.moderate,label:"Moderate"},{color:t.major,label:"Major"}]}}),evaluator:{title:"River Obs",fn:t=>{var e,i;const r=null===(e=t.features)||void 0===e?void 0:e[0];if(null==r?void 0:r.ob){let t="";return(null===(i=null==r?void 0:r.profile)||void 0===i?void 0:i.waterbody)&&(t+=`${(0,te.C)(r.profile.waterbody)} - `),t+=(0,te.C)(r.ob.status.replace(/_/," ")),t}return""}}}}($e.rivers)}),{satellite:{id:"raster.satellite.infrared",layer:(0,u.BH)(J.satellite_infrared)},"satellite-geocolor":{id:"raster.satellite.geocolor",layer:(0,u.BH)(J.satellite_geocolor)},"satellite-visible":{id:"raster.satellite.visible",layer:(0,u.BH)(J.satellite_visible)},"satellite-infrared-color":{id:"raster.satellite.infrared-color",layer:(0,u.BH)(J.satellite_infrared_color)},"satellite-water-vapor":{id:"raster.satellite.water-vapor",layer:(0,u.BH)(J.satellite_water_vapor)}})},ni=(t,e)=>({sources:q(e),layers:ai(t)})}}]),e}));