@openremote/or-map 1.20.0 → 1.20.1
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 tl{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 tc=n.aU([{name:"a_pos",type:"Int16",components:2}]);let td="#define PROJECTION_MERCATOR",tu="mercator";class tm{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return!1}get shaderVariantName(){return tu}get shaderDefine(){return td}get shaderPreludeCode(){return ta.projectionMercator}get vertexShaderPreludeCode(){return ta.projectionMercator.vertexSource}get subdivisionGranularity(){return n.aV.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.aW;s.emplaceBack(0,0),s.emplaceBack(n.a5,0),s.emplaceBack(0,n.a5),s.emplaceBack(n.a5,n.a5);let l=t.createVertexBuffer(s,tc.members),c=n.aX.simpleSegment(0,0,4,2),d=new n.aY;d.emplaceBack(1,0,2),d.emplaceBack(1,2,3);let u=t.createIndexBuffer(d);return this._cachedMesh=new tl(l,u,c),this._cachedMesh}recalculate(){}hasTransition(){return!1}setErrorQueryLatitudeDegrees(t){}}class th{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.G.number(t.top,i.top,r)),null!=i.bottom&&null!=t.bottom&&(this.bottom=n.G.number(t.bottom,i.bottom,r)),null!=i.left&&null!=t.left&&(this.left=n.G.number(t.left,i.left,r)),null!=i.right&&null!=t.right&&(this.right=n.G.number(t.right,i.right,r)),this}getCenter(t,i){let r=n.an((this.left+t-this.right)/2,0,t),o=n.an((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 th(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function tp(t,n){if(!t.renderWorldCopies||t.lngRange)return;let i=n.lng-t.center.lng;n.lng+=i>180?-360:360*(i<-180)}function tf(t){return Math.max(0,Math.floor(t))}class tb{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.V(0,0),this._elevation=0,this._zoom=0,this._tileZoom=tf(this._zoom),this._scale=n.aq(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new th,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=tf(this._zoom),this._scale=n.aq(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 th(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.W(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.an(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.aZ(this._fovInRadians)}setFov(t){t=n.an(t,.1,150),this.fov!==t&&(this._unmodified=!1,this._fovInRadians=n.ap(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.aq(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 Z([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.ao,n.ao])}getCameraQueryGeometry(t,i){if(1===i.length)return[i[0],t];{let{minX:r,minY:o,maxX:a,maxY:s}=n.aa.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.ar(new Float64Array(16));n.Q(t,t,[this._width/2,-this._height/2,1]),n.O(t,t,[1,-1,0]),this._clipSpaceToPixelsMatrix=t,t=n.ar(new Float64Array(16)),n.Q(t,t,[1,-1,1]),n.O(t,t,[-1,-1,0]),n.Q(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=void 0!==r?r:this.bearing,s=o=void 0!==o?o:this.pitch,{distanceToCenter:l,clampedElevation:c}=this._distanceToCenterFromAltElevationPitch(i,this.elevation,s),{x:d,y:u}=ev(s,a),m=n.a9.fromLngLat(t,i),h,p,f=n.a_(1,m.y),b=0;do{if((b+=1)>10)break;p=l/f,f=1/(h=new n.a9(m.x+d*p,m.y+u*p)).meterInMercatorCoordinateUnits()}while(Math.abs(l-p*f)>1e-12);return{center:h.toLngLat(),elevation:c,zoom:n.at(this.height/2/Math.tan(this.fovInRadians/2)/p/this.tileSize)}}recalculateZoomAndCenter(t){if(this.elevation-t==0)return;let i=1/this.worldSize,r=n.as(1,this.center.lat)*this.worldSize,o=n.a9.fromLngLat(this.center,this.elevation),a=o.x/i,s=o.y/i,l=o.z/i,c=this.pitch,{x:d,y:u,z:m}=ev(c,this.bearing),h=this.cameraToCenterDistance,{distanceToCenter:p,clampedElevation:f}=this._distanceToCenterFromAltElevationPitch((l+h*m)/r,t,c),b=p*r,g=new n.a9((a+-(h*d)+d*b)*i,(s+-(h*u)+u*b)*i,0).toLngLat(),_=n.as(1,g.lat),y=n.at(this.height/2/Math.tan(this.fovInRadians/2)/p/_/this.tileSize);this._elevation=f,this._center=g,this.setZoom(y)}_distanceToCenterFromAltElevationPitch(t,i,r){let o=-Math.cos(n.ap(r)),a=t-i,s,l=i;return o*a>=0||.1>Math.abs(o)?l=t+(s=1e4)*o:s=-a/o,{distanceToCenter:s,clampedElevation:l}}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.as(1,this.center.lat)*this.worldSize;return ey(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.a5,1/i/n.a5]}}class tg{constructor(t,i){this.min=t,this.max=i,this.center=n.a$([],n.b0([],this.min,this.max),.5)}quadrant(t){let i=[t%2==0,t<2],r=n.b1(this.min),o=n.b1(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 tg(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 t_{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.a2(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 tg([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.an(78.5-r/2,0,60);return!!i.terrain||t.pitch>o}allowWorldCopies(){return!0}prepareNextFrame(){}}class ty{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=>{let o,a;return a=1/(o=n.aH([],r,t))[3]/i*l,n.b6(o,o,[a,a,1/o[3],a])});o&&function(t,i,r,o){let a,s,l,c=4*!!o,d=4*!o,u=0,m=[],h=[];for(let i=0;i<4;i++){let r=n.b2([],t[i+d],t[i+c]),o=n.b7(r);n.a$(r,r,1/o),m.push(o),h.push(r)}for(let i=0;i<4;i++){let o=n.b8(t[i+c],h[i],r);u=null!==o&&o>=0?Math.max(u,o):Math.max(u,m[i])}let p=(a=n.b2([],t[i[0]],t[i[1]]),s=n.b2([],t[i[2]],t[i[1]]),l=[0,0,0,0],n.b3(l,n.b4([],a,s)),l[3]=-n.b5(l,t[i[0]]),l),f=function(t,i){let r=n.b9(t),o=n.ba([],t,1/r),a=n.b2([],i,n.a$([],o,n.b5(i,o))),s=n.b9(a);if(s>0){let t=Math.sqrt(1-o[3]*o[3]),r=n.a$([],o,-o[3]),l=n.b0([],r,n.a$([],a,t/s));return n.bb(i,l)}return null}(r,p);null!==f&&(u=Math.min(u,f/n.b5(h[0],p)));for(let n=0;n<4;n++){let i=Math.min(u,m[n]);t[n+d]=[t[n+c][0]+h[n][0]*i,t[n+c][1]+h[n][1]*i,t[n+c][2]+h[n][2]*i,1]}}(c,s[0],o,a);let d=s.map(t=>{let i=n.b2([],c[t[0]],c[t[1]]),r=n.b2([],c[t[2]],c[t[1]]),o=n.b3([],n.b4([],i,r)),a=-n.b5(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 ty(c,d,new tg(u,m))}}class tv{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.an(+i,this.minZoom,this.maxZoom);let a={center:new n.V(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.aq(a.zoom),c=0,d=l,u=0,m=l,h=0,p=0,{x:f,y:b}=this.size;if(this._helper._latRange){let t=this._helper._latRange;c=n.X(t[1])*l,(d=n.X(t[0])*l)-c<b&&(h=b/(d-c))}s&&(u=n.W(n.Y(s[0])*l,0,l),(m=n.W(n.Y(s[1])*l,0,l))<u&&(m+=l),m-u<f&&(p=f/(m-u)));let{x:g,y:_}=ef(l,t),y=Math.max(p||0,h||0);if(y)return a.center=eb(l,new n.P(p?(m+u)/2:g,h?(d+c)/2:_)).wrap(),a.zoom+=n.at(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.W(g,t-l/2,t+l/2));let o=f/2;i-o<u&&(r=u+o),i+o>m&&(r=m-o)}return(void 0!==r||void 0!==o)&&(a.center=eb(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 tb({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(t,n)=>this.defaultConstrain(t,n)},t),this._coveringTilesDetailsProvider=new t_}clone(){let t=new tv;return t.apply(this,!1),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.bc(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.bc(r,t))}return i}getCameraFrustum(){return ty.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.as(this.elevation,this.center.lat),o=this.screenPointToMercatorCoordinateAtZ(i,r),a=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,r),s=n.a9.fromLngLat(t),l=new n.a9(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.a9.fromLngLat(t),i.getElevationForLngLat(t,this),this._pixelMatrix3D):this.coordinatePoint(n.a9.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.aH(o,o,this._pixelMatrixInverse),n.aH(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.a9(n.G.number(o[0]/s,a[0]/l,h)/this.worldSize,n.G.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.aH(o,o,r),new n.P(o[0]/o[3],o[1]/o[3])}getBounds(){let t=Math.max(0,this._helper._height/2-eg(this));return(new Z).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-eg(this)}calculatePosMatrix(t,i=!1,r){var o;let a=null!=(o=t.key)?o:n.bd(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=e_(t,this.worldSize);n.S(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=e_(t,this.worldSize);return n.S(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.ap(this.fov)*(Math.abs(Math.cos(n.ap(this.roll)))*this.height+Math.abs(Math.sin(n.ap(this.roll)))*this.width)/this.height*(.5+r.y/this.height),d=Math.sin(c)*s/Math.sin(n.an(Math.PI-l-c,.01,Math.PI-.01)),u=eg(this),m=Math.atan(u/this._helper.cameraToCenterDistance),h=n.ap(.75),p=m>h?2*m*(.5+r.y/(2*u)):h,f=Math.min(d,Math.sin(p)*s/Math.sin(n.an(Math.PI-l-p,.01,Math.PI-.01)));this._helper._farZ=1.01*(Math.cos(Math.PI/2-i)*f+s),this._helper._nearZ=this._helper._height/50}_calcMatrices(){let t;if(!this._helper._height)return;let i=this.centerOffset,r=ef(this.worldSize,this.center),o=r.x,a=r.y;this._helper._pixelPerMeter=n.as(1,this.center.lat)*this.worldSize;let s=n.ap(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.be(t,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),n.aB(this._invProjMatrix,t),t[8]=-(2*i.x)/this._helper._width,t[9]=2*i.y/this._helper._height,this._projectionMatrix=n.bf(t),n.Q(t,t,[1,-1,1]),n.O(t,t,[0,0,-this._helper.cameraToCenterDistance]),n.bg(t,t,-this.rollInRadians),n.bh(t,t,this.pitchInRadians),n.bg(t,t,-this.bearingInRadians),n.O(t,t,[-o,-a,0]),this._mercatorMatrix=n.Q([],t,[this.worldSize,this.worldSize,this.worldSize]),n.Q(t,t,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=n.S(new Float64Array(16),this.clipSpaceToPixelsMatrix,t),n.O(t,t,[0,0,-this.elevation]),this._viewProjMatrix=t,this._invViewProjMatrix=n.aB([],t);let c=[0,0,-1,1];n.aH(c,c,this._invViewProjMatrix),this._cameraPosition=[c[0]/c[3],c[1]/c[3],c[2]/c[3]],this._fogMatrix=new Float64Array(16),n.be(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.Q(this._fogMatrix,this._fogMatrix,[1,-1,1]),n.O(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),n.bg(this._fogMatrix,this._fogMatrix,-this.rollInRadians),n.bh(this._fogMatrix,this._fogMatrix,this.pitchInRadians),n.bg(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),n.O(this._fogMatrix,this._fogMatrix,[-o,-a,0]),n.Q(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),n.O(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=n.S(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),p=o-Math.round(o)+m*d+h*u,f=a-Math.round(a)+m*u+h*d,b=new Float64Array(t);if(n.O(b,b,[p>.5?p-1:p,f>.5?f-1:f,0]),this._alignedProjMatrix=b,!(t=n.aB(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.aH(i,i,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){let t=n.as(1,this.center.lat)*this.worldSize;return ey(this.center,this.elevation,this.pitch,this.bearing,this._helper.cameraToCenterDistance/t).toLngLat()}lngLatToCameraDepth(t,i){let r=n.a9.fromLngLat(t),o=[r.x*this.worldSize,r.y*this.worldSize,i,1];return n.aH(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.bi(),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.b1(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.aH(a,a,s)):eZ(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.a9.fromLngLat(t,i),o=r.meterInMercatorCoordinateUnits(),a=n.bj();return n.O(a,a,[r.x,r.y,r.z]),n.bg(a,a,Math.PI),n.bh(a,a,Math.PI/2),n.Q(a,a,[-o,o,o]),a}getProjectionDataForCustomLayer(t=!0){let i=new n.a2(0,0,0,0,0),r=this.getProjectionData({overscaledTileID:i,applyGlobeMatrix:t}),o=e_(i,this.worldSize);n.S(o,this._viewProjMatrix,o),r.tileMercatorCoords=[0,0,1,1];let a=[n.a5,n.a5,this.worldSize/this._helper.pixelsPerMeter],s=n.bk();return n.Q(s,o,a),r.fallbackMatrix=s,r.mainMatrix=s,r}getFastPathSimpleProjectionMatrix(t){return this.calculatePosMatrix(t)}}function tx(){n.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function tw(t){if(t.useSlerp)if(t.k<1){let i=n.bl(t.startEulerAngles.roll,t.startEulerAngles.pitch,t.startEulerAngles.bearing),r=n.bl(t.endEulerAngles.roll,t.endEulerAngles.pitch,t.endEulerAngles.bearing),o=new Float64Array(4);n.bm(o,i,r,t.k);let a=n.bn(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.G.number(t.startEulerAngles.roll,t.endEulerAngles.roll,t.k)),t.tr.setPitch(n.G.number(t.startEulerAngles.pitch,t.endEulerAngles.pitch,t.k)),t.tr.setBearing(n.G.number(t.startEulerAngles.bearing,t.endEulerAngles.bearing,t.k))}function tF(t,i,r,o,a){let s=a.padding,l=ef(a.worldSize,r.getNorthWest()),c=ef(a.worldSize,r.getNorthEast()),d=ef(a.worldSize,r.getSouthEast()),u=ef(a.worldSize,r.getSouthWest()),m=n.ap(-o),h=l.rotate(m),p=c.rotate(m),f=d.rotate(m),b=u.rotate(m),g=new n.P(Math.max(h.x,p.x,b.x,f.x),Math.max(h.y,p.y,b.y,f.y)),_=new n.P(Math.min(h.x,p.x,b.x,f.x),Math.min(h.y,p.y,b.y,f.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 tx();let w=Math.min(n.at(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.ap(o)),E=F.add(k).mult(a.scale/n.aq(w));return{center:eb(a.worldSize,l.add(d).div(2).sub(E)),zoom:w,bearing:o}}class tk{get useGlobeControls(){return!1}handlePanInertia(t,n){let i=t.mag(),r=Math.abs(eg(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 tF(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.V.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:p,zoom:f}=t.applyConstrain(n.V.convert(i.center||h),null!=u?u:r);tp(t,p);let b=ef(t.worldSize,h),g=ef(t.worldSize,p).sub(b),_=n.aq(f-r);return{easeFunc:l=>{if(d&&t.setZoom(n.G.number(r,f,l)),n.bo(a,s)||tw({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.aq(t.zoom-r),o=Math.pow(f>r?Math.min(2,_):Math.max(.5,_),1-l),a=eb(t.worldSize,b.add(g.mult(l*o)).mult(i));t.setLocationAtPoint(t.renderWorldCopies?a.wrap():a,m)}},isZooming:d=f!==r,elevationCenter:p}}handleFlyTo(t,i){let r,o=void 0!==i.zoom,a=t.zoom,s=t.applyConstrain(n.V.convert(i.center||i.locationAtOffset),o?+i.zoom:a),l=s.center,c=s.zoom;tp(t,l);let d=ef(t.worldSize,i.locationAtOffset),u=ef(t.worldSize,l).sub(d),m=u.mag(),h=n.aq(c-a);if(void 0!==i.minZoom){let o=Math.min(+i.minZoom,a,c),s=t.applyConstrain(l,o).zoom;r=n.aq(s-a)}return{easeFunc:(i,r,o,s)=>{t.setZoom(1===i?c:a+n.at(r));let m=1===i?l:eb(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 tE{constructor(t,n,i){this.blendFunction=t,this.blendColor=n,this.mask=i}}tE.Replace=[1,0],tE.disabled=new tE(tE.Replace,n.bp.transparent,[!1,!1,!1,!1]),tE.unblended=new tE(tE.Replace,n.bp.transparent,[!0,!0,!0,!0]),tE.alphaBlended=new tE([1,771],n.bp.transparent,[!0,!0,!0,!0]);class tT{constructor(t,n,i){this.enable=t,this.mode=n,this.frontFace=i}}tT.disabled=new tT(!1,1029,2305),tT.backCCW=new tT(!0,1029,2305),tT.frontCCW=new tT(!0,1028,2305);class tM{constructor(t,n,i){this.func=t,this.mask=n,this.range=i}}tM.ReadOnly=!1,tM.ReadWrite=!0,tM.disabled=new tM(519,tM.ReadOnly,[0,1]);class tA{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}}tA.disabled=new tA({func:519,mask:0},0,0,7680,7680,7680);let tC=new WeakMap;function tS(t){var n;if(tC.has(t))return tC.get(t);{let i=null==(n=t.getParameter(t.VERSION))?void 0:n.startsWith("WebGL 2.0");return tC.set(t,i),i}}class tD{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;const i=t.context,r=i.gl;this._texFormat=r.RGBA,this._texType=r.UNSIGNED_BYTE;const o=new n.aW;o.emplaceBack(-1,-1),o.emplaceBack(2,-1),o.emplaceBack(-1,2);const a=new n.aY;a.emplaceBack(0,1,2),this._fullscreenTriangle=new tl(i.createVertexBuffer(o,tc.members),i.createIndexBuffer(a),n.aX.simpleSegment(0,0,o.length,a.length)),this._resultBuffer=new Uint8Array(4),i.activeTexture.set(r.TEXTURE1);const 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),tS(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.bp.transparent}),this._cachedRenderContext.useProgram("projectionErrorMeasurement").draw(r,o.TRIANGLES,tM.disabled,tA.disabled,tE.unblended,tT.disabled,{u_input:t,u_output_expected:i},null,null,"$clipping",this._fullscreenTriangle.vertexBuffer,this._fullscreenTriangle.indexBuffer,this._fullscreenTriangle.segments),this._pbo&&tS(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&&tS(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=tD._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 tL=n.a5/128;function tI(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,p=s*l>65536;if(p&&"16bit"===i)throw Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");let f=p||"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.a5;-1===o&&(a=-tL),o===r+1&&(a=n.a5+tL);let s=i/r*n.a5;-1===i&&(s=t.extendToNorthPole?n.br:-tL),i===r+1&&(s=t.extendToSouthPole?n.bs:n.a5+tL),b[g++]=a,b[g++]=s}let _=f?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:f}}let tP=new n.aV({fill:new n.bt(128,2),line:new n.bt(512,0),tile:new n.bt(128,32),stencil:new n.bt(128,1),circle:3});class tO{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 ta.projectionGlobe}get vertexShaderPreludeCode(){return ta.projectionMercator.vertexSource}get subdivisionGranularity(){return tP}get useGlobeControls(){return!0}get latitudeErrorCorrectionRadians(){return this._errorCorrectionUsable}destroy(){this._errorMeasurement&&this._errorMeasurement.destroy()}updateGPUdependent(t){this._errorMeasurement||(this._errorMeasurement=new tD(t));let i=n.X(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.bu(this._errorCorrectionPreviousValue,-this._errorMeasurementLastValue,n.bv(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?tP.stencil:tP.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,o,a,s=this._getMeshKey(i);if(s in this._tileMeshCache)return this._tileMeshCache[s];let l=(r=tI(i,"16bit"),o=n.aW.deserialize({arrayBuffer:r.vertices,length:r.vertices.byteLength/2/2}),a=n.aY.deserialize({arrayBuffer:r.indices,length:r.indices.byteLength/2/3}),new tl(t.createVertexBuffer(o,tc.members),t.createIndexBuffer(a),n.aX.simpleSegment(0,0,o.length,a.length)));return this._tileMeshCache[s]=l,l}recalculate(t){}hasTransition(){let t=v();return(t-this._errorMeasurementLastChangeTime)/1e3<.7||this._errorMeasurement&&this._errorMeasurement.awaitingQuery}setErrorQueryLatitudeDegrees(t){this._errorQueryLatitudeDegrees=t}}let tR=new n.t({type:new n.D(n.u.projection.type)});class tB extends n.E{constructor(t){super(),this._transitionable=new n.x(tR,void 0),this.setProjection(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new n.H(0)),this._mercatorProjection=new tm,this._verticalPerspectiveProjection=new tO}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.bw){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 tz(t){return 2*Math.PI*tj(t.worldSize,t.center.lat)}function tY(t,i,r,o,a){let s=1/(1<<a),l=i/n.a5*s+o*s,c=n.bz((t/n.a5*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 tN(t){var n,i;let r,o;return n=t.lng*Math.PI/180,r=Math.cos(i=t.lat*Math.PI/180),(o=new Float64Array(3))[0]=Math.sin(n)*r,o[1]=Math.sin(i),o[2]=Math.cos(n)*r,o}function tj(t,n){return t/(2*Math.PI)/Math.cos(n*Math.PI/180)}function tH(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.V(n.W(s,-180,180),i)}return new n.V(0,i)}function tU(t){return Math.cos(t*Math.PI/180)}function tV(t,i){let r=tU(t),o=tU(i);return n.at(o/r)}function tq(t,i){let r=t.rotate(i.bearingInRadians),o=i.zoom+tV(i.center.lat,0),a=n.bu(1/tU(i.center.lat),1/tU(Math.min(Math.abs(i.center.lat),60)),n.bx(o,7,3,0,1)),s=360/tz({worldSize:i.worldSize,center:{lat:i.center.lat}});return new n.V(i.center.lng-r.x*s*a,n.an(i.center.lat+r.y*s,-n.ao,n.ao))}function tG(t){let n=.5*t,i=Math.sin(n),r=Math.cos(n);return Math.log(i+r)-Math.log(r-i)}function t$(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=tG(s+o*(l-s)),d=tG(s),u=tG(l);return new n.V(t.lng+(c-d)/(u-d)*i,a)}return new n.V(t.lng+i*o,a)}class tW{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 tX{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 tX(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.bB([],r[0],r[1],r[2]),a=n.bC([],[i[0],0,0],o),s=n.bC([],[0,i[1],0],o),l=n.bC([],[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.b0(r,r,n.a$([],a,1&~i?-1:1)),n.b0(r,r,n.a$([],s,1==(i>>1&1)?1:-1)),n.b0(r,r,n.a$([],l,1==(i>>2&1)?1:-1)),u.push(r)}return new tX(u,[[...a,-n.b5(a,u[0])],[...s,-n.b5(s,u[0])],[...l,-n.b5(l,u[0])],[-a[0],-a[1],-a[2],-n.b5(a,u[7])],[-s[0],-s[1],-s[2],-n.b5(s,u[7])],[-l[0],-l[1],-l[2],-n.b5(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 tZ(t,n,i){let r=t-n;return r<0?-r:Math.max(0,r-i)}function tK(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,tZ(n,r,o))}class tJ{constructor(){this._boundingVolumeCache=new tW(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,tK(t,n,s,l,a)),tK(t,n,s+.5,-l-a,a)),tK(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=tZ(t.x,a,o),l=tZ(t.x,a-1,o),c=tZ(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.a2(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.bE,c/=n.bE,l+=1,c+=1,t.z<=0)return tX.fromAabb([-c,-c,-c],[c,c,c]);if(1===t.z)return tX.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=[tY(0,0,t.x,t.y,t.z),tY(n.a5,0,t.x,t.y,t.z),tY(n.a5,n.a5,t.x,t.y,t.z),tY(0,n.a5,t.x,t.y,t.z)],r=[];for(let t of i)r.push(n.a$([],t,c));if(c!==l)for(let t of i)r.push(n.a$([],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=tY(n.a5/2,n.a5/2,t.x,t.y,t.z),d=n.b4([],[0,1,0],s);n.b3(d,d);let u=n.b4([],s,d);n.b3(u,u);let m=n.b4([],i[2],i[1]);n.b3(m,m);let h=n.b4([],i[0],i[3]);n.b3(h,h),r.push(n.a$([],s,c)),t.y>=(1<<t.z)/2&&r.push(n.a$([],tY(n.a5/2,0,t.x,t.y,t.z),c)),t.y<(1<<t.z)/2&&r.push(n.a$([],tY(n.a5/2,n.a5,t.x,t.y,t.z),c));let p=tQ(s,r),f=tQ(u,r),b=[-s[0],-s[1],-s[2],p.max],g=[s[0],s[1],s[2],-p.min],_=[-u[0],-u[1],-u[2],f.max],y=[u[0],u[1],u[2],-f.min],v=[...m,0],x=[...h,0],w=[];return 0===t.y?w.push(n.bD(x,v,b),n.bD(x,v,g)):w.push(n.bD(_,v,b),n.bD(_,v,g),n.bD(_,x,b),n.bD(_,x,g)),t.y===(1<<t.z)-1?w.push(n.bD(x,v,b),n.bD(x,v,g)):w.push(n.bD(y,v,b),n.bD(y,v,g),n.bD(y,x,b),n.bD(y,x,g)),new tX(w,[b,g,_,y,v,x],o,a)}}}function tQ(t,i){let r=1/0,o=-1/0;for(let a of i){let i=n.b5(t,a);r=Math.min(r,i),o=Math.max(o,i)}return{min:r,max:o}}class t0{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.bF(),this._projectionMatrix=n.bj(),this._globeViewProjMatrix32f=n.bi(),this._globeViewProjMatrixNoCorrection=n.bj(),this._globeViewProjMatrixNoCorrectionInverted=n.bj(),this._globeProjMatrixInverted=n.bj(),this._cameraPosition=n.bA(),this._globeLatitudeErrorCorrectionRadians=0,this.defaultConstrain=(t,i)=>{let r=n.an(t.lat,-n.ao,n.ao),o=n.an(+i,this.minZoom+tV(0,r),this.maxZoom);return{center:new n.V(t.lng,r),zoom:o}},this.applyConstrain=(t,n)=>this._helper.applyConstrain(t,n),this._helper=new tb({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(t,n)=>this.defaultConstrain(t,n)},t),this._coveringTilesDetailsProvider=new tJ}clone(){let t=new t0;return t.apply(this,!1),t}apply(t,n,i){this._globeLatitudeErrorCorrectionRadians=i||0,this._helper.apply(t,n)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixNoCorrection}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){let t=n.bA();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.bG(u,u,[0,0,0],-this.bearingInRadians),n.bH(u,u,[0,0,0],-1*this.center.lat*Math.PI/180),n.bI(u,u,[0,0,0],this.center.lng*Math.PI/180);let m=1/n.b7(u);return n.a$(u,u,m),[...u,-s*m]}isLocationOccluded(t){return!this.isSurfacePointVisible(tN(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.b4(l,s,a),n.b3(s,s),n.b3(l,l);let c=[0,0,0];return n.b3(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,a;let s,l=(s=1/(1<<(a=r.canonical).z),new n.a9(t/n.a5*s+a.x*s,i/n.a5*s+a.y*s)),c=(o=l.y,[n.bz(l.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(c[1])}projectTileCoordinates(t,i,r,o){let a=r.canonical,s=tY(t,i,a.x,a.y,a.z),l=1+(o?o(t,i):0)/n.bE,c=[s[0]*l,s[1]*l,s[2]*l,1];n.aH(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=tj(this.worldSize,this.center.lat),i=n.bk(),r=n.bk();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+2*t),n.be(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.bf(i),this._globeProjMatrixInverted=n.bk(),n.aB(this._globeProjMatrixInverted,i),n.O(i,i,[0,0,-this.cameraToCenterDistance]),n.bg(i,i,this.rollInRadians),n.bh(i,i,-this.pitchInRadians),n.bg(i,i,this.bearingInRadians),n.O(i,i,[0,0,-t]);let a=n.bA();a[0]=t,a[1]=t,a[2]=t,n.bh(r,i,this.center.lat*Math.PI/180),n.bJ(r,r,-this.center.lng*Math.PI/180),n.Q(r,r,a),this._globeViewProjMatrixNoCorrection=r,n.bh(i,i,this.center.lat*Math.PI/180-this._globeLatitudeErrorCorrectionRadians),n.bJ(i,i,-this.center.lng*Math.PI/180),n.Q(i,i,a),this._globeViewProjMatrix32f=new Float32Array(i),this._globeViewProjMatrixNoCorrectionInverted=n.bk(),n.aB(this._globeViewProjMatrixNoCorrectionInverted,r);let s=n.bA();this._cameraPosition=n.bA(),this._cameraPosition[2]=this.cameraToCenterDistance/t,n.bG(this._cameraPosition,this._cameraPosition,s,-this.rollInRadians),n.bH(this._cameraPosition,this._cameraPosition,s,this.pitchInRadians),n.bG(this._cameraPosition,this._cameraPosition,s,-this.bearingInRadians),n.b0(this._cameraPosition,this._cameraPosition,[0,0,1]),n.bH(this._cameraPosition,this._cameraPosition,s,-this.center.lat*Math.PI/180),n.bI(this._cameraPosition,this._cameraPosition,s,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(t);let l=n.bf(this._globeViewProjMatrixNoCorrectionInverted);n.Q(l,l,[1,1,-1]),this._cachedFrustum=ty.fromInvProjectionMatrix(l,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(t){n.w("calculateFogMatrix is not supported on globe projection.");let i=n.bk();return n.ar(i),i}getVisibleUnwrappedCoordinates(t){return[new n.bc(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=tN(t);n.a$(r,r,1+i/n.bE);let o=n.bF();return n.aH(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.bK(d.lng,t.lng),r=n.bK(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 Z(u)}calculateCenterFromCameraLngLatAlt(t,n,i,r){return this._helper.calculateCenterFromCameraLngLatAlt(t,n,i,r)}setLocationAtPoint(t,i){let r,o,a=tN(this.unprojectScreenPoint(i)),s=tN(t),l=n.bA();n.bL(l);let c=n.bA();n.bI(c,a,l,-this.center.lng*Math.PI/180),n.bH(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.bM(s[0],s[2],c[0],m),p=n.bM(s[0],s[2],c[0],-m),f=n.bA();n.bI(f,s,l,-h);let b=n.bM(f[1],f[2],c[1],c[2]),g=n.bA();n.bI(g,s,l,-p);let _=n.bM(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.bN(h,t)+n.bN(b,i)<n.bN(p,t)+n.bN(_,i)?(r=h,o=b):(r=p,o=_)}else if(v)r=h,o=b;else{if(!x)return;r=p,o=_}let w=r/Math.PI*180,F=o/Math.PI*180,k=this.center.lat;this.setCenter(new n.V(w,n.an(F,-90,90))),this.setZoom(this.zoom+tV(k,this.center.lat))}locationToScreenPoint(t,i){let r=tN(t);if(i){let o=i.getElevationForLngLatZoom(t,this._helper._tileZoom);n.a$(r,r,1+o/n.bE)}return this._projectSurfacePointToScreen(r)}_projectSurfacePointToScreen(t){let i=n.bF();return n.aH(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.a9.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.bF();i[0]=t.x/this.width*2-1,i[1]=-1*(t.y/this.height*2-1),i[2]=1,i[3]=1,n.aH(i,i,this._globeViewProjMatrixNoCorrectionInverted),i[0]/=i[3],i[1]/=i[3],i[2]/=i[3];let r=n.bA();r[0]=i[0]-this._cameraPosition[0],r[1]=i[1]-this._cameraPosition[1],r[2]=i[2]-this._cameraPosition[2];let o=n.bA();return n.b3(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.bF();return n.aH(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.b5(t,i),o=n.bA(),a=n.bA();n.a$(a,i,r),n.b2(o,t,a);let s=1-n.b5(o,o);if(s<0)return null;let l=n.b5(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){var i,r;let o,a,s,l=this._cameraPosition,c=this.getRayDirectionFromPixel(t),d=this.rayPlanetIntersection(l,c);if(d){let t=n.bA();n.b0(t,l,[c[0]*d.tMin,c[1]*d.tMin,c[2]*d.tMin]);let i=n.bA();return n.b3(i,t),tH(i)}let u=this._cachedClippingPlane,m=u[0]*c[0]+u[1]*c[1]+u[2]*c[2],h=-n.bb(u,l)/m,p=n.bA();if(h>0)n.b0(p,l,[c[0]*h,c[1]*h,c[2]*h]);else{let t=n.bA();n.b0(t,l,[2*c[0],2*c[1],2*c[2]]);let i=n.bb(this._cachedClippingPlane,t);n.b2(p,t,[this._cachedClippingPlane[0]*i,this._cachedClippingPlane[1]*i,this._cachedClippingPlane[2]*i])}let f=((o=n.bA())[0]=-(u[0]*u[3]),o[1]=-(u[1]*u[3]),o[2]=-(u[2]*u[3]),{center:o,radius:Math.sqrt(1-u[3]*u[3])});return tH((i=f.center,r=f.radius,a=n.bA(),n.b2(a,p,i),s=n.bA(),n.by(s,i,a,r/n.b9(a)),s))}getMatrixForModel(t,i){let r=n.V.convert(t),o=1/n.bE,a=n.bj();return n.bJ(a,a,r.lng/180*Math.PI),n.bh(a,a,-r.lat/180*Math.PI),n.O(a,a,[0,0,1+i/n.bE]),n.bh(a,a,.5*Math.PI),n.Q(a,a,[o,o,o]),a}getProjectionDataForCustomLayer(t=!0){let i=this.getProjectionData({overscaledTileID:new n.a2(0,0,0,0,0),applyGlobeMatrix:t});return i.tileMercatorCoords=[0,0,1,1],i}getFastPathSimpleProjectionMatrix(t){}}class t1{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 tb({calcMatrices:()=>{this._calcMatrices()},defaultConstrain:(t,n)=>this.defaultConstrain(t,n)},t),this._globeness=1,this._mercatorTransform=new tv,this._verticalPerspectiveTransform=new t0}clone(){let t=new t1;return t._globeness=this._globeness,t._globeLatitudeErrorCorrectionRadians=this._globeLatitudeErrorCorrectionRadians,t.apply(this,!1),t}apply(t,n){this._helper.apply(t,n),this._mercatorTransform.apply(this,!1),this._verticalPerspectiveTransform.apply(this,!1,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.bu(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return n.bu(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.bu(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,!1,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){this.isGlobeRendering?(this._verticalPerspectiveTransform.setLocationAtPoint(t,n),this.apply(this._verticalPerspectiveTransform,!1)):(this._mercatorTransform.setLocationAtPoint(t,n),this.apply(this._mercatorTransform,!1))}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 t2{get useGlobeControls(){return!0}handlePanInertia(t,i){let r=tq(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.bK(i.center.lng,o.lng),c=l/(Math.abs(l/180)+1),d=n.bK(i.center.lat,o.lat),u=i.getRayDirectionFromPixel(r),m=i.cameraPosition,h=-1*n.b5(m,u),p=n.bA();n.b0(p,m,[u[0]*h,u[1]*h,u[2]*h]);let f=Math.exp(-(.5*Math.max(n.b7(p)-1-.3,0))),b=tj(i.worldSize,i.center.lat)/Math.min(i.width,i.height),g=n.bx(b,.9,.5,1,.25),_=(1-n.aq(-s))*Math.min(f,g),y=i.center.lat,v=i.zoom,x=new n.V(i.center.lng+c*_,n.an(i.center.lat+d*_,-n.ao,n.ao));i.setLocationAtPoint(o,r);let w=i.center,F=Math.pow(Math.max(n.bx(Math.abs(l),45,85,0,1),n.bx(b,.75,.35,0,1)),.25),k=n.bK(w.lng,x.lng),E=n.bK(w.lat,x.lat);i.setCenter(new n.V(w.lng+k*F,w.lat+E*F).wrap()),i.setZoom(v+tV(y,i.center.lat))}handleMapControlsPan(t,n,i){if(!t.panDelta)return;let r=n.center.lat,o=n.zoom;n.setCenter(tq(t.panDelta,n).wrap()),n.setZoom(o+tV(r,n.center.lat))}cameraForBoxAndBearing(t,i,r,o,a){let s=tF(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.bK(r.getWest(),r.getEast()),h=m?r.getEast():r.getWest(),p=m?r.getWest():r.getEast(),f=Math.max(r.getNorth(),r.getSouth()),b=Math.min(r.getNorth(),r.getSouth()),g=h+.5*n.bK(h,p),_=f+.5*n.bK(f,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=[tN(r.getNorthWest()),tN(r.getNorthEast()),tN(r.getSouthWest()),tN(r.getSouthEast()),tN(new n.V(p,_)),tN(new n.V(h,_)),tN(new n.V(g,f)),tN(new n.V(g,b))],w=tN(s.center),F=1/0;for(let t of x)l<0&&(F=t2.getLesserNonNegativeNonNull(F,t2.solveVectorScale(t,w,v,"x",l))),c>0&&(F=t2.getLesserNonNegativeNonNull(F,t2.solveVectorScale(t,w,v,"x",c))),d>0&&(F=t2.getLesserNonNegativeNonNull(F,t2.solveVectorScale(t,w,v,"y",d))),u<0&&(F=t2.getLesserNonNegativeNonNull(F,t2.solveVectorScale(t,w,v,"y",u)));if(Number.isFinite(F)&&0!==F)return s.zoom=y.zoom+n.at(F),s;tx()}handleJumpToCenterZoom(t,i){let r=t.center.lat,o=t.applyConstrain(i.center?n.V.convert(i.center):t.center,t.zoom).center;t.setCenter(o.wrap());let a=void 0!==i.zoom?+i.zoom:t.zoom+tV(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.V.convert(i.center):o,h=t.applyConstrain(m,r).center;tp(t,h);let p=t.clone();p.setCenter(h),p.setZoom(c?+i.zoom:r+tV(o.lat,m.lat)),p.setBearing(i.bearing);let f=new n.P(n.an(t.centerPoint.x+i.offsetAsPoint.x,0,t.width),n.an(t.centerPoint.y+i.offsetAsPoint.y,0,t.height));p.setLocationAtPoint(h,f);let b=(i.offset&&i.offsetAsPoint.mag())>0?p.center:h,g=c?+i.zoom:r+tV(o.lat,b.lat),_=r+tV(o.lat,0),y=g+tV(b.lat,0),v=n.bK(o.lng,b.lng),x=n.bK(o.lat,b.lat),w=n.aq(y-_);return{easeFunc:r=>{if(n.bo(s,l)||tw({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=t$(o,v,x,r*n);t.setCenter(i.wrap())}if(u){let i=n.G.number(_,y,r)+tV(0,t.center.lat);t.setZoom(i)}},isZooming:u=g!==r,elevationCenter:b}}handleFlyTo(t,i){let r,o,a,s=void 0!==i.zoom,l=t.center,c=t.zoom,d=t.padding,u=!t.isPaddingEqual(i.padding),m=t.applyConstrain(n.V.convert(i.center||i.locationAtOffset),c).center,h=s?+i.zoom:t.zoom+tV(t.center.lat,m.lat),p=t.clone();p.setCenter(m),p.setZoom(h),p.setBearing(i.bearing);let f=new n.P(n.an(t.centerPoint.x+i.offsetAsPoint.x,0,t.width),n.an(t.centerPoint.y+i.offsetAsPoint.y,0,t.height));p.setLocationAtPoint(m,f);let b=p.center;tp(t,b);let g=(o=tN(l),a=tN(b),Math.acos(n.b5(o,a))/(2*Math.PI)*tz(t)),_=c+tV(l.lat,0),y=h+tV(b.lat,0),v=n.aq(y-_);if("number"==typeof i.minZoom){let o=Math.min(+i.minZoom+tV(b.lat,0),_,y)+tV(0,b.lat),a=t.applyConstrain(b,o).zoom+tV(b.lat,0);r=n.aq(a-_)}let x=n.bK(l.lng,b.lng),w=n.bK(l.lat,b.lat);return{easeFunc:(r,o,a,s)=>{let c=t$(l,x,w,a);u&&t.interpolatePadding(d,i.padding,r);let m=1===r?b:c;t.setCenter(m.wrap());let p=_+n.at(o);t.setZoom(1===r?h:p+tV(0,m.lat))},scaleOfZoom:v,targetCenter:b,scaleOfMinZoom:r,pixelPathLength:g}}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 t5{constructor(t){this._globe=t,this._mercatorCameraHelper=new tk,this._verticalPerspectiveCameraHelper=new t2}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 t3=(t,i)=>n.B(t,i&&i.filter(t=>"source.canvas"!==t.identifier)),t4=n.bO();class t6 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(V(),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);const a=(null==(r=t._container)?void 0:r.lang)||"u">typeof document&&(null==(o=document.documentElement)?void 0:o.lang)||void 0;this.glyphManager=new O(t._requestManager,i.localIdeographFontFamily,a),this.lineAtlas=new N(256,512),this.crossTileSymbolIndex=new tr,this._setInitialValues(),this._resetUpdates(),this.dispatcher.broadcast("SR",n.bP()),em().on(ec,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.bQ,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.bR(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.bR(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(),s=i.getVisibilityAffectingGlobalStateRefs();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);(null==s?void 0:s.has(r))&&(i.recalculateVisibility(),this._updateLayer(i))}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,this.map._ownerWindow).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(t4,{validate:!1})}_load(t,i,r){var o,a;let s=i.transformStyle?i.transformStyle(r,t):t;if(!i.validate||!t3(this,n.C(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 B(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.bS(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.bT(a,this._globalState);if(t.setEventedParent(this,{layer:{id:a.id}}),this._layers[a.id]=t,n.bU(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);let a=new AbortController;this._spriteRequest=a,(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:p,textFitWidth:f,textFitHeight:b}=a[t];n[r][t]={data:null,pixelRatio:u,sdf:d,stretchX:m,stretchY:h,content:p,textFitWidth:f,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,a.signal.aborted||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.bV(r):r);let o=[];for(let a of t)if(r[a]){let t=i?n.bV(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)&&t3(this,n.C(t)))return!1;(t=n.bV(t)).layers=n.bS(t.layers);let a=n.bW(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,this.fire(new n.l("style.load",{style:this})),!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.C.source,`sources.${t}`,i,null,r))return;this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);let o=this.tileManagers[t]=new eD(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=${t}`);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(t3(this,n.bX(t)))return;o=n.bT(t,this._globalState)}else{if("source"in t&&"object"==typeof t.source&&(this.addSource(a,t.source),t=n.bV(t),t=n.e(t,{source:a})),this._validate(n.C.layer,`layers.${a}`,t,{arrayIndex:-1},r))return;o=n.bT(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.bR(o.filter,i))return null==i?(o.setFilter(void 0),void this._updateLayer(o)):void(this._validate(n.C.filter,`layers.${o.id}.filter`,i,null,r)||(o.setFilter(n.bV(i)),this._updateLayer(o)))}else this.fire(new n.k(Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return n.bV(this.getLayer(t).filter)}setLayoutProperty(t,i,r,o={}){this._checkLoaded();let a=this.getLayer(t);a?n.bR(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.bR(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.bU(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.bY(this.tileManagers,t=>t.serialize()),i=this._serializeByIds(this._order,!0),r=this.map.getTerrain()||void 0,o=this.stylesheet;return n.bZ({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.C.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($);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.N();return n.O(r,r,[1,1,0]),n.Q(r,r,[.5*t.width,.5*t.height,1]),t.calculatePosMatrix?n.S(r,r,t.calculatePosMatrix(i.toUnwrapped())):r}(s,o.tileID),l?(t,n)=>l(o.tileID,t,n):void 0)});var h,p=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 p)for(let i of p[n])W(i,t);return p}(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($),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])W(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.C.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.bR(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.stylesheet.projection=t,this.projection){if(this.projection.name===t.type)return;this.projection.destroy(),delete this.projection}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.bR(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 tB({type:t});return{projection:n,transform:new t1(r),cameraHelper:new t5(n)}}switch(t){case"mercator":return{projection:new tm,transform:new tv(r),cameraHelper:new tk};case"globe":{let t=new tB({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]});return{projection:t,transform:new t1(r),cameraHelper:new t5(t)}}case"vertical-perspective":return{projection:new tO,transform:new t0(r),cameraHelper:new t2};default:return n.w(`Unknown projection name: ${t}. Falling back to mercator projection.`),{projection:new tm,transform:new tv(r),cameraHelper:new tk}}}(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)&&t3(this,t.call(n.C,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),em().off(ec,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 e9(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.C.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.C.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.C.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];n.setEventedParent(null),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 t8=n.aU([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class t7{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 t9=(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.bp.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.bp.white,u_horizon_fog_blend:r?r.properties.get("horizon-fog-blend"):1,u_is_globe_mode:+!!a}),ne={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 nt(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 nn{constructor(t,i,r,o,a,s,l,c,d=[]){const u=t.gl;this.program=u.createProgram();const m=nt(i.staticAttributes),h=r?r.getBinderAttributes():[],p=m.concat(h),f=ta.prelude.staticUniforms?nt(ta.prelude.staticUniforms):[],b=l.staticUniforms?nt(l.staticUniforms):[],g=i.staticUniforms?nt(i.staticUniforms):[],_=r?r.getBinderUniforms():[],y=f.concat(b).concat(g).concat(_),v=[];for(const t of y)0>v.indexOf(t)&&v.push(t);const x=r?r.defines():[];tS(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(ta.prelude.fragmentSource,l.fragmentSource,i.fragmentSource).join("\n"),F=x.concat(ta.prelude.vertexSource,l.vertexSource,i.vertexSource).join("\n");tS(u)||(w=function(t){return t.replace(/\bin\s/g,"varying ").replace("out highp vec4 fragColor;","").replace(/fragColor/g,"gl_FragColor").replace(/texture\(/g,"texture2D(")}(w),F=function(t){return t.replace(/\bin\s/g,"attribute ").replace(/\bout\s/g,"varying ").replace(/texture\(/g,"texture2D(")}(F));const 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);const 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={};const T={};this.numAttributes=p.length;for(let t=0;t<this.numAttributes;t++)p[t]&&(u.bindAttribLocation(this.program,t,p[t]),this.attributes[p[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++){const n=v[t];if(n&&!T[n]){const t=u.getUniformLocation(this.program,n);t&&(T[n]=t)}}this.fixedUniforms=o(t,T),this.terrainUniforms=((t,i)=>({u_depth:new n.b_(t,i.u_depth),u_terrain:new n.b_(t,i.u_terrain),u_terrain_dim:new n.bq(t,i.u_terrain_dim),u_terrain_matrix:new n.c0(t,i.u_terrain_matrix),u_terrain_unpack:new n.c1(t,i.u_terrain_unpack),u_terrain_exaggeration:new n.bq(t,i.u_terrain_exaggeration)}))(t,T),this.projectionUniforms=((t,i)=>({u_projection_matrix:new n.c0(t,i.u_projection_matrix),u_projection_tile_mercator_coords:new n.c1(t,i.u_projection_tile_mercator_coords),u_projection_clipping_plane:new n.c1(t,i.u_projection_clipping_plane),u_projection_transition:new n.bq(t,i.u_projection_transition),u_projection_fallback_matrix:new n.c0(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,p,f,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[ne[t]].set(c[t]);if(s)for(let t in this.fixedUniforms)this.fixedUniforms[t].set(s[t]);b&&b.setUniforms(t,this.binderUniforms,p,{zoom:f});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 t7)).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 ni(t,i,r){let o=1/n.aN(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 nr=(t,i,r,o)=>{let a=t.style.light,s=a.properties.get("position"),l=[s.x,s.y,s.z],c=n.c4();"viewport"===a.properties.get("anchor")&&n.c5(c,t.transform.bearingInRadians),n.c6(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}},no=(t,i,r,o,a,s,l)=>n.e(nr(t,i,r,o),ni(s,t,l),{u_height_factor:-Math.pow(2,a.overscaledZ)/l.tileSize/8}),na=(t,i,r,o)=>n.e(ni(i,t,r),{u_fill_translate:o}),ns=(t,n)=>({u_world:t,u_fill_translate:n}),nl=(t,i,r,o,a)=>n.e(na(t,i,r,a),{u_world:o}),nc=(t,i,r,o,a)=>{let s=t.transform,l,c,d=0;if("map"===r.paint.get("circle-pitch-alignment")){let t=n.aN(i,1,s.zoom);l=!0,c=[t,t],d=t/(n.a5*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}},nd=t=>({u_pixel_extrude_scale:[1/t.width,1/t.height]}),nu=t=>({u_viewport_size:[t.width,t.height]}),nm=(t,n=1)=>({u_color:t,u_overlay:0,u_overlay_scale:n}),nh=(t,i,r,o)=>{let a=n.aN(t,1,i)/(n.a5*Math.pow(2,t.tileID.overscaledZ))*2*Math.PI*o;return{u_extrude_scale:n.aN(t,1,i),u_intensity:r,u_globe_extrude_scale:a}},np=(t,i,r,o)=>{let a=n.N();n.c7(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")}},nf=(t,i,r)=>{var o,a;let s,l,c,d=r.paint.get("hillshade-accent-color");switch(r.paint.get("hillshade-method")){case"basic":c=4;break;case"combined":c=1;break;case"igor":c=2;break;case"multidirectional":c=3;break;default:c=0}let u=r.getIlluminationProperties();for(let n=0;n<u.directionRadians.length;n++)"viewport"===r.paint.get("hillshade-illumination-anchor")&&(u.directionRadians[n]+=t.transform.bearingInRadians);return{u_image:0,u_latrange:(o=0,s=Math.pow(2,(a=i.tileID).canonical.z),l=a.canonical.y,[new n.a9(0,l/s).toLngLat().lat,new n.a9(0,(l+1)/s).toLngLat().lat]),u_exaggeration:r.paint.get("hillshade-exaggeration"),u_altitudes:u.altitudeRadians,u_azimuths:u.directionRadians,u_accent:d,u_method:c,u_highlights:u.highlightColor,u_shadows:u.shadowColor}},nb=(t,i)=>{let r=i.stride,o=n.N();return n.c7(o,0,n.a5,-n.a5,0,0,1),n.O(o,o,[0,-n.a5,0]),{u_matrix:o,u_image:1,u_dimension:[r,r],u_zoom:t.overscaledZ,u_unpack:i.getUnpackVector()}},ng=(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")}),n_=(t,i,r,o)=>{let a=t.transform;return{u_translation:nk(t,i,r),u_ratio:o/n.aN(i,1,a.zoom),u_device_pixel_ratio:t.pixelRatio,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},ny=(t,i,r,o,a)=>n.e(n_(t,i,r,o),{u_image:0,u_image_height:a}),nv=(t,i,r,o,a)=>{let s=t.transform,l=nF(i,s);return{u_translation:nk(t,i,r),u_texsize:i.imageAtlasTexture.size,u_ratio:o/n.aN(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]]}},nx=(t,i,r,o,a)=>{let s=nF(i,t.transform);return n.e(n_(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})},nw=(t,i,r,o,a,s)=>{let l=nF(i,t.transform);return n.e(n_(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 nF(t,i){return 1/n.aN(t,1,i.tileZoom)}function nk(t,i,r){return n.aO(t.transform,i,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}let nE=(t,n,i,r,o)=>{var a,s,l;let c,d;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:(c=Math.sin(l=r.paint.get("raster-hue-rotate")*(Math.PI/180)),[(2*(d=Math.cos(l))+1)/3,(-Math.sqrt(3)*c-d+1)/3,(Math.sqrt(3)*c-d+1)/3]),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]}},nT=(t,n,i,r,o,a,s,l,c,d,u,m,h)=>{let p=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:p.cameraToCenterDistance,u_pitch:p.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:p.width/p.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}},nM=(t,i,r,o,a,s,l,c,d,u,m,h,p,f)=>{let b=l.transform;return n.e(nT(t,i,r,o,a,s,l,c,d,u,m,h,f),{u_gamma_scale:o?Math.cos(b.pitch*Math.PI/180)*b.cameraToCenterDistance:1,u_device_pixel_ratio:l.pixelRatio,u_is_halo:1})},nA=(t,i,r,o,a,s,l,c,d,u,m,h,p)=>n.e(nM(t,i,r,o,a,s,l,c,d,u,!0,m,0,p),{u_texsize_icon:h,u_texture_icon:1}),nC=(t,n)=>({u_opacity:t,u_color:n}),nS=(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.aN(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}),nD=(t,n)=>{},nL={fillExtrusion:(t,i)=>({u_lightpos:new n.c2(t,i.u_lightpos),u_lightpos_globe:new n.c2(t,i.u_lightpos_globe),u_lightintensity:new n.bq(t,i.u_lightintensity),u_lightcolor:new n.c2(t,i.u_lightcolor),u_vertical_gradient:new n.bq(t,i.u_vertical_gradient),u_opacity:new n.bq(t,i.u_opacity),u_fill_translate:new n.c3(t,i.u_fill_translate)}),fillExtrusionPattern:(t,i)=>({u_lightpos:new n.c2(t,i.u_lightpos),u_lightpos_globe:new n.c2(t,i.u_lightpos_globe),u_lightintensity:new n.bq(t,i.u_lightintensity),u_lightcolor:new n.c2(t,i.u_lightcolor),u_vertical_gradient:new n.bq(t,i.u_vertical_gradient),u_height_factor:new n.bq(t,i.u_height_factor),u_opacity:new n.bq(t,i.u_opacity),u_fill_translate:new n.c3(t,i.u_fill_translate),u_image:new n.b_(t,i.u_image),u_texsize:new n.c3(t,i.u_texsize),u_pixel_coord_upper:new n.c3(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new n.c3(t,i.u_pixel_coord_lower),u_scale:new n.c2(t,i.u_scale),u_fade:new n.bq(t,i.u_fade)}),fill:(t,i)=>({u_fill_translate:new n.c3(t,i.u_fill_translate)}),fillPattern:(t,i)=>({u_image:new n.b_(t,i.u_image),u_texsize:new n.c3(t,i.u_texsize),u_pixel_coord_upper:new n.c3(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new n.c3(t,i.u_pixel_coord_lower),u_scale:new n.c2(t,i.u_scale),u_fade:new n.bq(t,i.u_fade),u_fill_translate:new n.c3(t,i.u_fill_translate)}),fillOutline:(t,i)=>({u_world:new n.c3(t,i.u_world),u_fill_translate:new n.c3(t,i.u_fill_translate)}),fillOutlinePattern:(t,i)=>({u_world:new n.c3(t,i.u_world),u_image:new n.b_(t,i.u_image),u_texsize:new n.c3(t,i.u_texsize),u_pixel_coord_upper:new n.c3(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new n.c3(t,i.u_pixel_coord_lower),u_scale:new n.c2(t,i.u_scale),u_fade:new n.bq(t,i.u_fade),u_fill_translate:new n.c3(t,i.u_fill_translate)}),circle:(t,i)=>({u_camera_to_center_distance:new n.bq(t,i.u_camera_to_center_distance),u_scale_with_map:new n.b_(t,i.u_scale_with_map),u_pitch_with_map:new n.b_(t,i.u_pitch_with_map),u_extrude_scale:new n.c3(t,i.u_extrude_scale),u_device_pixel_ratio:new n.bq(t,i.u_device_pixel_ratio),u_globe_extrude_scale:new n.bq(t,i.u_globe_extrude_scale),u_translate:new n.c3(t,i.u_translate)}),collisionBox:(t,i)=>({u_pixel_extrude_scale:new n.c3(t,i.u_pixel_extrude_scale)}),collisionCircle:(t,i)=>({u_viewport_size:new n.c3(t,i.u_viewport_size)}),debug:(t,i)=>({u_color:new n.b$(t,i.u_color),u_overlay:new n.b_(t,i.u_overlay),u_overlay_scale:new n.bq(t,i.u_overlay_scale)}),depth:nD,clippingMask:nD,heatmap:(t,i)=>({u_extrude_scale:new n.bq(t,i.u_extrude_scale),u_intensity:new n.bq(t,i.u_intensity),u_globe_extrude_scale:new n.bq(t,i.u_globe_extrude_scale)}),heatmapTexture:(t,i)=>({u_matrix:new n.c0(t,i.u_matrix),u_world:new n.c3(t,i.u_world),u_image:new n.b_(t,i.u_image),u_color_ramp:new n.b_(t,i.u_color_ramp),u_opacity:new n.bq(t,i.u_opacity)}),hillshade:(t,i)=>({u_image:new n.b_(t,i.u_image),u_latrange:new n.c3(t,i.u_latrange),u_exaggeration:new n.bq(t,i.u_exaggeration),u_altitudes:new n.c9(t,i.u_altitudes),u_azimuths:new n.c9(t,i.u_azimuths),u_accent:new n.b$(t,i.u_accent),u_method:new n.b_(t,i.u_method),u_shadows:new n.c8(t,i.u_shadows),u_highlights:new n.c8(t,i.u_highlights)}),hillshadePrepare:(t,i)=>({u_matrix:new n.c0(t,i.u_matrix),u_image:new n.b_(t,i.u_image),u_dimension:new n.c3(t,i.u_dimension),u_zoom:new n.bq(t,i.u_zoom),u_unpack:new n.c1(t,i.u_unpack)}),colorRelief:(t,i)=>({u_image:new n.b_(t,i.u_image),u_unpack:new n.c1(t,i.u_unpack),u_dimension:new n.c3(t,i.u_dimension),u_elevation_stops:new n.b_(t,i.u_elevation_stops),u_color_stops:new n.b_(t,i.u_color_stops),u_color_ramp_size:new n.b_(t,i.u_color_ramp_size),u_opacity:new n.bq(t,i.u_opacity)}),line:(t,i)=>({u_translation:new n.c3(t,i.u_translation),u_ratio:new n.bq(t,i.u_ratio),u_device_pixel_ratio:new n.bq(t,i.u_device_pixel_ratio),u_units_to_pixels:new n.c3(t,i.u_units_to_pixels)}),lineGradient:(t,i)=>({u_translation:new n.c3(t,i.u_translation),u_ratio:new n.bq(t,i.u_ratio),u_device_pixel_ratio:new n.bq(t,i.u_device_pixel_ratio),u_units_to_pixels:new n.c3(t,i.u_units_to_pixels),u_image:new n.b_(t,i.u_image),u_image_height:new n.bq(t,i.u_image_height)}),linePattern:(t,i)=>({u_translation:new n.c3(t,i.u_translation),u_texsize:new n.c3(t,i.u_texsize),u_ratio:new n.bq(t,i.u_ratio),u_device_pixel_ratio:new n.bq(t,i.u_device_pixel_ratio),u_image:new n.b_(t,i.u_image),u_units_to_pixels:new n.c3(t,i.u_units_to_pixels),u_scale:new n.c2(t,i.u_scale),u_fade:new n.bq(t,i.u_fade)}),lineSDF:(t,i)=>({u_translation:new n.c3(t,i.u_translation),u_ratio:new n.bq(t,i.u_ratio),u_device_pixel_ratio:new n.bq(t,i.u_device_pixel_ratio),u_units_to_pixels:new n.c3(t,i.u_units_to_pixels),u_image:new n.b_(t,i.u_image),u_mix:new n.bq(t,i.u_mix),u_tileratio:new n.bq(t,i.u_tileratio),u_crossfade_from:new n.bq(t,i.u_crossfade_from),u_crossfade_to:new n.bq(t,i.u_crossfade_to),u_lineatlas_width:new n.bq(t,i.u_lineatlas_width),u_lineatlas_height:new n.bq(t,i.u_lineatlas_height)}),lineGradientSDF:(t,i)=>({u_translation:new n.c3(t,i.u_translation),u_ratio:new n.bq(t,i.u_ratio),u_device_pixel_ratio:new n.bq(t,i.u_device_pixel_ratio),u_units_to_pixels:new n.c3(t,i.u_units_to_pixels),u_image:new n.b_(t,i.u_image),u_image_height:new n.bq(t,i.u_image_height),u_tileratio:new n.bq(t,i.u_tileratio),u_crossfade_from:new n.bq(t,i.u_crossfade_from),u_crossfade_to:new n.bq(t,i.u_crossfade_to),u_image_dash:new n.b_(t,i.u_image_dash),u_mix:new n.bq(t,i.u_mix),u_lineatlas_width:new n.bq(t,i.u_lineatlas_width),u_lineatlas_height:new n.bq(t,i.u_lineatlas_height)}),raster:(t,i)=>({u_tl_parent:new n.c3(t,i.u_tl_parent),u_scale_parent:new n.bq(t,i.u_scale_parent),u_buffer_scale:new n.bq(t,i.u_buffer_scale),u_fade_t:new n.bq(t,i.u_fade_t),u_opacity:new n.bq(t,i.u_opacity),u_image0:new n.b_(t,i.u_image0),u_image1:new n.b_(t,i.u_image1),u_brightness_low:new n.bq(t,i.u_brightness_low),u_brightness_high:new n.bq(t,i.u_brightness_high),u_saturation_factor:new n.bq(t,i.u_saturation_factor),u_contrast_factor:new n.bq(t,i.u_contrast_factor),u_spin_weights:new n.c2(t,i.u_spin_weights),u_coords_top:new n.c1(t,i.u_coords_top),u_coords_bottom:new n.c1(t,i.u_coords_bottom)}),symbolIcon:(t,i)=>({u_is_size_zoom_constant:new n.b_(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new n.b_(t,i.u_is_size_feature_constant),u_size_t:new n.bq(t,i.u_size_t),u_size:new n.bq(t,i.u_size),u_camera_to_center_distance:new n.bq(t,i.u_camera_to_center_distance),u_pitch:new n.bq(t,i.u_pitch),u_rotate_symbol:new n.b_(t,i.u_rotate_symbol),u_aspect_ratio:new n.bq(t,i.u_aspect_ratio),u_fade_change:new n.bq(t,i.u_fade_change),u_label_plane_matrix:new n.c0(t,i.u_label_plane_matrix),u_coord_matrix:new n.c0(t,i.u_coord_matrix),u_is_text:new n.b_(t,i.u_is_text),u_pitch_with_map:new n.b_(t,i.u_pitch_with_map),u_is_along_line:new n.b_(t,i.u_is_along_line),u_is_variable_anchor:new n.b_(t,i.u_is_variable_anchor),u_texsize:new n.c3(t,i.u_texsize),u_texture:new n.b_(t,i.u_texture),u_translation:new n.c3(t,i.u_translation),u_pitched_scale:new n.bq(t,i.u_pitched_scale)}),symbolSDF:(t,i)=>({u_is_size_zoom_constant:new n.b_(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new n.b_(t,i.u_is_size_feature_constant),u_size_t:new n.bq(t,i.u_size_t),u_size:new n.bq(t,i.u_size),u_camera_to_center_distance:new n.bq(t,i.u_camera_to_center_distance),u_pitch:new n.bq(t,i.u_pitch),u_rotate_symbol:new n.b_(t,i.u_rotate_symbol),u_aspect_ratio:new n.bq(t,i.u_aspect_ratio),u_fade_change:new n.bq(t,i.u_fade_change),u_label_plane_matrix:new n.c0(t,i.u_label_plane_matrix),u_coord_matrix:new n.c0(t,i.u_coord_matrix),u_is_text:new n.b_(t,i.u_is_text),u_pitch_with_map:new n.b_(t,i.u_pitch_with_map),u_is_along_line:new n.b_(t,i.u_is_along_line),u_is_variable_anchor:new n.b_(t,i.u_is_variable_anchor),u_texsize:new n.c3(t,i.u_texsize),u_texture:new n.b_(t,i.u_texture),u_gamma_scale:new n.bq(t,i.u_gamma_scale),u_device_pixel_ratio:new n.bq(t,i.u_device_pixel_ratio),u_is_halo:new n.b_(t,i.u_is_halo),u_translation:new n.c3(t,i.u_translation),u_pitched_scale:new n.bq(t,i.u_pitched_scale)}),symbolTextAndIcon:(t,i)=>({u_is_size_zoom_constant:new n.b_(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new n.b_(t,i.u_is_size_feature_constant),u_size_t:new n.bq(t,i.u_size_t),u_size:new n.bq(t,i.u_size),u_camera_to_center_distance:new n.bq(t,i.u_camera_to_center_distance),u_pitch:new n.bq(t,i.u_pitch),u_rotate_symbol:new n.b_(t,i.u_rotate_symbol),u_aspect_ratio:new n.bq(t,i.u_aspect_ratio),u_fade_change:new n.bq(t,i.u_fade_change),u_label_plane_matrix:new n.c0(t,i.u_label_plane_matrix),u_coord_matrix:new n.c0(t,i.u_coord_matrix),u_is_text:new n.b_(t,i.u_is_text),u_pitch_with_map:new n.b_(t,i.u_pitch_with_map),u_is_along_line:new n.b_(t,i.u_is_along_line),u_is_variable_anchor:new n.b_(t,i.u_is_variable_anchor),u_texsize:new n.c3(t,i.u_texsize),u_texsize_icon:new n.c3(t,i.u_texsize_icon),u_texture:new n.b_(t,i.u_texture),u_texture_icon:new n.b_(t,i.u_texture_icon),u_gamma_scale:new n.bq(t,i.u_gamma_scale),u_device_pixel_ratio:new n.bq(t,i.u_device_pixel_ratio),u_is_halo:new n.b_(t,i.u_is_halo),u_translation:new n.c3(t,i.u_translation),u_pitched_scale:new n.bq(t,i.u_pitched_scale)}),background:(t,i)=>({u_opacity:new n.bq(t,i.u_opacity),u_color:new n.b$(t,i.u_color)}),backgroundPattern:(t,i)=>({u_opacity:new n.bq(t,i.u_opacity),u_image:new n.b_(t,i.u_image),u_pattern_tl_a:new n.c3(t,i.u_pattern_tl_a),u_pattern_br_a:new n.c3(t,i.u_pattern_br_a),u_pattern_tl_b:new n.c3(t,i.u_pattern_tl_b),u_pattern_br_b:new n.c3(t,i.u_pattern_br_b),u_texsize:new n.c3(t,i.u_texsize),u_mix:new n.bq(t,i.u_mix),u_pattern_size_a:new n.c3(t,i.u_pattern_size_a),u_pattern_size_b:new n.c3(t,i.u_pattern_size_b),u_scale_a:new n.bq(t,i.u_scale_a),u_scale_b:new n.bq(t,i.u_scale_b),u_pixel_coord_upper:new n.c3(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new n.c3(t,i.u_pixel_coord_lower),u_tile_units_to_pixels:new n.bq(t,i.u_tile_units_to_pixels)}),terrain:(t,i)=>({u_texture:new n.b_(t,i.u_texture),u_ele_delta:new n.bq(t,i.u_ele_delta),u_fog_matrix:new n.c0(t,i.u_fog_matrix),u_fog_color:new n.b$(t,i.u_fog_color),u_fog_ground_blend:new n.bq(t,i.u_fog_ground_blend),u_fog_ground_blend_opacity:new n.bq(t,i.u_fog_ground_blend_opacity),u_horizon_color:new n.b$(t,i.u_horizon_color),u_horizon_fog_blend:new n.bq(t,i.u_horizon_fog_blend),u_is_globe_mode:new n.bq(t,i.u_is_globe_mode)}),terrainDepth:(t,i)=>({u_ele_delta:new n.bq(t,i.u_ele_delta)}),terrainCoords:(t,i)=>({u_texture:new n.b_(t,i.u_texture),u_terrain_coords_id:new n.bq(t,i.u_terrain_coords_id),u_ele_delta:new n.bq(t,i.u_ele_delta)}),projectionErrorMeasurement:(t,i)=>({u_input:new n.bq(t,i.u_input),u_output_expected:new n.bq(t,i.u_output_expected)}),atmosphere:(t,i)=>({u_sun_pos:new n.c2(t,i.u_sun_pos),u_atmosphere_blend:new n.bq(t,i.u_atmosphere_blend),u_globe_position:new n.c2(t,i.u_globe_position),u_globe_radius:new n.bq(t,i.u_globe_radius),u_inv_proj_matrix:new n.c0(t,i.u_inv_proj_matrix)}),sky:(t,i)=>({u_sky_color:new n.b$(t,i.u_sky_color),u_horizon_color:new n.b$(t,i.u_horizon_color),u_horizon:new n.c3(t,i.u_horizon),u_horizon_normal:new n.c3(t,i.u_horizon_normal),u_sky_horizon_blend:new n.bq(t,i.u_sky_horizon_blend),u_sky_blend:new n.bq(t,i.u_sky_blend)})};class nI{constructor(t,n,i){this.context=t;const 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 nP={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class nO{constructor(t,n,i,r){this.length=n.length,this.attributes=i,this.itemSize=n.bytesPerElement,this.dynamicDraw=r,this.context=t;const 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[nP[o.type]],!1,this.itemSize,o.offset+this.itemSize*(i||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class nR{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 nB extends nR{getDefault(){return n.bp.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 nz extends nR{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class nY extends nR{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class nN extends nR{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 nj extends nR{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class nH extends nR{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class nU extends nR{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 nV extends nR{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 nq extends nR{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 nG extends nR{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 n$ extends nR{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 nW extends nR{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class nX extends nR{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 nZ extends nR{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 nK extends nR{getDefault(){return n.bp.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 nJ extends nR{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class nQ extends nR{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 n0 extends nR{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class n1 extends nR{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}class n2 extends nR{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}}class n5 extends nR{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class n3 extends nR{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 n4 extends nR{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 n6 extends nR{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 n8 extends nR{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 n7 extends nR{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 n9 extends nR{getDefault(){return null}set(t){let n=this.gl;n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class ie extends nR{getDefault(){return null}set(t){var n;if(t===this.current&&!this.dirty)return;let i=this.gl;tS(i)?i.bindVertexArray(t):null==(n=i.getExtension("OES_vertex_array_object"))||n.bindVertexArrayOES(t),this.current=t,this.dirty=!1}}class it extends nR{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 ii extends nR{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 ir extends nR{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 io extends nR{constructor(t,n){super(t),this.context=t,this.parent=n}getDefault(){return null}}class ia extends io{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 is extends io{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 il extends io{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 ic="Framebuffer is not complete";class id{constructor(t,n,i,r,o){this.context=t,this.width=n,this.height=i;const a=t.gl,s=this.framebuffer=a.createFramebuffer();if(this.colorAttachment=new ia(t,s),r)this.depthAttachment=o?new il(t,s):new is(t,s);else if(o)throw Error("Stencil cannot be set without depth");if(a.checkFramebufferStatus(a.FRAMEBUFFER)!==a.FRAMEBUFFER_COMPLETE)throw Error(ic)}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 iu{constructor(t){var n,i;if(this.gl=t,this.clearColor=new nB(this),this.clearDepth=new nz(this),this.clearStencil=new nY(this),this.colorMask=new nN(this),this.depthMask=new nj(this),this.stencilMask=new nH(this),this.stencilFunc=new nU(this),this.stencilOp=new nV(this),this.stencilTest=new nq(this),this.depthRange=new nG(this),this.depthTest=new n$(this),this.depthFunc=new nW(this),this.blend=new nX(this),this.blendFunc=new nZ(this),this.blendColor=new nK(this),this.blendEquation=new nJ(this),this.cullFace=new nQ(this),this.cullFaceSide=new n0(this),this.frontFace=new n1(this),this.program=new n2(this),this.activeTexture=new n5(this),this.viewport=new n3(this),this.bindFramebuffer=new n4(this),this.bindRenderbuffer=new n6(this),this.bindTexture=new n8(this),this.bindVertexBuffer=new n7(this),this.bindElementBuffer=new n9(this),this.bindVertexArray=new ie(this),this.pixelStoreUnpack=new it(this),this.pixelStoreUnpackPremultiplyAlpha=new ii(this),this.pixelStoreUnpackFlipY=new ir(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),tS(t)){this.HALF_FLOAT=t.HALF_FLOAT;const 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");const 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 nI(this,t,n)}createVertexBuffer(t,n,i){return new nO(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 id(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.bR(t.blendFunction,tE.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 tS(this.gl)?this.gl.createVertexArray():null==(t=this.gl.getExtension("OES_vertex_array_object"))?void 0:t.createVertexArrayOES()}deleteVertexArray(t){var n;return tS(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 im(t,i,r,o,a){let s=t.context,l=t.transform,d=s.gl,u=t.useProgram("collisionBox"),m=[],h=0,p=0;for(let n=0;n<o.length;n++){let c=o[n],f=i.getTile(c).getBucket(r);if(!f)continue;let b=a?f.textCollisionBox:f.iconCollisionBox,g=f.collisionCircleArray;g.length>0&&(m.push({circleArray:g,circleOffset:p,coord:c}),h+=g.length/4,p=h),b&&u.draw(s,d.LINES,tM.disabled,tA.disabled,t.colorModeForRenderPass(),tT.disabled,nd(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 f=t.useProgram("collisionCircle"),b=new n.ca;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.cc;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.cb.members,!0);for(let i of m){let o=nu(t.transform);f.draw(s,d.TRIANGLES,tM.disabled,tA.disabled,t.colorModeForRenderPass(),tT.disabled,o,t.style.map.terrain&&t.style.map.terrain.getTerrainData(i.coord),null,r.id,y,_,n.aX.simpleSegment(0,2*i.circleOffset,i.circleArray.length,i.circleArray.length/2),null,t.transform.zoom,null,null,null)}y.destroy(),_.destroy()}let ih=n.ar(new Float32Array(16));function ip(t,i,r,o,a,s,l,c,d,u,m,h,p){let f=t.context,b=f.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,tM.ReadOnly),E=r._unevaluatedLayout.hasValue("text-variable-anchor")||r._unevaluatedLayout.hasValue("text-variable-anchor-offset"),T=[],M=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),f=a||d.sdfIcons,k=a?d.textSizeData:d.iconSizeData,A=y||0!==g.pitch,C=t.useProgram(d.iconsInText&&a?"symbolTextAndIcon":f?"symbolSDF":"symbolIcon",h),S=n.ay(k,g.zoom),D=t.style.map.terrain&&t.style.map.terrain.getTerrainData(c),L,I,P,O,R=[0,0],B=null;if(a)I=o.glyphAtlasTexture,P=b.LINEAR,L=o.glyphAtlasTexture.size,d.iconsInText&&(R=o.imageAtlasTexture.size,B=o.imageAtlasTexture,O=A||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;I=o.imageAtlasTexture,P=f||t.options.rotating||t.options.zooming||n||A?b.LINEAR:b.NEAREST,L=o.imageAtlasTexture.size}let z=n.aN(o,1,t.transform.zoom),Y=eO(_,t.transform,z),N=n.N();n.aB(N,Y);let j=function(t,i,r,o){if(t){let t=n.N();if(!i){let{vecSouth:n,vecEast:i}=eR(r);t[0]=i[0],t[1]=i[1],t[4]=n[0],t[5]=n[1]}return n.Q(t,t,[o,o,1]),t}return r.pixelsToClipSpaceMatrix}(y,_,t.transform,z),H=n.aO(g,o,s,l),U=g.getProjectionData({overscaledTileID:c,applyGlobeMatrix:!p,applyTerrainMatrix:!0}),V=E&&d.hasTextData(),q="none"!==r.layout.get("icon-text-fit")&&V&&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,p){let f=r?t.textSizeData:t.iconSizeData,b=n.ay(f,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.az.vertical&&!w){eX(k.numGlyphs,_);continue}w=!1;let E=new n.P(k.anchorX,k.anchorY),T={getElevation:p,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},M=eq(k.anchorX,k.anchorY,T);if(F=M.point,!(F.x>=-g[0]&&F.x<=g[0]&&F.y>=-g[1])||!(F.y<=g[1])){eX(k.numGlyphs,_);continue}let A=.5+i.transform.cameraToCenterDistance/M.signedDistanceFromCamera*.5,C=n.aA(f,b,k),S=s?C*i.transform.getPitchedTextCorrection(k.anchorX,k.anchorY,d)/A:C*A,D=eN({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&&eN({projectionContext:T,pitchedLabelPlaneMatrixInverse:a,symbol:k,fontSize:S,flip:!0,keepUpright:l,glyphOffsetArray:t.glyphOffsetArray,dynamicLayoutVertexArray:_,aspectRatio:x,rotateToLine:c}).notEnoughRoom)&&eX(k.numGlyphs,_)}r?t.text.dynamicLayoutVertexBuffer.updateData(_):t.icon.dynamicLayoutVertexBuffer.updateData(_)}(d,t,a,Y,N,y,u,"map"===r.layout.get("text-rotation-alignment"),c.toUnwrapped(),g.width,g.height,H,i)}let G=a&&E||q,$=v||G?ih:y?Y:t.transform.clipSpaceToPixelsMatrix,W=f&&0!==r.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1),X={program:C,buffers:m,uniformValues:f?d.iconsInText?nA(k.kind,S,x,y,v,G,t,$,j,H,L,R,M):nM(k.kind,S,x,y,v,G,t,$,j,H,a,L,0,M):nT(k.kind,S,x,y,v,G,t,$,j,H,a,L,M),projectionData:U,atlasTexture:I,atlasTextureIcon:B,atlasInterpolation:P,atlasInterpolationIcon:O,isSDF:f,hasHalo:W};if(w&&d.canOverlap)for(let t of(F=!0,m.segments.get()))T.push({segments:new n.aX([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(f.activeTexture.set(b.TEXTURE0),i.atlasTexture.bind(i.atlasInterpolation,b.CLAMP_TO_EDGE),i.atlasTextureIcon&&(f.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,ib(i.buffers,n.segments,r,t,i.program,k,m,h,o,i.projectionData,n.terrainData)),o.u_is_halo=0}ib(i.buffers,n.segments,r,t,i.program,k,m,h,i.uniformValues,i.projectionData,n.terrainData)}}function ib(t,n,i,r,o,a,s,l,c,d,u){let m=r.context;o.draw(m,m.gl.TRIANGLES,a,s,l,tT.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 ig(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 i_(t,i){return i.colorRampTexture||(i.colorRampTexture=new n.T(t,i.colorRamp,t.gl.RGBA)),i.colorRampTexture}function iy(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.an(n.ce(s.maxLineLength/n.a5*1024*a),256,r.maxTextureSize)}return c.gradient=n.cf({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 iv(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 ix(t,i,r,o,a,s,l,c){let d,u,m,h,p,f=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=f.LINES):(u=_?"fillPattern":"fill",d=f.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),M=t.style.map.terrain&&t.style.map.terrain.getTerrainData(g);_&&(t.context.activeTexture.set(f.TEXTURE0),o.imageAtlasTexture.bind(f.LINEAR,f.CLAMP_TO_EDGE),E.updatePaintBuffers(y)),iv(E,b,F,o,r);let A=v.getProjectionData({overscaledTileID:g,applyGlobeMatrix:!c,applyTerrainMatrix:!0}),C=n.aO(v,o,x,w);if(l){h=k.indexBuffer2,p=k.segments2;let n=[f.drawingBufferWidth,f.drawingBufferHeight];m="fillOutlinePattern"===u&&_?nl(t,y,o,n,C):ns(n,C)}else h=k.indexBuffer,p=k.segments,m=_?na(t,y,o,C):{u_fill_translate:C};let S=t.stencilModeForClipping(g);T.draw(t.context,d,a,S,s,tT.backCCW,m,M,A,r.id,k.layoutVertexBuffer,h,p,r.paint,t.transform.zoom,E)}}function iw(t,i,r,o,a,s,l,c){let d=t.context,u=d.gl,m="fill-extrusion-pattern",h=r.paint.get(m),p=h.constantOr(1),f=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(p?"fillExtrusionPattern":"fillExtrusion",x);p&&(t.context.activeTexture.set(u.TEXTURE0),o.imageAtlasTexture.bind(u.LINEAR,u.CLAMP_TO_EDGE),x.updatePaintBuffers(f));let F=_.getProjectionData({overscaledTileID:h,applyGlobeMatrix:!c,applyTerrainMatrix:!0});iv(x,m,g,o,r);let k=n.aO(_,o,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),E=r.paint.get("fill-extrusion-vertical-gradient"),T=p?no(t,E,b,k,h,f,o):nr(t,E,b,k);w.draw(d,d.gl.TRIANGLES,a,s,l,tT.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 iF(t,n,i,r,o,a,s,l,c){var d;let u=t.style.projection,m=t.context,h=t.transform,p=m.gl,f=[`#define NUM_ILLUMINATION_SOURCES ${i.paint.get("hillshade-highlight-color").values.length}`],b=t.useProgram("hillshade",null,!1,f),g=!t.options.moving;for(let f of r){let r=n.getTile(f),_=r.fbo;if(!_)continue;let y=u.getMeshFromTileID(m,f.canonical,l,!0,"raster"),v=null==(d=t.style.map.terrain)?void 0:d.getTerrainData(f);m.activeTexture.set(p.TEXTURE0),p.bindTexture(p.TEXTURE_2D,_.colorAttachment.get());let x=h.getProjectionData({overscaledTileID:f,aligned:g,applyGlobeMatrix:!c,applyTerrainMatrix:!0});b.draw(m,p.TRIANGLES,a,o[f.overscaledZ],s,tT.backCCW,nf(t,r,i),v,x,i.id,y.vertexBuffer,y.indexBuffer,y.segments)}}function ik(t,i,r,o,a,s,l,c,d){var u;let m=t.style.projection,h=t.context,p=t.transform,f=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=f.getParameter(f.MAX_TEXTURE_SIZE),{elevationTexture:n,colorTexture:i}=r.getColorRampTextures(h,t,x.getUnpackVector());h.activeTexture.set(f.TEXTURE1),n.bind(f.NEAREST,f.CLAMP_TO_EDGE),h.activeTexture.set(f.TEXTURE4),i.bind(f.LINEAR,f.CLAMP_TO_EDGE),_=!1,y=n.size[0]}if(!x||!x.data)continue;let w=x.stride,F=x.getPixels();if(h.activeTexture.set(f.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(f.LINEAR,f.CLAMP_TO_EDGE)}else o.demTexture=new n.T(h,F,f.RGBA,{premultiply:!1}),o.demTexture.bind(f.LINEAR,f.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=p.getProjectionData({overscaledTileID:v,aligned:g,applyGlobeMatrix:!d,applyTerrainMatrix:!0});b.draw(h,f.TRIANGLES,s,a[v.overscaledZ],l,tT.backCCW,ng(r,o.dem,y),E,T,r.id,k.vertexBuffer,k.indexBuffer,k.segments)}}let iE=[new n.P(0,0),new n.P(n.a5,0),new n.P(n.a5,n.a5),new n.P(0,n.a5)];function iT(t,i,r,o,a,s,l,c,d=!1,u=!1){let m=o[o.length-1].overscaledZ,h=t.context,p=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?tM.ReadWrite:tM.ReadOnly,p.LESS),M=i.getTile(T),A="nearest"===F?p.NEAREST:p.LINEAR;h.activeTexture.set(p.TEXTURE0),M.texture.bind(A,p.CLAMP_TO_EDGE,p.LINEAR_MIPMAP_NEAREST),h.activeTexture.set(p.TEXTURE1);let{parentTile:C,parentScaleBy:S,parentTopLeft:D,fadeValues:L}=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,s,l,c,d,u,m=i.getLoadedTile(t.fadingParentID);if(!m)return a;let h=Math.pow(2,m.tileID.overscaledZ-t.tileID.overscaledZ),p=[t.tileID.canonical.x*h%1,t.tileID.canonical.y*h%1],b=(s=((o=v())-m.timeAdded)/r,l=t.fadingDirection===f.Incoming,c=n.an((o-t.timeAdded)/r,0,1),d=n.an(1-s,0,1),{tileOpacity:u=l?c:d,parentTileOpacity:l?d:c,fadeMix:{opacity:1,mix:1-u}});return{parentTile:m,parentScaleBy:h,parentTopLeft:p,fadeValues:b}}if(t.selfFading){let i,o;return{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:(i=(v()-t.timeAdded)/r,{tileOpacity:o=n.an(i,0,1),fadeMix:{opacity:o,mix:0}})}}return a}(M,i,k,E);M.fadeOpacity=L.tileOpacity,C?(C.fadeOpacity=L.parentTileOpacity,C.texture.bind(A,p.CLAMP_TO_EDGE,p.LINEAR_MIPMAP_NEAREST)):M.texture.bind(A,p.CLAMP_TO_EDGE,p.LINEAR_MIPMAP_NEAREST),M.texture.useMipmap&&h.extTextureFilterAnisotropic&&t.transform.pitch>t.options.anisotropicFilterPitch&&p.texParameterf(p.TEXTURE_2D,h.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,h.extTextureFilterAnisotropicMax);let I=t.style.map.terrain&&t.style.map.terrain.getTerrainData(T),P=g.getProjectionData({overscaledTileID:T,aligned:x,applyGlobeMatrix:!u,applyTerrainMatrix:!0}),O=nE(D,S,L.fadeMix,r,c),R=_.getMeshFromTileID(h,T.canonical,s,l,"raster");b.draw(h,p.TRIANGLES,o,a?a[T.overscaledZ]:tA.disabled,y,d?tT.frontCCW:tT.backCCW,O,I,P,r.id,R.vertexBuffer,R.indexBuffer,R.segments)}}let iM=new n.bp(1,0,0,1),iA=new n.bp(0,1,0,1),iC=new n.bp(0,0,1,1),iS=new n.bp(1,0,1,1),iD=new n.bp(0,1,1,1);function iL(t,n,i,r){iP(t,0,n+i/2,t.transform.width,i,r)}function iI(t,n,i,r){iP(t,n-i/2,0,i,t.transform.height,r)}function iP(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 iO(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 p=t9(n.getMeshFrameDelta(l.zoom),l.calculateFogMatrix(r.tileID.toUnwrapped()),t.style.sky,l.pitch,o),f=l.getProjectionData({overscaledTileID:r.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});u.draw(a,s.TRIANGLES,d,tA.disabled,c,tT.backCCW,p,h,f,"terrain",i.vertexBuffer,i.indexBuffer,i.segments)}}function iR(t,i){if(!i.mesh){let r=new n.aW;r.emplaceBack(-1,-1),r.emplaceBack(1,-1),r.emplaceBack(1,1),r.emplaceBack(-1,1);let o=new n.aY;o.emplaceBack(0,1,2),o.emplaceBack(0,2,3),i.mesh=new tl(t.createVertexBuffer(r,tc.members),t.createIndexBuffer(o),n.aX.simpleSegment(0,0,r.length,o.length))}return i.mesh}class iB{constructor(t,i){this.context=new iu(t),this.transform=i,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:n.ar(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=eD.maxOverzooming+eD.maxUnderzooming+1,this.depthEpsilon=1/65536,this.crossTileSymbolIndex=new tr}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.aW;i.emplaceBack(0,0),i.emplaceBack(n.a5,0),i.emplaceBack(0,n.a5),i.emplaceBack(n.a5,n.a5),this.tileExtentBuffer=t.createVertexBuffer(i,tc.members),this.tileExtentSegments=n.aX.simpleSegment(0,0,4,2);let r=new n.aW;r.emplaceBack(0,0),r.emplaceBack(n.a5,0),r.emplaceBack(0,n.a5),r.emplaceBack(n.a5,n.a5),this.debugBuffer=t.createVertexBuffer(r,tc.members),this.debugSegments=n.aX.simpleSegment(0,0,4,5);let o=new n.ch;o.emplaceBack(0,0,0,0),o.emplaceBack(n.a5,0,n.a5,0),o.emplaceBack(0,n.a5,0,n.a5),o.emplaceBack(n.a5,n.a5,n.a5,n.a5),this.rasterBoundsBuffer=t.createVertexBuffer(o,t8.members),this.rasterBoundsSegments=n.aX.simpleSegment(0,0,4,2);let a=new n.aW;a.emplaceBack(0,0),a.emplaceBack(n.a5,0),a.emplaceBack(0,n.a5),a.emplaceBack(n.a5,n.a5),this.rasterBoundsBufferPosOnly=t.createVertexBuffer(a,tc.members),this.rasterBoundsSegmentsPosOnly=n.aX.simpleSegment(0,0,4,5);let s=new n.aW;s.emplaceBack(0,0),s.emplaceBack(1,0),s.emplaceBack(0,1),s.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(s,tc.members),this.viewportSegments=n.aX.simpleSegment(0,0,4,2);let l=new n.ci;l.emplaceBack(0),l.emplaceBack(1),l.emplaceBack(3),l.emplaceBack(2),l.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(l);let c=new n.aY;c.emplaceBack(1,0,2),c.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(c);let d=this.context.gl;this.stencilClearMode=new tA({func:d.ALWAYS,mask:0},0,255,d.ZERO,d.ZERO,d.ZERO),this.tileExtentMesh=new tl(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){let t=this.context,i=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let r=n.N();n.c7(r,0,this.width,this.height,0,0,1),n.Q(r,r,[i.drawingBufferWidth,i.drawingBufferHeight,0]),this.useProgram("clippingMask",null,!0).draw(t,i.TRIANGLES,tM.disabled,this.stencilClearMode,tE.disabled,tT.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(tE.disabled),r.setDepthMode(tM.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,tM.disabled,new tA({func:a.ALWAYS,mask:0},n,255,a.KEEP,a.KEEP,a.REPLACE),tE.disabled,i?tT.disabled:tT.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,tA.disabled,tE.disabled,tT.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 tA({func:n.NOTEQUAL,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(t){let n=this.context.gl;return new tA({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 tA({func:n.GEQUAL,mask:255},i+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=o,[t,i]}return[{[r]:tA.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 tA({func:n.GREATER,mask:255},o+1+i,255,n.KEEP,n.KEEP,n.REPLACE),a[i+r]=new tA({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 tA({func:n.GREATER,mask:255},2,255,n.KEEP,n.KEEP,n.REPLACE)},{[r]:new tA({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 tE([t.CONSTANT_COLOR,t.ONE],new n.bp(i,i,i,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?tE.unblended:tE.alphaBlended}getDepthModeForSublayer(t,n,i){if(!this.opaquePassEnabledForLayer())return tM.disabled;let r=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new tM(i||this.context.gl.LEQUAL,n,[r,r])}getDepthModeFor3D(){return new tM(this.context.gl.LEQUAL,tM.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,i){var r,o,a,s,l,c,d,u,m;let h,p,f,b,g,_,y,x,w,F,k,E,T,M;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,C=this.style.tileManagers,S={},D={},L={},I={isRenderingToTexture:!1,isRenderingGlobe:(null==(r=t.projection)?void 0:r.transitionState)>0};for(let t in C){let n=C[t];n.used&&n.prepare(this.context),S[t]=n.getVisibleCoordinates(!1),D[t]=S[t].slice().reverse(),L[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=D[n.source];("custom"===n.type||i.length)&&this.renderLayer(this,C[n.source],n,i,I)}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.bp.black:n.bp.transparent,depth:1}),this.clearStencil(),this.style.sky&&(a=this.style.sky,_=(g=this.context).gl,s=this.style.map.transform,l=this.pixelRatio,h=Math.cos(s.rollInRadians),p=Math.sin(s.rollInRadians),f=eg(s),b=s.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition,y={u_sky_color:a.properties.get("sky-color"),u_horizon_color:a.properties.get("horizon-color"),u_horizon:[(s.width/2-f*p)*l,(s.height/2+f*h)*l],u_horizon_normal:[-p,h],u_sky_horizon_blend:a.properties.get("sky-horizon-blend")*s.height/2*l,u_sky_blend:b},x=new tM(_.LEQUAL,tM.ReadWrite,[0,1]),w=tA.disabled,F=this.colorModeForRenderPass(),k=this.useProgram("sky"),E=iR(g,a),k.draw(g,_.TRIANGLES,x,w,F,tT.disabled,y,null,void 0,"sky",E.vertexBuffer,E.indexBuffer,E.segments)),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=C[t.source],i=S[t.source];this._renderTileClippingMasks(t,i,!1),this.renderLayer(this,n,t,i,I)}this.renderPass="translucent";let P=!1;for(this.currentLayer=0;this.currentLayer<A.length;this.currentLayer++){let t=this.style._layers[A[this.currentLayer]],n=C[t.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(t,I))continue;this.opaquePassEnabledForLayer()||P||(P=!0,I.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());let i=("symbol"===t.type?L:D)[t.source];this._renderTileClippingMasks(t,S[t.source],!!this.renderToTexture),this.renderLayer(this,n,t,i,I)}if(I.isRenderingGlobe&&function(t,i,r){var o;let a,s,l,c=t.context,d=c.gl,u=t.useProgram("atmosphere"),m=new tM(d.LEQUAL,tM.ReadOnly,[0,1]),h=t.transform,p=(o=t.transform,s=[-(a=r.properties.get("position")).x,-a.y,-a.z],l=n.ar(new Float64Array(16)),"map"===r.properties.get("anchor")&&(n.bg(l,l,o.rollInRadians),n.bh(l,l,-o.pitchInRadians),n.bg(l,l,o.bearingInRadians),n.bh(l,l,o.center.lat*Math.PI/180),n.bJ(l,l,-o.center.lng*Math.PI/180)),n.cg(s,s,l),s),f=h.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),b=i.properties.get("atmosphere-blend")*f.projectionTransition;if(0===b)return;let g=tj(h.worldSize,h.center.lat),_=h.inverseProjectionMatrix,y=new Float64Array(4);y[3]=1,n.aH(y,y,h.modelViewProjectionMatrix),y[0]/=y[3],y[1]/=y[3],y[2]/=y[3],y[3]=1,n.aH(y,y,_),y[0]/=y[3],y[1]/=y[3],y[2]/=y[3],y[3]=1;let v={u_sun_pos:p,u_atmosphere_blend:b,u_globe_position:[y[0],y[1],y[2]],u_globe_radius:g,u_inv_proj_matrix:_},x=iR(c,i);u.draw(c,d.TRIANGLES,m,tA.disabled,tE.alphaBlended,tT.disabled,v,null,null,"atmosphere",x.vertexBuffer,x.indexBuffer,x.segments)}(this,this.style.sky,this.style.light),this.options.showTileBoundaries){let t,i,r,o,a,s=(c=this.style,d=this.transform.zoom,t=null,r=(i=Object.values(c._layers).flatMap(t=>t.source&&!t.isHidden(d)?[c.tileManagers[t.source]]:[])).filter(t=>"vector"===t.getSource().type),o=i.filter(t=>"vector"!==t.getSource().type),a=n=>{(!t||t.getSource().maxzoom<n.getSource().maxzoom)&&(t=n)},r.forEach(t=>a(t)),t||o.forEach(t=>a(t)),t);s&&function(t,i,r){for(let o=0;o<r.length;o++)!function(t,i,r){var o;let a,s,l,c=t.context,d=c.gl,u=t.useProgram("debug"),m=tM.disabled,h=tA.disabled,p=t.colorModeForRenderPass(),f="$debug",b=t.style.map.terrain&&t.style.map.terrain.getTerrainData(r);c.activeTexture.set(d.TEXTURE0);let g=i.getTileByID(r.key).latestRawTileData,_=Math.floor((g&&g.byteLength||0)/1024),y=512/Math.min(i.getTile(r).tileSize,512)*(r.overscaledZ/t.transform.zoom)*.5,v=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(v+=` => ${r.overscaledZ}`),o=`${v} ${_}kB`,t.initDebugOverlayCanvas(),a=t.debugOverlayCanvas,s=t.context.gl,(l=t.debugOverlayCanvas.getContext("2d")).clearRect(0,0,a.width,a.height),l.shadowColor="white",l.shadowBlur=2,l.lineWidth=1.5,l.strokeStyle="white",l.textBaseline="top",l.font="bold 36px Open Sans, sans-serif",l.fillText(o,5,5),l.strokeText(o,5,5),t.debugOverlayTexture.update(a),t.debugOverlayTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE);let x=t.transform.getProjectionData({overscaledTileID:r,applyGlobeMatrix:!0,applyTerrainMatrix:!0});u.draw(c,d.TRIANGLES,m,h,tE.alphaBlended,tT.disabled,nm(n.bp.transparent,y),null,x,f,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments),u.draw(c,d.LINE_STRIP,m,h,p,tT.disabled,nm(n.bp.red),b,x,f,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments)}(t,i,r[o])}(this,s,s.getVisibleCoordinates())}this.options.showPadding&&(T=this.transform.padding,iL(this,this.transform.height-(T.top||0),3,iM),iL(this,T.bottom||0,3,iA),iI(this,T.left||0,3,iC),iI(this,this.transform.width-(T.right||0),3,iS),M=this.transform.centerPoint,u=M.x,iP(this,u-1,(m=this.transform.height-M.y)-10,2,20,iD),iP(this,u-10,m-1,20,2,iD)),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.cj(i,r):!n.ck(i,r)),o||(o=this.style.map.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime)),o&&(n.cl(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=tE.unblended,l=new tM(o.LEQUAL,tM.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.bp.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,tA.disabled,s,tT.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=tE.unblended,l=new tM(o.LEQUAL,tM.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.bp.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,tA.disabled,s,tT.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.cm(r)?function(t,i,r,o,a,s){if("translucent"!==t.renderPass)return;let{isRenderingToTexture:l}=s,c=tA.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,p="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 f=n.ay(s.textSizeData,u.zoom),b=n.aN(t,1,i.transform.zoom),g=eO(h,i.transform,b),_="none"!==r.layout.get("icon-text-fit")&&s.hasIconData();if(f){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 p=t.text.placedSymbolArray,f=t.text.dynamicLayoutVertexArray,b=t.icon.dynamicLayoutVertexArray,g={};f.clear();for(let b=0;b<p.length;b++){let _=p.get(b),y=_.hidden||!_.crossTileID||t.allowVerticalPlacement&&!_.placedOrientation?null:o[_.crossTileID];if(y){let o=new n.P(_.anchorX,_.anchorY),p={getElevation:h,width:a.width,height:a.height,pitchedLabelPlaneMatrix:s,pitchWithMap:r,transform:a,tileAnchorPoint:o,translation:u,unwrappedTileID:m},b=r?eq(o.x,o.y,p):eU(o.x,o.y,p),v=.5+a.cameraToCenterDistance/b.signedDistanceFromCamera*.5,x=n.aA(t.textSizeData,c,_)*v/n.aM;r&&(x*=t.tilePixelRatio/l);let{width:w,height:F,anchor:k,textOffset:E,textBoxScale:T}=y,M=function(t,i,r,o,a,s){let{horizontalAlign:l,verticalAlign:c}=n.aS(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),A=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 eB(n.x,n.y,i.pitchedLabelPlaneMatrix,i.getElevation).point}if(r){let n=eU(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,p,i,M,-a.bearingInRadians,A),S=t.allowVerticalPlacement&&_.placedOrientation===n.az.vertical?Math.PI/2:0;for(let t=0;t<_.numGlyphs;t++)n.aG(f,C,S);d&&_.associatedIconIndex>=0&&(g[_.associatedIconIndex]={shiftedAnchor:C,angle:S})}else eX(_.numGlyphs,f)}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)eX(r.numGlyphs,b);else{let i=g[t];if(i)for(let t=0;t<r.numGlyphs;t++)n.aG(b,i.shiftedAnchor,i.angle);else eX(r.numGlyphs,b)}}t.icon.dynamicLayoutVertexBuffer.updateData(b)}t.text.dynamicLayoutVertexBuffer.updateData(f)}(s,h,p,d,u,g,i,f,_,n.aO(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)&&ip(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)&&ip(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&&(im(t,i,r,o,!0),im(t,i,r,o,!1))}(t,i,r,o,this.style.placement.variableOffsets,a):n.cn(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,p=t.transform,f=t.getDepthModeForSublayer(0,tM.ReadOnly),b=tA.disabled,g=t.colorModeForRenderPass(),_=[],y=p.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"),f=n.aO(p,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:nc(t,c,r,f,y),terrainData:w,projectionData:p.getProjectionData({overscaledTileID:l,applyGlobeMatrix:!s,applyTerrainMatrix:!0})};if(u)for(let t of d.segments.get())_.push({segments:new n.aX([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,f,b,g,tT.backCCW,l,c,d,r.id,a,s,n.segments,r.paint,t.transform.zoom,i)}}(t,i,r,o,a):n.co(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=tA.disabled,d=new tE([l.ONE,l.ONE],n.bp.transparent,[!0,!0,!0,!0]),u=i.getBucket(r);if(!u)return;let m=o.key,h=r.heatmapFbos.get(m);h||(h=ig(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.bp.transparent});let p=u.programConfigurations.get(r.id),f=t.useProgram("heatmap",p,!a),b=t.transform.getProjectionData({overscaledTileID:i.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),g=t.style.map.terrain.getTerrainData(o);f.draw(s,l.TRIANGLES,tM.disabled,c,d,tT.disabled,nh(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,p)}(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=i_(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,tM.disabled,tA.disabled,t.colorModeForRenderPass(),tT.disabled,np(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{let a,s,l;"offscreen"===t.renderPass?function(t,i,r,o){let a,s,l=t.context,c=l.gl,d=t.transform,u=tA.disabled,m=new tE([c.ONE,c.ONE],n.bp.transparent,[!0,!0,!0,!0]);a=l.gl,l.activeTexture.set(a.TEXTURE1),l.viewport.set([0,0,t.width/4,t.height/4]),(s=r.heatmapFbos.get(n.cd))?(a.bindTexture(a.TEXTURE_2D,s.colorAttachment.get()),l.bindFramebuffer.set(s.framebuffer)):(s=ig(l,t.width/4,t.height/4),r.heatmapFbos.set(n.cd,s)),l.clear({color:n.bp.transparent});for(let n=0;n<o.length;n++){let a=o[n];if(i.hasRenderableParent(a))continue;let s=i.getTile(a),h=s.getBucket(r);if(!h)continue;let p=h.programConfigurations.get(r.id),f=t.useProgram("heatmap",p),b=d.getProjectionData({overscaledTileID:a,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),g=d.getCircleRadiusCorrection();f.draw(l,c.TRIANGLES,tM.disabled,u,m,tT.backCCW,nh(s,d.zoom,r.paint.get("heatmap-intensity"),g),null,b,r.id,h.layoutVertexBuffer,h.indexBuffer,h.segments,r.paint,d.zoom,p)}l.viewport.set([0,0,t.width,t.height])}(t,i,r,o):"translucent"===t.renderPass&&(s=(a=t.context).gl,a.setColorMode(t.colorModeForRenderPass()),(l=r.heatmapFbos.get(n.cd))&&(a.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,l.colorAttachment.get()),a.activeTexture.set(s.TEXTURE1),i_(a,r).bind(s.LINEAR,s.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(a,s.TRIANGLES,tM.disabled,tA.disabled,t.colorModeForRenderPass(),tT.disabled,np(t,r,0,1),null,null,r.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,r.paint,t.transform.zoom)))}}(t,i,r,o,a):n.cp(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,tM.ReadOnly),u=t.colorModeForRenderPass(),m=i.paint.get("line-dasharray"),h=m.constantOr(1),p=i.paint.get("line-pattern"),f=p.constantOr(1),b=i.paint.get("line-gradient"),g=i.getCrossfadeParameters();a=f?"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(f&&!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),M=p.constantOr(null),A=m&&m.constantOr(null);if(M&&l.imageAtlas){let t=l.imageAtlas,n=t.patternPositions[M.to.toString()],i=t.patternPositions[M.from.toString()];n&&i&&w.setConstantPatternPositions(n,i)}else if(A){let n="round"===i.layout.get("line-cap"),r=t.lineAtlas.getDash(A.to,n),o=t.lineAtlas.getDash(A.from,n);w.setConstantDashPositions(r,o)}let C=v.getProjectionData({overscaledTileID:o,applyGlobeMatrix:!s,applyTerrainMatrix:!0}),S=v.getPixelScale();f?(r=nv(t,l,i,S,g),_.activeTexture.set(y.TEXTURE0),l.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),w.updatePaintBuffers(g)):h&&b?(r=nw(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=iy(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=nx(t,l,i,S,g),(E||t.lineAtlas.dirty)&&(_.activeTexture.set(y.TEXTURE0),t.lineAtlas.bind(_)),w.updatePaintBuffers(g)):b?(r=ny(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=iy(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=n_(t,l,i,S);let D=t.stencilModeForClipping(o);k.draw(_,y.TRIANGLES,d,D,u,tT.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.cq(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.bp.transparent).a&&1===l.constantOr(0)?"opaque":"translucent";if(t.renderPass===m){let n=t.getDepthModeForSublayer(1,"opaque"===t.renderPass?tM.ReadWrite:tM.ReadOnly);ix(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"),tM.ReadOnly);ix(t,i,r,o,n,d,!0,c)}}(t,i,r,o,a):n.cr(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 tM(t.context.gl.LEQUAL,tM.ReadWrite,t.depthRangeFor3D);if(1!==a||i.paint.get("fill-extrusion-pattern").constantOr(1))iw(t,n,i,r,o,tA.disabled,tE.disabled,s),iw(t,n,i,r,o,t.stencilModeFor3D(),t.colorModeForRenderPass(),s);else{let a=t.colorModeForRenderPass();iw(t,n,i,r,o,tA.disabled,a,s)}}}(t,i,r,o,a):n.cs(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,tM.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,p=m.stride,f=m.getPixels();if(c.activeTexture.set(d.TEXTURE1),c.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||t.getTileTexture(p),r.demTexture){let t=r.demTexture;t.update(f,{premultiply:!1}),t.bind(d.NEAREST,d.CLAMP_TO_EDGE)}else r.demTexture=new n.T(c,f,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,tT.disabled,nb(r.tileID,m),null,null,o.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),r.needsHillshadePrepare=!1}}(t,i,o,r,d,tA.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);iF(t,i,r,l,n,d,u,!1,s),iF(t,i,r,l,a,d,u,!0,s)}else{let[n,a]=t.getStencilConfigForOverlapAndUpdateStencilID(o);iF(t,i,r,a,n,d,u,!1,s)}}(t,i,r,o,a):n.ct(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,tM.ReadOnly),c=t.colorModeForRenderPass();if(s){let[o,s,d]=t.stencilConfigForOverlapTwoPass(r);ik(t,n,i,d,o,l,c,!1,a),ik(t,n,i,d,s,l,c,!0,a)}else{let[o,s]=t.getStencilConfigForOverlapAndUpdateStencilID(r);ik(t,n,i,s,o,l,c,!1,a)}}(t,i,r,o,a):n.bU(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 er)iT(t,n,i,r,null,!1,!1,s.tileCoords,s.flippedWindingOrder,a);else if(l){let[o,s,l]=t.stencilConfigForOverlapTwoPass(r);iT(t,n,i,l,o,!1,!0,iE,!1,a),iT(t,n,i,l,s,!0,!0,iE,!1,a)}else{let[o,s]=t.getStencilConfigForOverlapAndUpdateStencilID(r);iT(t,n,i,s,o,!1,!0,iE,!1,a)}}(t,i,r,o,a):n.cu(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,p=i.paint.get("background-pattern");if(t.isPatternMissing(p))return;let f=!p&&1===a.a&&1===s&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==f)return;let b=tA.disabled,g=t.getDepthModeForSublayer(0,"opaque"===f?tM.ReadWrite:tM.ReadOnly),_=t.colorModeForRenderPass(),y=t.useProgram(p?"backgroundPattern":"background"),v=r||eE(m,{tileSize:h,terrain:t.style.map.terrain});p&&(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=p?nS(s,t,p,{tileID:n,tileSize:h},x):nC(s,a),f=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,_,tT.backCCW,o,f,r,i.id,v.vertexBuffer,v.indexBuffer,v.segments)}}(t,0,r,o,a):n.cv(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(tA.disabled);let n="3d"===m?t.getDepthModeFor3D():t.getDepthModeForSublayer(0,tM.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?ta.projectionMercator:a.shaderPreludeCode,l=i?td:a.shaderDefine,c=t+(n?n.cacheKey:"")+`/${i?tu:a.shaderVariantName}`+(this._showOverdrawInspector?"/overdraw":"")+(o?"/terrain":"")+(r?`/${r.join("/")}`:"");return this.cache[c]||(this.cache[c]=new nn(this.context,ta[t],n,nL[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 iz(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 iY{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=iz(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.V(+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 iN={linearity:.3,easing:n.cw(0,0,.3,1)},ij=n.e({deceleration:2500,maxSpeed:1400},iN),iH=n.e({deceleration:20,maxSpeed:1400},iN),iU=n.e({deceleration:1e3,maxSpeed:360},iN),iV=n.e({deceleration:1e3,maxSpeed:90},iN),iq=n.e({deceleration:1e3,maxSpeed:360},iN);class iG{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=iW(i.pan.mag(),r,n.e({},ij,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,i$(o,a)}if(i.zoom){let t=iW(i.zoom,r,iH);o.zoom=n.cx(this._map.transform.zoom+t.amount,this._map.getZoomSnap(),t.amount),i$(o,t)}if(i.bearing){let t=iW(i.bearing,r,iU);o.bearing=this._map.transform.bearing+n.an(t.amount,-179,179),i$(o,t)}if(i.pitch){let t=iW(i.pitch,r,iV);o.pitch=this._map.transform.pitch+t.amount,i$(o,t)}if(i.roll){let t=iW(i.roll,r,iq);o.roll=this._map.transform.roll+n.an(t.amount,-179,179),i$(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 i$(t,n){(!t.duration||t.duration<n.duration)&&(t.duration=n.duration,t.easing=n.easing)}function iW(t,i,r){let{maxSpeed:o,linearity:a,deceleration:s}=r,l=n.an(t*a/(i/1e3),-o,o),c=Math.abs(l)/(s*a);return{easing:r.easing,duration:1e3*c,amount:c/2*l}}class iX 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);const a=x.mousePos(i.getCanvas(),r),s=i.unproject(a);super(t,n.e({point:a,lngLat:s,originalEvent:r},o)),this._defaultPrevented=!1,this.target=i}}class iZ extends n.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,r){const 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 iK extends n.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,i){super(t,{originalEvent:i}),this._defaultPrevented=!1}}class iJ{constructor(t,n){this._map=t,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new iK(t.type,this._map,t))}mousedown(t,n){return this._mousedownPos=n,this._firePreventable(new iX(t.type,this._map,t))}mouseup(t){this._map.fire(new iX(t.type,this._map,t))}click(t,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new iX(t.type,this._map,t))}dblclick(t){return this._firePreventable(new iX(t.type,this._map,t))}mouseover(t){this._map.fire(new iX(t.type,this._map,t))}mouseout(t){this._map.fire(new iX(t.type,this._map,t))}touchstart(t){return this._firePreventable(new iZ(t.type,this._map,t))}touchmove(t){this._map.fire(new iZ(t.type,this._map,t))}touchend(t){this._map.fire(new iZ(t.type,this._map,t))}touchcancel(t){this._map.fire(new iZ(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class iQ{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new iX(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new iX("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new iX(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class i0{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 i1{constructor(t,n){this._map=t,this._tr=new i0(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 i2(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 i5{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=i2(r,i)))}touchmove(t,n,i){if(this.aborted||!this.centroid)return;let r=i2(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 i3{constructor(t){this.singleTap=new i5(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 i4{constructor(t){this._tr=new i0(t),this._zoomIn=new i3({numTouches:1,numTaps:2}),this._zoomOut=new i3({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,i,r){let o=this._zoomIn.touchend(t,i,r),a=this._zoomOut.touchend(t,i,r),s=this._tr;return o?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:i=>i.easeTo({duration:300,zoom:n.cx(s.zoom+1,i.getZoomSnap()),around:s.unproject(o)},{originalEvent:t})}):a?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:i=>i.easeTo({duration:300,zoom:n.cx(s.zoom-1,i.getZoomSnap()),around:s.unproject(a)},{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 i6{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 i8={0:1,2:2};class i7{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){let n;return n=i8[this._eventButton],void 0!==t.buttons&&(t.buttons&n)===n}isValidEndEvent(t){return x.mouseButton(t)===this._eventButton}}class i9{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 re{constructor(t=new i7({checkCorrectEvent:()=>!0}),n=new i9){this.mouseMoveStateManager=t,this.oneFingerTouchMoveStateManager=n}_executeRelevantHandler(t,n,i){return t instanceof MouseEvent?n(t):"u">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 rt=t=>{t.mousedown=t.dragStart,t.mousemoveWindow=t.dragMove,t.mouseup=t.dragEnd,t.contextmenu=t=>{t.preventDefault()}};class rn{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=i2(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 ri{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=rr(i,n,r),s=rr(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=rr(i,n,r),s=rr(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 rr(t,n,i){for(let r=0;r<t.length;r++)if(t[r].identifier===i)return n[r]}function ro(t,n){return Math.log(t/n)/Math.LN2}class ra extends ri{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(ro(this._distance,this._startDistance))))return this._active=!0,{zoomDelta:ro(this._distance,i),pinchAround:n}}}function rs(t,n){return 180*t.angleWith(n)/Math.PI}class rl extends ri{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:rs(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(rs(t,this._startVector))<n}}function rc(t){return Math.abs(t.y)>Math.abs(t.x)}class rd extends ri{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,rc(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 rc(t)&&rc(n)&&a}}let ru=100,rm=15,rh=10;class rp{constructor(t){this._tr=new i0(t),this._panStep=ru,this._bearingStep=rm,this._pitchStep=rh,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let i=0,r=0,o=0,a=0,s=0;switch(t.keyCode){case 61:case 107:case 171:case 187:i=1;break;case 189:case 109:case 173:i=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),a=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),a=1);break;case 38:t.shiftKey?o=1:(t.preventDefault(),s=-1);break;case 40:t.shiftKey?o=-1:(t.preventDefault(),s=1);break;default:return}return this._rotationDisabled&&(r=0,o=0),{cameraAnimation:l=>{let c=this._tr;l.easeTo({duration:300,easeId:"keyboardHandler",easing:rf,zoom:i?n.cx(c.zoom+i*(t.shiftKey?2:1),l.getZoomSnap()):c.zoom,bearing:c.bearing+r*this._bearingStep,pitch:c.pitch+o*this._pitchStep,offset:[-a*this._panStep,-s*this._panStep],center:c.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 rf(t){return t*(2-t)}let rb=1/450;class rg{constructor(t,n){this._onTimeout=t=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},this._map=t,this._tr=new i0(t),this._triggerRenderFrame=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=rb}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.V.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.aq(this._targetZoom),a=t.applyConstrain(t.getCameraLngLat(),n.at(o*r)).zoom,s=this._map.getZoomSnap();if("wheel"===this._type&&s>0){let i=n.cx(t.zoom,s);this._targetZoom=n.cx(a,s,a-i)}else this._targetZoom=a;"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.G.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.cz;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.cw(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 r_{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 ry{constructor(t){this._tr=new i0(t),this.reset()}reset(){this._active=!1}dblclick(t,i){return t.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:n.cx(this._tr.zoom+(t.shiftKey?-1:1),r.getZoomSnap()),around:this._tr.unproject(i)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class rv{constructor(){this._tap=new i3({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 rx{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 rw{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 rF{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 rk{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 rE=t=>t.zoom||t.drag||t.roll||t.pitch||t.rotate;class rT extends n.l{}function rM(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta||t.rollDelta}class rA{get _ownerDocument(){var t;return(null==(t=this._el)?void 0:t.ownerDocument)||document}get _ownerWindow(){var t,n;return(null==(n=null==(t=this._el)?void 0:t.ownerDocument)?void 0:n.defaultView)||window}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.cA(t,i||t.type)){let n=x.mousePos(this._map.getCanvas(),t);u=c[i||t.type](t,n)}else if(n.cB(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.cC(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||rM(o))&&(this._changes.push([o,a,l]),this._triggerRenderFrame()),(Object.keys(s).length||rM(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 iG(t),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(i);const r=this._el;for(const[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],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"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],[this._ownerWindow,"blur",void 0]],this._listeners))x.addEventListener(t,n,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,i)}destroy(){for(let[t,n,i]of this._listeners)x.removeEventListener(t,n,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,i)}_addDefaultHandlers(t){let i=this._map,r=i.getCanvasContainer();this._add("mapEvent",new iJ(i,t));let o=i.boxZoom=new i1(i,t);this._add("boxZoom",o),t.interactive&&t.boxZoom&&o.enable();let a=i.cooperativeGestures=new rk(i,t.cooperativeGestures);this._add("cooperativeGestures",a),t.cooperativeGestures&&a.enable();let s=new i4(i),l=new ry(i);i.doubleClickZoom=new r_(l,s),this._add("tapZoom",s),this._add("clickZoom",l),t.interactive&&t.doubleClickZoom&&i.doubleClickZoom.enable();let c=new rv;this._add("tapDragZoom",c);let d=i.touchPitch=new rd(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 i6({clickTolerance:i,move:(t,i)=>{let l=s();if(r&&Math.abs(l.y-t.y)>o)return{bearingDelta:n.cy(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 i7({checkCorrectEvent:t=>0===x.mouseButton(t)&&t.ctrlKey||2===x.mouseButton(t)&&!t.ctrlKey}),enable:t,assignEvents:rt})}(t,u),h=function({enable:t,clickTolerance:n,pitchDegreesPerPixelMoved:i=-.5}){return new i6({clickTolerance:n,move:(t,n)=>({pitchDelta:(n.y-t.y)*i}),moveStateManager:new i7({checkCorrectEvent:t=>0===x.mouseButton(t)&&t.ctrlKey||2===x.mouseButton(t)}),enable:t,assignEvents:rt})}(t),p=function({enable:t,clickTolerance:n,rollDegreesPerPixelMoved:i=.3},r){return new i6({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 i7({checkCorrectEvent:t=>2===x.mouseButton(t)&&t.ctrlKey}),enable:t,assignEvents:rt})}(t,u);i.dragRotate=new rw(t,m,h,p),this._add("mouseRotate",m,["mousePitch"]),this._add("mousePitch",h,["mouseRotate","mouseRoll"]),this._add("mouseRoll",p,["mousePitch"]),t.interactive&&t.dragRotate&&i.dragRotate.enable();let f=function({enable:t,clickTolerance:n}){return new i6({clickTolerance:n,move:(t,n)=>({around:n,panDelta:n.sub(t)}),activateOnStart:!0,moveStateManager:new i7({checkCorrectEvent:t=>0===x.mouseButton(t)&&!t.ctrlKey}),enable:t,assignEvents:rt})}(t),b=new rn(t,i);i.dragPan=new rx(r,f,b),this._add("mousePan",f),this._add("touchPan",b,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&i.dragPan.enable(t.dragPan);let g=new rl,_=new ra;i.touchZoomRotate=new rF(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 iQ(i));let y=i.scrollZoom=new rg(i,()=>this._triggerRenderFrame());this._add("scrollZoom",y,["mousePan"]),t.interactive&&t.scrollZoom&&i.scrollZoom.enable(t.scrollZoom);let v=i.keyboard=new rp(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!!rE(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(!(rM(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 p={panDelta:s,zoomDelta:l,rollDelta:u,pitchDelta:d,bearingDelta:c,around:m};this._map.cameraHelper.useGlobeControls&&!o.isPointOnMapSurface(m)&&(m=o.centerPoint);let f=.01>m.distSqr(o.centerPoint)?o.center:o.screenPointToLocation(s?m.sub(s):m);this._handleMapControls({terrain:a,tr:o,deltasForHelper:p,preZoomAroundLoc:f,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;(s.handleMapControlsRollPitchBearingZoom(i,n),t)?s.useGlobeControls?(!this._terrainMovement&&(o.drag||o.zoom)&&(this._terrainMovement=!0,this._map._elevationFreeze=!0),s.handleMapControlsPan(i,n,r)):!this._terrainMovement&&(o.drag||o.zoom)?(this._terrainMovement=!0,this._map._elevationFreeze=!0,s.handleMapControlsPan(i,n,r)):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=rE(this._eventsInProgress),s=rE(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=rE(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 rT("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class rC 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._zoomSnap=i.zoomSnap,this.cameraHelper=n,this.on("moveend",()=>{delete this._requestedCameraState})}migrateProjection(t,n){t.apply(this.transform,!0),this.transform=t,this.cameraHelper=n}getCenter(){return new n.V(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,i){return this.zoomTo(n.cx(this.getZoom()+1,this._zoomSnap),t,i),this}zoomOut(t,i){return this.zoomTo(n.cx(this.getZoom()-1,this._zoomSnap),t,i),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}setZoomSnap(t){return this._zoomSnap=t,this}getZoomSnap(){return this._zoomSnap}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=Z.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 Z(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.a9.fromLngLat(t,i),s=n.a9.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.at(this.transform.cameraToCenterDistance/u/this.transform.tileSize),p=180*Math.atan2(l,-c)/Math.PI,f=180*Math.acos(m/u)/Math.PI;return f=d<0?90-f:90+f,{center:s.toLngLat(),elevation:o,zoom:h,pitch:f,bearing:p}}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.cz},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,p=n.P.convert(t.offset);t.around&&(r=n.V.convert(t.around),o=a.locationToScreenPoint(r));let f={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:p,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,f),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.G.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,!1)}this.transform.apply(i,!1)}_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.U(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.cz},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),p=r.centerPoint.add(h),f=r.screenPointToLocation(p),b=this.cameraHelper.handleFlyTo(r,{bearing:c,pitch:d,roll:u,padding:m,locationAtOffset:f,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),M=function(t){return E(T)/E(T+g*t)},A=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,A=()=>0,M=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(f=>{let g=f*C,_=1/M(g),y=A(g);this._rotating&&r.setBearing(n.G.number(o,c,f)),this._pitching&&r.setPitch(n.G.number(a,d,f)),this._rolling&&r.setRoll(n.G.number(s,u,f)),this._padding&&(r.interpolatePadding(l,m,f),p=r.centerPoint.add(h)),b.easeFunc(f,_,y,p),this.terrain&&!t.freezeElevation&&this._updateElevation(f),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.W(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.getElevationForLngLat(n.V.convert(t),this.transform):null}}let rS={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class rD{constructor(t=rS){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 rL{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 rI{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 rP=n.aU([{name:"a_pos3d",type:"Int16",components:3}]);class rO 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.c7(o.terrainRttPosMatrix32f,0,n.a5,n.a5,0,0,1),this._tiles[o.key]=new eh(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.bk();if(o.canonical.equals(t.canonical))n.c7(s,0,n.a5,n.a5,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.a5>>i;n.c7(s,0,l,l,0,0,1),n.O(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.a5>>i;n.c7(s,0,n.a5,n.a5,0,0,1),n.O(s,s,[r*l,a*l,0]),n.Q(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.bk();if(a.canonical.z===t.canonical.z){let i=t.canonical.x-a.canonical.x+t.wrap*(1<<t.canonical.z),r=t.canonical.y-a.canonical.y;n.c7(l,0,n.a5,n.a5,0,0,1),n.O(l,l,[i*n.a5,r*n.a5,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)+t.wrap*(1<<a.canonical.z),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.a5>>i;n.c7(l,0,d,d,0,0,1),n.O(l,l,[-r*d+s*n.a5,-o*d+c*n.a5,0])}else{let i=t.canonical.z-a.canonical.z,r=t.canonical.x-(t.canonical.x>>i<<i)+t.wrap*(1<<t.canonical.z),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.a5<<i;n.c7(l,0,d,d,0,0,1),n.O(l,l,[r*n.a5+s*d,o*n.a5+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;this._sourceTileCache[t.key]||(this._sourceTileCache[t.key]=t.scaledTo(r).key);let o=this.findTileInCaches(this._sourceTileCache[t.key]);if(!(null==o?void 0:o.dem)&&n)for(;r>=i.minzoom&&!(null==o?void 0:o.dem);)o=this.findTileInCaches(t.scaledTo(r--).key);return o}findTileInCaches(t){let n=this.tileManager.getTileByID(t);return n||(n=this.tileManager._outOfViewCache.getByKey(t))}anyTilesAfterTime(t=Date.now()){return this._lastTilesetChange>=t}_isWithinTileRanges(t,n){let i=n[t.canonical.z];return!!i&&(t.wrap>i.minWrap||t.wrap<i.maxWrap||t.canonical.x>=i.minTileXWrapped&&t.canonical.x<=i.maxTileXWrapped&&t.canonical.y>=i.minTileY&&t.canonical.y<=i.maxTileY)}}class rR{constructor(t,n,i){this._meshCache={},this.painter=t,this.tileManager=new rO(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.a5){var a;let s=t.normalizeCoordinates(i,r,o);if(!s)return 0;let l=this.getTerrainData(s.tileID),c=null==(a=l.tile)?void 0:a.dem;if(!c)return 0;let d=n.cD([],[s.x/o*n.a5,s.y/o*n.a5],l.u_terrain_matrix),u=[d[0]*c.dim,d[1]*c.dim],m=Math.floor(u[0]),h=Math.floor(u[1]),p=u[0]-m,f=u[1]-h;return c.get(m,h)*(1-p)*(1-f)+c.get(m+1,h)*p*(1-f)+c.get(m,h+1)*(1-p)*f+c.get(m+1,h+1)*p*f}getElevationForLngLatZoom(t,i){if(!n.cE(i,t.wrap()))return 0;let{tileID:r,mercatorX:o,mercatorY:a}=this._getOverscaledTileIDFromLngLatZoom(t,i);return this.getElevation(r,o%n.a5,a%n.a5,n.a5)}getElevationForLngLat(t,n){let i=eE(n,{maxzoom:this.tileManager.maxzoom,minzoom:this.tileManager.minzoom,tileSize:512,terrain:this}),r=0;for(let t of i)t.canonical.z>r&&(r=Math.min(t.canonical.z,this.tileManager.maxzoom));return this.getElevationForLngLatZoom(t,r)}getElevation(t,i,r,o=n.a5){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.ar([])}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.toString()+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.cF(new Float64Array(16),[1/(n.a5<<o),1/(n.a5<<o),0]);n.O(l,l,[a*n.a5,s*n.a5,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,p=(1<<m.tileID.canonical.z)*h;return new n.a9((m.tileID.canonical.x*h+c)/p+m.tileID.wrap,(m.tileID.canonical.y*h+d)/p,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.cG,d=new n.aY,u=this.meshSize,m=n.a5/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 p=c.length,f=p+(u+1),b=(u+1)*u,g=o?n.br:0,_=+!o,y=a?n.bs:n.a5,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,f+t,f+t+1),d.emplaceBack(b+t,f+t+1,b+t+1),d.emplaceBack(0+t,p+t+1,p+t),d.emplaceBack(0+t,0+t+1,p+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.a5,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 tl(l.createVertexBuffer(c,rP.members),l.createIndexBuffer(d),n.aX.simpleSegment(0,0,c.length,d.length));return this._meshCache[s]=F,F}getMeshFrameDelta(t){return 2*Math.PI*n.bE/Math.pow(2,Math.max(t,0))/5}getMinTileElevationForLngLatZoom(t,i){var r;if(!n.cE(i,t.wrap()))return 0;let{tileID:o}=this._getOverscaledTileIDFromLngLatZoom(t,i);return null!=(r=this.getMinMaxElevation(o).minElevation)?r: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.a9.fromLngLat(t.wrap()),o=(1<<i)*n.a5,a=r.x*o,s=r.y*o,l=Math.floor(a/n.a5),c=Math.floor(s/n.a5);return{tileID:new n.a2(i,0,i,l,c),mercatorX:a,mercatorY:s}}}class rB{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 rz={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};class rY{constructor(t,n){this.painter=t,this.terrain=n,this.pool=new rB(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){var i,r;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 er?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._rttFingerprints={},t._order)){let o=t._layers[n],a=o.source;if(rz[o.type]&&!this._rttFingerprints[a]){this._rttFingerprints[a]={};let n=null!=(r=null==(i=t.tileManagers[a])?void 0:i.getState().revision)?r:0;for(let t in this._coordsAscending[a])this._rttFingerprints[a][t]=`${this._coordsAscending[a][t].map(t=>t.key).sort().join()}#${n}`}}for(let t of this._renderableTiles)for(let n in this._rttFingerprints){let i=this._rttFingerprints[n][t.tileID.key];i&&i!==t.rttFingerprint[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(rz[o]&&(this._prevType&&rz[this._prevType]||this._stacks.push([]),this._prevType=o,this._stacks[this._stacks.length-1].push(t.id),!s))return!0;if(rz[this._prevType]||rz[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()&&(iO(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.bp.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.rttFingerprint[n.source]=this._rttFingerprints[n.source][o.tileID.key])}}return iO(this.painter,this.terrain,this._rttTiles,r),this._rttTiles=[],this.pool.freeAllObjects(),rz[o]}return!1}}let rN={"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":"Drag to rotate map, click to reset 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"},rj={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:rS,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.c.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,anisotropicFilterPitch:20},rH={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class rU{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;const o=new re;this._rotatePitchHandler=new i6({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.cy(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 rV(t,i,r,o=!1){if(o||!r.getCoveringTilesDetailsProvider().allowWorldCopies())return null==t?void 0:t.wrap();let a=new n.V(t.lng,t.lat);if(t=new n.V(t.lng,t.lat),i){let o=new n.V(t.lng-360,t.lat),a=new n.V(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 rq={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 rG(t,n,i){let r=t.classList;for(let t in rq)r.remove(`maplibregl-${i}-anchor-${t}`);r.add(`maplibregl-${i}-anchor-${n}`)}class r$ extends n.E{constructor(t){if(super(),this._onClick=t=>{this.fire(new n.l("click",{originalEvent:t}))},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=rV(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,`${rq[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${r} ${i}`),_.frameAsync(new AbortController,this._map._ownerWindow).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");const 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");const 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");const o=x.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"fill-rule","nonzero");const a=x.createNS("http://www.w3.org/2000/svg","g");for(const 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"}])){const 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)}const s=x.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill",this._color);const 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);const c=x.createNS("http://www.w3.org/2000/svg","g");c.setAttributeNS(null,"opacity","0.25"),c.setAttributeNS(null,"fill","#000000");const 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);const u=x.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"transform","translate(6.0, 7.0)"),u.setAttributeNS(null,"fill","#FFFFFF");const m=x.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(8.0, 8.0)");const 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");const p=x.createNS("http://www.w3.org/2000/svg","circle");p.setAttributeNS(null,"fill","#FFFFFF"),p.setAttributeNS(null,"cx","5.5"),p.setAttributeNS(null,"cy","5.5"),p.setAttributeNS(null,"r","5.4999962"),m.appendChild(h),m.appendChild(p),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()}),rG(this._element,this._anchor,"marker"),this._element.addEventListener("click",this._onClick),t&&t.className)for(const 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.V.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.getElevationForLngLat(this._lngLat,s.transform);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 rW={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},rX=0,rZ=!1,rK={maxWidth:100,unit:"metric"};function rJ(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?rQ(n,c,i/5280,t._getUIString("ScaleControl.Miles")):rQ(n,c,i,t._getUIString("ScaleControl.Feet"))}else i&&"nautical"===i.unit?rQ(n,c,d/1852,t._getUIString("ScaleControl.NauticalMiles")):d>=1e3?rQ(n,c,d/1e3,t._getUIString("ScaleControl.Kilometers")):rQ(n,c,d,t._getUIString("ScaleControl.Meters"))}function rQ(t,n,i,r){var o;let a,s,l,c=(a=Math.pow(10,`${Math.floor(i)}`.length-1),s=i/a,a*(s=s>=10?10:s>=5?5:s>=3?3:s>=2?2:s>=1?1:(l=Math.pow(10,Math.ceil(-Math.log(o=s)/Math.LN10)),Math.round(o*l)/l)));t.style.width=c/i*n+"px",t.innerHTML=`${c} ${r}`}let r0={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0};t.AJAXError=n.cJ,t.EXTENT=n.a5,t.Event=n.l,t.Evented=n.E,t.LngLat=n.V,t.MercatorCoordinate=n.a9,t.Point=n.P,t.addProtocol=n.cK,t.config=n.c,t.removeProtocol=n.cL,t.AttributionControl=rD,t.BoxZoomHandler=i1,t.CanvasSource=ea,t.CooperativeGesturesHandler=rk,t.DoubleClickZoomHandler=r_,t.DragPanHandler=rx,t.DragRotateHandler=rw,t.EdgeInsets=th,t.FullscreenControl=class extends n.E{constructor(t={}){var i;super(),this._onFullscreenChange=()=>{var t;let n=window.document.fullscreenElement||window.document.webkitFullscreenElement;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,this._pseudo=null!=(i=t.pseudo)&&i,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(){this._pseudo?this._togglePseudoFullScreen():window.document.exitFullscreen?window.document.exitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._pseudo?this._togglePseudoFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},t.GeoJSONSource=ei,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.V(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy,o=this._map.getBearing(),a=n.e({bearing:o},this.options.fitBoundsOptions),s=Z.fromLngLat(i,r);this._map.fitBounds(s,a,{geolocateSource:!0})},this._updateMarker=t=>{if(t){let i=new n.V(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&&rZ)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 r$({element:this._dotElement}),this._circleElement=x.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new r$({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({},rW,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,rX=0,rZ=!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":rX--,rZ=!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"),++rX>1?(t={maximumAge:6e5,timeout:0},rZ=!0):(t=this.options.positionOptions,rZ=!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._map.on("projectiontransition",this._updateGlobeIcon),this._container}onRemove(){x.remove(this._container),this._map.off("styledata",this._updateGlobeIcon),this._map.off("projectiontransition",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},t.Hash=iY,t.ImageSource=er,t.KeyboardHandler=rp,t.LngLatBounds=Z,t.LogoControl=rL,t.Map=class extends rC{get _ownerWindow(){var t,n;return(null==(n=null==(t=this._container)?void 0:t.ownerDocument)?void 0:n.defaultView)||window}constructor(t){var i,r;n.cH.mark(n.cI.create);const o=Object.assign(Object.assign(Object.assign({},rj),t),{canvasContextAttributes:Object.assign(Object.assign({},rj.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");const a=new tv,s=new tk;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,zoomSnap:o.zoomSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new rI,this._controls=[],this._mapId=n.af(),this._lostContextStyle={style:null,images:null},this._contextLost=t=>{if(t.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),this.style){for(let t of Object.values(this.style._layers))if("custom"===t.type&&console.warn(`Custom layer with id '${t.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),t._listeners)for(let[n]of Object.entries(t._listeners))console.warn(`Custom layer with id '${t.id}' had event listeners for event '${n}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this.style.destroy(),this.style=null,this.fire(new n.l("webglcontextlost",{originalEvent:t}))}else 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._lostContextStyle={style:null,images:null},this._setupPainter(),this.resize(),this._update(),this._resizeInternal(),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._zoomSnap=o.zoomSnap,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({},rN),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,this.setAnisotropicFilterPitch(o.anisotropicFilterPitch),void 0!==o.reduceMotion&&(_.prefersReducedMotion=o.reduceMotion),this._imageQueueHandle=h.addThrottleControl(()=>this.isMoving()),this._requestManager=new A(o.transformRequest),this._container=this._resolveContainer(o.container),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}),"u">typeof window&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver()),this.handlers=new rA(this,o),this._hash=o.hash&&new iY("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}))));const 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 rD("boolean"==typeof o.attributionControl?void 0:o.attributionControl)),o.maplibreLogo&&this.addControl(new rL,o.logoPosition),this.on("style.load",()=>{if(l||this._resizeTransform(),this.transform.unmodified){let t=n.U(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.getElevationForLngLat(i,this.transform)),super.calculateCameraOptionsFromTo(t,n,i,r)}resize(t,i=!0){if(null!==this._lostContextStyle.style)return this;this._resizeInternal(i);let r=!this._moving;return r&&(this.stop(),this.fire(new n.l("movestart",t)).fire(new n.l("move",t))),this.fire(new n.l("resize",t)),r&&this.fire(new n.l("moveend",t)),this}_resizeInternal(t=!0){let[n,i]=this._containerDimensions(),r=this._getClampedPixelRatio(n,i);if(this._resizeCanvas(n,i,r),this.painter.resize(n,i,r),this.painter.overLimit()){let t=this.painter.context.gl;this._maxCanvasSize=[t.drawingBufferWidth,t.drawingBufferHeight];let r=this._getClampedPixelRatio(n,i);this._resizeCanvas(n,i,r),this.painter.resize(n,i,r)}this._resizeTransform(t)}_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(Z.convert(t)),this._update()}setMinZoom(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom){let i=this.transform.zoom,r=this._getTransformForUpdate();return r.setMinZoom(t),this._applyUpdatedTransform(r),this._update(),i!==this.transform.zoom&&this.fire(new n.l("zoomstart")).fire(new n.l("zoom")).fire(new n.l("zoomend")).fire(new n.l("movestart")).fire(new n.l("move")).fire(new n.l("moveend")),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){let i=this.transform.zoom,r=this._getTransformForUpdate();return r.setMaxZoom(t),this._applyUpdatedTransform(r),this._update(),i!==this.transform.zoom&&this.fire(new n.l("zoomstart")).fire(new n.l("zoom")).fire(new n.l("zoomend")).fire(new n.l("movestart")).fire(new n.l("move")).fire(new n.l("moveend")),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){let i=this.transform.pitch,r=this._getTransformForUpdate();return r.setMinPitch(t),this._applyUpdatedTransform(r),this._update(),i!==this.transform.pitch&&this.fire(new n.l("pitchstart")).fire(new n.l("pitch")).fire(new n.l("pitchend")).fire(new n.l("movestart")).fire(new n.l("move")).fire(new n.l("moveend")),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){let i=this.transform.pitch,r=this._getTransformForUpdate();return r.setMaxPitch(t),this._applyUpdatedTransform(r),this._update(),i!==this.transform.pitch&&this.fire(new n.l("pitchstart")).fire(new n.l("pitch")).fire(new n.l("pitchend")).fire(new n.l("movestart")).fire(new n.l("move")).fire(new n.l("moveend")),this}throw Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(t){if((t=null==t?20:t)>180)throw Error("anisotropicFilterPitch must be less than or equal to 180");if(t<0)throw Error("anisotropicFilterPitch must be greater than or equal to 0");return this._anisotropicFilterPitch=t,this._update()}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.V.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 iX(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 iX(t,this,o.originalEvent)))},a=n=>{r&&(r=!1,i.call(this,new iX(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 t6(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 t6(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 rR(this.painter,i,t),this.painter.renderToTexture=new rY(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(){for(let t of Object.values(this.style&&this.style.tileManagers))if(!t.areTilesLoaded())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.ac(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]}_setupResizeObserver(){var t;let n=!1,i=iz(t=>{this._trackResize&&!this._removed&&(this.resize(t),this.redraw())},50),r=null!=(t=this._ownerWindow.ResizeObserver)?t:ResizeObserver;this._resizeObserver=new r(t=>{n?i(t):n=!0}),this._resizeObserver.observe(this._container)}_resolveContainer(t){if("string"==typeof t){let n=document.getElementById(t);if(!n)throw Error(`Container '${t}' not found.`);return n}if(t instanceof HTMLElement||t&&"object"==typeof t&&1===t.nodeType)return t;throw Error("Invalid type: 'container' must be a String or HTMLElement.")}_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 iB(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.H(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,anisotropicFilterPitch:this.getAnisotropicFilterPitch()}),this.fire(new n.l("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,n.cH.mark(n.cI.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.cH.mark(n.cI.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),"u">typeof window&&this._ownerWindow.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.cH.remove(),this._removed=!0,this.fire(new n.l("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,_.frame(this._frameRequest,t=>{n.cH.recordStartOfFrameAt(t),this._frameRequest=null;try{this._render(t)}catch(t){if(!n.Z(t)&&t.message!==ic)throw t}},()=>{},this._ownerWindow))}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=iX,t.MapTouchEvent=iZ,t.MapWheelEvent=iK,t.Marker=r$,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({},rH,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 rU(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=rV(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){var a,s,l,c,d;let t,n=this._container.offsetWidth,u=this._container.offsetHeight,m=(a=this.options.padding)?{top:null!=(s=a.top)?s:0,right:null!=(l=a.right)?l:0,bottom:null!=(c=a.bottom)?c:0,left:null!=(d=a.left)?d:0}:{top:0,right:0,bottom:0,left:0};t=i.y+o.bottom.y<u+m.top?["top"]:i.y>this._map.transform.height-u-m.bottom?["bottom"]:[],i.x<n/2+m.left?t.push("left"):i.x>this._map.transform.width-n/2-m.right&&t.push("right"),r=0===t.length?"bottom":t.join("-")}let u=i.add(o[r]);this.options.subpixelPositioning||(u=u.round()),x.setTransform(this._container,`${rq[r]} translate(${u.x}px,${u.y}px)`),rG(this._container,r,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=n.e(Object.create(r0),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.V.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}setPadding(t){this.options.padding=t,this._update()}_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=ee,t.RasterTileSource=Q,t.ScaleControl=class{constructor(t){this._onMove=()=>{rJ(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,rJ(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},rK),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=rg,t.Style=t6,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=rd,t.TwoFingersTouchRotateHandler=rl,t.TwoFingersTouchZoomHandler=ra,t.TwoFingersTouchZoomRotateHandler=rF,t.VectorTileSource=J,t.VideoSource=eo,t.addSourceType=(t,i)=>n._(void 0,void 0,void 0,function*(){if(el(t))throw Error(`A source type called "${t}" already exists.`);es[t]=i}),t.clearPrewarmedResources=function(){let t=s;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(j),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=tI,t.getMaxParallelImageRequests=function(){return n.c.MAX_PARALLEL_IMAGE_REQUESTS},t.getRTLTextPluginStatus=function(){return em().getRTLTextPluginStatus()},t.getVersion=function(){return b},t.getWorkerCount=function(){return H.workerCount},t.getWorkerUrl=function(){return n.c.WORKER_URL},t.importScriptInWorkers=function(t){return G().broadcast("IS",t)},t.isTimeFrozen=function(){return y.isFrozen()},t.now=v,t.prewarm=function(){V().acquire(j)},t.restoreNow=function(){y.restoreNow()},t.setMaxParallelImageRequests=function(t){n.c.MAX_PARALLEL_IMAGE_REQUESTS=t},t.setNow=function(t){y.setNow(t)},t.setRTLTextPlugin=function(t,n){return em().setRTLTextPlugin(t,n)},t.setWorkerCount=function(t){H.workerCount=t},t.setWorkerUrl=function(t){n.c.WORKER_URL=t}}),t}()}},r={};function o(t){var n=r[t];if(void 0!==n)return n.exports;var a=r[t]={id:t,loaded:!1,exports:{}};return i[t].call(a.exports,a,a.exports,o),a.loaded=!0,a.exports}o.n=t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return o.d(n,{a:n}),n},n=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,o.t=function(i,r){if(1&r&&(i=this(i)),8&r||"object"==typeof i&&i&&(4&r&&i.__esModule||16&r&&"function"==typeof i.then))return i;var a=Object.create(null);o.r(a);var s={};t=t||[null,n({}),n([]),n(n)];for(var l=2&r&&i;("object"==typeof l||"function"==typeof l)&&!~t.indexOf(l);l=n(l))Object.getOwnPropertyNames(l).forEach(t=>{s[t]=()=>i[t]});return s.default=()=>i,o.d(a,s),a},o.d=(t,n)=>{for(var i in n)o.o(n,i)&&!o.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}})(),o.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),o.r=t=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var a={};return(()=>{"use strict";let t,n,i,r,s;o.r(a),o.d(a,{OrMapMarkerAsset:()=>sQ,getMarkerConfigAttributeName:()=>sJ,OrMapGeocoderChangeEvent:()=>ug,OrMap:()=>uv,OrMapLongPressEvent:()=>ub,OrMapLegendEvent:()=>uu,OrMapMarker:()=>sX,OrMapMarkersChangedEvent:()=>u_,Util:()=>tV,OrMapAssetCard:()=>uc,DefaultConfig:()=>ul,OrMapMarkerClickedEvent:()=>sW,geoJsonPointInputTemplateProvider:()=>uy,getMarkerConfigForAssetType:()=>sK,LngLat:()=>sw.LngLat,OrMapMarkerChangedEvent:()=>s$,OrMapLoadedEvent:()=>up,OrClusterMarker:()=>sR,OrMapLegend:()=>um,OrMapAssetCardLoadAssetEvent:()=>us,OrMapClickedEvent:()=>uf});var l,c,d,u,m,h,p,f,b,g,_,y,v,x,w,F,k,E,T,M,A,C,S,D,L,I,P,O,R,B,z,Y,N,j,H,U,V,q,G,$,W,X,Z,K,J,Q,ee,et,en,ei,er,eo,ea,es,el,ec,ed,eu,em,eh,ep,ef,eb,eg,e_,ey,ev,ex,ew,eF,ek,eE,eT,eM,eA,eC,eS,eD,eL,eI,eP,eO,eR,eB,ez,eY,eN,ej,eH,eU,eV,eq,eG,e$,eW,eX,eZ,eK,eJ,eQ,e0,e1,e2,e5,e3,e4,e6,e8,e7,e9,te,tt,tn,ti,tr,to,ta,ts,tl,tc,td,tu,tm,th,tp,tf,tb,tg,t_,ty,tv,tx,tw,tF,tk,tE,tT,tM,tA,tC,tS,tD,tL,tI,tP,tO,tR,tB,tz,tY,tN,tj,tH,tU={};o.r(tU),o.d(tU,{hasBrowserEnv:()=>i1,hasStandardBrowserEnv:()=>i5,hasStandardBrowserWebWorkerEnv:()=>i3,navigator:()=>i2,origin:()=>i4});var tV={};o.r(tV),o.d(tV,{getGeoJSONPoint:()=>sC,getLngLat:()=>sA,getLngLatBounds:()=>sS,getMarkerIconAndColorFromAssetType:()=>sD,isAssetWithLocation:()=>sI,isWebglSupported:()=>sL}),o(4532),(m=eC||(eC={})).CREATE="CREATE",m.UPDATE="UPDATE",m.DELETE="DELETE",(h=eS||(eS={})).LOW="LOW",h.MEDIUM="MEDIUM",h.HIGH="HIGH",(p=eD||(eD={})).MANUAL="MANUAL",p.CLIENT="CLIENT",p.GLOBAL_RULESET="GLOBAL_RULESET",p.REALM_RULESET="REALM_RULESET",p.ASSET_RULESET="ASSET_RULESET",p.AGENT="AGENT",(f=eL||(eL={})).OPEN="OPEN",f.ACKNOWLEDGED="ACKNOWLEDGED",f.IN_PROGRESS="IN_PROGRESS",f.RESOLVED="RESOLVED",f.CLOSED="CLOSED",(b=eI||(eI={})).BOTTOM_LEFT="BOTTOM_LEFT",b.BOTTOM_RIGHT="BOTTOM_RIGHT",b.TOP_LEFT="TOP_LEFT",b.TOP_RIGHT="TOP_RIGHT",(g=eP||(eP={})).CREATE="CREATE",g.READ="READ",g.UPDATE="UPDATE",g.DELETE="DELETE",(_=eO||(eO={})).NONE="NONE",_.FORECAST="FORECAST",_.SETPOINT="SETPOINT",(y=eR||(eR={})).DISCONNECTED="DISCONNECTED",y.CONNECTING="CONNECTING",y.DISCONNECTING="DISCONNECTING",y.CONNECTED="CONNECTED",y.DISABLED="DISABLED",y.WAITING="WAITING",y.ERROR="ERROR",y.STOPPED="STOPPED",(v=eB||(eB={})).REQUEST_START="REQUEST_START",v.REQUEST_REPEATING="REQUEST_REPEATING",v.REQUEST_CANCEL="REQUEST_CANCEL",v.READY="READY",v.COMPLETED="COMPLETED",v.RUNNING="RUNNING",v.CANCELLED="CANCELLED",(x=ez||(ez={})).TOGGLE="TOGGLE",x.INCREMENT="INCREMENT",x.DECREMENT="DECREMENT",x.NEGATE="NEGATE",(w=eY||(eY={})).ASSET_NOT_FOUND="ASSET_NOT_FOUND",w.ATTRIBUTE_NOT_FOUND="ATTRIBUTE_NOT_FOUND",w.INSUFFICIENT_ACCESS="INSUFFICIENT_ACCESS",w.INVALID_VALUE="INVALID_VALUE",w.INTERCEPTOR_FAILURE="INTERCEPTOR_FAILURE",w.STATE_STORAGE_FAILED="STATE_STORAGE_FAILED",w.CANNOT_PROCESS="CANNOT_PROCESS",w.QUEUE_FULL="QUEUE_FULL",w.UNKNOWN="UNKNOWN",w.ASSET_ID_MISSING="ASSET_ID_MISSING",w.ATTRIBUTE_NAME_MISSING="ATTRIBUTE_NAME_MISSING",(F=eN||(eN={})).PUBLIC="PUBLIC",F.SHARED="SHARED",F.PRIVATE="PRIVATE",(k=ej||(ej={})).OFF="OFF",k.ONE_MIN="ONE_MIN",k.FIVE_MIN="FIVE_MIN",k.QUARTER="QUARTER",k.ONE_HOUR="ONE_HOUR",(E=eH||(eH={})).WRAP_TO_SINGLE_COLUMN="WRAP_TO_SINGLE_COLUMN",E.KEEP_LAYOUT="KEEP_LAYOUT",E.REDIRECT="REDIRECT",E.BLOCK_DEVICE="BLOCK_DEVICE",(T=eU||(eU={})).CSV="CSV",T.CSV_CROSSTAB="CSV_CROSSTAB",T.CSV_CROSSTAB_MINUTE="CSV_CROSSTAB_MINUTE",(M=eV||(eV={})).MINUTE="MINUTE",M.HOUR="HOUR",M.DAY="DAY",M.WEEK="WEEK",M.MONTH="MONTH",M.YEAR="YEAR",(A=eq||(eq={})).MIN="MIN",A.AVG="AVG",A.MAX="MAX",A.DIFFERENCE="DIFFERENCE",A.COUNT="COUNT",A.SUM="SUM",A.MODE="MODE",A.MEDIAN="MEDIAN",(C=eG||(eG={})).TERMINATING="TERMINATING",C.DISABLED="DISABLED",C.ALREADY_CONNECTED="ALREADY_CONNECTED",C.UNRECOGNISED="UNRECOGNISED",C.PERMANENT_ERROR="PERMANENT_ERROR",C.SYNC_ERROR="SYNC_ERROR",(S=e$||(e$={})).HTTPS="HTTPS",S.HTTP="HTTP",S.TCP="TCP",(D=eW||(eW={})).GET="GET",D.POST="POST",D.PUT="PUT",D.DELETE="DELETE",D.OPTIONS="OPTIONS",D.PATCH="PATCH",(L=eX||(eX={})).KEYCLOAK="KEYCLOAK",L.BASIC="BASIC",L.NONE="NONE",(I=eZ||(eZ={})).WEBSOCKET="WEBSOCKET",I.POLLING="POLLING",(P=eK||(eK={})).INTERNAL="INTERNAL",P.CLIENT="CLIENT",P.GLOBAL_RULESET="GLOBAL_RULESET",P.REALM_RULESET="REALM_RULESET",P.ASSET_RULESET="ASSET_RULESET",(O=eJ||(eJ={})).REALM="REALM",O.USER="USER",O.ASSET="ASSET",O.CUSTOM="CUSTOM",(R=eQ||(eQ={})).NORMAL="NORMAL",R.HIGH="HIGH",(B=e0||(e0={})).DEVICE="DEVICE",B.TOPIC="TOPIC",B.CONDITION="CONDITION",(z=e1||(e1={})).ALWAYS="ALWAYS",z.ONCE="ONCE",z.HOURLY="HOURLY",z.DAILY="DAILY",z.WEEKLY="WEEKLY",z.MONTHLY="MONTHLY",z.ANNUALLY="ANNUALLY",(Y=e2||(e2={})).MESSAGE_INVALID="MESSAGE_INVALID",Y.CERTIFICATE_INVALID="CERTIFICATE_INVALID",Y.UNAUTHORIZED="UNAUTHORIZED",Y.FORBIDDEN="FORBIDDEN",Y.UNIQUE_ID_MISMATCH="UNIQUE_ID_MISMATCH",Y.CONFIG_DISABLED="CONFIG_DISABLED",Y.USER_DISABLED="USER_DISABLED",Y.SERVER_ERROR="SERVER_ERROR",Y.ASSET_ERROR="ASSET_ERROR",Y.SERVER_BUSY="SERVER_BUSY",(N=e5||(e5={})).PRIVATE="PRIVATE",N.PROTECTED="PROTECTED",N.PUBLIC="PUBLIC",(j=e3||(e3={})).EXACT="EXACT",j.BEGIN="BEGIN",j.END="END",j.CONTAINS="CONTAINS",(H=e4||(e4={})).EQUALS="EQUALS",H.GREATER_THAN="GREATER_THAN",H.GREATER_EQUALS="GREATER_EQUALS",H.LESS_THAN="LESS_THAN",H.LESS_EQUALS="LESS_EQUALS",H.BETWEEN="BETWEEN",(U=e6||(e6={})).CREATED_ON="CREATED_ON",U.NAME="NAME",U.ASSET_TYPE="ASSET_TYPE",U.PARENT_ID="PARENT_ID",U.REALM="REALM",(V=e8||(e8={})).RESTRICTED="RESTRICTED",V.LINKED="LINKED",V.REALM="REALM",(q=e7||(e7={})).AT_LEAST_ONE="AT_LEAST_ONE",q.ALL="ALL",q.NONE="NONE",(G=e9||(e9={})).AND="AND",G.OR="OR",($=te||(te={})).CREATED_ON="CREATED_ON",$.FIRST_NAME="FIRST_NAME",$.LAST_NAME="LAST_NAME",$.USERNAME="USERNAME",$.EMAIL="EMAIL",(W=tt||(tt={})).STOPPED="STOPPED",W.RUNNING="RUNNING",W.ERROR="ERROR",(X=tn||(tn={})).JAVASCRIPT="JAVASCRIPT",X.GROOVY="GROOVY",X.JSON="JSON",X.FLOW="FLOW",(Z=ti||(ti={})).READY="READY",Z.DEPLOYED="DEPLOYED",Z.COMPILATION_ERROR="COMPILATION_ERROR",Z.VALIDITY_PERIOD_ERROR="VALIDITY_PERIOD_ERROR",Z.EXECUTION_ERROR="EXECUTION_ERROR",Z.LOOP_ERROR="LOOP_ERROR",Z.DISABLED="DISABLED",Z.PAUSED="PAUSED",Z.EXPIRED="EXPIRED",Z.REMOVED="REMOVED",Z.EMPTY="EMPTY",(K=tr||(tr={})).SUNRISE="SUNRISE",K.SUNSET="SUNSET",K.TWILIGHT_MORNING_VISUAL="TWILIGHT_MORNING_VISUAL",K.TWILIGHT_MORNING_VISUAL_LOWER="TWILIGHT_MORNING_VISUAL_LOWER",K.TWILIGHT_MORNING_HORIZON="TWILIGHT_MORNING_HORIZON",K.TWILIGHT_MORNING_CIVIL="TWILIGHT_MORNING_CIVIL",K.TWILIGHT_MORNING_NAUTICAL="TWILIGHT_MORNING_NAUTICAL",K.TWILIGHT_MORNING_ASTRONOMICAL="TWILIGHT_MORNING_ASTRONOMICAL",K.TWILIGHT_MORNING_GOLDEN_HOUR="TWILIGHT_MORNING_GOLDEN_HOUR",K.TWILIGHT_MORNING_BLUE_HOUR="TWILIGHT_MORNING_BLUE_HOUR",K.TWILIGHT_MORNING_NIGHT_HOUR="TWILIGHT_MORNING_NIGHT_HOUR",K.TWILIGHT_EVENING_VISUAL="TWILIGHT_EVENING_VISUAL",K.TWILIGHT_EVENING_VISUAL_LOWER="TWILIGHT_EVENING_VISUAL_LOWER",K.TWILIGHT_EVENING_HORIZON="TWILIGHT_EVENING_HORIZON",K.TWILIGHT_EVENING_CIVIL="TWILIGHT_EVENING_CIVIL",K.TWILIGHT_EVENING_NAUTICAL="TWILIGHT_EVENING_NAUTICAL",K.TWILIGHT_EVENING_ASTRONOMICAL="TWILIGHT_EVENING_ASTRONOMICAL",K.TWILIGHT_EVENING_GOLDEN_HOUR="TWILIGHT_EVENING_GOLDEN_HOUR",K.TWILIGHT_EVENING_BLUE_HOUR="TWILIGHT_EVENING_BLUE_HOUR",K.TWILIGHT_EVENING_NIGHT_HOUR="TWILIGHT_EVENING_NIGHT_HOUR",(J=to||(to={})).NUMBER="NUMBER",J.NUMBER_ARRAY="NUMBER_ARRAY",J.STRING="STRING",J.BOOLEAN="BOOLEAN",J.TRIGGER="TRIGGER",J.COLOR="COLOR",J.ANY="ANY",(Q=ta||(ta={})).NEW_LINE="NEW_LINE",Q.SPACER="SPACER",(ee=ts||(ts={})).INPUT="INPUT",ee.PROCESSOR="PROCESSOR",ee.OUTPUT="OUTPUT",ee.THEN="THEN",(et=tl||(tl={})).TEXT="TEXT",et.MULTILINE="MULTILINE",et.NUMBER="NUMBER",et.DROPDOWN="DROPDOWN",et.DOUBLE_DROPDOWN="DOUBLE_DROPDOWN",et.CHECKBOX="CHECKBOX",et.ASSET_ATTRIBUTE="ASSET_ATTRIBUTE",et.COLOR="COLOR",et.DATE="DATE",(en=tc||(tc={})).ADD="ADD",en.ADD_OR_REPLACE="ADD_OR_REPLACE",en.REPLACE="REPLACE",en.DELETE="DELETE",en.CLEAR="CLEAR",(ei=td||(td={})).PER_ASSET="PER_ASSET",ei.GLOBAL="GLOBAL",(er=tu||(tu={})).READ_ADMIN="read:admin",er.READ_LOGS="read:logs",er.READ_USERS="read:users",er.READ_MAP="read:map",er.READ_ASSETS="read:assets",er.READ_RULES="read:rules",er.READ_INSIGHTS="read:insights",er.READ_ALARMS="read:alarms",er.READ_SERVICES="read:services",er.WRITE_SERVICES="write:services",er.WRITE_USER="write:user",er.WRITE_ADMIN="write:admin",er.WRITE_LOGS="write:logs",er.WRITE_ASSETS="write:assets",er.WRITE_ATTRIBUTES="write:attributes",er.WRITE_RULES="write:rules",er.WRITE_INSIGHTS="write:insights",er.WRITE_ALARMS="write:alarms",er.READ="read",er.WRITE="write",(eo=tm||(tm={})).REGISTER="REGISTER",eo.UPDATE="UPDATE",eo.DEREGISTER="DEREGISTER",(ea=th||(th={})).AVAILABLE="AVAILABLE",ea.UNAVAILABLE="UNAVAILABLE",(es=tp||(tp={})).ASSET="ASSET",es.AGENT="AGENT",es.NOTIFICATION="NOTIFICATION",es.ALARM="ALARM",es.RULES="RULES",es.PROTOCOL="PROTOCOL",es.GATEWAY="GATEWAY",es.MODEL_AND_VALUES="MODEL_AND_VALUES",es.API="API",es.DATA="DATA",(el=tf||(tf={})).INFO="INFO",el.WARN="WARN",el.ERROR="ERROR",(ec=tb||(tb={})).NUMERIC="numeric",ec.DIGIT_2="2-digit",ec.FULL="full",ec.LONG="long",ec.MEDIUM="medium",ec.SHORT="short",ec.NARROW="narrow",(ed=tg||(tg={})).SECONDLY="SECONDLY",ed.MINUTELY="MINUTELY",ed.HOURLY="HOURLY",ed.DAILY="DAILY",ed.WEEKLY="WEEKLY",ed.MONTHLY="MONTHLY",ed.YEARLY="YEARLY",(eu=t_||(t_={})).OMIT="OMIT",eu.BACKWARD="BACKWARD",eu.FORWARD="FORWARD",(em=ty||(ty={})).JAPANESE="JAPANESE",em.BUDDHIST="BUDDHIST",em.ROC="ROC",em.ISLAMIC="ISLAMIC",em.ISO8601="ISO8601",em.CHINESE="CHINESE",em.ETHIOPIC="ETHIOPIC",em.HEBREW="HEBREW",em.GREGORIAN="GREGORIAN",(eh=tv||(tv={})).SU="SU",eh.MO="MO",eh.TU="TU",eh.WE="WE",eh.TH="TH",eh.FR="FR",eh.SA="SA",(ep=tx||(tx={})).PEOPLECOUNTERASSET="PeopleCounterAsset",ep.MAILAGENT="MailAgent",ep.UDPAGENT="UDPAgent",ep.ROOMASSET="RoomAsset",ep.CITYASSET="CityAsset",ep.VENTILATIONASSET="VentilationAsset",ep.TRADFRILIGHTASSET="TradfriLightAsset",ep.CONSOLEASSET="ConsoleAsset",ep.PRESENCESENSORASSET="PresenceSensorAsset",ep.OPENWEATHERMAPAGENT="OpenWeatherMapAgent",ep.LIGHTASSET="LightAsset",ep.KNXAGENT="KNXAgent",ep.THETHINGSSTACKAGENT="TheThingsStackAgent",ep.PLUGASSET="PlugAsset",ep.CHIRPSTACKAGENT="ChirpStackAgent",ep.WEATHERASSET="WeatherAsset",ep.THINGASSET="ThingAsset",ep.WEBSOCKETAGENT="WebsocketAgent",ep.TCPAGENT="TCPAgent",ep.GATEWAYASSET="GatewayAsset",ep.SERIALAGENT="SerialAgent",ep.BLUETOOTHMESHAGENT="BluetoothMeshAgent",ep.PARKINGASSET="ParkingAsset",ep.TRADFRIPLUGASSET="TradfriPlugAsset",ep.SIMULATORAGENT="SimulatorAgent",ep.SNMPAGENT="SNMPAgent",ep.GROUPASSET="GroupAsset",ep.BUILDINGASSET="BuildingAsset",ep.MODBUSSERIALAGENT="ModbusSerialAgent",ep.ENVIRONMENTSENSORASSET="EnvironmentSensorAsset",ep.MQTTAGENT="MQTTAgent",ep.VELBUSTCPAGENT="VelbusTCPAgent",ep.ARTNETLIGHTASSET="ArtnetLightAsset",ep.VELBUSSERIALAGENT="VelbusSerialAgent",ep.GROUNDWATERSENSORASSET="GroundwaterSensorAsset",ep.MICROPHONEASSET="MicrophoneAsset",ep.MODBUSTCPAGENT="ModbusTcpAgent",ep.ZWAVEAGENT="ZWaveAgent",ep.HTTPAGENT="HTTPAgent",ep.DOORASSET="DoorAsset",ep.THERMOSTATASSET="ThermostatAsset",ep.SHIPASSET="ShipAsset",(ef=tw||(tw={})).COLOURRGB="colourRGB",ef.WILDCARDSUBSCRIPTIONTOPICS="wildcardSubscriptionTopics",ef.PRICEHOURLY="priceHourly",ef.MQTTPORT="MQTTPort",ef.PINGDISABLED="pingDisabled",ef.FLOW="flow",ef.CHILDASSETTYPE="childAssetType",ef.LASTACCESS="lastAccess",ef.POSITION="position",ef.NETWORKKEY="networkKey",ef.UNIVERSE="universe",ef.ROUTINGMODE="routingMode",ef.MSSINUMBER="MSSINumber",ef.LASTWILLRETAIN="lastWillRetain",ef.LASTWILLTOPIC="lastWillTopic",ef.SERIALBAUDRATE="serialBaudrate",ef.SUBSCRIBEQOS="subscribeQos",ef.LEDCOUNT="lEDCount",ef.LOCKED="locked",ef.CLOUDCOVERAGE="cloudCoverage",ef.BASEURL="baseURL",ef.PROTOCOL="protocol",ef.REQUIREDVALUES="requiredValues",ef.REGION="region",ef.CONSOLEPLATFORM="consolePlatform",ef.GATEWAYSTATUS="gatewayStatus",ef.NO2LEVEL="NO2Level",ef.ATMOSPHERICPRESSURE="atmosphericPressure",ef.SERIALPORT="serialPort",ef.APPLICATIONID="applicationId",ef.TAGS="tags",ef.UNLOCK="unlock",ef.CHECKINTERVALSECONDS="checkIntervalSeconds",ef.LOCATION="location",ef.CLIENTSECRET="clientSecret",ef.WINDDIRECTION="windDirection",ef.WINDSPEED="windSpeed",ef.PARTICLESPM10="particlesPM10",ef.APPLICATIONKEY="applicationKey",ef.LENGTH="length",ef.PROBABILITYOFPRECIPITATION="probabilityOfPrecipitation",ef.USERNAMEPASSWORD="usernamePassword",ef.WATERLEVEL="waterLevel",ef.CONNECTHEADERS="connectHeaders",ef.CONSOLENAME="consoleName",ef.WEBSOCKETQUERY="websocketQuery",ef.PREFERHTML="preferHTML",ef.PARITY="parity",ef.COOLING="cooling",ef.POLLINGMILLIS="pollingMillis",ef.SOILTEMPERATURE="soilTemperature",ef.SUNIRRADIANCE="sunIrradiance",ef.MESSAGEMAXLENGTH="messageMaxLength",ef.WINDGUSTSPEED="windGustSpeed",ef.LIGHTID="lightId",ef.PROXYADDRESS="proxyAddress",ef.REQUESTQUERYPARAMETERS="requestQueryParameters",ef.MQTTHOST="MQTTHost",ef.SECUREGRPC="secureGRPC",ef.MODEL="model",ef.STREET="street",ef.MANUFACTURER="manufacturer",ef.DELETEPROCESSEDMAIL="deleteProcessedMail",ef.RESUMESESSION="resumeSession",ef.ONOFF="onOff",ef.APIKEY="ApiKey",ef.CITY="city",ef.PRESENCE="presence",ef.SPACESOCCUPIED="spacesOccupied",ef.STARTTLS="startTLS",ef.REQUESTTIMEOUTMILLIS="requestTimeoutMillis",ef.WEBSOCKETPATH="websocketPath",ef.AGENTSTATUS="agentStatus",ef.PRICEDAILY="priceDaily",ef.COUNTGROWTHMINUTE="countGrowthMinute",ef.IMONUMBER="IMONumber",ef.ATTRIBUTION="Attribution",ef.TENANTID="tenantId",ef.REQUESTHEADERS="requestHeaders",ef.HOST="host",ef.COUNTOUTMINUTE="countOutMinute",ef.MESSAGECHARSET="messageCharset",ef.CERTIFICATEALIAS="certificateAlias",ef.EMAIL="email",ef.BINDPORT="bindPort",ef.CONSOLEVERSION="consoleVersion",ef.PARTICLESPM1="particlesPM1",ef.MTU="mtu",ef.SPEED="speed",ef.MESSAGESTRIPDELIMITER="messageStripDelimiter",ef.AREA="area",ef.COUNTRY="country",ef.SHIPTYPE="shipType",ef.CONNECTSUBSCRIPTIONS="connectSubscriptions",ef.RELATIVEHUMIDITY="relativeHumidity",ef.SOURCEADDRESS="sourceAddress",ef.RAINFALL="rainfall",ef.OAUTHGRANT="oAuthGrant",ef.OZONELEVEL="ozoneLevel",ef.SEQUENCENUMBER="sequenceNumber",ef.COUNTINMINUTE="countInMinute",ef.PORT="port",ef.SUNALTITUDE="sunAltitude",ef.COUNTOUT="countOut",ef.ROOMNUMBER="roomNumber",ef.TUNNELINGSUPPORTED="tunnelingSupported",ef.ENINUMBER="ENINumber",ef.PARTICLESPM2_5="particlesPM2_5",ef.AGENTDISABLED="agentDisabled",ef.DISABLED="disabled",ef.COUNTIN="countIn",ef.MESSAGESOURCEADDRESS="messageSourceAddress",ef.PROVISIONWEATHERASSET="ProvisionWeatherAsset",ef.TIMEINJECTIONINTERVAL="timeInjectionInterval",ef.TEMPERATURESETPOINT="temperatureSetpoint",ef.CONSOLEPROVIDERS="consoleProviders",ef.COUNTTOTAL="countTotal",ef.SPACESBUFFER="spacesBuffer",ef.DEVICECONFIG="deviceConfig",ef.SPACESTOTAL="spacesTotal",ef.BINDHOST="bindHost",ef.FANSPEED="fanSpeed",ef.MESSAGECONVERTBINARY="messageConvertBinary",ef.NOTES="notes",ef.MAILFOLDERNAME="mailFolderName",ef.MESSAGEDELIMITERS="messageDelimiters",ef.TEMPERATURE="temperature",ef.SUNZENITH="sunZenith",ef.SNMPVERSIONVALUE="SNMPVersionValue",ef.BRIGHTNESS="brightness",ef.POSTALCODE="postalCode",ef.SPACESOPEN="spacesOpen",ef.HUMIDITY="humidity",ef.SOUNDLEVEL="soundLevel",ef.SECUREMODE="secureMode",ef.DIRECTION="direction",ef.STOPBITS="stopbits",ef.UVINDEX="uVIndex",ef.CONNECTURL="connectURL",ef.CLIENTID="clientId",ef.NATMODE="NATMode",ef.UPDATEONWRITE="updateOnWrite",ef.LASTWILLPAYLOAD="lastWillPayload",ef.GROUPID="groupId",ef.FOLLOWREDIRECTS="followRedirects",ef.SUNAZIMUTH="sunAzimuth",ef.MESSAGECONVERTHEX="messageConvertHex",ef.WEBSOCKETMODE="websocketMode",ef.COLOURTEMPERATURE="colourTemperature",ef.PUBLISHQOS="publishQos",ef.DATABITS="dataBits",(eb=tF||(tF={})).FORMAT="format",eb.DATAPOINTSMAXAGEDAYS="dataPointsMaxAgeDays",eb.ACCESSRESTRICTEDWRITE="accessRestrictedWrite",eb.SECRET="secret",eb.APPLYPREDICTEDDATAPOINTS="applyPredictedDataPoints",eb.ATTRIBUTELINKS="attributeLinks",eb.RULERESETIMMEDIATE="ruleResetImmediate",eb.RULESTATE="ruleState",eb.AGENTLINKCONFIG="agentLinkConfig",eb.HASPREDICTEDDATAPOINTS="hasPredictedDataPoints",eb.FORECAST="forecast",eb.STOREDATAPOINTS="storeDataPoints",eb.LABEL="label",eb.CONSTRAINTS="constraints",eb.UNITS="units",eb.USERCONNECTED="userConnected",eb.SHOWONDASHBOARD="showOnDashboard",eb.READONLY="readOnly",eb.MULTILINE="multiline",eb.ACCESSPUBLICWRITE="accessPublicWrite",eb.MOMENTARY="momentary",eb.AGENTLINK="agentLink",eb.ACCESSRESTRICTEDREAD="accessRestrictedRead",eb.ACCESSPUBLICREAD="accessPublicRead",(eg=tk||(tk={})).ASSETQUERY="assetQuery",eg.WSURL="WS_URL",eg.COLOURRGB="colourRGB",eg.VALUEFORMAT="valueFormat",eg.TEXT="text",eg.BYTE="byte",eg.USERNAMEANDPASSWORD="usernameAndPassword",eg.HTTPURL="HTTP_URL",eg.ATTRIBUTELINK="attributeLink",eg.ASSETID="assetID",eg.NUMBERMAP="numberMap",eg.HTTPMETHOD="HTTPMethod",eg.ATTRIBUTESTATE="attributeState",eg.POSITIVENUMBER="positiveNumber",eg.POSITIVEINTEGER="positiveInteger",eg.EXECUTIONSTATUS="executionStatus",eg.BIGINTEGER="bigInteger",eg.VALUEDESCRIPTOR="valueDescriptor",eg.PERIODDURATIONISO8601="periodDurationISO8601",eg.LONG="long",eg.DATEANDTIME="dateAndTime",eg.BOOLEANMAP="booleanMap",eg.MQTTQOS="MQTTQos",eg.NEGATIVEINTEGER="negativeInteger",eg.TCPIPPORTNUMBER="TCP_IPPortNumber",eg.GEOJSONPOINT="GEO_JSONPoint",eg.SNMPVERSION="SNMPVersion",eg.ASSETTYPE="assetType",eg.JSONOBJECT="JSONObject",eg.INTEGERMAP="integerMap",eg.BIGNUMBER="bigNumber",eg.IPADDRESS="IPAddress",eg.EMAIL="email",eg.TIMESTAMP="timestamp",eg.KNXMESSAGESOURCEADDRESS="kNXMessageSourceAddress",eg.ATTRIBUTEREFERENCE="attributeReference",eg.UUID="UUID",eg.INTEGER="integer",eg.OAUTHGRANT="oAuthGrant",eg.NUMBER="number",eg.DEVICECONFIGMAP="DeviceConfigMap",eg.TEXTMAP="textMap",eg.WEBSOCKETSUBSCRIPTION="websocketSubscription",eg.BOOLEAN="boolean",eg.TIMEANDPERIODDURATIONISO8601="timeAndPeriodDurationISO8601",eg.FORECASTCONFIGURATION="forecastConfiguration",eg.TIMEDURATIONISO8601="timeDurationISO8601",eg.TIMESTAMPISO8601="timestampISO8601",eg.CONSOLEPROVIDERS="consoleProviders",eg.MULTIVALUEDTEXTMAP="multivaluedTextMap",eg.NEGATIVENUMBER="negativeNumber",eg.PARITYBIT="Paritybit",eg.JSON="JSON",eg.CRONEXPRESSION="CRONExpression",eg.INTEGERBYTE="integerByte",eg.AGENTLINK="agentLink",eg.DIRECTION="direction",eg.HOSTORIPADDRESS="hostOrIPAddress",eg.STOPBITS="Stopbits",eg.CALENDAREVENT="calendarEvent",eg.CONNECTIONSTATUS="connectionStatus",eg.VALUECONSTRAINT="valueConstraint",(e_=tE||(tE={})).MONTH="month",e_.MILE_SCANDINAVIAN="mile_scandinavian",e_.VAR="var",e_.OUNCE="ounce",e_.HECTARE="hectare",e_.YARD="yard",e_.YEAR="year",e_.JOULE="joule",e_.VOLT="volt",e_.HERTZ="hertz",e_.MILE="mile",e_.DEGREE="degree",e_.KILO="kilo",e_.BTU="btu",e_.FOOT="foot",e_.MEGA="mega",e_.KELVIN="kelvin",e_.CARBON="carbon",e_.DECIBEL_ATTENUATED="decibel_attenuated",e_.INCH="inch",e_.SQUARED="squared",e_.PERCENTAGE="percentage",e_.IN_HG="inch_mercury",e_.CENTI="centi",e_.GRAM="gram",e_.CUBED="cubed",e_.DAY="day",e_.RADIAN="radian",e_.OHM="ohm",e_.MINUTE="minute",e_.PART_PER_MILLION="ppm",e_.AMP="amp",e_.MASS_POUND="pound",e_.KNOT="knot",e_.METRE="metre",e_.LITRE="litre",e_.FLUID_OUNCE="fluid_ounce",e_.HOUR="hour",e_.ACRE="acre",e_.CELSIUS="celsius",e_.RPM="rpm",e_.PASCAL="pascal",e_.DECIBEL="decibel",e_.LUMEN="lumen",e_.WEEK="week",e_.FAHRENHEIT="fahrenheit",e_.WATT="watt",e_.GALLON="gallon",e_.LUX="lux",e_.MILLI="milli",e_.BAR="bar",e_.HECTO="hecto",e_.PEAK="peak",e_.SECOND="second",e_.MICRO="micro",e_.PER="per",e_.STONE="stone",tT||(tT={});class tq{static getAssetDescriptors(){return tq._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=tq.getValueDescriptor(n)),i=n.jsonType?n:tq.getValueDescriptor(n.type)),!i&&t&&(i=tq.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}}function tG(t){return(tG="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 t$(t,n){if(!(t instanceof n))throw TypeError("Cannot call a class as a function")}function tW(t){var n=function(t,n){if("object"!=tG(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,n||"default");if("object"!=tG(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==tG(n)?n:String(n)}function tX(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,tW(r.key),r)}}function tZ(t,n,i){return n&&tX(t.prototype,n),i&&tX(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function tK(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function tJ(t,n){return(tJ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}function tQ(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&&tJ(t,n)}function t0(t,n){if(n&&("object"===tG(n)||"function"==typeof n))return n;if(void 0!==n)throw TypeError("Derived constructors may only return object or undefined");return tK(t)}function t1(t){return(t1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function t2(t,n,i){return(n=tW(n))in t?Object.defineProperty(t,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[n]=i,t}function t5(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 t3(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 t4(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t3(Object(i),!0).forEach(function(n){t2(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):t3(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}tq._assetTypeInfos=[],tq._metaItemDescriptors=[],tq._valueDescriptors=[];var t6={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)}},t8=new(function(){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t$(this,t),this.init(n,i)}return tZ(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||t6,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,t4(t4({},{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}()),t7=function(){function t(){t$(this,t),this.observers={}}return tZ(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 t9(){var t,n,i=new Promise(function(i,r){t=i,n=r});return i.resolve=t,i.reject=n,i}function ne(t){return null==t?"":""+t}function nt(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 nn(t,n,i){var r=nt(t,n,Object);r.obj[r.k]=i}function ni(t,n){var i=nt(t,n),r=i.obj,o=i.k;if(r)return r[o]}function nr(t,n,i){var r=ni(t,i);return void 0!==r?r:ni(n,i)}function no(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var na={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function ns(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,function(t){return na[t]}):t}var nl="u">typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,nc=[" ",",","?","!",";"];function nd(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 nu(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?nd(Object(i),!0).forEach(function(n){t2(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):nd(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var nm=function(t){tQ(r,t);var n,i=(n=function(){if("u"<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=t1(r);return t=n?Reflect.construct(i,arguments,t1(this).constructor):i.apply(this,arguments),t0(this,t)});function r(t){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return t$(this,r),n=i.call(this),nl&&t7.call(tK(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 tZ(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=ni(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),nn(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=ni(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=nu(nu({},l),i),nn(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)?nu(nu({},{}),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}(t7),nh={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 np(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 nf(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?np(Object(i),!0).forEach(function(n){t2(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):np(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var nb={},ng=function(t){tQ(r,t);var n,i=(n=function(){if("u"<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=t1(r);return t=n?Reflect.construct(i,arguments,t1(this).constructor):i.apply(this,arguments),t0(this,t)});function r(t){var n,o,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t$(this,r),a=i.call(this),nl&&t7.call(tK(a)),n=["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],o=tK(a),n.forEach(function(n){t[n]&&(o[n]=t[n])}),a.options=s,void 0===a.options.keySeparator&&(a.options.keySeparator="."),a.logger=t8.create("translator"),a}return tZ(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=nc.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"!==tG(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 p=n.nsSeparator||this.options.nsSeparator;return a?(f.res="".concat(u).concat(p).concat(c),f):"".concat(u).concat(p).concat(c)}return a?(f.res=c,f):c}var f=this.resolve(t,n),b=f&&f.res,g=f&&f.usedKey||c,_=f&&f.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,nf(nf({},n),{},{ns:d})):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");return a?(f.res=F,f):F}if(s){var k="[object Array]"===y,E=k?[]:{},T=k?_:g;for(var M in b)if(Object.prototype.hasOwnProperty.call(b,M)){var A="".concat(T).concat(s).concat(M);E[M]=this.translate(A,nf(nf({},n),{joinArrays:!1,ns:d})),E[M]===A&&(E[M]=b[M])}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,L=r.hasDefaultValue(n),I=D?this.pluralResolver.getSuffix(m,n.count,n):"",P=n["defaultValue".concat(I)]||n.defaultValue;!this.isValidLookup(b)&&L&&(C=!0,b=P),this.isValidLookup(b)||(S=!0,b=c);var O=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&S?void 0:b,R=L&&P!==b&&this.options.updateMissing;if(S||C||R){if(this.logger.log(R?"updateKey":"missingKey",m,u,c,R?P:b),s){var B=this.resolve(c,nf(nf({},n),{},{keySeparator:!1}));B&&B.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 z=[],Y=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&Y&&Y[0])for(var N=0;N<Y.length;N++)z.push(Y[N]);else"all"===this.options.saveMissingTo?z=this.languageUtils.toResolveHierarchy(n.lng||this.language):z.push(n.lng||this.language);var j=function(t,i,r){var a=L&&r!==b?r:O;o.options.missingKeyHandler?o.options.missingKeyHandler(t,u,i,a,R,n):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(t,u,i,a,R,n),o.emit("missingKey",t,u,i,b)};this.options.saveMissing&&(this.options.saveMissingPlurals&&D?z.forEach(function(t){o.pluralResolver.getSuffixes(t,n).forEach(function(i){j([t],c+i,n["defaultValue".concat(i)]||P)})}):j(z,c,P))}b=this.extendTranslation(b,t,n,f,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?(f.res=b,f):b}},{key:"extendTranslation",value:function(t,n,i,r,o){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,nf(nf({},this.options.interpolation.defaultVariables),i),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init(nf(nf({},i),{interpolation:nf(nf({},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=nf(nf({},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=nh.handle(h,t,n,this.options&&this.options.postProcessPassResolved?nf({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(),p=void 0!==l.context&&("string"==typeof l.context||"number"==typeof l.context)&&""!==l.context,f=l.lngs?l.lngs:s.languageUtils.toResolveHierarchy(l.lng||s.language,l.fallbackLng);u.forEach(function(t){s.isValidLookup(n)||(a=t,!nb["".concat(f[0],"-").concat(t)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(a)&&(nb["".concat(f[0],"-").concat(t)]=!0,s.logger.warn('key "'.concat(i,'" for languages "').concat(f.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!!!")),f.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,f="".concat(s.options.pluralSeparator,"zero");if(m&&(c.push(d+u),h&&c.push(d+f)),p){var b="".concat(d).concat(s.options.contextSeparator).concat(l.context);c.push(b),m&&(c.push(b+u),h&&c.push(b+f))}}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}(t7);function n_(t){return t.charAt(0).toUpperCase()+t.slice(1)}var ny=function(){function t(n){t$(this,t),this.options=n,this.supportedLngs=this.options.supportedLngs||!1,this.logger=t8.create("languageUtils")}return tZ(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]=n_(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]=n_(i[1].toLowerCase())),n.indexOf(i[2].toLowerCase())>-1&&(i[2]=n_(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}(),nv=[{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}],nx={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)}},nw=["v1","v2","v3"],nF={zero:0,one:1,two:2,few:3,many:4,other:5},nk=function(){function t(n){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t$(this,t),this.languageUtils=n,this.options=r,this.logger=t8.create("pluralResolver"),(!this.options.compatibilityJSON||"v4"===this.options.compatibilityJSON)&&("u"<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={},nv.forEach(function(t){t.lngs.forEach(function(n){i[n]={numbers:t.nr,plurals:nx[t.fc]}})}),i)}return tZ(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 nF[t]-nF[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!nw.includes(this.options.compatibilityJSON)}}]),t}();function nE(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 nT(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?nE(Object(i),!0).forEach(function(n){t2(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):nE(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var nM=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t$(this,t),this.logger=t8.create("interpolator"),this.options=n,this.format=n.interpolation&&n.interpolation.format||function(t){return t},this.init(n)}return tZ(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:ns,this.escapeValue=void 0===n.escapeValue||n.escapeValue,this.useRawValueToEscape=void 0!==n.useRawValueToEscape&&n.useRawValueToEscape,this.prefix=n.prefix?no(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?no(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?no(n.nestingPrefix):n.nestingPrefixEscaped||no("$t("),this.nestingSuffix=n.nestingSuffix?no(n.nestingSuffix):n.nestingSuffixEscaped||no(")"),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=nr(n,c,t);return l.alwaysFormat?l.format(o,void 0,i,nT(nT(nT({},r),n),{},{interpolationkey:t})):o}var a=t.split(l.formatSeparator),s=a.shift().trim(),d=a.join(l.formatSeparator).trim();return l.format(nr(n,c,s),d,i,nT(nT(nT({},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=ne(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=nT({},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=nT(nT({},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=ne(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,nT(nT({},a),{},{interpolationkey:i[1].trim()}))},r.trim())),t=t.replace(i[0],r),this.regexp.lastIndex=0}return t}}]),t}();function nA(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 nC(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?nA(Object(i),!0).forEach(function(n){t2(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):nA(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}function nS(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 nD=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t$(this,t),this.logger=t8.create("formatter"),this.options=n,this.formats={number:nS(function(t,n){var i=new Intl.NumberFormat(t,n);return function(t){return i.format(t)}}),currency:nS(function(t,n){var i=new Intl.NumberFormat(t,nC(nC({},n),{},{style:"currency"}));return function(t){return i.format(t)}}),datetime:nS(function(t,n){var i=new Intl.DateTimeFormat(t,nC({},n));return function(t){return i.format(t)}}),relativetime:nS(function(t,n){var i=new Intl.RelativeTimeFormat(t,nC({},n));return function(t){return i.format(t,n.range||"day")}}),list:nS(function(t,n){var i=new Intl.ListFormat(t,nC({},n));return function(t){return i.format(t)}})},this.init(n)}return tZ(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()]=nS(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("u">typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||function(t,n){if(t){if("string"==typeof t)return t5(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 t5(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,nC(nC(nC({},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 nL(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 nI(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?nL(Object(i),!0).forEach(function(n){t2(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):nL(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var nP=function(t){tQ(r,t);var n,i=(n=function(){if("u"<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=t1(r);return t=n?Reflect.construct(i,arguments,t1(this).constructor):i.apply(this,arguments),t0(this,t)});function r(t,n,o){var a,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t$(this,r),a=i.call(this),nl&&t7.call(tK(a)),a.backend=t,a.store=n,a.services=o,a.languageUtils=o.languageUtils,a.options=s,a.logger=t8.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 tZ(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;r=i.loaded,(c=(l=nt(r,[o],Object)).obj)[d=l.k]=c[d]||[],c[d].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)}l&&c&&o<r.maxRetries?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]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)?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,nI(nI({},a),{},{isUpdate:o})),t&&t[0]&&this.store.addResource(t[0],n,i,r))}}]),r}(t7);function nO(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 nR(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 nB(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?nR(Object(i),!0).forEach(function(n){t2(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):nR(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}function nz(){}var nY=function(t){tQ(r,t);var n,i=(n=function(){if("u"<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=t1(r);return t=n?Reflect.construct(i,arguments,t1(this).constructor):i.apply(this,arguments),t0(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(t$(this,r),n=i.call(this),nl&&t7.call(tK(n)),n.options=nO(o),n.services={},n.logger=t8,n.modules={external:[]},Object.getOwnPropertyNames(Object.getPrototypeOf(t=tK(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),t0(n,tK(n));setTimeout(function(){n.init(o,a)},0)}return n}return tZ(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"===tG(t[1])&&(n=t[1]),"string"==typeof t[1]&&(n.defaultValue=t[1]),"string"==typeof t[2]&&(n.tDescription=t[2]),"object"===tG(t[2])||"object"===tG(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=nB(nB(nB({},r),this.options),nO(n)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=nB(nB({},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?t8.init(o(this.modules.logger),this.options):t8.init(null,this.options),this.modules.formatter?a=this.modules.formatter:"u">typeof Intl&&(a=nD);var a,s=new ny(this.options);this.store=new nm(this.options.resources,this.options);var l=this.services;l.logger=t8,l.resourceStore=this.store,l.languageUtils=s,l.pluralResolver=new nk(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 nM(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new nP(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 ng(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=nz),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=t9(),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]:nz,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=t9();return t||(t=this.languages),n||(n=this.options.ns),i||(i=nz),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&&nh.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=t9();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"!==tG(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=nB({},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=t9();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=t9();"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]:nz,o=nB(nB(nB({},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=nB({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new ng(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}(t7);t2(nY,"createInstance",function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new nY(t,n)});var nN=nY.createInstance();nN.createInstance=nY.createInstance,nN.createInstance,nN.init,nN.loadResources,nN.reloadResources,nN.use,nN.changeLanguage,nN.getFixedT,nN.t,nN.exists,nN.setDefaultNamespace,nN.hasLoadedNamespace,nN.loadNamespaces,nN.loadLanguages;let nj=nN;var nH=o(8183),nU=o.n(nH),nV=o(4867),nq=o.n(nV);o(3472);class nG{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 n$(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=>n$(t[i],n[i]))}return!1}function nW(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 nX(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 nZ(t,n,i,r,o,a){let s=nK(t?t.value:void 0,()=>nQ("format",t,n,i,o),void 0,a),l=nQ("units",t,n,i,!0);return r&&l&&l.length&&(s=nJ(nQ("units",t,n,i,o),s)),s}function nK(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||nj.language,r).format(t);break;case"boolean":r.asOnOff&&(o=t?nj.t("on"):nj.t("off")),r.asOpenClosed&&(o=t?nj.t("open"):nj.t("closed")),r.asPressedReleased&&(o=t?nj.t("pressed"):nj.t("released"));break;case"object":if(r.momentJsFormat)o=nq()(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||nj.language,r).format(t)}else o=Object(t).toString()}return o}function nJ(t,n){if(!t)return"";n||(n="");let i=t.map((t,i)=>{if(3!==t.length||t.toUpperCase()!==t)return nj.t(["units."+t,"or:units."+t]);{let r=new Intl.NumberFormat(nj.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 nQ(t,n,i,r,o){let a,s=[],l=n0(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=nX(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=tq.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 n0(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 nj.t(l,{defaultValue:a||""})}function n1(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 n2=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 n5=o(4461);class n3{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=n3._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 p=sx.getAppName();p.length>0&&0>u.apps.indexOf(p)&&u.apps.push(p),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 n2(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 n2(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 n2(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 n2(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 n2(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 nG,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={}),sx.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 n2(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:n5.name,version:n5.version,platform:n5.os.toString(),apps:[],model:((n5.manufacturer?n5.manufacturer+" ":"")+(n5.product?n5.product:"")).trim()}}_initialiseProvider(t){return n2(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)}})}}function n4(t,n){return function(){return t.apply(n,arguments)}}let{toString:n6}=Object.prototype,{getPrototypeOf:n8}=Object,{iterator:n7,toStringTag:n9}=Symbol,ie=(n=Object.create(null),t=>{let i=n6.call(t);return n[i]||(n[i]=i.slice(8,-1).toLowerCase())}),it=t=>(t=t.toLowerCase(),n=>ie(n)===t),ii=t=>n=>typeof n===t,{isArray:ir}=Array,io=ii("undefined");function ia(t){return null!==t&&!io(t)&&null!==t.constructor&&!io(t.constructor)&&ic(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}let is=it("ArrayBuffer"),il=ii("string"),ic=ii("function"),id=ii("number"),iu=t=>null!==t&&"object"==typeof t,im=t=>{if("object"!==ie(t))return!1;let n=n8(t);return(null===n||n===Object.prototype||null===Object.getPrototypeOf(n))&&!(n9 in t)&&!(n7 in t)},ih=it("Date"),ip=it("File"),ib=it("Blob"),ig=it("FileList"),i_="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},iy=void 0!==i_.FormData?i_.FormData:void 0,iv=it("URLSearchParams"),[ix,iw,iF,ik]=["ReadableStream","Request","Response","Headers"].map(it);function iE(t,n,{allOwnKeys:i=!1}={}){let r,o;if(null!=t)if("object"!=typeof t&&(t=[t]),ir(t))for(r=0,o=t.length;r<o;r++)n.call(null,t[r],r,t);else{let o;if(ia(t))return;let a=i?Object.getOwnPropertyNames(t):Object.keys(t),s=a.length;for(r=0;r<s;r++)o=a[r],n.call(null,t[o],o,t)}}function iT(t,n){let i;if(ia(t))return null;n=n.toLowerCase();let r=Object.keys(t),o=r.length;for(;o-- >0;)if(n===(i=r[o]).toLowerCase())return i;return null}let iM="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,iA=t=>!io(t)&&t!==iM,iC=(i="u">typeof Uint8Array&&n8(Uint8Array),t=>i&&t instanceof i),iS=it("HTMLFormElement"),iD=(({hasOwnProperty:t})=>(n,i)=>t.call(n,i))(Object.prototype),iL=it("RegExp"),iI=(t,n)=>{let i=Object.getOwnPropertyDescriptors(t),r={};iE(i,(i,o)=>{let a;!1!==(a=n(i,o,t))&&(r[o]=a||i)}),Object.defineProperties(t,r)},iP=it("AsyncFunction"),iO=(l="function"==typeof setImmediate,c=ic(iM.postMessage),l?setImmediate:c?(d=`axios@${Math.random()}`,u=[],iM.addEventListener("message",({source:t,data:n})=>{t===iM&&n===d&&u.length&&u.shift()()},!1),t=>{u.push(t),iM.postMessage(d,"*")}):t=>setTimeout(t)),iR="u">typeof queueMicrotask?queueMicrotask.bind(iM):"u">typeof process&&process.nextTick||iO,iB={isArray:ir,isArrayBuffer:is,isBuffer:ia,isFormData:t=>{let n;return t&&(iy&&t instanceof iy||ic(t.append)&&("formdata"===(n=ie(t))||"object"===n&&ic(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&is(t.buffer)},isString:il,isNumber:id,isBoolean:t=>!0===t||!1===t,isObject:iu,isPlainObject:im,isEmptyObject:t=>{if(!iu(t)||ia(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(t){return!1}},isReadableStream:ix,isRequest:iw,isResponse:iF,isHeaders:ik,isUndefined:io,isDate:ih,isFile:ip,isReactNativeBlob:t=>!!(t&&void 0!==t.uri),isReactNative:t=>t&&void 0!==t.getParts,isBlob:ib,isRegExp:iL,isFunction:ic,isStream:t=>iu(t)&&ic(t.pipe),isURLSearchParams:iv,isTypedArray:iC,isFileList:ig,forEach:iE,merge:function t(){let{caseless:n,skipUndefined:i}=iA(this)&&this||{},r={},o=(o,a)=>{if("__proto__"===a||"constructor"===a||"prototype"===a)return;let s=n&&iT(r,a)||a;im(r[s])&&im(o)?r[s]=t(r[s],o):im(o)?r[s]=t({},o):ir(o)?r[s]=o.slice():i&&io(o)||(r[s]=o)};for(let t=0,n=arguments.length;t<n;t++)arguments[t]&&iE(arguments[t],o);return r},extend:(t,n,i,{allOwnKeys:r}={})=>(iE(n,(n,r)=>{i&&ic(n)?Object.defineProperty(t,r,{value:n4(n,i),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,r,{value:n,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,n,i,r)=>{t.prototype=Object.create(n.prototype,r),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:n.prototype}),i&&Object.assign(t.prototype,i)},toFlatObject:(t,n,i,r)=>{let o,a,s,l={};if(n=n||{},null==t)return n;do{for(a=(o=Object.getOwnPropertyNames(t)).length;a-- >0;)s=o[a],(!r||r(s,t,n))&&!l[s]&&(n[s]=t[s],l[s]=!0);t=!1!==i&&n8(t)}while(t&&(!i||i(t,n))&&t!==Object.prototype);return n},kindOf:ie,kindOfTest:it,endsWith:(t,n,i)=>{t=String(t),(void 0===i||i>t.length)&&(i=t.length),i-=n.length;let r=t.indexOf(n,i);return -1!==r&&r===i},toArray:t=>{if(!t)return null;if(ir(t))return t;let n=t.length;if(!id(n))return null;let i=Array(n);for(;n-- >0;)i[n]=t[n];return i},forEachEntry:(t,n)=>{let i,r=(t&&t[n7]).call(t);for(;(i=r.next())&&!i.done;){let r=i.value;n.call(t,r[0],r[1])}},matchAll:(t,n)=>{let i,r=[];for(;null!==(i=t.exec(n));)r.push(i);return r},isHTMLForm:iS,hasOwnProperty:iD,hasOwnProp:iD,reduceDescriptors:iI,freezeMethods:t=>{iI(t,(n,i)=>{if(ic(t)&&-1!==["arguments","caller","callee"].indexOf(i))return!1;if(ic(t[i])){if(n.enumerable=!1,"writable"in n){n.writable=!1;return}n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},toObjectSet:(t,n)=>{let i={};return(ir(t)?t:String(t).split(n)).forEach(t=>{i[t]=!0}),i},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,i){return n.toUpperCase()+i}),noop:()=>{},toFiniteNumber:(t,n)=>null!=t&&Number.isFinite(t*=1)?t:n,findKey:iT,global:iM,isContextDefined:iA,isSpecCompliantForm:function(t){return!!(t&&ic(t.append)&&"FormData"===t[n9]&&t[n7])},toJSONObject:t=>{let n=Array(10),i=(t,r)=>{if(iu(t)){if(n.indexOf(t)>=0)return;if(ia(t))return t;if(!("toJSON"in t)){n[r]=t;let o=ir(t)?[]:{};return iE(t,(t,n)=>{let a=i(t,r+1);io(a)||(o[n]=a)}),n[r]=void 0,o}}return t};return i(t,0)},isAsyncFn:iP,isThenable:t=>t&&(iu(t)||ic(t))&&ic(t.then)&&ic(t.catch),setImmediate:iO,asap:iR,isIterable:t=>null!=t&&ic(t[n7])};class iz extends Error{static from(t,n,i,r,o,a){let s=new iz(t.message,n||t.code,i,r,o);return s.cause=t,s.name=t.name,null!=t.status&&null==s.status&&(s.status=t.status),a&&Object.assign(s,a),s}constructor(t,n,i,r,o){super(t),Object.defineProperty(this,"message",{value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),i&&(this.config=i),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:iB.toJSONObject(this.config),code:this.code,status:this.status}}}iz.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",iz.ERR_BAD_OPTION="ERR_BAD_OPTION",iz.ECONNABORTED="ECONNABORTED",iz.ETIMEDOUT="ETIMEDOUT",iz.ERR_NETWORK="ERR_NETWORK",iz.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",iz.ERR_DEPRECATED="ERR_DEPRECATED",iz.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",iz.ERR_BAD_REQUEST="ERR_BAD_REQUEST",iz.ERR_CANCELED="ERR_CANCELED",iz.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",iz.ERR_INVALID_URL="ERR_INVALID_URL";let iY=iz;function iN(t){return iB.isPlainObject(t)||iB.isArray(t)}function ij(t){return iB.endsWith(t,"[]")?t.slice(0,-2):t}function iH(t,n,i){return t?t.concat(n).map(function(t,n){return t=ij(t),!i&&n?"["+t+"]":t}).join(i?".":""):n}let iU=iB.toFlatObject(iB,{},null,function(t){return/^is[A-Z]/.test(t)}),iV=function(t,n,i){if(!iB.isObject(t))throw TypeError("target must be an object");n=n||new FormData;let r=(i=iB.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(t,n){return!iB.isUndefined(n[t])})).metaTokens,o=i.visitor||d,a=i.dots,s=i.indexes,l=(i.Blob||"u">typeof Blob&&Blob)&&iB.isSpecCompliantForm(n);if(!iB.isFunction(o))throw TypeError("visitor must be a function");function c(t){if(null===t)return"";if(iB.isDate(t))return t.toISOString();if(iB.isBoolean(t))return t.toString();if(!l&&iB.isBlob(t))throw new iY("Blob is not supported. Use a Buffer instead.");return iB.isArrayBuffer(t)||iB.isTypedArray(t)?l&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function d(t,i,o){let l=t;if(iB.isReactNative(n)&&iB.isReactNativeBlob(t))return n.append(iH(o,i,a),c(t)),!1;if(t&&!o&&"object"==typeof t)if(iB.endsWith(i,"{}"))i=r?i:i.slice(0,-2),t=JSON.stringify(t);else{var d;if(iB.isArray(t)&&(d=t,iB.isArray(d)&&!d.some(iN))||(iB.isFileList(t)||iB.endsWith(i,"[]"))&&(l=iB.toArray(t)))return i=ij(i),l.forEach(function(t,r){iB.isUndefined(t)||null===t||n.append(!0===s?iH([i],r,a):null===s?i:i+"[]",c(t))}),!1}return!!iN(t)||(n.append(iH(o,i,a),c(t)),!1)}let u=[],m=Object.assign(iU,{defaultVisitor:d,convertValue:c,isVisitable:iN});if(!iB.isObject(t))throw TypeError("data must be an object");return!function t(i,r){if(!iB.isUndefined(i)){if(-1!==u.indexOf(i))throw Error("Circular reference detected in "+r.join("."));u.push(i),iB.forEach(i,function(i,a){!0===(!(iB.isUndefined(i)||null===i)&&o.call(n,i,iB.isString(a)?a.trim():a,r,m))&&t(i,r?r.concat(a):[a])}),u.pop()}}(t),n};function iq(t){let n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(t){return n[t]})}function iG(t,n){this._pairs=[],t&&iV(t,this,n)}let i$=iG.prototype;function iW(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function iX(t,n,i){let r;if(!n)return t;let o=i&&i.encode||iW,a=iB.isFunction(i)?{serialize:i}:i,s=a&&a.serialize;if(r=s?s(n,a):iB.isURLSearchParams(n)?n.toString():new iG(n,a).toString(o)){let n=t.indexOf("#");-1!==n&&(t=t.slice(0,n)),t+=(-1===t.indexOf("?")?"?":"&")+r}return t}i$.append=function(t,n){this._pairs.push([t,n])},i$.toString=function(t){let n=t?function(n){return t.call(this,n,iq)}:iq;return this._pairs.map(function(t){return n(t[0])+"="+n(t[1])},"").join("&")};let iZ=class{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){iB.forEach(this.handlers,function(n){null!==n&&t(n)})}},iK={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},iJ="u">typeof URLSearchParams?URLSearchParams:iG,iQ="u">typeof FormData?FormData:null,i0="u">typeof Blob?Blob:null,i1="u">typeof window&&"u">typeof document,i2="object"==typeof navigator&&navigator||void 0,i5=i1&&(!i2||0>["ReactNative","NativeScript","NS"].indexOf(i2.product)),i3="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,i4=i1&&window.location.href||"http://localhost",i6={...tU,isBrowser:!0,classes:{URLSearchParams:iJ,FormData:iQ,Blob:i0},protocols:["http","https","file","blob","url","data"]},i8=function(t){if(iB.isFormData(t)&&iB.isFunction(t.entries)){let n={};return iB.forEachEntry(t,(t,i)=>{!function t(n,i,r,o){let a=n[o++];if("__proto__"===a)return!0;let s=Number.isFinite(+a),l=o>=n.length;return(a=!a&&iB.isArray(r)?r.length:a,l)?iB.hasOwnProp(r,a)?r[a]=[r[a],i]:r[a]=i:(r[a]&&iB.isObject(r[a])||(r[a]=[]),t(n,i,r[a],o)&&iB.isArray(r[a])&&(r[a]=function(t){let n,i,r={},o=Object.keys(t),a=o.length;for(n=0;n<a;n++)r[i=o[n]]=t[i];return r}(r[a]))),!s}(iB.matchAll(/\w+|\[(\w*)]/g,t).map(t=>"[]"===t[0]?"":t[1]||t[0]),i,n,0)}),n}return null},i7={transitional:iK,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){let i,r=n.getContentType()||"",o=r.indexOf("application/json")>-1,a=iB.isObject(t);if(a&&iB.isHTMLForm(t)&&(t=new FormData(t)),iB.isFormData(t))return o?JSON.stringify(i8(t)):t;if(iB.isArrayBuffer(t)||iB.isBuffer(t)||iB.isStream(t)||iB.isFile(t)||iB.isBlob(t)||iB.isReadableStream(t))return t;if(iB.isArrayBufferView(t))return t.buffer;if(iB.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1){var s,l;return(s=t,l=this.formSerializer,iV(s,new i6.classes.URLSearchParams,{visitor:function(t,n,i,r){return i6.isNode&&iB.isBuffer(t)?(this.append(n,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...l})).toString()}if((i=iB.isFileList(t))||r.indexOf("multipart/form-data")>-1){let n=this.env&&this.env.FormData;return iV(i?{"files[]":t}:t,n&&new n,this.formSerializer)}}if(a||o){n.setContentType("application/json",!1);var c=t;if(iB.isString(c))try{return(0,JSON.parse)(c),iB.trim(c)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(c)}return t}],transformResponse:[function(t){let n=this.transitional||i7.transitional,i=n&&n.forcedJSONParsing,r="json"===this.responseType;if(iB.isResponse(t)||iB.isReadableStream(t))return t;if(t&&iB.isString(t)&&(i&&!this.responseType||r)){let i=n&&n.silentJSONParsing;try{return JSON.parse(t,this.parseReviver)}catch(t){if(!i&&r){if("SyntaxError"===t.name)throw iY.from(t,iY.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:i6.classes.FormData,Blob:i6.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};iB.forEach(["delete","get","head","post","put","patch"],t=>{i7.headers[t]={}});let i9=iB.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),re=Symbol("internals");function rt(t){return t&&String(t).trim().toLowerCase()}function rn(t){return!1===t||null==t?t:iB.isArray(t)?t.map(rn):String(t)}function ri(t,n,i,r,o){if(iB.isFunction(r))return r.call(this,n,i);if(o&&(n=i),iB.isString(n)){if(iB.isString(r))return -1!==n.indexOf(r);if(iB.isRegExp(r))return r.test(n)}}class rr{constructor(t){t&&this.set(t)}set(t,n,i){let r=this;function o(t,n,i){let o=rt(n);if(!o)throw Error("header name must be a non-empty string");let a=iB.findKey(r,o);a&&void 0!==r[a]&&!0!==i&&(void 0!==i||!1===r[a])||(r[a||n]=rn(t))}let a=(t,n)=>iB.forEach(t,(t,i)=>o(t,i,n));if(iB.isPlainObject(t)||t instanceof this.constructor)a(t,n);else{let r;if(iB.isString(t)&&(t=t.trim())&&(r=t,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim()))){var s;let i,r,o,l;a((l={},(s=t)&&s.split("\n").forEach(function(t){o=t.indexOf(":"),i=t.substring(0,o).trim().toLowerCase(),r=t.substring(o+1).trim(),!i||l[i]&&i9[i]||("set-cookie"===i?l[i]?l[i].push(r):l[i]=[r]:l[i]=l[i]?l[i]+", "+r:r)}),l),n)}else if(iB.isObject(t)&&iB.isIterable(t)){let i={},r,o;for(let n of t){if(!iB.isArray(n))throw TypeError("Object iterator must return a key-value pair");i[o=n[0]]=(r=i[o])?iB.isArray(r)?[...r,n[1]]:[r,n[1]]:n[1]}a(i,n)}else null!=t&&o(n,t,i)}return this}get(t,n){if(t=rt(t)){let i=iB.findKey(this,t);if(i){let t=this[i];if(!n)return t;if(!0===n){let n,i=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;n=r.exec(t);)i[n[1]]=n[2];return i}if(iB.isFunction(n))return n.call(this,t,i);if(iB.isRegExp(n))return n.exec(t);throw TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=rt(t)){let i=iB.findKey(this,t);return!!(i&&void 0!==this[i]&&(!n||ri(this,this[i],i,n)))}return!1}delete(t,n){let i=this,r=!1;function o(t){if(t=rt(t)){let o=iB.findKey(i,t);o&&(!n||ri(i,i[o],o,n))&&(delete i[o],r=!0)}}return iB.isArray(t)?t.forEach(o):o(t),r}clear(t){let n=Object.keys(this),i=n.length,r=!1;for(;i--;){let o=n[i];(!t||ri(this,this[o],o,t,!0))&&(delete this[o],r=!0)}return r}normalize(t){let n=this,i={};return iB.forEach(this,(r,o)=>{let a=iB.findKey(i,o);if(a){n[a]=rn(r),delete n[o];return}let s=t?o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,i)=>n.toUpperCase()+i):String(o).trim();s!==o&&delete n[o],n[s]=rn(r),i[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let n=Object.create(null);return iB.forEach(this,(i,r)=>{null!=i&&!1!==i&&(n[r]=t&&iB.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){let i=new this(t);return n.forEach(t=>i.set(t)),i}static accessor(t){let n=(this[re]=this[re]={accessors:{}}).accessors,i=this.prototype;function r(t){let r=rt(t);if(!n[r]){let o;o=iB.toCamelCase(" "+t),["get","set","has"].forEach(n=>{Object.defineProperty(i,n+o,{value:function(i,r,o){return this[n].call(this,t,i,r,o)},configurable:!0})}),n[r]=!0}}return iB.isArray(t)?t.forEach(r):r(t),this}}function ro(t,n){let i=this||i7,r=n||i,o=rr.from(r.headers),a=r.data;return iB.forEach(t,function(t){a=t.call(i,a,o.normalize(),n?n.status:void 0)}),o.normalize(),a}function ra(t){return!!(t&&t.__CANCEL__)}rr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),iB.reduceDescriptors(rr.prototype,({value:t},n)=>{let i=n[0].toUpperCase()+n.slice(1);return{get:()=>t,set(t){this[i]=t}}}),iB.freezeMethods(rr);let rs=class extends iY{constructor(t,n,i){super(null==t?"canceled":t,iY.ERR_CANCELED,n,i),this.name="CanceledError",this.__CANCEL__=!0}};function rl(t,n,i){let r=i.config.validateStatus;!i.status||!r||r(i.status)?t(i):n(new iY("Request failed with status code "+i.status,[iY.ERR_BAD_REQUEST,iY.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}let rc=function(t,n){let i,r=Array(t=t||10),o=Array(t),a=0,s=0;return n=void 0!==n?n:1e3,function(l){let c=Date.now(),d=o[s];i||(i=c),r[a]=l,o[a]=c;let u=s,m=0;for(;u!==a;)m+=r[u++],u%=t;if((a=(a+1)%t)===s&&(s=(s+1)%t),c-i<n)return;let h=d&&c-d;return h?Math.round(1e3*m/h):void 0}},rd=function(t,n){let i,r,o=0,a=1e3/n,s=(n,a=Date.now())=>{o=a,i=null,r&&(clearTimeout(r),r=null),t(...n)};return[(...t)=>{let n=Date.now(),l=n-o;l>=a?s(t,n):(i=t,r||(r=setTimeout(()=>{r=null,s(i)},a-l)))},()=>i&&s(i)]},ru=(t,n,i=3)=>{let r=0,o=rc(50,250);return rd(i=>{let a=i.loaded,s=i.lengthComputable?i.total:void 0,l=a-r,c=o(l);r=a,t({loaded:a,total:s,progress:s?a/s:void 0,bytes:l,rate:c||void 0,estimated:c&&s&&a<=s?(s-a)/c:void 0,event:i,lengthComputable:null!=s,[n?"download":"upload"]:!0})},i)},rm=(t,n)=>{let i=null!=t;return[r=>n[0]({lengthComputable:i,total:t,loaded:r}),n[1]]},rh=t=>(...n)=>iB.asap(()=>t(...n)),rp=i6.hasStandardBrowserEnv?(r=new URL(i6.origin),s=i6.navigator&&/(msie|trident)/i.test(i6.navigator.userAgent),t=>(t=new URL(t,i6.origin),r.protocol===t.protocol&&r.host===t.host&&(s||r.port===t.port))):()=>!0,rf=i6.hasStandardBrowserEnv?{write(t,n,i,r,o,a,s){if("u"<typeof document)return;let l=[`${t}=${encodeURIComponent(n)}`];iB.isNumber(i)&&l.push(`expires=${new Date(i).toUTCString()}`),iB.isString(r)&&l.push(`path=${r}`),iB.isString(o)&&l.push(`domain=${o}`),!0===a&&l.push("secure"),iB.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(t){if("u"<typeof document)return null;let n=document.cookie.match(RegExp("(?:^|; )"+t+"=([^;]*)"));return n?decodeURIComponent(n[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function rb(t,n,i){let r=!("string"==typeof n&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n));return t&&(r||!1==i)?n?t.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):t:n}let rg=t=>t instanceof rr?{...t}:t;function r_(t,n){n=n||{};let i={};function r(t,n,i,r){return iB.isPlainObject(t)&&iB.isPlainObject(n)?iB.merge.call({caseless:r},t,n):iB.isPlainObject(n)?iB.merge({},n):iB.isArray(n)?n.slice():n}function o(t,n,i,o){return iB.isUndefined(n)?iB.isUndefined(t)?void 0:r(void 0,t,i,o):r(t,n,i,o)}function a(t,n){if(!iB.isUndefined(n))return r(void 0,n)}function s(t,n){return iB.isUndefined(n)?iB.isUndefined(t)?void 0:r(void 0,t):r(void 0,n)}function l(i,o,a){return a in n?r(i,o):a in t?r(void 0,i):void 0}let c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(t,n,i)=>o(rg(t),rg(n),i,!0)};return iB.forEach(Object.keys({...t,...n}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;let a=iB.hasOwnProp(c,r)?c[r]:o,s=a(t[r],n[r],r);iB.isUndefined(s)&&a!==l||(i[r]=s)}),i}let ry=t=>{let n=r_({},t),{data:i,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:a,headers:s,auth:l}=n;if(n.headers=s=rr.from(s),n.url=iX(rb(n.baseURL,n.url,n.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),iB.isFormData(i)){if(i6.hasStandardBrowserEnv||i6.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(iB.isFunction(i.getHeaders)){let t=i.getHeaders(),n=["content-type","content-length"];Object.entries(t).forEach(([t,i])=>{n.includes(t.toLowerCase())&&s.set(t,i)})}}if(i6.hasStandardBrowserEnv&&(r&&iB.isFunction(r)&&(r=r(n)),r||!1!==r&&rp(n.url))){let t=o&&a&&rf.read(a);t&&s.set(o,t)}return n},rv="u">typeof XMLHttpRequest&&function(t){return new Promise(function(n,i){var r;let o,a,s,l,c,d,u=ry(t),m=u.data,h=rr.from(u.headers).normalize(),{responseType:p,onUploadProgress:f,onDownloadProgress:b}=u;function g(){l&&l(),c&&c(),u.cancelToken&&u.cancelToken.unsubscribe(o),u.signal&&u.signal.removeEventListener("abort",o)}let _=new XMLHttpRequest;function y(){if(!_)return;let r=rr.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders());rl(function(t){n(t),g()},function(t){i(t),g()},{data:p&&"text"!==p&&"json"!==p?_.response:_.responseText,status:_.status,statusText:_.statusText,headers:r,config:t,request:_}),_=null}_.open(u.method.toUpperCase(),u.url,!0),_.timeout=u.timeout,"onloadend"in _?_.onloadend=y:_.onreadystatechange=function(){!_||4!==_.readyState||(0!==_.status||_.responseURL&&0===_.responseURL.indexOf("file:"))&&setTimeout(y)},_.onabort=function(){_&&(i(new iY("Request aborted",iY.ECONNABORTED,t,_)),_=null)},_.onerror=function(n){let r=new iY(n&&n.message?n.message:"Network Error",iY.ERR_NETWORK,t,_);r.event=n||null,i(r),_=null},_.ontimeout=function(){let n=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded",r=u.transitional||iK;u.timeoutErrorMessage&&(n=u.timeoutErrorMessage),i(new iY(n,r.clarifyTimeoutError?iY.ETIMEDOUT:iY.ECONNABORTED,t,_)),_=null},void 0===m&&h.setContentType(null),"setRequestHeader"in _&&iB.forEach(h.toJSON(),function(t,n){_.setRequestHeader(n,t)}),iB.isUndefined(u.withCredentials)||(_.withCredentials=!!u.withCredentials),p&&"json"!==p&&(_.responseType=u.responseType),b&&([s,c]=ru(b,!0),_.addEventListener("progress",s)),f&&_.upload&&([a,l]=ru(f),_.upload.addEventListener("progress",a),_.upload.addEventListener("loadend",l)),(u.cancelToken||u.signal)&&(o=n=>{_&&(i(!n||n.type?new rs(null,t,_):n),_.abort(),_=null)},u.cancelToken&&u.cancelToken.subscribe(o),u.signal&&(u.signal.aborted?o():u.signal.addEventListener("abort",o)));let v=(r=u.url,(d=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r))&&d[1]||"");v&&-1===i6.protocols.indexOf(v)?i(new iY("Unsupported protocol "+v+":",iY.ERR_BAD_REQUEST,t)):_.send(m||null)})},rx=function*(t,n){let i,r=t.byteLength;if(!n||r<n)return void(yield t);let o=0;for(;o<r;)i=o+n,yield t.slice(o,i),o=i},rw=async function*(t,n){for await(let i of rF(t))yield*rx(i,n)},rF=async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);let n=t.getReader();try{for(;;){let{done:t,value:i}=await n.read();if(t)break;yield i}}finally{await n.cancel()}},rk=(t,n,i,r)=>{let o,a=rw(t,n),s=0,l=t=>{!o&&(o=!0,r&&r(t))};return new ReadableStream({async pull(t){try{let{done:n,value:r}=await a.next();if(n){l(),t.close();return}let o=r.byteLength;if(i){let t=s+=o;i(t)}t.enqueue(new Uint8Array(r))}catch(t){throw l(t),t}},cancel:t=>(l(t),a.return())},{highWaterMark:2})},{isFunction:rE}=iB,rT=(({Request:t,Response:n})=>({Request:t,Response:n}))(iB.global),{ReadableStream:rM,TextEncoder:rA}=iB.global,rC=(t,...n)=>{try{return!!t(...n)}catch(t){return!1}},rS=t=>{let n,{fetch:i,Request:r,Response:o}=t=iB.merge.call({skipUndefined:!0},rT,t),a=i?rE(i):"function"==typeof fetch,s=rE(r),l=rE(o);if(!a)return!1;let c=a&&rE(rM),d=a&&("function"==typeof rA?(n=new rA,t=>n.encode(t)):async t=>new Uint8Array(await new r(t).arrayBuffer())),u=s&&c&&rC(()=>{let t=!1,n=new r(i6.origin,{body:new rM,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!n}),m=l&&c&&rC(()=>iB.isReadableStream(new o("").body)),h={stream:m&&(t=>t.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(t=>{h[t]||(h[t]=(n,i)=>{let r=n&&n[t];if(r)return r.call(n);throw new iY(`Response type '${t}' is not supported`,iY.ERR_NOT_SUPPORT,i)})});let p=async t=>{if(null==t)return 0;if(iB.isBlob(t))return t.size;if(iB.isSpecCompliantForm(t)){let n=new r(i6.origin,{method:"POST",body:t});return(await n.arrayBuffer()).byteLength}return iB.isArrayBufferView(t)||iB.isArrayBuffer(t)?t.byteLength:(iB.isURLSearchParams(t)&&(t+=""),iB.isString(t))?(await d(t)).byteLength:void 0},f=async(t,n)=>{let i=iB.toFiniteNumber(t.getContentLength());return null==i?p(n):i};return async t=>{let n,{url:a,method:l,data:c,signal:d,cancelToken:p,timeout:b,onDownloadProgress:g,onUploadProgress:_,responseType:y,headers:v,withCredentials:x="same-origin",fetchOptions:w}=ry(t),F=i||fetch;y=y?(y+"").toLowerCase():"text";let k=((t,n)=>{let{length:i}=t=t?t.filter(Boolean):[];if(n||i){let i,r=new AbortController,o=function(t){if(!i){i=!0,s();let n=t instanceof Error?t:this.reason;r.abort(n instanceof iY?n:new rs(n instanceof Error?n.message:n))}},a=n&&setTimeout(()=>{a=null,o(new iY(`timeout of ${n}ms exceeded`,iY.ETIMEDOUT))},n),s=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)}),t=null)};t.forEach(t=>t.addEventListener("abort",o));let{signal:l}=r;return l.unsubscribe=()=>iB.asap(s),l}})([d,p&&p.toAbortSignal()],b),E=null,T=k&&k.unsubscribe&&(()=>{k.unsubscribe()});try{if(_&&u&&"get"!==l&&"head"!==l&&0!==(n=await f(v,c))){let t,i=new r(a,{method:"POST",body:c,duplex:"half"});if(iB.isFormData(c)&&(t=i.headers.get("content-type"))&&v.setContentType(t),i.body){let[t,r]=rm(n,ru(rh(_)));c=rk(i.body,65536,t,r)}}iB.isString(x)||(x=x?"include":"omit");let i=s&&"credentials"in r.prototype,d={...w,signal:k,method:l.toUpperCase(),headers:v.normalize().toJSON(),body:c,duplex:"half",credentials:i?x:void 0};E=s&&new r(a,d);let p=await (s?F(E,w):F(a,d)),b=m&&("stream"===y||"response"===y);if(m&&(g||b&&T)){let t={};["status","statusText","headers"].forEach(n=>{t[n]=p[n]});let n=iB.toFiniteNumber(p.headers.get("content-length")),[i,r]=g&&rm(n,ru(rh(g),!0))||[];p=new o(rk(p.body,65536,i,()=>{r&&r(),T&&T()}),t)}y=y||"text";let M=await h[iB.findKey(h,y)||"text"](p,t);return!b&&T&&T(),await new Promise((n,i)=>{rl(n,i,{data:M,headers:rr.from(p.headers),status:p.status,statusText:p.statusText,config:t,request:E})})}catch(n){if(T&&T(),n&&"TypeError"===n.name&&/Load failed|fetch/i.test(n.message))throw Object.assign(new iY("Network Error",iY.ERR_NETWORK,t,E,n&&n.response),{cause:n.cause||n});throw iY.from(n,n&&n.code,t,E,n&&n.response)}}},rD=new Map,rL=t=>{let n=t&&t.env||{},{fetch:i,Request:r,Response:o}=n,a=[r,o,i],s=a.length,l,c,d=rD;for(;s--;)l=a[s],void 0===(c=d.get(l))&&d.set(l,c=s?new Map:rS(n)),d=c;return c};rL();let rI={http:null,xhr:rv,fetch:{get:rL}};iB.forEach(rI,(t,n)=>{if(t){try{Object.defineProperty(t,"name",{value:n})}catch(t){}Object.defineProperty(t,"adapterName",{value:n})}});let rP=t=>`- ${t}`,rO=t=>iB.isFunction(t)||null===t||!1===t,rR=function(t,n){let i,r,{length:o}=t=iB.isArray(t)?t:[t],a={};for(let s=0;s<o;s++){let o;if(r=i=t[s],!rO(i)&&void 0===(r=rI[(o=String(i)).toLowerCase()]))throw new iY(`Unknown adapter '${o}'`);if(r&&(iB.isFunction(r)||(r=r.get(n))))break;a[o||"#"+s]=r}if(!r){let t=Object.entries(a).map(([t,n])=>`adapter ${t} `+(!1===n?"is not supported by the environment":"is not available in the build"));throw new iY("There is no suitable adapter to dispatch the request "+(o?t.length>1?"since :\n"+t.map(rP).join("\n"):" "+rP(t[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function rB(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new rs(null,t)}function rz(t){return rB(t),t.headers=rr.from(t.headers),t.data=ro.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),rR(t.adapter||i7.adapter,t)(t).then(function(n){return rB(t),n.data=ro.call(t,t.transformResponse,n),n.headers=rr.from(n.headers),n},function(n){return!ra(n)&&(rB(t),n&&n.response&&(n.response.data=ro.call(t,t.transformResponse,n.response),n.response.headers=rr.from(n.response.headers))),Promise.reject(n)})}let rY={};["object","boolean","number","function","string","symbol"].forEach((t,n)=>{rY[t]=function(i){return typeof i===t||"a"+(n<1?"n ":" ")+t}});let rN={};rY.transitional=function(t,n,i){function r(t,n){return"[Axios v1.13.6] Transitional option '"+t+"'"+n+(i?". "+i:"")}return(i,o,a)=>{if(!1===t)throw new iY(r(o," has been removed"+(n?" in "+n:"")),iY.ERR_DEPRECATED);return n&&!rN[o]&&(rN[o]=!0,console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))),!t||t(i,o,a)}},rY.spelling=function(t){return(n,i)=>(console.warn(`${i} is likely a misspelling of ${t}`),!0)};let rj=function(t,n,i){if("object"!=typeof t)throw new iY("options must be an object",iY.ERR_BAD_OPTION_VALUE);let r=Object.keys(t),o=r.length;for(;o-- >0;){let a=r[o],s=n[a];if(s){let n=t[a],i=void 0===n||s(n,a,t);if(!0!==i)throw new iY("option "+a+" must be "+i,iY.ERR_BAD_OPTION_VALUE);continue}if(!0!==i)throw new iY("Unknown option "+a,iY.ERR_BAD_OPTION)}};class rH{constructor(t){this.defaults=t||{},this.interceptors={request:new iZ,response:new iZ}}async request(t,n){try{return await this._request(t,n)}catch(t){if(t instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=Error();let i=n.stack?n.stack.replace(/^.+\n/,""):"";try{t.stack?i&&!String(t.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+i):t.stack=i}catch(t){}}throw t}}_request(t,n){let i,r;"string"==typeof t?(n=n||{}).url=t:n=t||{};let{transitional:o,paramsSerializer:a,headers:s}=n=r_(this.defaults,n);void 0!==o&&rj(o,{silentJSONParsing:rY.transitional(rY.boolean),forcedJSONParsing:rY.transitional(rY.boolean),clarifyTimeoutError:rY.transitional(rY.boolean),legacyInterceptorReqResOrdering:rY.transitional(rY.boolean)},!1),null!=a&&(iB.isFunction(a)?n.paramsSerializer={serialize:a}:rj(a,{encode:rY.function,serialize:rY.function},!0)),void 0!==n.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),rj(n,{baseUrl:rY.spelling("baseURL"),withXsrfToken:rY.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=s&&iB.merge(s.common,s[n.method]);s&&iB.forEach(["delete","get","head","post","put","patch","common"],t=>{delete s[t]}),n.headers=rr.concat(l,s);let c=[],d=!0;this.interceptors.request.forEach(function(t){if("function"==typeof t.runWhen&&!1===t.runWhen(n))return;d=d&&t.synchronous;let i=n.transitional||iK;i&&i.legacyInterceptorReqResOrdering?c.unshift(t.fulfilled,t.rejected):c.push(t.fulfilled,t.rejected)});let u=[];this.interceptors.response.forEach(function(t){u.push(t.fulfilled,t.rejected)});let m=0;if(!d){let t=[rz.bind(this),void 0];for(t.unshift(...c),t.push(...u),r=t.length,i=Promise.resolve(n);m<r;)i=i.then(t[m++],t[m++]);return i}r=c.length;let h=n;for(;m<r;){let t=c[m++],n=c[m++];try{h=t(h)}catch(t){n.call(this,t);break}}try{i=rz.call(this,h)}catch(t){return Promise.reject(t)}for(m=0,r=u.length;m<r;)i=i.then(u[m++],u[m++]);return i}getUri(t){return iX(rb((t=r_(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}}iB.forEach(["delete","get","head","options"],function(t){rH.prototype[t]=function(n,i){return this.request(r_(i||{},{method:t,url:n,data:(i||{}).data}))}}),iB.forEach(["post","put","patch"],function(t){function n(n){return function(i,r,o){return this.request(r_(o||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:r}))}}rH.prototype[t]=n(),rH.prototype[t+"Form"]=n(!0)});class rU{constructor(t){let n;if("function"!=typeof t)throw TypeError("executor must be a function.");this.promise=new Promise(function(t){n=t});const i=this;this.promise.then(t=>{if(!i._listeners)return;let n=i._listeners.length;for(;n-- >0;)i._listeners[n](t);i._listeners=null}),this.promise.then=t=>{let n,r=new Promise(t=>{i.subscribe(t),n=t}).then(t);return r.cancel=function(){i.unsubscribe(n)},r},t(function(t,r,o){i.reason||(i.reason=new rs(t,r,o),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let n=this._listeners.indexOf(t);-1!==n&&this._listeners.splice(n,1)}toAbortSignal(){let t=new AbortController,n=n=>{t.abort(n)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new rU(function(n){t=n}),cancel:t}}}let rV={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(rV).forEach(([t,n])=>{rV[n]=t});let rq=function t(n){let i=new rH(n),r=n4(rH.prototype.request,i);return iB.extend(r,rH.prototype,i,{allOwnKeys:!0}),iB.extend(r,i,null,{allOwnKeys:!0}),r.create=function(i){return t(r_(n,i))},r}(i7);rq.Axios=rH,rq.CanceledError=rs,rq.CancelToken=rU,rq.isCancel=ra,rq.VERSION="1.13.6",rq.toFormData=iV,rq.AxiosError=iY,rq.Cancel=rq.CanceledError,rq.all=function(t){return Promise.all(t)},rq.spread=function(t){return function(n){return t.apply(null,n)}},rq.isAxiosError=function(t){return iB.isObject(t)&&!0===t.isAxiosError},rq.mergeConfig=r_,rq.AxiosHeaders=rr,rq.formToJSON=t=>i8(iB.isHTMLForm(t)?new FormData(t):t),rq.getAdapter=rR,rq.HttpStatusCode=rV,rq.default=rq;class rG{constructor(t){this.httpClient=t}deleteConnections(t,n){return this.httpClient.request({method:"DELETE",url:or`gateway/connection`,queryParams:t,options:n})}getConnections(t){return this.httpClient.request({method:"GET",url:or`gateway/connection`,options:t})}deleteConnection(t,n){return this.httpClient.request({method:"DELETE",url:or`gateway/connection/${t}`,options:n})}getConnection(t,n){return this.httpClient.request({method:"GET",url:or`gateway/connection/${t}`,options:n})}setConnection(t,n,i){return this.httpClient.request({method:"PUT",url:or`gateway/connection/${t}`,data:n,options:i})}getConnectionStatus(t,n){return this.httpClient.request({method:"GET",url:or`gateway/status/${t}`,options:n})}}class r${constructor(t){this.httpClient=t}create(t,n){return this.httpClient.request({method:"POST",url:or`realm`,data:t,options:n})}getAll(t){return this.httpClient.request({method:"GET",url:or`realm`,options:t})}getAccessible(t){return this.httpClient.request({method:"GET",url:or`realm/accessible`,options:t})}delete(t,n){return this.httpClient.request({method:"DELETE",url:or`realm/${t}`,options:n})}get(t,n){return this.httpClient.request({method:"GET",url:or`realm/${t}`,options:n})}update(t,n,i){return this.httpClient.request({method:"PUT",url:or`realm/${t}`,data:n,options:i})}}class rW{constructor(t){this.httpClient=t}getAllNodeDefinitions(t){return this.httpClient.request({method:"GET",url:or`flow`,options:t})}getNodeDefinition(t,n){return this.httpClient.request({method:"GET",url:or`flow/${t}`,options:n})}getAllNodeDefinitionsByType(t,n){return this.httpClient.request({method:"GET",url:or`flow/${t}`,options:n})}}class rX{constructor(t){this.httpClient=t}doProtocolAssetDiscovery(t,n,i){return this.httpClient.request({method:"GET",url:or`agent/assetDiscovery/${t}`,queryParams:n,options:i})}doProtocolAssetImport(t,n,i,r){return this.httpClient.request({method:"POST",url:or`agent/assetImport/${t}`,queryParams:i,data:n,options:r})}doProtocolInstanceDiscovery(t,n,i){return this.httpClient.request({method:"GET",url:or`agent/instanceDiscovery/${t}`,queryParams:n,options:i})}}class rZ{constructor(t){this.httpClient=t}create(t,n){return this.httpClient.request({method:"POST",url:or`dashboard`,data:t,options:n})}update(t,n){return this.httpClient.request({method:"PUT",url:or`dashboard`,data:t,options:n})}getAllRealmDashboards(t,n){return this.httpClient.request({method:"GET",url:or`dashboard/all/${t}`,options:n})}query(t,n){return this.httpClient.request({method:"POST",url:or`dashboard/query`,data:t,options:n})}delete(t,n,i){return this.httpClient.request({method:"DELETE",url:or`dashboard/${t}/${n}`,options:i})}get(t,n,i){return this.httpClient.request({method:"GET",url:or`dashboard/${t}/${n}`,options:i})}}class rK{constructor(t){this.httpClient=t}create(t,n){return this.httpClient.request({method:"POST",url:or`asset`,data:t,options:n})}delete(t,n){return this.httpClient.request({method:"DELETE",url:or`asset`,queryParams:t,options:n})}writeAttributeValues(t,n){return this.httpClient.request({method:"PUT",url:or`asset/attributes`,data:t,options:n})}writeAttributeEvents(t,n){return this.httpClient.request({method:"PUT",url:or`asset/attributes/timestamp`,data:t,options:n})}queryCount(t,n){return this.httpClient.request({method:"POST",url:or`asset/count`,data:t,options:n})}updateNoneParent(t,n){return this.httpClient.request({method:"DELETE",url:or`asset/parent`,queryParams:t,options:n})}getPartial(t,n){return this.httpClient.request({method:"GET",url:or`asset/partial/${t}`,options:n})}queryAssets(t,n){return this.httpClient.request({method:"POST",url:or`asset/query`,data:t,options:n})}queryAssetTree(t,n){return this.httpClient.request({method:"POST",url:or`asset/tree`,data:t,options:n})}getCurrentUserAssets(t){return this.httpClient.request({method:"GET",url:or`asset/user/current`,options:t})}createUserAssetLinks(t,n){return this.httpClient.request({method:"POST",url:or`asset/user/link`,data:t,options:n})}getUserAssetLinks(t,n){return this.httpClient.request({method:"GET",url:or`asset/user/link`,queryParams:t,options:n})}deleteUserAssetLinks(t,n){return this.httpClient.request({method:"POST",url:or`asset/user/link/delete`,data:t,options:n})}deleteAllUserAssetLinks(t,n,i){return this.httpClient.request({method:"DELETE",url:or`asset/user/link/${t}/${n}`,options:i})}deleteUserAssetLink(t,n,i,r){return this.httpClient.request({method:"DELETE",url:or`asset/user/link/${t}/${n}/${i}`,options:r})}get(t,n){return this.httpClient.request({method:"GET",url:or`asset/${t}`,options:n})}update(t,n,i){return this.httpClient.request({method:"PUT",url:or`asset/${t}`,data:n,options:i})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(t,n,i,r){return this.httpClient.request({method:"PUT",url:or`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:or`asset/${t}/attribute/${n}/${i}`,data:r,options:o})}updateParent(t,n,i){return this.httpClient.request({method:"PUT",url:or`asset/${t}/child`,queryParams:n,options:i})}}class rJ{constructor(t){this.httpClient=t}getConfig(t){return this.httpClient.request({method:"GET",url:or`syslog/config`,options:t})}updateConfig(t,n){return this.httpClient.request({method:"PUT",url:or`syslog/config`,data:t,options:n})}clearEvents(t){return this.httpClient.request({method:"DELETE",url:or`syslog/event`,options:t})}getEvents(t,n){return this.httpClient.request({method:"GET",url:or`syslog/event`,queryParams:t,options:n})}}class rQ{constructor(t){this.httpClient=t}getPredictedDatapoints(t,n,i,r){return this.httpClient.request({method:"POST",url:or`asset/predicted/${t}/${n}`,data:i,options:r})}writePredictedDatapoints(t,n,i,r){return this.httpClient.request({method:"PUT",url:or`asset/predicted/${t}/${n}`,data:i,options:r})}}class r0{constructor(t){this.httpClient=t}getHealthStatus(t){return this.httpClient.request({method:"GET",url:or`health`,options:t})}getInfo(t){return this.httpClient.request({method:"GET",url:or`info`,options:t})}}class r1{constructor(t){this.httpClient=t}updateCurrentUserLocale(t,n){return this.httpClient.request({method:"PUT",url:or`user/locale`,data:t,options:n})}query(t,n){return this.httpClient.request({method:"POST",url:or`user/query`,data:t,options:n})}requestPasswordResetCurrent(t){return this.httpClient.request({method:"PUT",url:or`user/request-password-reset`,options:t})}updatePasswordCurrent(t,n){return this.httpClient.request({method:"PUT",url:or`user/reset-password`,data:t,options:n})}updateCurrent(t,n){return this.httpClient.request({method:"PUT",url:or`user/update`,data:t,options:n})}getCurrent(t){return this.httpClient.request({method:"GET",url:or`user/user`,options:t})}getCurrentUserRealmRoles(t){return this.httpClient.request({method:"GET",url:or`user/userRealmRoles`,options:t})}getCurrentUserClientRoles(t,n){return this.httpClient.request({method:"GET",url:or`user/userRoles/${t}`,options:n})}disconnectUserSession(t,n,i){return this.httpClient.request({method:"GET",url:or`user/${t}/disconnect/${n}`,options:i})}requestPasswordReset(t,n,i){return this.httpClient.request({method:"PUT",url:or`user/${t}/request-password-reset/${n}`,options:i})}updatePassword(t,n,i,r){return this.httpClient.request({method:"PUT",url:or`user/${t}/reset-password/${n}`,data:i,options:r})}resetSecret(t,n,i){return this.httpClient.request({method:"GET",url:or`user/${t}/reset-secret/${n}`,options:i})}updateRoles(t,n,i){return this.httpClient.request({method:"PUT",url:or`user/${t}/roles`,data:n,options:i})}getUserRealmRoles(t,n,i){return this.httpClient.request({method:"GET",url:or`user/${t}/userRealmRoles/${n}`,options:i})}updateUserRealmRoles(t,n,i,r){return this.httpClient.request({method:"PUT",url:or`user/${t}/userRealmRoles/${n}`,data:i,options:r})}getUserClientRoles(t,n,i,r){return this.httpClient.request({method:"GET",url:or`user/${t}/userRoles/${n}/${i}`,options:r})}updateUserClientRoles(t,n,i,r,o){return this.httpClient.request({method:"PUT",url:or`user/${t}/userRoles/${n}/${i}`,data:r,options:o})}getUserSessions(t,n,i){return this.httpClient.request({method:"GET",url:or`user/${t}/userSessions/${n}`,options:i})}create(t,n,i){return this.httpClient.request({method:"POST",url:or`user/${t}/users`,data:n,options:i})}update(t,n,i){return this.httpClient.request({method:"PUT",url:or`user/${t}/users`,data:n,options:i})}delete(t,n,i){return this.httpClient.request({method:"DELETE",url:or`user/${t}/users/${n}`,options:i})}getClientRoles(t,n,i){return this.httpClient.request({method:"GET",url:or`user/${t}/${n}/roles`,options:i})}updateClientRoles(t,n,i,r){return this.httpClient.request({method:"PUT",url:or`user/${t}/${n}/roles`,data:i,options:r})}get(t,n,i){return this.httpClient.request({method:"GET",url:or`user/${t}/${n}`,options:i})}}class r2{constructor(t){this.httpClient=t}register(t,n){return this.httpClient.request({method:"POST",url:or`console/register`,data:t,options:n})}}class r5{constructor(t){this.httpClient=t}getManagerConfig(t){return this.httpClient.request({method:"GET",url:or`configuration/manager`,options:t})}update(t,n){return this.httpClient.request({method:"PUT",url:or`configuration/manager`,data:t,options:n})}fileUpload(t,n,i){return this.httpClient.request({method:"POST",url:or`configuration/manager/file`,queryParams:n,data:t,options:i})}getManagerConfigImage(t,n){return this.httpClient.request({method:"GET",url:or`configuration/manager/image/${t}`,options:n})}}class r3{constructor(t){this.httpClient=t}getNotifications(t,n){return this.httpClient.request({method:"GET",url:or`notification`,queryParams:t,options:n})}removeNotifications(t,n){return this.httpClient.request({method:"DELETE",url:or`notification`,queryParams:t,options:n})}sendNotification(t,n){return this.httpClient.request({method:"POST",url:or`notification/alert`,data:t,options:n})}removeNotification(t,n){return this.httpClient.request({method:"DELETE",url:or`notification/${t}`,options:n})}notificationAcknowledged(t,n,i,r){return this.httpClient.request({method:"PUT",url:or`notification/${t}/acknowledged`,queryParams:i,data:n,options:r})}notificationDelivered(t,n,i){return this.httpClient.request({method:"PUT",url:or`notification/${t}/delivered`,queryParams:n,options:i})}}class r4{constructor(t){this.httpClient=t}getAssetDescriptors(t,n){return this.httpClient.request({method:"GET",url:or`model/assetDescriptors`,queryParams:t,options:n})}getAssetInfo(t,n,i){return this.httpClient.request({method:"GET",url:or`model/assetInfo/${t}`,queryParams:n,options:i})}getAssetInfos(t,n){return this.httpClient.request({method:"GET",url:or`model/assetInfos`,queryParams:t,options:n})}getValueDescriptorSchema(t,n){return this.httpClient.request({method:"GET",url:or`model/getValueDescriptorSchema`,queryParams:t,options:n})}getMetaItemDescriptors(t,n){return this.httpClient.request({method:"GET",url:or`model/metaItemDescriptors`,queryParams:t,options:n})}getValueDescriptors(t,n){return this.httpClient.request({method:"GET",url:or`model/valueDescriptors`,queryParams:t,options:n})}}class r6{constructor(t){this.httpClient=t}getSettings(t){return this.httpClient.request({method:"GET",url:or`map`,options:t})}saveSettings(t,n){return this.httpClient.request({method:"PUT",url:or`map`,data:t,options:n})}deleteMap(t){return this.httpClient.request({method:"DELETE",url:or`map/deleteMap`,options:t})}getCustomMapInfo(t){return this.httpClient.request({method:"GET",url:or`map/getCustomMapInfo`,options:t})}getTile(t,n,i,r){return this.httpClient.request({method:"GET",url:or`map/tile/${t}/${n}/${i}`,options:r})}uploadMap(t,n){return this.httpClient.request({method:"POST",url:or`map/upload`,queryParams:t,options:n})}}class r8{constructor(t){this.httpClient=t}getDatapointExport(t,n){return this.httpClient.request({method:"GET",url:or`asset/datapoint/export`,queryParams:t,options:n})}getDatapointPeriod(t,n){return this.httpClient.request({method:"GET",url:or`asset/datapoint/periods`,queryParams:t,options:n})}getDatapoints(t,n,i,r){return this.httpClient.request({method:"POST",url:or`asset/datapoint/${t}/${n}`,data:i,options:r})}}class r7{constructor(t){this.httpClient=t}startTunnel(t,n){return this.httpClient.request({method:"POST",url:or`gateway/tunnel`,data:t,options:n})}stopTunnel(t,n){return this.httpClient.request({method:"DELETE",url:or`gateway/tunnel`,data:t,options:n})}getAllActiveTunnelInfos(t,n){return this.httpClient.request({method:"GET",url:or`gateway/tunnel/${t}`,options:n})}getGatewayActiveTunnelInfos(t,n,i){return this.httpClient.request({method:"GET",url:or`gateway/tunnel/${t}/${n}`,options:i})}getActiveTunnelInfo(t,n,i,r,o){return this.httpClient.request({method:"GET",url:or`gateway/tunnel/${t}/${n}/${i}/${r}`,options:o})}}class r9{constructor(t){this.httpClient=t}createAlarm(t,n,i){return this.httpClient.request({method:"POST",url:or`alarm`,queryParams:n,data:t,options:i})}getAlarms(t,n){return this.httpClient.request({method:"GET",url:or`alarm`,queryParams:t,options:n})}removeAlarms(t,n){return this.httpClient.request({method:"DELETE",url:or`alarm`,data:t,options:n})}setAssetLinks(t,n){return this.httpClient.request({method:"PUT",url:or`alarm/assets`,data:t,options:n})}getAlarm(t,n){return this.httpClient.request({method:"GET",url:or`alarm/${t}`,options:n})}removeAlarm(t,n){return this.httpClient.request({method:"DELETE",url:or`alarm/${t}`,options:n})}updateAlarm(t,n,i){return this.httpClient.request({method:"PUT",url:or`alarm/${t}`,data:n,options:i})}getAssetLinks(t,n,i){return this.httpClient.request({method:"GET",url:or`alarm/${t}/assets`,queryParams:n,options:i})}}class oe{constructor(t){this.httpClient=t}getApps(t){return this.httpClient.request({method:"GET",url:or`apps`,options:t})}getConsoleConfig(t){return this.httpClient.request({method:"GET",url:or`apps/consoleConfig`,options:t})}getAppInfos(t){return this.httpClient.request({method:"GET",url:or`apps/info`,options:t})}}class ot{constructor(t){this.httpClient=t}getServices(t,n){return this.httpClient.request({method:"GET",url:or`service`,queryParams:t,options:n})}registerService(t,n){return this.httpClient.request({method:"POST",url:or`service`,data:t,options:n})}getGlobalServices(t){return this.httpClient.request({method:"GET",url:or`service/global`,options:t})}registerGlobalService(t,n){return this.httpClient.request({method:"POST",url:or`service/global`,data:t,options:n})}deregisterService(t,n,i){return this.httpClient.request({method:"DELETE",url:or`service/${t}/${n}`,options:i})}getService(t,n,i){return this.httpClient.request({method:"GET",url:or`service/${t}/${n}`,options:i})}heartbeat(t,n,i){return this.httpClient.request({method:"PUT",url:or`service/${t}/${n}`,options:i})}}class on{constructor(t){this.httpClient=t}createGlobalRuleset(t,n){return this.httpClient.request({method:"POST",url:or`rules`,data:t,options:n})}getGlobalRulesets(t,n){return this.httpClient.request({method:"GET",url:or`rules`,queryParams:t,options:n})}createAssetRuleset(t,n){return this.httpClient.request({method:"POST",url:or`rules/asset`,data:t,options:n})}getAssetRulesets(t,n,i){return this.httpClient.request({method:"GET",url:or`rules/asset/for/${t}`,queryParams:n,options:i})}deleteAssetRuleset(t,n){return this.httpClient.request({method:"DELETE",url:or`rules/asset/${t}`,options:n})}getAssetRuleset(t,n){return this.httpClient.request({method:"GET",url:or`rules/asset/${t}`,options:n})}updateAssetRuleset(t,n,i){return this.httpClient.request({method:"PUT",url:or`rules/asset/${t}`,data:n,options:i})}getAssetGeofences(t,n){return this.httpClient.request({method:"GET",url:or`rules/geofences/${t}`,options:n})}getAssetEngineInfo(t,n){return this.httpClient.request({method:"GET",url:or`rules/info/asset/${t}`,options:n})}getGlobalEngineInfo(t){return this.httpClient.request({method:"GET",url:or`rules/info/global`,options:t})}getRealmEngineInfo(t,n){return this.httpClient.request({method:"GET",url:or`rules/info/realm/${t}`,options:n})}createRealmRuleset(t,n){return this.httpClient.request({method:"POST",url:or`rules/realm`,data:t,options:n})}getRealmRulesets(t,n,i){return this.httpClient.request({method:"GET",url:or`rules/realm/for/${t}`,queryParams:n,options:i})}deleteRealmRuleset(t,n){return this.httpClient.request({method:"DELETE",url:or`rules/realm/${t}`,options:n})}getRealmRuleset(t,n){return this.httpClient.request({method:"GET",url:or`rules/realm/${t}`,options:n})}updateRealmRuleset(t,n,i){return this.httpClient.request({method:"PUT",url:or`rules/realm/${t}`,data:n,options:i})}deleteGlobalRuleset(t,n){return this.httpClient.request({method:"DELETE",url:or`rules/${t}`,options:n})}getGlobalRuleset(t,n){return this.httpClient.request({method:"GET",url:or`rules/${t}`,options:n})}updateGlobalRuleset(t,n,i){return this.httpClient.request({method:"PUT",url:or`rules/${t}`,data:n,options:i})}}class oi{constructor(t){this.httpClient=t}createProvisioningConfig(t,n){return this.httpClient.request({method:"POST",url:or`provisioning`,data:t,options:n})}getProvisioningConfigs(t){return this.httpClient.request({method:"GET",url:or`provisioning`,options:t})}deleteProvisioningConfig(t,n){return this.httpClient.request({method:"DELETE",url:or`provisioning/${t}`,options:n})}updateProvisioningConfig(t,n,i){return this.httpClient.request({method:"PUT",url:or`provisioning/${t}`,data:n,options:i})}}function or(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 oo{constructor(t,n=rq.create()){this._gatewayClientResource=new os(t,n),this._realmResource=new ol(t,n),this._flowResource=new oc(t,n),this._agentResource=new od(t,n),this._dashboardResource=new ou(t,n),this._assetResource=new om(t,n),this._syslogResource=new oh(t,n),this._assetPredictedDatapointResource=new op(t,n),this._statusResource=new of(t,n),this._userResource=new ob(t,n),this._consoleResource=new og(t,n),this._configurationResource=new o_(t,n),this._notificationResource=new oy(t,n),this._assetModelResource=new ov(t,n),this._mapResource=new ox(t,n),this._assetDatapointResource=new ow(t,n),this._gatewayServiceResource=new oF(t,n),this._alarmResource=new ok(t,n),this._appResource=new oE(t,n),this._externalServiceResource=new oT(t,n),this._rulesResource=new oM(t,n),this._provisioningResource=new oA(t,n),this._assetResource=new om(t,n)}get GatewayClientResource(){return this._gatewayClientResource}get RealmResource(){return this._realmResource}get FlowResource(){return this._flowResource}get AgentResource(){return this._agentResource}get DashboardResource(){return this._dashboardResource}get AssetResource(){return this._assetResource}get SyslogResource(){return this._syslogResource}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get StatusResource(){return this._statusResource}get UserResource(){return this._userResource}get ConsoleResource(){return this._consoleResource}get ConfigurationResource(){return this._configurationResource}get NotificationResource(){return this._notificationResource}get AssetModelResource(){return this._assetModelResource}get MapResource(){return this._mapResource}get AssetDatapointResource(){return this._assetDatapointResource}get GatewayServiceResource(){return this._gatewayServiceResource}get AlarmResource(){return this._alarmResource}get AppResource(){return this._appResource}get ExternalServiceResource(){return this._externalServiceResource}get RulesResource(){return this._rulesResource}get ProvisioningResource(){return this._provisioningResource}}class oa{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 os extends rG{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class ol extends r${constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class oc extends rW{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class od extends rX{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class ou extends rZ{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class om extends rK{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class oh extends rJ{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class op extends rQ{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class of extends r0{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class ob extends r1{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class og extends r2{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class o_ extends r5{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class oy extends r3{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class ov extends r4{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class ox extends r6{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class ow extends r8{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class oF extends r7{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class ok extends r9{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class oE extends oe{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class oT extends ot{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class oM extends on{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class oA extends oi{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}rq.isAxiosError;let oC=new class{get api(){return this._client}constructor(){this._axiosInstance=rq.create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(t=>(t.paramsSerializer=t=>nU().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 oo(t,this._axiosInstance)}};var oS=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())})};(ey=tM||(tM={})).DISCONNECTED="DISCONNECTED",ey.CONNECTED="CONNECTED",ey.CONNECTING="CONNECTING";let oD="SUBSCRIBED:",oL="UNAUTHORIZED:",oI="TRIGGERED:",oP="EVENT:";class oO{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=oR.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=tM.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===tM.CONNECTED)?Promise.resolve(!0):(this._disconnectRequested=!1,this._connectingDeferred||(this._onStatusChanged(tM.CONNECTING),this._connectingDeferred=new nG,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=oR.MIN_RECONNECT_DELAY,this._onStatusChanged(tM.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!==tM.DISCONNECTED&&this._doDisconnect())}subscribe(t,n){let i={eventSubscription:t,callback:n,deferred:new nG};return null!=this._pendingSubscription||this._status!==tM.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 oS(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===tM.CONNECTED&&this._doSend(t)}sendEventWithReply(t){return this._status!==tM.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(t)}subscribeAssetEvents(t,n,i){return oS(this,void 0,void 0,function*(){let r=t&&"string"!=typeof t[0]?t.map(t=>t.id):t,o="AssetEvent"+oO._subscriptionCounter++;if(!this._assetEventPromise){let t;sx.authenticated||(t={filterType:"asset",realm:sx.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===sx.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 oS(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"+oO._subscriptionCounter++;if(!this._attributeEventPromise){let t;sx.authenticated||(t={filterType:"asset",realm:sx.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===sx.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===tM.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===tM.CONNECTED&&this._onStatusChanged(tM.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(tM.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<oR.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(oR.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}oO.MIN_RECONNECT_DELAY=0,oO.MAX_RECONNECT_DELAY=3e4,oO._subscriptionCounter=0;class oR extends oO{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="+sx.config.realm;return sx.authenticated&&(t+="&Authorization="+sx.getAuthorizationHeader()),this._webSocket=new WebSocket(t),this._connectDeferred=new nG,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(oD)){let t=JSON.parse(n.substring(oD.length)),i=this._subscribeDeferred;this._subscribeDeferred=null,i&&i.resolve(t.subscriptionId)}else if(n.startsWith(oL)){let t=JSON.parse(n.substring(oL.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(oI)){let t=JSON.parse(n.substring(oI.length));t.events&&t.events.forEach(n=>{this._onMessageReceived(t.subscriptionId,n)})}else if(n.startsWith(oP)){let t=JSON.parse(n.substring(oP.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 nG,t.subscriptionId||(t.subscriptionId=oR._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=oP+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 nG;return this._repliesDeferred.set(t.messageID,n),this._webSocket.send(oP+JSON.stringify(t)),n.promise}}function oB(t){return(oB="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)}oR._subscriptionCounter=1;var oz=[],oY=oz.forEach,oN=oz.slice;function oj(t){return oY.call(oN.call(arguments,1),function(n){if(n)for(var i in n)void 0===t[i]&&(t[i]=n[i])}),t}function oH(){return"function"==typeof XMLHttpRequest||("u"<typeof XMLHttpRequest?"undefined":oB(XMLHttpRequest))==="object"}var oU=o(4550),oV=o.t(oU,2);function oq(t){return(oq="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&&(tA="u">typeof global&&global.fetch?global.fetch:"u">typeof window&&window.fetch?window.fetch:fetch),oH()&&("u">typeof global&&global.XMLHttpRequest?tC=global.XMLHttpRequest:"u">typeof window&&window.XMLHttpRequest&&(tC=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&("u">typeof global&&global.ActiveXObject?tS=global.ActiveXObject:"u">typeof window&&window.ActiveXObject&&(tS=window.ActiveXObject)),tA||!oV||tC||tS||(tA=oU||oV),"function"!=typeof tA&&(tA=void 0);var oG=function(t,n){if(n&&"object"===oq(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},o$=function(t,n,i){tA(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)},oW=!1,oX=function(t,n,i,r){t.queryStringParams&&(n=oG(n,t.queryStringParams));var o=oj({},"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=oj({method:i?"POST":"GET",body:i?t.stringify(i):void 0,headers:o},oW?{}:a);try{o$(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]}),o$(n,s,r),oW=!0}catch(t){r(t)}}},oZ=function(t,n,i,r){i&&"object"===oq(i)&&(i=oG("",i).slice(1)),t.queryStringParams&&(n=oG(n,t.queryStringParams));try{(o=tC?new tC:new tS("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 oK=function(t,n,i,r){return("function"==typeof i&&(r=i,i=void 0),r=r||function(){},tA)?oX(t,n,i,r):oH()||"function"==typeof ActiveXObject?oZ(t,n,i,r):void r(Error("No fetch and no xhr implementation found!"))};var oJ=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=oj(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:oK,reloadInterval:"u"<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}();oJ.type="backend";let oQ=globalThis,o0=oQ.ShadowRoot&&(void 0===oQ.ShadyCSS||oQ.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o1=Symbol(),o2=new WeakMap;class o5{constructor(t,n,i){if(this._$cssResult$=!0,i!==o1)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(o0&&void 0===t){let i=void 0!==n&&1===n.length;i&&(t=o2.get(n)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&o2.set(n,t))}return t}toString(){return this.cssText}}let o3=t=>new o5("string"==typeof t?t:t+"",void 0,o1),o4=(t,...n)=>new o5(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,o1),o6=o0?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let n="";for(let i of t.cssRules)n+=i.cssText;return o3(n)})(t):t,{is:o8,defineProperty:o7,getOwnPropertyDescriptor:o9,getOwnPropertyNames:ae,getOwnPropertySymbols:at,getPrototypeOf:an}=Object,ai=globalThis,ar=ai.trustedTypes,ao=ar?ar.emptyScript:"",aa=ai.reactiveElementPolyfillSupport,as={toAttribute(t,n){switch(n){case Boolean:t=t?ao: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}},al=(t,n)=>!o8(t,n),ac={attribute:!0,type:String,converter:as,reflect:!1,useDefault:!1,hasChanged:al};Symbol.metadata??=Symbol("metadata"),ai.litPropertyMetadata??=new WeakMap;class ad 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=ac){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&&o7(this.prototype,t,r)}}static getPropertyDescriptor(t,n,i){let{get:r,set:o}=o9(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)??ac}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;let t=an(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[...ae(t),...at(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(o6(i));else void 0!==t&&n.push(o6(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(o0)t.adoptedStyleSheets=n.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let i of n){let n=document.createElement("style"),r=oQ.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:as).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:as;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??al)(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){}}ad.elementStyles=[],ad.shadowRootOptions={mode:"open"},ad.elementProperties=new Map,ad.finalized=new Map,aa?.({ReactiveElement:ad}),(ai.reactiveElementVersions??=[]).push("2.1.1");let au=globalThis,am=au.trustedTypes,ah=am?am.createPolicy("lit-html",{createHTML:t=>t}):void 0,ap="$lit$",af=`lit$${Math.random().toFixed(9).slice(2)}$`,ab="?"+af,ag=`<${ab}>`,a_=document,ay=()=>a_.createComment(""),av=t=>null===t||"object"!=typeof t&&"function"!=typeof t,ax=Array.isArray,aw=t=>ax(t)||"function"==typeof t?.[Symbol.iterator],aF="[ \n\f\r]",ak=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,aE=/-->/g,aT=/>/g,aM=RegExp(`>|${aF}(?:([^\\s"'>=/]+)(${aF}*=${aF}*(?:[^
|
|
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(tA.disabled);let n="3d"===m?t.getDepthModeFor3D():t.getDepthModeForSublayer(0,tM.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?ta.projectionMercator:a.shaderPreludeCode,l=i?td:a.shaderDefine,c=t+(n?n.cacheKey:"")+`/${i?tu:a.shaderVariantName}`+(this._showOverdrawInspector?"/overdraw":"")+(o?"/terrain":"")+(r?`/${r.join("/")}`:"");return this.cache[c]||(this.cache[c]=new nn(this.context,ta[t],n,nL[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 iz(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 iY{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=iz(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.V(+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 iN={linearity:.3,easing:n.cw(0,0,.3,1)},ij=n.e({deceleration:2500,maxSpeed:1400},iN),iH=n.e({deceleration:20,maxSpeed:1400},iN),iU=n.e({deceleration:1e3,maxSpeed:360},iN),iV=n.e({deceleration:1e3,maxSpeed:90},iN),iq=n.e({deceleration:1e3,maxSpeed:360},iN);class iG{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=iW(i.pan.mag(),r,n.e({},ij,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,i$(o,a)}if(i.zoom){let t=iW(i.zoom,r,iH);o.zoom=n.cx(this._map.transform.zoom+t.amount,this._map.getZoomSnap(),t.amount),i$(o,t)}if(i.bearing){let t=iW(i.bearing,r,iU);o.bearing=this._map.transform.bearing+n.an(t.amount,-179,179),i$(o,t)}if(i.pitch){let t=iW(i.pitch,r,iV);o.pitch=this._map.transform.pitch+t.amount,i$(o,t)}if(i.roll){let t=iW(i.roll,r,iq);o.roll=this._map.transform.roll+n.an(t.amount,-179,179),i$(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 i$(t,n){(!t.duration||t.duration<n.duration)&&(t.duration=n.duration,t.easing=n.easing)}function iW(t,i,r){let{maxSpeed:o,linearity:a,deceleration:s}=r,l=n.an(t*a/(i/1e3),-o,o),c=Math.abs(l)/(s*a);return{easing:r.easing,duration:1e3*c,amount:c/2*l}}class iX 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);const a=x.mousePos(i.getCanvas(),r),s=i.unproject(a);super(t,n.e({point:a,lngLat:s,originalEvent:r},o)),this._defaultPrevented=!1,this.target=i}}class iZ extends n.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,r){const 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 iK extends n.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,n,i){super(t,{originalEvent:i}),this._defaultPrevented=!1}}class iJ{constructor(t,n){this._map=t,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new iK(t.type,this._map,t))}mousedown(t,n){return this._mousedownPos=n,this._firePreventable(new iX(t.type,this._map,t))}mouseup(t){this._map.fire(new iX(t.type,this._map,t))}click(t,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new iX(t.type,this._map,t))}dblclick(t){return this._firePreventable(new iX(t.type,this._map,t))}mouseover(t){this._map.fire(new iX(t.type,this._map,t))}mouseout(t){this._map.fire(new iX(t.type,this._map,t))}touchstart(t){return this._firePreventable(new iZ(t.type,this._map,t))}touchmove(t){this._map.fire(new iZ(t.type,this._map,t))}touchend(t){this._map.fire(new iZ(t.type,this._map,t))}touchcancel(t){this._map.fire(new iZ(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class iQ{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new iX(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new iX("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new iX(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class i0{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 i1{constructor(t,n){this._map=t,this._tr=new i0(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 i2(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 i5{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=i2(r,i)))}touchmove(t,n,i){if(this.aborted||!this.centroid)return;let r=i2(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 i3{constructor(t){this.singleTap=new i5(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 i4{constructor(t){this._tr=new i0(t),this._zoomIn=new i3({numTouches:1,numTaps:2}),this._zoomOut=new i3({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,i,r){let o=this._zoomIn.touchend(t,i,r),a=this._zoomOut.touchend(t,i,r),s=this._tr;return o?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:i=>i.easeTo({duration:300,zoom:n.cx(s.zoom+1,i.getZoomSnap()),around:s.unproject(o)},{originalEvent:t})}):a?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:i=>i.easeTo({duration:300,zoom:n.cx(s.zoom-1,i.getZoomSnap()),around:s.unproject(a)},{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 i6{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 i8={0:1,2:2};class i7{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){let n;return n=i8[this._eventButton],void 0!==t.buttons&&(t.buttons&n)===n}isValidEndEvent(t){return x.mouseButton(t)===this._eventButton}}class i9{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 re{constructor(t=new i7({checkCorrectEvent:()=>!0}),n=new i9){this.mouseMoveStateManager=t,this.oneFingerTouchMoveStateManager=n}_executeRelevantHandler(t,n,i){return t instanceof MouseEvent?n(t):"u">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 rt=t=>{t.mousedown=t.dragStart,t.mousemoveWindow=t.dragMove,t.mouseup=t.dragEnd,t.contextmenu=t=>{t.preventDefault()}};class rn{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=i2(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 ri{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=rr(i,n,r),s=rr(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=rr(i,n,r),s=rr(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 rr(t,n,i){for(let r=0;r<t.length;r++)if(t[r].identifier===i)return n[r]}function ro(t,n){return Math.log(t/n)/Math.LN2}class ra extends ri{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(ro(this._distance,this._startDistance))))return this._active=!0,{zoomDelta:ro(this._distance,i),pinchAround:n}}}function rs(t,n){return 180*t.angleWith(n)/Math.PI}class rl extends ri{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:rs(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(rs(t,this._startVector))<n}}function rc(t){return Math.abs(t.y)>Math.abs(t.x)}class rd extends ri{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,rc(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 rc(t)&&rc(n)&&a}}let ru=100,rm=15,rh=10;class rp{constructor(t){this._tr=new i0(t),this._panStep=ru,this._bearingStep=rm,this._pitchStep=rh,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let i=0,r=0,o=0,a=0,s=0;switch(t.keyCode){case 61:case 107:case 171:case 187:i=1;break;case 189:case 109:case 173:i=-1;break;case 37:t.shiftKey?r=-1:(t.preventDefault(),a=-1);break;case 39:t.shiftKey?r=1:(t.preventDefault(),a=1);break;case 38:t.shiftKey?o=1:(t.preventDefault(),s=-1);break;case 40:t.shiftKey?o=-1:(t.preventDefault(),s=1);break;default:return}return this._rotationDisabled&&(r=0,o=0),{cameraAnimation:l=>{let c=this._tr;l.easeTo({duration:300,easeId:"keyboardHandler",easing:rf,zoom:i?n.cx(c.zoom+i*(t.shiftKey?2:1),l.getZoomSnap()):c.zoom,bearing:c.bearing+r*this._bearingStep,pitch:c.pitch+o*this._pitchStep,offset:[-a*this._panStep,-s*this._panStep],center:c.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 rf(t){return t*(2-t)}let rb=1/450;class rg{constructor(t,n){this._onTimeout=t=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},this._map=t,this._tr=new i0(t),this._triggerRenderFrame=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=rb}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.V.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.aq(this._targetZoom),a=t.applyConstrain(t.getCameraLngLat(),n.at(o*r)).zoom,s=this._map.getZoomSnap();if("wheel"===this._type&&s>0){let i=n.cx(t.zoom,s);this._targetZoom=n.cx(a,s,a-i)}else this._targetZoom=a;"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.G.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.cz;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.cw(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 r_{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 ry{constructor(t){this._tr=new i0(t),this.reset()}reset(){this._active=!1}dblclick(t,i){return t.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:n.cx(this._tr.zoom+(t.shiftKey?-1:1),r.getZoomSnap()),around:this._tr.unproject(i)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class rv{constructor(){this._tap=new i3({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 rx{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 rw{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 rF{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 rk{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 rE=t=>t.zoom||t.drag||t.roll||t.pitch||t.rotate;class rT extends n.l{}function rM(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta||t.rollDelta}class rA{get _ownerDocument(){var t;return(null==(t=this._el)?void 0:t.ownerDocument)||document}get _ownerWindow(){var t,n;return(null==(n=null==(t=this._el)?void 0:t.ownerDocument)?void 0:n.defaultView)||window}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.cA(t,i||t.type)){let n=x.mousePos(this._map.getCanvas(),t);u=c[i||t.type](t,n)}else if(n.cB(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.cC(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||rM(o))&&(this._changes.push([o,a,l]),this._triggerRenderFrame()),(Object.keys(s).length||rM(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 iG(t),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(i);const r=this._el;for(const[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],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"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],[this._ownerWindow,"blur",void 0]],this._listeners))x.addEventListener(t,n,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,i)}destroy(){for(let[t,n,i]of this._listeners)x.removeEventListener(t,n,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,i)}_addDefaultHandlers(t){let i=this._map,r=i.getCanvasContainer();this._add("mapEvent",new iJ(i,t));let o=i.boxZoom=new i1(i,t);this._add("boxZoom",o),t.interactive&&t.boxZoom&&o.enable();let a=i.cooperativeGestures=new rk(i,t.cooperativeGestures);this._add("cooperativeGestures",a),t.cooperativeGestures&&a.enable();let s=new i4(i),l=new ry(i);i.doubleClickZoom=new r_(l,s),this._add("tapZoom",s),this._add("clickZoom",l),t.interactive&&t.doubleClickZoom&&i.doubleClickZoom.enable();let c=new rv;this._add("tapDragZoom",c);let d=i.touchPitch=new rd(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 i6({clickTolerance:i,move:(t,i)=>{let l=s();if(r&&Math.abs(l.y-t.y)>o)return{bearingDelta:n.cy(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 i7({checkCorrectEvent:t=>0===x.mouseButton(t)&&t.ctrlKey||2===x.mouseButton(t)&&!t.ctrlKey}),enable:t,assignEvents:rt})}(t,u),h=function({enable:t,clickTolerance:n,pitchDegreesPerPixelMoved:i=-.5}){return new i6({clickTolerance:n,move:(t,n)=>({pitchDelta:(n.y-t.y)*i}),moveStateManager:new i7({checkCorrectEvent:t=>0===x.mouseButton(t)&&t.ctrlKey||2===x.mouseButton(t)}),enable:t,assignEvents:rt})}(t),p=function({enable:t,clickTolerance:n,rollDegreesPerPixelMoved:i=.3},r){return new i6({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 i7({checkCorrectEvent:t=>2===x.mouseButton(t)&&t.ctrlKey}),enable:t,assignEvents:rt})}(t,u);i.dragRotate=new rw(t,m,h,p),this._add("mouseRotate",m,["mousePitch"]),this._add("mousePitch",h,["mouseRotate","mouseRoll"]),this._add("mouseRoll",p,["mousePitch"]),t.interactive&&t.dragRotate&&i.dragRotate.enable();let f=function({enable:t,clickTolerance:n}){return new i6({clickTolerance:n,move:(t,n)=>({around:n,panDelta:n.sub(t)}),activateOnStart:!0,moveStateManager:new i7({checkCorrectEvent:t=>0===x.mouseButton(t)&&!t.ctrlKey}),enable:t,assignEvents:rt})}(t),b=new rn(t,i);i.dragPan=new rx(r,f,b),this._add("mousePan",f),this._add("touchPan",b,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&i.dragPan.enable(t.dragPan);let g=new rl,_=new ra;i.touchZoomRotate=new rF(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 iQ(i));let y=i.scrollZoom=new rg(i,()=>this._triggerRenderFrame());this._add("scrollZoom",y,["mousePan"]),t.interactive&&t.scrollZoom&&i.scrollZoom.enable(t.scrollZoom);let v=i.keyboard=new rp(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!!rE(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(!(rM(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 p={panDelta:s,zoomDelta:l,rollDelta:u,pitchDelta:d,bearingDelta:c,around:m};this._map.cameraHelper.useGlobeControls&&!o.isPointOnMapSurface(m)&&(m=o.centerPoint);let f=.01>m.distSqr(o.centerPoint)?o.center:o.screenPointToLocation(s?m.sub(s):m);this._handleMapControls({terrain:a,tr:o,deltasForHelper:p,preZoomAroundLoc:f,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;(s.handleMapControlsRollPitchBearingZoom(i,n),t)?s.useGlobeControls?(!this._terrainMovement&&(o.drag||o.zoom)&&(this._terrainMovement=!0,this._map._elevationFreeze=!0),s.handleMapControlsPan(i,n,r)):!this._terrainMovement&&(o.drag||o.zoom)?(this._terrainMovement=!0,this._map._elevationFreeze=!0,s.handleMapControlsPan(i,n,r)):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=rE(this._eventsInProgress),s=rE(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=rE(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 rT("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class rC 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._zoomSnap=i.zoomSnap,this.cameraHelper=n,this.on("moveend",()=>{delete this._requestedCameraState})}migrateProjection(t,n){t.apply(this.transform,!0),this.transform=t,this.cameraHelper=n}getCenter(){return new n.V(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,i){return this.zoomTo(n.cx(this.getZoom()+1,this._zoomSnap),t,i),this}zoomOut(t,i){return this.zoomTo(n.cx(this.getZoom()-1,this._zoomSnap),t,i),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}setZoomSnap(t){return this._zoomSnap=t,this}getZoomSnap(){return this._zoomSnap}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=Z.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 Z(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.a9.fromLngLat(t,i),s=n.a9.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.at(this.transform.cameraToCenterDistance/u/this.transform.tileSize),p=180*Math.atan2(l,-c)/Math.PI,f=180*Math.acos(m/u)/Math.PI;return f=d<0?90-f:90+f,{center:s.toLngLat(),elevation:o,zoom:h,pitch:f,bearing:p}}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.cz},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,p=n.P.convert(t.offset);t.around&&(r=n.V.convert(t.around),o=a.locationToScreenPoint(r));let f={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:p,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,f),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.G.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,!1)}this.transform.apply(i,!1)}_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.U(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.cz},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),p=r.centerPoint.add(h),f=r.screenPointToLocation(p),b=this.cameraHelper.handleFlyTo(r,{bearing:c,pitch:d,roll:u,padding:m,locationAtOffset:f,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),M=function(t){return E(T)/E(T+g*t)},A=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,A=()=>0,M=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(f=>{let g=f*C,_=1/M(g),y=A(g);this._rotating&&r.setBearing(n.G.number(o,c,f)),this._pitching&&r.setPitch(n.G.number(a,d,f)),this._rolling&&r.setRoll(n.G.number(s,u,f)),this._padding&&(r.interpolatePadding(l,m,f),p=r.centerPoint.add(h)),b.easeFunc(f,_,y,p),this.terrain&&!t.freezeElevation&&this._updateElevation(f),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.W(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.getElevationForLngLat(n.V.convert(t),this.transform):null}}let rS={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class rD{constructor(t=rS){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 rL{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 rI{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 rP=n.aU([{name:"a_pos3d",type:"Int16",components:3}]);class rO 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.c7(o.terrainRttPosMatrix32f,0,n.a5,n.a5,0,0,1),this._tiles[o.key]=new eh(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.bk();if(o.canonical.equals(t.canonical))n.c7(s,0,n.a5,n.a5,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.a5>>i;n.c7(s,0,l,l,0,0,1),n.O(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.a5>>i;n.c7(s,0,n.a5,n.a5,0,0,1),n.O(s,s,[r*l,a*l,0]),n.Q(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.bk();if(a.canonical.z===t.canonical.z){let i=t.canonical.x-a.canonical.x+t.wrap*(1<<t.canonical.z),r=t.canonical.y-a.canonical.y;n.c7(l,0,n.a5,n.a5,0,0,1),n.O(l,l,[i*n.a5,r*n.a5,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)+t.wrap*(1<<a.canonical.z),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.a5>>i;n.c7(l,0,d,d,0,0,1),n.O(l,l,[-r*d+s*n.a5,-o*d+c*n.a5,0])}else{let i=t.canonical.z-a.canonical.z,r=t.canonical.x-(t.canonical.x>>i<<i)+t.wrap*(1<<t.canonical.z),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.a5<<i;n.c7(l,0,d,d,0,0,1),n.O(l,l,[r*n.a5+s*d,o*n.a5+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;this._sourceTileCache[t.key]||(this._sourceTileCache[t.key]=t.scaledTo(r).key);let o=this.findTileInCaches(this._sourceTileCache[t.key]);if(!(null==o?void 0:o.dem)&&n)for(;r>=i.minzoom&&!(null==o?void 0:o.dem);)o=this.findTileInCaches(t.scaledTo(r--).key);return o}findTileInCaches(t){let n=this.tileManager.getTileByID(t);return n||(n=this.tileManager._outOfViewCache.getByKey(t))}anyTilesAfterTime(t=Date.now()){return this._lastTilesetChange>=t}_isWithinTileRanges(t,n){let i=n[t.canonical.z];return!!i&&(t.wrap>i.minWrap||t.wrap<i.maxWrap||t.canonical.x>=i.minTileXWrapped&&t.canonical.x<=i.maxTileXWrapped&&t.canonical.y>=i.minTileY&&t.canonical.y<=i.maxTileY)}}class rR{constructor(t,n,i){this._meshCache={},this.painter=t,this.tileManager=new rO(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.a5){var a;let s=t.normalizeCoordinates(i,r,o);if(!s)return 0;let l=this.getTerrainData(s.tileID),c=null==(a=l.tile)?void 0:a.dem;if(!c)return 0;let d=n.cD([],[s.x/o*n.a5,s.y/o*n.a5],l.u_terrain_matrix),u=[d[0]*c.dim,d[1]*c.dim],m=Math.floor(u[0]),h=Math.floor(u[1]),p=u[0]-m,f=u[1]-h;return c.get(m,h)*(1-p)*(1-f)+c.get(m+1,h)*p*(1-f)+c.get(m,h+1)*(1-p)*f+c.get(m+1,h+1)*p*f}getElevationForLngLatZoom(t,i){if(!n.cE(i,t.wrap()))return 0;let{tileID:r,mercatorX:o,mercatorY:a}=this._getOverscaledTileIDFromLngLatZoom(t,i);return this.getElevation(r,o%n.a5,a%n.a5,n.a5)}getElevationForLngLat(t,n){let i=eE(n,{maxzoom:this.tileManager.maxzoom,minzoom:this.tileManager.minzoom,tileSize:512,terrain:this}),r=0;for(let t of i)t.canonical.z>r&&(r=Math.min(t.canonical.z,this.tileManager.maxzoom));return this.getElevationForLngLatZoom(t,r)}getElevation(t,i,r,o=n.a5){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.ar([])}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.toString()+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.cF(new Float64Array(16),[1/(n.a5<<o),1/(n.a5<<o),0]);n.O(l,l,[a*n.a5,s*n.a5,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,p=(1<<m.tileID.canonical.z)*h;return new n.a9((m.tileID.canonical.x*h+c)/p+m.tileID.wrap,(m.tileID.canonical.y*h+d)/p,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.cG,d=new n.aY,u=this.meshSize,m=n.a5/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 p=c.length,f=p+(u+1),b=(u+1)*u,g=o?n.br:0,_=+!o,y=a?n.bs:n.a5,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,f+t,f+t+1),d.emplaceBack(b+t,f+t+1,b+t+1),d.emplaceBack(0+t,p+t+1,p+t),d.emplaceBack(0+t,0+t+1,p+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.a5,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 tl(l.createVertexBuffer(c,rP.members),l.createIndexBuffer(d),n.aX.simpleSegment(0,0,c.length,d.length));return this._meshCache[s]=F,F}getMeshFrameDelta(t){return 2*Math.PI*n.bE/Math.pow(2,Math.max(t,0))/5}getMinTileElevationForLngLatZoom(t,i){var r;if(!n.cE(i,t.wrap()))return 0;let{tileID:o}=this._getOverscaledTileIDFromLngLatZoom(t,i);return null!=(r=this.getMinMaxElevation(o).minElevation)?r: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.a9.fromLngLat(t.wrap()),o=(1<<i)*n.a5,a=r.x*o,s=r.y*o,l=Math.floor(a/n.a5),c=Math.floor(s/n.a5);return{tileID:new n.a2(i,0,i,l,c),mercatorX:a,mercatorY:s}}}class rB{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 rz={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};class rY{constructor(t,n){this.painter=t,this.terrain=n,this.pool=new rB(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){var i,r;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 er?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._rttFingerprints={},t._order)){let o=t._layers[n],a=o.source;if(rz[o.type]&&!this._rttFingerprints[a]){this._rttFingerprints[a]={};let n=null!=(r=null==(i=t.tileManagers[a])?void 0:i.getState().revision)?r:0;for(let t in this._coordsAscending[a])this._rttFingerprints[a][t]=`${this._coordsAscending[a][t].map(t=>t.key).sort().join()}#${n}`}}for(let t of this._renderableTiles)for(let n in this._rttFingerprints){let i=this._rttFingerprints[n][t.tileID.key];i&&i!==t.rttFingerprint[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(rz[o]&&(this._prevType&&rz[this._prevType]||this._stacks.push([]),this._prevType=o,this._stacks[this._stacks.length-1].push(t.id),!s))return!0;if(rz[this._prevType]||rz[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()&&(iO(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.bp.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.rttFingerprint[n.source]=this._rttFingerprints[n.source][o.tileID.key])}}return iO(this.painter,this.terrain,this._rttTiles,r),this._rttTiles=[],this.pool.freeAllObjects(),rz[o]}return!1}}let rN={"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":"Drag to rotate map, click to reset 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"},rj={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:rS,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.c.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,anisotropicFilterPitch:20},rH={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class rU{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;const o=new re;this._rotatePitchHandler=new i6({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.cy(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 rV(t,i,r,o=!1){if(o||!r.getCoveringTilesDetailsProvider().allowWorldCopies())return null==t?void 0:t.wrap();let a=new n.V(t.lng,t.lat);if(t=new n.V(t.lng,t.lat),i){let o=new n.V(t.lng-360,t.lat),a=new n.V(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 rq={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 rG(t,n,i){let r=t.classList;for(let t in rq)r.remove(`maplibregl-${i}-anchor-${t}`);r.add(`maplibregl-${i}-anchor-${n}`)}class r$ extends n.E{constructor(t){if(super(),this._onClick=t=>{this.fire(new n.l("click",{originalEvent:t}))},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=rV(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,`${rq[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${r} ${i}`),_.frameAsync(new AbortController,this._map._ownerWindow).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");const 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");const 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");const o=x.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"fill-rule","nonzero");const a=x.createNS("http://www.w3.org/2000/svg","g");for(const 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"}])){const 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)}const s=x.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill",this._color);const 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);const c=x.createNS("http://www.w3.org/2000/svg","g");c.setAttributeNS(null,"opacity","0.25"),c.setAttributeNS(null,"fill","#000000");const 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);const u=x.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"transform","translate(6.0, 7.0)"),u.setAttributeNS(null,"fill","#FFFFFF");const m=x.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(8.0, 8.0)");const 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");const p=x.createNS("http://www.w3.org/2000/svg","circle");p.setAttributeNS(null,"fill","#FFFFFF"),p.setAttributeNS(null,"cx","5.5"),p.setAttributeNS(null,"cy","5.5"),p.setAttributeNS(null,"r","5.4999962"),m.appendChild(h),m.appendChild(p),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()}),rG(this._element,this._anchor,"marker"),this._element.addEventListener("click",this._onClick),t&&t.className)for(const 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.V.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.getElevationForLngLat(this._lngLat,s.transform);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 rW={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},rX=0,rZ=!1,rK={maxWidth:100,unit:"metric"};function rJ(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?rQ(n,c,i/5280,t._getUIString("ScaleControl.Miles")):rQ(n,c,i,t._getUIString("ScaleControl.Feet"))}else i&&"nautical"===i.unit?rQ(n,c,d/1852,t._getUIString("ScaleControl.NauticalMiles")):d>=1e3?rQ(n,c,d/1e3,t._getUIString("ScaleControl.Kilometers")):rQ(n,c,d,t._getUIString("ScaleControl.Meters"))}function rQ(t,n,i,r){var o;let a,s,l,c=(a=Math.pow(10,`${Math.floor(i)}`.length-1),s=i/a,a*(s=s>=10?10:s>=5?5:s>=3?3:s>=2?2:s>=1?1:(l=Math.pow(10,Math.ceil(-Math.log(o=s)/Math.LN10)),Math.round(o*l)/l)));t.style.width=c/i*n+"px",t.innerHTML=`${c} ${r}`}let r0={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0};t.AJAXError=n.cJ,t.EXTENT=n.a5,t.Event=n.l,t.Evented=n.E,t.LngLat=n.V,t.MercatorCoordinate=n.a9,t.Point=n.P,t.addProtocol=n.cK,t.config=n.c,t.removeProtocol=n.cL,t.AttributionControl=rD,t.BoxZoomHandler=i1,t.CanvasSource=ea,t.CooperativeGesturesHandler=rk,t.DoubleClickZoomHandler=r_,t.DragPanHandler=rx,t.DragRotateHandler=rw,t.EdgeInsets=th,t.FullscreenControl=class extends n.E{constructor(t={}){var i;super(),this._onFullscreenChange=()=>{var t;let n=window.document.fullscreenElement||window.document.webkitFullscreenElement;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,this._pseudo=null!=(i=t.pseudo)&&i,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(){this._pseudo?this._togglePseudoFullScreen():window.document.exitFullscreen?window.document.exitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._pseudo?this._togglePseudoFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},t.GeoJSONSource=ei,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.V(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy,o=this._map.getBearing(),a=n.e({bearing:o},this.options.fitBoundsOptions),s=Z.fromLngLat(i,r);this._map.fitBounds(s,a,{geolocateSource:!0})},this._updateMarker=t=>{if(t){let i=new n.V(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&&rZ)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 r$({element:this._dotElement}),this._circleElement=x.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new r$({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({},rW,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,rX=0,rZ=!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":rX--,rZ=!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"),++rX>1?(t={maximumAge:6e5,timeout:0},rZ=!0):(t=this.options.positionOptions,rZ=!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._map.on("projectiontransition",this._updateGlobeIcon),this._container}onRemove(){x.remove(this._container),this._map.off("styledata",this._updateGlobeIcon),this._map.off("projectiontransition",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},t.Hash=iY,t.ImageSource=er,t.KeyboardHandler=rp,t.LngLatBounds=Z,t.LogoControl=rL,t.Map=class extends rC{get _ownerWindow(){var t,n;return(null==(n=null==(t=this._container)?void 0:t.ownerDocument)?void 0:n.defaultView)||window}constructor(t){var i,r;n.cH.mark(n.cI.create);const o=Object.assign(Object.assign(Object.assign({},rj),t),{canvasContextAttributes:Object.assign(Object.assign({},rj.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");const a=new tv,s=new tk;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,zoomSnap:o.zoomSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new rI,this._controls=[],this._mapId=n.af(),this._lostContextStyle={style:null,images:null},this._contextLost=t=>{if(t.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),this.style){for(let t of Object.values(this.style._layers))if("custom"===t.type&&console.warn(`Custom layer with id '${t.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),t._listeners)for(let[n]of Object.entries(t._listeners))console.warn(`Custom layer with id '${t.id}' had event listeners for event '${n}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this.style.destroy(),this.style=null,this.fire(new n.l("webglcontextlost",{originalEvent:t}))}else 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._lostContextStyle={style:null,images:null},this._setupPainter(),this.resize(),this._update(),this._resizeInternal(),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._zoomSnap=o.zoomSnap,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({},rN),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,this.setAnisotropicFilterPitch(o.anisotropicFilterPitch),void 0!==o.reduceMotion&&(_.prefersReducedMotion=o.reduceMotion),this._imageQueueHandle=h.addThrottleControl(()=>this.isMoving()),this._requestManager=new A(o.transformRequest),this._container=this._resolveContainer(o.container),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}),"u">typeof window&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver()),this.handlers=new rA(this,o),this._hash=o.hash&&new iY("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}))));const 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 rD("boolean"==typeof o.attributionControl?void 0:o.attributionControl)),o.maplibreLogo&&this.addControl(new rL,o.logoPosition),this.on("style.load",()=>{if(l||this._resizeTransform(),this.transform.unmodified){let t=n.U(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.getElevationForLngLat(i,this.transform)),super.calculateCameraOptionsFromTo(t,n,i,r)}resize(t,i=!0){if(null!==this._lostContextStyle.style)return this;this._resizeInternal(i);let r=!this._moving;return r&&(this.stop(),this.fire(new n.l("movestart",t)).fire(new n.l("move",t))),this.fire(new n.l("resize",t)),r&&this.fire(new n.l("moveend",t)),this}_resizeInternal(t=!0){let[n,i]=this._containerDimensions(),r=this._getClampedPixelRatio(n,i);if(this._resizeCanvas(n,i,r),this.painter.resize(n,i,r),this.painter.overLimit()){let t=this.painter.context.gl;this._maxCanvasSize=[t.drawingBufferWidth,t.drawingBufferHeight];let r=this._getClampedPixelRatio(n,i);this._resizeCanvas(n,i,r),this.painter.resize(n,i,r)}this._resizeTransform(t)}_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(Z.convert(t)),this._update()}setMinZoom(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom){let i=this.transform.zoom,r=this._getTransformForUpdate();return r.setMinZoom(t),this._applyUpdatedTransform(r),this._update(),i!==this.transform.zoom&&this.fire(new n.l("zoomstart")).fire(new n.l("zoom")).fire(new n.l("zoomend")).fire(new n.l("movestart")).fire(new n.l("move")).fire(new n.l("moveend")),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){let i=this.transform.zoom,r=this._getTransformForUpdate();return r.setMaxZoom(t),this._applyUpdatedTransform(r),this._update(),i!==this.transform.zoom&&this.fire(new n.l("zoomstart")).fire(new n.l("zoom")).fire(new n.l("zoomend")).fire(new n.l("movestart")).fire(new n.l("move")).fire(new n.l("moveend")),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){let i=this.transform.pitch,r=this._getTransformForUpdate();return r.setMinPitch(t),this._applyUpdatedTransform(r),this._update(),i!==this.transform.pitch&&this.fire(new n.l("pitchstart")).fire(new n.l("pitch")).fire(new n.l("pitchend")).fire(new n.l("movestart")).fire(new n.l("move")).fire(new n.l("moveend")),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){let i=this.transform.pitch,r=this._getTransformForUpdate();return r.setMaxPitch(t),this._applyUpdatedTransform(r),this._update(),i!==this.transform.pitch&&this.fire(new n.l("pitchstart")).fire(new n.l("pitch")).fire(new n.l("pitchend")).fire(new n.l("movestart")).fire(new n.l("move")).fire(new n.l("moveend")),this}throw Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(t){if((t=null==t?20:t)>180)throw Error("anisotropicFilterPitch must be less than or equal to 180");if(t<0)throw Error("anisotropicFilterPitch must be greater than or equal to 0");return this._anisotropicFilterPitch=t,this._update()}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.V.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 iX(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 iX(t,this,o.originalEvent)))},a=n=>{r&&(r=!1,i.call(this,new iX(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 t6(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 t6(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 rR(this.painter,i,t),this.painter.renderToTexture=new rY(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(){for(let t of Object.values(this.style&&this.style.tileManagers))if(!t.areTilesLoaded())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.ac(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]}_setupResizeObserver(){var t;let n=!1,i=iz(t=>{this._trackResize&&!this._removed&&(this.resize(t),this.redraw())},50),r=null!=(t=this._ownerWindow.ResizeObserver)?t:ResizeObserver;this._resizeObserver=new r(t=>{n?i(t):n=!0}),this._resizeObserver.observe(this._container)}_resolveContainer(t){if("string"==typeof t){let n=document.getElementById(t);if(!n)throw Error(`Container '${t}' not found.`);return n}if(t instanceof HTMLElement||t&&"object"==typeof t&&1===t.nodeType)return t;throw Error("Invalid type: 'container' must be a String or HTMLElement.")}_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 iB(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.H(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,anisotropicFilterPitch:this.getAnisotropicFilterPitch()}),this.fire(new n.l("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,n.cH.mark(n.cI.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.cH.mark(n.cI.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),"u">typeof window&&this._ownerWindow.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.cH.remove(),this._removed=!0,this.fire(new n.l("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,_.frame(this._frameRequest,t=>{n.cH.recordStartOfFrameAt(t),this._frameRequest=null;try{this._render(t)}catch(t){if(!n.Z(t)&&t.message!==ic)throw t}},()=>{},this._ownerWindow))}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=iX,t.MapTouchEvent=iZ,t.MapWheelEvent=iK,t.Marker=r$,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({},rH,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 rU(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=rV(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){var a,s,l,c,d;let t,n=this._container.offsetWidth,u=this._container.offsetHeight,m=(a=this.options.padding)?{top:null!=(s=a.top)?s:0,right:null!=(l=a.right)?l:0,bottom:null!=(c=a.bottom)?c:0,left:null!=(d=a.left)?d:0}:{top:0,right:0,bottom:0,left:0};t=i.y+o.bottom.y<u+m.top?["top"]:i.y>this._map.transform.height-u-m.bottom?["bottom"]:[],i.x<n/2+m.left?t.push("left"):i.x>this._map.transform.width-n/2-m.right&&t.push("right"),r=0===t.length?"bottom":t.join("-")}let u=i.add(o[r]);this.options.subpixelPositioning||(u=u.round()),x.setTransform(this._container,`${rq[r]} translate(${u.x}px,${u.y}px)`),rG(this._container,r,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=n.e(Object.create(r0),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.V.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}setPadding(t){this.options.padding=t,this._update()}_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=ee,t.RasterTileSource=Q,t.ScaleControl=class{constructor(t){this._onMove=()=>{rJ(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,rJ(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},rK),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=rg,t.Style=t6,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=rd,t.TwoFingersTouchRotateHandler=rl,t.TwoFingersTouchZoomHandler=ra,t.TwoFingersTouchZoomRotateHandler=rF,t.VectorTileSource=J,t.VideoSource=eo,t.addSourceType=(t,i)=>n._(void 0,void 0,void 0,function*(){if(el(t))throw Error(`A source type called "${t}" already exists.`);es[t]=i}),t.clearPrewarmedResources=function(){let t=s;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(j),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=tI,t.getMaxParallelImageRequests=function(){return n.c.MAX_PARALLEL_IMAGE_REQUESTS},t.getRTLTextPluginStatus=function(){return em().getRTLTextPluginStatus()},t.getVersion=function(){return b},t.getWorkerCount=function(){return H.workerCount},t.getWorkerUrl=function(){return n.c.WORKER_URL},t.importScriptInWorkers=function(t){return G().broadcast("IS",t)},t.isTimeFrozen=function(){return y.isFrozen()},t.now=v,t.prewarm=function(){V().acquire(j)},t.restoreNow=function(){y.restoreNow()},t.setMaxParallelImageRequests=function(t){n.c.MAX_PARALLEL_IMAGE_REQUESTS=t},t.setNow=function(t){y.setNow(t)},t.setRTLTextPlugin=function(t,n){return em().setRTLTextPlugin(t,n)},t.setWorkerCount=function(t){H.workerCount=t},t.setWorkerUrl=function(t){n.c.WORKER_URL=t}}),t}()}},r={};function o(t){var n=r[t];if(void 0!==n)return n.exports;var a=r[t]={id:t,loaded:!1,exports:{}};return i[t].call(a.exports,a,a.exports,o),a.loaded=!0,a.exports}o.n=t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return o.d(n,{a:n}),n},n=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,o.t=function(i,r){if(1&r&&(i=this(i)),8&r||"object"==typeof i&&i&&(4&r&&i.__esModule||16&r&&"function"==typeof i.then))return i;var a=Object.create(null);o.r(a);var s={};t=t||[null,n({}),n([]),n(n)];for(var l=2&r&&i;("object"==typeof l||"function"==typeof l)&&!~t.indexOf(l);l=n(l))Object.getOwnPropertyNames(l).forEach(t=>{s[t]=()=>i[t]});return s.default=()=>i,o.d(a,s),a},o.d=(t,n)=>{for(var i in n)o.o(n,i)&&!o.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}})(),o.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),o.r=t=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var a={};return(()=>{"use strict";let t,n,i,r,s;o.r(a),o.d(a,{OrMapMarkerAsset:()=>sQ,getMarkerConfigAttributeName:()=>sJ,OrMapGeocoderChangeEvent:()=>ug,OrMap:()=>uv,OrMapLongPressEvent:()=>ub,OrMapLegendEvent:()=>uu,OrMapMarker:()=>sX,OrMapMarkersChangedEvent:()=>u_,Util:()=>tV,OrMapAssetCard:()=>uc,DefaultConfig:()=>ul,OrMapMarkerClickedEvent:()=>sW,geoJsonPointInputTemplateProvider:()=>uy,getMarkerConfigForAssetType:()=>sK,LngLat:()=>sw.LngLat,OrMapMarkerChangedEvent:()=>s$,OrMapLoadedEvent:()=>up,OrClusterMarker:()=>sR,OrMapLegend:()=>um,OrMapAssetCardLoadAssetEvent:()=>us,OrMapClickedEvent:()=>uf});var l,c,d,u,m,h,p,f,b,g,_,y,v,x,w,F,k,E,T,M,A,C,S,D,L,I,P,O,R,B,z,Y,N,j,H,U,V,q,G,$,W,X,Z,K,J,Q,ee,et,en,ei,er,eo,ea,es,el,ec,ed,eu,em,eh,ep,ef,eb,eg,e_,ey,ev,ex,ew,eF,ek,eE,eT,eM,eA,eC,eS,eD,eL,eI,eP,eO,eR,eB,ez,eY,eN,ej,eH,eU,eV,eq,eG,e$,eW,eX,eZ,eK,eJ,eQ,e0,e1,e2,e5,e3,e4,e6,e8,e7,e9,te,tt,tn,ti,tr,to,ta,ts,tl,tc,td,tu,tm,th,tp,tf,tb,tg,t_,ty,tv,tx,tw,tF,tk,tE,tT,tM,tA,tC,tS,tD,tL,tI,tP,tO,tR,tB,tz,tY,tN,tj,tH,tU={};o.r(tU),o.d(tU,{hasBrowserEnv:()=>i1,hasStandardBrowserEnv:()=>i5,hasStandardBrowserWebWorkerEnv:()=>i3,navigator:()=>i2,origin:()=>i4});var tV={};o.r(tV),o.d(tV,{getGeoJSONPoint:()=>sC,getLngLat:()=>sA,getLngLatBounds:()=>sS,getMarkerIconAndColorFromAssetType:()=>sD,isAssetWithLocation:()=>sI,isWebglSupported:()=>sL}),o(4532),(m=eC||(eC={})).CREATE="CREATE",m.UPDATE="UPDATE",m.DELETE="DELETE",(h=eS||(eS={})).LOW="LOW",h.MEDIUM="MEDIUM",h.HIGH="HIGH",(p=eD||(eD={})).MANUAL="MANUAL",p.CLIENT="CLIENT",p.GLOBAL_RULESET="GLOBAL_RULESET",p.REALM_RULESET="REALM_RULESET",p.ASSET_RULESET="ASSET_RULESET",p.AGENT="AGENT",(f=eL||(eL={})).OPEN="OPEN",f.ACKNOWLEDGED="ACKNOWLEDGED",f.IN_PROGRESS="IN_PROGRESS",f.RESOLVED="RESOLVED",f.CLOSED="CLOSED",(b=eI||(eI={})).BOTTOM_LEFT="BOTTOM_LEFT",b.BOTTOM_RIGHT="BOTTOM_RIGHT",b.TOP_LEFT="TOP_LEFT",b.TOP_RIGHT="TOP_RIGHT",(g=eP||(eP={})).CREATE="CREATE",g.READ="READ",g.UPDATE="UPDATE",g.DELETE="DELETE",(_=eO||(eO={})).NONE="NONE",_.FORECAST="FORECAST",_.SETPOINT="SETPOINT",(y=eR||(eR={})).DISCONNECTED="DISCONNECTED",y.CONNECTING="CONNECTING",y.DISCONNECTING="DISCONNECTING",y.CONNECTED="CONNECTED",y.DISABLED="DISABLED",y.WAITING="WAITING",y.ERROR="ERROR",y.STOPPED="STOPPED",(v=eB||(eB={})).REQUEST_START="REQUEST_START",v.REQUEST_REPEATING="REQUEST_REPEATING",v.REQUEST_CANCEL="REQUEST_CANCEL",v.READY="READY",v.COMPLETED="COMPLETED",v.RUNNING="RUNNING",v.CANCELLED="CANCELLED",(x=ez||(ez={})).TOGGLE="TOGGLE",x.INCREMENT="INCREMENT",x.DECREMENT="DECREMENT",x.NEGATE="NEGATE",(w=eY||(eY={})).ASSET_NOT_FOUND="ASSET_NOT_FOUND",w.ATTRIBUTE_NOT_FOUND="ATTRIBUTE_NOT_FOUND",w.INSUFFICIENT_ACCESS="INSUFFICIENT_ACCESS",w.INVALID_VALUE="INVALID_VALUE",w.INTERCEPTOR_FAILURE="INTERCEPTOR_FAILURE",w.STATE_STORAGE_FAILED="STATE_STORAGE_FAILED",w.CANNOT_PROCESS="CANNOT_PROCESS",w.QUEUE_FULL="QUEUE_FULL",w.UNKNOWN="UNKNOWN",w.ASSET_ID_MISSING="ASSET_ID_MISSING",w.ATTRIBUTE_NAME_MISSING="ATTRIBUTE_NAME_MISSING",(F=eN||(eN={})).PUBLIC="PUBLIC",F.SHARED="SHARED",F.PRIVATE="PRIVATE",(k=ej||(ej={})).OFF="OFF",k.ONE_MIN="ONE_MIN",k.FIVE_MIN="FIVE_MIN",k.QUARTER="QUARTER",k.ONE_HOUR="ONE_HOUR",(E=eH||(eH={})).WRAP_TO_SINGLE_COLUMN="WRAP_TO_SINGLE_COLUMN",E.KEEP_LAYOUT="KEEP_LAYOUT",E.REDIRECT="REDIRECT",E.BLOCK_DEVICE="BLOCK_DEVICE",(T=eU||(eU={})).CSV="CSV",T.CSV_CROSSTAB="CSV_CROSSTAB",T.CSV_CROSSTAB_MINUTE="CSV_CROSSTAB_MINUTE",(M=eV||(eV={})).MINUTE="MINUTE",M.HOUR="HOUR",M.DAY="DAY",M.WEEK="WEEK",M.MONTH="MONTH",M.YEAR="YEAR",(A=eq||(eq={})).MIN="MIN",A.AVG="AVG",A.MAX="MAX",A.DIFFERENCE="DIFFERENCE",A.COUNT="COUNT",A.SUM="SUM",A.MODE="MODE",A.MEDIAN="MEDIAN",(C=eG||(eG={})).TERMINATING="TERMINATING",C.DISABLED="DISABLED",C.ALREADY_CONNECTED="ALREADY_CONNECTED",C.UNRECOGNISED="UNRECOGNISED",C.PERMANENT_ERROR="PERMANENT_ERROR",C.SYNC_ERROR="SYNC_ERROR",(S=e$||(e$={})).HTTPS="HTTPS",S.HTTP="HTTP",S.TCP="TCP",(D=eW||(eW={})).GET="GET",D.POST="POST",D.PUT="PUT",D.DELETE="DELETE",D.OPTIONS="OPTIONS",D.PATCH="PATCH",(L=eX||(eX={})).KEYCLOAK="KEYCLOAK",L.BASIC="BASIC",L.NONE="NONE",(I=eZ||(eZ={})).WEBSOCKET="WEBSOCKET",I.POLLING="POLLING",(P=eK||(eK={})).INTERNAL="INTERNAL",P.CLIENT="CLIENT",P.GLOBAL_RULESET="GLOBAL_RULESET",P.REALM_RULESET="REALM_RULESET",P.ASSET_RULESET="ASSET_RULESET",(O=eJ||(eJ={})).REALM="REALM",O.USER="USER",O.ASSET="ASSET",O.CUSTOM="CUSTOM",(R=eQ||(eQ={})).NORMAL="NORMAL",R.HIGH="HIGH",(B=e0||(e0={})).DEVICE="DEVICE",B.TOPIC="TOPIC",B.CONDITION="CONDITION",(z=e1||(e1={})).ALWAYS="ALWAYS",z.ONCE="ONCE",z.HOURLY="HOURLY",z.DAILY="DAILY",z.WEEKLY="WEEKLY",z.MONTHLY="MONTHLY",z.ANNUALLY="ANNUALLY",(Y=e2||(e2={})).MESSAGE_INVALID="MESSAGE_INVALID",Y.CERTIFICATE_INVALID="CERTIFICATE_INVALID",Y.UNAUTHORIZED="UNAUTHORIZED",Y.FORBIDDEN="FORBIDDEN",Y.UNIQUE_ID_MISMATCH="UNIQUE_ID_MISMATCH",Y.CONFIG_DISABLED="CONFIG_DISABLED",Y.USER_DISABLED="USER_DISABLED",Y.SERVER_ERROR="SERVER_ERROR",Y.ASSET_ERROR="ASSET_ERROR",Y.SERVER_BUSY="SERVER_BUSY",(N=e5||(e5={})).PRIVATE="PRIVATE",N.PROTECTED="PROTECTED",N.PUBLIC="PUBLIC",(j=e3||(e3={})).EXACT="EXACT",j.BEGIN="BEGIN",j.END="END",j.CONTAINS="CONTAINS",(H=e4||(e4={})).EQUALS="EQUALS",H.GREATER_THAN="GREATER_THAN",H.GREATER_EQUALS="GREATER_EQUALS",H.LESS_THAN="LESS_THAN",H.LESS_EQUALS="LESS_EQUALS",H.BETWEEN="BETWEEN",(U=e6||(e6={})).CREATED_ON="CREATED_ON",U.NAME="NAME",U.ASSET_TYPE="ASSET_TYPE",U.PARENT_ID="PARENT_ID",U.REALM="REALM",(V=e8||(e8={})).RESTRICTED="RESTRICTED",V.LINKED="LINKED",V.REALM="REALM",(q=e7||(e7={})).AT_LEAST_ONE="AT_LEAST_ONE",q.ALL="ALL",q.NONE="NONE",(G=e9||(e9={})).AND="AND",G.OR="OR",($=te||(te={})).CREATED_ON="CREATED_ON",$.FIRST_NAME="FIRST_NAME",$.LAST_NAME="LAST_NAME",$.USERNAME="USERNAME",$.EMAIL="EMAIL",(W=tt||(tt={})).STOPPED="STOPPED",W.RUNNING="RUNNING",W.ERROR="ERROR",(X=tn||(tn={})).JAVASCRIPT="JAVASCRIPT",X.GROOVY="GROOVY",X.JSON="JSON",X.FLOW="FLOW",(Z=ti||(ti={})).READY="READY",Z.DEPLOYED="DEPLOYED",Z.COMPILATION_ERROR="COMPILATION_ERROR",Z.VALIDITY_PERIOD_ERROR="VALIDITY_PERIOD_ERROR",Z.EXECUTION_ERROR="EXECUTION_ERROR",Z.LOOP_ERROR="LOOP_ERROR",Z.DISABLED="DISABLED",Z.PAUSED="PAUSED",Z.EXPIRED="EXPIRED",Z.REMOVED="REMOVED",Z.EMPTY="EMPTY",(K=tr||(tr={})).SUNRISE="SUNRISE",K.SUNSET="SUNSET",K.TWILIGHT_MORNING_VISUAL="TWILIGHT_MORNING_VISUAL",K.TWILIGHT_MORNING_VISUAL_LOWER="TWILIGHT_MORNING_VISUAL_LOWER",K.TWILIGHT_MORNING_HORIZON="TWILIGHT_MORNING_HORIZON",K.TWILIGHT_MORNING_CIVIL="TWILIGHT_MORNING_CIVIL",K.TWILIGHT_MORNING_NAUTICAL="TWILIGHT_MORNING_NAUTICAL",K.TWILIGHT_MORNING_ASTRONOMICAL="TWILIGHT_MORNING_ASTRONOMICAL",K.TWILIGHT_MORNING_GOLDEN_HOUR="TWILIGHT_MORNING_GOLDEN_HOUR",K.TWILIGHT_MORNING_BLUE_HOUR="TWILIGHT_MORNING_BLUE_HOUR",K.TWILIGHT_MORNING_NIGHT_HOUR="TWILIGHT_MORNING_NIGHT_HOUR",K.TWILIGHT_EVENING_VISUAL="TWILIGHT_EVENING_VISUAL",K.TWILIGHT_EVENING_VISUAL_LOWER="TWILIGHT_EVENING_VISUAL_LOWER",K.TWILIGHT_EVENING_HORIZON="TWILIGHT_EVENING_HORIZON",K.TWILIGHT_EVENING_CIVIL="TWILIGHT_EVENING_CIVIL",K.TWILIGHT_EVENING_NAUTICAL="TWILIGHT_EVENING_NAUTICAL",K.TWILIGHT_EVENING_ASTRONOMICAL="TWILIGHT_EVENING_ASTRONOMICAL",K.TWILIGHT_EVENING_GOLDEN_HOUR="TWILIGHT_EVENING_GOLDEN_HOUR",K.TWILIGHT_EVENING_BLUE_HOUR="TWILIGHT_EVENING_BLUE_HOUR",K.TWILIGHT_EVENING_NIGHT_HOUR="TWILIGHT_EVENING_NIGHT_HOUR",(J=to||(to={})).NUMBER="NUMBER",J.NUMBER_ARRAY="NUMBER_ARRAY",J.STRING="STRING",J.BOOLEAN="BOOLEAN",J.TRIGGER="TRIGGER",J.COLOR="COLOR",J.ANY="ANY",(Q=ta||(ta={})).NEW_LINE="NEW_LINE",Q.SPACER="SPACER",(ee=ts||(ts={})).INPUT="INPUT",ee.PROCESSOR="PROCESSOR",ee.OUTPUT="OUTPUT",ee.THEN="THEN",(et=tl||(tl={})).TEXT="TEXT",et.MULTILINE="MULTILINE",et.NUMBER="NUMBER",et.DROPDOWN="DROPDOWN",et.DOUBLE_DROPDOWN="DOUBLE_DROPDOWN",et.CHECKBOX="CHECKBOX",et.ASSET_ATTRIBUTE="ASSET_ATTRIBUTE",et.COLOR="COLOR",et.DATE="DATE",(en=tc||(tc={})).ADD="ADD",en.ADD_OR_REPLACE="ADD_OR_REPLACE",en.REPLACE="REPLACE",en.DELETE="DELETE",en.CLEAR="CLEAR",(ei=td||(td={})).PER_ASSET="PER_ASSET",ei.GLOBAL="GLOBAL",(er=tu||(tu={})).READ_ADMIN="read:admin",er.READ_LOGS="read:logs",er.READ_USERS="read:users",er.READ_MAP="read:map",er.READ_ASSETS="read:assets",er.READ_RULES="read:rules",er.READ_INSIGHTS="read:insights",er.READ_ALARMS="read:alarms",er.READ_SERVICES="read:services",er.WRITE_SERVICES="write:services",er.WRITE_USER="write:user",er.WRITE_ADMIN="write:admin",er.WRITE_LOGS="write:logs",er.WRITE_ASSETS="write:assets",er.WRITE_ATTRIBUTES="write:attributes",er.WRITE_RULES="write:rules",er.WRITE_INSIGHTS="write:insights",er.WRITE_ALARMS="write:alarms",er.READ="read",er.WRITE="write",(eo=tm||(tm={})).REGISTER="REGISTER",eo.UPDATE="UPDATE",eo.DEREGISTER="DEREGISTER",(ea=th||(th={})).AVAILABLE="AVAILABLE",ea.UNAVAILABLE="UNAVAILABLE",(es=tp||(tp={})).ASSET="ASSET",es.AGENT="AGENT",es.NOTIFICATION="NOTIFICATION",es.ALARM="ALARM",es.RULES="RULES",es.PROTOCOL="PROTOCOL",es.GATEWAY="GATEWAY",es.MODEL_AND_VALUES="MODEL_AND_VALUES",es.API="API",es.DATA="DATA",(el=tf||(tf={})).INFO="INFO",el.WARN="WARN",el.ERROR="ERROR",(ec=tb||(tb={})).NUMERIC="numeric",ec.DIGIT_2="2-digit",ec.FULL="full",ec.LONG="long",ec.MEDIUM="medium",ec.SHORT="short",ec.NARROW="narrow",(ed=tg||(tg={})).SECONDLY="SECONDLY",ed.MINUTELY="MINUTELY",ed.HOURLY="HOURLY",ed.DAILY="DAILY",ed.WEEKLY="WEEKLY",ed.MONTHLY="MONTHLY",ed.YEARLY="YEARLY",(eu=t_||(t_={})).OMIT="OMIT",eu.BACKWARD="BACKWARD",eu.FORWARD="FORWARD",(em=ty||(ty={})).JAPANESE="JAPANESE",em.BUDDHIST="BUDDHIST",em.ROC="ROC",em.ISLAMIC="ISLAMIC",em.ISO8601="ISO8601",em.CHINESE="CHINESE",em.ETHIOPIC="ETHIOPIC",em.HEBREW="HEBREW",em.GREGORIAN="GREGORIAN",(eh=tv||(tv={})).SU="SU",eh.MO="MO",eh.TU="TU",eh.WE="WE",eh.TH="TH",eh.FR="FR",eh.SA="SA",(ep=tx||(tx={})).PEOPLECOUNTERASSET="PeopleCounterAsset",ep.MAILAGENT="MailAgent",ep.UDPAGENT="UDPAgent",ep.ROOMASSET="RoomAsset",ep.CITYASSET="CityAsset",ep.VENTILATIONASSET="VentilationAsset",ep.TRADFRILIGHTASSET="TradfriLightAsset",ep.CONSOLEASSET="ConsoleAsset",ep.PRESENCESENSORASSET="PresenceSensorAsset",ep.OPENWEATHERMAPAGENT="OpenWeatherMapAgent",ep.LIGHTASSET="LightAsset",ep.KNXAGENT="KNXAgent",ep.THETHINGSSTACKAGENT="TheThingsStackAgent",ep.PLUGASSET="PlugAsset",ep.CHIRPSTACKAGENT="ChirpStackAgent",ep.WEATHERASSET="WeatherAsset",ep.THINGASSET="ThingAsset",ep.WEBSOCKETAGENT="WebsocketAgent",ep.TCPAGENT="TCPAgent",ep.GATEWAYASSET="GatewayAsset",ep.SERIALAGENT="SerialAgent",ep.BLUETOOTHMESHAGENT="BluetoothMeshAgent",ep.PARKINGASSET="ParkingAsset",ep.TRADFRIPLUGASSET="TradfriPlugAsset",ep.SIMULATORAGENT="SimulatorAgent",ep.SNMPAGENT="SNMPAgent",ep.GROUPASSET="GroupAsset",ep.BUILDINGASSET="BuildingAsset",ep.MODBUSSERIALAGENT="ModbusSerialAgent",ep.ENVIRONMENTSENSORASSET="EnvironmentSensorAsset",ep.MQTTAGENT="MQTTAgent",ep.VELBUSTCPAGENT="VelbusTCPAgent",ep.ARTNETLIGHTASSET="ArtnetLightAsset",ep.VELBUSSERIALAGENT="VelbusSerialAgent",ep.GROUNDWATERSENSORASSET="GroundwaterSensorAsset",ep.MICROPHONEASSET="MicrophoneAsset",ep.MODBUSTCPAGENT="ModbusTcpAgent",ep.ZWAVEAGENT="ZWaveAgent",ep.HTTPAGENT="HTTPAgent",ep.DOORASSET="DoorAsset",ep.THERMOSTATASSET="ThermostatAsset",ep.SHIPASSET="ShipAsset",(ef=tw||(tw={})).COLOURRGB="colourRGB",ef.WILDCARDSUBSCRIPTIONTOPICS="wildcardSubscriptionTopics",ef.PRICEHOURLY="priceHourly",ef.MQTTPORT="MQTTPort",ef.PINGDISABLED="pingDisabled",ef.FLOW="flow",ef.CHILDASSETTYPE="childAssetType",ef.LASTACCESS="lastAccess",ef.POSITION="position",ef.NETWORKKEY="networkKey",ef.UNIVERSE="universe",ef.ROUTINGMODE="routingMode",ef.MSSINUMBER="MSSINumber",ef.LASTWILLRETAIN="lastWillRetain",ef.LASTWILLTOPIC="lastWillTopic",ef.SERIALBAUDRATE="serialBaudrate",ef.SUBSCRIBEQOS="subscribeQos",ef.LEDCOUNT="lEDCount",ef.LOCKED="locked",ef.CLOUDCOVERAGE="cloudCoverage",ef.BASEURL="baseURL",ef.PROTOCOL="protocol",ef.REQUIREDVALUES="requiredValues",ef.REGION="region",ef.CONSOLEPLATFORM="consolePlatform",ef.GATEWAYSTATUS="gatewayStatus",ef.NO2LEVEL="NO2Level",ef.ATMOSPHERICPRESSURE="atmosphericPressure",ef.SERIALPORT="serialPort",ef.APPLICATIONID="applicationId",ef.TAGS="tags",ef.UNLOCK="unlock",ef.CHECKINTERVALSECONDS="checkIntervalSeconds",ef.LOCATION="location",ef.CLIENTSECRET="clientSecret",ef.WINDDIRECTION="windDirection",ef.WINDSPEED="windSpeed",ef.PARTICLESPM10="particlesPM10",ef.APPLICATIONKEY="applicationKey",ef.LENGTH="length",ef.PROBABILITYOFPRECIPITATION="probabilityOfPrecipitation",ef.USERNAMEPASSWORD="usernamePassword",ef.WATERLEVEL="waterLevel",ef.CONNECTHEADERS="connectHeaders",ef.CONSOLENAME="consoleName",ef.WEBSOCKETQUERY="websocketQuery",ef.PREFERHTML="preferHTML",ef.PARITY="parity",ef.COOLING="cooling",ef.POLLINGMILLIS="pollingMillis",ef.SOILTEMPERATURE="soilTemperature",ef.SUNIRRADIANCE="sunIrradiance",ef.MESSAGEMAXLENGTH="messageMaxLength",ef.WINDGUSTSPEED="windGustSpeed",ef.LIGHTID="lightId",ef.PROXYADDRESS="proxyAddress",ef.REQUESTQUERYPARAMETERS="requestQueryParameters",ef.MQTTHOST="MQTTHost",ef.SECUREGRPC="secureGRPC",ef.MODEL="model",ef.STREET="street",ef.MANUFACTURER="manufacturer",ef.DELETEPROCESSEDMAIL="deleteProcessedMail",ef.RESUMESESSION="resumeSession",ef.ONOFF="onOff",ef.APIKEY="ApiKey",ef.CITY="city",ef.PRESENCE="presence",ef.SPACESOCCUPIED="spacesOccupied",ef.STARTTLS="startTLS",ef.REQUESTTIMEOUTMILLIS="requestTimeoutMillis",ef.WEBSOCKETPATH="websocketPath",ef.AGENTSTATUS="agentStatus",ef.PRICEDAILY="priceDaily",ef.COUNTGROWTHMINUTE="countGrowthMinute",ef.IMONUMBER="IMONumber",ef.ATTRIBUTION="Attribution",ef.TENANTID="tenantId",ef.REQUESTHEADERS="requestHeaders",ef.HOST="host",ef.COUNTOUTMINUTE="countOutMinute",ef.MESSAGECHARSET="messageCharset",ef.CERTIFICATEALIAS="certificateAlias",ef.EMAIL="email",ef.BINDPORT="bindPort",ef.CONSOLEVERSION="consoleVersion",ef.PARTICLESPM1="particlesPM1",ef.MTU="mtu",ef.SPEED="speed",ef.MESSAGESTRIPDELIMITER="messageStripDelimiter",ef.AREA="area",ef.COUNTRY="country",ef.SHIPTYPE="shipType",ef.CONNECTSUBSCRIPTIONS="connectSubscriptions",ef.RELATIVEHUMIDITY="relativeHumidity",ef.SOURCEADDRESS="sourceAddress",ef.RAINFALL="rainfall",ef.OAUTHGRANT="oAuthGrant",ef.OZONELEVEL="ozoneLevel",ef.SEQUENCENUMBER="sequenceNumber",ef.COUNTINMINUTE="countInMinute",ef.PORT="port",ef.SUNALTITUDE="sunAltitude",ef.COUNTOUT="countOut",ef.ROOMNUMBER="roomNumber",ef.TUNNELINGSUPPORTED="tunnelingSupported",ef.ENINUMBER="ENINumber",ef.PARTICLESPM2_5="particlesPM2_5",ef.AGENTDISABLED="agentDisabled",ef.DISABLED="disabled",ef.COUNTIN="countIn",ef.MESSAGESOURCEADDRESS="messageSourceAddress",ef.PROVISIONWEATHERASSET="ProvisionWeatherAsset",ef.TIMEINJECTIONINTERVAL="timeInjectionInterval",ef.TEMPERATURESETPOINT="temperatureSetpoint",ef.CONSOLEPROVIDERS="consoleProviders",ef.COUNTTOTAL="countTotal",ef.SPACESBUFFER="spacesBuffer",ef.DEVICECONFIG="deviceConfig",ef.SPACESTOTAL="spacesTotal",ef.BINDHOST="bindHost",ef.FANSPEED="fanSpeed",ef.MESSAGECONVERTBINARY="messageConvertBinary",ef.NOTES="notes",ef.MAILFOLDERNAME="mailFolderName",ef.MESSAGEDELIMITERS="messageDelimiters",ef.TEMPERATURE="temperature",ef.SUNZENITH="sunZenith",ef.SNMPVERSIONVALUE="SNMPVersionValue",ef.BRIGHTNESS="brightness",ef.POSTALCODE="postalCode",ef.SPACESOPEN="spacesOpen",ef.HUMIDITY="humidity",ef.SOUNDLEVEL="soundLevel",ef.SECUREMODE="secureMode",ef.DIRECTION="direction",ef.STOPBITS="stopbits",ef.UVINDEX="uVIndex",ef.CONNECTURL="connectURL",ef.CLIENTID="clientId",ef.NATMODE="NATMode",ef.UPDATEONWRITE="updateOnWrite",ef.LASTWILLPAYLOAD="lastWillPayload",ef.GROUPID="groupId",ef.FOLLOWREDIRECTS="followRedirects",ef.SUNAZIMUTH="sunAzimuth",ef.MESSAGECONVERTHEX="messageConvertHex",ef.WEBSOCKETMODE="websocketMode",ef.COLOURTEMPERATURE="colourTemperature",ef.PUBLISHQOS="publishQos",ef.DATABITS="dataBits",(eb=tF||(tF={})).FORMAT="format",eb.DATAPOINTSMAXAGEDAYS="dataPointsMaxAgeDays",eb.ACCESSRESTRICTEDWRITE="accessRestrictedWrite",eb.SECRET="secret",eb.APPLYPREDICTEDDATAPOINTS="applyPredictedDataPoints",eb.ATTRIBUTELINKS="attributeLinks",eb.RULERESETIMMEDIATE="ruleResetImmediate",eb.RULESTATE="ruleState",eb.AGENTLINKCONFIG="agentLinkConfig",eb.HASPREDICTEDDATAPOINTS="hasPredictedDataPoints",eb.FORECAST="forecast",eb.STOREDATAPOINTS="storeDataPoints",eb.LABEL="label",eb.CONSTRAINTS="constraints",eb.UNITS="units",eb.USERCONNECTED="userConnected",eb.SHOWONDASHBOARD="showOnDashboard",eb.READONLY="readOnly",eb.MULTILINE="multiline",eb.ACCESSPUBLICWRITE="accessPublicWrite",eb.MOMENTARY="momentary",eb.AGENTLINK="agentLink",eb.ACCESSRESTRICTEDREAD="accessRestrictedRead",eb.ACCESSPUBLICREAD="accessPublicRead",(eg=tk||(tk={})).ASSETQUERY="assetQuery",eg.WSURL="WS_URL",eg.COLOURRGB="colourRGB",eg.VALUEFORMAT="valueFormat",eg.TEXT="text",eg.BYTE="byte",eg.USERNAMEANDPASSWORD="usernameAndPassword",eg.HTTPURL="HTTP_URL",eg.ATTRIBUTELINK="attributeLink",eg.ASSETID="assetID",eg.NUMBERMAP="numberMap",eg.HTTPMETHOD="HTTPMethod",eg.ATTRIBUTESTATE="attributeState",eg.POSITIVENUMBER="positiveNumber",eg.POSITIVEINTEGER="positiveInteger",eg.EXECUTIONSTATUS="executionStatus",eg.BIGINTEGER="bigInteger",eg.VALUEDESCRIPTOR="valueDescriptor",eg.PERIODDURATIONISO8601="periodDurationISO8601",eg.LONG="long",eg.DATEANDTIME="dateAndTime",eg.BOOLEANMAP="booleanMap",eg.MQTTQOS="MQTTQos",eg.NEGATIVEINTEGER="negativeInteger",eg.TCPIPPORTNUMBER="TCP_IPPortNumber",eg.GEOJSONPOINT="GEO_JSONPoint",eg.SNMPVERSION="SNMPVersion",eg.ASSETTYPE="assetType",eg.JSONOBJECT="JSONObject",eg.INTEGERMAP="integerMap",eg.BIGNUMBER="bigNumber",eg.IPADDRESS="IPAddress",eg.EMAIL="email",eg.TIMESTAMP="timestamp",eg.KNXMESSAGESOURCEADDRESS="kNXMessageSourceAddress",eg.ATTRIBUTEREFERENCE="attributeReference",eg.UUID="UUID",eg.INTEGER="integer",eg.OAUTHGRANT="oAuthGrant",eg.NUMBER="number",eg.DEVICECONFIGMAP="DeviceConfigMap",eg.TEXTMAP="textMap",eg.WEBSOCKETSUBSCRIPTION="websocketSubscription",eg.BOOLEAN="boolean",eg.TIMEANDPERIODDURATIONISO8601="timeAndPeriodDurationISO8601",eg.FORECASTCONFIGURATION="forecastConfiguration",eg.TIMEDURATIONISO8601="timeDurationISO8601",eg.TIMESTAMPISO8601="timestampISO8601",eg.CONSOLEPROVIDERS="consoleProviders",eg.MULTIVALUEDTEXTMAP="multivaluedTextMap",eg.NEGATIVENUMBER="negativeNumber",eg.PARITYBIT="Paritybit",eg.JSON="JSON",eg.CRONEXPRESSION="CRONExpression",eg.INTEGERBYTE="integerByte",eg.AGENTLINK="agentLink",eg.DIRECTION="direction",eg.HOSTORIPADDRESS="hostOrIPAddress",eg.STOPBITS="Stopbits",eg.CALENDAREVENT="calendarEvent",eg.CONNECTIONSTATUS="connectionStatus",eg.VALUECONSTRAINT="valueConstraint",(e_=tE||(tE={})).MONTH="month",e_.MILE_SCANDINAVIAN="mile_scandinavian",e_.VAR="var",e_.OUNCE="ounce",e_.HECTARE="hectare",e_.YARD="yard",e_.YEAR="year",e_.JOULE="joule",e_.VOLT="volt",e_.HERTZ="hertz",e_.MILE="mile",e_.DEGREE="degree",e_.KILO="kilo",e_.BTU="btu",e_.FOOT="foot",e_.MEGA="mega",e_.KELVIN="kelvin",e_.CARBON="carbon",e_.DECIBEL_ATTENUATED="decibel_attenuated",e_.INCH="inch",e_.SQUARED="squared",e_.PERCENTAGE="percentage",e_.IN_HG="inch_mercury",e_.CENTI="centi",e_.GRAM="gram",e_.CUBED="cubed",e_.DAY="day",e_.RADIAN="radian",e_.OHM="ohm",e_.MINUTE="minute",e_.PART_PER_MILLION="ppm",e_.AMP="amp",e_.MASS_POUND="pound",e_.KNOT="knot",e_.METRE="metre",e_.LITRE="litre",e_.FLUID_OUNCE="fluid_ounce",e_.HOUR="hour",e_.ACRE="acre",e_.CELSIUS="celsius",e_.RPM="rpm",e_.PASCAL="pascal",e_.DECIBEL="decibel",e_.LUMEN="lumen",e_.WEEK="week",e_.FAHRENHEIT="fahrenheit",e_.WATT="watt",e_.GALLON="gallon",e_.LUX="lux",e_.MILLI="milli",e_.BAR="bar",e_.HECTO="hecto",e_.PEAK="peak",e_.SECOND="second",e_.MICRO="micro",e_.PER="per",e_.STONE="stone",tT||(tT={});class tq{static getAssetDescriptors(){return tq._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=tq.getValueDescriptor(n)),i=n.jsonType?n:tq.getValueDescriptor(n.type)),!i&&t&&(i=tq.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}}function tG(t){return(tG="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 t$(t,n){if(!(t instanceof n))throw TypeError("Cannot call a class as a function")}function tW(t){var n=function(t,n){if("object"!=tG(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,n||"default");if("object"!=tG(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==tG(n)?n:String(n)}function tX(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,tW(r.key),r)}}function tZ(t,n,i){return n&&tX(t.prototype,n),i&&tX(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function tK(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function tJ(t,n){return(tJ=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}function tQ(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&&tJ(t,n)}function t0(t,n){if(n&&("object"===tG(n)||"function"==typeof n))return n;if(void 0!==n)throw TypeError("Derived constructors may only return object or undefined");return tK(t)}function t1(t){return(t1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function t2(t,n,i){return(n=tW(n))in t?Object.defineProperty(t,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[n]=i,t}function t5(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 t3(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 t4(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t3(Object(i),!0).forEach(function(n){t2(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):t3(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}tq._assetTypeInfos=[],tq._metaItemDescriptors=[],tq._valueDescriptors=[];var t6={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)}},t8=new(function(){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t$(this,t),this.init(n,i)}return tZ(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||t6,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,t4(t4({},{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}()),t7=function(){function t(){t$(this,t),this.observers={}}return tZ(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 t9(){var t,n,i=new Promise(function(i,r){t=i,n=r});return i.resolve=t,i.reject=n,i}function ne(t){return null==t?"":""+t}function nt(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 nn(t,n,i){var r=nt(t,n,Object);r.obj[r.k]=i}function ni(t,n){var i=nt(t,n),r=i.obj,o=i.k;if(r)return r[o]}function nr(t,n,i){var r=ni(t,i);return void 0!==r?r:ni(n,i)}function no(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var na={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function ns(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,function(t){return na[t]}):t}var nl="u">typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,nc=[" ",",","?","!",";"];function nd(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 nu(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?nd(Object(i),!0).forEach(function(n){t2(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):nd(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var nm=function(t){tQ(r,t);var n,i=(n=function(){if("u"<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=t1(r);return t=n?Reflect.construct(i,arguments,t1(this).constructor):i.apply(this,arguments),t0(this,t)});function r(t){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return t$(this,r),n=i.call(this),nl&&t7.call(tK(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 tZ(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=ni(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),nn(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=ni(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=nu(nu({},l),i),nn(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)?nu(nu({},{}),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}(t7),nh={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 np(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 nf(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?np(Object(i),!0).forEach(function(n){t2(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):np(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var nb={},ng=function(t){tQ(r,t);var n,i=(n=function(){if("u"<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=t1(r);return t=n?Reflect.construct(i,arguments,t1(this).constructor):i.apply(this,arguments),t0(this,t)});function r(t){var n,o,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t$(this,r),a=i.call(this),nl&&t7.call(tK(a)),n=["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],o=tK(a),n.forEach(function(n){t[n]&&(o[n]=t[n])}),a.options=s,void 0===a.options.keySeparator&&(a.options.keySeparator="."),a.logger=t8.create("translator"),a}return tZ(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=nc.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"!==tG(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 p=n.nsSeparator||this.options.nsSeparator;return a?(f.res="".concat(u).concat(p).concat(c),f):"".concat(u).concat(p).concat(c)}return a?(f.res=c,f):c}var f=this.resolve(t,n),b=f&&f.res,g=f&&f.usedKey||c,_=f&&f.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,nf(nf({},n),{},{ns:d})):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");return a?(f.res=F,f):F}if(s){var k="[object Array]"===y,E=k?[]:{},T=k?_:g;for(var M in b)if(Object.prototype.hasOwnProperty.call(b,M)){var A="".concat(T).concat(s).concat(M);E[M]=this.translate(A,nf(nf({},n),{joinArrays:!1,ns:d})),E[M]===A&&(E[M]=b[M])}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,L=r.hasDefaultValue(n),I=D?this.pluralResolver.getSuffix(m,n.count,n):"",P=n["defaultValue".concat(I)]||n.defaultValue;!this.isValidLookup(b)&&L&&(C=!0,b=P),this.isValidLookup(b)||(S=!0,b=c);var O=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&S?void 0:b,R=L&&P!==b&&this.options.updateMissing;if(S||C||R){if(this.logger.log(R?"updateKey":"missingKey",m,u,c,R?P:b),s){var B=this.resolve(c,nf(nf({},n),{},{keySeparator:!1}));B&&B.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 z=[],Y=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&Y&&Y[0])for(var N=0;N<Y.length;N++)z.push(Y[N]);else"all"===this.options.saveMissingTo?z=this.languageUtils.toResolveHierarchy(n.lng||this.language):z.push(n.lng||this.language);var j=function(t,i,r){var a=L&&r!==b?r:O;o.options.missingKeyHandler?o.options.missingKeyHandler(t,u,i,a,R,n):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(t,u,i,a,R,n),o.emit("missingKey",t,u,i,b)};this.options.saveMissing&&(this.options.saveMissingPlurals&&D?z.forEach(function(t){o.pluralResolver.getSuffixes(t,n).forEach(function(i){j([t],c+i,n["defaultValue".concat(i)]||P)})}):j(z,c,P))}b=this.extendTranslation(b,t,n,f,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?(f.res=b,f):b}},{key:"extendTranslation",value:function(t,n,i,r,o){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,nf(nf({},this.options.interpolation.defaultVariables),i),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init(nf(nf({},i),{interpolation:nf(nf({},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=nf(nf({},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=nh.handle(h,t,n,this.options&&this.options.postProcessPassResolved?nf({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(),p=void 0!==l.context&&("string"==typeof l.context||"number"==typeof l.context)&&""!==l.context,f=l.lngs?l.lngs:s.languageUtils.toResolveHierarchy(l.lng||s.language,l.fallbackLng);u.forEach(function(t){s.isValidLookup(n)||(a=t,!nb["".concat(f[0],"-").concat(t)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(a)&&(nb["".concat(f[0],"-").concat(t)]=!0,s.logger.warn('key "'.concat(i,'" for languages "').concat(f.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!!!")),f.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,f="".concat(s.options.pluralSeparator,"zero");if(m&&(c.push(d+u),h&&c.push(d+f)),p){var b="".concat(d).concat(s.options.contextSeparator).concat(l.context);c.push(b),m&&(c.push(b+u),h&&c.push(b+f))}}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}(t7);function n_(t){return t.charAt(0).toUpperCase()+t.slice(1)}var ny=function(){function t(n){t$(this,t),this.options=n,this.supportedLngs=this.options.supportedLngs||!1,this.logger=t8.create("languageUtils")}return tZ(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]=n_(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]=n_(i[1].toLowerCase())),n.indexOf(i[2].toLowerCase())>-1&&(i[2]=n_(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}(),nv=[{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}],nx={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)}},nw=["v1","v2","v3"],nF={zero:0,one:1,two:2,few:3,many:4,other:5},nk=function(){function t(n){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t$(this,t),this.languageUtils=n,this.options=r,this.logger=t8.create("pluralResolver"),(!this.options.compatibilityJSON||"v4"===this.options.compatibilityJSON)&&("u"<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={},nv.forEach(function(t){t.lngs.forEach(function(n){i[n]={numbers:t.nr,plurals:nx[t.fc]}})}),i)}return tZ(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 nF[t]-nF[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!nw.includes(this.options.compatibilityJSON)}}]),t}();function nE(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 nT(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?nE(Object(i),!0).forEach(function(n){t2(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):nE(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var nM=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t$(this,t),this.logger=t8.create("interpolator"),this.options=n,this.format=n.interpolation&&n.interpolation.format||function(t){return t},this.init(n)}return tZ(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:ns,this.escapeValue=void 0===n.escapeValue||n.escapeValue,this.useRawValueToEscape=void 0!==n.useRawValueToEscape&&n.useRawValueToEscape,this.prefix=n.prefix?no(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?no(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?no(n.nestingPrefix):n.nestingPrefixEscaped||no("$t("),this.nestingSuffix=n.nestingSuffix?no(n.nestingSuffix):n.nestingSuffixEscaped||no(")"),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=nr(n,c,t);return l.alwaysFormat?l.format(o,void 0,i,nT(nT(nT({},r),n),{},{interpolationkey:t})):o}var a=t.split(l.formatSeparator),s=a.shift().trim(),d=a.join(l.formatSeparator).trim();return l.format(nr(n,c,s),d,i,nT(nT(nT({},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=ne(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=nT({},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=nT(nT({},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=ne(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,nT(nT({},a),{},{interpolationkey:i[1].trim()}))},r.trim())),t=t.replace(i[0],r),this.regexp.lastIndex=0}return t}}]),t}();function nA(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 nC(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?nA(Object(i),!0).forEach(function(n){t2(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):nA(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}function nS(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 nD=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t$(this,t),this.logger=t8.create("formatter"),this.options=n,this.formats={number:nS(function(t,n){var i=new Intl.NumberFormat(t,n);return function(t){return i.format(t)}}),currency:nS(function(t,n){var i=new Intl.NumberFormat(t,nC(nC({},n),{},{style:"currency"}));return function(t){return i.format(t)}}),datetime:nS(function(t,n){var i=new Intl.DateTimeFormat(t,nC({},n));return function(t){return i.format(t)}}),relativetime:nS(function(t,n){var i=new Intl.RelativeTimeFormat(t,nC({},n));return function(t){return i.format(t,n.range||"day")}}),list:nS(function(t,n){var i=new Intl.ListFormat(t,nC({},n));return function(t){return i.format(t)}})},this.init(n)}return tZ(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()]=nS(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("u">typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||function(t,n){if(t){if("string"==typeof t)return t5(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 t5(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,nC(nC(nC({},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 nL(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 nI(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?nL(Object(i),!0).forEach(function(n){t2(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):nL(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var nP=function(t){tQ(r,t);var n,i=(n=function(){if("u"<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=t1(r);return t=n?Reflect.construct(i,arguments,t1(this).constructor):i.apply(this,arguments),t0(this,t)});function r(t,n,o){var a,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t$(this,r),a=i.call(this),nl&&t7.call(tK(a)),a.backend=t,a.store=n,a.services=o,a.languageUtils=o.languageUtils,a.options=s,a.logger=t8.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 tZ(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;r=i.loaded,(c=(l=nt(r,[o],Object)).obj)[d=l.k]=c[d]||[],c[d].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)}l&&c&&o<r.maxRetries?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]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)?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,nI(nI({},a),{},{isUpdate:o})),t&&t[0]&&this.store.addResource(t[0],n,i,r))}}]),r}(t7);function nO(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 nR(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 nB(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?nR(Object(i),!0).forEach(function(n){t2(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):nR(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}function nz(){}var nY=function(t){tQ(r,t);var n,i=(n=function(){if("u"<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=t1(r);return t=n?Reflect.construct(i,arguments,t1(this).constructor):i.apply(this,arguments),t0(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(t$(this,r),n=i.call(this),nl&&t7.call(tK(n)),n.options=nO(o),n.services={},n.logger=t8,n.modules={external:[]},Object.getOwnPropertyNames(Object.getPrototypeOf(t=tK(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),t0(n,tK(n));setTimeout(function(){n.init(o,a)},0)}return n}return tZ(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"===tG(t[1])&&(n=t[1]),"string"==typeof t[1]&&(n.defaultValue=t[1]),"string"==typeof t[2]&&(n.tDescription=t[2]),"object"===tG(t[2])||"object"===tG(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=nB(nB(nB({},r),this.options),nO(n)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=nB(nB({},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?t8.init(o(this.modules.logger),this.options):t8.init(null,this.options),this.modules.formatter?a=this.modules.formatter:"u">typeof Intl&&(a=nD);var a,s=new ny(this.options);this.store=new nm(this.options.resources,this.options);var l=this.services;l.logger=t8,l.resourceStore=this.store,l.languageUtils=s,l.pluralResolver=new nk(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 nM(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new nP(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 ng(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=nz),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=t9(),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]:nz,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=t9();return t||(t=this.languages),n||(n=this.options.ns),i||(i=nz),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&&nh.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=t9();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"!==tG(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=nB({},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=t9();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=t9();"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]:nz,o=nB(nB(nB({},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=nB({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new ng(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}(t7);t2(nY,"createInstance",function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new nY(t,n)});var nN=nY.createInstance();nN.createInstance=nY.createInstance,nN.createInstance,nN.init,nN.loadResources,nN.reloadResources,nN.use,nN.changeLanguage,nN.getFixedT,nN.t,nN.exists,nN.setDefaultNamespace,nN.hasLoadedNamespace,nN.loadNamespaces,nN.loadLanguages;let nj=nN;var nH=o(8183),nU=o.n(nH),nV=o(4867),nq=o.n(nV);o(3472);class nG{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 n$(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=>n$(t[i],n[i]))}return!1}function nW(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 nX(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 nZ(t,n,i,r,o,a){let s=nK(t?t.value:void 0,()=>nQ("format",t,n,i,o),void 0,a),l=nQ("units",t,n,i,!0);return r&&l&&l.length&&(s=nJ(nQ("units",t,n,i,o),s)),s}function nK(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||nj.language,r).format(t);break;case"boolean":r.asOnOff&&(o=t?nj.t("on"):nj.t("off")),r.asOpenClosed&&(o=t?nj.t("open"):nj.t("closed")),r.asPressedReleased&&(o=t?nj.t("pressed"):nj.t("released"));break;case"object":if(r.momentJsFormat)o=nq()(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||nj.language,r).format(t)}else o=Object(t).toString()}return o}function nJ(t,n){if(!t)return"";n||(n="");let i=t.map((t,i)=>{if(3!==t.length||t.toUpperCase()!==t)return nj.t(["units."+t,"or:units."+t]);{let r=new Intl.NumberFormat(nj.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 nQ(t,n,i,r,o){let a,s=[],l=n0(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=nX(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=tq.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 n0(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 nj.t(l,{defaultValue:a||""})}function n1(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 n2=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 n5=o(4461);class n3{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=n3._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 p=sx.getAppName();p.length>0&&0>u.apps.indexOf(p)&&u.apps.push(p),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 n2(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 n2(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 n2(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 n2(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 n2(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 nG,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={}),sx.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 n2(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:n5.name,version:n5.version,platform:n5.os.toString(),apps:[],model:((n5.manufacturer?n5.manufacturer+" ":"")+(n5.product?n5.product:"")).trim()}}_initialiseProvider(t){return n2(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)}})}}function n4(t,n){return function(){return t.apply(n,arguments)}}let{toString:n6}=Object.prototype,{getPrototypeOf:n8}=Object,{iterator:n7,toStringTag:n9}=Symbol,ie=(n=Object.create(null),t=>{let i=n6.call(t);return n[i]||(n[i]=i.slice(8,-1).toLowerCase())}),it=t=>(t=t.toLowerCase(),n=>ie(n)===t),ii=t=>n=>typeof n===t,{isArray:ir}=Array,io=ii("undefined");function ia(t){return null!==t&&!io(t)&&null!==t.constructor&&!io(t.constructor)&&ic(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}let is=it("ArrayBuffer"),il=ii("string"),ic=ii("function"),id=ii("number"),iu=t=>null!==t&&"object"==typeof t,im=t=>{if("object"!==ie(t))return!1;let n=n8(t);return(null===n||n===Object.prototype||null===Object.getPrototypeOf(n))&&!(n9 in t)&&!(n7 in t)},ih=it("Date"),ip=it("File"),ib=it("Blob"),ig=it("FileList"),i_="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},iy=void 0!==i_.FormData?i_.FormData:void 0,iv=it("URLSearchParams"),[ix,iw,iF,ik]=["ReadableStream","Request","Response","Headers"].map(it);function iE(t,n,{allOwnKeys:i=!1}={}){let r,o;if(null!=t)if("object"!=typeof t&&(t=[t]),ir(t))for(r=0,o=t.length;r<o;r++)n.call(null,t[r],r,t);else{let o;if(ia(t))return;let a=i?Object.getOwnPropertyNames(t):Object.keys(t),s=a.length;for(r=0;r<s;r++)o=a[r],n.call(null,t[o],o,t)}}function iT(t,n){let i;if(ia(t))return null;n=n.toLowerCase();let r=Object.keys(t),o=r.length;for(;o-- >0;)if(n===(i=r[o]).toLowerCase())return i;return null}let iM="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,iA=t=>!io(t)&&t!==iM,iC=(i="u">typeof Uint8Array&&n8(Uint8Array),t=>i&&t instanceof i),iS=it("HTMLFormElement"),iD=(({hasOwnProperty:t})=>(n,i)=>t.call(n,i))(Object.prototype),iL=it("RegExp"),iI=(t,n)=>{let i=Object.getOwnPropertyDescriptors(t),r={};iE(i,(i,o)=>{let a;!1!==(a=n(i,o,t))&&(r[o]=a||i)}),Object.defineProperties(t,r)},iP=it("AsyncFunction"),iO=(l="function"==typeof setImmediate,c=ic(iM.postMessage),l?setImmediate:c?(d=`axios@${Math.random()}`,u=[],iM.addEventListener("message",({source:t,data:n})=>{t===iM&&n===d&&u.length&&u.shift()()},!1),t=>{u.push(t),iM.postMessage(d,"*")}):t=>setTimeout(t)),iR="u">typeof queueMicrotask?queueMicrotask.bind(iM):"u">typeof process&&process.nextTick||iO,iB={isArray:ir,isArrayBuffer:is,isBuffer:ia,isFormData:t=>{let n;return t&&(iy&&t instanceof iy||ic(t.append)&&("formdata"===(n=ie(t))||"object"===n&&ic(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&is(t.buffer)},isString:il,isNumber:id,isBoolean:t=>!0===t||!1===t,isObject:iu,isPlainObject:im,isEmptyObject:t=>{if(!iu(t)||ia(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(t){return!1}},isReadableStream:ix,isRequest:iw,isResponse:iF,isHeaders:ik,isUndefined:io,isDate:ih,isFile:ip,isReactNativeBlob:t=>!!(t&&void 0!==t.uri),isReactNative:t=>t&&void 0!==t.getParts,isBlob:ib,isRegExp:iL,isFunction:ic,isStream:t=>iu(t)&&ic(t.pipe),isURLSearchParams:iv,isTypedArray:iC,isFileList:ig,forEach:iE,merge:function t(){let{caseless:n,skipUndefined:i}=iA(this)&&this||{},r={},o=(o,a)=>{if("__proto__"===a||"constructor"===a||"prototype"===a)return;let s=n&&iT(r,a)||a;im(r[s])&&im(o)?r[s]=t(r[s],o):im(o)?r[s]=t({},o):ir(o)?r[s]=o.slice():i&&io(o)||(r[s]=o)};for(let t=0,n=arguments.length;t<n;t++)arguments[t]&&iE(arguments[t],o);return r},extend:(t,n,i,{allOwnKeys:r}={})=>(iE(n,(n,r)=>{i&&ic(n)?Object.defineProperty(t,r,{value:n4(n,i),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,r,{value:n,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,n,i,r)=>{t.prototype=Object.create(n.prototype,r),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:n.prototype}),i&&Object.assign(t.prototype,i)},toFlatObject:(t,n,i,r)=>{let o,a,s,l={};if(n=n||{},null==t)return n;do{for(a=(o=Object.getOwnPropertyNames(t)).length;a-- >0;)s=o[a],(!r||r(s,t,n))&&!l[s]&&(n[s]=t[s],l[s]=!0);t=!1!==i&&n8(t)}while(t&&(!i||i(t,n))&&t!==Object.prototype);return n},kindOf:ie,kindOfTest:it,endsWith:(t,n,i)=>{t=String(t),(void 0===i||i>t.length)&&(i=t.length),i-=n.length;let r=t.indexOf(n,i);return -1!==r&&r===i},toArray:t=>{if(!t)return null;if(ir(t))return t;let n=t.length;if(!id(n))return null;let i=Array(n);for(;n-- >0;)i[n]=t[n];return i},forEachEntry:(t,n)=>{let i,r=(t&&t[n7]).call(t);for(;(i=r.next())&&!i.done;){let r=i.value;n.call(t,r[0],r[1])}},matchAll:(t,n)=>{let i,r=[];for(;null!==(i=t.exec(n));)r.push(i);return r},isHTMLForm:iS,hasOwnProperty:iD,hasOwnProp:iD,reduceDescriptors:iI,freezeMethods:t=>{iI(t,(n,i)=>{if(ic(t)&&-1!==["arguments","caller","callee"].indexOf(i))return!1;if(ic(t[i])){if(n.enumerable=!1,"writable"in n){n.writable=!1;return}n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},toObjectSet:(t,n)=>{let i={};return(ir(t)?t:String(t).split(n)).forEach(t=>{i[t]=!0}),i},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,i){return n.toUpperCase()+i}),noop:()=>{},toFiniteNumber:(t,n)=>null!=t&&Number.isFinite(t*=1)?t:n,findKey:iT,global:iM,isContextDefined:iA,isSpecCompliantForm:function(t){return!!(t&&ic(t.append)&&"FormData"===t[n9]&&t[n7])},toJSONObject:t=>{let n=Array(10),i=(t,r)=>{if(iu(t)){if(n.indexOf(t)>=0)return;if(ia(t))return t;if(!("toJSON"in t)){n[r]=t;let o=ir(t)?[]:{};return iE(t,(t,n)=>{let a=i(t,r+1);io(a)||(o[n]=a)}),n[r]=void 0,o}}return t};return i(t,0)},isAsyncFn:iP,isThenable:t=>t&&(iu(t)||ic(t))&&ic(t.then)&&ic(t.catch),setImmediate:iO,asap:iR,isIterable:t=>null!=t&&ic(t[n7])};class iz extends Error{static from(t,n,i,r,o,a){let s=new iz(t.message,n||t.code,i,r,o);return s.cause=t,s.name=t.name,null!=t.status&&null==s.status&&(s.status=t.status),a&&Object.assign(s,a),s}constructor(t,n,i,r,o){super(t),Object.defineProperty(this,"message",{value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),i&&(this.config=i),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:iB.toJSONObject(this.config),code:this.code,status:this.status}}}iz.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",iz.ERR_BAD_OPTION="ERR_BAD_OPTION",iz.ECONNABORTED="ECONNABORTED",iz.ETIMEDOUT="ETIMEDOUT",iz.ERR_NETWORK="ERR_NETWORK",iz.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",iz.ERR_DEPRECATED="ERR_DEPRECATED",iz.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",iz.ERR_BAD_REQUEST="ERR_BAD_REQUEST",iz.ERR_CANCELED="ERR_CANCELED",iz.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",iz.ERR_INVALID_URL="ERR_INVALID_URL";let iY=iz;function iN(t){return iB.isPlainObject(t)||iB.isArray(t)}function ij(t){return iB.endsWith(t,"[]")?t.slice(0,-2):t}function iH(t,n,i){return t?t.concat(n).map(function(t,n){return t=ij(t),!i&&n?"["+t+"]":t}).join(i?".":""):n}let iU=iB.toFlatObject(iB,{},null,function(t){return/^is[A-Z]/.test(t)}),iV=function(t,n,i){if(!iB.isObject(t))throw TypeError("target must be an object");n=n||new FormData;let r=(i=iB.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(t,n){return!iB.isUndefined(n[t])})).metaTokens,o=i.visitor||d,a=i.dots,s=i.indexes,l=(i.Blob||"u">typeof Blob&&Blob)&&iB.isSpecCompliantForm(n);if(!iB.isFunction(o))throw TypeError("visitor must be a function");function c(t){if(null===t)return"";if(iB.isDate(t))return t.toISOString();if(iB.isBoolean(t))return t.toString();if(!l&&iB.isBlob(t))throw new iY("Blob is not supported. Use a Buffer instead.");return iB.isArrayBuffer(t)||iB.isTypedArray(t)?l&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function d(t,i,o){let l=t;if(iB.isReactNative(n)&&iB.isReactNativeBlob(t))return n.append(iH(o,i,a),c(t)),!1;if(t&&!o&&"object"==typeof t)if(iB.endsWith(i,"{}"))i=r?i:i.slice(0,-2),t=JSON.stringify(t);else{var d;if(iB.isArray(t)&&(d=t,iB.isArray(d)&&!d.some(iN))||(iB.isFileList(t)||iB.endsWith(i,"[]"))&&(l=iB.toArray(t)))return i=ij(i),l.forEach(function(t,r){iB.isUndefined(t)||null===t||n.append(!0===s?iH([i],r,a):null===s?i:i+"[]",c(t))}),!1}return!!iN(t)||(n.append(iH(o,i,a),c(t)),!1)}let u=[],m=Object.assign(iU,{defaultVisitor:d,convertValue:c,isVisitable:iN});if(!iB.isObject(t))throw TypeError("data must be an object");return!function t(i,r){if(!iB.isUndefined(i)){if(-1!==u.indexOf(i))throw Error("Circular reference detected in "+r.join("."));u.push(i),iB.forEach(i,function(i,a){!0===(!(iB.isUndefined(i)||null===i)&&o.call(n,i,iB.isString(a)?a.trim():a,r,m))&&t(i,r?r.concat(a):[a])}),u.pop()}}(t),n};function iq(t){let n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(t){return n[t]})}function iG(t,n){this._pairs=[],t&&iV(t,this,n)}let i$=iG.prototype;function iW(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function iX(t,n,i){let r;if(!n)return t;let o=i&&i.encode||iW,a=iB.isFunction(i)?{serialize:i}:i,s=a&&a.serialize;if(r=s?s(n,a):iB.isURLSearchParams(n)?n.toString():new iG(n,a).toString(o)){let n=t.indexOf("#");-1!==n&&(t=t.slice(0,n)),t+=(-1===t.indexOf("?")?"?":"&")+r}return t}i$.append=function(t,n){this._pairs.push([t,n])},i$.toString=function(t){let n=t?function(n){return t.call(this,n,iq)}:iq;return this._pairs.map(function(t){return n(t[0])+"="+n(t[1])},"").join("&")};let iZ=class{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){iB.forEach(this.handlers,function(n){null!==n&&t(n)})}},iK={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},iJ="u">typeof URLSearchParams?URLSearchParams:iG,iQ="u">typeof FormData?FormData:null,i0="u">typeof Blob?Blob:null,i1="u">typeof window&&"u">typeof document,i2="object"==typeof navigator&&navigator||void 0,i5=i1&&(!i2||0>["ReactNative","NativeScript","NS"].indexOf(i2.product)),i3="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,i4=i1&&window.location.href||"http://localhost",i6={...tU,isBrowser:!0,classes:{URLSearchParams:iJ,FormData:iQ,Blob:i0},protocols:["http","https","file","blob","url","data"]},i8=function(t){if(iB.isFormData(t)&&iB.isFunction(t.entries)){let n={};return iB.forEachEntry(t,(t,i)=>{!function t(n,i,r,o){let a=n[o++];if("__proto__"===a)return!0;let s=Number.isFinite(+a),l=o>=n.length;return(a=!a&&iB.isArray(r)?r.length:a,l)?iB.hasOwnProp(r,a)?r[a]=[r[a],i]:r[a]=i:(r[a]&&iB.isObject(r[a])||(r[a]=[]),t(n,i,r[a],o)&&iB.isArray(r[a])&&(r[a]=function(t){let n,i,r={},o=Object.keys(t),a=o.length;for(n=0;n<a;n++)r[i=o[n]]=t[i];return r}(r[a]))),!s}(iB.matchAll(/\w+|\[(\w*)]/g,t).map(t=>"[]"===t[0]?"":t[1]||t[0]),i,n,0)}),n}return null},i7={transitional:iK,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){let i,r=n.getContentType()||"",o=r.indexOf("application/json")>-1,a=iB.isObject(t);if(a&&iB.isHTMLForm(t)&&(t=new FormData(t)),iB.isFormData(t))return o?JSON.stringify(i8(t)):t;if(iB.isArrayBuffer(t)||iB.isBuffer(t)||iB.isStream(t)||iB.isFile(t)||iB.isBlob(t)||iB.isReadableStream(t))return t;if(iB.isArrayBufferView(t))return t.buffer;if(iB.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1){var s,l;return(s=t,l=this.formSerializer,iV(s,new i6.classes.URLSearchParams,{visitor:function(t,n,i,r){return i6.isNode&&iB.isBuffer(t)?(this.append(n,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...l})).toString()}if((i=iB.isFileList(t))||r.indexOf("multipart/form-data")>-1){let n=this.env&&this.env.FormData;return iV(i?{"files[]":t}:t,n&&new n,this.formSerializer)}}if(a||o){n.setContentType("application/json",!1);var c=t;if(iB.isString(c))try{return(0,JSON.parse)(c),iB.trim(c)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(c)}return t}],transformResponse:[function(t){let n=this.transitional||i7.transitional,i=n&&n.forcedJSONParsing,r="json"===this.responseType;if(iB.isResponse(t)||iB.isReadableStream(t))return t;if(t&&iB.isString(t)&&(i&&!this.responseType||r)){let i=n&&n.silentJSONParsing;try{return JSON.parse(t,this.parseReviver)}catch(t){if(!i&&r){if("SyntaxError"===t.name)throw iY.from(t,iY.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:i6.classes.FormData,Blob:i6.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};iB.forEach(["delete","get","head","post","put","patch"],t=>{i7.headers[t]={}});let i9=iB.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),re=Symbol("internals");function rt(t){return t&&String(t).trim().toLowerCase()}function rn(t){return!1===t||null==t?t:iB.isArray(t)?t.map(rn):String(t)}function ri(t,n,i,r,o){if(iB.isFunction(r))return r.call(this,n,i);if(o&&(n=i),iB.isString(n)){if(iB.isString(r))return -1!==n.indexOf(r);if(iB.isRegExp(r))return r.test(n)}}class rr{constructor(t){t&&this.set(t)}set(t,n,i){let r=this;function o(t,n,i){let o=rt(n);if(!o)throw Error("header name must be a non-empty string");let a=iB.findKey(r,o);a&&void 0!==r[a]&&!0!==i&&(void 0!==i||!1===r[a])||(r[a||n]=rn(t))}let a=(t,n)=>iB.forEach(t,(t,i)=>o(t,i,n));if(iB.isPlainObject(t)||t instanceof this.constructor)a(t,n);else{let r;if(iB.isString(t)&&(t=t.trim())&&(r=t,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim()))){var s;let i,r,o,l;a((l={},(s=t)&&s.split("\n").forEach(function(t){o=t.indexOf(":"),i=t.substring(0,o).trim().toLowerCase(),r=t.substring(o+1).trim(),!i||l[i]&&i9[i]||("set-cookie"===i?l[i]?l[i].push(r):l[i]=[r]:l[i]=l[i]?l[i]+", "+r:r)}),l),n)}else if(iB.isObject(t)&&iB.isIterable(t)){let i={},r,o;for(let n of t){if(!iB.isArray(n))throw TypeError("Object iterator must return a key-value pair");i[o=n[0]]=(r=i[o])?iB.isArray(r)?[...r,n[1]]:[r,n[1]]:n[1]}a(i,n)}else null!=t&&o(n,t,i)}return this}get(t,n){if(t=rt(t)){let i=iB.findKey(this,t);if(i){let t=this[i];if(!n)return t;if(!0===n){let n,i=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;n=r.exec(t);)i[n[1]]=n[2];return i}if(iB.isFunction(n))return n.call(this,t,i);if(iB.isRegExp(n))return n.exec(t);throw TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=rt(t)){let i=iB.findKey(this,t);return!!(i&&void 0!==this[i]&&(!n||ri(this,this[i],i,n)))}return!1}delete(t,n){let i=this,r=!1;function o(t){if(t=rt(t)){let o=iB.findKey(i,t);o&&(!n||ri(i,i[o],o,n))&&(delete i[o],r=!0)}}return iB.isArray(t)?t.forEach(o):o(t),r}clear(t){let n=Object.keys(this),i=n.length,r=!1;for(;i--;){let o=n[i];(!t||ri(this,this[o],o,t,!0))&&(delete this[o],r=!0)}return r}normalize(t){let n=this,i={};return iB.forEach(this,(r,o)=>{let a=iB.findKey(i,o);if(a){n[a]=rn(r),delete n[o];return}let s=t?o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,i)=>n.toUpperCase()+i):String(o).trim();s!==o&&delete n[o],n[s]=rn(r),i[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let n=Object.create(null);return iB.forEach(this,(i,r)=>{null!=i&&!1!==i&&(n[r]=t&&iB.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){let i=new this(t);return n.forEach(t=>i.set(t)),i}static accessor(t){let n=(this[re]=this[re]={accessors:{}}).accessors,i=this.prototype;function r(t){let r=rt(t);if(!n[r]){let o;o=iB.toCamelCase(" "+t),["get","set","has"].forEach(n=>{Object.defineProperty(i,n+o,{value:function(i,r,o){return this[n].call(this,t,i,r,o)},configurable:!0})}),n[r]=!0}}return iB.isArray(t)?t.forEach(r):r(t),this}}function ro(t,n){let i=this||i7,r=n||i,o=rr.from(r.headers),a=r.data;return iB.forEach(t,function(t){a=t.call(i,a,o.normalize(),n?n.status:void 0)}),o.normalize(),a}function ra(t){return!!(t&&t.__CANCEL__)}rr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),iB.reduceDescriptors(rr.prototype,({value:t},n)=>{let i=n[0].toUpperCase()+n.slice(1);return{get:()=>t,set(t){this[i]=t}}}),iB.freezeMethods(rr);let rs=class extends iY{constructor(t,n,i){super(null==t?"canceled":t,iY.ERR_CANCELED,n,i),this.name="CanceledError",this.__CANCEL__=!0}};function rl(t,n,i){let r=i.config.validateStatus;!i.status||!r||r(i.status)?t(i):n(new iY("Request failed with status code "+i.status,[iY.ERR_BAD_REQUEST,iY.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}let rc=function(t,n){let i,r=Array(t=t||10),o=Array(t),a=0,s=0;return n=void 0!==n?n:1e3,function(l){let c=Date.now(),d=o[s];i||(i=c),r[a]=l,o[a]=c;let u=s,m=0;for(;u!==a;)m+=r[u++],u%=t;if((a=(a+1)%t)===s&&(s=(s+1)%t),c-i<n)return;let h=d&&c-d;return h?Math.round(1e3*m/h):void 0}},rd=function(t,n){let i,r,o=0,a=1e3/n,s=(n,a=Date.now())=>{o=a,i=null,r&&(clearTimeout(r),r=null),t(...n)};return[(...t)=>{let n=Date.now(),l=n-o;l>=a?s(t,n):(i=t,r||(r=setTimeout(()=>{r=null,s(i)},a-l)))},()=>i&&s(i)]},ru=(t,n,i=3)=>{let r=0,o=rc(50,250);return rd(i=>{let a=i.loaded,s=i.lengthComputable?i.total:void 0,l=a-r,c=o(l);r=a,t({loaded:a,total:s,progress:s?a/s:void 0,bytes:l,rate:c||void 0,estimated:c&&s&&a<=s?(s-a)/c:void 0,event:i,lengthComputable:null!=s,[n?"download":"upload"]:!0})},i)},rm=(t,n)=>{let i=null!=t;return[r=>n[0]({lengthComputable:i,total:t,loaded:r}),n[1]]},rh=t=>(...n)=>iB.asap(()=>t(...n)),rp=i6.hasStandardBrowserEnv?(r=new URL(i6.origin),s=i6.navigator&&/(msie|trident)/i.test(i6.navigator.userAgent),t=>(t=new URL(t,i6.origin),r.protocol===t.protocol&&r.host===t.host&&(s||r.port===t.port))):()=>!0,rf=i6.hasStandardBrowserEnv?{write(t,n,i,r,o,a,s){if("u"<typeof document)return;let l=[`${t}=${encodeURIComponent(n)}`];iB.isNumber(i)&&l.push(`expires=${new Date(i).toUTCString()}`),iB.isString(r)&&l.push(`path=${r}`),iB.isString(o)&&l.push(`domain=${o}`),!0===a&&l.push("secure"),iB.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(t){if("u"<typeof document)return null;let n=document.cookie.match(RegExp("(?:^|; )"+t+"=([^;]*)"));return n?decodeURIComponent(n[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}};function rb(t,n,i){let r=!("string"==typeof n&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n));return t&&(r||!1==i)?n?t.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):t:n}let rg=t=>t instanceof rr?{...t}:t;function r_(t,n){n=n||{};let i={};function r(t,n,i,r){return iB.isPlainObject(t)&&iB.isPlainObject(n)?iB.merge.call({caseless:r},t,n):iB.isPlainObject(n)?iB.merge({},n):iB.isArray(n)?n.slice():n}function o(t,n,i,o){return iB.isUndefined(n)?iB.isUndefined(t)?void 0:r(void 0,t,i,o):r(t,n,i,o)}function a(t,n){if(!iB.isUndefined(n))return r(void 0,n)}function s(t,n){return iB.isUndefined(n)?iB.isUndefined(t)?void 0:r(void 0,t):r(void 0,n)}function l(i,o,a){return a in n?r(i,o):a in t?r(void 0,i):void 0}let c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(t,n,i)=>o(rg(t),rg(n),i,!0)};return iB.forEach(Object.keys({...t,...n}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;let a=iB.hasOwnProp(c,r)?c[r]:o,s=a(t[r],n[r],r);iB.isUndefined(s)&&a!==l||(i[r]=s)}),i}let ry=t=>{let n=r_({},t),{data:i,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:a,headers:s,auth:l}=n;if(n.headers=s=rr.from(s),n.url=iX(rb(n.baseURL,n.url,n.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),iB.isFormData(i)){if(i6.hasStandardBrowserEnv||i6.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(iB.isFunction(i.getHeaders)){let t=i.getHeaders(),n=["content-type","content-length"];Object.entries(t).forEach(([t,i])=>{n.includes(t.toLowerCase())&&s.set(t,i)})}}if(i6.hasStandardBrowserEnv&&(r&&iB.isFunction(r)&&(r=r(n)),r||!1!==r&&rp(n.url))){let t=o&&a&&rf.read(a);t&&s.set(o,t)}return n},rv="u">typeof XMLHttpRequest&&function(t){return new Promise(function(n,i){var r;let o,a,s,l,c,d,u=ry(t),m=u.data,h=rr.from(u.headers).normalize(),{responseType:p,onUploadProgress:f,onDownloadProgress:b}=u;function g(){l&&l(),c&&c(),u.cancelToken&&u.cancelToken.unsubscribe(o),u.signal&&u.signal.removeEventListener("abort",o)}let _=new XMLHttpRequest;function y(){if(!_)return;let r=rr.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders());rl(function(t){n(t),g()},function(t){i(t),g()},{data:p&&"text"!==p&&"json"!==p?_.response:_.responseText,status:_.status,statusText:_.statusText,headers:r,config:t,request:_}),_=null}_.open(u.method.toUpperCase(),u.url,!0),_.timeout=u.timeout,"onloadend"in _?_.onloadend=y:_.onreadystatechange=function(){!_||4!==_.readyState||(0!==_.status||_.responseURL&&0===_.responseURL.indexOf("file:"))&&setTimeout(y)},_.onabort=function(){_&&(i(new iY("Request aborted",iY.ECONNABORTED,t,_)),_=null)},_.onerror=function(n){let r=new iY(n&&n.message?n.message:"Network Error",iY.ERR_NETWORK,t,_);r.event=n||null,i(r),_=null},_.ontimeout=function(){let n=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded",r=u.transitional||iK;u.timeoutErrorMessage&&(n=u.timeoutErrorMessage),i(new iY(n,r.clarifyTimeoutError?iY.ETIMEDOUT:iY.ECONNABORTED,t,_)),_=null},void 0===m&&h.setContentType(null),"setRequestHeader"in _&&iB.forEach(h.toJSON(),function(t,n){_.setRequestHeader(n,t)}),iB.isUndefined(u.withCredentials)||(_.withCredentials=!!u.withCredentials),p&&"json"!==p&&(_.responseType=u.responseType),b&&([s,c]=ru(b,!0),_.addEventListener("progress",s)),f&&_.upload&&([a,l]=ru(f),_.upload.addEventListener("progress",a),_.upload.addEventListener("loadend",l)),(u.cancelToken||u.signal)&&(o=n=>{_&&(i(!n||n.type?new rs(null,t,_):n),_.abort(),_=null)},u.cancelToken&&u.cancelToken.subscribe(o),u.signal&&(u.signal.aborted?o():u.signal.addEventListener("abort",o)));let v=(r=u.url,(d=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r))&&d[1]||"");v&&-1===i6.protocols.indexOf(v)?i(new iY("Unsupported protocol "+v+":",iY.ERR_BAD_REQUEST,t)):_.send(m||null)})},rx=function*(t,n){let i,r=t.byteLength;if(!n||r<n)return void(yield t);let o=0;for(;o<r;)i=o+n,yield t.slice(o,i),o=i},rw=async function*(t,n){for await(let i of rF(t))yield*rx(i,n)},rF=async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);let n=t.getReader();try{for(;;){let{done:t,value:i}=await n.read();if(t)break;yield i}}finally{await n.cancel()}},rk=(t,n,i,r)=>{let o,a=rw(t,n),s=0,l=t=>{!o&&(o=!0,r&&r(t))};return new ReadableStream({async pull(t){try{let{done:n,value:r}=await a.next();if(n){l(),t.close();return}let o=r.byteLength;if(i){let t=s+=o;i(t)}t.enqueue(new Uint8Array(r))}catch(t){throw l(t),t}},cancel:t=>(l(t),a.return())},{highWaterMark:2})},{isFunction:rE}=iB,rT=(({Request:t,Response:n})=>({Request:t,Response:n}))(iB.global),{ReadableStream:rM,TextEncoder:rA}=iB.global,rC=(t,...n)=>{try{return!!t(...n)}catch(t){return!1}},rS=t=>{let n,{fetch:i,Request:r,Response:o}=t=iB.merge.call({skipUndefined:!0},rT,t),a=i?rE(i):"function"==typeof fetch,s=rE(r),l=rE(o);if(!a)return!1;let c=a&&rE(rM),d=a&&("function"==typeof rA?(n=new rA,t=>n.encode(t)):async t=>new Uint8Array(await new r(t).arrayBuffer())),u=s&&c&&rC(()=>{let t=!1,n=new r(i6.origin,{body:new rM,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!n}),m=l&&c&&rC(()=>iB.isReadableStream(new o("").body)),h={stream:m&&(t=>t.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(t=>{h[t]||(h[t]=(n,i)=>{let r=n&&n[t];if(r)return r.call(n);throw new iY(`Response type '${t}' is not supported`,iY.ERR_NOT_SUPPORT,i)})});let p=async t=>{if(null==t)return 0;if(iB.isBlob(t))return t.size;if(iB.isSpecCompliantForm(t)){let n=new r(i6.origin,{method:"POST",body:t});return(await n.arrayBuffer()).byteLength}return iB.isArrayBufferView(t)||iB.isArrayBuffer(t)?t.byteLength:(iB.isURLSearchParams(t)&&(t+=""),iB.isString(t))?(await d(t)).byteLength:void 0},f=async(t,n)=>{let i=iB.toFiniteNumber(t.getContentLength());return null==i?p(n):i};return async t=>{let n,{url:a,method:l,data:c,signal:d,cancelToken:p,timeout:b,onDownloadProgress:g,onUploadProgress:_,responseType:y,headers:v,withCredentials:x="same-origin",fetchOptions:w}=ry(t),F=i||fetch;y=y?(y+"").toLowerCase():"text";let k=((t,n)=>{let{length:i}=t=t?t.filter(Boolean):[];if(n||i){let i,r=new AbortController,o=function(t){if(!i){i=!0,s();let n=t instanceof Error?t:this.reason;r.abort(n instanceof iY?n:new rs(n instanceof Error?n.message:n))}},a=n&&setTimeout(()=>{a=null,o(new iY(`timeout of ${n}ms exceeded`,iY.ETIMEDOUT))},n),s=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)}),t=null)};t.forEach(t=>t.addEventListener("abort",o));let{signal:l}=r;return l.unsubscribe=()=>iB.asap(s),l}})([d,p&&p.toAbortSignal()],b),E=null,T=k&&k.unsubscribe&&(()=>{k.unsubscribe()});try{if(_&&u&&"get"!==l&&"head"!==l&&0!==(n=await f(v,c))){let t,i=new r(a,{method:"POST",body:c,duplex:"half"});if(iB.isFormData(c)&&(t=i.headers.get("content-type"))&&v.setContentType(t),i.body){let[t,r]=rm(n,ru(rh(_)));c=rk(i.body,65536,t,r)}}iB.isString(x)||(x=x?"include":"omit");let i=s&&"credentials"in r.prototype,d={...w,signal:k,method:l.toUpperCase(),headers:v.normalize().toJSON(),body:c,duplex:"half",credentials:i?x:void 0};E=s&&new r(a,d);let p=await (s?F(E,w):F(a,d)),b=m&&("stream"===y||"response"===y);if(m&&(g||b&&T)){let t={};["status","statusText","headers"].forEach(n=>{t[n]=p[n]});let n=iB.toFiniteNumber(p.headers.get("content-length")),[i,r]=g&&rm(n,ru(rh(g),!0))||[];p=new o(rk(p.body,65536,i,()=>{r&&r(),T&&T()}),t)}y=y||"text";let M=await h[iB.findKey(h,y)||"text"](p,t);return!b&&T&&T(),await new Promise((n,i)=>{rl(n,i,{data:M,headers:rr.from(p.headers),status:p.status,statusText:p.statusText,config:t,request:E})})}catch(n){if(T&&T(),n&&"TypeError"===n.name&&/Load failed|fetch/i.test(n.message))throw Object.assign(new iY("Network Error",iY.ERR_NETWORK,t,E,n&&n.response),{cause:n.cause||n});throw iY.from(n,n&&n.code,t,E,n&&n.response)}}},rD=new Map,rL=t=>{let n=t&&t.env||{},{fetch:i,Request:r,Response:o}=n,a=[r,o,i],s=a.length,l,c,d=rD;for(;s--;)l=a[s],void 0===(c=d.get(l))&&d.set(l,c=s?new Map:rS(n)),d=c;return c};rL();let rI={http:null,xhr:rv,fetch:{get:rL}};iB.forEach(rI,(t,n)=>{if(t){try{Object.defineProperty(t,"name",{value:n})}catch(t){}Object.defineProperty(t,"adapterName",{value:n})}});let rP=t=>`- ${t}`,rO=t=>iB.isFunction(t)||null===t||!1===t,rR=function(t,n){let i,r,{length:o}=t=iB.isArray(t)?t:[t],a={};for(let s=0;s<o;s++){let o;if(r=i=t[s],!rO(i)&&void 0===(r=rI[(o=String(i)).toLowerCase()]))throw new iY(`Unknown adapter '${o}'`);if(r&&(iB.isFunction(r)||(r=r.get(n))))break;a[o||"#"+s]=r}if(!r){let t=Object.entries(a).map(([t,n])=>`adapter ${t} `+(!1===n?"is not supported by the environment":"is not available in the build"));throw new iY("There is no suitable adapter to dispatch the request "+(o?t.length>1?"since :\n"+t.map(rP).join("\n"):" "+rP(t[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function rB(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new rs(null,t)}function rz(t){return rB(t),t.headers=rr.from(t.headers),t.data=ro.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),rR(t.adapter||i7.adapter,t)(t).then(function(n){return rB(t),n.data=ro.call(t,t.transformResponse,n),n.headers=rr.from(n.headers),n},function(n){return!ra(n)&&(rB(t),n&&n.response&&(n.response.data=ro.call(t,t.transformResponse,n.response),n.response.headers=rr.from(n.response.headers))),Promise.reject(n)})}let rY={};["object","boolean","number","function","string","symbol"].forEach((t,n)=>{rY[t]=function(i){return typeof i===t||"a"+(n<1?"n ":" ")+t}});let rN={};rY.transitional=function(t,n,i){function r(t,n){return"[Axios v1.13.6] Transitional option '"+t+"'"+n+(i?". "+i:"")}return(i,o,a)=>{if(!1===t)throw new iY(r(o," has been removed"+(n?" in "+n:"")),iY.ERR_DEPRECATED);return n&&!rN[o]&&(rN[o]=!0,console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))),!t||t(i,o,a)}},rY.spelling=function(t){return(n,i)=>(console.warn(`${i} is likely a misspelling of ${t}`),!0)};let rj=function(t,n,i){if("object"!=typeof t)throw new iY("options must be an object",iY.ERR_BAD_OPTION_VALUE);let r=Object.keys(t),o=r.length;for(;o-- >0;){let a=r[o],s=n[a];if(s){let n=t[a],i=void 0===n||s(n,a,t);if(!0!==i)throw new iY("option "+a+" must be "+i,iY.ERR_BAD_OPTION_VALUE);continue}if(!0!==i)throw new iY("Unknown option "+a,iY.ERR_BAD_OPTION)}};class rH{constructor(t){this.defaults=t||{},this.interceptors={request:new iZ,response:new iZ}}async request(t,n){try{return await this._request(t,n)}catch(t){if(t instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=Error();let i=n.stack?n.stack.replace(/^.+\n/,""):"";try{t.stack?i&&!String(t.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+i):t.stack=i}catch(t){}}throw t}}_request(t,n){let i,r;"string"==typeof t?(n=n||{}).url=t:n=t||{};let{transitional:o,paramsSerializer:a,headers:s}=n=r_(this.defaults,n);void 0!==o&&rj(o,{silentJSONParsing:rY.transitional(rY.boolean),forcedJSONParsing:rY.transitional(rY.boolean),clarifyTimeoutError:rY.transitional(rY.boolean),legacyInterceptorReqResOrdering:rY.transitional(rY.boolean)},!1),null!=a&&(iB.isFunction(a)?n.paramsSerializer={serialize:a}:rj(a,{encode:rY.function,serialize:rY.function},!0)),void 0!==n.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),rj(n,{baseUrl:rY.spelling("baseURL"),withXsrfToken:rY.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=s&&iB.merge(s.common,s[n.method]);s&&iB.forEach(["delete","get","head","post","put","patch","common"],t=>{delete s[t]}),n.headers=rr.concat(l,s);let c=[],d=!0;this.interceptors.request.forEach(function(t){if("function"==typeof t.runWhen&&!1===t.runWhen(n))return;d=d&&t.synchronous;let i=n.transitional||iK;i&&i.legacyInterceptorReqResOrdering?c.unshift(t.fulfilled,t.rejected):c.push(t.fulfilled,t.rejected)});let u=[];this.interceptors.response.forEach(function(t){u.push(t.fulfilled,t.rejected)});let m=0;if(!d){let t=[rz.bind(this),void 0];for(t.unshift(...c),t.push(...u),r=t.length,i=Promise.resolve(n);m<r;)i=i.then(t[m++],t[m++]);return i}r=c.length;let h=n;for(;m<r;){let t=c[m++],n=c[m++];try{h=t(h)}catch(t){n.call(this,t);break}}try{i=rz.call(this,h)}catch(t){return Promise.reject(t)}for(m=0,r=u.length;m<r;)i=i.then(u[m++],u[m++]);return i}getUri(t){return iX(rb((t=r_(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}}iB.forEach(["delete","get","head","options"],function(t){rH.prototype[t]=function(n,i){return this.request(r_(i||{},{method:t,url:n,data:(i||{}).data}))}}),iB.forEach(["post","put","patch"],function(t){function n(n){return function(i,r,o){return this.request(r_(o||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:r}))}}rH.prototype[t]=n(),rH.prototype[t+"Form"]=n(!0)});class rU{constructor(t){let n;if("function"!=typeof t)throw TypeError("executor must be a function.");this.promise=new Promise(function(t){n=t});const i=this;this.promise.then(t=>{if(!i._listeners)return;let n=i._listeners.length;for(;n-- >0;)i._listeners[n](t);i._listeners=null}),this.promise.then=t=>{let n,r=new Promise(t=>{i.subscribe(t),n=t}).then(t);return r.cancel=function(){i.unsubscribe(n)},r},t(function(t,r,o){i.reason||(i.reason=new rs(t,r,o),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let n=this._listeners.indexOf(t);-1!==n&&this._listeners.splice(n,1)}toAbortSignal(){let t=new AbortController,n=n=>{t.abort(n)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new rU(function(n){t=n}),cancel:t}}}let rV={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(rV).forEach(([t,n])=>{rV[n]=t});let rq=function t(n){let i=new rH(n),r=n4(rH.prototype.request,i);return iB.extend(r,rH.prototype,i,{allOwnKeys:!0}),iB.extend(r,i,null,{allOwnKeys:!0}),r.create=function(i){return t(r_(n,i))},r}(i7);rq.Axios=rH,rq.CanceledError=rs,rq.CancelToken=rU,rq.isCancel=ra,rq.VERSION="1.13.6",rq.toFormData=iV,rq.AxiosError=iY,rq.Cancel=rq.CanceledError,rq.all=function(t){return Promise.all(t)},rq.spread=function(t){return function(n){return t.apply(null,n)}},rq.isAxiosError=function(t){return iB.isObject(t)&&!0===t.isAxiosError},rq.mergeConfig=r_,rq.AxiosHeaders=rr,rq.formToJSON=t=>i8(iB.isHTMLForm(t)?new FormData(t):t),rq.getAdapter=rR,rq.HttpStatusCode=rV,rq.default=rq;class rG{constructor(t){this.httpClient=t}register(t,n){return this.httpClient.request({method:"POST",url:or`console/register`,data:t,options:n})}}class r${constructor(t){this.httpClient=t}getSettings(t){return this.httpClient.request({method:"GET",url:or`map`,options:t})}saveSettings(t,n){return this.httpClient.request({method:"PUT",url:or`map`,data:t,options:n})}deleteMap(t){return this.httpClient.request({method:"DELETE",url:or`map/deleteMap`,options:t})}getCustomMapInfo(t){return this.httpClient.request({method:"GET",url:or`map/getCustomMapInfo`,options:t})}getTile(t,n,i,r){return this.httpClient.request({method:"GET",url:or`map/tile/${t}/${n}/${i}`,options:r})}uploadMap(t,n){return this.httpClient.request({method:"POST",url:or`map/upload`,queryParams:t,options:n})}}class rW{constructor(t){this.httpClient=t}create(t,n){return this.httpClient.request({method:"POST",url:or`dashboard`,data:t,options:n})}update(t,n){return this.httpClient.request({method:"PUT",url:or`dashboard`,data:t,options:n})}getAllRealmDashboards(t,n){return this.httpClient.request({method:"GET",url:or`dashboard/all/${t}`,options:n})}query(t,n){return this.httpClient.request({method:"POST",url:or`dashboard/query`,data:t,options:n})}delete(t,n,i){return this.httpClient.request({method:"DELETE",url:or`dashboard/${t}/${n}`,options:i})}get(t,n,i){return this.httpClient.request({method:"GET",url:or`dashboard/${t}/${n}`,options:i})}}class rX{constructor(t){this.httpClient=t}getHealthStatus(t){return this.httpClient.request({method:"GET",url:or`health`,options:t})}getInfo(t){return this.httpClient.request({method:"GET",url:or`info`,options:t})}}class rZ{constructor(t){this.httpClient=t}doProtocolAssetDiscovery(t,n,i){return this.httpClient.request({method:"GET",url:or`agent/assetDiscovery/${t}`,queryParams:n,options:i})}doProtocolAssetImport(t,n,i,r){return this.httpClient.request({method:"POST",url:or`agent/assetImport/${t}`,queryParams:i,data:n,options:r})}doProtocolInstanceDiscovery(t,n,i){return this.httpClient.request({method:"GET",url:or`agent/instanceDiscovery/${t}`,queryParams:n,options:i})}}class rK{constructor(t){this.httpClient=t}createGlobalRuleset(t,n){return this.httpClient.request({method:"POST",url:or`rules`,data:t,options:n})}getGlobalRulesets(t,n){return this.httpClient.request({method:"GET",url:or`rules`,queryParams:t,options:n})}createAssetRuleset(t,n){return this.httpClient.request({method:"POST",url:or`rules/asset`,data:t,options:n})}getAssetRulesets(t,n,i){return this.httpClient.request({method:"GET",url:or`rules/asset/for/${t}`,queryParams:n,options:i})}deleteAssetRuleset(t,n){return this.httpClient.request({method:"DELETE",url:or`rules/asset/${t}`,options:n})}getAssetRuleset(t,n){return this.httpClient.request({method:"GET",url:or`rules/asset/${t}`,options:n})}updateAssetRuleset(t,n,i){return this.httpClient.request({method:"PUT",url:or`rules/asset/${t}`,data:n,options:i})}getAssetGeofences(t,n){return this.httpClient.request({method:"GET",url:or`rules/geofences/${t}`,options:n})}getAssetEngineInfo(t,n){return this.httpClient.request({method:"GET",url:or`rules/info/asset/${t}`,options:n})}getGlobalEngineInfo(t){return this.httpClient.request({method:"GET",url:or`rules/info/global`,options:t})}getRealmEngineInfo(t,n){return this.httpClient.request({method:"GET",url:or`rules/info/realm/${t}`,options:n})}createRealmRuleset(t,n){return this.httpClient.request({method:"POST",url:or`rules/realm`,data:t,options:n})}getRealmRulesets(t,n,i){return this.httpClient.request({method:"GET",url:or`rules/realm/for/${t}`,queryParams:n,options:i})}deleteRealmRuleset(t,n){return this.httpClient.request({method:"DELETE",url:or`rules/realm/${t}`,options:n})}getRealmRuleset(t,n){return this.httpClient.request({method:"GET",url:or`rules/realm/${t}`,options:n})}updateRealmRuleset(t,n,i){return this.httpClient.request({method:"PUT",url:or`rules/realm/${t}`,data:n,options:i})}deleteGlobalRuleset(t,n){return this.httpClient.request({method:"DELETE",url:or`rules/${t}`,options:n})}getGlobalRuleset(t,n){return this.httpClient.request({method:"GET",url:or`rules/${t}`,options:n})}updateGlobalRuleset(t,n,i){return this.httpClient.request({method:"PUT",url:or`rules/${t}`,data:n,options:i})}}class rJ{constructor(t){this.httpClient=t}getNotifications(t,n){return this.httpClient.request({method:"GET",url:or`notification`,queryParams:t,options:n})}removeNotifications(t,n){return this.httpClient.request({method:"DELETE",url:or`notification`,queryParams:t,options:n})}sendNotification(t,n){return this.httpClient.request({method:"POST",url:or`notification/alert`,data:t,options:n})}removeNotification(t,n){return this.httpClient.request({method:"DELETE",url:or`notification/${t}`,options:n})}notificationAcknowledged(t,n,i,r){return this.httpClient.request({method:"PUT",url:or`notification/${t}/acknowledged`,queryParams:i,data:n,options:r})}notificationDelivered(t,n,i){return this.httpClient.request({method:"PUT",url:or`notification/${t}/delivered`,queryParams:n,options:i})}}class rQ{constructor(t){this.httpClient=t}getPredictedDatapoints(t,n,i,r){return this.httpClient.request({method:"POST",url:or`asset/predicted/${t}/${n}`,data:i,options:r})}writePredictedDatapoints(t,n,i,r){return this.httpClient.request({method:"PUT",url:or`asset/predicted/${t}/${n}`,data:i,options:r})}}class r0{constructor(t){this.httpClient=t}createAlarm(t,n,i){return this.httpClient.request({method:"POST",url:or`alarm`,queryParams:n,data:t,options:i})}getAlarms(t,n){return this.httpClient.request({method:"GET",url:or`alarm`,queryParams:t,options:n})}removeAlarms(t,n){return this.httpClient.request({method:"DELETE",url:or`alarm`,data:t,options:n})}setAssetLinks(t,n){return this.httpClient.request({method:"PUT",url:or`alarm/assets`,data:t,options:n})}getAlarm(t,n){return this.httpClient.request({method:"GET",url:or`alarm/${t}`,options:n})}removeAlarm(t,n){return this.httpClient.request({method:"DELETE",url:or`alarm/${t}`,options:n})}updateAlarm(t,n,i){return this.httpClient.request({method:"PUT",url:or`alarm/${t}`,data:n,options:i})}getAssetLinks(t,n,i){return this.httpClient.request({method:"GET",url:or`alarm/${t}/assets`,queryParams:n,options:i})}}class r1{constructor(t){this.httpClient=t}deleteConnections(t,n){return this.httpClient.request({method:"DELETE",url:or`gateway/connection`,queryParams:t,options:n})}getConnections(t){return this.httpClient.request({method:"GET",url:or`gateway/connection`,options:t})}deleteConnection(t,n){return this.httpClient.request({method:"DELETE",url:or`gateway/connection/${t}`,options:n})}getConnection(t,n){return this.httpClient.request({method:"GET",url:or`gateway/connection/${t}`,options:n})}setConnection(t,n,i){return this.httpClient.request({method:"PUT",url:or`gateway/connection/${t}`,data:n,options:i})}getConnectionStatus(t,n){return this.httpClient.request({method:"GET",url:or`gateway/status/${t}`,options:n})}}class r2{constructor(t){this.httpClient=t}getConfig(t){return this.httpClient.request({method:"GET",url:or`syslog/config`,options:t})}updateConfig(t,n){return this.httpClient.request({method:"PUT",url:or`syslog/config`,data:t,options:n})}clearEvents(t){return this.httpClient.request({method:"DELETE",url:or`syslog/event`,options:t})}getEvents(t,n){return this.httpClient.request({method:"GET",url:or`syslog/event`,queryParams:t,options:n})}}class r5{constructor(t){this.httpClient=t}create(t,n){return this.httpClient.request({method:"POST",url:or`realm`,data:t,options:n})}getAll(t){return this.httpClient.request({method:"GET",url:or`realm`,options:t})}getAccessible(t){return this.httpClient.request({method:"GET",url:or`realm/accessible`,options:t})}delete(t,n){return this.httpClient.request({method:"DELETE",url:or`realm/${t}`,options:n})}get(t,n){return this.httpClient.request({method:"GET",url:or`realm/${t}`,options:n})}update(t,n,i){return this.httpClient.request({method:"PUT",url:or`realm/${t}`,data:n,options:i})}}class r3{constructor(t){this.httpClient=t}getAllNodeDefinitions(t){return this.httpClient.request({method:"GET",url:or`flow`,options:t})}getNodeDefinition(t,n){return this.httpClient.request({method:"GET",url:or`flow/${t}`,options:n})}getAllNodeDefinitionsByType(t,n){return this.httpClient.request({method:"GET",url:or`flow/${t}`,options:n})}}class r4{constructor(t){this.httpClient=t}getDatapointExport(t,n){return this.httpClient.request({method:"GET",url:or`asset/datapoint/export`,queryParams:t,options:n})}getDatapointPeriod(t,n){return this.httpClient.request({method:"GET",url:or`asset/datapoint/periods`,queryParams:t,options:n})}getDatapoints(t,n,i,r){return this.httpClient.request({method:"POST",url:or`asset/datapoint/${t}/${n}`,data:i,options:r})}}class r6{constructor(t){this.httpClient=t}getServices(t,n){return this.httpClient.request({method:"GET",url:or`service`,queryParams:t,options:n})}registerService(t,n){return this.httpClient.request({method:"POST",url:or`service`,data:t,options:n})}getGlobalServices(t){return this.httpClient.request({method:"GET",url:or`service/global`,options:t})}registerGlobalService(t,n){return this.httpClient.request({method:"POST",url:or`service/global`,data:t,options:n})}deregisterService(t,n,i){return this.httpClient.request({method:"DELETE",url:or`service/${t}/${n}`,options:i})}getService(t,n,i){return this.httpClient.request({method:"GET",url:or`service/${t}/${n}`,options:i})}heartbeat(t,n,i){return this.httpClient.request({method:"PUT",url:or`service/${t}/${n}`,options:i})}}class r8{constructor(t){this.httpClient=t}create(t,n){return this.httpClient.request({method:"POST",url:or`asset`,data:t,options:n})}delete(t,n){return this.httpClient.request({method:"DELETE",url:or`asset`,queryParams:t,options:n})}writeAttributeValues(t,n){return this.httpClient.request({method:"PUT",url:or`asset/attributes`,data:t,options:n})}writeAttributeEvents(t,n){return this.httpClient.request({method:"PUT",url:or`asset/attributes/timestamp`,data:t,options:n})}queryCount(t,n){return this.httpClient.request({method:"POST",url:or`asset/count`,data:t,options:n})}updateNoneParent(t,n){return this.httpClient.request({method:"DELETE",url:or`asset/parent`,queryParams:t,options:n})}getPartial(t,n){return this.httpClient.request({method:"GET",url:or`asset/partial/${t}`,options:n})}queryAssets(t,n){return this.httpClient.request({method:"POST",url:or`asset/query`,data:t,options:n})}queryAssetTree(t,n){return this.httpClient.request({method:"POST",url:or`asset/tree`,data:t,options:n})}getCurrentUserAssets(t){return this.httpClient.request({method:"GET",url:or`asset/user/current`,options:t})}createUserAssetLinks(t,n){return this.httpClient.request({method:"POST",url:or`asset/user/link`,data:t,options:n})}getUserAssetLinks(t,n){return this.httpClient.request({method:"GET",url:or`asset/user/link`,queryParams:t,options:n})}deleteUserAssetLinks(t,n){return this.httpClient.request({method:"POST",url:or`asset/user/link/delete`,data:t,options:n})}deleteAllUserAssetLinks(t,n,i){return this.httpClient.request({method:"DELETE",url:or`asset/user/link/${t}/${n}`,options:i})}deleteUserAssetLink(t,n,i,r){return this.httpClient.request({method:"DELETE",url:or`asset/user/link/${t}/${n}/${i}`,options:r})}get(t,n){return this.httpClient.request({method:"GET",url:or`asset/${t}`,options:n})}update(t,n,i){return this.httpClient.request({method:"PUT",url:or`asset/${t}`,data:n,options:i})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(t,n,i,r){return this.httpClient.request({method:"PUT",url:or`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:or`asset/${t}/attribute/${n}/${i}`,data:r,options:o})}updateParent(t,n,i){return this.httpClient.request({method:"PUT",url:or`asset/${t}/child`,queryParams:n,options:i})}}class r7{constructor(t){this.httpClient=t}updateCurrentUserLocale(t,n){return this.httpClient.request({method:"PUT",url:or`user/locale`,data:t,options:n})}query(t,n){return this.httpClient.request({method:"POST",url:or`user/query`,data:t,options:n})}requestPasswordResetCurrent(t){return this.httpClient.request({method:"PUT",url:or`user/request-password-reset`,options:t})}updatePasswordCurrent(t,n){return this.httpClient.request({method:"PUT",url:or`user/reset-password`,data:t,options:n})}updateCurrent(t,n){return this.httpClient.request({method:"PUT",url:or`user/update`,data:t,options:n})}getCurrent(t){return this.httpClient.request({method:"GET",url:or`user/user`,options:t})}getCurrentUserRealmRoles(t){return this.httpClient.request({method:"GET",url:or`user/userRealmRoles`,options:t})}getCurrentUserClientRoles(t,n){return this.httpClient.request({method:"GET",url:or`user/userRoles/${t}`,options:n})}disconnectUserSession(t,n,i){return this.httpClient.request({method:"GET",url:or`user/${t}/disconnect/${n}`,options:i})}requestPasswordReset(t,n,i){return this.httpClient.request({method:"PUT",url:or`user/${t}/request-password-reset/${n}`,options:i})}updatePassword(t,n,i,r){return this.httpClient.request({method:"PUT",url:or`user/${t}/reset-password/${n}`,data:i,options:r})}resetSecret(t,n,i){return this.httpClient.request({method:"GET",url:or`user/${t}/reset-secret/${n}`,options:i})}updateRoles(t,n,i){return this.httpClient.request({method:"PUT",url:or`user/${t}/roles`,data:n,options:i})}getUserRealmRoles(t,n,i){return this.httpClient.request({method:"GET",url:or`user/${t}/userRealmRoles/${n}`,options:i})}updateUserRealmRoles(t,n,i,r){return this.httpClient.request({method:"PUT",url:or`user/${t}/userRealmRoles/${n}`,data:i,options:r})}getUserClientRoles(t,n,i,r){return this.httpClient.request({method:"GET",url:or`user/${t}/userRoles/${n}/${i}`,options:r})}updateUserClientRoles(t,n,i,r,o){return this.httpClient.request({method:"PUT",url:or`user/${t}/userRoles/${n}/${i}`,data:r,options:o})}getUserSessions(t,n,i){return this.httpClient.request({method:"GET",url:or`user/${t}/userSessions/${n}`,options:i})}create(t,n,i){return this.httpClient.request({method:"POST",url:or`user/${t}/users`,data:n,options:i})}update(t,n,i){return this.httpClient.request({method:"PUT",url:or`user/${t}/users`,data:n,options:i})}delete(t,n,i){return this.httpClient.request({method:"DELETE",url:or`user/${t}/users/${n}`,options:i})}getClientRoles(t,n,i){return this.httpClient.request({method:"GET",url:or`user/${t}/${n}/roles`,options:i})}updateClientRoles(t,n,i,r){return this.httpClient.request({method:"PUT",url:or`user/${t}/${n}/roles`,data:i,options:r})}get(t,n,i){return this.httpClient.request({method:"GET",url:or`user/${t}/${n}`,options:i})}}class r9{constructor(t){this.httpClient=t}getAssetDescriptors(t,n){return this.httpClient.request({method:"GET",url:or`model/assetDescriptors`,queryParams:t,options:n})}getAssetInfo(t,n,i){return this.httpClient.request({method:"GET",url:or`model/assetInfo/${t}`,queryParams:n,options:i})}getAssetInfos(t,n){return this.httpClient.request({method:"GET",url:or`model/assetInfos`,queryParams:t,options:n})}getValueDescriptorSchema(t,n){return this.httpClient.request({method:"GET",url:or`model/getValueDescriptorSchema`,queryParams:t,options:n})}getMetaItemDescriptors(t,n){return this.httpClient.request({method:"GET",url:or`model/metaItemDescriptors`,queryParams:t,options:n})}getValueDescriptors(t,n){return this.httpClient.request({method:"GET",url:or`model/valueDescriptors`,queryParams:t,options:n})}}class oe{constructor(t){this.httpClient=t}getApps(t){return this.httpClient.request({method:"GET",url:or`apps`,options:t})}getConsoleConfig(t){return this.httpClient.request({method:"GET",url:or`apps/consoleConfig`,options:t})}getAppInfos(t){return this.httpClient.request({method:"GET",url:or`apps/info`,options:t})}}class ot{constructor(t){this.httpClient=t}getManagerConfig(t){return this.httpClient.request({method:"GET",url:or`configuration/manager`,options:t})}update(t,n){return this.httpClient.request({method:"PUT",url:or`configuration/manager`,data:t,options:n})}fileUpload(t,n,i){return this.httpClient.request({method:"POST",url:or`configuration/manager/file`,queryParams:n,data:t,options:i})}getManagerConfigImage(t,n){return this.httpClient.request({method:"GET",url:or`configuration/manager/image/${t}`,options:n})}}class on{constructor(t){this.httpClient=t}createProvisioningConfig(t,n){return this.httpClient.request({method:"POST",url:or`provisioning`,data:t,options:n})}getProvisioningConfigs(t){return this.httpClient.request({method:"GET",url:or`provisioning`,options:t})}deleteProvisioningConfig(t,n){return this.httpClient.request({method:"DELETE",url:or`provisioning/${t}`,options:n})}updateProvisioningConfig(t,n,i){return this.httpClient.request({method:"PUT",url:or`provisioning/${t}`,data:n,options:i})}}class oi{constructor(t){this.httpClient=t}startTunnel(t,n){return this.httpClient.request({method:"POST",url:or`gateway/tunnel`,data:t,options:n})}stopTunnel(t,n){return this.httpClient.request({method:"DELETE",url:or`gateway/tunnel`,data:t,options:n})}getAllActiveTunnelInfos(t,n){return this.httpClient.request({method:"GET",url:or`gateway/tunnel/${t}`,options:n})}getGatewayActiveTunnelInfos(t,n,i){return this.httpClient.request({method:"GET",url:or`gateway/tunnel/${t}/${n}`,options:i})}getActiveTunnelInfo(t,n,i,r,o){return this.httpClient.request({method:"GET",url:or`gateway/tunnel/${t}/${n}/${i}/${r}`,options:o})}}function or(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 oo{constructor(t,n=rq.create()){this._consoleResource=new os(t,n),this._mapResource=new ol(t,n),this._dashboardResource=new oc(t,n),this._statusResource=new od(t,n),this._agentResource=new ou(t,n),this._rulesResource=new om(t,n),this._notificationResource=new oh(t,n),this._assetPredictedDatapointResource=new op(t,n),this._alarmResource=new of(t,n),this._gatewayClientResource=new ob(t,n),this._syslogResource=new og(t,n),this._realmResource=new o_(t,n),this._flowResource=new oy(t,n),this._assetDatapointResource=new ov(t,n),this._externalServiceResource=new ox(t,n),this._assetResource=new ow(t,n),this._userResource=new oF(t,n),this._assetModelResource=new ok(t,n),this._appResource=new oE(t,n),this._configurationResource=new oT(t,n),this._provisioningResource=new oM(t,n),this._gatewayServiceResource=new oA(t,n),this._assetResource=new ow(t,n)}get ConsoleResource(){return this._consoleResource}get MapResource(){return this._mapResource}get DashboardResource(){return this._dashboardResource}get StatusResource(){return this._statusResource}get AgentResource(){return this._agentResource}get RulesResource(){return this._rulesResource}get NotificationResource(){return this._notificationResource}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get AlarmResource(){return this._alarmResource}get GatewayClientResource(){return this._gatewayClientResource}get SyslogResource(){return this._syslogResource}get RealmResource(){return this._realmResource}get FlowResource(){return this._flowResource}get AssetDatapointResource(){return this._assetDatapointResource}get ExternalServiceResource(){return this._externalServiceResource}get AssetResource(){return this._assetResource}get UserResource(){return this._userResource}get AssetModelResource(){return this._assetModelResource}get AppResource(){return this._appResource}get ConfigurationResource(){return this._configurationResource}get ProvisioningResource(){return this._provisioningResource}get GatewayServiceResource(){return this._gatewayServiceResource}}class oa{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 os extends rG{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class ol extends r${constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class oc extends rW{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class od extends rX{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class ou extends rZ{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class om extends rK{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class oh extends rJ{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class op extends rQ{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class of extends r0{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class ob extends r1{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class og extends r2{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class o_ extends r5{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class oy extends r3{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class ov extends r4{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class ox extends r6{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class ow extends r8{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class oF extends r7{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class ok extends r9{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class oE extends oe{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class oT extends ot{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class oM extends on{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}class oA extends oi{constructor(t,n=rq.create()){n.defaults.baseURL=t,super(new oa(n))}}rq.isAxiosError;let oC=new class{get api(){return this._client}constructor(){this._axiosInstance=rq.create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(t=>(t.paramsSerializer=t=>nU().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 oo(t,this._axiosInstance)}};var oS=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())})};(ey=tM||(tM={})).DISCONNECTED="DISCONNECTED",ey.CONNECTED="CONNECTED",ey.CONNECTING="CONNECTING";let oD="SUBSCRIBED:",oL="UNAUTHORIZED:",oI="TRIGGERED:",oP="EVENT:";class oO{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=oR.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=tM.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===tM.CONNECTED)?Promise.resolve(!0):(this._disconnectRequested=!1,this._connectingDeferred||(this._onStatusChanged(tM.CONNECTING),this._connectingDeferred=new nG,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=oR.MIN_RECONNECT_DELAY,this._onStatusChanged(tM.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!==tM.DISCONNECTED&&this._doDisconnect())}subscribe(t,n){let i={eventSubscription:t,callback:n,deferred:new nG};return null!=this._pendingSubscription||this._status!==tM.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 oS(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===tM.CONNECTED&&this._doSend(t)}sendEventWithReply(t){return this._status!==tM.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(t)}subscribeAssetEvents(t,n,i){return oS(this,void 0,void 0,function*(){let r=t&&"string"!=typeof t[0]?t.map(t=>t.id):t,o="AssetEvent"+oO._subscriptionCounter++;if(!this._assetEventPromise){let t;sx.authenticated||(t={filterType:"asset",realm:sx.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===sx.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 oS(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"+oO._subscriptionCounter++;if(!this._attributeEventPromise){let t;sx.authenticated||(t={filterType:"asset",realm:sx.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===sx.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===tM.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===tM.CONNECTED&&this._onStatusChanged(tM.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(tM.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<oR.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(oR.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}oO.MIN_RECONNECT_DELAY=0,oO.MAX_RECONNECT_DELAY=3e4,oO._subscriptionCounter=0;class oR extends oO{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="+sx.config.realm;return sx.authenticated&&(t+="&Authorization="+sx.getAuthorizationHeader()),this._webSocket=new WebSocket(t),this._connectDeferred=new nG,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(oD)){let t=JSON.parse(n.substring(oD.length)),i=this._subscribeDeferred;this._subscribeDeferred=null,i&&i.resolve(t.subscriptionId)}else if(n.startsWith(oL)){let t=JSON.parse(n.substring(oL.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(oI)){let t=JSON.parse(n.substring(oI.length));t.events&&t.events.forEach(n=>{this._onMessageReceived(t.subscriptionId,n)})}else if(n.startsWith(oP)){let t=JSON.parse(n.substring(oP.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 nG,t.subscriptionId||(t.subscriptionId=oR._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=oP+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 nG;return this._repliesDeferred.set(t.messageID,n),this._webSocket.send(oP+JSON.stringify(t)),n.promise}}function oB(t){return(oB="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)}oR._subscriptionCounter=1;var oz=[],oY=oz.forEach,oN=oz.slice;function oj(t){return oY.call(oN.call(arguments,1),function(n){if(n)for(var i in n)void 0===t[i]&&(t[i]=n[i])}),t}function oH(){return"function"==typeof XMLHttpRequest||("u"<typeof XMLHttpRequest?"undefined":oB(XMLHttpRequest))==="object"}var oU=o(4550),oV=o.t(oU,2);function oq(t){return(oq="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&&(tA="u">typeof global&&global.fetch?global.fetch:"u">typeof window&&window.fetch?window.fetch:fetch),oH()&&("u">typeof global&&global.XMLHttpRequest?tC=global.XMLHttpRequest:"u">typeof window&&window.XMLHttpRequest&&(tC=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&("u">typeof global&&global.ActiveXObject?tS=global.ActiveXObject:"u">typeof window&&window.ActiveXObject&&(tS=window.ActiveXObject)),tA||!oV||tC||tS||(tA=oU||oV),"function"!=typeof tA&&(tA=void 0);var oG=function(t,n){if(n&&"object"===oq(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},o$=function(t,n,i){tA(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)},oW=!1,oX=function(t,n,i,r){t.queryStringParams&&(n=oG(n,t.queryStringParams));var o=oj({},"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=oj({method:i?"POST":"GET",body:i?t.stringify(i):void 0,headers:o},oW?{}:a);try{o$(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]}),o$(n,s,r),oW=!0}catch(t){r(t)}}},oZ=function(t,n,i,r){i&&"object"===oq(i)&&(i=oG("",i).slice(1)),t.queryStringParams&&(n=oG(n,t.queryStringParams));try{(o=tC?new tC:new tS("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 oK=function(t,n,i,r){return("function"==typeof i&&(r=i,i=void 0),r=r||function(){},tA)?oX(t,n,i,r):oH()||"function"==typeof ActiveXObject?oZ(t,n,i,r):void r(Error("No fetch and no xhr implementation found!"))};var oJ=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=oj(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:oK,reloadInterval:"u"<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}();oJ.type="backend";let oQ=globalThis,o0=oQ.ShadowRoot&&(void 0===oQ.ShadyCSS||oQ.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o1=Symbol(),o2=new WeakMap;class o5{constructor(t,n,i){if(this._$cssResult$=!0,i!==o1)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(o0&&void 0===t){let i=void 0!==n&&1===n.length;i&&(t=o2.get(n)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&o2.set(n,t))}return t}toString(){return this.cssText}}let o3=t=>new o5("string"==typeof t?t:t+"",void 0,o1),o4=(t,...n)=>new o5(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,o1),o6=o0?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let n="";for(let i of t.cssRules)n+=i.cssText;return o3(n)})(t):t,{is:o8,defineProperty:o7,getOwnPropertyDescriptor:o9,getOwnPropertyNames:ae,getOwnPropertySymbols:at,getPrototypeOf:an}=Object,ai=globalThis,ar=ai.trustedTypes,ao=ar?ar.emptyScript:"",aa=ai.reactiveElementPolyfillSupport,as={toAttribute(t,n){switch(n){case Boolean:t=t?ao: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}},al=(t,n)=>!o8(t,n),ac={attribute:!0,type:String,converter:as,reflect:!1,useDefault:!1,hasChanged:al};Symbol.metadata??=Symbol("metadata"),ai.litPropertyMetadata??=new WeakMap;class ad 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=ac){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&&o7(this.prototype,t,r)}}static getPropertyDescriptor(t,n,i){let{get:r,set:o}=o9(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)??ac}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;let t=an(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[...ae(t),...at(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(o6(i));else void 0!==t&&n.push(o6(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(o0)t.adoptedStyleSheets=n.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let i of n){let n=document.createElement("style"),r=oQ.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:as).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:as;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??al)(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){}}ad.elementStyles=[],ad.shadowRootOptions={mode:"open"},ad.elementProperties=new Map,ad.finalized=new Map,aa?.({ReactiveElement:ad}),(ai.reactiveElementVersions??=[]).push("2.1.1");let au=globalThis,am=au.trustedTypes,ah=am?am.createPolicy("lit-html",{createHTML:t=>t}):void 0,ap="$lit$",af=`lit$${Math.random().toFixed(9).slice(2)}$`,ab="?"+af,ag=`<${ab}>`,a_=document,ay=()=>a_.createComment(""),av=t=>null===t||"object"!=typeof t&&"function"!=typeof t,ax=Array.isArray,aw=t=>ax(t)||"function"==typeof t?.[Symbol.iterator],aF="[ \n\f\r]",ak=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,aE=/-->/g,aT=/>/g,aM=RegExp(`>|${aF}(?:([^\\s"'>=/]+)(${aF}*=${aF}*(?:[^
|
|
54
54
|
\f\r"'\`<>=]|("|')|))|$)`,"g"),aA=/'/g,aC=/"/g,aS=/^(?:script|style|textarea|title)$/i,aD=t=>(n,...i)=>({_$litType$:t,strings:n,values:i}),aL=aD(1),aI=aD(2),aP=(aD(3),Symbol.for("lit-noChange")),aO=Symbol.for("lit-nothing"),aR=new WeakMap,aB=a_.createTreeWalker(a_,129);function az(t,n){if(!ax(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==ah?ah.createHTML(n):n}let aY=(t,n)=>{let i=t.length-1,r=[],o,a=2===n?"<svg>":3===n?"<math>":"",s=ak;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===ak?"!--"===c[1]?s=aE:void 0!==c[1]?s=aT:void 0!==c[2]?(aS.test(c[2])&&(o=RegExp("</"+c[2],"g")),s=aM):void 0!==c[3]&&(s=aM):s===aM?">"===c[0]?(s=o??ak,d=-1):void 0===c[1]?d=-2:(d=s.lastIndex-c[2].length,l=c[1],s=void 0===c[3]?aM:'"'===c[3]?aC:aA):s===aC||s===aA?s=aM:s===aE||s===aT?s=ak:(s=aM,o=void 0);let m=s===aM&&t[n+1].startsWith("/>")?" ":"";a+=s===ak?i+ag:d>=0?(r.push(l),i.slice(0,d)+ap+i.slice(d)+af+m):i+af+(-2===d?n:m)}return[az(t,a+(t[i]||"<?>")+(2===n?"</svg>":3===n?"</math>":"")),r]};class aN{constructor({strings:t,_$litType$:n},i){let r;this.parts=[];let o=0,a=0;const s=t.length-1,l=this.parts,[c,d]=aY(t,n);if(this.el=aN.createElement(c,i),aB.currentNode=this.el.content,2===n||3===n){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=aB.nextNode())&&l.length<s;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(ap)){const n=d[a++],i=r.getAttribute(t).split(af),s=/([.?@])?(.*)/.exec(n);l.push({type:1,index:o,name:s[2],strings:i,ctor:"."===s[1]?aq:"?"===s[1]?aG:"@"===s[1]?a$:aV}),r.removeAttribute(t)}else t.startsWith(af)&&(l.push({type:6,index:o}),r.removeAttribute(t));if(aS.test(r.tagName)){const t=r.textContent.split(af),n=t.length-1;if(n>0){r.textContent=am?am.emptyScript:"";for(let i=0;i<n;i++)r.append(t[i],ay()),aB.nextNode(),l.push({type:2,index:++o});r.append(t[n],ay())}}}else if(8===r.nodeType)if(r.data===ab)l.push({type:2,index:o});else{let t=-1;for(;-1!==(t=r.data.indexOf(af,t+1));)l.push({type:7,index:o}),t+=af.length-1}o++}}static createElement(t,n){let i=a_.createElement("template");return i.innerHTML=t,i}}function aj(t,n,i=t,r){if(n===aP)return n;let o=void 0!==r?i._$Co?.[r]:i._$Cl,a=av(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=aj(t,o._$AS(t,n.values),o,r)),n}class aH{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??a_).importNode(n,!0);aB.currentNode=r;let o=aB.nextNode(),a=0,s=0,l=i[0];for(;void 0!==l;){if(a===l.index){let n;2===l.type?n=new aU(o,o.nextSibling,this,t):1===l.type?n=new l.ctor(o,l.name,l.strings,this,t):6===l.type&&(n=new aW(o,this,t)),this._$AV.push(n),l=i[++s]}a!==l?.index&&(o=aB.nextNode(),a++)}return aB.currentNode=a_,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 aU{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,n,i,r){this.type=2,this._$AH=aO,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){av(t=aj(this,t,n))?t===aO||null==t||""===t?(this._$AH!==aO&&this._$AR(),this._$AH=aO):t!==this._$AH&&t!==aP&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):aw(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!==aO&&av(this._$AH)?this._$AA.nextSibling.data=t:this.T(a_.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=aN.createElement(az(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(n);else{let t=new aH(r,this),i=t.u(this.options);t.p(n),this.T(i),this._$AH=t}}_$AC(t){let n=aR.get(t.strings);return void 0===n&&aR.set(t.strings,n=new aN(t)),n}k(t){ax(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 aU(this.O(ay()),this.O(ay()),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 aV{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,n,i,r,o){this.type=1,this._$AH=aO,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=aO}_$AI(t,n=this,i,r){let o=this.strings,a=!1;if(void 0===o)(a=!av(t=aj(this,t,n,0))||t!==this._$AH&&t!==aP)&&(this._$AH=t);else{let r,s,l=t;for(t=o[0],r=0;r<o.length-1;r++)(s=aj(this,l[i+r],n,r))===aP&&(s=this._$AH[r]),a||=!av(s)||s!==this._$AH[r],s===aO?t=aO:t!==aO&&(t+=(s??"")+o[r+1]),this._$AH[r]=s}a&&!r&&this.j(t)}j(t){t===aO?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class aq extends aV{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===aO?void 0:t}}class aG extends aV{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==aO)}}class a$ extends aV{constructor(t,n,i,r,o){super(t,n,i,r,o),this.type=5}_$AI(t,n=this){if((t=aj(this,t,n,0)??aO)===aP)return;let i=this._$AH,r=t===aO&&i!==aO||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==aO&&(i===aO||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 aW{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){aj(this,t)}}let aX=au.litHtmlPolyfillSupport;aX?.(aN,aU),(au.litHtmlVersions??=[]).push("3.3.1");let aZ=globalThis;class aK extends ad{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 aU(n.insertBefore(ay(),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 aP}}aK._$litElement$=!0,aK.finalized=!0,aZ.litElementHydrateSupport?.({LitElement:aK});let aJ=aZ.litElementPolyfillSupport;aJ?.({LitElement:aK}),(aZ.litElementVersions??=[]).push("4.2.1");let aQ=t=>(...n)=>({_$litDirective$:t,values:n});class a0{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 a1 extends a0{constructor(t){if(super(t),this.it=aO,2!==t.type)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===aO||null==t)return this._t=void 0,this.it=t;if(t===aP)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:[]}}}a1.directiveName="unsafeHTML",a1.resultType=1,aQ(a1);class a2 extends a1{}a2.directiveName="unsafeSVG",a2.resultType=2;let a5=aQ(a2),a3=t=>(n,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(t,n)}):customElements.define(t,n)},a4={attribute:!0,type:String,converter:as,reflect:!1,hasChanged:al};function a6(t){return(n,i)=>{let r;return"object"==typeof i?((t=a4,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):(r=n.hasOwnProperty(i),n.constructor.createProperty(i,t),r?Object.getOwnPropertyDescriptor(n,i):void 0)}}function a8(t){return a6({...t,state:!0,attribute:!1})}let a7=(t,n,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof n&&Object.defineProperty(t,n,i),i);function a9(t,n){return(i,r,o)=>{let a=n=>n.renderRoot?.querySelector(t)??null;if(n){let t,{get:n,set:s}="object"==typeof r?i:o??(t=Symbol(),{get(){return this[t]},set(n){this[t]=n}});return a7(i,r,{get(){let t=n.call(this);return void 0===t&&(null!==(t=a(this))||this.hasUpdated)&&s.call(this,t),t}})}return a7(i,r,{get(){return a(this)}})}}let se={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" />',trash:'<path d="M6 9V19C6 19.5523 6.44772 20 7 20H17C17.5523 20 18 19.5523 18 19V9" stroke="#E21D12" stroke-width="2"/><path d="M14 11L14 16" stroke="#E21D12" stroke-width="2" stroke-linecap="round"/><path d="M10 11V16" stroke="#E21D12" stroke-width="2" stroke-linecap="round"/><path d="M5 6H8.5H19" stroke="#E21D12" stroke-width="2" stroke-linecap="round"/><path d="M8.09516 4.02871L7 6H17L15.9048 4.02871C15.5521 3.39378 14.8829 3 14.1565 3H9.84347C9.11714 3 8.4479 3.39378 8.09516 4.02871Z" fill="#E21D12"/>'};var st=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};class sn extends CustomEvent{constructor(){super(sn.NAME,{bubbles:!0,composed:!0})}}sn.NAME="or-iconset-added";let si=new class{constructor(){this._icons={}}addIconSet(t,n){this._icons[t]=n,this._defaultIconSet||(this._defaultIconSet=n),n.onAdd&&n.onAdd(),window.dispatchEvent(new sn)}getIconSet(t){return this._icons[t]}getIconTemplate(t){if(!t)return aL``;let n=(t||"").split(":"),i=n.pop(),r=n.pop(),o=this._defaultIconSet;return(r&&(o=this.getIconSet(r)),i&&o)?o.getIconTemplate(i):aL``}},sr=class extends aK{constructor(){super(...arguments),this._handler=t=>{this._updateIcon()}}static get styles(){return[o4`
|
|
55
55
|
:host {
|
|
56
56
|
--internal-or-icon-width: var(--or-icon-width, 24px);
|