@openremote/or-map 1.12.1 → 1.13.0-snapshot.20251216145940
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.
|
@@ -50,7 +50,7 @@ uniform ${i} ${r} u_${o};
|
|
|
50
50
|
#endif
|
|
51
51
|
`}),staticAttributes:r,staticUniforms:s}}class ta{constructor(t,n,i){this.vertexBuffer=t,this.indexBuffer=n,this.segments=i}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}var ts=n.aO([{name:"a_pos",type:"Int16",components:2}]);let tl="#define PROJECTION_MERCATOR",tc="mercator";class td{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return!1}get shaderVariantName(){return tc}get shaderDefine(){return tl}get shaderPreludeCode(){return tr.projectionMercator}get vertexShaderPreludeCode(){return tr.projectionMercator.vertexSource}get subdivisionGranularity(){return n.aP.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}get latitudeErrorCorrectionRadians(){return 0}destroy(){}updateGPUdependent(t){}getMeshFromTileID(t,i,r,o,a){if(this._cachedMesh)return this._cachedMesh;let s=new n.aQ;s.emplaceBack(0,0),s.emplaceBack(n.a3,0),s.emplaceBack(0,n.a3),s.emplaceBack(n.a3,n.a3);let l=t.createVertexBuffer(s,ts.members),c=n.aR.simpleSegment(0,0,4,2),d=new n.aS;d.emplaceBack(1,0,2),d.emplaceBack(1,2,3);let u=t.createIndexBuffer(d);return this._cachedMesh=new ta(l,u,c),this._cachedMesh}recalculate(){}hasTransition(){return!1}setErrorQueryLatitudeDegrees(t){}}class tu{constructor(t=0,n=0,i=0,r=0){if(isNaN(t)||t<0||isNaN(n)||n<0||isNaN(i)||i<0||isNaN(r)||r<0)throw Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=n,this.left=i,this.right=r}interpolate(t,i,r){return null!=i.top&&null!=t.top&&(this.top=n.F.number(t.top,i.top,r)),null!=i.bottom&&null!=t.bottom&&(this.bottom=n.F.number(t.bottom,i.bottom,r)),null!=i.left&&null!=t.left&&(this.left=n.F.number(t.left,i.left,r)),null!=i.right&&null!=t.right&&(this.right=n.F.number(t.right,i.right,r)),this}getCenter(t,i){let r=n.ai((this.left+t-this.right)/2,0,t),o=n.ai((this.top+i-this.bottom)/2,0,i);return new n.P(r,o)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new tu(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function tm(t,n){if(!t.renderWorldCopies||t.lngRange)return;let i=n.lng-t.center.lng;n.lng+=i>180?-360:360*(i<-180)}function th(t){return Math.max(0,Math.floor(t))}class tf{constructor(t,i){var r;this.applyConstrain=(t,n)=>null!==this._constrainOverride?this._constrainOverride(t,n):this._callbacks.defaultConstrain(t,n),this._callbacks=t,this._tileSize=512,this._renderWorldCopies=void 0===(null==i?void 0:i.renderWorldCopies)||!!(null==i?void 0:i.renderWorldCopies),this._minZoom=(null==i?void 0:i.minZoom)||0,this._maxZoom=(null==i?void 0:i.maxZoom)||22,this._minPitch=null==(null==i?void 0:i.minPitch)?0:null==i?void 0:i.minPitch,this._maxPitch=null==(null==i?void 0:i.maxPitch)?60:null==i?void 0:i.maxPitch,this._constrainOverride=null!=(r=null==i?void 0:i.constrainOverride)?r:null,this.setMaxBounds(),this._width=0,this._height=0,this._center=new n.U(0,0),this._elevation=0,this._zoom=0,this._tileZoom=th(this._zoom),this._scale=n.al(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new tu,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(t,i,r){this._constrainOverride=t.constrainOverride,this._latRange=t.latRange,this._lngRange=t.lngRange,this._width=t.width,this._height=t.height,this._center=t.center,this._elevation=t.elevation,this._minElevationForCurrentTile=t.minElevationForCurrentTile,this._zoom=t.zoom,this._tileZoom=th(this._zoom),this._scale=n.al(this._zoom),this._bearingInRadians=t.bearingInRadians,this._fovInRadians=t.fovInRadians,this._pitchInRadians=t.pitchInRadians,this._rollInRadians=t.rollInRadians,this._unmodified=t.unmodified,this._edgeInsets=new tu(t.padding.top,t.padding.bottom,t.padding.left,t.padding.right),this._minZoom=t.minZoom,this._maxZoom=t.maxZoom,this._minPitch=t.minPitch,this._maxPitch=t.maxPitch,this._renderWorldCopies=t.renderWorldCopies,this._cameraToCenterDistance=t.cameraToCenterDistance,this._nearZ=t.nearZ,this._farZ=t.farZ,this._autoCalculateNearFarZ=!r&&t.autoCalculateNearFarZ,i&&this.constrainInternal(),this._calcMatrices()}get pixelsToClipSpaceMatrix(){return this._pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._clipSpaceToPixelsMatrix}get minElevationForCurrentTile(){return this._minElevationForCurrentTile}setMinElevationForCurrentTile(t){this._minElevationForCurrentTile=t}get tileSize(){return this._tileSize}get tileZoom(){return this._tileZoom}get scale(){return this._scale}get width(){return this._width}get height(){return this._height}get bearingInRadians(){return this._bearingInRadians}get lngRange(){return this._lngRange}get latRange(){return this._latRange}get pixelsToGLUnits(){return this._pixelsToGLUnits}get minZoom(){return this._minZoom}setMinZoom(t){this._minZoom!==t&&(this._minZoom=t,this.setZoom(this.applyConstrain(this._center,this.zoom).zoom))}get maxZoom(){return this._maxZoom}setMaxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.setZoom(this.applyConstrain(this._center,this.zoom).zoom))}get minPitch(){return this._minPitch}setMinPitch(t){this._minPitch!==t&&(this._minPitch=t,this.setPitch(Math.max(this.pitch,t)))}get maxPitch(){return this._maxPitch}setMaxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.setPitch(Math.min(this.pitch,t)))}get renderWorldCopies(){return this._renderWorldCopies}setRenderWorldCopies(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t}get constrainOverride(){return this._constrainOverride}setConstrainOverride(t){void 0===t&&(t=null),this._constrainOverride!==t&&(this._constrainOverride=t,this.constrainInternal(),this._calcMatrices())}get worldSize(){return this._tileSize*this._scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new n.P(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(t){var i,r,o,a,s,l,c,d,u;let m=n.V(t,-180,180)*Math.PI/180;this._bearingInRadians!==m&&(this._unmodified=!1,this._bearingInRadians=m,this._calcMatrices(),this._rotationMatrix=g(),i=this._rotationMatrix,o=-this._bearingInRadians,a=(r=this._rotationMatrix)[0],s=r[1],l=r[2],c=r[3],d=Math.sin(o),u=Math.cos(o),i[0]=a*u+l*d,i[1]=s*u+c*d,i[2]=-(a*d)+l*u,i[3]=-(s*d)+c*u)}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(t){let i=n.ai(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==i&&(this._unmodified=!1,this._pitchInRadians=i,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(t){let n=t/180*Math.PI;this._rollInRadians!==n&&(this._unmodified=!1,this._rollInRadians=n,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return n.aT(this._fovInRadians)}setFov(t){t=n.ai(t,.1,150),this.fov!==t&&(this._unmodified=!1,this._fovInRadians=n.ak(t),this._calcMatrices())}get zoom(){return this._zoom}setZoom(t){let i=this.applyConstrain(this._center,t).zoom;this._zoom!==i&&(this._unmodified=!1,this._zoom=i,this._tileZoom=Math.max(0,Math.floor(i)),this._scale=n.al(i),this.constrainInternal(),this._calcMatrices())}get center(){return this._center}setCenter(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this.constrainInternal(),this._calcMatrices())}get elevation(){return this._elevation}setElevation(t){t!==this._elevation&&(this._elevation=t,this.constrainInternal(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}setPadding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this._width,this._height)}get pixelsPerMeter(){return this._pixelPerMeter}get unmodified(){return this._unmodified}get cameraToCenterDistance(){return this._cameraToCenterDistance}get nearZ(){return this._nearZ}get farZ(){return this._farZ}get autoCalculateNearFarZ(){return this._autoCalculateNearFarZ}overrideNearFarZ(t,n){this._autoCalculateNearFarZ=!1,this._nearZ=t,this._farZ=n,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=!0,this._calcMatrices()}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,n,i){this._unmodified=!1,this._edgeInsets.interpolate(t,n,i),this.constrainInternal(),this._calcMatrices()}resize(t,n,i=!0){this._width=t,this._height=n,i&&this.constrainInternal(),this._calcMatrices()}getMaxBounds(){return this._latRange&&2===this._latRange.length&&this._lngRange&&2===this._lngRange.length?new K([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]]):null}setMaxBounds(t){t?(this._lngRange=[t.getWest(),t.getEast()],this._latRange=[t.getSouth(),t.getNorth()],this.constrainInternal()):(this._lngRange=null,this._latRange=[-n.aj,n.aj])}getCameraQueryGeometry(t,i){if(1===i.length)return[i[0],t];{let{minX:r,minY:o,maxX:a,maxY:s}=n.a6.fromPoints(i).extend(t);return[new n.P(r,o),new n.P(a,o),new n.P(a,s),new n.P(r,s),new n.P(r,o)]}}constrainInternal(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;let t=this._unmodified,{center:n,zoom:i}=this.applyConstrain(this.center,this.zoom);this.setCenter(n),this.setZoom(i),this._unmodified=t,this._constraining=!1}_calcMatrices(){if(this._width&&this._height){this._pixelsToGLUnits=[2/this._width,-2/this._height];let t=n.am(new Float64Array(16));n.O(t,t,[this._width/2,-this._height/2,1]),n.N(t,t,[1,-1,0]),this._clipSpaceToPixelsMatrix=t,t=n.am(new Float64Array(16)),n.O(t,t,[1,-1,1]),n.N(t,t,[-1,-1,0]),n.O(t,t,[2/this._width,2/this._height,1]),this._pixelsToClipSpaceMatrix=t,this._cameraToCenterDistance=.5/Math.tan(this.fovInRadians/2)*this._height}this._callbacks.calcMatrices()}calculateCenterFromCameraLngLatAlt(t,i,r,o){let a,s=void 0!==r?r:this.bearing,l=o=void 0!==o?o:this.pitch,c=n.a5.fromLngLat(t,i),d=-Math.cos(n.ak(l)),u=Math.sin(n.ak(l)),m=u*Math.sin(n.ak(s)),h=-u*Math.cos(n.ak(s)),f=this.elevation,p=i-f;d*p>=0||.1>Math.abs(d)?f=i+(a=1e4)*d:a=-p/d;let b,g,_=n.aU(1,c.y),y=0;do{if((y+=1)>10)break;g=a/_,_=1/(b=new n.a5(c.x+m*g,c.y+h*g)).meterInMercatorCoordinateUnits()}while(Math.abs(a-g*_)>1e-12);return{center:b.toLngLat(),elevation:f,zoom:n.ao(this.height/2/Math.tan(this.fovInRadians/2)/g/this.tileSize)}}recalculateZoomAndCenter(t){if(this.elevation-t==0)return;let i=n.an(1,this.center.lat)*this.worldSize,r=this.cameraToCenterDistance/i,o=n.a5.fromLngLat(this.center,this.elevation),a=ev(this.center,this.elevation,this.pitch,this.bearing,r);this._elevation=t;let s=this.calculateCenterFromCameraLngLatAlt(a.toLngLat(),n.aU(a.z,o.y),this.bearing,this.pitch);this._elevation=s.elevation,this._center=s.center,this.setZoom(s.zoom)}getCameraPoint(){let t=Math.tan(this.pitchInRadians)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new n.P(t*Math.sin(this.rollInRadians),t*Math.cos(this.rollInRadians)))}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this._cameraToCenterDistance/this._pixelPerMeter+this.elevation}getCameraLngLat(){let t=n.an(1,this.center.lat)*this.worldSize;return ev(this.center,this.elevation,this.pitch,this.bearing,this.cameraToCenterDistance/t).toLngLat()}getMercatorTileCoordinates(t){if(!t)return[0,0,1,1];let i=t.canonical.z>=0?1<<t.canonical.z:Math.pow(2,t.canonical.z);return[t.canonical.x/i,t.canonical.y/i,1/i/n.a3,1/i/n.a3]}}class tp{constructor(t,i){this.min=t,this.max=i,this.center=n.aV([],n.aW([],this.min,this.max),.5)}quadrant(t){let i=[t%2==0,t<2],r=n.aX(this.min),o=n.aX(this.max);for(let t=0;t<i.length;t++)r[t]=i[t]?this.min[t]:this.center[t],o[t]=i[t]?this.center[t]:this.max[t];return o[2]=this.max[2],new tp(r,o)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}intersectsFrustum(t){let n=!0;for(let i=0;i<t.planes.length;i++){let r=this.intersectsPlane(t.planes[i]);if(0===r)return 0;1===r&&(n=!1)}return n?2:t.aabb.min[0]>this.max[0]||t.aabb.min[1]>this.max[1]||t.aabb.min[2]>this.max[2]||t.aabb.max[0]<this.min[0]||t.aabb.max[1]<this.min[1]||t.aabb.max[2]<this.min[2]?0:1}intersectsPlane(t){let n=t[3],i=t[3];for(let r=0;r<3;r++)t[r]>0?(n+=t[r]*this.min[r],i+=t[r]*this.max[r]):(i+=t[r]*this.min[r],n+=t[r]*this.max[r]);return n>=0?2:i<0?0:1}}class tb{distanceToTile2d(t,n,i,r){return Math.hypot(r.distanceX([t,n]),r.distanceY([t,n]))}getWrap(t,n,i){return i}getTileBoundingVolume(t,i,r,o){var a,s;let l=0,c=0;if(null==o?void 0:o.terrain){let d=new n.a0(t.z,i,t.z,t.x,t.y),u=o.terrain.getMinMaxElevation(d);l=null!=(a=u.minElevation)?a:Math.min(0,r),c=null!=(s=u.maxElevation)?s:Math.max(0,r)}let d=1<<t.z;return new tp([i+t.x/d,t.y/d,l],[i+(t.x+1)/d,(t.y+1)/d,c])}allowVariableZoom(t,i){let r=t.fov*(Math.abs(Math.cos(t.rollInRadians))*t.height+Math.abs(Math.sin(t.rollInRadians))*t.width)/t.height,o=n.ai(78.5-r/2,0,60);return!!i.terrain||t.pitch>o}allowWorldCopies(){return!0}prepareNextFrame(){}}class tg{constructor(t,n,i){this.points=t,this.planes=n,this.aabb=i}static fromInvProjectionMatrix(t,i=1,r=0,o,a){let s=a?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],l=Math.pow(2,r),c=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(r=>(function(t,i,r,o){let a=n.aB([],t,i),s=1/a[3]/r*o;return n.b0(a,a,[s,s,1/a[3],s])})(r,t,i,l));o&&function(t,i,r,o){let a=4*!!o,s=4*!o,l=0,c=[],d=[];for(let i=0;i<4;i++){let r=n.aY([],t[i+s],t[i+a]),o=n.b1(r);n.aV(r,r,1/o),c.push(o),d.push(r)}for(let i=0;i<4;i++){let o=n.b2(t[i+a],d[i],r);l=null!==o&&o>=0?Math.max(l,o):Math.max(l,c[i])}let u=function(t,i){let r=n.aY([],t[i[0]],t[i[1]]),o=n.aY([],t[i[2]],t[i[1]]),a=[0,0,0,0];return n.aZ(a,n.a_([],r,o)),a[3]=-n.a$(a,t[i[0]]),a}(t,i),m=function(t,i){let r=n.b3(t),o=n.b4([],t,1/r),a=n.aY([],i,n.aV([],o,n.a$(i,o))),s=n.b3(a);if(s>0){let t=Math.sqrt(1-o[3]*o[3]),r=n.aV([],o,-o[3]),l=n.aW([],r,n.aV([],a,t/s));return n.b5(i,l)}return null}(r,u);null!==m&&(l=Math.min(l,m/n.a$(d[0],u)));for(let n=0;n<4;n++){let i=Math.min(l,c[n]);t[n+s]=[t[n+a][0]+d[n][0]*i,t[n+a][1]+d[n][1]*i,t[n+a][2]+d[n][2]*i,1]}}(c,s[0],o,a);let d=s.map(t=>{let i=n.aY([],c[t[0]],c[t[1]]),r=n.aY([],c[t[2]],c[t[1]]),o=n.aZ([],n.a_([],i,r)),a=-n.a$(o,c[t[1]]);return o.concat(a)}),u=[1/0,1/0,1/0],m=[-1/0,-1/0,-1/0];for(let t of c)for(let n=0;n<3;n++)u[n]=Math.min(u[n],t[n]),m[n]=Math.max(m[n],t[n]);return new tg(c,d,new tp(u,m))}}class t_{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,n,i){return this._helper.interpolatePadding(t,n,i)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,n,i=!0){this._helper.resize(t,n,i)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,n){this._helper.overrideNearFarZ(t,n)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(t,n){}constructor(t){this._posMatrixCache=new Map,this._alignedPosMatrixCache=new Map,this._fogMatrixCacheF32=new Map,this.defaultConstrain=(t,i)=>{let r,o;i=n.ai(+i,this.minZoom,this.maxZoom);let a={center:new n.U(t.lng,t.lat),zoom:i},s=this._helper._lngRange;this._helper._renderWorldCopies||null!==s||(s=[-(180-1e-10),180-1e-10]);let l=this.tileSize*n.al(a.zoom),c=0,d=l,u=0,m=l,h=0,f=0,{x:p,y:b}=this.size;if(this._helper._latRange){let t=this._helper._latRange;c=n.W(t[1])*l,(d=n.W(t[0])*l)-c<b&&(h=b/(d-c))}s&&(u=n.V(n.X(s[0])*l,0,l),(m=n.V(n.X(s[1])*l,0,l))<u&&(m+=l),m-u<p&&(f=p/(m-u)));let{x:g,y:_}=eb(l,t),y=Math.max(f||0,h||0);if(y)return a.center=eg(l,new n.P(f?(m+u)/2:g,h?(d+c)/2:_)).wrap(),a.zoom+=n.ao(y),a;if(this._helper._latRange){let t=b/2;_-t<c&&(o=c+t),_+t>d&&(o=d-t)}if(s){let t=(u+m)/2,i=g;this._helper._renderWorldCopies&&(i=n.V(g,t-l/2,t+l/2));let o=p/2;i-o<u&&(r=u+o),i+o>m&&(r=m-o)}return(void 0!==r||void 0!==o)&&(a.center=eg(l,new n.P(null!=r?r:g,null!=o?o:_)).wrap()),a},this.applyConstrain=(t,n)=>this._helper.applyConstrain(t,n),this._helper=new tf({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(t,n)=>this.defaultConstrain(t,n)},t),this._coveringTilesDetailsProvider=new tb}clone(){let t=new t_;return t.apply(this),t}apply(t,n,i){this._helper.apply(t,n,i)}get cameraPosition(){return this._cameraPosition}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._viewProjMatrix}get inverseProjectionMatrix(){return this._invProjMatrix}get mercatorMatrix(){return this._mercatorMatrix}getVisibleUnwrappedCoordinates(t){let i=[new n.b6(0,t)];if(this._helper._renderWorldCopies){let r=this.screenPointToMercatorCoordinate(new n.P(0,0)),o=this.screenPointToMercatorCoordinate(new n.P(this._helper._width,0)),a=this.screenPointToMercatorCoordinate(new n.P(this._helper._width,this._helper._height)),s=this.screenPointToMercatorCoordinate(new n.P(0,this._helper._height)),l=Math.floor(Math.min(r.x,o.x,a.x,s.x)),c=Math.floor(Math.max(r.x,o.x,a.x,s.x));for(let r=l-1;r<=c+1;r++)0!==r&&i.push(new n.b6(r,t))}return i}getCameraFrustum(){return tg.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){let n=this.screenPointToLocation(this.centerPoint,t),i=t?t.getElevationForLngLatZoom(n,this._helper._tileZoom):0;this._helper.recalculateZoomAndCenter(i)}setLocationAtPoint(t,i){let r=n.an(this.elevation,this.center.lat),o=this.screenPointToMercatorCoordinateAtZ(i,r),a=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,r),s=n.a5.fromLngLat(t),l=new n.a5(s.x-(o.x-a.x),s.y-(o.y-a.y));this.setCenter(null==l?void 0:l.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(t,i){return i?this.coordinatePoint(n.a5.fromLngLat(t),i.getElevationForLngLatZoom(t,this._helper._tileZoom),this._pixelMatrix3D):this.coordinatePoint(n.a5.fromLngLat(t))}screenPointToLocation(t,n){var i;return null==(i=this.screenPointToMercatorCoordinate(t,n))?void 0:i.toLngLat()}screenPointToMercatorCoordinate(t,n){if(n){let i=n.pointCoordinate(t);if(null!=i)return i}return this.screenPointToMercatorCoordinateAtZ(t)}screenPointToMercatorCoordinateAtZ(t,i){let r=i||0,o=[t.x,t.y,0,1],a=[t.x,t.y,1,1];n.aB(o,o,this._pixelMatrixInverse),n.aB(a,a,this._pixelMatrixInverse);let s=o[3],l=a[3],c=o[1]/s,d=a[1]/l,u=o[2]/s,m=a[2]/l,h=u===m?0:(r-u)/(m-u);return new n.a5(n.F.number(o[0]/s,a[0]/l,h)/this.worldSize,n.F.number(c,d,h)/this.worldSize,r)}coordinatePoint(t,i=0,r=this._pixelMatrix){let o=[t.x*this.worldSize,t.y*this.worldSize,i,1];return n.aB(o,o,r),new n.P(o[0]/o[3],o[1]/o[3])}getBounds(){let t=Math.max(0,this._helper._height/2-e_(this));return(new K).extend(this.screenPointToLocation(new n.P(0,t))).extend(this.screenPointToLocation(new n.P(this._helper._width,t))).extend(this.screenPointToLocation(new n.P(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new n.P(0,this._helper._height)))}isPointOnMapSurface(t,n){return n?null!=n.pointCoordinate(t):t.y>this.height/2-e_(this)}calculatePosMatrix(t,i=!1,r){var o;let a=null!=(o=t.key)?o:n.b7(t.wrap,t.canonical.z,t.canonical.z,t.canonical.x,t.canonical.y),s=i?this._alignedPosMatrixCache:this._posMatrixCache;if(s.has(a)){let t=s.get(a);return r?t.f32:t.f64}let l=ey(t,this.worldSize);n.Q(l,i?this._alignedProjMatrix:this._viewProjMatrix,l);let c={f64:l,f32:new Float32Array(l)};return s.set(a,c),r?c.f32:c.f64}calculateFogMatrix(t){let i=t.key,r=this._fogMatrixCacheF32;if(r.has(i))return r.get(i);let o=ey(t,this.worldSize);return n.Q(o,this._fogMatrix,o),r.set(i,new Float32Array(o)),r.get(i)}calculateCenterFromCameraLngLatAlt(t,n,i,r){return this._helper.calculateCenterFromCameraLngLatAlt(t,n,i,r)}_calculateNearFarZIfNeeded(t,i,r){if(!this._helper.autoCalculateNearFarZ)return;let o=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),a=t-o*this._helper._pixelPerMeter/Math.cos(i),s=o<0?a:t,l=Math.PI/2+this.pitchInRadians,c=n.ak(this.fov)*(Math.abs(Math.cos(n.ak(this.roll)))*this.height+Math.abs(Math.sin(n.ak(this.roll)))*this.width)/this.height*(.5+r.y/this.height),d=Math.sin(c)*s/Math.sin(n.ai(Math.PI-l-c,.01,Math.PI-.01)),u=e_(this),m=Math.atan(u/this._helper.cameraToCenterDistance),h=n.ak(.75),f=m>h?2*m*(.5+r.y/(2*u)):h,p=Math.min(d,Math.sin(f)*s/Math.sin(n.ai(Math.PI-l-f,.01,Math.PI-.01)));this._helper._farZ=1.01*(Math.cos(Math.PI/2-i)*p+s),this._helper._nearZ=this._helper._height/50}_calcMatrices(){let t;if(!this._helper._height)return;let i=this.centerOffset,r=eb(this.worldSize,this.center),o=r.x,a=r.y;this._helper._pixelPerMeter=n.an(1,this.center.lat)*this.worldSize;let s=n.ak(Math.min(this.pitch,89.25)),l=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(s));this._calculateNearFarZIfNeeded(l,s,i),t=new Float64Array(16),n.b8(t,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),n.av(this._invProjMatrix,t),t[8]=-(2*i.x)/this._helper._width,t[9]=2*i.y/this._helper._height,this._projectionMatrix=n.b9(t),n.O(t,t,[1,-1,1]),n.N(t,t,[0,0,-this._helper.cameraToCenterDistance]),n.ba(t,t,-this.rollInRadians),n.bb(t,t,this.pitchInRadians),n.ba(t,t,-this.bearingInRadians),n.N(t,t,[-o,-a,0]),this._mercatorMatrix=n.O([],t,[this.worldSize,this.worldSize,this.worldSize]),n.O(t,t,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=n.Q(new Float64Array(16),this.clipSpaceToPixelsMatrix,t),n.N(t,t,[0,0,-this.elevation]),this._viewProjMatrix=t,this._invViewProjMatrix=n.av([],t);let c=[0,0,-1,1];n.aB(c,c,this._invViewProjMatrix),this._cameraPosition=[c[0]/c[3],c[1]/c[3],c[2]/c[3]],this._fogMatrix=new Float64Array(16),n.b8(this._fogMatrix,this.fovInRadians,this.width/this.height,l,this._helper._farZ),this._fogMatrix[8]=-(2*i.x)/this.width,this._fogMatrix[9]=2*i.y/this.height,n.O(this._fogMatrix,this._fogMatrix,[1,-1,1]),n.N(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),n.ba(this._fogMatrix,this._fogMatrix,-this.rollInRadians),n.bb(this._fogMatrix,this._fogMatrix,this.pitchInRadians),n.ba(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),n.N(this._fogMatrix,this._fogMatrix,[-o,-a,0]),n.O(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),n.N(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=n.Q(new Float64Array(16),this.clipSpaceToPixelsMatrix,t);let d=this._helper._width%2/2,u=this._helper._height%2/2,m=Math.cos(this.bearingInRadians),h=Math.sin(-this.bearingInRadians),f=o-Math.round(o)+m*d+h*u,p=a-Math.round(a)+m*u+h*d,b=new Float64Array(t);if(n.N(b,b,[f>.5?f-1:f,p>.5?p-1:p,0]),this._alignedProjMatrix=b,!(t=n.av(new Float64Array(16),this._pixelMatrix)))throw Error("failed to invert matrix");this._pixelMatrixInverse=t,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;let t=this.screenPointToMercatorCoordinate(new n.P(0,0)),i=[t.x*this.worldSize,t.y*this.worldSize,0,1];return n.aB(i,i,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){let t=n.an(1,this.center.lat)*this.worldSize;return ev(this.center,this.elevation,this.pitch,this.bearing,this._helper.cameraToCenterDistance/t).toLngLat()}lngLatToCameraDepth(t,i){let r=n.a5.fromLngLat(t),o=[r.x*this.worldSize,r.y*this.worldSize,i,1];return n.aB(o,o,this._viewProjMatrix),o[2]/o[3]}getProjectionData(t){let i,{overscaledTileID:r,aligned:o,applyTerrainMatrix:a}=t,s=this._helper.getMercatorTileCoordinates(r),l=r?this.calculatePosMatrix(r,o,!0):null;return{mainMatrix:i=r&&r.terrainRttPosMatrix32f&&a?r.terrainRttPosMatrix32f:l||n.bc(),tileMercatorCoords:s,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:i}}isLocationOccluded(t){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(t,n,i){return 1}transformLightDirection(t){return n.aX(t)}getRayDirectionFromPixel(t){throw Error("Not implemented.")}projectTileCoordinates(t,i,r,o){let a,s=this.calculatePosMatrix(r);o?(a=[t,i,o(t,i),1],n.aB(a,a,s)):eW(a=[t,i,0,1],a,s);let l=a[3];return{point:new n.P(a[0]/l,a[1]/l),signedDistanceFromCamera:l,isOccluded:!1}}populateCache(t){for(let n of t)this.calculatePosMatrix(n)}getMatrixForModel(t,i){let r=n.a5.fromLngLat(t,i),o=r.meterInMercatorCoordinateUnits(),a=n.bd();return n.N(a,a,[r.x,r.y,r.z]),n.ba(a,a,Math.PI),n.bb(a,a,Math.PI/2),n.O(a,a,[-o,o,o]),a}getProjectionDataForCustomLayer(t=!0){let i=new n.a0(0,0,0,0,0),r=this.getProjectionData({overscaledTileID:i,applyGlobeMatrix:t}),o=ey(i,this.worldSize);n.Q(o,this._viewProjMatrix,o),r.tileMercatorCoords=[0,0,1,1];let a=[n.a3,n.a3,this.worldSize/this._helper.pixelsPerMeter],s=n.be();return n.O(s,o,a),r.fallbackMatrix=s,r.mainMatrix=s,r}getFastPathSimpleProjectionMatrix(t){return this.calculatePosMatrix(t)}}function ty(){n.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function tv(t){if(t.useSlerp)if(t.k<1){let i=n.bf(t.startEulerAngles.roll,t.startEulerAngles.pitch,t.startEulerAngles.bearing),r=n.bf(t.endEulerAngles.roll,t.endEulerAngles.pitch,t.endEulerAngles.bearing),o=new Float64Array(4);n.bg(o,i,r,t.k);let a=n.bh(o);t.tr.setRoll(a.roll),t.tr.setPitch(a.pitch),t.tr.setBearing(a.bearing)}else t.tr.setRoll(t.endEulerAngles.roll),t.tr.setPitch(t.endEulerAngles.pitch),t.tr.setBearing(t.endEulerAngles.bearing);else t.tr.setRoll(n.F.number(t.startEulerAngles.roll,t.endEulerAngles.roll,t.k)),t.tr.setPitch(n.F.number(t.startEulerAngles.pitch,t.endEulerAngles.pitch,t.k)),t.tr.setBearing(n.F.number(t.startEulerAngles.bearing,t.endEulerAngles.bearing,t.k))}function tx(t,i,r,o,a){let s=a.padding,l=eb(a.worldSize,r.getNorthWest()),c=eb(a.worldSize,r.getNorthEast()),d=eb(a.worldSize,r.getSouthEast()),u=eb(a.worldSize,r.getSouthWest()),m=n.ak(-o),h=l.rotate(m),f=c.rotate(m),p=d.rotate(m),b=u.rotate(m),g=new n.P(Math.max(h.x,f.x,b.x,p.x),Math.max(h.y,f.y,b.y,p.y)),_=new n.P(Math.min(h.x,f.x,b.x,p.x),Math.min(h.y,f.y,b.y,p.y)),y=g.sub(_),v=(a.width-(s.left+s.right+i.left+i.right))/y.x,x=(a.height-(s.top+s.bottom+i.top+i.bottom))/y.y;if(x<0||v<0)return void ty();let w=Math.min(n.ao(a.scale*Math.min(v,x)),t.maxZoom),F=n.P.convert(t.offset),k=new n.P((i.left-i.right)/2,(i.top-i.bottom)/2).rotate(n.ak(o)),E=F.add(k).mult(a.scale/n.al(w));return{center:eg(a.worldSize,l.add(d).div(2).sub(E)),zoom:w,bearing:o}}class tw{get useGlobeControls(){return!1}handlePanInertia(t,n){let i=t.mag(),r=Math.abs(e_(n));return{easingOffset:t.mult(Math.min(.75*r/i,1)),easingCenter:n.center}}handleMapControlsRollPitchBearingZoom(t,n){t.bearingDelta&&n.setBearing(n.bearing+t.bearingDelta),t.pitchDelta&&n.setPitch(n.pitch+t.pitchDelta),t.rollDelta&&n.setRoll(n.roll+t.rollDelta),t.zoomDelta&&n.setZoom(n.zoom+t.zoomDelta)}handleMapControlsPan(t,n,i){.01>t.around.distSqr(n.centerPoint)||n.setLocationAtPoint(i,t.around)}cameraForBoxAndBearing(t,n,i,r,o){return tx(t,n,i,r,o)}handleJumpToCenterZoom(t,i){t.zoom!==(void 0!==i.zoom?+i.zoom:t.zoom)&&t.setZoom(+i.zoom),void 0!==i.center&&t.setCenter(n.U.convert(i.center))}handleEaseTo(t,i){let r=t.zoom,o=t.padding,a={roll:t.roll,pitch:t.pitch,bearing:t.bearing},s={roll:void 0===i.roll?t.roll:i.roll,pitch:void 0===i.pitch?t.pitch:i.pitch,bearing:void 0===i.bearing?t.bearing:i.bearing},l=void 0!==i.zoom,c=!t.isPaddingEqual(i.padding),d=!1,u=l?+i.zoom:t.zoom,m=t.centerPoint.add(i.offsetAsPoint),h=t.screenPointToLocation(m),{center:f,zoom:p}=t.applyConstrain(n.U.convert(i.center||h),null!=u?u:r);tm(t,f);let b=eb(t.worldSize,h),g=eb(t.worldSize,f).sub(b),_=n.al(p-r);return{easeFunc:l=>{if(d&&t.setZoom(n.F.number(r,p,l)),n.bi(a,s)||tv({startEulerAngles:a,endEulerAngles:s,tr:t,k:l,useSlerp:a.roll!=s.roll}),c&&(t.interpolatePadding(o,i.padding,l),m=t.centerPoint.add(i.offsetAsPoint)),i.around)t.setLocationAtPoint(i.around,i.aroundPoint);else{let i=n.al(t.zoom-r),o=Math.pow(p>r?Math.min(2,_):Math.max(.5,_),1-l),a=eg(t.worldSize,b.add(g.mult(l*o)).mult(i));t.setLocationAtPoint(t.renderWorldCopies?a.wrap():a,m)}},isZooming:d=p!==r,elevationCenter:f}}handleFlyTo(t,i){let r,o=void 0!==i.zoom,a=t.zoom,s=t.applyConstrain(n.U.convert(i.center||i.locationAtOffset),o?+i.zoom:a),l=s.center,c=s.zoom;tm(t,l);let d=eb(t.worldSize,i.locationAtOffset),u=eb(t.worldSize,l).sub(d),m=u.mag(),h=n.al(c-a);if(void 0!==i.minZoom){let o=Math.min(+i.minZoom,a,c),s=t.applyConstrain(l,o).zoom;r=n.al(s-a)}return{easeFunc:(i,r,o,s)=>{t.setZoom(1===i?c:a+n.ao(r));let m=1===i?l:eg(t.worldSize,d.add(u.mult(o)).mult(r));t.setLocationAtPoint(t.renderWorldCopies?m.wrap():m,s)},scaleOfZoom:h,targetCenter:l,scaleOfMinZoom:r,pixelPathLength:m}}}class tF{constructor(t,n,i){this.blendFunction=t,this.blendColor=n,this.mask=i}}tF.Replace=[1,0],tF.disabled=new tF(tF.Replace,n.bj.transparent,[!1,!1,!1,!1]),tF.unblended=new tF(tF.Replace,n.bj.transparent,[!0,!0,!0,!0]),tF.alphaBlended=new tF([1,771],n.bj.transparent,[!0,!0,!0,!0]);class tk{constructor(t,n,i){this.enable=t,this.mode=n,this.frontFace=i}}tk.disabled=new tk(!1,1029,2305),tk.backCCW=new tk(!0,1029,2305),tk.frontCCW=new tk(!0,1028,2305);class tE{constructor(t,n,i){this.func=t,this.mask=n,this.range=i}}tE.ReadOnly=!1,tE.ReadWrite=!0,tE.disabled=new tE(519,tE.ReadOnly,[0,1]);class tT{constructor(t,n,i,r,o,a){this.test=t,this.ref=n,this.mask=i,this.fail=r,this.depthFail=o,this.pass=a}}tT.disabled=new tT({func:519,mask:0},0,0,7680,7680,7680);let tA=new WeakMap;function tM(t){var n;if(tA.has(t))return tA.get(t);{let i=null==(n=t.getParameter(t.VERSION))?void 0:n.startsWith("WebGL 2.0");return tA.set(t,i),i}}class tC{get awaitingQuery(){return!!this._readbackQueue}constructor(t){this._readbackWaitFrames=4,this._measureWaitFrames=6,this._texWidth=1,this._texHeight=1,this._measuredError=0,this._updateCount=0,this._lastReadbackFrame=-1e3,this._readbackQueue=null,this._cachedRenderContext=t;let i=t.context,r=i.gl;this._texFormat=r.RGBA,this._texType=r.UNSIGNED_BYTE;let o=new n.aQ;o.emplaceBack(-1,-1),o.emplaceBack(2,-1),o.emplaceBack(-1,2);let a=new n.aS;a.emplaceBack(0,1,2),this._fullscreenTriangle=new ta(i.createVertexBuffer(o,ts.members),i.createIndexBuffer(a),n.aR.simpleSegment(0,0,o.length,a.length)),this._resultBuffer=new Uint8Array(4),i.activeTexture.set(r.TEXTURE1);let s=r.createTexture();r.bindTexture(r.TEXTURE_2D,s),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.NEAREST),r.texImage2D(r.TEXTURE_2D,0,this._texFormat,this._texWidth,this._texHeight,0,this._texFormat,this._texType,null),this._fbo=i.createFramebuffer(this._texWidth,this._texHeight,!1,!1),this._fbo.colorAttachment.set(s),tM(r)&&(this._pbo=r.createBuffer(),r.bindBuffer(r.PIXEL_PACK_BUFFER,this._pbo),r.bufferData(r.PIXEL_PACK_BUFFER,4,r.STREAM_READ),r.bindBuffer(r.PIXEL_PACK_BUFFER,null))}destroy(){let t=this._cachedRenderContext.context.gl;this._fullscreenTriangle.destroy(),this._fbo.destroy(),t.deleteBuffer(this._pbo),this._fullscreenTriangle=null,this._fbo=null,this._pbo=null,this._resultBuffer=null}updateErrorLoop(t,n){let i=this._updateCount;return this._readbackQueue?i>=this._readbackQueue.frameNumberIssued+this._readbackWaitFrames&&this._tryReadback():i>=this._lastReadbackFrame+this._measureWaitFrames&&this._renderErrorTexture(t,n),this._updateCount++,this._measuredError}_bindFramebuffer(){let t=this._cachedRenderContext.context,n=t.gl;t.activeTexture.set(n.TEXTURE1),n.bindTexture(n.TEXTURE_2D,this._fbo.colorAttachment.get()),t.bindFramebuffer.set(this._fbo.framebuffer)}_renderErrorTexture(t,i){let r=this._cachedRenderContext.context,o=r.gl;if(this._bindFramebuffer(),r.viewport.set([0,0,this._texWidth,this._texHeight]),r.clear({color:n.bj.transparent}),this._cachedRenderContext.useProgram("projectionErrorMeasurement").draw(r,o.TRIANGLES,tE.disabled,tT.disabled,tF.unblended,tk.disabled,{u_input:t,u_output_expected:i},null,null,"$clipping",this._fullscreenTriangle.vertexBuffer,this._fullscreenTriangle.indexBuffer,this._fullscreenTriangle.segments),this._pbo&&tM(o)){o.bindBuffer(o.PIXEL_PACK_BUFFER,this._pbo),o.readBuffer(o.COLOR_ATTACHMENT0),o.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,0),o.bindBuffer(o.PIXEL_PACK_BUFFER,null);let t=o.fenceSync(o.SYNC_GPU_COMMANDS_COMPLETE,0);o.flush(),this._readbackQueue={frameNumberIssued:this._updateCount,sync:t}}else this._readbackQueue={frameNumberIssued:this._updateCount,sync:null}}_tryReadback(){let t=this._cachedRenderContext.context.gl;if(this._pbo&&this._readbackQueue&&tM(t)){let i=t.clientWaitSync(this._readbackQueue.sync,0,0);if(i===t.WAIT_FAILED)return n.w("WebGL2 clientWaitSync failed."),this._readbackQueue=null,void(this._lastReadbackFrame=this._updateCount);if(i===t.TIMEOUT_EXPIRED)return;t.bindBuffer(t.PIXEL_PACK_BUFFER,this._pbo),t.getBufferSubData(t.PIXEL_PACK_BUFFER,0,this._resultBuffer,0,4),t.bindBuffer(t.PIXEL_PACK_BUFFER,null)}else this._bindFramebuffer(),t.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,this._resultBuffer);this._readbackQueue=null,this._measuredError=tC._parseRGBA8float(this._resultBuffer),this._lastReadbackFrame=this._updateCount}static _parseRGBA8float(t){let n;return n=0+(t[0]/256+t[1]/65536+t[2]/0x1000000),t[3]<127&&(n=-n),n/128}}let tS=n.a3/128;function tL(t,i){let r=void 0!==t.granularity?Math.max(t.granularity,1):1,o=r+2*!!t.generateBorders,a=r+(t.extendToNorthPole||t.generateBorders?1:0)+(t.extendToSouthPole||t.generateBorders?1:0),s=o+1,l=a+1,c=t.generateBorders?-1:0,d=t.generateBorders||t.extendToNorthPole?-1:0,u=r+ +!!t.generateBorders,m=r+(t.generateBorders||t.extendToSouthPole?1:0),h=o*a*6,f=s*l>65536;if(f&&"16bit"===i)throw Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");let p=f||"32bit"===i,b=new Int16Array(s*l*2),g=0;for(let i=d;i<=m;i++)for(let o=c;o<=u;o++){let a=o/r*n.a3;-1===o&&(a=-tS),o===r+1&&(a=n.a3+tS);let s=i/r*n.a3;-1===i&&(s=t.extendToNorthPole?n.bl:-tS),i===r+1&&(s=t.extendToSouthPole?n.bm:n.a3+tS),b[g++]=a,b[g++]=s}let _=p?new Uint32Array(h):new Uint16Array(h),y=0;for(let t=0;t<a;t++)for(let n=0;n<o;n++){let i=n+1+t*s,r=n+(t+1)*s,o=n+1+(t+1)*s;_[y++]=n+t*s,_[y++]=r,_[y++]=i,_[y++]=i,_[y++]=r,_[y++]=o}return{vertices:b.buffer.slice(0),indices:_.buffer.slice(0),uses32bitIndices:p}}let tD=new n.aP({fill:new n.bn(128,2),line:new n.bn(512,0),tile:new n.bn(128,32),stencil:new n.bn(128,1),circle:3});class tI{constructor(){this._tileMeshCache={},this._errorCorrectionUsable=0,this._errorMeasurementLastValue=0,this._errorCorrectionPreviousValue=0,this._errorMeasurementLastChangeTime=-1e3}get name(){return"vertical-perspective"}get transitionState(){return 1}get useSubdivision(){return!0}get shaderVariantName(){return"globe"}get shaderDefine(){return"#define GLOBE"}get shaderPreludeCode(){return tr.projectionGlobe}get vertexShaderPreludeCode(){return tr.projectionMercator.vertexSource}get subdivisionGranularity(){return tD}get useGlobeControls(){return!0}get latitudeErrorCorrectionRadians(){return this._errorCorrectionUsable}destroy(){this._errorMeasurement&&this._errorMeasurement.destroy()}updateGPUdependent(t){this._errorMeasurement||(this._errorMeasurement=new tC(t));let i=n.W(this._errorQueryLatitudeDegrees),r=2*Math.atan(Math.exp(Math.PI-i*Math.PI*2))-.5*Math.PI,o=this._errorMeasurement.updateErrorLoop(i,r),a=v();o!==this._errorMeasurementLastValue&&(this._errorCorrectionPreviousValue=this._errorCorrectionUsable,this._errorMeasurementLastValue=o,this._errorMeasurementLastChangeTime=a);let s=Math.min(Math.max((a-this._errorMeasurementLastChangeTime)/1e3/.5,0),1);this._errorCorrectionUsable=n.bo(this._errorCorrectionPreviousValue,-this._errorMeasurementLastValue,n.bp(s))}_getMeshKey(t){return`${t.granularity.toString(36)}_${t.generateBorders?"b":""}${t.extendToNorthPole?"n":""}${t.extendToSouthPole?"s":""}`}getMeshFromTileID(t,n,i,r,o){let a=("stencil"===o?tD.stencil:tD.tile).getGranularityForZoomLevel(n.z);return this._getMesh(t,{granularity:a,generateBorders:i,extendToNorthPole:0===n.y&&r,extendToSouthPole:n.y===(1<<n.z)-1&&r})}_getMesh(t,i){let r=this._getMeshKey(i);if(r in this._tileMeshCache)return this._tileMeshCache[r];let o=function(t,i){let r=tL(i,"16bit"),o=n.aQ.deserialize({arrayBuffer:r.vertices,length:r.vertices.byteLength/2/2}),a=n.aS.deserialize({arrayBuffer:r.indices,length:r.indices.byteLength/2/3});return new ta(t.createVertexBuffer(o,ts.members),t.createIndexBuffer(a),n.aR.simpleSegment(0,0,o.length,a.length))}(t,i);return this._tileMeshCache[r]=o,o}recalculate(t){}hasTransition(){let t=v();return(t-this._errorMeasurementLastChangeTime)/1e3<.7||this._errorMeasurement&&this._errorMeasurement.awaitingQuery}setErrorQueryLatitudeDegrees(t){this._errorQueryLatitudeDegrees=t}}let tP=new n.t({type:new n.D(n.u.projection.type)});class tR extends n.E{constructor(t){super(),this._transitionable=new n.x(tP,void 0),this.setProjection(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new n.G(0)),this._mercatorProjection=new td,this._verticalPerspectiveProjection=new tI}get transitionState(){let t=this.properties.get("type");if("string"==typeof t&&"mercator"===t)return 0;if("string"==typeof t&&"vertical-perspective"===t)return 1;if(t instanceof n.bq){if("vertical-perspective"===t.from&&"mercator"===t.to)return 1-t.transition;if("mercator"===t.from&&"vertical-perspective"===t.to)return t.transition}return 1}get useGlobeRendering(){return this.transitionState>0}get latitudeErrorCorrectionRadians(){return this._verticalPerspectiveProjection.latitudeErrorCorrectionRadians}get currentProjection(){return this.useGlobeRendering?this._verticalPerspectiveProjection:this._mercatorProjection}get name(){return"globe"}get useSubdivision(){return this.currentProjection.useSubdivision}get shaderVariantName(){return this.currentProjection.shaderVariantName}get shaderDefine(){return this.currentProjection.shaderDefine}get shaderPreludeCode(){return this.currentProjection.shaderPreludeCode}get vertexShaderPreludeCode(){return this.currentProjection.vertexShaderPreludeCode}get subdivisionGranularity(){return this.currentProjection.subdivisionGranularity}get useGlobeControls(){return this.transitionState>0}destroy(){this._mercatorProjection.destroy(),this._verticalPerspectiveProjection.destroy()}updateGPUdependent(t){this._mercatorProjection.updateGPUdependent(t),this._verticalPerspectiveProjection.updateGPUdependent(t)}getMeshFromTileID(t,n,i,r,o){return this.currentProjection.getMeshFromTileID(t,n,i,r,o)}setProjection(t){this._transitionable.setValue("type",(null==t?void 0:t.type)||"mercator")}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()||this.currentProjection.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}setErrorQueryLatitudeDegrees(t){this._verticalPerspectiveProjection.setErrorQueryLatitudeDegrees(t),this._mercatorProjection.setErrorQueryLatitudeDegrees(t)}}function tO(t){return 2*Math.PI*tN(t.worldSize,t.center.lat)}function tB(t,i,r,o,a){let s=1/(1<<a),l=i/n.a3*s+o*s,c=n.bs((t/n.a3*s+r*s)*Math.PI*2+Math.PI,2*Math.PI),d=2*Math.atan(Math.exp(Math.PI-l*Math.PI*2))-.5*Math.PI,u=Math.cos(d),m=new Float64Array(3);return m[0]=Math.sin(c)*u,m[1]=Math.sin(d),m[2]=Math.cos(c)*u,m}function tz(t){return function(t,n){let i=Math.cos(n),r=new Float64Array(3);return r[0]=Math.sin(t)*i,r[1]=Math.sin(n),r[2]=Math.cos(t)*i,r}(t.lng*Math.PI/180,t.lat*Math.PI/180)}function tN(t,n){return t/(2*Math.PI)/Math.cos(n*Math.PI/180)}function tY(t){let i=Math.asin(t[1])/Math.PI*180,r=Math.sqrt(t[0]*t[0]+t[2]*t[2]);if(r>1e-6){let o=t[0]/r,a=Math.acos(t[2]/r),s=(o>0?a:-a)/Math.PI*180;return new n.U(n.V(s,-180,180),i)}return new n.U(0,i)}function tj(t){return Math.cos(t*Math.PI/180)}function tU(t,i){let r=tj(t),o=tj(i);return n.ao(o/r)}function tH(t,i){let r=t.rotate(i.bearingInRadians),o=i.zoom+tU(i.center.lat,0),a=n.bo(1/tj(i.center.lat),1/tj(Math.min(Math.abs(i.center.lat),60)),n.br(o,7,3,0,1)),s=360/tO({worldSize:i.worldSize,center:{lat:i.center.lat}});return new n.U(i.center.lng-r.x*s*a,n.ai(i.center.lat+r.y*s,-n.aj,n.aj))}function tV(t){let n=.5*t,i=Math.sin(n),r=Math.cos(n);return Math.log(i+r)-Math.log(r-i)}function tG(t,i,r,o){let a=t.lat+r*o;if(Math.abs(r)>1){let s=(Math.sign(t.lat+r)!==Math.sign(t.lat)?-Math.abs(t.lat):Math.abs(t.lat))*Math.PI/180,l=Math.abs(t.lat+r)*Math.PI/180,c=tV(s+o*(l-s)),d=tV(s),u=tV(l);return new n.U(t.lng+(c-d)/(u-d)*i,a)}return new n.U(t.lng+i*o,a)}class tq{constructor(t){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=!1,this._boundingVolumeFactory=t}swapBuffers(){if(!this._hadAnyChanges)return;let t=this._cachePrevious;this._cachePrevious=this._cache,this._cache=t,this._cache.clear(),this._hadAnyChanges=!1}getTileBoundingVolume(t,n,i,r){let o=`${t.z}_${t.x}_${t.y}_${(null==r?void 0:r.terrain)?"t":""}`,a=this._cache.get(o);if(a)return a;let s=this._cachePrevious.get(o);if(s)return this._cache.set(o,s),s;let l=this._boundingVolumeFactory(t,n,i,r);return this._cache.set(o,l),this._hadAnyChanges=!0,l}}class t${constructor(t,n,i,r){this.min=i,this.max=r,this.points=t,this.planes=n}static fromAabb(t,n){let i=[];for(let r=0;r<8;r++)i.push([1&~r?t[0]:n[0],1==(r>>1&1)?n[1]:t[1],1==(r>>2&1)?n[2]:t[2]]);return new t$(i,[[-1,0,0,n[0]],[1,0,0,-t[0]],[0,-1,0,n[1]],[0,1,0,-t[1]],[0,0,-1,n[2]],[0,0,1,-t[2]]],t,n)}static fromCenterSizeAngles(t,i,r){let o=n.bv([],r[0],r[1],r[2]),a=n.bw([],[i[0],0,0],o),s=n.bw([],[0,i[1],0],o),l=n.bw([],[0,0,i[2]],o),c=[...t],d=[...t];for(let n=0;n<8;n++)for(let i=0;i<3;i++){let r=t[i]+a[i]*(1&~n?-1:1)+s[i]*(1==(n>>1&1)?1:-1)+l[i]*(1==(n>>2&1)?1:-1);c[i]=Math.min(c[i],r),d[i]=Math.max(d[i],r)}let u=[];for(let i=0;i<8;i++){let r=[...t];n.aW(r,r,n.aV([],a,1&~i?-1:1)),n.aW(r,r,n.aV([],s,1==(i>>1&1)?1:-1)),n.aW(r,r,n.aV([],l,1==(i>>2&1)?1:-1)),u.push(r)}return new t$(u,[[...a,-n.a$(a,u[0])],[...s,-n.a$(s,u[0])],[...l,-n.a$(l,u[0])],[-a[0],-a[1],-a[2],-n.a$(a,u[7])],[-s[0],-s[1],-s[2],-n.a$(s,u[7])],[-l[0],-l[1],-l[2],-n.a$(l,u[7])]],c,d)}intersectsFrustum(t){let n=!0,i=this.points.length,r=this.planes.length,o=t.planes.length,a=t.points.length;for(let r=0;r<o;r++){let o=t.planes[r],a=0;for(let t=0;t<i;t++){let n=this.points[t];o[0]*n[0]+o[1]*n[1]+o[2]*n[2]+o[3]>=0&&a++}if(0===a)return 0;a<i&&(n=!1)}if(n)return 2;for(let n=0;n<r;n++){let i=this.planes[n],r=0;for(let n=0;n<a;n++){let o=t.points[n];i[0]*o[0]+i[1]*o[1]+i[2]*o[2]+i[3]>=0&&r++}if(0===r)return 0}return 1}intersectsPlane(t){let n=this.points.length,i=0;for(let r=0;r<n;r++){let n=this.points[r];t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]>=0&&i++}return i===n?2:+(0!==i)}}function tW(t,n,i){let r=t-n;return r<0?-r:Math.max(0,r-i)}function tZ(t,n,i,r,o){let a=t-i;return Math.max(a<0?Math.min(-a,1+a-o):a>1?Math.min(Math.max(a-o,0),1-a):0,tW(n,r,o))}class tX{constructor(){this._boundingVolumeCache=new tq(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(t,n,i,r){let o=1<<i.z,a=1/o,s=i.x/o,l=i.y/o;return Math.min(Math.min(Math.min(2,tZ(t,n,s,l,a)),tZ(t,n,s+.5,-l-a,a)),tZ(t,n,s+.5,2-l-a,a))}getWrap(t,n,i){let r=1<<n.z,o=1/r,a=n.x/r,s=tW(t.x,a,o),l=tW(t.x,a-1,o),c=tW(t.x,a+1,o),d=Math.min(s,l,c);return d===c?1:d===l?-1:0}allowVariableZoom(t,n){return ek(t,n)>4}allowWorldCopies(){return!1}getTileBoundingVolume(t,n,i,r){return this._boundingVolumeCache.getTileBoundingVolume(t,n,i,r)}_computeTileBoundingVolume(t,i,r,o){var a,s;let l=0,c=0;if(null==o?void 0:o.terrain){let d=new n.a0(t.z,i,t.z,t.x,t.y),u=o.terrain.getMinMaxElevation(d);l=null!=(a=u.minElevation)?a:Math.min(0,r),c=null!=(s=u.maxElevation)?s:Math.max(0,r)}if(l/=n.by,c/=n.by,l+=1,c+=1,t.z<=0)return t$.fromAabb([-c,-c,-c],[c,c,c]);if(1===t.z)return t$.fromAabb([0===t.x?-c:0,0===t.y?0:-c,-c],[0===t.x?0:c,0===t.y?c:0,c]);{let i=[tB(0,0,t.x,t.y,t.z),tB(n.a3,0,t.x,t.y,t.z),tB(n.a3,n.a3,t.x,t.y,t.z),tB(0,n.a3,t.x,t.y,t.z)],r=[];for(let t of i)r.push(n.aV([],t,c));if(c!==l)for(let t of i)r.push(n.aV([],t,l));0===t.y&&r.push([0,1,0]),t.y===(1<<t.z)-1&&r.push([0,-1,0]);let o=[1,1,1],a=[-1,-1,-1];for(let t of r)for(let n=0;n<3;n++)o[n]=Math.min(o[n],t[n]),a[n]=Math.max(a[n],t[n]);let s=tB(n.a3/2,n.a3/2,t.x,t.y,t.z),d=n.a_([],[0,1,0],s);n.aZ(d,d);let u=n.a_([],s,d);n.aZ(u,u);let m=n.a_([],i[2],i[1]);n.aZ(m,m);let h=n.a_([],i[0],i[3]);n.aZ(h,h),r.push(n.aV([],s,c)),t.y>=(1<<t.z)/2&&r.push(n.aV([],tB(n.a3/2,0,t.x,t.y,t.z),c)),t.y<(1<<t.z)/2&&r.push(n.aV([],tB(n.a3/2,n.a3,t.x,t.y,t.z),c));let f=tK(s,r),p=tK(u,r),b=[-s[0],-s[1],-s[2],f.max],g=[s[0],s[1],s[2],-f.min],_=[-u[0],-u[1],-u[2],p.max],y=[u[0],u[1],u[2],-p.min],v=[...m,0],x=[...h,0],w=[];return 0===t.y?w.push(n.bx(x,v,b),n.bx(x,v,g)):w.push(n.bx(_,v,b),n.bx(_,v,g),n.bx(_,x,b),n.bx(_,x,g)),t.y===(1<<t.z)-1?w.push(n.bx(x,v,b),n.bx(x,v,g)):w.push(n.bx(y,v,b),n.bx(y,v,g),n.bx(y,x,b),n.bx(y,x,g)),new t$(w,[b,g,_,y,v,x],o,a)}}}function tK(t,i){let r=1/0,o=-1/0;for(let a of i){let i=n.a$(t,a);r=Math.min(r,i),o=Math.max(o,i)}return{min:r,max:o}}class tJ{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,n,i){return this._helper.interpolatePadding(t,n,i)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,n){this._helper.resize(t,n)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,n){this._helper.overrideNearFarZ(t,n)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(t){}constructor(t){this._cachedClippingPlane=n.bz(),this._projectionMatrix=n.bd(),this._globeViewProjMatrix32f=n.bc(),this._globeViewProjMatrixNoCorrection=n.bd(),this._globeViewProjMatrixNoCorrectionInverted=n.bd(),this._globeProjMatrixInverted=n.bd(),this._cameraPosition=n.bt(),this._globeLatitudeErrorCorrectionRadians=0,this.defaultConstrain=(t,i)=>{let r=n.ai(t.lat,-n.aj,n.aj),o=n.ai(+i,this.minZoom+tU(0,r),this.maxZoom);return{center:new n.U(t.lng,r),zoom:o}},this.applyConstrain=(t,n)=>this._helper.applyConstrain(t,n),this._helper=new tf({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(t,n)=>this.defaultConstrain(t,n)},t),this._coveringTilesDetailsProvider=new tX}clone(){let t=new tJ;return t.apply(this),t}apply(t,n){this._globeLatitudeErrorCorrectionRadians=n||0,this._helper.apply(t)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixNoCorrection}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){let t=n.bt();return t[0]=this._cameraPosition[0],t[1]=this._cameraPosition[1],t[2]=this._cameraPosition[2],t}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(t){let{overscaledTileID:n,applyGlobeMatrix:i}=t,r=this._helper.getMercatorTileCoordinates(n);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:r,clippingPlane:this._cachedClippingPlane,projectionTransition:+!!i,fallbackMatrix:this._globeViewProjMatrix32f}}_computeClippingPlane(t){let i=this.pitchInRadians,r=this.cameraToCenterDistance/t,o=Math.sin(i)*r,a=Math.cos(i)*r+1,s=1/Math.sqrt(o*o+a*a)*1,l=-o,c=a,d=Math.sqrt(l*l+c*c),u=[0,l/=d,c/=d];n.bA(u,u,[0,0,0],-this.bearingInRadians),n.bB(u,u,[0,0,0],-1*this.center.lat*Math.PI/180),n.bC(u,u,[0,0,0],this.center.lng*Math.PI/180);let m=1/n.b1(u);return n.aV(u,u,m),[...u,-s*m]}isLocationOccluded(t){return!this.isSurfacePointVisible(tz(t))}transformLightDirection(t){let i=this._helper._center.lng*Math.PI/180,r=this._helper._center.lat*Math.PI/180,o=Math.cos(r),a=[Math.sin(i)*o,Math.sin(r),Math.cos(i)*o],s=[a[2],0,-a[0]],l=[0,0,0];n.a_(l,s,a),n.aZ(s,s),n.aZ(l,l);let c=[0,0,0];return n.aZ(c,[s[0]*t[0]+l[0]*t[1]+a[0]*t[2],s[1]*t[0]+l[1]*t[1]+a[1]*t[2],s[2]*t[0]+l[2]*t[1]+a[2]*t[2]]),c}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(t,i,r){var o;let a=function(t,i,r){let o=1/(1<<r.z);return new n.a5(t/n.a3*o+r.x*o,i/n.a3*o+r.y*o)}(t,i,r.canonical),s=(o=a.y,[n.bs(a.x*Math.PI*2+Math.PI,2*Math.PI),2*Math.atan(Math.exp(Math.PI-o*Math.PI*2))-.5*Math.PI]);return this.getCircleRadiusCorrection()/Math.cos(s[1])}projectTileCoordinates(t,i,r,o){let a=r.canonical,s=tB(t,i,a.x,a.y,a.z),l=1+(o?o(t,i):0)/n.by,c=[s[0]*l,s[1]*l,s[2]*l,1];n.aB(c,c,this._globeViewProjMatrixNoCorrection);let d=this._cachedClippingPlane,u=d[0]*s[0]+d[1]*s[1]+d[2]*s[2]+d[3]<0;return{point:new n.P(c[0]/c[3],c[1]/c[3]),signedDistanceFromCamera:c[3],isOccluded:u}}_calcMatrices(){if(!this._helper._width||!this._helper._height)return;let t=tN(this.worldSize,this.center.lat),i=n.be(),r=n.be();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+2*t),n.b8(i,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);let o=this.centerOffset;i[8]=-(2*o.x)/this._helper._width,i[9]=2*o.y/this._helper._height,this._projectionMatrix=n.b9(i),this._globeProjMatrixInverted=n.be(),n.av(this._globeProjMatrixInverted,i),n.N(i,i,[0,0,-this.cameraToCenterDistance]),n.ba(i,i,this.rollInRadians),n.bb(i,i,-this.pitchInRadians),n.ba(i,i,this.bearingInRadians),n.N(i,i,[0,0,-t]);let a=n.bt();a[0]=t,a[1]=t,a[2]=t,n.bb(r,i,this.center.lat*Math.PI/180),n.bD(r,r,-this.center.lng*Math.PI/180),n.O(r,r,a),this._globeViewProjMatrixNoCorrection=r,n.bb(i,i,this.center.lat*Math.PI/180-this._globeLatitudeErrorCorrectionRadians),n.bD(i,i,-this.center.lng*Math.PI/180),n.O(i,i,a),this._globeViewProjMatrix32f=new Float32Array(i),this._globeViewProjMatrixNoCorrectionInverted=n.be(),n.av(this._globeViewProjMatrixNoCorrectionInverted,r);let s=n.bt();this._cameraPosition=n.bt(),this._cameraPosition[2]=this.cameraToCenterDistance/t,n.bA(this._cameraPosition,this._cameraPosition,s,-this.rollInRadians),n.bB(this._cameraPosition,this._cameraPosition,s,this.pitchInRadians),n.bA(this._cameraPosition,this._cameraPosition,s,-this.bearingInRadians),n.aW(this._cameraPosition,this._cameraPosition,[0,0,1]),n.bB(this._cameraPosition,this._cameraPosition,s,-this.center.lat*Math.PI/180),n.bC(this._cameraPosition,this._cameraPosition,s,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(t);let l=n.b9(this._globeViewProjMatrixNoCorrectionInverted);n.O(l,l,[1,1,-1]),this._cachedFrustum=tg.fromInvProjectionMatrix(l,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(t){n.w("calculateFogMatrix is not supported on globe projection.");let i=n.be();return n.am(i),i}getVisibleUnwrappedCoordinates(t){return[new n.b6(0,t)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(t){t&&n.w("terrain is not fully supported on vertical perspective projection."),this._helper.recalculateZoomAndCenter(0)}maxPitchScaleFactor(){return 1}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(t,i){if(!this._globeViewProjMatrixNoCorrection)return 1;let r=tz(t);n.aV(r,r,1+i/n.by);let o=n.bz();return n.aB(o,[r[0],r[1],r[2],1],this._globeViewProjMatrixNoCorrection),o[2]/o[3]}populateCache(t){}getBounds(){let t=.5*this.width,i=.5*this.height,r=[new n.P(0,0),new n.P(t,0),new n.P(this.width,0),new n.P(this.width,i),new n.P(this.width,this.height),new n.P(t,this.height),new n.P(0,this.height),new n.P(0,i)],o=[];for(let t of r)o.push(this.unprojectScreenPoint(t));let a=0,s=0,l=0,c=0,d=this.center;for(let t of o){let i=n.bE(d.lng,t.lng),r=n.bE(d.lat,t.lat);i<s&&(s=i),i>a&&(a=i),r<c&&(c=r),r>l&&(l=r)}let u=[d.lng+s,d.lat+c,d.lng+a,d.lat+l];return this.isSurfacePointOnScreen([0,1,0])&&(u[3]=90,u[0]=-180,u[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(u[1]=-90,u[0]=-180,u[2]=180),new K(u)}calculateCenterFromCameraLngLatAlt(t,n,i,r){return this._helper.calculateCenterFromCameraLngLatAlt(t,n,i,r)}setLocationAtPoint(t,i){let r,o,a=tz(this.unprojectScreenPoint(i)),s=tz(t),l=n.bt();n.bF(l);let c=n.bt();n.bC(c,a,l,-this.center.lng*Math.PI/180),n.bB(c,c,l,this.center.lat*Math.PI/180);let d=s[0]*s[0]+s[2]*s[2],u=c[0]*c[0];if(d<u)return;let m=Math.sqrt(d-u),h=n.bG(s[0],s[2],c[0],m),f=n.bG(s[0],s[2],c[0],-m),p=n.bt();n.bC(p,s,l,-h);let b=n.bG(p[1],p[2],c[1],c[2]),g=n.bt();n.bC(g,s,l,-f);let _=n.bG(g[1],g[2],c[1],c[2]),y=.5*Math.PI,v=b>=-y&&b<=y,x=_>=-y&&_<=y;if(v&&x){let t=this.center.lng*Math.PI/180,i=this.center.lat*Math.PI/180;n.bH(h,t)+n.bH(b,i)<n.bH(f,t)+n.bH(_,i)?(r=h,o=b):(r=f,o=_)}else if(v)r=h,o=b;else{if(!x)return;r=f,o=_}let w=r/Math.PI*180,F=o/Math.PI*180,k=this.center.lat;this.setCenter(new n.U(w,n.ai(F,-90,90))),this.setZoom(this.zoom+tU(k,this.center.lat))}locationToScreenPoint(t,i){let r=tz(t);if(i){let o=i.getElevationForLngLatZoom(t,this._helper._tileZoom);n.aV(r,r,1+o/n.by)}return this._projectSurfacePointToScreen(r)}_projectSurfacePointToScreen(t){let i=n.bz();return n.aB(i,[...t,1],this._globeViewProjMatrixNoCorrection),i[0]/=i[3],i[1]/=i[3],new n.P((.5*i[0]+.5)*this.width,(-(.5*i[1])+.5)*this.height)}screenPointToMercatorCoordinate(t,i){if(i){let n=i.pointCoordinate(t);if(n)return n}return n.a5.fromLngLat(this.unprojectScreenPoint(t))}screenPointToLocation(t,n){var i;return null==(i=this.screenPointToMercatorCoordinate(t,n))?void 0:i.toLngLat()}isPointOnMapSurface(t,n){let i=this._cameraPosition,r=this.getRayDirectionFromPixel(t);return!!this.rayPlanetIntersection(i,r)}getRayDirectionFromPixel(t){let i=n.bz();i[0]=t.x/this.width*2-1,i[1]=-1*(t.y/this.height*2-1),i[2]=1,i[3]=1,n.aB(i,i,this._globeViewProjMatrixNoCorrectionInverted),i[0]/=i[3],i[1]/=i[3],i[2]/=i[3];let r=n.bt();r[0]=i[0]-this._cameraPosition[0],r[1]=i[1]-this._cameraPosition[1],r[2]=i[2]-this._cameraPosition[2];let o=n.bt();return n.aZ(o,r),o}isSurfacePointVisible(t){let n=this._cachedClippingPlane;return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]>=0}isSurfacePointOnScreen(t){if(!this.isSurfacePointVisible(t))return!1;let i=n.bz();return n.aB(i,[...t,1],this._globeViewProjMatrixNoCorrection),i[0]/=i[3],i[1]/=i[3],i[2]/=i[3],i[0]>-1&&i[0]<1&&i[1]>-1&&i[1]<1&&i[2]>-1&&i[2]<1}rayPlanetIntersection(t,i){let r=n.a$(t,i),o=n.bt(),a=n.bt();n.aV(a,i,r),n.aY(o,t,a);let s=1-n.a$(o,o);if(s<0)return null;let l=n.a$(t,t)-1,c=-r+(r<0?1:-1)*Math.sqrt(s),d=l/c;return{tMin:Math.min(d,c),tMax:Math.max(d,c)}}unprojectScreenPoint(t){let i=this._cameraPosition,r=this.getRayDirectionFromPixel(t),o=this.rayPlanetIntersection(i,r);if(o){let t=n.bt();n.aW(t,i,[r[0]*o.tMin,r[1]*o.tMin,r[2]*o.tMin]);let a=n.bt();return n.aZ(a,t),tY(a)}let a=this._cachedClippingPlane,s=a[0]*r[0]+a[1]*r[1]+a[2]*r[2],l=-n.b5(a,i)/s,c=n.bt();if(l>0)n.aW(c,i,[r[0]*l,r[1]*l,r[2]*l]);else{let t=n.bt();n.aW(t,i,[2*r[0],2*r[1],2*r[2]]);let o=n.b5(this._cachedClippingPlane,t);n.aY(c,t,[this._cachedClippingPlane[0]*o,this._cachedClippingPlane[1]*o,this._cachedClippingPlane[2]*o])}let d=function(t){let i=n.bt();return i[0]=-(t[0]*t[3]),i[1]=-(t[1]*t[3]),i[2]=-(t[2]*t[3]),{center:i,radius:Math.sqrt(1-t[3]*t[3])}}(a);return tY(function(t,i,r){let o=n.bt();n.aY(o,r,t);let a=n.bt();return n.bu(a,t,o,i/n.b3(o)),a}(d.center,d.radius,c))}getMatrixForModel(t,i){let r=n.U.convert(t),o=1/n.by,a=n.bd();return n.bD(a,a,r.lng/180*Math.PI),n.bb(a,a,-r.lat/180*Math.PI),n.N(a,a,[0,0,1+i/n.by]),n.bb(a,a,.5*Math.PI),n.O(a,a,[o,o,o]),a}getProjectionDataForCustomLayer(t=!0){let i=this.getProjectionData({overscaledTileID:new n.a0(0,0,0,0,0),applyGlobeMatrix:t});return i.tileMercatorCoords=[0,0,1,1],i}getFastPathSimpleProjectionMatrix(t){}}class tQ{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(t){this._helper.setMinZoom(t)}setMaxZoom(t){this._helper.setMaxZoom(t)}setMinPitch(t){this._helper.setMinPitch(t)}setMaxPitch(t){this._helper.setMaxPitch(t)}setRenderWorldCopies(t){this._helper.setRenderWorldCopies(t)}setBearing(t){this._helper.setBearing(t)}setPitch(t){this._helper.setPitch(t)}setRoll(t){this._helper.setRoll(t)}setFov(t){this._helper.setFov(t)}setZoom(t){this._helper.setZoom(t)}setCenter(t){this._helper.setCenter(t)}setElevation(t){this._helper.setElevation(t)}setMinElevationForCurrentTile(t){this._helper.setMinElevationForCurrentTile(t)}setPadding(t){this._helper.setPadding(t)}interpolatePadding(t,n,i){return this._helper.interpolatePadding(t,n,i)}isPaddingEqual(t){return this._helper.isPaddingEqual(t)}resize(t,n,i=!0){this._helper.resize(t,n,i)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(t){this._helper.setMaxBounds(t)}setConstrainOverride(t){this._helper.setConstrainOverride(t)}overrideNearFarZ(t,n){this._helper.overrideNearFarZ(t,n)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(t){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),t)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get constrainOverride(){return this._helper.constrainOverride}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}get isGlobeRendering(){return this._globeness>0}setTransitionState(t,n){this._globeness=t,this._globeLatitudeErrorCorrectionRadians=n,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame(),this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(t){this._globeLatitudeErrorCorrectionRadians=0,this._globeness=1,this.defaultConstrain=(t,n)=>this.currentTransform.defaultConstrain(t,n),this.applyConstrain=(t,n)=>this._helper.applyConstrain(t,n),this._helper=new tf({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(t,n)=>this.defaultConstrain(t,n)},t),this._globeness=1,this._mercatorTransform=new t_,this._verticalPerspectiveTransform=new tJ}clone(){let t=new tQ;return t._globeness=this._globeness,t._globeLatitudeErrorCorrectionRadians=this._globeLatitudeErrorCorrectionRadians,t.apply(this),t}apply(t){this._helper.apply(t),this._mercatorTransform.apply(this),this._verticalPerspectiveTransform.apply(this,this._globeLatitudeErrorCorrectionRadians)}get projectionMatrix(){return this.currentTransform.projectionMatrix}get modelViewProjectionMatrix(){return this.currentTransform.modelViewProjectionMatrix}get inverseProjectionMatrix(){return this.currentTransform.inverseProjectionMatrix}get cameraPosition(){return this.currentTransform.cameraPosition}getProjectionData(t){let n=this._mercatorTransform.getProjectionData(t),i=this._verticalPerspectiveTransform.getProjectionData(t);return{mainMatrix:this.isGlobeRendering?i.mainMatrix:n.mainMatrix,clippingPlane:i.clippingPlane,tileMercatorCoords:i.tileMercatorCoords,projectionTransition:t.applyGlobeMatrix?this._globeness:0,fallbackMatrix:n.fallbackMatrix}}isLocationOccluded(t){return this.currentTransform.isLocationOccluded(t)}transformLightDirection(t){return this.currentTransform.transformLightDirection(t)}getPixelScale(){return n.bo(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return n.bo(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(t,i,r){let o=this._mercatorTransform.getPitchedTextCorrection(t,i,r),a=this._verticalPerspectiveTransform.getPitchedTextCorrection(t,i,r);return n.bo(o,a,this._globeness)}projectTileCoordinates(t,n,i,r){return this.currentTransform.projectTileCoordinates(t,n,i,r)}_calcMatrices(){this._helper._width&&this._helper._height&&(this._verticalPerspectiveTransform.apply(this,this._globeLatitudeErrorCorrectionRadians),this._helper._nearZ=this._verticalPerspectiveTransform.nearZ,this._helper._farZ=this._verticalPerspectiveTransform.farZ,this._mercatorTransform.apply(this,!0,this.isGlobeRendering),this._helper._nearZ=this._mercatorTransform.nearZ,this._helper._farZ=this._mercatorTransform.farZ)}calculateFogMatrix(t){return this.currentTransform.calculateFogMatrix(t)}getVisibleUnwrappedCoordinates(t){return this.currentTransform.getVisibleUnwrappedCoordinates(t)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(t){this._mercatorTransform.recalculateZoomAndCenter(t),this._verticalPerspectiveTransform.recalculateZoomAndCenter(t)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(t,n){return this.currentTransform.lngLatToCameraDepth(t,n)}populateCache(t){this._mercatorTransform.populateCache(t),this._verticalPerspectiveTransform.populateCache(t)}getBounds(){return this.currentTransform.getBounds()}calculateCenterFromCameraLngLatAlt(t,n,i,r){return this._helper.calculateCenterFromCameraLngLatAlt(t,n,i,r)}setLocationAtPoint(t,n){if(!this.isGlobeRendering)return this._mercatorTransform.setLocationAtPoint(t,n),void this.apply(this._mercatorTransform);this._verticalPerspectiveTransform.setLocationAtPoint(t,n),this.apply(this._verticalPerspectiveTransform)}locationToScreenPoint(t,n){return this.currentTransform.locationToScreenPoint(t,n)}screenPointToMercatorCoordinate(t,n){return this.currentTransform.screenPointToMercatorCoordinate(t,n)}screenPointToLocation(t,n){return this.currentTransform.screenPointToLocation(t,n)}isPointOnMapSurface(t,n){return this.currentTransform.isPointOnMapSurface(t,n)}getRayDirectionFromPixel(t){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(t)}getMatrixForModel(t,n){return this.currentTransform.getMatrixForModel(t,n)}getProjectionDataForCustomLayer(t=!0){let n=this._mercatorTransform.getProjectionDataForCustomLayer(t);if(!this.isGlobeRendering)return n;let i=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(t);return i.fallbackMatrix=n.mainMatrix,i}getFastPathSimpleProjectionMatrix(t){return this.currentTransform.getFastPathSimpleProjectionMatrix(t)}}class t0{get useGlobeControls(){return!0}handlePanInertia(t,i){let r=tH(t,i);return Math.abs(r.lng-i.center.lng)>180&&(r.lng=i.center.lng+179.5*Math.sign(r.lng-i.center.lng)),{easingCenter:r,easingOffset:new n.P(0,0)}}handleMapControlsRollPitchBearingZoom(t,i){let r=t.around,o=i.screenPointToLocation(r);t.bearingDelta&&i.setBearing(i.bearing+t.bearingDelta),t.pitchDelta&&i.setPitch(i.pitch+t.pitchDelta),t.rollDelta&&i.setRoll(i.roll+t.rollDelta);let a=i.zoom;t.zoomDelta&&i.setZoom(i.zoom+t.zoomDelta);let s=i.zoom-a;if(0===s)return;let l=n.bE(i.center.lng,o.lng),c=l/(Math.abs(l/180)+1),d=n.bE(i.center.lat,o.lat),u=i.getRayDirectionFromPixel(r),m=i.cameraPosition,h=-1*n.a$(m,u),f=n.bt();n.aW(f,m,[u[0]*h,u[1]*h,u[2]*h]);let p=Math.exp(-(.5*Math.max(n.b1(f)-1-.3,0))),b=tN(i.worldSize,i.center.lat)/Math.min(i.width,i.height),g=n.br(b,.9,.5,1,.25),_=(1-n.al(-s))*Math.min(p,g),y=i.center.lat,v=i.zoom,x=new n.U(i.center.lng+c*_,n.ai(i.center.lat+d*_,-n.aj,n.aj));i.setLocationAtPoint(o,r);let w=i.center,F=Math.pow(Math.max(n.br(Math.abs(l),45,85,0,1),n.br(b,.75,.35,0,1)),.25),k=n.bE(w.lng,x.lng),E=n.bE(w.lat,x.lat);i.setCenter(new n.U(w.lng+k*F,w.lat+E*F).wrap()),i.setZoom(v+tU(y,i.center.lat))}handleMapControlsPan(t,n,i){if(!t.panDelta)return;let r=n.center.lat,o=n.zoom;n.setCenter(tH(t.panDelta,n).wrap()),n.setZoom(o+tU(r,n.center.lat))}cameraForBoxAndBearing(t,i,r,o,a){let s=tx(t,i,r,o,a),l=i.left/a.width*2-1,c=(a.width-i.right)/a.width*2-1,d=-(i.top/a.height*2)+1,u=-((a.height-i.bottom)/a.height*2)+1,m=0>n.bE(r.getWest(),r.getEast()),h=m?r.getEast():r.getWest(),f=m?r.getWest():r.getEast(),p=Math.max(r.getNorth(),r.getSouth()),b=Math.min(r.getNorth(),r.getSouth()),g=h+.5*n.bE(h,f),_=p+.5*n.bE(p,b),y=a.clone();y.setCenter(s.center),y.setBearing(s.bearing),y.setPitch(0),y.setRoll(0),y.setZoom(s.zoom);let v=y.modelViewProjectionMatrix,x=[tz(r.getNorthWest()),tz(r.getNorthEast()),tz(r.getSouthWest()),tz(r.getSouthEast()),tz(new n.U(f,_)),tz(new n.U(h,_)),tz(new n.U(g,p)),tz(new n.U(g,b))],w=tz(s.center),F=1/0;for(let t of x)l<0&&(F=t0.getLesserNonNegativeNonNull(F,t0.solveVectorScale(t,w,v,"x",l))),c>0&&(F=t0.getLesserNonNegativeNonNull(F,t0.solveVectorScale(t,w,v,"x",c))),d>0&&(F=t0.getLesserNonNegativeNonNull(F,t0.solveVectorScale(t,w,v,"y",d))),u<0&&(F=t0.getLesserNonNegativeNonNull(F,t0.solveVectorScale(t,w,v,"y",u)));if(Number.isFinite(F)&&0!==F)return s.zoom=y.zoom+n.ao(F),s;ty()}handleJumpToCenterZoom(t,i){let r=t.center.lat,o=t.applyConstrain(i.center?n.U.convert(i.center):t.center,t.zoom).center;t.setCenter(o.wrap());let a=void 0!==i.zoom?+i.zoom:t.zoom+tU(r,o.lat);t.zoom!==a&&t.setZoom(a)}handleEaseTo(t,i){let r=t.zoom,o=t.center,a=t.padding,s={roll:t.roll,pitch:t.pitch,bearing:t.bearing},l={roll:void 0===i.roll?t.roll:i.roll,pitch:void 0===i.pitch?t.pitch:i.pitch,bearing:void 0===i.bearing?t.bearing:i.bearing},c=void 0!==i.zoom,d=!t.isPaddingEqual(i.padding),u=!1,m=i.center?n.U.convert(i.center):o,h=t.applyConstrain(m,r).center;tm(t,h);let f=t.clone();f.setCenter(h),f.setZoom(c?+i.zoom:r+tU(o.lat,m.lat)),f.setBearing(i.bearing);let p=new n.P(n.ai(t.centerPoint.x+i.offsetAsPoint.x,0,t.width),n.ai(t.centerPoint.y+i.offsetAsPoint.y,0,t.height));f.setLocationAtPoint(h,p);let b=(i.offset&&i.offsetAsPoint.mag())>0?f.center:h,g=c?+i.zoom:r+tU(o.lat,b.lat),_=r+tU(o.lat,0),y=g+tU(b.lat,0),v=n.bE(o.lng,b.lng),x=n.bE(o.lat,b.lat),w=n.al(y-_);return{easeFunc:r=>{if(n.bi(s,l)||tv({startEulerAngles:s,endEulerAngles:l,tr:t,k:r,useSlerp:s.roll!=l.roll}),d&&t.interpolatePadding(a,i.padding,r),i.around)n.w("Easing around a point is not supported under globe projection."),t.setLocationAtPoint(i.around,i.aroundPoint);else{let n=Math.pow(y>_?Math.min(2,w):Math.max(.5,w),1-r),i=tG(o,v,x,r*n);t.setCenter(i.wrap())}if(u){let i=n.F.number(_,y,r)+tU(0,t.center.lat);t.setZoom(i)}},isZooming:u=g!==r,elevationCenter:b}}handleFlyTo(t,i){let r,o=void 0!==i.zoom,a=t.center,s=t.zoom,l=t.padding,c=!t.isPaddingEqual(i.padding),d=t.applyConstrain(n.U.convert(i.center||i.locationAtOffset),s).center,u=o?+i.zoom:t.zoom+tU(t.center.lat,d.lat),m=t.clone();m.setCenter(d),m.setZoom(u),m.setBearing(i.bearing);let h=new n.P(n.ai(t.centerPoint.x+i.offsetAsPoint.x,0,t.width),n.ai(t.centerPoint.y+i.offsetAsPoint.y,0,t.height));m.setLocationAtPoint(d,h);let f=m.center;tm(t,f);let p=function(t,i,r){let o=tz(i),a=tz(r);return Math.acos(n.a$(o,a))/(2*Math.PI)*tO(t)}(t,a,f),b=s+tU(a.lat,0),g=u+tU(f.lat,0),_=n.al(g-b);if("number"==typeof i.minZoom){let o=Math.min(+i.minZoom+tU(f.lat,0),b,g)+tU(0,f.lat),a=t.applyConstrain(f,o).zoom+tU(f.lat,0);r=n.al(a-b)}let y=n.bE(a.lng,f.lng),v=n.bE(a.lat,f.lat);return{easeFunc:(r,o,s,d)=>{let m=tG(a,y,v,s);c&&t.interpolatePadding(l,i.padding,r);let h=1===r?f:m;t.setCenter(h.wrap());let p=b+n.ao(o);t.setZoom(1===r?u:p+tU(0,h.lat))},scaleOfZoom:_,targetCenter:f,scaleOfMinZoom:r,pixelPathLength:p}}static solveVectorScale(t,n,i,r,o){let a="x"===r?[i[0],i[4],i[8],i[12]]:[i[1],i[5],i[9],i[13]],s=[i[3],i[7],i[11],i[15]],l=t[0]*a[0]+t[1]*a[1]+t[2]*a[2],c=t[0]*s[0]+t[1]*s[1]+t[2]*s[2],d=n[0]*a[0]+n[1]*a[1]+n[2]*a[2],u=n[0]*s[0]+n[1]*s[1]+n[2]*s[2];return d+o*c===l+o*u||s[3]*(l-d)+a[3]*(u-c)+l*u==d*c?null:(d+a[3]-o*u-o*s[3])/(d-l-o*u+o*c)}static getLesserNonNegativeNonNull(t,n){return null!==n&&n>=0&&n<t?n:t}}class t1{constructor(t){this._globe=t,this._mercatorCameraHelper=new tw,this._verticalPerspectiveCameraHelper=new t0}get useGlobeControls(){return this._globe.useGlobeRendering}get currentHelper(){return this.useGlobeControls?this._verticalPerspectiveCameraHelper:this._mercatorCameraHelper}handlePanInertia(t,n){return this.currentHelper.handlePanInertia(t,n)}handleMapControlsRollPitchBearingZoom(t,n){return this.currentHelper.handleMapControlsRollPitchBearingZoom(t,n)}handleMapControlsPan(t,n,i){this.currentHelper.handleMapControlsPan(t,n,i)}cameraForBoxAndBearing(t,n,i,r,o){return this.currentHelper.cameraForBoxAndBearing(t,n,i,r,o)}handleJumpToCenterZoom(t,n){this.currentHelper.handleJumpToCenterZoom(t,n)}handleEaseTo(t,n){return this.currentHelper.handleEaseTo(t,n)}handleFlyTo(t,n){return this.currentHelper.handleFlyTo(t,n)}}let t2=(t,i)=>n.z(t,i&&i.filter(t=>"source.canvas"!==t.identifier)),t3=n.bI();class t5 extends n.E{constructor(t,i={}){var r,o;super(),this._rtlPluginLoaded=()=>{for(let t in this.tileManagers){let n=this.tileManagers[t].getSource().type;"vector"!==n&&"geojson"!==n||this.tileManagers[t].reload()}},this.map=t,this.dispatcher=new q(G(),t._getMapId()),this.dispatcher.registerMessageHandler("GG",(t,n)=>this.getGlyphs(t,n)),this.dispatcher.registerMessageHandler("GI",(t,n)=>this.getImages(t,n)),this.dispatcher.registerMessageHandler("GDA",(t,n)=>this.getDashes(t,n)),this.imageManager=new D,this.imageManager.setEventedParent(this);let a=(null==(r=t._container)?void 0:r.lang)||"undefined"!=typeof document&&(null==(o=document.documentElement)?void 0:o.lang)||void 0;this.glyphManager=new O(t._requestManager,i.localIdeographFontFamily,a),this.lineAtlas=new j(256,512),this.crossTileSymbolIndex=new tn,this._setInitialValues(),this._resetUpdates(),this.dispatcher.broadcast("SR",n.bJ()),eh().on(ed,this._rtlPluginLoaded),this.on("data",t=>{if("source"!==t.dataType||"metadata"!==t.sourceDataType)return;let n=this.tileManagers[t.sourceId];if(!n)return;let i=n.getSource();if(i&&i.vectorLayerIds)for(let t in this._layers){let n=this._layers[t];n.source===i.id&&this._validateLayer(n)}})}_setInitialValues(){var t;this._spritesImagesIds={},this._layers={},this._order=[],this.tileManagers={},this.zoomHistory=new n.bK,this._availableImages=[],this._globalState={},this._serializedLayers={},this.stylesheet=null,this.light=null,this.sky=null,this.projection&&(this.projection.destroy(),delete this.projection),this._loaded=!1,this._changed=!1,this._updatedLayers={},this._updatedSources={},this._changedImages={},this._glyphsDidChange=!1,this._updatedPaintProps={},this._layerOrderChanged=!1,this.crossTileSymbolIndex=new((null==(t=this.crossTileSymbolIndex)?void 0:t.constructor)||Object),this.pauseablePlacement=void 0,this.placement=void 0,this.z=0}setGlobalStateProperty(t,i){var r,o,a;this._checkLoaded();let s=null===i?null!=(a=null==(o=null==(r=this.stylesheet.state)?void 0:r[t])?void 0:o.default)?a:null:i;if(n.bL(s,this._globalState[t]))return this;this._globalState[t]=s,this._applyGlobalStateChanges([t])}getGlobalState(){return this._globalState}setGlobalState(t){this._checkLoaded();let i=[];for(let r in t)n.bL(this._globalState[r],t[r].default)||(i.push(r),this._globalState[r]=t[r].default);this._applyGlobalStateChanges(i)}_applyGlobalStateChanges(t){if(0===t.length)return;let n=new Set,i={};for(let r of t)for(let t in i[r]=this._globalState[r],this._layers){let i=this._layers[t],o=i.getLayoutAffectingGlobalStateRefs(),a=i.getPaintAffectingGlobalStateRefs();if(o.has(r)&&n.add(i.source),a.has(r))for(let{name:t,value:n}of a.get(r))this._updatePaintProperty(i,t,n)}for(let t in this.dispatcher.broadcast("UGS",i),this.tileManagers)n.has(t)&&(this._reloadSource(t),this._changed=!0)}loadURL(t,i={},r){this.fire(new n.l("dataloading",{dataType:"style"})),i.validate="boolean"!=typeof i.validate||i.validate;let o=this.map._requestManager.transformRequest(t,"Style");this._loadStyleRequest=new AbortController;let a=this._loadStyleRequest;n.j(o,this._loadStyleRequest).then(t=>{this._loadStyleRequest=null,this._load(t.data,i,r)}).catch(t=>{this._loadStyleRequest=null,t&&!a.signal.aborted&&this.fire(new n.k(t))})}loadJSON(t,i={},r){this.fire(new n.l("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,_.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,i.validate=!1!==i.validate,this._load(t,i,r)}).catch(()=>{})}loadEmpty(){this.fire(new n.l("dataloading",{dataType:"style"})),this._load(t3,{validate:!1})}_load(t,i,r){var o,a;let s=i.transformStyle?i.transformStyle(r,t):t;if(!i.validate||!t2(this,n.B(s))){for(let t in s=Object.assign({},s),this._loaded=!0,this.stylesheet=s,s.sources)this.addSource(t,s.sources[t],{validate:!1});s.sprite?this._loadSprite(s.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(s.glyphs),this._createLayers(),this.light=new z(this.stylesheet.light),this._setProjectionInternal((null==(o=this.stylesheet.projection)?void 0:o.type)||"mercator"),this.sky=new Y(this.stylesheet.sky),this.map.setTerrain(null!=(a=this.stylesheet.terrain)?a:null),this.fire(new n.l("data",{dataType:"style"})),this.fire(new n.l("style.load"))}}_createLayers(){var t,i,r;let o=n.bM(this.stylesheet.layers);for(let a of(this.setGlobalState(null!=(t=this.stylesheet.state)?t:null),this.dispatcher.broadcast("SL",o),this._order=o.map(t=>t.id),this._layers={},this._serializedLayers=null,o)){let t=n.bN(a,this._globalState);if(t.setEventedParent(this,{layer:{id:a.id}}),this._layers[a.id]=t,n.bO(t)&&this.tileManagers[t.source]){let n=null!=(r=null==(i=a.paint)?void 0:i["raster-fade-duration"])?r:t.paint.get("raster-fade-duration");this.tileManagers[t.source].setRasterFadeDuration(n)}}}_loadSprite(t,i=!1,r){let o;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,(function(t,i,r,o){return n._(this,void 0,void 0,function*(){let a=C(t),s=r>1?"@2x":"",l={},c={};for(let{id:t,url:r}of a){let a=i.transformRequest(S(r,s,".json"),"SpriteJSON");l[t]=n.j(a,o);let d=i.transformRequest(S(r,s,".png"),"SpriteImage");c[t]=h.getImage(d,o)}return yield Promise.all([...Object.values(l),...Object.values(c)]),function(t,i){return n._(this,void 0,void 0,function*(){let n={};for(let r in t){n[r]={};let o=_.getImageCanvasContext((yield i[r]).data),a=(yield t[r]).data;for(let t in a){let{width:i,height:s,x:l,y:c,sdf:d,pixelRatio:u,stretchX:m,stretchY:h,content:f,textFitWidth:p,textFitHeight:b}=a[t];n[r][t]={data:null,pixelRatio:u,sdf:d,stretchX:m,stretchY:h,content:f,textFitWidth:p,textFitHeight:b,spriteData:{width:i,height:s,x:l,y:c,context:o}}}}return n})}(l,c)})})(t,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(t=>{if(this._spriteRequest=null,t)for(let n in t){for(let i of(this._spritesImagesIds[n]=[],this._spritesImagesIds[n]?this._spritesImagesIds[n].filter(n=>!(n in t)):[]))this.imageManager.removeImage(i),this._changedImages[i]=!0;for(let r in t[n]){let o="default"===n?r:`${n}:${r}`;this._spritesImagesIds[n].push(o),o in this.imageManager.images?this.imageManager.updateImage(o,t[n][r],!1):this.imageManager.addImage(o,t[n][r]),i&&(this._changedImages[o]=!0)}}}).catch(t=>{this._spriteRequest=null,o=t,this.fire(new n.k(o))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),i&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new n.l("data",{dataType:"style"})),r&&r(o)})}_unloadSprite(){for(let t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new n.l("data",{dataType:"style"}))}_validateLayer(t){let i=this.tileManagers[t.source];if(!i)return;let r=t.sourceLayer;if(!r)return;let o=i.getSource();("geojson"===o.type||o.vectorLayerIds&&-1===o.vectorLayerIds.indexOf(r))&&this.fire(new n.k(Error(`Source layer "${r}" does not exist on source "${o.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let t in this.tileManagers)if(!this.tileManagers[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t,i=!1){let r=this._serializedAllLayers();if(!t||0===t.length)return Object.values(i?n.bP(r):r);let o=[];for(let a of t)if(r[a]){let t=i?n.bP(r[a]):r[a];o.push(t)}return o}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;for(let n of(t=this._serializedLayers={},Object.keys(this._layers))){let i=this._layers[n];"custom"!==i.type&&(t[n]=i.serialize())}return t}hasTransitions(){var t,n,i;if((null==(t=this.light)?void 0:t.hasTransition())||(null==(n=this.sky)?void 0:n.hasTransition())||(null==(i=this.projection)?void 0:i.hasTransition()))return!0;for(let t in this.tileManagers)if(this.tileManagers[t].hasTransition())return!0;for(let t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw Error("Style is not done loading.")}update(t){if(!this._loaded)return;let i=this._changed;if(i){let n=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);for(let t in(n.length||i.length)&&this._updateWorkerLayers(n,i),this._updatedSources){let n=this._updatedSources[t];if("reload"===n)this._reloadSource(t);else{if("clear"!==n)throw Error(`Invalid action ${n}`);this._clearSource(t)}}for(let n in this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs(),this._updatedPaintProps)this._layers[n].updateTransitions(t);this.light.updateTransitions(t),this.sky.updateTransitions(t),this._resetUpdates()}let r={};for(let t in this.tileManagers){let n=this.tileManagers[t];r[t]=n.used,n.used=!1}for(let n of this._order){let i=this._layers[n];i.recalculate(t,this._availableImages),!i.isHidden(t.zoom)&&i.source&&(this.tileManagers[i.source].used=!0)}for(let t in r){let i=this.tileManagers[t];!!r[t]!=!!i.used&&i.fire(new n.l("data",{sourceDataType:"visibility",dataType:"source",sourceId:t}))}this.light.recalculate(t),this.sky.recalculate(t),this.projection.recalculate(t),this.z=t.zoom,i&&this.fire(new n.l("data",{dataType:"style"}))}_updateTilesForChangedImages(){let t=Object.keys(this._changedImages);if(t.length){for(let n in this.tileManagers)this.tileManagers[n].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let t in this.tileManagers)this.tileManagers[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,n){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(t,!1),removedIds:n})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,i={}){var r;this._checkLoaded();let o=this.serialize();if(t=i.transformStyle?i.transformStyle(o,t):t,(null==(r=i.validate)||r)&&t2(this,n.B(t)))return!1;(t=n.bP(t)).layers=n.bM(t.layers);let a=n.bQ(o,t),s=this._getOperationsToPerform(a);if(s.unimplemented.length>0)throw Error(`Unimplemented: ${s.unimplemented.join(", ")}.`);if(0===s.operations.length)return!1;for(let t of s.operations)t();return this.stylesheet=t,this._serializedLayers=null,!0}_getOperationsToPerform(t){let n=[],i=[];for(let r of t)switch(r.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":case"setRoll":continue;case"addLayer":n.push(()=>this.addLayer.apply(this,r.args));break;case"removeLayer":n.push(()=>this.removeLayer.apply(this,r.args));break;case"setPaintProperty":n.push(()=>this.setPaintProperty.apply(this,r.args));break;case"setLayoutProperty":n.push(()=>this.setLayoutProperty.apply(this,r.args));break;case"setFilter":n.push(()=>this.setFilter.apply(this,r.args));break;case"addSource":n.push(()=>this.addSource.apply(this,r.args));break;case"removeSource":n.push(()=>this.removeSource.apply(this,r.args));break;case"setLayerZoomRange":n.push(()=>this.setLayerZoomRange.apply(this,r.args));break;case"setLight":n.push(()=>this.setLight.apply(this,r.args));break;case"setGeoJSONSourceData":n.push(()=>this.setGeoJSONSourceData.apply(this,r.args));break;case"setGlyphs":n.push(()=>this.setGlyphs.apply(this,r.args));break;case"setSprite":n.push(()=>this.setSprite.apply(this,r.args));break;case"setTerrain":n.push(()=>this.map.setTerrain.apply(this,r.args));break;case"setSky":n.push(()=>this.setSky.apply(this,r.args));break;case"setProjection":this.setProjection.apply(this,r.args);break;case"setGlobalState":n.push(()=>this.setGlobalState.apply(this,r.args));break;case"setTransition":n.push(()=>{});break;default:i.push(r.command)}return{operations:n,unimplemented:i}}addImage(t,i){if(this.getImage(t))return this.fire(new n.k(Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,i),this._afterImageUpdated(t)}updateImage(t,n){this.imageManager.updateImage(t,n)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new n.k(Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new n.l("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,i,r={}){if(this._checkLoaded(),void 0!==this.tileManagers[t])throw Error(`Source "${t}" already exists.`);if(!i.type)throw Error(`The type property must be defined, but only the following properties were given: ${Object.keys(i).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(i.type)>=0&&this._validate(n.B.source,`sources.${t}`,i,null,r))return;this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);let o=this.tileManagers[t]=new eA(t,i,this.dispatcher);o.style=this,o.setEventedParent(this,()=>({isSourceLoaded:o.loaded(),source:o.serialize(),sourceId:t})),o.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),void 0===this.tileManagers[t])throw Error("There is no source with this ID");for(let i in this._layers)if(this._layers[i].source===t)return this.fire(new n.k(Error(`Source "${t}" cannot be removed while layer "${i}" is using it.`)));let i=this.tileManagers[t];delete this.tileManagers[t],delete this._updatedSources[t],i.fire(new n.l("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),i.setEventedParent(null),i.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,n){if(this._checkLoaded(),void 0===this.tileManagers[t])throw Error(`There is no source with this ID=${t}`);let i=this.tileManagers[t].getSource();if("geojson"!==i.type)throw Error(`geojsonSource.type is ${i.type}, which is !== 'geojson`);i.setData(n),this._changed=!0}getSource(t){return this.tileManagers[t]&&this.tileManagers[t].getSource()}addLayer(t,i,r={}){let o;this._checkLoaded();let a=t.id;if(this.getLayer(a))return void this.fire(new n.k(Error(`Layer "${a}" already exists on this map.`)));if("custom"===t.type){if(t2(this,n.bR(t)))return;o=n.bN(t,this._globalState)}else{if("source"in t&&"object"==typeof t.source&&(this.addSource(a,t.source),t=n.bP(t),t=n.e(t,{source:a})),this._validate(n.B.layer,`layers.${a}`,t,{arrayIndex:-1},r))return;o=n.bN(t,this._globalState),this._validateLayer(o),o.setEventedParent(this,{layer:{id:a}})}let s=i?this._order.indexOf(i):this._order.length;if(i&&-1===s)this.fire(new n.k(Error(`Cannot add layer "${a}" before non-existing layer "${i}".`)));else{if(this._order.splice(s,0,a),this._layerOrderChanged=!0,this._layers[a]=o,this._removedLayers[a]&&o.source&&"custom"!==o.type){let t=this._removedLayers[a];delete this._removedLayers[a],t.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.tileManagers[o.source].pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map)}}moveLayer(t,i){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new n.k(Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===i)return;let r=this._order.indexOf(t);this._order.splice(r,1);let o=i?this._order.indexOf(i):this._order.length;i&&-1===o?this.fire(new n.k(Error(`Cannot move layer "${t}" before non-existing layer "${i}".`))):(this._order.splice(o,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();let i=this._layers[t];if(!i)return void this.fire(new n.k(Error(`Cannot remove non-existing layer "${t}".`)));i.setEventedParent(null);let r=this._order.indexOf(t);this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=i,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],i.onRemove&&i.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,i,r){this._checkLoaded();let o=this.getLayer(t);o?o.minzoom===i&&o.maxzoom===r||(null!=i&&(o.minzoom=i),null!=r&&(o.maxzoom=r),this._updateLayer(o)):this.fire(new n.k(Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,i,r={}){this._checkLoaded();let o=this.getLayer(t);if(o){if(!n.bL(o.filter,i))return null==i?(o.setFilter(void 0),void this._updateLayer(o)):void(this._validate(n.B.filter,`layers.${o.id}.filter`,i,null,r)||(o.setFilter(n.bP(i)),this._updateLayer(o)))}else this.fire(new n.k(Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return n.bP(this.getLayer(t).filter)}setLayoutProperty(t,i,r,o={}){this._checkLoaded();let a=this.getLayer(t);a?n.bL(a.getLayoutProperty(i),r)||(a.setLayoutProperty(i,r,o),this._updateLayer(a)):this.fire(new n.k(Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,i){let r=this.getLayer(t);if(r)return r.getLayoutProperty(i);this.fire(new n.k(Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,i,r,o={}){this._checkLoaded();let a=this.getLayer(t);a?n.bL(a.getPaintProperty(i),r)||this._updatePaintProperty(a,i,r,o):this.fire(new n.k(Error(`Cannot style non-existing layer "${t}".`)))}_updatePaintProperty(t,i,r,o={}){t.setPaintProperty(i,r,o)&&this._updateLayer(t),n.bO(t)&&"raster-fade-duration"===i&&this.tileManagers[t.source].setRasterFadeDuration(r),this._changed=!0,this._updatedPaintProps[t.id]=!0,this._serializedLayers=null}getPaintProperty(t,n){return this.getLayer(t).getPaintProperty(n)}setFeatureState(t,i){this._checkLoaded();let r=t.source,o=t.sourceLayer,a=this.tileManagers[r];if(void 0===a)return void this.fire(new n.k(Error(`The source '${r}' does not exist in the map's style.`)));let s=a.getSource().type;"geojson"===s&&o?this.fire(new n.k(Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==s||o?(void 0===t.id&&this.fire(new n.k(Error("The feature id parameter must be provided."))),a.setFeatureState(o,t.id,i)):this.fire(new n.k(Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,i){this._checkLoaded();let r=t.source,o=this.tileManagers[r];if(void 0===o)return void this.fire(new n.k(Error(`The source '${r}' does not exist in the map's style.`)));let a=o.getSource().type,s="vector"===a?t.sourceLayer:void 0;"vector"!==a||s?i&&"string"!=typeof t.id&&"number"!=typeof t.id?this.fire(new n.k(Error("A feature id is required to remove its specific state property."))):o.removeFeatureState(s,t.id,i):this.fire(new n.k(Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();let i=t.source,r=t.sourceLayer,o=this.tileManagers[i];if(void 0!==o)return"vector"!==o.getSource().type||r?(void 0===t.id&&this.fire(new n.k(Error("The feature id parameter must be provided."))),o.getFeatureState(r,t.id)):void this.fire(new n.k(Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new n.k(Error(`The source '${i}' does not exist in the map's style.`)))}getTransition(){return n.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;let t=n.bS(this.tileManagers,t=>t.serialize()),i=this._serializeByIds(this._order,!0),r=this.map.getTerrain()||void 0,o=this.stylesheet;return n.bT({version:o.version,name:o.name,metadata:o.metadata,light:o.light,sky:o.sky,center:o.center,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch,sprite:o.sprite,glyphs:o.glyphs,transition:o.transition,projection:o.projection,sources:t,layers:i,terrain:r},t=>void 0!==t)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.tileManagers[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.tileManagers[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){let n=t=>"fill-extrusion"===this._layers[t].type,i={},r=[];for(let o=this._order.length-1;o>=0;o--){let a=this._order[o];if(n(a))for(let n of(i[a]=o,t)){let t=n[a];if(t)for(let n of t)r.push(n)}}r.sort((t,n)=>n.intersectionZ-t.intersectionZ);let o=[];for(let a=this._order.length-1;a>=0;a--){let s=this._order[a];if(n(s))for(let t=r.length-1;t>=0;t--){let n=r[t].feature;if(i[n.layer.id]<a)break;o.push(n),r.pop()}else for(let n of t){let t=n[s];if(t)for(let n of t)o.push(n.feature)}}return o}queryRenderedFeatures(t,i,r){i&&i.filter&&this._validate(n.B.filter,"queryRenderedFeatures.filter",i.filter,null,i);let o={};if(i&&i.layers){if(!(Array.isArray(i.layers)||i.layers instanceof Set))return this.fire(new n.k(Error("parameters.layers must be an Array or a Set of strings"))),[];for(let t of i.layers){let i=this._layers[t];if(!i)return this.fire(new n.k(Error(`The layer '${t}' does not exist in the map's style and cannot be queried for features.`))),[];o[i.source]=!0}}let a=[];i.availableImages=this._availableImages;let s=this._serializedAllLayers(),l=i.layers instanceof Set?i.layers:Array.isArray(i.layers)?new Set(i.layers):null,c=Object.assign(Object.assign({},i),{layers:l,globalState:this._globalState});for(let l in this.tileManagers)i.layers&&!o[l]||a.push(function(t,i,r,o,a,s,l){let c=function(t,n,i){if(t)for(let r of t){let t=n[r];if(t&&t.source===i&&"fill-extrusion"===t.type)return!0}else for(let t in n){let r=n[t];if(r.source===i&&"fill-extrusion"===r.type)return!0}return!1}(null!=(h=null==a?void 0:a.layers)?h:null,i,t.id),d=s.maxPitchScaleFactor(),u=t.tilesIn(o,d,c);u.sort(W);let m=[];for(let o of u)m.push({wrappedTileID:o.tileID.wrapped().key,queryResults:o.tile.queryRenderedFeatures(i,r,t.getState(),o.queryGeometry,o.cameraQueryGeometry,o.scale,a,s,d,function(t,i){let r=n.M();return n.N(r,r,[1,1,0]),n.O(r,r,[.5*t.width,.5*t.height,1]),t.calculatePosMatrix?n.Q(r,r,t.calculatePosMatrix(i.toUnwrapped())):r}(s,o.tileID),l?(t,n)=>l(o.tileID,t,n):void 0)});var h,f=function(t){let n={},i={};for(let r of t){let t=r.queryResults,o=r.wrappedTileID,a=i[o]=i[o]||{};for(let i in t){let r=t[i],o=a[i]=a[i]||{},s=n[i]=n[i]||[];for(let t of r)o[t.featureIndex]||(o[t.featureIndex]=!0,s.push(t))}}return n}(m);for(let n in f)for(let i of f[n])Z(i,t);return f}(this.tileManagers[l],this._layers,s,t,c,r,this.map.terrain?(t,n,i)=>this.map.terrain.getElevation(t,n,i):void 0));return this.placement&&a.push(function(t,n,i,r,o,a,s){let l={},c=a.queryRenderedSymbols(r),d=[];for(let t of Object.keys(c).map(Number))d.push(s[t]);for(let i of(d.sort(W),d)){let r=i.featureIndex.lookupSymbolFeatures(c[i.bucketInstanceId],n,i.bucketIndex,i.sourceLayerIndex,{filterSpec:o.filter,globalState:o.globalState},o.layers,o.availableImages,t);for(let t in r){let n=l[t]=l[t]||[],o=r[t];for(let t of(o.sort((t,n)=>{let r=i.featureSortOrder;if(r){let i=r.indexOf(t.featureIndex);return r.indexOf(n.featureIndex)-i}return n.featureIndex-t.featureIndex}),o))n.push(t)}}for(let n in l)for(let r of l[n])Z(r,i[t[n].source]);return l}(this._layers,s,this.tileManagers,t,c,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(a)}querySourceFeatures(t,i){(null==i?void 0:i.filter)&&this._validate(n.B.filter,"querySourceFeatures.filter",i.filter,null,i);let r=this.tileManagers[t];return r?function(t,n){let i=t.getRenderableIds().map(n=>t.getTileByID(n)),r=[],o={};for(let t=0;t<i.length;t++){let a=i[t],s=a.tileID.canonical.key;o[s]||(o[s]=!0,a.querySourceFeatures(r,n))}return r}(r,i?Object.assign(Object.assign({},i),{globalState:this._globalState}):{globalState:this._globalState}):[]}getLight(){return this.light.getLight()}setLight(t,i={}){this._checkLoaded();let r=this.light.getLight(),o=!1;for(let i in t)if(!n.bL(t[i],r[i])){o=!0;break}if(!o)return;let a={now:v(),transition:n.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,i),this.light.updateTransitions(a)}getProjection(){var t;return null==(t=this.stylesheet)?void 0:t.projection}setProjection(t){if(this._checkLoaded(),this.projection){if(this.projection.name===t.type)return;this.projection.destroy(),delete this.projection}this.stylesheet.projection=t,this._setProjectionInternal(t.type)}getSky(){var t;return null==(t=this.stylesheet)?void 0:t.sky}setSky(t,i={}){this._checkLoaded();let r=this.getSky(),o=!1;if(!t&&!r)return;if(t&&!r)o=!0;else if(!t&&r)o=!0;else for(let i in t)if(!n.bL(t[i],r[i])){o=!0;break}if(!o)return;let a={now:v(),transition:n.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=t,this.sky.setSky(t,i),this.sky.updateTransitions(a)}_setProjectionInternal(t){let i=function(t,i){let r={constrainOverride:i};if(Array.isArray(t)){let n=new tR({type:t});return{projection:n,transform:new tQ(r),cameraHelper:new t1(n)}}switch(t){case"mercator":return{projection:new td,transform:new t_(r),cameraHelper:new tw};case"globe":{let t=new tR({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]});return{projection:t,transform:new tQ(r),cameraHelper:new t1(t)}}case"vertical-perspective":return{projection:new tI,transform:new tJ(r),cameraHelper:new t0};default:return n.w(`Unknown projection name: ${t}. Falling back to mercator projection.`),{projection:new td,transform:new t_(r),cameraHelper:new tw}}}(t,this.map.transformConstrain);for(let t in this.projection=i.projection,this.map.migrateProjection(i.transform,i.cameraHelper),this.tileManagers)this.tileManagers[t].reload()}_validate(t,i,r,o,a={}){return(!a||!1!==a.validate)&&t2(this,t.call(n.B,n.e({key:i,style:this.serialize(),value:r,styleSpec:n.u},o)))}_remove(t=!0){for(let t in this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),eh().off(ed,this._rtlPluginLoaded),this._layers)this._layers[t].setEventedParent(null);for(let t in this.tileManagers){let n=this.tileManagers[t];n.setEventedParent(null),n.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),t&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(t)}_clearSource(t){this.tileManagers[t].clearTiles()}_reloadSource(t){this.tileManagers[t].resume(),this.tileManagers[t].reload()}_updateSources(t){for(let n in this.tileManagers)this.tileManagers[n].update(t,this.map.terrain)}_generateCollisionBoxes(){for(let t in this.tileManagers)this._reloadSource(t)}_updatePlacement(t,n,i,r,o=!1){let a=!1,s=!1,l={};for(let n of this._order){let i=this._layers[n];if("symbol"!==i.type)continue;if(!l[i.source]){let t=this.tileManagers[i.source];l[i.source]=t.getRenderableIds(!0).map(n=>t.getTileByID(n)).sort((t,n)=>n.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(n.tileID)?-1:1))}let r=this.crossTileSymbolIndex.addLayer(i,l[i.source],t.center.lng);a=a||r}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((o=o||this._layerOrderChanged||0===i)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(v(),t.zoom))&&(this.pauseablePlacement=new e8(t,this.map.terrain,this._order,o,n,i,r,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(v()),s=!0),a&&this.pauseablePlacement.placement.setStale()),s||a)for(let t of this._order){let n=this._layers[t];"symbol"===n.type&&this.placement.updateLayerOpacities(n,l[n.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(v())}_releaseSymbolFadeTiles(){for(let t in this.tileManagers)this.tileManagers[t].releaseSymbolFadeTiles()}getImages(t,i){return n._(this,void 0,void 0,function*(){let t=yield this.imageManager.getImages(i.icons);this._updateTilesForChangedImages();let n=this.tileManagers[i.source];return n&&n.setDependencies(i.tileID.key,i.type,i.icons),t})}getGlyphs(t,i){return n._(this,void 0,void 0,function*(){let t=yield this.glyphManager.getGlyphs(i.stacks),n=this.tileManagers[i.source];return n&&n.setDependencies(i.tileID.key,i.type,[""]),t})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,i={}){this._checkLoaded(),t&&this._validate(n.B.glyphs,"glyphs",t,null,i)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}getDashes(t,i){return n._(this,void 0,void 0,function*(){let t={};for(let[n,r]of Object.entries(i.dashes))t[n]=this.lineAtlas.getDash(r.dasharray,r.round);return t})}addSprite(t,i,r={},o){this._checkLoaded();let a=[{id:t,url:i}],s=[...C(this.stylesheet.sprite),...a];this._validate(n.B.sprite,"sprite",s,null,r)||(this.stylesheet.sprite=s,this._loadSprite(a,!0,o))}removeSprite(t){this._checkLoaded();let i=C(this.stylesheet.sprite);if(i.find(n=>n.id===t)){if(this._spritesImagesIds[t])for(let n of this._spritesImagesIds[t])this.imageManager.removeImage(n),this._changedImages[n]=!0;i.splice(i.findIndex(n=>n.id===t),1),this.stylesheet.sprite=i.length>0?i:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new n.l("data",{dataType:"style"}))}else this.fire(new n.k(Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return C(this.stylesheet.sprite)}setSprite(t,i={},r){this._checkLoaded(),t&&this._validate(n.B.sprite,"sprite",t,null,i)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,r):(this._unloadSprite(),r&&r(null)))}destroy(){for(let t in this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),this.tileManagers){let n=this.tileManagers[t];if(n.setEventedParent(null),n._tiles){for(let t in n._tiles)n._tiles[t].unloadVectorData();n._tiles={}}n._cache.reset(),n.onRemove(this.map)}for(let t in this.tileManagers={},this.imageManager&&(this.imageManager.setEventedParent(null),this.imageManager.destroy(),this._availableImages=[],this._spritesImagesIds={}),this.glyphManager&&this.glyphManager.destroy(),this._layers){let n=this._layers[t];n.setEventedParent(null),n.onRemove&&n.onRemove(this.map)}this._setInitialValues(),this.setEventedParent(null),this.dispatcher.unregisterMessageHandler("GG"),this.dispatcher.unregisterMessageHandler("GI"),this.dispatcher.unregisterMessageHandler("GDA"),this.dispatcher.remove(!0),this._listeners={},this._oneTimeListeners={}}}var t4=n.aO([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class t6{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,n,i,r,o,a,s,l,c){this.context=t;let d=this.boundPaintVertexBuffers.length!==r.length;for(let t=0;!d&&t<r.length;t++)this.boundPaintVertexBuffers[t]!==r[t]&&(d=!0);!this.vao||this.boundProgram!==n||this.boundLayoutVertexBuffer!==i||d||this.boundIndexBuffer!==o||this.boundVertexOffset!==a||this.boundDynamicVertexBuffer!==s||this.boundDynamicVertexBuffer2!==l||this.boundDynamicVertexBuffer3!==c?this.freshBind(n,i,r,o,a,s,l,c):(t.bindVertexArray.set(this.vao),s&&s.bind(),o&&o.dynamicDraw&&o.bind(),l&&l.bind(),c&&c.bind())}freshBind(t,n,i,r,o,a,s,l){let c=t.numAttributes,d=this.context,u=d.gl;for(let c of(this.vao&&this.destroy(),this.vao=d.createVertexArray(),d.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=n,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=r,this.boundVertexOffset=o,this.boundDynamicVertexBuffer=a,this.boundDynamicVertexBuffer2=s,this.boundDynamicVertexBuffer3=l,n.enableAttributes(u,t),i))c.enableAttributes(u,t);for(let r of(a&&a.enableAttributes(u,t),s&&s.enableAttributes(u,t),l&&l.enableAttributes(u,t),n.bind(),n.setVertexAttribPointers(u,t,o),i))r.bind(),r.setVertexAttribPointers(u,t,o);a&&(a.bind(),a.setVertexAttribPointers(u,t,o)),r&&r.bind(),s&&(s.bind(),s.setVertexAttribPointers(u,t,o)),l&&(l.bind(),l.setVertexAttribPointers(u,t,o)),d.currentNumAttributes=c}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}let t8=(t,i,r,o,a)=>({u_texture:0,u_ele_delta:t,u_fog_matrix:i,u_fog_color:r?r.properties.get("fog-color"):n.bj.white,u_fog_ground_blend:r?r.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:a?0:r?r.calculateFogBlendOpacity(o):0,u_horizon_color:r?r.properties.get("horizon-color"):n.bj.white,u_horizon_fog_blend:r?r.properties.get("horizon-fog-blend"):1,u_is_globe_mode:+!!a}),t7={mainMatrix:"u_projection_matrix",tileMercatorCoords:"u_projection_tile_mercator_coords",clippingPlane:"u_projection_clipping_plane",projectionTransition:"u_projection_transition",fallbackMatrix:"u_projection_fallback_matrix"};function t9(t){let n=[];for(let i=0;i<t.length;i++){if(null===t[i])continue;let r=t[i].split(" ");n.push(r.pop())}return n}class ne{constructor(t,i,r,o,a,s,l,c,d=[]){let u=t.gl;this.program=u.createProgram();let m=t9(i.staticAttributes),h=r?r.getBinderAttributes():[],f=m.concat(h),p=tr.prelude.staticUniforms?t9(tr.prelude.staticUniforms):[],b=l.staticUniforms?t9(l.staticUniforms):[],g=i.staticUniforms?t9(i.staticUniforms):[],_=r?r.getBinderUniforms():[],y=p.concat(b).concat(g).concat(_),v=[];for(let t of y)0>v.indexOf(t)&&v.push(t);let x=r?r.defines():[];tM(u)&&x.unshift("#version 300 es"),a&&x.push("#define OVERDRAW_INSPECTOR;"),s&&x.push("#define TERRAIN3D;"),c&&x.push(c),d&&x.push(...d);let w=x.concat(tr.prelude.fragmentSource,l.fragmentSource,i.fragmentSource).join("\n"),F=x.concat(tr.prelude.vertexSource,l.vertexSource,i.vertexSource).join("\n");tM(u)||(w=w.replace(/\bin\s/g,"varying ").replace("out highp vec4 fragColor;","").replace(/fragColor/g,"gl_FragColor").replace(/texture\(/g,"texture2D("),F=F.replace(/\bin\s/g,"attribute ").replace(/\bout\s/g,"varying ").replace(/texture\(/g,"texture2D("));let k=u.createShader(u.FRAGMENT_SHADER);if(u.isContextLost())return void(this.failedToCreate=!0);if(u.shaderSource(k,w),u.compileShader(k),!u.getShaderParameter(k,u.COMPILE_STATUS))throw Error(`Could not compile fragment shader: ${u.getShaderInfoLog(k)}`);u.attachShader(this.program,k);let E=u.createShader(u.VERTEX_SHADER);if(u.isContextLost())return void(this.failedToCreate=!0);if(u.shaderSource(E,F),u.compileShader(E),!u.getShaderParameter(E,u.COMPILE_STATUS))throw Error(`Could not compile vertex shader: ${u.getShaderInfoLog(E)}`);u.attachShader(this.program,E),this.attributes={};let T={};this.numAttributes=f.length;for(let t=0;t<this.numAttributes;t++)f[t]&&(u.bindAttribLocation(this.program,t,f[t]),this.attributes[f[t]]=t);if(u.linkProgram(this.program),!u.getProgramParameter(this.program,u.LINK_STATUS))throw Error(`Program failed to link: ${u.getProgramInfoLog(this.program)}`);u.deleteShader(E),u.deleteShader(k);for(let t=0;t<v.length;t++){let n=v[t];if(n&&!T[n]){let t=u.getUniformLocation(this.program,n);t&&(T[n]=t)}}this.fixedUniforms=o(t,T),this.terrainUniforms=((t,i)=>({u_depth:new n.bU(t,i.u_depth),u_terrain:new n.bU(t,i.u_terrain),u_terrain_dim:new n.bk(t,i.u_terrain_dim),u_terrain_matrix:new n.bW(t,i.u_terrain_matrix),u_terrain_unpack:new n.bX(t,i.u_terrain_unpack),u_terrain_exaggeration:new n.bk(t,i.u_terrain_exaggeration)}))(t,T),this.projectionUniforms=((t,i)=>({u_projection_matrix:new n.bW(t,i.u_projection_matrix),u_projection_tile_mercator_coords:new n.bX(t,i.u_projection_tile_mercator_coords),u_projection_clipping_plane:new n.bX(t,i.u_projection_clipping_plane),u_projection_transition:new n.bk(t,i.u_projection_transition),u_projection_fallback_matrix:new n.bW(t,i.u_projection_fallback_matrix)}))(t,T),this.binderUniforms=r?r.getUniforms(t,T):[]}draw(t,n,i,r,o,a,s,l,c,d,u,m,h,f,p,b,g,_,y){let v=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(r),t.setColorMode(o),t.setCullFace(a),l)for(let n in t.activeTexture.set(v.TEXTURE2),v.bindTexture(v.TEXTURE_2D,l.depthTexture),t.activeTexture.set(v.TEXTURE3),v.bindTexture(v.TEXTURE_2D,l.texture),this.terrainUniforms)this.terrainUniforms[n].set(l[n]);if(c)for(let t in c)this.projectionUniforms[t7[t]].set(c[t]);if(s)for(let t in this.fixedUniforms)this.fixedUniforms[t].set(s[t]);b&&b.setUniforms(t,this.binderUniforms,f,{zoom:p});let x=0;switch(n){case v.LINES:x=2;break;case v.TRIANGLES:x=3;break;case v.LINE_STRIP:x=1}for(let i of h.get()){let r=i.vaos||(i.vaos={});(r[d]||(r[d]=new t6)).bind(t,this,u,b?b.getPaintVertexBuffers():[],m,i.vertexOffset,g,_,y),v.drawElements(n,i.primitiveLength*x,v.UNSIGNED_SHORT,i.primitiveOffset*x*2)}}}function nt(t,i,r){let o=1/n.aH(r,1,i.transform.tileZoom),a=Math.pow(2,r.tileID.overscaledZ),s=r.tileSize*Math.pow(2,i.transform.tileZoom)/a,l=s*(r.tileID.canonical.x+r.tileID.wrap*a),c=s*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[o,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[l>>16,c>>16],u_pixel_coord_lower:[65535&l,65535&c]}}let nn=(t,i,r,o)=>{let a=t.style.light,s=a.properties.get("position"),l=[s.x,s.y,s.z],c=n.b_();"viewport"===a.properties.get("anchor")&&n.b$(c,t.transform.bearingInRadians),n.c0(l,l,c);let d=t.transform.transformLightDirection(l),u=a.properties.get("color");return{u_lightpos:l,u_lightpos_globe:d,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[u.r,u.g,u.b],u_vertical_gradient:+i,u_opacity:r,u_fill_translate:o}},ni=(t,i,r,o,a,s,l)=>n.e(nn(t,i,r,o),nt(s,t,l),{u_height_factor:-Math.pow(2,a.overscaledZ)/l.tileSize/8}),nr=(t,i,r,o)=>n.e(nt(i,t,r),{u_fill_translate:o}),no=(t,n)=>({u_world:t,u_fill_translate:n}),na=(t,i,r,o,a)=>n.e(nr(t,i,r,a),{u_world:o}),ns=(t,i,r,o,a)=>{let s=t.transform,l,c,d=0;if("map"===r.paint.get("circle-pitch-alignment")){let t=n.aH(i,1,s.zoom);l=!0,c=[t,t],d=t/(n.a3*Math.pow(2,i.tileID.overscaledZ))*2*Math.PI*a}else l=!1,c=s.pixelsToGLUnits;return{u_camera_to_center_distance:s.cameraToCenterDistance,u_scale_with_map:+("map"===r.paint.get("circle-pitch-scale")),u_pitch_with_map:+l,u_device_pixel_ratio:t.pixelRatio,u_extrude_scale:c,u_globe_extrude_scale:d,u_translate:o}},nl=t=>({u_pixel_extrude_scale:[1/t.width,1/t.height]}),nc=t=>({u_viewport_size:[t.width,t.height]}),nd=(t,n=1)=>({u_color:t,u_overlay:0,u_overlay_scale:n}),nu=(t,i,r,o)=>{let a=n.aH(t,1,i)/(n.a3*Math.pow(2,t.tileID.overscaledZ))*2*Math.PI*o;return{u_extrude_scale:n.aH(t,1,i),u_intensity:r,u_globe_extrude_scale:a}},nm=(t,i,r,o)=>{let a=n.M();n.c1(a,0,t.width,t.height,0,0,1);let s=t.context.gl;return{u_matrix:a,u_world:[s.drawingBufferWidth,s.drawingBufferHeight],u_image:r,u_color_ramp:o,u_opacity:i.paint.get("heatmap-opacity")}},nh=(t,i,r)=>{let o,a=r.paint.get("hillshade-accent-color");switch(r.paint.get("hillshade-method")){case"basic":o=4;break;case"combined":o=1;break;case"igor":o=2;break;case"multidirectional":o=3;break;default:o=0}let s=r.getIlluminationProperties();for(let n=0;n<s.directionRadians.length;n++)"viewport"===r.paint.get("hillshade-illumination-anchor")&&(s.directionRadians[n]+=t.transform.bearingInRadians);return{u_image:0,u_latrange:function(t,i){let r=Math.pow(2,i.canonical.z),o=i.canonical.y;return[new n.a5(0,o/r).toLngLat().lat,new n.a5(0,(o+1)/r).toLngLat().lat]}(0,i.tileID),u_exaggeration:r.paint.get("hillshade-exaggeration"),u_altitudes:s.altitudeRadians,u_azimuths:s.directionRadians,u_accent:a,u_method:o,u_highlights:s.highlightColor,u_shadows:s.shadowColor}},nf=(t,i)=>{let r=i.stride,o=n.M();return n.c1(o,0,n.a3,-n.a3,0,0,1),n.N(o,o,[0,-n.a3,0]),{u_matrix:o,u_image:1,u_dimension:[r,r],u_zoom:t.overscaledZ,u_unpack:i.getUnpackVector()}},np=(t,n,i=0)=>({u_image:0,u_unpack:n.getUnpackVector(),u_dimension:[n.stride,n.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:i,u_opacity:t.paint.get("color-relief-opacity")}),nb=(t,i,r,o)=>{let a=t.transform;return{u_translation:nw(t,i,r),u_ratio:o/n.aH(i,1,a.zoom),u_device_pixel_ratio:t.pixelRatio,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},ng=(t,i,r,o,a)=>n.e(nb(t,i,r,o),{u_image:0,u_image_height:a}),n_=(t,i,r,o,a)=>{let s=t.transform,l=nx(i,s);return{u_translation:nw(t,i,r),u_texsize:i.imageAtlasTexture.size,u_ratio:o/n.aH(i,1,s.zoom),u_device_pixel_ratio:t.pixelRatio,u_image:0,u_scale:[l,a.fromScale,a.toScale],u_fade:a.t,u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]]}},ny=(t,i,r,o,a)=>{let s=nx(i,t.transform);return n.e(nb(t,i,r,o),{u_tileratio:s,u_crossfade_from:a.fromScale,u_crossfade_to:a.toScale,u_image:0,u_mix:a.t,u_lineatlas_width:t.lineAtlas.width,u_lineatlas_height:t.lineAtlas.height})},nv=(t,i,r,o,a,s)=>{let l=nx(i,t.transform);return n.e(nb(t,i,r,o),{u_image:0,u_image_height:s,u_tileratio:l,u_crossfade_from:a.fromScale,u_crossfade_to:a.toScale,u_image_dash:1,u_mix:a.t,u_lineatlas_width:t.lineAtlas.width,u_lineatlas_height:t.lineAtlas.height})};function nx(t,i){return 1/n.aH(t,1,i.tileZoom)}function nw(t,i,r){return n.aI(t.transform,i,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}let nF=(t,n,i,r,o)=>{var a,s;return{u_tl_parent:t,u_scale_parent:n,u_buffer_scale:1,u_fade_t:i.mix,u_opacity:i.opacity*r.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:r.paint.get("raster-brightness-min"),u_brightness_high:r.paint.get("raster-brightness-max"),u_saturation_factor:(s=r.paint.get("raster-saturation"))>0?1-1/(1.001-s):-s,u_contrast_factor:(a=r.paint.get("raster-contrast"))>0?1/(1-a):1+a,u_spin_weights:function(t){let n=Math.sin(t*=Math.PI/180),i=Math.cos(t);return[(2*i+1)/3,(-Math.sqrt(3)*n-i+1)/3,(Math.sqrt(3)*n-i+1)/3]}(r.paint.get("raster-hue-rotate")),u_coords_top:[o[0].x,o[0].y,o[1].x,o[1].y],u_coords_bottom:[o[3].x,o[3].y,o[2].x,o[2].y]}},nk=(t,n,i,r,o,a,s,l,c,d,u,m,h)=>{let f=s.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:n?n.uSizeT:0,u_size:n?n.uSize:0,u_camera_to_center_distance:f.cameraToCenterDistance,u_pitch:f.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:f.width/f.height,u_fade_change:s.options.fadeDuration?s.symbolFadeChange:1,u_label_plane_matrix:l,u_coord_matrix:c,u_is_text:+u,u_pitch_with_map:+r,u_is_along_line:o,u_is_variable_anchor:a,u_texsize:m,u_texture:0,u_translation:d,u_pitched_scale:h}},nE=(t,i,r,o,a,s,l,c,d,u,m,h,f,p)=>{let b=l.transform;return n.e(nk(t,i,r,o,a,s,l,c,d,u,m,h,p),{u_gamma_scale:o?Math.cos(b.pitch*Math.PI/180)*b.cameraToCenterDistance:1,u_device_pixel_ratio:l.pixelRatio,u_is_halo:1})},nT=(t,i,r,o,a,s,l,c,d,u,m,h,f)=>n.e(nE(t,i,r,o,a,s,l,c,d,u,!0,m,0,f),{u_texsize_icon:h,u_texture_icon:1}),nA=(t,n)=>({u_opacity:t,u_color:n}),nM=(t,i,r,o,a)=>n.e(function(t,i,r,o){let a=r.imageManager.getPattern(t.from.toString()),s=r.imageManager.getPattern(t.to.toString()),{width:l,height:c}=r.imageManager.getPixelSize(),d=Math.pow(2,o.tileID.overscaledZ),u=o.tileSize*Math.pow(2,r.transform.tileZoom)/d,m=u*(o.tileID.canonical.x+o.tileID.wrap*d),h=u*o.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:a.tl,u_pattern_br_a:a.br,u_pattern_tl_b:s.tl,u_pattern_br_b:s.br,u_texsize:[l,c],u_mix:i.t,u_pattern_size_a:a.displaySize,u_pattern_size_b:s.displaySize,u_scale_a:i.fromScale,u_scale_b:i.toScale,u_tile_units_to_pixels:1/n.aH(o,1,r.transform.tileZoom),u_pixel_coord_upper:[m>>16,h>>16],u_pixel_coord_lower:[65535&m,65535&h]}}(r,a,i,o),{u_opacity:t}),nC=(t,n)=>{},nS={fillExtrusion:(t,i)=>({u_lightpos:new n.bY(t,i.u_lightpos),u_lightpos_globe:new n.bY(t,i.u_lightpos_globe),u_lightintensity:new n.bk(t,i.u_lightintensity),u_lightcolor:new n.bY(t,i.u_lightcolor),u_vertical_gradient:new n.bk(t,i.u_vertical_gradient),u_opacity:new n.bk(t,i.u_opacity),u_fill_translate:new n.bZ(t,i.u_fill_translate)}),fillExtrusionPattern:(t,i)=>({u_lightpos:new n.bY(t,i.u_lightpos),u_lightpos_globe:new n.bY(t,i.u_lightpos_globe),u_lightintensity:new n.bk(t,i.u_lightintensity),u_lightcolor:new n.bY(t,i.u_lightcolor),u_vertical_gradient:new n.bk(t,i.u_vertical_gradient),u_height_factor:new n.bk(t,i.u_height_factor),u_opacity:new n.bk(t,i.u_opacity),u_fill_translate:new n.bZ(t,i.u_fill_translate),u_image:new n.bU(t,i.u_image),u_texsize:new n.bZ(t,i.u_texsize),u_pixel_coord_upper:new n.bZ(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new n.bZ(t,i.u_pixel_coord_lower),u_scale:new n.bY(t,i.u_scale),u_fade:new n.bk(t,i.u_fade)}),fill:(t,i)=>({u_fill_translate:new n.bZ(t,i.u_fill_translate)}),fillPattern:(t,i)=>({u_image:new n.bU(t,i.u_image),u_texsize:new n.bZ(t,i.u_texsize),u_pixel_coord_upper:new n.bZ(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new n.bZ(t,i.u_pixel_coord_lower),u_scale:new n.bY(t,i.u_scale),u_fade:new n.bk(t,i.u_fade),u_fill_translate:new n.bZ(t,i.u_fill_translate)}),fillOutline:(t,i)=>({u_world:new n.bZ(t,i.u_world),u_fill_translate:new n.bZ(t,i.u_fill_translate)}),fillOutlinePattern:(t,i)=>({u_world:new n.bZ(t,i.u_world),u_image:new n.bU(t,i.u_image),u_texsize:new n.bZ(t,i.u_texsize),u_pixel_coord_upper:new n.bZ(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new n.bZ(t,i.u_pixel_coord_lower),u_scale:new n.bY(t,i.u_scale),u_fade:new n.bk(t,i.u_fade),u_fill_translate:new n.bZ(t,i.u_fill_translate)}),circle:(t,i)=>({u_camera_to_center_distance:new n.bk(t,i.u_camera_to_center_distance),u_scale_with_map:new n.bU(t,i.u_scale_with_map),u_pitch_with_map:new n.bU(t,i.u_pitch_with_map),u_extrude_scale:new n.bZ(t,i.u_extrude_scale),u_device_pixel_ratio:new n.bk(t,i.u_device_pixel_ratio),u_globe_extrude_scale:new n.bk(t,i.u_globe_extrude_scale),u_translate:new n.bZ(t,i.u_translate)}),collisionBox:(t,i)=>({u_pixel_extrude_scale:new n.bZ(t,i.u_pixel_extrude_scale)}),collisionCircle:(t,i)=>({u_viewport_size:new n.bZ(t,i.u_viewport_size)}),debug:(t,i)=>({u_color:new n.bV(t,i.u_color),u_overlay:new n.bU(t,i.u_overlay),u_overlay_scale:new n.bk(t,i.u_overlay_scale)}),depth:nC,clippingMask:nC,heatmap:(t,i)=>({u_extrude_scale:new n.bk(t,i.u_extrude_scale),u_intensity:new n.bk(t,i.u_intensity),u_globe_extrude_scale:new n.bk(t,i.u_globe_extrude_scale)}),heatmapTexture:(t,i)=>({u_matrix:new n.bW(t,i.u_matrix),u_world:new n.bZ(t,i.u_world),u_image:new n.bU(t,i.u_image),u_color_ramp:new n.bU(t,i.u_color_ramp),u_opacity:new n.bk(t,i.u_opacity)}),hillshade:(t,i)=>({u_image:new n.bU(t,i.u_image),u_latrange:new n.bZ(t,i.u_latrange),u_exaggeration:new n.bk(t,i.u_exaggeration),u_altitudes:new n.c3(t,i.u_altitudes),u_azimuths:new n.c3(t,i.u_azimuths),u_accent:new n.bV(t,i.u_accent),u_method:new n.bU(t,i.u_method),u_shadows:new n.c2(t,i.u_shadows),u_highlights:new n.c2(t,i.u_highlights)}),hillshadePrepare:(t,i)=>({u_matrix:new n.bW(t,i.u_matrix),u_image:new n.bU(t,i.u_image),u_dimension:new n.bZ(t,i.u_dimension),u_zoom:new n.bk(t,i.u_zoom),u_unpack:new n.bX(t,i.u_unpack)}),colorRelief:(t,i)=>({u_image:new n.bU(t,i.u_image),u_unpack:new n.bX(t,i.u_unpack),u_dimension:new n.bZ(t,i.u_dimension),u_elevation_stops:new n.bU(t,i.u_elevation_stops),u_color_stops:new n.bU(t,i.u_color_stops),u_color_ramp_size:new n.bU(t,i.u_color_ramp_size),u_opacity:new n.bk(t,i.u_opacity)}),line:(t,i)=>({u_translation:new n.bZ(t,i.u_translation),u_ratio:new n.bk(t,i.u_ratio),u_device_pixel_ratio:new n.bk(t,i.u_device_pixel_ratio),u_units_to_pixels:new n.bZ(t,i.u_units_to_pixels)}),lineGradient:(t,i)=>({u_translation:new n.bZ(t,i.u_translation),u_ratio:new n.bk(t,i.u_ratio),u_device_pixel_ratio:new n.bk(t,i.u_device_pixel_ratio),u_units_to_pixels:new n.bZ(t,i.u_units_to_pixels),u_image:new n.bU(t,i.u_image),u_image_height:new n.bk(t,i.u_image_height)}),linePattern:(t,i)=>({u_translation:new n.bZ(t,i.u_translation),u_texsize:new n.bZ(t,i.u_texsize),u_ratio:new n.bk(t,i.u_ratio),u_device_pixel_ratio:new n.bk(t,i.u_device_pixel_ratio),u_image:new n.bU(t,i.u_image),u_units_to_pixels:new n.bZ(t,i.u_units_to_pixels),u_scale:new n.bY(t,i.u_scale),u_fade:new n.bk(t,i.u_fade)}),lineSDF:(t,i)=>({u_translation:new n.bZ(t,i.u_translation),u_ratio:new n.bk(t,i.u_ratio),u_device_pixel_ratio:new n.bk(t,i.u_device_pixel_ratio),u_units_to_pixels:new n.bZ(t,i.u_units_to_pixels),u_image:new n.bU(t,i.u_image),u_mix:new n.bk(t,i.u_mix),u_tileratio:new n.bk(t,i.u_tileratio),u_crossfade_from:new n.bk(t,i.u_crossfade_from),u_crossfade_to:new n.bk(t,i.u_crossfade_to),u_lineatlas_width:new n.bk(t,i.u_lineatlas_width),u_lineatlas_height:new n.bk(t,i.u_lineatlas_height)}),lineGradientSDF:(t,i)=>({u_translation:new n.bZ(t,i.u_translation),u_ratio:new n.bk(t,i.u_ratio),u_device_pixel_ratio:new n.bk(t,i.u_device_pixel_ratio),u_units_to_pixels:new n.bZ(t,i.u_units_to_pixels),u_image:new n.bU(t,i.u_image),u_image_height:new n.bk(t,i.u_image_height),u_tileratio:new n.bk(t,i.u_tileratio),u_crossfade_from:new n.bk(t,i.u_crossfade_from),u_crossfade_to:new n.bk(t,i.u_crossfade_to),u_image_dash:new n.bU(t,i.u_image_dash),u_mix:new n.bk(t,i.u_mix),u_lineatlas_width:new n.bk(t,i.u_lineatlas_width),u_lineatlas_height:new n.bk(t,i.u_lineatlas_height)}),raster:(t,i)=>({u_tl_parent:new n.bZ(t,i.u_tl_parent),u_scale_parent:new n.bk(t,i.u_scale_parent),u_buffer_scale:new n.bk(t,i.u_buffer_scale),u_fade_t:new n.bk(t,i.u_fade_t),u_opacity:new n.bk(t,i.u_opacity),u_image0:new n.bU(t,i.u_image0),u_image1:new n.bU(t,i.u_image1),u_brightness_low:new n.bk(t,i.u_brightness_low),u_brightness_high:new n.bk(t,i.u_brightness_high),u_saturation_factor:new n.bk(t,i.u_saturation_factor),u_contrast_factor:new n.bk(t,i.u_contrast_factor),u_spin_weights:new n.bY(t,i.u_spin_weights),u_coords_top:new n.bX(t,i.u_coords_top),u_coords_bottom:new n.bX(t,i.u_coords_bottom)}),symbolIcon:(t,i)=>({u_is_size_zoom_constant:new n.bU(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new n.bU(t,i.u_is_size_feature_constant),u_size_t:new n.bk(t,i.u_size_t),u_size:new n.bk(t,i.u_size),u_camera_to_center_distance:new n.bk(t,i.u_camera_to_center_distance),u_pitch:new n.bk(t,i.u_pitch),u_rotate_symbol:new n.bU(t,i.u_rotate_symbol),u_aspect_ratio:new n.bk(t,i.u_aspect_ratio),u_fade_change:new n.bk(t,i.u_fade_change),u_label_plane_matrix:new n.bW(t,i.u_label_plane_matrix),u_coord_matrix:new n.bW(t,i.u_coord_matrix),u_is_text:new n.bU(t,i.u_is_text),u_pitch_with_map:new n.bU(t,i.u_pitch_with_map),u_is_along_line:new n.bU(t,i.u_is_along_line),u_is_variable_anchor:new n.bU(t,i.u_is_variable_anchor),u_texsize:new n.bZ(t,i.u_texsize),u_texture:new n.bU(t,i.u_texture),u_translation:new n.bZ(t,i.u_translation),u_pitched_scale:new n.bk(t,i.u_pitched_scale)}),symbolSDF:(t,i)=>({u_is_size_zoom_constant:new n.bU(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new n.bU(t,i.u_is_size_feature_constant),u_size_t:new n.bk(t,i.u_size_t),u_size:new n.bk(t,i.u_size),u_camera_to_center_distance:new n.bk(t,i.u_camera_to_center_distance),u_pitch:new n.bk(t,i.u_pitch),u_rotate_symbol:new n.bU(t,i.u_rotate_symbol),u_aspect_ratio:new n.bk(t,i.u_aspect_ratio),u_fade_change:new n.bk(t,i.u_fade_change),u_label_plane_matrix:new n.bW(t,i.u_label_plane_matrix),u_coord_matrix:new n.bW(t,i.u_coord_matrix),u_is_text:new n.bU(t,i.u_is_text),u_pitch_with_map:new n.bU(t,i.u_pitch_with_map),u_is_along_line:new n.bU(t,i.u_is_along_line),u_is_variable_anchor:new n.bU(t,i.u_is_variable_anchor),u_texsize:new n.bZ(t,i.u_texsize),u_texture:new n.bU(t,i.u_texture),u_gamma_scale:new n.bk(t,i.u_gamma_scale),u_device_pixel_ratio:new n.bk(t,i.u_device_pixel_ratio),u_is_halo:new n.bU(t,i.u_is_halo),u_translation:new n.bZ(t,i.u_translation),u_pitched_scale:new n.bk(t,i.u_pitched_scale)}),symbolTextAndIcon:(t,i)=>({u_is_size_zoom_constant:new n.bU(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new n.bU(t,i.u_is_size_feature_constant),u_size_t:new n.bk(t,i.u_size_t),u_size:new n.bk(t,i.u_size),u_camera_to_center_distance:new n.bk(t,i.u_camera_to_center_distance),u_pitch:new n.bk(t,i.u_pitch),u_rotate_symbol:new n.bU(t,i.u_rotate_symbol),u_aspect_ratio:new n.bk(t,i.u_aspect_ratio),u_fade_change:new n.bk(t,i.u_fade_change),u_label_plane_matrix:new n.bW(t,i.u_label_plane_matrix),u_coord_matrix:new n.bW(t,i.u_coord_matrix),u_is_text:new n.bU(t,i.u_is_text),u_pitch_with_map:new n.bU(t,i.u_pitch_with_map),u_is_along_line:new n.bU(t,i.u_is_along_line),u_is_variable_anchor:new n.bU(t,i.u_is_variable_anchor),u_texsize:new n.bZ(t,i.u_texsize),u_texsize_icon:new n.bZ(t,i.u_texsize_icon),u_texture:new n.bU(t,i.u_texture),u_texture_icon:new n.bU(t,i.u_texture_icon),u_gamma_scale:new n.bk(t,i.u_gamma_scale),u_device_pixel_ratio:new n.bk(t,i.u_device_pixel_ratio),u_is_halo:new n.bU(t,i.u_is_halo),u_translation:new n.bZ(t,i.u_translation),u_pitched_scale:new n.bk(t,i.u_pitched_scale)}),background:(t,i)=>({u_opacity:new n.bk(t,i.u_opacity),u_color:new n.bV(t,i.u_color)}),backgroundPattern:(t,i)=>({u_opacity:new n.bk(t,i.u_opacity),u_image:new n.bU(t,i.u_image),u_pattern_tl_a:new n.bZ(t,i.u_pattern_tl_a),u_pattern_br_a:new n.bZ(t,i.u_pattern_br_a),u_pattern_tl_b:new n.bZ(t,i.u_pattern_tl_b),u_pattern_br_b:new n.bZ(t,i.u_pattern_br_b),u_texsize:new n.bZ(t,i.u_texsize),u_mix:new n.bk(t,i.u_mix),u_pattern_size_a:new n.bZ(t,i.u_pattern_size_a),u_pattern_size_b:new n.bZ(t,i.u_pattern_size_b),u_scale_a:new n.bk(t,i.u_scale_a),u_scale_b:new n.bk(t,i.u_scale_b),u_pixel_coord_upper:new n.bZ(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new n.bZ(t,i.u_pixel_coord_lower),u_tile_units_to_pixels:new n.bk(t,i.u_tile_units_to_pixels)}),terrain:(t,i)=>({u_texture:new n.bU(t,i.u_texture),u_ele_delta:new n.bk(t,i.u_ele_delta),u_fog_matrix:new n.bW(t,i.u_fog_matrix),u_fog_color:new n.bV(t,i.u_fog_color),u_fog_ground_blend:new n.bk(t,i.u_fog_ground_blend),u_fog_ground_blend_opacity:new n.bk(t,i.u_fog_ground_blend_opacity),u_horizon_color:new n.bV(t,i.u_horizon_color),u_horizon_fog_blend:new n.bk(t,i.u_horizon_fog_blend),u_is_globe_mode:new n.bk(t,i.u_is_globe_mode)}),terrainDepth:(t,i)=>({u_ele_delta:new n.bk(t,i.u_ele_delta)}),terrainCoords:(t,i)=>({u_texture:new n.bU(t,i.u_texture),u_terrain_coords_id:new n.bk(t,i.u_terrain_coords_id),u_ele_delta:new n.bk(t,i.u_ele_delta)}),projectionErrorMeasurement:(t,i)=>({u_input:new n.bk(t,i.u_input),u_output_expected:new n.bk(t,i.u_output_expected)}),atmosphere:(t,i)=>({u_sun_pos:new n.bY(t,i.u_sun_pos),u_atmosphere_blend:new n.bk(t,i.u_atmosphere_blend),u_globe_position:new n.bY(t,i.u_globe_position),u_globe_radius:new n.bk(t,i.u_globe_radius),u_inv_proj_matrix:new n.bW(t,i.u_inv_proj_matrix)}),sky:(t,i)=>({u_sky_color:new n.bV(t,i.u_sky_color),u_horizon_color:new n.bV(t,i.u_horizon_color),u_horizon:new n.bZ(t,i.u_horizon),u_horizon_normal:new n.bZ(t,i.u_horizon_normal),u_sky_horizon_blend:new n.bk(t,i.u_sky_horizon_blend),u_sky_blend:new n.bk(t,i.u_sky_blend)})};class nL{constructor(t,n,i){this.context=t;let r=t.gl;this.buffer=r.createBuffer(),this.dynamicDraw=!!i,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){let n=this.context.gl;if(!this.dynamicDraw)throw Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let nD={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class nI{constructor(t,n,i,r){this.length=n.length,this.attributes=i,this.itemSize=n.bytesPerElement,this.dynamicDraw=r,this.context=t;let o=t.gl;this.buffer=o.createBuffer(),t.bindVertexBuffer.set(this.buffer),o.bufferData(o.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?o.DYNAMIC_DRAW:o.STATIC_DRAW),this.dynamicDraw||delete n.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);let n=this.context.gl;this.bind(),n.bufferSubData(n.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,n){for(let i=0;i<this.attributes.length;i++){let r=n.attributes[this.attributes[i].name];void 0!==r&&t.enableVertexAttribArray(r)}}setVertexAttribPointers(t,n,i){for(let r=0;r<this.attributes.length;r++){let o=this.attributes[r],a=n.attributes[o.name];void 0!==a&&t.vertexAttribPointer(a,o.components,t[nD[o.type]],!1,this.itemSize,o.offset+this.itemSize*(i||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class nP{constructor(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(t){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class nR extends nP{getDefault(){return n.bj.transparent}set(t){let n=this.current;(t.r!==n.r||t.g!==n.g||t.b!==n.b||t.a!==n.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class nO extends nP{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class nB extends nP{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class nz extends nP{getDefault(){return[!0,!0,!0,!0]}set(t){let n=this.current;(t[0]!==n[0]||t[1]!==n[1]||t[2]!==n[2]||t[3]!==n[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class nN extends nP{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class nY extends nP{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class nj extends nP{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){let n=this.current;(t.func!==n.func||t.ref!==n.ref||t.mask!==n.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class nU extends nP{getDefault(){let t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){let n=this.current;(t[0]!==n[0]||t[1]!==n[1]||t[2]!==n[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class nH extends nP{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;t?n.enable(n.STENCIL_TEST):n.disable(n.STENCIL_TEST),this.current=t,this.dirty=!1}}class nV extends nP{getDefault(){return[0,1]}set(t){let n=this.current;(t[0]!==n[0]||t[1]!==n[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class nG extends nP{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;t?n.enable(n.DEPTH_TEST):n.disable(n.DEPTH_TEST),this.current=t,this.dirty=!1}}class nq extends nP{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class n$ extends nP{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;t?n.enable(n.BLEND):n.disable(n.BLEND),this.current=t,this.dirty=!1}}class nW extends nP{getDefault(){let t=this.gl;return[t.ONE,t.ZERO]}set(t){let n=this.current;(t[0]!==n[0]||t[1]!==n[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}}class nZ extends nP{getDefault(){return n.bj.transparent}set(t){let n=this.current;(t.r!==n.r||t.g!==n.g||t.b!==n.b||t.a!==n.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class nX extends nP{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class nK extends nP{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;t?n.enable(n.CULL_FACE):n.disable(n.CULL_FACE),this.current=t,this.dirty=!1}}class nJ extends nP{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class nQ extends nP{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}class n0 extends nP{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}}class n1 extends nP{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class n2 extends nP{getDefault(){let t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){let n=this.current;(t[0]!==n[0]||t[1]!==n[1]||t[2]!==n[2]||t[3]!==n[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class n3 extends nP{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;n.bindFramebuffer(n.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class n5 extends nP{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;n.bindRenderbuffer(n.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class n4 extends nP{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;n.bindTexture(n.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class n6 extends nP{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;n.bindBuffer(n.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class n8 extends nP{getDefault(){return null}set(t){let n=this.gl;n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class n7 extends nP{getDefault(){return null}set(t){var n;if(t===this.current&&!this.dirty)return;let i=this.gl;tM(i)?i.bindVertexArray(t):null==(n=i.getExtension("OES_vertex_array_object"))||n.bindVertexArrayOES(t),this.current=t,this.dirty=!1}}class n9 extends nP{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;n.pixelStorei(n.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class ie extends nP{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class it extends nP{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class ii extends nP{constructor(t,n){super(t),this.context=t,this.parent=n}getDefault(){return null}}class ir extends ii{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let n=this.gl;n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class io extends ii{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let n=this.gl;n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class ia extends ii{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let n=this.gl;n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,t),this.current=t,this.dirty=!1}}let is="Framebuffer is not complete";class il{constructor(t,n,i,r,o){this.context=t,this.width=n,this.height=i;let a=t.gl,s=this.framebuffer=a.createFramebuffer();if(this.colorAttachment=new ir(t,s),r)this.depthAttachment=o?new ia(t,s):new io(t,s);else if(o)throw Error("Stencil cannot be set without depth");if(a.checkFramebufferStatus(a.FRAMEBUFFER)!==a.FRAMEBUFFER_COMPLETE)throw Error(is)}destroy(){let t=this.context.gl,n=this.colorAttachment.get();if(n&&t.deleteTexture(n),this.depthAttachment){let n=this.depthAttachment.get();n&&t.deleteRenderbuffer(n)}t.deleteFramebuffer(this.framebuffer)}}class ic{constructor(t){var n,i;if(this.gl=t,this.clearColor=new nR(this),this.clearDepth=new nO(this),this.clearStencil=new nB(this),this.colorMask=new nz(this),this.depthMask=new nN(this),this.stencilMask=new nY(this),this.stencilFunc=new nj(this),this.stencilOp=new nU(this),this.stencilTest=new nH(this),this.depthRange=new nV(this),this.depthTest=new nG(this),this.depthFunc=new nq(this),this.blend=new n$(this),this.blendFunc=new nW(this),this.blendColor=new nZ(this),this.blendEquation=new nX(this),this.cullFace=new nK(this),this.cullFaceSide=new nJ(this),this.frontFace=new nQ(this),this.program=new n0(this),this.activeTexture=new n1(this),this.viewport=new n2(this),this.bindFramebuffer=new n3(this),this.bindRenderbuffer=new n5(this),this.bindTexture=new n4(this),this.bindVertexBuffer=new n6(this),this.bindElementBuffer=new n8(this),this.bindVertexArray=new n7(this),this.pixelStoreUnpack=new n9(this),this.pixelStoreUnpackPremultiplyAlpha=new ie(this),this.pixelStoreUnpackFlipY=new it(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),tM(t)){this.HALF_FLOAT=t.HALF_FLOAT;let r=t.getExtension("EXT_color_buffer_half_float");this.RGBA16F=null!=(n=t.RGBA16F)?n:null==r?void 0:r.RGBA16F_EXT,this.RGB16F=null!=(i=t.RGB16F)?i:null==r?void 0:r.RGB16F_EXT,t.getExtension("EXT_color_buffer_float")}else{t.getExtension("EXT_color_buffer_half_float"),t.getExtension("OES_texture_half_float_linear");let n=t.getExtension("OES_texture_half_float");this.HALF_FLOAT=null==n?void 0:n.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(t,n){return new nL(this,t,n)}createVertexBuffer(t,n,i){return new nI(this,t,n,i)}createRenderbuffer(t,n,i){let r=this.gl,o=r.createRenderbuffer();return this.bindRenderbuffer.set(o),r.renderbufferStorage(r.RENDERBUFFER,t,n,i),this.bindRenderbuffer.set(null),o}createFramebuffer(t,n,i,r){return new il(this,t,n,i,r)}clear({color:t,depth:n,stencil:i}){let r=this.gl,o=0;t&&(o|=r.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),void 0!==n&&(o|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),void 0!==i&&(o|=r.STENCIL_BUFFER_BIT,this.clearStencil.set(i),this.stencilMask.set(255)),r.clear(o)}setCullFace(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)}setColorMode(t){n.bL(t.blendFunction,tF.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)}createVertexArray(){var t;return tM(this.gl)?this.gl.createVertexArray():null==(t=this.gl.getExtension("OES_vertex_array_object"))?void 0:t.createVertexArrayOES()}deleteVertexArray(t){var n;return tM(this.gl)?this.gl.deleteVertexArray(t):null==(n=this.gl.getExtension("OES_vertex_array_object"))?void 0:n.deleteVertexArrayOES(t)}unbindVAO(){this.bindVertexArray.set(null)}}function id(t,i,r,o,a){let s=t.context,l=t.transform,d=s.gl,u=t.useProgram("collisionBox"),m=[],h=0,f=0;for(let n=0;n<o.length;n++){let c=o[n],p=i.getTile(c).getBucket(r);if(!p)continue;let b=a?p.textCollisionBox:p.iconCollisionBox,g=p.collisionCircleArray;g.length>0&&(m.push({circleArray:g,circleOffset:f,coord:c}),h+=g.length/4,f=h),b&&u.draw(s,d.LINES,tE.disabled,tT.disabled,t.colorModeForRenderPass(),tk.disabled,nl(t.transform),t.style.map.terrain&&t.style.map.terrain.getTerrainData(c),l.getProjectionData({overscaledTileID:c,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),r.id,b.layoutVertexBuffer,b.indexBuffer,b.segments,null,t.transform.zoom,null,null,b.collisionVertexBuffer)}if(!a||!m.length)return;let p=t.useProgram("collisionCircle"),b=new n.c4;b.resize(4*h),b._trim();let g=0;for(let t of m)for(let n=0;n<t.circleArray.length/4;n++){let i=4*n,r=t.circleArray[i+0],o=t.circleArray[i+1],a=t.circleArray[i+2],s=t.circleArray[i+3];b.emplace(g++,r,o,a,s,0),b.emplace(g++,r,o,a,s,1),b.emplace(g++,r,o,a,s,2),b.emplace(g++,r,o,a,s,3)}(!c||c.length<2*h)&&(c=function(t){let i=2*t,r=new n.c6;r.resize(i),r._trim();for(let t=0;t<i;t++){let n=6*t;r.uint16[n+0]=4*t+0,r.uint16[n+1]=4*t+1,r.uint16[n+2]=4*t+2,r.uint16[n+3]=4*t+2,r.uint16[n+4]=4*t+3,r.uint16[n+5]=4*t+0}return r}(h));let _=s.createIndexBuffer(c,!0),y=s.createVertexBuffer(b,n.c5.members,!0);for(let i of m){let o=nc(t.transform);p.draw(s,d.TRIANGLES,tE.disabled,tT.disabled,t.colorModeForRenderPass(),tk.disabled,o,t.style.map.terrain&&t.style.map.terrain.getTerrainData(i.coord),null,r.id,y,_,n.aR.simpleSegment(0,2*i.circleOffset,i.circleArray.length,i.circleArray.length/2),null,t.transform.zoom,null,null,null)}y.destroy(),_.destroy()}let iu=n.am(new Float32Array(16));function im(t,i,r,o,a,s,l,c,d,u,m,h,f){let p=t.context,b=p.gl,g=t.transform,_="map"===c,y="map"===d,v="viewport"!==c&&"point"!==r.layout.get("symbol-placement"),x=_&&!y&&!v,w=!r.layout.get("symbol-sort-key").isConstant(),F=!1,k=t.getDepthModeForSublayer(0,tE.ReadOnly),E=r._unevaluatedLayout.hasValue("text-variable-anchor")||r._unevaluatedLayout.hasValue("text-variable-anchor-offset"),T=[],A=g.getCircleRadiusCorrection();for(let c of o){let o=i.getTile(c),d=o.getBucket(r);if(!d)continue;let m=a?d.text:d.icon;if(!m||!m.segments.get().length||!m.hasVisibleVertices)continue;let h=m.programConfigurations.get(r.id),p=a||d.sdfIcons,k=a?d.textSizeData:d.iconSizeData,M=y||0!==g.pitch,C=t.useProgram(d.iconsInText&&a?"symbolTextAndIcon":p?"symbolSDF":"symbolIcon",h),S=n.as(k,g.zoom),D=t.style.map.terrain&&t.style.map.terrain.getTerrainData(c),I,P,R,O,B=[0,0],z=null;if(a)P=o.glyphAtlasTexture,R=b.LINEAR,I=o.glyphAtlasTexture.size,d.iconsInText&&(B=o.imageAtlasTexture.size,z=o.imageAtlasTexture,O=M||t.options.rotating||t.options.zooming||"composite"===k.kind||"camera"===k.kind?b.LINEAR:b.NEAREST);else{let n=1!==r.layout.get("icon-size").constantOr(0)||d.iconsNeedLinear;P=o.imageAtlasTexture,R=p||t.options.rotating||t.options.zooming||n||M?b.LINEAR:b.NEAREST,I=o.imageAtlasTexture.size}let N=n.aH(o,1,t.transform.zoom),Y=eI(_,t.transform,N),j=n.M();n.av(j,Y);let U=function(t,i,r,o){if(t){let t=n.M();if(!i){let{vecSouth:n,vecEast:i}=eP(r);t[0]=i[0],t[1]=i[1],t[4]=n[0],t[5]=n[1]}return n.O(t,t,[o,o,1]),t}return r.pixelsToClipSpaceMatrix}(y,_,t.transform,N),H=n.aI(g,o,s,l),V=g.getProjectionData({overscaledTileID:c,applyGlobeMatrix:!f,applyTerrainMatrix:!0}),G=E&&d.hasTextData(),q="none"!==r.layout.get("icon-text-fit")&&G&&d.hasIconData();if(v){let i=t.style.map.terrain?(n,i)=>t.style.map.terrain.getElevation(c,n,i):null;!function(t,i,r,o,a,s,l,c,d,u,m,h,f){let p=r?t.textSizeData:t.iconSizeData,b=n.as(p,i.transform.zoom),g=[256/i.width*2+1,256/i.height*2+1],_=r?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;_.clear();let y=t.lineVertexArray,v=r?t.text.placedSymbolArray:t.icon.placedSymbolArray,x=i.transform.width/i.transform.height,w=!1;for(let r=0;r<v.length;r++){var F;let k=v.get(r);if(k.hidden||k.writingMode===n.at.vertical&&!w){e$(k.numGlyphs,_);continue}w=!1;let E=new n.P(k.anchorX,k.anchorY),T={getElevation:f,pitchedLabelPlaneMatrix:o,lineVertexArray:y,pitchWithMap:s,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:i.transform,tileAnchorPoint:E,unwrappedTileID:d,width:u,height:m,translation:h},A=eH(k.anchorX,k.anchorY,T);if(F=A.point,!(F.x>=-g[0]&&F.x<=g[0]&&F.y>=-g[1])||!(F.y<=g[1])){e$(k.numGlyphs,_);continue}let M=.5+i.transform.cameraToCenterDistance/A.signedDistanceFromCamera*.5,C=n.au(p,b,k),S=s?C*i.transform.getPitchedTextCorrection(k.anchorX,k.anchorY,d)/M:C*M,D=ez({projectionContext:T,pitchedLabelPlaneMatrixInverse:a,symbol:k,fontSize:S,flip:!1,keepUpright:l,glyphOffsetArray:t.glyphOffsetArray,dynamicLayoutVertexArray:_,aspectRatio:x,rotateToLine:c});w=D.useVertical,(D.notEnoughRoom||w||D.needsFlipping&&ez({projectionContext:T,pitchedLabelPlaneMatrixInverse:a,symbol:k,fontSize:S,flip:!0,keepUpright:l,glyphOffsetArray:t.glyphOffsetArray,dynamicLayoutVertexArray:_,aspectRatio:x,rotateToLine:c}).notEnoughRoom)&&e$(k.numGlyphs,_)}r?t.text.dynamicLayoutVertexBuffer.updateData(_):t.icon.dynamicLayoutVertexBuffer.updateData(_)}(d,t,a,Y,j,y,u,"map"===r.layout.get("text-rotation-alignment"),c.toUnwrapped(),g.width,g.height,H,i)}let $=a&&E||q,W=v||$?iu:y?Y:t.transform.clipSpaceToPixelsMatrix,Z=p&&0!==r.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1),X={program:C,buffers:m,uniformValues:p?d.iconsInText?nT(k.kind,S,x,y,v,$,t,W,U,H,I,B,A):nE(k.kind,S,x,y,v,$,t,W,U,H,a,I,0,A):nk(k.kind,S,x,y,v,$,t,W,U,H,a,I,A),projectionData:V,atlasTexture:P,atlasTextureIcon:z,atlasInterpolation:R,atlasInterpolationIcon:O,isSDF:p,hasHalo:Z};if(w&&d.canOverlap)for(let t of(F=!0,m.segments.get()))T.push({segments:new n.aR([t]),sortKey:t.sortKey,state:X,terrainData:D});else T.push({segments:m.segments,sortKey:0,state:X,terrainData:D})}for(let n of(F&&T.sort((t,n)=>t.sortKey-n.sortKey),T)){let i=n.state;if(p.activeTexture.set(b.TEXTURE0),i.atlasTexture.bind(i.atlasInterpolation,b.CLAMP_TO_EDGE),i.atlasTextureIcon&&(p.activeTexture.set(b.TEXTURE1),i.atlasTextureIcon&&i.atlasTextureIcon.bind(i.atlasInterpolationIcon,b.CLAMP_TO_EDGE)),i.isSDF){let o=i.uniformValues;i.hasHalo&&(o.u_is_halo=1,ih(i.buffers,n.segments,r,t,i.program,k,m,h,o,i.projectionData,n.terrainData)),o.u_is_halo=0}ih(i.buffers,n.segments,r,t,i.program,k,m,h,i.uniformValues,i.projectionData,n.terrainData)}}function ih(t,n,i,r,o,a,s,l,c,d,u){let m=r.context;o.draw(m,m.gl.TRIANGLES,a,s,l,tk.backCCW,c,u,d,i.id,t.layoutVertexBuffer,t.indexBuffer,n,i.paint,r.transform.zoom,t.programConfigurations.get(i.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function ip(t,n,i){var r,o;let a=t.gl,s=a.createTexture();a.bindTexture(a.TEXTURE_2D,s),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);let l=null!=(r=t.HALF_FLOAT)?r:a.UNSIGNED_BYTE,c=null!=(o=t.RGBA16F)?o:a.RGBA;a.texImage2D(a.TEXTURE_2D,0,c,n,i,0,a.RGBA,l,null);let d=t.createFramebuffer(n,i,!1,!1);return d.colorAttachment.set(s),d}function ib(t,i){return i.colorRampTexture||(i.colorRampTexture=new n.T(t,i.colorRamp,t.gl.RGBA)),i.colorRampTexture}function ig(t,i,r,o,a,s,l,c){let d=256;if(a.stepInterpolant){let o=i.getSource().maxzoom,a=l.canonical.z===o?Math.ceil(1<<t.transform.maxZoom-l.canonical.z):1;d=n.ai(n.c8(s.maxLineLength/n.a3*1024*a),256,r.maxTextureSize)}return c.gradient=n.c9({expression:a.gradientExpression(),evaluationKey:"lineProgress",resolution:d,image:c.gradient||void 0,clips:s.lineClipsArray}),c.texture?c.texture.update(c.gradient):c.texture=new n.T(r,c.gradient,o.RGBA),c.version=a.gradientVersion,c.texture}function i_(t,n,i,r,o){if(!i||!r||!r.imageAtlas)return;let a=r.imageAtlas.patternPositions,s=a[i.to.toString()],l=a[i.from.toString()];if(!s&&l&&(s=l),!l&&s&&(l=s),!s||!l){let t=o.getPaintProperty(n);s=a[t],l=a[t]}s&&l&&t.setConstantPatternPositions(s,l)}function iy(t,i,r,o,a,s,l,c){let d,u,m,h,f,p=t.context.gl,b="fill-pattern",g=r.paint.get(b),_=g&&g.constantOr(1),y=r.getCrossfadeParameters(),v=t.transform,x=r.paint.get("fill-translate"),w=r.paint.get("fill-translate-anchor");l?(u=_&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",d=p.LINES):(u=_?"fillPattern":"fill",d=p.TRIANGLES);let F=g.constantOr(null);for(let g of o){let o=i.getTile(g);if(_&&!o.patternsLoaded())continue;let k=o.getBucket(r);if(!k)continue;let E=k.programConfigurations.get(r.id),T=t.useProgram(u,E),A=t.style.map.terrain&&t.style.map.terrain.getTerrainData(g);_&&(t.context.activeTexture.set(p.TEXTURE0),o.imageAtlasTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),E.updatePaintBuffers(y)),i_(E,b,F,o,r);let M=v.getProjectionData({overscaledTileID:g,applyGlobeMatrix:!c,applyTerrainMatrix:!0}),C=n.aI(v,o,x,w);if(l){h=k.indexBuffer2,f=k.segments2;let n=[p.drawingBufferWidth,p.drawingBufferHeight];m="fillOutlinePattern"===u&&_?na(t,y,o,n,C):no(n,C)}else h=k.indexBuffer,f=k.segments,m=_?nr(t,y,o,C):{u_fill_translate:C};let S=t.stencilModeForClipping(g);T.draw(t.context,d,a,S,s,tk.backCCW,m,A,M,r.id,k.layoutVertexBuffer,h,f,r.paint,t.transform.zoom,E)}}function iv(t,i,r,o,a,s,l,c){let d=t.context,u=d.gl,m="fill-extrusion-pattern",h=r.paint.get(m),f=h.constantOr(1),p=r.getCrossfadeParameters(),b=r.paint.get("fill-extrusion-opacity"),g=h.constantOr(null),_=t.transform;for(let h of o){let o=i.getTile(h),y=o.getBucket(r);if(!y)continue;let v=t.style.map.terrain&&t.style.map.terrain.getTerrainData(h),x=y.programConfigurations.get(r.id),w=t.useProgram(f?"fillExtrusionPattern":"fillExtrusion",x);f&&(t.context.activeTexture.set(u.TEXTURE0),o.imageAtlasTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),x.updatePaintBuffers(p));let F=_.getProjectionData({overscaledTileID:h,applyGlobeMatrix:!c,applyTerrainMatrix:!0});i_(x,m,g,o,r);let k=n.aI(_,o,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),E=r.paint.get("fill-extrusion-vertical-gradient"),T=f?ni(t,E,b,k,h,p,o):nn(t,E,b,k);w.draw(d,d.gl.TRIANGLES,a,s,l,tk.backCCW,T,v,F,r.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,r.paint,t.transform.zoom,x,t.style.map.terrain&&y.centroidVertexBuffer)}}function ix(t,n,i,r,o,a,s,l,c){var d;let u=t.style.projection,m=t.context,h=t.transform,f=m.gl,p=[`#define NUM_ILLUMINATION_SOURCES ${i.paint.get("hillshade-highlight-color").values.length}`],b=t.useProgram("hillshade",null,!1,p),g=!t.options.moving;for(let p of r){let r=n.getTile(p),_=r.fbo;if(!_)continue;let y=u.getMeshFromTileID(m,p.canonical,l,!0,"raster"),v=null==(d=t.style.map.terrain)?void 0:d.getTerrainData(p);m.activeTexture.set(f.TEXTURE0),f.bindTexture(f.TEXTURE_2D,_.colorAttachment.get());let x=h.getProjectionData({overscaledTileID:p,aligned:g,applyGlobeMatrix:!c,applyTerrainMatrix:!0});b.draw(m,f.TRIANGLES,a,o[p.overscaledZ],s,tk.backCCW,nh(t,r,i),v,x,i.id,y.vertexBuffer,y.indexBuffer,y.segments)}}function iw(t,i,r,o,a,s,l,c,d){var u;let m=t.style.projection,h=t.context,f=t.transform,p=h.gl,b=t.useProgram("colorRelief"),g=!t.options.moving,_=!0,y=0;for(let v of o){let o=i.getTile(v),x=o.dem;if(_){let t=p.getParameter(p.MAX_TEXTURE_SIZE),{elevationTexture:n,colorTexture:i}=r.getColorRampTextures(h,t,x.getUnpackVector());h.activeTexture.set(p.TEXTURE1),n.bind(p.NEAREST,p.CLAMP_TO_EDGE),h.activeTexture.set(p.TEXTURE4),i.bind(p.LINEAR,p.CLAMP_TO_EDGE),_=!1,y=n.size[0]}if(!x||!x.data)continue;let w=x.stride,F=x.getPixels();if(h.activeTexture.set(p.TEXTURE0),h.pixelStoreUnpackPremultiplyAlpha.set(!1),o.demTexture=o.demTexture||t.getTileTexture(w),o.demTexture){let t=o.demTexture;t.update(F,{premultiply:!1}),t.bind(p.LINEAR,p.CLAMP_TO_EDGE)}else o.demTexture=new n.T(h,F,p.RGBA,{premultiply:!1}),o.demTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE);let k=m.getMeshFromTileID(h,v.canonical,c,!0,"raster"),E=null==(u=t.style.map.terrain)?void 0:u.getTerrainData(v),T=f.getProjectionData({overscaledTileID:v,aligned:g,applyGlobeMatrix:!d,applyTerrainMatrix:!0});b.draw(h,p.TRIANGLES,s,a[v.overscaledZ],l,tk.backCCW,np(r,o.dem,y),E,T,r.id,k.vertexBuffer,k.indexBuffer,k.segments)}}let iF=[new n.P(0,0),new n.P(n.a3,0),new n.P(n.a3,n.a3),new n.P(0,n.a3)];function ik(t,i,r,o,a,s,l,c,d=!1,u=!1){let m=o[o.length-1].overscaledZ,h=t.context,f=h.gl,b=t.useProgram("raster"),g=t.transform,_=t.style.projection,y=t.colorModeForRenderPass(),x=!t.options.moving,w=r.paint.get("raster-opacity"),F=r.paint.get("raster-resampling"),k=r.paint.get("raster-fade-duration"),E=!!t.style.map.terrain;for(let T of o){let o=t.getDepthModeForSublayer(T.overscaledZ-m,1===w?tE.ReadWrite:tE.ReadOnly,f.LESS),A=i.getTile(T),M="nearest"===F?f.NEAREST:f.LINEAR;h.activeTexture.set(f.TEXTURE0),A.texture.bind(M,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST),h.activeTexture.set(f.TEXTURE1);let{parentTile:C,parentScaleBy:S,parentTopLeft:D,fadeValues:I}=function(t,i,r,o){let a={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(0===r||o)return a;if(t.fadingParentID){let o=i.getLoadedTile(t.fadingParentID);if(!o)return a;let s=Math.pow(2,o.tileID.overscaledZ-t.tileID.overscaledZ),l=[t.tileID.canonical.x*s%1,t.tileID.canonical.y*s%1],c=function(t,i,r){let o=v(),a=(o-i.timeAdded)/r,s=t.fadingDirection===p.Incoming,l=n.ai((o-t.timeAdded)/r,0,1),c=n.ai(1-a,0,1),d=s?l:c;return{tileOpacity:d,parentTileOpacity:s?c:l,fadeMix:{opacity:1,mix:1-d}}}(t,o,r);return{parentTile:o,parentScaleBy:s,parentTopLeft:l,fadeValues:c}}return t.selfFading?{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:function(t,i){let r=(v()-t.timeAdded)/i,o=n.ai(r,0,1);return{tileOpacity:o,fadeMix:{opacity:o,mix:0}}}(t,r)}:a}(A,i,k,E);A.fadeOpacity=I.tileOpacity,C?(C.fadeOpacity=I.parentTileOpacity,C.texture.bind(M,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST)):A.texture.bind(M,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST),A.texture.useMipmap&&h.extTextureFilterAnisotropic&&t.transform.pitch>20&&f.texParameterf(f.TEXTURE_2D,h.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,h.extTextureFilterAnisotropicMax);let P=t.style.map.terrain&&t.style.map.terrain.getTerrainData(T),R=g.getProjectionData({overscaledTileID:T,aligned:x,applyGlobeMatrix:!u,applyTerrainMatrix:!0}),O=nF(D,S,I.fadeMix,r,c),B=_.getMeshFromTileID(h,T.canonical,s,l,"raster");b.draw(h,f.TRIANGLES,o,a?a[T.overscaledZ]:tT.disabled,y,d?tk.frontCCW:tk.backCCW,O,P,R,r.id,B.vertexBuffer,B.indexBuffer,B.segments)}}let iE=new n.bj(1,0,0,1),iT=new n.bj(0,1,0,1),iA=new n.bj(0,0,1,1),iM=new n.bj(1,0,1,1),iC=new n.bj(0,1,1,1);function iS(t,n,i,r){iD(t,0,n+i/2,t.transform.width,i,r)}function iL(t,n,i,r){iD(t,n-i/2,0,i,t.transform.height,r)}function iD(t,n,i,r,o,a){let s=t.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(n*t.pixelRatio,i*t.pixelRatio,r*t.pixelRatio,o*t.pixelRatio),s.clear({color:a}),l.disable(l.SCISSOR_TEST)}function iI(t,n,i,r){let{isRenderingGlobe:o}=r,a=t.context,s=a.gl,l=t.transform,c=t.colorModeForRenderPass(),d=t.getDepthModeFor3D(),u=t.useProgram("terrain");for(let r of(a.bindFramebuffer.set(null),a.viewport.set([0,0,t.width,t.height]),i)){let i=n.getTerrainMesh(r.tileID),m=t.renderToTexture.getTexture(r),h=n.getTerrainData(r.tileID);a.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,m.texture);let f=t8(n.getMeshFrameDelta(l.zoom),l.calculateFogMatrix(r.tileID.toUnwrapped()),t.style.sky,l.pitch,o),p=l.getProjectionData({overscaledTileID:r.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});u.draw(a,s.TRIANGLES,d,tT.disabled,c,tk.backCCW,f,h,p,"terrain",i.vertexBuffer,i.indexBuffer,i.segments)}}function iP(t,i){if(!i.mesh){let r=new n.aQ;r.emplaceBack(-1,-1),r.emplaceBack(1,-1),r.emplaceBack(1,1),r.emplaceBack(-1,1);let o=new n.aS;o.emplaceBack(0,1,2),o.emplaceBack(0,2,3),i.mesh=new ta(t.createVertexBuffer(r,ts.members),t.createIndexBuffer(o),n.aR.simpleSegment(0,0,r.length,o.length))}return i.mesh}class iR{constructor(t,i){this.context=new ic(t),this.transform=i,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:n.am(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=eA.maxUnderzooming+eA.maxOverzooming+1,this.depthEpsilon=1/65536,this.crossTileSymbolIndex=new tn}resize(t,n,i){if(this.width=Math.floor(t*i),this.height=Math.floor(n*i),this.pixelRatio=i,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let t of this.style._order)this.style._layers[t].resize()}setup(){let t=this.context,i=new n.aQ;i.emplaceBack(0,0),i.emplaceBack(n.a3,0),i.emplaceBack(0,n.a3),i.emplaceBack(n.a3,n.a3),this.tileExtentBuffer=t.createVertexBuffer(i,ts.members),this.tileExtentSegments=n.aR.simpleSegment(0,0,4,2);let r=new n.aQ;r.emplaceBack(0,0),r.emplaceBack(n.a3,0),r.emplaceBack(0,n.a3),r.emplaceBack(n.a3,n.a3),this.debugBuffer=t.createVertexBuffer(r,ts.members),this.debugSegments=n.aR.simpleSegment(0,0,4,5);let o=new n.cb;o.emplaceBack(0,0,0,0),o.emplaceBack(n.a3,0,n.a3,0),o.emplaceBack(0,n.a3,0,n.a3),o.emplaceBack(n.a3,n.a3,n.a3,n.a3),this.rasterBoundsBuffer=t.createVertexBuffer(o,t4.members),this.rasterBoundsSegments=n.aR.simpleSegment(0,0,4,2);let a=new n.aQ;a.emplaceBack(0,0),a.emplaceBack(n.a3,0),a.emplaceBack(0,n.a3),a.emplaceBack(n.a3,n.a3),this.rasterBoundsBufferPosOnly=t.createVertexBuffer(a,ts.members),this.rasterBoundsSegmentsPosOnly=n.aR.simpleSegment(0,0,4,5);let s=new n.aQ;s.emplaceBack(0,0),s.emplaceBack(1,0),s.emplaceBack(0,1),s.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(s,ts.members),this.viewportSegments=n.aR.simpleSegment(0,0,4,2);let l=new n.cc;l.emplaceBack(0),l.emplaceBack(1),l.emplaceBack(3),l.emplaceBack(2),l.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(l);let c=new n.aS;c.emplaceBack(1,0,2),c.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(c);let d=this.context.gl;this.stencilClearMode=new tT({func:d.ALWAYS,mask:0},0,255,d.ZERO,d.ZERO,d.ZERO),this.tileExtentMesh=new ta(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){let t=this.context,i=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let r=n.M();n.c1(r,0,this.width,this.height,0,0,1),n.O(r,r,[i.drawingBufferWidth,i.drawingBufferHeight,0]),this.useProgram("clippingMask",null,!0).draw(t,i.TRIANGLES,tE.disabled,this.stencilClearMode,tF.disabled,tk.disabled,null,null,{mainMatrix:r,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:r},"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,n,i){if(this.currentStencilSource===t.source||!t.isTileClipped()||!n||!n.length)return;this.currentStencilSource=t.source,this.nextStencilID+n.length>256&&this.clearStencil();let r=this.context;r.setColorMode(tF.disabled),r.setDepthMode(tE.disabled);let o={};for(let t of n)o[t.key]=this.nextStencilID++;this._renderTileMasks(o,n,i,!0),this._renderTileMasks(o,n,i,!1),this._tileClippingMaskIDs=o}_renderTileMasks(t,n,i,r){let o=this.context,a=o.gl,s=this.style.projection,l=this.transform,c=this.useProgram("clippingMask");for(let d of n){let n=t[d.key],u=this.style.map.terrain&&this.style.map.terrain.getTerrainData(d),m=s.getMeshFromTileID(this.context,d.canonical,r,!0,"stencil"),h=l.getProjectionData({overscaledTileID:d,applyGlobeMatrix:!i,applyTerrainMatrix:!0});c.draw(o,a.TRIANGLES,tE.disabled,new tT({func:a.ALWAYS,mask:0},n,255,a.KEEP,a.KEEP,a.REPLACE),tF.disabled,i?tk.disabled:tk.backCCW,null,u,h,"$clipping",m.vertexBuffer,m.indexBuffer,m.segments)}}_renderTilesDepthBuffer(){let t=this.context,n=t.gl,i=this.style.projection,r=this.transform,o=this.useProgram("depth"),a=this.getDepthModeFor3D();for(let s of eE(r,{tileSize:r.tileSize})){let l=this.style.map.terrain&&this.style.map.terrain.getTerrainData(s),c=i.getMeshFromTileID(this.context,s.canonical,!0,!0,"raster"),d=r.getProjectionData({overscaledTileID:s,applyGlobeMatrix:!0,applyTerrainMatrix:!0});o.draw(t,n.TRIANGLES,a,tT.disabled,tF.disabled,tk.backCCW,null,l,d,"$clipping",c.vertexBuffer,c.indexBuffer,c.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let t=this.nextStencilID++,n=this.context.gl;return new tT({func:n.NOTEQUAL,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(t){let n=this.context.gl;return new tT({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,n.KEEP,n.KEEP,n.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(t){let n=this.context.gl,i=t.sort((t,n)=>n.overscaledZ-t.overscaledZ),r=i[i.length-1].overscaledZ,o=i[0].overscaledZ-r+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();let t={};for(let i=0;i<o;i++)t[i+r]=new tT({func:n.GEQUAL,mask:255},i+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=o,[t,i]}return[{[r]:tT.disabled},i]}stencilConfigForOverlapTwoPass(t){let n=this.context.gl,i=t.sort((t,n)=>n.overscaledZ-t.overscaledZ),r=i[i.length-1].overscaledZ,o=i[0].overscaledZ-r+1;if(this.clearStencil(),o>1){let t={},a={};for(let i=0;i<o;i++)t[i+r]=new tT({func:n.GREATER,mask:255},o+1+i,255,n.KEEP,n.KEEP,n.REPLACE),a[i+r]=new tT({func:n.GREATER,mask:255},1+i,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID=2*o+1,[t,a,i]}return this.nextStencilID=3,[{[r]:new tT({func:n.GREATER,mask:255},2,255,n.KEEP,n.KEEP,n.REPLACE)},{[r]:new tT({func:n.GREATER,mask:255},1,255,n.KEEP,n.KEEP,n.REPLACE)},i]}colorModeForRenderPass(){let t=this.context.gl;if(this._showOverdrawInspector){let i=1/8;return new tF([t.CONSTANT_COLOR,t.ONE],new n.bj(i,i,i,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?tF.unblended:tF.alphaBlended}getDepthModeForSublayer(t,n,i){if(!this.opaquePassEnabledForLayer())return tE.disabled;let r=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new tE(i||this.context.gl.LEQUAL,n,[r,r])}getDepthModeFor3D(){return new tE(this.context.gl.LEQUAL,tE.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,i){var r,o;this.style=t,this.options=i,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(v()),this.imageManager.beginFrame();let a=this.style._order,s=this.style.tileManagers,l={},c={},d={},u={isRenderingToTexture:!1,isRenderingGlobe:(null==(r=t.projection)?void 0:r.transitionState)>0};for(let t in s){let n=s[t];n.used&&n.prepare(this.context),l[t]=n.getVisibleCoordinates(!1),c[t]=l[t].slice().reverse(),d[t]=n.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let t=0;t<a.length;t++)if(this.style._layers[a[t]].is3D()){this.opaquePassCutoff=t;break}for(let t of(this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen",a)){let n=this.style._layers[t];if(!n.hasOffscreenPass()||n.isHidden(this.transform.zoom))continue;let i=c[n.source];("custom"===n.type||i.length)&&this.renderLayer(this,s[n.source],n,i,u)}if(null==(o=this.style.projection)||o.updateGPUdependent({context:this.context,useProgram:t=>this.useProgram(t)}),this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:i.showOverdrawInspector?n.bj.black:n.bj.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(t,n){let i=t.context,r=i.gl,o=((t,n,i)=>{let r=Math.cos(n.rollInRadians),o=Math.sin(n.rollInRadians),a=e_(n),s=n.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:t.properties.get("sky-color"),u_horizon_color:t.properties.get("horizon-color"),u_horizon:[(n.width/2-a*o)*i,(n.height/2+a*r)*i],u_horizon_normal:[-o,r],u_sky_horizon_blend:t.properties.get("sky-horizon-blend")*n.height/2*i,u_sky_blend:s}})(n,t.style.map.transform,t.pixelRatio),a=new tE(r.LEQUAL,tE.ReadWrite,[0,1]),s=tT.disabled,l=t.colorModeForRenderPass(),c=t.useProgram("sky"),d=iP(i,n);c.draw(i,r.TRIANGLES,a,s,l,tk.disabled,o,null,void 0,"sky",d.vertexBuffer,d.indexBuffer,d.segments)}(this,this.style.sky),this._showOverdrawInspector=i.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=a.length-1;this.currentLayer>=0;this.currentLayer--){let t=this.style._layers[a[this.currentLayer]],n=s[t.source],i=l[t.source];this._renderTileClippingMasks(t,i,!1),this.renderLayer(this,n,t,i,u)}this.renderPass="translucent";let m=!1;for(this.currentLayer=0;this.currentLayer<a.length;this.currentLayer++){let t=this.style._layers[a[this.currentLayer]],n=s[t.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(t,u))continue;this.opaquePassEnabledForLayer()||m||(m=!0,u.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());let i=("symbol"===t.type?d:c)[t.source];this._renderTileClippingMasks(t,l[t.source],!!this.renderToTexture),this.renderLayer(this,n,t,i,u)}if(u.isRenderingGlobe&&function(t,i,r){let o=t.context,a=o.gl,s=t.useProgram("atmosphere"),l=new tE(a.LEQUAL,tE.ReadOnly,[0,1]),c=t.transform,d=function(t,i){let r=t.properties.get("position"),o=[-r.x,-r.y,-r.z],a=n.am(new Float64Array(16));return"map"===t.properties.get("anchor")&&(n.ba(a,a,i.rollInRadians),n.bb(a,a,-i.pitchInRadians),n.ba(a,a,i.bearingInRadians),n.bb(a,a,i.center.lat*Math.PI/180),n.bD(a,a,-i.center.lng*Math.PI/180)),n.ca(o,o,a),o}(r,t.transform),u=c.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),m=i.properties.get("atmosphere-blend")*u.projectionTransition;if(0===m)return;let h=tN(c.worldSize,c.center.lat),f=c.inverseProjectionMatrix,p=new Float64Array(4);p[3]=1,n.aB(p,p,c.modelViewProjectionMatrix),p[0]/=p[3],p[1]/=p[3],p[2]/=p[3],p[3]=1,n.aB(p,p,f),p[0]/=p[3],p[1]/=p[3],p[2]/=p[3],p[3]=1;let b={u_sun_pos:d,u_atmosphere_blend:m,u_globe_position:[p[0],p[1],p[2]],u_globe_radius:h,u_inv_proj_matrix:f},g=iP(o,i);s.draw(o,a.TRIANGLES,l,tT.disabled,tF.alphaBlended,tk.disabled,b,null,null,"atmosphere",g.vertexBuffer,g.indexBuffer,g.segments)}(this,this.style.sky,this.style.light),this.options.showTileBoundaries){let t=function(t,n){let i=null,r=Object.values(t._layers).flatMap(i=>i.source&&!i.isHidden(n)?[t.tileManagers[i.source]]:[]),o=r.filter(t=>"vector"===t.getSource().type),a=r.filter(t=>"vector"!==t.getSource().type),s=t=>{(!i||i.getSource().maxzoom<t.getSource().maxzoom)&&(i=t)};return o.forEach(t=>s(t)),i||a.forEach(t=>s(t)),i}(this.style,this.transform.zoom);t&&function(t,i,r){for(let o=0;o<r.length;o++)!function(t,i,r){let o=t.context,a=o.gl,s=t.useProgram("debug"),l=tE.disabled,c=tT.disabled,d=t.colorModeForRenderPass(),u="$debug",m=t.style.map.terrain&&t.style.map.terrain.getTerrainData(r);o.activeTexture.set(a.TEXTURE0);let h=i.getTileByID(r.key).latestRawTileData,f=Math.floor((h&&h.byteLength||0)/1024),p=512/Math.min(i.getTile(r).tileSize,512)*(r.overscaledZ/t.transform.zoom)*.5,b=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(b+=` => ${r.overscaledZ}`),function(t,n){t.initDebugOverlayCanvas();let i=t.debugOverlayCanvas,r=t.context.gl,o=t.debugOverlayCanvas.getContext("2d");o.clearRect(0,0,i.width,i.height),o.shadowColor="white",o.shadowBlur=2,o.lineWidth=1.5,o.strokeStyle="white",o.textBaseline="top",o.font="bold 36px Open Sans, sans-serif",o.fillText(n,5,5),o.strokeText(n,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}(t,`${b} ${f}kB`);let g=t.transform.getProjectionData({overscaledTileID:r,applyGlobeMatrix:!0,applyTerrainMatrix:!0});s.draw(o,a.TRIANGLES,l,c,tF.alphaBlended,tk.disabled,nd(n.bj.transparent,p),null,g,u,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments),s.draw(o,a.LINE_STRIP,l,c,d,tk.disabled,nd(n.bj.red),m,g,u,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments)}(t,i,r[o])}(this,t,t.getVisibleCoordinates())}this.options.showPadding&&function(t){var n,i;let r=t.transform.padding;iS(t,t.transform.height-(r.top||0),3,iE),iS(t,r.bottom||0,3,iT),iL(t,r.left||0,3,iA),iL(t,t.transform.width-(r.right||0),3,iM);let o=t.transform.centerPoint;n=o.x,i=t.transform.height-o.y,iD(t,n-1,i-10,2,20,iC),iD(t,n-10,i-1,20,2,iC)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(t){if(!this.style||!this.style.map||!this.style.map.terrain)return;let i=this.terrainFacilitator.matrix,r=this.transform.modelViewProjectionMatrix,o=this.terrainFacilitator.dirty;o||(o=t?!n.cd(i,r):!n.ce(i,r)),o||(o=this.style.map.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime)),o&&(n.cf(i,r),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(t,i){let r=t.context,o=r.gl,a=t.transform,s=tF.unblended,l=new tE(o.LEQUAL,tE.ReadWrite,[0,1]),c=i.tileManager.getRenderableTiles(),d=t.useProgram("terrainDepth");for(let u of(r.bindFramebuffer.set(i.getFramebuffer("depth").framebuffer),r.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),r.clear({color:n.bj.transparent,depth:1}),c)){let t=i.getTerrainMesh(u.tileID),n=i.getTerrainData(u.tileID),c=a.getProjectionData({overscaledTileID:u.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),m={u_ele_delta:i.getMeshFrameDelta(a.zoom)};d.draw(r,o.TRIANGLES,l,tT.disabled,s,tk.backCCW,m,n,c,"terrain",t.vertexBuffer,t.indexBuffer,t.segments)}r.bindFramebuffer.set(null),r.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain),function(t,i){let r=t.context,o=r.gl,a=t.transform,s=tF.unblended,l=new tE(o.LEQUAL,tE.ReadWrite,[0,1]),c=i.getCoordsTexture(),d=i.tileManager.getRenderableTiles(),u=t.useProgram("terrainCoords");for(let m of(r.bindFramebuffer.set(i.getFramebuffer("coords").framebuffer),r.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),r.clear({color:n.bj.transparent,depth:1}),i.coordsIndex=[],d)){let t=i.getTerrainMesh(m.tileID),n=i.getTerrainData(m.tileID);r.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,c.texture);let d={u_terrain_coords_id:(255-i.coordsIndex.length)/255,u_texture:0,u_ele_delta:i.getMeshFrameDelta(a.zoom)},h=a.getProjectionData({overscaledTileID:m.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});u.draw(r,o.TRIANGLES,l,tT.disabled,s,tk.backCCW,d,n,h,"terrain",t.vertexBuffer,t.indexBuffer,t.segments),i.coordsIndex.push(m.tileID.key)}r.bindFramebuffer.set(null),r.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain))}renderLayer(t,i,r,o,a){r.isHidden(this.transform.zoom)||("background"===r.type||"custom"===r.type||(o||[]).length)&&(this.id=r.id,n.cg(r)?function(t,i,r,o,a,s){if("translucent"!==t.renderPass)return;let{isRenderingToTexture:l}=s,c=tT.disabled,d=t.colorModeForRenderPass();(r._unevaluatedLayout.hasValue("text-variable-anchor")||r._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(t,i,r,o,a,s,l,c,d){let u=i.transform,m=i.style.map.terrain,h="map"===a,f="map"===s;for(let a of t){let t=o.getTile(a),s=t.getBucket(r);if(!s||!s.text||!s.text.segments.get().length)continue;let p=n.as(s.textSizeData,u.zoom),b=n.aH(t,1,i.transform.zoom),g=eI(h,i.transform,b),_="none"!==r.layout.get("icon-text-fit")&&s.hasIconData();if(p){let i=Math.pow(2,u.zoom-t.tileID.overscaledZ),r=m?(t,n)=>m.getElevation(a,t,n):null;!function(t,i,r,o,a,s,l,c,d,u,m,h){let f=t.text.placedSymbolArray,p=t.text.dynamicLayoutVertexArray,b=t.icon.dynamicLayoutVertexArray,g={};p.clear();for(let b=0;b<f.length;b++){let _=f.get(b),y=_.hidden||!_.crossTileID||t.allowVerticalPlacement&&!_.placedOrientation?null:o[_.crossTileID];if(y){let o=new n.P(_.anchorX,_.anchorY),f={getElevation:h,width:a.width,height:a.height,pitchedLabelPlaneMatrix:s,pitchWithMap:r,transform:a,tileAnchorPoint:o,translation:u,unwrappedTileID:m},b=r?eH(o.x,o.y,f):ej(o.x,o.y,f),v=.5+a.cameraToCenterDistance/b.signedDistanceFromCamera*.5,x=n.au(t.textSizeData,c,_)*v/n.aG;r&&(x*=t.tilePixelRatio/l);let{width:w,height:F,anchor:k,textOffset:E,textBoxScale:T}=y,A=function(t,i,r,o,a,s){let{horizontalAlign:l,verticalAlign:c}=n.aM(t);return new n.P((-(l-.5)*i/a+o[0])*s,(-(c-.5)*r/a+o[1])*s)}(k,w,F,E,T,x),M=a.getPitchedTextCorrection(o.x+u[0],o.y+u[1],m),C=function(t,i,r,o,a,s){let l=i.tileAnchorPoint.add(new n.P(i.translation[0],i.translation[1]));if(i.pitchWithMap){let t=o.mult(s);r||(t=t.rotate(-a));let n=l.add(t);return eR(n.x,n.y,i.pitchedLabelPlaneMatrix,i.getElevation).point}if(r){let n=ej(i.tileAnchorPoint.x+1,i.tileAnchorPoint.y,i).point.sub(t),r=Math.atan(n.y/n.x)+(n.x<0?Math.PI:0);return t.add(o.rotate(r))}return t.add(o)}(b.point,f,i,A,-a.bearingInRadians,M),S=t.allowVerticalPlacement&&_.placedOrientation===n.at.vertical?Math.PI/2:0;for(let t=0;t<_.numGlyphs;t++)n.aA(p,C,S);d&&_.associatedIconIndex>=0&&(g[_.associatedIconIndex]={shiftedAnchor:C,angle:S})}else e$(_.numGlyphs,p)}if(d){b.clear();let i=t.icon.placedSymbolArray;for(let t=0;t<i.length;t++){let r=i.get(t);if(r.hidden)e$(r.numGlyphs,b);else{let i=g[t];if(i)for(let t=0;t<r.numGlyphs;t++)n.aA(b,i.shiftedAnchor,i.angle);else e$(r.numGlyphs,b)}}t.icon.dynamicLayoutVertexBuffer.updateData(b)}t.text.dynamicLayoutVertexBuffer.updateData(p)}(s,h,f,d,u,g,i,p,_,n.aI(u,t,l,c),a.toUnwrapped(),r)}}}(o,t,r,i,r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),a),0!==r.paint.get("icon-opacity").constantOr(1)&&im(t,i,r,o,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright"),c,d,l),0!==r.paint.get("text-opacity").constantOr(1)&&im(t,i,r,o,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright"),c,d,l),i.map.showCollisionBoxes&&(id(t,i,r,o,!0),id(t,i,r,o,!1))}(t,i,r,o,this.style.placement.variableOffsets,a):n.ch(r)?function(t,i,r,o,a){if("translucent"!==t.renderPass)return;let{isRenderingToTexture:s}=a,l=r.paint.get("circle-opacity"),c=r.paint.get("circle-stroke-width"),d=r.paint.get("circle-stroke-opacity"),u=!r.layout.get("circle-sort-key").isConstant();if(0===l.constantOr(1)&&(0===c.constantOr(1)||0===d.constantOr(1)))return;let m=t.context,h=m.gl,f=t.transform,p=t.getDepthModeForSublayer(0,tE.ReadOnly),b=tT.disabled,g=t.colorModeForRenderPass(),_=[],y=f.getCircleRadiusCorrection();for(let a=0;a<o.length;a++){let l=o[a],c=i.getTile(l),d=c.getBucket(r);if(!d)continue;let m=r.paint.get("circle-translate"),h=r.paint.get("circle-translate-anchor"),p=n.aI(f,c,m,h),b=d.programConfigurations.get(r.id),g=t.useProgram("circle",b),v=d.layoutVertexBuffer,x=d.indexBuffer,w=t.style.map.terrain&&t.style.map.terrain.getTerrainData(l),F={programConfiguration:b,program:g,layoutVertexBuffer:v,indexBuffer:x,uniformValues:ns(t,c,r,p,y),terrainData:w,projectionData:f.getProjectionData({overscaledTileID:l,applyGlobeMatrix:!s,applyTerrainMatrix:!0})};if(u)for(let t of d.segments.get())_.push({segments:new n.aR([t]),sortKey:t.sortKey,state:F});else _.push({segments:d.segments,sortKey:0,state:F})}for(let n of(u&&_.sort((t,n)=>t.sortKey-n.sortKey),_)){let{programConfiguration:i,program:o,layoutVertexBuffer:a,indexBuffer:s,uniformValues:l,terrainData:c,projectionData:d}=n.state;o.draw(m,h.TRIANGLES,p,b,g,tk.backCCW,l,c,d,r.id,a,s,n.segments,r.paint,t.transform.zoom,i)}}(t,i,r,o,a):n.ci(r)?function(t,i,r,o,a){if(0===r.paint.get("heatmap-opacity"))return;let s=t.context,{isRenderingToTexture:l,isRenderingGlobe:c}=a;if(t.style.map.terrain){for(let a of o){let o=i.getTile(a);i.hasRenderableParent(a)||("offscreen"===t.renderPass?function(t,i,r,o,a){let s=t.context,l=s.gl,c=tT.disabled,d=new tF([l.ONE,l.ONE],n.bj.transparent,[!0,!0,!0,!0]),u=i.getBucket(r);if(!u)return;let m=o.key,h=r.heatmapFbos.get(m);h||(h=ip(s,i.tileSize,i.tileSize),r.heatmapFbos.set(m,h)),s.bindFramebuffer.set(h.framebuffer),s.viewport.set([0,0,i.tileSize,i.tileSize]),s.clear({color:n.bj.transparent});let f=u.programConfigurations.get(r.id),p=t.useProgram("heatmap",f,!a),b=t.transform.getProjectionData({overscaledTileID:i.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),g=t.style.map.terrain.getTerrainData(o);p.draw(s,l.TRIANGLES,tE.disabled,c,d,tk.disabled,nu(i,t.transform.zoom,r.paint.get("heatmap-intensity"),1),g,b,r.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,r.paint,t.transform.zoom,f)}(t,o,r,a,c):"translucent"===t.renderPass&&function(t,n,i,r,o){let a=t.context,s=a.gl,l=t.transform;a.setColorMode(t.colorModeForRenderPass());let c=ib(a,n),d=i.key,u=n.heatmapFbos.get(d);if(!u)return;a.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,u.colorAttachment.get()),a.activeTexture.set(s.TEXTURE1),c.bind(s.LINEAR,s.CLAMP_TO_EDGE);let m=l.getProjectionData({overscaledTileID:i,applyTerrainMatrix:o,applyGlobeMatrix:!r});t.useProgram("heatmapTexture").draw(a,s.TRIANGLES,tE.disabled,tT.disabled,t.colorModeForRenderPass(),tk.disabled,nm(t,n,0,1),null,m,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments,n.paint,l.zoom),u.destroy(),n.heatmapFbos.delete(d)}(t,r,a,l,c))}s.viewport.set([0,0,t.width,t.height])}else"offscreen"===t.renderPass?function(t,i,r,o){let a=t.context,s=a.gl,l=t.transform,c=tT.disabled,d=new tF([s.ONE,s.ONE],n.bj.transparent,[!0,!0,!0,!0]);(function(t,i,r){let o=t.gl;t.activeTexture.set(o.TEXTURE1),t.viewport.set([0,0,i.width/4,i.height/4]);let a=r.heatmapFbos.get(n.c7);a?(o.bindTexture(o.TEXTURE_2D,a.colorAttachment.get()),t.bindFramebuffer.set(a.framebuffer)):(a=ip(t,i.width/4,i.height/4),r.heatmapFbos.set(n.c7,a))})(a,t,r),a.clear({color:n.bj.transparent});for(let n=0;n<o.length;n++){let u=o[n];if(i.hasRenderableParent(u))continue;let m=i.getTile(u),h=m.getBucket(r);if(!h)continue;let f=h.programConfigurations.get(r.id),p=t.useProgram("heatmap",f),b=l.getProjectionData({overscaledTileID:u,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),g=l.getCircleRadiusCorrection();p.draw(a,s.TRIANGLES,tE.disabled,c,d,tk.backCCW,nu(m,l.zoom,r.paint.get("heatmap-intensity"),g),null,b,r.id,h.layoutVertexBuffer,h.indexBuffer,h.segments,r.paint,l.zoom,f)}a.viewport.set([0,0,t.width,t.height])}(t,i,r,o):"translucent"===t.renderPass&&function(t,i){let r=t.context,o=r.gl;r.setColorMode(t.colorModeForRenderPass());let a=i.heatmapFbos.get(n.c7);a&&(r.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,a.colorAttachment.get()),r.activeTexture.set(o.TEXTURE1),ib(r,i).bind(o.LINEAR,o.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(r,o.TRIANGLES,tE.disabled,tT.disabled,t.colorModeForRenderPass(),tk.disabled,nm(t,i,0,1),null,null,i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,i.paint,t.transform.zoom))}(t,r)}(t,i,r,o,a):n.cj(r)?function(t,n,i,r,o){let a;if("translucent"!==t.renderPass)return;let{isRenderingToTexture:s}=o,l=i.paint.get("line-opacity"),c=i.paint.get("line-width");if(0===l.constantOr(1)||0===c.constantOr(1))return;let d=t.getDepthModeForSublayer(0,tE.ReadOnly),u=t.colorModeForRenderPass(),m=i.paint.get("line-dasharray"),h=m.constantOr(1),f=i.paint.get("line-pattern"),p=f.constantOr(1),b=i.paint.get("line-gradient"),g=i.getCrossfadeParameters();a=p?"linePattern":h&&b?"lineGradientSDF":h?"lineSDF":b?"lineGradient":"line";let _=t.context,y=_.gl,v=t.transform,x=!0;for(let o of r){let r,l=n.getTile(o);if(p&&!l.patternsLoaded())continue;let c=l.getBucket(i);if(!c)continue;let w=c.programConfigurations.get(i.id),F=t.context.program.get(),k=t.useProgram(a,w),E=x||k.program!==F,T=t.style.map.terrain&&t.style.map.terrain.getTerrainData(o),A=f.constantOr(null),M=m&&m.constantOr(null);if(A&&l.imageAtlas){let t=l.imageAtlas,n=t.patternPositions[A.to.toString()],i=t.patternPositions[A.from.toString()];n&&i&&w.setConstantPatternPositions(n,i)}else if(M){let n="round"===i.layout.get("line-cap"),r=t.lineAtlas.getDash(M.to,n),o=t.lineAtlas.getDash(M.from,n);w.setConstantDashPositions(r,o)}let C=v.getProjectionData({overscaledTileID:o,applyGlobeMatrix:!s,applyTerrainMatrix:!0}),S=v.getPixelScale();p?(r=n_(t,l,i,S,g),_.activeTexture.set(y.TEXTURE0),l.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),w.updatePaintBuffers(g)):h&&b?(r=nv(t,l,i,S,g,c.lineClipsArray.length),function(t,n,i,r,o,a,s,l,c){let d=a.gradients[o.id],u=d.texture;o.gradientVersion!==d.version&&(u=ig(t,n,i,r,o,a,s,d)),i.activeTexture.set(r.TEXTURE0),u.bind(o.stepInterpolant?r.NEAREST:r.LINEAR,r.CLAMP_TO_EDGE),i.activeTexture.set(r.TEXTURE1),t.lineAtlas.bind(i),l.updatePaintBuffers(c)}(t,n,_,y,i,c,o,w,g)):h?(r=ny(t,l,i,S,g),(E||t.lineAtlas.dirty)&&(_.activeTexture.set(y.TEXTURE0),t.lineAtlas.bind(_)),w.updatePaintBuffers(g)):b?(r=ng(t,l,i,S,c.lineClipsArray.length),function(t,n,i,r,o,a,s){let l=a.gradients[o.id],c=l.texture;o.gradientVersion!==l.version&&(c=ig(t,n,i,r,o,a,s,l)),i.activeTexture.set(r.TEXTURE0),c.bind(o.stepInterpolant?r.NEAREST:r.LINEAR,r.CLAMP_TO_EDGE)}(t,n,_,y,i,c,o)):r=nb(t,l,i,S);let D=t.stencilModeForClipping(o);k.draw(_,y.TRIANGLES,d,D,u,tk.disabled,r,T,C,i.id,c.layoutVertexBuffer,c.indexBuffer,c.segments,i.paint,t.transform.zoom,w,c.layoutVertexBuffer2),x=!1}}(t,i,r,o,a):n.ck(r)?function(t,i,r,o,a){let s=r.paint.get("fill-color"),l=r.paint.get("fill-opacity");if(0===l.constantOr(1))return;let{isRenderingToTexture:c}=a,d=t.colorModeForRenderPass(),u=r.paint.get("fill-pattern"),m=t.opaquePassEnabledForLayer()&&!u.constantOr(1)&&1===s.constantOr(n.bj.transparent).a&&1===l.constantOr(0)?"opaque":"translucent";if(t.renderPass===m){let n=t.getDepthModeForSublayer(1,"opaque"===t.renderPass?tE.ReadWrite:tE.ReadOnly);iy(t,i,r,o,n,d,!1,c)}if("translucent"===t.renderPass&&r.paint.get("fill-antialias")){let n=t.getDepthModeForSublayer(2*!!r.getPaintProperty("fill-outline-color"),tE.ReadOnly);iy(t,i,r,o,n,d,!0,c)}}(t,i,r,o,a):n.cl(r)?function(t,n,i,r,o){let a=i.paint.get("fill-extrusion-opacity");if(0===a)return;let{isRenderingToTexture:s}=o;if("translucent"===t.renderPass){let o=new tE(t.context.gl.LEQUAL,tE.ReadWrite,t.depthRangeFor3D);if(1!==a||i.paint.get("fill-extrusion-pattern").constantOr(1))iv(t,n,i,r,o,tT.disabled,tF.disabled,s),iv(t,n,i,r,o,t.stencilModeFor3D(),t.colorModeForRenderPass(),s);else{let a=t.colorModeForRenderPass();iv(t,n,i,r,o,tT.disabled,a,s)}}}(t,i,r,o,a):n.cm(r)?function(t,i,r,o,a){if("offscreen"!==t.renderPass&&"translucent"!==t.renderPass)return;let{isRenderingToTexture:s}=a,l=t.context,c=t.style.projection.useSubdivision,d=t.getDepthModeForSublayer(0,tE.ReadOnly),u=t.colorModeForRenderPass();if("offscreen"===t.renderPass)!function(t,i,r,o,a,s,l){let c=t.context,d=c.gl;for(let u of r){let r=i.getTile(u),m=r.dem;if(!m||!m.data||!r.needsHillshadePrepare)continue;let h=m.dim,f=m.stride,p=m.getPixels();if(c.activeTexture.set(d.TEXTURE1),c.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||t.getTileTexture(f),r.demTexture){let t=r.demTexture;t.update(p,{premultiply:!1}),t.bind(d.NEAREST,d.CLAMP_TO_EDGE)}else r.demTexture=new n.T(c,p,d.RGBA,{premultiply:!1}),r.demTexture.bind(d.NEAREST,d.CLAMP_TO_EDGE);c.activeTexture.set(d.TEXTURE0);let b=r.fbo;if(!b){let t=new n.T(c,{width:h,height:h,data:null},d.RGBA);t.bind(d.LINEAR,d.CLAMP_TO_EDGE),(b=r.fbo=c.createFramebuffer(h,h,!0,!1)).colorAttachment.set(t.texture)}c.bindFramebuffer.set(b.framebuffer),c.viewport.set([0,0,h,h]),t.useProgram("hillshadePrepare").draw(c,d.TRIANGLES,a,s,l,tk.disabled,nf(r.tileID,m),null,null,o.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),r.needsHillshadePrepare=!1}}(t,i,o,r,d,tT.disabled,u),l.viewport.set([0,0,t.width,t.height]);else if("translucent"===t.renderPass)if(c){let[n,a,l]=t.stencilConfigForOverlapTwoPass(o);ix(t,i,r,l,n,d,u,!1,s),ix(t,i,r,l,a,d,u,!0,s)}else{let[n,a]=t.getStencilConfigForOverlapAndUpdateStencilID(o);ix(t,i,r,a,n,d,u,!1,s)}}(t,i,r,o,a):n.cn(r)?function(t,n,i,r,o){if("translucent"!==t.renderPass||!r.length)return;let{isRenderingToTexture:a}=o,s=t.style.projection.useSubdivision,l=t.getDepthModeForSublayer(0,tE.ReadOnly),c=t.colorModeForRenderPass();if(s){let[o,s,d]=t.stencilConfigForOverlapTwoPass(r);iw(t,n,i,d,o,l,c,!1,a),iw(t,n,i,d,s,l,c,!0,a)}else{let[o,s]=t.getStencilConfigForOverlapAndUpdateStencilID(r);iw(t,n,i,s,o,l,c,!1,a)}}(t,i,r,o,a):n.bO(r)?function(t,n,i,r,o){if("translucent"!==t.renderPass||0===i.paint.get("raster-opacity")||!r.length)return;let{isRenderingToTexture:a}=o,s=n.getSource(),l=t.style.projection.useSubdivision;if(s instanceof eo)ik(t,n,i,r,null,!1,!1,s.tileCoords,s.flippedWindingOrder,a);else if(l){let[o,s,l]=t.stencilConfigForOverlapTwoPass(r);ik(t,n,i,l,o,!1,!0,iF,!1,a),ik(t,n,i,l,s,!0,!0,iF,!1,a)}else{let[o,s]=t.getStencilConfigForOverlapAndUpdateStencilID(r);ik(t,n,i,s,o,!1,!0,iF,!1,a)}}(t,i,r,o,a):n.co(r)?function(t,n,i,r,o){let a=i.paint.get("background-color"),s=i.paint.get("background-opacity");if(0===s)return;let{isRenderingToTexture:l}=o,c=t.context,d=c.gl,u=t.style.projection,m=t.transform,h=m.tileSize,f=i.paint.get("background-pattern");if(t.isPatternMissing(f))return;let p=!f&&1===a.a&&1===s&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==p)return;let b=tT.disabled,g=t.getDepthModeForSublayer(0,"opaque"===p?tE.ReadWrite:tE.ReadOnly),_=t.colorModeForRenderPass(),y=t.useProgram(f?"backgroundPattern":"background"),v=r||eE(m,{tileSize:h,terrain:t.style.map.terrain});f&&(c.activeTexture.set(d.TEXTURE0),t.imageManager.bind(t.context));let x=i.getCrossfadeParameters();for(let n of v){let r=m.getProjectionData({overscaledTileID:n,applyGlobeMatrix:!l,applyTerrainMatrix:!0}),o=f?nM(s,t,f,{tileID:n,tileSize:h},x):nA(s,a),p=t.style.map.terrain&&t.style.map.terrain.getTerrainData(n),v=u.getMeshFromTileID(c,n.canonical,!1,!0,"raster");y.draw(c,d.TRIANGLES,g,b,_,tk.backCCW,o,p,r,i.id,v.vertexBuffer,v.indexBuffer,v.segments)}}(t,0,r,o,a):n.cp(r)&&function(t,n,i,r){let{isRenderingGlobe:o}=r,a=t.context,s=i.implementation,l=t.style.projection,c=t.transform,d=c.getProjectionDataForCustomLayer(o),u={farZ:c.farZ,nearZ:c.nearZ,fov:c.fov*Math.PI/180,modelViewProjectionMatrix:c.modelViewProjectionMatrix,projectionMatrix:c.projectionMatrix,shaderData:{variantName:l.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793;
|
|
52
52
|
uniform mat4 u_projection_matrix;
|
|
53
|
-
${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionData:d},m=s.renderingMode?s.renderingMode:"2d";if("offscreen"===t.renderPass){let n=s.prerender;n&&(t.setCustomLayerDefaults(),a.setColorMode(t.colorModeForRenderPass()),n.call(s,a.gl,u),a.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),a.setColorMode(t.colorModeForRenderPass()),a.setStencilMode(tT.disabled);let n="3d"===m?t.getDepthModeFor3D():t.getDepthModeForSublayer(0,tE.ReadOnly);a.setDepthMode(n),s.render(a.gl,u),a.setDirty(),t.setBaseState(),a.bindFramebuffer.set(null)}}(t,0,r,a))}saveTileTexture(t){let n=this._tileTextures[t.size[0]];n?n.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){let n=this._tileTextures[t];return n&&n.length>0?n.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;let n=this.imageManager.getPattern(t.from.toString()),i=this.imageManager.getPattern(t.to.toString());return!n||!i}useProgram(t,n,i=!1,r=[]){this.cache=this.cache||{};let o=!!this.style.map.terrain,a=this.style.projection,s=i?tr.projectionMercator:a.shaderPreludeCode,l=i?tl:a.shaderDefine,c=t+(n?n.cacheKey:"")+`/${i?tc:a.shaderVariantName}`+(this._showOverdrawInspector?"/overdraw":"")+(o?"/terrain":"")+(r?`/${r.join("/")}`:"");return this.cache[c]||(this.cache[c]=new ne(this.context,tr[t],n,nS[t],this._showOverdrawInspector,o,s,l,r)),this.cache[c]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new n.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){var t,n;if(this._tileTextures){for(let t in this._tileTextures){let n=this._tileTextures[t];if(n)for(let t of n)t.destroy()}this._tileTextures={}}if(this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.rasterBoundsBufferPosOnly&&this.rasterBoundsBufferPosOnly.destroy(),this.viewportBuffer&&this.viewportBuffer.destroy(),this.tileBorderIndexBuffer&&this.tileBorderIndexBuffer.destroy(),this.quadTriangleIndexBuffer&&this.quadTriangleIndexBuffer.destroy(),this.tileExtentMesh&&(null==(t=this.tileExtentMesh.vertexBuffer)||t.destroy()),this.tileExtentMesh&&(null==(n=this.tileExtentMesh.indexBuffer)||n.destroy()),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.cache){for(let t in this.cache){let n=this.cache[t];n&&n.program&&this.context.gl.deleteProgram(n.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){let{drawingBufferWidth:t,drawingBufferHeight:n}=this.context.gl;return this.width!==t||this.height!==n}}function iO(t,n){let i,r=!1,o=null,a=null,s=()=>{o=null,r&&(t.apply(a,i),o=setTimeout(s,n),r=!1)};return(...t)=>(r=!0,a=this,i=t,o||s(),o)}class iB{constructor(t){this._getCurrentHash=()=>{let t=window.location.hash.replace("#","");if(this._hashName){let n;return t.split("&").map(t=>t.split("=")).forEach(t=>{t[0]===this._hashName&&(n=t)}),(n&&n[1]||"").split("/")}return t.split("/")},this._onHashChange=()=>{let t=this._getCurrentHash();if(!this._isValidHash(t))return!1;let n=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:n,pitch:+(t[4]||0)}),!0},this._updateHashUnthrottled=()=>{let t=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,t)},this._removeHash=()=>{let t=this._getCurrentHash();if(0===t.length)return;let n=t.join("/"),i=n;i.split("&").length>0&&(i=i.split("&")[0]),this._hashName&&(i=`${this._hashName}=${n}`);let r=window.location.hash.replace(i,"");r.startsWith("#&")?r=r.slice(0,1)+r.slice(2):"#"===r&&(r="");let o=window.location.href.replace(/(#.+)?$/,r);o=o.replace("&&","&"),window.history.replaceState(window.history.state,null,o)},this._updateHash=iO(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(t){let n=this._map.getCenter(),i=Math.round(100*this._map.getZoom())/100,r=Math.pow(10,Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10)),o=Math.round(n.lng*r)/r,a=Math.round(n.lat*r)/r,s=this._map.getBearing(),l=this._map.getPitch(),c="";if(c+=t?`/${o}/${a}/${i}`:`${i}/${a}/${o}`,(s||l)&&(c+="/"+Math.round(10*s)/10),l&&(c+=`/${Math.round(l)}`),this._hashName){let t=this._hashName,n=!1,i=window.location.hash.slice(1).split("&").map(i=>{let r=i.split("=")[0];return r===t?(n=!0,`${r}=${c}`):i}).filter(t=>t);return n||i.push(`${t}=${c}`),`#${i.join("&")}`}return`#${c}`}_isValidHash(t){if(t.length<3||t.some(isNaN))return!1;try{new n.U(+t[2],+t[1])}catch(t){return!1}let i=+t[0],r=+(t[3]||0),o=+(t[4]||0);return i>=this._map.getMinZoom()&&i<=this._map.getMaxZoom()&&r>=-180&&r<=180&&o>=this._map.getMinPitch()&&o<=this._map.getMaxPitch()}}let iz={linearity:.3,easing:n.cq(0,0,.3,1)},iN=n.e({deceleration:2500,maxSpeed:1400},iz),iY=n.e({deceleration:20,maxSpeed:1400},iz),ij=n.e({deceleration:1e3,maxSpeed:360},iz),iU=n.e({deceleration:1e3,maxSpeed:90},iz),iH=n.e({deceleration:1e3,maxSpeed:360},iz);class iV{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:v(),settings:t})}_drainInertiaBuffer(){let t=this._inertiaBuffer,n=v();for(;t.length>0&&n-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let i={zoom:0,bearing:0,pitch:0,roll:0,pan:new n.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:t}of this._inertiaBuffer)i.zoom+=t.zoomDelta||0,i.bearing+=t.bearingDelta||0,i.pitch+=t.pitchDelta||0,i.roll+=t.rollDelta||0,t.panDelta&&i.pan._add(t.panDelta),t.around&&(i.around=t.around),t.pinchAround&&(i.pinchAround=t.pinchAround);let r=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,o={};if(i.pan.mag()){let a=iq(i.pan.mag(),r,n.e({},iN,t||{})),s=i.pan.mult(a.amount/i.pan.mag()),l=this._map.cameraHelper.handlePanInertia(s,this._map.transform);o.center=l.easingCenter,o.offset=l.easingOffset,iG(o,a)}if(i.zoom){let t=iq(i.zoom,r,iY);o.zoom=this._map.transform.zoom+t.amount,iG(o,t)}if(i.bearing){let t=iq(i.bearing,r,ij);o.bearing=this._map.transform.bearing+n.ai(t.amount,-179,179),iG(o,t)}if(i.pitch){let t=iq(i.pitch,r,iU);o.pitch=this._map.transform.pitch+t.amount,iG(o,t)}if(i.roll){let t=iq(i.roll,r,iH);o.roll=this._map.transform.roll+n.ai(t.amount,-179,179),iG(o,t)}if(o.zoom||o.bearing){let t=void 0===i.pinchAround?i.around:i.pinchAround;o.around=t?this._map.unproject(t):this._map.getCenter()}return this.clear(),n.e(o,{noMoveStart:!0})}}function iG(t,n){(!t.duration||t.duration<n.duration)&&(t.duration=n.duration,t.easing=n.easing)}function iq(t,i,r){let{maxSpeed:o,linearity:a,deceleration:s}=r,l=n.ai(t*a/(i/1e3),-o,o),c=Math.abs(l)/(s*a);return{easing:r.easing,duration:1e3*c,amount:c/2*l}}class i$ extends n.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,r,o={}){r=r instanceof MouseEvent?r:new MouseEvent(t,r);let a=x.mousePos(i.getCanvas(),r);super(t,n.e({point:a,lngLat:i.unproject(a),originalEvent:r},o)),this._defaultPrevented=!1,this.target=i}}class iW extends n.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,r){let o="touchend"===t?r.changedTouches:r.touches,a=x.touchPos(i.getCanvasContainer(),o),s=a.map(t=>i.unproject(t)),l=a.reduce((t,n,i,r)=>t.add(n.div(r.length)),new n.P(0,0));super(t,{points:a,point:l,lngLats:s,lngLat:i.unproject(l),originalEvent:r}),this._defaultPrevented=!1}}class iZ extends n.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,i){super(t,{originalEvent:i}),this._defaultPrevented=!1}}class iX{constructor(t,n){this._map=t,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new iZ(t.type,this._map,t))}mousedown(t,n){return this._mousedownPos=n,this._firePreventable(new i$(t.type,this._map,t))}mouseup(t){this._map.fire(new i$(t.type,this._map,t))}click(t,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new i$(t.type,this._map,t))}dblclick(t){return this._firePreventable(new i$(t.type,this._map,t))}mouseover(t){this._map.fire(new i$(t.type,this._map,t))}mouseout(t){this._map.fire(new i$(t.type,this._map,t))}touchstart(t){return this._firePreventable(new iW(t.type,this._map,t))}touchmove(t){this._map.fire(new iW(t.type,this._map,t))}touchend(t){this._map.fire(new iW(t.type,this._map,t))}touchcancel(t){this._map.fire(new iW(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class iK{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new i$(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new i$("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new i$(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class iJ{constructor(t){this._map=t}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.screenPointToLocation(n.P.convert(t),this._map.terrain)}}class iQ{constructor(t,n){this._map=t,this._tr=new iJ(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=n.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,n){this.isEnabled()&&t.shiftKey&&0===t.button&&(x.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(t,n){if(!this._active||this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)return;let i=this._startPos;this._lastPos=n,this._box||(this._box=x.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));let r=Math.min(i.x,n.x),o=Math.max(i.x,n.x),a=Math.min(i.y,n.y),s=Math.max(i.y,n.y);x.setTransform(this._box,`translate(${r}px,${a}px)`),this._box.style.width=o-r+"px",this._box.style.height=s-a+"px"}mouseupWindow(t,i){if(!this._active||0!==t.button)return;let r=this._startPos;if(this.reset(),x.suppressClick(),r.x!==i.x||r.y!==i.y)return this._map.fire(new n.l("boxzoomend",{originalEvent:t})),{cameraAnimation:t=>t.fitScreenCoordinates(r,i,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(x.remove(this._box),this._box=null),x.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,i){return this._map.fire(new n.l(t,{originalEvent:i}))}}function i0(t,n){if(t.length!==n.length)throw Error(`The number of touches and points are not equal - touches ${t.length}, points ${n.length}`);let i={};for(let r=0;r<t.length;r++)i[t[r].identifier]=n[r];return i}class i1{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,i,r){(this.centroid||r.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),r.length===this.numTouches&&(this.centroid=function(t){let i=new n.P(0,0);for(let n of t)i._add(n);return i.div(t.length)}(i),this.touches=i0(r,i)))}touchmove(t,n,i){if(this.aborted||!this.centroid)return;let r=i0(i,n);for(let t in this.touches){let n=r[t];(!n||n.dist(this.touches[t])>30)&&(this.aborted=!0)}}touchend(t,n,i){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){let t=!this.aborted&&this.centroid;if(this.reset(),t)return t}}}class i2{constructor(t){this.singleTap=new i1(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,n,i){this.singleTap.touchstart(t,n,i)}touchmove(t,n,i){this.singleTap.touchmove(t,n,i)}touchend(t,n,i){let r=this.singleTap.touchend(t,n,i);if(r){let n=t.timeStamp-this.lastTime<500,i=!this.lastTap||30>this.lastTap.dist(r);if(n&&i||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}}}class i3{constructor(t){this._tr=new iJ(t),this._zoomIn=new i2({numTouches:1,numTaps:2}),this._zoomOut=new i2({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,n,i){this._zoomIn.touchstart(t,n,i),this._zoomOut.touchstart(t,n,i)}touchmove(t,n,i){this._zoomIn.touchmove(t,n,i),this._zoomOut.touchmove(t,n,i)}touchend(t,n,i){let r=this._zoomIn.touchend(t,n,i),o=this._zoomOut.touchend(t,n,i),a=this._tr;return r?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:n=>n.easeTo({duration:300,zoom:a.zoom+1,around:a.unproject(r)},{originalEvent:t})}):o?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:n=>n.easeTo({duration:300,zoom:a.zoom-1,around:a.unproject(o)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class i5{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){let n=this._moveFunction(...t);if(n.bearingDelta||n.pitchDelta||n.rollDelta||n.around||n.panDelta)return this._active=!0,n}dragStart(t,n){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=Array.isArray(n)?n[0]:n,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,n){if(!this.isEnabled())return;let i=this._lastPoint;if(!i)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);let r=Array.isArray(n)?n[0]:n;return!this._moved&&r.dist(i)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=r,this._move(i,r))}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&x.suppressClick(),this.reset(t))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}let i4={0:1,2:2};class i6{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){let n=x.mouseButton(t);this._eventButton=n}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){return!function(t,n){let i=i4[n];return void 0===t.buttons||(t.buttons&i)!==i}(t,this._eventButton)}isValidEndEvent(t){return x.mouseButton(t)===this._eventButton}}class i8{constructor(){this._firstTouch=void 0}_isOneFingerTouch(t){return 1===t.targetTouches.length}_isSameTouchEvent(t){return t.targetTouches[0].identifier===this._firstTouch}startMove(t){this._firstTouch=t.targetTouches[0].identifier}endMove(t){delete this._firstTouch}isValidStartEvent(t){return this._isOneFingerTouch(t)}isValidMoveEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}isValidEndEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}}class i7{constructor(t=new i6({checkCorrectEvent:()=>!0}),n=new i8){this.mouseMoveStateManager=t,this.oneFingerTouchMoveStateManager=n}_executeRelevantHandler(t,n,i){return t instanceof MouseEvent?n(t):"undefined"!=typeof TouchEvent&&t instanceof TouchEvent?i(t):void 0}startMove(t){this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.startMove(t),t=>this.oneFingerTouchMoveStateManager.startMove(t))}endMove(t){this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.endMove(t),t=>this.oneFingerTouchMoveStateManager.endMove(t))}isValidStartEvent(t){return this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidStartEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidStartEvent(t))}isValidMoveEvent(t){return this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidMoveEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(t))}isValidEndEvent(t){return this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidEndEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidEndEvent(t))}}let i9=t=>{t.mousedown=t.dragStart,t.mousemoveWindow=t.dragMove,t.mouseup=t.dragEnd,t.contextmenu=t=>{t.preventDefault()}};class re{constructor(t,n){this._clickTolerance=t.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new n.P(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,n,i){return this._calculateTransform(t,n,i)}touchmove(t,n,i){if(this._active){if(!this._shouldBePrevented(i.length))return t.preventDefault(),this._calculateTransform(t,n,i);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t)}}touchend(t,n,i){this._calculateTransform(t,n,i),this._active&&this._shouldBePrevented(i.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,i,r){r.length>0&&(this._active=!0);let o=i0(r,i),a=new n.P(0,0),s=new n.P(0,0),l=0;for(let t in o){let n=o[t],i=this._touches[t];i&&(a._add(n),s._add(n.sub(i)),l++,o[t]=n)}if(this._touches=o,this._shouldBePrevented(l)||!s.mag())return;let c=s.div(l);return this._sum._add(c),this._sum.mag()<this._clickTolerance?void 0:{around:a.div(l),panDelta:c}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class rt{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,n,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([n[0],n[1]]))}touchmove(t,n,i){if(!this._firstTwoTouches)return;t.preventDefault();let[r,o]=this._firstTwoTouches,a=rn(i,n,r),s=rn(i,n,o);if(!a||!s)return;let l=this._aroundCenter?null:a.add(s).div(2);return this._move([a,s],l,t)}touchend(t,n,i){if(!this._firstTwoTouches)return;let[r,o]=this._firstTwoTouches,a=rn(i,n,r),s=rn(i,n,o);a&&s||(this._active&&x.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function rn(t,n,i){for(let r=0;r<t.length;r++)if(t[r].identifier===i)return n[r]}function ri(t,n){return Math.log(t/n)/Math.LN2}class rr extends rt{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,n){let i=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(.1>Math.abs(ri(this._distance,this._startDistance))))return this._active=!0,{zoomDelta:ri(this._distance,i),pinchAround:n}}}function ro(t,n){return 180*t.angleWith(n)/Math.PI}class ra extends rt{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,n,i){let r=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ro(this._vector,r),pinchAround:n}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());let n=25/(Math.PI*this._minDiameter)*360;return Math.abs(ro(t,this._startVector))<n}}function rs(t){return Math.abs(t.y)>Math.abs(t.x)}class rl extends rt{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,n,i){super.touchstart(t,n,i),this._currentTouchCount=i.length}_start(t){this._lastPoints=t,rs(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,n,i){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let r=t[0].sub(this._lastPoints[0]),o=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(r,o,i.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:-((r.y+o.y)/2*.5)}):void 0}gestureBeginsVertically(t,n,i){if(void 0!==this._valid)return this._valid;let r=t.mag()>=2,o=n.mag()>=2;if(!r&&!o)return;if(!r||!o)return void 0===this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;let a=t.y>0==n.y>0;return rs(t)&&rs(n)&&a}}let rc=100,rd=15,ru=10;class rm{constructor(t){this._tr=new iJ(t),this._panStep=rc,this._bearingStep=rd,this._pitchStep=ru,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=0,i=0,r=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?i=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?r=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?r=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(i=0,r=0),{cameraAnimation:s=>{let l=this._tr;s.easeTo({duration:300,easeId:"keyboardHandler",easing:rh,zoom:n?Math.round(l.zoom)+n*(t.shiftKey?2:1):l.zoom,bearing:l.bearing+i*this._bearingStep,pitch:l.pitch+r*this._pitchStep,offset:[-o*this._panStep,-a*this._panStep],center:l.center},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function rh(t){return t*(2-t)}let rf=1/450;class rp{constructor(t,n){this._onTimeout=t=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},this._map=t,this._tr=new iJ(t),this._triggerRenderFrame=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=rf}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(t){return!!this._map.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this._map.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);let n=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,i=v(),r=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==n&&n%4.000244140625==0?this._type="wheel":0!==n&&4>Math.abs(n)?this._type="trackpad":r>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=200>Math.abs(r*n)?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let i=x.mousePos(this._map.getCanvas(),t),r=this._tr;this._aroundPoint=this._aroundCenter?r.transform.locationToScreenPoint(n.U.convert(r.center)):i,this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let t=this._tr.transform;if("number"==typeof this._lastExpectedZoom){let n=t.zoom-this._lastExpectedZoom;"number"==typeof this._startZoom&&(this._startZoom+=n),"number"==typeof this._targetZoom&&(this._targetZoom+=n)}if(0!==this._delta){let i="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,r=2/(1+Math.exp(-Math.abs(this._delta*i)));this._delta<0&&0!==r&&(r=1/r);let o="number"!=typeof this._targetZoom?t.scale:n.al(this._targetZoom);this._targetZoom=t.applyConstrain(t.getCameraLngLat(),n.ao(o*r)).zoom,"wheel"===this._type&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let i="number"!=typeof this._targetZoom?t.zoom:this._targetZoom,r=this._startZoom,o=this._easing,a,s=!1;if("wheel"===this._type&&r&&o){let t=Math.min((v()-this._lastWheelEventTime+5)/200,1),l=o(t);a=n.F.number(r,i,l),t<1?this._frameId||(this._frameId=!0):s=!0}else a=i,s=!0;return this._active=!0,s&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout},200)),this._lastExpectedZoom=a,{noInertia:!0,needsRenderFrame:!s,zoomDelta:a-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let i=n.cs;if(this._prevEase){let t=this._prevEase,r=(v()-t.start)/t.duration,o=t.easing(r+.01)-t.easing(r),a=.27/Math.sqrt(o*o+1e-4)*.01,s=Math.sqrt(.0729-a*a);i=n.cq(a,s,.25,1)}return this._prevEase={start:v(),duration:t,easing:i},i}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class rb{constructor(t,n){this._clickZoom=t,this._tapZoom=n}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class rg{constructor(t){this._tr=new iJ(t),this.reset()}reset(){this._active=!1}dblclick(t,n){return t.preventDefault(),{cameraAnimation:i=>{i.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(n)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class r_{constructor(){this._tap=new i2({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,n,i){if(!this._swipePoint)if(this._tapTime){let r=n[0],o=t.timeStamp-this._tapTime<500,a=30>this._tapPoint.dist(r);o&&a?i.length>0&&(this._swipePoint=r,this._swipeTouch=i[0].identifier):this.reset()}else this._tap.touchstart(t,n,i)}touchmove(t,n,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;let r=n[0],o=r.y-this._swipePoint.y;return this._swipePoint=r,t.preventDefault(),this._active=!0,{zoomDelta:o/128}}}else this._tap.touchmove(t,n,i)}touchend(t,n,i){if(this._tapTime)this._swipePoint&&0===i.length&&this.reset();else{let r=this._tap.touchend(t,n,i);r&&(this._tapTime=t.timeStamp,this._tapPoint=r)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ry{constructor(t,n,i){this._el=t,this._mousePan=n,this._touchPan=i}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class rv{constructor(t,n,i,r){this._pitchWithRotate=t.pitchWithRotate,this._rollEnabled=t.rollEnabled,this._mouseRotate=n,this._mousePitch=i,this._mouseRoll=r}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}}class rx{constructor(t,n,i,r){this._el=t,this._touchZoom=n,this._touchRotate=i,this._tapDragZoom=r,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class rw{constructor(t,n){this._bypassKey=-1!==navigator.userAgent.indexOf("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=n,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=x.create("div","maplibregl-cooperative-gesture-screen",t);let n=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(n=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let i=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),r=document.createElement("div");r.className="maplibregl-desktop-message",r.textContent=n,this._container.appendChild(r);let o=document.createElement("div");o.className="maplibregl-mobile-message",o.textContent=i,this._container.appendChild(o),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(x.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(t){return t[this._bypassKey]}notifyGestureBlocked(t,i){this._enabled&&(this._map.fire(new n.l("cooperativegestureprevented",{gestureType:t,originalEvent:i})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}let rF=t=>t.zoom||t.drag||t.roll||t.pitch||t.rotate;class rk extends n.l{}function rE(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta||t.rollDelta}class rT{constructor(t,i){this.handleWindowEvent=t=>{this.handleEvent(t,`${t.type}Window`)},this.handleEvent=(t,i)=>{if("blur"===t.type)return void this.stop(!0);this._updatingCamera=!0;let r="renderFrame"===t.type?void 0:t,o={needsRenderFrame:!1},a={},s={};for(let{handlerName:l,handler:c,allowed:d}of this._handlers){let u;if(c.isEnabled()){if(this._blockedByActive(s,d,l))c.reset();else if(c[i||t.type]){if(n.ct(t,i||t.type)){let n=x.mousePos(this._map.getCanvas(),t);u=c[i||t.type](t,n)}else if(n.cu(t,i||t.type)){let n=this._getMapTouches(t.touches),r=x.touchPos(this._map.getCanvas(),n);u=c[i||t.type](t,r,n)}else n.cv(i||t.type)||(u=c[i||t.type](t));this.mergeHandlerResult(o,a,u,l,r),u&&u.needsRenderFrame&&this._triggerRenderFrame()}(u||c.isActive())&&(s[l]=c)}}let l={};for(let t in this._previousActiveHandlers)s[t]||(l[t]=r);this._previousActiveHandlers=s,(Object.keys(l).length||rE(o))&&(this._changes.push([o,a,l]),this._triggerRenderFrame()),(Object.keys(s).length||rE(o))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:c}=o;c&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],c(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new iV(t),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(i);let r=this._el;for(let[t,n,i]of(this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[window,"blur",void 0]],this._listeners))x.addEventListener(t,n,t===document?this.handleWindowEvent:this.handleEvent,i)}destroy(){for(let[t,n,i]of this._listeners)x.removeEventListener(t,n,t===document?this.handleWindowEvent:this.handleEvent,i)}_addDefaultHandlers(t){let i=this._map,r=i.getCanvasContainer();this._add("mapEvent",new iX(i,t));let o=i.boxZoom=new iQ(i,t);this._add("boxZoom",o),t.interactive&&t.boxZoom&&o.enable();let a=i.cooperativeGestures=new rw(i,t.cooperativeGestures);this._add("cooperativeGestures",a),t.cooperativeGestures&&a.enable();let s=new i3(i),l=new rg(i);i.doubleClickZoom=new rb(l,s),this._add("tapZoom",s),this._add("clickZoom",l),t.interactive&&t.doubleClickZoom&&i.doubleClickZoom.enable();let c=new r_;this._add("tapDragZoom",c);let d=i.touchPitch=new rl(i);this._add("touchPitch",d),t.interactive&&t.touchPitch&&i.touchPitch.enable(t.touchPitch);let u=()=>i.project(i.getCenter()),m=function({enable:t,clickTolerance:i,aroundCenter:r=!0,minPixelCenterThreshold:o=100,rotateDegreesPerPixelMoved:a=.8},s){return new i5({clickTolerance:i,move:(t,i)=>{let l=s();if(r&&Math.abs(l.y-t.y)>o)return{bearingDelta:n.cr(new n.P(t.x,i.y),i,l)};let c=(i.x-t.x)*a;return r&&i.y<l.y&&(c=-c),{bearingDelta:c}},moveStateManager:new i6({checkCorrectEvent:t=>0===x.mouseButton(t)&&t.ctrlKey||2===x.mouseButton(t)&&!t.ctrlKey}),enable:t,assignEvents:i9})}(t,u),h=function({enable:t,clickTolerance:n,pitchDegreesPerPixelMoved:i=-.5}){return new i5({clickTolerance:n,move:(t,n)=>({pitchDelta:(n.y-t.y)*i}),moveStateManager:new i6({checkCorrectEvent:t=>0===x.mouseButton(t)&&t.ctrlKey||2===x.mouseButton(t)}),enable:t,assignEvents:i9})}(t),f=function({enable:t,clickTolerance:n,rollDegreesPerPixelMoved:i=.3},r){return new i5({clickTolerance:n,move:(t,n)=>{let o=r(),a=(n.x-t.x)*i;return n.y<o.y&&(a=-a),{rollDelta:a}},moveStateManager:new i6({checkCorrectEvent:t=>2===x.mouseButton(t)&&t.ctrlKey}),enable:t,assignEvents:i9})}(t,u);i.dragRotate=new rv(t,m,h,f),this._add("mouseRotate",m,["mousePitch"]),this._add("mousePitch",h,["mouseRotate","mouseRoll"]),this._add("mouseRoll",f,["mousePitch"]),t.interactive&&t.dragRotate&&i.dragRotate.enable();let p=function({enable:t,clickTolerance:n}){return new i5({clickTolerance:n,move:(t,n)=>({around:n,panDelta:n.sub(t)}),activateOnStart:!0,moveStateManager:new i6({checkCorrectEvent:t=>0===x.mouseButton(t)&&!t.ctrlKey}),enable:t,assignEvents:i9})}(t),b=new re(t,i);i.dragPan=new ry(r,p,b),this._add("mousePan",p),this._add("touchPan",b,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&i.dragPan.enable(t.dragPan);let g=new ra,_=new rr;i.touchZoomRotate=new rx(r,_,g,c),this._add("touchRotate",g,["touchPan","touchZoom"]),this._add("touchZoom",_,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&i.touchZoomRotate.enable(t.touchZoomRotate),this._add("blockableMapEvent",new iK(i));let y=i.scrollZoom=new rp(i,()=>this._triggerRenderFrame());this._add("scrollZoom",y,["mousePan"]),t.interactive&&t.scrollZoom&&i.scrollZoom.enable(t.scrollZoom);let v=i.keyboard=new rm(i);this._add("keyboard",v),t.interactive&&t.keyboard&&i.keyboard.enable()}_add(t,n,i){this._handlers.push({handlerName:t,handler:n,allowed:i}),this._handlersById[t]=n}stop(t){if(!this._updatingCamera){for(let{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(let{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!rF(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,n,i){for(let r in t)if(r!==i&&(!n||0>n.indexOf(r)))return!0;return!1}_getMapTouches(t){let n=[];for(let i of t)this._el.contains(i.target)&&n.push(i);return n}mergeHandlerResult(t,i,r,o,a){if(!r)return;n.e(t,r);let s={handlerName:o,originalEvent:r.originalEvent||a};void 0!==r.zoomDelta&&(i.zoom=s),void 0!==r.panDelta&&(i.drag=s),void 0!==r.rollDelta&&(i.roll=s),void 0!==r.pitchDelta&&(i.pitch=s),void 0!==r.bearingDelta&&(i.rotate=s)}_applyChanges(){let t={},i={},r={};for(let[o,a,s]of this._changes)o.panDelta&&(t.panDelta=(t.panDelta||new n.P(0,0))._add(o.panDelta)),o.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+o.zoomDelta),o.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+o.bearingDelta),o.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+o.pitchDelta),o.rollDelta&&(t.rollDelta=(t.rollDelta||0)+o.rollDelta),void 0!==o.around&&(t.around=o.around),void 0!==o.pinchAround&&(t.pinchAround=o.pinchAround),o.noInertia&&(t.noInertia=o.noInertia),n.e(i,a),n.e(r,s);this._updateMapTransform(t,i,r),this._changes=[]}_updateMapTransform(t,n,i){let r=this._map,o=r._getTransformForUpdate(),a=r.terrain;if(!(rE(t)||a&&this._terrainMovement))return this._fireEvents(n,i,!0);r._stop(!0);let{panDelta:s,zoomDelta:l,bearingDelta:c,pitchDelta:d,rollDelta:u,around:m,pinchAround:h}=t;void 0!==h&&(m=h),m=m||r.transform.centerPoint,a&&!o.isPointOnMapSurface(m)&&(m=o.centerPoint);let f={panDelta:s,zoomDelta:l,rollDelta:u,pitchDelta:d,bearingDelta:c,around:m};this._map.cameraHelper.useGlobeControls&&!o.isPointOnMapSurface(m)&&(m=o.centerPoint);let p=.01>m.distSqr(o.centerPoint)?o.center:o.screenPointToLocation(s?m.sub(s):m);this._handleMapControls({terrain:a,tr:o,deltasForHelper:f,preZoomAroundLoc:p,combinedEventsInProgress:n,panDelta:s}),r._applyUpdatedTransform(o),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,i,!0)}_handleMapControls({terrain:t,tr:n,deltasForHelper:i,preZoomAroundLoc:r,combinedEventsInProgress:o,panDelta:a}){let s=this._map.cameraHelper;if(s.handleMapControlsRollPitchBearingZoom(i,n),t)return s.useGlobeControls?(!this._terrainMovement&&(o.drag||o.zoom)&&(this._terrainMovement=!0,this._map._elevationFreeze=!0),void s.handleMapControlsPan(i,n,r)):!this._terrainMovement&&(o.drag||o.zoom)?(this._terrainMovement=!0,this._map._elevationFreeze=!0,void s.handleMapControlsPan(i,n,r)):void(o.drag&&this._terrainMovement&&a?n.setCenter(n.screenPointToLocation(n.centerPoint.sub(a))):s.handleMapControlsPan(i,n,r));s.handleMapControlsPan(i,n,r)}_fireEvents(t,i,r){let o,a=rF(this._eventsInProgress),s=rF(t),l={};for(let n in t){let{originalEvent:i}=t[n];this._eventsInProgress[n]||(l[`${n}start`]=i),this._eventsInProgress[n]=t[n]}for(let t in!a&&s&&this._fireEvent("movestart",s.originalEvent),l)this._fireEvent(t,l[t]);for(let n in s&&this._fireEvent("move",s.originalEvent),t){let{originalEvent:i}=t[n];this._fireEvent(n,i)}let c={};for(let t in this._eventsInProgress){let{handlerName:n,originalEvent:r}=this._eventsInProgress[t];this._handlersById[n].isActive()||(delete this._eventsInProgress[t],o=i[n]||r,c[`${t}end`]=o)}for(let t in c)this._fireEvent(t,c[t]);let d=rF(this._eventsInProgress),u=(a||s)&&!d;if(u&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let t=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&t.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(t)}if(r&&u){this._updatingCamera=!0;let t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),i=t=>0!==t&&-this._bearingSnap<t&&t<this._bearingSnap;t&&(t.essential||!_.prefersReducedMotion)?(i(t.bearing||this._map.getBearing())&&(t.bearing=0),t.freezeElevation=!0,this._map.easeTo(t,{originalEvent:o})):(this._map.fire(new n.l("moveend",{originalEvent:o})),i(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(t,i){this._map.fire(new n.l(t,i?{originalEvent:i}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(t=>{delete this._frameId,this.handleEvent(new rk("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class rA extends n.E{constructor(t,n,i){super(),this._renderFrameCallback=()=>{let t=Math.min((v()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=i.bearingSnap,this.cameraHelper=n,this.on("moveend",()=>{delete this._requestedCameraState})}migrateProjection(t,n){t.apply(this.transform),this.transform=t,this.cameraHelper=n}getCenter(){return new n.U(this.transform.center.lng,this.transform.center.lat)}setCenter(t,n){return this.jumpTo({center:t},n)}getCenterElevation(){return this.transform.elevation}setCenterElevation(t,n){return this.jumpTo({elevation:t},n),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(t){this._centerClampedToGround=t}panBy(t,i,r){return t=n.P.convert(t).mult(-1),this.panTo(this.transform.center,n.e({offset:t},i),r)}panTo(t,i,r){return this.easeTo(n.e({center:t},i),r)}getZoom(){return this.transform.zoom}setZoom(t,n){return this.jumpTo({zoom:t},n),this}zoomTo(t,i,r){return this.easeTo(n.e({zoom:t},i),r)}zoomIn(t,n){return this.zoomTo(this.getZoom()+1,t,n),this}zoomOut(t,n){return this.zoomTo(this.getZoom()-1,t,n),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(t,i){return t!=this.transform.fov&&(this.transform.setFov(t),this.fire(new n.l("movestart",i)).fire(new n.l("move",i)).fire(new n.l("moveend",i))),this}getBearing(){return this.transform.bearing}setBearing(t,n){return this.jumpTo({bearing:t},n),this}getPadding(){return this.transform.padding}setPadding(t,n){return this.jumpTo({padding:t},n),this}rotateTo(t,i,r){return this.easeTo(n.e({bearing:t},i),r)}resetNorth(t,i){return this.rotateTo(0,n.e({duration:1e3},t),i),this}resetNorthPitch(t,i){return this.easeTo(n.e({bearing:0,pitch:0,roll:0,duration:1e3},t),i),this}snapToNorth(t,n){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,n):this}getPitch(){return this.transform.pitch}setPitch(t,n){return this.jumpTo({pitch:t},n),this}getRoll(){return this.transform.roll}setRoll(t,n){return this.jumpTo({roll:t},n),this}cameraForBounds(t,n){t=K.convert(t).adjustAntiMeridian();let i=n&&n.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),i,n)}_cameraForBoxAndBearing(t,i,r,o){let a={top:0,bottom:0,right:0,left:0};if("number"==typeof(o=n.e({padding:a,offset:[0,0],maxZoom:this.transform.maxZoom},o)).padding){let t=o.padding;o.padding={top:t,bottom:t,right:t,left:t}}let s=n.e(a,o.padding);o.padding=s;let l=this.transform,c=new K(t,i);return this.cameraHelper.cameraForBoxAndBearing(o,s,c,r,l)}fitBounds(t,n,i){return this._fitInternal(this.cameraForBounds(t,n),n,i)}fitScreenCoordinates(t,i,r,o,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(n.P.convert(t)),this.transform.screenPointToLocation(n.P.convert(i)),r,o),o,a)}_fitInternal(t,i,r){return t?(delete(i=n.e(t,i)).padding,i.linear?this.easeTo(i,r):this.flyTo(i,r)):this}jumpTo(t,i){this.stop();let r=this._getTransformForUpdate(),o=!1,a=!1,s=!1,l=r.zoom;this.cameraHelper.handleJumpToCenterZoom(r,t);let c=r.zoom!==l;return"elevation"in t&&r.elevation!==+t.elevation&&r.setElevation(+t.elevation),"bearing"in t&&r.bearing!==+t.bearing&&(o=!0,r.setBearing(+t.bearing)),"pitch"in t&&r.pitch!==+t.pitch&&(a=!0,r.setPitch(+t.pitch)),"roll"in t&&r.roll!==+t.roll&&(s=!0,r.setRoll(+t.roll)),null==t.padding||r.isPaddingEqual(t.padding)||r.setPadding(t.padding),this._applyUpdatedTransform(r),this.fire(new n.l("movestart",i)).fire(new n.l("move",i)),c&&this.fire(new n.l("zoomstart",i)).fire(new n.l("zoom",i)).fire(new n.l("zoomend",i)),o&&this.fire(new n.l("rotatestart",i)).fire(new n.l("rotate",i)).fire(new n.l("rotateend",i)),a&&this.fire(new n.l("pitchstart",i)).fire(new n.l("pitch",i)).fire(new n.l("pitchend",i)),s&&this.fire(new n.l("rollstart",i)).fire(new n.l("roll",i)).fire(new n.l("rollend",i)),this.fire(new n.l("moveend",i))}calculateCameraOptionsFromTo(t,i,r,o=0){let a=n.a5.fromLngLat(t,i),s=n.a5.fromLngLat(r,o),l=s.x-a.x,c=s.y-a.y,d=s.z-a.z,u=Math.hypot(l,c,d);if(0===u)throw Error("Can't calculate camera options with same From and To");let m=Math.hypot(l,c),h=n.ao(this.transform.cameraToCenterDistance/u/this.transform.tileSize),f=180*Math.atan2(l,-c)/Math.PI,p=180*Math.acos(m/u)/Math.PI;return p=d<0?90-p:90+p,{center:s.toLngLat(),elevation:o,zoom:h,pitch:p,bearing:f}}calculateCameraOptionsFromCameraLngLatAltRotation(t,n,i,r,o){let a=this.transform.calculateCenterFromCameraLngLatAlt(t,n,i,r);return{center:a.center,elevation:a.elevation,zoom:a.zoom,bearing:i,pitch:r,roll:o}}easeTo(t,i){let r,o;this._stop(!1,t.easeId),(!1===(t=n.e({offset:[0,0],duration:500,easing:n.cs},t)).animate||!t.essential&&_.prefersReducedMotion)&&(t.duration=0);let a=this._getTransformForUpdate(),s=this.getBearing(),l=a.pitch,c=a.roll,d="bearing"in t?this._normalizeBearing(t.bearing,s):s,u="pitch"in t?+t.pitch:l,m="roll"in t?this._normalizeBearing(t.roll,c):c,h="padding"in t?t.padding:a.padding,f=n.P.convert(t.offset);t.around&&(r=n.U.convert(t.around),o=a.locationToScreenPoint(r));let p={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},b=this.cameraHelper.handleEaseTo(a,{bearing:d,pitch:u,roll:m,padding:h,around:r,aroundPoint:o,offsetAsPoint:f,offset:t.offset,zoom:t.zoom,center:t.center});return this._rotating=this._rotating||s!==d,this._pitching=this._pitching||u!==l,this._rolling=this._rolling||m!==c,this._padding=!a.isPaddingEqual(h),this._zooming=this._zooming||b.isZooming,this._easeId=t.easeId,this._prepareEase(i,t.noMoveStart,p),this.terrain&&this._prepareElevation(b.elevationCenter),this._ease(n=>{b.easeFunc(n),this.terrain&&!t.freezeElevation&&this._updateElevation(n),this._applyUpdatedTransform(a),this._fireMoveEvents(i)},n=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(i,n)},t),this}_prepareEase(t,i,r={}){this._moving=!0,i||r.moving||this.fire(new n.l("movestart",t)),this._zooming&&!r.zooming&&this.fire(new n.l("zoomstart",t)),this._rotating&&!r.rotating&&this.fire(new n.l("rotatestart",t)),this._pitching&&!r.pitching&&this.fire(new n.l("pitchstart",t)),this._rolling&&!r.rolling&&this.fire(new n.l("rollstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){void 0!==this._elevationStart&&void 0!==this._elevationCenter||this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));let i=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&i!==this._elevationTarget){let n=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(n-(i-(n*t+this._elevationStart))/(1-t)),this._elevationTarget=i}this.transform.setElevation(n.F.number(this._elevationStart,this._elevationTarget,t))}_finalizeElevation(){this._elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(t){if(!this.terrain&&t.elevation>=0&&t.pitch<=90)return{};let n=t.getCameraLngLat(),i=t.getCameraAltitude(),r=this.terrain?this.terrain.getElevationForLngLatZoom(n,t.zoom):0;if(i<r){let i=this.calculateCameraOptionsFromTo(n,r,t.center,t.elevation);return{pitch:i.pitch,zoom:i.zoom}}return{}}_applyUpdatedTransform(t){let n=[];if(n.push(t=>this._elevateCameraIfInsideTerrain(t)),this.transformCameraUpdate&&n.push(t=>this.transformCameraUpdate(t)),!n.length)return;let i=t.clone();for(let t of n){let n=i.clone(),{center:r,zoom:o,roll:a,pitch:s,bearing:l,elevation:c}=t(n);r&&n.setCenter(r),void 0!==c&&n.setElevation(c),void 0!==o&&n.setZoom(o),void 0!==a&&n.setRoll(a),void 0!==s&&n.setPitch(s),void 0!==l&&n.setBearing(l),i.apply(n)}this.transform.apply(i)}_fireMoveEvents(t){this.fire(new n.l("move",t)),this._zooming&&this.fire(new n.l("zoom",t)),this._rotating&&this.fire(new n.l("rotate",t)),this._pitching&&this.fire(new n.l("pitch",t)),this._rolling&&this.fire(new n.l("roll",t))}_afterEase(t,i){if(this._easeId&&i&&this._easeId===i)return;delete this._easeId;let r=this._zooming,o=this._rotating,a=this._pitching,s=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,r&&this.fire(new n.l("zoomend",t)),o&&this.fire(new n.l("rotateend",t)),a&&this.fire(new n.l("pitchend",t)),s&&this.fire(new n.l("rollend",t)),this.fire(new n.l("moveend",t))}flyTo(t,i){if(!t.essential&&_.prefersReducedMotion){let r=n.S(t,["center","zoom","bearing","pitch","roll","elevation","padding"]);return this.jumpTo(r,i)}this.stop(),t=n.e({offset:[0,0],speed:1.2,curve:1.42,easing:n.cs},t);let r=this._getTransformForUpdate(),o=r.bearing,a=r.pitch,s=r.roll,l=r.padding,c="bearing"in t?this._normalizeBearing(t.bearing,o):o,d="pitch"in t?+t.pitch:a,u="roll"in t?this._normalizeBearing(t.roll,s):s,m="padding"in t?t.padding:r.padding,h=n.P.convert(t.offset),f=r.centerPoint.add(h),p=r.screenPointToLocation(f),b=this.cameraHelper.handleFlyTo(r,{bearing:c,pitch:d,roll:u,padding:m,locationAtOffset:p,offsetAsPoint:h,center:t.center,minZoom:t.minZoom,zoom:t.zoom}),g=t.curve,y=Math.max(r.width,r.height),v=y/b.scaleOfZoom,x=b.pixelPathLength;"number"==typeof b.scaleOfMinZoom&&(g=Math.sqrt(y/b.scaleOfMinZoom/x*2));let w=g*g;function F(t){let n=(v*v-y*y+(t?-1:1)*w*w*x*x)/(2*(t?v:y)*w*x);return Math.log(Math.sqrt(n*n+1)-n)}function k(t){return(Math.exp(t)-Math.exp(-t))/2}function E(t){return(Math.exp(t)+Math.exp(-t))/2}let T=F(!1),A=function(t){return E(T)/E(T+g*t)},M=function(t){var n;return y*((E(T)*(k(n=T+g*t)/E(n))-k(T))/w)/x},C=(F(!0)-T)/g;if(2e-6>Math.abs(x)||!isFinite(C)){if(1e-6>Math.abs(y-v))return this.easeTo(t,i);let n=v<y?-1:1;C=Math.abs(Math.log(v/y))/g,M=()=>0,A=t=>Math.exp(n*g*t)}return t.duration="duration"in t?+t.duration:1e3*C/("screenSpeed"in t?t.screenSpeed/g:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=o!==c,this._pitching=d!==a,this._rolling=u!==s,this._padding=!r.isPaddingEqual(m),this._prepareEase(i,!1),this.terrain&&this._prepareElevation(b.targetCenter),this._ease(p=>{let g=p*C,_=1/A(g),y=M(g);this._rotating&&r.setBearing(n.F.number(o,c,p)),this._pitching&&r.setPitch(n.F.number(a,d,p)),this._rolling&&r.setRoll(n.F.number(s,u,p)),this._padding&&(r.interpolatePadding(l,m,p),f=r.centerPoint.add(h)),b.easeFunc(p,_,y,f),this.terrain&&!t.freezeElevation&&this._updateElevation(p),this._applyUpdatedTransform(r),this._fireMoveEvents(i)},()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(i)},t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,n){var i;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let t=this._onEaseEnd;delete this._onEaseEnd,t.call(this,n)}return t||null==(i=this.handlers)||i.stop(!1),this}_ease(t,n,i){!1===i.animate||0===i.duration?(t(1),n()):(this._easeStart=v(),this._easeOptions=i,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,i){let r=Math.abs((t=n.V(t,-180,180))-i);return Math.abs(t-360-i)<r&&(t-=360),Math.abs(t+360-i)<r&&(t+=360),t}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(n.U.convert(t),this.transform.tileZoom):null}}let rM={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class rC{constructor(t=rM){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=t=>{t&&("metadata"===t.sourceDataType||"visibility"===t.sourceDataType||"style"===t.dataType||"terrain"===t.type)&&this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=x.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=x.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=x.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){x.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,n){let i=this._map._getUIString(`AttributionControl.${n}`);t.title=i,t.setAttribute("aria-label",i)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(t=>"string"!=typeof t?"":t)):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){let t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}let n=this._map.style.tileManagers;for(let i in n){let r=n[i];if(r.used||r.usedForTerrain){let n=r.getSource();n.attribution&&0>t.indexOf(n.attribution)&&t.push(n.attribution)}}(t=t.filter(t=>String(t).trim())).sort((t,n)=>t.length-n.length);let i=(t=t.filter((n,i)=>{for(let r=i+1;r<t.length;r++)if(t[r].indexOf(n)>=0)return!1;return!0})).join(" | ");i!==this._attribHTML&&(this._attribHTML=i,t.length?(this._innerContainer.innerHTML=x.sanitize(i),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class rS{constructor(t={}){this._updateCompact=()=>{let t=this._container.children;if(t.length){let n=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&n.classList.add("maplibregl-compact"):n.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=x.create("div","maplibregl-ctrl");let n=x.create("a","maplibregl-ctrl-logo");return n.target="_blank",n.rel="noopener nofollow",n.href="https://maplibre.org/",n.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),n.setAttribute("rel","noopener nofollow"),this._container.appendChild(n),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){x.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class rL{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){let n=++this._id;return this._queue.push({callback:t,id:n,cancelled:!1}),n}remove(t){let n=this._currentlyRunning;for(let i of n?this._queue.concat(n):this._queue)if(i.id===t)return void(i.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw Error("Attempting to run(), but is already running.");let n=this._currentlyRunning=this._queue;for(let i of(this._queue=[],n))if(!i.cancelled&&(i.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var rD=n.aO([{name:"a_pos3d",type:"Int16",components:3}]);class rI extends n.E{constructor(t){super(),this._lastTilesetChange=v(),this.tileManager=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=t._source.tileSize*2**this.deltaZoom,t.usedForTerrain=!0,t.tileSize=this.tileSize}destruct(){this.tileManager.usedForTerrain=!1,this.tileManager.tileSize=null}getSource(){return this.tileManager._source}update(t,i){this.tileManager.update(t,i),this._renderableTilesKeys=[];let r={};for(let o of eE(t,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:i,calculateTileZoom:this.tileManager._source.calculateTileZoom}))r[o.key]=!0,this._renderableTilesKeys.push(o.key),this._tiles[o.key]||(o.terrainRttPosMatrix32f=new Float64Array(16),n.c1(o.terrainRttPosMatrix32f,0,n.a3,n.a3,0,0,1),this._tiles[o.key]=new ef(o,this.tileSize),this._lastTilesetChange=v());for(let t in this._tiles)r[t]||delete this._tiles[t]}freeRtt(t){for(let n in this._tiles){let i=this._tiles[n];(!t||i.tileID.equals(t)||i.tileID.isChildOf(t)||t.isChildOf(i.tileID))&&(i.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t,n){return n?this._getTerrainCoordsForTileRanges(t,n):this._getTerrainCoordsForRegularTile(t)}_getTerrainCoordsForRegularTile(t){let i={};for(let r of this._renderableTilesKeys){let o=this._tiles[r].tileID,a=t.clone(),s=n.be();if(o.canonical.equals(t.canonical))n.c1(s,0,n.a3,n.a3,0,0,1);else if(o.canonical.isChildOf(t.canonical)){let i=o.canonical.z-t.canonical.z,r=o.canonical.x-(o.canonical.x>>i<<i),a=o.canonical.y-(o.canonical.y>>i<<i),l=n.a3>>i;n.c1(s,0,l,l,0,0,1),n.N(s,s,[-r*l,-a*l,0])}else{if(!t.canonical.isChildOf(o.canonical))continue;{let i=t.canonical.z-o.canonical.z,r=t.canonical.x-(t.canonical.x>>i<<i),a=t.canonical.y-(t.canonical.y>>i<<i),l=n.a3>>i;n.c1(s,0,n.a3,n.a3,0,0,1),n.N(s,s,[r*l,a*l,0]),n.O(s,s,[1/2**i,1/2**i,0])}}a.terrainRttPosMatrix32f=new Float32Array(s),i[r]=a}return i}_getTerrainCoordsForTileRanges(t,i){let r={};for(let o of this._renderableTilesKeys){let a=this._tiles[o].tileID;if(!this._isWithinTileRanges(a,i))continue;let s=t.clone(),l=n.be();if(a.canonical.z===t.canonical.z){let i=t.canonical.x-a.canonical.x,r=t.canonical.y-a.canonical.y;n.c1(l,0,n.a3,n.a3,0,0,1),n.N(l,l,[i*n.a3,r*n.a3,0])}else if(a.canonical.z>t.canonical.z){let i=a.canonical.z-t.canonical.z,r=a.canonical.x-(a.canonical.x>>i<<i),o=a.canonical.y-(a.canonical.y>>i<<i),s=t.canonical.x-(a.canonical.x>>i),c=t.canonical.y-(a.canonical.y>>i),d=n.a3>>i;n.c1(l,0,d,d,0,0,1),n.N(l,l,[-r*d+s*n.a3,-o*d+c*n.a3,0])}else{let i=t.canonical.z-a.canonical.z,r=t.canonical.x-(t.canonical.x>>i<<i),o=t.canonical.y-(t.canonical.y>>i<<i),s=(t.canonical.x>>i)-a.canonical.x,c=(t.canonical.y>>i)-a.canonical.y,d=n.a3<<i;n.c1(l,0,d,d,0,0,1),n.N(l,l,[r*n.a3+s*d,o*n.a3+c*d,0])}s.terrainRttPosMatrix32f=new Float32Array(l),r[o]=s}return r}getSourceTile(t,n){let i=this.tileManager._source,r=t.overscaledZ-this.deltaZoom;if(r>i.maxzoom&&(r=i.maxzoom),r<i.minzoom)return null;this._sourceTileCache[t.key]||(this._sourceTileCache[t.key]=t.scaledTo(r).key);let o=this.tileManager.getTileByID(this._sourceTileCache[t.key]);if((!o||!o.dem)&&n)for(;r>=i.minzoom&&(!o||!o.dem);)o=this.tileManager.getTileByID(t.scaledTo(r--).key);return o}anyTilesAfterTime(t=Date.now()){return this._lastTilesetChange>=t}_isWithinTileRanges(t,n){return n[t.canonical.z]&&t.canonical.x>=n[t.canonical.z].minTileX&&t.canonical.x<=n[t.canonical.z].maxTileX&&t.canonical.y>=n[t.canonical.z].minTileY&&t.canonical.y<=n[t.canonical.z].maxTileY}}class rP{constructor(t,n,i){this._meshCache={},this.painter=t,this.tileManager=new rI(n),this.options=i,this.exaggeration="number"==typeof i.exaggeration?i.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,i,r,o=n.a3){var a;if(!(i>=0&&i<o&&r>=0&&r<o))return 0;let s=this.getTerrainData(t),l=null==(a=s.tile)?void 0:a.dem;if(!l)return 0;let c=n.cw([],[i/o*n.a3,r/o*n.a3],s.u_terrain_matrix),d=[c[0]*l.dim,c[1]*l.dim],u=Math.floor(d[0]),m=Math.floor(d[1]),h=d[0]-u,f=d[1]-m;return l.get(u,m)*(1-h)*(1-f)+l.get(u+1,m)*h*(1-f)+l.get(u,m+1)*(1-h)*f+l.get(u+1,m+1)*h*f}getElevationForLngLatZoom(t,i){if(!n.cx(i,t.wrap()))return 0;let{tileID:r,mercatorX:o,mercatorY:a}=this._getOverscaledTileIDFromLngLatZoom(t,i);return this.getElevation(r,o%n.a3,a%n.a3,n.a3)}getElevation(t,i,r,o=n.a3){return this.getDEMElevation(t,i,r,o)*this.exaggeration}getTerrainData(t){if(!this._emptyDemTexture){let t=this.painter.context,i=new n.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new n.T(t,i,t.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new n.T(t,new n.R({width:1,height:1}),t.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=n.am([])}let i=this.tileManager.getSourceTile(t,!0);if(i&&i.dem&&(!i.demTexture||i.needsTerrainPrepare)){let t=this.painter.context;i.demTexture=this.painter.getTileTexture(i.dem.stride),i.demTexture?i.demTexture.update(i.dem.getPixels(),{premultiply:!1}):i.demTexture=new n.T(t,i.dem.getPixels(),t.gl.RGBA,{premultiply:!1}),i.demTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),i.needsTerrainPrepare=!1}let r=i&&i+i.tileID.key+t.key;if(r&&!this._demMatrixCache[r]){let r=this.tileManager.getSource().maxzoom,o=t.canonical.z-i.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=r?o=t.canonical.z-r:n.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let a=t.canonical.x-(t.canonical.x>>o<<o),s=t.canonical.y-(t.canonical.y>>o<<o),l=n.cy(new Float64Array(16),[1/(n.a3<<o),1/(n.a3<<o),0]);n.N(l,l,[a*n.a3,s*n.a3,0]),this._demMatrixCache[t.key]={matrix:l,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:i&&i.dem&&i.dem.dim||1,u_terrain_matrix:r?this._demMatrixCache[t.key].matrix:this._emptyDemMatrix,u_terrain_unpack:i&&i.dem&&i.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(i&&i.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:i}}getFramebuffer(t){let i=this.painter,r=i.width/devicePixelRatio,o=i.height/devicePixelRatio;return this._fbo&&(this._fbo.width!==r||this._fbo.height!==o)&&(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new n.T(i.context,{width:r,height:o,data:null},i.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(i.context.gl.NEAREST,i.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new n.T(i.context,{width:r,height:o,data:null},i.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(i.context.gl.NEAREST,i.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=i.context.createFramebuffer(r,o,!0,!1),this._fbo.depthAttachment.set(i.context.createRenderbuffer(i.context.gl.DEPTH_COMPONENT16,r,o))),this._fbo.colorAttachment.set("coords"===t?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let t=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let i=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let t=0,n=0;t<this._coordsTextureSize;t++)for(let r=0;r<this._coordsTextureSize;r++,n+=4)i[n+0]=255&r,i[n+1]=255&t,i[n+2]=r>>8<<4|t>>8,i[n+3]=0;let r=new n.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(i.buffer)),o=new n.T(t,r,t.gl.RGBA,{premultiply:!1});return o.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=o,o}pointCoordinate(t){this.painter.maybeDrawDepthAndCoords(!0);let i=new Uint8Array(4),r=this.painter.context,o=r.gl,a=Math.round(t.x*this.painter.pixelRatio/devicePixelRatio),s=Math.round(t.y*this.painter.pixelRatio/devicePixelRatio),l=Math.round(this.painter.height/devicePixelRatio);r.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),o.readPixels(a,l-s-1,1,1,o.RGBA,o.UNSIGNED_BYTE,i),r.bindFramebuffer.set(null);let c=i[0]+(i[2]>>4<<8),d=i[1]+((15&i[2])<<8),u=this.coordsIndex[255-i[3]],m=u&&this.tileManager.getTileByID(u);if(!m)return null;let h=this._coordsTextureSize,f=(1<<m.tileID.canonical.z)*h;return new n.a5((m.tileID.canonical.x*h+c)/f+m.tileID.wrap,(m.tileID.canonical.y*h+d)/f,this.getElevation(m.tileID,c,d,h))}depthAtPoint(t){let n=new Uint8Array(4),i=this.painter.context,r=i.gl;return i.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),r.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,r.RGBA,r.UNSIGNED_BYTE,n),i.bindFramebuffer.set(null),(n[0]/0x1000000+n[1]/65536+n[2]/256+n[3])/256}getTerrainMesh(t){var i;let r=(null==(i=this.painter.style.projection)?void 0:i.transitionState)>0,o=r&&0===t.canonical.y,a=r&&t.canonical.y===(1<<t.canonical.z)-1,s=`m_${o?"n":""}_${a?"s":""}`;if(this._meshCache[s])return this._meshCache[s];let l=this.painter.context,c=new n.cz,d=new n.aS,u=this.meshSize,m=n.a3/u,h=u*u;for(let t=0;t<=u;t++)for(let n=0;n<=u;n++)c.emplaceBack(n*m,t*m,0);for(let t=0;t<h;t+=u+1)for(let n=0;n<u;n++)d.emplaceBack(n+t,u+n+t+1,u+n+t+2),d.emplaceBack(n+t,u+n+t+2,n+t+1);let f=c.length,p=f+(u+1),b=(u+1)*u,g=o?n.bl:0,_=+!o,y=a?n.bm:n.a3,v=+!a;for(let t=0;t<=u;t++)c.emplaceBack(t*m,g,_);for(let t=0;t<=u;t++)c.emplaceBack(t*m,y,v);for(let t=0;t<u;t++)d.emplaceBack(b+t,p+t,p+t+1),d.emplaceBack(b+t,p+t+1,b+t+1),d.emplaceBack(0+t,f+t+1,f+t),d.emplaceBack(0+t,0+t+1,f+t+1);let x=c.length,w=x+2*(u+1);for(let t of[0,1])for(let i=0;i<=u;i++)for(let r of[0,1])c.emplaceBack(t*n.a3,i*m,r);for(let t=0;t<2*u;t+=2)d.emplaceBack(x+t,x+t+1,x+t+3),d.emplaceBack(x+t,x+t+3,x+t+2),d.emplaceBack(w+t,w+t+3,w+t+1),d.emplaceBack(w+t,w+t+2,w+t+3);let F=new ta(l.createVertexBuffer(c,rD.members),l.createIndexBuffer(d),n.aR.simpleSegment(0,0,c.length,d.length));return this._meshCache[s]=F,F}getMeshFrameDelta(t){return 2*Math.PI*n.by/Math.pow(2,Math.max(t,0))/5}getMinTileElevationForLngLatZoom(t,n){var i;let{tileID:r}=this._getOverscaledTileIDFromLngLatZoom(t,n);return null!=(i=this.getMinMaxElevation(r).minElevation)?i:0}getMinMaxElevation(t){let n=this.getTerrainData(t).tile,i={minElevation:null,maxElevation:null};return n&&n.dem&&(i.minElevation=n.dem.min*this.exaggeration,i.maxElevation=n.dem.max*this.exaggeration),i}_getOverscaledTileIDFromLngLatZoom(t,i){let r=n.a5.fromLngLat(t.wrap()),o=(1<<i)*n.a3,a=r.x*o,s=r.y*o,l=Math.floor(a/n.a3),c=Math.floor(s/n.a3);return{tileID:new n.a0(i,0,i,l,c),mercatorX:a,mercatorY:s}}}class rR{constructor(t,n,i){this._context=t,this._size=n,this._tileSize=i,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(let t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){let i=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),r=new n.T(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return r.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),this._context.extTextureFilterAnisotropic&&this._context.gl.texParameterf(this._context.gl.TEXTURE_2D,this._context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this._context.extTextureFilterAnisotropicMax),i.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),i.colorAttachment.set(r.texture),{id:t,fbo:i,texture:r,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(n=>t.id!==n),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(let t of this._recentlyUsed)if(!this._objects[t].inUse)return this._objects[t];if(this._objects.length>=this._size)throw Error("No free RenderPool available, call freeAllObjects() required!");let t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(let t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length<this._size)&&!1===this._objects.some(t=>!t.inUse)}}let rO={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};class rB{constructor(t,n){this.painter=t,this.terrain=n,this.pool=new rR(t.context,30,n.tileManager.tileSize*n.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,n){for(let i in this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=t._order.filter(i=>!t._layers[i].isHidden(n)),this._coordsAscending={},t.tileManagers){this._coordsAscending[i]={};let n=t.tileManagers[i].getVisibleCoordinates(),r=t.tileManagers[i].getSource(),o=r instanceof eo?r.terrainTileRanges:null;for(let t of n){let n=this.terrain.tileManager.getTerrainCoords(t,o);for(let t in n)this._coordsAscending[i][t]||(this._coordsAscending[i][t]=[]),this._coordsAscending[i][t].push(n[t])}}for(let n of(this._coordsAscendingStr={},t._order)){let i=t._layers[n],r=i.source;if(rO[i.type]&&!this._coordsAscendingStr[r])for(let t in this._coordsAscendingStr[r]={},this._coordsAscending[r])this._coordsAscendingStr[r][t]=this._coordsAscending[r][t].map(t=>t.key).sort().join()}for(let t of this._renderableTiles)for(let n in this._coordsAscendingStr){let i=this._coordsAscendingStr[n][t.tileID.key];i&&i!==t.rttCoords[n]&&(t.rtt=[])}}renderLayer(t,i){if(t.isHidden(this.painter.transform.zoom))return!1;let r=Object.assign(Object.assign({},i),{isRenderingToTexture:!0}),o=t.type,a=this.painter,s=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(rO[o]&&(this._prevType&&rO[this._prevType]||this._stacks.push([]),this._prevType=o,this._stacks[this._stacks.length-1].push(t.id),!s))return!0;if(rO[this._prevType]||rO[o]&&s){this._prevType=o;let t=this._stacks.length-1,i=this._stacks[t]||[];for(let o of this._renderableTiles){if(this.pool.isFull()&&(iI(this.painter,this.terrain,this._rttTiles,r),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(o),o.rtt[t]){let n=this.pool.getObjectForId(o.rtt[t].id);if(n.stamp===o.rtt[t].stamp){this.pool.useObject(n);continue}}let s=this.pool.getOrCreateFreeObject();this.pool.useObject(s),this.pool.stampObject(s),o.rtt[t]={id:s.id,stamp:s.stamp},a.context.bindFramebuffer.set(s.fbo.framebuffer),a.context.clear({color:n.bj.transparent,stencil:0}),a.currentStencilSource=void 0;for(let t=0;t<i.length;t++){let n=a.style._layers[i[t]],l=n.source?this._coordsAscending[n.source][o.tileID.key]:[o.tileID];a.context.viewport.set([0,0,s.fbo.width,s.fbo.height]),a._renderTileClippingMasks(n,l,!0),a.renderLayer(a,a.style.tileManagers[n.source],n,l,r),n.source&&(o.rttCoords[n.source]=this._coordsAscendingStr[n.source][o.tileID.key])}}return iI(this.painter,this.terrain,this._rttTiles,r),this._rttTiles=[],this.pool.freeAllObjects(),rO[o]}return!1}}let rz={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},rN={hash:!1,interactive:!0,bearingSnap:7,attributionControl:rM,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:n.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,transformConstrain:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,reduceMotion:void 0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,experimentalZoomLevelsToOverscale:void 0},rY={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class rj{constructor(t,i,r=!1){this.mousedown=t=>{this.startMove(t,x.mousePos(this.element,t)),x.addEventListener(window,"mousemove",this.mousemove),x.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=t=>{this.move(t,x.mousePos(this.element,t))},this.mouseup=t=>{this._rotatePitchHandler.dragEnd(t),this.offTemp()},this.touchstart=t=>{1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=x.touchPos(this.element,t.targetTouches)[0],this.startMove(t,this._startPos),x.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),x.addEventListener(window,"touchend",this.touchend))},this.touchmove=t=>{1!==t.targetTouches.length?this.reset():(this._lastPos=x.touchPos(this.element,t.targetTouches)[0],this.move(t,this._lastPos))},this.touchend=t=>{0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=i;let o=new i7;this._rotatePitchHandler=new i5({clickTolerance:3,move:(t,o)=>{let a=i.getBoundingClientRect(),s=new n.P((a.bottom-a.top)/2,(a.right-a.left)/2);return{bearingDelta:n.cr(new n.P(t.x,o.y),o,s),pitchDelta:r?-.5*(o.y-t.y):void 0}},moveStateManager:o,enable:!0,assignEvents:()=>{}}),this.map=t,x.addEventListener(i,"mousedown",this.mousedown),x.addEventListener(i,"touchstart",this.touchstart,{passive:!1}),x.addEventListener(i,"touchcancel",this.reset)}startMove(t,n){this._rotatePitchHandler.dragStart(t,n),x.disableDrag()}move(t,n){let i=this.map,{bearingDelta:r,pitchDelta:o}=this._rotatePitchHandler.dragMove(t,n)||{};r&&i.setBearing(i.getBearing()+r),o&&i.setPitch(i.getPitch()+o)}off(){let t=this.element;x.removeEventListener(t,"mousedown",this.mousedown),x.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),x.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),x.removeEventListener(window,"touchend",this.touchend),x.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){x.enableDrag(),x.removeEventListener(window,"mousemove",this.mousemove),x.removeEventListener(window,"mouseup",this.mouseup),x.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),x.removeEventListener(window,"touchend",this.touchend)}}function rU(t,i,r,o=!1){if(o||!r.getCoveringTilesDetailsProvider().allowWorldCopies())return null==t?void 0:t.wrap();let a=new n.U(t.lng,t.lat);if(t=new n.U(t.lng,t.lat),i){let o=new n.U(t.lng-360,t.lat),a=new n.U(t.lng+360,t.lat),s=r.locationToScreenPoint(t).distSqr(i);r.locationToScreenPoint(o).distSqr(i)<s?t=o:r.locationToScreenPoint(a).distSqr(i)<s&&(t=a)}for(;Math.abs(t.lng-r.center.lng)>180;){let n=r.locationToScreenPoint(t);if(n.x>=0&&n.y>=0&&n.x<=r.width&&n.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t.lng!==a.lng&&r.isPointOnMapSurface(r.locationToScreenPoint(t))?t:a}let rH={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function rV(t,n,i){let r=t.classList;for(let t in rH)r.remove(`maplibregl-${i}-anchor-${t}`);r.add(`maplibregl-${i}-anchor-${n}`)}class rG extends n.E{constructor(t){if(super(),this._onKeyPress=t=>{let n=t.code,i=t.charCode||t.keyCode;"Space"!==n&&"Enter"!==n&&32!==i&&13!==i||this.togglePopup()},this._onMapClick=t=>{let n=t.originalEvent.target,i=this._element;this._popup&&(n===i||i.contains(n))&&this.togglePopup()},this._update=t=>{if(!this._map)return;let n=this._map.loaded()&&!this._map.isMoving();"terrain"!==(null==t?void 0:t.type)&&("render"!==(null==t?void 0:t.type)||n)||this._map.once("render",this._update),this._lngLat=rU(this._lngLat,this._flatPos,this._map.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let i="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?i=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(i=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let r="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?r="rotateX(0deg)":"map"===this._pitchAlignment&&(r=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||t&&"moveend"!==t.type||(this._pos=this._pos.round()),x.setTransform(this._element,`${rH[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${r} ${i}`),_.frameAsync(new AbortController).then(()=>{this._updateOpacity(t&&"moveend"===t.type)}).catch(()=>{})},this._onMove=t=>{if(!this._isDragging){let n=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=n}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new n.l("dragstart"))),this.fire(new n.l("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new n.l("dragend")),this._state="inactive"},this._addDragHandler=t=>{this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._subpixelPositioning=t&&t.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this._rotationAlignment,this.setOpacity(null==t?void 0:t.opacity,null==t?void 0:t.opacityWhenCovered),t&&t.element)this._element=t.element,this._offset=n.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=x.create("div");let i=x.createNS("http://www.w3.org/2000/svg","svg");i.setAttributeNS(null,"display","block"),i.setAttributeNS(null,"height","41px"),i.setAttributeNS(null,"width","27px"),i.setAttributeNS(null,"viewBox","0 0 27 41");let r=x.createNS("http://www.w3.org/2000/svg","g");r.setAttributeNS(null,"stroke","none"),r.setAttributeNS(null,"stroke-width","1"),r.setAttributeNS(null,"fill","none"),r.setAttributeNS(null,"fill-rule","evenodd");let o=x.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"fill-rule","nonzero");let a=x.createNS("http://www.w3.org/2000/svg","g");for(let t of(a.setAttributeNS(null,"transform","translate(3.0, 29.0)"),a.setAttributeNS(null,"fill","#000000"),[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}])){let n=x.createNS("http://www.w3.org/2000/svg","ellipse");n.setAttributeNS(null,"opacity","0.04"),n.setAttributeNS(null,"cx","10.5"),n.setAttributeNS(null,"cy","5.80029008"),n.setAttributeNS(null,"rx",t.rx),n.setAttributeNS(null,"ry",t.ry),a.appendChild(n)}let s=x.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill",this._color);let l=x.createNS("http://www.w3.org/2000/svg","path");l.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),s.appendChild(l);let c=x.createNS("http://www.w3.org/2000/svg","g");c.setAttributeNS(null,"opacity","0.25"),c.setAttributeNS(null,"fill","#000000");let d=x.createNS("http://www.w3.org/2000/svg","path");d.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),c.appendChild(d);let u=x.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"transform","translate(6.0, 7.0)"),u.setAttributeNS(null,"fill","#FFFFFF");let m=x.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(8.0, 8.0)");let h=x.createNS("http://www.w3.org/2000/svg","circle");h.setAttributeNS(null,"fill","#000000"),h.setAttributeNS(null,"opacity","0.25"),h.setAttributeNS(null,"cx","5.5"),h.setAttributeNS(null,"cy","5.5"),h.setAttributeNS(null,"r","5.4999962");let f=x.createNS("http://www.w3.org/2000/svg","circle");f.setAttributeNS(null,"fill","#FFFFFF"),f.setAttributeNS(null,"cx","5.5"),f.setAttributeNS(null,"cy","5.5"),f.setAttributeNS(null,"r","5.4999962"),m.appendChild(h),m.appendChild(f),o.appendChild(a),o.appendChild(s),o.appendChild(c),o.appendChild(u),o.appendChild(m),i.appendChild(o),i.setAttributeNS(null,"height",41*this._scale+"px"),i.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(i),this._offset=n.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",t=>{t.preventDefault()}),this._element.addEventListener("mousedown",t=>{t.preventDefault()}),rV(this._element,this._anchor,"marker"),t&&t.className)for(let n of t.className.split(" "))this._element.classList.add(n);this._popup=null}addTo(t){return this.remove(),this._map=t,this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),this._element.hasAttribute("role")||this._element.setAttribute("role","button"),t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),t.on("projectiontransition",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),x.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=n.U.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){let n=Math.abs(13.5)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[n,-1*(24.6+n)],"bottom-right":[-n,-1*(24.6+n)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}getPopup(){return this._popup}togglePopup(){let t=this._popup;return this._element.style.opacity===this._opacityWhenCovered||t&&(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map))),this}_updateOpacity(t=!1){var i,r;let o=null==(i=this._map)?void 0:i.terrain,a=this._map.transform.isLocationOccluded(this._lngLat);if(!o||a){let t=a?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==t&&(this._element.style.opacity=t))}if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let s=this._map,l=s.terrain.depthAtPoint(this._pos),c=s.terrain.getElevationForLngLatZoom(this._lngLat,s.transform.tileZoom);if(s.transform.lngLatToCameraDepth(this._lngLat,c)-l<.006)return void(this._element.style.opacity=this._opacity);let d=-this._offset.y/s.transform.pixelsPerMeter,u=Math.sin(s.getPitch()*Math.PI/180)*d,m=s.terrain.depthAtPoint(new n.P(this._pos.x,this._pos.y-this._offset.y)),h=s.transform.lngLatToCameraDepth(this._lngLat,c+u)-m>.006;(null==(r=this._popup)?void 0:r.isOpen())&&h&&this._popup.remove(),this._element.style.opacity=h?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(t){return this._offset=n.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,n){return(void 0===this._opacity||void 0===t&&void 0===n)&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==t&&(this._opacity=t),void 0!==n&&(this._opacityWhenCovered=n),this._map&&this._updateOpacity(!0),this}}let rq={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},r$=0,rW=!1,rZ={maxWidth:100,unit:"metric"};function rX(t,n,i){let r=i&&i.maxWidth||100,o=t._container.clientHeight/2,a=t._container.clientWidth/2,s=t.unproject([a-r/2,o]),l=t.unproject([a+r/2,o]),c=Math.min(r,Math.round(t.project(l).x-t.project(s).x),t._container.clientWidth),d=s.distanceTo(l);if(i&&"imperial"===i.unit){let i=3.2808*d;i>5280?rK(n,c,i/5280,t._getUIString("ScaleControl.Miles")):rK(n,c,i,t._getUIString("ScaleControl.Feet"))}else i&&"nautical"===i.unit?rK(n,c,d/1852,t._getUIString("ScaleControl.NauticalMiles")):d>=1e3?rK(n,c,d/1e3,t._getUIString("ScaleControl.Kilometers")):rK(n,c,d,t._getUIString("ScaleControl.Meters"))}function rK(t,n,i,r){let o=function(t){let n=Math.pow(10,`${Math.floor(t)}`.length-1),i=t/n;return n*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:i>=1?1:function(t){let n=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*n)/n}(i))}(i);t.style.width=o/i*n+"px",t.innerHTML=`${o} ${r}`}let rJ={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0};t.AJAXError=n.cD,t.Event=n.l,t.Evented=n.E,t.LngLat=n.U,t.MercatorCoordinate=n.a5,t.Point=n.P,t.addProtocol=n.cE,t.config=n.a,t.removeProtocol=n.cF,t.AttributionControl=rC,t.BoxZoomHandler=iQ,t.CanvasSource=es,t.CooperativeGesturesHandler=rw,t.DoubleClickZoomHandler=rb,t.DragPanHandler=ry,t.DragRotateHandler=rv,t.EdgeInsets=tu,t.FullscreenControl=class extends n.E{constructor(t={}){super(),this._onFullscreenChange=()=>{var t;let n=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;null==(t=null==n?void 0:n.shadowRoot)?void 0:t.fullscreenElement;)n=n.shadowRoot.fullscreenElement;n===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,t&&t.container&&(t.container instanceof HTMLElement?this._container=t.container:n.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=x.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){x.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let t=this._fullscreenButton=x.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);x.create("span","maplibregl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new n.l("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new n.l("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},t.GeoJSONSource=er,t.GeolocateControl=class extends n.E{constructor(t){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new n.l("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new n.l("geolocate",t)),this._finish()}},this._updateCamera=t=>{let i=new n.U(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy,o=this._map.getBearing(),a=n.e({bearing:o},this.options.fitBoundsOptions),s=K.fromLngLat(i,r);this._map.fitBounds(s,a,{geolocateSource:!0})},this._updateMarker=t=>{if(t){let i=new n.U(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=t.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=t=>{if(this._map){if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&rW)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new n.l("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",t=>t.preventDefault()),this._geolocateButton=x.create("button","maplibregl-ctrl-geolocate",this._container),x.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=t=>{if(this._map){if(!1===t){n.w("Geolocation support is not available so the GeolocateControl will be disabled.");let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{let t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=x.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new rG({element:this._dotElement}),this._circleElement=x.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new rG({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onUpdate),this._map.on("move",this._onUpdate),this._map.on("rotate",this._onUpdate),this._map.on("pitch",this._onUpdate)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",t=>{let i=(null==t?void 0:t[0])instanceof ResizeObserverEntry;t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||i||this._map.isZooming()||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new n.l("trackuserlocationend")),this.fire(new n.l("userlocationlostfocus")))})}},this.options=n.e({},rq,t)}onAdd(t){return this._map=t,this._container=x.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),(function(){return n._(this,arguments,void 0,function*(t=!1){if(void 0!==d&&!t)return d;if(void 0===window.navigator.permissions)return d=!!window.navigator.geolocation;try{let t=yield window.navigator.permissions.query({name:"geolocation"});d="denied"!==t.state}catch(t){d=!!window.navigator.geolocation}return d})})().then(t=>this._finishSetupUI(t)),this._container}onRemove(){void 0!==this._geolocationWatchID&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),x.remove(this._container),this._map.off("zoom",this._onUpdate),this._map.off("move",this._onUpdate),this._map.off("rotate",this._onUpdate),this._map.off("pitch",this._onUpdate),this._map=void 0,r$=0,rW=!1}_isOutOfMapMaxBounds(t){let n=this._map.getMaxBounds(),i=t.coords;return n&&(i.longitude<n.getWest()||i.longitude>n.getEast()||i.latitude<n.getSouth()||i.latitude>n.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":case"BACKGROUND_ERROR":case"OFF":case void 0:break;default:throw Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadiusIfNeeded(){let t=this._userLocationDotMarker.getLngLat();if(!(this.options.showUserLocation&&this.options.showAccuracyCircle&&this._accuracy&&t))return;let n=this._map.project(t),i=this._map.unproject([n.x+100,n.y]),r=t.distanceTo(i)/100,o=2*this._accuracy/r;this._circleElement.style.width=`${o.toFixed(2)}px`,this._circleElement.style.height=`${o.toFixed(2)}px`}trigger(){if(!this._setup)return n.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new n.l("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":r$--,rW=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new n.l("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new n.l("trackuserlocationstart")),this.fire(new n.l("userlocationfocus"));break;default:throw Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw Error(`Unexpected watchState ${this._watchState}`)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let t;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++r$>1?(t={maximumAge:6e5,timeout:0},rW=!0):(t=this.options.positionOptions,rW=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},t.GlobeControl=class{constructor(){this._toggleProjection=()=>{var t;let n=null==(t=this._map.getProjection())?void 0:t.type;this._map.setProjection("mercator"!==n&&n?{type:"mercator"}:{type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var t;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),"globe"===(null==(t=this._map.getProjection())?void 0:t.type)?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(t){return this._map=t,this._container=x.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=x.create("button","maplibregl-ctrl-globe",this._container),x.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._container}onRemove(){x.remove(this._container),this._map.off("styledata",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},t.Hash=iB,t.ImageSource=eo,t.KeyboardHandler=rm,t.LngLatBounds=K,t.LogoControl=rS,t.Map=class extends rA{constructor(t){var i,r;n.cA.mark(n.cB.create);let o=Object.assign(Object.assign(Object.assign({},rN),t),{canvasContextAttributes:Object.assign(Object.assign({},rN.canvasContextAttributes),t.canvasContextAttributes)});if(null!=o.minZoom&&null!=o.maxZoom&&o.minZoom>o.maxZoom)throw Error("maxZoom must be greater than or equal to minZoom");if(null!=o.minPitch&&null!=o.maxPitch&&o.minPitch>o.maxPitch)throw Error("maxPitch must be greater than or equal to minPitch");if(null!=o.minPitch&&o.minPitch<0)throw Error("minPitch must be greater than or equal to 0");if(null!=o.maxPitch&&o.maxPitch>180)throw Error("maxPitch must be less than or equal to 180");let a=new t_,s=new tw;if(void 0!==o.minZoom&&a.setMinZoom(o.minZoom),void 0!==o.maxZoom&&a.setMaxZoom(o.maxZoom),void 0!==o.minPitch&&a.setMinPitch(o.minPitch),void 0!==o.maxPitch&&a.setMaxPitch(o.maxPitch),void 0!==o.renderWorldCopies&&a.setRenderWorldCopies(o.renderWorldCopies),null!==o.transformConstrain&&a.setConstrainOverride(o.transformConstrain),super(a,s,{bearingSnap:o.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new rL,this._controls=[],this._mapId=n.ab(),this._lostContextStyle={style:null,images:null},this._contextLost=t=>{for(let n of(t.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.painter.destroy(),Object.values(this.style._layers)))if("custom"===n.type&&console.warn(`Custom layer with id '${n.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),n._listeners)for(let[t]of Object.entries(n._listeners))console.warn(`Custom layer with id '${n.id}' had event listeners for event '${t}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this._lostContextStyle=this._getStyleAndImages(),this.style.destroy(),this.style=null,this.fire(new n.l("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&(this.style.imageManager.images=this._lostContextStyle.images),this._setupPainter(),this.resize(),this._update(),this.fire(new n.l("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=o.interactive,this._maxTileCacheSize=o.maxTileCacheSize,this._maxTileCacheZoomLevels=o.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},o.canvasContextAttributes),this._trackResize=!0===o.trackResize,this._bearingSnap=o.bearingSnap,this._centerClampedToGround=o.centerClampedToGround,this._refreshExpiredTiles=!0===o.refreshExpiredTiles,this._fadeDuration=o.fadeDuration,this._crossSourceCollisions=!0===o.crossSourceCollisions,this._collectResourceTiming=!0===o.collectResourceTiming,this._locale=Object.assign(Object.assign({},rz),o.locale),this._clickTolerance=o.clickTolerance,this._overridePixelRatio=o.pixelRatio,this._maxCanvasSize=o.maxCanvasSize,this._zoomLevelsToOverscale=o.experimentalZoomLevelsToOverscale,this.transformCameraUpdate=o.transformCameraUpdate,this.transformConstrain=o.transformConstrain,this.cancelPendingTileRequestsWhileZooming=!0===o.cancelPendingTileRequestsWhileZooming,void 0!==o.reduceMotion&&(_.prefersReducedMotion=o.reduceMotion),this._imageQueueHandle=h.addThrottleControl(()=>this.isMoving()),this._requestManager=new M(o.transformRequest),"string"==typeof o.container){if(this._container=document.getElementById(o.container),!this._container)throw Error(`Container '${o.container}' not found.`)}else{if(!(o.container instanceof HTMLElement))throw Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=o.container}if(o.maxBounds&&this.setMaxBounds(o.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),"undefined"!=typeof window){addEventListener("online",this._onWindowOnline,!1);let t=!1,n=iO(t=>{this._trackResize&&!this._removed&&(this.resize(t),this.redraw())},50);this._resizeObserver=new ResizeObserver(i=>{t?n(i):t=!0}),this._resizeObserver.observe(this._container)}this.handlers=new rT(this,o),this._hash=o.hash&&new iB("string"==typeof o.hash&&o.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:o.center,elevation:o.elevation,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch,roll:o.roll}),o.bounds&&(this.resize(),this.fitBounds(o.bounds,n.e({},o.fitBoundsOptions,{duration:0}))));let l="string"==typeof o.style||"globe"!==(null==(r=null==(i=o.style)?void 0:i.projection)?void 0:r.type);this.resize(null,l),this._localIdeographFontFamily=o.localIdeographFontFamily,this._validateStyle=o.validateStyle,o.style&&this.setStyle(o.style,{localIdeographFontFamily:o.localIdeographFontFamily}),o.attributionControl&&this.addControl(new rC("boolean"==typeof o.attributionControl?void 0:o.attributionControl)),o.maplibreLogo&&this.addControl(new rS,o.logoPosition),this.on("style.load",()=>{if(l||this._resizeTransform(),this.transform.unmodified){let t=n.S(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(t)}}),this.on("data",t=>{this._update("style"===t.dataType),this.fire(new n.l(`${t.dataType}data`,t))}),this.on("dataloading",t=>{this.fire(new n.l(`${t.dataType}dataloading`,t))}),this.on("dataabort",t=>{this.fire(new n.l("sourcedataabort",t))})}_getMapId(){return this._mapId}setGlobalStateProperty(t,n){return this.style.setGlobalStateProperty(t,n),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(t,i){if(void 0===i&&(i=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new n.k(Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let r=t.onAdd(this);this._controls.push(t);let o=this._controlPositions[i];return -1!==i.indexOf("bottom")?o.insertBefore(r,o.firstChild):o.appendChild(r),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new n.k(Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let i=this._controls.indexOf(t);return i>-1&&this._controls.splice(i,1),t.onRemove(this),this}hasControl(t){return this._controls.indexOf(t)>-1}coveringTiles(t){return eE(this.transform,t)}calculateCameraOptionsFromTo(t,n,i,r){return null==r&&this.terrain&&(r=this.terrain.getElevationForLngLatZoom(i,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(t,n,i,r)}resize(t,i=!0){let[r,o]=this._containerDimensions(),a=this._getClampedPixelRatio(r,o);if(this._resizeCanvas(r,o,a),this.painter.resize(r,o,a),this.painter.overLimit()){let t=this.painter.context.gl;this._maxCanvasSize=[t.drawingBufferWidth,t.drawingBufferHeight];let n=this._getClampedPixelRatio(r,o);this._resizeCanvas(r,o,n),this.painter.resize(r,o,n)}this._resizeTransform(i);let s=!this._moving;return s&&(this.stop(),this.fire(new n.l("movestart",t)).fire(new n.l("move",t))),this.fire(new n.l("resize",t)),s&&this.fire(new n.l("moveend",t)),this}_resizeTransform(t=!0){var n;let[i,r]=this._containerDimensions();this.transform.resize(i,r,t),null==(n=this._requestedCameraState)||n.resize(i,r,t)}_getClampedPixelRatio(t,n){let{0:i,1:r}=this._maxCanvasSize,o=this.getPixelRatio(),a=t*o,s=n*o;return Math.min(a>i?i/a:1,s>r?r/s:1)*o}getPixelRatio(){var t;return null!=(t=this._overridePixelRatio)?t:devicePixelRatio}setPixelRatio(t){this._overridePixelRatio=t,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(t){return this.transform.setMaxBounds(K.convert(t)),this._update()}setMinZoom(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.setMinZoom(t),this._update(),this.getZoom()<t&&this.setZoom(t),this;throw Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.setMaxZoom(t),this._update(),this.getZoom()>t&&this.setZoom(t),this;throw Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=null==t?0:t)<0)throw Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.setMinPitch(t),this._update(),this.getPitch()<t&&this.setPitch(t),this;throw Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(t){if((t=null==t?60:t)>180)throw Error("maxPitch must be less than or equal to 180");if(t>=this.transform.minPitch)return this.transform.setMaxPitch(t),this._update(),this.getPitch()>t&&this.setPitch(t),this;throw Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(t){return this.transform.setRenderWorldCopies(t),this._update()}setTransformConstrain(t){return this.transform.setConstrainOverride(t),this._update()}project(t){return this.transform.locationToScreenPoint(n.U.convert(t),this.style&&this.terrain)}unproject(t){return this.transform.screenPointToLocation(n.P.convert(t),this.terrain)}isMoving(){var t;return this._moving||(null==(t=this.handlers)?void 0:t.isMoving())}isZooming(){var t;return this._zooming||(null==(t=this.handlers)?void 0:t.isZooming())}isRotating(){var t;return this._rotating||(null==(t=this.handlers)?void 0:t.isRotating())}_createDelegatedListener(t,n,i){if("mouseenter"===t||"mouseover"===t){let r=!1,o=o=>{let a=n.filter(t=>this.getLayer(t)),s=0!==a.length?this.queryRenderedFeatures(o.point,{layers:a}):[];s.length?r||(r=!0,i.call(this,new i$(t,this,o.originalEvent,{features:s}))):r=!1};return{layers:n,listener:i,delegates:{mousemove:o,mouseout:()=>{r=!1}}}}if("mouseleave"===t||"mouseout"===t){let r=!1,o=o=>{let a=n.filter(t=>this.getLayer(t));(0!==a.length?this.queryRenderedFeatures(o.point,{layers:a}):[]).length?r=!0:r&&(r=!1,i.call(this,new i$(t,this,o.originalEvent)))},a=n=>{r&&(r=!1,i.call(this,new i$(t,this,n.originalEvent)))};return{layers:n,listener:i,delegates:{mousemove:o,mouseout:a}}}{let r=t=>{let r=n.filter(t=>this.getLayer(t)),o=0!==r.length?this.queryRenderedFeatures(t.point,{layers:r}):[];o.length&&(t.features=o,i.call(this,t),delete t.features)};return{layers:n,listener:i,delegates:{[t]:r}}}}_saveDelegatedListener(t,n){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(n)}_removeDelegatedListener(t,n,i){if(!this._delegatedListeners||!this._delegatedListeners[t])return;let r=this._delegatedListeners[t];for(let t=0;t<r.length;t++){let o=r[t];if(o.listener===i&&o.layers.length===n.length&&o.layers.every(t=>n.includes(t))){for(let t in o.delegates)this.off(t,o.delegates[t]);return void r.splice(t,1)}}}on(t,n,i){if(void 0===i)return super.on(t,n);let r="string"==typeof n?[n]:n,o=this._createDelegatedListener(t,r,i);for(let n in this._saveDelegatedListener(t,o),o.delegates)this.on(n,o.delegates[n]);return{unsubscribe:()=>{this._removeDelegatedListener(t,r,i)}}}once(t,n,i){if(void 0===i)return super.once(t,n);let r="string"==typeof n?[n]:n,o=this._createDelegatedListener(t,r,i);for(let n in o.delegates){let a=o.delegates[n];o.delegates[n]=(...n)=>{this._removeDelegatedListener(t,r,i),a(...n)}}for(let n in this._saveDelegatedListener(t,o),o.delegates)this.once(n,o.delegates[n]);return this}off(t,n,i){return void 0===i?super.off(t,n):(this._removeDelegatedListener(t,"string"==typeof n?[n]:n,i),this)}queryRenderedFeatures(t,i){let r;if(!this.style)return[];let o=t instanceof n.P||Array.isArray(t),a=o?t:[[0,0],[this.transform.width,this.transform.height]];if(i=i||(o?{}:t)||{},a instanceof n.P||"number"==typeof a[0])r=[n.P.convert(a)];else{let t=n.P.convert(a[0]),i=n.P.convert(a[1]);r=[t,new n.P(i.x,t.y),i,new n.P(t.x,i.y),t]}return this.style.queryRenderedFeatures(r,i,this.transform)}querySourceFeatures(t,n){return this.style.querySourceFeatures(t,n)}setStyle(t,i){return!1!==(i=n.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},i)).diff&&i.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,i),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._updateStyle(t,i))}setTransformRequest(t){return this._requestManager.setTransformRequest(t),this}_getUIString(t){let n=this._locale[t];if(null==n)throw Error(`Missing UI string '${t}'`);return n}_updateStyle(t,n){var i,r;if(n.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(t,n));let o=this.style&&n.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!t)),t?(this.style=new t5(this,n||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t,n,o):this.style.loadJSON(t,n,o)):(null==(r=null==(i=this.style)?void 0:i.projection)||r.destroy(),delete this.style),this}_lazyInitEmptyStyle(){this.style||(this.style=new t5(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(t,i){if("string"==typeof t){let r=this._requestManager.transformRequest(t,"Style");n.j(r,new AbortController).then(t=>{this._updateDiff(t.data,i)}).catch(t=>{t&&this.fire(new n.k(t))})}else"object"==typeof t&&this._updateDiff(t,i)}_updateDiff(t,i){try{this.style.setState(t,i)&&this._update(!0)}catch(r){n.w(`Unable to perform style diff: ${r.message||r.error||r}. Rebuilding the style from scratch.`),this._updateStyle(t,i)}}getStyle(){if(this.style)return this.style.serialize()}_getStyleAndImages(){return this.style?{style:this.style.serialize(),images:this.style.imageManager.cloneImages()}:{style:null,images:{}}}isStyleLoaded(){return this.style?this.style.loaded():n.w("There is no style added to the map.")}addSource(t,n){return this._lazyInitEmptyStyle(),this.style.addSource(t,n),this._update(!0)}isSourceLoaded(t){let i=this.style&&this.style.tileManagers[t];if(void 0!==i)return i.loaded();this.fire(new n.k(Error(`There is no tile manager with ID '${t}'`)))}setTerrain(t){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),t){let i=this.style.tileManagers[t.source];if(!i)throw Error(`cannot load terrain, because there exists no source with ID: ${t.source}`);for(let r in null===this.terrain&&i.reload(),this.style._layers){let i=this.style._layers[r];"hillshade"===i.type&&i.source===t.source&&n.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),"color-relief"===i.type&&i.source===t.source&&n.w("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new rP(this.painter,i,t),this.painter.renderToTexture=new rB(this.painter,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._terrainDataCallback=n=>{var i;"style"===n.dataType?this.terrain.tileManager.freeRtt():"source"===n.dataType&&n.tile&&(n.sourceId!==t.source||this._elevationFreeze||(this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))),"image"===(null==(i=n.source)?void 0:i.type)?this.terrain.tileManager.freeRtt():this.terrain.tileManager.freeRtt(n.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.tileManager.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0);return this.fire(new n.l("terrain",{terrain:t})),this}getTerrain(){var t,n;return null!=(n=null==(t=this.terrain)?void 0:t.options)?n:null}areTilesLoaded(){let t=this.style&&this.style.tileManagers;for(let n in t){let i=t[n]._tiles;for(let t in i){let n=i[t];if("loaded"!==n.state&&"errored"!==n.state)return!1}}return!0}removeSource(t){return this.style.removeSource(t),this._update(!0)}getSource(t){return this.style.getSource(t)}setSourceTileLodParams(t,n,i){if(i){let r=this.getSource(i);if(!r)throw Error(`There is no source with ID "${i}", cannot set LOD parameters`);r.calculateTileZoom=ew(Math.max(1,t),Math.max(1,n))}else for(let i in this.style.tileManagers)this.style.tileManagers[i].getSource().calculateTileZoom=ew(Math.max(1,t),Math.max(1,n));return this._update(!0),this}refreshTiles(t,i){let r=this.style.tileManagers[t];if(!r)throw Error(`There is no tile manager with ID "${t}", cannot refresh tile`);void 0===i?r.reload(!0):r.refreshTiles(i.map(t=>new n.a8(t.z,t.x,t.y)))}addImage(t,i,r={}){let{pixelRatio:o=1,sdf:a=!1,stretchX:s,stretchY:l,content:c,textFitWidth:d,textFitHeight:u}=r;if(this._lazyInitEmptyStyle(),!(i instanceof HTMLImageElement||n.b(i))){if(void 0===i.width||void 0===i.height)return this.fire(new n.k(Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{let{width:r,height:m,data:h}=i;return this.style.addImage(t,{data:new n.R({width:r,height:m},new Uint8Array(h)),pixelRatio:o,stretchX:s,stretchY:l,content:c,textFitWidth:d,textFitHeight:u,sdf:a,version:0,userImage:i}),i.onAdd&&i.onAdd(this,t),this}}{let{width:r,height:m,data:h}=_.getImageData(i);this.style.addImage(t,{data:new n.R({width:r,height:m},h),pixelRatio:o,stretchX:s,stretchY:l,content:c,textFitWidth:d,textFitHeight:u,sdf:a,version:0})}}updateImage(t,i){let r=this.style.getImage(t);if(!r)return this.fire(new n.k(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:o,height:a,data:s}=i instanceof HTMLImageElement||n.b(i)?_.getImageData(i):i;if(void 0===o||void 0===a)return this.fire(new n.k(Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(o!==r.data.width||a!==r.data.height)return this.fire(new n.k(Error("The width and height of the updated image must be that same as the previous version of the image")));let l=!(i instanceof HTMLImageElement||n.b(i));return r.data.replace(s,l),this.style.updateImage(t,r),this}getImage(t){return this.style.getImage(t)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new n.k(Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}loadImage(t){return h.getImage(this._requestManager.transformRequest(t,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(t,n){return this._lazyInitEmptyStyle(),this.style.addLayer(t,n),this._update(!0)}moveLayer(t,n){return this.style.moveLayer(t,n),this._update(!0)}removeLayer(t){return this.style.removeLayer(t),this._update(!0)}getLayer(t){return this.style.getLayer(t)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(t,n,i){return this.style.setLayerZoomRange(t,n,i),this._update(!0)}setFilter(t,n,i={}){return this.style.setFilter(t,n,i),this._update(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,n,i,r={}){return this.style.setPaintProperty(t,n,i,r),this._update(!0)}getPaintProperty(t,n){return this.style.getPaintProperty(t,n)}setLayoutProperty(t,n,i,r={}){return this.style.setLayoutProperty(t,n,i,r),this._update(!0)}getLayoutProperty(t,n){return this.style.getLayoutProperty(t,n)}setGlyphs(t,n={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(t,n),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(t,n,i={}){return this._lazyInitEmptyStyle(),this.style.addSprite(t,n,i,t=>{t||this._update(!0)}),this}removeSprite(t){return this._lazyInitEmptyStyle(),this.style.removeSprite(t),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(t,n={}){return this._lazyInitEmptyStyle(),this.style.setSprite(t,n,t=>{t||this._update(!0)}),this}setLight(t,n={}){return this._lazyInitEmptyStyle(),this.style.setLight(t,n),this._update(!0)}getLight(){return this.style.getLight()}setSky(t,n={}){return this._lazyInitEmptyStyle(),this.style.setSky(t,n),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(t,n){return this.style.setFeatureState(t,n),this._update()}removeFeatureState(t,n){return this.style.removeFeatureState(t,n),this._update()}getFeatureState(t){return this.style.getFeatureState(t)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let t=0,n=0;return this._container&&(t=this._container.clientWidth||400,n=this._container.clientHeight||300),[t,n]}_setupContainer(){let t=this._container;t.classList.add("maplibregl-map");let n=this._canvasContainer=x.create("div","maplibregl-canvas-container",t);this._interactive&&n.classList.add("maplibregl-interactive"),this._canvas=x.create("canvas","maplibregl-canvas",n),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");let i=this._containerDimensions(),r=this._getClampedPixelRatio(i[0],i[1]);this._resizeCanvas(i[0],i[1],r);let o=this._controlContainer=x.create("div","maplibregl-control-container",t),a=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(t=>{a[t]=x.create("div",`maplibregl-ctrl-${t} `,o)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(t,n,i){this._canvas.width=Math.floor(i*t),this._canvas.height=Math.floor(i*n),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${n}px`}_setupPainter(){let t=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0}),n=null;this._canvas.addEventListener("webglcontextcreationerror",i=>{n={requestedAttributes:t},i&&(n.statusMessage=i.statusMessage,n.type=i.type)},{once:!0});let i=null;if(!(i=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,t):this._canvas.getContext("webgl2",t)||this._canvas.getContext("webgl",t))){let t="Failed to initialize WebGL";throw n?(n.message=t,Error(JSON.stringify(n))):Error(t)}this.painter=new iR(i,this.transform),w.testSupport(i)}migrateProjection(t,i){super.migrateProjection(t,i),this.painter.transform=t,this.fire(new n.l("projectiontransition",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(t){return this.style&&this.style._loaded&&(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint()),this}_requestRenderFrame(t){return this._update(),this._renderTaskQueue.add(t)}_cancelRenderFrame(t){this._renderTaskQueue.remove(t)}_render(t){var i,r,o,a,s;let l=this._idleTriggered?this._fadeDuration:0,c=(null==(i=this.style.projection)?void 0:i.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),this._removed)return;let d=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let t=this.transform.zoom,i=v();this.style.zoomHistory.update(t,i);let r=new n.G(t,{now:i,fadeDuration:l,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),o=r.crossFadingFactor();1===o&&o===this._crossFadingFactor||(d=!0,this._crossFadingFactor=o),this.style.update(r)}let u=(null==(r=this.style.projection)?void 0:r.transitionState)>0!==c;null==(o=this.style.projection)||o.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState(null==(a=this.style.projection)?void 0:a.transitionState,null==(s=this.style.projection)?void 0:s.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||u)&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.tileManager.update(this.transform,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),!this._elevationFreeze&&this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0)),this._placementDirty=this.style&&this.style._updatePlacement(this.transform,this.showCollisionBoxes,l,this._crossSourceCollisions,u),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:l,showPadding:this.showPadding}),this.fire(new n.l("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,n.cA.mark(n.cB.load),this.fire(new n.l("load"))),this.style&&(this.style.hasTransitions()||d)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let m=this._sourcesDirty||this._styleDirty||this._placementDirty;return m||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new n.l("idle")),!this._loaded||this._fullyLoaded||m||(this._fullyLoaded=!0,n.cA.mark(n.cB.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var t;for(let t of(this._hash&&this._hash.remove(),this._controls))t.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),"undefined"!=typeof window&&removeEventListener("online",this._onWindowOnline,!1),h.removeThrottleControl(this._imageQueueHandle),null==(t=this._resizeObserver)||t.disconnect();let i=this.painter.context.gl.getExtension("WEBGL_lose_context");(null==i?void 0:i.loseContext)&&i.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),x.remove(this._canvasContainer),x.remove(this._controlContainer),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map"),n.cA.clearMetrics(),this._removed=!0,this.fire(new n.l("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,_.frame(this._frameRequest,t=>{n.cA.frame(t),this._frameRequest=null;try{this._render(t)}catch(t){if(!n.cC(t)&&t.message!==is)throw t}},()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())}get showPadding(){return!!this._showPadding}set showPadding(t){this._showPadding!==t&&(this._showPadding=t,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())}get repaint(){return!!this._repaint}set repaint(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(t){this._vertices=t,this._update()}get version(){return b}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(t){return this._lazyInitEmptyStyle(),this.style.setProjection(t),this._update(!0)}},t.MapMouseEvent=i$,t.MapTouchEvent=iW,t.MapWheelEvent=iZ,t.Marker=rG,t.NavigationControl=class{constructor(t){this._updateZoomButtons=()=>{let t=this._map.getZoom(),n=t===this._map.getMaxZoom(),i=t===this._map.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=i,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",i.toString())},this._rotateCompassArrow=()=>{this._compassIcon.style.transform=this.options.visualizePitch&&this.options.visualizeRoll?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateZ(${-this._map.transform.roll}deg) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizeRoll?`rotate(${-this._map.transform.bearing-this._map.transform.roll}deg)`:`rotate(${-this._map.transform.bearing}deg)`},this._setButtonTitle=(t,n)=>{let i=this._map._getUIString(`NavigationControl.${n}`);t.title=i,t.setAttribute("aria-label",i)},this.options=n.e({},rY,t),this._container=x.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),x.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),x.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=x.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new rj(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){x.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(t,n){let i=x.create("button",t,this._container);return i.type="button",i.addEventListener("click",n),i}},t.Popup=class extends n.E{constructor(t){super(),this._updateOpacity=()=>{void 0!==this.options.locationOccludedOpacity&&(this._container.style.opacity=this._map.transform.isLocationOccluded(this.getLngLat())?`${this.options.locationOccludedOpacity}`:"")},this.remove=()=>(this._content&&x.remove(this._content),this._container&&(x.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new n.l("close"))),this),this._onMouseUp=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=x.create("div","maplibregl-popup",this._map.getContainer()),this._tip=x.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let t of this.options.className.split(" "))this._container.classList.add(t);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=rU(this._lngLat,this._flatPos,this._map.transform,this._trackPointer),this._trackPointer&&!t)return;let i=this._flatPos=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&t?t:this._map.transform.locationToScreenPoint(this._lngLat));let r=this.options.anchor,o=function t(i){if(i){if("number"==typeof i){let t=Math.round(Math.abs(i)/Math.SQRT2);return{center:new n.P(0,0),top:new n.P(0,i),"top-left":new n.P(t,t),"top-right":new n.P(-t,t),bottom:new n.P(0,-i),"bottom-left":new n.P(t,-t),"bottom-right":new n.P(-t,-t),left:new n.P(i,0),right:new n.P(-i,0)}}if(i instanceof n.P||Array.isArray(i)){let t=n.P.convert(i);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:n.P.convert(i.center||[0,0]),top:n.P.convert(i.top||[0,0]),"top-left":n.P.convert(i["top-left"]||[0,0]),"top-right":n.P.convert(i["top-right"]||[0,0]),bottom:n.P.convert(i.bottom||[0,0]),"bottom-left":n.P.convert(i["bottom-left"]||[0,0]),"bottom-right":n.P.convert(i["bottom-right"]||[0,0]),left:n.P.convert(i.left||[0,0]),right:n.P.convert(i.right||[0,0])}}return t(new n.P(0,0))}(this.options.offset);if(!r){let t,n=this._container.offsetWidth,a=this._container.offsetHeight;t=i.y+o.bottom.y<a?["top"]:i.y>this._map.transform.height-a?["bottom"]:[],i.x<n/2?t.push("left"):i.x>this._map.transform.width-n/2&&t.push("right"),r=0===t.length?"bottom":t.join("-")}let a=i.add(o[r]);this.options.subpixelPositioning||(a=a.round()),x.setTransform(this._container,`${rH[r]} translate(${a.x}px,${a.y}px)`),rV(this._container,r,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=n.e(Object.create(rJ),t)}addTo(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new n.l("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=n.U.convert(t),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(t){return this.setDOMContent(document.createTextNode(t))}setHTML(t){let n,i=document.createDocumentFragment(),r=document.createElement("body");for(r.innerHTML=t;n=r.firstChild;)i.appendChild(n);return this.setDOMContent(i)}getMaxWidth(){var t;return null==(t=this._container)?void 0:t.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this._update(),this}setDOMContent(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=x.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(t){return this._container&&this._container.classList.add(t),this}removeClassName(t){return this._container&&this._container.classList.remove(t),this}setOffset(t){return this.options.offset=t,this._update(),this}toggleClassName(t){if(this._container)return this._container.classList.toggle(t)}setSubpixelPositioning(t){this.options.subpixelPositioning=t}_createCloseButton(){this.options.closeButton&&(this._closeButton=x.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let t=this._container.querySelector("a[href], [tabindex]:not([tabindex='-1']), [contenteditable]:not([contenteditable='false']), button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])");t&&t.focus()}},t.RasterDEMTileSource=et,t.RasterTileSource=ee,t.ScaleControl=class{constructor(t){this._onMove=()=>{rX(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,rX(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},rZ),t)}getDefaultPosition(){return"bottom-left"}onAdd(t){return this._map=t,this._container=x.create("div","maplibregl-ctrl maplibregl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){x.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},t.ScrollZoomHandler=rp,t.Style=t5,t.TerrainControl=class{constructor(t){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=t}onAdd(t){return this._map=t,this._container=x.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=x.create("button","maplibregl-ctrl-terrain",this._container),x.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){x.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},t.TwoFingersTouchPitchHandler=rl,t.TwoFingersTouchRotateHandler=ra,t.TwoFingersTouchZoomHandler=rr,t.TwoFingersTouchZoomRotateHandler=rx,t.VectorTileSource=Q,t.VideoSource=ea,t.addSourceType=(t,i)=>n._(void 0,void 0,void 0,function*(){if(ec(t))throw Error(`A source type called "${t}" already exists.`);el[t]=i}),t.clearPrewarmedResources=function(){let t=s;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(U),s=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},t.createTileMesh=tL,t.getMaxParallelImageRequests=function(){return n.a.MAX_PARALLEL_IMAGE_REQUESTS},t.getRTLTextPluginStatus=function(){return eh().getRTLTextPluginStatus()},t.getVersion=function(){return b},t.getWorkerCount=function(){return H.workerCount},t.getWorkerUrl=function(){return n.a.WORKER_URL},t.importScriptInWorkers=function(t){return $().broadcast("IS",t)},t.isTimeFrozen=function(){return y.isFrozen()},t.now=v,t.prewarm=function(){G().acquire(U)},t.restoreNow=function(){y.restoreNow()},t.setMaxParallelImageRequests=function(t){n.a.MAX_PARALLEL_IMAGE_REQUESTS=t},t.setNow=function(t){y.setNow(t)},t.setRTLTextPlugin=function(t,n){return eh().setRTLTextPlugin(t,n)},t.setWorkerCount=function(t){H.workerCount=t},t.setWorkerUrl=function(t){n.a.WORKER_URL=t}}),t}()}},n={};function i(r){var o=n[r];if(void 0!==o)return o.exports;var a=n[r]={id:r,loaded:!1,exports:{}};return t[r].call(a.exports,a,a.exports,i),a.loaded=!0,a.exports}i.n=t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return i.d(n,{a:n}),n},(()=>{var t,n=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__;i.t=function(r,o){if(1&o&&(r=this(r)),8&o||"object"==typeof r&&r&&(4&o&&r.__esModule||16&o&&"function"==typeof r.then))return r;var a=Object.create(null);i.r(a);var s={};t=t||[null,n({}),n([]),n(n)];for(var l=2&o&&r;"object"==typeof l&&!~t.indexOf(l);l=n(l))Object.getOwnPropertyNames(l).forEach(t=>{s[t]=()=>r[t]});return s.default=()=>r,i.d(a,s),a}})(),i.d=(t,n)=>{for(var r in n)i.o(n,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},i.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}})(),i.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r={};return(()=>{"use strict";let t;i.r(r),i.d(r,{OrMapLoadedEvent:()=>la,geoJsonPointInputTemplateProvider:()=>lu,OrMapMarkerClickedEvent:()=>r3,OrMap:()=>lm,OrMapLegendEvent:()=>li,OrMapAssetCard:()=>lt,OrMapMarker:()=>r5,getMarkerConfigAttributeName:()=>r8,OrClusterMarker:()=>rV,DefaultConfig:()=>le,OrMapAssetCardLoadAssetEvent:()=>s9,Util:()=>eD,getMarkerConfigForAssetType:()=>r6,OrMapLongPressEvent:()=>ll,OrMapMarkerChangedEvent:()=>r2,LngLat:()=>rL.LngLat,OrMapLegend:()=>lr,OrMapMarkerAsset:()=>r7,OrMapGeocoderChangeEvent:()=>lc,OrMapMarkersChangedEvent:()=>ld,OrMapClickedEvent:()=>ls});var n,o,a,s,l,c,d,u,m,h,f,p,b,g,_,y,v,x,w,F,k,E,T,A,M,C,S,D,I,P,R,O,B,z,N,Y,j,U,H,V,G,q,$,W,Z,X,K,J,Q,ee,et,en,ei,er,eo,ea,es,el,ec,ed,eu,em,eh,ef,ep,eb,eg,e_,ey,ev,ex,ew,eF,ek,eE,eT,eA,eM,eC,eS,eL,eD={};function eI(t){return(eI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function eP(t,n){if(!(t instanceof n))throw TypeError("Cannot call a class as a function")}function eR(t){var n=function(t,n){if("object"!=eI(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,n||"default");if("object"!=eI(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==eI(n)?n:String(n)}function eO(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,eR(r.key),r)}}function eB(t,n,i){return n&&eO(t.prototype,n),i&&eO(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function ez(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function eN(t,n){return(eN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}function eY(t,n){if("function"!=typeof n&&null!==n)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&eN(t,n)}function ej(t,n){if(n&&("object"===eI(n)||"function"==typeof n))return n;if(void 0!==n)throw TypeError("Derived constructors may only return object or undefined");return ez(t)}function eU(t){return(eU=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function eH(t,n,i){return(n=eR(n))in t?Object.defineProperty(t,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[n]=i,t}function eV(t,n){(null==n||n>t.length)&&(n=t.length);for(var i=0,r=Array(n);i<n;i++)r[i]=t[i];return r}function eG(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function eq(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?eG(Object(i),!0).forEach(function(n){eH(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):eG(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}i.r(eD),i.d(eD,{getGeoJSONPoint:()=>rO,getLatLngBounds:()=>rz,getLngLat:()=>rR,getLngLatBounds:()=>rB,getMarkerIconAndColorFromAssetType:()=>rN,isAssetWithLocation:()=>rj,isWebglSupported:()=>rY}),i(488);var e$={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,n){console&&console[t]&&console[t].apply(console,n)}},eW=new(function(){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};eP(this,t),this.init(n,i)}return eB(t,[{key:"init",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||e$,this.options=n,this.debug=n.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return this.forward(n,"log","",!0)}},{key:"warn",value:function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return this.forward(n,"warn","",!0)}},{key:"error",value:function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return this.forward(n,"error","")}},{key:"deprecate",value:function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(t,n,i,r){return r&&!this.debug?null:("string"==typeof t[0]&&(t[0]="".concat(i).concat(this.prefix," ").concat(t[0])),this.logger[n](t))}},{key:"create",value:function(n){return new t(this.logger,eq(eq({},{prefix:"".concat(this.prefix,":").concat(n,":")}),this.options))}},{key:"clone",value:function(n){return(n=n||this.options).prefix=n.prefix||this.prefix,new t(this.logger,n)}}]),t}()),eZ=function(){function t(){eP(this,t),this.observers={}}return eB(t,[{key:"on",value:function(t,n){var i=this;return t.split(" ").forEach(function(t){i.observers[t]=i.observers[t]||[],i.observers[t].push(n)}),this}},{key:"off",value:function(t,n){if(this.observers[t]){if(!n)return void delete this.observers[t];this.observers[t]=this.observers[t].filter(function(t){return t!==n})}}},{key:"emit",value:function(t){for(var n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.observers[t]&&[].concat(this.observers[t]).forEach(function(t){t.apply(void 0,i)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(function(n){n.apply(n,[t].concat(i))})}}]),t}();function eX(){var t,n,i=new Promise(function(i,r){t=i,n=r});return i.resolve=t,i.reject=n,i}function eK(t){return null==t?"":""+t}function eJ(t,n,i){function r(t){return t&&t.indexOf("###")>-1?t.replace(/###/g,"."):t}function o(){return!t||"string"==typeof t}for(var a="string"!=typeof n?[].concat(n):n.split(".");a.length>1;){if(o())return{};var s=r(a.shift());!t[s]&&i&&(t[s]=new i),t=Object.prototype.hasOwnProperty.call(t,s)?t[s]:{}}return o()?{}:{obj:t,k:r(a.shift())}}function eQ(t,n,i){var r=eJ(t,n,Object);r.obj[r.k]=i}function e0(t,n){var i=eJ(t,n),r=i.obj,o=i.k;if(r)return r[o]}function e1(t,n,i){var r=e0(t,i);return void 0!==r?r:e0(n,i)}function e2(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var e3={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function e5(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,function(t){return e3[t]}):t}var e4="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,e6=[" ",",","?","!",";"];function e8(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function e7(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e8(Object(i),!0).forEach(function(n){eH(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e8(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var e9=function(t){eY(r,t);var n,i=(n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=eU(r);return t=n?Reflect.construct(i,arguments,eU(this).constructor):i.apply(this,arguments),ej(this,t)});function r(t){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return eP(this,r),n=i.call(this),e4&&eZ.call(ez(n)),n.data=t||{},n.options=o,void 0===n.options.keySeparator&&(n.options.keySeparator="."),void 0===n.options.ignoreJSONStructure&&(n.options.ignoreJSONStructure=!0),n}return eB(r,[{key:"addNamespaces",value:function(t){0>this.options.ns.indexOf(t)&&this.options.ns.push(t)}},{key:"removeNamespaces",value:function(t){var n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}},{key:"getResource",value:function(t,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,a=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,s=[t,n];i&&"string"!=typeof i&&(s=s.concat(i)),i&&"string"==typeof i&&(s=s.concat(o?i.split(o):i)),t.indexOf(".")>-1&&(s=t.split("."));var l=e0(this.data,s);return l||!a||"string"!=typeof i?l:function t(n,i){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(n){if(n[i])return n[i];for(var o=i.split(r),a=n,s=0;s<o.length;++s){if(!a||"string"==typeof a[o[s]]&&s+1<o.length)return;if(void 0===a[o[s]]){for(var l=2,c=o.slice(s,s+l).join(r),d=a[c];void 0===d&&o.length>s+l;)l++,d=a[c=o.slice(s,s+l).join(r)];if(void 0===d)return;if(null===d)return null;if(i.endsWith(c)){if("string"==typeof d)return d;if(c&&"string"==typeof d[c])return d[c]}var u=o.slice(s+l).join(r);if(u)return t(d,u,r);return}a=a[o[s]]}return a}}(this.data&&this.data[t]&&this.data[t][n],i,o)}},{key:"addResource",value:function(t,n,i,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},a=this.options.keySeparator;void 0===a&&(a=".");var s=[t,n];i&&(s=s.concat(a?i.split(a):i)),t.indexOf(".")>-1&&(s=t.split("."),r=n,n=s[1]),this.addNamespaces(n),eQ(this.data,s,r),o.silent||this.emit("added",t,n,i,r)}},{key:"addResources",value:function(t,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in i)("string"==typeof i[o]||"[object Array]"===Object.prototype.toString.apply(i[o]))&&this.addResource(t,n,o,i[o],{silent:!0});r.silent||this.emit("added",t,n,i)}},{key:"addResourceBundle",value:function(t,n,i,r,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[t,n];t.indexOf(".")>-1&&(s=t.split("."),r=i,i=n,n=s[1]),this.addNamespaces(n);var l=e0(this.data,s)||{};r?function t(n,i,r){for(var o in i)"__proto__"!==o&&"constructor"!==o&&(o in n?"string"==typeof n[o]||n[o]instanceof String||"string"==typeof i[o]||i[o]instanceof String?r&&(n[o]=i[o]):t(n[o],i[o],r):n[o]=i[o]);return n}(l,i,o):l=e7(e7({},l),i),eQ(this.data,s,l),a.silent||this.emit("added",t,n,i)}},{key:"removeResourceBundle",value:function(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}},{key:"hasResourceBundle",value:function(t,n){return void 0!==this.getResource(t,n)}},{key:"getResourceBundle",value:function(t,n){return(n||(n=this.options.defaultNS),"v1"===this.options.compatibilityAPI)?e7(e7({},{}),this.getResource(t,n)):this.getResource(t,n)}},{key:"getDataByLanguage",value:function(t){return this.data[t]}},{key:"hasLanguageSomeTranslations",value:function(t){var n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(function(t){return n[t]&&Object.keys(n[t]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),r}(eZ),te={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,i,r,o){var a=this;return t.forEach(function(t){a.processors[t]&&(n=a.processors[t].process(n,i,r,o))}),n}};function tt(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function tn(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?tt(Object(i),!0).forEach(function(n){eH(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):tt(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var ti={},tr=function(t){eY(r,t);var n,i=(n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=eU(r);return t=n?Reflect.construct(i,arguments,eU(this).constructor):i.apply(this,arguments),ej(this,t)});function r(t){var n,o,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return eP(this,r),a=i.call(this),e4&&eZ.call(ez(a)),n=["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],o=ez(a),n.forEach(function(n){t[n]&&(o[n]=t[n])}),a.options=s,void 0===a.options.keySeparator&&(a.options.keySeparator="."),a.logger=eW.create("translator"),a}return eB(r,[{key:"changeLanguage",value:function(t){t&&(this.language=t)}},{key:"exists",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==t)return!1;var i=this.resolve(t,n);return i&&void 0!==i.res}},{key:"extractFromKey",value:function(t,n){var i=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===i&&(i=":");var r=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,o=n.ns||this.options.defaultNS||[],a=i&&t.indexOf(i)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!function(t,n,i){n=n||"",i=i||"";var r=e6.filter(function(t){return 0>n.indexOf(t)&&0>i.indexOf(t)});if(0===r.length)return!0;var o=new RegExp("(".concat(r.map(function(t){return"?"===t?"\\?":t}).join("|"),")")),a=!o.test(t);if(!a){var s=t.indexOf(i);s>0&&!o.test(t.substring(0,s))&&(a=!0)}return a}(t,i,r);if(a&&!s){var l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:o};var c=t.split(i);(i!==r||i===r&&this.options.ns.indexOf(c[0])>-1)&&(o=c.shift()),t=c.join(r)}return"string"==typeof o&&(o=[o]),{key:t,namespaces:o}}},{key:"translate",value:function(t,n,i){var o=this;if("object"!==eI(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);var a=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,s=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,l=this.extractFromKey(t[t.length-1],n),c=l.key,d=l.namespaces,u=d[d.length-1],m=n.lng||this.language,h=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(m&&"cimode"===m.toLowerCase()){if(h){var f=n.nsSeparator||this.options.nsSeparator;return a?(p.res="".concat(u).concat(f).concat(c),p):"".concat(u).concat(f).concat(c)}return a?(p.res=c,p):c}var p=this.resolve(t,n),b=p&&p.res,g=p&&p.usedKey||c,_=p&&p.exactUsedKey||c,y=Object.prototype.toString.apply(b),v=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,w="string"!=typeof b&&"boolean"!=typeof b&&"number"!=typeof b;if(x&&b&&w&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(y)&&("string"!=typeof v||"[object Array]"!==y)){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var F=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,b,tn(tn({},n),{},{ns:d})):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");return a?(p.res=F,p):F}if(s){var k="[object Array]"===y,E=k?[]:{},T=k?_:g;for(var A in b)if(Object.prototype.hasOwnProperty.call(b,A)){var M="".concat(T).concat(s).concat(A);E[A]=this.translate(M,tn(tn({},n),{joinArrays:!1,ns:d})),E[A]===M&&(E[A]=b[A])}b=E}}else if(x&&"string"==typeof v&&"[object Array]"===y)(b=b.join(v))&&(b=this.extendTranslation(b,t,n,i));else{var C=!1,S=!1,D=void 0!==n.count&&"string"!=typeof n.count,I=r.hasDefaultValue(n),P=D?this.pluralResolver.getSuffix(m,n.count,n):"",R=n["defaultValue".concat(P)]||n.defaultValue;!this.isValidLookup(b)&&I&&(C=!0,b=R),this.isValidLookup(b)||(S=!0,b=c);var O=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&S?void 0:b,B=I&&R!==b&&this.options.updateMissing;if(S||C||B){if(this.logger.log(B?"updateKey":"missingKey",m,u,c,B?R:b),s){var z=this.resolve(c,tn(tn({},n),{},{keySeparator:!1}));z&&z.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var N=[],Y=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&Y&&Y[0])for(var j=0;j<Y.length;j++)N.push(Y[j]);else"all"===this.options.saveMissingTo?N=this.languageUtils.toResolveHierarchy(n.lng||this.language):N.push(n.lng||this.language);var U=function(t,i,r){var a=I&&r!==b?r:O;o.options.missingKeyHandler?o.options.missingKeyHandler(t,u,i,a,B,n):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(t,u,i,a,B,n),o.emit("missingKey",t,u,i,b)};this.options.saveMissing&&(this.options.saveMissingPlurals&&D?N.forEach(function(t){o.pluralResolver.getSuffixes(t,n).forEach(function(i){U([t],c+i,n["defaultValue".concat(i)]||R)})}):U(N,c,R))}b=this.extendTranslation(b,t,n,p,i),S&&b===c&&this.options.appendNamespaceToMissingKey&&(b="".concat(u,":").concat(c)),(S||C)&&this.options.parseMissingKeyHandler&&(b="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(u,":").concat(c):c,C?b:void 0):this.options.parseMissingKeyHandler(b))}return a?(p.res=b,p):b}},{key:"extendTranslation",value:function(t,n,i,r,o){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,tn(tn({},this.options.interpolation.defaultVariables),i),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init(tn(tn({},i),{interpolation:tn(tn({},this.options.interpolation),i.interpolation)}));var s,l="string"==typeof t&&(i&&i.interpolation&&void 0!==i.interpolation.skipOnVariables?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(l){var c=t.match(this.interpolator.nestingRegexp);s=c&&c.length}var d=i.replace&&"string"!=typeof i.replace?i.replace:i;if(this.options.interpolation.defaultVariables&&(d=tn(tn({},this.options.interpolation.defaultVariables),d)),t=this.interpolator.interpolate(t,d,i.lng||this.language,i),l){var u=t.match(this.interpolator.nestingRegexp);s<(u&&u.length)&&(i.nest=!1)}!1!==i.nest&&(t=this.interpolator.nest(t,function(){for(var t=arguments.length,r=Array(t),s=0;s<t;s++)r[s]=arguments[s];return o&&o[0]===r[0]&&!i.context?(a.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(n[0])),null):a.translate.apply(a,r.concat([n]))},i)),i.interpolation&&this.interpolator.reset()}var m=i.postProcess||this.options.postProcess,h="string"==typeof m?[m]:m;return null!=t&&h&&h.length&&!1!==i.applyPostProcessor&&(t=te.handle(h,t,n,this.options&&this.options.postProcessPassResolved?tn({i18nResolved:r},i):i,this)),t}},{key:"resolve",value:function(t){var n,i,r,o,a,s=this,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=[t]),t.forEach(function(t){if(!s.isValidLookup(n)){var c=s.extractFromKey(t,l),d=c.key;i=d;var u=c.namespaces;s.options.fallbackNS&&(u=u.concat(s.options.fallbackNS));var m=void 0!==l.count&&"string"!=typeof l.count,h=m&&!l.ordinal&&0===l.count&&s.pluralResolver.shouldUseIntlApi(),f=void 0!==l.context&&("string"==typeof l.context||"number"==typeof l.context)&&""!==l.context,p=l.lngs?l.lngs:s.languageUtils.toResolveHierarchy(l.lng||s.language,l.fallbackLng);u.forEach(function(t){s.isValidLookup(n)||(a=t,!ti["".concat(p[0],"-").concat(t)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(a)&&(ti["".concat(p[0],"-").concat(t)]=!0,s.logger.warn('key "'.concat(i,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(a,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(function(i){if(!s.isValidLookup(n)){o=i;var a,c=[d];if(s.i18nFormat&&s.i18nFormat.addLookupKeys)s.i18nFormat.addLookupKeys(c,d,i,t,l);else{m&&(u=s.pluralResolver.getSuffix(i,l.count,l));var u,p="".concat(s.options.pluralSeparator,"zero");if(m&&(c.push(d+u),h&&c.push(d+p)),f){var b="".concat(d).concat(s.options.contextSeparator).concat(l.context);c.push(b),m&&(c.push(b+u),h&&c.push(b+p))}}for(;a=c.pop();)s.isValidLookup(n)||(r=a,n=s.getResource(i,t,a,l))}}))})}}),{res:n,usedKey:i,exactUsedKey:r,usedLng:o,usedNS:a}}},{key:"isValidLookup",value:function(t){return void 0!==t&&!(!this.options.returnNull&&null===t)&&!(!this.options.returnEmptyString&&""===t)}},{key:"getResource",value:function(t,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,i,r):this.resourceStore.getResource(t,n,i,r)}}],[{key:"hasDefaultValue",value:function(t){var n="defaultValue";for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&n===i.substring(0,n.length)&&void 0!==t[i])return!0;return!1}}]),r}(eZ);function to(t){return t.charAt(0).toUpperCase()+t.slice(1)}var ta=function(){function t(n){eP(this,t),this.options=n,this.supportedLngs=this.options.supportedLngs||!1,this.logger=eW.create("languageUtils")}return eB(t,[{key:"getScriptPartFromCode",value:function(t){if(!t||0>t.indexOf("-"))return null;var n=t.split("-");return 2===n.length||(n.pop(),"x"===n[n.length-1].toLowerCase())?null:this.formatLanguageCode(n.join("-"))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||0>t.indexOf("-"))return t;var n=t.split("-");return this.formatLanguageCode(n[0])}},{key:"formatLanguageCode",value:function(t){if("string"==typeof t&&t.indexOf("-")>-1){var n=["hans","hant","latn","cyrl","cans","mong","arab"],i=t.split("-");return this.options.lowerCaseLng?i=i.map(function(t){return t.toLowerCase()}):2===i.length?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=to(i[1].toLowerCase()))):3===i.length&&(i[0]=i[0].toLowerCase(),2===i[1].length&&(i[1]=i[1].toUpperCase()),"sgn"!==i[0]&&2===i[2].length&&(i[2]=i[2].toUpperCase()),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=to(i[1].toLowerCase())),n.indexOf(i[2].toLowerCase())>-1&&(i[2]=to(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isSupportedCode",value:function(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var n,i=this;return t?(t.forEach(function(t){if(!n){var r=i.formatLanguageCode(t);(!i.options.supportedLngs||i.isSupportedCode(r))&&(n=r)}}),!n&&this.options.supportedLngs&&t.forEach(function(t){if(!n){var r=i.getLanguagePartFromCode(t);if(i.isSupportedCode(r))return n=r;n=i.options.supportedLngs.find(function(t){if(0===t.indexOf(r))return t})}}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n):null}},{key:"getFallbackCodes",value:function(t,n){if(!t)return[];if("function"==typeof t&&(t=t(n)),"string"==typeof t&&(t=[t]),"[object Array]"===Object.prototype.toString.apply(t))return t;if(!n)return t.default||[];var i=t[n];return i||(i=t[this.getScriptPartFromCode(n)]),i||(i=t[this.formatLanguageCode(n)]),i||(i=t[this.getLanguagePartFromCode(n)]),i||(i=t.default),i||[]}},{key:"toResolveHierarchy",value:function(t,n){var i=this,r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),o=[],a=function(t){t&&(i.isSupportedCode(t)?o.push(t):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(t)))};return"string"==typeof t&&t.indexOf("-")>-1?("languageOnly"!==this.options.load&&a(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&a(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&a(this.getLanguagePartFromCode(t))):"string"==typeof t&&a(this.formatLanguageCode(t)),r.forEach(function(t){0>o.indexOf(t)&&a(i.formatLanguageCode(t))}),o}}]),t}(),ts=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],tl={1:function(t){return Number(t>1)},2:function(t){return Number(1!=t)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(1==t?0:t>=2&&t<=4?1:2)},7:function(t){return Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(1==t?0:2==t?1:t<7?2:t<11?3:4)},11:function(t){return Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(0!==t)},14:function(t){return Number(1==t?0:2==t?1:3==t?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:0!==t?1:2)},17:function(t){return Number(+(1!=t&&(t%10!=1||t%100==11)))},18:function(t){return Number(0==t?0:1==t?1:2)},19:function(t){return Number(1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(1==t?0:0==t||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:3*(t%100==3||t%100==4))},22:function(t){return Number(1==t?0:2==t?1:(t<0||t>10)&&t%10==0?2:3)}},tc=["v1","v2","v3"],td={zero:0,one:1,two:2,few:3,many:4,other:5},tu=function(){function t(n){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};eP(this,t),this.languageUtils=n,this.options=r,this.logger=eW.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(i={},ts.forEach(function(t){t.lngs.forEach(function(n){i[n]={numbers:t.nr,plurals:tl[t.fc]}})}),i)}return eB(t,[{key:"addRule",value:function(t,n){this.rules[t]=n}},{key:"getRule",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(t,{type:n.ordinal?"ordinal":"cardinal"})}catch(t){return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.getRule(t,n);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(t,i).map(function(t){return"".concat(n).concat(t)})}},{key:"getSuffixes",value:function(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(t,i);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort(function(t,n){return td[t]-td[n]}).map(function(t){return"".concat(n.options.prepend).concat(t)}):r.numbers.map(function(r){return n.getSuffix(t,r,i)}):[]}},{key:"getSuffix",value:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(t,i);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(n)):this.getSuffixRetroCompatible(r,n):(this.logger.warn("no plural rule found for: ".concat(t)),"")}},{key:"getSuffixRetroCompatible",value:function(t,n){var i=this,r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n)),o=t.numbers[r];this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var a=function(){return i.options.prepend&&o.toString()?i.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):a():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]?a():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!tc.includes(this.options.compatibilityJSON)}}]),t}();function tm(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function th(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?tm(Object(i),!0).forEach(function(n){eH(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):tm(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var tf=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};eP(this,t),this.logger=eW.create("interpolator"),this.options=n,this.format=n.interpolation&&n.interpolation.format||function(t){return t},this.init(n)}return eB(t,[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var n=t.interpolation;this.escape=void 0!==n.escape?n.escape:e5,this.escapeValue=void 0===n.escapeValue||n.escapeValue,this.useRawValueToEscape=void 0!==n.useRawValueToEscape&&n.useRawValueToEscape,this.prefix=n.prefix?e2(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?e2(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?e2(n.nestingPrefix):n.nestingPrefixEscaped||e2("$t("),this.nestingSuffix=n.nestingSuffix?e2(n.nestingSuffix):n.nestingSuffixEscaped||e2(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=void 0!==n.alwaysFormat&&n.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=RegExp(t,"g");var n="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=RegExp(n,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=RegExp(i,"g")}},{key:"interpolate",value:function(t,n,i,r){var o,a,s,l=this,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function d(t){return t.replace(/\$/g,"$$$$")}var u=function(t){if(0>t.indexOf(l.formatSeparator)){var o=e1(n,c,t);return l.alwaysFormat?l.format(o,void 0,i,th(th(th({},r),n),{},{interpolationkey:t})):o}var a=t.split(l.formatSeparator),s=a.shift().trim(),d=a.join(l.formatSeparator).trim();return l.format(e1(n,c,s),d,i,th(th(th({},r),n),{},{interpolationkey:s}))};this.resetRegExp();var m=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,h=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(t){return d(t)}},{regex:this.regexp,safeValue:function(t){return l.escapeValue?d(l.escape(t)):d(t)}}].forEach(function(n){for(s=0;o=n.regex.exec(t);){var i=o[1].trim();if(void 0===(a=u(i)))if("function"==typeof m){var c=m(t,o,r);a="string"==typeof c?c:""}else if(r&&r.hasOwnProperty(i))a="";else if(h){a=o[0];continue}else l.logger.warn("missed to pass in variable ".concat(i," for interpolating ").concat(t)),a="";else"string"==typeof a||l.useRawValueToEscape||(a=eK(a));var d=n.safeValue(a);if(t=t.replace(o[0],d),h?(n.regex.lastIndex+=a.length,n.regex.lastIndex-=o[0].length):n.regex.lastIndex=0,++s>=l.maxReplaces)break}}),t}},{key:"nest",value:function(t,n){var i,r,o=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=th({},a);function l(t,n){var i=this.nestingOptionsSeparator;if(0>t.indexOf(i))return t;var r=t.split(new RegExp("".concat(i,"[ ]*{"))),o="{".concat(r[1]);t=r[0];var a=(o=this.interpolate(o,s)).match(/'/g),l=o.match(/"/g);(a&&a.length%2==0&&!l||l.length%2!=0)&&(o=o.replace(/'/g,'"'));try{s=JSON.parse(o),n&&(s=th(th({},n),s))}catch(n){return this.logger.warn("failed parsing options string in nesting for key ".concat(t),n),"".concat(t).concat(i).concat(o)}return delete s.defaultValue,t}for(s.applyPostProcessor=!1,delete s.defaultValue;i=this.nestingRegexp.exec(t);){var c=[],d=!1;if(-1!==i[0].indexOf(this.formatSeparator)&&!/{.*}/.test(i[1])){var u=i[1].split(this.formatSeparator).map(function(t){return t.trim()});i[1]=u.shift(),c=u,d=!0}if((r=n(l.call(this,i[1].trim(),s),s))&&i[0]===t&&"string"!=typeof r)return r;"string"!=typeof r&&(r=eK(r)),r||(this.logger.warn("missed to resolve ".concat(i[1]," for nesting ").concat(t)),r=""),d&&(r=c.reduce(function(t,n){return o.format(t,n,a.lng,th(th({},a),{},{interpolationkey:i[1].trim()}))},r.trim())),t=t.replace(i[0],r),this.regexp.lastIndex=0}return t}}]),t}();function tp(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function tb(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?tp(Object(i),!0).forEach(function(n){eH(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):tp(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}function tg(t){var n={};return function(i,r,o){var a=r+JSON.stringify(o),s=n[a];return s||(s=t(r,o),n[a]=s),s(i)}}var t_=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};eP(this,t),this.logger=eW.create("formatter"),this.options=n,this.formats={number:tg(function(t,n){var i=new Intl.NumberFormat(t,n);return function(t){return i.format(t)}}),currency:tg(function(t,n){var i=new Intl.NumberFormat(t,tb(tb({},n),{},{style:"currency"}));return function(t){return i.format(t)}}),datetime:tg(function(t,n){var i=new Intl.DateTimeFormat(t,tb({},n));return function(t){return i.format(t)}}),relativetime:tg(function(t,n){var i=new Intl.RelativeTimeFormat(t,tb({},n));return function(t){return i.format(t,n.range||"day")}}),list:tg(function(t,n){var i=new Intl.ListFormat(t,tb({},n));return function(t){return i.format(t)}})},this.init(n)}return eB(t,[{key:"init",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},i=n.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(t,n){this.formats[t.toLowerCase().trim()]=n}},{key:"addCached",value:function(t,n){this.formats[t.toLowerCase().trim()]=tg(n)}},{key:"format",value:function(t,n,i,r){var o=this;return n.split(this.formatSeparator).reduce(function(t,n){var a=function(t){var n=t.toLowerCase().trim(),i={};if(t.indexOf("(")>-1){var r=t.split("(");n=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);"currency"===n&&0>o.indexOf(":")?i.currency||(i.currency=o.trim()):"relativetime"===n&&0>o.indexOf(":")?i.range||(i.range=o.trim()):o.split(";").forEach(function(t){if(t){var n,r=function(t){if(Array.isArray(t))return t}(n=t.split(":"))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||function(t,n){if(t){if("string"==typeof t)return eV(t,void 0);var i=Object.prototype.toString.call(t).slice(8,-1);if("Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return eV(t,void 0)}}(n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=r[0],a=r.slice(1).join(":").trim().replace(/^'+|'+$/g,"");i[o.trim()]||(i[o.trim()]=a),"false"===a&&(i[o.trim()]=!1),"true"===a&&(i[o.trim()]=!0),isNaN(a)||(i[o.trim()]=parseInt(a,10))}})}return{formatName:n,formatOptions:i}}(n),s=a.formatName,l=a.formatOptions;if(o.formats[s]){var c=t;try{var d=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},u=d.locale||d.lng||r.locale||r.lng||i;c=o.formats[s](t,u,tb(tb(tb({},l),r),d))}catch(t){o.logger.warn(t)}return c}return o.logger.warn("there was no format function for ".concat(s)),t},t)}}]),t}();function ty(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function tv(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ty(Object(i),!0).forEach(function(n){eH(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ty(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var tx=function(t){eY(r,t);var n,i=(n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=eU(r);return t=n?Reflect.construct(i,arguments,eU(this).constructor):i.apply(this,arguments),ej(this,t)});function r(t,n,o){var a,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return eP(this,r),a=i.call(this),e4&&eZ.call(ez(a)),a.backend=t,a.store=n,a.services=o,a.languageUtils=o.languageUtils,a.options=s,a.logger=eW.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=s.maxParallelReads||10,a.readingCalls=0,a.maxRetries=s.maxRetries>=0?s.maxRetries:5,a.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(o,s.backend,s),a}return eB(r,[{key:"queueLoad",value:function(t,n,i,r){var o=this,a={},s={},l={},c={};return t.forEach(function(t){var r=!0;n.forEach(function(n){var l="".concat(t,"|").concat(n);!i.reload&&o.store.hasResourceBundle(t,n)?o.state[l]=2:o.state[l]<0||(1===o.state[l]?void 0===s[l]&&(s[l]=!0):(o.state[l]=1,r=!1,void 0===s[l]&&(s[l]=!0),void 0===a[l]&&(a[l]=!0),void 0===c[n]&&(c[n]=!0)))}),r||(l[t]=!0)}),(Object.keys(a).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(a),pending:Object.keys(s),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}},{key:"loaded",value:function(t,n,i){var r=t.split("|"),o=r[0],a=r[1];n&&this.emit("failedLoading",o,a,n),i&&this.store.addResourceBundle(o,a,i),this.state[t]=n?-1:2;var s={};this.queue.forEach(function(i){var r,l,c,d,u;r=i.loaded,(d=(c=eJ(r,[o],Object)).obj)[u=c.k]=d[u]||[],l||d[u].push(a),void 0!==i.pending[t]&&(delete i.pending[t],i.pendingCount--),n&&i.errors.push(n),0!==i.pendingCount||i.done||(Object.keys(i.loaded).forEach(function(t){s[t]||(s[t]={});var n=i.loaded[t];n.length&&n.forEach(function(n){void 0===s[t][n]&&(s[t][n]=!0)})}),i.done=!0,i.errors.length?i.callback(i.errors):i.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(function(t){return!t.done})}},{key:"read",value:function(t,n,i){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;return t.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:t,ns:n,fcName:i,tried:o,wait:a,callback:s}):(this.readingCalls++,this.backend[i](t,n,function(l,c){if(r.readingCalls--,r.waitingReads.length>0){var d=r.waitingReads.shift();r.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(l&&c&&o<r.maxRetries)return void setTimeout(function(){r.read.call(r,t,n,i,o+1,2*a,s)},a);s(l,c)})):s(null,{})}},{key:"prepareLoading",value:function(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof n&&(n=[n]);var a=this.queueLoad(t,n,r,o);if(!a.toLoad.length)return a.pending.length||o(),null;a.toLoad.forEach(function(t){i.loadOne(t)})}},{key:"load",value:function(t,n,i){this.prepareLoading(t,n,{},i)}},{key:"reload",value:function(t,n,i){this.prepareLoading(t,n,{reload:!0},i)}},{key:"loadOne",value:function(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=t.split("|"),o=r[0],a=r[1];this.read(o,a,"read",void 0,void 0,function(r,s){r&&n.logger.warn("".concat(i,"loading namespace ").concat(a," for language ").concat(o," failed"),r),!r&&s&&n.logger.log("".concat(i,"loaded namespace ").concat(a," for language ").concat(o),s),n.loaded(t,r,s)})}},{key:"saveMissing",value:function(t,n,i,r,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n))return void this.logger.warn('did not save key "'.concat(i,'" as the namespace "').concat(n,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");null!=i&&""!==i&&(this.backend&&this.backend.create&&this.backend.create(t,n,i,r,null,tv(tv({},a),{},{isUpdate:o})),t&&t[0]&&this.store.addResource(t[0],n,i,r))}}]),r}(eZ);function tw(t){return"string"==typeof t.ns&&(t.ns=[t.ns]),"string"==typeof t.fallbackLng&&(t.fallbackLng=[t.fallbackLng]),"string"==typeof t.fallbackNS&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&0>t.supportedLngs.indexOf("cimode")&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function tF(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function tk(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?tF(Object(i),!0).forEach(function(n){eH(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):tF(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}function tE(){}var tT=function(t){eY(r,t);var n,i=(n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=eU(r);return t=n?Reflect.construct(i,arguments,eU(this).constructor):i.apply(this,arguments),ej(this,t)});function r(){var t,n,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if(eP(this,r),n=i.call(this),e4&&eZ.call(ez(n)),n.options=tw(o),n.services={},n.logger=eW,n.modules={external:[]},Object.getOwnPropertyNames(Object.getPrototypeOf(t=ez(n))).forEach(function(n){"function"==typeof t[n]&&(t[n]=t[n].bind(t))}),a&&!n.isInitialized&&!o.isClone){if(!n.options.initImmediate)return n.init(o,a),ej(n,ez(n));setTimeout(function(){n.init(o,a)},0)}return n}return eB(r,[{key:"init",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;"function"==typeof n&&(i=n,n={}),!n.defaultNS&&!1!==n.defaultNS&&n.ns&&("string"==typeof n.ns?n.defaultNS=n.ns:0>n.ns.indexOf("translation")&&(n.defaultNS=n.ns[0]));var r={debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if("object"===eI(t[1])&&(n=t[1]),"string"==typeof t[1]&&(n.defaultValue=t[1]),"string"==typeof t[2]&&(n.tDescription=t[2]),"object"===eI(t[2])||"object"===eI(t[3])){var i=t[3]||t[2];Object.keys(i).forEach(function(t){n[t]=i[t]})}return n},interpolation:{escapeValue:!0,format:function(t,n,i,r){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}};function o(t){return t?"function"==typeof t?new t:t:null}if(this.options=tk(tk(tk({},r),this.options),tw(n)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=tk(tk({},r.interpolation),this.options.interpolation)),void 0!==n.keySeparator&&(this.options.userDefinedKeySeparator=n.keySeparator),void 0!==n.nsSeparator&&(this.options.userDefinedNsSeparator=n.nsSeparator),!this.options.isClone){this.modules.logger?eW.init(o(this.modules.logger),this.options):eW.init(null,this.options),this.modules.formatter?a=this.modules.formatter:"undefined"!=typeof Intl&&(a=t_);var a,s=new ta(this.options);this.store=new e9(this.options.resources,this.options);var l=this.services;l.logger=eW,l.resourceStore=this.store,l.languageUtils=s,l.pluralResolver=new tu(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),a&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(l.formatter=o(a),l.formatter.init(l,this.options),this.options.interpolation.format=l.formatter.format.bind(l.formatter)),l.interpolator=new tf(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new tx(o(this.modules.backend),l.resourceStore,l,this.options),l.backendConnector.on("*",function(n){for(var i=arguments.length,r=Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];t.emit.apply(t,[n].concat(r))}),this.modules.languageDetector&&(l.languageDetector=o(this.modules.languageDetector),l.languageDetector.init(l,this.options.detection,this.options)),this.modules.i18nFormat&&(l.i18nFormat=o(this.modules.i18nFormat),l.i18nFormat.init&&l.i18nFormat.init(this)),this.translator=new tr(this.services,this.options),this.translator.on("*",function(n){for(var i=arguments.length,r=Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];t.emit.apply(t,[n].concat(r))}),this.modules.external.forEach(function(n){n.init&&n.init(t)})}if(this.format=this.options.interpolation.format,i||(i=tE),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&"dev"!==c[0]&&(this.options.lng=c[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(function(n){t[n]=function(){var i;return(i=t.store)[n].apply(i,arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(function(n){t[n]=function(){var i;return(i=t.store)[n].apply(i,arguments),t}});var d=eX(),u=function(){var n=function(n,r){t.isInitialized&&!t.initializedStoreOnce&&t.logger.warn("init: i18next is already initialized. You should call init just once!"),t.isInitialized=!0,t.options.isClone||t.logger.log("initialized",t.options),t.emit("initialized",t.options),d.resolve(r),i(n,r)};if(t.languages&&"v1"!==t.options.compatibilityAPI&&!t.isInitialized)return n(null,t.t.bind(t));t.changeLanguage(t.options.lng,n)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),d}},{key:"loadResources",value:function(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tE,r=i,o="string"==typeof t?t:this.language;if("function"==typeof t&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(o&&"cimode"===o.toLowerCase())return r();var a=[],s=function(t){t&&n.services.languageUtils.toResolveHierarchy(t).forEach(function(t){0>a.indexOf(t)&&a.push(t)})};o?s(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(function(t){return s(t)}),this.options.preload&&this.options.preload.forEach(function(t){return s(t)}),this.services.backendConnector.load(a,this.options.ns,function(t){t||n.resolvedLanguage||!n.language||n.setResolvedLanguage(n.language),r(t)})}else r(null)}},{key:"reloadResources",value:function(t,n,i){var r=eX();return t||(t=this.languages),n||(n=this.options.ns),i||(i=tE),this.services.backendConnector.reload(t,n,function(t){r.resolve(),i(t)}),r}},{key:"use",value:function(t){if(!t)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&te.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}},{key:"setResolvedLanguage",value:function(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1))for(var n=0;n<this.languages.length;n++){var i=this.languages[n];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}}},{key:"changeLanguage",value:function(t,n){var i=this;this.isLanguageChangingTo=t;var r=eX();this.emit("languageChanging",t);var o=function(t){i.language=t,i.languages=i.services.languageUtils.toResolveHierarchy(t),i.resolvedLanguage=void 0,i.setResolvedLanguage(t)},a=function(t,a){a?(o(a),i.translator.changeLanguage(a),i.isLanguageChangingTo=void 0,i.emit("languageChanged",a),i.logger.log("languageChanged",a)):i.isLanguageChangingTo=void 0,r.resolve(function(){return i.t.apply(i,arguments)}),n&&n(t,function(){return i.t.apply(i,arguments)})},s=function(n){t||n||!i.services.languageDetector||(n=[]);var r="string"==typeof n?n:i.services.languageUtils.getBestMatchFromCodes(n);r&&(i.language||o(r),i.translator.language||i.translator.changeLanguage(r),i.services.languageDetector&&i.services.languageDetector.cacheUserLanguage(r)),i.loadResources(r,function(t){a(t,r)})};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(s):s(t):s(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(t,n,i){var r=this,o=function t(n,o){if("object"!==eI(o)){for(var a,s=arguments.length,l=Array(s>2?s-2:0),c=2;c<s;c++)l[c-2]=arguments[c];a=r.options.overloadTranslationOptionHandler([n,o].concat(l))}else a=tk({},o);a.lng=a.lng||t.lng,a.lngs=a.lngs||t.lngs,a.ns=a.ns||t.ns,a.keyPrefix=a.keyPrefix||i||t.keyPrefix;var d=r.options.keySeparator||".",u=a.keyPrefix?"".concat(a.keyPrefix).concat(d).concat(n):n;return r.t(u,a)};return"string"==typeof t?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=i,o}},{key:"t",value:function(){var t;return this.translator&&(t=this.translator).translate.apply(t,arguments)}},{key:"exists",value:function(){var t;return this.translator&&(t=this.translator).exists.apply(t,arguments)}},{key:"setDefaultNamespace",value:function(t){this.options.defaultNS=t}},{key:"hasLoadedNamespace",value:function(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,a=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var s=function(t,i){var r=n.services.backendConnector.state["".concat(t,"|").concat(i)];return -1===r||2===r};if(i.precheck){var l=i.precheck(this,s);if(void 0!==l)return l}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,t)&&(!o||s(a,t)))}},{key:"loadNamespaces",value:function(t,n){var i=this,r=eX();return this.options.ns?("string"==typeof t&&(t=[t]),t.forEach(function(t){0>i.options.ns.indexOf(t)&&i.options.ns.push(t)}),this.loadResources(function(t){r.resolve(),n&&n(t)}),r):(n&&n(),Promise.resolve())}},{key:"loadLanguages",value:function(t,n){var i=eX();"string"==typeof t&&(t=[t]);var r=this.options.preload||[],o=t.filter(function(t){return 0>r.indexOf(t)});return o.length?(this.options.preload=r.concat(o),this.loadResources(function(t){i.resolve(),n&&n(t)}),i):(n&&n(),Promise.resolve())}},{key:"dir",value:function(t){return(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),t)?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr":"rtl"}},{key:"cloneInstance",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tE,o=tk(tk(tk({},this.options),n),{isClone:!0}),a=new r(o);return(void 0!==n.debug||void 0!==n.prefix)&&(a.logger=a.logger.clone(n)),["store","services","language"].forEach(function(n){a[n]=t[n]}),a.services=tk({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new tr(a.services,a.options),a.translator.on("*",function(t){for(var n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];a.emit.apply(a,[t].concat(i))}),a.init(o,i),a.translator.options=a.options,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),r}(eZ);eH(tT,"createInstance",function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new tT(t,n)});var tA=tT.createInstance();tA.createInstance=tT.createInstance,tA.createInstance,tA.init,tA.loadResources,tA.reloadResources,tA.use,tA.changeLanguage,tA.getFixedT,tA.t,tA.exists,tA.setDefaultNamespace,tA.hasLoadedNamespace,tA.loadNamespaces,tA.loadLanguages;let tM=tA;var tC=i(3348),tS=i.n(tC);!function(t){t.CREATE="CREATE",t.UPDATE="UPDATE",t.DELETE="DELETE"}(n||(n={})),function(t){t.LOW="LOW",t.MEDIUM="MEDIUM",t.HIGH="HIGH"}(o||(o={})),function(t){t.MANUAL="MANUAL",t.CLIENT="CLIENT",t.GLOBAL_RULESET="GLOBAL_RULESET",t.REALM_RULESET="REALM_RULESET",t.ASSET_RULESET="ASSET_RULESET",t.AGENT="AGENT"}(a||(a={})),function(t){t.OPEN="OPEN",t.ACKNOWLEDGED="ACKNOWLEDGED",t.IN_PROGRESS="IN_PROGRESS",t.RESOLVED="RESOLVED",t.CLOSED="CLOSED"}(s||(s={})),function(t){t.BOTTOM_LEFT="BOTTOM_LEFT",t.BOTTOM_RIGHT="BOTTOM_RIGHT",t.TOP_LEFT="TOP_LEFT",t.TOP_RIGHT="TOP_RIGHT"}(l||(l={})),function(t){t.CREATE="CREATE",t.READ="READ",t.UPDATE="UPDATE",t.DELETE="DELETE"}(c||(c={})),function(t){t.NONE="NONE",t.FORECAST="FORECAST",t.SETPOINT="SETPOINT"}(d||(d={})),function(t){t.DISCONNECTED="DISCONNECTED",t.CONNECTING="CONNECTING",t.DISCONNECTING="DISCONNECTING",t.CONNECTED="CONNECTED",t.DISABLED="DISABLED",t.WAITING="WAITING",t.ERROR="ERROR",t.STOPPED="STOPPED"}(u||(u={})),function(t){t.EV="EV",t.PHEV="PHEV"}(m||(m={})),function(t){t.YAZAKI="YAZAKI",t.MENNEKES="MENNEKES",t.LE_GRAND="LE_GRAND",t.CHADEMO="CHADEMO",t.COMBO="COMBO",t.SCHUKO="SCHUKO",t.ENERGYLOCK="ENERGYLOCK"}(h||(h={})),function(t){t.SOUTH="SOUTH",t.EAST_WEST="EAST_WEST"}(f||(f={})),function(t){t.REQUEST_START="REQUEST_START",t.REQUEST_REPEATING="REQUEST_REPEATING",t.REQUEST_CANCEL="REQUEST_CANCEL",t.READY="READY",t.COMPLETED="COMPLETED",t.RUNNING="RUNNING",t.CANCELLED="CANCELLED"}(p||(p={})),function(t){t.TOGGLE="TOGGLE",t.INCREMENT="INCREMENT",t.DECREMENT="DECREMENT",t.NEGATE="NEGATE"}(b||(b={})),function(t){t.ASSET_NOT_FOUND="ASSET_NOT_FOUND",t.ATTRIBUTE_NOT_FOUND="ATTRIBUTE_NOT_FOUND",t.INSUFFICIENT_ACCESS="INSUFFICIENT_ACCESS",t.INVALID_VALUE="INVALID_VALUE",t.INTERCEPTOR_FAILURE="INTERCEPTOR_FAILURE",t.STATE_STORAGE_FAILED="STATE_STORAGE_FAILED",t.CANNOT_PROCESS="CANNOT_PROCESS",t.QUEUE_FULL="QUEUE_FULL",t.UNKNOWN="UNKNOWN",t.ASSET_ID_MISSING="ASSET_ID_MISSING",t.ATTRIBUTE_NAME_MISSING="ATTRIBUTE_NAME_MISSING"}(g||(g={})),function(t){t.PUBLIC="PUBLIC",t.SHARED="SHARED",t.PRIVATE="PRIVATE"}(_||(_={})),function(t){t.OFF="OFF",t.ONE_MIN="ONE_MIN",t.FIVE_MIN="FIVE_MIN",t.QUARTER="QUARTER",t.ONE_HOUR="ONE_HOUR"}(y||(y={})),function(t){t.WRAP_TO_SINGLE_COLUMN="WRAP_TO_SINGLE_COLUMN",t.KEEP_LAYOUT="KEEP_LAYOUT",t.REDIRECT="REDIRECT",t.BLOCK_DEVICE="BLOCK_DEVICE"}(v||(v={})),function(t){t.MINUTE="MINUTE",t.HOUR="HOUR",t.DAY="DAY",t.WEEK="WEEK",t.MONTH="MONTH",t.YEAR="YEAR"}(x||(x={})),function(t){t.MIN="MIN",t.AVG="AVG",t.MAX="MAX",t.DIFFERENCE="DIFFERENCE",t.COUNT="COUNT",t.SUM="SUM",t.MODE="MODE",t.MEDIAN="MEDIAN"}(w||(w={})),function(t){t.TERMINATING="TERMINATING",t.DISABLED="DISABLED",t.ALREADY_CONNECTED="ALREADY_CONNECTED",t.UNRECOGNISED="UNRECOGNISED",t.PERMANENT_ERROR="PERMANENT_ERROR",t.SYNC_ERROR="SYNC_ERROR"}(F||(F={})),function(t){t.HTTPS="HTTPS",t.HTTP="HTTP",t.TCP="TCP"}(k||(k={})),function(t){t.GET="GET",t.POST="POST",t.PUT="PUT",t.DELETE="DELETE",t.OPTIONS="OPTIONS",t.PATCH="PATCH"}(E||(E={})),function(t){t.KEYCLOAK="KEYCLOAK",t.BASIC="BASIC",t.NONE="NONE"}(T||(T={})),function(t){t.WEBSOCKET="WEBSOCKET",t.POLLING="POLLING"}(A||(A={})),function(t){t.VECTOR="VECTOR",t.RASTER="RASTER"}(M||(M={})),function(t){t.INTERNAL="INTERNAL",t.CLIENT="CLIENT",t.GLOBAL_RULESET="GLOBAL_RULESET",t.REALM_RULESET="REALM_RULESET",t.ASSET_RULESET="ASSET_RULESET"}(C||(C={})),function(t){t.REALM="REALM",t.USER="USER",t.ASSET="ASSET",t.CUSTOM="CUSTOM"}(S||(S={})),function(t){t.NORMAL="NORMAL",t.HIGH="HIGH"}(D||(D={})),function(t){t.DEVICE="DEVICE",t.TOPIC="TOPIC",t.CONDITION="CONDITION"}(I||(I={})),function(t){t.ALWAYS="ALWAYS",t.ONCE="ONCE",t.HOURLY="HOURLY",t.DAILY="DAILY",t.WEEKLY="WEEKLY",t.MONTHLY="MONTHLY",t.ANNUALLY="ANNUALLY"}(P||(P={})),function(t){t.MESSAGE_INVALID="MESSAGE_INVALID",t.CERTIFICATE_INVALID="CERTIFICATE_INVALID",t.UNAUTHORIZED="UNAUTHORIZED",t.FORBIDDEN="FORBIDDEN",t.UNIQUE_ID_MISMATCH="UNIQUE_ID_MISMATCH",t.CONFIG_DISABLED="CONFIG_DISABLED",t.USER_DISABLED="USER_DISABLED",t.SERVER_ERROR="SERVER_ERROR",t.ASSET_ERROR="ASSET_ERROR",t.SERVER_BUSY="SERVER_BUSY"}(R||(R={})),function(t){t.PRIVATE="PRIVATE",t.PROTECTED="PROTECTED",t.PUBLIC="PUBLIC"}(O||(O={})),function(t){t.EXACT="EXACT",t.BEGIN="BEGIN",t.END="END",t.CONTAINS="CONTAINS"}(B||(B={})),function(t){t.EQUALS="EQUALS",t.GREATER_THAN="GREATER_THAN",t.GREATER_EQUALS="GREATER_EQUALS",t.LESS_THAN="LESS_THAN",t.LESS_EQUALS="LESS_EQUALS",t.BETWEEN="BETWEEN"}(z||(z={})),function(t){t.CREATED_ON="CREATED_ON",t.NAME="NAME",t.ASSET_TYPE="ASSET_TYPE",t.PARENT_ID="PARENT_ID",t.REALM="REALM"}(N||(N={})),function(t){t.RESTRICTED="RESTRICTED",t.LINKED="LINKED",t.REALM="REALM"}(Y||(Y={})),function(t){t.AT_LEAST_ONE="AT_LEAST_ONE",t.ALL="ALL",t.NONE="NONE"}(j||(j={})),function(t){t.AND="AND",t.OR="OR"}(U||(U={})),function(t){t.CREATED_ON="CREATED_ON",t.FIRST_NAME="FIRST_NAME",t.LAST_NAME="LAST_NAME",t.USERNAME="USERNAME",t.EMAIL="EMAIL"}(H||(H={})),function(t){t.STOPPED="STOPPED",t.RUNNING="RUNNING",t.ERROR="ERROR"}(V||(V={})),function(t){t.JAVASCRIPT="JAVASCRIPT",t.GROOVY="GROOVY",t.JSON="JSON",t.FLOW="FLOW"}(G||(G={})),function(t){t.READY="READY",t.DEPLOYED="DEPLOYED",t.COMPILATION_ERROR="COMPILATION_ERROR",t.VALIDITY_PERIOD_ERROR="VALIDITY_PERIOD_ERROR",t.EXECUTION_ERROR="EXECUTION_ERROR",t.LOOP_ERROR="LOOP_ERROR",t.DISABLED="DISABLED",t.PAUSED="PAUSED",t.EXPIRED="EXPIRED",t.REMOVED="REMOVED",t.EMPTY="EMPTY"}(q||(q={})),function(t){t.SUNRISE="SUNRISE",t.SUNSET="SUNSET",t.TWILIGHT_MORNING_VISUAL="TWILIGHT_MORNING_VISUAL",t.TWILIGHT_MORNING_VISUAL_LOWER="TWILIGHT_MORNING_VISUAL_LOWER",t.TWILIGHT_MORNING_HORIZON="TWILIGHT_MORNING_HORIZON",t.TWILIGHT_MORNING_CIVIL="TWILIGHT_MORNING_CIVIL",t.TWILIGHT_MORNING_NAUTICAL="TWILIGHT_MORNING_NAUTICAL",t.TWILIGHT_MORNING_ASTRONOMICAL="TWILIGHT_MORNING_ASTRONOMICAL",t.TWILIGHT_MORNING_GOLDEN_HOUR="TWILIGHT_MORNING_GOLDEN_HOUR",t.TWILIGHT_MORNING_BLUE_HOUR="TWILIGHT_MORNING_BLUE_HOUR",t.TWILIGHT_MORNING_NIGHT_HOUR="TWILIGHT_MORNING_NIGHT_HOUR",t.TWILIGHT_EVENING_VISUAL="TWILIGHT_EVENING_VISUAL",t.TWILIGHT_EVENING_VISUAL_LOWER="TWILIGHT_EVENING_VISUAL_LOWER",t.TWILIGHT_EVENING_HORIZON="TWILIGHT_EVENING_HORIZON",t.TWILIGHT_EVENING_CIVIL="TWILIGHT_EVENING_CIVIL",t.TWILIGHT_EVENING_NAUTICAL="TWILIGHT_EVENING_NAUTICAL",t.TWILIGHT_EVENING_ASTRONOMICAL="TWILIGHT_EVENING_ASTRONOMICAL",t.TWILIGHT_EVENING_GOLDEN_HOUR="TWILIGHT_EVENING_GOLDEN_HOUR",t.TWILIGHT_EVENING_BLUE_HOUR="TWILIGHT_EVENING_BLUE_HOUR",t.TWILIGHT_EVENING_NIGHT_HOUR="TWILIGHT_EVENING_NIGHT_HOUR"}($||($={})),function(t){t.NUMBER="NUMBER",t.NUMBER_ARRAY="NUMBER_ARRAY",t.STRING="STRING",t.BOOLEAN="BOOLEAN",t.TRIGGER="TRIGGER",t.COLOR="COLOR",t.ANY="ANY"}(W||(W={})),function(t){t.NEW_LINE="NEW_LINE",t.SPACER="SPACER"}(Z||(Z={})),function(t){t.INPUT="INPUT",t.PROCESSOR="PROCESSOR",t.OUTPUT="OUTPUT",t.THEN="THEN"}(X||(X={})),function(t){t.TEXT="TEXT",t.MULTILINE="MULTILINE",t.NUMBER="NUMBER",t.DROPDOWN="DROPDOWN",t.DOUBLE_DROPDOWN="DOUBLE_DROPDOWN",t.CHECKBOX="CHECKBOX",t.ASSET_ATTRIBUTE="ASSET_ATTRIBUTE",t.COLOR="COLOR",t.DATE="DATE"}(K||(K={})),function(t){t.ADD="ADD",t.ADD_OR_REPLACE="ADD_OR_REPLACE",t.REPLACE="REPLACE",t.DELETE="DELETE",t.CLEAR="CLEAR"}(J||(J={})),function(t){t.PER_ASSET="PER_ASSET",t.GLOBAL="GLOBAL"}(Q||(Q={})),function(t){t.READ_ADMIN="read:admin",t.READ_LOGS="read:logs",t.READ_USERS="read:users",t.READ_MAP="read:map",t.READ_ASSETS="read:assets",t.READ_RULES="read:rules",t.READ_INSIGHTS="read:insights",t.READ_ALARMS="read:alarms",t.READ_SERVICES="read:services",t.WRITE_SERVICES="write:services",t.WRITE_USER="write:user",t.WRITE_ADMIN="write:admin",t.WRITE_LOGS="write:logs",t.WRITE_ASSETS="write:assets",t.WRITE_ATTRIBUTES="write:attributes",t.WRITE_RULES="write:rules",t.WRITE_INSIGHTS="write:insights",t.WRITE_ALARMS="write:alarms",t.READ="read",t.WRITE="write"}(ee||(ee={})),function(t){t.REGISTER="REGISTER",t.UPDATE="UPDATE",t.DEREGISTER="DEREGISTER"}(et||(et={})),function(t){t.AVAILABLE="AVAILABLE",t.UNAVAILABLE="UNAVAILABLE"}(en||(en={})),function(t){t.ASSET="ASSET",t.AGENT="AGENT",t.NOTIFICATION="NOTIFICATION",t.ALARM="ALARM",t.RULES="RULES",t.PROTOCOL="PROTOCOL",t.GATEWAY="GATEWAY",t.MODEL_AND_VALUES="MODEL_AND_VALUES",t.API="API",t.DATA="DATA"}(ei||(ei={})),function(t){t.INFO="INFO",t.WARN="WARN",t.ERROR="ERROR"}(er||(er={})),function(t){t.NUMERIC="numeric",t.DIGIT_2="2-digit",t.FULL="full",t.LONG="long",t.MEDIUM="medium",t.SHORT="short",t.NARROW="narrow"}(eo||(eo={})),function(t){t.SECONDLY="SECONDLY",t.MINUTELY="MINUTELY",t.HOURLY="HOURLY",t.DAILY="DAILY",t.WEEKLY="WEEKLY",t.MONTHLY="MONTHLY",t.YEARLY="YEARLY"}(ea||(ea={})),function(t){t.OMIT="OMIT",t.BACKWARD="BACKWARD",t.FORWARD="FORWARD"}(es||(es={})),function(t){t.JAPANESE="JAPANESE",t.BUDDHIST="BUDDHIST",t.ROC="ROC",t.ISLAMIC="ISLAMIC",t.ISO8601="ISO8601",t.CHINESE="CHINESE",t.ETHIOPIC="ETHIOPIC",t.HEBREW="HEBREW",t.GREGORIAN="GREGORIAN"}(el||(el={})),function(t){t.SU="SU",t.MO="MO",t.TU="TU",t.WE="WE",t.TH="TH",t.FR="FR",t.SA="SA"}(ec||(ec={})),function(t){t.PEOPLECOUNTERASSET="PeopleCounterAsset",t.STORAGESIMULATORAGENT="StorageSimulatorAgent",t.CITYASSET="CityAsset",t.ELECTRICITYCONSUMERASSET="ElectricityConsumerAsset",t.ELECTRICVEHICLEASSET="ElectricVehicleAsset",t.CONSOLEASSET="ConsoleAsset",t.PRESENCESENSORASSET="PresenceSensorAsset",t.LIGHTASSET="LightAsset",t.THETHINGSSTACKAGENT="TheThingsStackAgent",t.PLUGASSET="PlugAsset",t.ELECTRICITYCHARGERASSET="ElectricityChargerAsset",t.ELECTRICITYBATTERYASSET="ElectricityBatteryAsset",t.ELECTRICITYSUPPLIERASSET="ElectricitySupplierAsset",t.TCPAGENT="TCPAgent",t.SERIALAGENT="SerialAgent",t.BLUETOOTHMESHAGENT="BluetoothMeshAgent",t.SNMPAGENT="SNMPAgent",t.GROUPASSET="GroupAsset",t.BUILDINGASSET="BuildingAsset",t.ELECTRICITYPRODUCERWINDASSET="ElectricityProducerWindAsset",t.ENVIRONMENTSENSORASSET="EnvironmentSensorAsset",t.MQTTAGENT="MQTTAgent",t.MICROPHONEASSET="MicrophoneAsset",t.MODBUSTCPAGENT="ModbusTcpAgent",t.HTTPAGENT="HTTPAgent",t.DOORASSET="DoorAsset",t.ELECTRICITYPRODUCERASSET="ElectricityProducerAsset",t.MAILAGENT="MailAgent",t.UDPAGENT="UDPAgent",t.ROOMASSET="RoomAsset",t.VENTILATIONASSET="VentilationAsset",t.TRADFRILIGHTASSET="TradfriLightAsset",t.KNXAGENT="KNXAgent",t.OPENWEATHERMAPAGENT="OpenWeatherMapAgent",t.CHIRPSTACKAGENT="ChirpStackAgent",t.WEATHERASSET="WeatherAsset",t.THINGASSET="ThingAsset",t.WEBSOCKETAGENT="WebsocketAgent",t.GATEWAYASSET="GatewayAsset",t.PARKINGASSET="ParkingAsset",t.TRADFRIPLUGASSET="TradfriPlugAsset",t.SIMULATORAGENT="SimulatorAgent",t.MODBUSSERIALAGENT="ModbusSerialAgent",t.ELECTRICVEHICLEFLEETGROUPASSET="ElectricVehicleFleetGroupAsset",t.VELBUSTCPAGENT="VelbusTCPAgent",t.ARTNETLIGHTASSET="ArtnetLightAsset",t.VELBUSSERIALAGENT="VelbusSerialAgent",t.GROUNDWATERSENSORASSET="GroundwaterSensorAsset",t.ELECTRICITYPRODUCERSOLARASSET="ElectricityProducerSolarAsset",t.ENERGYOPTIMISATIONASSET="EnergyOptimisationAsset",t.ZWAVEAGENT="ZWaveAgent",t.THERMOSTATASSET="ThermostatAsset",t.SHIPASSET="ShipAsset"}(ed||(ed={})),function(t){t.SUPPORTSEXPORT="supportsExport",t.MQTTPORT="MQTTPort",t.ENERGYSELFCONSUMPTION="energySelfConsumption",t.LASTACCESS="lastAccess",t.CHARGERID="chargerID",t.POSITION="position",t.CARBONSAVING="carbonSaving",t.ROUTINGMODE="routingMode",t.LASTWILLRETAIN="lastWillRetain",t.LASTWILLTOPIC="lastWillTopic",t.SERIALBAUDRATE="serialBaudrate",t.BASEURL="baseURL",t.REQUIREDVALUES="requiredValues",t.FINANCIALSAVING="financialSaving",t.FLEETCATEGORY="fleetCategory",t.GATEWAYSTATUS="gatewayStatus",t.NO2LEVEL="NO2Level",t.ATMOSPHERICPRESSURE="atmosphericPressure",t.TAGS="tags",t.UNLOCK="unlock",t.MILEAGEMIN="mileageMin",t.CHECKINTERVALSECONDS="checkIntervalSeconds",t.LOCATION="location",t.CLIENTSECRET="clientSecret",t.WINDDIRECTION="windDirection",t.WINDSPEED="windSpeed",t.PARTICLESPM10="particlesPM10",t.APPLICATIONKEY="applicationKey",t.POWEREXPORTMAX="powerExportMax",t.SETWINDACTUALVALUEWITHFORECAST="setWindActualValueWithForecast",t.WATERLEVEL="waterLevel",t.CONSOLENAME="consoleName",t.CONNECTHEADERS="connectHeaders",t.WEBSOCKETQUERY="websocketQuery",t.PREFERHTML="preferHTML",t.COOLING="cooling",t.POLLINGMILLIS="pollingMillis",t.SOILTEMPERATURE="soilTemperature",t.SUNIRRADIANCE="sunIrradiance",t.ODOMETER="odometer",t.SUPPORTSIMPORT="supportsImport",t.MESSAGEMAXLENGTH="messageMaxLength",t.WINDGUSTSPEED="windGustSpeed",t.ENERGYLEVELPERCENTAGEMIN="energyLevelPercentageMin",t.LIGHTID="lightId",t.POWER="power",t.STREET="street",t.DELETEPROCESSEDMAIL="deleteProcessedMail",t.WINDSPEEDMIN="windSpeedMin",t.POWERSETPOINT="powerSetpoint",t.PRESENCE="presence",t.SPACESOCCUPIED="spacesOccupied",t.STARTTLS="startTLS",t.AGENTSTATUS="agentStatus",t.MESSAGECHARSET="messageCharset",t.CERTIFICATEALIAS="certificateAlias",t.PANELPITCH="panelPitch",t.EMAIL="email",t.BINDPORT="bindPort",t.PARTICLESPM1="particlesPM1",t.SPEED="speed",t.ENERGYLEVELPERCENTAGEMAX="energyLevelPercentageMax",t.MESSAGESTRIPDELIMITER="messageStripDelimiter",t.AREA="area",t.COUNTRY="country",t.SHIPTYPE="shipType",t.CONNECTSUBSCRIPTIONS="connectSubscriptions",t.RELATIVEHUMIDITY="relativeHumidity",t.INCLUDEFORECASTWINDSERVICE="includeForecastWindService",t.SOURCEADDRESS="sourceAddress",t.RAINFALL="rainfall",t.ENERGYIMPORTTOTAL="energyImportTotal",t.OAUTHGRANT="oAuthGrant",t.OZONELEVEL="ozoneLevel",t.COUNTINMINUTE="countInMinute",t.PORT="port",t.TUNNELINGSUPPORTED="tunnelingSupported",t.ENINUMBER="ENINumber",t.AGENTDISABLED="agentDisabled",t.DISABLED="disabled",t.FORCECHARGE="forceCharge",t.TIMEINJECTIONINTERVAL="timeInjectionInterval",t.FINANCIALWEIGHTING="financialWeighting",t.ENERGYLEVELPERCENTAGE="energyLevelPercentage",t.SPACESBUFFER="spacesBuffer",t.VEHICLECATEGORY="vehicleCategory",t.FANSPEED="fanSpeed",t.FINANCIALCOST="financialCost",t.NOTES="notes",t.MAILFOLDERNAME="mailFolderName",t.TEMPERATURE="temperature",t.AVAILABLECHARGINGSPACES="availableChargingSpaces",t.ENERGYCAPACITY="energyCapacity",t.POWERIMPORTMIN="powerImportMin",t.INTERVALSIZE="intervalSize",t.SNMPVERSIONVALUE="SNMPVersionValue",t.SOUNDLEVEL="soundLevel",t.UNITID="unitId",t.STOPBITS="stopBits",t.CONNECTURL="connectURL",t.CLIENTID="clientId",t.VEHICLEID="vehicleID",t.SUNAZIMUTH="sunAzimuth",t.AVAILABLEDISCHARGINGSPACES="availableDischargingSpaces",t.WEBSOCKETMODE="websocketMode",t.COLOURTEMPERATURE="colourTemperature",t.VEHICLECONNECTED="vehicleConnected",t.DATABITS="dataBits",t.MILEAGEMINIMUM="mileageMinimum",t.COLOURRGB="colourRGB",t.CARBONIMPORT="carbonImport",t.WILDCARDSUBSCRIPTIONTOPICS="wildcardSubscriptionTopics",t.PRICEHOURLY="priceHourly",t.WINDSPEEDMAX="windSpeedMax",t.PINGDISABLED="pingDisabled",t.FLOW="flow",t.CHILDASSETTYPE="childAssetType",t.NETWORKKEY="networkKey",t.UNIVERSE="universe",t.MSSINUMBER="MSSINumber",t.SUBSCRIBEQOS="subscribeQos",t.LEDCOUNT="lEDCount",t.LOCKED="locked",t.CLOUDCOVERAGE="cloudCoverage",t.PROTOCOL="protocol",t.TARIFFIMPORT="tariffImport",t.ENERGYRENEWABLESHARE="energyRenewableShare",t.REGION="region",t.CONSOLEPLATFORM="consolePlatform",t.POWEREXPORTMIN="powerExportMin",t.EFFICIENCYEXPORT="efficiencyExport",t.CHARGECYCLES="chargeCycles",t.SERIALPORT="serialPort",t.APPLICATIONID="applicationId",t.PANELORIENTATION="panelOrientation",t.LENGTH="length",t.PROBABILITYOFPRECIPITATION="probabilityOfPrecipitation",t.USERNAMEPASSWORD="usernamePassword",t.POWERFORECAST="powerForecast",t.SETACTUALSOLARVALUEWITHFORECAST="setActualSolarValueWithForecast",t.REQUESTQUERYPARAMETERS="requestQueryParameters",t.PROXYADDRESS="proxyAddress",t.MQTTHOST="MQTTHost",t.ENERGYLOCAL="energyLocal",t.ENERGYAUTARKY="energyAutarky",t.MODEL="model",t.MANUFACTURER="manufacturer",t.ONOFF="onOff",t.RESUMESESSION="resumeSession",t.TARIFFEXPORT="tariffExport",t.APIKEY="ApiKey",t.CITY="city",t.CONNECTORTYPE="connectorType",t.ENERGYEXPORTTOTAL="energyExportTotal",t.CARBONEXPORT="carbonExport",t.REQUESTTIMEOUTMILLIS="requestTimeoutMillis",t.ENERGYLEVEL="energyLevel",t.OPTIMISATIONDISABLED="optimisationDisabled",t.WEBSOCKETPATH="websocketPath",t.WINDSPEEDREFERENCE="windSpeedReference",t.PRICEDAILY="priceDaily",t.COUNTGROWTHMINUTE="countGrowthMinute",t.IMONUMBER="IMONumber",t.ATTRIBUTION="Attribution",t.INCLUDEFORECASTSOLARSERVICE="includeForecastSolarService",t.REQUESTHEADERS="requestHeaders",t.TENANTID="tenantId",t.HOST="host",t.COUNTOUTMINUTE="countOutMinute",t.ENERGYTYPE="energyType",t.CONSOLEVERSION="consoleVersion",t.MTU="mtu",t.PANELAZIMUTH="panelAzimuth",t.SEQUENCENUMBER="sequenceNumber",t.SUNALTITUDE="sunAltitude",t.COUNTOUT="countOut",t.CHARGERCONNECTED="chargerConnected",t.ROOMNUMBER="roomNumber",t.PARTICLESPM2_5="particlesPM2_5",t.MESSAGESOURCEADDRESS="messageSourceAddress",t.COUNTIN="countIn",t.MILEAGECHARGED="mileageCharged",t.PROVISIONWEATHERASSET="ProvisionWeatherAsset",t.TEMPERATURESETPOINT="temperatureSetpoint",t.CONSOLEPROVIDERS="consoleProviders",t.POWERIMPORTMAX="powerImportMax",t.COUNTTOTAL="countTotal",t.SPACESTOTAL="spacesTotal",t.BINDHOST="bindHost",t.MESSAGECONVERTBINARY="messageConvertBinary",t.MESSAGEDELIMITERS="messageDelimiters",t.EFFICIENCYIMPORT="efficiencyImport",t.SUNZENITH="sunZenith",t.BRIGHTNESS="brightness",t.POSTALCODE="postalCode",t.SPACESOPEN="spacesOpen",t.HUMIDITY="humidity",t.SECUREMODE="secureMode",t.MILEAGECAPACITY="mileageCapacity",t.DIRECTION="direction",t.ENERGYLEVELSCHEDULE="energyLevelSchedule",t.UVINDEX="uVIndex",t.NATMODE="NATMode",t.UPDATEONWRITE="updateOnWrite",t.LASTWILLPAYLOAD="lastWillPayload",t.GROUPID="groupId",t.FOLLOWREDIRECTS="followRedirects",t.CARBONCOST="carbonCost",t.MESSAGECONVERTHEX="messageConvertHex",t.PUBLISHQOS="publishQos"}(eu||(eu={})),function(t){t.FORMAT="format",t.RULESTATE="ruleState",t.HASPREDICTEDDATAPOINTS="hasPredictedDataPoints",t.STOREDATAPOINTS="storeDataPoints",t.LABEL="label",t.CONSTRAINTS="constraints",t.SHOWONDASHBOARD="showOnDashboard",t.READONLY="readOnly",t.MULTILINE="multiline",t.ACCESSPUBLICWRITE="accessPublicWrite",t.MOMENTARY="momentary",t.AGENTLINK="agentLink",t.ACCESSRESTRICTEDREAD="accessRestrictedRead",t.DATAPOINTSMAXAGEDAYS="dataPointsMaxAgeDays",t.ACCESSRESTRICTEDWRITE="accessRestrictedWrite",t.SECRET="secret",t.ATTRIBUTELINKS="attributeLinks",t.RULERESETIMMEDIATE="ruleResetImmediate",t.AGENTLINKCONFIG="agentLinkConfig",t.FORECAST="forecast",t.UNITS="units",t.USERCONNECTED="userConnected",t.ACCESSPUBLICREAD="accessPublicRead"}(em||(em={})),function(t){t.WSURL="WS_URL",t.POSITIVENUMBER="positiveNumber",t.VALUEDESCRIPTOR="valueDescriptor",t.LONG="long",t.BOOLEANMAP="booleanMap",t.MQTTQOS="MQTTQos",t.GEOJSONPOINT="GEO_JSONPoint",t.SNMPVERSION="SNMPVersion",t.ASSETTYPE="assetType",t.JSONOBJECT="JSONObject",t.BIGNUMBER="bigNumber",t.IPADDRESS="IPAddress",t.EMAIL="email",t.KNXMESSAGESOURCEADDRESS="kNXMessageSourceAddress",t.ATTRIBUTEREFERENCE="attributeReference",t.INTEGER="integer",t.OAUTHGRANT="oAuthGrant",t.NUMBER="number",t.TEXTMAP="textMap",t.WEBSOCKETSUBSCRIPTION="websocketSubscription",t.BOOLEAN="boolean",t.TIMEANDPERIODDURATIONISO8601="timeAndPeriodDurationISO8601",t.TIMESTAMPISO8601="timestampISO8601",t.MULTIVALUEDTEXTMAP="multivaluedTextMap",t.JSON="JSON",t.INTEGERBYTE="integerByte",t.AGENTLINK="agentLink",t.CALENDAREVENT="calendarEvent",t.CONNECTIONSTATUS="connectionStatus",t.VALUECONSTRAINT="valueConstraint",t.ASSETQUERY="assetQuery",t.COLOURRGB="colourRGB",t.VALUEFORMAT="valueFormat",t.TEXT="text",t.BYTE="byte",t.USERNAMEANDPASSWORD="usernameAndPassword",t.HTTPURL="HTTP_URL",t.ATTRIBUTELINK="attributeLink",t.ASSETID="assetID",t.NUMBERMAP="numberMap",t.HTTPMETHOD="HTTPMethod",t.PANELORIENTATION="panelOrientation",t.ATTRIBUTESTATE="attributeState",t.POSITIVEINTEGER="positiveInteger",t.EXECUTIONSTATUS="executionStatus",t.BIGINTEGER="bigInteger",t.PERIODDURATIONISO8601="periodDurationISO8601",t.DATEANDTIME="dateAndTime",t.CONNECTORTYPE="connectorType",t.NEGATIVEINTEGER="negativeInteger",t.TCPIPPORTNUMBER="TCP_IPPortNumber",t.INTEGERMAP="integerMap",t.ENERGYTYPE="energyType",t.TIMESTAMP="timestamp",t.UUID="UUID",t.FORECASTCONFIGURATION="forecastConfiguration",t.TIMEDURATIONISO8601="timeDurationISO8601",t.CONSOLEPROVIDERS="consoleProviders",t.NEGATIVENUMBER="negativeNumber",t.CRONEXPRESSION="CRONExpression",t.DIRECTION="direction",t.HOSTORIPADDRESS="hostOrIPAddress"}(eh||(eh={})),function(t){t.MONTH="month",t.MILE_SCANDINAVIAN="mile_scandinavian",t.YEAR="year",t.VOLT="volt",t.HERTZ="hertz",t.MILE="mile",t.BTU="btu",t.FOOT="foot",t.MEGA="mega",t.INCH="inch",t.IN_HG="inch_mercury",t.CENTI="centi",t.GRAM="gram",t.KNOT="knot",t.METRE="metre",t.LITRE="litre",t.FLUID_OUNCE="fluid_ounce",t.CELSIUS="celsius",t.DECIBEL="decibel",t.FAHRENHEIT="fahrenheit",t.WATT="watt",t.PEAK="peak",t.MICRO="micro",t.PER="per",t.STONE="stone",t.VAR="var",t.OUNCE="ounce",t.HECTARE="hectare",t.YARD="yard",t.JOULE="joule",t.DEGREE="degree",t.KILO="kilo",t.KELVIN="kelvin",t.CARBON="carbon",t.DECIBEL_ATTENUATED="decibel_attenuated",t.SQUARED="squared",t.PERCENTAGE="percentage",t.CUBED="cubed",t.DAY="day",t.RADIAN="radian",t.OHM="ohm",t.MINUTE="minute",t.PART_PER_MILLION="ppm",t.AMP="amp",t.MASS_POUND="pound",t.HOUR="hour",t.ACRE="acre",t.RPM="rpm",t.PASCAL="pascal",t.LUMEN="lumen",t.WEEK="week",t.GALLON="gallon",t.LUX="lux",t.MILLI="milli",t.BAR="bar",t.HECTO="hecto",t.SECOND="second"}(ef||(ef={})),ep||(ep={});class tL{static getAssetDescriptors(){return tL._assetTypeInfos.map(t=>t.assetDescriptor)}static getMetaItemDescriptors(){return[...this._metaItemDescriptors]}static getValueDescriptors(){return[...this._valueDescriptors]}static getAssetTypeInfos(){return[...this._assetTypeInfos]}static getAssetTypeInfo(t){if(t)return t.assetDescriptor?t:("string"!=typeof t&&(t=t.name),this._assetTypeInfos.find(n=>n.assetDescriptor.name===t))}static getAssetDescriptor(t){if(!t)return;if(t.assetDescriptor)return t.assetDescriptor;if("string"!=typeof t)return t;let n=this._assetTypeInfos.find(n=>n.assetDescriptor.name===t);return n?n.assetDescriptor:void 0}static getAttributeDescriptor(t,n){if(!t)return;let i=this.getAssetTypeInfo(n||"ThingAsset");if(i&&i.attributeDescriptors)return i.attributeDescriptors.find(n=>n.name===t)}static getValueDescriptor(t){let n;if(!t)return;if(t.endsWith("[]"))for(n=0;t.endsWith("[]");)t=t.substring(0,t.length-2),n++;let i=this._valueDescriptors.find(n=>n.name===t);return i&&n&&(i=Object.assign(Object.assign({},i),{arrayDimensions:n})),i}static resolveValueDescriptor(t,n){let i;return n&&("string"==typeof n&&(i=tL.getValueDescriptor(n)),i=n.jsonType?n:tL.getValueDescriptor(n.type)),!i&&t&&(i=tL.getValueDescriptor("JSON")),i}static resolveValueTypeFromValue(t){if(null!=t){if("number"==typeof t)return"number";if("string"==typeof t)return"text";if("boolean"==typeof t)return"boolean";if(Array.isArray(t)){let n=1,i=t.find(t=>null!=t);for(;Array.isArray(i);)i=i.find(t=>null!=t),n++;let r=this.resolveValueTypeFromValue(i);if(!r)return;for(;n>0;)r+="[]",n--;return r}if(t instanceof Date)return"dateAndTime"}}static getAttributeAndValueDescriptors(t,n,i){let r,o;if(n&&"string"!=typeof n)r=n;else{let o=this.getAssetTypeInfo(t||"ThingAsset");if(!o)return[void 0,void 0];"string"==typeof n&&(r=this.getAttributeDescriptor(n,o)),!r&&i&&(r={type:i.type,name:i.name,meta:i.meta})}return r&&(o=this.getValueDescriptor(r.type)),[r,o]}static getMetaItemDescriptor(t){if(t)return this._metaItemDescriptors.find(n=>n.name===t)}static getAssetDescriptorColour(t,n){let i=this.getAssetDescriptor(t);return i&&i.colour?i.colour:n}static getAssetDescriptorIcon(t,n){let i=this.getAssetDescriptor(t);return i&&i.icon?i.icon:n}}tL._assetTypeInfos=[],tL._metaItemDescriptors=[],tL._valueDescriptors=[];var tD=i(3806),tI=i.n(tD),tP=i(2891);class tR{get resolve(){return this._resolve}get reject(){return this._reject}get promise(){return this._promise}constructor(){this._promise=new Promise((t,n)=>{this._resolve=t,this._reject=n}),Object.freeze(this)}}function tO(t,n,i=!0){if(null==t||null==n)return t===n;if(t.constructor!==n.constructor)return!1;if(t instanceof Function||t instanceof RegExp)return t===n;if(t===n||t.valueOf()===n.valueOf())return!0;if(Array.isArray(t)&&t.length!==n.length||t instanceof Date||!(t instanceof Object)||!(n instanceof Object))return!1;if(i){let i=Object.keys(t);return Object.keys(n).every(t=>-1!==i.indexOf(t))&&i.every(i=>tO(t[i],n[i]))}return!1}function tB(t){if(null==t)return"";let n=!1;return t.split(/([A-Z]|\d)/).map((t,i,r)=>{if(!t)return t;if(!n)return n=!0,t.charAt(0).toUpperCase()+t.slice(1);if("_"===t)return" ";if(1===t.length&&t===t.toUpperCase()){let n=!r[i-1]||"_"===r[i-1],o=i+1<r.length&&r[i+1]&&"_"!==r[i+1],a=i+3>r.length||!r[i+1]&&!r[i+3];(!n||o)&&(t=" "+t),!o&&(n||a)||(t=t.toLowerCase())}return t}).join("").trim()}function tz(t,n,i){let r="string"==typeof t?t:t.name;return n&&n.meta&&n.meta.hasOwnProperty(r)?n.meta[r]:i&&i.meta?i.meta[r]:void 0}function tN(t,n,i,r,o,a){let s=tY(t?t.value:void 0,()=>tU("format",t,n,i,o),void 0,a),l=tU("units",t,n,i,!0);return r&&l&&l.length&&(s=tj(tU("units",t,n,i,o),s)),s}function tY(t,n,i,r){let o="";if(null==t)o=r||"";else if("string"==typeof t)o=t;else if("number"==typeof t||"boolean"==typeof t||t instanceof Date){let r=n&&n();if(r&&0!==Object.keys(r).length)switch("number"==typeof t?r.asBoolean?t=!!t:r.asDate&&(t=new Date(t)):"boolean"==typeof t&&r.asNumber&&(t=+!!t),typeof t){case"number":o=new Intl.NumberFormat(i||tM.language,r).format(t);break;case"boolean":r.asOnOff&&(o=t?tM.t("on"):tM.t("off")),r.asOpenClosed&&(o=t?tM.t("open"):tM.t("closed")),r.asPressedReleased&&(o=t?tM.t("pressed"):tM.t("released"));break;case"object":if(r.momentJsFormat)o=tI()(t).format(r.momentJsFormat);else if(r.iso8601)o=t.toISOString();else if(r.week){var a;let n,i=((a=new Date(Date.UTC((a=t).getFullYear(),a.getMonth(),a.getDate()))).setUTCDate(a.getUTCDate()+4-(a.getUTCDay()||7)),n=new Date(Date.UTC(a.getUTCFullYear(),0,1)),Math.ceil(((a.getTime()-n.getTime())/864e5+1)/7));o="2-digit"===r.week?String(i).padStart(2,"0"):Number(i).toString(10)}else o=new Intl.DateTimeFormat(i||tM.language,r).format(t)}else o=Object(t).toString()}return o}function tj(t,n){if(!t)return"";n||(n="");let i=t.map((t,i)=>{if(3!==t.length||t.toUpperCase()!==t)return tM.t(["units."+t,"or:units."+t]);{let r=new Intl.NumberFormat(tM.language,{currency:t,style:"currency"}).formatToParts();if(0!==i||"currency"!==r[0].type)return"currency"===r[0].type?r[0].value:r[r.length-1].value;if(!n)return r[0].value;n=r[0].value+n}}).join("");return n.length>0?n+" "+i:i}function tU(t,n,i,r,o){let a,s=[],l=tH(t,n&&"string"==typeof n?n:n?n.name:i?"string"==typeof i?i:i.name:void 0,i,r,o);if(l&&(a=JSON.parse(l)))if("format"!==t)return a;else s.push(a);if(n&&n.meta&&(a=tz(t,n,i)))if("format"!==t)return a;else s.push(a);if(i&&"string"!=typeof i&&i.hasOwnProperty(t)){if(a=i[t],"format"!==t)return a;s.push(a)}if(i&&i.type){if(a=tL.getValueDescriptor(i.type)[t],"format"!==t)return a;s.push(a)}if("format"!==t||0===s.length)return a;let c={};return s.reverse().forEach(t=>{c=Object.assign(Object.assign({},c),t)}),c}function tH(t,n,i,r,o,a){let s;if(n?s="string"==typeof n?n:n.name:i&&(s="string"==typeof i?i:i.name),!s)return;let l=[],c=t+"."+(o?"attribute":"meta")+".";if(r&&l.push(c+r+"."+s),i&&"string"!=typeof i&&(l.push(c+i.type+"."+s),l.push(c+i.type)),l.push(c+s),l.length>0)return tM.t(l,{defaultValue:a||""})}function tV(t,n){let i=n.ref.name;if(t.attributes)if(n.deleted)delete t.attributes[i];else{let r=t.attributes[i];r&&(r.value=n.value,r.timestamp=n.timestamp)}return Object.assign({},t)}var tG=function(t,n,i,r){return new(i||(i=Promise))(function(o,a){function s(t){try{c(r.next(t))}catch(t){a(t)}}function l(t){try{c(r.throw(t))}catch(t){a(t)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof i?n:new i(function(t){t(n)})).then(s,l)}c((r=r.apply(t,n||[])).next())})};let tq=i(9916);class t${constructor(t,n,i){this._autoEnable=!1,this._initialised=!1,this._initialiseInProgress=!1,this._pendingProviderPromises={},this._providerMessageListeners={},this._pendingProviderEnables=[],this._registrationTimer=null,this._realm=t,this._autoEnable=n,this._enableCompleteCallback=i,window.OpenRemoteConsole=this;let r=new URLSearchParams(window.location.search),o=r.get("consoleName"),a=r.get("consoleVersion"),s=r.get("consolePlatform"),l=r.get("consoleProviders"),c=r.get("consoleAutoEnable"),d=l&&l.length>0?l.split(" "):["push"];this._pendingProviderEnables=d;let u=t$._createConsoleRegistration(),m=window.localStorage.getItem("OpenRemoteConsole:"+t);if(m)try{let t=JSON.parse(m);t.id&&(u.id=t.id),t.name&&(u.name=t.name),t.providers&&(u.providers=t.providers),t.apps&&(u.apps=t.apps)}catch(t){console.error("Failed to deserialise console registration")}let h=u.providers;for(let t of(u.providers={},d)){let n=h&&h.hasOwnProperty(t)?h[t]:{enabled:!1,disabled:!1};u.providers[t]=n}let f=rS.getAppName();f.length>0&&0>u.apps.indexOf(f)&&u.apps.push(f),this._registration=u,o&&(u.name=o),a&&(u.version=a),s&&(u.platform=s),c&&(this._autoEnable="TRUE"===c||"true"===c)}get registration(){return this._registration}get autoEnable(){return this._autoEnable}get pendingProviderEnables(){return this._pendingProviderEnables.slice(0)}get shellApple(){let t=navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform:navigator.platform;return t&&("iP"===t.substring(0,2)||"Mac"===t.substring(0,3))&&window.webkit&&window.webkit.messageHandlers}get shellAndroid(){return!!window.MobileInterface}get isMobile(){return this.shellApple||this.shellAndroid}initialise(){return tG(this,void 0,void 0,function*(){if(!this._initialised&&!this._initialiseInProgress){console.debug("Console: initialising"),this._initialiseInProgress=!0;try{if(this._registration.providers)for(let t of Object.keys(this._registration.providers))yield this._initialiseProvider(t);this._registration.id||(yield this.sendRegistration(0)),this._initialised=!0,this._initialiseInProgress=!1,0===this._pendingProviderEnables.length?(yield this.sendRegistration(),this._callCompletedCallback()):this._autoEnable&&(yield this.enableProviders())}catch(t){console.error(t)}finally{this._initialiseInProgress=!1}}})}enableProviders(){return tG(this,void 0,void 0,function*(){if(!this._initialised)throw Error("Console must be initialised before enabling providers");for(let t=this._pendingProviderEnables.length-1;t>-1;t--){let n=this._pendingProviderEnables[t];yield this.enableProvider(n)}})}enableProvider(t,n){return tG(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before enabling providers");if(!this._registration.providers.hasOwnProperty(t))throw console.debug("Invalid console provider '"+t+"'"),Error("Invalid console provider '"+t+"'");console.debug("Console: enabling provider '"+t+"'");let i={provider:t,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:n},r=yield this.sendProviderMessage(i,!0);this._registration.providers[t].hasPermission=r.hasPermission,this._registration.providers[t].success=r.success,this._registration.providers[t].enabled=r.success,this._registration.providers[t].data=r.data;let o=this._pendingProviderEnables.indexOf(t);return o>=0&&(this._pendingProviderEnables.splice(o,1),0===this._pendingProviderEnables.length&&(this.sendRegistration(),this._callCompletedCallback())),r})}disableProvider(t){return tG(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before disabling providers");if(!this._registration.providers.hasOwnProperty(t))throw console.debug("Invalid console provider '"+t+"'"),Error("Invalid console provider '"+t+"'");console.debug("Console: disabling provider '"+t+"'");let n=yield this.sendProviderMessage({provider:t,action:"PROVIDER_DISABLE"},!0);return this._registration.providers[t].disabled=!0,this._registration.providers[t].enabled=!1,n})}getProvider(t){return this._registration&&this._registration.providers?this._registration.providers[t]:void 0}sendProviderMessage(t,n){return tG(this,void 0,void 0,function*(){if("storage"!==t.provider&&!this._registration.providers.hasOwnProperty(t.provider))throw console.debug("Invalid console provider '"+t.provider+"'"),Error("Invalid console provider '"+t.provider+"'");if(!n)return void this._doSendProviderMessage(t);let i=t.provider+t.action;if(this._pendingProviderPromises[i])throw Error("Message already pending for provider '"+t.provider+"' with action '"+t.action+"'");let r=new tR,o=()=>{delete this._pendingProviderPromises[i],r.reject("No response from provider")};return this._pendingProviderPromises[i]=[r,window.setTimeout(o,5e3)],this._doSendProviderMessage(t),r.promise})}sendRegistration(t){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),console.debug("Sending registration in: "+(t=void 0!==t?t:2e3)+"ms"),new Promise((t,n)=>{this._registrationTimer=window.setTimeout(()=>{this._registrationTimer=null,console.debug("Console: updating registration");try{this._registration.name||(this._registration.name="Console"),this._registration.platform||(this._registration.platform="N/A"),this._registration.version||(this._registration.version="N/A"),this._registration.providers||(this._registration.providers={}),rS.rest.api.ConsoleResource.register(this._registration).then(n=>{if(200!==n.status)throw Error("Failed to register console");this._registration=n.data,console.debug("Console: registration successful"),console.debug("Console: updating locally stored registration"),window.localStorage.setItem("OpenRemoteConsole:"+this._realm,JSON.stringify(this._registration)),t()})}catch(t){console.error("Failed to register console"),n("Failed to register console")}})})}storeData(t,n){this.sendProviderMessage({provider:"storage",action:"STORE",key:t,value:n},!1)}retrieveData(t){return tG(this,void 0,void 0,function*(){let n=this.sendProviderMessage({provider:"storage",action:"RETRIEVE",key:t},!0);try{let t=yield Promise.race([n,new Promise((t,n)=>setTimeout(n,2e3))]);if(t&&t.value){let n=t.value;return"null"===n?void 0:n}}catch(t){console.log("Failed to retrieve data from storage provider")}})}addProviderMessageListener(t,n){this._providerMessageListeners[t.provider+t.action]=n}removeProviderMessageListener(t){delete this._providerMessageListeners[t.provider+t.action]}_postNativeShellMessage(t){try{if(this.shellAndroid)return window.MobileInterface.postMessage(JSON.stringify(t));if(this.shellApple)return window.webkit.messageHandlers.int.postMessage(t)}catch(t){console.error("Failed to send shell message towards console",t)}}_doSendGenericMessage(t,n){let i={type:t,data:n};this.isMobile?this._postNativeShellMessage(i):console.warn("Failed to send generic message to console.",i)}_doSendProviderMessage(t){if(this.isMobile)this._postNativeShellMessage({type:"provider",data:t});else{if(!t.provider||!t.action)return;switch(t.provider.trim().toUpperCase()){case"PUSH":switch(t.action.trim().toUpperCase()){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"push",version:"web",enabled:!0,disabled:!1,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"push",hasPermission:!0,success:!0}));break;default:throw Error("Unsupported provider '"+t.provider+"' and action '"+t.action+"'")}break;case"STORAGE":switch(t.action){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"storage",version:"1.0.0",disabled:!1,enabled:!0,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"storage",hasPermission:!0,success:!0}));break;case"STORE":{let n=t.key?t.key.trim():null;if(!n||0===n.length)throw Error("Storage provider 'store' action requires a `key`");null===t.value?window.localStorage.removeItem(n):window.localStorage.setItem(n,JSON.stringify(t.value))}break;case"RETRIEVE":{let n=t.key?t.key.trim():null;if(!n||0===n.length)throw Error("Storage provider 'retrieve' action requires a `key`");let i=window.localStorage.getItem(n);if(null!==i)try{i=JSON.parse(i)}catch(t){}this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:n,value:i}))}break;default:throw Error("Unsupported provider '"+t.provider+"' and action '"+t.action+"'")}break;default:console.error("Unsupported provider: "+t.provider)}}}_handleProviderResponse(t){if(!t)return;let n=JSON.parse(t),i=n.provider,r=n.action,o=this._pendingProviderPromises[i+r];o&&(window.clearTimeout(o[1]),delete this._pendingProviderPromises[i+r],o[0].resolve(n));let a=this._providerMessageListeners[i+r];a&&a(n)}_callCompletedCallback(){let t=this._enableCompleteCallback;this._enableCompleteCallback=null,t&&window.setTimeout(()=>{t()},0)}static _createConsoleRegistration(){return{name:tq.name,version:tq.version,platform:tq.os.toString(),apps:[],model:((tq.manufacturer?tq.manufacturer+" ":"")+(tq.product?tq.product:"")).trim()}}_initialiseProvider(t){return tG(this,void 0,void 0,function*(){let n;console.debug("Console: initialising provider '"+t+"'");try{n=yield this.sendProviderMessage({provider:t,action:"PROVIDER_INIT"},!0),this._registration.providers[t].version=n.version,this._registration.providers[t].requiresPermission=n.requiresPermission,this._registration.providers[t].hasPermission=n.hasPermission,this._registration.providers[t].success=n.success,this._registration.providers[t].enabled=n.enabled,this._registration.providers[t].disabled=n.disabled,this._registration.providers[t].data=n.data}catch(t){console.error(t),n={action:"",disabled:!1,enabled:!1,hasPermission:!1,provider:"",requiresPermission:!1,version:"",success:!1}}if(n.success||(console.debug("Provider initialisation failed: '"+t+"'"),n.disabled=!0,this._registration.providers[t].disabled=!0),n.disabled||n.enabled){let n=this._pendingProviderEnables.indexOf(t);n>=0&&this._pendingProviderEnables.splice(n,1)}})}}var tW=i(3653),tZ=i.n(tW);class tX{constructor(t){this.httpClient=t}getConfig(t){return this.httpClient.request({method:"GET",url:nl`syslog/config`,options:t})}updateConfig(t,n){return this.httpClient.request({method:"PUT",url:nl`syslog/config`,data:t,options:n})}clearEvents(t){return this.httpClient.request({method:"DELETE",url:nl`syslog/event`,options:t})}getEvents(t,n){return this.httpClient.request({method:"GET",url:nl`syslog/event`,queryParams:t,options:n})}}class tK{constructor(t){this.httpClient=t}updateCurrentUserLocale(t,n){return this.httpClient.request({method:"PUT",url:nl`user/locale`,data:t,options:n})}query(t,n){return this.httpClient.request({method:"POST",url:nl`user/query`,data:t,options:n})}requestPasswordResetCurrent(t){return this.httpClient.request({method:"PUT",url:nl`user/request-password-reset`,options:t})}updatePasswordCurrent(t,n){return this.httpClient.request({method:"PUT",url:nl`user/reset-password`,data:t,options:n})}updateCurrent(t,n){return this.httpClient.request({method:"PUT",url:nl`user/update`,data:t,options:n})}getCurrent(t){return this.httpClient.request({method:"GET",url:nl`user/user`,options:t})}getCurrentUserRealmRoles(t){return this.httpClient.request({method:"GET",url:nl`user/userRealmRoles`,options:t})}getCurrentUserClientRoles(t,n){return this.httpClient.request({method:"GET",url:nl`user/userRoles/${t}`,options:n})}disconnectUserSession(t,n,i){return this.httpClient.request({method:"GET",url:nl`user/${t}/disconnect/${n}`,options:i})}requestPasswordReset(t,n,i){return this.httpClient.request({method:"PUT",url:nl`user/${t}/request-password-reset/${n}`,options:i})}updatePassword(t,n,i,r){return this.httpClient.request({method:"PUT",url:nl`user/${t}/reset-password/${n}`,data:i,options:r})}resetSecret(t,n,i){return this.httpClient.request({method:"GET",url:nl`user/${t}/reset-secret/${n}`,options:i})}updateRoles(t,n,i){return this.httpClient.request({method:"PUT",url:nl`user/${t}/roles`,data:n,options:i})}getUserRealmRoles(t,n,i){return this.httpClient.request({method:"GET",url:nl`user/${t}/userRealmRoles/${n}`,options:i})}updateUserRealmRoles(t,n,i,r){return this.httpClient.request({method:"PUT",url:nl`user/${t}/userRealmRoles/${n}`,data:i,options:r})}getUserClientRoles(t,n,i,r){return this.httpClient.request({method:"GET",url:nl`user/${t}/userRoles/${n}/${i}`,options:r})}updateUserClientRoles(t,n,i,r,o){return this.httpClient.request({method:"PUT",url:nl`user/${t}/userRoles/${n}/${i}`,data:r,options:o})}getUserSessions(t,n,i){return this.httpClient.request({method:"GET",url:nl`user/${t}/userSessions/${n}`,options:i})}create(t,n,i){return this.httpClient.request({method:"POST",url:nl`user/${t}/users`,data:n,options:i})}update(t,n,i){return this.httpClient.request({method:"PUT",url:nl`user/${t}/users`,data:n,options:i})}delete(t,n,i){return this.httpClient.request({method:"DELETE",url:nl`user/${t}/users/${n}`,options:i})}getClientRoles(t,n,i){return this.httpClient.request({method:"GET",url:nl`user/${t}/${n}/roles`,options:i})}updateClientRoles(t,n,i,r){return this.httpClient.request({method:"PUT",url:nl`user/${t}/${n}/roles`,data:i,options:r})}get(t,n,i){return this.httpClient.request({method:"GET",url:nl`user/${t}/${n}`,options:i})}}class tJ{constructor(t){this.httpClient=t}create(t,n){return this.httpClient.request({method:"POST",url:nl`realm`,data:t,options:n})}getAll(t){return this.httpClient.request({method:"GET",url:nl`realm`,options:t})}getAccessible(t){return this.httpClient.request({method:"GET",url:nl`realm/accessible`,options:t})}delete(t,n){return this.httpClient.request({method:"DELETE",url:nl`realm/${t}`,options:n})}get(t,n){return this.httpClient.request({method:"GET",url:nl`realm/${t}`,options:n})}update(t,n,i){return this.httpClient.request({method:"PUT",url:nl`realm/${t}`,data:n,options:i})}}class tQ{constructor(t){this.httpClient=t}doProtocolAssetDiscovery(t,n,i){return this.httpClient.request({method:"GET",url:nl`agent/assetDiscovery/${t}`,queryParams:n,options:i})}doProtocolAssetImport(t,n,i,r){return this.httpClient.request({method:"POST",url:nl`agent/assetImport/${t}`,queryParams:i,data:n,options:r})}doProtocolInstanceDiscovery(t,n,i){return this.httpClient.request({method:"GET",url:nl`agent/instanceDiscovery/${t}`,queryParams:n,options:i})}}class t0{constructor(t){this.httpClient=t}startTunnel(t,n){return this.httpClient.request({method:"POST",url:nl`gateway/tunnel`,data:t,options:n})}stopTunnel(t,n){return this.httpClient.request({method:"DELETE",url:nl`gateway/tunnel`,data:t,options:n})}getAllActiveTunnelInfos(t,n){return this.httpClient.request({method:"GET",url:nl`gateway/tunnel/${t}`,options:n})}getGatewayActiveTunnelInfos(t,n,i){return this.httpClient.request({method:"GET",url:nl`gateway/tunnel/${t}/${n}`,options:i})}getActiveTunnelInfo(t,n,i,r,o){return this.httpClient.request({method:"GET",url:nl`gateway/tunnel/${t}/${n}/${i}/${r}`,options:o})}}class t1{constructor(t){this.httpClient=t}create(t,n){return this.httpClient.request({method:"POST",url:nl`asset`,data:t,options:n})}delete(t,n){return this.httpClient.request({method:"DELETE",url:nl`asset`,queryParams:t,options:n})}writeAttributeValues(t,n){return this.httpClient.request({method:"PUT",url:nl`asset/attributes`,data:t,options:n})}writeAttributeEvents(t,n){return this.httpClient.request({method:"PUT",url:nl`asset/attributes/timestamp`,data:t,options:n})}updateNoneParent(t,n){return this.httpClient.request({method:"DELETE",url:nl`asset/parent`,queryParams:t,options:n})}getPartial(t,n){return this.httpClient.request({method:"GET",url:nl`asset/partial/${t}`,options:n})}queryAssets(t,n){return this.httpClient.request({method:"POST",url:nl`asset/query`,data:t,options:n})}queryAssetTree(t,n){return this.httpClient.request({method:"POST",url:nl`asset/tree`,data:t,options:n})}getCurrentUserAssets(t){return this.httpClient.request({method:"GET",url:nl`asset/user/current`,options:t})}createUserAssetLinks(t,n){return this.httpClient.request({method:"POST",url:nl`asset/user/link`,data:t,options:n})}getUserAssetLinks(t,n){return this.httpClient.request({method:"GET",url:nl`asset/user/link`,queryParams:t,options:n})}deleteUserAssetLinks(t,n){return this.httpClient.request({method:"POST",url:nl`asset/user/link/delete`,data:t,options:n})}deleteAllUserAssetLinks(t,n,i){return this.httpClient.request({method:"DELETE",url:nl`asset/user/link/${t}/${n}`,options:i})}deleteUserAssetLink(t,n,i,r){return this.httpClient.request({method:"DELETE",url:nl`asset/user/link/${t}/${n}/${i}`,options:r})}get(t,n){return this.httpClient.request({method:"GET",url:nl`asset/${t}`,options:n})}update(t,n,i){return this.httpClient.request({method:"PUT",url:nl`asset/${t}`,data:n,options:i})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(t,n,i,r){return this.httpClient.request({method:"PUT",url:nl`asset/${t}/attribute/${n}`,data:i,options:r})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp(t,n,i,r,o){return this.httpClient.request({method:"PUT",url:nl`asset/${t}/attribute/${n}/${i}`,data:r,options:o})}updateParent(t,n,i){return this.httpClient.request({method:"PUT",url:nl`asset/${t}/child`,queryParams:n,options:i})}}class t2{constructor(t){this.httpClient=t}createGlobalRuleset(t,n){return this.httpClient.request({method:"POST",url:nl`rules`,data:t,options:n})}getGlobalRulesets(t,n){return this.httpClient.request({method:"GET",url:nl`rules`,queryParams:t,options:n})}createAssetRuleset(t,n){return this.httpClient.request({method:"POST",url:nl`rules/asset`,data:t,options:n})}getAssetRulesets(t,n,i){return this.httpClient.request({method:"GET",url:nl`rules/asset/for/${t}`,queryParams:n,options:i})}deleteAssetRuleset(t,n){return this.httpClient.request({method:"DELETE",url:nl`rules/asset/${t}`,options:n})}getAssetRuleset(t,n){return this.httpClient.request({method:"GET",url:nl`rules/asset/${t}`,options:n})}updateAssetRuleset(t,n,i){return this.httpClient.request({method:"PUT",url:nl`rules/asset/${t}`,data:n,options:i})}getAssetGeofences(t,n){return this.httpClient.request({method:"GET",url:nl`rules/geofences/${t}`,options:n})}getAssetEngineInfo(t,n){return this.httpClient.request({method:"GET",url:nl`rules/info/asset/${t}`,options:n})}getGlobalEngineInfo(t){return this.httpClient.request({method:"GET",url:nl`rules/info/global`,options:t})}getRealmEngineInfo(t,n){return this.httpClient.request({method:"GET",url:nl`rules/info/realm/${t}`,options:n})}createRealmRuleset(t,n){return this.httpClient.request({method:"POST",url:nl`rules/realm`,data:t,options:n})}getRealmRulesets(t,n,i){return this.httpClient.request({method:"GET",url:nl`rules/realm/for/${t}`,queryParams:n,options:i})}deleteRealmRuleset(t,n){return this.httpClient.request({method:"DELETE",url:nl`rules/realm/${t}`,options:n})}getRealmRuleset(t,n){return this.httpClient.request({method:"GET",url:nl`rules/realm/${t}`,options:n})}updateRealmRuleset(t,n,i){return this.httpClient.request({method:"PUT",url:nl`rules/realm/${t}`,data:n,options:i})}deleteGlobalRuleset(t,n){return this.httpClient.request({method:"DELETE",url:nl`rules/${t}`,options:n})}getGlobalRuleset(t,n){return this.httpClient.request({method:"GET",url:nl`rules/${t}`,options:n})}updateGlobalRuleset(t,n,i){return this.httpClient.request({method:"PUT",url:nl`rules/${t}`,data:n,options:i})}}class t3{constructor(t){this.httpClient=t}getDatapointExport(t,n){return this.httpClient.request({method:"GET",url:nl`asset/datapoint/export`,queryParams:t,options:n})}getDatapointPeriod(t,n){return this.httpClient.request({method:"GET",url:nl`asset/datapoint/periods`,queryParams:t,options:n})}getDatapoints(t,n,i,r){return this.httpClient.request({method:"POST",url:nl`asset/datapoint/${t}/${n}`,data:i,options:r})}}class t5{constructor(t){this.httpClient=t}getSettings(t){return this.httpClient.request({method:"GET",url:nl`map`,options:t})}saveSettings(t,n){return this.httpClient.request({method:"PUT",url:nl`map`,data:t,options:n})}deleteMap(t){return this.httpClient.request({method:"DELETE",url:nl`map/deleteMap`,options:t})}getCustomMapInfo(t){return this.httpClient.request({method:"GET",url:nl`map/getCustomMapInfo`,options:t})}getSettingsJs(t){return this.httpClient.request({method:"GET",url:nl`map/js`,options:t})}getTile(t,n,i,r){return this.httpClient.request({method:"GET",url:nl`map/tile/${t}/${n}/${i}`,options:r})}uploadMap(t,n){return this.httpClient.request({method:"POST",url:nl`map/upload`,queryParams:t,options:n})}}class t4{constructor(t){this.httpClient=t}create(t,n){return this.httpClient.request({method:"POST",url:nl`dashboard`,data:t,options:n})}update(t,n){return this.httpClient.request({method:"PUT",url:nl`dashboard`,data:t,options:n})}getAllRealmDashboards(t,n){return this.httpClient.request({method:"GET",url:nl`dashboard/all/${t}`,options:n})}query(t,n){return this.httpClient.request({method:"POST",url:nl`dashboard/query`,data:t,options:n})}delete(t,n,i){return this.httpClient.request({method:"DELETE",url:nl`dashboard/${t}/${n}`,options:i})}get(t,n,i){return this.httpClient.request({method:"GET",url:nl`dashboard/${t}/${n}`,options:i})}}class t6{constructor(t){this.httpClient=t}getApps(t){return this.httpClient.request({method:"GET",url:nl`apps`,options:t})}getConsoleConfig(t){return this.httpClient.request({method:"GET",url:nl`apps/consoleConfig`,options:t})}getAppInfos(t){return this.httpClient.request({method:"GET",url:nl`apps/info`,options:t})}}class t8{constructor(t){this.httpClient=t}getAllNodeDefinitions(t){return this.httpClient.request({method:"GET",url:nl`flow`,options:t})}getNodeDefinition(t,n){return this.httpClient.request({method:"GET",url:nl`flow/${t}`,options:n})}getAllNodeDefinitionsByType(t,n){return this.httpClient.request({method:"GET",url:nl`flow/${t}`,options:n})}}class t7{constructor(t){this.httpClient=t}getHealthStatus(t){return this.httpClient.request({method:"GET",url:nl`health`,options:t})}getInfo(t){return this.httpClient.request({method:"GET",url:nl`info`,options:t})}}class t9{constructor(t){this.httpClient=t}getServices(t,n){return this.httpClient.request({method:"GET",url:nl`service`,queryParams:t,options:n})}registerService(t,n){return this.httpClient.request({method:"POST",url:nl`service`,data:t,options:n})}getGlobalServices(t){return this.httpClient.request({method:"GET",url:nl`service/global`,options:t})}registerGlobalService(t,n){return this.httpClient.request({method:"POST",url:nl`service/global`,data:t,options:n})}deregisterService(t,n,i){return this.httpClient.request({method:"DELETE",url:nl`service/${t}/${n}`,options:i})}getService(t,n,i){return this.httpClient.request({method:"GET",url:nl`service/${t}/${n}`,options:i})}heartbeat(t,n,i){return this.httpClient.request({method:"PUT",url:nl`service/${t}/${n}`,options:i})}}class ne{constructor(t){this.httpClient=t}getManagerConfig(t){return this.httpClient.request({method:"GET",url:nl`configuration/manager`,options:t})}update(t,n){return this.httpClient.request({method:"PUT",url:nl`configuration/manager`,data:t,options:n})}fileUpload(t,n,i){return this.httpClient.request({method:"POST",url:nl`configuration/manager/file`,queryParams:n,data:t,options:i})}getManagerConfigImage(t,n){return this.httpClient.request({method:"GET",url:nl`configuration/manager/image/${t}`,options:n})}}class nt{constructor(t){this.httpClient=t}getAssetDescriptors(t,n){return this.httpClient.request({method:"GET",url:nl`model/assetDescriptors`,queryParams:t,options:n})}getAssetInfo(t,n,i){return this.httpClient.request({method:"GET",url:nl`model/assetInfo/${t}`,queryParams:n,options:i})}getAssetInfos(t,n){return this.httpClient.request({method:"GET",url:nl`model/assetInfos`,queryParams:t,options:n})}getValueDescriptorSchema(t,n){return this.httpClient.request({method:"GET",url:nl`model/getValueDescriptorSchema`,queryParams:t,options:n})}getMetaItemDescriptors(t,n){return this.httpClient.request({method:"GET",url:nl`model/metaItemDescriptors`,queryParams:t,options:n})}getValueDescriptors(t,n){return this.httpClient.request({method:"GET",url:nl`model/valueDescriptors`,queryParams:t,options:n})}}class nn{constructor(t){this.httpClient=t}createProvisioningConfig(t,n){return this.httpClient.request({method:"POST",url:nl`provisioning`,data:t,options:n})}getProvisioningConfigs(t){return this.httpClient.request({method:"GET",url:nl`provisioning`,options:t})}deleteProvisioningConfig(t,n){return this.httpClient.request({method:"DELETE",url:nl`provisioning/${t}`,options:n})}updateProvisioningConfig(t,n,i){return this.httpClient.request({method:"PUT",url:nl`provisioning/${t}`,data:n,options:i})}}class ni{constructor(t){this.httpClient=t}createAlarm(t,n,i){return this.httpClient.request({method:"POST",url:nl`alarm`,queryParams:n,data:t,options:i})}getAlarms(t,n){return this.httpClient.request({method:"GET",url:nl`alarm`,queryParams:t,options:n})}removeAlarms(t,n){return this.httpClient.request({method:"DELETE",url:nl`alarm`,data:t,options:n})}setAssetLinks(t,n){return this.httpClient.request({method:"PUT",url:nl`alarm/assets`,data:t,options:n})}getAlarm(t,n){return this.httpClient.request({method:"GET",url:nl`alarm/${t}`,options:n})}removeAlarm(t,n){return this.httpClient.request({method:"DELETE",url:nl`alarm/${t}`,options:n})}updateAlarm(t,n,i){return this.httpClient.request({method:"PUT",url:nl`alarm/${t}`,data:n,options:i})}getAssetLinks(t,n,i){return this.httpClient.request({method:"GET",url:nl`alarm/${t}/assets`,queryParams:n,options:i})}}class nr{constructor(t){this.httpClient=t}getNotifications(t,n){return this.httpClient.request({method:"GET",url:nl`notification`,queryParams:t,options:n})}removeNotifications(t,n){return this.httpClient.request({method:"DELETE",url:nl`notification`,queryParams:t,options:n})}sendNotification(t,n){return this.httpClient.request({method:"POST",url:nl`notification/alert`,data:t,options:n})}removeNotification(t,n){return this.httpClient.request({method:"DELETE",url:nl`notification/${t}`,options:n})}notificationAcknowledged(t,n,i,r){return this.httpClient.request({method:"PUT",url:nl`notification/${t}/acknowledged`,queryParams:i,data:n,options:r})}notificationDelivered(t,n,i){return this.httpClient.request({method:"PUT",url:nl`notification/${t}/delivered`,queryParams:n,options:i})}}class no{constructor(t){this.httpClient=t}deleteConnections(t,n){return this.httpClient.request({method:"DELETE",url:nl`gateway/connection`,queryParams:t,options:n})}getConnections(t){return this.httpClient.request({method:"GET",url:nl`gateway/connection`,options:t})}deleteConnection(t,n){return this.httpClient.request({method:"DELETE",url:nl`gateway/connection/${t}`,options:n})}getConnection(t,n){return this.httpClient.request({method:"GET",url:nl`gateway/connection/${t}`,options:n})}setConnection(t,n,i){return this.httpClient.request({method:"PUT",url:nl`gateway/connection/${t}`,data:n,options:i})}getConnectionStatus(t,n){return this.httpClient.request({method:"GET",url:nl`gateway/status/${t}`,options:n})}}class na{constructor(t){this.httpClient=t}getPredictedDatapoints(t,n,i,r){return this.httpClient.request({method:"POST",url:nl`asset/predicted/${t}/${n}`,data:i,options:r})}writePredictedDatapoints(t,n,i,r){return this.httpClient.request({method:"PUT",url:nl`asset/predicted/${t}/${n}`,data:i,options:r})}}class ns{constructor(t){this.httpClient=t}register(t,n){return this.httpClient.request({method:"POST",url:nl`console/register`,data:t,options:n})}}function nl(t,...n){let i="";for(let r=0;r<n.length;r++)i+=t[r],i+=encodeURIComponent(n[r]);return i+t[t.length-1]}class nc{constructor(t,n=tZ().create()){this._syslogResource=new nu(t,n),this._userResource=new nm(t,n),this._realmResource=new nh(t,n),this._agentResource=new nf(t,n),this._gatewayServiceResource=new np(t,n),this._assetResource=new nb(t,n),this._rulesResource=new ng(t,n),this._assetDatapointResource=new n_(t,n),this._mapResource=new ny(t,n),this._dashboardResource=new nv(t,n),this._appResource=new nx(t,n),this._flowResource=new nw(t,n),this._statusResource=new nF(t,n),this._externalServiceResource=new nk(t,n),this._configurationResource=new nE(t,n),this._assetModelResource=new nT(t,n),this._provisioningResource=new nA(t,n),this._alarmResource=new nM(t,n),this._notificationResource=new nC(t,n),this._gatewayClientResource=new nS(t,n),this._assetPredictedDatapointResource=new nL(t,n),this._consoleResource=new nD(t,n),this._assetResource=new nb(t,n)}get SyslogResource(){return this._syslogResource}get UserResource(){return this._userResource}get RealmResource(){return this._realmResource}get AgentResource(){return this._agentResource}get GatewayServiceResource(){return this._gatewayServiceResource}get AssetResource(){return this._assetResource}get RulesResource(){return this._rulesResource}get AssetDatapointResource(){return this._assetDatapointResource}get MapResource(){return this._mapResource}get DashboardResource(){return this._dashboardResource}get AppResource(){return this._appResource}get FlowResource(){return this._flowResource}get StatusResource(){return this._statusResource}get ExternalServiceResource(){return this._externalServiceResource}get ConfigurationResource(){return this._configurationResource}get AssetModelResource(){return this._assetModelResource}get ProvisioningResource(){return this._provisioningResource}get AlarmResource(){return this._alarmResource}get NotificationResource(){return this._notificationResource}get GatewayClientResource(){return this._gatewayClientResource}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get ConsoleResource(){return this._consoleResource}}class nd{constructor(t){this.axios=t}request(t){let n={};n.method=t.method,n.url=t.url,n.params=t.queryParams,n.data=t.data,function(t,n){if(void 0!=n)for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i])}(n,t.options);let i=t.copyFn;return this.axios.request(n).then(t=>(i&&t.data&&(t.originalData=t.data,t.data=i(t.data)),t))}}class nu extends tX{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nm extends tK{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nh extends tJ{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nf extends tQ{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class np extends t0{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nb extends t1{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class ng extends t2{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class n_ extends t3{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class ny extends t5{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nv extends t4{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nx extends t6{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nw extends t8{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nF extends t7{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nk extends t9{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nE extends ne{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nT extends nt{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nA extends nn{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nM extends ni{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nC extends nr{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nS extends no{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nL extends na{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nD extends ns{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}tZ().isAxiosError;let nI=new class{get api(){return this._client}constructor(){this._axiosInstance=tZ().create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(t=>(t.paramsSerializer=t=>tS().stringify(t,{arrayFormat:"repeat"}),t))}get axiosInstance(){return this._axiosInstance}get baseUrl(){return this._baseUrl}setTimeout(t){this._axiosInstance.defaults.timeout=t}addRequestInterceptor(t){this._axiosInstance.interceptors.request.use(t)}initialise(t){this._baseUrl=t,this._client=new nc(t,this._axiosInstance)}};var nP=function(t,n,i,r){return new(i||(i=Promise))(function(o,a){function s(t){try{c(r.next(t))}catch(t){a(t)}}function l(t){try{c(r.throw(t))}catch(t){a(t)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof i?n:new i(function(t){t(n)})).then(s,l)}c((r=r.apply(t,n||[])).next())})};!function(t){t.DISCONNECTED="DISCONNECTED",t.CONNECTED="CONNECTED",t.CONNECTING="CONNECTING"}(eb||(eb={}));let nR="SUBSCRIBED:",nO="UNAUTHORIZED:",nB="TRIGGERED:",nz="EVENT:";class nN{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=nY.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=eb.DISCONNECTED,this._connectingDeferred=null,this._statusCallbacks=[],this._pendingSubscription=null,this._queuedSubscriptions=[],this._subscriptionMap=new Map,this._assetEventCallbackMap=new Map,this._attributeEventCallbackMap=new Map,this._unloading=!1}get status(){return this._status}subscribeStatusChange(t){this._statusCallbacks.push(t)}unsubscribeStatusChange(t){!function(t,n){if(0===t.length)return;let i=t.indexOf(n);i>=0&&t.splice(i,1)}(this._statusCallbacks,t)}connect(){return(this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this._status===eb.CONNECTED)?Promise.resolve(!0):(this._disconnectRequested=!1,this._connectingDeferred||(this._onStatusChanged(eb.CONNECTING),this._connectingDeferred=new tR,this._doConnect().then(t=>{if(this._connectingDeferred){let n=this._connectingDeferred;this._connectingDeferred=null,t?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=nY.MIN_RECONNECT_DELAY,this._onStatusChanged(eb.CONNECTED),window.setTimeout(()=>{this._onConnect()},0)):(console.debug("Failed to connect to event service: "+this.endpointUrl),this._scheduleReconnect()),n.resolve(t)}})),this._connectingDeferred.promise)}disconnect(){console.debug("Disconnecting from event service: "+this.endpointUrl),this._disconnectRequested||(this._disconnectRequested=!0,this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this.status!==eb.DISCONNECTED&&this._doDisconnect())}subscribe(t,n){let i={eventSubscription:t,callback:n,deferred:new tR};return null!=this._pendingSubscription||this._status!==eb.CONNECTED?(this._queuedSubscriptions.push(i),i.deferred.promise):(this._pendingSubscription=i,this._doSubscribe(t).then(t=>{if(this._pendingSubscription){let n=this._pendingSubscription;this._pendingSubscription=null,this._subscriptionMap.set(t,n),this._processNextSubscription();let i=n.deferred;n.deferred=null,i&&i.resolve(t)}},t=>{if(this._pendingSubscription){let n=this._pendingSubscription;this._pendingSubscription=null,this._processNextSubscription();let i=n.deferred;n.deferred=null,i&&i.reject(t)}}),this._pendingSubscription.deferred.promise)}unsubscribe(t){return nP(this,void 0,void 0,function*(){if(this._subscriptionMap.delete(t))return void this._doUnsubscribe(t);if(this._assetEventCallbackMap.delete(t)){if(this._assetEventPromise&&0===this._assetEventCallbackMap.size){let t=yield this._assetEventPromise;this._assetEventPromise=void 0,this.unsubscribe(t)}return}if(this._attributeEventCallbackMap.delete(t)){if(this._attributeEventPromise&&0===this._attributeEventCallbackMap.size){let t=yield this._attributeEventPromise;this._attributeEventPromise=void 0,this.unsubscribe(t)}return}})}sendEvent(t){this._status===eb.CONNECTED&&this._doSend(t)}sendEventWithReply(t){return this._status!==eb.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(t)}subscribeAssetEvents(t,n,i){return nP(this,void 0,void 0,function*(){let r=t&&"string"!=typeof t[0]?t.map(t=>t.id):t,o="AssetEvent"+nN._subscriptionCounter++;if(!this._assetEventPromise){let t;rS.authenticated||(t={filterType:"asset",realm:rS.displayRealm});let n={eventType:"asset",filter:t};this._assetEventPromise=this.subscribe(n,t=>{this._assetEventCallbackMap.forEach(n=>n(t))})}return this._assetEventCallbackMap.set(o,t=>{let n=t.asset.id;r?r.find(t=>n===t)&&i(t):t.asset.realm===rS.displayRealm&&i(t)}),this._assetEventPromise.then(()=>{try{if(r&&n){let t={messageID:"read-assets:"+r.join(",")+":"+o,eventType:"read-assets",assetQuery:{ids:r}};this.sendEventWithReply(t).then(t=>{t.assets&&this._assetEventCallbackMap.has(o)&&t.assets.forEach(t=>{i({eventType:"asset",asset:t,cause:"READ"})})})}}catch(n){throw console.error("Failed to subscribe to asset events for assets: "+t),o&&this.unsubscribe(o),n}return o})})}subscribeAttributeEvents(t,n,i){return nP(this,void 0,void 0,function*(){let r=t&&"string"!=typeof t[0],o=r?t.map(t=>t.id):t,a=r?t:void 0,s="AttributeEvent"+nN._subscriptionCounter++;if(!this._attributeEventPromise){let t;rS.authenticated||(t={filterType:"asset",realm:rS.displayRealm});let n={eventType:"attribute",filter:t};this._attributeEventPromise=this.subscribe(n,t=>{this._attributeEventCallbackMap.forEach(n=>n(t))})}let l=n=>{let a=n.ref;r?t.forEach(t=>{a.id===t.id&&a.name===t.name&&i(n)}):o?o.find(t=>a.id===t)&&i(n):n.realm===rS.displayRealm&&i(n)};return this._attributeEventCallbackMap.set(s,l),this._attributeEventPromise.then(()=>{try{if(n&&o){let t={messageID:"read-assets:"+o.join(",")+":"+s,eventType:"read-assets",assetQuery:{ids:o}};this.sendEventWithReply(t).then(t=>{t.assets&&this._attributeEventCallbackMap.has(s)&&t.assets.forEach(t=>{t.attributes&&Object.entries(t.attributes).forEach(([n,i])=>{(!a||a.find(i=>i.id===t.id&&i.name===n))&&l({eventType:"attribute",timestamp:i.timestamp,value:i.value,ref:{id:t.id,name:n}})})})})}}catch(n){throw console.error("Failed to subscribe to asset events for assets: "+t),s&&this.unsubscribe(s),n}return s})})}_processNextSubscription(){this._status===eb.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout(()=>{let t=this._queuedSubscriptions.shift();t&&this.subscribe(t.eventSubscription,t.callback).then(n=>{let i=t.deferred;t.deferred=null,i&&i.resolve(n)},n=>{let i=t.deferred;t.deferred=null,i&&i.reject(n)})},0)}_onStatusChanged(t){t!==this._status&&(console.debug("Event provider status changed: "+t),this._status=t,this._unloading||window.setTimeout(()=>{this._statusCallbacks.forEach(n=>n(t))},0))}_onMessageReceived(t,n){let i=this._subscriptionMap.get(t);i&&i.callback(n)}_onConnect(){if(Object.keys(this._subscriptionMap).length>0){for(let t in this._subscriptionMap)this._subscriptionMap.has(t)&&this._queuedSubscriptions.unshift(this._subscriptionMap.get(t));this._subscriptionMap.clear()}this._processNextSubscription()}_onDisconnect(){this._status===eb.CONNECTED&&this._onStatusChanged(eb.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(eb.CONNECTING),this._scheduleReconnect()}_scheduleReconnect(){this._reconnectTimer||!this._disconnectRequested&&(console.debug("Event provider scheduling reconnect in "+this._reconnectDelayMillis+"ms"),this._reconnectTimer=window.setTimeout(()=>{this._disconnectRequested||this.connect()},this._reconnectDelayMillis),this._reconnectDelayMillis<nY.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(nY.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}nN.MIN_RECONNECT_DELAY=0,nN.MAX_RECONNECT_DELAY=3e4,nN._subscriptionCounter=0;class nY extends nN{get endpointUrl(){return this._endpointUrl}constructor(t){super(),this._webSocket=void 0,this._connectDeferred=null,this._subscribeDeferred=null,this._repliesDeferred=new Map,this._endpointUrl=(t.startsWith("https:")?"wss":"ws")+"://"+t.substr(t.indexOf("://")+3)+"/websocket/events",window.addEventListener("beforeunload",()=>{this._unloading=!0,this.disconnect()})}_doConnect(){let t=this._endpointUrl+"?Realm="+rS.config.realm;return rS.authenticated&&(t+="&Authorization="+rS.getAuthorizationHeader()),this._webSocket=new WebSocket(t),this._connectDeferred=new tR,this._webSocket.onopen=()=>{if(this._connectDeferred){let t=this._connectDeferred;this._connectDeferred=null,t.resolve(!0)}},this._webSocket.onerror=t=>{if(this._connectDeferred){let t=this._connectDeferred;this._connectDeferred=null,t.resolve(!1)}else console.debug("Event provider error"),this._beforeDisconnect()},this._webSocket.onclose=()=>{if(this._webSocket=void 0,this._connectDeferred){let t=this._connectDeferred;this._connectDeferred=null,t.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onmessage=t=>{let n=t.data;if(n&&n.startsWith(nR)){let t=JSON.parse(n.substring(nR.length)),i=this._subscribeDeferred;this._subscribeDeferred=null,i&&i.resolve(t.subscriptionId)}else if(n.startsWith(nO)){let t=JSON.parse(n.substring(nO.length)),i=this._subscribeDeferred;this._subscribeDeferred=null,i&&(console.warn("Unauthorized event subscription: "+JSON.stringify(t,null,2)),i.reject("Unauthorized"))}else if(n.startsWith(nB)){let t=JSON.parse(n.substring(nB.length));t.events&&t.events.forEach(n=>{this._onMessageReceived(t.subscriptionId,n)})}else if(n.startsWith(nz)){let t=JSON.parse(n.substring(nz.length));if(t.messageID){let n=this._repliesDeferred.get(t.messageID);this._repliesDeferred.delete(t.messageID),n&&n.resolve(t)}}},this._connectDeferred.promise}_beforeDisconnect(){this._onDisconnect()}_doDisconnect(){var t;null==(t=this._webSocket)||t.close(),this._subscribeDeferred=null,this._repliesDeferred.clear()}_doSubscribe(t){return this._webSocket?this._subscribeDeferred?Promise.reject("There's already a pending subscription"):(this._subscribeDeferred=new tR,t.subscriptionId||(t.subscriptionId=nY._subscriptionCounter+++""),this._webSocket.send("SUBSCRIBE:"+JSON.stringify(t)),this._subscribeDeferred.promise):Promise.reject("Not connected")}_doUnsubscribe(t){this._webSocket&&this._webSocket.send("UNSUBSCRIBE:"+JSON.stringify({subscriptionId:t}))}_doSend(t){let n=nz+JSON.stringify(t);this._webSocket.send(n)}_doSendWithReply(t){if(t.messageID||(t.messageID=(new Date().getTime()+10*Math.random()).toString(10)),this._repliesDeferred.has(t.messageID))return Promise.reject("There's already a pending send and reply with this ID");let n=new tR;return this._repliesDeferred.set(t.messageID,n),this._webSocket.send(nz+JSON.stringify(t)),n.promise}}function nj(t){return(nj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}nY._subscriptionCounter=1;var nU=[],nH=nU.forEach,nV=nU.slice;function nG(t){return nH.call(nV.call(arguments,1),function(n){if(n)for(var i in n)void 0===t[i]&&(t[i]=n[i])}),t}function nq(){return"function"==typeof XMLHttpRequest||("undefined"==typeof XMLHttpRequest?"undefined":nj(XMLHttpRequest))==="object"}var n$=i(6850),nW=i.t(n$,2);function nZ(t){return(nZ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}"function"==typeof fetch&&(eg="undefined"!=typeof global&&global.fetch?global.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),nq()&&("undefined"!=typeof global&&global.XMLHttpRequest?e_=global.XMLHttpRequest:"undefined"!=typeof window&&window.XMLHttpRequest&&(e_=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&("undefined"!=typeof global&&global.ActiveXObject?ey=global.ActiveXObject:"undefined"!=typeof window&&window.ActiveXObject&&(ey=window.ActiveXObject)),eg||!nW||e_||ey||(eg=n$||nW),"function"!=typeof eg&&(eg=void 0);var nX=function(t,n){if(n&&"object"===nZ(n)){var i="";for(var r in n)i+="&"+encodeURIComponent(r)+"="+encodeURIComponent(n[r]);if(!i)return t;t=t+(-1!==t.indexOf("?")?"&":"?")+i.slice(1)}return t},nK=function(t,n,i){eg(t,n).then(function(t){if(!t.ok)return i(t.statusText||"Error",{status:t.status});t.text().then(function(n){i(null,{status:t.status,data:n})}).catch(i)}).catch(i)},nJ=!1,nQ=function(t,n,i,r){t.queryStringParams&&(n=nX(n,t.queryStringParams));var o=nG({},"function"==typeof t.customHeaders?t.customHeaders():t.customHeaders);i&&(o["Content-Type"]="application/json");var a="function"==typeof t.requestOptions?t.requestOptions(i):t.requestOptions,s=nG({method:i?"POST":"GET",body:i?t.stringify(i):void 0,headers:o},nJ?{}:a);try{nK(n,s,r)}catch(t){if(!a||0===Object.keys(a).length||!t.message||0>t.message.indexOf("not implemented"))return r(t);try{Object.keys(a).forEach(function(t){delete s[t]}),nK(n,s,r),nJ=!0}catch(t){r(t)}}},n0=function(t,n,i,r){i&&"object"===nZ(i)&&(i=nX("",i).slice(1)),t.queryStringParams&&(n=nX(n,t.queryStringParams));try{(o=e_?new e_:new ey("MSXML2.XMLHTTP.3.0")).open(i?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,i&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var o,a=t.customHeaders;if(a="function"==typeof a?a():a)for(var s in a)o.setRequestHeader(s,a[s]);o.onreadystatechange=function(){o.readyState>3&&r(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(i)}catch(t){console&&console.log(t)}};let n1=function(t,n,i,r){return("function"==typeof i&&(r=i,i=void 0),r=r||function(){},eg)?nQ(t,n,i,r):nq()||"function"==typeof ActiveXObject?n0(t,n,i,r):void r(Error("No fetch and no xhr implementation found!"))};var n2=function(){var t;function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(this instanceof n))throw TypeError("Cannot call a class as a function");this.services=t,this.options=i,this.allOptions=r,this.type="backend",this.init(t,i,r)}return t=[{key:"init",value:function(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=t,this.options=nG(i,this.options||{},{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(t){return JSON.parse(t)},stringify:JSON.stringify,parsePayload:function(t,n,i){var r,o;return r={},o=i||"",n in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,r},request:n1,reloadInterval:"undefined"==typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}),this.allOptions=r,this.services&&this.options.reloadInterval&&setInterval(function(){return n.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(t,n,i){this._readAny(t,t,n,n,i)}},{key:"read",value:function(t,n,i){this._readAny([t],t,[n],n,i)}},{key:"_readAny",value:function(t,n,i,r,o){var a,s,l=this,c=this.options.loadPath;"function"==typeof this.options.loadPath&&(c=this.options.loadPath(t,i)),(c=(s=a=c)&&"function"==typeof s.then?a:Promise.resolve(a)).then(function(a){if(!a)return o(null,{});var s=l.services.interpolator.interpolate(a,{lng:t.join("+"),ns:i.join("+")});l.loadUrl(s,o,n,r)})}},{key:"loadUrl",value:function(t,n,i,r){var o=this;this.options.request(this.options,t,void 0,function(a,s){var l,c;if(s&&(s.status>=500&&s.status<600||!s.status))return n("failed loading "+t+"; status code: "+s.status,!0);if(s&&s.status>=400&&s.status<500)return n("failed loading "+t+"; status code: "+s.status,!1);if(!s&&a&&a.message&&a.message.indexOf("Failed to fetch")>-1)return n("failed loading "+t+": "+a.message,!0);if(a)return n(a,!1);try{l="string"==typeof s.data?o.options.parse(s.data,i,r):s.data}catch(n){c="failed parsing "+t+" to json"}if(c)return n(c,!1);n(null,l)})}},{key:"create",value:function(t,n,i,r,o){var a=this;if(this.options.addPath){"string"==typeof t&&(t=[t]);var s=this.options.parsePayload(n,i,r),l=0,c=[],d=[];t.forEach(function(i){var r=a.options.addPath;"function"==typeof a.options.addPath&&(r=a.options.addPath(i,n));var u=a.services.interpolator.interpolate(r,{lng:i,ns:n});a.options.request(a.options,u,s,function(n,i){l+=1,c.push(n),d.push(i),l===t.length&&o&&o(c,d)})})}}},{key:"reload",value:function(){var t=this,n=this.services,i=n.backendConnector,r=n.languageUtils,o=n.logger,a=i.language;if(!a||"cimode"!==a.toLowerCase()){var s=[],l=function(t){r.toResolveHierarchy(t).forEach(function(t){0>s.indexOf(t)&&s.push(t)})};l(a),this.allOptions.preload&&this.allOptions.preload.forEach(function(t){return l(t)}),s.forEach(function(n){t.allOptions.ns.forEach(function(t){i.read(n,t,"read",null,null,function(r,a){r&&o.warn("loading namespace ".concat(t," for language ").concat(n," failed"),r),!r&&a&&o.log("loaded namespace ".concat(t," for language ").concat(n),a),i.loaded("".concat(n,"|").concat(t),r,a)})})})}}}],function(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}();n2.type="backend";let n3=globalThis,n5=n3.ShadowRoot&&(void 0===n3.ShadyCSS||n3.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n4=Symbol(),n6=new WeakMap;class n8{constructor(t,n,i){if(this._$cssResult$=!0,i!==n4)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n}get styleSheet(){let t=this.o,n=this.t;if(n5&&void 0===t){let i=void 0!==n&&1===n.length;i&&(t=n6.get(n)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&n6.set(n,t))}return t}toString(){return this.cssText}}let n7=t=>new n8("string"==typeof t?t:t+"",void 0,n4),n9=(t,...n)=>new n8(1===t.length?t[0]:n.reduce((n,i,r)=>n+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[r+1],t[0]),t,n4),ie=n5?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let n="";for(let i of t.cssRules)n+=i.cssText;return n7(n)})(t):t,{is:it,defineProperty:ii,getOwnPropertyDescriptor:ir,getOwnPropertyNames:io,getOwnPropertySymbols:ia,getPrototypeOf:is}=Object,il=globalThis,ic=il.trustedTypes,id=ic?ic.emptyScript:"",iu=il.reactiveElementPolyfillSupport,im={toAttribute(t,n){switch(n){case Boolean:t=t?id:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,n){let i=t;switch(n){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},ih=(t,n)=>!it(t,n),ip={attribute:!0,type:String,converter:im,reflect:!1,useDefault:!1,hasChanged:ih};Symbol.metadata??=Symbol("metadata"),il.litPropertyMetadata??=new WeakMap;class ib extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,n=ip){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(t,n),!n.noAccessor){let i=Symbol(),r=this.getPropertyDescriptor(t,i,n);void 0!==r&&ii(this.prototype,t,r)}}static getPropertyDescriptor(t,n,i){let{get:r,set:o}=ir(this.prototype,t)??{get(){return this[n]},set(t){this[n]=t}};return{get:r,set(n){let a=r?.call(this);o?.call(this,n),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??ip}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;let t=is(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){let t=this.properties;for(let n of[...io(t),...ia(t)])this.createProperty(n,t[n])}let t=this[Symbol.metadata];if(null!==t){let n=litPropertyMetadata.get(t);if(void 0!==n)for(let[t,i]of n)this.elementProperties.set(t,i)}for(let[t,n]of(this._$Eh=new Map,this.elementProperties)){let i=this._$Eu(t,n);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let n=[];if(Array.isArray(t))for(let i of new Set(t.flat(1/0).reverse()))n.unshift(ie(i));else void 0!==t&&n.push(ie(t));return n}static _$Eu(t,n){let i=n.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map;for(let n of this.constructor.elementProperties.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,n)=>{if(n5)t.adoptedStyleSheets=n.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let i of n){let n=document.createElement("style"),r=n3.litNonce;void 0!==r&&n.setAttribute("nonce",r),n.textContent=i.cssText,t.appendChild(n)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,n,i){this._$AK(t,i)}_$ET(t,n){let i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(void 0!==r&&!0===i.reflect){let o=(void 0!==i.converter?.toAttribute?i.converter:im).toAttribute(n,i.type);this._$Em=t,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,n){let i=this.constructor,r=i._$Eh.get(t);if(void 0!==r&&this._$Em!==r){let t=i.getPropertyOptions(r),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:im;this._$Em=r;let a=o.fromAttribute(n,t.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(t,n,i){if(void 0!==t){let r=this.constructor,o=this[t];if(!(((i??=r.getPropertyOptions(t)).hasChanged??ih)(o,n)||i.useDefault&&i.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,i))))return;this.C(t,n,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,n,{useDefault:i,reflect:r,wrapped:o},a){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,a??n??this[t]),!0!==o||void 0!==a)||(this._$AL.has(t)||(this.hasUpdated||i||(n=void 0),this._$AL.set(t,n)),!0===r&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[t,n]of this._$Ep)this[t]=n;this._$Ep=void 0}let t=this.constructor.elementProperties;if(t.size>0)for(let[n,i]of t){let{wrapped:t}=i,r=this[n];!0!==t||this._$AL.has(n)||void 0===r||this.C(n,void 0,i,r)}}let t=!1,n=this._$AL;try{(t=this.shouldUpdate(n))?(this.willUpdate(n),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(n)):this._$EM()}catch(n){throw t=!1,this._$EM(),n}t&&this._$AE(n)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}ib.elementStyles=[],ib.shadowRootOptions={mode:"open"},ib.elementProperties=new Map,ib.finalized=new Map,iu?.({ReactiveElement:ib}),(il.reactiveElementVersions??=[]).push("2.1.1");let ig=globalThis,i_=ig.trustedTypes,iy=i_?i_.createPolicy("lit-html",{createHTML:t=>t}):void 0,iv="$lit$",ix=`lit$${Math.random().toFixed(9).slice(2)}$`,iw="?"+ix,iF=`<${iw}>`,ik=document,iE=()=>ik.createComment(""),iT=t=>null===t||"object"!=typeof t&&"function"!=typeof t,iA=Array.isArray,iM=t=>iA(t)||"function"==typeof t?.[Symbol.iterator],iC="[ \n\f\r]",iS=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,iL=/-->/g,iD=/>/g,iI=RegExp(`>|${iC}(?:([^\\s"'>=/]+)(${iC}*=${iC}*(?:[^
|
|
53
|
+
${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionData:d},m=s.renderingMode?s.renderingMode:"2d";if("offscreen"===t.renderPass){let n=s.prerender;n&&(t.setCustomLayerDefaults(),a.setColorMode(t.colorModeForRenderPass()),n.call(s,a.gl,u),a.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),a.setColorMode(t.colorModeForRenderPass()),a.setStencilMode(tT.disabled);let n="3d"===m?t.getDepthModeFor3D():t.getDepthModeForSublayer(0,tE.ReadOnly);a.setDepthMode(n),s.render(a.gl,u),a.setDirty(),t.setBaseState(),a.bindFramebuffer.set(null)}}(t,0,r,a))}saveTileTexture(t){let n=this._tileTextures[t.size[0]];n?n.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){let n=this._tileTextures[t];return n&&n.length>0?n.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;let n=this.imageManager.getPattern(t.from.toString()),i=this.imageManager.getPattern(t.to.toString());return!n||!i}useProgram(t,n,i=!1,r=[]){this.cache=this.cache||{};let o=!!this.style.map.terrain,a=this.style.projection,s=i?tr.projectionMercator:a.shaderPreludeCode,l=i?tl:a.shaderDefine,c=t+(n?n.cacheKey:"")+`/${i?tc:a.shaderVariantName}`+(this._showOverdrawInspector?"/overdraw":"")+(o?"/terrain":"")+(r?`/${r.join("/")}`:"");return this.cache[c]||(this.cache[c]=new ne(this.context,tr[t],n,nS[t],this._showOverdrawInspector,o,s,l,r)),this.cache[c]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new n.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){var t,n;if(this._tileTextures){for(let t in this._tileTextures){let n=this._tileTextures[t];if(n)for(let t of n)t.destroy()}this._tileTextures={}}if(this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.rasterBoundsBufferPosOnly&&this.rasterBoundsBufferPosOnly.destroy(),this.viewportBuffer&&this.viewportBuffer.destroy(),this.tileBorderIndexBuffer&&this.tileBorderIndexBuffer.destroy(),this.quadTriangleIndexBuffer&&this.quadTriangleIndexBuffer.destroy(),this.tileExtentMesh&&(null==(t=this.tileExtentMesh.vertexBuffer)||t.destroy()),this.tileExtentMesh&&(null==(n=this.tileExtentMesh.indexBuffer)||n.destroy()),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.cache){for(let t in this.cache){let n=this.cache[t];n&&n.program&&this.context.gl.deleteProgram(n.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){let{drawingBufferWidth:t,drawingBufferHeight:n}=this.context.gl;return this.width!==t||this.height!==n}}function iO(t,n){let i,r=!1,o=null,a=null,s=()=>{o=null,r&&(t.apply(a,i),o=setTimeout(s,n),r=!1)};return(...t)=>(r=!0,a=this,i=t,o||s(),o)}class iB{constructor(t){this._getCurrentHash=()=>{let t=window.location.hash.replace("#","");if(this._hashName){let n;return t.split("&").map(t=>t.split("=")).forEach(t=>{t[0]===this._hashName&&(n=t)}),(n&&n[1]||"").split("/")}return t.split("/")},this._onHashChange=()=>{let t=this._getCurrentHash();if(!this._isValidHash(t))return!1;let n=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:n,pitch:+(t[4]||0)}),!0},this._updateHashUnthrottled=()=>{let t=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,t)},this._removeHash=()=>{let t=this._getCurrentHash();if(0===t.length)return;let n=t.join("/"),i=n;i.split("&").length>0&&(i=i.split("&")[0]),this._hashName&&(i=`${this._hashName}=${n}`);let r=window.location.hash.replace(i,"");r.startsWith("#&")?r=r.slice(0,1)+r.slice(2):"#"===r&&(r="");let o=window.location.href.replace(/(#.+)?$/,r);o=o.replace("&&","&"),window.history.replaceState(window.history.state,null,o)},this._updateHash=iO(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(t){let n=this._map.getCenter(),i=Math.round(100*this._map.getZoom())/100,r=Math.pow(10,Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10)),o=Math.round(n.lng*r)/r,a=Math.round(n.lat*r)/r,s=this._map.getBearing(),l=this._map.getPitch(),c="";if(c+=t?`/${o}/${a}/${i}`:`${i}/${a}/${o}`,(s||l)&&(c+="/"+Math.round(10*s)/10),l&&(c+=`/${Math.round(l)}`),this._hashName){let t=this._hashName,n=!1,i=window.location.hash.slice(1).split("&").map(i=>{let r=i.split("=")[0];return r===t?(n=!0,`${r}=${c}`):i}).filter(t=>t);return n||i.push(`${t}=${c}`),`#${i.join("&")}`}return`#${c}`}_isValidHash(t){if(t.length<3||t.some(isNaN))return!1;try{new n.U(+t[2],+t[1])}catch(t){return!1}let i=+t[0],r=+(t[3]||0),o=+(t[4]||0);return i>=this._map.getMinZoom()&&i<=this._map.getMaxZoom()&&r>=-180&&r<=180&&o>=this._map.getMinPitch()&&o<=this._map.getMaxPitch()}}let iz={linearity:.3,easing:n.cq(0,0,.3,1)},iN=n.e({deceleration:2500,maxSpeed:1400},iz),iY=n.e({deceleration:20,maxSpeed:1400},iz),ij=n.e({deceleration:1e3,maxSpeed:360},iz),iU=n.e({deceleration:1e3,maxSpeed:90},iz),iH=n.e({deceleration:1e3,maxSpeed:360},iz);class iV{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:v(),settings:t})}_drainInertiaBuffer(){let t=this._inertiaBuffer,n=v();for(;t.length>0&&n-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let i={zoom:0,bearing:0,pitch:0,roll:0,pan:new n.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:t}of this._inertiaBuffer)i.zoom+=t.zoomDelta||0,i.bearing+=t.bearingDelta||0,i.pitch+=t.pitchDelta||0,i.roll+=t.rollDelta||0,t.panDelta&&i.pan._add(t.panDelta),t.around&&(i.around=t.around),t.pinchAround&&(i.pinchAround=t.pinchAround);let r=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,o={};if(i.pan.mag()){let a=iq(i.pan.mag(),r,n.e({},iN,t||{})),s=i.pan.mult(a.amount/i.pan.mag()),l=this._map.cameraHelper.handlePanInertia(s,this._map.transform);o.center=l.easingCenter,o.offset=l.easingOffset,iG(o,a)}if(i.zoom){let t=iq(i.zoom,r,iY);o.zoom=this._map.transform.zoom+t.amount,iG(o,t)}if(i.bearing){let t=iq(i.bearing,r,ij);o.bearing=this._map.transform.bearing+n.ai(t.amount,-179,179),iG(o,t)}if(i.pitch){let t=iq(i.pitch,r,iU);o.pitch=this._map.transform.pitch+t.amount,iG(o,t)}if(i.roll){let t=iq(i.roll,r,iH);o.roll=this._map.transform.roll+n.ai(t.amount,-179,179),iG(o,t)}if(o.zoom||o.bearing){let t=void 0===i.pinchAround?i.around:i.pinchAround;o.around=t?this._map.unproject(t):this._map.getCenter()}return this.clear(),n.e(o,{noMoveStart:!0})}}function iG(t,n){(!t.duration||t.duration<n.duration)&&(t.duration=n.duration,t.easing=n.easing)}function iq(t,i,r){let{maxSpeed:o,linearity:a,deceleration:s}=r,l=n.ai(t*a/(i/1e3),-o,o),c=Math.abs(l)/(s*a);return{easing:r.easing,duration:1e3*c,amount:c/2*l}}class i$ extends n.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,r,o={}){r=r instanceof MouseEvent?r:new MouseEvent(t,r);let a=x.mousePos(i.getCanvas(),r);super(t,n.e({point:a,lngLat:i.unproject(a),originalEvent:r},o)),this._defaultPrevented=!1,this.target=i}}class iW extends n.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,r){let o="touchend"===t?r.changedTouches:r.touches,a=x.touchPos(i.getCanvasContainer(),o),s=a.map(t=>i.unproject(t)),l=a.reduce((t,n,i,r)=>t.add(n.div(r.length)),new n.P(0,0));super(t,{points:a,point:l,lngLats:s,lngLat:i.unproject(l),originalEvent:r}),this._defaultPrevented=!1}}class iZ extends n.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,i){super(t,{originalEvent:i}),this._defaultPrevented=!1}}class iX{constructor(t,n){this._map=t,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new iZ(t.type,this._map,t))}mousedown(t,n){return this._mousedownPos=n,this._firePreventable(new i$(t.type,this._map,t))}mouseup(t){this._map.fire(new i$(t.type,this._map,t))}click(t,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new i$(t.type,this._map,t))}dblclick(t){return this._firePreventable(new i$(t.type,this._map,t))}mouseover(t){this._map.fire(new i$(t.type,this._map,t))}mouseout(t){this._map.fire(new i$(t.type,this._map,t))}touchstart(t){return this._firePreventable(new iW(t.type,this._map,t))}touchmove(t){this._map.fire(new iW(t.type,this._map,t))}touchend(t){this._map.fire(new iW(t.type,this._map,t))}touchcancel(t){this._map.fire(new iW(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class iK{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new i$(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new i$("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new i$(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class iJ{constructor(t){this._map=t}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.screenPointToLocation(n.P.convert(t),this._map.terrain)}}class iQ{constructor(t,n){this._map=t,this._tr=new iJ(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=n.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,n){this.isEnabled()&&t.shiftKey&&0===t.button&&(x.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(t,n){if(!this._active||this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)return;let i=this._startPos;this._lastPos=n,this._box||(this._box=x.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));let r=Math.min(i.x,n.x),o=Math.max(i.x,n.x),a=Math.min(i.y,n.y),s=Math.max(i.y,n.y);x.setTransform(this._box,`translate(${r}px,${a}px)`),this._box.style.width=o-r+"px",this._box.style.height=s-a+"px"}mouseupWindow(t,i){if(!this._active||0!==t.button)return;let r=this._startPos;if(this.reset(),x.suppressClick(),r.x!==i.x||r.y!==i.y)return this._map.fire(new n.l("boxzoomend",{originalEvent:t})),{cameraAnimation:t=>t.fitScreenCoordinates(r,i,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(x.remove(this._box),this._box=null),x.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,i){return this._map.fire(new n.l(t,{originalEvent:i}))}}function i0(t,n){if(t.length!==n.length)throw Error(`The number of touches and points are not equal - touches ${t.length}, points ${n.length}`);let i={};for(let r=0;r<t.length;r++)i[t[r].identifier]=n[r];return i}class i1{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,i,r){(this.centroid||r.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),r.length===this.numTouches&&(this.centroid=function(t){let i=new n.P(0,0);for(let n of t)i._add(n);return i.div(t.length)}(i),this.touches=i0(r,i)))}touchmove(t,n,i){if(this.aborted||!this.centroid)return;let r=i0(i,n);for(let t in this.touches){let n=r[t];(!n||n.dist(this.touches[t])>30)&&(this.aborted=!0)}}touchend(t,n,i){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){let t=!this.aborted&&this.centroid;if(this.reset(),t)return t}}}class i2{constructor(t){this.singleTap=new i1(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,n,i){this.singleTap.touchstart(t,n,i)}touchmove(t,n,i){this.singleTap.touchmove(t,n,i)}touchend(t,n,i){let r=this.singleTap.touchend(t,n,i);if(r){let n=t.timeStamp-this.lastTime<500,i=!this.lastTap||30>this.lastTap.dist(r);if(n&&i||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}}}class i3{constructor(t){this._tr=new iJ(t),this._zoomIn=new i2({numTouches:1,numTaps:2}),this._zoomOut=new i2({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,n,i){this._zoomIn.touchstart(t,n,i),this._zoomOut.touchstart(t,n,i)}touchmove(t,n,i){this._zoomIn.touchmove(t,n,i),this._zoomOut.touchmove(t,n,i)}touchend(t,n,i){let r=this._zoomIn.touchend(t,n,i),o=this._zoomOut.touchend(t,n,i),a=this._tr;return r?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:n=>n.easeTo({duration:300,zoom:a.zoom+1,around:a.unproject(r)},{originalEvent:t})}):o?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:n=>n.easeTo({duration:300,zoom:a.zoom-1,around:a.unproject(o)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class i5{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){let n=this._moveFunction(...t);if(n.bearingDelta||n.pitchDelta||n.rollDelta||n.around||n.panDelta)return this._active=!0,n}dragStart(t,n){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=Array.isArray(n)?n[0]:n,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,n){if(!this.isEnabled())return;let i=this._lastPoint;if(!i)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);let r=Array.isArray(n)?n[0]:n;return!this._moved&&r.dist(i)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=r,this._move(i,r))}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&x.suppressClick(),this.reset(t))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}let i4={0:1,2:2};class i6{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){let n=x.mouseButton(t);this._eventButton=n}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){return!function(t,n){let i=i4[n];return void 0===t.buttons||(t.buttons&i)!==i}(t,this._eventButton)}isValidEndEvent(t){return x.mouseButton(t)===this._eventButton}}class i8{constructor(){this._firstTouch=void 0}_isOneFingerTouch(t){return 1===t.targetTouches.length}_isSameTouchEvent(t){return t.targetTouches[0].identifier===this._firstTouch}startMove(t){this._firstTouch=t.targetTouches[0].identifier}endMove(t){delete this._firstTouch}isValidStartEvent(t){return this._isOneFingerTouch(t)}isValidMoveEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}isValidEndEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}}class i7{constructor(t=new i6({checkCorrectEvent:()=>!0}),n=new i8){this.mouseMoveStateManager=t,this.oneFingerTouchMoveStateManager=n}_executeRelevantHandler(t,n,i){return t instanceof MouseEvent?n(t):"undefined"!=typeof TouchEvent&&t instanceof TouchEvent?i(t):void 0}startMove(t){this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.startMove(t),t=>this.oneFingerTouchMoveStateManager.startMove(t))}endMove(t){this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.endMove(t),t=>this.oneFingerTouchMoveStateManager.endMove(t))}isValidStartEvent(t){return this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidStartEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidStartEvent(t))}isValidMoveEvent(t){return this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidMoveEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(t))}isValidEndEvent(t){return this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidEndEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidEndEvent(t))}}let i9=t=>{t.mousedown=t.dragStart,t.mousemoveWindow=t.dragMove,t.mouseup=t.dragEnd,t.contextmenu=t=>{t.preventDefault()}};class re{constructor(t,n){this._clickTolerance=t.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new n.P(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,n,i){return this._calculateTransform(t,n,i)}touchmove(t,n,i){if(this._active){if(!this._shouldBePrevented(i.length))return t.preventDefault(),this._calculateTransform(t,n,i);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t)}}touchend(t,n,i){this._calculateTransform(t,n,i),this._active&&this._shouldBePrevented(i.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,i,r){r.length>0&&(this._active=!0);let o=i0(r,i),a=new n.P(0,0),s=new n.P(0,0),l=0;for(let t in o){let n=o[t],i=this._touches[t];i&&(a._add(n),s._add(n.sub(i)),l++,o[t]=n)}if(this._touches=o,this._shouldBePrevented(l)||!s.mag())return;let c=s.div(l);return this._sum._add(c),this._sum.mag()<this._clickTolerance?void 0:{around:a.div(l),panDelta:c}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class rt{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,n,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([n[0],n[1]]))}touchmove(t,n,i){if(!this._firstTwoTouches)return;t.preventDefault();let[r,o]=this._firstTwoTouches,a=rn(i,n,r),s=rn(i,n,o);if(!a||!s)return;let l=this._aroundCenter?null:a.add(s).div(2);return this._move([a,s],l,t)}touchend(t,n,i){if(!this._firstTwoTouches)return;let[r,o]=this._firstTwoTouches,a=rn(i,n,r),s=rn(i,n,o);a&&s||(this._active&&x.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function rn(t,n,i){for(let r=0;r<t.length;r++)if(t[r].identifier===i)return n[r]}function ri(t,n){return Math.log(t/n)/Math.LN2}class rr extends rt{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,n){let i=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(.1>Math.abs(ri(this._distance,this._startDistance))))return this._active=!0,{zoomDelta:ri(this._distance,i),pinchAround:n}}}function ro(t,n){return 180*t.angleWith(n)/Math.PI}class ra extends rt{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,n,i){let r=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ro(this._vector,r),pinchAround:n}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());let n=25/(Math.PI*this._minDiameter)*360;return Math.abs(ro(t,this._startVector))<n}}function rs(t){return Math.abs(t.y)>Math.abs(t.x)}class rl extends rt{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,n,i){super.touchstart(t,n,i),this._currentTouchCount=i.length}_start(t){this._lastPoints=t,rs(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,n,i){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let r=t[0].sub(this._lastPoints[0]),o=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(r,o,i.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:-((r.y+o.y)/2*.5)}):void 0}gestureBeginsVertically(t,n,i){if(void 0!==this._valid)return this._valid;let r=t.mag()>=2,o=n.mag()>=2;if(!r&&!o)return;if(!r||!o)return void 0===this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;let a=t.y>0==n.y>0;return rs(t)&&rs(n)&&a}}let rc=100,rd=15,ru=10;class rm{constructor(t){this._tr=new iJ(t),this._panStep=rc,this._bearingStep=rd,this._pitchStep=ru,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=0,i=0,r=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?i=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?r=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?r=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(i=0,r=0),{cameraAnimation:s=>{let l=this._tr;s.easeTo({duration:300,easeId:"keyboardHandler",easing:rh,zoom:n?Math.round(l.zoom)+n*(t.shiftKey?2:1):l.zoom,bearing:l.bearing+i*this._bearingStep,pitch:l.pitch+r*this._pitchStep,offset:[-o*this._panStep,-a*this._panStep],center:l.center},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function rh(t){return t*(2-t)}let rf=1/450;class rp{constructor(t,n){this._onTimeout=t=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},this._map=t,this._tr=new iJ(t),this._triggerRenderFrame=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=rf}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(t){return!!this._map.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this._map.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);let n=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,i=v(),r=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==n&&n%4.000244140625==0?this._type="wheel":0!==n&&4>Math.abs(n)?this._type="trackpad":r>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=200>Math.abs(r*n)?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let i=x.mousePos(this._map.getCanvas(),t),r=this._tr;this._aroundPoint=this._aroundCenter?r.transform.locationToScreenPoint(n.U.convert(r.center)):i,this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let t=this._tr.transform;if("number"==typeof this._lastExpectedZoom){let n=t.zoom-this._lastExpectedZoom;"number"==typeof this._startZoom&&(this._startZoom+=n),"number"==typeof this._targetZoom&&(this._targetZoom+=n)}if(0!==this._delta){let i="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,r=2/(1+Math.exp(-Math.abs(this._delta*i)));this._delta<0&&0!==r&&(r=1/r);let o="number"!=typeof this._targetZoom?t.scale:n.al(this._targetZoom);this._targetZoom=t.applyConstrain(t.getCameraLngLat(),n.ao(o*r)).zoom,"wheel"===this._type&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let i="number"!=typeof this._targetZoom?t.zoom:this._targetZoom,r=this._startZoom,o=this._easing,a,s=!1;if("wheel"===this._type&&r&&o){let t=Math.min((v()-this._lastWheelEventTime+5)/200,1),l=o(t);a=n.F.number(r,i,l),t<1?this._frameId||(this._frameId=!0):s=!0}else a=i,s=!0;return this._active=!0,s&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout},200)),this._lastExpectedZoom=a,{noInertia:!0,needsRenderFrame:!s,zoomDelta:a-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let i=n.cs;if(this._prevEase){let t=this._prevEase,r=(v()-t.start)/t.duration,o=t.easing(r+.01)-t.easing(r),a=.27/Math.sqrt(o*o+1e-4)*.01,s=Math.sqrt(.0729-a*a);i=n.cq(a,s,.25,1)}return this._prevEase={start:v(),duration:t,easing:i},i}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class rb{constructor(t,n){this._clickZoom=t,this._tapZoom=n}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class rg{constructor(t){this._tr=new iJ(t),this.reset()}reset(){this._active=!1}dblclick(t,n){return t.preventDefault(),{cameraAnimation:i=>{i.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(n)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class r_{constructor(){this._tap=new i2({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,n,i){if(!this._swipePoint)if(this._tapTime){let r=n[0],o=t.timeStamp-this._tapTime<500,a=30>this._tapPoint.dist(r);o&&a?i.length>0&&(this._swipePoint=r,this._swipeTouch=i[0].identifier):this.reset()}else this._tap.touchstart(t,n,i)}touchmove(t,n,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;let r=n[0],o=r.y-this._swipePoint.y;return this._swipePoint=r,t.preventDefault(),this._active=!0,{zoomDelta:o/128}}}else this._tap.touchmove(t,n,i)}touchend(t,n,i){if(this._tapTime)this._swipePoint&&0===i.length&&this.reset();else{let r=this._tap.touchend(t,n,i);r&&(this._tapTime=t.timeStamp,this._tapPoint=r)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ry{constructor(t,n,i){this._el=t,this._mousePan=n,this._touchPan=i}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class rv{constructor(t,n,i,r){this._pitchWithRotate=t.pitchWithRotate,this._rollEnabled=t.rollEnabled,this._mouseRotate=n,this._mousePitch=i,this._mouseRoll=r}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}}class rx{constructor(t,n,i,r){this._el=t,this._touchZoom=n,this._touchRotate=i,this._tapDragZoom=r,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class rw{constructor(t,n){this._bypassKey=-1!==navigator.userAgent.indexOf("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=n,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=x.create("div","maplibregl-cooperative-gesture-screen",t);let n=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(n=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let i=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),r=document.createElement("div");r.className="maplibregl-desktop-message",r.textContent=n,this._container.appendChild(r);let o=document.createElement("div");o.className="maplibregl-mobile-message",o.textContent=i,this._container.appendChild(o),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(x.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(t){return t[this._bypassKey]}notifyGestureBlocked(t,i){this._enabled&&(this._map.fire(new n.l("cooperativegestureprevented",{gestureType:t,originalEvent:i})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}let rF=t=>t.zoom||t.drag||t.roll||t.pitch||t.rotate;class rk extends n.l{}function rE(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta||t.rollDelta}class rT{constructor(t,i){this.handleWindowEvent=t=>{this.handleEvent(t,`${t.type}Window`)},this.handleEvent=(t,i)=>{if("blur"===t.type)return void this.stop(!0);this._updatingCamera=!0;let r="renderFrame"===t.type?void 0:t,o={needsRenderFrame:!1},a={},s={};for(let{handlerName:l,handler:c,allowed:d}of this._handlers){let u;if(c.isEnabled()){if(this._blockedByActive(s,d,l))c.reset();else if(c[i||t.type]){if(n.ct(t,i||t.type)){let n=x.mousePos(this._map.getCanvas(),t);u=c[i||t.type](t,n)}else if(n.cu(t,i||t.type)){let n=this._getMapTouches(t.touches),r=x.touchPos(this._map.getCanvas(),n);u=c[i||t.type](t,r,n)}else n.cv(i||t.type)||(u=c[i||t.type](t));this.mergeHandlerResult(o,a,u,l,r),u&&u.needsRenderFrame&&this._triggerRenderFrame()}(u||c.isActive())&&(s[l]=c)}}let l={};for(let t in this._previousActiveHandlers)s[t]||(l[t]=r);this._previousActiveHandlers=s,(Object.keys(l).length||rE(o))&&(this._changes.push([o,a,l]),this._triggerRenderFrame()),(Object.keys(s).length||rE(o))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:c}=o;c&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],c(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new iV(t),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(i);let r=this._el;for(let[t,n,i]of(this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[window,"blur",void 0]],this._listeners))x.addEventListener(t,n,t===document?this.handleWindowEvent:this.handleEvent,i)}destroy(){for(let[t,n,i]of this._listeners)x.removeEventListener(t,n,t===document?this.handleWindowEvent:this.handleEvent,i)}_addDefaultHandlers(t){let i=this._map,r=i.getCanvasContainer();this._add("mapEvent",new iX(i,t));let o=i.boxZoom=new iQ(i,t);this._add("boxZoom",o),t.interactive&&t.boxZoom&&o.enable();let a=i.cooperativeGestures=new rw(i,t.cooperativeGestures);this._add("cooperativeGestures",a),t.cooperativeGestures&&a.enable();let s=new i3(i),l=new rg(i);i.doubleClickZoom=new rb(l,s),this._add("tapZoom",s),this._add("clickZoom",l),t.interactive&&t.doubleClickZoom&&i.doubleClickZoom.enable();let c=new r_;this._add("tapDragZoom",c);let d=i.touchPitch=new rl(i);this._add("touchPitch",d),t.interactive&&t.touchPitch&&i.touchPitch.enable(t.touchPitch);let u=()=>i.project(i.getCenter()),m=function({enable:t,clickTolerance:i,aroundCenter:r=!0,minPixelCenterThreshold:o=100,rotateDegreesPerPixelMoved:a=.8},s){return new i5({clickTolerance:i,move:(t,i)=>{let l=s();if(r&&Math.abs(l.y-t.y)>o)return{bearingDelta:n.cr(new n.P(t.x,i.y),i,l)};let c=(i.x-t.x)*a;return r&&i.y<l.y&&(c=-c),{bearingDelta:c}},moveStateManager:new i6({checkCorrectEvent:t=>0===x.mouseButton(t)&&t.ctrlKey||2===x.mouseButton(t)&&!t.ctrlKey}),enable:t,assignEvents:i9})}(t,u),h=function({enable:t,clickTolerance:n,pitchDegreesPerPixelMoved:i=-.5}){return new i5({clickTolerance:n,move:(t,n)=>({pitchDelta:(n.y-t.y)*i}),moveStateManager:new i6({checkCorrectEvent:t=>0===x.mouseButton(t)&&t.ctrlKey||2===x.mouseButton(t)}),enable:t,assignEvents:i9})}(t),f=function({enable:t,clickTolerance:n,rollDegreesPerPixelMoved:i=.3},r){return new i5({clickTolerance:n,move:(t,n)=>{let o=r(),a=(n.x-t.x)*i;return n.y<o.y&&(a=-a),{rollDelta:a}},moveStateManager:new i6({checkCorrectEvent:t=>2===x.mouseButton(t)&&t.ctrlKey}),enable:t,assignEvents:i9})}(t,u);i.dragRotate=new rv(t,m,h,f),this._add("mouseRotate",m,["mousePitch"]),this._add("mousePitch",h,["mouseRotate","mouseRoll"]),this._add("mouseRoll",f,["mousePitch"]),t.interactive&&t.dragRotate&&i.dragRotate.enable();let p=function({enable:t,clickTolerance:n}){return new i5({clickTolerance:n,move:(t,n)=>({around:n,panDelta:n.sub(t)}),activateOnStart:!0,moveStateManager:new i6({checkCorrectEvent:t=>0===x.mouseButton(t)&&!t.ctrlKey}),enable:t,assignEvents:i9})}(t),b=new re(t,i);i.dragPan=new ry(r,p,b),this._add("mousePan",p),this._add("touchPan",b,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&i.dragPan.enable(t.dragPan);let g=new ra,_=new rr;i.touchZoomRotate=new rx(r,_,g,c),this._add("touchRotate",g,["touchPan","touchZoom"]),this._add("touchZoom",_,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&i.touchZoomRotate.enable(t.touchZoomRotate),this._add("blockableMapEvent",new iK(i));let y=i.scrollZoom=new rp(i,()=>this._triggerRenderFrame());this._add("scrollZoom",y,["mousePan"]),t.interactive&&t.scrollZoom&&i.scrollZoom.enable(t.scrollZoom);let v=i.keyboard=new rm(i);this._add("keyboard",v),t.interactive&&t.keyboard&&i.keyboard.enable()}_add(t,n,i){this._handlers.push({handlerName:t,handler:n,allowed:i}),this._handlersById[t]=n}stop(t){if(!this._updatingCamera){for(let{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(let{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!rF(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,n,i){for(let r in t)if(r!==i&&(!n||0>n.indexOf(r)))return!0;return!1}_getMapTouches(t){let n=[];for(let i of t)this._el.contains(i.target)&&n.push(i);return n}mergeHandlerResult(t,i,r,o,a){if(!r)return;n.e(t,r);let s={handlerName:o,originalEvent:r.originalEvent||a};void 0!==r.zoomDelta&&(i.zoom=s),void 0!==r.panDelta&&(i.drag=s),void 0!==r.rollDelta&&(i.roll=s),void 0!==r.pitchDelta&&(i.pitch=s),void 0!==r.bearingDelta&&(i.rotate=s)}_applyChanges(){let t={},i={},r={};for(let[o,a,s]of this._changes)o.panDelta&&(t.panDelta=(t.panDelta||new n.P(0,0))._add(o.panDelta)),o.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+o.zoomDelta),o.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+o.bearingDelta),o.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+o.pitchDelta),o.rollDelta&&(t.rollDelta=(t.rollDelta||0)+o.rollDelta),void 0!==o.around&&(t.around=o.around),void 0!==o.pinchAround&&(t.pinchAround=o.pinchAround),o.noInertia&&(t.noInertia=o.noInertia),n.e(i,a),n.e(r,s);this._updateMapTransform(t,i,r),this._changes=[]}_updateMapTransform(t,n,i){let r=this._map,o=r._getTransformForUpdate(),a=r.terrain;if(!(rE(t)||a&&this._terrainMovement))return this._fireEvents(n,i,!0);r._stop(!0);let{panDelta:s,zoomDelta:l,bearingDelta:c,pitchDelta:d,rollDelta:u,around:m,pinchAround:h}=t;void 0!==h&&(m=h),m=m||r.transform.centerPoint,a&&!o.isPointOnMapSurface(m)&&(m=o.centerPoint);let f={panDelta:s,zoomDelta:l,rollDelta:u,pitchDelta:d,bearingDelta:c,around:m};this._map.cameraHelper.useGlobeControls&&!o.isPointOnMapSurface(m)&&(m=o.centerPoint);let p=.01>m.distSqr(o.centerPoint)?o.center:o.screenPointToLocation(s?m.sub(s):m);this._handleMapControls({terrain:a,tr:o,deltasForHelper:f,preZoomAroundLoc:p,combinedEventsInProgress:n,panDelta:s}),r._applyUpdatedTransform(o),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,i,!0)}_handleMapControls({terrain:t,tr:n,deltasForHelper:i,preZoomAroundLoc:r,combinedEventsInProgress:o,panDelta:a}){let s=this._map.cameraHelper;if(s.handleMapControlsRollPitchBearingZoom(i,n),t)return s.useGlobeControls?(!this._terrainMovement&&(o.drag||o.zoom)&&(this._terrainMovement=!0,this._map._elevationFreeze=!0),void s.handleMapControlsPan(i,n,r)):!this._terrainMovement&&(o.drag||o.zoom)?(this._terrainMovement=!0,this._map._elevationFreeze=!0,void s.handleMapControlsPan(i,n,r)):void(o.drag&&this._terrainMovement&&a?n.setCenter(n.screenPointToLocation(n.centerPoint.sub(a))):s.handleMapControlsPan(i,n,r));s.handleMapControlsPan(i,n,r)}_fireEvents(t,i,r){let o,a=rF(this._eventsInProgress),s=rF(t),l={};for(let n in t){let{originalEvent:i}=t[n];this._eventsInProgress[n]||(l[`${n}start`]=i),this._eventsInProgress[n]=t[n]}for(let t in!a&&s&&this._fireEvent("movestart",s.originalEvent),l)this._fireEvent(t,l[t]);for(let n in s&&this._fireEvent("move",s.originalEvent),t){let{originalEvent:i}=t[n];this._fireEvent(n,i)}let c={};for(let t in this._eventsInProgress){let{handlerName:n,originalEvent:r}=this._eventsInProgress[t];this._handlersById[n].isActive()||(delete this._eventsInProgress[t],o=i[n]||r,c[`${t}end`]=o)}for(let t in c)this._fireEvent(t,c[t]);let d=rF(this._eventsInProgress),u=(a||s)&&!d;if(u&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let t=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&t.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(t)}if(r&&u){this._updatingCamera=!0;let t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),i=t=>0!==t&&-this._bearingSnap<t&&t<this._bearingSnap;t&&(t.essential||!_.prefersReducedMotion)?(i(t.bearing||this._map.getBearing())&&(t.bearing=0),t.freezeElevation=!0,this._map.easeTo(t,{originalEvent:o})):(this._map.fire(new n.l("moveend",{originalEvent:o})),i(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(t,i){this._map.fire(new n.l(t,i?{originalEvent:i}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(t=>{delete this._frameId,this.handleEvent(new rk("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class rA extends n.E{constructor(t,n,i){super(),this._renderFrameCallback=()=>{let t=Math.min((v()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=i.bearingSnap,this.cameraHelper=n,this.on("moveend",()=>{delete this._requestedCameraState})}migrateProjection(t,n){t.apply(this.transform),this.transform=t,this.cameraHelper=n}getCenter(){return new n.U(this.transform.center.lng,this.transform.center.lat)}setCenter(t,n){return this.jumpTo({center:t},n)}getCenterElevation(){return this.transform.elevation}setCenterElevation(t,n){return this.jumpTo({elevation:t},n),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(t){this._centerClampedToGround=t}panBy(t,i,r){return t=n.P.convert(t).mult(-1),this.panTo(this.transform.center,n.e({offset:t},i),r)}panTo(t,i,r){return this.easeTo(n.e({center:t},i),r)}getZoom(){return this.transform.zoom}setZoom(t,n){return this.jumpTo({zoom:t},n),this}zoomTo(t,i,r){return this.easeTo(n.e({zoom:t},i),r)}zoomIn(t,n){return this.zoomTo(this.getZoom()+1,t,n),this}zoomOut(t,n){return this.zoomTo(this.getZoom()-1,t,n),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(t,i){return t!=this.transform.fov&&(this.transform.setFov(t),this.fire(new n.l("movestart",i)).fire(new n.l("move",i)).fire(new n.l("moveend",i))),this}getBearing(){return this.transform.bearing}setBearing(t,n){return this.jumpTo({bearing:t},n),this}getPadding(){return this.transform.padding}setPadding(t,n){return this.jumpTo({padding:t},n),this}rotateTo(t,i,r){return this.easeTo(n.e({bearing:t},i),r)}resetNorth(t,i){return this.rotateTo(0,n.e({duration:1e3},t),i),this}resetNorthPitch(t,i){return this.easeTo(n.e({bearing:0,pitch:0,roll:0,duration:1e3},t),i),this}snapToNorth(t,n){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,n):this}getPitch(){return this.transform.pitch}setPitch(t,n){return this.jumpTo({pitch:t},n),this}getRoll(){return this.transform.roll}setRoll(t,n){return this.jumpTo({roll:t},n),this}cameraForBounds(t,n){t=K.convert(t).adjustAntiMeridian();let i=n&&n.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),i,n)}_cameraForBoxAndBearing(t,i,r,o){let a={top:0,bottom:0,right:0,left:0};if("number"==typeof(o=n.e({padding:a,offset:[0,0],maxZoom:this.transform.maxZoom},o)).padding){let t=o.padding;o.padding={top:t,bottom:t,right:t,left:t}}let s=n.e(a,o.padding);o.padding=s;let l=this.transform,c=new K(t,i);return this.cameraHelper.cameraForBoxAndBearing(o,s,c,r,l)}fitBounds(t,n,i){return this._fitInternal(this.cameraForBounds(t,n),n,i)}fitScreenCoordinates(t,i,r,o,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(n.P.convert(t)),this.transform.screenPointToLocation(n.P.convert(i)),r,o),o,a)}_fitInternal(t,i,r){return t?(delete(i=n.e(t,i)).padding,i.linear?this.easeTo(i,r):this.flyTo(i,r)):this}jumpTo(t,i){this.stop();let r=this._getTransformForUpdate(),o=!1,a=!1,s=!1,l=r.zoom;this.cameraHelper.handleJumpToCenterZoom(r,t);let c=r.zoom!==l;return"elevation"in t&&r.elevation!==+t.elevation&&r.setElevation(+t.elevation),"bearing"in t&&r.bearing!==+t.bearing&&(o=!0,r.setBearing(+t.bearing)),"pitch"in t&&r.pitch!==+t.pitch&&(a=!0,r.setPitch(+t.pitch)),"roll"in t&&r.roll!==+t.roll&&(s=!0,r.setRoll(+t.roll)),null==t.padding||r.isPaddingEqual(t.padding)||r.setPadding(t.padding),this._applyUpdatedTransform(r),this.fire(new n.l("movestart",i)).fire(new n.l("move",i)),c&&this.fire(new n.l("zoomstart",i)).fire(new n.l("zoom",i)).fire(new n.l("zoomend",i)),o&&this.fire(new n.l("rotatestart",i)).fire(new n.l("rotate",i)).fire(new n.l("rotateend",i)),a&&this.fire(new n.l("pitchstart",i)).fire(new n.l("pitch",i)).fire(new n.l("pitchend",i)),s&&this.fire(new n.l("rollstart",i)).fire(new n.l("roll",i)).fire(new n.l("rollend",i)),this.fire(new n.l("moveend",i))}calculateCameraOptionsFromTo(t,i,r,o=0){let a=n.a5.fromLngLat(t,i),s=n.a5.fromLngLat(r,o),l=s.x-a.x,c=s.y-a.y,d=s.z-a.z,u=Math.hypot(l,c,d);if(0===u)throw Error("Can't calculate camera options with same From and To");let m=Math.hypot(l,c),h=n.ao(this.transform.cameraToCenterDistance/u/this.transform.tileSize),f=180*Math.atan2(l,-c)/Math.PI,p=180*Math.acos(m/u)/Math.PI;return p=d<0?90-p:90+p,{center:s.toLngLat(),elevation:o,zoom:h,pitch:p,bearing:f}}calculateCameraOptionsFromCameraLngLatAltRotation(t,n,i,r,o){let a=this.transform.calculateCenterFromCameraLngLatAlt(t,n,i,r);return{center:a.center,elevation:a.elevation,zoom:a.zoom,bearing:i,pitch:r,roll:o}}easeTo(t,i){let r,o;this._stop(!1,t.easeId),(!1===(t=n.e({offset:[0,0],duration:500,easing:n.cs},t)).animate||!t.essential&&_.prefersReducedMotion)&&(t.duration=0);let a=this._getTransformForUpdate(),s=this.getBearing(),l=a.pitch,c=a.roll,d="bearing"in t?this._normalizeBearing(t.bearing,s):s,u="pitch"in t?+t.pitch:l,m="roll"in t?this._normalizeBearing(t.roll,c):c,h="padding"in t?t.padding:a.padding,f=n.P.convert(t.offset);t.around&&(r=n.U.convert(t.around),o=a.locationToScreenPoint(r));let p={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},b=this.cameraHelper.handleEaseTo(a,{bearing:d,pitch:u,roll:m,padding:h,around:r,aroundPoint:o,offsetAsPoint:f,offset:t.offset,zoom:t.zoom,center:t.center});return this._rotating=this._rotating||s!==d,this._pitching=this._pitching||u!==l,this._rolling=this._rolling||m!==c,this._padding=!a.isPaddingEqual(h),this._zooming=this._zooming||b.isZooming,this._easeId=t.easeId,this._prepareEase(i,t.noMoveStart,p),this.terrain&&this._prepareElevation(b.elevationCenter),this._ease(n=>{b.easeFunc(n),this.terrain&&!t.freezeElevation&&this._updateElevation(n),this._applyUpdatedTransform(a),this._fireMoveEvents(i)},n=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(i,n)},t),this}_prepareEase(t,i,r={}){this._moving=!0,i||r.moving||this.fire(new n.l("movestart",t)),this._zooming&&!r.zooming&&this.fire(new n.l("zoomstart",t)),this._rotating&&!r.rotating&&this.fire(new n.l("rotatestart",t)),this._pitching&&!r.pitching&&this.fire(new n.l("pitchstart",t)),this._rolling&&!r.rolling&&this.fire(new n.l("rollstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){void 0!==this._elevationStart&&void 0!==this._elevationCenter||this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));let i=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&i!==this._elevationTarget){let n=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(n-(i-(n*t+this._elevationStart))/(1-t)),this._elevationTarget=i}this.transform.setElevation(n.F.number(this._elevationStart,this._elevationTarget,t))}_finalizeElevation(){this._elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(t){if(!this.terrain&&t.elevation>=0&&t.pitch<=90)return{};let n=t.getCameraLngLat(),i=t.getCameraAltitude(),r=this.terrain?this.terrain.getElevationForLngLatZoom(n,t.zoom):0;if(i<r){let i=this.calculateCameraOptionsFromTo(n,r,t.center,t.elevation);return{pitch:i.pitch,zoom:i.zoom}}return{}}_applyUpdatedTransform(t){let n=[];if(n.push(t=>this._elevateCameraIfInsideTerrain(t)),this.transformCameraUpdate&&n.push(t=>this.transformCameraUpdate(t)),!n.length)return;let i=t.clone();for(let t of n){let n=i.clone(),{center:r,zoom:o,roll:a,pitch:s,bearing:l,elevation:c}=t(n);r&&n.setCenter(r),void 0!==c&&n.setElevation(c),void 0!==o&&n.setZoom(o),void 0!==a&&n.setRoll(a),void 0!==s&&n.setPitch(s),void 0!==l&&n.setBearing(l),i.apply(n)}this.transform.apply(i)}_fireMoveEvents(t){this.fire(new n.l("move",t)),this._zooming&&this.fire(new n.l("zoom",t)),this._rotating&&this.fire(new n.l("rotate",t)),this._pitching&&this.fire(new n.l("pitch",t)),this._rolling&&this.fire(new n.l("roll",t))}_afterEase(t,i){if(this._easeId&&i&&this._easeId===i)return;delete this._easeId;let r=this._zooming,o=this._rotating,a=this._pitching,s=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,r&&this.fire(new n.l("zoomend",t)),o&&this.fire(new n.l("rotateend",t)),a&&this.fire(new n.l("pitchend",t)),s&&this.fire(new n.l("rollend",t)),this.fire(new n.l("moveend",t))}flyTo(t,i){if(!t.essential&&_.prefersReducedMotion){let r=n.S(t,["center","zoom","bearing","pitch","roll","elevation","padding"]);return this.jumpTo(r,i)}this.stop(),t=n.e({offset:[0,0],speed:1.2,curve:1.42,easing:n.cs},t);let r=this._getTransformForUpdate(),o=r.bearing,a=r.pitch,s=r.roll,l=r.padding,c="bearing"in t?this._normalizeBearing(t.bearing,o):o,d="pitch"in t?+t.pitch:a,u="roll"in t?this._normalizeBearing(t.roll,s):s,m="padding"in t?t.padding:r.padding,h=n.P.convert(t.offset),f=r.centerPoint.add(h),p=r.screenPointToLocation(f),b=this.cameraHelper.handleFlyTo(r,{bearing:c,pitch:d,roll:u,padding:m,locationAtOffset:p,offsetAsPoint:h,center:t.center,minZoom:t.minZoom,zoom:t.zoom}),g=t.curve,y=Math.max(r.width,r.height),v=y/b.scaleOfZoom,x=b.pixelPathLength;"number"==typeof b.scaleOfMinZoom&&(g=Math.sqrt(y/b.scaleOfMinZoom/x*2));let w=g*g;function F(t){let n=(v*v-y*y+(t?-1:1)*w*w*x*x)/(2*(t?v:y)*w*x);return Math.log(Math.sqrt(n*n+1)-n)}function k(t){return(Math.exp(t)-Math.exp(-t))/2}function E(t){return(Math.exp(t)+Math.exp(-t))/2}let T=F(!1),A=function(t){return E(T)/E(T+g*t)},M=function(t){var n;return y*((E(T)*(k(n=T+g*t)/E(n))-k(T))/w)/x},C=(F(!0)-T)/g;if(2e-6>Math.abs(x)||!isFinite(C)){if(1e-6>Math.abs(y-v))return this.easeTo(t,i);let n=v<y?-1:1;C=Math.abs(Math.log(v/y))/g,M=()=>0,A=t=>Math.exp(n*g*t)}return t.duration="duration"in t?+t.duration:1e3*C/("screenSpeed"in t?t.screenSpeed/g:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=o!==c,this._pitching=d!==a,this._rolling=u!==s,this._padding=!r.isPaddingEqual(m),this._prepareEase(i,!1),this.terrain&&this._prepareElevation(b.targetCenter),this._ease(p=>{let g=p*C,_=1/A(g),y=M(g);this._rotating&&r.setBearing(n.F.number(o,c,p)),this._pitching&&r.setPitch(n.F.number(a,d,p)),this._rolling&&r.setRoll(n.F.number(s,u,p)),this._padding&&(r.interpolatePadding(l,m,p),f=r.centerPoint.add(h)),b.easeFunc(p,_,y,f),this.terrain&&!t.freezeElevation&&this._updateElevation(p),this._applyUpdatedTransform(r),this._fireMoveEvents(i)},()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(i)},t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,n){var i;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let t=this._onEaseEnd;delete this._onEaseEnd,t.call(this,n)}return t||null==(i=this.handlers)||i.stop(!1),this}_ease(t,n,i){!1===i.animate||0===i.duration?(t(1),n()):(this._easeStart=v(),this._easeOptions=i,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,i){let r=Math.abs((t=n.V(t,-180,180))-i);return Math.abs(t-360-i)<r&&(t-=360),Math.abs(t+360-i)<r&&(t+=360),t}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(n.U.convert(t),this.transform.tileZoom):null}}let rM={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class rC{constructor(t=rM){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=t=>{t&&("metadata"===t.sourceDataType||"visibility"===t.sourceDataType||"style"===t.dataType||"terrain"===t.type)&&this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=x.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=x.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=x.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){x.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,n){let i=this._map._getUIString(`AttributionControl.${n}`);t.title=i,t.setAttribute("aria-label",i)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(t=>"string"!=typeof t?"":t)):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){let t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}let n=this._map.style.tileManagers;for(let i in n){let r=n[i];if(r.used||r.usedForTerrain){let n=r.getSource();n.attribution&&0>t.indexOf(n.attribution)&&t.push(n.attribution)}}(t=t.filter(t=>String(t).trim())).sort((t,n)=>t.length-n.length);let i=(t=t.filter((n,i)=>{for(let r=i+1;r<t.length;r++)if(t[r].indexOf(n)>=0)return!1;return!0})).join(" | ");i!==this._attribHTML&&(this._attribHTML=i,t.length?(this._innerContainer.innerHTML=x.sanitize(i),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class rS{constructor(t={}){this._updateCompact=()=>{let t=this._container.children;if(t.length){let n=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&n.classList.add("maplibregl-compact"):n.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=x.create("div","maplibregl-ctrl");let n=x.create("a","maplibregl-ctrl-logo");return n.target="_blank",n.rel="noopener nofollow",n.href="https://maplibre.org/",n.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),n.setAttribute("rel","noopener nofollow"),this._container.appendChild(n),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){x.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class rL{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){let n=++this._id;return this._queue.push({callback:t,id:n,cancelled:!1}),n}remove(t){let n=this._currentlyRunning;for(let i of n?this._queue.concat(n):this._queue)if(i.id===t)return void(i.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw Error("Attempting to run(), but is already running.");let n=this._currentlyRunning=this._queue;for(let i of(this._queue=[],n))if(!i.cancelled&&(i.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var rD=n.aO([{name:"a_pos3d",type:"Int16",components:3}]);class rI extends n.E{constructor(t){super(),this._lastTilesetChange=v(),this.tileManager=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=t._source.tileSize*2**this.deltaZoom,t.usedForTerrain=!0,t.tileSize=this.tileSize}destruct(){this.tileManager.usedForTerrain=!1,this.tileManager.tileSize=null}getSource(){return this.tileManager._source}update(t,i){this.tileManager.update(t,i),this._renderableTilesKeys=[];let r={};for(let o of eE(t,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:i,calculateTileZoom:this.tileManager._source.calculateTileZoom}))r[o.key]=!0,this._renderableTilesKeys.push(o.key),this._tiles[o.key]||(o.terrainRttPosMatrix32f=new Float64Array(16),n.c1(o.terrainRttPosMatrix32f,0,n.a3,n.a3,0,0,1),this._tiles[o.key]=new ef(o,this.tileSize),this._lastTilesetChange=v());for(let t in this._tiles)r[t]||delete this._tiles[t]}freeRtt(t){for(let n in this._tiles){let i=this._tiles[n];(!t||i.tileID.equals(t)||i.tileID.isChildOf(t)||t.isChildOf(i.tileID))&&(i.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t,n){return n?this._getTerrainCoordsForTileRanges(t,n):this._getTerrainCoordsForRegularTile(t)}_getTerrainCoordsForRegularTile(t){let i={};for(let r of this._renderableTilesKeys){let o=this._tiles[r].tileID,a=t.clone(),s=n.be();if(o.canonical.equals(t.canonical))n.c1(s,0,n.a3,n.a3,0,0,1);else if(o.canonical.isChildOf(t.canonical)){let i=o.canonical.z-t.canonical.z,r=o.canonical.x-(o.canonical.x>>i<<i),a=o.canonical.y-(o.canonical.y>>i<<i),l=n.a3>>i;n.c1(s,0,l,l,0,0,1),n.N(s,s,[-r*l,-a*l,0])}else{if(!t.canonical.isChildOf(o.canonical))continue;{let i=t.canonical.z-o.canonical.z,r=t.canonical.x-(t.canonical.x>>i<<i),a=t.canonical.y-(t.canonical.y>>i<<i),l=n.a3>>i;n.c1(s,0,n.a3,n.a3,0,0,1),n.N(s,s,[r*l,a*l,0]),n.O(s,s,[1/2**i,1/2**i,0])}}a.terrainRttPosMatrix32f=new Float32Array(s),i[r]=a}return i}_getTerrainCoordsForTileRanges(t,i){let r={};for(let o of this._renderableTilesKeys){let a=this._tiles[o].tileID;if(!this._isWithinTileRanges(a,i))continue;let s=t.clone(),l=n.be();if(a.canonical.z===t.canonical.z){let i=t.canonical.x-a.canonical.x,r=t.canonical.y-a.canonical.y;n.c1(l,0,n.a3,n.a3,0,0,1),n.N(l,l,[i*n.a3,r*n.a3,0])}else if(a.canonical.z>t.canonical.z){let i=a.canonical.z-t.canonical.z,r=a.canonical.x-(a.canonical.x>>i<<i),o=a.canonical.y-(a.canonical.y>>i<<i),s=t.canonical.x-(a.canonical.x>>i),c=t.canonical.y-(a.canonical.y>>i),d=n.a3>>i;n.c1(l,0,d,d,0,0,1),n.N(l,l,[-r*d+s*n.a3,-o*d+c*n.a3,0])}else{let i=t.canonical.z-a.canonical.z,r=t.canonical.x-(t.canonical.x>>i<<i),o=t.canonical.y-(t.canonical.y>>i<<i),s=(t.canonical.x>>i)-a.canonical.x,c=(t.canonical.y>>i)-a.canonical.y,d=n.a3<<i;n.c1(l,0,d,d,0,0,1),n.N(l,l,[r*n.a3+s*d,o*n.a3+c*d,0])}s.terrainRttPosMatrix32f=new Float32Array(l),r[o]=s}return r}getSourceTile(t,n){let i=this.tileManager._source,r=t.overscaledZ-this.deltaZoom;if(r>i.maxzoom&&(r=i.maxzoom),r<i.minzoom)return null;this._sourceTileCache[t.key]||(this._sourceTileCache[t.key]=t.scaledTo(r).key);let o=this.tileManager.getTileByID(this._sourceTileCache[t.key]);if((!o||!o.dem)&&n)for(;r>=i.minzoom&&(!o||!o.dem);)o=this.tileManager.getTileByID(t.scaledTo(r--).key);return o}anyTilesAfterTime(t=Date.now()){return this._lastTilesetChange>=t}_isWithinTileRanges(t,n){return n[t.canonical.z]&&t.canonical.x>=n[t.canonical.z].minTileX&&t.canonical.x<=n[t.canonical.z].maxTileX&&t.canonical.y>=n[t.canonical.z].minTileY&&t.canonical.y<=n[t.canonical.z].maxTileY}}class rP{constructor(t,n,i){this._meshCache={},this.painter=t,this.tileManager=new rI(n),this.options=i,this.exaggeration="number"==typeof i.exaggeration?i.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,i,r,o=n.a3){var a;if(!(i>=0&&i<o&&r>=0&&r<o))return 0;let s=this.getTerrainData(t),l=null==(a=s.tile)?void 0:a.dem;if(!l)return 0;let c=n.cw([],[i/o*n.a3,r/o*n.a3],s.u_terrain_matrix),d=[c[0]*l.dim,c[1]*l.dim],u=Math.floor(d[0]),m=Math.floor(d[1]),h=d[0]-u,f=d[1]-m;return l.get(u,m)*(1-h)*(1-f)+l.get(u+1,m)*h*(1-f)+l.get(u,m+1)*(1-h)*f+l.get(u+1,m+1)*h*f}getElevationForLngLatZoom(t,i){if(!n.cx(i,t.wrap()))return 0;let{tileID:r,mercatorX:o,mercatorY:a}=this._getOverscaledTileIDFromLngLatZoom(t,i);return this.getElevation(r,o%n.a3,a%n.a3,n.a3)}getElevation(t,i,r,o=n.a3){return this.getDEMElevation(t,i,r,o)*this.exaggeration}getTerrainData(t){if(!this._emptyDemTexture){let t=this.painter.context,i=new n.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new n.T(t,i,t.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new n.T(t,new n.R({width:1,height:1}),t.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=n.am([])}let i=this.tileManager.getSourceTile(t,!0);if(i&&i.dem&&(!i.demTexture||i.needsTerrainPrepare)){let t=this.painter.context;i.demTexture=this.painter.getTileTexture(i.dem.stride),i.demTexture?i.demTexture.update(i.dem.getPixels(),{premultiply:!1}):i.demTexture=new n.T(t,i.dem.getPixels(),t.gl.RGBA,{premultiply:!1}),i.demTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),i.needsTerrainPrepare=!1}let r=i&&i+i.tileID.key+t.key;if(r&&!this._demMatrixCache[r]){let r=this.tileManager.getSource().maxzoom,o=t.canonical.z-i.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=r?o=t.canonical.z-r:n.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let a=t.canonical.x-(t.canonical.x>>o<<o),s=t.canonical.y-(t.canonical.y>>o<<o),l=n.cy(new Float64Array(16),[1/(n.a3<<o),1/(n.a3<<o),0]);n.N(l,l,[a*n.a3,s*n.a3,0]),this._demMatrixCache[t.key]={matrix:l,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:i&&i.dem&&i.dem.dim||1,u_terrain_matrix:r?this._demMatrixCache[t.key].matrix:this._emptyDemMatrix,u_terrain_unpack:i&&i.dem&&i.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(i&&i.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:i}}getFramebuffer(t){let i=this.painter,r=i.width/devicePixelRatio,o=i.height/devicePixelRatio;return this._fbo&&(this._fbo.width!==r||this._fbo.height!==o)&&(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new n.T(i.context,{width:r,height:o,data:null},i.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(i.context.gl.NEAREST,i.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new n.T(i.context,{width:r,height:o,data:null},i.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(i.context.gl.NEAREST,i.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=i.context.createFramebuffer(r,o,!0,!1),this._fbo.depthAttachment.set(i.context.createRenderbuffer(i.context.gl.DEPTH_COMPONENT16,r,o))),this._fbo.colorAttachment.set("coords"===t?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let t=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let i=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let t=0,n=0;t<this._coordsTextureSize;t++)for(let r=0;r<this._coordsTextureSize;r++,n+=4)i[n+0]=255&r,i[n+1]=255&t,i[n+2]=r>>8<<4|t>>8,i[n+3]=0;let r=new n.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(i.buffer)),o=new n.T(t,r,t.gl.RGBA,{premultiply:!1});return o.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=o,o}pointCoordinate(t){this.painter.maybeDrawDepthAndCoords(!0);let i=new Uint8Array(4),r=this.painter.context,o=r.gl,a=Math.round(t.x*this.painter.pixelRatio/devicePixelRatio),s=Math.round(t.y*this.painter.pixelRatio/devicePixelRatio),l=Math.round(this.painter.height/devicePixelRatio);r.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),o.readPixels(a,l-s-1,1,1,o.RGBA,o.UNSIGNED_BYTE,i),r.bindFramebuffer.set(null);let c=i[0]+(i[2]>>4<<8),d=i[1]+((15&i[2])<<8),u=this.coordsIndex[255-i[3]],m=u&&this.tileManager.getTileByID(u);if(!m)return null;let h=this._coordsTextureSize,f=(1<<m.tileID.canonical.z)*h;return new n.a5((m.tileID.canonical.x*h+c)/f+m.tileID.wrap,(m.tileID.canonical.y*h+d)/f,this.getElevation(m.tileID,c,d,h))}depthAtPoint(t){let n=new Uint8Array(4),i=this.painter.context,r=i.gl;return i.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),r.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,r.RGBA,r.UNSIGNED_BYTE,n),i.bindFramebuffer.set(null),(n[0]/0x1000000+n[1]/65536+n[2]/256+n[3])/256}getTerrainMesh(t){var i;let r=(null==(i=this.painter.style.projection)?void 0:i.transitionState)>0,o=r&&0===t.canonical.y,a=r&&t.canonical.y===(1<<t.canonical.z)-1,s=`m_${o?"n":""}_${a?"s":""}`;if(this._meshCache[s])return this._meshCache[s];let l=this.painter.context,c=new n.cz,d=new n.aS,u=this.meshSize,m=n.a3/u,h=u*u;for(let t=0;t<=u;t++)for(let n=0;n<=u;n++)c.emplaceBack(n*m,t*m,0);for(let t=0;t<h;t+=u+1)for(let n=0;n<u;n++)d.emplaceBack(n+t,u+n+t+1,u+n+t+2),d.emplaceBack(n+t,u+n+t+2,n+t+1);let f=c.length,p=f+(u+1),b=(u+1)*u,g=o?n.bl:0,_=+!o,y=a?n.bm:n.a3,v=+!a;for(let t=0;t<=u;t++)c.emplaceBack(t*m,g,_);for(let t=0;t<=u;t++)c.emplaceBack(t*m,y,v);for(let t=0;t<u;t++)d.emplaceBack(b+t,p+t,p+t+1),d.emplaceBack(b+t,p+t+1,b+t+1),d.emplaceBack(0+t,f+t+1,f+t),d.emplaceBack(0+t,0+t+1,f+t+1);let x=c.length,w=x+2*(u+1);for(let t of[0,1])for(let i=0;i<=u;i++)for(let r of[0,1])c.emplaceBack(t*n.a3,i*m,r);for(let t=0;t<2*u;t+=2)d.emplaceBack(x+t,x+t+1,x+t+3),d.emplaceBack(x+t,x+t+3,x+t+2),d.emplaceBack(w+t,w+t+3,w+t+1),d.emplaceBack(w+t,w+t+2,w+t+3);let F=new ta(l.createVertexBuffer(c,rD.members),l.createIndexBuffer(d),n.aR.simpleSegment(0,0,c.length,d.length));return this._meshCache[s]=F,F}getMeshFrameDelta(t){return 2*Math.PI*n.by/Math.pow(2,Math.max(t,0))/5}getMinTileElevationForLngLatZoom(t,n){var i;let{tileID:r}=this._getOverscaledTileIDFromLngLatZoom(t,n);return null!=(i=this.getMinMaxElevation(r).minElevation)?i:0}getMinMaxElevation(t){let n=this.getTerrainData(t).tile,i={minElevation:null,maxElevation:null};return n&&n.dem&&(i.minElevation=n.dem.min*this.exaggeration,i.maxElevation=n.dem.max*this.exaggeration),i}_getOverscaledTileIDFromLngLatZoom(t,i){let r=n.a5.fromLngLat(t.wrap()),o=(1<<i)*n.a3,a=r.x*o,s=r.y*o,l=Math.floor(a/n.a3),c=Math.floor(s/n.a3);return{tileID:new n.a0(i,0,i,l,c),mercatorX:a,mercatorY:s}}}class rR{constructor(t,n,i){this._context=t,this._size=n,this._tileSize=i,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(let t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){let i=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),r=new n.T(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return r.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),this._context.extTextureFilterAnisotropic&&this._context.gl.texParameterf(this._context.gl.TEXTURE_2D,this._context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this._context.extTextureFilterAnisotropicMax),i.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),i.colorAttachment.set(r.texture),{id:t,fbo:i,texture:r,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(n=>t.id!==n),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(let t of this._recentlyUsed)if(!this._objects[t].inUse)return this._objects[t];if(this._objects.length>=this._size)throw Error("No free RenderPool available, call freeAllObjects() required!");let t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(let t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length<this._size)&&!1===this._objects.some(t=>!t.inUse)}}let rO={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};class rB{constructor(t,n){this.painter=t,this.terrain=n,this.pool=new rR(t.context,30,n.tileManager.tileSize*n.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,n){for(let i in this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=t._order.filter(i=>!t._layers[i].isHidden(n)),this._coordsAscending={},t.tileManagers){this._coordsAscending[i]={};let n=t.tileManagers[i].getVisibleCoordinates(),r=t.tileManagers[i].getSource(),o=r instanceof eo?r.terrainTileRanges:null;for(let t of n){let n=this.terrain.tileManager.getTerrainCoords(t,o);for(let t in n)this._coordsAscending[i][t]||(this._coordsAscending[i][t]=[]),this._coordsAscending[i][t].push(n[t])}}for(let n of(this._coordsAscendingStr={},t._order)){let i=t._layers[n],r=i.source;if(rO[i.type]&&!this._coordsAscendingStr[r])for(let t in this._coordsAscendingStr[r]={},this._coordsAscending[r])this._coordsAscendingStr[r][t]=this._coordsAscending[r][t].map(t=>t.key).sort().join()}for(let t of this._renderableTiles)for(let n in this._coordsAscendingStr){let i=this._coordsAscendingStr[n][t.tileID.key];i&&i!==t.rttCoords[n]&&(t.rtt=[])}}renderLayer(t,i){if(t.isHidden(this.painter.transform.zoom))return!1;let r=Object.assign(Object.assign({},i),{isRenderingToTexture:!0}),o=t.type,a=this.painter,s=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(rO[o]&&(this._prevType&&rO[this._prevType]||this._stacks.push([]),this._prevType=o,this._stacks[this._stacks.length-1].push(t.id),!s))return!0;if(rO[this._prevType]||rO[o]&&s){this._prevType=o;let t=this._stacks.length-1,i=this._stacks[t]||[];for(let o of this._renderableTiles){if(this.pool.isFull()&&(iI(this.painter,this.terrain,this._rttTiles,r),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(o),o.rtt[t]){let n=this.pool.getObjectForId(o.rtt[t].id);if(n.stamp===o.rtt[t].stamp){this.pool.useObject(n);continue}}let s=this.pool.getOrCreateFreeObject();this.pool.useObject(s),this.pool.stampObject(s),o.rtt[t]={id:s.id,stamp:s.stamp},a.context.bindFramebuffer.set(s.fbo.framebuffer),a.context.clear({color:n.bj.transparent,stencil:0}),a.currentStencilSource=void 0;for(let t=0;t<i.length;t++){let n=a.style._layers[i[t]],l=n.source?this._coordsAscending[n.source][o.tileID.key]:[o.tileID];a.context.viewport.set([0,0,s.fbo.width,s.fbo.height]),a._renderTileClippingMasks(n,l,!0),a.renderLayer(a,a.style.tileManagers[n.source],n,l,r),n.source&&(o.rttCoords[n.source]=this._coordsAscendingStr[n.source][o.tileID.key])}}return iI(this.painter,this.terrain,this._rttTiles,r),this._rttTiles=[],this.pool.freeAllObjects(),rO[o]}return!1}}let rz={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},rN={hash:!1,interactive:!0,bearingSnap:7,attributionControl:rM,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:n.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,transformConstrain:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,reduceMotion:void 0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,experimentalZoomLevelsToOverscale:void 0},rY={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class rj{constructor(t,i,r=!1){this.mousedown=t=>{this.startMove(t,x.mousePos(this.element,t)),x.addEventListener(window,"mousemove",this.mousemove),x.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=t=>{this.move(t,x.mousePos(this.element,t))},this.mouseup=t=>{this._rotatePitchHandler.dragEnd(t),this.offTemp()},this.touchstart=t=>{1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=x.touchPos(this.element,t.targetTouches)[0],this.startMove(t,this._startPos),x.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),x.addEventListener(window,"touchend",this.touchend))},this.touchmove=t=>{1!==t.targetTouches.length?this.reset():(this._lastPos=x.touchPos(this.element,t.targetTouches)[0],this.move(t,this._lastPos))},this.touchend=t=>{0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=i;let o=new i7;this._rotatePitchHandler=new i5({clickTolerance:3,move:(t,o)=>{let a=i.getBoundingClientRect(),s=new n.P((a.bottom-a.top)/2,(a.right-a.left)/2);return{bearingDelta:n.cr(new n.P(t.x,o.y),o,s),pitchDelta:r?-.5*(o.y-t.y):void 0}},moveStateManager:o,enable:!0,assignEvents:()=>{}}),this.map=t,x.addEventListener(i,"mousedown",this.mousedown),x.addEventListener(i,"touchstart",this.touchstart,{passive:!1}),x.addEventListener(i,"touchcancel",this.reset)}startMove(t,n){this._rotatePitchHandler.dragStart(t,n),x.disableDrag()}move(t,n){let i=this.map,{bearingDelta:r,pitchDelta:o}=this._rotatePitchHandler.dragMove(t,n)||{};r&&i.setBearing(i.getBearing()+r),o&&i.setPitch(i.getPitch()+o)}off(){let t=this.element;x.removeEventListener(t,"mousedown",this.mousedown),x.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),x.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),x.removeEventListener(window,"touchend",this.touchend),x.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){x.enableDrag(),x.removeEventListener(window,"mousemove",this.mousemove),x.removeEventListener(window,"mouseup",this.mouseup),x.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),x.removeEventListener(window,"touchend",this.touchend)}}function rU(t,i,r,o=!1){if(o||!r.getCoveringTilesDetailsProvider().allowWorldCopies())return null==t?void 0:t.wrap();let a=new n.U(t.lng,t.lat);if(t=new n.U(t.lng,t.lat),i){let o=new n.U(t.lng-360,t.lat),a=new n.U(t.lng+360,t.lat),s=r.locationToScreenPoint(t).distSqr(i);r.locationToScreenPoint(o).distSqr(i)<s?t=o:r.locationToScreenPoint(a).distSqr(i)<s&&(t=a)}for(;Math.abs(t.lng-r.center.lng)>180;){let n=r.locationToScreenPoint(t);if(n.x>=0&&n.y>=0&&n.x<=r.width&&n.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t.lng!==a.lng&&r.isPointOnMapSurface(r.locationToScreenPoint(t))?t:a}let rH={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function rV(t,n,i){let r=t.classList;for(let t in rH)r.remove(`maplibregl-${i}-anchor-${t}`);r.add(`maplibregl-${i}-anchor-${n}`)}class rG extends n.E{constructor(t){if(super(),this._onKeyPress=t=>{let n=t.code,i=t.charCode||t.keyCode;"Space"!==n&&"Enter"!==n&&32!==i&&13!==i||this.togglePopup()},this._onMapClick=t=>{let n=t.originalEvent.target,i=this._element;this._popup&&(n===i||i.contains(n))&&this.togglePopup()},this._update=t=>{if(!this._map)return;let n=this._map.loaded()&&!this._map.isMoving();"terrain"!==(null==t?void 0:t.type)&&("render"!==(null==t?void 0:t.type)||n)||this._map.once("render",this._update),this._lngLat=rU(this._lngLat,this._flatPos,this._map.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let i="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?i=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(i=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let r="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?r="rotateX(0deg)":"map"===this._pitchAlignment&&(r=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||t&&"moveend"!==t.type||(this._pos=this._pos.round()),x.setTransform(this._element,`${rH[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${r} ${i}`),_.frameAsync(new AbortController).then(()=>{this._updateOpacity(t&&"moveend"===t.type)}).catch(()=>{})},this._onMove=t=>{if(!this._isDragging){let n=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=n}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new n.l("dragstart"))),this.fire(new n.l("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new n.l("dragend")),this._state="inactive"},this._addDragHandler=t=>{this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._subpixelPositioning=t&&t.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this._rotationAlignment,this.setOpacity(null==t?void 0:t.opacity,null==t?void 0:t.opacityWhenCovered),t&&t.element)this._element=t.element,this._offset=n.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=x.create("div");let i=x.createNS("http://www.w3.org/2000/svg","svg");i.setAttributeNS(null,"display","block"),i.setAttributeNS(null,"height","41px"),i.setAttributeNS(null,"width","27px"),i.setAttributeNS(null,"viewBox","0 0 27 41");let r=x.createNS("http://www.w3.org/2000/svg","g");r.setAttributeNS(null,"stroke","none"),r.setAttributeNS(null,"stroke-width","1"),r.setAttributeNS(null,"fill","none"),r.setAttributeNS(null,"fill-rule","evenodd");let o=x.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"fill-rule","nonzero");let a=x.createNS("http://www.w3.org/2000/svg","g");for(let t of(a.setAttributeNS(null,"transform","translate(3.0, 29.0)"),a.setAttributeNS(null,"fill","#000000"),[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}])){let n=x.createNS("http://www.w3.org/2000/svg","ellipse");n.setAttributeNS(null,"opacity","0.04"),n.setAttributeNS(null,"cx","10.5"),n.setAttributeNS(null,"cy","5.80029008"),n.setAttributeNS(null,"rx",t.rx),n.setAttributeNS(null,"ry",t.ry),a.appendChild(n)}let s=x.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill",this._color);let l=x.createNS("http://www.w3.org/2000/svg","path");l.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),s.appendChild(l);let c=x.createNS("http://www.w3.org/2000/svg","g");c.setAttributeNS(null,"opacity","0.25"),c.setAttributeNS(null,"fill","#000000");let d=x.createNS("http://www.w3.org/2000/svg","path");d.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),c.appendChild(d);let u=x.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"transform","translate(6.0, 7.0)"),u.setAttributeNS(null,"fill","#FFFFFF");let m=x.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(8.0, 8.0)");let h=x.createNS("http://www.w3.org/2000/svg","circle");h.setAttributeNS(null,"fill","#000000"),h.setAttributeNS(null,"opacity","0.25"),h.setAttributeNS(null,"cx","5.5"),h.setAttributeNS(null,"cy","5.5"),h.setAttributeNS(null,"r","5.4999962");let f=x.createNS("http://www.w3.org/2000/svg","circle");f.setAttributeNS(null,"fill","#FFFFFF"),f.setAttributeNS(null,"cx","5.5"),f.setAttributeNS(null,"cy","5.5"),f.setAttributeNS(null,"r","5.4999962"),m.appendChild(h),m.appendChild(f),o.appendChild(a),o.appendChild(s),o.appendChild(c),o.appendChild(u),o.appendChild(m),i.appendChild(o),i.setAttributeNS(null,"height",41*this._scale+"px"),i.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(i),this._offset=n.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",t=>{t.preventDefault()}),this._element.addEventListener("mousedown",t=>{t.preventDefault()}),rV(this._element,this._anchor,"marker"),t&&t.className)for(let n of t.className.split(" "))this._element.classList.add(n);this._popup=null}addTo(t){return this.remove(),this._map=t,this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),this._element.hasAttribute("role")||this._element.setAttribute("role","button"),t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),t.on("projectiontransition",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),x.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=n.U.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){let n=Math.abs(13.5)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[n,-1*(24.6+n)],"bottom-right":[-n,-1*(24.6+n)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}getPopup(){return this._popup}togglePopup(){let t=this._popup;return this._element.style.opacity===this._opacityWhenCovered||t&&(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map))),this}_updateOpacity(t=!1){var i,r;let o=null==(i=this._map)?void 0:i.terrain,a=this._map.transform.isLocationOccluded(this._lngLat);if(!o||a){let t=a?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==t&&(this._element.style.opacity=t))}if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let s=this._map,l=s.terrain.depthAtPoint(this._pos),c=s.terrain.getElevationForLngLatZoom(this._lngLat,s.transform.tileZoom);if(s.transform.lngLatToCameraDepth(this._lngLat,c)-l<.006)return void(this._element.style.opacity=this._opacity);let d=-this._offset.y/s.transform.pixelsPerMeter,u=Math.sin(s.getPitch()*Math.PI/180)*d,m=s.terrain.depthAtPoint(new n.P(this._pos.x,this._pos.y-this._offset.y)),h=s.transform.lngLatToCameraDepth(this._lngLat,c+u)-m>.006;(null==(r=this._popup)?void 0:r.isOpen())&&h&&this._popup.remove(),this._element.style.opacity=h?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(t){return this._offset=n.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,n){return(void 0===this._opacity||void 0===t&&void 0===n)&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==t&&(this._opacity=t),void 0!==n&&(this._opacityWhenCovered=n),this._map&&this._updateOpacity(!0),this}}let rq={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},r$=0,rW=!1,rZ={maxWidth:100,unit:"metric"};function rX(t,n,i){let r=i&&i.maxWidth||100,o=t._container.clientHeight/2,a=t._container.clientWidth/2,s=t.unproject([a-r/2,o]),l=t.unproject([a+r/2,o]),c=Math.min(r,Math.round(t.project(l).x-t.project(s).x),t._container.clientWidth),d=s.distanceTo(l);if(i&&"imperial"===i.unit){let i=3.2808*d;i>5280?rK(n,c,i/5280,t._getUIString("ScaleControl.Miles")):rK(n,c,i,t._getUIString("ScaleControl.Feet"))}else i&&"nautical"===i.unit?rK(n,c,d/1852,t._getUIString("ScaleControl.NauticalMiles")):d>=1e3?rK(n,c,d/1e3,t._getUIString("ScaleControl.Kilometers")):rK(n,c,d,t._getUIString("ScaleControl.Meters"))}function rK(t,n,i,r){let o=function(t){let n=Math.pow(10,`${Math.floor(t)}`.length-1),i=t/n;return n*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:i>=1?1:function(t){let n=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*n)/n}(i))}(i);t.style.width=o/i*n+"px",t.innerHTML=`${o} ${r}`}let rJ={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0};t.AJAXError=n.cD,t.Event=n.l,t.Evented=n.E,t.LngLat=n.U,t.MercatorCoordinate=n.a5,t.Point=n.P,t.addProtocol=n.cE,t.config=n.a,t.removeProtocol=n.cF,t.AttributionControl=rC,t.BoxZoomHandler=iQ,t.CanvasSource=es,t.CooperativeGesturesHandler=rw,t.DoubleClickZoomHandler=rb,t.DragPanHandler=ry,t.DragRotateHandler=rv,t.EdgeInsets=tu,t.FullscreenControl=class extends n.E{constructor(t={}){super(),this._onFullscreenChange=()=>{var t;let n=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;null==(t=null==n?void 0:n.shadowRoot)?void 0:t.fullscreenElement;)n=n.shadowRoot.fullscreenElement;n===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,t&&t.container&&(t.container instanceof HTMLElement?this._container=t.container:n.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=x.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){x.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let t=this._fullscreenButton=x.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);x.create("span","maplibregl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new n.l("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new n.l("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},t.GeoJSONSource=er,t.GeolocateControl=class extends n.E{constructor(t){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new n.l("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new n.l("geolocate",t)),this._finish()}},this._updateCamera=t=>{let i=new n.U(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy,o=this._map.getBearing(),a=n.e({bearing:o},this.options.fitBoundsOptions),s=K.fromLngLat(i,r);this._map.fitBounds(s,a,{geolocateSource:!0})},this._updateMarker=t=>{if(t){let i=new n.U(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=t.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=t=>{if(this._map){if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&rW)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new n.l("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",t=>t.preventDefault()),this._geolocateButton=x.create("button","maplibregl-ctrl-geolocate",this._container),x.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=t=>{if(this._map){if(!1===t){n.w("Geolocation support is not available so the GeolocateControl will be disabled.");let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{let t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=x.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new rG({element:this._dotElement}),this._circleElement=x.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new rG({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onUpdate),this._map.on("move",this._onUpdate),this._map.on("rotate",this._onUpdate),this._map.on("pitch",this._onUpdate)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",t=>{let i=(null==t?void 0:t[0])instanceof ResizeObserverEntry;t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||i||this._map.isZooming()||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new n.l("trackuserlocationend")),this.fire(new n.l("userlocationlostfocus")))})}},this.options=n.e({},rq,t)}onAdd(t){return this._map=t,this._container=x.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),(function(){return n._(this,arguments,void 0,function*(t=!1){if(void 0!==d&&!t)return d;if(void 0===window.navigator.permissions)return d=!!window.navigator.geolocation;try{let t=yield window.navigator.permissions.query({name:"geolocation"});d="denied"!==t.state}catch(t){d=!!window.navigator.geolocation}return d})})().then(t=>this._finishSetupUI(t)),this._container}onRemove(){void 0!==this._geolocationWatchID&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),x.remove(this._container),this._map.off("zoom",this._onUpdate),this._map.off("move",this._onUpdate),this._map.off("rotate",this._onUpdate),this._map.off("pitch",this._onUpdate),this._map=void 0,r$=0,rW=!1}_isOutOfMapMaxBounds(t){let n=this._map.getMaxBounds(),i=t.coords;return n&&(i.longitude<n.getWest()||i.longitude>n.getEast()||i.latitude<n.getSouth()||i.latitude>n.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":case"BACKGROUND_ERROR":case"OFF":case void 0:break;default:throw Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadiusIfNeeded(){let t=this._userLocationDotMarker.getLngLat();if(!(this.options.showUserLocation&&this.options.showAccuracyCircle&&this._accuracy&&t))return;let n=this._map.project(t),i=this._map.unproject([n.x+100,n.y]),r=t.distanceTo(i)/100,o=2*this._accuracy/r;this._circleElement.style.width=`${o.toFixed(2)}px`,this._circleElement.style.height=`${o.toFixed(2)}px`}trigger(){if(!this._setup)return n.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new n.l("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":r$--,rW=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new n.l("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new n.l("trackuserlocationstart")),this.fire(new n.l("userlocationfocus"));break;default:throw Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw Error(`Unexpected watchState ${this._watchState}`)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let t;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++r$>1?(t={maximumAge:6e5,timeout:0},rW=!0):(t=this.options.positionOptions,rW=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},t.GlobeControl=class{constructor(){this._toggleProjection=()=>{var t;let n=null==(t=this._map.getProjection())?void 0:t.type;this._map.setProjection("mercator"!==n&&n?{type:"mercator"}:{type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var t;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),"globe"===(null==(t=this._map.getProjection())?void 0:t.type)?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(t){return this._map=t,this._container=x.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=x.create("button","maplibregl-ctrl-globe",this._container),x.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._container}onRemove(){x.remove(this._container),this._map.off("styledata",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},t.Hash=iB,t.ImageSource=eo,t.KeyboardHandler=rm,t.LngLatBounds=K,t.LogoControl=rS,t.Map=class extends rA{constructor(t){var i,r;n.cA.mark(n.cB.create);let o=Object.assign(Object.assign(Object.assign({},rN),t),{canvasContextAttributes:Object.assign(Object.assign({},rN.canvasContextAttributes),t.canvasContextAttributes)});if(null!=o.minZoom&&null!=o.maxZoom&&o.minZoom>o.maxZoom)throw Error("maxZoom must be greater than or equal to minZoom");if(null!=o.minPitch&&null!=o.maxPitch&&o.minPitch>o.maxPitch)throw Error("maxPitch must be greater than or equal to minPitch");if(null!=o.minPitch&&o.minPitch<0)throw Error("minPitch must be greater than or equal to 0");if(null!=o.maxPitch&&o.maxPitch>180)throw Error("maxPitch must be less than or equal to 180");let a=new t_,s=new tw;if(void 0!==o.minZoom&&a.setMinZoom(o.minZoom),void 0!==o.maxZoom&&a.setMaxZoom(o.maxZoom),void 0!==o.minPitch&&a.setMinPitch(o.minPitch),void 0!==o.maxPitch&&a.setMaxPitch(o.maxPitch),void 0!==o.renderWorldCopies&&a.setRenderWorldCopies(o.renderWorldCopies),null!==o.transformConstrain&&a.setConstrainOverride(o.transformConstrain),super(a,s,{bearingSnap:o.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new rL,this._controls=[],this._mapId=n.ab(),this._lostContextStyle={style:null,images:null},this._contextLost=t=>{for(let n of(t.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.painter.destroy(),Object.values(this.style._layers)))if("custom"===n.type&&console.warn(`Custom layer with id '${n.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),n._listeners)for(let[t]of Object.entries(n._listeners))console.warn(`Custom layer with id '${n.id}' had event listeners for event '${t}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this._lostContextStyle=this._getStyleAndImages(),this.style.destroy(),this.style=null,this.fire(new n.l("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&(this.style.imageManager.images=this._lostContextStyle.images),this._setupPainter(),this.resize(),this._update(),this.fire(new n.l("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=o.interactive,this._maxTileCacheSize=o.maxTileCacheSize,this._maxTileCacheZoomLevels=o.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},o.canvasContextAttributes),this._trackResize=!0===o.trackResize,this._bearingSnap=o.bearingSnap,this._centerClampedToGround=o.centerClampedToGround,this._refreshExpiredTiles=!0===o.refreshExpiredTiles,this._fadeDuration=o.fadeDuration,this._crossSourceCollisions=!0===o.crossSourceCollisions,this._collectResourceTiming=!0===o.collectResourceTiming,this._locale=Object.assign(Object.assign({},rz),o.locale),this._clickTolerance=o.clickTolerance,this._overridePixelRatio=o.pixelRatio,this._maxCanvasSize=o.maxCanvasSize,this._zoomLevelsToOverscale=o.experimentalZoomLevelsToOverscale,this.transformCameraUpdate=o.transformCameraUpdate,this.transformConstrain=o.transformConstrain,this.cancelPendingTileRequestsWhileZooming=!0===o.cancelPendingTileRequestsWhileZooming,void 0!==o.reduceMotion&&(_.prefersReducedMotion=o.reduceMotion),this._imageQueueHandle=h.addThrottleControl(()=>this.isMoving()),this._requestManager=new M(o.transformRequest),"string"==typeof o.container){if(this._container=document.getElementById(o.container),!this._container)throw Error(`Container '${o.container}' not found.`)}else{if(!(o.container instanceof HTMLElement))throw Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=o.container}if(o.maxBounds&&this.setMaxBounds(o.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),"undefined"!=typeof window){addEventListener("online",this._onWindowOnline,!1);let t=!1,n=iO(t=>{this._trackResize&&!this._removed&&(this.resize(t),this.redraw())},50);this._resizeObserver=new ResizeObserver(i=>{t?n(i):t=!0}),this._resizeObserver.observe(this._container)}this.handlers=new rT(this,o),this._hash=o.hash&&new iB("string"==typeof o.hash&&o.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:o.center,elevation:o.elevation,zoom:o.zoom,bearing:o.bearing,pitch:o.pitch,roll:o.roll}),o.bounds&&(this.resize(),this.fitBounds(o.bounds,n.e({},o.fitBoundsOptions,{duration:0}))));let l="string"==typeof o.style||"globe"!==(null==(r=null==(i=o.style)?void 0:i.projection)?void 0:r.type);this.resize(null,l),this._localIdeographFontFamily=o.localIdeographFontFamily,this._validateStyle=o.validateStyle,o.style&&this.setStyle(o.style,{localIdeographFontFamily:o.localIdeographFontFamily}),o.attributionControl&&this.addControl(new rC("boolean"==typeof o.attributionControl?void 0:o.attributionControl)),o.maplibreLogo&&this.addControl(new rS,o.logoPosition),this.on("style.load",()=>{if(l||this._resizeTransform(),this.transform.unmodified){let t=n.S(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(t)}}),this.on("data",t=>{this._update("style"===t.dataType),this.fire(new n.l(`${t.dataType}data`,t))}),this.on("dataloading",t=>{this.fire(new n.l(`${t.dataType}dataloading`,t))}),this.on("dataabort",t=>{this.fire(new n.l("sourcedataabort",t))})}_getMapId(){return this._mapId}setGlobalStateProperty(t,n){return this.style.setGlobalStateProperty(t,n),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(t,i){if(void 0===i&&(i=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new n.k(Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let r=t.onAdd(this);this._controls.push(t);let o=this._controlPositions[i];return -1!==i.indexOf("bottom")?o.insertBefore(r,o.firstChild):o.appendChild(r),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new n.k(Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let i=this._controls.indexOf(t);return i>-1&&this._controls.splice(i,1),t.onRemove(this),this}hasControl(t){return this._controls.indexOf(t)>-1}coveringTiles(t){return eE(this.transform,t)}calculateCameraOptionsFromTo(t,n,i,r){return null==r&&this.terrain&&(r=this.terrain.getElevationForLngLatZoom(i,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(t,n,i,r)}resize(t,i=!0){let[r,o]=this._containerDimensions(),a=this._getClampedPixelRatio(r,o);if(this._resizeCanvas(r,o,a),this.painter.resize(r,o,a),this.painter.overLimit()){let t=this.painter.context.gl;this._maxCanvasSize=[t.drawingBufferWidth,t.drawingBufferHeight];let n=this._getClampedPixelRatio(r,o);this._resizeCanvas(r,o,n),this.painter.resize(r,o,n)}this._resizeTransform(i);let s=!this._moving;return s&&(this.stop(),this.fire(new n.l("movestart",t)).fire(new n.l("move",t))),this.fire(new n.l("resize",t)),s&&this.fire(new n.l("moveend",t)),this}_resizeTransform(t=!0){var n;let[i,r]=this._containerDimensions();this.transform.resize(i,r,t),null==(n=this._requestedCameraState)||n.resize(i,r,t)}_getClampedPixelRatio(t,n){let{0:i,1:r}=this._maxCanvasSize,o=this.getPixelRatio(),a=t*o,s=n*o;return Math.min(a>i?i/a:1,s>r?r/s:1)*o}getPixelRatio(){var t;return null!=(t=this._overridePixelRatio)?t:devicePixelRatio}setPixelRatio(t){this._overridePixelRatio=t,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(t){return this.transform.setMaxBounds(K.convert(t)),this._update()}setMinZoom(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.setMinZoom(t),this._update(),this.getZoom()<t&&this.setZoom(t),this;throw Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.setMaxZoom(t),this._update(),this.getZoom()>t&&this.setZoom(t),this;throw Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=null==t?0:t)<0)throw Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.setMinPitch(t),this._update(),this.getPitch()<t&&this.setPitch(t),this;throw Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(t){if((t=null==t?60:t)>180)throw Error("maxPitch must be less than or equal to 180");if(t>=this.transform.minPitch)return this.transform.setMaxPitch(t),this._update(),this.getPitch()>t&&this.setPitch(t),this;throw Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(t){return this.transform.setRenderWorldCopies(t),this._update()}setTransformConstrain(t){return this.transform.setConstrainOverride(t),this._update()}project(t){return this.transform.locationToScreenPoint(n.U.convert(t),this.style&&this.terrain)}unproject(t){return this.transform.screenPointToLocation(n.P.convert(t),this.terrain)}isMoving(){var t;return this._moving||(null==(t=this.handlers)?void 0:t.isMoving())}isZooming(){var t;return this._zooming||(null==(t=this.handlers)?void 0:t.isZooming())}isRotating(){var t;return this._rotating||(null==(t=this.handlers)?void 0:t.isRotating())}_createDelegatedListener(t,n,i){if("mouseenter"===t||"mouseover"===t){let r=!1,o=o=>{let a=n.filter(t=>this.getLayer(t)),s=0!==a.length?this.queryRenderedFeatures(o.point,{layers:a}):[];s.length?r||(r=!0,i.call(this,new i$(t,this,o.originalEvent,{features:s}))):r=!1};return{layers:n,listener:i,delegates:{mousemove:o,mouseout:()=>{r=!1}}}}if("mouseleave"===t||"mouseout"===t){let r=!1,o=o=>{let a=n.filter(t=>this.getLayer(t));(0!==a.length?this.queryRenderedFeatures(o.point,{layers:a}):[]).length?r=!0:r&&(r=!1,i.call(this,new i$(t,this,o.originalEvent)))},a=n=>{r&&(r=!1,i.call(this,new i$(t,this,n.originalEvent)))};return{layers:n,listener:i,delegates:{mousemove:o,mouseout:a}}}{let r=t=>{let r=n.filter(t=>this.getLayer(t)),o=0!==r.length?this.queryRenderedFeatures(t.point,{layers:r}):[];o.length&&(t.features=o,i.call(this,t),delete t.features)};return{layers:n,listener:i,delegates:{[t]:r}}}}_saveDelegatedListener(t,n){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(n)}_removeDelegatedListener(t,n,i){if(!this._delegatedListeners||!this._delegatedListeners[t])return;let r=this._delegatedListeners[t];for(let t=0;t<r.length;t++){let o=r[t];if(o.listener===i&&o.layers.length===n.length&&o.layers.every(t=>n.includes(t))){for(let t in o.delegates)this.off(t,o.delegates[t]);return void r.splice(t,1)}}}on(t,n,i){if(void 0===i)return super.on(t,n);let r="string"==typeof n?[n]:n,o=this._createDelegatedListener(t,r,i);for(let n in this._saveDelegatedListener(t,o),o.delegates)this.on(n,o.delegates[n]);return{unsubscribe:()=>{this._removeDelegatedListener(t,r,i)}}}once(t,n,i){if(void 0===i)return super.once(t,n);let r="string"==typeof n?[n]:n,o=this._createDelegatedListener(t,r,i);for(let n in o.delegates){let a=o.delegates[n];o.delegates[n]=(...n)=>{this._removeDelegatedListener(t,r,i),a(...n)}}for(let n in this._saveDelegatedListener(t,o),o.delegates)this.once(n,o.delegates[n]);return this}off(t,n,i){return void 0===i?super.off(t,n):(this._removeDelegatedListener(t,"string"==typeof n?[n]:n,i),this)}queryRenderedFeatures(t,i){let r;if(!this.style)return[];let o=t instanceof n.P||Array.isArray(t),a=o?t:[[0,0],[this.transform.width,this.transform.height]];if(i=i||(o?{}:t)||{},a instanceof n.P||"number"==typeof a[0])r=[n.P.convert(a)];else{let t=n.P.convert(a[0]),i=n.P.convert(a[1]);r=[t,new n.P(i.x,t.y),i,new n.P(t.x,i.y),t]}return this.style.queryRenderedFeatures(r,i,this.transform)}querySourceFeatures(t,n){return this.style.querySourceFeatures(t,n)}setStyle(t,i){return!1!==(i=n.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},i)).diff&&i.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,i),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._updateStyle(t,i))}setTransformRequest(t){return this._requestManager.setTransformRequest(t),this}_getUIString(t){let n=this._locale[t];if(null==n)throw Error(`Missing UI string '${t}'`);return n}_updateStyle(t,n){var i,r;if(n.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(t,n));let o=this.style&&n.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!t)),t?(this.style=new t5(this,n||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t,n,o):this.style.loadJSON(t,n,o)):(null==(r=null==(i=this.style)?void 0:i.projection)||r.destroy(),delete this.style),this}_lazyInitEmptyStyle(){this.style||(this.style=new t5(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(t,i){if("string"==typeof t){let r=this._requestManager.transformRequest(t,"Style");n.j(r,new AbortController).then(t=>{this._updateDiff(t.data,i)}).catch(t=>{t&&this.fire(new n.k(t))})}else"object"==typeof t&&this._updateDiff(t,i)}_updateDiff(t,i){try{this.style.setState(t,i)&&this._update(!0)}catch(r){n.w(`Unable to perform style diff: ${r.message||r.error||r}. Rebuilding the style from scratch.`),this._updateStyle(t,i)}}getStyle(){if(this.style)return this.style.serialize()}_getStyleAndImages(){return this.style?{style:this.style.serialize(),images:this.style.imageManager.cloneImages()}:{style:null,images:{}}}isStyleLoaded(){return this.style?this.style.loaded():n.w("There is no style added to the map.")}addSource(t,n){return this._lazyInitEmptyStyle(),this.style.addSource(t,n),this._update(!0)}isSourceLoaded(t){let i=this.style&&this.style.tileManagers[t];if(void 0!==i)return i.loaded();this.fire(new n.k(Error(`There is no tile manager with ID '${t}'`)))}setTerrain(t){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),t){let i=this.style.tileManagers[t.source];if(!i)throw Error(`cannot load terrain, because there exists no source with ID: ${t.source}`);for(let r in null===this.terrain&&i.reload(),this.style._layers){let i=this.style._layers[r];"hillshade"===i.type&&i.source===t.source&&n.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),"color-relief"===i.type&&i.source===t.source&&n.w("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new rP(this.painter,i,t),this.painter.renderToTexture=new rB(this.painter,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._terrainDataCallback=n=>{var i;"style"===n.dataType?this.terrain.tileManager.freeRtt():"source"===n.dataType&&n.tile&&(n.sourceId!==t.source||this._elevationFreeze||(this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))),"image"===(null==(i=n.source)?void 0:i.type)?this.terrain.tileManager.freeRtt():this.terrain.tileManager.freeRtt(n.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.tileManager.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0);return this.fire(new n.l("terrain",{terrain:t})),this}getTerrain(){var t,n;return null!=(n=null==(t=this.terrain)?void 0:t.options)?n:null}areTilesLoaded(){let t=this.style&&this.style.tileManagers;for(let n in t){let i=t[n]._tiles;for(let t in i){let n=i[t];if("loaded"!==n.state&&"errored"!==n.state)return!1}}return!0}removeSource(t){return this.style.removeSource(t),this._update(!0)}getSource(t){return this.style.getSource(t)}setSourceTileLodParams(t,n,i){if(i){let r=this.getSource(i);if(!r)throw Error(`There is no source with ID "${i}", cannot set LOD parameters`);r.calculateTileZoom=ew(Math.max(1,t),Math.max(1,n))}else for(let i in this.style.tileManagers)this.style.tileManagers[i].getSource().calculateTileZoom=ew(Math.max(1,t),Math.max(1,n));return this._update(!0),this}refreshTiles(t,i){let r=this.style.tileManagers[t];if(!r)throw Error(`There is no tile manager with ID "${t}", cannot refresh tile`);void 0===i?r.reload(!0):r.refreshTiles(i.map(t=>new n.a8(t.z,t.x,t.y)))}addImage(t,i,r={}){let{pixelRatio:o=1,sdf:a=!1,stretchX:s,stretchY:l,content:c,textFitWidth:d,textFitHeight:u}=r;if(this._lazyInitEmptyStyle(),!(i instanceof HTMLImageElement||n.b(i))){if(void 0===i.width||void 0===i.height)return this.fire(new n.k(Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{let{width:r,height:m,data:h}=i;return this.style.addImage(t,{data:new n.R({width:r,height:m},new Uint8Array(h)),pixelRatio:o,stretchX:s,stretchY:l,content:c,textFitWidth:d,textFitHeight:u,sdf:a,version:0,userImage:i}),i.onAdd&&i.onAdd(this,t),this}}{let{width:r,height:m,data:h}=_.getImageData(i);this.style.addImage(t,{data:new n.R({width:r,height:m},h),pixelRatio:o,stretchX:s,stretchY:l,content:c,textFitWidth:d,textFitHeight:u,sdf:a,version:0})}}updateImage(t,i){let r=this.style.getImage(t);if(!r)return this.fire(new n.k(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:o,height:a,data:s}=i instanceof HTMLImageElement||n.b(i)?_.getImageData(i):i;if(void 0===o||void 0===a)return this.fire(new n.k(Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(o!==r.data.width||a!==r.data.height)return this.fire(new n.k(Error("The width and height of the updated image must be that same as the previous version of the image")));let l=!(i instanceof HTMLImageElement||n.b(i));return r.data.replace(s,l),this.style.updateImage(t,r),this}getImage(t){return this.style.getImage(t)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new n.k(Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}loadImage(t){return h.getImage(this._requestManager.transformRequest(t,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(t,n){return this._lazyInitEmptyStyle(),this.style.addLayer(t,n),this._update(!0)}moveLayer(t,n){return this.style.moveLayer(t,n),this._update(!0)}removeLayer(t){return this.style.removeLayer(t),this._update(!0)}getLayer(t){return this.style.getLayer(t)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(t,n,i){return this.style.setLayerZoomRange(t,n,i),this._update(!0)}setFilter(t,n,i={}){return this.style.setFilter(t,n,i),this._update(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,n,i,r={}){return this.style.setPaintProperty(t,n,i,r),this._update(!0)}getPaintProperty(t,n){return this.style.getPaintProperty(t,n)}setLayoutProperty(t,n,i,r={}){return this.style.setLayoutProperty(t,n,i,r),this._update(!0)}getLayoutProperty(t,n){return this.style.getLayoutProperty(t,n)}setGlyphs(t,n={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(t,n),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(t,n,i={}){return this._lazyInitEmptyStyle(),this.style.addSprite(t,n,i,t=>{t||this._update(!0)}),this}removeSprite(t){return this._lazyInitEmptyStyle(),this.style.removeSprite(t),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(t,n={}){return this._lazyInitEmptyStyle(),this.style.setSprite(t,n,t=>{t||this._update(!0)}),this}setLight(t,n={}){return this._lazyInitEmptyStyle(),this.style.setLight(t,n),this._update(!0)}getLight(){return this.style.getLight()}setSky(t,n={}){return this._lazyInitEmptyStyle(),this.style.setSky(t,n),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(t,n){return this.style.setFeatureState(t,n),this._update()}removeFeatureState(t,n){return this.style.removeFeatureState(t,n),this._update()}getFeatureState(t){return this.style.getFeatureState(t)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let t=0,n=0;return this._container&&(t=this._container.clientWidth||400,n=this._container.clientHeight||300),[t,n]}_setupContainer(){let t=this._container;t.classList.add("maplibregl-map");let n=this._canvasContainer=x.create("div","maplibregl-canvas-container",t);this._interactive&&n.classList.add("maplibregl-interactive"),this._canvas=x.create("canvas","maplibregl-canvas",n),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");let i=this._containerDimensions(),r=this._getClampedPixelRatio(i[0],i[1]);this._resizeCanvas(i[0],i[1],r);let o=this._controlContainer=x.create("div","maplibregl-control-container",t),a=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(t=>{a[t]=x.create("div",`maplibregl-ctrl-${t} `,o)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(t,n,i){this._canvas.width=Math.floor(i*t),this._canvas.height=Math.floor(i*n),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${n}px`}_setupPainter(){let t=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0}),n=null;this._canvas.addEventListener("webglcontextcreationerror",i=>{n={requestedAttributes:t},i&&(n.statusMessage=i.statusMessage,n.type=i.type)},{once:!0});let i=null;if(!(i=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,t):this._canvas.getContext("webgl2",t)||this._canvas.getContext("webgl",t))){let t="Failed to initialize WebGL";throw n?(n.message=t,Error(JSON.stringify(n))):Error(t)}this.painter=new iR(i,this.transform),w.testSupport(i)}migrateProjection(t,i){super.migrateProjection(t,i),this.painter.transform=t,this.fire(new n.l("projectiontransition",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(t){return this.style&&this.style._loaded&&(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint()),this}_requestRenderFrame(t){return this._update(),this._renderTaskQueue.add(t)}_cancelRenderFrame(t){this._renderTaskQueue.remove(t)}_render(t){var i,r,o,a,s;let l=this._idleTriggered?this._fadeDuration:0,c=(null==(i=this.style.projection)?void 0:i.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),this._removed)return;let d=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let t=this.transform.zoom,i=v();this.style.zoomHistory.update(t,i);let r=new n.G(t,{now:i,fadeDuration:l,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),o=r.crossFadingFactor();1===o&&o===this._crossFadingFactor||(d=!0,this._crossFadingFactor=o),this.style.update(r)}let u=(null==(r=this.style.projection)?void 0:r.transitionState)>0!==c;null==(o=this.style.projection)||o.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState(null==(a=this.style.projection)?void 0:a.transitionState,null==(s=this.style.projection)?void 0:s.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||u)&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.tileManager.update(this.transform,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),!this._elevationFreeze&&this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0)),this._placementDirty=this.style&&this.style._updatePlacement(this.transform,this.showCollisionBoxes,l,this._crossSourceCollisions,u),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:l,showPadding:this.showPadding}),this.fire(new n.l("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,n.cA.mark(n.cB.load),this.fire(new n.l("load"))),this.style&&(this.style.hasTransitions()||d)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let m=this._sourcesDirty||this._styleDirty||this._placementDirty;return m||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new n.l("idle")),!this._loaded||this._fullyLoaded||m||(this._fullyLoaded=!0,n.cA.mark(n.cB.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var t;for(let t of(this._hash&&this._hash.remove(),this._controls))t.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),"undefined"!=typeof window&&removeEventListener("online",this._onWindowOnline,!1),h.removeThrottleControl(this._imageQueueHandle),null==(t=this._resizeObserver)||t.disconnect();let i=this.painter.context.gl.getExtension("WEBGL_lose_context");(null==i?void 0:i.loseContext)&&i.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),x.remove(this._canvasContainer),x.remove(this._controlContainer),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map"),n.cA.clearMetrics(),this._removed=!0,this.fire(new n.l("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,_.frame(this._frameRequest,t=>{n.cA.frame(t),this._frameRequest=null;try{this._render(t)}catch(t){if(!n.cC(t)&&t.message!==is)throw t}},()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())}get showPadding(){return!!this._showPadding}set showPadding(t){this._showPadding!==t&&(this._showPadding=t,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())}get repaint(){return!!this._repaint}set repaint(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(t){this._vertices=t,this._update()}get version(){return b}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(t){return this._lazyInitEmptyStyle(),this.style.setProjection(t),this._update(!0)}},t.MapMouseEvent=i$,t.MapTouchEvent=iW,t.MapWheelEvent=iZ,t.Marker=rG,t.NavigationControl=class{constructor(t){this._updateZoomButtons=()=>{let t=this._map.getZoom(),n=t===this._map.getMaxZoom(),i=t===this._map.getMinZoom();this._zoomInButton.disabled=n,this._zoomOutButton.disabled=i,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",i.toString())},this._rotateCompassArrow=()=>{this._compassIcon.style.transform=this.options.visualizePitch&&this.options.visualizeRoll?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateZ(${-this._map.transform.roll}deg) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizeRoll?`rotate(${-this._map.transform.bearing-this._map.transform.roll}deg)`:`rotate(${-this._map.transform.bearing}deg)`},this._setButtonTitle=(t,n)=>{let i=this._map._getUIString(`NavigationControl.${n}`);t.title=i,t.setAttribute("aria-label",i)},this.options=n.e({},rY,t),this._container=x.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),x.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),x.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=x.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new rj(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){x.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(t,n){let i=x.create("button",t,this._container);return i.type="button",i.addEventListener("click",n),i}},t.Popup=class extends n.E{constructor(t){super(),this._updateOpacity=()=>{void 0!==this.options.locationOccludedOpacity&&(this._container.style.opacity=this._map.transform.isLocationOccluded(this.getLngLat())?`${this.options.locationOccludedOpacity}`:"")},this.remove=()=>(this._content&&x.remove(this._content),this._container&&(x.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new n.l("close"))),this),this._onMouseUp=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=x.create("div","maplibregl-popup",this._map.getContainer()),this._tip=x.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let t of this.options.className.split(" "))this._container.classList.add(t);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=rU(this._lngLat,this._flatPos,this._map.transform,this._trackPointer),this._trackPointer&&!t)return;let i=this._flatPos=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&t?t:this._map.transform.locationToScreenPoint(this._lngLat));let r=this.options.anchor,o=function t(i){if(i){if("number"==typeof i){let t=Math.round(Math.abs(i)/Math.SQRT2);return{center:new n.P(0,0),top:new n.P(0,i),"top-left":new n.P(t,t),"top-right":new n.P(-t,t),bottom:new n.P(0,-i),"bottom-left":new n.P(t,-t),"bottom-right":new n.P(-t,-t),left:new n.P(i,0),right:new n.P(-i,0)}}if(i instanceof n.P||Array.isArray(i)){let t=n.P.convert(i);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:n.P.convert(i.center||[0,0]),top:n.P.convert(i.top||[0,0]),"top-left":n.P.convert(i["top-left"]||[0,0]),"top-right":n.P.convert(i["top-right"]||[0,0]),bottom:n.P.convert(i.bottom||[0,0]),"bottom-left":n.P.convert(i["bottom-left"]||[0,0]),"bottom-right":n.P.convert(i["bottom-right"]||[0,0]),left:n.P.convert(i.left||[0,0]),right:n.P.convert(i.right||[0,0])}}return t(new n.P(0,0))}(this.options.offset);if(!r){let t,n=this._container.offsetWidth,a=this._container.offsetHeight;t=i.y+o.bottom.y<a?["top"]:i.y>this._map.transform.height-a?["bottom"]:[],i.x<n/2?t.push("left"):i.x>this._map.transform.width-n/2&&t.push("right"),r=0===t.length?"bottom":t.join("-")}let a=i.add(o[r]);this.options.subpixelPositioning||(a=a.round()),x.setTransform(this._container,`${rH[r]} translate(${a.x}px,${a.y}px)`),rV(this._container,r,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=n.e(Object.create(rJ),t)}addTo(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new n.l("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=n.U.convert(t),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(t){return this.setDOMContent(document.createTextNode(t))}setHTML(t){let n,i=document.createDocumentFragment(),r=document.createElement("body");for(r.innerHTML=t;n=r.firstChild;)i.appendChild(n);return this.setDOMContent(i)}getMaxWidth(){var t;return null==(t=this._container)?void 0:t.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this._update(),this}setDOMContent(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=x.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(t){return this._container&&this._container.classList.add(t),this}removeClassName(t){return this._container&&this._container.classList.remove(t),this}setOffset(t){return this.options.offset=t,this._update(),this}toggleClassName(t){if(this._container)return this._container.classList.toggle(t)}setSubpixelPositioning(t){this.options.subpixelPositioning=t}_createCloseButton(){this.options.closeButton&&(this._closeButton=x.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let t=this._container.querySelector("a[href], [tabindex]:not([tabindex='-1']), [contenteditable]:not([contenteditable='false']), button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])");t&&t.focus()}},t.RasterDEMTileSource=et,t.RasterTileSource=ee,t.ScaleControl=class{constructor(t){this._onMove=()=>{rX(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,rX(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},rZ),t)}getDefaultPosition(){return"bottom-left"}onAdd(t){return this._map=t,this._container=x.create("div","maplibregl-ctrl maplibregl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){x.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},t.ScrollZoomHandler=rp,t.Style=t5,t.TerrainControl=class{constructor(t){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=t}onAdd(t){return this._map=t,this._container=x.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=x.create("button","maplibregl-ctrl-terrain",this._container),x.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){x.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},t.TwoFingersTouchPitchHandler=rl,t.TwoFingersTouchRotateHandler=ra,t.TwoFingersTouchZoomHandler=rr,t.TwoFingersTouchZoomRotateHandler=rx,t.VectorTileSource=Q,t.VideoSource=ea,t.addSourceType=(t,i)=>n._(void 0,void 0,void 0,function*(){if(ec(t))throw Error(`A source type called "${t}" already exists.`);el[t]=i}),t.clearPrewarmedResources=function(){let t=s;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(U),s=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},t.createTileMesh=tL,t.getMaxParallelImageRequests=function(){return n.a.MAX_PARALLEL_IMAGE_REQUESTS},t.getRTLTextPluginStatus=function(){return eh().getRTLTextPluginStatus()},t.getVersion=function(){return b},t.getWorkerCount=function(){return H.workerCount},t.getWorkerUrl=function(){return n.a.WORKER_URL},t.importScriptInWorkers=function(t){return $().broadcast("IS",t)},t.isTimeFrozen=function(){return y.isFrozen()},t.now=v,t.prewarm=function(){G().acquire(U)},t.restoreNow=function(){y.restoreNow()},t.setMaxParallelImageRequests=function(t){n.a.MAX_PARALLEL_IMAGE_REQUESTS=t},t.setNow=function(t){y.setNow(t)},t.setRTLTextPlugin=function(t,n){return eh().setRTLTextPlugin(t,n)},t.setWorkerCount=function(t){H.workerCount=t},t.setWorkerUrl=function(t){n.a.WORKER_URL=t}}),t}()}},n={};function i(r){var o=n[r];if(void 0!==o)return o.exports;var a=n[r]={id:r,loaded:!1,exports:{}};return t[r].call(a.exports,a,a.exports,i),a.loaded=!0,a.exports}i.n=t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return i.d(n,{a:n}),n},(()=>{var t,n=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__;i.t=function(r,o){if(1&o&&(r=this(r)),8&o||"object"==typeof r&&r&&(4&o&&r.__esModule||16&o&&"function"==typeof r.then))return r;var a=Object.create(null);i.r(a);var s={};t=t||[null,n({}),n([]),n(n)];for(var l=2&o&&r;"object"==typeof l&&!~t.indexOf(l);l=n(l))Object.getOwnPropertyNames(l).forEach(t=>{s[t]=()=>r[t]});return s.default=()=>r,i.d(a,s),a}})(),i.d=(t,n)=>{for(var r in n)i.o(n,r)&&!i.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},i.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}})(),i.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r={};return(()=>{"use strict";let t;i.r(r),i.d(r,{OrMapLoadedEvent:()=>la,geoJsonPointInputTemplateProvider:()=>lu,OrMapMarkerClickedEvent:()=>r3,OrMap:()=>lm,OrMapLegendEvent:()=>li,OrMapAssetCard:()=>lt,OrMapMarker:()=>r5,getMarkerConfigAttributeName:()=>r8,OrClusterMarker:()=>rV,DefaultConfig:()=>le,OrMapAssetCardLoadAssetEvent:()=>s9,Util:()=>eD,getMarkerConfigForAssetType:()=>r6,OrMapLongPressEvent:()=>ll,OrMapMarkerChangedEvent:()=>r2,LngLat:()=>rL.LngLat,OrMapLegend:()=>lr,OrMapMarkerAsset:()=>r7,OrMapGeocoderChangeEvent:()=>lc,OrMapMarkersChangedEvent:()=>ld,OrMapClickedEvent:()=>ls});var n,o,a,s,l,c,d,u,m,h,f,p,b,g,_,y,v,x,w,F,k,E,T,A,M,C,S,D,I,P,R,O,B,z,N,Y,j,U,H,V,G,q,$,W,Z,X,K,J,Q,ee,et,en,ei,er,eo,ea,es,el,ec,ed,eu,em,eh,ef,ep,eb,eg,e_,ey,ev,ex,ew,eF,ek,eE,eT,eA,eM,eC,eS,eL,eD={};function eI(t){return(eI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function eP(t,n){if(!(t instanceof n))throw TypeError("Cannot call a class as a function")}function eR(t){var n=function(t,n){if("object"!=eI(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,n||"default");if("object"!=eI(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==eI(n)?n:String(n)}function eO(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,eR(r.key),r)}}function eB(t,n,i){return n&&eO(t.prototype,n),i&&eO(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function ez(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function eN(t,n){return(eN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}function eY(t,n){if("function"!=typeof n&&null!==n)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&eN(t,n)}function ej(t,n){if(n&&("object"===eI(n)||"function"==typeof n))return n;if(void 0!==n)throw TypeError("Derived constructors may only return object or undefined");return ez(t)}function eU(t){return(eU=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function eH(t,n,i){return(n=eR(n))in t?Object.defineProperty(t,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[n]=i,t}function eV(t,n){(null==n||n>t.length)&&(n=t.length);for(var i=0,r=Array(n);i<n;i++)r[i]=t[i];return r}function eG(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function eq(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?eG(Object(i),!0).forEach(function(n){eH(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):eG(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}i.r(eD),i.d(eD,{getGeoJSONPoint:()=>rO,getLatLngBounds:()=>rz,getLngLat:()=>rR,getLngLatBounds:()=>rB,getMarkerIconAndColorFromAssetType:()=>rN,isAssetWithLocation:()=>rj,isWebglSupported:()=>rY}),i(488);var e$={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,n){console&&console[t]&&console[t].apply(console,n)}},eW=new(function(){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};eP(this,t),this.init(n,i)}return eB(t,[{key:"init",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||e$,this.options=n,this.debug=n.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return this.forward(n,"log","",!0)}},{key:"warn",value:function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return this.forward(n,"warn","",!0)}},{key:"error",value:function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return this.forward(n,"error","")}},{key:"deprecate",value:function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(t,n,i,r){return r&&!this.debug?null:("string"==typeof t[0]&&(t[0]="".concat(i).concat(this.prefix," ").concat(t[0])),this.logger[n](t))}},{key:"create",value:function(n){return new t(this.logger,eq(eq({},{prefix:"".concat(this.prefix,":").concat(n,":")}),this.options))}},{key:"clone",value:function(n){return(n=n||this.options).prefix=n.prefix||this.prefix,new t(this.logger,n)}}]),t}()),eZ=function(){function t(){eP(this,t),this.observers={}}return eB(t,[{key:"on",value:function(t,n){var i=this;return t.split(" ").forEach(function(t){i.observers[t]=i.observers[t]||[],i.observers[t].push(n)}),this}},{key:"off",value:function(t,n){if(this.observers[t]){if(!n)return void delete this.observers[t];this.observers[t]=this.observers[t].filter(function(t){return t!==n})}}},{key:"emit",value:function(t){for(var n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.observers[t]&&[].concat(this.observers[t]).forEach(function(t){t.apply(void 0,i)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(function(n){n.apply(n,[t].concat(i))})}}]),t}();function eX(){var t,n,i=new Promise(function(i,r){t=i,n=r});return i.resolve=t,i.reject=n,i}function eK(t){return null==t?"":""+t}function eJ(t,n,i){function r(t){return t&&t.indexOf("###")>-1?t.replace(/###/g,"."):t}function o(){return!t||"string"==typeof t}for(var a="string"!=typeof n?[].concat(n):n.split(".");a.length>1;){if(o())return{};var s=r(a.shift());!t[s]&&i&&(t[s]=new i),t=Object.prototype.hasOwnProperty.call(t,s)?t[s]:{}}return o()?{}:{obj:t,k:r(a.shift())}}function eQ(t,n,i){var r=eJ(t,n,Object);r.obj[r.k]=i}function e0(t,n){var i=eJ(t,n),r=i.obj,o=i.k;if(r)return r[o]}function e1(t,n,i){var r=e0(t,i);return void 0!==r?r:e0(n,i)}function e2(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var e3={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function e5(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,function(t){return e3[t]}):t}var e4="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,e6=[" ",",","?","!",";"];function e8(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function e7(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?e8(Object(i),!0).forEach(function(n){eH(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):e8(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var e9=function(t){eY(r,t);var n,i=(n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=eU(r);return t=n?Reflect.construct(i,arguments,eU(this).constructor):i.apply(this,arguments),ej(this,t)});function r(t){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return eP(this,r),n=i.call(this),e4&&eZ.call(ez(n)),n.data=t||{},n.options=o,void 0===n.options.keySeparator&&(n.options.keySeparator="."),void 0===n.options.ignoreJSONStructure&&(n.options.ignoreJSONStructure=!0),n}return eB(r,[{key:"addNamespaces",value:function(t){0>this.options.ns.indexOf(t)&&this.options.ns.push(t)}},{key:"removeNamespaces",value:function(t){var n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}},{key:"getResource",value:function(t,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,a=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,s=[t,n];i&&"string"!=typeof i&&(s=s.concat(i)),i&&"string"==typeof i&&(s=s.concat(o?i.split(o):i)),t.indexOf(".")>-1&&(s=t.split("."));var l=e0(this.data,s);return l||!a||"string"!=typeof i?l:function t(n,i){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(n){if(n[i])return n[i];for(var o=i.split(r),a=n,s=0;s<o.length;++s){if(!a||"string"==typeof a[o[s]]&&s+1<o.length)return;if(void 0===a[o[s]]){for(var l=2,c=o.slice(s,s+l).join(r),d=a[c];void 0===d&&o.length>s+l;)l++,d=a[c=o.slice(s,s+l).join(r)];if(void 0===d)return;if(null===d)return null;if(i.endsWith(c)){if("string"==typeof d)return d;if(c&&"string"==typeof d[c])return d[c]}var u=o.slice(s+l).join(r);if(u)return t(d,u,r);return}a=a[o[s]]}return a}}(this.data&&this.data[t]&&this.data[t][n],i,o)}},{key:"addResource",value:function(t,n,i,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},a=this.options.keySeparator;void 0===a&&(a=".");var s=[t,n];i&&(s=s.concat(a?i.split(a):i)),t.indexOf(".")>-1&&(s=t.split("."),r=n,n=s[1]),this.addNamespaces(n),eQ(this.data,s,r),o.silent||this.emit("added",t,n,i,r)}},{key:"addResources",value:function(t,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in i)("string"==typeof i[o]||"[object Array]"===Object.prototype.toString.apply(i[o]))&&this.addResource(t,n,o,i[o],{silent:!0});r.silent||this.emit("added",t,n,i)}},{key:"addResourceBundle",value:function(t,n,i,r,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[t,n];t.indexOf(".")>-1&&(s=t.split("."),r=i,i=n,n=s[1]),this.addNamespaces(n);var l=e0(this.data,s)||{};r?function t(n,i,r){for(var o in i)"__proto__"!==o&&"constructor"!==o&&(o in n?"string"==typeof n[o]||n[o]instanceof String||"string"==typeof i[o]||i[o]instanceof String?r&&(n[o]=i[o]):t(n[o],i[o],r):n[o]=i[o]);return n}(l,i,o):l=e7(e7({},l),i),eQ(this.data,s,l),a.silent||this.emit("added",t,n,i)}},{key:"removeResourceBundle",value:function(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}},{key:"hasResourceBundle",value:function(t,n){return void 0!==this.getResource(t,n)}},{key:"getResourceBundle",value:function(t,n){return(n||(n=this.options.defaultNS),"v1"===this.options.compatibilityAPI)?e7(e7({},{}),this.getResource(t,n)):this.getResource(t,n)}},{key:"getDataByLanguage",value:function(t){return this.data[t]}},{key:"hasLanguageSomeTranslations",value:function(t){var n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(function(t){return n[t]&&Object.keys(n[t]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),r}(eZ),te={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,i,r,o){var a=this;return t.forEach(function(t){a.processors[t]&&(n=a.processors[t].process(n,i,r,o))}),n}};function tt(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function tn(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?tt(Object(i),!0).forEach(function(n){eH(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):tt(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var ti={},tr=function(t){eY(r,t);var n,i=(n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=eU(r);return t=n?Reflect.construct(i,arguments,eU(this).constructor):i.apply(this,arguments),ej(this,t)});function r(t){var n,o,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return eP(this,r),a=i.call(this),e4&&eZ.call(ez(a)),n=["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],o=ez(a),n.forEach(function(n){t[n]&&(o[n]=t[n])}),a.options=s,void 0===a.options.keySeparator&&(a.options.keySeparator="."),a.logger=eW.create("translator"),a}return eB(r,[{key:"changeLanguage",value:function(t){t&&(this.language=t)}},{key:"exists",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==t)return!1;var i=this.resolve(t,n);return i&&void 0!==i.res}},{key:"extractFromKey",value:function(t,n){var i=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===i&&(i=":");var r=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,o=n.ns||this.options.defaultNS||[],a=i&&t.indexOf(i)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!function(t,n,i){n=n||"",i=i||"";var r=e6.filter(function(t){return 0>n.indexOf(t)&&0>i.indexOf(t)});if(0===r.length)return!0;var o=new RegExp("(".concat(r.map(function(t){return"?"===t?"\\?":t}).join("|"),")")),a=!o.test(t);if(!a){var s=t.indexOf(i);s>0&&!o.test(t.substring(0,s))&&(a=!0)}return a}(t,i,r);if(a&&!s){var l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:o};var c=t.split(i);(i!==r||i===r&&this.options.ns.indexOf(c[0])>-1)&&(o=c.shift()),t=c.join(r)}return"string"==typeof o&&(o=[o]),{key:t,namespaces:o}}},{key:"translate",value:function(t,n,i){var o=this;if("object"!==eI(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);var a=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,s=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,l=this.extractFromKey(t[t.length-1],n),c=l.key,d=l.namespaces,u=d[d.length-1],m=n.lng||this.language,h=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(m&&"cimode"===m.toLowerCase()){if(h){var f=n.nsSeparator||this.options.nsSeparator;return a?(p.res="".concat(u).concat(f).concat(c),p):"".concat(u).concat(f).concat(c)}return a?(p.res=c,p):c}var p=this.resolve(t,n),b=p&&p.res,g=p&&p.usedKey||c,_=p&&p.exactUsedKey||c,y=Object.prototype.toString.apply(b),v=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,w="string"!=typeof b&&"boolean"!=typeof b&&"number"!=typeof b;if(x&&b&&w&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(y)&&("string"!=typeof v||"[object Array]"!==y)){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var F=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,b,tn(tn({},n),{},{ns:d})):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");return a?(p.res=F,p):F}if(s){var k="[object Array]"===y,E=k?[]:{},T=k?_:g;for(var A in b)if(Object.prototype.hasOwnProperty.call(b,A)){var M="".concat(T).concat(s).concat(A);E[A]=this.translate(M,tn(tn({},n),{joinArrays:!1,ns:d})),E[A]===M&&(E[A]=b[A])}b=E}}else if(x&&"string"==typeof v&&"[object Array]"===y)(b=b.join(v))&&(b=this.extendTranslation(b,t,n,i));else{var C=!1,S=!1,D=void 0!==n.count&&"string"!=typeof n.count,I=r.hasDefaultValue(n),P=D?this.pluralResolver.getSuffix(m,n.count,n):"",R=n["defaultValue".concat(P)]||n.defaultValue;!this.isValidLookup(b)&&I&&(C=!0,b=R),this.isValidLookup(b)||(S=!0,b=c);var O=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&S?void 0:b,B=I&&R!==b&&this.options.updateMissing;if(S||C||B){if(this.logger.log(B?"updateKey":"missingKey",m,u,c,B?R:b),s){var z=this.resolve(c,tn(tn({},n),{},{keySeparator:!1}));z&&z.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var N=[],Y=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&Y&&Y[0])for(var j=0;j<Y.length;j++)N.push(Y[j]);else"all"===this.options.saveMissingTo?N=this.languageUtils.toResolveHierarchy(n.lng||this.language):N.push(n.lng||this.language);var U=function(t,i,r){var a=I&&r!==b?r:O;o.options.missingKeyHandler?o.options.missingKeyHandler(t,u,i,a,B,n):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(t,u,i,a,B,n),o.emit("missingKey",t,u,i,b)};this.options.saveMissing&&(this.options.saveMissingPlurals&&D?N.forEach(function(t){o.pluralResolver.getSuffixes(t,n).forEach(function(i){U([t],c+i,n["defaultValue".concat(i)]||R)})}):U(N,c,R))}b=this.extendTranslation(b,t,n,p,i),S&&b===c&&this.options.appendNamespaceToMissingKey&&(b="".concat(u,":").concat(c)),(S||C)&&this.options.parseMissingKeyHandler&&(b="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(u,":").concat(c):c,C?b:void 0):this.options.parseMissingKeyHandler(b))}return a?(p.res=b,p):b}},{key:"extendTranslation",value:function(t,n,i,r,o){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,tn(tn({},this.options.interpolation.defaultVariables),i),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init(tn(tn({},i),{interpolation:tn(tn({},this.options.interpolation),i.interpolation)}));var s,l="string"==typeof t&&(i&&i.interpolation&&void 0!==i.interpolation.skipOnVariables?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(l){var c=t.match(this.interpolator.nestingRegexp);s=c&&c.length}var d=i.replace&&"string"!=typeof i.replace?i.replace:i;if(this.options.interpolation.defaultVariables&&(d=tn(tn({},this.options.interpolation.defaultVariables),d)),t=this.interpolator.interpolate(t,d,i.lng||this.language,i),l){var u=t.match(this.interpolator.nestingRegexp);s<(u&&u.length)&&(i.nest=!1)}!1!==i.nest&&(t=this.interpolator.nest(t,function(){for(var t=arguments.length,r=Array(t),s=0;s<t;s++)r[s]=arguments[s];return o&&o[0]===r[0]&&!i.context?(a.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(n[0])),null):a.translate.apply(a,r.concat([n]))},i)),i.interpolation&&this.interpolator.reset()}var m=i.postProcess||this.options.postProcess,h="string"==typeof m?[m]:m;return null!=t&&h&&h.length&&!1!==i.applyPostProcessor&&(t=te.handle(h,t,n,this.options&&this.options.postProcessPassResolved?tn({i18nResolved:r},i):i,this)),t}},{key:"resolve",value:function(t){var n,i,r,o,a,s=this,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=[t]),t.forEach(function(t){if(!s.isValidLookup(n)){var c=s.extractFromKey(t,l),d=c.key;i=d;var u=c.namespaces;s.options.fallbackNS&&(u=u.concat(s.options.fallbackNS));var m=void 0!==l.count&&"string"!=typeof l.count,h=m&&!l.ordinal&&0===l.count&&s.pluralResolver.shouldUseIntlApi(),f=void 0!==l.context&&("string"==typeof l.context||"number"==typeof l.context)&&""!==l.context,p=l.lngs?l.lngs:s.languageUtils.toResolveHierarchy(l.lng||s.language,l.fallbackLng);u.forEach(function(t){s.isValidLookup(n)||(a=t,!ti["".concat(p[0],"-").concat(t)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(a)&&(ti["".concat(p[0],"-").concat(t)]=!0,s.logger.warn('key "'.concat(i,'" for languages "').concat(p.join(", "),'" won\'t get resolved as namespace "').concat(a,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach(function(i){if(!s.isValidLookup(n)){o=i;var a,c=[d];if(s.i18nFormat&&s.i18nFormat.addLookupKeys)s.i18nFormat.addLookupKeys(c,d,i,t,l);else{m&&(u=s.pluralResolver.getSuffix(i,l.count,l));var u,p="".concat(s.options.pluralSeparator,"zero");if(m&&(c.push(d+u),h&&c.push(d+p)),f){var b="".concat(d).concat(s.options.contextSeparator).concat(l.context);c.push(b),m&&(c.push(b+u),h&&c.push(b+p))}}for(;a=c.pop();)s.isValidLookup(n)||(r=a,n=s.getResource(i,t,a,l))}}))})}}),{res:n,usedKey:i,exactUsedKey:r,usedLng:o,usedNS:a}}},{key:"isValidLookup",value:function(t){return void 0!==t&&!(!this.options.returnNull&&null===t)&&!(!this.options.returnEmptyString&&""===t)}},{key:"getResource",value:function(t,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,i,r):this.resourceStore.getResource(t,n,i,r)}}],[{key:"hasDefaultValue",value:function(t){var n="defaultValue";for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&n===i.substring(0,n.length)&&void 0!==t[i])return!0;return!1}}]),r}(eZ);function to(t){return t.charAt(0).toUpperCase()+t.slice(1)}var ta=function(){function t(n){eP(this,t),this.options=n,this.supportedLngs=this.options.supportedLngs||!1,this.logger=eW.create("languageUtils")}return eB(t,[{key:"getScriptPartFromCode",value:function(t){if(!t||0>t.indexOf("-"))return null;var n=t.split("-");return 2===n.length||(n.pop(),"x"===n[n.length-1].toLowerCase())?null:this.formatLanguageCode(n.join("-"))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||0>t.indexOf("-"))return t;var n=t.split("-");return this.formatLanguageCode(n[0])}},{key:"formatLanguageCode",value:function(t){if("string"==typeof t&&t.indexOf("-")>-1){var n=["hans","hant","latn","cyrl","cans","mong","arab"],i=t.split("-");return this.options.lowerCaseLng?i=i.map(function(t){return t.toLowerCase()}):2===i.length?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=to(i[1].toLowerCase()))):3===i.length&&(i[0]=i[0].toLowerCase(),2===i[1].length&&(i[1]=i[1].toUpperCase()),"sgn"!==i[0]&&2===i[2].length&&(i[2]=i[2].toUpperCase()),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=to(i[1].toLowerCase())),n.indexOf(i[2].toLowerCase())>-1&&(i[2]=to(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isSupportedCode",value:function(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var n,i=this;return t?(t.forEach(function(t){if(!n){var r=i.formatLanguageCode(t);(!i.options.supportedLngs||i.isSupportedCode(r))&&(n=r)}}),!n&&this.options.supportedLngs&&t.forEach(function(t){if(!n){var r=i.getLanguagePartFromCode(t);if(i.isSupportedCode(r))return n=r;n=i.options.supportedLngs.find(function(t){if(0===t.indexOf(r))return t})}}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n):null}},{key:"getFallbackCodes",value:function(t,n){if(!t)return[];if("function"==typeof t&&(t=t(n)),"string"==typeof t&&(t=[t]),"[object Array]"===Object.prototype.toString.apply(t))return t;if(!n)return t.default||[];var i=t[n];return i||(i=t[this.getScriptPartFromCode(n)]),i||(i=t[this.formatLanguageCode(n)]),i||(i=t[this.getLanguagePartFromCode(n)]),i||(i=t.default),i||[]}},{key:"toResolveHierarchy",value:function(t,n){var i=this,r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),o=[],a=function(t){t&&(i.isSupportedCode(t)?o.push(t):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(t)))};return"string"==typeof t&&t.indexOf("-")>-1?("languageOnly"!==this.options.load&&a(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&a(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&a(this.getLanguagePartFromCode(t))):"string"==typeof t&&a(this.formatLanguageCode(t)),r.forEach(function(t){0>o.indexOf(t)&&a(i.formatLanguageCode(t))}),o}}]),t}(),ts=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],tl={1:function(t){return Number(t>1)},2:function(t){return Number(1!=t)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(1==t?0:t>=2&&t<=4?1:2)},7:function(t){return Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(1==t?0:2==t?1:t<7?2:t<11?3:4)},11:function(t){return Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(0!==t)},14:function(t){return Number(1==t?0:2==t?1:3==t?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:0!==t?1:2)},17:function(t){return Number(+(1!=t&&(t%10!=1||t%100==11)))},18:function(t){return Number(0==t?0:1==t?1:2)},19:function(t){return Number(1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(1==t?0:0==t||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:3*(t%100==3||t%100==4))},22:function(t){return Number(1==t?0:2==t?1:(t<0||t>10)&&t%10==0?2:3)}},tc=["v1","v2","v3"],td={zero:0,one:1,two:2,few:3,many:4,other:5},tu=function(){function t(n){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};eP(this,t),this.languageUtils=n,this.options=r,this.logger=eW.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(i={},ts.forEach(function(t){t.lngs.forEach(function(n){i[n]={numbers:t.nr,plurals:tl[t.fc]}})}),i)}return eB(t,[{key:"addRule",value:function(t,n){this.rules[t]=n}},{key:"getRule",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(t,{type:n.ordinal?"ordinal":"cardinal"})}catch(t){return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.getRule(t,n);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(t,i).map(function(t){return"".concat(n).concat(t)})}},{key:"getSuffixes",value:function(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(t,i);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort(function(t,n){return td[t]-td[n]}).map(function(t){return"".concat(n.options.prepend).concat(t)}):r.numbers.map(function(r){return n.getSuffix(t,r,i)}):[]}},{key:"getSuffix",value:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(t,i);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(n)):this.getSuffixRetroCompatible(r,n):(this.logger.warn("no plural rule found for: ".concat(t)),"")}},{key:"getSuffixRetroCompatible",value:function(t,n){var i=this,r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n)),o=t.numbers[r];this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var a=function(){return i.options.prepend&&o.toString()?i.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):a():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]?a():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!tc.includes(this.options.compatibilityJSON)}}]),t}();function tm(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function th(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?tm(Object(i),!0).forEach(function(n){eH(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):tm(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var tf=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};eP(this,t),this.logger=eW.create("interpolator"),this.options=n,this.format=n.interpolation&&n.interpolation.format||function(t){return t},this.init(n)}return eB(t,[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var n=t.interpolation;this.escape=void 0!==n.escape?n.escape:e5,this.escapeValue=void 0===n.escapeValue||n.escapeValue,this.useRawValueToEscape=void 0!==n.useRawValueToEscape&&n.useRawValueToEscape,this.prefix=n.prefix?e2(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?e2(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?e2(n.nestingPrefix):n.nestingPrefixEscaped||e2("$t("),this.nestingSuffix=n.nestingSuffix?e2(n.nestingSuffix):n.nestingSuffixEscaped||e2(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=void 0!==n.alwaysFormat&&n.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=RegExp(t,"g");var n="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=RegExp(n,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=RegExp(i,"g")}},{key:"interpolate",value:function(t,n,i,r){var o,a,s,l=this,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function d(t){return t.replace(/\$/g,"$$$$")}var u=function(t){if(0>t.indexOf(l.formatSeparator)){var o=e1(n,c,t);return l.alwaysFormat?l.format(o,void 0,i,th(th(th({},r),n),{},{interpolationkey:t})):o}var a=t.split(l.formatSeparator),s=a.shift().trim(),d=a.join(l.formatSeparator).trim();return l.format(e1(n,c,s),d,i,th(th(th({},r),n),{},{interpolationkey:s}))};this.resetRegExp();var m=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,h=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(t){return d(t)}},{regex:this.regexp,safeValue:function(t){return l.escapeValue?d(l.escape(t)):d(t)}}].forEach(function(n){for(s=0;o=n.regex.exec(t);){var i=o[1].trim();if(void 0===(a=u(i)))if("function"==typeof m){var c=m(t,o,r);a="string"==typeof c?c:""}else if(r&&r.hasOwnProperty(i))a="";else if(h){a=o[0];continue}else l.logger.warn("missed to pass in variable ".concat(i," for interpolating ").concat(t)),a="";else"string"==typeof a||l.useRawValueToEscape||(a=eK(a));var d=n.safeValue(a);if(t=t.replace(o[0],d),h?(n.regex.lastIndex+=a.length,n.regex.lastIndex-=o[0].length):n.regex.lastIndex=0,++s>=l.maxReplaces)break}}),t}},{key:"nest",value:function(t,n){var i,r,o=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=th({},a);function l(t,n){var i=this.nestingOptionsSeparator;if(0>t.indexOf(i))return t;var r=t.split(new RegExp("".concat(i,"[ ]*{"))),o="{".concat(r[1]);t=r[0];var a=(o=this.interpolate(o,s)).match(/'/g),l=o.match(/"/g);(a&&a.length%2==0&&!l||l.length%2!=0)&&(o=o.replace(/'/g,'"'));try{s=JSON.parse(o),n&&(s=th(th({},n),s))}catch(n){return this.logger.warn("failed parsing options string in nesting for key ".concat(t),n),"".concat(t).concat(i).concat(o)}return delete s.defaultValue,t}for(s.applyPostProcessor=!1,delete s.defaultValue;i=this.nestingRegexp.exec(t);){var c=[],d=!1;if(-1!==i[0].indexOf(this.formatSeparator)&&!/{.*}/.test(i[1])){var u=i[1].split(this.formatSeparator).map(function(t){return t.trim()});i[1]=u.shift(),c=u,d=!0}if((r=n(l.call(this,i[1].trim(),s),s))&&i[0]===t&&"string"!=typeof r)return r;"string"!=typeof r&&(r=eK(r)),r||(this.logger.warn("missed to resolve ".concat(i[1]," for nesting ").concat(t)),r=""),d&&(r=c.reduce(function(t,n){return o.format(t,n,a.lng,th(th({},a),{},{interpolationkey:i[1].trim()}))},r.trim())),t=t.replace(i[0],r),this.regexp.lastIndex=0}return t}}]),t}();function tp(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function tb(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?tp(Object(i),!0).forEach(function(n){eH(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):tp(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}function tg(t){var n={};return function(i,r,o){var a=r+JSON.stringify(o),s=n[a];return s||(s=t(r,o),n[a]=s),s(i)}}var t_=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};eP(this,t),this.logger=eW.create("formatter"),this.options=n,this.formats={number:tg(function(t,n){var i=new Intl.NumberFormat(t,n);return function(t){return i.format(t)}}),currency:tg(function(t,n){var i=new Intl.NumberFormat(t,tb(tb({},n),{},{style:"currency"}));return function(t){return i.format(t)}}),datetime:tg(function(t,n){var i=new Intl.DateTimeFormat(t,tb({},n));return function(t){return i.format(t)}}),relativetime:tg(function(t,n){var i=new Intl.RelativeTimeFormat(t,tb({},n));return function(t){return i.format(t,n.range||"day")}}),list:tg(function(t,n){var i=new Intl.ListFormat(t,tb({},n));return function(t){return i.format(t)}})},this.init(n)}return eB(t,[{key:"init",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},i=n.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(t,n){this.formats[t.toLowerCase().trim()]=n}},{key:"addCached",value:function(t,n){this.formats[t.toLowerCase().trim()]=tg(n)}},{key:"format",value:function(t,n,i,r){var o=this;return n.split(this.formatSeparator).reduce(function(t,n){var a=function(t){var n=t.toLowerCase().trim(),i={};if(t.indexOf("(")>-1){var r=t.split("(");n=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);"currency"===n&&0>o.indexOf(":")?i.currency||(i.currency=o.trim()):"relativetime"===n&&0>o.indexOf(":")?i.range||(i.range=o.trim()):o.split(";").forEach(function(t){if(t){var n,r=function(t){if(Array.isArray(t))return t}(n=t.split(":"))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||function(t,n){if(t){if("string"==typeof t)return eV(t,void 0);var i=Object.prototype.toString.call(t).slice(8,-1);if("Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return eV(t,void 0)}}(n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=r[0],a=r.slice(1).join(":").trim().replace(/^'+|'+$/g,"");i[o.trim()]||(i[o.trim()]=a),"false"===a&&(i[o.trim()]=!1),"true"===a&&(i[o.trim()]=!0),isNaN(a)||(i[o.trim()]=parseInt(a,10))}})}return{formatName:n,formatOptions:i}}(n),s=a.formatName,l=a.formatOptions;if(o.formats[s]){var c=t;try{var d=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},u=d.locale||d.lng||r.locale||r.lng||i;c=o.formats[s](t,u,tb(tb(tb({},l),r),d))}catch(t){o.logger.warn(t)}return c}return o.logger.warn("there was no format function for ".concat(s)),t},t)}}]),t}();function ty(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function tv(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ty(Object(i),!0).forEach(function(n){eH(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ty(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var tx=function(t){eY(r,t);var n,i=(n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=eU(r);return t=n?Reflect.construct(i,arguments,eU(this).constructor):i.apply(this,arguments),ej(this,t)});function r(t,n,o){var a,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return eP(this,r),a=i.call(this),e4&&eZ.call(ez(a)),a.backend=t,a.store=n,a.services=o,a.languageUtils=o.languageUtils,a.options=s,a.logger=eW.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=s.maxParallelReads||10,a.readingCalls=0,a.maxRetries=s.maxRetries>=0?s.maxRetries:5,a.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(o,s.backend,s),a}return eB(r,[{key:"queueLoad",value:function(t,n,i,r){var o=this,a={},s={},l={},c={};return t.forEach(function(t){var r=!0;n.forEach(function(n){var l="".concat(t,"|").concat(n);!i.reload&&o.store.hasResourceBundle(t,n)?o.state[l]=2:o.state[l]<0||(1===o.state[l]?void 0===s[l]&&(s[l]=!0):(o.state[l]=1,r=!1,void 0===s[l]&&(s[l]=!0),void 0===a[l]&&(a[l]=!0),void 0===c[n]&&(c[n]=!0)))}),r||(l[t]=!0)}),(Object.keys(a).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(a),pending:Object.keys(s),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}},{key:"loaded",value:function(t,n,i){var r=t.split("|"),o=r[0],a=r[1];n&&this.emit("failedLoading",o,a,n),i&&this.store.addResourceBundle(o,a,i),this.state[t]=n?-1:2;var s={};this.queue.forEach(function(i){var r,l,c,d,u;r=i.loaded,(d=(c=eJ(r,[o],Object)).obj)[u=c.k]=d[u]||[],l||d[u].push(a),void 0!==i.pending[t]&&(delete i.pending[t],i.pendingCount--),n&&i.errors.push(n),0!==i.pendingCount||i.done||(Object.keys(i.loaded).forEach(function(t){s[t]||(s[t]={});var n=i.loaded[t];n.length&&n.forEach(function(n){void 0===s[t][n]&&(s[t][n]=!0)})}),i.done=!0,i.errors.length?i.callback(i.errors):i.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(function(t){return!t.done})}},{key:"read",value:function(t,n,i){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;return t.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:t,ns:n,fcName:i,tried:o,wait:a,callback:s}):(this.readingCalls++,this.backend[i](t,n,function(l,c){if(r.readingCalls--,r.waitingReads.length>0){var d=r.waitingReads.shift();r.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(l&&c&&o<r.maxRetries)return void setTimeout(function(){r.read.call(r,t,n,i,o+1,2*a,s)},a);s(l,c)})):s(null,{})}},{key:"prepareLoading",value:function(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof n&&(n=[n]);var a=this.queueLoad(t,n,r,o);if(!a.toLoad.length)return a.pending.length||o(),null;a.toLoad.forEach(function(t){i.loadOne(t)})}},{key:"load",value:function(t,n,i){this.prepareLoading(t,n,{},i)}},{key:"reload",value:function(t,n,i){this.prepareLoading(t,n,{reload:!0},i)}},{key:"loadOne",value:function(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=t.split("|"),o=r[0],a=r[1];this.read(o,a,"read",void 0,void 0,function(r,s){r&&n.logger.warn("".concat(i,"loading namespace ").concat(a," for language ").concat(o," failed"),r),!r&&s&&n.logger.log("".concat(i,"loaded namespace ").concat(a," for language ").concat(o),s),n.loaded(t,r,s)})}},{key:"saveMissing",value:function(t,n,i,r,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n))return void this.logger.warn('did not save key "'.concat(i,'" as the namespace "').concat(n,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");null!=i&&""!==i&&(this.backend&&this.backend.create&&this.backend.create(t,n,i,r,null,tv(tv({},a),{},{isUpdate:o})),t&&t[0]&&this.store.addResource(t[0],n,i,r))}}]),r}(eZ);function tw(t){return"string"==typeof t.ns&&(t.ns=[t.ns]),"string"==typeof t.fallbackLng&&(t.fallbackLng=[t.fallbackLng]),"string"==typeof t.fallbackNS&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&0>t.supportedLngs.indexOf("cimode")&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function tF(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function tk(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?tF(Object(i),!0).forEach(function(n){eH(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):tF(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}function tE(){}var tT=function(t){eY(r,t);var n,i=(n=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=eU(r);return t=n?Reflect.construct(i,arguments,eU(this).constructor):i.apply(this,arguments),ej(this,t)});function r(){var t,n,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if(eP(this,r),n=i.call(this),e4&&eZ.call(ez(n)),n.options=tw(o),n.services={},n.logger=eW,n.modules={external:[]},Object.getOwnPropertyNames(Object.getPrototypeOf(t=ez(n))).forEach(function(n){"function"==typeof t[n]&&(t[n]=t[n].bind(t))}),a&&!n.isInitialized&&!o.isClone){if(!n.options.initImmediate)return n.init(o,a),ej(n,ez(n));setTimeout(function(){n.init(o,a)},0)}return n}return eB(r,[{key:"init",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;"function"==typeof n&&(i=n,n={}),!n.defaultNS&&!1!==n.defaultNS&&n.ns&&("string"==typeof n.ns?n.defaultNS=n.ns:0>n.ns.indexOf("translation")&&(n.defaultNS=n.ns[0]));var r={debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if("object"===eI(t[1])&&(n=t[1]),"string"==typeof t[1]&&(n.defaultValue=t[1]),"string"==typeof t[2]&&(n.tDescription=t[2]),"object"===eI(t[2])||"object"===eI(t[3])){var i=t[3]||t[2];Object.keys(i).forEach(function(t){n[t]=i[t]})}return n},interpolation:{escapeValue:!0,format:function(t,n,i,r){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}};function o(t){return t?"function"==typeof t?new t:t:null}if(this.options=tk(tk(tk({},r),this.options),tw(n)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=tk(tk({},r.interpolation),this.options.interpolation)),void 0!==n.keySeparator&&(this.options.userDefinedKeySeparator=n.keySeparator),void 0!==n.nsSeparator&&(this.options.userDefinedNsSeparator=n.nsSeparator),!this.options.isClone){this.modules.logger?eW.init(o(this.modules.logger),this.options):eW.init(null,this.options),this.modules.formatter?a=this.modules.formatter:"undefined"!=typeof Intl&&(a=t_);var a,s=new ta(this.options);this.store=new e9(this.options.resources,this.options);var l=this.services;l.logger=eW,l.resourceStore=this.store,l.languageUtils=s,l.pluralResolver=new tu(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),a&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(l.formatter=o(a),l.formatter.init(l,this.options),this.options.interpolation.format=l.formatter.format.bind(l.formatter)),l.interpolator=new tf(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new tx(o(this.modules.backend),l.resourceStore,l,this.options),l.backendConnector.on("*",function(n){for(var i=arguments.length,r=Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];t.emit.apply(t,[n].concat(r))}),this.modules.languageDetector&&(l.languageDetector=o(this.modules.languageDetector),l.languageDetector.init(l,this.options.detection,this.options)),this.modules.i18nFormat&&(l.i18nFormat=o(this.modules.i18nFormat),l.i18nFormat.init&&l.i18nFormat.init(this)),this.translator=new tr(this.services,this.options),this.translator.on("*",function(n){for(var i=arguments.length,r=Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];t.emit.apply(t,[n].concat(r))}),this.modules.external.forEach(function(n){n.init&&n.init(t)})}if(this.format=this.options.interpolation.format,i||(i=tE),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&"dev"!==c[0]&&(this.options.lng=c[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(function(n){t[n]=function(){var i;return(i=t.store)[n].apply(i,arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(function(n){t[n]=function(){var i;return(i=t.store)[n].apply(i,arguments),t}});var d=eX(),u=function(){var n=function(n,r){t.isInitialized&&!t.initializedStoreOnce&&t.logger.warn("init: i18next is already initialized. You should call init just once!"),t.isInitialized=!0,t.options.isClone||t.logger.log("initialized",t.options),t.emit("initialized",t.options),d.resolve(r),i(n,r)};if(t.languages&&"v1"!==t.options.compatibilityAPI&&!t.isInitialized)return n(null,t.t.bind(t));t.changeLanguage(t.options.lng,n)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),d}},{key:"loadResources",value:function(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tE,r=i,o="string"==typeof t?t:this.language;if("function"==typeof t&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(o&&"cimode"===o.toLowerCase())return r();var a=[],s=function(t){t&&n.services.languageUtils.toResolveHierarchy(t).forEach(function(t){0>a.indexOf(t)&&a.push(t)})};o?s(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(function(t){return s(t)}),this.options.preload&&this.options.preload.forEach(function(t){return s(t)}),this.services.backendConnector.load(a,this.options.ns,function(t){t||n.resolvedLanguage||!n.language||n.setResolvedLanguage(n.language),r(t)})}else r(null)}},{key:"reloadResources",value:function(t,n,i){var r=eX();return t||(t=this.languages),n||(n=this.options.ns),i||(i=tE),this.services.backendConnector.reload(t,n,function(t){r.resolve(),i(t)}),r}},{key:"use",value:function(t){if(!t)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&te.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}},{key:"setResolvedLanguage",value:function(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1))for(var n=0;n<this.languages.length;n++){var i=this.languages[n];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}}},{key:"changeLanguage",value:function(t,n){var i=this;this.isLanguageChangingTo=t;var r=eX();this.emit("languageChanging",t);var o=function(t){i.language=t,i.languages=i.services.languageUtils.toResolveHierarchy(t),i.resolvedLanguage=void 0,i.setResolvedLanguage(t)},a=function(t,a){a?(o(a),i.translator.changeLanguage(a),i.isLanguageChangingTo=void 0,i.emit("languageChanged",a),i.logger.log("languageChanged",a)):i.isLanguageChangingTo=void 0,r.resolve(function(){return i.t.apply(i,arguments)}),n&&n(t,function(){return i.t.apply(i,arguments)})},s=function(n){t||n||!i.services.languageDetector||(n=[]);var r="string"==typeof n?n:i.services.languageUtils.getBestMatchFromCodes(n);r&&(i.language||o(r),i.translator.language||i.translator.changeLanguage(r),i.services.languageDetector&&i.services.languageDetector.cacheUserLanguage(r)),i.loadResources(r,function(t){a(t,r)})};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(s):s(t):s(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(t,n,i){var r=this,o=function t(n,o){if("object"!==eI(o)){for(var a,s=arguments.length,l=Array(s>2?s-2:0),c=2;c<s;c++)l[c-2]=arguments[c];a=r.options.overloadTranslationOptionHandler([n,o].concat(l))}else a=tk({},o);a.lng=a.lng||t.lng,a.lngs=a.lngs||t.lngs,a.ns=a.ns||t.ns,a.keyPrefix=a.keyPrefix||i||t.keyPrefix;var d=r.options.keySeparator||".",u=a.keyPrefix?"".concat(a.keyPrefix).concat(d).concat(n):n;return r.t(u,a)};return"string"==typeof t?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=i,o}},{key:"t",value:function(){var t;return this.translator&&(t=this.translator).translate.apply(t,arguments)}},{key:"exists",value:function(){var t;return this.translator&&(t=this.translator).exists.apply(t,arguments)}},{key:"setDefaultNamespace",value:function(t){this.options.defaultNS=t}},{key:"hasLoadedNamespace",value:function(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,a=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var s=function(t,i){var r=n.services.backendConnector.state["".concat(t,"|").concat(i)];return -1===r||2===r};if(i.precheck){var l=i.precheck(this,s);if(void 0!==l)return l}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,t)&&(!o||s(a,t)))}},{key:"loadNamespaces",value:function(t,n){var i=this,r=eX();return this.options.ns?("string"==typeof t&&(t=[t]),t.forEach(function(t){0>i.options.ns.indexOf(t)&&i.options.ns.push(t)}),this.loadResources(function(t){r.resolve(),n&&n(t)}),r):(n&&n(),Promise.resolve())}},{key:"loadLanguages",value:function(t,n){var i=eX();"string"==typeof t&&(t=[t]);var r=this.options.preload||[],o=t.filter(function(t){return 0>r.indexOf(t)});return o.length?(this.options.preload=r.concat(o),this.loadResources(function(t){i.resolve(),n&&n(t)}),i):(n&&n(),Promise.resolve())}},{key:"dir",value:function(t){return(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),t)?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr":"rtl"}},{key:"cloneInstance",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tE,o=tk(tk(tk({},this.options),n),{isClone:!0}),a=new r(o);return(void 0!==n.debug||void 0!==n.prefix)&&(a.logger=a.logger.clone(n)),["store","services","language"].forEach(function(n){a[n]=t[n]}),a.services=tk({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new tr(a.services,a.options),a.translator.on("*",function(t){for(var n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];a.emit.apply(a,[t].concat(i))}),a.init(o,i),a.translator.options=a.options,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),r}(eZ);eH(tT,"createInstance",function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new tT(t,n)});var tA=tT.createInstance();tA.createInstance=tT.createInstance,tA.createInstance,tA.init,tA.loadResources,tA.reloadResources,tA.use,tA.changeLanguage,tA.getFixedT,tA.t,tA.exists,tA.setDefaultNamespace,tA.hasLoadedNamespace,tA.loadNamespaces,tA.loadLanguages;let tM=tA;var tC=i(3348),tS=i.n(tC);!function(t){t.CREATE="CREATE",t.UPDATE="UPDATE",t.DELETE="DELETE"}(n||(n={})),function(t){t.LOW="LOW",t.MEDIUM="MEDIUM",t.HIGH="HIGH"}(o||(o={})),function(t){t.MANUAL="MANUAL",t.CLIENT="CLIENT",t.GLOBAL_RULESET="GLOBAL_RULESET",t.REALM_RULESET="REALM_RULESET",t.ASSET_RULESET="ASSET_RULESET",t.AGENT="AGENT"}(a||(a={})),function(t){t.OPEN="OPEN",t.ACKNOWLEDGED="ACKNOWLEDGED",t.IN_PROGRESS="IN_PROGRESS",t.RESOLVED="RESOLVED",t.CLOSED="CLOSED"}(s||(s={})),function(t){t.BOTTOM_LEFT="BOTTOM_LEFT",t.BOTTOM_RIGHT="BOTTOM_RIGHT",t.TOP_LEFT="TOP_LEFT",t.TOP_RIGHT="TOP_RIGHT"}(l||(l={})),function(t){t.CREATE="CREATE",t.READ="READ",t.UPDATE="UPDATE",t.DELETE="DELETE"}(c||(c={})),function(t){t.NONE="NONE",t.FORECAST="FORECAST",t.SETPOINT="SETPOINT"}(d||(d={})),function(t){t.DISCONNECTED="DISCONNECTED",t.CONNECTING="CONNECTING",t.DISCONNECTING="DISCONNECTING",t.CONNECTED="CONNECTED",t.DISABLED="DISABLED",t.WAITING="WAITING",t.ERROR="ERROR",t.STOPPED="STOPPED"}(u||(u={})),function(t){t.EV="EV",t.PHEV="PHEV"}(m||(m={})),function(t){t.YAZAKI="YAZAKI",t.MENNEKES="MENNEKES",t.LE_GRAND="LE_GRAND",t.CHADEMO="CHADEMO",t.COMBO="COMBO",t.SCHUKO="SCHUKO",t.ENERGYLOCK="ENERGYLOCK"}(h||(h={})),function(t){t.SOUTH="SOUTH",t.EAST_WEST="EAST_WEST"}(f||(f={})),function(t){t.REQUEST_START="REQUEST_START",t.REQUEST_REPEATING="REQUEST_REPEATING",t.REQUEST_CANCEL="REQUEST_CANCEL",t.READY="READY",t.COMPLETED="COMPLETED",t.RUNNING="RUNNING",t.CANCELLED="CANCELLED"}(p||(p={})),function(t){t.TOGGLE="TOGGLE",t.INCREMENT="INCREMENT",t.DECREMENT="DECREMENT",t.NEGATE="NEGATE"}(b||(b={})),function(t){t.ASSET_NOT_FOUND="ASSET_NOT_FOUND",t.ATTRIBUTE_NOT_FOUND="ATTRIBUTE_NOT_FOUND",t.INSUFFICIENT_ACCESS="INSUFFICIENT_ACCESS",t.INVALID_VALUE="INVALID_VALUE",t.INTERCEPTOR_FAILURE="INTERCEPTOR_FAILURE",t.STATE_STORAGE_FAILED="STATE_STORAGE_FAILED",t.CANNOT_PROCESS="CANNOT_PROCESS",t.QUEUE_FULL="QUEUE_FULL",t.UNKNOWN="UNKNOWN",t.ASSET_ID_MISSING="ASSET_ID_MISSING",t.ATTRIBUTE_NAME_MISSING="ATTRIBUTE_NAME_MISSING"}(g||(g={})),function(t){t.PUBLIC="PUBLIC",t.SHARED="SHARED",t.PRIVATE="PRIVATE"}(_||(_={})),function(t){t.OFF="OFF",t.ONE_MIN="ONE_MIN",t.FIVE_MIN="FIVE_MIN",t.QUARTER="QUARTER",t.ONE_HOUR="ONE_HOUR"}(y||(y={})),function(t){t.WRAP_TO_SINGLE_COLUMN="WRAP_TO_SINGLE_COLUMN",t.KEEP_LAYOUT="KEEP_LAYOUT",t.REDIRECT="REDIRECT",t.BLOCK_DEVICE="BLOCK_DEVICE"}(v||(v={})),function(t){t.MINUTE="MINUTE",t.HOUR="HOUR",t.DAY="DAY",t.WEEK="WEEK",t.MONTH="MONTH",t.YEAR="YEAR"}(x||(x={})),function(t){t.MIN="MIN",t.AVG="AVG",t.MAX="MAX",t.DIFFERENCE="DIFFERENCE",t.COUNT="COUNT",t.SUM="SUM",t.MODE="MODE",t.MEDIAN="MEDIAN"}(w||(w={})),function(t){t.TERMINATING="TERMINATING",t.DISABLED="DISABLED",t.ALREADY_CONNECTED="ALREADY_CONNECTED",t.UNRECOGNISED="UNRECOGNISED",t.PERMANENT_ERROR="PERMANENT_ERROR",t.SYNC_ERROR="SYNC_ERROR"}(F||(F={})),function(t){t.HTTPS="HTTPS",t.HTTP="HTTP",t.TCP="TCP"}(k||(k={})),function(t){t.GET="GET",t.POST="POST",t.PUT="PUT",t.DELETE="DELETE",t.OPTIONS="OPTIONS",t.PATCH="PATCH"}(E||(E={})),function(t){t.KEYCLOAK="KEYCLOAK",t.BASIC="BASIC",t.NONE="NONE"}(T||(T={})),function(t){t.WEBSOCKET="WEBSOCKET",t.POLLING="POLLING"}(A||(A={})),function(t){t.VECTOR="VECTOR",t.RASTER="RASTER"}(M||(M={})),function(t){t.INTERNAL="INTERNAL",t.CLIENT="CLIENT",t.GLOBAL_RULESET="GLOBAL_RULESET",t.REALM_RULESET="REALM_RULESET",t.ASSET_RULESET="ASSET_RULESET"}(C||(C={})),function(t){t.REALM="REALM",t.USER="USER",t.ASSET="ASSET",t.CUSTOM="CUSTOM"}(S||(S={})),function(t){t.NORMAL="NORMAL",t.HIGH="HIGH"}(D||(D={})),function(t){t.DEVICE="DEVICE",t.TOPIC="TOPIC",t.CONDITION="CONDITION"}(I||(I={})),function(t){t.ALWAYS="ALWAYS",t.ONCE="ONCE",t.HOURLY="HOURLY",t.DAILY="DAILY",t.WEEKLY="WEEKLY",t.MONTHLY="MONTHLY",t.ANNUALLY="ANNUALLY"}(P||(P={})),function(t){t.MESSAGE_INVALID="MESSAGE_INVALID",t.CERTIFICATE_INVALID="CERTIFICATE_INVALID",t.UNAUTHORIZED="UNAUTHORIZED",t.FORBIDDEN="FORBIDDEN",t.UNIQUE_ID_MISMATCH="UNIQUE_ID_MISMATCH",t.CONFIG_DISABLED="CONFIG_DISABLED",t.USER_DISABLED="USER_DISABLED",t.SERVER_ERROR="SERVER_ERROR",t.ASSET_ERROR="ASSET_ERROR",t.SERVER_BUSY="SERVER_BUSY"}(R||(R={})),function(t){t.PRIVATE="PRIVATE",t.PROTECTED="PROTECTED",t.PUBLIC="PUBLIC"}(O||(O={})),function(t){t.EXACT="EXACT",t.BEGIN="BEGIN",t.END="END",t.CONTAINS="CONTAINS"}(B||(B={})),function(t){t.EQUALS="EQUALS",t.GREATER_THAN="GREATER_THAN",t.GREATER_EQUALS="GREATER_EQUALS",t.LESS_THAN="LESS_THAN",t.LESS_EQUALS="LESS_EQUALS",t.BETWEEN="BETWEEN"}(z||(z={})),function(t){t.CREATED_ON="CREATED_ON",t.NAME="NAME",t.ASSET_TYPE="ASSET_TYPE",t.PARENT_ID="PARENT_ID",t.REALM="REALM"}(N||(N={})),function(t){t.RESTRICTED="RESTRICTED",t.LINKED="LINKED",t.REALM="REALM"}(Y||(Y={})),function(t){t.AT_LEAST_ONE="AT_LEAST_ONE",t.ALL="ALL",t.NONE="NONE"}(j||(j={})),function(t){t.AND="AND",t.OR="OR"}(U||(U={})),function(t){t.CREATED_ON="CREATED_ON",t.FIRST_NAME="FIRST_NAME",t.LAST_NAME="LAST_NAME",t.USERNAME="USERNAME",t.EMAIL="EMAIL"}(H||(H={})),function(t){t.STOPPED="STOPPED",t.RUNNING="RUNNING",t.ERROR="ERROR"}(V||(V={})),function(t){t.JAVASCRIPT="JAVASCRIPT",t.GROOVY="GROOVY",t.JSON="JSON",t.FLOW="FLOW"}(G||(G={})),function(t){t.READY="READY",t.DEPLOYED="DEPLOYED",t.COMPILATION_ERROR="COMPILATION_ERROR",t.VALIDITY_PERIOD_ERROR="VALIDITY_PERIOD_ERROR",t.EXECUTION_ERROR="EXECUTION_ERROR",t.LOOP_ERROR="LOOP_ERROR",t.DISABLED="DISABLED",t.PAUSED="PAUSED",t.EXPIRED="EXPIRED",t.REMOVED="REMOVED",t.EMPTY="EMPTY"}(q||(q={})),function(t){t.SUNRISE="SUNRISE",t.SUNSET="SUNSET",t.TWILIGHT_MORNING_VISUAL="TWILIGHT_MORNING_VISUAL",t.TWILIGHT_MORNING_VISUAL_LOWER="TWILIGHT_MORNING_VISUAL_LOWER",t.TWILIGHT_MORNING_HORIZON="TWILIGHT_MORNING_HORIZON",t.TWILIGHT_MORNING_CIVIL="TWILIGHT_MORNING_CIVIL",t.TWILIGHT_MORNING_NAUTICAL="TWILIGHT_MORNING_NAUTICAL",t.TWILIGHT_MORNING_ASTRONOMICAL="TWILIGHT_MORNING_ASTRONOMICAL",t.TWILIGHT_MORNING_GOLDEN_HOUR="TWILIGHT_MORNING_GOLDEN_HOUR",t.TWILIGHT_MORNING_BLUE_HOUR="TWILIGHT_MORNING_BLUE_HOUR",t.TWILIGHT_MORNING_NIGHT_HOUR="TWILIGHT_MORNING_NIGHT_HOUR",t.TWILIGHT_EVENING_VISUAL="TWILIGHT_EVENING_VISUAL",t.TWILIGHT_EVENING_VISUAL_LOWER="TWILIGHT_EVENING_VISUAL_LOWER",t.TWILIGHT_EVENING_HORIZON="TWILIGHT_EVENING_HORIZON",t.TWILIGHT_EVENING_CIVIL="TWILIGHT_EVENING_CIVIL",t.TWILIGHT_EVENING_NAUTICAL="TWILIGHT_EVENING_NAUTICAL",t.TWILIGHT_EVENING_ASTRONOMICAL="TWILIGHT_EVENING_ASTRONOMICAL",t.TWILIGHT_EVENING_GOLDEN_HOUR="TWILIGHT_EVENING_GOLDEN_HOUR",t.TWILIGHT_EVENING_BLUE_HOUR="TWILIGHT_EVENING_BLUE_HOUR",t.TWILIGHT_EVENING_NIGHT_HOUR="TWILIGHT_EVENING_NIGHT_HOUR"}($||($={})),function(t){t.NUMBER="NUMBER",t.NUMBER_ARRAY="NUMBER_ARRAY",t.STRING="STRING",t.BOOLEAN="BOOLEAN",t.TRIGGER="TRIGGER",t.COLOR="COLOR",t.ANY="ANY"}(W||(W={})),function(t){t.NEW_LINE="NEW_LINE",t.SPACER="SPACER"}(Z||(Z={})),function(t){t.INPUT="INPUT",t.PROCESSOR="PROCESSOR",t.OUTPUT="OUTPUT",t.THEN="THEN"}(X||(X={})),function(t){t.TEXT="TEXT",t.MULTILINE="MULTILINE",t.NUMBER="NUMBER",t.DROPDOWN="DROPDOWN",t.DOUBLE_DROPDOWN="DOUBLE_DROPDOWN",t.CHECKBOX="CHECKBOX",t.ASSET_ATTRIBUTE="ASSET_ATTRIBUTE",t.COLOR="COLOR",t.DATE="DATE"}(K||(K={})),function(t){t.ADD="ADD",t.ADD_OR_REPLACE="ADD_OR_REPLACE",t.REPLACE="REPLACE",t.DELETE="DELETE",t.CLEAR="CLEAR"}(J||(J={})),function(t){t.PER_ASSET="PER_ASSET",t.GLOBAL="GLOBAL"}(Q||(Q={})),function(t){t.READ_ADMIN="read:admin",t.READ_LOGS="read:logs",t.READ_USERS="read:users",t.READ_MAP="read:map",t.READ_ASSETS="read:assets",t.READ_RULES="read:rules",t.READ_INSIGHTS="read:insights",t.READ_ALARMS="read:alarms",t.READ_SERVICES="read:services",t.WRITE_SERVICES="write:services",t.WRITE_USER="write:user",t.WRITE_ADMIN="write:admin",t.WRITE_LOGS="write:logs",t.WRITE_ASSETS="write:assets",t.WRITE_ATTRIBUTES="write:attributes",t.WRITE_RULES="write:rules",t.WRITE_INSIGHTS="write:insights",t.WRITE_ALARMS="write:alarms",t.READ="read",t.WRITE="write"}(ee||(ee={})),function(t){t.REGISTER="REGISTER",t.UPDATE="UPDATE",t.DEREGISTER="DEREGISTER"}(et||(et={})),function(t){t.AVAILABLE="AVAILABLE",t.UNAVAILABLE="UNAVAILABLE"}(en||(en={})),function(t){t.ASSET="ASSET",t.AGENT="AGENT",t.NOTIFICATION="NOTIFICATION",t.ALARM="ALARM",t.RULES="RULES",t.PROTOCOL="PROTOCOL",t.GATEWAY="GATEWAY",t.MODEL_AND_VALUES="MODEL_AND_VALUES",t.API="API",t.DATA="DATA"}(ei||(ei={})),function(t){t.INFO="INFO",t.WARN="WARN",t.ERROR="ERROR"}(er||(er={})),function(t){t.NUMERIC="numeric",t.DIGIT_2="2-digit",t.FULL="full",t.LONG="long",t.MEDIUM="medium",t.SHORT="short",t.NARROW="narrow"}(eo||(eo={})),function(t){t.SECONDLY="SECONDLY",t.MINUTELY="MINUTELY",t.HOURLY="HOURLY",t.DAILY="DAILY",t.WEEKLY="WEEKLY",t.MONTHLY="MONTHLY",t.YEARLY="YEARLY"}(ea||(ea={})),function(t){t.OMIT="OMIT",t.BACKWARD="BACKWARD",t.FORWARD="FORWARD"}(es||(es={})),function(t){t.JAPANESE="JAPANESE",t.BUDDHIST="BUDDHIST",t.ROC="ROC",t.ISLAMIC="ISLAMIC",t.ISO8601="ISO8601",t.CHINESE="CHINESE",t.ETHIOPIC="ETHIOPIC",t.HEBREW="HEBREW",t.GREGORIAN="GREGORIAN"}(el||(el={})),function(t){t.SU="SU",t.MO="MO",t.TU="TU",t.WE="WE",t.TH="TH",t.FR="FR",t.SA="SA"}(ec||(ec={})),function(t){t.PEOPLECOUNTERASSET="PeopleCounterAsset",t.STORAGESIMULATORAGENT="StorageSimulatorAgent",t.CITYASSET="CityAsset",t.ELECTRICITYCONSUMERASSET="ElectricityConsumerAsset",t.ELECTRICVEHICLEASSET="ElectricVehicleAsset",t.CONSOLEASSET="ConsoleAsset",t.PRESENCESENSORASSET="PresenceSensorAsset",t.LIGHTASSET="LightAsset",t.THETHINGSSTACKAGENT="TheThingsStackAgent",t.PLUGASSET="PlugAsset",t.ELECTRICITYCHARGERASSET="ElectricityChargerAsset",t.ELECTRICITYBATTERYASSET="ElectricityBatteryAsset",t.ELECTRICITYSUPPLIERASSET="ElectricitySupplierAsset",t.TCPAGENT="TCPAgent",t.SERIALAGENT="SerialAgent",t.BLUETOOTHMESHAGENT="BluetoothMeshAgent",t.SNMPAGENT="SNMPAgent",t.GROUPASSET="GroupAsset",t.BUILDINGASSET="BuildingAsset",t.ELECTRICITYPRODUCERWINDASSET="ElectricityProducerWindAsset",t.ENVIRONMENTSENSORASSET="EnvironmentSensorAsset",t.MQTTAGENT="MQTTAgent",t.MICROPHONEASSET="MicrophoneAsset",t.MODBUSTCPAGENT="ModbusTcpAgent",t.HTTPAGENT="HTTPAgent",t.DOORASSET="DoorAsset",t.ELECTRICITYPRODUCERASSET="ElectricityProducerAsset",t.MAILAGENT="MailAgent",t.UDPAGENT="UDPAgent",t.ROOMASSET="RoomAsset",t.VENTILATIONASSET="VentilationAsset",t.TRADFRILIGHTASSET="TradfriLightAsset",t.KNXAGENT="KNXAgent",t.OPENWEATHERMAPAGENT="OpenWeatherMapAgent",t.CHIRPSTACKAGENT="ChirpStackAgent",t.WEATHERASSET="WeatherAsset",t.THINGASSET="ThingAsset",t.WEBSOCKETAGENT="WebsocketAgent",t.GATEWAYASSET="GatewayAsset",t.PARKINGASSET="ParkingAsset",t.TRADFRIPLUGASSET="TradfriPlugAsset",t.SIMULATORAGENT="SimulatorAgent",t.MODBUSSERIALAGENT="ModbusSerialAgent",t.ELECTRICVEHICLEFLEETGROUPASSET="ElectricVehicleFleetGroupAsset",t.VELBUSTCPAGENT="VelbusTCPAgent",t.ARTNETLIGHTASSET="ArtnetLightAsset",t.VELBUSSERIALAGENT="VelbusSerialAgent",t.GROUNDWATERSENSORASSET="GroundwaterSensorAsset",t.ELECTRICITYPRODUCERSOLARASSET="ElectricityProducerSolarAsset",t.ENERGYOPTIMISATIONASSET="EnergyOptimisationAsset",t.ZWAVEAGENT="ZWaveAgent",t.THERMOSTATASSET="ThermostatAsset",t.SHIPASSET="ShipAsset"}(ed||(ed={})),function(t){t.SUPPORTSEXPORT="supportsExport",t.MQTTPORT="MQTTPort",t.ENERGYSELFCONSUMPTION="energySelfConsumption",t.LASTACCESS="lastAccess",t.CHARGERID="chargerID",t.POSITION="position",t.CARBONSAVING="carbonSaving",t.ROUTINGMODE="routingMode",t.LASTWILLRETAIN="lastWillRetain",t.LASTWILLTOPIC="lastWillTopic",t.SERIALBAUDRATE="serialBaudrate",t.BASEURL="baseURL",t.REQUIREDVALUES="requiredValues",t.FINANCIALSAVING="financialSaving",t.FLEETCATEGORY="fleetCategory",t.GATEWAYSTATUS="gatewayStatus",t.NO2LEVEL="NO2Level",t.ATMOSPHERICPRESSURE="atmosphericPressure",t.TAGS="tags",t.UNLOCK="unlock",t.MILEAGEMIN="mileageMin",t.CHECKINTERVALSECONDS="checkIntervalSeconds",t.LOCATION="location",t.CLIENTSECRET="clientSecret",t.WINDDIRECTION="windDirection",t.WINDSPEED="windSpeed",t.PARTICLESPM10="particlesPM10",t.APPLICATIONKEY="applicationKey",t.POWEREXPORTMAX="powerExportMax",t.SETWINDACTUALVALUEWITHFORECAST="setWindActualValueWithForecast",t.WATERLEVEL="waterLevel",t.CONSOLENAME="consoleName",t.CONNECTHEADERS="connectHeaders",t.WEBSOCKETQUERY="websocketQuery",t.PREFERHTML="preferHTML",t.COOLING="cooling",t.POLLINGMILLIS="pollingMillis",t.SOILTEMPERATURE="soilTemperature",t.SUNIRRADIANCE="sunIrradiance",t.ODOMETER="odometer",t.SUPPORTSIMPORT="supportsImport",t.MESSAGEMAXLENGTH="messageMaxLength",t.WINDGUSTSPEED="windGustSpeed",t.ENERGYLEVELPERCENTAGEMIN="energyLevelPercentageMin",t.LIGHTID="lightId",t.POWER="power",t.STREET="street",t.DELETEPROCESSEDMAIL="deleteProcessedMail",t.WINDSPEEDMIN="windSpeedMin",t.POWERSETPOINT="powerSetpoint",t.PRESENCE="presence",t.SPACESOCCUPIED="spacesOccupied",t.STARTTLS="startTLS",t.AGENTSTATUS="agentStatus",t.MESSAGECHARSET="messageCharset",t.CERTIFICATEALIAS="certificateAlias",t.PANELPITCH="panelPitch",t.EMAIL="email",t.BINDPORT="bindPort",t.PARTICLESPM1="particlesPM1",t.SPEED="speed",t.ENERGYLEVELPERCENTAGEMAX="energyLevelPercentageMax",t.MESSAGESTRIPDELIMITER="messageStripDelimiter",t.AREA="area",t.COUNTRY="country",t.SHIPTYPE="shipType",t.CONNECTSUBSCRIPTIONS="connectSubscriptions",t.RELATIVEHUMIDITY="relativeHumidity",t.INCLUDEFORECASTWINDSERVICE="includeForecastWindService",t.SOURCEADDRESS="sourceAddress",t.RAINFALL="rainfall",t.ENERGYIMPORTTOTAL="energyImportTotal",t.OAUTHGRANT="oAuthGrant",t.OZONELEVEL="ozoneLevel",t.COUNTINMINUTE="countInMinute",t.PORT="port",t.TUNNELINGSUPPORTED="tunnelingSupported",t.ENINUMBER="ENINumber",t.AGENTDISABLED="agentDisabled",t.DISABLED="disabled",t.FORCECHARGE="forceCharge",t.TIMEINJECTIONINTERVAL="timeInjectionInterval",t.FINANCIALWEIGHTING="financialWeighting",t.ENERGYLEVELPERCENTAGE="energyLevelPercentage",t.SPACESBUFFER="spacesBuffer",t.VEHICLECATEGORY="vehicleCategory",t.FANSPEED="fanSpeed",t.FINANCIALCOST="financialCost",t.NOTES="notes",t.MAILFOLDERNAME="mailFolderName",t.TEMPERATURE="temperature",t.AVAILABLECHARGINGSPACES="availableChargingSpaces",t.ENERGYCAPACITY="energyCapacity",t.POWERIMPORTMIN="powerImportMin",t.INTERVALSIZE="intervalSize",t.SNMPVERSIONVALUE="SNMPVersionValue",t.SOUNDLEVEL="soundLevel",t.UNITID="unitId",t.STOPBITS="stopBits",t.CONNECTURL="connectURL",t.CLIENTID="clientId",t.VEHICLEID="vehicleID",t.SUNAZIMUTH="sunAzimuth",t.AVAILABLEDISCHARGINGSPACES="availableDischargingSpaces",t.WEBSOCKETMODE="websocketMode",t.COLOURTEMPERATURE="colourTemperature",t.VEHICLECONNECTED="vehicleConnected",t.DATABITS="dataBits",t.MILEAGEMINIMUM="mileageMinimum",t.COLOURRGB="colourRGB",t.CARBONIMPORT="carbonImport",t.WILDCARDSUBSCRIPTIONTOPICS="wildcardSubscriptionTopics",t.PRICEHOURLY="priceHourly",t.WINDSPEEDMAX="windSpeedMax",t.PINGDISABLED="pingDisabled",t.FLOW="flow",t.CHILDASSETTYPE="childAssetType",t.NETWORKKEY="networkKey",t.UNIVERSE="universe",t.MSSINUMBER="MSSINumber",t.SUBSCRIBEQOS="subscribeQos",t.LEDCOUNT="lEDCount",t.LOCKED="locked",t.CLOUDCOVERAGE="cloudCoverage",t.PROTOCOL="protocol",t.TARIFFIMPORT="tariffImport",t.ENERGYRENEWABLESHARE="energyRenewableShare",t.REGION="region",t.CONSOLEPLATFORM="consolePlatform",t.POWEREXPORTMIN="powerExportMin",t.EFFICIENCYEXPORT="efficiencyExport",t.CHARGECYCLES="chargeCycles",t.SERIALPORT="serialPort",t.APPLICATIONID="applicationId",t.PANELORIENTATION="panelOrientation",t.LENGTH="length",t.PROBABILITYOFPRECIPITATION="probabilityOfPrecipitation",t.USERNAMEPASSWORD="usernamePassword",t.POWERFORECAST="powerForecast",t.SETACTUALSOLARVALUEWITHFORECAST="setActualSolarValueWithForecast",t.REQUESTQUERYPARAMETERS="requestQueryParameters",t.PROXYADDRESS="proxyAddress",t.MQTTHOST="MQTTHost",t.ENERGYLOCAL="energyLocal",t.ENERGYAUTARKY="energyAutarky",t.MODEL="model",t.MANUFACTURER="manufacturer",t.ONOFF="onOff",t.RESUMESESSION="resumeSession",t.TARIFFEXPORT="tariffExport",t.APIKEY="ApiKey",t.CITY="city",t.CONNECTORTYPE="connectorType",t.ENERGYEXPORTTOTAL="energyExportTotal",t.CARBONEXPORT="carbonExport",t.REQUESTTIMEOUTMILLIS="requestTimeoutMillis",t.ENERGYLEVEL="energyLevel",t.OPTIMISATIONDISABLED="optimisationDisabled",t.WEBSOCKETPATH="websocketPath",t.WINDSPEEDREFERENCE="windSpeedReference",t.PRICEDAILY="priceDaily",t.COUNTGROWTHMINUTE="countGrowthMinute",t.IMONUMBER="IMONumber",t.ATTRIBUTION="Attribution",t.INCLUDEFORECASTSOLARSERVICE="includeForecastSolarService",t.REQUESTHEADERS="requestHeaders",t.TENANTID="tenantId",t.HOST="host",t.COUNTOUTMINUTE="countOutMinute",t.ENERGYTYPE="energyType",t.CONSOLEVERSION="consoleVersion",t.MTU="mtu",t.PANELAZIMUTH="panelAzimuth",t.SEQUENCENUMBER="sequenceNumber",t.SUNALTITUDE="sunAltitude",t.COUNTOUT="countOut",t.CHARGERCONNECTED="chargerConnected",t.ROOMNUMBER="roomNumber",t.PARTICLESPM2_5="particlesPM2_5",t.MESSAGESOURCEADDRESS="messageSourceAddress",t.COUNTIN="countIn",t.MILEAGECHARGED="mileageCharged",t.PROVISIONWEATHERASSET="ProvisionWeatherAsset",t.TEMPERATURESETPOINT="temperatureSetpoint",t.CONSOLEPROVIDERS="consoleProviders",t.POWERIMPORTMAX="powerImportMax",t.COUNTTOTAL="countTotal",t.SPACESTOTAL="spacesTotal",t.BINDHOST="bindHost",t.MESSAGECONVERTBINARY="messageConvertBinary",t.MESSAGEDELIMITERS="messageDelimiters",t.EFFICIENCYIMPORT="efficiencyImport",t.SUNZENITH="sunZenith",t.BRIGHTNESS="brightness",t.POSTALCODE="postalCode",t.SPACESOPEN="spacesOpen",t.HUMIDITY="humidity",t.SECUREMODE="secureMode",t.MILEAGECAPACITY="mileageCapacity",t.DIRECTION="direction",t.ENERGYLEVELSCHEDULE="energyLevelSchedule",t.UVINDEX="uVIndex",t.NATMODE="NATMode",t.UPDATEONWRITE="updateOnWrite",t.LASTWILLPAYLOAD="lastWillPayload",t.GROUPID="groupId",t.FOLLOWREDIRECTS="followRedirects",t.CARBONCOST="carbonCost",t.MESSAGECONVERTHEX="messageConvertHex",t.PUBLISHQOS="publishQos"}(eu||(eu={})),function(t){t.FORMAT="format",t.RULESTATE="ruleState",t.HASPREDICTEDDATAPOINTS="hasPredictedDataPoints",t.STOREDATAPOINTS="storeDataPoints",t.LABEL="label",t.CONSTRAINTS="constraints",t.SHOWONDASHBOARD="showOnDashboard",t.READONLY="readOnly",t.MULTILINE="multiline",t.ACCESSPUBLICWRITE="accessPublicWrite",t.MOMENTARY="momentary",t.AGENTLINK="agentLink",t.ACCESSRESTRICTEDREAD="accessRestrictedRead",t.DATAPOINTSMAXAGEDAYS="dataPointsMaxAgeDays",t.ACCESSRESTRICTEDWRITE="accessRestrictedWrite",t.SECRET="secret",t.ATTRIBUTELINKS="attributeLinks",t.RULERESETIMMEDIATE="ruleResetImmediate",t.AGENTLINKCONFIG="agentLinkConfig",t.FORECAST="forecast",t.UNITS="units",t.USERCONNECTED="userConnected",t.ACCESSPUBLICREAD="accessPublicRead"}(em||(em={})),function(t){t.WSURL="WS_URL",t.POSITIVENUMBER="positiveNumber",t.VALUEDESCRIPTOR="valueDescriptor",t.LONG="long",t.BOOLEANMAP="booleanMap",t.MQTTQOS="MQTTQos",t.GEOJSONPOINT="GEO_JSONPoint",t.SNMPVERSION="SNMPVersion",t.ASSETTYPE="assetType",t.JSONOBJECT="JSONObject",t.BIGNUMBER="bigNumber",t.IPADDRESS="IPAddress",t.EMAIL="email",t.KNXMESSAGESOURCEADDRESS="kNXMessageSourceAddress",t.ATTRIBUTEREFERENCE="attributeReference",t.INTEGER="integer",t.OAUTHGRANT="oAuthGrant",t.NUMBER="number",t.TEXTMAP="textMap",t.WEBSOCKETSUBSCRIPTION="websocketSubscription",t.BOOLEAN="boolean",t.TIMEANDPERIODDURATIONISO8601="timeAndPeriodDurationISO8601",t.TIMESTAMPISO8601="timestampISO8601",t.MULTIVALUEDTEXTMAP="multivaluedTextMap",t.JSON="JSON",t.INTEGERBYTE="integerByte",t.AGENTLINK="agentLink",t.CALENDAREVENT="calendarEvent",t.CONNECTIONSTATUS="connectionStatus",t.VALUECONSTRAINT="valueConstraint",t.ASSETQUERY="assetQuery",t.COLOURRGB="colourRGB",t.VALUEFORMAT="valueFormat",t.TEXT="text",t.BYTE="byte",t.USERNAMEANDPASSWORD="usernameAndPassword",t.HTTPURL="HTTP_URL",t.ATTRIBUTELINK="attributeLink",t.ASSETID="assetID",t.NUMBERMAP="numberMap",t.HTTPMETHOD="HTTPMethod",t.PANELORIENTATION="panelOrientation",t.ATTRIBUTESTATE="attributeState",t.POSITIVEINTEGER="positiveInteger",t.EXECUTIONSTATUS="executionStatus",t.BIGINTEGER="bigInteger",t.PERIODDURATIONISO8601="periodDurationISO8601",t.DATEANDTIME="dateAndTime",t.CONNECTORTYPE="connectorType",t.NEGATIVEINTEGER="negativeInteger",t.TCPIPPORTNUMBER="TCP_IPPortNumber",t.INTEGERMAP="integerMap",t.ENERGYTYPE="energyType",t.TIMESTAMP="timestamp",t.UUID="UUID",t.FORECASTCONFIGURATION="forecastConfiguration",t.TIMEDURATIONISO8601="timeDurationISO8601",t.CONSOLEPROVIDERS="consoleProviders",t.NEGATIVENUMBER="negativeNumber",t.CRONEXPRESSION="CRONExpression",t.DIRECTION="direction",t.HOSTORIPADDRESS="hostOrIPAddress"}(eh||(eh={})),function(t){t.MONTH="month",t.MILE_SCANDINAVIAN="mile_scandinavian",t.YEAR="year",t.VOLT="volt",t.HERTZ="hertz",t.MILE="mile",t.BTU="btu",t.FOOT="foot",t.MEGA="mega",t.INCH="inch",t.IN_HG="inch_mercury",t.CENTI="centi",t.GRAM="gram",t.KNOT="knot",t.METRE="metre",t.LITRE="litre",t.FLUID_OUNCE="fluid_ounce",t.CELSIUS="celsius",t.DECIBEL="decibel",t.FAHRENHEIT="fahrenheit",t.WATT="watt",t.PEAK="peak",t.MICRO="micro",t.PER="per",t.STONE="stone",t.VAR="var",t.OUNCE="ounce",t.HECTARE="hectare",t.YARD="yard",t.JOULE="joule",t.DEGREE="degree",t.KILO="kilo",t.KELVIN="kelvin",t.CARBON="carbon",t.DECIBEL_ATTENUATED="decibel_attenuated",t.SQUARED="squared",t.PERCENTAGE="percentage",t.CUBED="cubed",t.DAY="day",t.RADIAN="radian",t.OHM="ohm",t.MINUTE="minute",t.PART_PER_MILLION="ppm",t.AMP="amp",t.MASS_POUND="pound",t.HOUR="hour",t.ACRE="acre",t.RPM="rpm",t.PASCAL="pascal",t.LUMEN="lumen",t.WEEK="week",t.GALLON="gallon",t.LUX="lux",t.MILLI="milli",t.BAR="bar",t.HECTO="hecto",t.SECOND="second"}(ef||(ef={})),ep||(ep={});class tL{static getAssetDescriptors(){return tL._assetTypeInfos.map(t=>t.assetDescriptor)}static getMetaItemDescriptors(){return[...this._metaItemDescriptors]}static getValueDescriptors(){return[...this._valueDescriptors]}static getAssetTypeInfos(){return[...this._assetTypeInfos]}static getAssetTypeInfo(t){if(t)return t.assetDescriptor?t:("string"!=typeof t&&(t=t.name),this._assetTypeInfos.find(n=>n.assetDescriptor.name===t))}static getAssetDescriptor(t){if(!t)return;if(t.assetDescriptor)return t.assetDescriptor;if("string"!=typeof t)return t;let n=this._assetTypeInfos.find(n=>n.assetDescriptor.name===t);return n?n.assetDescriptor:void 0}static getAttributeDescriptor(t,n){if(!t)return;let i=this.getAssetTypeInfo(n||"ThingAsset");if(i&&i.attributeDescriptors)return i.attributeDescriptors.find(n=>n.name===t)}static getValueDescriptor(t){let n;if(!t)return;if(t.endsWith("[]"))for(n=0;t.endsWith("[]");)t=t.substring(0,t.length-2),n++;let i=this._valueDescriptors.find(n=>n.name===t);return i&&n&&(i=Object.assign(Object.assign({},i),{arrayDimensions:n})),i}static resolveValueDescriptor(t,n){let i;return n&&("string"==typeof n&&(i=tL.getValueDescriptor(n)),i=n.jsonType?n:tL.getValueDescriptor(n.type)),!i&&t&&(i=tL.getValueDescriptor("JSON")),i}static resolveValueTypeFromValue(t){if(null!=t){if("number"==typeof t)return"number";if("string"==typeof t)return"text";if("boolean"==typeof t)return"boolean";if(Array.isArray(t)){let n=1,i=t.find(t=>null!=t);for(;Array.isArray(i);)i=i.find(t=>null!=t),n++;let r=this.resolveValueTypeFromValue(i);if(!r)return;for(;n>0;)r+="[]",n--;return r}if(t instanceof Date)return"dateAndTime"}}static getAttributeAndValueDescriptors(t,n,i){let r,o;if(n&&"string"!=typeof n)r=n;else{let o=this.getAssetTypeInfo(t||"ThingAsset");if(!o)return[void 0,void 0];"string"==typeof n&&(r=this.getAttributeDescriptor(n,o)),!r&&i&&(r={type:i.type,name:i.name,meta:i.meta})}return r&&(o=this.getValueDescriptor(r.type)),[r,o]}static getMetaItemDescriptor(t){if(t)return this._metaItemDescriptors.find(n=>n.name===t)}static getAssetDescriptorColour(t,n){let i=this.getAssetDescriptor(t);return i&&i.colour?i.colour:n}static getAssetDescriptorIcon(t,n){let i=this.getAssetDescriptor(t);return i&&i.icon?i.icon:n}}tL._assetTypeInfos=[],tL._metaItemDescriptors=[],tL._valueDescriptors=[];var tD=i(3806),tI=i.n(tD),tP=i(2891);class tR{get resolve(){return this._resolve}get reject(){return this._reject}get promise(){return this._promise}constructor(){this._promise=new Promise((t,n)=>{this._resolve=t,this._reject=n}),Object.freeze(this)}}function tO(t,n,i=!0){if(null==t||null==n)return t===n;if(t.constructor!==n.constructor)return!1;if(t instanceof Function||t instanceof RegExp)return t===n;if(t===n||t.valueOf()===n.valueOf())return!0;if(Array.isArray(t)&&t.length!==n.length||t instanceof Date||!(t instanceof Object)||!(n instanceof Object))return!1;if(i){let i=Object.keys(t);return Object.keys(n).every(t=>-1!==i.indexOf(t))&&i.every(i=>tO(t[i],n[i]))}return!1}function tB(t){if(null==t)return"";let n=!1;return t.split(/([A-Z]|\d)/).map((t,i,r)=>{if(!t)return t;if(!n)return n=!0,t.charAt(0).toUpperCase()+t.slice(1);if("_"===t)return" ";if(1===t.length&&t===t.toUpperCase()){let n=!r[i-1]||"_"===r[i-1],o=i+1<r.length&&r[i+1]&&"_"!==r[i+1],a=i+3>r.length||!r[i+1]&&!r[i+3];(!n||o)&&(t=" "+t),!o&&(n||a)||(t=t.toLowerCase())}return t}).join("").trim()}function tz(t,n,i){let r="string"==typeof t?t:t.name;return n&&n.meta&&n.meta.hasOwnProperty(r)?n.meta[r]:i&&i.meta?i.meta[r]:void 0}function tN(t,n,i,r,o,a){let s=tY(t?t.value:void 0,()=>tU("format",t,n,i,o),void 0,a),l=tU("units",t,n,i,!0);return r&&l&&l.length&&(s=tj(tU("units",t,n,i,o),s)),s}function tY(t,n,i,r){let o="";if(null==t)o=r||"";else if("string"==typeof t)o=t;else if("number"==typeof t||"boolean"==typeof t||t instanceof Date){let r=n&&n();if(r&&0!==Object.keys(r).length)switch("number"==typeof t?r.asBoolean?t=!!t:r.asDate&&(t=new Date(t)):"boolean"==typeof t&&r.asNumber&&(t=+!!t),typeof t){case"number":o=new Intl.NumberFormat(i||tM.language,r).format(t);break;case"boolean":r.asOnOff&&(o=t?tM.t("on"):tM.t("off")),r.asOpenClosed&&(o=t?tM.t("open"):tM.t("closed")),r.asPressedReleased&&(o=t?tM.t("pressed"):tM.t("released"));break;case"object":if(r.momentJsFormat)o=tI()(t).format(r.momentJsFormat);else if(r.iso8601)o=t.toISOString();else if(r.week){var a;let n,i=((a=new Date(Date.UTC((a=t).getFullYear(),a.getMonth(),a.getDate()))).setUTCDate(a.getUTCDate()+4-(a.getUTCDay()||7)),n=new Date(Date.UTC(a.getUTCFullYear(),0,1)),Math.ceil(((a.getTime()-n.getTime())/864e5+1)/7));o="2-digit"===r.week?String(i).padStart(2,"0"):Number(i).toString(10)}else o=new Intl.DateTimeFormat(i||tM.language,r).format(t)}else o=Object(t).toString()}return o}function tj(t,n){if(!t)return"";n||(n="");let i=t.map((t,i)=>{if(3!==t.length||t.toUpperCase()!==t)return tM.t(["units."+t,"or:units."+t]);{let r=new Intl.NumberFormat(tM.language,{currency:t,style:"currency"}).formatToParts();if(0!==i||"currency"!==r[0].type)return"currency"===r[0].type?r[0].value:r[r.length-1].value;if(!n)return r[0].value;n=r[0].value+n}}).join("");return n.length>0?n+" "+i:i}function tU(t,n,i,r,o){let a,s=[],l=tH(t,n&&"string"==typeof n?n:n?n.name:i?"string"==typeof i?i:i.name:void 0,i,r,o);if(l&&(a=JSON.parse(l)))if("format"!==t)return a;else s.push(a);if(n&&n.meta&&(a=tz(t,n,i)))if("format"!==t)return a;else s.push(a);if(i&&"string"!=typeof i&&i.hasOwnProperty(t)){if(a=i[t],"format"!==t)return a;s.push(a)}if(i&&i.type){if(a=tL.getValueDescriptor(i.type)[t],"format"!==t)return a;s.push(a)}if("format"!==t||0===s.length)return a;let c={};return s.reverse().forEach(t=>{c=Object.assign(Object.assign({},c),t)}),c}function tH(t,n,i,r,o,a){let s;if(n?s="string"==typeof n?n:n.name:i&&(s="string"==typeof i?i:i.name),!s)return;let l=[],c=t+"."+(o?"attribute":"meta")+".";if(r&&l.push(c+r+"."+s),i&&"string"!=typeof i&&(l.push(c+i.type+"."+s),l.push(c+i.type)),l.push(c+s),l.length>0)return tM.t(l,{defaultValue:a||""})}function tV(t,n){let i=n.ref.name;if(t.attributes)if(n.deleted)delete t.attributes[i];else{let r=t.attributes[i];r&&(r.value=n.value,r.timestamp=n.timestamp)}return Object.assign({},t)}var tG=function(t,n,i,r){return new(i||(i=Promise))(function(o,a){function s(t){try{c(r.next(t))}catch(t){a(t)}}function l(t){try{c(r.throw(t))}catch(t){a(t)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof i?n:new i(function(t){t(n)})).then(s,l)}c((r=r.apply(t,n||[])).next())})};let tq=i(9916);class t${constructor(t,n,i){this._autoEnable=!1,this._initialised=!1,this._initialiseInProgress=!1,this._pendingProviderPromises={},this._providerMessageListeners={},this._pendingProviderEnables=[],this._registrationTimer=null,this._realm=t,this._autoEnable=n,this._enableCompleteCallback=i,window.OpenRemoteConsole=this;let r=new URLSearchParams(window.location.search),o=r.get("consoleName"),a=r.get("consoleVersion"),s=r.get("consolePlatform"),l=r.get("consoleProviders"),c=r.get("consoleAutoEnable"),d=l&&l.length>0?l.split(" "):["push"];this._pendingProviderEnables=d;let u=t$._createConsoleRegistration(),m=window.localStorage.getItem("OpenRemoteConsole:"+t);if(m)try{let t=JSON.parse(m);t.id&&(u.id=t.id),t.name&&(u.name=t.name),t.providers&&(u.providers=t.providers),t.apps&&(u.apps=t.apps)}catch(t){console.error("Failed to deserialise console registration")}let h=u.providers;for(let t of(u.providers={},d)){let n=h&&h.hasOwnProperty(t)?h[t]:{enabled:!1,disabled:!1};u.providers[t]=n}let f=rS.getAppName();f.length>0&&0>u.apps.indexOf(f)&&u.apps.push(f),this._registration=u,o&&(u.name=o),a&&(u.version=a),s&&(u.platform=s),c&&(this._autoEnable="TRUE"===c||"true"===c)}get registration(){return this._registration}get autoEnable(){return this._autoEnable}get pendingProviderEnables(){return this._pendingProviderEnables.slice(0)}get shellApple(){let t=navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform:navigator.platform;return t&&("iP"===t.substring(0,2)||"Mac"===t.substring(0,3))&&window.webkit&&window.webkit.messageHandlers}get shellAndroid(){return!!window.MobileInterface}get isMobile(){return this.shellApple||this.shellAndroid}initialise(){return tG(this,void 0,void 0,function*(){if(!this._initialised&&!this._initialiseInProgress){console.debug("Console: initialising"),this._initialiseInProgress=!0;try{if(this._registration.providers)for(let t of Object.keys(this._registration.providers))yield this._initialiseProvider(t);this._registration.id||(yield this.sendRegistration(0)),this._initialised=!0,this._initialiseInProgress=!1,0===this._pendingProviderEnables.length?(yield this.sendRegistration(),this._callCompletedCallback()):this._autoEnable&&(yield this.enableProviders())}catch(t){console.error(t)}finally{this._initialiseInProgress=!1}}})}enableProviders(){return tG(this,void 0,void 0,function*(){if(!this._initialised)throw Error("Console must be initialised before enabling providers");for(let t=this._pendingProviderEnables.length-1;t>-1;t--){let n=this._pendingProviderEnables[t];yield this.enableProvider(n)}})}enableProvider(t,n){return tG(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before enabling providers");if(!this._registration.providers.hasOwnProperty(t))throw console.debug("Invalid console provider '"+t+"'"),Error("Invalid console provider '"+t+"'");console.debug("Console: enabling provider '"+t+"'");let i={provider:t,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:n},r=yield this.sendProviderMessage(i,!0);this._registration.providers[t].hasPermission=r.hasPermission,this._registration.providers[t].success=r.success,this._registration.providers[t].enabled=r.success,this._registration.providers[t].data=r.data;let o=this._pendingProviderEnables.indexOf(t);return o>=0&&(this._pendingProviderEnables.splice(o,1),0===this._pendingProviderEnables.length&&(this.sendRegistration(),this._callCompletedCallback())),r})}disableProvider(t){return tG(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before disabling providers");if(!this._registration.providers.hasOwnProperty(t))throw console.debug("Invalid console provider '"+t+"'"),Error("Invalid console provider '"+t+"'");console.debug("Console: disabling provider '"+t+"'");let n=yield this.sendProviderMessage({provider:t,action:"PROVIDER_DISABLE"},!0);return this._registration.providers[t].disabled=!0,this._registration.providers[t].enabled=!1,n})}getProvider(t){return this._registration&&this._registration.providers?this._registration.providers[t]:void 0}sendProviderMessage(t,n){return tG(this,void 0,void 0,function*(){if("storage"!==t.provider&&!this._registration.providers.hasOwnProperty(t.provider))throw console.debug("Invalid console provider '"+t.provider+"'"),Error("Invalid console provider '"+t.provider+"'");if(!n)return void this._doSendProviderMessage(t);let i=t.provider+t.action;if(this._pendingProviderPromises[i])throw Error("Message already pending for provider '"+t.provider+"' with action '"+t.action+"'");let r=new tR,o=()=>{delete this._pendingProviderPromises[i],r.reject("No response from provider")};return this._pendingProviderPromises[i]=[r,window.setTimeout(o,5e3)],this._doSendProviderMessage(t),r.promise})}sendRegistration(t){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),console.debug("Sending registration in: "+(t=void 0!==t?t:2e3)+"ms"),new Promise((t,n)=>{this._registrationTimer=window.setTimeout(()=>{this._registrationTimer=null,console.debug("Console: updating registration");try{this._registration.name||(this._registration.name="Console"),this._registration.platform||(this._registration.platform="N/A"),this._registration.version||(this._registration.version="N/A"),this._registration.providers||(this._registration.providers={}),rS.rest.api.ConsoleResource.register(this._registration).then(n=>{if(200!==n.status)throw Error("Failed to register console");this._registration=n.data,console.debug("Console: registration successful"),console.debug("Console: updating locally stored registration"),window.localStorage.setItem("OpenRemoteConsole:"+this._realm,JSON.stringify(this._registration)),t()})}catch(t){console.error("Failed to register console"),n("Failed to register console")}})})}storeData(t,n){this.sendProviderMessage({provider:"storage",action:"STORE",key:t,value:n},!1)}retrieveData(t){return tG(this,void 0,void 0,function*(){let n=this.sendProviderMessage({provider:"storage",action:"RETRIEVE",key:t},!0);try{let t=yield Promise.race([n,new Promise((t,n)=>setTimeout(n,2e3))]);if(t&&t.value){let n=t.value;return"null"===n?void 0:n}}catch(t){console.log("Failed to retrieve data from storage provider")}})}addProviderMessageListener(t,n){this._providerMessageListeners[t.provider+t.action]=n}removeProviderMessageListener(t){delete this._providerMessageListeners[t.provider+t.action]}_postNativeShellMessage(t){try{if(this.shellAndroid)return window.MobileInterface.postMessage(JSON.stringify(t));if(this.shellApple)return window.webkit.messageHandlers.int.postMessage(t)}catch(t){console.error("Failed to send shell message towards console",t)}}_doSendGenericMessage(t,n){let i={type:t,data:n};this.isMobile?this._postNativeShellMessage(i):console.warn("Failed to send generic message to console.",i)}_doSendProviderMessage(t){if(this.isMobile)this._postNativeShellMessage({type:"provider",data:t});else{if(!t.provider||!t.action)return;switch(t.provider.trim().toUpperCase()){case"PUSH":switch(t.action.trim().toUpperCase()){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"push",version:"web",enabled:!0,disabled:!1,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"push",hasPermission:!0,success:!0}));break;default:throw Error("Unsupported provider '"+t.provider+"' and action '"+t.action+"'")}break;case"STORAGE":switch(t.action){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"storage",version:"1.0.0",disabled:!1,enabled:!0,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"storage",hasPermission:!0,success:!0}));break;case"STORE":{let n=t.key?t.key.trim():null;if(!n||0===n.length)throw Error("Storage provider 'store' action requires a `key`");null===t.value?window.localStorage.removeItem(n):window.localStorage.setItem(n,JSON.stringify(t.value))}break;case"RETRIEVE":{let n=t.key?t.key.trim():null;if(!n||0===n.length)throw Error("Storage provider 'retrieve' action requires a `key`");let i=window.localStorage.getItem(n);if(null!==i)try{i=JSON.parse(i)}catch(t){}this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:n,value:i}))}break;default:throw Error("Unsupported provider '"+t.provider+"' and action '"+t.action+"'")}break;default:console.error("Unsupported provider: "+t.provider)}}}_handleProviderResponse(t){if(!t)return;let n=JSON.parse(t),i=n.provider,r=n.action,o=this._pendingProviderPromises[i+r];o&&(window.clearTimeout(o[1]),delete this._pendingProviderPromises[i+r],o[0].resolve(n));let a=this._providerMessageListeners[i+r];a&&a(n)}_callCompletedCallback(){let t=this._enableCompleteCallback;this._enableCompleteCallback=null,t&&window.setTimeout(()=>{t()},0)}static _createConsoleRegistration(){return{name:tq.name,version:tq.version,platform:tq.os.toString(),apps:[],model:((tq.manufacturer?tq.manufacturer+" ":"")+(tq.product?tq.product:"")).trim()}}_initialiseProvider(t){return tG(this,void 0,void 0,function*(){let n;console.debug("Console: initialising provider '"+t+"'");try{n=yield this.sendProviderMessage({provider:t,action:"PROVIDER_INIT"},!0),this._registration.providers[t].version=n.version,this._registration.providers[t].requiresPermission=n.requiresPermission,this._registration.providers[t].hasPermission=n.hasPermission,this._registration.providers[t].success=n.success,this._registration.providers[t].enabled=n.enabled,this._registration.providers[t].disabled=n.disabled,this._registration.providers[t].data=n.data}catch(t){console.error(t),n={action:"",disabled:!1,enabled:!1,hasPermission:!1,provider:"",requiresPermission:!1,version:"",success:!1}}if(n.success||(console.debug("Provider initialisation failed: '"+t+"'"),n.disabled=!0,this._registration.providers[t].disabled=!0),n.disabled||n.enabled){let n=this._pendingProviderEnables.indexOf(t);n>=0&&this._pendingProviderEnables.splice(n,1)}})}}var tW=i(3653),tZ=i.n(tW);class tX{constructor(t){this.httpClient=t}startTunnel(t,n){return this.httpClient.request({method:"POST",url:nl`gateway/tunnel`,data:t,options:n})}stopTunnel(t,n){return this.httpClient.request({method:"DELETE",url:nl`gateway/tunnel`,data:t,options:n})}getAllActiveTunnelInfos(t,n){return this.httpClient.request({method:"GET",url:nl`gateway/tunnel/${t}`,options:n})}getGatewayActiveTunnelInfos(t,n,i){return this.httpClient.request({method:"GET",url:nl`gateway/tunnel/${t}/${n}`,options:i})}getActiveTunnelInfo(t,n,i,r,o){return this.httpClient.request({method:"GET",url:nl`gateway/tunnel/${t}/${n}/${i}/${r}`,options:o})}}class tK{constructor(t){this.httpClient=t}getConfig(t){return this.httpClient.request({method:"GET",url:nl`syslog/config`,options:t})}updateConfig(t,n){return this.httpClient.request({method:"PUT",url:nl`syslog/config`,data:t,options:n})}clearEvents(t){return this.httpClient.request({method:"DELETE",url:nl`syslog/event`,options:t})}getEvents(t,n){return this.httpClient.request({method:"GET",url:nl`syslog/event`,queryParams:t,options:n})}}class tJ{constructor(t){this.httpClient=t}getManagerConfig(t){return this.httpClient.request({method:"GET",url:nl`configuration/manager`,options:t})}update(t,n){return this.httpClient.request({method:"PUT",url:nl`configuration/manager`,data:t,options:n})}fileUpload(t,n,i){return this.httpClient.request({method:"POST",url:nl`configuration/manager/file`,queryParams:n,data:t,options:i})}getManagerConfigImage(t,n){return this.httpClient.request({method:"GET",url:nl`configuration/manager/image/${t}`,options:n})}}class tQ{constructor(t){this.httpClient=t}create(t,n){return this.httpClient.request({method:"POST",url:nl`asset`,data:t,options:n})}delete(t,n){return this.httpClient.request({method:"DELETE",url:nl`asset`,queryParams:t,options:n})}writeAttributeValues(t,n){return this.httpClient.request({method:"PUT",url:nl`asset/attributes`,data:t,options:n})}writeAttributeEvents(t,n){return this.httpClient.request({method:"PUT",url:nl`asset/attributes/timestamp`,data:t,options:n})}updateNoneParent(t,n){return this.httpClient.request({method:"DELETE",url:nl`asset/parent`,queryParams:t,options:n})}getPartial(t,n){return this.httpClient.request({method:"GET",url:nl`asset/partial/${t}`,options:n})}queryAssets(t,n){return this.httpClient.request({method:"POST",url:nl`asset/query`,data:t,options:n})}queryAssetTree(t,n){return this.httpClient.request({method:"POST",url:nl`asset/tree`,data:t,options:n})}getCurrentUserAssets(t){return this.httpClient.request({method:"GET",url:nl`asset/user/current`,options:t})}createUserAssetLinks(t,n){return this.httpClient.request({method:"POST",url:nl`asset/user/link`,data:t,options:n})}getUserAssetLinks(t,n){return this.httpClient.request({method:"GET",url:nl`asset/user/link`,queryParams:t,options:n})}deleteUserAssetLinks(t,n){return this.httpClient.request({method:"POST",url:nl`asset/user/link/delete`,data:t,options:n})}deleteAllUserAssetLinks(t,n,i){return this.httpClient.request({method:"DELETE",url:nl`asset/user/link/${t}/${n}`,options:i})}deleteUserAssetLink(t,n,i,r){return this.httpClient.request({method:"DELETE",url:nl`asset/user/link/${t}/${n}/${i}`,options:r})}get(t,n){return this.httpClient.request({method:"GET",url:nl`asset/${t}`,options:n})}update(t,n,i){return this.httpClient.request({method:"PUT",url:nl`asset/${t}`,data:n,options:i})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(t,n,i,r){return this.httpClient.request({method:"PUT",url:nl`asset/${t}/attribute/${n}`,data:i,options:r})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp(t,n,i,r,o){return this.httpClient.request({method:"PUT",url:nl`asset/${t}/attribute/${n}/${i}`,data:r,options:o})}updateParent(t,n,i){return this.httpClient.request({method:"PUT",url:nl`asset/${t}/child`,queryParams:n,options:i})}}class t0{constructor(t){this.httpClient=t}getDatapointExport(t,n){return this.httpClient.request({method:"GET",url:nl`asset/datapoint/export`,queryParams:t,options:n})}getDatapointPeriod(t,n){return this.httpClient.request({method:"GET",url:nl`asset/datapoint/periods`,queryParams:t,options:n})}getDatapoints(t,n,i,r){return this.httpClient.request({method:"POST",url:nl`asset/datapoint/${t}/${n}`,data:i,options:r})}}class t1{constructor(t){this.httpClient=t}getAllNodeDefinitions(t){return this.httpClient.request({method:"GET",url:nl`flow`,options:t})}getNodeDefinition(t,n){return this.httpClient.request({method:"GET",url:nl`flow/${t}`,options:n})}getAllNodeDefinitionsByType(t,n){return this.httpClient.request({method:"GET",url:nl`flow/${t}`,options:n})}}class t2{constructor(t){this.httpClient=t}createGlobalRuleset(t,n){return this.httpClient.request({method:"POST",url:nl`rules`,data:t,options:n})}getGlobalRulesets(t,n){return this.httpClient.request({method:"GET",url:nl`rules`,queryParams:t,options:n})}createAssetRuleset(t,n){return this.httpClient.request({method:"POST",url:nl`rules/asset`,data:t,options:n})}getAssetRulesets(t,n,i){return this.httpClient.request({method:"GET",url:nl`rules/asset/for/${t}`,queryParams:n,options:i})}deleteAssetRuleset(t,n){return this.httpClient.request({method:"DELETE",url:nl`rules/asset/${t}`,options:n})}getAssetRuleset(t,n){return this.httpClient.request({method:"GET",url:nl`rules/asset/${t}`,options:n})}updateAssetRuleset(t,n,i){return this.httpClient.request({method:"PUT",url:nl`rules/asset/${t}`,data:n,options:i})}getAssetGeofences(t,n){return this.httpClient.request({method:"GET",url:nl`rules/geofences/${t}`,options:n})}getAssetEngineInfo(t,n){return this.httpClient.request({method:"GET",url:nl`rules/info/asset/${t}`,options:n})}getGlobalEngineInfo(t){return this.httpClient.request({method:"GET",url:nl`rules/info/global`,options:t})}getRealmEngineInfo(t,n){return this.httpClient.request({method:"GET",url:nl`rules/info/realm/${t}`,options:n})}createRealmRuleset(t,n){return this.httpClient.request({method:"POST",url:nl`rules/realm`,data:t,options:n})}getRealmRulesets(t,n,i){return this.httpClient.request({method:"GET",url:nl`rules/realm/for/${t}`,queryParams:n,options:i})}deleteRealmRuleset(t,n){return this.httpClient.request({method:"DELETE",url:nl`rules/realm/${t}`,options:n})}getRealmRuleset(t,n){return this.httpClient.request({method:"GET",url:nl`rules/realm/${t}`,options:n})}updateRealmRuleset(t,n,i){return this.httpClient.request({method:"PUT",url:nl`rules/realm/${t}`,data:n,options:i})}deleteGlobalRuleset(t,n){return this.httpClient.request({method:"DELETE",url:nl`rules/${t}`,options:n})}getGlobalRuleset(t,n){return this.httpClient.request({method:"GET",url:nl`rules/${t}`,options:n})}updateGlobalRuleset(t,n,i){return this.httpClient.request({method:"PUT",url:nl`rules/${t}`,data:n,options:i})}}class t3{constructor(t){this.httpClient=t}updateCurrentUserLocale(t,n){return this.httpClient.request({method:"PUT",url:nl`user/locale`,data:t,options:n})}query(t,n){return this.httpClient.request({method:"POST",url:nl`user/query`,data:t,options:n})}requestPasswordResetCurrent(t){return this.httpClient.request({method:"PUT",url:nl`user/request-password-reset`,options:t})}updatePasswordCurrent(t,n){return this.httpClient.request({method:"PUT",url:nl`user/reset-password`,data:t,options:n})}updateCurrent(t,n){return this.httpClient.request({method:"PUT",url:nl`user/update`,data:t,options:n})}getCurrent(t){return this.httpClient.request({method:"GET",url:nl`user/user`,options:t})}getCurrentUserRealmRoles(t){return this.httpClient.request({method:"GET",url:nl`user/userRealmRoles`,options:t})}getCurrentUserClientRoles(t,n){return this.httpClient.request({method:"GET",url:nl`user/userRoles/${t}`,options:n})}disconnectUserSession(t,n,i){return this.httpClient.request({method:"GET",url:nl`user/${t}/disconnect/${n}`,options:i})}requestPasswordReset(t,n,i){return this.httpClient.request({method:"PUT",url:nl`user/${t}/request-password-reset/${n}`,options:i})}updatePassword(t,n,i,r){return this.httpClient.request({method:"PUT",url:nl`user/${t}/reset-password/${n}`,data:i,options:r})}resetSecret(t,n,i){return this.httpClient.request({method:"GET",url:nl`user/${t}/reset-secret/${n}`,options:i})}updateRoles(t,n,i){return this.httpClient.request({method:"PUT",url:nl`user/${t}/roles`,data:n,options:i})}getUserRealmRoles(t,n,i){return this.httpClient.request({method:"GET",url:nl`user/${t}/userRealmRoles/${n}`,options:i})}updateUserRealmRoles(t,n,i,r){return this.httpClient.request({method:"PUT",url:nl`user/${t}/userRealmRoles/${n}`,data:i,options:r})}getUserClientRoles(t,n,i,r){return this.httpClient.request({method:"GET",url:nl`user/${t}/userRoles/${n}/${i}`,options:r})}updateUserClientRoles(t,n,i,r,o){return this.httpClient.request({method:"PUT",url:nl`user/${t}/userRoles/${n}/${i}`,data:r,options:o})}getUserSessions(t,n,i){return this.httpClient.request({method:"GET",url:nl`user/${t}/userSessions/${n}`,options:i})}create(t,n,i){return this.httpClient.request({method:"POST",url:nl`user/${t}/users`,data:n,options:i})}update(t,n,i){return this.httpClient.request({method:"PUT",url:nl`user/${t}/users`,data:n,options:i})}delete(t,n,i){return this.httpClient.request({method:"DELETE",url:nl`user/${t}/users/${n}`,options:i})}getClientRoles(t,n,i){return this.httpClient.request({method:"GET",url:nl`user/${t}/${n}/roles`,options:i})}updateClientRoles(t,n,i,r){return this.httpClient.request({method:"PUT",url:nl`user/${t}/${n}/roles`,data:i,options:r})}get(t,n,i){return this.httpClient.request({method:"GET",url:nl`user/${t}/${n}`,options:i})}}class t5{constructor(t){this.httpClient=t}register(t,n){return this.httpClient.request({method:"POST",url:nl`console/register`,data:t,options:n})}}class t4{constructor(t){this.httpClient=t}create(t,n){return this.httpClient.request({method:"POST",url:nl`dashboard`,data:t,options:n})}update(t,n){return this.httpClient.request({method:"PUT",url:nl`dashboard`,data:t,options:n})}getAllRealmDashboards(t,n){return this.httpClient.request({method:"GET",url:nl`dashboard/all/${t}`,options:n})}query(t,n){return this.httpClient.request({method:"POST",url:nl`dashboard/query`,data:t,options:n})}delete(t,n,i){return this.httpClient.request({method:"DELETE",url:nl`dashboard/${t}/${n}`,options:i})}get(t,n,i){return this.httpClient.request({method:"GET",url:nl`dashboard/${t}/${n}`,options:i})}}class t6{constructor(t){this.httpClient=t}getHealthStatus(t){return this.httpClient.request({method:"GET",url:nl`health`,options:t})}getInfo(t){return this.httpClient.request({method:"GET",url:nl`info`,options:t})}}class t8{constructor(t){this.httpClient=t}create(t,n){return this.httpClient.request({method:"POST",url:nl`realm`,data:t,options:n})}getAll(t){return this.httpClient.request({method:"GET",url:nl`realm`,options:t})}getAccessible(t){return this.httpClient.request({method:"GET",url:nl`realm/accessible`,options:t})}delete(t,n){return this.httpClient.request({method:"DELETE",url:nl`realm/${t}`,options:n})}get(t,n){return this.httpClient.request({method:"GET",url:nl`realm/${t}`,options:n})}update(t,n,i){return this.httpClient.request({method:"PUT",url:nl`realm/${t}`,data:n,options:i})}}class t7{constructor(t){this.httpClient=t}deleteConnections(t,n){return this.httpClient.request({method:"DELETE",url:nl`gateway/connection`,queryParams:t,options:n})}getConnections(t){return this.httpClient.request({method:"GET",url:nl`gateway/connection`,options:t})}deleteConnection(t,n){return this.httpClient.request({method:"DELETE",url:nl`gateway/connection/${t}`,options:n})}getConnection(t,n){return this.httpClient.request({method:"GET",url:nl`gateway/connection/${t}`,options:n})}setConnection(t,n,i){return this.httpClient.request({method:"PUT",url:nl`gateway/connection/${t}`,data:n,options:i})}getConnectionStatus(t,n){return this.httpClient.request({method:"GET",url:nl`gateway/status/${t}`,options:n})}}class t9{constructor(t){this.httpClient=t}getServices(t,n){return this.httpClient.request({method:"GET",url:nl`service`,queryParams:t,options:n})}registerService(t,n){return this.httpClient.request({method:"POST",url:nl`service`,data:t,options:n})}getGlobalServices(t){return this.httpClient.request({method:"GET",url:nl`service/global`,options:t})}registerGlobalService(t,n){return this.httpClient.request({method:"POST",url:nl`service/global`,data:t,options:n})}deregisterService(t,n,i){return this.httpClient.request({method:"DELETE",url:nl`service/${t}/${n}`,options:i})}getService(t,n,i){return this.httpClient.request({method:"GET",url:nl`service/${t}/${n}`,options:i})}heartbeat(t,n,i){return this.httpClient.request({method:"PUT",url:nl`service/${t}/${n}`,options:i})}}class ne{constructor(t){this.httpClient=t}getPredictedDatapoints(t,n,i,r){return this.httpClient.request({method:"POST",url:nl`asset/predicted/${t}/${n}`,data:i,options:r})}writePredictedDatapoints(t,n,i,r){return this.httpClient.request({method:"PUT",url:nl`asset/predicted/${t}/${n}`,data:i,options:r})}}class nt{constructor(t){this.httpClient=t}createProvisioningConfig(t,n){return this.httpClient.request({method:"POST",url:nl`provisioning`,data:t,options:n})}getProvisioningConfigs(t){return this.httpClient.request({method:"GET",url:nl`provisioning`,options:t})}deleteProvisioningConfig(t,n){return this.httpClient.request({method:"DELETE",url:nl`provisioning/${t}`,options:n})}updateProvisioningConfig(t,n,i){return this.httpClient.request({method:"PUT",url:nl`provisioning/${t}`,data:n,options:i})}}class nn{constructor(t){this.httpClient=t}getApps(t){return this.httpClient.request({method:"GET",url:nl`apps`,options:t})}getConsoleConfig(t){return this.httpClient.request({method:"GET",url:nl`apps/consoleConfig`,options:t})}getAppInfos(t){return this.httpClient.request({method:"GET",url:nl`apps/info`,options:t})}}class ni{constructor(t){this.httpClient=t}doProtocolAssetDiscovery(t,n,i){return this.httpClient.request({method:"GET",url:nl`agent/assetDiscovery/${t}`,queryParams:n,options:i})}doProtocolAssetImport(t,n,i,r){return this.httpClient.request({method:"POST",url:nl`agent/assetImport/${t}`,queryParams:i,data:n,options:r})}doProtocolInstanceDiscovery(t,n,i){return this.httpClient.request({method:"GET",url:nl`agent/instanceDiscovery/${t}`,queryParams:n,options:i})}}class nr{constructor(t){this.httpClient=t}getSettings(t){return this.httpClient.request({method:"GET",url:nl`map`,options:t})}saveSettings(t,n){return this.httpClient.request({method:"PUT",url:nl`map`,data:t,options:n})}deleteMap(t){return this.httpClient.request({method:"DELETE",url:nl`map/deleteMap`,options:t})}getCustomMapInfo(t){return this.httpClient.request({method:"GET",url:nl`map/getCustomMapInfo`,options:t})}getSettingsJs(t){return this.httpClient.request({method:"GET",url:nl`map/js`,options:t})}getTile(t,n,i,r){return this.httpClient.request({method:"GET",url:nl`map/tile/${t}/${n}/${i}`,options:r})}uploadMap(t,n){return this.httpClient.request({method:"POST",url:nl`map/upload`,queryParams:t,options:n})}}class no{constructor(t){this.httpClient=t}getAssetDescriptors(t,n){return this.httpClient.request({method:"GET",url:nl`model/assetDescriptors`,queryParams:t,options:n})}getAssetInfo(t,n,i){return this.httpClient.request({method:"GET",url:nl`model/assetInfo/${t}`,queryParams:n,options:i})}getAssetInfos(t,n){return this.httpClient.request({method:"GET",url:nl`model/assetInfos`,queryParams:t,options:n})}getValueDescriptorSchema(t,n){return this.httpClient.request({method:"GET",url:nl`model/getValueDescriptorSchema`,queryParams:t,options:n})}getMetaItemDescriptors(t,n){return this.httpClient.request({method:"GET",url:nl`model/metaItemDescriptors`,queryParams:t,options:n})}getValueDescriptors(t,n){return this.httpClient.request({method:"GET",url:nl`model/valueDescriptors`,queryParams:t,options:n})}}class na{constructor(t){this.httpClient=t}getNotifications(t,n){return this.httpClient.request({method:"GET",url:nl`notification`,queryParams:t,options:n})}removeNotifications(t,n){return this.httpClient.request({method:"DELETE",url:nl`notification`,queryParams:t,options:n})}sendNotification(t,n){return this.httpClient.request({method:"POST",url:nl`notification/alert`,data:t,options:n})}removeNotification(t,n){return this.httpClient.request({method:"DELETE",url:nl`notification/${t}`,options:n})}notificationAcknowledged(t,n,i,r){return this.httpClient.request({method:"PUT",url:nl`notification/${t}/acknowledged`,queryParams:i,data:n,options:r})}notificationDelivered(t,n,i){return this.httpClient.request({method:"PUT",url:nl`notification/${t}/delivered`,queryParams:n,options:i})}}class ns{constructor(t){this.httpClient=t}createAlarm(t,n,i){return this.httpClient.request({method:"POST",url:nl`alarm`,queryParams:n,data:t,options:i})}getAlarms(t,n){return this.httpClient.request({method:"GET",url:nl`alarm`,queryParams:t,options:n})}removeAlarms(t,n){return this.httpClient.request({method:"DELETE",url:nl`alarm`,data:t,options:n})}setAssetLinks(t,n){return this.httpClient.request({method:"PUT",url:nl`alarm/assets`,data:t,options:n})}getAlarm(t,n){return this.httpClient.request({method:"GET",url:nl`alarm/${t}`,options:n})}removeAlarm(t,n){return this.httpClient.request({method:"DELETE",url:nl`alarm/${t}`,options:n})}updateAlarm(t,n,i){return this.httpClient.request({method:"PUT",url:nl`alarm/${t}`,data:n,options:i})}getAssetLinks(t,n,i){return this.httpClient.request({method:"GET",url:nl`alarm/${t}/assets`,queryParams:n,options:i})}}function nl(t,...n){let i="";for(let r=0;r<n.length;r++)i+=t[r],i+=encodeURIComponent(n[r]);return i+t[t.length-1]}class nc{constructor(t,n=tZ().create()){this._gatewayServiceResource=new nu(t,n),this._syslogResource=new nm(t,n),this._configurationResource=new nh(t,n),this._assetResource=new nf(t,n),this._assetDatapointResource=new np(t,n),this._flowResource=new nb(t,n),this._rulesResource=new ng(t,n),this._userResource=new n_(t,n),this._consoleResource=new ny(t,n),this._dashboardResource=new nv(t,n),this._statusResource=new nx(t,n),this._realmResource=new nw(t,n),this._gatewayClientResource=new nF(t,n),this._externalServiceResource=new nk(t,n),this._assetPredictedDatapointResource=new nE(t,n),this._provisioningResource=new nT(t,n),this._appResource=new nA(t,n),this._agentResource=new nM(t,n),this._mapResource=new nC(t,n),this._assetModelResource=new nS(t,n),this._notificationResource=new nL(t,n),this._alarmResource=new nD(t,n),this._assetResource=new nf(t,n)}get GatewayServiceResource(){return this._gatewayServiceResource}get SyslogResource(){return this._syslogResource}get ConfigurationResource(){return this._configurationResource}get AssetResource(){return this._assetResource}get AssetDatapointResource(){return this._assetDatapointResource}get FlowResource(){return this._flowResource}get RulesResource(){return this._rulesResource}get UserResource(){return this._userResource}get ConsoleResource(){return this._consoleResource}get DashboardResource(){return this._dashboardResource}get StatusResource(){return this._statusResource}get RealmResource(){return this._realmResource}get GatewayClientResource(){return this._gatewayClientResource}get ExternalServiceResource(){return this._externalServiceResource}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get ProvisioningResource(){return this._provisioningResource}get AppResource(){return this._appResource}get AgentResource(){return this._agentResource}get MapResource(){return this._mapResource}get AssetModelResource(){return this._assetModelResource}get NotificationResource(){return this._notificationResource}get AlarmResource(){return this._alarmResource}}class nd{constructor(t){this.axios=t}request(t){let n={};n.method=t.method,n.url=t.url,n.params=t.queryParams,n.data=t.data,function(t,n){if(void 0!=n)for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i])}(n,t.options);let i=t.copyFn;return this.axios.request(n).then(t=>(i&&t.data&&(t.originalData=t.data,t.data=i(t.data)),t))}}class nu extends tX{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nm extends tK{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nh extends tJ{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nf extends tQ{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class np extends t0{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nb extends t1{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class ng extends t2{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class n_ extends t3{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class ny extends t5{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nv extends t4{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nx extends t6{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nw extends t8{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nF extends t7{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nk extends t9{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nE extends ne{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nT extends nt{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nA extends nn{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nM extends ni{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nC extends nr{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nS extends no{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nL extends na{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}class nD extends ns{constructor(t,n=tZ().create()){n.defaults.baseURL=t,super(new nd(n))}}tZ().isAxiosError;let nI=new class{get api(){return this._client}constructor(){this._axiosInstance=tZ().create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(t=>(t.paramsSerializer=t=>tS().stringify(t,{arrayFormat:"repeat"}),t))}get axiosInstance(){return this._axiosInstance}get baseUrl(){return this._baseUrl}setTimeout(t){this._axiosInstance.defaults.timeout=t}addRequestInterceptor(t){this._axiosInstance.interceptors.request.use(t)}initialise(t){this._baseUrl=t,this._client=new nc(t,this._axiosInstance)}};var nP=function(t,n,i,r){return new(i||(i=Promise))(function(o,a){function s(t){try{c(r.next(t))}catch(t){a(t)}}function l(t){try{c(r.throw(t))}catch(t){a(t)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof i?n:new i(function(t){t(n)})).then(s,l)}c((r=r.apply(t,n||[])).next())})};!function(t){t.DISCONNECTED="DISCONNECTED",t.CONNECTED="CONNECTED",t.CONNECTING="CONNECTING"}(eb||(eb={}));let nR="SUBSCRIBED:",nO="UNAUTHORIZED:",nB="TRIGGERED:",nz="EVENT:";class nN{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=nY.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=eb.DISCONNECTED,this._connectingDeferred=null,this._statusCallbacks=[],this._pendingSubscription=null,this._queuedSubscriptions=[],this._subscriptionMap=new Map,this._assetEventCallbackMap=new Map,this._attributeEventCallbackMap=new Map,this._unloading=!1}get status(){return this._status}subscribeStatusChange(t){this._statusCallbacks.push(t)}unsubscribeStatusChange(t){!function(t,n){if(0===t.length)return;let i=t.indexOf(n);i>=0&&t.splice(i,1)}(this._statusCallbacks,t)}connect(){return(this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this._status===eb.CONNECTED)?Promise.resolve(!0):(this._disconnectRequested=!1,this._connectingDeferred||(this._onStatusChanged(eb.CONNECTING),this._connectingDeferred=new tR,this._doConnect().then(t=>{if(this._connectingDeferred){let n=this._connectingDeferred;this._connectingDeferred=null,t?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=nY.MIN_RECONNECT_DELAY,this._onStatusChanged(eb.CONNECTED),window.setTimeout(()=>{this._onConnect()},0)):(console.debug("Failed to connect to event service: "+this.endpointUrl),this._scheduleReconnect()),n.resolve(t)}})),this._connectingDeferred.promise)}disconnect(){console.debug("Disconnecting from event service: "+this.endpointUrl),this._disconnectRequested||(this._disconnectRequested=!0,this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this.status!==eb.DISCONNECTED&&this._doDisconnect())}subscribe(t,n){let i={eventSubscription:t,callback:n,deferred:new tR};return null!=this._pendingSubscription||this._status!==eb.CONNECTED?(this._queuedSubscriptions.push(i),i.deferred.promise):(this._pendingSubscription=i,this._doSubscribe(t).then(t=>{if(this._pendingSubscription){let n=this._pendingSubscription;this._pendingSubscription=null,this._subscriptionMap.set(t,n),this._processNextSubscription();let i=n.deferred;n.deferred=null,i&&i.resolve(t)}},t=>{if(this._pendingSubscription){let n=this._pendingSubscription;this._pendingSubscription=null,this._processNextSubscription();let i=n.deferred;n.deferred=null,i&&i.reject(t)}}),this._pendingSubscription.deferred.promise)}unsubscribe(t){return nP(this,void 0,void 0,function*(){if(this._subscriptionMap.delete(t))return void this._doUnsubscribe(t);if(this._assetEventCallbackMap.delete(t)){if(this._assetEventPromise&&0===this._assetEventCallbackMap.size){let t=yield this._assetEventPromise;this._assetEventPromise=void 0,this.unsubscribe(t)}return}if(this._attributeEventCallbackMap.delete(t)){if(this._attributeEventPromise&&0===this._attributeEventCallbackMap.size){let t=yield this._attributeEventPromise;this._attributeEventPromise=void 0,this.unsubscribe(t)}return}})}sendEvent(t){this._status===eb.CONNECTED&&this._doSend(t)}sendEventWithReply(t){return this._status!==eb.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(t)}subscribeAssetEvents(t,n,i){return nP(this,void 0,void 0,function*(){let r=t&&"string"!=typeof t[0]?t.map(t=>t.id):t,o="AssetEvent"+nN._subscriptionCounter++;if(!this._assetEventPromise){let t;rS.authenticated||(t={filterType:"asset",realm:rS.displayRealm});let n={eventType:"asset",filter:t};this._assetEventPromise=this.subscribe(n,t=>{this._assetEventCallbackMap.forEach(n=>n(t))})}return this._assetEventCallbackMap.set(o,t=>{let n=t.asset.id;r?r.find(t=>n===t)&&i(t):t.asset.realm===rS.displayRealm&&i(t)}),this._assetEventPromise.then(()=>{try{if(r&&n){let t={messageID:"read-assets:"+r.join(",")+":"+o,eventType:"read-assets",assetQuery:{ids:r}};this.sendEventWithReply(t).then(t=>{t.assets&&this._assetEventCallbackMap.has(o)&&t.assets.forEach(t=>{i({eventType:"asset",asset:t,cause:"READ"})})})}}catch(n){throw console.error("Failed to subscribe to asset events for assets: "+t),o&&this.unsubscribe(o),n}return o})})}subscribeAttributeEvents(t,n,i){return nP(this,void 0,void 0,function*(){let r=t&&"string"!=typeof t[0],o=r?t.map(t=>t.id):t,a=r?t:void 0,s="AttributeEvent"+nN._subscriptionCounter++;if(!this._attributeEventPromise){let t;rS.authenticated||(t={filterType:"asset",realm:rS.displayRealm});let n={eventType:"attribute",filter:t};this._attributeEventPromise=this.subscribe(n,t=>{this._attributeEventCallbackMap.forEach(n=>n(t))})}let l=n=>{let a=n.ref;r?t.forEach(t=>{a.id===t.id&&a.name===t.name&&i(n)}):o?o.find(t=>a.id===t)&&i(n):n.realm===rS.displayRealm&&i(n)};return this._attributeEventCallbackMap.set(s,l),this._attributeEventPromise.then(()=>{try{if(n&&o){let t={messageID:"read-assets:"+o.join(",")+":"+s,eventType:"read-assets",assetQuery:{ids:o}};this.sendEventWithReply(t).then(t=>{t.assets&&this._attributeEventCallbackMap.has(s)&&t.assets.forEach(t=>{t.attributes&&Object.entries(t.attributes).forEach(([n,i])=>{(!a||a.find(i=>i.id===t.id&&i.name===n))&&l({eventType:"attribute",timestamp:i.timestamp,value:i.value,ref:{id:t.id,name:n}})})})})}}catch(n){throw console.error("Failed to subscribe to asset events for assets: "+t),s&&this.unsubscribe(s),n}return s})})}_processNextSubscription(){this._status===eb.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout(()=>{let t=this._queuedSubscriptions.shift();t&&this.subscribe(t.eventSubscription,t.callback).then(n=>{let i=t.deferred;t.deferred=null,i&&i.resolve(n)},n=>{let i=t.deferred;t.deferred=null,i&&i.reject(n)})},0)}_onStatusChanged(t){t!==this._status&&(console.debug("Event provider status changed: "+t),this._status=t,this._unloading||window.setTimeout(()=>{this._statusCallbacks.forEach(n=>n(t))},0))}_onMessageReceived(t,n){let i=this._subscriptionMap.get(t);i&&i.callback(n)}_onConnect(){if(Object.keys(this._subscriptionMap).length>0){for(let t in this._subscriptionMap)this._subscriptionMap.has(t)&&this._queuedSubscriptions.unshift(this._subscriptionMap.get(t));this._subscriptionMap.clear()}this._processNextSubscription()}_onDisconnect(){this._status===eb.CONNECTED&&this._onStatusChanged(eb.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(eb.CONNECTING),this._scheduleReconnect()}_scheduleReconnect(){this._reconnectTimer||!this._disconnectRequested&&(console.debug("Event provider scheduling reconnect in "+this._reconnectDelayMillis+"ms"),this._reconnectTimer=window.setTimeout(()=>{this._disconnectRequested||this.connect()},this._reconnectDelayMillis),this._reconnectDelayMillis<nY.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(nY.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}nN.MIN_RECONNECT_DELAY=0,nN.MAX_RECONNECT_DELAY=3e4,nN._subscriptionCounter=0;class nY extends nN{get endpointUrl(){return this._endpointUrl}constructor(t){super(),this._webSocket=void 0,this._connectDeferred=null,this._subscribeDeferred=null,this._repliesDeferred=new Map,this._endpointUrl=(t.startsWith("https:")?"wss":"ws")+"://"+t.substr(t.indexOf("://")+3)+"/websocket/events",window.addEventListener("beforeunload",()=>{this._unloading=!0,this.disconnect()})}_doConnect(){let t=this._endpointUrl+"?Realm="+rS.config.realm;return rS.authenticated&&(t+="&Authorization="+rS.getAuthorizationHeader()),this._webSocket=new WebSocket(t),this._connectDeferred=new tR,this._webSocket.onopen=()=>{if(this._connectDeferred){let t=this._connectDeferred;this._connectDeferred=null,t.resolve(!0)}},this._webSocket.onerror=t=>{if(this._connectDeferred){let t=this._connectDeferred;this._connectDeferred=null,t.resolve(!1)}else console.debug("Event provider error"),this._beforeDisconnect()},this._webSocket.onclose=()=>{if(this._webSocket=void 0,this._connectDeferred){let t=this._connectDeferred;this._connectDeferred=null,t.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onmessage=t=>{let n=t.data;if(n&&n.startsWith(nR)){let t=JSON.parse(n.substring(nR.length)),i=this._subscribeDeferred;this._subscribeDeferred=null,i&&i.resolve(t.subscriptionId)}else if(n.startsWith(nO)){let t=JSON.parse(n.substring(nO.length)),i=this._subscribeDeferred;this._subscribeDeferred=null,i&&(console.warn("Unauthorized event subscription: "+JSON.stringify(t,null,2)),i.reject("Unauthorized"))}else if(n.startsWith(nB)){let t=JSON.parse(n.substring(nB.length));t.events&&t.events.forEach(n=>{this._onMessageReceived(t.subscriptionId,n)})}else if(n.startsWith(nz)){let t=JSON.parse(n.substring(nz.length));if(t.messageID){let n=this._repliesDeferred.get(t.messageID);this._repliesDeferred.delete(t.messageID),n&&n.resolve(t)}}},this._connectDeferred.promise}_beforeDisconnect(){this._onDisconnect()}_doDisconnect(){var t;null==(t=this._webSocket)||t.close(),this._subscribeDeferred=null,this._repliesDeferred.clear()}_doSubscribe(t){return this._webSocket?this._subscribeDeferred?Promise.reject("There's already a pending subscription"):(this._subscribeDeferred=new tR,t.subscriptionId||(t.subscriptionId=nY._subscriptionCounter+++""),this._webSocket.send("SUBSCRIBE:"+JSON.stringify(t)),this._subscribeDeferred.promise):Promise.reject("Not connected")}_doUnsubscribe(t){this._webSocket&&this._webSocket.send("UNSUBSCRIBE:"+JSON.stringify({subscriptionId:t}))}_doSend(t){let n=nz+JSON.stringify(t);this._webSocket.send(n)}_doSendWithReply(t){if(t.messageID||(t.messageID=(new Date().getTime()+10*Math.random()).toString(10)),this._repliesDeferred.has(t.messageID))return Promise.reject("There's already a pending send and reply with this ID");let n=new tR;return this._repliesDeferred.set(t.messageID,n),this._webSocket.send(nz+JSON.stringify(t)),n.promise}}function nj(t){return(nj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}nY._subscriptionCounter=1;var nU=[],nH=nU.forEach,nV=nU.slice;function nG(t){return nH.call(nV.call(arguments,1),function(n){if(n)for(var i in n)void 0===t[i]&&(t[i]=n[i])}),t}function nq(){return"function"==typeof XMLHttpRequest||("undefined"==typeof XMLHttpRequest?"undefined":nj(XMLHttpRequest))==="object"}var n$=i(6850),nW=i.t(n$,2);function nZ(t){return(nZ="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}"function"==typeof fetch&&(eg="undefined"!=typeof global&&global.fetch?global.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),nq()&&("undefined"!=typeof global&&global.XMLHttpRequest?e_=global.XMLHttpRequest:"undefined"!=typeof window&&window.XMLHttpRequest&&(e_=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&("undefined"!=typeof global&&global.ActiveXObject?ey=global.ActiveXObject:"undefined"!=typeof window&&window.ActiveXObject&&(ey=window.ActiveXObject)),eg||!nW||e_||ey||(eg=n$||nW),"function"!=typeof eg&&(eg=void 0);var nX=function(t,n){if(n&&"object"===nZ(n)){var i="";for(var r in n)i+="&"+encodeURIComponent(r)+"="+encodeURIComponent(n[r]);if(!i)return t;t=t+(-1!==t.indexOf("?")?"&":"?")+i.slice(1)}return t},nK=function(t,n,i){eg(t,n).then(function(t){if(!t.ok)return i(t.statusText||"Error",{status:t.status});t.text().then(function(n){i(null,{status:t.status,data:n})}).catch(i)}).catch(i)},nJ=!1,nQ=function(t,n,i,r){t.queryStringParams&&(n=nX(n,t.queryStringParams));var o=nG({},"function"==typeof t.customHeaders?t.customHeaders():t.customHeaders);i&&(o["Content-Type"]="application/json");var a="function"==typeof t.requestOptions?t.requestOptions(i):t.requestOptions,s=nG({method:i?"POST":"GET",body:i?t.stringify(i):void 0,headers:o},nJ?{}:a);try{nK(n,s,r)}catch(t){if(!a||0===Object.keys(a).length||!t.message||0>t.message.indexOf("not implemented"))return r(t);try{Object.keys(a).forEach(function(t){delete s[t]}),nK(n,s,r),nJ=!0}catch(t){r(t)}}},n0=function(t,n,i,r){i&&"object"===nZ(i)&&(i=nX("",i).slice(1)),t.queryStringParams&&(n=nX(n,t.queryStringParams));try{(o=e_?new e_:new ey("MSXML2.XMLHTTP.3.0")).open(i?"POST":"GET",n,1),t.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!t.withCredentials,i&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var o,a=t.customHeaders;if(a="function"==typeof a?a():a)for(var s in a)o.setRequestHeader(s,a[s]);o.onreadystatechange=function(){o.readyState>3&&r(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(i)}catch(t){console&&console.log(t)}};let n1=function(t,n,i,r){return("function"==typeof i&&(r=i,i=void 0),r=r||function(){},eg)?nQ(t,n,i,r):nq()||"function"==typeof ActiveXObject?n0(t,n,i,r):void r(Error("No fetch and no xhr implementation found!"))};var n2=function(){var t;function n(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!(this instanceof n))throw TypeError("Cannot call a class as a function");this.services=t,this.options=i,this.allOptions=r,this.type="backend",this.init(t,i,r)}return t=[{key:"init",value:function(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=t,this.options=nG(i,this.options||{},{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",allowMultiLoading:!1,parse:function(t){return JSON.parse(t)},stringify:JSON.stringify,parsePayload:function(t,n,i){var r,o;return r={},o=i||"",n in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,r},request:n1,reloadInterval:"undefined"==typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}),this.allOptions=r,this.services&&this.options.reloadInterval&&setInterval(function(){return n.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(t,n,i){this._readAny(t,t,n,n,i)}},{key:"read",value:function(t,n,i){this._readAny([t],t,[n],n,i)}},{key:"_readAny",value:function(t,n,i,r,o){var a,s,l=this,c=this.options.loadPath;"function"==typeof this.options.loadPath&&(c=this.options.loadPath(t,i)),(c=(s=a=c)&&"function"==typeof s.then?a:Promise.resolve(a)).then(function(a){if(!a)return o(null,{});var s=l.services.interpolator.interpolate(a,{lng:t.join("+"),ns:i.join("+")});l.loadUrl(s,o,n,r)})}},{key:"loadUrl",value:function(t,n,i,r){var o=this;this.options.request(this.options,t,void 0,function(a,s){var l,c;if(s&&(s.status>=500&&s.status<600||!s.status))return n("failed loading "+t+"; status code: "+s.status,!0);if(s&&s.status>=400&&s.status<500)return n("failed loading "+t+"; status code: "+s.status,!1);if(!s&&a&&a.message&&a.message.indexOf("Failed to fetch")>-1)return n("failed loading "+t+": "+a.message,!0);if(a)return n(a,!1);try{l="string"==typeof s.data?o.options.parse(s.data,i,r):s.data}catch(n){c="failed parsing "+t+" to json"}if(c)return n(c,!1);n(null,l)})}},{key:"create",value:function(t,n,i,r,o){var a=this;if(this.options.addPath){"string"==typeof t&&(t=[t]);var s=this.options.parsePayload(n,i,r),l=0,c=[],d=[];t.forEach(function(i){var r=a.options.addPath;"function"==typeof a.options.addPath&&(r=a.options.addPath(i,n));var u=a.services.interpolator.interpolate(r,{lng:i,ns:n});a.options.request(a.options,u,s,function(n,i){l+=1,c.push(n),d.push(i),l===t.length&&o&&o(c,d)})})}}},{key:"reload",value:function(){var t=this,n=this.services,i=n.backendConnector,r=n.languageUtils,o=n.logger,a=i.language;if(!a||"cimode"!==a.toLowerCase()){var s=[],l=function(t){r.toResolveHierarchy(t).forEach(function(t){0>s.indexOf(t)&&s.push(t)})};l(a),this.allOptions.preload&&this.allOptions.preload.forEach(function(t){return l(t)}),s.forEach(function(n){t.allOptions.ns.forEach(function(t){i.read(n,t,"read",null,null,function(r,a){r&&o.warn("loading namespace ".concat(t," for language ").concat(n," failed"),r),!r&&a&&o.log("loaded namespace ".concat(t," for language ").concat(n),a),i.loaded("".concat(n,"|").concat(t),r,a)})})})}}}],function(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}(n.prototype,t),Object.defineProperty(n,"prototype",{writable:!1}),n}();n2.type="backend";let n3=globalThis,n5=n3.ShadowRoot&&(void 0===n3.ShadyCSS||n3.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n4=Symbol(),n6=new WeakMap;class n8{constructor(t,n,i){if(this._$cssResult$=!0,i!==n4)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n}get styleSheet(){let t=this.o,n=this.t;if(n5&&void 0===t){let i=void 0!==n&&1===n.length;i&&(t=n6.get(n)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&n6.set(n,t))}return t}toString(){return this.cssText}}let n7=t=>new n8("string"==typeof t?t:t+"",void 0,n4),n9=(t,...n)=>new n8(1===t.length?t[0]:n.reduce((n,i,r)=>n+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[r+1],t[0]),t,n4),ie=n5?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let n="";for(let i of t.cssRules)n+=i.cssText;return n7(n)})(t):t,{is:it,defineProperty:ii,getOwnPropertyDescriptor:ir,getOwnPropertyNames:io,getOwnPropertySymbols:ia,getPrototypeOf:is}=Object,il=globalThis,ic=il.trustedTypes,id=ic?ic.emptyScript:"",iu=il.reactiveElementPolyfillSupport,im={toAttribute(t,n){switch(n){case Boolean:t=t?id:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,n){let i=t;switch(n){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},ih=(t,n)=>!it(t,n),ip={attribute:!0,type:String,converter:im,reflect:!1,useDefault:!1,hasChanged:ih};Symbol.metadata??=Symbol("metadata"),il.litPropertyMetadata??=new WeakMap;class ib extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,n=ip){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(t,n),!n.noAccessor){let i=Symbol(),r=this.getPropertyDescriptor(t,i,n);void 0!==r&&ii(this.prototype,t,r)}}static getPropertyDescriptor(t,n,i){let{get:r,set:o}=ir(this.prototype,t)??{get(){return this[n]},set(t){this[n]=t}};return{get:r,set(n){let a=r?.call(this);o?.call(this,n),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??ip}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;let t=is(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){let t=this.properties;for(let n of[...io(t),...ia(t)])this.createProperty(n,t[n])}let t=this[Symbol.metadata];if(null!==t){let n=litPropertyMetadata.get(t);if(void 0!==n)for(let[t,i]of n)this.elementProperties.set(t,i)}for(let[t,n]of(this._$Eh=new Map,this.elementProperties)){let i=this._$Eu(t,n);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let n=[];if(Array.isArray(t))for(let i of new Set(t.flat(1/0).reverse()))n.unshift(ie(i));else void 0!==t&&n.push(ie(t));return n}static _$Eu(t,n){let i=n.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map;for(let n of this.constructor.elementProperties.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,n)=>{if(n5)t.adoptedStyleSheets=n.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let i of n){let n=document.createElement("style"),r=n3.litNonce;void 0!==r&&n.setAttribute("nonce",r),n.textContent=i.cssText,t.appendChild(n)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,n,i){this._$AK(t,i)}_$ET(t,n){let i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(void 0!==r&&!0===i.reflect){let o=(void 0!==i.converter?.toAttribute?i.converter:im).toAttribute(n,i.type);this._$Em=t,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,n){let i=this.constructor,r=i._$Eh.get(t);if(void 0!==r&&this._$Em!==r){let t=i.getPropertyOptions(r),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:im;this._$Em=r;let a=o.fromAttribute(n,t.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(t,n,i){if(void 0!==t){let r=this.constructor,o=this[t];if(!(((i??=r.getPropertyOptions(t)).hasChanged??ih)(o,n)||i.useDefault&&i.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,i))))return;this.C(t,n,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,n,{useDefault:i,reflect:r,wrapped:o},a){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,a??n??this[t]),!0!==o||void 0!==a)||(this._$AL.has(t)||(this.hasUpdated||i||(n=void 0),this._$AL.set(t,n)),!0===r&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[t,n]of this._$Ep)this[t]=n;this._$Ep=void 0}let t=this.constructor.elementProperties;if(t.size>0)for(let[n,i]of t){let{wrapped:t}=i,r=this[n];!0!==t||this._$AL.has(n)||void 0===r||this.C(n,void 0,i,r)}}let t=!1,n=this._$AL;try{(t=this.shouldUpdate(n))?(this.willUpdate(n),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(n)):this._$EM()}catch(n){throw t=!1,this._$EM(),n}t&&this._$AE(n)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}ib.elementStyles=[],ib.shadowRootOptions={mode:"open"},ib.elementProperties=new Map,ib.finalized=new Map,iu?.({ReactiveElement:ib}),(il.reactiveElementVersions??=[]).push("2.1.1");let ig=globalThis,i_=ig.trustedTypes,iy=i_?i_.createPolicy("lit-html",{createHTML:t=>t}):void 0,iv="$lit$",ix=`lit$${Math.random().toFixed(9).slice(2)}$`,iw="?"+ix,iF=`<${iw}>`,ik=document,iE=()=>ik.createComment(""),iT=t=>null===t||"object"!=typeof t&&"function"!=typeof t,iA=Array.isArray,iM=t=>iA(t)||"function"==typeof t?.[Symbol.iterator],iC="[ \n\f\r]",iS=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,iL=/-->/g,iD=/>/g,iI=RegExp(`>|${iC}(?:([^\\s"'>=/]+)(${iC}*=${iC}*(?:[^
|
|
54
54
|
\f\r"'\`<>=]|("|')|))|$)`,"g"),iP=/'/g,iR=/"/g,iO=/^(?:script|style|textarea|title)$/i,iB=t=>(n,...i)=>({_$litType$:t,strings:n,values:i}),iz=iB(1),iN=iB(2),iY=(iB(3),Symbol.for("lit-noChange")),ij=Symbol.for("lit-nothing"),iU=new WeakMap,iH=ik.createTreeWalker(ik,129);function iV(t,n){if(!iA(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==iy?iy.createHTML(n):n}let iG=(t,n)=>{let i=t.length-1,r=[],o,a=2===n?"<svg>":3===n?"<math>":"",s=iS;for(let n=0;n<i;n++){let i=t[n],l,c,d=-1,u=0;for(;u<i.length&&(s.lastIndex=u,null!==(c=s.exec(i)));)u=s.lastIndex,s===iS?"!--"===c[1]?s=iL:void 0!==c[1]?s=iD:void 0!==c[2]?(iO.test(c[2])&&(o=RegExp("</"+c[2],"g")),s=iI):void 0!==c[3]&&(s=iI):s===iI?">"===c[0]?(s=o??iS,d=-1):void 0===c[1]?d=-2:(d=s.lastIndex-c[2].length,l=c[1],s=void 0===c[3]?iI:'"'===c[3]?iR:iP):s===iR||s===iP?s=iI:s===iL||s===iD?s=iS:(s=iI,o=void 0);let m=s===iI&&t[n+1].startsWith("/>")?" ":"";a+=s===iS?i+iF:d>=0?(r.push(l),i.slice(0,d)+iv+i.slice(d)+ix+m):i+ix+(-2===d?n:m)}return[iV(t,a+(t[i]||"<?>")+(2===n?"</svg>":3===n?"</math>":"")),r]};class iq{constructor({strings:t,_$litType$:n},i){let r;this.parts=[];let o=0,a=0,s=t.length-1,l=this.parts,[c,d]=iG(t,n);if(this.el=iq.createElement(c,i),iH.currentNode=this.el.content,2===n||3===n){let t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=iH.nextNode())&&l.length<s;){if(1===r.nodeType){if(r.hasAttributes())for(let t of r.getAttributeNames())if(t.endsWith(iv)){let n=d[a++],i=r.getAttribute(t).split(ix),s=/([.?@])?(.*)/.exec(n);l.push({type:1,index:o,name:s[2],strings:i,ctor:"."===s[1]?iK:"?"===s[1]?iJ:"@"===s[1]?iQ:iX}),r.removeAttribute(t)}else t.startsWith(ix)&&(l.push({type:6,index:o}),r.removeAttribute(t));if(iO.test(r.tagName)){let t=r.textContent.split(ix),n=t.length-1;if(n>0){r.textContent=i_?i_.emptyScript:"";for(let i=0;i<n;i++)r.append(t[i],iE()),iH.nextNode(),l.push({type:2,index:++o});r.append(t[n],iE())}}}else if(8===r.nodeType)if(r.data===iw)l.push({type:2,index:o});else{let t=-1;for(;-1!==(t=r.data.indexOf(ix,t+1));)l.push({type:7,index:o}),t+=ix.length-1}o++}}static createElement(t,n){let i=ik.createElement("template");return i.innerHTML=t,i}}function i$(t,n,i=t,r){if(n===iY)return n;let o=void 0!==r?i._$Co?.[r]:i._$Cl,a=iT(n)?void 0:n._$litDirective$;return o?.constructor!==a&&(o?._$AO?.(!1),void 0===a?o=void 0:(o=new a(t))._$AT(t,i,r),void 0!==r?(i._$Co??=[])[r]=o:i._$Cl=o),void 0!==o&&(n=i$(t,o._$AS(t,n.values),o,r)),n}class iW{constructor(t,n){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:n},parts:i}=this._$AD,r=(t?.creationScope??ik).importNode(n,!0);iH.currentNode=r;let o=iH.nextNode(),a=0,s=0,l=i[0];for(;void 0!==l;){if(a===l.index){let n;2===l.type?n=new iZ(o,o.nextSibling,this,t):1===l.type?n=new l.ctor(o,l.name,l.strings,this,t):6===l.type&&(n=new i0(o,this,t)),this._$AV.push(n),l=i[++s]}a!==l?.index&&(o=iH.nextNode(),a++)}return iH.currentNode=ik,r}p(t){let n=0;for(let i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,n),n+=i.strings.length-2):i._$AI(t[n])),n++}}class iZ{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,n,i,r){this.type=2,this._$AH=ij,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,n=this._$AM;return void 0!==n&&11===t?.nodeType&&(t=n.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,n=this){iT(t=i$(this,t,n))?t===ij||null==t||""===t?(this._$AH!==ij&&this._$AR(),this._$AH=ij):t!==this._$AH&&t!==iY&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):iM(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==ij&&iT(this._$AH)?this._$AA.nextSibling.data=t:this.T(ik.createTextNode(t)),this._$AH=t}$(t){let{values:n,_$litType$:i}=t,r="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=iq.createElement(iV(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(n);else{let t=new iW(r,this),i=t.u(this.options);t.p(n),this.T(i),this._$AH=t}}_$AC(t){let n=iU.get(t.strings);return void 0===n&&iU.set(t.strings,n=new iq(t)),n}k(t){iA(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,i,r=0;for(let o of t)r===n.length?n.push(i=new iZ(this.O(iE()),this.O(iE()),this,this.options)):i=n[r],i._$AI(o),r++;r<n.length&&(this._$AR(i&&i._$AB.nextSibling,r),n.length=r)}_$AR(t=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);t!==this._$AB;){let n=t.nextSibling;t.remove(),t=n}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class iX{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,n,i,r,o){this.type=1,this._$AH=ij,this._$AN=void 0,this.element=t,this.name=n,this._$AM=r,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=ij}_$AI(t,n=this,i,r){let o=this.strings,a=!1;if(void 0===o)(a=!iT(t=i$(this,t,n,0))||t!==this._$AH&&t!==iY)&&(this._$AH=t);else{let r,s,l=t;for(t=o[0],r=0;r<o.length-1;r++)(s=i$(this,l[i+r],n,r))===iY&&(s=this._$AH[r]),a||=!iT(s)||s!==this._$AH[r],s===ij?t=ij:t!==ij&&(t+=(s??"")+o[r+1]),this._$AH[r]=s}a&&!r&&this.j(t)}j(t){t===ij?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class iK extends iX{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===ij?void 0:t}}class iJ extends iX{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==ij)}}class iQ extends iX{constructor(t,n,i,r,o){super(t,n,i,r,o),this.type=5}_$AI(t,n=this){if((t=i$(this,t,n,0)??ij)===iY)return;let i=this._$AH,r=t===ij&&i!==ij||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==ij&&(i===ij||r);r&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class i0{constructor(t,n,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){i$(this,t)}}let i1=ig.litHtmlPolyfillSupport;i1?.(iq,iZ),(ig.litHtmlVersions??=[]).push("3.3.1");let i2=globalThis;class i3 extends ib{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,n,i)=>{let r=i?.renderBefore??n,o=r._$litPart$;if(void 0===o){let t=i?.renderBefore??null;r._$litPart$=o=new iZ(n.insertBefore(iE(),t),t,void 0,i??{})}return o._$AI(t),o})(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return iY}}i3._$litElement$=!0,i3.finalized=!0,i2.litElementHydrateSupport?.({LitElement:i3});let i5=i2.litElementPolyfillSupport;i5?.({LitElement:i3}),(i2.litElementVersions??=[]).push("4.2.1");let i4={ATTRIBUTE:1,CHILD:2},i6=t=>(...n)=>({_$litDirective$:t,values:n});class i8{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,n,i){this._$Ct=t,this._$AM=n,this._$Ci=i}_$AS(t,n){return this.update(t,n)}update(t,n){return this.render(...n)}}class i7 extends i8{constructor(t){if(super(t),this.it=ij,t.type!==i4.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===ij||null==t)return this._t=void 0,this.it=t;if(t===iY)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;let n=[t];return n.raw=n,this._t={_$litType$:this.constructor.resultType,strings:n,values:[]}}}i7.directiveName="unsafeHTML",i7.resultType=1,i6(i7);class i9 extends i7{}i9.directiveName="unsafeSVG",i9.resultType=2;let re=i6(i9),rt=t=>(n,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(t,n)}):customElements.define(t,n)},rn={attribute:!0,type:String,converter:im,reflect:!1,hasChanged:ih};function ri(t){return(n,i)=>"object"==typeof i?((t=rn,n,i)=>{let{kind:r,metadata:o}=i,a=globalThis.litPropertyMetadata.get(o);if(void 0===a&&globalThis.litPropertyMetadata.set(o,a=new Map),"setter"===r&&((t=Object.create(t)).wrapped=!0),a.set(i.name,t),"accessor"===r){let{name:r}=i;return{set(i){let o=n.get.call(this);n.set.call(this,i),this.requestUpdate(r,o,t)},init(n){return void 0!==n&&this.C(r,void 0,t,n),n}}}if("setter"===r){let{name:r}=i;return function(i){let o=this[r];n.call(this,i),this.requestUpdate(r,o,t)}}throw Error("Unsupported decorator location: "+r)})(t,n,i):((t,n,i)=>{let r=n.hasOwnProperty(i);return n.constructor.createProperty(i,t),r?Object.getOwnPropertyDescriptor(n,i):void 0})(t,n,i)}function rr(t){return ri({...t,state:!0,attribute:!1})}let ro=(t,n,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof n&&Object.defineProperty(t,n,i),i);function ra(t,n){return(i,r,o)=>{let a=n=>n.renderRoot?.querySelector(t)??null;if(n){let{get:t,set:n}="object"==typeof r?i:o??(()=>{let t=Symbol();return{get(){return this[t]},set(n){this[t]=n}}})();return ro(i,r,{get(){let i=t.call(this);return void 0===i&&(null!==(i=a(this))||this.hasUpdated)&&n.call(this,i),i}})}return ro(i,r,{get(){return a(this)}})}}let rs={size:24,icons:{logo:'<path style=\'pointer-events: var(--or-icon-pointer-events, none);\' fill="#C4D600" d="m11.96125,23.85096c-6.56773,0 -11.90971,-5.34202 -11.90971,-11.90862l2.49411,0c0,5.19176 4.22389,9.41568 9.41561,9.41568c5.19053,0 9.41561,-4.22392 9.41561,-9.41568c0,-5.19176 -4.22389,-9.41568 -9.41561,-9.41568l0,-2.49413c6.56655,0 11.90971,5.34439 11.90971,11.9098c0,6.5666 -5.34316,11.90862 -11.90971,11.90862l0,0z" /><path fill="#4E9D2D" d="m10.25094,20.38647c-2.26848,-0.47231 -4.21822,-1.80199 -5.48741,-3.74009s-1.70892,-4.25777 -1.23545,-6.52625c0.47347,-2.26965 1.80315,-4.21822 3.74242,-5.48857c1.93926,-1.27035 4.25661,-1.70892 6.52625,-1.23545c4.68471,0.97719 7.70121,5.5828 6.72286,10.26635l-2.39994,-0.49907c0.70149,-3.36085 -1.4623,-6.66585 -4.82431,-7.36734c-1.62866,-0.33969 -3.29105,-0.02559 -4.68238,0.88645c-1.39134,0.91088 -2.34526,2.3092 -2.68495,3.93786c-0.33853,1.62633 -0.02443,3.28988 0.88645,4.68122c0.91088,1.39134 2.3092,2.34526 3.93786,2.68379l-0.50139,2.4011l0,0z"/><path fill="#1D5632"d="m12.03064,17.49616c-0.09524,0 -0.19048,-0.00116 -0.28457,-0.00465c-1.49833,-0.0755 -2.87818,-0.72942 -3.88636,-1.84097c-1.00818,-1.11271 -1.52156,-2.54948 -1.44722,-4.05013l2.44378,0.12196c-0.04181,0.84557 0.24856,1.65745 0.81769,2.28466c0.56681,0.62721 1.34733,0.99656 2.1929,1.03838c0.84208,0.03833 1.65629,-0.2474 2.2835,-0.81653c0.62837,-0.56797 0.99656,-1.34617 1.03954,-2.19174c0.08711,-1.74573 -1.26371,-3.23708 -3.00943,-3.3242l0.12196,-2.44378c3.09422,0.15332 5.4869,2.79455 5.33358,5.88877c-0.07434,1.49949 -0.72942,2.87818 -1.84097,3.8852c-1.04186,0.94313 -2.36945,1.45303 -3.7644,1.45303l0,0z"/>',"logo-plain":"m11.9925,23.91349c-6.58498,0 -11.94099,-5.35605 -11.94099,-11.9399l2.50066,0c0,5.20539 4.23498,9.44041 9.44033,9.44041c5.20416,0 9.44033,-4.23502 9.44033,-9.44041c0,-5.20539 -4.23498,-9.44041 -9.44033,-9.44041l0,-2.50068c6.5838,0 11.94099,5.35842 11.94099,11.94108c0,6.58385 -5.35719,11.9399 -11.94099,11.9399l0,0zm-1.80787,-3.27769c-2.31323,-0.48163 -4.30141,-1.83755 -5.59563,-3.81389s-1.74263,-4.34178 -1.25982,-6.65502c0.48281,-2.31443 1.83872,-4.30145 3.81623,-5.59686c1.97751,-1.29542 4.34056,-1.74264 6.65497,-1.25983c4.77711,0.99647 7.8531,5.69295 6.85545,10.46891l-2.44727,-0.50891c0.71532,-3.42716 -1.49114,-6.79738 -4.91946,-7.5127c-1.66078,-0.34639 -3.35596,-0.0261 -4.77474,0.90394c-1.41878,0.92886 -2.39152,2.35476 -2.73791,4.01555c-0.3452,1.65842 -0.02491,3.3548 0.90394,4.77359c0.92885,1.41879 2.35475,2.39154 4.01552,2.73675l-0.51128,2.44848l0,0zm1.81499,-2.92536c-0.09727,0 -0.19455,-0.00119 -0.29064,-0.00475c-1.53029,-0.07711 -2.93958,-0.74498 -3.96926,-1.88025c-1.02968,-1.13646 -1.55401,-2.60388 -1.47809,-4.13655l2.49591,0.12456c-0.04271,0.86361 0.25386,1.69282 0.83513,2.33341c0.5789,0.64059 1.37607,1.01783 2.23968,1.06053c0.86005,0.03915 1.69162,-0.25268 2.33221,-0.83395c0.64177,-0.58009 1.01782,-1.3749 1.06171,-2.23851c0.08897,-1.78298 -1.29066,-3.30616 -3.07362,-3.39513l0.12456,-2.49593c3.16022,0.15659 5.60394,2.85419 5.44735,6.01443c-0.07592,1.53149 -0.74498,2.9396 -1.88024,3.9681c-1.06408,0.96326 -2.41999,1.48403 -3.8447,1.48403l0,0z",marker:'<ellipse fill="#000" opacity="0.2" ry="1.5" rx="4" cy="22.5" cx="12" /><path style=\'pointer-events: var(--or-icon-pointer-events, none);\' d="m11.999999,0a8.437501,8.344057 0 0 1 8.437501,8.344057c0,6.500779 -5.798864,6.280799 -8.437501,14.412461c-2.638637,-8.131662 -8.437501,-7.911683 -8.437501,-14.412461a8.437501,8.344057 0 0 1 8.437501,-8.344057z" />'}};var rl=function(t,n,i,r){var o,a=arguments.length,s=a<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,n,i,r);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(s=(a<3?o(s):a>3?o(n,i,s):o(n,i))||s);return a>3&&s&&Object.defineProperty(n,i,s),s};let rc=i(7319);class rd extends CustomEvent{constructor(){super(rd.NAME,{bubbles:!0,composed:!0})}}rd.NAME="or-iconset-added";let ru=new class{constructor(){this._icons={}}addIconSet(t,n){this._icons[t]=n,this._defaultIconSet||(this._defaultIconSet=n),n.onAdd&&n.onAdd(),window.dispatchEvent(new rd)}getIconSet(t){return this._icons[t]}getIconTemplate(t){if(!t)return iz``;let n=(t||"").split(":"),i=n.pop(),r=n.pop(),o=this._defaultIconSet;return(r&&(o=this.getIconSet(r)),i&&o)?o.getIconTemplate(i):iz``}},rm=class extends i3{constructor(){super(...arguments),this._handler=t=>{this._updateIcon()}}static get styles(){return[n9`
|
|
55
55
|
:host {
|
|
56
56
|
--internal-or-icon-width: var(--or-icon-width, 24px);
|