@openremote/or-map 1.20.0 → 1.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/custom-elements-jsx.d.ts +9 -4
  2. package/custom-elements.json +2008 -1008
  3. package/dist/umd/index.bundle.js +69 -69
  4. package/dist/umd/index.bundle.js.map +1 -1
  5. package/dist/umd/index.js +70 -70
  6. package/dist/umd/index.js.map +1 -1
  7. package/dist/umd/index.orbundle.js +64 -64
  8. package/dist/umd/index.orbundle.js.map +1 -1
  9. package/lib/asset-map.d.ts +60 -0
  10. package/lib/asset-map.d.ts.map +1 -0
  11. package/lib/asset-map.js +1 -0
  12. package/lib/asset-map.js.map +1 -0
  13. package/lib/{mapwidget.d.ts → base-map.d.ts} +6 -29
  14. package/lib/base-map.d.ts.map +1 -0
  15. package/lib/base-map.js +1 -0
  16. package/lib/base-map.js.map +1 -0
  17. package/lib/index.d.ts +12 -34
  18. package/lib/index.d.ts.map +1 -1
  19. package/lib/index.js +10 -10
  20. package/lib/index.js.map +1 -1
  21. package/lib/markers/or-cluster-marker.d.ts +7 -4
  22. package/lib/markers/or-cluster-marker.d.ts.map +1 -1
  23. package/lib/markers/or-cluster-marker.js +6 -6
  24. package/lib/markers/or-cluster-marker.js.map +1 -1
  25. package/lib/or-map-legend.d.ts +1 -1
  26. package/lib/or-map-legend.d.ts.map +1 -1
  27. package/lib/or-map-legend.js +6 -6
  28. package/lib/or-map-legend.js.map +1 -1
  29. package/lib/types.d.ts +39 -0
  30. package/lib/types.d.ts.map +1 -0
  31. package/lib/types.js +1 -0
  32. package/lib/types.js.map +1 -0
  33. package/lib/util/index.d.ts +1 -0
  34. package/lib/util/index.d.ts.map +1 -1
  35. package/lib/util/index.js +1 -1
  36. package/lib/util/index.js.map +1 -1
  37. package/package.json +6 -6
  38. package/lib/mapwidget.d.ts.map +0 -1
  39. package/lib/mapwidget.js +0 -1
  40. package/lib/mapwidget.js.map +0 -1
@@ -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}&nbsp;${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="&#215;",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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};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}&nbsp;${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="&#215;",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:()=>sU,getMarkerConfigAttributeName:()=>sH,OrMapGeocoderChangeEvent:()=>uv,OrMap:()=>uF,OrMapLongPressEvent:()=>uy,OrMapLegendEvent:()=>up,OrMapMarker:()=>sL,OrMapMarkersChangedEvent:()=>ux,Util:()=>tV,OrMapAssetCard:()=>um,DefaultConfig:()=>uu,OrMapMarkerClickedEvent:()=>sD,geoJsonPointInputTemplateProvider:()=>uw,getMarkerConfigForAssetType:()=>sj,LngLat:()=>sw.LngLat,OrMapMarkerChangedEvent:()=>sS,OrMapLoadedEvent:()=>ug,OrClusterMarker:()=>uo,OrMapLegend:()=>uf,OrMapAssetCardLoadAssetEvent:()=>ud,OrMapClickedEvent:()=>u_});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:()=>sO,getLngLat:()=>sP,getLngLatBounds:()=>sR,getMarkerIconAndColorFromAssetType:()=>sB,isAssetWithLocation:()=>sY,isWebglSupported:()=>sz,metersToPixelsAtMaxZoom:()=>sI}),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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};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}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 r${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 rW{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 rX{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 rZ{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 rK{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 rJ{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 rQ{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 r0{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 r1{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 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}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 r3{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 r4{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 r6{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 r8{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 r7{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 r9{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 oe{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 ot{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 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}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})}}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._realmResource=new os(t,n),this._agentResource=new ol(t,n),this._syslogResource=new oc(t,n),this._assetDatapointResource=new od(t,n),this._gatewayServiceResource=new ou(t,n),this._statusResource=new om(t,n),this._userResource=new oh(t,n),this._appResource=new op(t,n),this._rulesResource=new of(t,n),this._configurationResource=new ob(t,n),this._consoleResource=new og(t,n),this._assetPredictedDatapointResource=new o_(t,n),this._mapResource=new oy(t,n),this._notificationResource=new ov(t,n),this._dashboardResource=new ox(t,n),this._assetModelResource=new ow(t,n),this._assetResource=new oF(t,n),this._flowResource=new ok(t,n),this._externalServiceResource=new oE(t,n),this._gatewayClientResource=new oT(t,n),this._provisioningResource=new oM(t,n),this._alarmResource=new oA(t,n),this._assetResource=new oF(t,n)}get RealmResource(){return this._realmResource}get AgentResource(){return this._agentResource}get SyslogResource(){return this._syslogResource}get AssetDatapointResource(){return this._assetDatapointResource}get GatewayServiceResource(){return this._gatewayServiceResource}get StatusResource(){return this._statusResource}get UserResource(){return this._userResource}get AppResource(){return this._appResource}get RulesResource(){return this._rulesResource}get ConfigurationResource(){return this._configurationResource}get ConsoleResource(){return this._consoleResource}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get MapResource(){return this._mapResource}get NotificationResource(){return this._notificationResource}get DashboardResource(){return this._dashboardResource}get AssetModelResource(){return this._assetModelResource}get AssetResource(){return this._assetResource}get FlowResource(){return this._flowResource}get ExternalServiceResource(){return this._externalServiceResource}get GatewayClientResource(){return this._gatewayClientResource}get ProvisioningResource(){return this._provisioningResource}get AlarmResource(){return this._alarmResource}}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);
@@ -99,27 +99,7 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
99
99
  viewBox="0 0 ${24} ${24}" preserveAspectRatio="xMidYMid meet" focusable="false">
100
100
  ${a5(n.startsWith("<")?n:'<path xmlns="http://www.w3.org/2000/svg" d="'+n+'" />')}
101
101
  </svg>
102
- `:aL``},onAdd:void 0}))}getConsoleAppConfig(){return sg(this,void 0,void 0,function*(){var t;try{let n=yield fetch((null!=(t=sv.managerUrl)?t:"")+"/consoleappconfig/"+sv.displayRealm+".json");return this._consoleAppConfig=yield n.json(),!0}catch(t){return!0}})}getConsolePreferredLanguage(){return sg(this,arguments,void 0,function*(t=this.console){return t.retrieveData("LANGUAGE")})}getUserPreferredLanguage(){return sg(this,arguments,void 0,function*(t=this._keycloak){if(t&&t.authenticated){let n=(null==t?void 0:t.profile)||(yield null==t?void 0:t.loadUserProfile());if(null==n?void 0:n.attributes){let t=new Map(Object.entries(n.attributes));if(t.has("locale")){let n=t.get("locale");if("string"==typeof n[0])return n[0]}console.warn("Could not get user language from keycloak: no user attributes were found.")}else console.warn("Could not get user language from keycloak: no valid keycloak user profile was found.")}})}updateKeycloakUserLanguage(t){return sg(this,arguments,void 0,function*(t,n=this.rest){this.authenticated?n?yield n.api.UserResource.updateCurrentUserLocale(t,{headers:{"Content-Type":"application/json"}}):console.warn("Tried updating user language, but the REST API is not initialized yet."):console.warn("Tried updating user language, but the user is not authenticated.")})}logout(t){this._authenticated&&(this._authenticated=!0,this._keycloak?(this.isMobile()&&this.console.storeData("REFRESH_TOKEN",null),this._keycloakUpdateTokenInterval&&(window.clearTimeout(this._keycloakUpdateTokenInterval),this._keycloakUpdateTokenInterval=void 0),this._keycloak.logout(t&&""!==t?{redirectUri:t}:void 0)):this._basicIdentity&&(this._basicIdentity=void 0,t?window.location.href=t:window.location.reload()))}login(t){switch(this._config.auth){case"BASIC":t&&t.credentials&&(this._config.credentials=Object.assign({},t.credentials)),this.doBasicLogin();break;case"KEYCLOAK":if(this._keycloak){let n={};t&&t.redirectUrl&&""!==t.redirectUrl&&(n.redirectUri=t.redirectUrl),(null==t?void 0:t.action)&&""!==t.action&&(n.action=t.action),this.isMobile()&&(n.scope="offline_access"),this._keycloak.login(n)}}}initialiseBasicAuth(){return sg(this,void 0,void 0,function*(){return this.config.basicLoginProvider?(this.config.autoLogin&&(this._readyCallback=()=>this.doBasicLogin()),!0):(console.debug("No basicLoginProvider defined on config so cannot display login UI"),!1)})}doBasicLogin(){return sg(this,void 0,void 0,function*(){var t,n,i,r;if(!this.config.basicLoginProvider)return;let o={username:(null==(t=this.config.credentials)?void 0:t.username)?null==(n=this.config.credentials)?void 0:n.username:"",password:(null==(i=this.config.credentials)?void 0:i.password)?null==(r=this.config.credentials)?void 0:r.password:"",cancel:!1},a=!1;for(this._basicIdentity={roles:void 0,token:void 0,user:void 0};!a;){if((o=yield this.config.basicLoginProvider(o.username,o.password)).cancel){console.debug("Basic authentication cancelled by user");break}if(!o.username||!o.password)continue;this._basicIdentity.token=btoa(o.username+":"+o.password);let t=!1;try{let n=yield oC.api.UserResource.getCurrent();200===n.status&&(t=!0,this._basicIdentity.user=n.data),t||401!==n.status&&403!==n.status||console.debug("Basic authentication invalid credentials, trying again")}catch(t){console.error("Basic auth failed: ",t)}if(t){console.debug("Basic authentication successful"),a=!0;let t=yield oC.api.UserResource.getCurrentUserClientRoles(this.clientId);this._basicIdentity.roles=t.data}else{console.debug("Unknown response so aborting"),this._basicIdentity=void 0;break}}a&&this._onAuthenticated()})}isSuperUser(){return!!(this.getRealm()&&"master"===this.getRealm()&&this.hasRealmRole("admin"))}isRestrictedUser(){return!!this.hasRealmRole("restricted_user")}getApiBaseUrl(){return this._config.managerUrl+"/api/"+this._config.realm+"/"}getAppName(){let t=location.pathname.split("/");return t.length>=1?t[1]:""}hasRealmRole(t){return this.isKeycloak()&&this._keycloak.hasRealmRole(t)}hasRole(t,n=this._config.clientId){let i=this.roles;return i&&i.has(n)&&i.get(n).indexOf(t)>=0}getAuthorizationHeader(){return this.getKeycloakToken()?"Bearer "+this.getKeycloakToken():this.getBasicToken()?"Basic "+this.getBasicToken():void 0}getKeycloakToken(){if(this.isKeycloak())return this._keycloak.token}getBasicToken(){return this._basicIdentity?this._basicIdentity.token:void 0}getRealm(){if(this._config)return this._config.realm}isMobile(){return this.console&&this.console.isMobile}isKeycloak(){return!!this._keycloak}_onAuthenticated(){this._authenticated=!0}loadAndInitialiseKeycloak(){return sg(this,void 0,void 0,function*(){var t,n,i,r;try{this._keycloak=new sl({clientId:this._config.clientId,realm:this._config.realm,url:this._config.keycloakUrl});let o=yield this._getNativeOfflineRefreshToken(),a=yield this._keycloak.init({checkLoginIframe:!1,onLoad:"check-sso"});if(!a&&o)try{console.error("SETTING OFFLINE TOKEN"),this._keycloak.refreshToken=o,a=yield this._updateKeycloakAccessToken()}catch(t){console.error("Failed to authenticate using offline token")}if(a)this._name=null==(t=this._keycloak.tokenParsed)?void 0:t.name,this._username=null==(n=this._keycloak.tokenParsed)?void 0:n.preferred_username,this._createTokenUpdateInterval(),this.isMobile()&&(null==(r=null==(i=this._keycloak)?void 0:i.refreshTokenParsed)?void 0:r.typ)==="Offline"&&(console.debug("Storing offline refresh token"),this.console.storeData("REFRESH_TOKEN",this._keycloak.refreshToken)),this._onAuthenticated();else if(this.config.autoLogin)return this.login(),!1;return!0}catch(t){return this._authenticated=!1,this._setError(tD.AUTH_FAILED),console.error("Failed to initialise Keycloak: "+t),!1}})}_createTokenUpdateInterval(){this._keycloakUpdateTokenInterval||(this._keycloakUpdateTokenInterval=window.setInterval(()=>sg(this,void 0,void 0,function*(){yield this._updateKeycloakAccessToken().catch(()=>{console.debug("Keycloak failed to refresh the access token"),this._onDisconnect()})}),1e4))}_updateKeycloakAccessToken(){return sg(this,void 0,void 0,function*(){let t=yield this._keycloak.updateToken(20);return console.debug("Access token update success, refreshed from server: "+t),t&&this._onAuthenticated(),t})}_getNativeOfflineRefreshToken(){return sg(this,void 0,void 0,function*(){if(this.isMobile())return yield this.console.retrieveData("REFRESH_TOKEN")})}_emitEvent(t){window.setTimeout(()=>{for(let n of this._listeners)n(t)},0)}_setError(t){this._error=t,this._emitEvent(tL.ERROR),console.warn("Error set: "+t)}_clearWebHistory(){var t;this.isMobile()&&(null==(t=this.console)||t._doSendGenericMessage("CLEAR_WEB_HISTORY",void 0))}_onDisconnect(){return sg(this,void 0,void 0,function*(){this._disconnected||(console.debug("Disconnected"),this._disconnected=!0,this._keycloakUpdateTokenInterval&&(window.clearTimeout(this._keycloakUpdateTokenInterval),this._keycloakUpdateTokenInterval=void 0),this._emitEvent(tL.OFFLINE),this.reconnect())})}_onReconnected(){console.debug("Reconnected"),this._disconnected=!1,this._createTokenUpdateInterval(),this._emitEvent(tL.ONLINE)}reconnect(){return sg(this,arguments,void 0,function*(t=3e3){if(!this._disconnected)return;this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=void 0);let n=()=>sg(this,void 0,void 0,function*(){var t;if(console.debug("Attempting reconnect"),!(yield this.isKeycloakReachable()))return console.debug("Keycloak is unreachable"),!1;console.debug("Keycloak is reachable"),console.debug("Checking keycloak access token");try{yield this._updateKeycloakAccessToken()}catch(n){let t=yield this._getNativeOfflineRefreshToken();this._keycloak.refreshToken=t;try{yield this._updateKeycloakAccessToken()}catch(t){console.debug("Cannot update access token so sending to login"),this.login();return}return console.debug("Keycloak access token is valid"),!0}let n=this.events&&this.events.status===tM.CONNECTING;return console.debug("If event provider offline then attempting reconnect: offline="+n),!n||(yield null==(t=this.events)?void 0:t.connect())}),i=yield n();if(void 0!==i){if(!i){console.debug("Scheduling another reconnect attempt in (ms): "+(t=Math.min(sy.MAX_RECONNECT_DELAY,t+3e3))),this._reconnectTimer=window.setTimeout(()=>this.reconnect(t),t);return}this._onReconnected()}})}isKeycloakReachable(){return sg(this,arguments,void 0,function*(t=2e3){let n=new AbortController,i=setTimeout(()=>n.abort(),t);try{let t=this._keycloak.endpoints.token(),i=yield fetch(t,{method:"OPTIONS",signal:n.signal});return 200===i.status}catch(t){return!1}finally{clearTimeout(i)}})}}sy.MAX_RECONNECT_DELAY=45e3;let sv=new sy,sx=sv;var sw=o(7415),sF=o.n(sw),sk=o(3087),sE=o.n(sk);o(7561);var sT=o(2051),sM=o.n(sT);function sA(t){if(t){if(t instanceof sw.LngLat)return t;if(t.lat)return t.lon?{lng:t.lon,lat:t.lat}:{lng:t.lng,lat:t.lat};if(Array.isArray(t))return{lng:t[0],lat:t[1]};if(t.coordinates&&Array.isArray(t.coordinates)&&t.coordinates.length>=2)return sA(t.coordinates);if(t.attributes){let n=t.attributes.location;return n&&n.value?sA(n.value):void 0}if(t.value)return sA(t.value)}}function sC(t){if(t)return Array.isArray(t)?{type:"Point",coordinates:t}:{type:"Point",coordinates:[t.hasOwnProperty("lng")?t.lng:t.lon,t.lat]}}function sS(t){if(t){if(t instanceof sw.LngLatBounds)return t;if(2===t.length){let n=sA(t[0]),i=sA(t[1]);if(n&&i)return new sw.LngLatBounds(n,i)}if(4===t.length)return new sw.LngLatBounds([t[0],t[1],t[2],t[3]])}}function sD(t,n){if(!t)return;let i="string"==typeof t?tq.getAssetDescriptor(t):t,r=i&&i.icon?i.icon:"help-circle",o=i&&i.colour?i.colour:void 0;if(n&&n.markerConfig){let t=n.markerConfig,i=n.currentValue;if("range"===t.type&&t.ranges&&"number"==typeof i){let n=t.ranges;o=(n.sort((t,n)=>n.min-t.min).find(t=>i>=t.min)||n.reduce((t,n)=>n.min>t.min?t:n)).colour||void 0}else"boolean"===t.type?o=t[!!i+""]:"string"===t.type&&(o=t[i+""])}return{color:o,icon:r}}function sL(){if(window.WebGLRenderingContext){let t=document.createElement("canvas");try{let n=t.getContext("webgl2")||t.getContext("webgl");if(n&&"function"==typeof n.getParameter)return!0}catch(t){}}return!1}function sI(t){if(!t.attributes)return!1;let n=t.attributes.location;return!!n.value&&(!n.meta||!n.meta.hasOwnProperty("showOnDashboard")||!!nX("showOnDashboard",n))}function sP(t){let n=t.match(/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/);if(!n)throw Error("Unable to parse URL object");return{protocol:n[1],authority:n[2],path:n[3]||"/",params:n[4]?n[4].split("&"):[]}}function sO(t,n){let i=sP("https://api.mapbox.com");t.protocol=i.protocol,t.authority=i.authority,t.params.push(`access_token=${n}`);let r=t.params.length?`?${t.params.join("&")}`:"";return`${t.protocol}://${t.authority}${t.path}${r}`}let sR=class extends aK{constructor(t,n,i,r,o){super(),this._slices=[],this._highThreshold=99,this._midTreshold=this._highThreshold/10,this._lowTreshold=this._midTreshold/10,this._clusterId=n,this._slices=t,this.lng=i,this.lat=r,this._map=o}hasTypes(t){for(let n of t)if(!this._slices.some(([t])=>t===n))return!1;return!0}render(){return aI`${this._createDonutChart(this._slices)}`}_createDonutChart(t){let n=0;for(let i of t)i.push(n),n+=i[2];let i=n>=this._highThreshold?18:n>=this._midTreshold?16:n>=this._lowTreshold?14:12,r=n>=this._highThreshold?32:n>=this._midTreshold?26:n>=this._lowTreshold?16:12,o=n>=this._highThreshold?28:n>=this._midTreshold?24:n>=this._lowTreshold?16:8,a=r-o,s=Math.round(.6*r),l=2*r,c=n>this._highThreshold;return aI`
103
- <svg
104
- width="${l}"
105
- height="${l}"
106
- viewbox="0 0 ${l} ${l}"
107
- text-anchor="middle"
108
- style="cursor: pointer; pointer-events: auto; font: ${i}px Helvetica Neue,Arial,Helvetica,sans-serif; display: block">
109
- ${t.map(([,t,i,r])=>this._donutSegment(r/n,(r+i)/n,o,s,t,a))}
110
- <circle cx="${r}" cy="${r}" r="${s}" fill="white" />
111
- <text dominant-baseline="central" transform="translate(${r}, ${r})">
112
- ${(c?this._highThreshold:n).toLocaleString()+(c?"+":"")}
113
- </text>
114
- </svg>
115
- `}_donutSegment(t,n,i,r,o,a){n-t==1&&(n-=1e-5);let s=2*Math.PI*(t-.25),l=2*Math.PI*(n-.25),c=Math.cos(s),d=Math.sin(s),u=Math.cos(l),m=Math.sin(l),h=+(n-t>.5);return aI`<path fill="#${o}" transform="translate(${a}, ${a})" d="
116
- M ${i+r*c} ${i+r*d}
117
- L ${i+i*c} ${i+i*d}
118
- A ${i} ${i} 0 ${h} 1 ${i+i*u} ${i+i*m}
119
- L ${i+r*u} ${i+r*m}
120
- A ${r} ${r} 0 ${h} 0 ${i+r*c} ${i+r*d}
121
- "
122
- />`}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.onClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.onClick)}onClick(){var t,n,i,r;return t=this,n=void 0,i=void 0,r=function*(){if(this.lng&&this.lat){let t=yield this._map.getSource("mapPoints").getClusterExpansionZoom(this._clusterId);this._map.easeTo({center:[this.lng,this.lat],zoom:t},{marker:this})}},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())})}};sR=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}([a3("or-cluster-marker")],sR);var sB=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 sz=o(6126),sY=o(7561);class sN{constructor(t,n,i=!1,r=!1,o=!0,a=!0,s){this._loaded=!1,this._markers=new Map,this._geoJsonSources=[],this._geoJsonLayers=new Map,this._showGeoCodingControl=!1,this._showBoundaryBox=!1,this._useZoomControls=!0,this._showGeoJson=!0,this._clickHandlers=new Map,this._pointsMap={type:"FeatureCollection",features:[]},this._assetTypeColors={},this._cachedMarkers={},this._markersOnScreen={},this._assetsOnScreen={},this._onMove=()=>this._updateMarkers(),this._onMoveEnd=t=>{requestAnimationFrame(()=>{t.marker instanceof sR&&this._clearMarker(t.marker._clusterId),this._updateMarkers()})},this._onData=t=>{this._map&&t.isSourceLoaded&&"mapPoints"===t.sourceId&&(this._map.on("move",this._onMove),this._map.on("moveend",this._onMoveEnd),this._updateMarkers())},this._styleParent=t,this._mapContainer=n,this._showGeoCodingControl=i,this._showBoundaryBox=r,this._useZoomControls=o,this._showGeoJson=a,this._clusterConfig=s}setCenter(t){return this._center=sA(t),this._map&&this._center&&this._map.setCenter(this._center),this}flyTo(t,n){return t||(t=this._center?this._center:this._viewSettings?this._viewSettings.center:void 0),n||(n=this._zoom?this._zoom:this._viewSettings&&this._viewSettings.zoom?this._viewSettings.zoom:void 0),this._map?t&&this._map.flyTo({center:t,zoom:n}):(this._center=t,this._zoom=n),this}resize(){return this._map&&this._map.resize(),this}setZoom(t){return this._zoom=t,this._map&&this._zoom&&this._map.setZoom(this._zoom),this}setControls(t){return this._controls=t,this._map&&(this._controls?this._controls.forEach(t=>{Array.isArray(t)?this._map.addControl(t[0],t[1]):this._map.addControl(t)}):this._map.addControl(new sw.NavigationControl)),this}setGeoJson(t){var n;return this._geoJsonConfig=t,this._map&&(this._geoJsonConfig?this._loadGeoJSON(this._geoJsonConfig):this._loadGeoJSON(null==(n=this._viewSettings)?void 0:n.geoJson)),this}loadViewSettings(){return sB(this,void 0,void 0,function*(){var t;let n=(yield sx.rest.api.MapResource.getSettings()).data;if(n.override)return n.override;let i=sx.displayRealm||"default";return this._viewSettings=n.options?n.options[i]?n.options[i]:n.options.default:null,this._viewSettings&&(this._map&&(this._map.setMinZoom(this._viewSettings.minZoom),this._map.setMaxZoom(this._viewSettings.maxZoom),this._viewSettings.bounds&&this._map.setMaxBounds(this._viewSettings.bounds),this._geoJsonConfig?yield this._loadGeoJSON(this._geoJsonConfig):yield this._loadGeoJSON(null==(t=this._viewSettings)?void 0:t.geoJson)),this._center?this.setCenter(this._center):this.setCenter(this._viewSettings.center)),n})}build(){return sB(this,void 0,void 0,function*(){var n;if(this._loaded)return;let i=document.createElement("style");i.id="maplibreGlStyle",i.textContent=sz,this._styleParent.appendChild(i),(i=document.createElement("style")).id="maplibreGeoCoderStyles",i.textContent=sY,this._styleParent.appendChild(i);let r=yield Promise.resolve().then(o.t.bind(o,7415,23)),a=yield this.loadViewSettings(),s={attributionControl:{compact:!0},container:this._mapContainer,style:a,transformRequest:(n,i)=>{if(t||(t=new URL(n).searchParams.get("access_token")||""),0===n.indexOf("mapbox:")){var r,o,a,s,l,c,d,u,m;let h,p,f,b,g,_,y,v;return r=t,n.indexOf("/styles/")>-1&&-1===n.indexOf("/sprite")?{url:(o=n,a=r,(h=sP(o)).path=`/styles/v1${h.path}`,sO(h,a))}:n.indexOf("/sprites/")>-1?{url:(s=n,l=r,b=(f=(p=sP(s)).path.split("."))[0],g=f[1],_="",b.indexOf("@2x")&&(b=b.split("@2x")[0],_="@2x"),p.path=`/styles/v1${b}/sprite${_}.${g}`,sO(p,l))}:n.indexOf("/fonts/")>-1?{url:(c=n,d=r,(y=sP(c)).path=`/fonts/v1${y.path}`,sO(y,d))}:n.indexOf("/v4/")>-1||"Source"===i?{url:(u=n,m=r,(v=sP(u)).path=`/v4/${v.authority}.json`,v.params.push("secure"),sO(v,m))}:void 0}return{headers:new URL(window.origin).hostname===new URL(n).hostname?{Authorization:sx.getAuthorizationHeader()}:{},url:n}}};(this._viewSettings&&(this._useZoomControls&&(s.maxZoom=this._viewSettings.maxZoom,s.minZoom=this._viewSettings.minZoom),this._viewSettings.bounds&&!this._showBoundaryBox&&(s.maxBounds=this._viewSettings.bounds),s.boxZoom=this._viewSettings.boxZoom,s.zoom=this._viewSettings.zoom,s.center=this._viewSettings.center),this._center=this._center||(this._viewSettings?this._viewSettings.center:void 0),s.center=this._center,this._zoom&&(s.zoom=this._zoom),sL())?(this._map=new r.Map(s),yield this._styleLoaded(),this._map.on("click",t=>{this._onMapClick(t.lngLat)}),this._map.on("dblclick",t=>{this._onMapClick(t.lngLat,!0)}),this._showGeoCodingControl&&this._viewSettings&&this._viewSettings.geocodeUrl&&(this._geocoder=new(sE())({forwardGeocode:this._forwardGeocode.bind(this),reverseGeocode:this._reverseGeocode},{maplibregl:sF(),showResultsWhileTyping:!0}),this._geocoder._onKeyDown=sM()(t=>{if(27===t.keyCode&&this._geocoder.options.clearAndBlurOnEsc)return this._geocoder._clear(t),this._geocoder._inputEl.blur();var n=this._geocoder._inputEl.value||t.key;if(!n)return this._geocoder.fresh=!0,9!==t.keyCode&&this._geocoder.clear(t),this._geocoder._clearEl.style.display="none";if(!t.metaKey&&-1===[9,27,37,39,38,40].indexOf(t.keyCode)){if(13===t.keyCode)if(this._geocoder.options.showResultsWhileTyping){this._geocoder.options.showResultMarkers&&this._geocoder._fitBoundsForMarkers(),this._geocoder._inputEl.value=this._geocoder._typeahead.query,this._geocoder.lastSelected=null,this._geocoder._typeahead.selected=null;return}else this._geocoder._typeahead.list.selectingListItem||this._geocoder._geocode(n);n.length>=this._geocoder.options.minLength&&this._geocoder.options.showResultsWhileTyping&&this._geocoder._geocode(n)}},300),this._map.addControl(this._geocoder,"top-left"),this._geocoder._inputEl.addEventListener("change",()=>{var t=this._geocoder._typeahead.selected;this._onGeocodeChange(t)})),this._controls?this._controls.forEach(t=>{Array.isArray(t)?this._map.addControl(t[0],t[1]):this._map.addControl(t)}):(this._map.addControl(new sw.NavigationControl),this._map.addControl(new sw.GeolocateControl({positionOptions:{enableHighAccuracy:!0},showAccuracyCircle:!0,showUserLocation:!0}))),this._geoJsonConfig?yield this._loadGeoJSON(this._geoJsonConfig):yield this._loadGeoJSON(null==(n=this._viewSettings)?void 0:n.geoJson),this._initLongPressEvent(),this._map.on("load",()=>sB(this,void 0,void 0,function*(){return yield this.load()})),this._mapContainer.dispatchEvent(new up),this._loaded=!0,this.createBoundaryBox()):console.warn("WebGL is not supported in this environment. The map cannot be initialized.")})}_styleLoaded(){return new Promise(t=>{this._map&&this._map.once("style.load",t)})}load(){return sB(this,void 0,void 0,function*(){var t,n,i,r,o,a;this._map&&this._loaded?(this._map.getSource("mapPoints")&&(this._map.getLayer("unclustered-point")&&this._map.removeLayer("unclustered-point"),this._map.getLayer("clusters")&&this._map.removeLayer("clusters"),this._map.getLayer("cluster-count")&&this._map.removeLayer("cluster-count"),this._map.removeSource("mapPoints")),this._map.addSource("mapPoints",{type:"geojson",cluster:null==(n=null==(t=this._clusterConfig)?void 0:t.cluster)||n,clusterRadius:null!=(r=null==(i=this._clusterConfig)?void 0:i.clusterRadius)?r:180,clusterMaxZoom:null!=(a=null==(o=this._clusterConfig)?void 0:o.clusterMaxZoom)?a:17,data:this._pointsMap,clusterProperties:Object.fromEntries(Object.keys(this._assetTypeColors).map(t=>[t,["+",["case",["==",["get","assetType"],t],1,0]]]))}),this._map.getLayer("unclustered-point")||this._map.addLayer({id:"unclustered-point",type:"circle",source:"mapPoints",filter:["!",["has","point_count"]],paint:{"circle-radius":0}}),this._map.on("data",this._onData)):console.warn("MapLibre Map not initialized!")})}unload(){this._map&&(this._map.remove(),this._map=void 0)}_onMapClick(t,n=!1){this._mapContainer.dispatchEvent(new uf(t,n))}_loadGeoJSON(t){return sB(this,void 0,void 0,function*(){if(this._geoJsonLayers.size>0&&(this._geoJsonLayers.forEach((t,n)=>this._map.removeLayer(n)),this._geoJsonLayers=new Map),this._geoJsonSources.length>0&&(this._geoJsonSources.forEach(t=>this._map.removeSource(t)),this._geoJsonSources=[]),this._showGeoJson&&t)if("FeatureCollection"==t.source.type){let n=this.groupSourcesByGeometryType(t.source);null==n||n.forEach((t,n)=>{let i=this.addGeoJSONSource({type:"geojson",data:{type:"FeatureCollection",features:t}});i&&this.addGeoJSONLayer(n,i.sourceId)})}else if("Feature"==t.source.type){let n=this.addGeoJSONSource(t.source);n&&this.addGeoJSONLayer(n.source.type,n.sourceId)}else console.error("Could not create layer since source type is neither 'FeatureCollection' nor 'Feature'.")})}groupSourcesByGeometryType(t){let n=new Map;return t.features.forEach(t=>{var i;let r=null!=(i=n.get(t.geometry.type))?i:[];r.push(t),n.set(t.geometry.type,r)}),n}addGeoJSONSource(t){if(!this._map)return void console.error("mapGl instance not found!");let n=Date.now()+"-"+(this._geoJsonSources.length+1);return this._map.addSource(n,t),this._geoJsonSources.push(n),{source:t,sourceId:n}}addGeoJSONLayer(t,n){if(!this._map)return void console.error("mapGl instance not found!");let i=n+"-"+t;if(void 0==this._geoJsonLayers.get(i)){let r=getComputedStyle(this._mapContainer).getPropertyValue("--or-app-color4");(void 0==r||0==r.length)&&(r=su);let o={id:i,source:n};switch(t){case"Point":case"MultiPoint":o.type="circle",o.paint={"circle-radius":12,"circle-color":r},this._geoJsonLayers.set(i,o),this._map.addLayer(o);break;case"LineString":case"MultiLineString":o.type="line",o.paint={"line-color":r,"line-width":4},this._geoJsonLayers.set(i,o),this._map.addLayer(o);break;case"Polygon":case"MultiPolygon":{o.type="fill",o.paint={"fill-color":r,"fill-opacity":.3},this._geoJsonLayers.set(i,o),this._map.addLayer(o);let t=i+"-outline",a={id:t,source:n,type:"line",paint:{"line-color":r,"line-width":2}};this._geoJsonLayers.set(t,a),this._map.addLayer(a);break}case"GeometryCollection":return void console.error("GeometryCollection GeoJSON is not implemented yet!")}}}addMarker(t){t.hasPosition()&&this._updateMarkerElement(t,!0)}_clearMarker(t){this._markersOnScreen[t].remove(),delete this._assetsOnScreen[t]}_updateMarkers(){if(!this._map)return;let t={},n=this._map.querySourceFeatures("mapPoints");for(let i of n){if(!i.properties.id)continue;let n=i.properties.id,r=i.geometry.coordinates,o=this._cachedMarkers[n];if(!o){let t=document.createElement("div");o=this._cachedMarkers[n]=new sw.Marker({element:t}).setLngLat(r)}t[n]=o,this._markersOnScreen[n]||(o.addTo(this._map),this._assetsOnScreen[n]=JSON.parse(i.properties.asset))}for(let i of n){if(!i.properties.cluster)continue;let n=i.properties.cluster_id,[r,o]=i.geometry.coordinates,a=this._cachedMarkers[n];if(!a){let t=Object.entries(i.properties).filter(([t])=>this._assetTypeColors.hasOwnProperty(t)).map(([t,n])=>[t,this._assetTypeColors[t],n]);a=this._cachedMarkers[n]=new sw.Marker({element:new sR(t,n,r,o,this._map)}).setLngLat([r,o])}t[n]=a,this._markersOnScreen[n]||a.addTo(this._map)}for(let n in this._markersOnScreen){let i=t[n];(!i||i._element instanceof sR&&!i._element.hasTypes(Object.keys(this._assetTypeColors)))&&this._clearMarker(n)}this._markersOnScreen=t,this._mapContainer.dispatchEvent(new u_(Object.values(this._assetsOnScreen)))}addAssetMarker(t,n,i,r,o,a){var s;this._assetTypeColors[i]=null==(s=sD(i))?void 0:s.color,this._pointsMap.features.push({type:"Feature",properties:{name:n,id:t,assetType:i,asset:a},geometry:{type:"Point",coordinates:[r,o]}})}cleanUpAssetMarkers(){this._assetTypeColors={},this._pointsMap={type:"FeatureCollection",features:[]}}removeMarker(t){this._removeMarkerRadius(t),this._updateMarkerElement(t,!1)}onMarkerChanged(t,n){if(this._loaded)switch(n){case"lat":case"lng":case"radius":t.hasPosition()?t._actualMarkerElement?this._updateMarkerPosition(t):this._updateMarkerElement(t,!0):t._actualMarkerElement&&this._updateMarkerElement(t,!1)}}_updateMarkerPosition(t){var n;null==(n=this._markers.get(t))||n.setLngLat([t.lng,t.lat]),this._createMarkerRadius(t)}_updateMarkerElement(t,n){let i=this._markers.get(t);if(i&&(t._actualMarkerElement=void 0,this._removeMarkerClickHandler(t,i.getElement()),i.remove(),this._markers.delete(t)),n){let n=t._createMarkerElement();n&&(i=new sw.Marker({element:n,anchor:"top-left"}).setLngLat([t.lng,t.lat]).addTo(this._map),this._markers.set(t,i),t._actualMarkerElement=i.getElement(),t.interactive&&this._addMarkerClickHandler(t,i.getElement())),t.radius&&this._createMarkerRadius(t)}}_removeMarkerRadius(t){this._map&&this._loaded&&t.radius&&t.lat&&t.lng&&this._map.getSource("circleData")&&(this._map.removeLayer("marker-radius-circle"),this._map.removeSource("circleData"))}_createMarkerRadius(t){this._map&&this._loaded&&t.radius&&t.lat&&t.lng&&(this._removeMarkerRadius(t),this._map.addSource("circleData",{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[t.lng,t.lat]},properties:{}}]}}),this._map.addLayer({id:"marker-radius-circle",type:"circle",source:"circleData",paint:{"circle-radius":["interpolate",["exponential",2],["zoom"],0,0,20,t.radius/.075/Math.cos(t.lat*Math.PI/180)],"circle-color":"red","circle-opacity":.3,"circle-pitch-alignment":"map"}}))}createBoundaryBox(t=[]){var n,i;if(this._map&&this._loaded&&this._showBoundaryBox&&(null==(n=this._viewSettings)?void 0:n.bounds)){this._map.getSource("bounds")&&(this._map.removeLayer("bounds"),this._map.removeSource("bounds")),4!==t.length&&(t=null==(i=this._viewSettings)?void 0:i.bounds.toString().split(","));var r=[[[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]],[t[0],t[3]]]];this._map.fitBounds([parseFloat(t[0])+.01,parseFloat(t[1])-.01,parseFloat(t[2])-.01,parseFloat(t[3])+.01]),this._map.addSource("bounds",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:r}}}),this._map.addLayer({id:"bounds",type:"fill",source:"bounds",paint:{"fill-color":"#FF0000","fill-opacity":.4}})}}_addMarkerClickHandler(t,n){if(n){let i=n=>{n.stopPropagation(),t._onClick(n)};this._clickHandlers.set(t,i),n.addEventListener("click",i)}}_removeMarkerClickHandler(t,n){let i=this._clickHandlers.get(t);i&&n&&(n.removeEventListener("click",i),this._clickHandlers.delete(t))}_forwardGeocode(t){return sB(this,void 0,void 0,function*(){let n=[];try{let i=this._viewSettings.geocodeUrl+"/search?q="+t.query+"&format=geojson&polygon_geojson=1&addressdetails=1",r=yield fetch(i);for(let t of(yield r.json()).features){let i=[t.bbox[0]+(t.bbox[2]-t.bbox[0])/2,t.bbox[1]+(t.bbox[3]-t.bbox[1])/2],r={type:"Feature",geometry:{type:"Point",coordinates:i},place_name:t.properties.display_name,properties:t.properties,text:t.properties.display_name,place_type:["place"],center:i};n.push(r)}}catch(t){console.error(`Failed to forwardGeocode with error: ${t}`)}return{features:n}})}_reverseGeocode(t){return sB(this,void 0,void 0,function*(){let n=[];try{let i=this._viewSettings.geocodeUrl+"/reverse?lat="+t.lat+"&lon="+t.lon+"&format=geojson&polygon_geojson=1&addressdetails=1",r=yield fetch(i);for(let t of(yield r.json()).features){let i=[t.bbox[0]+(t.bbox[2]-t.bbox[0])/2,t.bbox[1]+(t.bbox[3]-t.bbox[1])/2],r={type:"Feature",geometry:{type:"Point",coordinates:i},place_name:t.properties.display_name,properties:t.properties,text:t.properties.display_name,place_type:["place"],center:i};n.push(r)}}catch(t){console.error(`Failed to reverseGeocode with error: ${t}`)}return{features:n}})}_initLongPressEvent(){if(this._map){let t,n,i=()=>{t&&clearTimeout(t),t=null};this._map.on("touchstart",i=>{i.originalEvent.touches.length>1||(n=i.lngLat,t=setTimeout(()=>{this._onLongPress(n)},500))}),this._map.on("mousedown",i=>{t||(n=i.lngLat,t=setTimeout(()=>{this._onLongPress(n),t=null},500))}),this._map.on("dragstart",i),this._map.on("mouseup",i),this._map.on("touchend",i),this._map.on("touchcancel",i),this._map.on("touchmove",i),this._map.on("moveend",i),this._map.on("gesturestart",i),this._map.on("gesturechange",i),this._map.on("gestureend",i)}}_onLongPress(t){this._mapContainer.dispatchEvent(new ub(t))}_onGeocodeChange(t){this._mapContainer.dispatchEvent(new ug(t))}}let sj="--internal-or-map-marker-color",sH="--internal-or-map-marker-active-color",sU=o4`
102
+ `:aL``},onAdd:void 0}))}getConsoleAppConfig(){return sg(this,void 0,void 0,function*(){var t;try{let n=yield fetch((null!=(t=sv.managerUrl)?t:"")+"/consoleappconfig/"+sv.displayRealm+".json");return this._consoleAppConfig=yield n.json(),!0}catch(t){return!0}})}getConsolePreferredLanguage(){return sg(this,arguments,void 0,function*(t=this.console){return t.retrieveData("LANGUAGE")})}getUserPreferredLanguage(){return sg(this,arguments,void 0,function*(t=this._keycloak){if(t&&t.authenticated){let n=(null==t?void 0:t.profile)||(yield null==t?void 0:t.loadUserProfile());if(null==n?void 0:n.attributes){let t=new Map(Object.entries(n.attributes));if(t.has("locale")){let n=t.get("locale");if("string"==typeof n[0])return n[0]}console.warn("Could not get user language from keycloak: no user attributes were found.")}else console.warn("Could not get user language from keycloak: no valid keycloak user profile was found.")}})}updateKeycloakUserLanguage(t){return sg(this,arguments,void 0,function*(t,n=this.rest){this.authenticated?n?yield n.api.UserResource.updateCurrentUserLocale(t,{headers:{"Content-Type":"application/json"}}):console.warn("Tried updating user language, but the REST API is not initialized yet."):console.warn("Tried updating user language, but the user is not authenticated.")})}logout(t){this._authenticated&&(this._authenticated=!0,this._keycloak?(this.isMobile()&&this.console.storeData("REFRESH_TOKEN",null),this._keycloakUpdateTokenInterval&&(window.clearTimeout(this._keycloakUpdateTokenInterval),this._keycloakUpdateTokenInterval=void 0),this._keycloak.logout(t&&""!==t?{redirectUri:t}:void 0)):this._basicIdentity&&(this._basicIdentity=void 0,t?window.location.href=t:window.location.reload()))}login(t){switch(this._config.auth){case"BASIC":t&&t.credentials&&(this._config.credentials=Object.assign({},t.credentials)),this.doBasicLogin();break;case"KEYCLOAK":if(this._keycloak){let n={};t&&t.redirectUrl&&""!==t.redirectUrl&&(n.redirectUri=t.redirectUrl),(null==t?void 0:t.action)&&""!==t.action&&(n.action=t.action),this.isMobile()&&(n.scope="offline_access"),this._keycloak.login(n)}}}initialiseBasicAuth(){return sg(this,void 0,void 0,function*(){return this.config.basicLoginProvider?(this.config.autoLogin&&(this._readyCallback=()=>this.doBasicLogin()),!0):(console.debug("No basicLoginProvider defined on config so cannot display login UI"),!1)})}doBasicLogin(){return sg(this,void 0,void 0,function*(){var t,n,i,r;if(!this.config.basicLoginProvider)return;let o={username:(null==(t=this.config.credentials)?void 0:t.username)?null==(n=this.config.credentials)?void 0:n.username:"",password:(null==(i=this.config.credentials)?void 0:i.password)?null==(r=this.config.credentials)?void 0:r.password:"",cancel:!1},a=!1;for(this._basicIdentity={roles:void 0,token:void 0,user:void 0};!a;){if((o=yield this.config.basicLoginProvider(o.username,o.password)).cancel){console.debug("Basic authentication cancelled by user");break}if(!o.username||!o.password)continue;this._basicIdentity.token=btoa(o.username+":"+o.password);let t=!1;try{let n=yield oC.api.UserResource.getCurrent();200===n.status&&(t=!0,this._basicIdentity.user=n.data),t||401!==n.status&&403!==n.status||console.debug("Basic authentication invalid credentials, trying again")}catch(t){console.error("Basic auth failed: ",t)}if(t){console.debug("Basic authentication successful"),a=!0;let t=yield oC.api.UserResource.getCurrentUserClientRoles(this.clientId);this._basicIdentity.roles=t.data}else{console.debug("Unknown response so aborting"),this._basicIdentity=void 0;break}}a&&this._onAuthenticated()})}isSuperUser(){return!!(this.getRealm()&&"master"===this.getRealm()&&this.hasRealmRole("admin"))}isRestrictedUser(){return!!this.hasRealmRole("restricted_user")}getApiBaseUrl(){return this._config.managerUrl+"/api/"+this._config.realm+"/"}getAppName(){let t=location.pathname.split("/");return t.length>=1?t[1]:""}hasRealmRole(t){return this.isKeycloak()&&this._keycloak.hasRealmRole(t)}hasRole(t,n=this._config.clientId){let i=this.roles;return i&&i.has(n)&&i.get(n).indexOf(t)>=0}getAuthorizationHeader(){return this.getKeycloakToken()?"Bearer "+this.getKeycloakToken():this.getBasicToken()?"Basic "+this.getBasicToken():void 0}getKeycloakToken(){if(this.isKeycloak())return this._keycloak.token}getBasicToken(){return this._basicIdentity?this._basicIdentity.token:void 0}getRealm(){if(this._config)return this._config.realm}isMobile(){return this.console&&this.console.isMobile}isKeycloak(){return!!this._keycloak}_onAuthenticated(){this._authenticated=!0}loadAndInitialiseKeycloak(){return sg(this,void 0,void 0,function*(){var t,n,i,r;try{this._keycloak=new sl({clientId:this._config.clientId,realm:this._config.realm,url:this._config.keycloakUrl});let o=yield this._getNativeOfflineRefreshToken(),a=yield this._keycloak.init({checkLoginIframe:!1,onLoad:"check-sso"});if(!a&&o)try{console.error("SETTING OFFLINE TOKEN"),this._keycloak.refreshToken=o,a=yield this._updateKeycloakAccessToken()}catch(t){console.error("Failed to authenticate using offline token")}if(a)this._name=null==(t=this._keycloak.tokenParsed)?void 0:t.name,this._username=null==(n=this._keycloak.tokenParsed)?void 0:n.preferred_username,this._createTokenUpdateInterval(),this.isMobile()&&(null==(r=null==(i=this._keycloak)?void 0:i.refreshTokenParsed)?void 0:r.typ)==="Offline"&&(console.debug("Storing offline refresh token"),this.console.storeData("REFRESH_TOKEN",this._keycloak.refreshToken)),this._onAuthenticated();else if(this.config.autoLogin)return this.login(),!1;return!0}catch(t){return this._authenticated=!1,this._setError(tD.AUTH_FAILED),console.error("Failed to initialise Keycloak: "+t),!1}})}_createTokenUpdateInterval(){this._keycloakUpdateTokenInterval||(this._keycloakUpdateTokenInterval=window.setInterval(()=>sg(this,void 0,void 0,function*(){yield this._updateKeycloakAccessToken().catch(()=>{console.debug("Keycloak failed to refresh the access token"),this._onDisconnect()})}),1e4))}_updateKeycloakAccessToken(){return sg(this,void 0,void 0,function*(){let t=yield this._keycloak.updateToken(20);return console.debug("Access token update success, refreshed from server: "+t),t&&this._onAuthenticated(),t})}_getNativeOfflineRefreshToken(){return sg(this,void 0,void 0,function*(){if(this.isMobile())return yield this.console.retrieveData("REFRESH_TOKEN")})}_emitEvent(t){window.setTimeout(()=>{for(let n of this._listeners)n(t)},0)}_setError(t){this._error=t,this._emitEvent(tL.ERROR),console.warn("Error set: "+t)}_clearWebHistory(){var t;this.isMobile()&&(null==(t=this.console)||t._doSendGenericMessage("CLEAR_WEB_HISTORY",void 0))}_onDisconnect(){return sg(this,void 0,void 0,function*(){this._disconnected||(console.debug("Disconnected"),this._disconnected=!0,this._keycloakUpdateTokenInterval&&(window.clearTimeout(this._keycloakUpdateTokenInterval),this._keycloakUpdateTokenInterval=void 0),this._emitEvent(tL.OFFLINE),this.reconnect())})}_onReconnected(){console.debug("Reconnected"),this._disconnected=!1,this._createTokenUpdateInterval(),this._emitEvent(tL.ONLINE)}reconnect(){return sg(this,arguments,void 0,function*(t=3e3){if(!this._disconnected)return;this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=void 0);let n=()=>sg(this,void 0,void 0,function*(){var t;if(console.debug("Attempting reconnect"),!(yield this.isKeycloakReachable()))return console.debug("Keycloak is unreachable"),!1;console.debug("Keycloak is reachable"),console.debug("Checking keycloak access token");try{yield this._updateKeycloakAccessToken()}catch(n){let t=yield this._getNativeOfflineRefreshToken();this._keycloak.refreshToken=t;try{yield this._updateKeycloakAccessToken()}catch(t){console.debug("Cannot update access token so sending to login"),this.login();return}return console.debug("Keycloak access token is valid"),!0}let n=this.events&&this.events.status===tM.CONNECTING;return console.debug("If event provider offline then attempting reconnect: offline="+n),!n||(yield null==(t=this.events)?void 0:t.connect())}),i=yield n();if(void 0!==i){if(!i){console.debug("Scheduling another reconnect attempt in (ms): "+(t=Math.min(sy.MAX_RECONNECT_DELAY,t+3e3))),this._reconnectTimer=window.setTimeout(()=>this.reconnect(t),t);return}this._onReconnected()}})}isKeycloakReachable(){return sg(this,arguments,void 0,function*(t=2e3){let n=new AbortController,i=setTimeout(()=>n.abort(),t);try{let t=this._keycloak.endpoints.token(),i=yield fetch(t,{method:"OPTIONS",signal:n.signal});return 200===i.status}catch(t){return!1}finally{clearTimeout(i)}})}}sy.MAX_RECONNECT_DELAY=45e3;let sv=new sy,sx=sv;var sw=o(7415),sF=o.n(sw);let sk="--internal-or-map-marker-color",sE="--internal-or-map-marker-active-color",sT=o4`
123
103
  :host {
124
104
  --internal-or-map-width: var(--or-map-width, 100%);
125
105
  --internal-or-map-min-height: var(--or-map-min-height, 300px);
@@ -261,7 +241,7 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
261
241
  right: 12px;
262
242
  }
263
243
  }
264
- `,sV=o4`
244
+ `,sM=o4`
265
245
  :host {
266
246
  --internal-or-map-asset-card-header-color: var(--or-map-asset-card-header-color, var(--or-app-color3, ${o3(sf)}));
267
247
  --internal-or-map-asset-card-header-text-color: var(--or-map-asset-card-header-text-color, var(--or-app-color1, ${o3(sm)}));
@@ -351,7 +331,7 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
351
331
  min-height: 134px;
352
332
  }
353
333
  }
354
- `,sq=o4`
334
+ `,sA=o4`
355
335
  :host {
356
336
  --internal-or-map-asset-legend-background-color: var(--or-map-asset-card-background-color, var(--or-app-color1, ${o3(sm)}));
357
337
  --internal-or-map-asset-legend-header-height: var(--or-map-asset-card-header-height, calc(${o3("50px")} - 10px));
@@ -418,7 +398,7 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
418
398
  user-select: none;
419
399
  }
420
400
  }
421
- `;var sG=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 s$ extends CustomEvent{constructor(t,n){super(s$.NAME,{detail:{marker:t,property:n},bubbles:!0,composed:!0})}}s$.NAME="or-map-marker-changed";class sW extends CustomEvent{constructor(t){super(sW.NAME,{detail:{marker:t},bubbles:!0,composed:!0})}}sW.NAME="or-map-marker-clicked";let sX=tI=class extends aK{constructor(){super(...arguments),this.visible=!0,this.interactive=!0,this.active=!1}static get styles(){return o4`
401
+ `;var sC=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 sS extends CustomEvent{constructor(t,n){super(sS.NAME,{detail:{marker:t,property:n},bubbles:!0,composed:!0})}}sS.NAME="or-map-marker-changed";class sD extends CustomEvent{constructor(t){super(sD.NAME,{detail:{marker:t},bubbles:!0,composed:!0})}}sD.NAME="or-map-marker-clicked";let sL=tI=class extends aK{constructor(){super(...arguments),this.visible=!0,this.interactive=!0,this.active=!1}static get styles(){return o4`
422
402
  .label {
423
403
  background-color: white;
424
404
  width: auto;
@@ -485,9 +465,9 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
485
465
  r: 18px;
486
466
  stroke-width: 4px;
487
467
  }
488
- `}get markerContainer(){if(this._actualMarkerElement)return this._actualMarkerElement.firstElementChild}_onClick(t){this.dispatchEvent(new sW(this))}_createMarkerElement(){let t=document.createElement("div"),n=document.createElement("div");t.appendChild(n),this._addMarkerClassNames(t),this._addMarkerContainerClassNames(n);let i=this.createMarkerContent();return i||(t.classList.add("or-map-marker-default"),i=this._createDefaultMarkerContent()),n.appendChild(i),this._updateInteractive(t),this._updateVisibility(t),this._updateColor(n),this._updateActive(t),t}createMarkerContent(){let t=!1,n=document.createElement("div");if(this._slot&&this._slot.assignedNodes({flatten:!0}).forEach(i=>{i instanceof HTMLElement&&(n.appendChild(i.cloneNode(!0)),t=!0)}),t)return n}shouldUpdate(t){return(t.has("icon")||t.has("displayValue")||t.has("direction"))&&this._refreshMarkerContent(),(t.has("color")||t.has("activeColor"))&&this._updateColor(this.markerContainer),t.has("visible")&&this._updateVisibility(this._actualMarkerElement),t.has("interactive")&&this._updateInteractive(this._actualMarkerElement),t.has("active")&&(this._updateActive(this._actualMarkerElement),this._updateColor(this.markerContainer)),t.forEach((t,n)=>this._raisePropertyChange(n)),!1}_updateVisibility(t){t&&(this.visible?t.removeAttribute("hidden"):t.setAttribute("hidden","true"))}_getColor(){return this.color&&"unset"!==this.color?this.color:void 0}_getActiveColor(){return this.activeColor&&"unset"!==this.activeColor?this.activeColor:void 0}_updateColor(t){if(t){t.style.removeProperty(sj),t.style.removeProperty(sH);let n=this._getColor(),i=this._getActiveColor();n&&t.style.setProperty(sj,n),i&&t.style.setProperty(sH,i)}}_updateActive(t){t&&(this.active?t.classList.add("active"):t.classList.remove("active"))}_updateInteractive(t){t&&(this.interactive?t.classList.add("interactive"):t.classList.remove("interactive"))}_refreshMarkerContent(){if(this.markerContainer){let t=this.createMarkerContent();t?this._actualMarkerElement.classList.remove("or-map-marker-default"):(this._actualMarkerElement.classList.add("or-map-marker-default"),t=this._createDefaultMarkerContent()),this.markerContainer.children.length>0&&this.markerContainer.removeChild(this.markerContainer.children[0]),this.markerContainer.appendChild(t)}}render(){return aL`
468
+ `}get markerContainer(){if(this._actualMarkerElement)return this._actualMarkerElement.firstElementChild}_onClick(t){this.dispatchEvent(new sD(this))}_createMarkerElement(){let t=document.createElement("div"),n=document.createElement("div");t.appendChild(n),this._addMarkerClassNames(t),this._addMarkerContainerClassNames(n);let i=this.createMarkerContent();return i||(t.classList.add("or-map-marker-default"),i=this._createDefaultMarkerContent()),n.appendChild(i),this._updateInteractive(t),this._updateVisibility(t),this._updateColor(n),this._updateActive(t),t}createMarkerContent(){let t=!1,n=document.createElement("div");if(this._slot&&this._slot.assignedNodes({flatten:!0}).forEach(i=>{i instanceof HTMLElement&&(n.appendChild(i.cloneNode(!0)),t=!0)}),t)return n}shouldUpdate(t){return(t.has("icon")||t.has("displayValue")||t.has("direction"))&&this._refreshMarkerContent(),(t.has("color")||t.has("activeColor"))&&this._updateColor(this.markerContainer),t.has("visible")&&this._updateVisibility(this._actualMarkerElement),t.has("interactive")&&this._updateInteractive(this._actualMarkerElement),t.has("active")&&(this._updateActive(this._actualMarkerElement),this._updateColor(this.markerContainer)),t.forEach((t,n)=>this._raisePropertyChange(n)),!1}_updateVisibility(t){t&&(this.visible?t.removeAttribute("hidden"):t.setAttribute("hidden","true"))}_getColor(){return this.color&&"unset"!==this.color?this.color:void 0}_getActiveColor(){return this.activeColor&&"unset"!==this.activeColor?this.activeColor:void 0}_updateColor(t){if(t){t.style.removeProperty(sk),t.style.removeProperty(sE);let n=this._getColor(),i=this._getActiveColor();n&&t.style.setProperty(sk,n),i&&t.style.setProperty(sE,i)}}_updateActive(t){t&&(this.active?t.classList.add("active"):t.classList.remove("active"))}_updateInteractive(t){t&&(this.interactive?t.classList.add("interactive"):t.classList.remove("interactive"))}_refreshMarkerContent(){if(this.markerContainer){let t=this.createMarkerContent();t?this._actualMarkerElement.classList.remove("or-map-marker-default"):(this._actualMarkerElement.classList.add("or-map-marker-default"),t=this._createDefaultMarkerContent()),this.markerContainer.children.length>0&&this.markerContainer.removeChild(this.markerContainer.children[0]),this.markerContainer.appendChild(t)}}render(){return aL`
489
469
  <slot></slot>
490
- `}_raisePropertyChange(t){this.dispatchEvent(new s$(this,t))}_addMarkerClassNames(t){t.classList.add("or-map-marker")}_addMarkerContainerClassNames(t){t.classList.add("marker-container")}_createDefaultMarkerContent(){let t=document.createElement("div");return t.innerHTML=tI._defaultTemplate(this.icon,{displayValue:this.displayValue,direction:this.direction}),t}_applyMapMarkerStyles(){var t;if(this.parentElement instanceof uv){let n=null==(t=this.parentElement.shadowRoot)?void 0:t.querySelector("#map"),i=this.constructor.styles,r=null==n?void 0:n.querySelector("style");r||(r=document.createElement("style"));let o=[];n&&i&&(Array.isArray(i)?o=i:o.push(i),o.forEach(t=>{r.textContent=String(t),n.children.length>0?n.insertBefore(r,n.children[0]):n.appendChild(r)}))}}hasPosition(){return"number"==typeof this.lat&&"number"==typeof this.lng&&this.lat>=-90&&this.lat<90&&this.lng>=-180&&this.lng<180}connectedCallback(){super.connectedCallback(),this._applyMapMarkerStyles(),this._map=this.parentElement}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this._map)||t._removeMarker(this)}};sX._defaultTemplate=(t,n)=>`
470
+ `}_raisePropertyChange(t){this.dispatchEvent(new sS(this,t))}_addMarkerClassNames(t){t.classList.add("or-map-marker")}_addMarkerContainerClassNames(t){t.classList.add("marker-container")}_createDefaultMarkerContent(){let t=document.createElement("div");return t.innerHTML=tI._defaultTemplate(this.icon,{displayValue:this.displayValue,direction:this.direction}),t}_applyMapMarkerStyles(){var t;if(this.parentElement instanceof uF){let n=null==(t=this.parentElement.shadowRoot)?void 0:t.querySelector("#map"),i=this.constructor.styles,r=null==n?void 0:n.querySelector("style");r||(r=document.createElement("style"));let o=[];n&&i&&(Array.isArray(i)?o=i:o.push(i),o.forEach(t=>{r.textContent=String(t),n.children.length>0?n.insertBefore(r,n.children[0]):n.appendChild(r)}))}}hasPosition(){return"number"==typeof this.lat&&"number"==typeof this.lng&&this.lat>=-90&&this.lat<90&&this.lng>=-180&&this.lng<180}connectedCallback(){super.connectedCallback(),this._applyMapMarkerStyles(),this._map=this.parentElement}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this._map)||t._removeMarker(this)}};function sI(t,n){return t/.075/Math.cos(n*Math.PI/180)}function sP(t){if(t){if(t instanceof sw.LngLat)return t;if(t.lat)return t.lon?{lng:t.lon,lat:t.lat}:{lng:t.lng,lat:t.lat};if(Array.isArray(t))return{lng:t[0],lat:t[1]};if(t.coordinates&&Array.isArray(t.coordinates)&&t.coordinates.length>=2)return sP(t.coordinates);if(t.attributes){let n=t.attributes.location;return n&&n.value?sP(n.value):void 0}if(t.value)return sP(t.value)}}function sO(t){if(t)return Array.isArray(t)?{type:"Point",coordinates:t}:{type:"Point",coordinates:[t.hasOwnProperty("lng")?t.lng:t.lon,t.lat]}}function sR(t){if(t){if(t instanceof sw.LngLatBounds)return t;if(2===t.length){let n=sP(t[0]),i=sP(t[1]);if(n&&i)return new sw.LngLatBounds(n,i)}if(4===t.length)return new sw.LngLatBounds([t[0],t[1],t[2],t[3]])}}function sB(t,n){if(!t)return;let i="string"==typeof t?tq.getAssetDescriptor(t):t,r=i&&i.icon?i.icon:"help-circle",o=i&&i.colour?i.colour:void 0;if(n&&n.markerConfig){let t=n.markerConfig,i=n.currentValue;if("range"===t.type&&t.ranges&&"number"==typeof i){let n=t.ranges;o=(n.sort((t,n)=>n.min-t.min).find(t=>i>=t.min)||n.reduce((t,n)=>n.min>t.min?t:n)).colour||void 0}else"boolean"===t.type?o=t[!!i+""]:"string"===t.type&&(o=t[i+""])}return{color:o,icon:r}}function sz(){if(window.WebGLRenderingContext){let t=document.createElement("canvas");try{let n=t.getContext("webgl2")||t.getContext("webgl");if(n&&"function"==typeof n.getParameter)return!0}catch(t){}}return!1}function sY(t){var n;if(!(null==t?void 0:t.attributes))return!1;let i=t.attributes.location;return!!(null==(n=null==i?void 0:i.value)?void 0:n.coordinates)&&(!i.meta||!("showOnDashboard"in i.meta)||!!nX("showOnDashboard",i))}sL._defaultTemplate=(t,n)=>`
491
471
  ${n&&void 0!==n.displayValue?`<div class="label"><span>${n.displayValue}</span></div>`:""}
492
472
  ${n&&n.direction?`<div class="direction-icon-wrapper" style="transform: rotate(${n.direction}deg);">
493
473
  <svg class="direction-circle">
@@ -497,9 +477,9 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
497
477
  </div>`:""}
498
478
  <or-icon icon="or:marker"></or-icon>
499
479
  <or-icon class="marker-icon" icon="${t||""}"></or-icon>
500
- `,sG([a6({type:Number,reflect:!0,attribute:!0})],sX.prototype,"lat",void 0),sG([a6({type:Number,reflect:!0})],sX.prototype,"lng",void 0),sG([a6({type:Number,reflect:!0})],sX.prototype,"radius",void 0),sG([a6({reflect:!0})],sX.prototype,"displayValue",void 0),sG([a6({reflect:!0})],sX.prototype,"direction",void 0),sG([a6({type:Boolean})],sX.prototype,"visible",void 0),sG([a6({type:String})],sX.prototype,"icon",void 0),sG([a6({type:String})],sX.prototype,"color",void 0),sG([a6({type:String})],sX.prototype,"activeColor",void 0),sG([a6({type:Boolean})],sX.prototype,"interactive",void 0),sG([a6({type:Boolean})],sX.prototype,"active",void 0),sG([a9("slot")],sX.prototype,"_slot",void 0),sX=tI=sG([a3("or-map-marker")],sX);var sZ=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};function sK(t,n){if(t&&n&&t[n])return t[n]}function sJ(t,n){let i=sK(t,n);if(i)return i.attributeName}let sQ=class extends sd(sx)(sX){constructor(){super(),this.assetTypeAsIcon=!0,this.visible=!1}set type(t){let n,i=sK(this.config,t);if(i&&i.attributeName&&this.asset&&this.asset.attributes&&this.asset.attributes[i.attributeName]&&i.colours){let t=this.asset.attributes[i.attributeName].value;n={markerConfig:i.colours,currentValue:t}}let r=sD(t,n);if(!r){this.visible=!1;return}this.assetTypeAsIcon&&(this.icon=r.icon),this._markerColor=Array.isArray(r.color)?r.color[0].colour:r.color||void 0,this._updateColor(this.markerContainer),this.visible=!0}shouldUpdate(t){if(t.has("assetId")&&(this.lat=void 0,this.lng=void 0,this.type=void 0,this.direction=void 0,this.displayValue=void 0,this.assetIds=this.assetId&&this.assetId.length>0?[this.assetId]:void 0,1===Object.keys(t).length))return!1;if(t.has("asset"))try{this._onAssetChanged(this.asset)}catch(t){console.error(t)}return super.shouldUpdate(t)}_onEvent(t){if("attribute"===t.eventType)return"location"===t.ref.name?void this._updateLocation(t.value):void(this.asset&&(this.asset=n1(this.asset,t),this.requestUpdate()));if("asset"===t.eventType)switch(t.cause){case"READ":case"CREATE":case"UPDATE":this._onAssetChanged(t.asset);break;case"DELETE":this._onAssetChanged(void 0)}}_onAssetChanged(t){var n,i,r,o;return n=this,i=void 0,r=void 0,o=function*(){if(t){this.direction=void 0,this.displayValue=void 0;let r=t.attributes?t.attributes.location:void 0;this._updateLocation(r?r.value:null);let o=sK(this.config,t.type),a=!o||!o.hideDirection,s=o&&!0===o.showLabel&&!!o.attributeName,l=!!(o&&!1!==o.showUnits);if(s&&t.attributes&&t.attributes[null==o?void 0:o.attributeName]){var n,i;let r=t.attributes[o.attributeName],a=tq.getAttributeAndValueDescriptors(t.type,r.name,r);this.displayValue=(n=a[0],i=t.type,nZ(r,n,i,l,!0,"-"))}if(a&&t.attributes&&t.attributes.direction){let n=t.attributes.direction.value;null!=n&&(this.direction=n.toString())}this.type=t.type}else this.lat=void 0,this.lng=void 0},new(r||(r=Promise))(function(t,a){function s(t){try{c(o.next(t))}catch(t){a(t)}}function l(t){try{c(o.throw(t))}catch(t){a(t)}}function c(n){var i;n.done?t(n.value):((i=n.value)instanceof r?i:new r(function(t){t(i)})).then(s,l)}c((o=o.apply(n,i||[])).next())})}_updateLocation(t){this.lat=t&&t.coordinates?t.coordinates[1]:void 0,this.lng=t&&t.coordinates?t.coordinates[0]:void 0}_getColor(){return this._markerColor&&!this.color?"#"+this._markerColor:super._getColor()}_getActiveColor(){return this._markerColor&&!this.activeColor?"#"+this._markerColor:super._getActiveColor()}};sZ([a6({type:String,reflect:!0,attribute:!0})],sQ.prototype,"assetId",void 0),sZ([a6({type:Object,attribute:!0})],sQ.prototype,"asset",void 0),sZ([a6()],sQ.prototype,"config",void 0),sQ=sZ([a3("or-map-marker-asset")],sQ);let{I:s0}={M:ap,P:af,A:ab,C:1,L:aY,R:aH,D:aw,V:aj,I:aU,H:aV,N:aG,U:a$,B:aq,F:aW},s1=(t,n)=>{let i=t._$AN;if(void 0===i)return!1;for(let t of i)t._$AO?.(n,!1),s1(t,n);return!0},s2=t=>{let n,i;do{if(void 0===(n=t._$AM))break;(i=n._$AN).delete(t),t=n}while(0===i?.size)},s5=t=>{for(let n;n=t._$AM;t=n){let i=n._$AN;if(void 0===i)n._$AN=i=new Set;else if(i.has(t))break;i.add(t),s6(n)}};function s3(t){void 0!==this._$AN?(s2(this),this._$AM=t,s5(this)):this._$AM=t}function s4(t,n=!1,i=0){let r=this._$AH,o=this._$AN;if(void 0!==o&&0!==o.size)if(n)if(Array.isArray(r))for(let t=i;t<r.length;t++)s1(r[t],!1),s2(r[t]);else null!=r&&(s1(r,!1),s2(r));else s1(this,t)}let s6=t=>{2==t.type&&(t._$AP??=s4,t._$AQ??=s3)};class s8 extends a0{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,n,i){super._$AT(t,n,i),s5(this),this.isConnected=t._$AU}_$AO(t,n=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),n&&(s1(this,t),s2(this))}setValue(t){if(void 0===this._$Ct.strings)this._$Ct._$AI(t,this);else{let n=[...this._$Ct._$AH];n[this._$Ci]=t,this._$Ct._$AI(n,this,0)}}disconnected(){}reconnected(){}}let s7=new WeakMap;aQ(class extends s8{render(t){return aO}update(t,[n]){let i=n!==this.G;return i&&void 0!==this.G&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.G=n,this.ht=t.options?.host,this.rt(this.ct=t.element)),aO}rt(t){if(this.isConnected||(t=void 0),"function"==typeof this.G){let n=this.ht??globalThis,i=s7.get(n);void 0===i&&(i=new WeakMap,s7.set(n,i)),void 0!==i.get(this.G)&&this.G.call(this.ht,void 0),i.set(this.G,t),void 0!==t&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){return"function"==typeof this.G?s7.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});let s9=aQ(class extends a0{constructor(t){if(super(t),1!==t.type||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(n=>t[n]).join(" ")+" "}update(t,[n]){if(void 0===this.st){for(let i in this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t))),n)n[i]&&!this.nt?.has(i)&&this.st.add(i);return this.render(n)}let i=t.element.classList;for(let t of this.st)t in n||(i.remove(t),this.st.delete(t));for(let t in n){let r=!!n[t];r===this.st.has(t)||this.nt?.has(t)||(r?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return aP}});class le{constructor(t){this.G=t}disconnect(){this.G=void 0}reconnect(t){this.G=t}deref(){return this.G}}class lt{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise(t=>this.Z=t)}resume(){this.Z?.(),this.Y=this.Z=void 0}}let ln=t=>null!==t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then,li=aQ(class extends s8{constructor(){super(...arguments),this._$Cwt=0x3fffffff,this._$Cbt=[],this._$CK=new le(this),this._$CX=new lt}render(...t){return t.find(t=>!ln(t))??aP}update(t,n){let i=this._$Cbt,r=i.length;this._$Cbt=n;let o=this._$CK,a=this._$CX;this.isConnected||this.disconnected();for(let t=0;t<n.length&&!(t>this._$Cwt);t++){let s=n[t];if(!ln(s))return this._$Cwt=t,s;t<r&&s===i[t]||(this._$Cwt=0x3fffffff,r=0,Promise.resolve(s).then(async t=>{for(;a.get();)await a.get();let n=o.deref();if(void 0!==n){let i=n._$Cbt.indexOf(s);i>-1&&i<n._$Cwt&&(n._$Cwt=i,n.setValue(t))}}))}return aP}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}});var lr=function(t,n){return(lr=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])})(t,n)};function lo(t,n){function i(){this.constructor=t}lr(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var la=function(){return(la=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++)for(var o in n=arguments[i])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)};function ls(t){var n="function"==typeof Symbol&&Symbol.iterator,i=n&&t[n],r=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function ll(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(function(t,n){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var r,o,a=i.call(t),s=[];try{for(;(void 0===n||n-- >0)&&!(r=a.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}return s}(arguments[n]));return t}var lc=function(){function t(t){void 0===t&&(t={}),this.adapter=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}(),ld=function(){function t(t,n){for(var i=[],r=2;r<arguments.length;r++)i[r-2]=arguments[r];this.root=t,this.initialize.apply(this,ll(i)),this.foundation=void 0===n?this.getDefaultFoundation():n,this.foundation.init(),this.initialSyncWithDOM()}return t.attachTo=function(n){return new t(n,new lc({}))},t.prototype.initialize=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n]},t.prototype.getDefaultFoundation=function(){throw Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},t.prototype.initialSyncWithDOM=function(){},t.prototype.destroy=function(){this.foundation.destroy()},t.prototype.listen=function(t,n,i){this.root.addEventListener(t,n,i)},t.prototype.unlisten=function(t,n,i){this.root.removeEventListener(t,n,i)},t.prototype.emit=function(t,n,i){var r;void 0===i&&(i=!1),"function"==typeof CustomEvent?r=new CustomEvent(t,{bubbles:i,detail:n}):(r=document.createEvent("CustomEvent")).initCustomEvent(t,i,!1,n),this.root.dispatchEvent(r)},t}();function lu(t){return void 0===t&&(t=window),!!function(t){void 0===t&&(t=window);var n=!1;try{var i={get passive(){return n=!0,!1}},r=function(){};t.document.addEventListener("test",r,i),t.document.removeEventListener("test",r,i)}catch(t){n=!1}return n}(t)&&{passive:!0}}function lm(t,n){if(t.closest)return t.closest(n);for(var i=t;i;){if(lh(i,n))return i;i=i.parentElement}return null}function lh(t,n){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,n)}var lp={LABEL_FLOAT_ABOVE:"mdc-floating-label--float-above",LABEL_REQUIRED:"mdc-floating-label--required",LABEL_SHAKE:"mdc-floating-label--shake",ROOT:"mdc-floating-label"},lf=function(t){function n(i){var r=t.call(this,la(la({},n.defaultAdapter),i))||this;return r.shakeAnimationEndHandler_=function(){return r.handleShakeAnimationEnd_()},r}return lo(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return lp},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},getWidth:function(){return 0},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){this.adapter.registerInteractionHandler("animationend",this.shakeAnimationEndHandler_)},n.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("animationend",this.shakeAnimationEndHandler_)},n.prototype.getWidth=function(){return this.adapter.getWidth()},n.prototype.shake=function(t){var i=n.cssClasses.LABEL_SHAKE;t?this.adapter.addClass(i):this.adapter.removeClass(i)},n.prototype.float=function(t){var i=n.cssClasses,r=i.LABEL_FLOAT_ABOVE,o=i.LABEL_SHAKE;t?this.adapter.addClass(r):(this.adapter.removeClass(r),this.adapter.removeClass(o))},n.prototype.setRequired=function(t){var i=n.cssClasses.LABEL_REQUIRED;t?this.adapter.addClass(i):this.adapter.removeClass(i)},n.prototype.handleShakeAnimationEnd_=function(){var t=n.cssClasses.LABEL_SHAKE;this.adapter.removeClass(t)},n}(lc),lb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return lo(n,t),n.attachTo=function(t){return new n(t)},n.prototype.shake=function(t){this.foundation.shake(t)},n.prototype.float=function(t){this.foundation.float(t)},n.prototype.setRequired=function(t){this.foundation.setRequired(t)},n.prototype.getWidth=function(){return this.foundation.getWidth()},n.prototype.getDefaultFoundation=function(){var t=this;return new lf({addClass:function(n){return t.root.classList.add(n)},removeClass:function(n){return t.root.classList.remove(n)},getWidth:function(){var n=t.root;if(null!==n.offsetParent)return n.scrollWidth;var i=n.cloneNode(!0);i.style.setProperty("position","absolute"),i.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(i);var r=i.scrollWidth;return document.documentElement.removeChild(i),r},registerInteractionHandler:function(n,i){return t.listen(n,i)},deregisterInteractionHandler:function(n,i){return t.unlisten(n,i)}})},n}(ld),lg={LINE_RIPPLE_ACTIVE:"mdc-line-ripple--active",LINE_RIPPLE_DEACTIVATING:"mdc-line-ripple--deactivating"},l_=function(t){function n(i){var r=t.call(this,la(la({},n.defaultAdapter),i))||this;return r.transitionEndHandler_=function(t){return r.handleTransitionEnd(t)},r}return lo(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return lg},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setStyle:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){this.adapter.registerEventHandler("transitionend",this.transitionEndHandler_)},n.prototype.destroy=function(){this.adapter.deregisterEventHandler("transitionend",this.transitionEndHandler_)},n.prototype.activate=function(){this.adapter.removeClass(lg.LINE_RIPPLE_DEACTIVATING),this.adapter.addClass(lg.LINE_RIPPLE_ACTIVE)},n.prototype.setRippleCenter=function(t){this.adapter.setStyle("transform-origin",t+"px center")},n.prototype.deactivate=function(){this.adapter.addClass(lg.LINE_RIPPLE_DEACTIVATING)},n.prototype.handleTransitionEnd=function(t){var n=this.adapter.hasClass(lg.LINE_RIPPLE_DEACTIVATING);"opacity"===t.propertyName&&n&&(this.adapter.removeClass(lg.LINE_RIPPLE_ACTIVE),this.adapter.removeClass(lg.LINE_RIPPLE_DEACTIVATING))},n}(lc),ly=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return lo(n,t),n.attachTo=function(t){return new n(t)},n.prototype.activate=function(){this.foundation.activate()},n.prototype.deactivate=function(){this.foundation.deactivate()},n.prototype.setRippleCenter=function(t){this.foundation.setRippleCenter(t)},n.prototype.getDefaultFoundation=function(){var t=this;return new l_({addClass:function(n){return t.root.classList.add(n)},removeClass:function(n){return t.root.classList.remove(n)},hasClass:function(n){return t.root.classList.contains(n)},setStyle:function(n,i){return t.root.style.setProperty(n,i)},registerEventHandler:function(n,i){return t.listen(n,i)},deregisterEventHandler:function(n,i){return t.unlisten(n,i)}})},n}(ld),lv={NOTCH_ELEMENT_SELECTOR:".mdc-notched-outline__notch"},lx={NOTCH_ELEMENT_PADDING:8},lw={NO_LABEL:"mdc-notched-outline--no-label",OUTLINE_NOTCHED:"mdc-notched-outline--notched",OUTLINE_UPGRADED:"mdc-notched-outline--upgraded"},lF=function(t){function n(i){return t.call(this,la(la({},n.defaultAdapter),i))||this}return lo(n,t),Object.defineProperty(n,"strings",{get:function(){return lv},enumerable:!0,configurable:!0}),Object.defineProperty(n,"cssClasses",{get:function(){return lw},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return lx},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNotchWidthProperty:function(){},removeNotchWidthProperty:function(){}}},enumerable:!0,configurable:!0}),n.prototype.notch=function(t){var i=n.cssClasses.OUTLINE_NOTCHED;t>0&&(t+=lx.NOTCH_ELEMENT_PADDING),this.adapter.setNotchWidthProperty(t),this.adapter.addClass(i)},n.prototype.closeNotch=function(){var t=n.cssClasses.OUTLINE_NOTCHED;this.adapter.removeClass(t),this.adapter.removeNotchWidthProperty()},n}(lc),lk=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return lo(n,t),n.attachTo=function(t){return new n(t)},n.prototype.initialSyncWithDOM=function(){this.notchElement_=this.root.querySelector(lv.NOTCH_ELEMENT_SELECTOR);var t=this.root.querySelector("."+lf.cssClasses.ROOT);t?(t.style.transitionDuration="0s",this.root.classList.add(lw.OUTLINE_UPGRADED),requestAnimationFrame(function(){t.style.transitionDuration=""})):this.root.classList.add(lw.NO_LABEL)},n.prototype.notch=function(t){this.foundation.notch(t)},n.prototype.closeNotch=function(){this.foundation.closeNotch()},n.prototype.getDefaultFoundation=function(){var t=this;return new lF({addClass:function(n){return t.root.classList.add(n)},removeClass:function(n){return t.root.classList.remove(n)},setNotchWidthProperty:function(n){return t.notchElement_.style.setProperty("width",n+"px")},removeNotchWidthProperty:function(){return t.notchElement_.style.removeProperty("width")}})},n}(ld),lE={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},lT={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},lM={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300},lA=["touchstart","pointerdown","mousedown","keydown"],lC=["touchend","pointerup","mouseup","contextmenu"],lS=[],lD=function(t){function n(i){var r=t.call(this,la(la({},n.defaultAdapter),i))||this;return r.activationAnimationHasEnded_=!1,r.activationTimer_=0,r.fgDeactivationRemovalTimer_=0,r.fgScale_="0",r.frame_={width:0,height:0},r.initialSize_=0,r.layoutFrame_=0,r.maxRadius_=0,r.unboundedCoords_={left:0,top:0},r.activationState_=r.defaultActivationState_(),r.activationTimerCallback_=function(){r.activationAnimationHasEnded_=!0,r.runDeactivationUXLogicIfReady_()},r.activateHandler_=function(t){return r.activate_(t)},r.deactivateHandler_=function(){return r.deactivate_()},r.focusHandler_=function(){return r.handleFocus()},r.blurHandler_=function(){return r.handleBlur()},r.resizeHandler_=function(){return r.layout()},r}return lo(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return lE},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return lT},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return lM},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){var t=this,i=this.supportsPressRipple_();if(this.registerRootHandlers_(i),i){var r=n.cssClasses,o=r.ROOT,a=r.UNBOUNDED;requestAnimationFrame(function(){t.adapter.addClass(o),t.adapter.isUnbounded()&&(t.adapter.addClass(a),t.layoutInternal_())})}},n.prototype.destroy=function(){var t=this;if(this.supportsPressRipple_()){this.activationTimer_&&(clearTimeout(this.activationTimer_),this.activationTimer_=0,this.adapter.removeClass(n.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer_&&(clearTimeout(this.fgDeactivationRemovalTimer_),this.fgDeactivationRemovalTimer_=0,this.adapter.removeClass(n.cssClasses.FG_DEACTIVATION));var i=n.cssClasses,r=i.ROOT,o=i.UNBOUNDED;requestAnimationFrame(function(){t.adapter.removeClass(r),t.adapter.removeClass(o),t.removeCssVars_()})}this.deregisterRootHandlers_(),this.deregisterDeactivationHandlers_()},n.prototype.activate=function(t){this.activate_(t)},n.prototype.deactivate=function(){this.deactivate_()},n.prototype.layout=function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame(function(){t.layoutInternal_(),t.layoutFrame_=0})},n.prototype.setUnbounded=function(t){var i=n.cssClasses.UNBOUNDED;t?this.adapter.addClass(i):this.adapter.removeClass(i)},n.prototype.handleFocus=function(){var t=this;requestAnimationFrame(function(){return t.adapter.addClass(n.cssClasses.BG_FOCUSED)})},n.prototype.handleBlur=function(){var t=this;requestAnimationFrame(function(){return t.adapter.removeClass(n.cssClasses.BG_FOCUSED)})},n.prototype.supportsPressRipple_=function(){return this.adapter.browserSupportsCssVars()},n.prototype.defaultActivationState_=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},n.prototype.registerRootHandlers_=function(t){var n=this;t&&(lA.forEach(function(t){n.adapter.registerInteractionHandler(t,n.activateHandler_)}),this.adapter.isUnbounded()&&this.adapter.registerResizeHandler(this.resizeHandler_)),this.adapter.registerInteractionHandler("focus",this.focusHandler_),this.adapter.registerInteractionHandler("blur",this.blurHandler_)},n.prototype.registerDeactivationHandlers_=function(t){var n=this;"keydown"===t.type?this.adapter.registerInteractionHandler("keyup",this.deactivateHandler_):lC.forEach(function(t){n.adapter.registerDocumentInteractionHandler(t,n.deactivateHandler_)})},n.prototype.deregisterRootHandlers_=function(){var t=this;lA.forEach(function(n){t.adapter.deregisterInteractionHandler(n,t.activateHandler_)}),this.adapter.deregisterInteractionHandler("focus",this.focusHandler_),this.adapter.deregisterInteractionHandler("blur",this.blurHandler_),this.adapter.isUnbounded()&&this.adapter.deregisterResizeHandler(this.resizeHandler_)},n.prototype.deregisterDeactivationHandlers_=function(){var t=this;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler_),lC.forEach(function(n){t.adapter.deregisterDocumentInteractionHandler(n,t.deactivateHandler_)})},n.prototype.removeCssVars_=function(){var t=this,i=n.strings;Object.keys(i).forEach(function(n){0===n.indexOf("VAR_")&&t.adapter.updateCssVariable(i[n],null)})},n.prototype.activate_=function(t){var n=this;if(!this.adapter.isSurfaceDisabled()){var i=this.activationState_;if(!i.isActivated){var r=this.previousActivationEvent_;if(!(r&&void 0!==t&&r.type!==t.type)){if(i.isActivated=!0,i.isProgrammatic=void 0===t,i.activationEvent=t,i.wasActivatedByPointer=!i.isProgrammatic&&void 0!==t&&("mousedown"===t.type||"touchstart"===t.type||"pointerdown"===t.type),void 0!==t&&lS.length>0&&lS.some(function(t){return n.adapter.containsEventTarget(t)}))return void this.resetActivationState_();void 0!==t&&(lS.push(t.target),this.registerDeactivationHandlers_(t)),i.wasElementMadeActive=this.checkElementMadeActive_(t),i.wasElementMadeActive&&this.animateActivation_(),requestAnimationFrame(function(){lS=[],!i.wasElementMadeActive&&void 0!==t&&(" "===t.key||32===t.keyCode)&&(i.wasElementMadeActive=n.checkElementMadeActive_(t),i.wasElementMadeActive&&n.animateActivation_()),i.wasElementMadeActive||(n.activationState_=n.defaultActivationState_())})}}}},n.prototype.checkElementMadeActive_=function(t){return void 0===t||"keydown"!==t.type||this.adapter.isSurfaceActive()},n.prototype.animateActivation_=function(){var t=this,i=n.strings,r=i.VAR_FG_TRANSLATE_START,o=i.VAR_FG_TRANSLATE_END,a=n.cssClasses,s=a.FG_DEACTIVATION,l=a.FG_ACTIVATION,c=n.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal_();var d="",u="";if(!this.adapter.isUnbounded()){var m=this.getFgTranslationCoordinates_(),h=m.startPoint,p=m.endPoint;d=h.x+"px, "+h.y+"px",u=p.x+"px, "+p.y+"px"}this.adapter.updateCssVariable(r,d),this.adapter.updateCssVariable(o,u),clearTimeout(this.activationTimer_),clearTimeout(this.fgDeactivationRemovalTimer_),this.rmBoundedActivationClasses_(),this.adapter.removeClass(s),this.adapter.computeBoundingRect(),this.adapter.addClass(l),this.activationTimer_=setTimeout(function(){return t.activationTimerCallback_()},c)},n.prototype.getFgTranslationCoordinates_=function(){var t,n=this.activationState_,i=n.activationEvent;return{startPoint:t={x:(t=n.wasActivatedByPointer?function(t,n,i){if(!t)return{x:0,y:0};var r,o,a=n.x,s=n.y,l=a+i.left,c=s+i.top;return"touchstart"===t.type?(r=t.changedTouches[0].pageX-l,o=t.changedTouches[0].pageY-c):(r=t.pageX-l,o=t.pageY-c),{x:r,y:o}}(i,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect()):{x:this.frame_.width/2,y:this.frame_.height/2}).x-this.initialSize_/2,y:t.y-this.initialSize_/2},endPoint:{x:this.frame_.width/2-this.initialSize_/2,y:this.frame_.height/2-this.initialSize_/2}}},n.prototype.runDeactivationUXLogicIfReady_=function(){var t=this,i=n.cssClasses.FG_DEACTIVATION,r=this.activationState_,o=r.hasDeactivationUXRun,a=r.isActivated;(o||!a)&&this.activationAnimationHasEnded_&&(this.rmBoundedActivationClasses_(),this.adapter.addClass(i),this.fgDeactivationRemovalTimer_=setTimeout(function(){t.adapter.removeClass(i)},lM.FG_DEACTIVATION_MS))},n.prototype.rmBoundedActivationClasses_=function(){var t=n.cssClasses.FG_ACTIVATION;this.adapter.removeClass(t),this.activationAnimationHasEnded_=!1,this.adapter.computeBoundingRect()},n.prototype.resetActivationState_=function(){var t=this;this.previousActivationEvent_=this.activationState_.activationEvent,this.activationState_=this.defaultActivationState_(),setTimeout(function(){return t.previousActivationEvent_=void 0},n.numbers.TAP_DELAY_MS)},n.prototype.deactivate_=function(){var t=this,n=this.activationState_;if(n.isActivated){var i=la({},n);n.isProgrammatic?(requestAnimationFrame(function(){return t.animateDeactivation_(i)}),this.resetActivationState_()):(this.deregisterDeactivationHandlers_(),requestAnimationFrame(function(){t.activationState_.hasDeactivationUXRun=!0,t.animateDeactivation_(i),t.resetActivationState_()}))}},n.prototype.animateDeactivation_=function(t){var n=t.wasActivatedByPointer,i=t.wasElementMadeActive;(n||i)&&this.runDeactivationUXLogicIfReady_()},n.prototype.layoutInternal_=function(){this.frame_=this.adapter.computeBoundingRect();var t=Math.max(this.frame_.height,this.frame_.width);this.maxRadius_=this.adapter.isUnbounded()?t:Math.sqrt(Math.pow(this.frame_.width,2)+Math.pow(this.frame_.height,2))+n.numbers.PADDING;var i=Math.floor(t*n.numbers.INITIAL_ORIGIN_SCALE);this.adapter.isUnbounded()&&i%2!=0?this.initialSize_=i-1:this.initialSize_=i,this.fgScale_=""+this.maxRadius_/this.initialSize_,this.updateLayoutCssVars_()},n.prototype.updateLayoutCssVars_=function(){var t=n.strings,i=t.VAR_FG_SIZE,r=t.VAR_LEFT,o=t.VAR_TOP,a=t.VAR_FG_SCALE;this.adapter.updateCssVariable(i,this.initialSize_+"px"),this.adapter.updateCssVariable(a,this.fgScale_),this.adapter.isUnbounded()&&(this.unboundedCoords_={left:Math.round(this.frame_.width/2-this.initialSize_/2),top:Math.round(this.frame_.height/2-this.initialSize_/2)},this.adapter.updateCssVariable(r,this.unboundedCoords_.left+"px"),this.adapter.updateCssVariable(o,this.unboundedCoords_.top+"px"))},n}(lc),lL=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.disabled=!1,n}return lo(n,t),n.attachTo=function(t,i){void 0===i&&(i={isUnbounded:void 0});var r=new n(t);return void 0!==i.isUnbounded&&(r.unbounded=i.isUnbounded),r},n.createAdapter=function(t){return{addClass:function(n){return t.root.classList.add(n)},browserSupportsCssVars:function(){return function(t,n){void 0===n&&(n=!1);var i=t.CSS,r=tP;if("boolean"==typeof tP&&!n)return tP;if(!(i&&"function"==typeof i.supports))return!1;var o=i.supports("--css-vars","yes"),a=i.supports("(--css-vars: yes)")&&i.supports("color","#00000000");return r=o||a,n||(tP=r),r}(window)},computeBoundingRect:function(){return t.root.getBoundingClientRect()},containsEventTarget:function(n){return t.root.contains(n)},deregisterDocumentInteractionHandler:function(t,n){return document.documentElement.removeEventListener(t,n,lu())},deregisterInteractionHandler:function(n,i){return t.root.removeEventListener(n,i,lu())},deregisterResizeHandler:function(t){return window.removeEventListener("resize",t)},getWindowPageOffset:function(){return{x:window.pageXOffset,y:window.pageYOffset}},isSurfaceActive:function(){return lh(t.root,":active")},isSurfaceDisabled:function(){return!!t.disabled},isUnbounded:function(){return!!t.unbounded},registerDocumentInteractionHandler:function(t,n){return document.documentElement.addEventListener(t,n,lu())},registerInteractionHandler:function(n,i){return t.root.addEventListener(n,i,lu())},registerResizeHandler:function(t){return window.addEventListener("resize",t)},removeClass:function(n){return t.root.classList.remove(n)},updateCssVariable:function(n,i){return t.root.style.setProperty(n,i)}}},Object.defineProperty(n.prototype,"unbounded",{get:function(){return!!this.unbounded_},set:function(t){this.unbounded_=!!t,this.setUnbounded_()},enumerable:!0,configurable:!0}),n.prototype.activate=function(){this.foundation.activate()},n.prototype.deactivate=function(){this.foundation.deactivate()},n.prototype.layout=function(){this.foundation.layout()},n.prototype.getDefaultFoundation=function(){return new lD(n.createAdapter(this))},n.prototype.initialSyncWithDOM=function(){var t=this.root;this.unbounded="mdcRippleIsUnbounded"in t.dataset},n.prototype.setUnbounded_=function(){this.foundation.setUnbounded(!!this.unbounded_)},n}(ld),lI={ROOT:"mdc-text-field-character-counter"},lP={ROOT_SELECTOR:"."+lI.ROOT},lO=function(t){function n(i){return t.call(this,la(la({},n.defaultAdapter),i))||this}return lo(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return lI},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return lP},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{setContent:function(){}}},enumerable:!0,configurable:!0}),n.prototype.setCounterValue=function(t,n){t=Math.min(t,n),this.adapter.setContent(t+" / "+n)},n}(lc),lR=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return lo(n,t),n.attachTo=function(t){return new n(t)},Object.defineProperty(n.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),n.prototype.getDefaultFoundation=function(){var t=this;return new lO({setContent:function(n){t.root.textContent=n}})},n}(ld),lB={ARIA_CONTROLS:"aria-controls",ARIA_DESCRIBEDBY:"aria-describedby",INPUT_SELECTOR:".mdc-text-field__input",LABEL_SELECTOR:".mdc-floating-label",LEADING_ICON_SELECTOR:".mdc-text-field__icon--leading",LINE_RIPPLE_SELECTOR:".mdc-line-ripple",OUTLINE_SELECTOR:".mdc-notched-outline",PREFIX_SELECTOR:".mdc-text-field__affix--prefix",SUFFIX_SELECTOR:".mdc-text-field__affix--suffix",TRAILING_ICON_SELECTOR:".mdc-text-field__icon--trailing"},lz={DISABLED:"mdc-text-field--disabled",FOCUSED:"mdc-text-field--focused",HELPER_LINE:"mdc-text-field-helper-line",INVALID:"mdc-text-field--invalid",LABEL_FLOATING:"mdc-text-field--label-floating",NO_LABEL:"mdc-text-field--no-label",OUTLINED:"mdc-text-field--outlined",ROOT:"mdc-text-field",TEXTAREA:"mdc-text-field--textarea",WITH_LEADING_ICON:"mdc-text-field--with-leading-icon",WITH_TRAILING_ICON:"mdc-text-field--with-trailing-icon"},lY={LABEL_SCALE:.75},lN=["pattern","min","max","required","step","minlength","maxlength"],lj=["color","date","datetime-local","month","range","time","week"],lH=["mousedown","touchstart"],lU=["click","keydown"],lV=function(t){function n(i,r){void 0===r&&(r={});var o=t.call(this,la(la({},n.defaultAdapter),i))||this;return o.isFocused_=!1,o.receivedUserInput_=!1,o.isValid_=!0,o.useNativeValidation_=!0,o.validateOnValueChange_=!0,o.helperText_=r.helperText,o.characterCounter_=r.characterCounter,o.leadingIcon_=r.leadingIcon,o.trailingIcon_=r.trailingIcon,o.inputFocusHandler_=function(){return o.activateFocus()},o.inputBlurHandler_=function(){return o.deactivateFocus()},o.inputInputHandler_=function(){return o.handleInput()},o.setPointerXOffset_=function(t){return o.setTransformOrigin(t)},o.textFieldInteractionHandler_=function(){return o.handleTextFieldInteraction()},o.validationAttributeChangeHandler_=function(t){return o.handleValidationAttributeChange(t)},o}return lo(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return lz},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return lB},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return lY},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"shouldAlwaysFloat_",{get:function(){var t=this.getNativeInput_().type;return lj.indexOf(t)>=0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"shouldFloat",{get:function(){return this.shouldAlwaysFloat_||this.isFocused_||!!this.getValue()||this.isBadInput_()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"shouldShake",{get:function(){return!this.isFocused_&&!this.isValid()&&!!this.getValue()},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!0},setInputAttr:function(){},removeInputAttr:function(){},registerTextFieldInteractionHandler:function(){},deregisterTextFieldInteractionHandler:function(){},registerInputInteractionHandler:function(){},deregisterInputInteractionHandler:function(){},registerValidationAttributeChangeHandler:function(){return new MutationObserver(function(){})},deregisterValidationAttributeChangeHandler:function(){},getNativeInput:function(){return null},isFocused:function(){return!1},activateLineRipple:function(){},deactivateLineRipple:function(){},setLineRippleTransformOrigin:function(){},shakeLabel:function(){},floatLabel:function(){},setLabelRequired:function(){},hasLabel:function(){return!1},getLabelWidth:function(){return 0},hasOutline:function(){return!1},notchOutline:function(){},closeOutline:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){var t=this;this.adapter.hasLabel()&&this.getNativeInput_().required&&this.adapter.setLabelRequired(!0),this.adapter.isFocused()?this.inputFocusHandler_():this.adapter.hasLabel()&&this.shouldFloat&&(this.notchOutline(!0),this.adapter.floatLabel(!0),this.styleFloating_(!0)),this.adapter.registerInputInteractionHandler("focus",this.inputFocusHandler_),this.adapter.registerInputInteractionHandler("blur",this.inputBlurHandler_),this.adapter.registerInputInteractionHandler("input",this.inputInputHandler_),lH.forEach(function(n){t.adapter.registerInputInteractionHandler(n,t.setPointerXOffset_)}),lU.forEach(function(n){t.adapter.registerTextFieldInteractionHandler(n,t.textFieldInteractionHandler_)}),this.validationObserver_=this.adapter.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler_),this.setCharacterCounter_(this.getValue().length)},n.prototype.destroy=function(){var t=this;this.adapter.deregisterInputInteractionHandler("focus",this.inputFocusHandler_),this.adapter.deregisterInputInteractionHandler("blur",this.inputBlurHandler_),this.adapter.deregisterInputInteractionHandler("input",this.inputInputHandler_),lH.forEach(function(n){t.adapter.deregisterInputInteractionHandler(n,t.setPointerXOffset_)}),lU.forEach(function(n){t.adapter.deregisterTextFieldInteractionHandler(n,t.textFieldInteractionHandler_)}),this.adapter.deregisterValidationAttributeChangeHandler(this.validationObserver_)},n.prototype.handleTextFieldInteraction=function(){var t=this.adapter.getNativeInput();t&&t.disabled||(this.receivedUserInput_=!0)},n.prototype.handleValidationAttributeChange=function(t){var n=this;t.some(function(t){return lN.indexOf(t)>-1&&(n.styleValidity_(!0),n.adapter.setLabelRequired(n.getNativeInput_().required),!0)}),t.indexOf("maxlength")>-1&&this.setCharacterCounter_(this.getValue().length)},n.prototype.notchOutline=function(t){if(this.adapter.hasOutline()&&this.adapter.hasLabel())if(t){var n=this.adapter.getLabelWidth()*lY.LABEL_SCALE;this.adapter.notchOutline(n)}else this.adapter.closeOutline()},n.prototype.activateFocus=function(){this.isFocused_=!0,this.styleFocused_(this.isFocused_),this.adapter.activateLineRipple(),this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.adapter.shakeLabel(this.shouldShake)),this.helperText_&&(this.helperText_.isPersistent()||!this.helperText_.isValidation()||!this.isValid_)&&this.helperText_.showToScreenReader()},n.prototype.setTransformOrigin=function(t){if(!(this.isDisabled()||this.adapter.hasOutline())){var n=t.touches,i=n?n[0]:t,r=i.target.getBoundingClientRect(),o=i.clientX-r.left;this.adapter.setLineRippleTransformOrigin(o)}},n.prototype.handleInput=function(){this.autoCompleteFocus(),this.setCharacterCounter_(this.getValue().length)},n.prototype.autoCompleteFocus=function(){this.receivedUserInput_||this.activateFocus()},n.prototype.deactivateFocus=function(){this.isFocused_=!1,this.adapter.deactivateLineRipple();var t=this.isValid();this.styleValidity_(t),this.styleFocused_(this.isFocused_),this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.adapter.shakeLabel(this.shouldShake)),this.shouldFloat||(this.receivedUserInput_=!1)},n.prototype.getValue=function(){return this.getNativeInput_().value},n.prototype.setValue=function(t){if(this.getValue()!==t&&(this.getNativeInput_().value=t),this.setCharacterCounter_(t.length),this.validateOnValueChange_){var n=this.isValid();this.styleValidity_(n)}this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.validateOnValueChange_&&this.adapter.shakeLabel(this.shouldShake))},n.prototype.isValid=function(){return this.useNativeValidation_?this.isNativeInputValid_():this.isValid_},n.prototype.setValid=function(t){this.isValid_=t,this.styleValidity_(t);var n=!t&&!this.isFocused_&&!!this.getValue();this.adapter.hasLabel()&&this.adapter.shakeLabel(n)},n.prototype.setValidateOnValueChange=function(t){this.validateOnValueChange_=t},n.prototype.getValidateOnValueChange=function(){return this.validateOnValueChange_},n.prototype.setUseNativeValidation=function(t){this.useNativeValidation_=t},n.prototype.isDisabled=function(){return this.getNativeInput_().disabled},n.prototype.setDisabled=function(t){this.getNativeInput_().disabled=t,this.styleDisabled_(t)},n.prototype.setHelperTextContent=function(t){this.helperText_&&this.helperText_.setContent(t)},n.prototype.setLeadingIconAriaLabel=function(t){this.leadingIcon_&&this.leadingIcon_.setAriaLabel(t)},n.prototype.setLeadingIconContent=function(t){this.leadingIcon_&&this.leadingIcon_.setContent(t)},n.prototype.setTrailingIconAriaLabel=function(t){this.trailingIcon_&&this.trailingIcon_.setAriaLabel(t)},n.prototype.setTrailingIconContent=function(t){this.trailingIcon_&&this.trailingIcon_.setContent(t)},n.prototype.setCharacterCounter_=function(t){if(this.characterCounter_){var n=this.getNativeInput_().maxLength;if(-1===n)throw Error("MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.");this.characterCounter_.setCounterValue(t,n)}},n.prototype.isBadInput_=function(){return this.getNativeInput_().validity.badInput||!1},n.prototype.isNativeInputValid_=function(){return this.getNativeInput_().validity.valid},n.prototype.styleValidity_=function(t){var i=n.cssClasses.INVALID;if(t?this.adapter.removeClass(i):this.adapter.addClass(i),this.helperText_){if(this.helperText_.setValidity(t),!this.helperText_.isValidation())return;var r=this.helperText_.isVisible(),o=this.helperText_.getId();r&&o?this.adapter.setInputAttr(lB.ARIA_DESCRIBEDBY,o):this.adapter.removeInputAttr(lB.ARIA_DESCRIBEDBY)}},n.prototype.styleFocused_=function(t){var i=n.cssClasses.FOCUSED;t?this.adapter.addClass(i):this.adapter.removeClass(i)},n.prototype.styleDisabled_=function(t){var i=n.cssClasses,r=i.DISABLED,o=i.INVALID;t?(this.adapter.addClass(r),this.adapter.removeClass(o)):this.adapter.removeClass(r),this.leadingIcon_&&this.leadingIcon_.setDisabled(t),this.trailingIcon_&&this.trailingIcon_.setDisabled(t)},n.prototype.styleFloating_=function(t){var i=n.cssClasses.LABEL_FLOATING;t?this.adapter.addClass(i):this.adapter.removeClass(i)},n.prototype.getNativeInput_=function(){return(this.adapter?this.adapter.getNativeInput():null)||{disabled:!1,maxLength:-1,required:!1,type:"input",validity:{badInput:!1,valid:!0},value:""}},n}(lc),lq={HELPER_TEXT_PERSISTENT:"mdc-text-field-helper-text--persistent",HELPER_TEXT_VALIDATION_MSG:"mdc-text-field-helper-text--validation-msg",ROOT:"mdc-text-field-helper-text"},lG={ARIA_HIDDEN:"aria-hidden",ROLE:"role",ROOT_SELECTOR:"."+lq.ROOT},l$=function(t){function n(i){return t.call(this,la(la({},n.defaultAdapter),i))||this}return lo(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return lq},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return lG},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){}}},enumerable:!0,configurable:!0}),n.prototype.getId=function(){return this.adapter.getAttr("id")},n.prototype.isVisible=function(){return"true"!==this.adapter.getAttr(lG.ARIA_HIDDEN)},n.prototype.setContent=function(t){this.adapter.setContent(t)},n.prototype.isPersistent=function(){return this.adapter.hasClass(lq.HELPER_TEXT_PERSISTENT)},n.prototype.setPersistent=function(t){t?this.adapter.addClass(lq.HELPER_TEXT_PERSISTENT):this.adapter.removeClass(lq.HELPER_TEXT_PERSISTENT)},n.prototype.isValidation=function(){return this.adapter.hasClass(lq.HELPER_TEXT_VALIDATION_MSG)},n.prototype.setValidation=function(t){t?this.adapter.addClass(lq.HELPER_TEXT_VALIDATION_MSG):this.adapter.removeClass(lq.HELPER_TEXT_VALIDATION_MSG)},n.prototype.showToScreenReader=function(){this.adapter.removeAttr(lG.ARIA_HIDDEN)},n.prototype.setValidity=function(t){var n=this.adapter.hasClass(lq.HELPER_TEXT_PERSISTENT),i=this.adapter.hasClass(lq.HELPER_TEXT_VALIDATION_MSG)&&!t;i?(this.showToScreenReader(),this.adapter.setAttr(lG.ROLE,"alert")):this.adapter.removeAttr(lG.ROLE),n||i||this.hide_()},n.prototype.hide_=function(){this.adapter.setAttr(lG.ARIA_HIDDEN,"true")},n}(lc),lW=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return lo(n,t),n.attachTo=function(t){return new n(t)},Object.defineProperty(n.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),n.prototype.getDefaultFoundation=function(){var t=this;return new l$({addClass:function(n){return t.root.classList.add(n)},removeClass:function(n){return t.root.classList.remove(n)},hasClass:function(n){return t.root.classList.contains(n)},getAttr:function(n){return t.root.getAttribute(n)},setAttr:function(n,i){return t.root.setAttribute(n,i)},removeAttr:function(n){return t.root.removeAttribute(n)},setContent:function(n){t.root.textContent=n}})},n}(ld),lX={ICON_EVENT:"MDCTextField:icon",ICON_ROLE:"button"},lZ={ROOT:"mdc-text-field__icon"},lK=["click","keydown"],lJ=function(t){function n(i){var r=t.call(this,la(la({},n.defaultAdapter),i))||this;return r.savedTabIndex_=null,r.interactionHandler_=function(t){return r.handleInteraction(t)},r}return lo(n,t),Object.defineProperty(n,"strings",{get:function(){return lX},enumerable:!0,configurable:!0}),Object.defineProperty(n,"cssClasses",{get:function(){return lZ},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},notifyIconAction:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){var t=this;this.savedTabIndex_=this.adapter.getAttr("tabindex"),lK.forEach(function(n){t.adapter.registerInteractionHandler(n,t.interactionHandler_)})},n.prototype.destroy=function(){var t=this;lK.forEach(function(n){t.adapter.deregisterInteractionHandler(n,t.interactionHandler_)})},n.prototype.setDisabled=function(t){this.savedTabIndex_&&(t?(this.adapter.setAttr("tabindex","-1"),this.adapter.removeAttr("role")):(this.adapter.setAttr("tabindex",this.savedTabIndex_),this.adapter.setAttr("role",lX.ICON_ROLE)))},n.prototype.setAriaLabel=function(t){this.adapter.setAttr("aria-label",t)},n.prototype.setContent=function(t){this.adapter.setContent(t)},n.prototype.handleInteraction=function(t){var n="Enter"===t.key||13===t.keyCode;("click"===t.type||n)&&(t.preventDefault(),this.adapter.notifyIconAction())},n}(lc),lQ=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return lo(n,t),n.attachTo=function(t){return new n(t)},Object.defineProperty(n.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),n.prototype.getDefaultFoundation=function(){var t=this;return new lJ({getAttr:function(n){return t.root.getAttribute(n)},setAttr:function(n,i){return t.root.setAttribute(n,i)},removeAttr:function(n){return t.root.removeAttribute(n)},setContent:function(n){t.root.textContent=n},registerInteractionHandler:function(n,i){return t.listen(n,i)},deregisterInteractionHandler:function(n,i){return t.unlisten(n,i)},notifyIconAction:function(){return t.emit(lJ.strings.ICON_EVENT,{},!0)}})},n}(ld),l0=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return lo(n,t),n.attachTo=function(t){return new n(t)},n.prototype.initialize=function(t,n,i,r,o,a,s){void 0===t&&(t=function(t,n){return new lL(t,n)}),void 0===n&&(n=function(t){return new ly(t)}),void 0===i&&(i=function(t){return new lW(t)}),void 0===r&&(r=function(t){return new lR(t)}),void 0===o&&(o=function(t){return new lQ(t)}),void 0===a&&(a=function(t){return new lb(t)}),void 0===s&&(s=function(t){return new lk(t)}),this.input_=this.root.querySelector(lB.INPUT_SELECTOR);var l=this.root.querySelector(lB.LABEL_SELECTOR);this.label_=l?a(l):null;var c=this.root.querySelector(lB.LINE_RIPPLE_SELECTOR);this.lineRipple_=c?n(c):null;var d=this.root.querySelector(lB.OUTLINE_SELECTOR);this.outline_=d?s(d):null;var u=l$.strings,m=this.root.nextElementSibling,h=m&&m.classList.contains(lz.HELPER_LINE),p=h&&m&&m.querySelector(u.ROOT_SELECTOR);this.helperText_=p?i(p):null;var f=lO.strings,b=this.root.querySelector(f.ROOT_SELECTOR);!b&&h&&m&&(b=m.querySelector(f.ROOT_SELECTOR)),this.characterCounter_=b?r(b):null;var g=this.root.querySelector(lB.LEADING_ICON_SELECTOR);this.leadingIcon_=g?o(g):null;var _=this.root.querySelector(lB.TRAILING_ICON_SELECTOR);this.trailingIcon_=_?o(_):null,this.prefix_=this.root.querySelector(lB.PREFIX_SELECTOR),this.suffix_=this.root.querySelector(lB.SUFFIX_SELECTOR),this.ripple=this.createRipple_(t)},n.prototype.destroy=function(){this.ripple&&this.ripple.destroy(),this.lineRipple_&&this.lineRipple_.destroy(),this.helperText_&&this.helperText_.destroy(),this.characterCounter_&&this.characterCounter_.destroy(),this.leadingIcon_&&this.leadingIcon_.destroy(),this.trailingIcon_&&this.trailingIcon_.destroy(),this.label_&&this.label_.destroy(),this.outline_&&this.outline_.destroy(),t.prototype.destroy.call(this)},n.prototype.initialSyncWithDOM=function(){this.disabled=this.input_.disabled},Object.defineProperty(n.prototype,"value",{get:function(){return this.foundation.getValue()},set:function(t){this.foundation.setValue(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this.foundation.isDisabled()},set:function(t){this.foundation.setDisabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"valid",{get:function(){return this.foundation.isValid()},set:function(t){this.foundation.setValid(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"required",{get:function(){return this.input_.required},set:function(t){this.input_.required=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"pattern",{get:function(){return this.input_.pattern},set:function(t){this.input_.pattern=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"minLength",{get:function(){return this.input_.minLength},set:function(t){this.input_.minLength=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"maxLength",{get:function(){return this.input_.maxLength},set:function(t){t<0?this.input_.removeAttribute("maxLength"):this.input_.maxLength=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.input_.min},set:function(t){this.input_.min=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.input_.max},set:function(t){this.input_.max=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"step",{get:function(){return this.input_.step},set:function(t){this.input_.step=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"helperTextContent",{set:function(t){this.foundation.setHelperTextContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"leadingIconAriaLabel",{set:function(t){this.foundation.setLeadingIconAriaLabel(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"leadingIconContent",{set:function(t){this.foundation.setLeadingIconContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"trailingIconAriaLabel",{set:function(t){this.foundation.setTrailingIconAriaLabel(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"trailingIconContent",{set:function(t){this.foundation.setTrailingIconContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"useNativeValidation",{set:function(t){this.foundation.setUseNativeValidation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"prefixText",{get:function(){return this.prefix_?this.prefix_.textContent:null},set:function(t){this.prefix_&&(this.prefix_.textContent=t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"suffixText",{get:function(){return this.suffix_?this.suffix_.textContent:null},set:function(t){this.suffix_&&(this.suffix_.textContent=t)},enumerable:!0,configurable:!0}),n.prototype.focus=function(){this.input_.focus()},n.prototype.layout=function(){var t=this.foundation.shouldFloat;this.foundation.notchOutline(t)},n.prototype.getDefaultFoundation=function(){return new lV(la(la(la(la(la({},this.getRootAdapterMethods_()),this.getInputAdapterMethods_()),this.getLabelAdapterMethods_()),this.getLineRippleAdapterMethods_()),this.getOutlineAdapterMethods_()),this.getFoundationMap_())},n.prototype.getRootAdapterMethods_=function(){var t=this;return{addClass:function(n){return t.root.classList.add(n)},removeClass:function(n){return t.root.classList.remove(n)},hasClass:function(n){return t.root.classList.contains(n)},registerTextFieldInteractionHandler:function(n,i){t.listen(n,i)},deregisterTextFieldInteractionHandler:function(n,i){t.unlisten(n,i)},registerValidationAttributeChangeHandler:function(n){var i=new MutationObserver(function(t){return n(t.map(function(t){return t.attributeName}).filter(function(t){return t}))});return i.observe(t.input_,{attributes:!0}),i},deregisterValidationAttributeChangeHandler:function(t){t.disconnect()}}},n.prototype.getInputAdapterMethods_=function(){var t=this;return{getNativeInput:function(){return t.input_},setInputAttr:function(n,i){t.input_.setAttribute(n,i)},removeInputAttr:function(n){t.input_.removeAttribute(n)},isFocused:function(){return document.activeElement===t.input_},registerInputInteractionHandler:function(n,i){t.input_.addEventListener(n,i,lu())},deregisterInputInteractionHandler:function(n,i){t.input_.removeEventListener(n,i,lu())}}},n.prototype.getLabelAdapterMethods_=function(){var t=this;return{floatLabel:function(n){return t.label_&&t.label_.float(n)},getLabelWidth:function(){return t.label_?t.label_.getWidth():0},hasLabel:function(){return!!t.label_},shakeLabel:function(n){return t.label_&&t.label_.shake(n)},setLabelRequired:function(n){return t.label_&&t.label_.setRequired(n)}}},n.prototype.getLineRippleAdapterMethods_=function(){var t=this;return{activateLineRipple:function(){t.lineRipple_&&t.lineRipple_.activate()},deactivateLineRipple:function(){t.lineRipple_&&t.lineRipple_.deactivate()},setLineRippleTransformOrigin:function(n){t.lineRipple_&&t.lineRipple_.setRippleCenter(n)}}},n.prototype.getOutlineAdapterMethods_=function(){var t=this;return{closeOutline:function(){return t.outline_&&t.outline_.closeNotch()},hasOutline:function(){return!!t.outline_},notchOutline:function(n){return t.outline_&&t.outline_.notch(n)}}},n.prototype.getFoundationMap_=function(){return{characterCounter:this.characterCounter_?this.characterCounter_.foundationForTextField:void 0,helperText:this.helperText_?this.helperText_.foundationForTextField:void 0,leadingIcon:this.leadingIcon_?this.leadingIcon_.foundationForTextField:void 0,trailingIcon:this.trailingIcon_?this.trailingIcon_.foundationForTextField:void 0}},n.prototype.createRipple_=function(t){var n=this,i=this.root.classList.contains(lz.TEXTAREA),r=this.root.classList.contains(lz.OUTLINED);if(i||r)return null;var o=la(la({},lL.createAdapter(this)),{isSurfaceActive:function(){return lh(n.input_,":active")},registerInteractionHandler:function(t,i){return n.input_.addEventListener(t,i,lu())},deregisterInteractionHandler:function(t,i){return n.input_.removeEventListener(t,i,lu())}});return t(this.root,new lD(o))},n}(ld),l1={animation:{prefixed:"-webkit-animation",standard:"animation"},transform:{prefixed:"-webkit-transform",standard:"transform"},transition:{prefixed:"-webkit-transition",standard:"transition"}},l2={animationend:{cssProperty:"animation",prefixed:"webkitAnimationEnd",standard:"animationend"},animationiteration:{cssProperty:"animation",prefixed:"webkitAnimationIteration",standard:"animationiteration"},animationstart:{cssProperty:"animation",prefixed:"webkitAnimationStart",standard:"animationstart"},transitionend:{cssProperty:"transition",prefixed:"webkitTransitionEnd",standard:"transitionend"}};function l5(t){return!!t.document&&"function"==typeof t.document.createElement}function l3(t,n){if(l5(t)&&n in l1){var i=t.document.createElement("div"),r=l1[n],o=r.standard,a=r.prefixed;return o in i.style?o:a}return n}function l4(t,n){if(l5(t)&&n in l2){var i=t.document.createElement("div"),r=l2[n],o=r.standard,a=r.prefixed;return r.cssProperty in i.style?o:a}return n}var l6={ANIM_CHECKED_INDETERMINATE:"mdc-checkbox--anim-checked-indeterminate",ANIM_CHECKED_UNCHECKED:"mdc-checkbox--anim-checked-unchecked",ANIM_INDETERMINATE_CHECKED:"mdc-checkbox--anim-indeterminate-checked",ANIM_INDETERMINATE_UNCHECKED:"mdc-checkbox--anim-indeterminate-unchecked",ANIM_UNCHECKED_CHECKED:"mdc-checkbox--anim-unchecked-checked",ANIM_UNCHECKED_INDETERMINATE:"mdc-checkbox--anim-unchecked-indeterminate",BACKGROUND:"mdc-checkbox__background",CHECKED:"mdc-checkbox--checked",CHECKMARK:"mdc-checkbox__checkmark",CHECKMARK_PATH:"mdc-checkbox__checkmark-path",DISABLED:"mdc-checkbox--disabled",INDETERMINATE:"mdc-checkbox--indeterminate",MIXEDMARK:"mdc-checkbox__mixedmark",NATIVE_CONTROL:"mdc-checkbox__native-control",ROOT:"mdc-checkbox",SELECTED:"mdc-checkbox--selected",UPGRADED:"mdc-checkbox--upgraded"},l8={ARIA_CHECKED_ATTR:"aria-checked",ARIA_CHECKED_INDETERMINATE_VALUE:"mixed",DATA_INDETERMINATE_ATTR:"data-indeterminate",NATIVE_CONTROL_SELECTOR:".mdc-checkbox__native-control",TRANSITION_STATE_CHECKED:"checked",TRANSITION_STATE_INDETERMINATE:"indeterminate",TRANSITION_STATE_INIT:"init",TRANSITION_STATE_UNCHECKED:"unchecked"},l7={ANIM_END_LATCH_MS:250},l9=function(t){function n(i){var r=t.call(this,la(la({},n.defaultAdapter),i))||this;return r.currentCheckState_=l8.TRANSITION_STATE_INIT,r.currentAnimationClass_="",r.animEndLatchTimer_=0,r.enableAnimationEndHandler_=!1,r}return lo(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return l6},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return l8},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return l7},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},forceLayout:function(){},hasNativeControl:function(){return!1},isAttachedToDOM:function(){return!1},isChecked:function(){return!1},isIndeterminate:function(){return!1},removeClass:function(){},removeNativeControlAttr:function(){},setNativeControlAttr:function(){},setNativeControlDisabled:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){this.currentCheckState_=this.determineCheckState_(),this.updateAriaChecked_(),this.adapter.addClass(l6.UPGRADED)},n.prototype.destroy=function(){clearTimeout(this.animEndLatchTimer_)},n.prototype.setDisabled=function(t){this.adapter.setNativeControlDisabled(t),t?this.adapter.addClass(l6.DISABLED):this.adapter.removeClass(l6.DISABLED)},n.prototype.handleAnimationEnd=function(){var t=this;this.enableAnimationEndHandler_&&(clearTimeout(this.animEndLatchTimer_),this.animEndLatchTimer_=setTimeout(function(){t.adapter.removeClass(t.currentAnimationClass_),t.enableAnimationEndHandler_=!1},l7.ANIM_END_LATCH_MS))},n.prototype.handleChange=function(){this.transitionCheckState_()},n.prototype.transitionCheckState_=function(){if(this.adapter.hasNativeControl()){var t=this.currentCheckState_,n=this.determineCheckState_();if(t!==n){this.updateAriaChecked_();var i=l8.TRANSITION_STATE_UNCHECKED,r=l6.SELECTED;n===i?this.adapter.removeClass(r):this.adapter.addClass(r),this.currentAnimationClass_.length>0&&(clearTimeout(this.animEndLatchTimer_),this.adapter.forceLayout(),this.adapter.removeClass(this.currentAnimationClass_)),this.currentAnimationClass_=this.getTransitionAnimationClass_(t,n),this.currentCheckState_=n,this.adapter.isAttachedToDOM()&&this.currentAnimationClass_.length>0&&(this.adapter.addClass(this.currentAnimationClass_),this.enableAnimationEndHandler_=!0)}}},n.prototype.determineCheckState_=function(){var t=l8.TRANSITION_STATE_INDETERMINATE,n=l8.TRANSITION_STATE_CHECKED,i=l8.TRANSITION_STATE_UNCHECKED;return this.adapter.isIndeterminate()?t:this.adapter.isChecked()?n:i},n.prototype.getTransitionAnimationClass_=function(t,i){var r=l8.TRANSITION_STATE_INIT,o=l8.TRANSITION_STATE_CHECKED,a=l8.TRANSITION_STATE_UNCHECKED,s=n.cssClasses,l=s.ANIM_UNCHECKED_CHECKED,c=s.ANIM_UNCHECKED_INDETERMINATE,d=s.ANIM_CHECKED_UNCHECKED,u=s.ANIM_CHECKED_INDETERMINATE,m=s.ANIM_INDETERMINATE_CHECKED,h=s.ANIM_INDETERMINATE_UNCHECKED;switch(t){case r:if(i===a)return"";return i===o?m:h;case a:return i===o?l:c;case o:return i===a?d:u;default:return i===o?m:h}},n.prototype.updateAriaChecked_=function(){this.adapter.isIndeterminate()?this.adapter.setNativeControlAttr(l8.ARIA_CHECKED_ATTR,l8.ARIA_CHECKED_INDETERMINATE_VALUE):this.adapter.removeNativeControlAttr(l8.ARIA_CHECKED_ATTR)},n}(lc),ce=["checked","indeterminate"],ct=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.ripple_=n.createRipple_(),n}return lo(n,t),n.attachTo=function(t){return new n(t)},Object.defineProperty(n.prototype,"ripple",{get:function(){return this.ripple_},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"checked",{get:function(){return this.nativeControl_.checked},set:function(t){this.nativeControl_.checked=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"indeterminate",{get:function(){return this.nativeControl_.indeterminate},set:function(t){this.nativeControl_.indeterminate=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this.nativeControl_.disabled},set:function(t){this.foundation.setDisabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.nativeControl_.value},set:function(t){this.nativeControl_.value=t},enumerable:!0,configurable:!0}),n.prototype.initialize=function(){var t=l8.DATA_INDETERMINATE_ATTR;this.nativeControl_.indeterminate="true"===this.nativeControl_.getAttribute(t),this.nativeControl_.removeAttribute(t)},n.prototype.initialSyncWithDOM=function(){var t=this;this.handleChange_=function(){return t.foundation.handleChange()},this.handleAnimationEnd_=function(){return t.foundation.handleAnimationEnd()},this.nativeControl_.addEventListener("change",this.handleChange_),this.listen(l4(window,"animationend"),this.handleAnimationEnd_),this.installPropertyChangeHooks_()},n.prototype.destroy=function(){this.ripple_.destroy(),this.nativeControl_.removeEventListener("change",this.handleChange_),this.unlisten(l4(window,"animationend"),this.handleAnimationEnd_),this.uninstallPropertyChangeHooks_(),t.prototype.destroy.call(this)},n.prototype.getDefaultFoundation=function(){var t=this;return new l9({addClass:function(n){return t.root.classList.add(n)},forceLayout:function(){return t.root.offsetWidth},hasNativeControl:function(){return!!t.nativeControl_},isAttachedToDOM:function(){return!!t.root.parentNode},isChecked:function(){return t.checked},isIndeterminate:function(){return t.indeterminate},removeClass:function(n){t.root.classList.remove(n)},removeNativeControlAttr:function(n){t.nativeControl_.removeAttribute(n)},setNativeControlAttr:function(n,i){t.nativeControl_.setAttribute(n,i)},setNativeControlDisabled:function(n){t.nativeControl_.disabled=n}})},n.prototype.createRipple_=function(){var t=this,n=la(la({},lL.createAdapter(this)),{deregisterInteractionHandler:function(n,i){return t.nativeControl_.removeEventListener(n,i,lu())},isSurfaceActive:function(){return lh(t.nativeControl_,":active")},isUnbounded:function(){return!0},registerInteractionHandler:function(n,i){return t.nativeControl_.addEventListener(n,i,lu())}});return new lL(this.root,new lD(n))},n.prototype.installPropertyChangeHooks_=function(){var t=this,n=this.nativeControl_,i=Object.getPrototypeOf(n);ce.forEach(function(r){var o=Object.getOwnPropertyDescriptor(i,r);if(cn(o)){var a=o.get,s={configurable:o.configurable,enumerable:o.enumerable,get:a,set:function(i){o.set.call(n,i),t.foundation.handleChange()}};Object.defineProperty(n,r,s)}})},n.prototype.uninstallPropertyChangeHooks_=function(){var t=this.nativeControl_,n=Object.getPrototypeOf(t);ce.forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);cn(r)&&Object.defineProperty(t,i,r)})},Object.defineProperty(n.prototype,"nativeControl_",{get:function(){var t=l8.NATIVE_CONTROL_SELECTOR,n=this.root.querySelector(t);if(!n)throw Error("Checkbox component requires a "+t+" element");return n},enumerable:!0,configurable:!0}),n}(ld);function cn(t){return!!t&&"function"==typeof t.set}var ci={CHECKED:"mdc-switch--checked",DISABLED:"mdc-switch--disabled"},cr={ARIA_CHECKED_ATTR:"aria-checked",NATIVE_CONTROL_SELECTOR:".mdc-switch__native-control",RIPPLE_SURFACE_SELECTOR:".mdc-switch__thumb-underlay"},co=function(t){function n(i){return t.call(this,la(la({},n.defaultAdapter),i))||this}return lo(n,t),Object.defineProperty(n,"strings",{get:function(){return cr},enumerable:!0,configurable:!0}),Object.defineProperty(n,"cssClasses",{get:function(){return ci},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNativeControlChecked:function(){},setNativeControlDisabled:function(){},setNativeControlAttr:function(){}}},enumerable:!0,configurable:!0}),n.prototype.setChecked=function(t){this.adapter.setNativeControlChecked(t),this.updateAriaChecked_(t),this.updateCheckedStyling_(t)},n.prototype.setDisabled=function(t){this.adapter.setNativeControlDisabled(t),t?this.adapter.addClass(ci.DISABLED):this.adapter.removeClass(ci.DISABLED)},n.prototype.handleChange=function(t){var n=t.target;this.updateAriaChecked_(n.checked),this.updateCheckedStyling_(n.checked)},n.prototype.updateCheckedStyling_=function(t){t?this.adapter.addClass(ci.CHECKED):this.adapter.removeClass(ci.CHECKED)},n.prototype.updateAriaChecked_=function(t){this.adapter.setNativeControlAttr(cr.ARIA_CHECKED_ATTR,""+!!t)},n}(lc),ca=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.ripple_=n.createRipple_(),n}return lo(n,t),n.attachTo=function(t){return new n(t)},n.prototype.destroy=function(){t.prototype.destroy.call(this),this.ripple_.destroy(),this.nativeControl_.removeEventListener("change",this.changeHandler_)},n.prototype.initialSyncWithDOM=function(){var t=this;this.changeHandler_=function(){for(var n,i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];return(n=t.foundation).handleChange.apply(n,ll(i))},this.nativeControl_.addEventListener("change",this.changeHandler_),this.checked=this.checked},n.prototype.getDefaultFoundation=function(){var t=this;return new co({addClass:function(n){return t.root.classList.add(n)},removeClass:function(n){return t.root.classList.remove(n)},setNativeControlChecked:function(n){return t.nativeControl_.checked=n},setNativeControlDisabled:function(n){return t.nativeControl_.disabled=n},setNativeControlAttr:function(n,i){return t.nativeControl_.setAttribute(n,i)}})},Object.defineProperty(n.prototype,"ripple",{get:function(){return this.ripple_},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"checked",{get:function(){return this.nativeControl_.checked},set:function(t){this.foundation.setChecked(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this.nativeControl_.disabled},set:function(t){this.foundation.setDisabled(t)},enumerable:!0,configurable:!0}),n.prototype.createRipple_=function(){var t=this,n=co.strings.RIPPLE_SURFACE_SELECTOR,i=this.root.querySelector(n),r=la(la({},lL.createAdapter(this)),{addClass:function(t){return i.classList.add(t)},computeBoundingRect:function(){return i.getBoundingClientRect()},deregisterInteractionHandler:function(n,i){t.nativeControl_.removeEventListener(n,i,lu())},isSurfaceActive:function(){return lh(t.nativeControl_,":active")},isUnbounded:function(){return!0},registerInteractionHandler:function(n,i){t.nativeControl_.addEventListener(n,i,lu())},removeClass:function(t){i.classList.remove(t)},updateCssVariable:function(t,n){i.style.setProperty(t,n)}});return new lL(this.root,new lD(r))},Object.defineProperty(n.prototype,"nativeControl_",{get:function(){var t=co.strings.NATIVE_CONTROL_SELECTOR;return this.root.querySelector(t)},enumerable:!0,configurable:!0}),n}(ld),cs="mdc-slider--disabled",cl="mdc-slider__thumb",cc="mdc-slider__thumb--top",cd="mdc-slider__thumb--with-indicator",cu="mdc-slider__tick-marks",cm="mdc-slider__tick-mark--active",ch="mdc-slider__tick-mark--inactive",cp="disabled",cf="value",cb="step";(ew=tO||(tO={}))[ew.ACTIVE=0]="ACTIVE",ew[ew.INACTIVE=1]="INACTIVE",(eF=tR||(tR={}))[eF.START=1]="START",eF[eF.END=2]="END";var cg="u">typeof window,c_=function(t){function n(i){var r=t.call(this,la(la({},n.defaultAdapter),i))||this;return r.initialStylesRemoved=!1,r.isDisabled=!1,r.isDiscrete=!1,r.step=1,r.hasTickMarks=!1,r.isRange=!1,r.thumb=null,r.downEventClientX=null,r.startThumbKnobWidth=0,r.endThumbKnobWidth=0,r}return lo(n,t),Object.defineProperty(n,"defaultAdapter",{get:function(){return{hasClass:function(){return!1},addClass:function(){},removeClass:function(){},addThumbClass:function(){},removeThumbClass:function(){},getAttribute:function(){return null},getInputValue:function(){return""},setInputValue:function(){},getInputAttribute:function(){return null},setInputAttribute:function(){return null},removeInputAttribute:function(){return null},focusInput:function(){},isInputFocused:function(){return!1},getThumbKnobWidth:function(){return 0},getThumbBoundingClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},getBoundingClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},isRTL:function(){return!1},setThumbStyleProperty:function(){},removeThumbStyleProperty:function(){},setTrackActiveStyleProperty:function(){},removeTrackActiveStyleProperty:function(){},setValueIndicatorText:function(){},getValueToAriaValueTextFn:function(){return null},updateTickMarks:function(){},setPointerCapture:function(){},emitChangeEvent:function(){},emitInputEvent:function(){},emitDragStartEvent:function(){},emitDragEndEvent:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){},registerThumbEventHandler:function(){},deregisterThumbEventHandler:function(){},registerInputEventHandler:function(){},deregisterInputEventHandler:function(){},registerBodyEventHandler:function(){},deregisterBodyEventHandler:function(){},registerWindowEventHandler:function(){},deregisterWindowEventHandler:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){var t=this;this.isDisabled=this.adapter.hasClass(cs),this.isDiscrete=this.adapter.hasClass("mdc-slider--discrete"),this.hasTickMarks=this.adapter.hasClass("mdc-slider--tick-marks"),this.isRange=this.adapter.hasClass("mdc-slider--range");var n=this.convertAttributeValueToNumber(this.adapter.getInputAttribute("min",this.isRange?tR.START:tR.END),"min"),i=this.convertAttributeValueToNumber(this.adapter.getInputAttribute("max",tR.END),"max"),r=this.convertAttributeValueToNumber(this.adapter.getInputAttribute(cf,tR.END),cf),o=this.isRange?this.convertAttributeValueToNumber(this.adapter.getInputAttribute(cf,tR.START),cf):n;this.validateProperties({min:n,max:i,value:r,valueStart:o}),this.min=n,this.max=i,this.value=r,this.valueStart=o,this.valueBeforeDownEvent=r,this.valueStartBeforeDownEvent=o;var a=this.adapter.getInputAttribute(cb,tR.END);if(a&&(this.step=this.convertAttributeValueToNumber(a,cb)),this.step<=0)throw Error("MDCSliderFoundation: step must be a positive number. Current step: "+this.step);this.mousedownOrTouchstartListener=this.handleMousedownOrTouchstart.bind(this),this.moveListener=this.handleMove.bind(this),this.pointerdownListener=this.handlePointerdown.bind(this),this.pointerupListener=this.handlePointerup.bind(this),this.thumbMouseenterListener=this.handleThumbMouseenter.bind(this),this.thumbMouseleaveListener=this.handleThumbMouseleave.bind(this),this.inputStartChangeListener=function(){t.handleInputChange(tR.START)},this.inputEndChangeListener=function(){t.handleInputChange(tR.END)},this.inputStartFocusListener=function(){t.handleInputFocus(tR.START)},this.inputEndFocusListener=function(){t.handleInputFocus(tR.END)},this.inputStartBlurListener=function(){t.handleInputBlur(tR.START)},this.inputEndBlurListener=function(){t.handleInputBlur(tR.END)},this.resizeListener=this.handleResize.bind(this),this.registerEventHandlers()},n.prototype.destroy=function(){this.deregisterEventHandlers()},n.prototype.getMin=function(){return this.min},n.prototype.getMax=function(){return this.max},n.prototype.getValue=function(){return this.value},n.prototype.setValue=function(t){if(this.isRange&&t<this.valueStart)throw Error("end thumb value ("+t+") must be >= start thumb value ("+this.valueStart+")");this.updateValue(t,tR.END)},n.prototype.getValueStart=function(){if(!this.isRange)throw Error("`valueStart` is only applicable for range sliders.");return this.valueStart},n.prototype.setValueStart=function(t){if(!this.isRange)throw Error("`valueStart` is only applicable for range sliders.");if(this.isRange&&t>this.value)throw Error("start thumb value ("+t+") must be <= end thumb value ("+this.value+")");this.updateValue(t,tR.START)},n.prototype.getStep=function(){return this.step},n.prototype.getDisabled=function(){return this.isDisabled},n.prototype.setDisabled=function(t){this.isDisabled=t,t?(this.adapter.addClass(cs),this.isRange&&this.adapter.setInputAttribute(cp,"",tR.START),this.adapter.setInputAttribute(cp,"",tR.END)):(this.adapter.removeClass(cs),this.isRange&&this.adapter.removeInputAttribute(cp,tR.START),this.adapter.removeInputAttribute(cp,tR.END))},n.prototype.getIsRange=function(){return this.isRange},n.prototype.layout=function(t){var n=(void 0===t?{}:t).skipUpdateUI;this.rect=this.adapter.getBoundingClientRect(),this.isRange&&(this.startThumbKnobWidth=this.adapter.getThumbKnobWidth(tR.START),this.endThumbKnobWidth=this.adapter.getThumbKnobWidth(tR.END)),n||this.updateUI()},n.prototype.handleResize=function(){this.layout()},n.prototype.handleDown=function(t){if(!this.isDisabled){this.valueStartBeforeDownEvent=this.valueStart,this.valueBeforeDownEvent=this.value;var n=null!=t.clientX?t.clientX:t.targetTouches[0].clientX;this.downEventClientX=n;var i=this.mapClientXOnSliderScale(n);this.thumb=this.getThumbFromDownEvent(n,i),null===this.thumb||(this.handleDragStart(t,i,this.thumb),this.isRange&&i>=this.valueStart&&i<=this.value||this.updateValue(i,this.thumb,{emitInputEvent:!0}))}},n.prototype.handleMove=function(t){if(!this.isDisabled){t.preventDefault();var n=null!=t.clientX?t.clientX:t.targetTouches[0].clientX,i=null!=this.thumb;if(this.thumb=this.getThumbFromMoveEvent(n),null!==this.thumb){var r=this.mapClientXOnSliderScale(n);i||(this.handleDragStart(t,r,this.thumb),this.adapter.emitDragStartEvent(r,this.thumb)),this.updateValue(r,this.thumb,{emitInputEvent:!0})}}},n.prototype.handleUp=function(){if(!this.isDisabled&&null!==this.thumb){var t=this.thumb===tR.START?this.valueStartBeforeDownEvent:this.valueBeforeDownEvent,n=this.thumb===tR.START?this.valueStart:this.value;t!==n&&this.adapter.emitChangeEvent(n,this.thumb),this.adapter.emitDragEndEvent(n,this.thumb),this.thumb=null}},n.prototype.handleThumbMouseenter=function(){this.isDiscrete&&this.isRange&&(this.adapter.addThumbClass(cd,tR.START),this.adapter.addThumbClass(cd,tR.END))},n.prototype.handleThumbMouseleave=function(){!this.isDiscrete||!this.isRange||this.adapter.isInputFocused(tR.START)||this.adapter.isInputFocused(tR.END)||(this.adapter.removeThumbClass(cd,tR.START),this.adapter.removeThumbClass(cd,tR.END))},n.prototype.handleMousedownOrTouchstart=function(t){var n=this,i="mousedown"===t.type?"mousemove":"touchmove";this.adapter.registerBodyEventHandler(i,this.moveListener);var r=function(){n.handleUp(),n.adapter.deregisterBodyEventHandler(i,n.moveListener),n.adapter.deregisterEventHandler("mouseup",r),n.adapter.deregisterEventHandler("touchend",r)};this.adapter.registerBodyEventHandler("mouseup",r),this.adapter.registerBodyEventHandler("touchend",r),this.handleDown(t)},n.prototype.handlePointerdown=function(t){this.adapter.setPointerCapture(t.pointerId),this.adapter.registerEventHandler("pointermove",this.moveListener),this.handleDown(t)},n.prototype.handleInputChange=function(t){var n=Number(this.adapter.getInputValue(t));t===tR.START?this.setValueStart(n):this.setValue(n)},n.prototype.handleInputFocus=function(t){if(this.isDiscrete&&(this.adapter.addThumbClass(cd,t),this.isRange)){var n=t===tR.START?tR.END:tR.START;this.adapter.addThumbClass(cd,n)}},n.prototype.handleInputBlur=function(t){if(this.isDiscrete&&(this.adapter.removeThumbClass(cd,t),this.isRange)){var n=t===tR.START?tR.END:tR.START;this.adapter.removeThumbClass(cd,n)}},n.prototype.handleDragStart=function(t,n,i){this.adapter.focusInput(i),t.preventDefault(),this.adapter.emitDragStartEvent(n,i)},n.prototype.getThumbFromDownEvent=function(t,n){if(!this.isRange)return tR.END;var i=this.adapter.getThumbBoundingClientRect(tR.START),r=this.adapter.getThumbBoundingClientRect(tR.END),o=t>=i.left&&t<=i.right,a=t>=r.left&&t<=r.right;return o&&a?null:o?tR.START:a?tR.END:n<this.valueStart?tR.START:n>this.value?tR.END:null},n.prototype.getThumbFromMoveEvent=function(t){if(null!==this.thumb)return this.thumb;if(null===this.downEventClientX)throw Error("`downEventClientX` is null after move event.");return 5>Math.abs(this.downEventClientX-t)?this.thumb:t<this.downEventClientX?this.adapter.isRTL()?tR.END:tR.START:this.adapter.isRTL()?tR.START:tR.END},n.prototype.updateUI=function(t){this.updateThumbAndInputAttributes(t),this.updateThumbAndTrackUI(t),this.updateValueIndicatorUI(t),this.updateTickMarksUI()},n.prototype.updateThumbAndInputAttributes=function(t){if(t){var n=this.isRange&&t===tR.START?this.valueStart:this.value,i=String(n);this.adapter.setInputAttribute(cf,i,t),this.isRange&&t===tR.START?this.adapter.setInputAttribute("min",i,tR.END):this.isRange&&t===tR.END&&this.adapter.setInputAttribute("max",i,tR.START),this.adapter.getInputValue(t)!==i&&this.adapter.setInputValue(i,t);var r=this.adapter.getValueToAriaValueTextFn();r&&this.adapter.setInputAttribute("aria-valuetext",r(n),t)}},n.prototype.updateValueIndicatorUI=function(t){if(this.isDiscrete){var n=this.isRange&&t===tR.START?this.valueStart:this.value;this.adapter.setValueIndicatorText(n,t===tR.START?tR.START:tR.END),!t&&this.isRange&&this.adapter.setValueIndicatorText(this.valueStart,tR.START)}},n.prototype.updateTickMarksUI=function(){if(this.isDiscrete&&this.hasTickMarks){var t=(this.valueStart-this.min)/this.step,n=(this.value-this.valueStart)/this.step+1,i=(this.max-this.value)/this.step,r=Array.from({length:t}).fill(tO.INACTIVE),o=Array.from({length:n}).fill(tO.ACTIVE),a=Array.from({length:i}).fill(tO.INACTIVE);this.adapter.updateTickMarks(r.concat(o).concat(a))}},n.prototype.mapClientXOnSliderScale=function(t){var n=(t-this.rect.left)/this.rect.width;this.adapter.isRTL()&&(n=1-n);var i=this.min+n*(this.max-this.min);return i===this.max||i===this.min?i:this.quantize(i)},n.prototype.updateValue=function(t,n,i){var r=void 0===i?{}:i,o=r.emitInputEvent,a=r.emitChangeEvent;if(t=this.clampValue(t,n),this.isRange&&n===tR.START){if(this.valueStart===t)return;this.valueStart=t}else{if(this.value===t)return;this.value=t}this.updateUI(n),o&&this.adapter.emitInputEvent(n===tR.START?this.valueStart:this.value,n),a&&this.adapter.emitChangeEvent(n===tR.START?this.valueStart:this.value,n)},n.prototype.quantize=function(t){return Math.round(t/this.step)*this.step},n.prototype.clampValue=function(t,n){return(t=Math.min(Math.max(t,this.min),this.max),this.isRange&&n===tR.START&&t>this.value)?this.value:this.isRange&&n===tR.END&&t<this.valueStart?this.valueStart:t},n.prototype.updateThumbAndTrackUI=function(t){var n=this,i=this.max,r=this.min,o=(this.value-this.valueStart)/(i-r),a=o*this.rect.width,s=this.adapter.isRTL(),l=cg?l3(window,"transform"):"transform";if(this.isRange){var c=this.adapter.isRTL()?(i-this.value)/(i-r)*this.rect.width:(this.valueStart-r)/(i-r)*this.rect.width,d=c+a;requestAnimationFrame(function(){!s&&t===tR.START||s&&t!==tR.START?(n.adapter.setTrackActiveStyleProperty("transform-origin","right"),n.adapter.setTrackActiveStyleProperty("left","unset"),n.adapter.setTrackActiveStyleProperty("right",n.rect.width-d+"px")):(n.adapter.setTrackActiveStyleProperty("transform-origin","left"),n.adapter.setTrackActiveStyleProperty("right","unset"),n.adapter.setTrackActiveStyleProperty("left",c+"px")),n.adapter.setTrackActiveStyleProperty(l,"scaleX("+o+")");var i=s?d:c,r=n.adapter.isRTL()?c:d;t!==tR.START&&t&&n.initialStylesRemoved||n.adapter.setThumbStyleProperty(l,"translateX("+i+"px)",tR.START),t!==tR.END&&t&&n.initialStylesRemoved||n.adapter.setThumbStyleProperty(l,"translateX("+r+"px)",tR.END),n.removeInitialStyles(s),n.updateOverlappingThumbsUI(i,r,t)})}else requestAnimationFrame(function(){var t=s?n.rect.width-a:a;n.adapter.setThumbStyleProperty(l,"translateX("+t+"px)",tR.END),n.adapter.setTrackActiveStyleProperty(l,"scaleX("+o+")"),n.removeInitialStyles(s)})},n.prototype.removeInitialStyles=function(t){if(!this.initialStylesRemoved){var n=t?"right":"left";this.adapter.removeThumbStyleProperty(n,tR.END),this.isRange&&this.adapter.removeThumbStyleProperty(n,tR.START),this.initialStylesRemoved=!0,this.resetTrackAndThumbAnimation()}},n.prototype.resetTrackAndThumbAnimation=function(){var t=this;if(this.isDiscrete){var n=cg?l3(window,"transition"):"transition",i="all 0s ease 0s";this.adapter.setThumbStyleProperty(n,i,tR.END),this.isRange&&this.adapter.setThumbStyleProperty(n,i,tR.START),this.adapter.setTrackActiveStyleProperty(n,i),requestAnimationFrame(function(){t.adapter.removeThumbStyleProperty(n,tR.END),t.adapter.removeTrackActiveStyleProperty(n),t.isRange&&t.adapter.removeThumbStyleProperty(n,tR.START)})}},n.prototype.updateOverlappingThumbsUI=function(t,n,i){var r=!1;if(this.adapter.isRTL()){var o=t-this.startThumbKnobWidth/2;r=n+this.endThumbKnobWidth/2>=o}else r=t+this.startThumbKnobWidth/2>=n-this.endThumbKnobWidth/2;r?(this.adapter.addThumbClass(cc,i||tR.END),this.adapter.removeThumbClass(cc,i===tR.START?tR.END:tR.START)):(this.adapter.removeThumbClass(cc,tR.START),this.adapter.removeThumbClass(cc,tR.END))},n.prototype.convertAttributeValueToNumber=function(t,n){if(null===t)throw Error("MDCSliderFoundation: `"+n+"` must be non-null.");var i=Number(t);if(isNaN(i))throw Error("MDCSliderFoundation: `"+n+"` value is `"+t+"`, but must be a number.");return i},n.prototype.validateProperties=function(t){var n=t.min,i=t.max,r=t.value,o=t.valueStart;if(n>=i)throw Error("MDCSliderFoundation: min must be strictly less than max. "+("Current: [min: "+n+", max: ")+i+"]");if(this.isRange){if(r<n||r>i||o<n||o>i)throw Error("MDCSliderFoundation: values must be in [min, max] range. "+("Current values: [start value: "+o+", end value: ")+r+"]");if(o>r)throw Error("MDCSliderFoundation: start value must be <= end value. "+("Current values: [start value: "+o+", end value: ")+r+"]")}else if(r<n||r>i)throw Error("MDCSliderFoundation: value must be in [min, max] range. Current value: "+r)},n.prototype.registerEventHandlers=function(){this.adapter.registerWindowEventHandler("resize",this.resizeListener),n.SUPPORTS_POINTER_EVENTS?(this.adapter.registerEventHandler("pointerdown",this.pointerdownListener),this.adapter.registerEventHandler("pointerup",this.pointerupListener)):(this.adapter.registerEventHandler("mousedown",this.mousedownOrTouchstartListener),this.adapter.registerEventHandler("touchstart",this.mousedownOrTouchstartListener)),this.isRange&&(this.adapter.registerThumbEventHandler(tR.START,"mouseenter",this.thumbMouseenterListener),this.adapter.registerThumbEventHandler(tR.START,"mouseleave",this.thumbMouseleaveListener),this.adapter.registerInputEventHandler(tR.START,"change",this.inputStartChangeListener),this.adapter.registerInputEventHandler(tR.START,"focus",this.inputStartFocusListener),this.adapter.registerInputEventHandler(tR.START,"blur",this.inputStartBlurListener)),this.adapter.registerThumbEventHandler(tR.END,"mouseenter",this.thumbMouseenterListener),this.adapter.registerThumbEventHandler(tR.END,"mouseleave",this.thumbMouseleaveListener),this.adapter.registerInputEventHandler(tR.END,"change",this.inputEndChangeListener),this.adapter.registerInputEventHandler(tR.END,"focus",this.inputEndFocusListener),this.adapter.registerInputEventHandler(tR.END,"blur",this.inputEndBlurListener)},n.prototype.deregisterEventHandlers=function(){this.adapter.deregisterWindowEventHandler("resize",this.resizeListener),n.SUPPORTS_POINTER_EVENTS?(this.adapter.deregisterEventHandler("pointerdown",this.pointerdownListener),this.adapter.deregisterEventHandler("pointerup",this.pointerupListener)):(this.adapter.deregisterEventHandler("mousedown",this.mousedownOrTouchstartListener),this.adapter.deregisterEventHandler("touchstart",this.mousedownOrTouchstartListener)),this.isRange&&(this.adapter.deregisterThumbEventHandler(tR.START,"mouseenter",this.thumbMouseenterListener),this.adapter.deregisterThumbEventHandler(tR.START,"mouseleave",this.thumbMouseleaveListener),this.adapter.deregisterInputEventHandler(tR.START,"change",this.inputStartChangeListener),this.adapter.deregisterInputEventHandler(tR.START,"focus",this.inputStartFocusListener),this.adapter.deregisterInputEventHandler(tR.START,"blur",this.inputStartBlurListener)),this.adapter.deregisterThumbEventHandler(tR.END,"mouseenter",this.thumbMouseenterListener),this.adapter.deregisterThumbEventHandler(tR.END,"mouseleave",this.thumbMouseleaveListener),this.adapter.deregisterInputEventHandler(tR.END,"change",this.inputEndChangeListener),this.adapter.deregisterInputEventHandler(tR.END,"focus",this.inputEndFocusListener),this.adapter.deregisterInputEventHandler(tR.END,"blur",this.inputEndBlurListener)},n.prototype.handlePointerup=function(){this.handleUp(),this.adapter.deregisterEventHandler("pointermove",this.moveListener)},n.SUPPORTS_POINTER_EVENTS=cg&&!!window.PointerEvent,n}(lc),cy=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.skipInitialUIUpdate=!1,n.valueToAriaValueTextFn=null,n}return lo(n,t),n.attachTo=function(t,i){return void 0===i&&(i={}),new n(t,void 0,i)},n.prototype.getDefaultFoundation=function(){var t=this;return new c_({hasClass:function(n){return t.root.classList.contains(n)},addClass:function(n){t.root.classList.add(n)},removeClass:function(n){t.root.classList.remove(n)},addThumbClass:function(n,i){t.getThumbEl(i).classList.add(n)},removeThumbClass:function(n,i){t.getThumbEl(i).classList.remove(n)},getAttribute:function(n){return t.root.getAttribute(n)},getInputValue:function(n){return t.getInput(n).value},setInputValue:function(n,i){t.getInput(i).value=n},getInputAttribute:function(n,i){return t.getInput(i).getAttribute(n)},setInputAttribute:function(n,i,r){t.getInput(r).setAttribute(n,i)},removeInputAttribute:function(n,i){t.getInput(i).removeAttribute(n)},focusInput:function(n){t.getInput(n).focus()},isInputFocused:function(n){return t.getInput(n)===document.activeElement},getThumbKnobWidth:function(n){return t.getThumbEl(n).querySelector(".mdc-slider__thumb-knob").getBoundingClientRect().width},getThumbBoundingClientRect:function(n){return t.getThumbEl(n).getBoundingClientRect()},getBoundingClientRect:function(){return t.root.getBoundingClientRect()},isRTL:function(){return"rtl"===getComputedStyle(t.root).direction},setThumbStyleProperty:function(n,i,r){t.getThumbEl(r).style.setProperty(n,i)},removeThumbStyleProperty:function(n,i){t.getThumbEl(i).style.removeProperty(n)},setTrackActiveStyleProperty:function(n,i){t.trackActive.style.setProperty(n,i)},removeTrackActiveStyleProperty:function(n){t.trackActive.style.removeProperty(n)},setValueIndicatorText:function(n,i){t.getThumbEl(i).querySelector(".mdc-slider__value-indicator-text").textContent=String(n)},getValueToAriaValueTextFn:function(){return t.valueToAriaValueTextFn},updateTickMarks:function(n){var i=t.root.querySelector("."+cu);i||((i=document.createElement("div")).classList.add(cu),t.root.querySelector(".mdc-slider__track").appendChild(i)),n.length!==i.children.length?(i.innerHTML="",t.addTickMarks(i,n)):t.updateTickMarks(i,n)},setPointerCapture:function(n){t.root.setPointerCapture(n)},emitChangeEvent:function(n,i){t.emit("MDCSlider:change",{value:n,thumb:i})},emitInputEvent:function(n,i){t.emit("MDCSlider:input",{value:n,thumb:i})},emitDragStartEvent:function(n,i){t.getRipple(i).activate()},emitDragEndEvent:function(n,i){t.getRipple(i).deactivate()},registerEventHandler:function(n,i){t.listen(n,i)},deregisterEventHandler:function(n,i){t.unlisten(n,i)},registerThumbEventHandler:function(n,i,r){t.getThumbEl(n).addEventListener(i,r)},deregisterThumbEventHandler:function(n,i,r){t.getThumbEl(n).removeEventListener(i,r)},registerInputEventHandler:function(n,i,r){t.getInput(n).addEventListener(i,r)},deregisterInputEventHandler:function(n,i,r){t.getInput(n).removeEventListener(i,r)},registerBodyEventHandler:function(t,n){document.body.addEventListener(t,n)},deregisterBodyEventHandler:function(t,n){document.body.removeEventListener(t,n)},registerWindowEventHandler:function(t,n){window.addEventListener(t,n)},deregisterWindowEventHandler:function(t,n){window.removeEventListener(t,n)}})},n.prototype.initialize=function(t){var n=(void 0===t?{}:t).skipInitialUIUpdate;this.inputs=[].slice.call(this.root.querySelectorAll(".mdc-slider__input")),this.thumbs=[].slice.call(this.root.querySelectorAll("."+cl)),this.trackActive=this.root.querySelector(".mdc-slider__track--active_fill"),this.ripples=this.createRipples(),n&&(this.skipInitialUIUpdate=!0)},n.prototype.initialSyncWithDOM=function(){this.foundation.layout({skipUpdateUI:this.skipInitialUIUpdate})},n.prototype.layout=function(){this.foundation.layout()},n.prototype.getValueStart=function(){return this.foundation.getValueStart()},n.prototype.setValueStart=function(t){this.foundation.setValueStart(t)},n.prototype.getValue=function(){return this.foundation.getValue()},n.prototype.setValue=function(t){this.foundation.setValue(t)},n.prototype.getDisabled=function(){return this.foundation.getDisabled()},n.prototype.setDisabled=function(t){this.foundation.setDisabled(t)},n.prototype.setValueToAriaValueTextFn=function(t){this.valueToAriaValueTextFn=t},n.prototype.getThumbEl=function(t){return t===tR.END?this.thumbs[this.thumbs.length-1]:this.thumbs[0]},n.prototype.getInput=function(t){return t===tR.END?this.inputs[this.inputs.length-1]:this.inputs[0]},n.prototype.getRipple=function(t){return t===tR.END?this.ripples[this.ripples.length-1]:this.ripples[0]},n.prototype.addTickMarks=function(t,n){for(var i=document.createDocumentFragment(),r=0;r<n.length;r++){var o=document.createElement("div"),a=n[r]===tO.ACTIVE?cm:ch;o.classList.add(a),i.appendChild(o)}t.appendChild(i)},n.prototype.updateTickMarks=function(t,n){for(var i=Array.from(t.children),r=0;r<i.length;r++)n[r]===tO.ACTIVE?(i[r].classList.add(cm),i[r].classList.remove(ch)):(i[r].classList.add(ch),i[r].classList.remove(cm))},n.prototype.createRipples=function(){for(var t=[],n=[].slice.call(this.root.querySelectorAll("."+cl)),i=this,r=0;r<n.length;r++)!function(r){var o=n[r],a=i.inputs[r],s=la(la({},lL.createAdapter(i)),{addClass:function(t){o.classList.add(t)},computeBoundingRect:function(){return o.getBoundingClientRect()},deregisterInteractionHandler:function(t,n){a.removeEventListener(t,n)},isSurfaceActive:function(){return lh(a,":active")},isUnbounded:function(){return!0},registerInteractionHandler:function(t,n){a.addEventListener(t,n)},removeClass:function(t){o.classList.remove(t)},updateCssVariable:function(t,n){o.style.setProperty(t,n)}}),l=new lL(o,new lD(s));l.unbounded=!0,t.push(l)}(r);return t},n}(ld),cv={ANCHOR:"mdc-menu-surface--anchor",ANIMATING_CLOSED:"mdc-menu-surface--animating-closed",ANIMATING_OPEN:"mdc-menu-surface--animating-open",FIXED:"mdc-menu-surface--fixed",IS_OPEN_BELOW:"mdc-menu-surface--is-open-below",OPEN:"mdc-menu-surface--open",ROOT:"mdc-menu-surface"},cx={CLOSED_EVENT:"MDCMenuSurface:closed",OPENED_EVENT:"MDCMenuSurface:opened",FOCUSABLE_ELEMENTS:'button:not(:disabled), [href]:not([aria-disabled="true"]), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])'},cw={TRANSITION_OPEN_DURATION:120,TRANSITION_CLOSE_DURATION:75,MARGIN_TO_EDGE:32,ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO:.67};(ek=tB||(tB={}))[ek.BOTTOM=1]="BOTTOM",ek[ek.CENTER=2]="CENTER",ek[ek.RIGHT=4]="RIGHT",ek[ek.FLIP_RTL=8]="FLIP_RTL",(eE=tz||(tz={}))[eE.TOP_LEFT=0]="TOP_LEFT",eE[eE.TOP_RIGHT=4]="TOP_RIGHT",eE[eE.BOTTOM_LEFT=1]="BOTTOM_LEFT",eE[eE.BOTTOM_RIGHT=5]="BOTTOM_RIGHT",eE[eE.TOP_START=8]="TOP_START",eE[eE.TOP_END=12]="TOP_END",eE[eE.BOTTOM_START=9]="BOTTOM_START",eE[eE.BOTTOM_END=13]="BOTTOM_END";var cF={LIST_ITEM_ACTIVATED_CLASS:"mdc-list-item--activated",LIST_ITEM_CLASS:"mdc-list-item",LIST_ITEM_DISABLED_CLASS:"mdc-list-item--disabled",LIST_ITEM_SELECTED_CLASS:"mdc-list-item--selected",LIST_ITEM_TEXT_CLASS:"mdc-list-item__text",LIST_ITEM_PRIMARY_TEXT_CLASS:"mdc-list-item__primary-text",ROOT:"mdc-list"},ck={ACTION_EVENT:"MDCList:action",ARIA_CHECKED:"aria-checked",ARIA_CHECKED_CHECKBOX_SELECTOR:'[role="checkbox"][aria-checked="true"]',ARIA_CHECKED_RADIO_SELECTOR:'[role="radio"][aria-checked="true"]',ARIA_CURRENT:"aria-current",ARIA_DISABLED:"aria-disabled",ARIA_ORIENTATION:"aria-orientation",ARIA_ORIENTATION_HORIZONTAL:"horizontal",ARIA_ROLE_CHECKBOX_SELECTOR:'[role="checkbox"]',ARIA_SELECTED:"aria-selected",CHECKBOX_RADIO_SELECTOR:'input[type="checkbox"], input[type="radio"]',CHECKBOX_SELECTOR:'input[type="checkbox"]',CHILD_ELEMENTS_TO_TOGGLE_TABINDEX:"\n ."+cF.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+cF.LIST_ITEM_CLASS+" a\n ",FOCUSABLE_CHILD_ELEMENTS:"\n ."+cF.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+cF.LIST_ITEM_CLASS+" a,\n ."+cF.LIST_ITEM_CLASS+' input[type="radio"]:not(:disabled),\n .'+cF.LIST_ITEM_CLASS+' input[type="checkbox"]:not(:disabled)\n ',RADIO_SELECTOR:'input[type="radio"]'},cE={UNSET_INDEX:-1,TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS:300},cT="Backspace",cM="Enter",cA="Spacebar",cC="PageUp",cS="PageDown",cD="Home",cL="ArrowLeft",cI="ArrowUp",cP="ArrowRight",cO="ArrowDown",cR="Delete",cB="Escape",cz=new Set;cz.add(cT),cz.add(cM),cz.add(cA),cz.add(cC),cz.add(cS),cz.add("End"),cz.add(cD),cz.add(cL),cz.add(cI),cz.add(cP),cz.add(cO),cz.add(cR),cz.add(cB);var cY=new Map;cY.set(8,cT),cY.set(13,cM),cY.set(32,cA),cY.set(33,cC),cY.set(34,cS),cY.set(35,"End"),cY.set(36,cD),cY.set(37,cL),cY.set(38,cI),cY.set(39,cP),cY.set(40,cO),cY.set(46,cR),cY.set(27,cB);var cN=new Set;function cj(t){var n=t.key;if(cz.has(n))return n;var i=cY.get(t.keyCode);return i||"Unknown"}cN.add(cC),cN.add(cS),cN.add("End"),cN.add(cD),cN.add(cL),cN.add(cI),cN.add(cP),cN.add(cO);var cH=["input","button","textarea","select"],cU=function(t){var n=t.target;if(n){var i=(""+n.tagName).toLowerCase();-1===cH.indexOf(i)&&t.preventDefault()}};function cV(t,n){var i,r=t.nextChar,o=t.focusItemAtIndex,a=t.sortedIndexByFirstChar,s=t.focusedItemIndex,l=t.skipFocus,c=t.isItemAtIndexDisabled;return clearTimeout(n.bufferClearTimeout),n.bufferClearTimeout=setTimeout(function(){cG(n)},cE.TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS),n.typeaheadBuffer=n.typeaheadBuffer+r,-1===(i=1===n.typeaheadBuffer.length?function(t,n,i,r){var o,a=r.typeaheadBuffer[0],s=t.get(a);if(!s)return -1;if(a===r.currentFirstChar&&s[r.sortedIndexCursor].index===n){r.sortedIndexCursor=(r.sortedIndexCursor+1)%s.length;var l=s[r.sortedIndexCursor].index;if(!i(l))return l}r.currentFirstChar=a;var c=-1;for(o=0;o<s.length;o++)if(!i(s[o].index)){c=o;break}for(;o<s.length;o++)if(s[o].index>n&&!i(s[o].index)){c=o;break}return -1!==c?(r.sortedIndexCursor=c,s[r.sortedIndexCursor].index):-1}(a,s,c,n):function(t,n,i){var r=i.typeaheadBuffer[0],o=t.get(r);if(!o)return -1;var a=o[i.sortedIndexCursor];if(0===a.text.lastIndexOf(i.typeaheadBuffer,0)&&!n(a.index))return a.index;for(var s=(i.sortedIndexCursor+1)%o.length,l=-1;s!==i.sortedIndexCursor;){var c=o[s],d=0===c.text.lastIndexOf(i.typeaheadBuffer,0),u=!n(c.index);if(d&&u){l=s;break}s=(s+1)%o.length}return -1!==l?(i.sortedIndexCursor=l,o[i.sortedIndexCursor].index):-1}(a,c,n))||l||o(i),i}function cq(t){return t.typeaheadBuffer.length>0}function cG(t){t.typeaheadBuffer=""}function c$(t,n){var i=t.event,r=t.isTargetListItem,o=t.focusedItemIndex,a=t.focusItemAtIndex,s=t.sortedIndexByFirstChar,l=t.isItemAtIndexDisabled,c="ArrowLeft"===cj(i),d="ArrowUp"===cj(i),u="ArrowRight"===cj(i),m="ArrowDown"===cj(i),h="Home"===cj(i),p="End"===cj(i),f="Enter"===cj(i),b="Spacebar"===cj(i);if(c||d||u||m||h||p||f)return -1;if(!b&&1===i.key.length){cU(i);var g={focusItemAtIndex:a,focusedItemIndex:o,nextChar:i.key.toLowerCase(),sortedIndexByFirstChar:s,skipFocus:!1,isItemAtIndexDisabled:l};return cV(g,n)}if(!b)return -1;if(r&&cU(i),r&&cq(n)){var g={focusItemAtIndex:a,focusedItemIndex:o,nextChar:" ",sortedIndexByFirstChar:s,skipFocus:!1,isItemAtIndexDisabled:l};return cV(g,n)}return -1}var cW=function(t){function n(i){var r=t.call(this,la(la({},n.defaultAdapter),i))||this;return r.wrapFocus_=!1,r.isVertical_=!0,r.isSingleSelectionList_=!1,r.selectedIndex_=cE.UNSET_INDEX,r.focusedItemIndex=cE.UNSET_INDEX,r.useActivatedClass_=!1,r.useSelectedAttr_=!1,r.ariaCurrentAttrValue_=null,r.isCheckboxList_=!1,r.isRadioList_=!1,r.hasTypeahead=!1,r.typeaheadState={bufferClearTimeout:0,currentFirstChar:"",sortedIndexCursor:0,typeaheadBuffer:""},r.sortedIndexByFirstChar=new Map,r}return lo(n,t),Object.defineProperty(n,"strings",{get:function(){return ck},enumerable:!0,configurable:!0}),Object.defineProperty(n,"cssClasses",{get:function(){return cF},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return cE},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClassForElementIndex:function(){},focusItemAtIndex:function(){},getAttributeForElementIndex:function(){return null},getFocusedElementIndex:function(){return 0},getListItemCount:function(){return 0},hasCheckboxAtIndex:function(){return!1},hasRadioAtIndex:function(){return!1},isCheckboxCheckedAtIndex:function(){return!1},isFocusInsideList:function(){return!1},isRootFocused:function(){return!1},listItemAtIndexHasClass:function(){return!1},notifyAction:function(){},removeClassForElementIndex:function(){},setAttributeForElementIndex:function(){},setCheckedCheckboxOrRadioAtIndex:function(){},setTabIndexForListItemChildren:function(){},getPrimaryTextAtIndex:function(){return""}}},enumerable:!0,configurable:!0}),n.prototype.layout=function(){0!==this.adapter.getListItemCount()&&(this.adapter.hasCheckboxAtIndex(0)?this.isCheckboxList_=!0:this.adapter.hasRadioAtIndex(0)?this.isRadioList_=!0:this.maybeInitializeSingleSelection(),this.hasTypeahead&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex()))},n.prototype.setWrapFocus=function(t){this.wrapFocus_=t},n.prototype.setVerticalOrientation=function(t){this.isVertical_=t},n.prototype.setSingleSelection=function(t){this.isSingleSelectionList_=t,t&&this.maybeInitializeSingleSelection()},n.prototype.maybeInitializeSingleSelection=function(){for(var t=0;t<this.adapter.getListItemCount();t++){var n=this.adapter.listItemAtIndexHasClass(t,cF.LIST_ITEM_SELECTED_CLASS),i=this.adapter.listItemAtIndexHasClass(t,cF.LIST_ITEM_ACTIVATED_CLASS);if(n||i){i&&this.setUseActivatedClass(!0),this.isSingleSelectionList_=!0,this.selectedIndex_=t;return}}},n.prototype.setHasTypeahead=function(t){this.hasTypeahead=t,t&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex())},n.prototype.isTypeaheadInProgress=function(){return this.hasTypeahead&&cq(this.typeaheadState)},n.prototype.setUseActivatedClass=function(t){this.useActivatedClass_=t},n.prototype.setUseSelectedAttribute=function(t){this.useSelectedAttr_=t},n.prototype.getSelectedIndex=function(){return this.selectedIndex_},n.prototype.setSelectedIndex=function(t){this.isIndexValid_(t)&&(this.isCheckboxList_?this.setCheckboxAtIndex_(t):this.isRadioList_?this.setRadioAtIndex_(t):this.setSingleSelectionAtIndex_(t))},n.prototype.handleFocusIn=function(t,n){n>=0&&(this.focusedItemIndex=n,this.adapter.setAttributeForElementIndex(n,"tabindex","0"),this.adapter.setTabIndexForListItemChildren(n,"0"))},n.prototype.handleFocusOut=function(t,n){var i=this;n>=0&&(this.adapter.setAttributeForElementIndex(n,"tabindex","-1"),this.adapter.setTabIndexForListItemChildren(n,"-1")),setTimeout(function(){i.adapter.isFocusInsideList()||i.setTabindexToFirstSelectedOrFocusedItem()},0)},n.prototype.handleKeydown=function(t,n,i){var r=this,o="ArrowLeft"===cj(t),a="ArrowUp"===cj(t),s="ArrowRight"===cj(t),l="ArrowDown"===cj(t),c="Home"===cj(t),d="End"===cj(t),u="Enter"===cj(t),m="Spacebar"===cj(t),h="A"===t.key||"a"===t.key;if(this.adapter.isRootFocused()){if(a||d?(t.preventDefault(),this.focusLastElement()):(l||c)&&(t.preventDefault(),this.focusFirstElement()),this.hasTypeahead){var p={event:t,focusItemAtIndex:function(t){r.focusItemAtIndex(t)},focusedItemIndex:-1,isTargetListItem:n,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return r.adapter.listItemAtIndexHasClass(t,cF.LIST_ITEM_DISABLED_CLASS)}};c$(p,this.typeaheadState)}return}var f=this.adapter.getFocusedElementIndex();if(-1!==f||!((f=i)<0)){if(this.isVertical_&&l||!this.isVertical_&&s)cU(t),this.focusNextElement(f);else if(this.isVertical_&&a||!this.isVertical_&&o)cU(t),this.focusPrevElement(f);else if(c)cU(t),this.focusFirstElement();else if(d)cU(t),this.focusLastElement();else if(h&&t.ctrlKey&&this.isCheckboxList_)t.preventDefault(),this.toggleAll(this.selectedIndex_===cE.UNSET_INDEX?[]:this.selectedIndex_);else if((u||m)&&n){var b=t.target;if(b&&"A"===b.tagName&&u||(cU(t),this.adapter.listItemAtIndexHasClass(f,cF.LIST_ITEM_DISABLED_CLASS)))return;this.isTypeaheadInProgress()||(this.isSelectableList_()&&this.setSelectedIndexOnAction_(f),this.adapter.notifyAction(f))}if(this.hasTypeahead){var p={event:t,focusItemAtIndex:function(t){r.focusItemAtIndex(t)},focusedItemIndex:this.focusedItemIndex,isTargetListItem:n,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return r.adapter.listItemAtIndexHasClass(t,cF.LIST_ITEM_DISABLED_CLASS)}};c$(p,this.typeaheadState)}}},n.prototype.handleClick=function(t,n){t===cE.UNSET_INDEX||this.adapter.listItemAtIndexHasClass(t,cF.LIST_ITEM_DISABLED_CLASS)||(this.isSelectableList_()&&this.setSelectedIndexOnAction_(t,n),this.adapter.notifyAction(t))},n.prototype.focusNextElement=function(t){var n=this.adapter.getListItemCount(),i=t+1;if(i>=n)if(!this.wrapFocus_)return t;else i=0;return this.focusItemAtIndex(i),i},n.prototype.focusPrevElement=function(t){var n=t-1;if(n<0)if(!this.wrapFocus_)return t;else n=this.adapter.getListItemCount()-1;return this.focusItemAtIndex(n),n},n.prototype.focusFirstElement=function(){return this.focusItemAtIndex(0),0},n.prototype.focusLastElement=function(){var t=this.adapter.getListItemCount()-1;return this.focusItemAtIndex(t),t},n.prototype.focusInitialElement=function(){var t=this.getFirstSelectedOrFocusedItemIndex();return this.focusItemAtIndex(t),t},n.prototype.setEnabled=function(t,n){this.isIndexValid_(t)&&(n?(this.adapter.removeClassForElementIndex(t,cF.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,ck.ARIA_DISABLED,"false")):(this.adapter.addClassForElementIndex(t,cF.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,ck.ARIA_DISABLED,"true")))},n.prototype.setSingleSelectionAtIndex_=function(t){if(this.selectedIndex_!==t){var n=cF.LIST_ITEM_SELECTED_CLASS;this.useActivatedClass_&&(n=cF.LIST_ITEM_ACTIVATED_CLASS),this.selectedIndex_!==cE.UNSET_INDEX&&this.adapter.removeClassForElementIndex(this.selectedIndex_,n),this.setAriaForSingleSelectionAtIndex_(t),this.setTabindexAtIndex(t),t!==cE.UNSET_INDEX&&this.adapter.addClassForElementIndex(t,n),this.selectedIndex_=t}},n.prototype.setAriaForSingleSelectionAtIndex_=function(t){this.selectedIndex_===cE.UNSET_INDEX&&(this.ariaCurrentAttrValue_=this.adapter.getAttributeForElementIndex(t,ck.ARIA_CURRENT));var n=null!==this.ariaCurrentAttrValue_,i=n?ck.ARIA_CURRENT:ck.ARIA_SELECTED;if(this.selectedIndex_!==cE.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex_,i,"false"),t!==cE.UNSET_INDEX){var r=n?this.ariaCurrentAttrValue_:"true";this.adapter.setAttributeForElementIndex(t,i,r)}},n.prototype.getSelectionAttribute=function(){return this.useSelectedAttr_?ck.ARIA_SELECTED:ck.ARIA_CHECKED},n.prototype.setRadioAtIndex_=function(t){var n=this.getSelectionAttribute();this.adapter.setCheckedCheckboxOrRadioAtIndex(t,!0),this.selectedIndex_!==cE.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex_,n,"false"),this.adapter.setAttributeForElementIndex(t,n,"true"),this.selectedIndex_=t},n.prototype.setCheckboxAtIndex_=function(t){for(var n=this.getSelectionAttribute(),i=0;i<this.adapter.getListItemCount();i++){var r=!1;t.indexOf(i)>=0&&(r=!0),this.adapter.setCheckedCheckboxOrRadioAtIndex(i,r),this.adapter.setAttributeForElementIndex(i,n,r?"true":"false")}this.selectedIndex_=t},n.prototype.setTabindexAtIndex=function(t){this.focusedItemIndex===cE.UNSET_INDEX&&0!==t?this.adapter.setAttributeForElementIndex(0,"tabindex","-1"):this.focusedItemIndex>=0&&this.focusedItemIndex!==t&&this.adapter.setAttributeForElementIndex(this.focusedItemIndex,"tabindex","-1"),this.selectedIndex_ instanceof Array||this.selectedIndex_===t||this.adapter.setAttributeForElementIndex(this.selectedIndex_,"tabindex","-1"),t!==cE.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(t,"tabindex","0")},n.prototype.isSelectableList_=function(){return this.isSingleSelectionList_||this.isCheckboxList_||this.isRadioList_},n.prototype.setTabindexToFirstSelectedOrFocusedItem=function(){var t=this.getFirstSelectedOrFocusedItemIndex();this.setTabindexAtIndex(t)},n.prototype.getFirstSelectedOrFocusedItemIndex=function(){var t=this.focusedItemIndex>=0?this.focusedItemIndex:0;return this.isSelectableList_()&&("number"==typeof this.selectedIndex_&&this.selectedIndex_!==cE.UNSET_INDEX?t=this.selectedIndex_:this.selectedIndex_ instanceof Array&&this.selectedIndex_.length>0&&(t=this.selectedIndex_.reduce(function(t,n){return Math.min(t,n)}))),t},n.prototype.isIndexValid_=function(t){var n=this;if(t instanceof Array){if(!this.isCheckboxList_)throw Error("MDCListFoundation: Array of index is only supported for checkbox based list");return 0===t.length||t.some(function(t){return n.isIndexInRange_(t)})}if("number"!=typeof t)return!1;if(this.isCheckboxList_)throw Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+t);return this.isIndexInRange_(t)||this.isSingleSelectionList_&&t===cE.UNSET_INDEX},n.prototype.isIndexInRange_=function(t){var n=this.adapter.getListItemCount();return t>=0&&t<n},n.prototype.setSelectedIndexOnAction_=function(t,n){void 0===n&&(n=!0),this.isCheckboxList_?this.toggleCheckboxAtIndex_(t,n):this.setSelectedIndex(t)},n.prototype.toggleCheckboxAtIndex_=function(t,n){var i=this.getSelectionAttribute(),r=this.adapter.isCheckboxCheckedAtIndex(t);n&&(r=!r,this.adapter.setCheckedCheckboxOrRadioAtIndex(t,r)),this.adapter.setAttributeForElementIndex(t,i,r?"true":"false");var o=this.selectedIndex_===cE.UNSET_INDEX?[]:this.selectedIndex_.slice();r?o.push(t):o=o.filter(function(n){return n!==t}),this.selectedIndex_=o},n.prototype.focusItemAtIndex=function(t){this.adapter.focusItemAtIndex(t),this.focusedItemIndex=t},n.prototype.toggleAll=function(t){var n=this.adapter.getListItemCount();if(t.length===n)this.setCheckboxAtIndex_([]);else{for(var i=[],r=0;r<n;r++)(!this.adapter.listItemAtIndexHasClass(r,cF.LIST_ITEM_DISABLED_CLASS)||t.indexOf(r)>-1)&&i.push(r);this.setCheckboxAtIndex_(i)}},n.prototype.typeaheadMatchItem=function(t,n,i){var r=this;return void 0===i&&(i=!1),cV({focusItemAtIndex:function(t){r.focusItemAtIndex(t)},focusedItemIndex:n||this.focusedItemIndex,nextChar:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,skipFocus:i,isItemAtIndexDisabled:function(t){return r.adapter.listItemAtIndexHasClass(t,cF.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState)},n.prototype.typeaheadInitSortedIndex=function(){return function(t,n){for(var i=new Map,r=0;r<t;r++){var o=n(r).trim();if(o){var a=o[0].toLowerCase();i.has(a)||i.set(a,[]),i.get(a).push({text:o.toLowerCase(),index:r})}}return i.forEach(function(t){t.sort(function(t,n){return t.index-n.index})}),i}(this.adapter.getListItemCount(),this.adapter.getPrimaryTextAtIndex)},n.prototype.clearTypeaheadBuffer=function(){cG(this.typeaheadState)},n}(lc),cX=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return lo(n,t),Object.defineProperty(n.prototype,"vertical",{set:function(t){this.foundation.setVerticalOrientation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"listElements",{get:function(){return[].slice.call(this.root.querySelectorAll("."+cF.LIST_ITEM_CLASS))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"wrapFocus",{set:function(t){this.foundation.setWrapFocus(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"typeaheadInProgress",{get:function(){return this.foundation.isTypeaheadInProgress()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hasTypeahead",{set:function(t){this.foundation.setHasTypeahead(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"singleSelection",{set:function(t){this.foundation.setSingleSelection(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(t){this.foundation.setSelectedIndex(t)},enumerable:!0,configurable:!0}),n.attachTo=function(t){return new n(t)},n.prototype.initialSyncWithDOM=function(){this.handleClick_=this.handleClickEvent_.bind(this),this.handleKeydown_=this.handleKeydownEvent_.bind(this),this.focusInEventListener_=this.handleFocusInEvent_.bind(this),this.focusOutEventListener_=this.handleFocusOutEvent_.bind(this),this.listen("keydown",this.handleKeydown_),this.listen("click",this.handleClick_),this.listen("focusin",this.focusInEventListener_),this.listen("focusout",this.focusOutEventListener_),this.layout(),this.initializeListType()},n.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown_),this.unlisten("click",this.handleClick_),this.unlisten("focusin",this.focusInEventListener_),this.unlisten("focusout",this.focusOutEventListener_)},n.prototype.layout=function(){var t=this.root.getAttribute(ck.ARIA_ORIENTATION);this.vertical=t!==ck.ARIA_ORIENTATION_HORIZONTAL,[].slice.call(this.root.querySelectorAll(".mdc-list-item:not([tabindex])")).forEach(function(t){t.setAttribute("tabindex","-1")}),[].slice.call(this.root.querySelectorAll(ck.FOCUSABLE_CHILD_ELEMENTS)).forEach(function(t){return t.setAttribute("tabindex","-1")}),this.foundation.layout()},n.prototype.getPrimaryText=function(t){var n=t.querySelector("."+cF.LIST_ITEM_PRIMARY_TEXT_CLASS);if(n)return n.textContent||"";var i=t.querySelector("."+cF.LIST_ITEM_TEXT_CLASS);return i&&i.textContent||""},n.prototype.initializeListType=function(){var t=this,n=this.root.querySelectorAll(ck.ARIA_ROLE_CHECKBOX_SELECTOR),i=this.root.querySelector(ck.ARIA_CHECKED_RADIO_SELECTOR);if(n.length){var r=this.root.querySelectorAll(ck.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=[].map.call(r,function(n){return t.listElements.indexOf(n)})}else i&&(this.selectedIndex=this.listElements.indexOf(i))},n.prototype.setEnabled=function(t,n){this.foundation.setEnabled(t,n)},n.prototype.typeaheadMatchItem=function(t,n){return this.foundation.typeaheadMatchItem(t,n,!0)},n.prototype.getDefaultFoundation=function(){var t=this;return new cW({addClassForElementIndex:function(n,i){var r=t.listElements[n];r&&r.classList.add(i)},focusItemAtIndex:function(n){var i=t.listElements[n];i&&i.focus()},getAttributeForElementIndex:function(n,i){return t.listElements[n].getAttribute(i)},getFocusedElementIndex:function(){return t.listElements.indexOf(document.activeElement)},getListItemCount:function(){return t.listElements.length},getPrimaryTextAtIndex:function(n){return t.getPrimaryText(t.listElements[n])},hasCheckboxAtIndex:function(n){return!!t.listElements[n].querySelector(ck.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(n){return!!t.listElements[n].querySelector(ck.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(n){return t.listElements[n].querySelector(ck.CHECKBOX_SELECTOR).checked},isFocusInsideList:function(){return t.root!==document.activeElement&&t.root.contains(document.activeElement)},isRootFocused:function(){return document.activeElement===t.root},listItemAtIndexHasClass:function(n,i){return t.listElements[n].classList.contains(i)},notifyAction:function(n){t.emit(ck.ACTION_EVENT,{index:n},!0)},removeClassForElementIndex:function(n,i){var r=t.listElements[n];r&&r.classList.remove(i)},setAttributeForElementIndex:function(n,i,r){var o=t.listElements[n];o&&o.setAttribute(i,r)},setCheckedCheckboxOrRadioAtIndex:function(n,i){var r=t.listElements[n].querySelector(ck.CHECKBOX_RADIO_SELECTOR);r.checked=i;var o=document.createEvent("Event");o.initEvent("change",!0,!0),r.dispatchEvent(o)},setTabIndexForListItemChildren:function(n,i){var r=t.listElements[n];[].slice.call(r.querySelectorAll(ck.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX)).forEach(function(t){return t.setAttribute("tabindex",i)})}})},n.prototype.getListItemIndex_=function(t){var n=lm(t.target,"."+cF.LIST_ITEM_CLASS+", ."+cF.ROOT);return n&&lh(n,"."+cF.LIST_ITEM_CLASS)?this.listElements.indexOf(n):-1},n.prototype.handleFocusInEvent_=function(t){var n=this.getListItemIndex_(t);this.foundation.handleFocusIn(t,n)},n.prototype.handleFocusOutEvent_=function(t){var n=this.getListItemIndex_(t);this.foundation.handleFocusOut(t,n)},n.prototype.handleKeydownEvent_=function(t){var n=this.getListItemIndex_(t),i=t.target;this.foundation.handleKeydown(t,i.classList.contains(cF.LIST_ITEM_CLASS),n)},n.prototype.handleClickEvent_=function(t){var n=this.getListItemIndex_(t),i=!lh(t.target,ck.CHECKBOX_RADIO_SELECTOR);this.foundation.handleClick(n,i)},n}(ld),cZ=function(t){function n(i){var r=t.call(this,la(la({},n.defaultAdapter),i))||this;return r.isSurfaceOpen=!1,r.isQuickOpen=!1,r.isHoistedElement=!1,r.isFixedPosition=!1,r.openAnimationEndTimerId=0,r.closeAnimationEndTimerId=0,r.animationRequestId=0,r.anchorCorner=tz.TOP_START,r.originCorner=tz.TOP_START,r.anchorMargin={top:0,right:0,bottom:0,left:0},r.position={x:0,y:0},r}return lo(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return cv},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return cx},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return cw},enumerable:!0,configurable:!0}),Object.defineProperty(n,"Corner",{get:function(){return tz},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},hasAnchor:function(){return!1},isElementInContainer:function(){return!1},isFocused:function(){return!1},isRtl:function(){return!1},getInnerDimensions:function(){return{height:0,width:0}},getAnchorDimensions:function(){return null},getWindowDimensions:function(){return{height:0,width:0}},getBodyDimensions:function(){return{height:0,width:0}},getWindowScroll:function(){return{x:0,y:0}},setPosition:function(){},setMaxHeight:function(){},setTransformOrigin:function(){},saveFocus:function(){},restoreFocus:function(){},notifyClose:function(){},notifyOpen:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){var t=n.cssClasses,i=t.ROOT,r=t.OPEN;if(!this.adapter.hasClass(i))throw Error(i+" class required in root element.");this.adapter.hasClass(r)&&(this.isSurfaceOpen=!0)},n.prototype.destroy=function(){clearTimeout(this.openAnimationEndTimerId),clearTimeout(this.closeAnimationEndTimerId),cancelAnimationFrame(this.animationRequestId)},n.prototype.setAnchorCorner=function(t){this.anchorCorner=t},n.prototype.flipCornerHorizontally=function(){this.originCorner=this.originCorner^tB.RIGHT},n.prototype.setAnchorMargin=function(t){this.anchorMargin.top=t.top||0,this.anchorMargin.right=t.right||0,this.anchorMargin.bottom=t.bottom||0,this.anchorMargin.left=t.left||0},n.prototype.setIsHoisted=function(t){this.isHoistedElement=t},n.prototype.setFixedPosition=function(t){this.isFixedPosition=t},n.prototype.setAbsolutePosition=function(t,n){this.position.x=this.isFinite(t)?t:0,this.position.y=this.isFinite(n)?n:0},n.prototype.setQuickOpen=function(t){this.isQuickOpen=t},n.prototype.isOpen=function(){return this.isSurfaceOpen},n.prototype.open=function(){var t=this;this.isSurfaceOpen||(this.adapter.saveFocus(),this.isQuickOpen?(this.isSurfaceOpen=!0,this.adapter.addClass(n.cssClasses.OPEN),this.dimensions=this.adapter.getInnerDimensions(),this.autoposition(),this.adapter.notifyOpen()):(this.adapter.addClass(n.cssClasses.ANIMATING_OPEN),this.animationRequestId=requestAnimationFrame(function(){t.adapter.addClass(n.cssClasses.OPEN),t.dimensions=t.adapter.getInnerDimensions(),t.autoposition(),t.openAnimationEndTimerId=setTimeout(function(){t.openAnimationEndTimerId=0,t.adapter.removeClass(n.cssClasses.ANIMATING_OPEN),t.adapter.notifyOpen()},cw.TRANSITION_OPEN_DURATION)}),this.isSurfaceOpen=!0))},n.prototype.close=function(t){var i=this;void 0===t&&(t=!1),this.isSurfaceOpen&&(this.isQuickOpen?(this.isSurfaceOpen=!1,t||this.maybeRestoreFocus(),this.adapter.removeClass(n.cssClasses.OPEN),this.adapter.removeClass(n.cssClasses.IS_OPEN_BELOW),this.adapter.notifyClose()):(this.adapter.addClass(n.cssClasses.ANIMATING_CLOSED),requestAnimationFrame(function(){i.adapter.removeClass(n.cssClasses.OPEN),i.adapter.removeClass(n.cssClasses.IS_OPEN_BELOW),i.closeAnimationEndTimerId=setTimeout(function(){i.closeAnimationEndTimerId=0,i.adapter.removeClass(n.cssClasses.ANIMATING_CLOSED),i.adapter.notifyClose()},cw.TRANSITION_CLOSE_DURATION)}),this.isSurfaceOpen=!1,t||this.maybeRestoreFocus()))},n.prototype.handleBodyClick=function(t){var n=t.target;this.adapter.isElementInContainer(n)||this.close()},n.prototype.handleKeydown=function(t){var n=t.keyCode;("Escape"===t.key||27===n)&&this.close()},n.prototype.autoposition=function(){this.measurements=this.getAutoLayoutmeasurements();var t,i=this.getoriginCorner(),r=this.getMenuSurfaceMaxHeight(i),o=this.hasBit(i,tB.BOTTOM)?"bottom":"top",a=this.hasBit(i,tB.RIGHT)?"right":"left",s=this.getHorizontalOriginOffset(i),l=this.getVerticalOriginOffset(i),c=this.measurements,d=c.anchorSize,u=c.surfaceSize,m=((t={})[a]=s,t[o]=l,t);d.width/u.width>cw.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO&&(a="center"),(this.isHoistedElement||this.isFixedPosition)&&this.adjustPositionForHoistedElement(m),this.adapter.setTransformOrigin(a+" "+o),this.adapter.setPosition(m),this.adapter.setMaxHeight(r?r+"px":""),this.hasBit(i,tB.BOTTOM)||this.adapter.addClass(n.cssClasses.IS_OPEN_BELOW)},n.prototype.getAutoLayoutmeasurements=function(){var t=this.adapter.getAnchorDimensions(),n=this.adapter.getBodyDimensions(),i=this.adapter.getWindowDimensions(),r=this.adapter.getWindowScroll();return t||(t={top:this.position.y,right:this.position.x,bottom:this.position.y,left:this.position.x,width:0,height:0}),{anchorSize:t,bodySize:n,surfaceSize:this.dimensions,viewportDistance:{top:t.top,right:i.width-t.right,bottom:i.height-t.bottom,left:t.left},viewportSize:i,windowScroll:r}},n.prototype.getoriginCorner=function(){var t,i,r,o,a=this.originCorner,s=this.measurements,l=s.viewportDistance,c=s.anchorSize,d=s.surfaceSize,u=n.numbers.MARGIN_TO_EDGE;this.hasBit(this.anchorCorner,tB.BOTTOM)?(t=l.top-u+c.height+this.anchorMargin.bottom,i=l.bottom-u-this.anchorMargin.bottom):(t=l.top-u+this.anchorMargin.top,i=l.bottom-u+c.height-this.anchorMargin.top),!(i-d.height>0)&&t>=i&&(a=this.setBit(a,tB.BOTTOM));var m=this.adapter.isRtl(),h=this.hasBit(this.anchorCorner,tB.FLIP_RTL),p=this.hasBit(this.anchorCorner,tB.RIGHT)||this.hasBit(a,tB.RIGHT),f=!1;(f=m&&h?!p:p)?(r=l.left+c.width+this.anchorMargin.right,o=l.right-this.anchorMargin.right):(r=l.left+this.anchorMargin.left,o=l.right+c.width-this.anchorMargin.left);var b=r-d.width>0,g=o-d.width>0,_=this.hasBit(a,tB.FLIP_RTL)&&this.hasBit(a,tB.RIGHT);return g&&_&&m||!b&&_?a=this.unsetBit(a,tB.RIGHT):(b&&f&&m||b&&!f&&p||!g&&r>=o)&&(a=this.setBit(a,tB.RIGHT)),a},n.prototype.getMenuSurfaceMaxHeight=function(t){var i=this.measurements.viewportDistance,r=0,o=this.hasBit(t,tB.BOTTOM),a=this.hasBit(this.anchorCorner,tB.BOTTOM),s=n.numbers.MARGIN_TO_EDGE;return o?(r=i.top+this.anchorMargin.top-s,a||(r+=this.measurements.anchorSize.height)):(r=i.bottom-this.anchorMargin.bottom+this.measurements.anchorSize.height-s,a&&(r-=this.measurements.anchorSize.height)),r},n.prototype.getHorizontalOriginOffset=function(t){var n=this.measurements.anchorSize,i=this.hasBit(t,tB.RIGHT),r=this.hasBit(this.anchorCorner,tB.RIGHT);if(i){var o=r?n.width-this.anchorMargin.left:this.anchorMargin.right;return this.isHoistedElement||this.isFixedPosition?o-(this.measurements.viewportSize.width-this.measurements.bodySize.width):o}return r?n.width-this.anchorMargin.right:this.anchorMargin.left},n.prototype.getVerticalOriginOffset=function(t){var n=this.measurements.anchorSize,i=this.hasBit(t,tB.BOTTOM),r=this.hasBit(this.anchorCorner,tB.BOTTOM);return i?r?n.height-this.anchorMargin.top:-this.anchorMargin.bottom:r?n.height+this.anchorMargin.bottom:this.anchorMargin.top},n.prototype.adjustPositionForHoistedElement=function(t){var n,i,r=this.measurements,o=r.windowScroll,a=r.viewportDistance,s=Object.keys(t);try{for(var l=ls(s),c=l.next();!c.done;c=l.next()){var d=c.value,u=t[d]||0;u+=a[d],this.isFixedPosition||("top"===d?u+=o.y:"bottom"===d?u-=o.y:"left"===d?u+=o.x:u-=o.x),t[d]=u}}catch(t){n={error:t}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}},n.prototype.maybeRestoreFocus=function(){var t=this.adapter.isFocused(),n=document.activeElement&&this.adapter.isElementInContainer(document.activeElement);(t||n)&&this.adapter.restoreFocus()},n.prototype.hasBit=function(t,n){return!!(t&n)},n.prototype.setBit=function(t,n){return t|n},n.prototype.unsetBit=function(t,n){return t^n},n.prototype.isFinite=function(t){return"number"==typeof t&&isFinite(t)},n}(lc),cK=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return lo(n,t),n.attachTo=function(t){return new n(t)},n.prototype.initialSyncWithDOM=function(){var t=this,n=this.root.parentElement;this.anchorElement=n&&n.classList.contains(cv.ANCHOR)?n:null,this.root.classList.contains(cv.FIXED)&&this.setFixedPosition(!0),this.handleKeydown=function(n){t.foundation.handleKeydown(n)},this.handleBodyClick=function(n){t.foundation.handleBodyClick(n)},this.registerBodyClickListener=function(){document.body.addEventListener("click",t.handleBodyClick,{capture:!0})},this.deregisterBodyClickListener=function(){document.body.removeEventListener("click",t.handleBodyClick,{capture:!0})},this.listen("keydown",this.handleKeydown),this.listen(cx.OPENED_EVENT,this.registerBodyClickListener),this.listen(cx.CLOSED_EVENT,this.deregisterBodyClickListener)},n.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown),this.unlisten(cx.OPENED_EVENT,this.registerBodyClickListener),this.unlisten(cx.CLOSED_EVENT,this.deregisterBodyClickListener),t.prototype.destroy.call(this)},n.prototype.isOpen=function(){return this.foundation.isOpen()},n.prototype.open=function(){this.foundation.open()},n.prototype.close=function(t){void 0===t&&(t=!1),this.foundation.close(t)},Object.defineProperty(n.prototype,"quickOpen",{set:function(t){this.foundation.setQuickOpen(t)},enumerable:!0,configurable:!0}),n.prototype.setIsHoisted=function(t){this.foundation.setIsHoisted(t)},n.prototype.setMenuSurfaceAnchorElement=function(t){this.anchorElement=t},n.prototype.setFixedPosition=function(t){t?this.root.classList.add(cv.FIXED):this.root.classList.remove(cv.FIXED),this.foundation.setFixedPosition(t)},n.prototype.setAbsolutePosition=function(t,n){this.foundation.setAbsolutePosition(t,n),this.setIsHoisted(!0)},n.prototype.setAnchorCorner=function(t){this.foundation.setAnchorCorner(t)},n.prototype.setAnchorMargin=function(t){this.foundation.setAnchorMargin(t)},n.prototype.getDefaultFoundation=function(){var t=this;return new cZ({addClass:function(n){return t.root.classList.add(n)},removeClass:function(n){return t.root.classList.remove(n)},hasClass:function(n){return t.root.classList.contains(n)},hasAnchor:function(){return!!t.anchorElement},notifyClose:function(){return t.emit(cZ.strings.CLOSED_EVENT,{})},notifyOpen:function(){return t.emit(cZ.strings.OPENED_EVENT,{})},isElementInContainer:function(n){return t.root.contains(n)},isRtl:function(){return"rtl"===getComputedStyle(t.root).getPropertyValue("direction")},setTransformOrigin:function(n){var i,r,o=(i=window,void 0===r&&(r=!1),(void 0===tY||r)&&(tY="transform"in i.document.createElement("div").style?"transform":"webkitTransform"),tY+"-origin");t.root.style.setProperty(o,n)},isFocused:function(){return document.activeElement===t.root},saveFocus:function(){t.previousFocus=document.activeElement},restoreFocus:function(){t.root.contains(document.activeElement)&&t.previousFocus&&t.previousFocus.focus&&t.previousFocus.focus()},getInnerDimensions:function(){return{width:t.root.offsetWidth,height:t.root.offsetHeight}},getAnchorDimensions:function(){return t.anchorElement?t.anchorElement.getBoundingClientRect():null},getWindowDimensions:function(){return{width:window.innerWidth,height:window.innerHeight}},getBodyDimensions:function(){return{width:document.body.clientWidth,height:document.body.clientHeight}},getWindowScroll:function(){return{x:window.pageXOffset,y:window.pageYOffset}},setPosition:function(n){var i=t.root;i.style.left="left"in n?n.left+"px":"",i.style.right="right"in n?n.right+"px":"",i.style.top="top"in n?n.top+"px":"",i.style.bottom="bottom"in n?n.bottom+"px":""},setMaxHeight:function(n){t.root.style.maxHeight=n}})},n}(ld),cJ={MENU_SELECTED_LIST_ITEM:"mdc-menu-item--selected",MENU_SELECTION_GROUP:"mdc-menu__selection-group",ROOT:"mdc-menu"},cQ={ARIA_CHECKED_ATTR:"aria-checked",ARIA_DISABLED_ATTR:"aria-disabled",CHECKBOX_SELECTOR:'input[type="checkbox"]',LIST_SELECTOR:".mdc-list",SELECTED_EVENT:"MDCMenu:selected"},c0={FOCUS_ROOT_INDEX:-1};(eT=tN||(tN={}))[eT.NONE=0]="NONE",eT[eT.LIST_ROOT=1]="LIST_ROOT",eT[eT.FIRST_ITEM=2]="FIRST_ITEM",eT[eT.LAST_ITEM=3]="LAST_ITEM";var c1=function(t){function n(i){var r=t.call(this,la(la({},n.defaultAdapter),i))||this;return r.closeAnimationEndTimerId_=0,r.defaultFocusState_=tN.LIST_ROOT,r}return lo(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return cJ},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return cQ},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return c0},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClassToElementAtIndex:function(){},removeClassFromElementAtIndex:function(){},addAttributeToElementAtIndex:function(){},removeAttributeFromElementAtIndex:function(){},elementContainsClass:function(){return!1},closeSurface:function(){},getElementIndex:function(){return -1},notifySelected:function(){},getMenuItemCount:function(){return 0},focusItemAtIndex:function(){},focusListRoot:function(){},getSelectedSiblingOfItemAtIndex:function(){return -1},isSelectableItemAtIndex:function(){return!1}}},enumerable:!0,configurable:!0}),n.prototype.destroy=function(){this.closeAnimationEndTimerId_&&clearTimeout(this.closeAnimationEndTimerId_),this.adapter.closeSurface()},n.prototype.handleKeydown=function(t){var n=t.key,i=t.keyCode;("Tab"===n||9===i)&&this.adapter.closeSurface(!0)},n.prototype.handleItemAction=function(t){var n=this,i=this.adapter.getElementIndex(t);i<0||(this.adapter.notifySelected({index:i}),this.adapter.closeSurface(),this.closeAnimationEndTimerId_=setTimeout(function(){var i=n.adapter.getElementIndex(t);i>=0&&n.adapter.isSelectableItemAtIndex(i)&&n.setSelectedIndex(i)},cZ.numbers.TRANSITION_CLOSE_DURATION))},n.prototype.handleMenuSurfaceOpened=function(){switch(this.defaultFocusState_){case tN.FIRST_ITEM:this.adapter.focusItemAtIndex(0);break;case tN.LAST_ITEM:this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount()-1);break;case tN.NONE:break;default:this.adapter.focusListRoot()}},n.prototype.setDefaultFocusState=function(t){this.defaultFocusState_=t},n.prototype.setSelectedIndex=function(t){if(this.validatedIndex_(t),!this.adapter.isSelectableItemAtIndex(t))throw Error("MDCMenuFoundation: No selection group at specified index.");var n=this.adapter.getSelectedSiblingOfItemAtIndex(t);n>=0&&(this.adapter.removeAttributeFromElementAtIndex(n,cQ.ARIA_CHECKED_ATTR),this.adapter.removeClassFromElementAtIndex(n,cJ.MENU_SELECTED_LIST_ITEM)),this.adapter.addClassToElementAtIndex(t,cJ.MENU_SELECTED_LIST_ITEM),this.adapter.addAttributeToElementAtIndex(t,cQ.ARIA_CHECKED_ATTR,"true")},n.prototype.setEnabled=function(t,n){this.validatedIndex_(t),n?(this.adapter.removeClassFromElementAtIndex(t,cF.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(t,cQ.ARIA_DISABLED_ATTR,"false")):(this.adapter.addClassToElementAtIndex(t,cF.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(t,cQ.ARIA_DISABLED_ATTR,"true"))},n.prototype.validatedIndex_=function(t){var n=this.adapter.getMenuItemCount();if(!(t>=0&&t<n))throw Error("MDCMenuFoundation: No list item at specified index.")},n}(lc),c2=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return lo(n,t),n.attachTo=function(t){return new n(t)},n.prototype.initialize=function(t,n){void 0===t&&(t=function(t){return new cK(t)}),void 0===n&&(n=function(t){return new cX(t)}),this.menuSurfaceFactory_=t,this.listFactory_=n},n.prototype.initialSyncWithDOM=function(){var t=this;this.menuSurface_=this.menuSurfaceFactory_(this.root);var n=this.root.querySelector(cQ.LIST_SELECTOR);n?(this.list_=this.listFactory_(n),this.list_.wrapFocus=!0):this.list_=null,this.handleKeydown_=function(n){return t.foundation.handleKeydown(n)},this.handleItemAction_=function(n){return t.foundation.handleItemAction(t.items[n.detail.index])},this.handleMenuSurfaceOpened_=function(){return t.foundation.handleMenuSurfaceOpened()},this.menuSurface_.listen(cZ.strings.OPENED_EVENT,this.handleMenuSurfaceOpened_),this.listen("keydown",this.handleKeydown_),this.listen(cW.strings.ACTION_EVENT,this.handleItemAction_)},n.prototype.destroy=function(){this.list_&&this.list_.destroy(),this.menuSurface_.destroy(),this.menuSurface_.unlisten(cZ.strings.OPENED_EVENT,this.handleMenuSurfaceOpened_),this.unlisten("keydown",this.handleKeydown_),this.unlisten(cW.strings.ACTION_EVENT,this.handleItemAction_),t.prototype.destroy.call(this)},Object.defineProperty(n.prototype,"open",{get:function(){return this.menuSurface_.isOpen()},set:function(t){t?this.menuSurface_.open():this.menuSurface_.close()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"wrapFocus",{get:function(){return!!this.list_&&this.list_.wrapFocus},set:function(t){this.list_&&(this.list_.wrapFocus=t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hasTypeahead",{set:function(t){this.list_&&(this.list_.hasTypeahead=t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"typeaheadInProgress",{get:function(){return!!this.list_&&this.list_.typeaheadInProgress},enumerable:!0,configurable:!0}),n.prototype.typeaheadMatchItem=function(t,n){return this.list_?this.list_.typeaheadMatchItem(t,n):-1},n.prototype.layout=function(){this.list_&&this.list_.layout()},Object.defineProperty(n.prototype,"items",{get:function(){return this.list_?this.list_.listElements:[]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"singleSelection",{set:function(t){this.list_&&(this.list_.singleSelection=t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"selectedIndex",{get:function(){return this.list_?this.list_.selectedIndex:cE.UNSET_INDEX},set:function(t){this.list_&&(this.list_.selectedIndex=t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"quickOpen",{set:function(t){this.menuSurface_.quickOpen=t},enumerable:!0,configurable:!0}),n.prototype.setDefaultFocusState=function(t){this.foundation.setDefaultFocusState(t)},n.prototype.setAnchorCorner=function(t){this.menuSurface_.setAnchorCorner(t)},n.prototype.setAnchorMargin=function(t){this.menuSurface_.setAnchorMargin(t)},n.prototype.setSelectedIndex=function(t){this.foundation.setSelectedIndex(t)},n.prototype.setEnabled=function(t,n){this.foundation.setEnabled(t,n)},n.prototype.getOptionByIndex=function(t){return t<this.items.length?this.items[t]:null},n.prototype.getPrimaryTextAtIndex=function(t){var n=this.getOptionByIndex(t);return n&&this.list_&&this.list_.getPrimaryText(n)||""},n.prototype.setFixedPosition=function(t){this.menuSurface_.setFixedPosition(t)},n.prototype.setIsHoisted=function(t){this.menuSurface_.setIsHoisted(t)},n.prototype.setAbsolutePosition=function(t,n){this.menuSurface_.setAbsolutePosition(t,n)},n.prototype.setAnchorElement=function(t){this.menuSurface_.anchorElement=t},n.prototype.getDefaultFoundation=function(){var t=this;return new c1({addClassToElementAtIndex:function(n,i){t.items[n].classList.add(i)},removeClassFromElementAtIndex:function(n,i){t.items[n].classList.remove(i)},addAttributeToElementAtIndex:function(n,i,r){t.items[n].setAttribute(i,r)},removeAttributeFromElementAtIndex:function(n,i){t.items[n].removeAttribute(i)},elementContainsClass:function(t,n){return t.classList.contains(n)},closeSurface:function(n){return t.menuSurface_.close(n)},getElementIndex:function(n){return t.items.indexOf(n)},notifySelected:function(n){return t.emit(cQ.SELECTED_EVENT,{index:n.index,item:t.items[n.index]})},getMenuItemCount:function(){return t.items.length},focusItemAtIndex:function(n){return t.items[n].focus()},focusListRoot:function(){return t.root.querySelector(cQ.LIST_SELECTOR).focus()},isSelectableItemAtIndex:function(n){return!!lm(t.items[n],"."+cJ.MENU_SELECTION_GROUP)},getSelectedSiblingOfItemAtIndex:function(n){var i=lm(t.items[n],"."+cJ.MENU_SELECTION_GROUP).querySelector("."+cJ.MENU_SELECTED_LIST_ITEM);return i?t.items.indexOf(i):-1}})},n}(ld),c5={ACTIVATED:"mdc-select--activated",DISABLED:"mdc-select--disabled",FOCUSED:"mdc-select--focused",INVALID:"mdc-select--invalid",MENU_INVALID:"mdc-select__menu--invalid",OUTLINED:"mdc-select--outlined",REQUIRED:"mdc-select--required",ROOT:"mdc-select",WITH_LEADING_ICON:"mdc-select--with-leading-icon"},c3={ARIA_CONTROLS:"aria-controls",ARIA_DESCRIBEDBY:"aria-describedby",ARIA_SELECTED_ATTR:"aria-selected",CHANGE_EVENT:"MDCSelect:change",HIDDEN_INPUT_SELECTOR:'input[type="hidden"]',LABEL_SELECTOR:".mdc-floating-label",LEADING_ICON_SELECTOR:".mdc-select__icon",LINE_RIPPLE_SELECTOR:".mdc-line-ripple",MENU_SELECTOR:".mdc-select__menu",OUTLINE_SELECTOR:".mdc-notched-outline",SELECTED_TEXT_SELECTOR:".mdc-select__selected-text",SELECT_ANCHOR_SELECTOR:".mdc-select__anchor",VALUE_ATTR:"data-value"},c4={LABEL_SCALE:.75,UNSET_INDEX:-1,CLICK_DEBOUNCE_TIMEOUT_MS:330},c6=function(t){function n(i,r){void 0===r&&(r={});var o=t.call(this,la(la({},n.defaultAdapter),i))||this;return o.disabled=!1,o.isMenuOpen=!1,o.useDefaultValidation=!0,o.customValidity=!0,o.lastSelectedIndex=c4.UNSET_INDEX,o.clickDebounceTimeout=0,o.recentlyClicked=!1,o.leadingIcon=r.leadingIcon,o.helperText=r.helperText,o}return lo(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return c5},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return c4},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return c3},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},activateBottomLine:function(){},deactivateBottomLine:function(){},getSelectedIndex:function(){return -1},setSelectedIndex:function(){},hasLabel:function(){return!1},floatLabel:function(){},getLabelWidth:function(){return 0},setLabelRequired:function(){},hasOutline:function(){return!1},notchOutline:function(){},closeOutline:function(){},setRippleCenter:function(){},notifyChange:function(){},setSelectedText:function(){},isSelectAnchorFocused:function(){return!1},getSelectAnchorAttr:function(){return""},setSelectAnchorAttr:function(){},removeSelectAnchorAttr:function(){},addMenuClass:function(){},removeMenuClass:function(){},openMenu:function(){},closeMenu:function(){},getAnchorElement:function(){return null},setMenuAnchorElement:function(){},setMenuAnchorCorner:function(){},setMenuWrapFocus:function(){},focusMenuItemAtIndex:function(){},getMenuItemCount:function(){return 0},getMenuItemValues:function(){return[]},getMenuItemTextAtIndex:function(){return""},isTypeaheadInProgress:function(){return!1},typeaheadMatchItem:function(){return -1}}},enumerable:!0,configurable:!0}),n.prototype.getSelectedIndex=function(){return this.adapter.getSelectedIndex()},n.prototype.setSelectedIndex=function(t,n,i){void 0===n&&(n=!1),void 0===i&&(i=!1),t>=this.adapter.getMenuItemCount()||(t===c4.UNSET_INDEX?this.adapter.setSelectedText(""):this.adapter.setSelectedText(this.adapter.getMenuItemTextAtIndex(t).trim()),this.adapter.setSelectedIndex(t),n&&this.adapter.closeMenu(),i||this.lastSelectedIndex===t||this.handleChange(),this.lastSelectedIndex=t)},n.prototype.setValue=function(t,n){void 0===n&&(n=!1);var i=this.adapter.getMenuItemValues().indexOf(t);this.setSelectedIndex(i,!1,n)},n.prototype.getValue=function(){var t=this.adapter.getSelectedIndex(),n=this.adapter.getMenuItemValues();return t!==c4.UNSET_INDEX?n[t]:""},n.prototype.getDisabled=function(){return this.disabled},n.prototype.setDisabled=function(t){this.disabled=t,this.disabled?(this.adapter.addClass(c5.DISABLED),this.adapter.closeMenu()):this.adapter.removeClass(c5.DISABLED),this.leadingIcon&&this.leadingIcon.setDisabled(this.disabled),this.disabled?this.adapter.removeSelectAnchorAttr("tabindex"):this.adapter.setSelectAnchorAttr("tabindex","0"),this.adapter.setSelectAnchorAttr("aria-disabled",this.disabled.toString())},n.prototype.openMenu=function(){this.adapter.addClass(c5.ACTIVATED),this.adapter.openMenu(),this.isMenuOpen=!0,this.adapter.setSelectAnchorAttr("aria-expanded","true")},n.prototype.setHelperTextContent=function(t){this.helperText&&this.helperText.setContent(t)},n.prototype.layout=function(){if(this.adapter.hasLabel()){var t=this.getValue().length>0,n=this.adapter.hasClass(c5.FOCUSED),i=t||n,r=this.adapter.hasClass(c5.REQUIRED);this.notchOutline(i),this.adapter.floatLabel(i),this.adapter.setLabelRequired(r)}},n.prototype.layoutOptions=function(){var t=this.adapter.getMenuItemValues().indexOf(this.getValue());this.setSelectedIndex(t,!1,!0)},n.prototype.handleMenuOpened=function(){if(0!==this.adapter.getMenuItemValues().length){var t=this.getSelectedIndex();this.adapter.focusMenuItemAtIndex(t>=0?t:0)}},n.prototype.handleMenuClosed=function(){this.adapter.removeClass(c5.ACTIVATED),this.isMenuOpen=!1,this.adapter.setSelectAnchorAttr("aria-expanded","false"),this.adapter.isSelectAnchorFocused()||this.blur()},n.prototype.handleChange=function(){this.layout(),this.adapter.notifyChange(this.getValue()),this.adapter.hasClass(c5.REQUIRED)&&this.useDefaultValidation&&this.setValid(this.isValid())},n.prototype.handleMenuItemAction=function(t){this.setSelectedIndex(t,!0)},n.prototype.handleFocus=function(){this.adapter.addClass(c5.FOCUSED),this.layout(),this.adapter.activateBottomLine()},n.prototype.handleBlur=function(){this.isMenuOpen||this.blur()},n.prototype.handleClick=function(t){if(!this.disabled&&!this.recentlyClicked){if(this.setClickDebounceTimeout(),this.isMenuOpen)return void this.adapter.closeMenu();this.adapter.setRippleCenter(t),this.openMenu()}},n.prototype.handleKeydown=function(t){if(!this.isMenuOpen&&this.adapter.hasClass(c5.FOCUSED)){var n=cj(t)===cM,i=cj(t)===cA,r=cj(t)===cI,o=cj(t)===cO;if(!i&&t.key&&1===t.key.length||i&&this.adapter.isTypeaheadInProgress()){var a=i?" ":t.key,s=this.adapter.typeaheadMatchItem(a,this.getSelectedIndex());s>=0&&this.setSelectedIndex(s),t.preventDefault();return}(n||i||r||o)&&(r&&this.getSelectedIndex()>0?this.setSelectedIndex(this.getSelectedIndex()-1):o&&this.getSelectedIndex()<this.adapter.getMenuItemCount()-1&&this.setSelectedIndex(this.getSelectedIndex()+1),this.openMenu(),t.preventDefault())}},n.prototype.notchOutline=function(t){if(this.adapter.hasOutline()){var n=this.adapter.hasClass(c5.FOCUSED);if(t){var i=c4.LABEL_SCALE,r=this.adapter.getLabelWidth()*i;this.adapter.notchOutline(r)}else n||this.adapter.closeOutline()}},n.prototype.setLeadingIconAriaLabel=function(t){this.leadingIcon&&this.leadingIcon.setAriaLabel(t)},n.prototype.setLeadingIconContent=function(t){this.leadingIcon&&this.leadingIcon.setContent(t)},n.prototype.setUseDefaultValidation=function(t){this.useDefaultValidation=t},n.prototype.setValid=function(t){this.useDefaultValidation||(this.customValidity=t),this.adapter.setSelectAnchorAttr("aria-invalid",(!t).toString()),t?(this.adapter.removeClass(c5.INVALID),this.adapter.removeMenuClass(c5.MENU_INVALID)):(this.adapter.addClass(c5.INVALID),this.adapter.addMenuClass(c5.MENU_INVALID)),this.syncHelperTextValidity(t)},n.prototype.isValid=function(){return this.useDefaultValidation&&this.adapter.hasClass(c5.REQUIRED)&&!this.adapter.hasClass(c5.DISABLED)?this.getSelectedIndex()!==c4.UNSET_INDEX&&(0!==this.getSelectedIndex()||!!this.getValue()):this.customValidity},n.prototype.setRequired=function(t){t?this.adapter.addClass(c5.REQUIRED):this.adapter.removeClass(c5.REQUIRED),this.adapter.setSelectAnchorAttr("aria-required",t.toString()),this.adapter.setLabelRequired(t)},n.prototype.getRequired=function(){return"true"===this.adapter.getSelectAnchorAttr("aria-required")},n.prototype.init=function(){var t=this.adapter.getAnchorElement();t&&(this.adapter.setMenuAnchorElement(t),this.adapter.setMenuAnchorCorner(tz.BOTTOM_START)),this.adapter.setMenuWrapFocus(!1),this.setDisabled(this.adapter.hasClass(c5.DISABLED)),this.syncHelperTextValidity(!this.adapter.hasClass(c5.INVALID)),this.layout(),this.layoutOptions()},n.prototype.blur=function(){this.adapter.removeClass(c5.FOCUSED),this.layout(),this.adapter.deactivateBottomLine(),this.adapter.hasClass(c5.REQUIRED)&&this.useDefaultValidation&&this.setValid(this.isValid())},n.prototype.syncHelperTextValidity=function(t){if(this.helperText){this.helperText.setValidity(t);var n=this.helperText.isVisible(),i=this.helperText.getId();n&&i?this.adapter.setSelectAnchorAttr(c3.ARIA_DESCRIBEDBY,i):this.adapter.removeSelectAnchorAttr(c3.ARIA_DESCRIBEDBY)}},n.prototype.setClickDebounceTimeout=function(){var t=this;clearTimeout(this.clickDebounceTimeout),this.clickDebounceTimeout=setTimeout(function(){t.recentlyClicked=!1},c4.CLICK_DEBOUNCE_TIMEOUT_MS),this.recentlyClicked=!0},n}(lc),c8={ARIA_HIDDEN:"aria-hidden",ROLE:"role"},c7={HELPER_TEXT_VALIDATION_MSG:"mdc-select-helper-text--validation-msg",HELPER_TEXT_VALIDATION_MSG_PERSISTENT:"mdc-select-helper-text--validation-msg-persistent"},c9=function(t){function n(i){return t.call(this,la(la({},n.defaultAdapter),i))||this}return lo(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return c7},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return c8},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setAttr:function(){},getAttr:function(){return null},removeAttr:function(){},setContent:function(){}}},enumerable:!0,configurable:!0}),n.prototype.getId=function(){return this.adapter.getAttr("id")},n.prototype.isVisible=function(){return"true"!==this.adapter.getAttr(c8.ARIA_HIDDEN)},n.prototype.setContent=function(t){this.adapter.setContent(t)},n.prototype.setValidation=function(t){t?this.adapter.addClass(c7.HELPER_TEXT_VALIDATION_MSG):this.adapter.removeClass(c7.HELPER_TEXT_VALIDATION_MSG)},n.prototype.setValidationMsgPersistent=function(t){t?this.adapter.addClass(c7.HELPER_TEXT_VALIDATION_MSG_PERSISTENT):this.adapter.removeClass(c7.HELPER_TEXT_VALIDATION_MSG_PERSISTENT)},n.prototype.setValidity=function(t){if(this.adapter.hasClass(c7.HELPER_TEXT_VALIDATION_MSG)){var n=this.adapter.hasClass(c7.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);if(!t||n){this.showToScreenReader(),t?this.adapter.removeAttr(c8.ROLE):this.adapter.setAttr(c8.ROLE,"alert");return}this.adapter.removeAttr(c8.ROLE),this.hide()}},n.prototype.showToScreenReader=function(){this.adapter.removeAttr(c8.ARIA_HIDDEN)},n.prototype.hide=function(){this.adapter.setAttr(c8.ARIA_HIDDEN,"true")},n}(lc),de=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return lo(n,t),n.attachTo=function(t){return new n(t)},Object.defineProperty(n.prototype,"foundationForSelect",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),n.prototype.getDefaultFoundation=function(){var t=this;return new c9({addClass:function(n){return t.root.classList.add(n)},removeClass:function(n){return t.root.classList.remove(n)},hasClass:function(n){return t.root.classList.contains(n)},getAttr:function(n){return t.root.getAttribute(n)},setAttr:function(n,i){return t.root.setAttribute(n,i)},removeAttr:function(n){return t.root.removeAttribute(n)},setContent:function(n){t.root.textContent=n}})},n}(ld),dt={ICON_EVENT:"MDCSelect:icon",ICON_ROLE:"button"},dn=["click","keydown"],di=function(t){function n(i){var r=t.call(this,la(la({},n.defaultAdapter),i))||this;return r.savedTabIndex_=null,r.interactionHandler_=function(t){return r.handleInteraction(t)},r}return lo(n,t),Object.defineProperty(n,"strings",{get:function(){return dt},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},notifyIconAction:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){var t=this;this.savedTabIndex_=this.adapter.getAttr("tabindex"),dn.forEach(function(n){t.adapter.registerInteractionHandler(n,t.interactionHandler_)})},n.prototype.destroy=function(){var t=this;dn.forEach(function(n){t.adapter.deregisterInteractionHandler(n,t.interactionHandler_)})},n.prototype.setDisabled=function(t){this.savedTabIndex_&&(t?(this.adapter.setAttr("tabindex","-1"),this.adapter.removeAttr("role")):(this.adapter.setAttr("tabindex",this.savedTabIndex_),this.adapter.setAttr("role",dt.ICON_ROLE)))},n.prototype.setAriaLabel=function(t){this.adapter.setAttr("aria-label",t)},n.prototype.setContent=function(t){this.adapter.setContent(t)},n.prototype.handleInteraction=function(t){var n="Enter"===t.key||13===t.keyCode;("click"===t.type||n)&&this.adapter.notifyIconAction()},n}(lc),dr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return lo(n,t),n.attachTo=function(t){return new n(t)},Object.defineProperty(n.prototype,"foundationForSelect",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),n.prototype.getDefaultFoundation=function(){var t=this;return new di({getAttr:function(n){return t.root.getAttribute(n)},setAttr:function(n,i){return t.root.setAttribute(n,i)},removeAttr:function(n){return t.root.removeAttribute(n)},setContent:function(n){t.root.textContent=n},registerInteractionHandler:function(n,i){return t.listen(n,i)},deregisterInteractionHandler:function(n,i){return t.unlisten(n,i)},notifyIconAction:function(){return t.emit(di.strings.ICON_EVENT,{},!0)}})},n}(ld),da=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return lo(n,t),n.attachTo=function(t){return new n(t)},n.prototype.initialize=function(t,n,i,r,o,a){if(void 0===t&&(t=function(t){return new lb(t)}),void 0===n&&(n=function(t){return new ly(t)}),void 0===i&&(i=function(t){return new lk(t)}),void 0===r&&(r=function(t){return new c2(t)}),void 0===o&&(o=function(t){return new dr(t)}),void 0===a&&(a=function(t){return new de(t)}),this.selectAnchor=this.root.querySelector(c3.SELECT_ANCHOR_SELECTOR),this.selectedText=this.root.querySelector(c3.SELECTED_TEXT_SELECTOR),this.hiddenInput=this.root.querySelector(c3.HIDDEN_INPUT_SELECTOR),!this.selectedText)throw Error("MDCSelect: Missing required element: The following selector must be present: '"+c3.SELECTED_TEXT_SELECTOR+"'");if(this.selectAnchor.hasAttribute(c3.ARIA_CONTROLS)){var s=document.getElementById(this.selectAnchor.getAttribute(c3.ARIA_CONTROLS));s&&(this.helperText=a(s))}this.menuSetup(r);var l=this.root.querySelector(c3.LABEL_SELECTOR);this.label=l?t(l):null;var c=this.root.querySelector(c3.LINE_RIPPLE_SELECTOR);this.lineRipple=c?n(c):null;var d=this.root.querySelector(c3.OUTLINE_SELECTOR);this.outline=d?i(d):null;var u=this.root.querySelector(c3.LEADING_ICON_SELECTOR);u&&(this.leadingIcon=o(u)),this.root.classList.contains(c5.OUTLINED)||(this.ripple=this.createRipple())},n.prototype.initialSyncWithDOM=function(){var t=this;if(this.handleFocus=function(){t.foundation.handleFocus()},this.handleBlur=function(){t.foundation.handleBlur()},this.handleClick=function(n){t.selectAnchor.focus(),t.foundation.handleClick(t.getNormalizedXCoordinate(n))},this.handleKeydown=function(n){t.foundation.handleKeydown(n)},this.handleMenuItemAction=function(n){t.foundation.handleMenuItemAction(n.detail.index)},this.handleMenuOpened=function(){t.foundation.handleMenuOpened()},this.handleMenuClosed=function(){t.foundation.handleMenuClosed()},this.selectAnchor.addEventListener("focus",this.handleFocus),this.selectAnchor.addEventListener("blur",this.handleBlur),this.selectAnchor.addEventListener("click",this.handleClick),this.selectAnchor.addEventListener("keydown",this.handleKeydown),this.menu.listen(cx.CLOSED_EVENT,this.handleMenuClosed),this.menu.listen(cx.OPENED_EVENT,this.handleMenuOpened),this.menu.listen(cQ.SELECTED_EVENT,this.handleMenuItemAction),this.hiddenInput){if(this.hiddenInput.value){this.foundation.setValue(this.hiddenInput.value,!0),this.foundation.layout();return}this.hiddenInput.value=this.value}},n.prototype.destroy=function(){this.selectAnchor.removeEventListener("focus",this.handleFocus),this.selectAnchor.removeEventListener("blur",this.handleBlur),this.selectAnchor.removeEventListener("keydown",this.handleKeydown),this.selectAnchor.removeEventListener("click",this.handleClick),this.menu.unlisten(cx.CLOSED_EVENT,this.handleMenuClosed),this.menu.unlisten(cx.OPENED_EVENT,this.handleMenuOpened),this.menu.unlisten(cQ.SELECTED_EVENT,this.handleMenuItemAction),this.menu.destroy(),this.ripple&&this.ripple.destroy(),this.outline&&this.outline.destroy(),this.leadingIcon&&this.leadingIcon.destroy(),this.helperText&&this.helperText.destroy(),t.prototype.destroy.call(this)},Object.defineProperty(n.prototype,"value",{get:function(){return this.foundation.getValue()},set:function(t){this.foundation.setValue(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(t){this.foundation.setSelectedIndex(t,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this.foundation.getDisabled()},set:function(t){this.foundation.setDisabled(t),this.hiddenInput&&(this.hiddenInput.disabled=t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"leadingIconAriaLabel",{set:function(t){this.foundation.setLeadingIconAriaLabel(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"leadingIconContent",{set:function(t){this.foundation.setLeadingIconContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"helperTextContent",{set:function(t){this.foundation.setHelperTextContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"useDefaultValidation",{set:function(t){this.foundation.setUseDefaultValidation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"valid",{get:function(){return this.foundation.isValid()},set:function(t){this.foundation.setValid(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"required",{get:function(){return this.foundation.getRequired()},set:function(t){this.foundation.setRequired(t)},enumerable:!0,configurable:!0}),n.prototype.layout=function(){this.foundation.layout()},n.prototype.layoutOptions=function(){this.foundation.layoutOptions(),this.menu.layout(),this.menuItemValues=this.menu.items.map(function(t){return t.getAttribute(c3.VALUE_ATTR)||""}),this.hiddenInput&&(this.hiddenInput.value=this.value)},n.prototype.getDefaultFoundation=function(){return new c6(la(la(la(la({},this.getSelectAdapterMethods()),this.getCommonAdapterMethods()),this.getOutlineAdapterMethods()),this.getLabelAdapterMethods()),this.getFoundationMap())},n.prototype.menuSetup=function(t){this.menuElement=this.root.querySelector(c3.MENU_SELECTOR),this.menu=t(this.menuElement),this.menu.hasTypeahead=!0,this.menu.singleSelection=!0,this.menuItemValues=this.menu.items.map(function(t){return t.getAttribute(c3.VALUE_ATTR)||""})},n.prototype.createRipple=function(){var t=this,n=la(la({},lL.createAdapter({root:this.selectAnchor})),{registerInteractionHandler:function(n,i){t.selectAnchor.addEventListener(n,i)},deregisterInteractionHandler:function(n,i){t.selectAnchor.removeEventListener(n,i)}});return new lL(this.selectAnchor,new lD(n))},n.prototype.getSelectAdapterMethods=function(){var t=this;return{getMenuItemAttr:function(t,n){return t.getAttribute(n)},setSelectedText:function(n){t.selectedText.textContent=n},isSelectAnchorFocused:function(){return document.activeElement===t.selectAnchor},getSelectAnchorAttr:function(n){return t.selectAnchor.getAttribute(n)},setSelectAnchorAttr:function(n,i){t.selectAnchor.setAttribute(n,i)},removeSelectAnchorAttr:function(n){t.selectAnchor.removeAttribute(n)},addMenuClass:function(n){t.menuElement.classList.add(n)},removeMenuClass:function(n){t.menuElement.classList.remove(n)},openMenu:function(){t.menu.open=!0},closeMenu:function(){t.menu.open=!1},getAnchorElement:function(){return t.root.querySelector(c3.SELECT_ANCHOR_SELECTOR)},setMenuAnchorElement:function(n){t.menu.setAnchorElement(n)},setMenuAnchorCorner:function(n){t.menu.setAnchorCorner(n)},setMenuWrapFocus:function(n){t.menu.wrapFocus=n},getSelectedIndex:function(){var n=t.menu.selectedIndex;return n instanceof Array?n[0]:n},setSelectedIndex:function(n){t.menu.selectedIndex=n},focusMenuItemAtIndex:function(n){t.menu.items[n].focus()},getMenuItemCount:function(){return t.menu.items.length},getMenuItemValues:function(){return t.menuItemValues},getMenuItemTextAtIndex:function(n){return t.menu.getPrimaryTextAtIndex(n)},isTypeaheadInProgress:function(){return t.menu.typeaheadInProgress},typeaheadMatchItem:function(n,i){return t.menu.typeaheadMatchItem(n,i)}}},n.prototype.getCommonAdapterMethods=function(){var t=this;return{addClass:function(n){t.root.classList.add(n)},removeClass:function(n){t.root.classList.remove(n)},hasClass:function(n){return t.root.classList.contains(n)},setRippleCenter:function(n){t.lineRipple&&t.lineRipple.setRippleCenter(n)},activateBottomLine:function(){t.lineRipple&&t.lineRipple.activate()},deactivateBottomLine:function(){t.lineRipple&&t.lineRipple.deactivate()},notifyChange:function(n){var i=t.selectedIndex;t.emit(c3.CHANGE_EVENT,{value:n,index:i},!0),t.hiddenInput&&(t.hiddenInput.value=n)}}},n.prototype.getOutlineAdapterMethods=function(){var t=this;return{hasOutline:function(){return!!t.outline},notchOutline:function(n){t.outline&&t.outline.notch(n)},closeOutline:function(){t.outline&&t.outline.closeNotch()}}},n.prototype.getLabelAdapterMethods=function(){var t=this;return{hasLabel:function(){return!!t.label},floatLabel:function(n){t.label&&t.label.float(n)},getLabelWidth:function(){return t.label?t.label.getWidth():0},setLabelRequired:function(n){t.label&&t.label.setRequired(n)}}},n.prototype.getNormalizedXCoordinate=function(t){var n=t.target.getBoundingClientRect();return(this.isTouchEvent(t)?t.touches[0].clientX:t.clientX)-n.left},n.prototype.isTouchEvent=function(t){return!!t.touches},n.prototype.getFoundationMap=function(){return{helperText:this.helperText?this.helperText.foundationForSelect:void 0,leadingIcon:this.leadingIcon?this.leadingIcon.foundationForSelect:void 0}},n}(ld),ds={ROOT:"mdc-form-field"},dl={LABEL_SELECTOR:".mdc-form-field > label"},dc=function(t){function n(i){var r=t.call(this,la(la({},n.defaultAdapter),i))||this;return r.click=function(){r.handleClick()},r}return lo(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return ds},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return dl},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{activateInputRipple:function(){},deactivateInputRipple:function(){},deregisterInteractionHandler:function(){},registerInteractionHandler:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){this.adapter.registerInteractionHandler("click",this.click)},n.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("click",this.click)},n.prototype.handleClick=function(){var t=this;this.adapter.activateInputRipple(),requestAnimationFrame(function(){t.adapter.deactivateInputRipple()})},n}(lc),dd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return lo(n,t),n.attachTo=function(t){return new n(t)},n.prototype.labelEl=function(){var t=dc.strings.LABEL_SELECTOR;return this.root.querySelector(t)},n.prototype.getDefaultFoundation=function(){var t=this;return new dc({activateInputRipple:function(){t.input&&t.input.ripple&&t.input.ripple.activate()},deactivateInputRipple:function(){t.input&&t.input.ripple&&t.input.ripple.deactivate()},deregisterInteractionHandler:function(n,i){var r=t.labelEl();r&&r.removeEventListener(n,i)},registerInteractionHandler:function(n,i){var r=t.labelEl();r&&r.addEventListener(n,i)}})},n}(ld),du={ICON_BUTTON_ON:"mdc-icon-button--on",ROOT:"mdc-icon-button"},dm={ARIA_LABEL:"aria-label",ARIA_PRESSED:"aria-pressed",DATA_ARIA_LABEL_OFF:"data-aria-label-off",DATA_ARIA_LABEL_ON:"data-aria-label-on",CHANGE_EVENT:"MDCIconButtonToggle:change"},dh=function(t){function n(i){var r=t.call(this,la(la({},n.defaultAdapter),i))||this;return r.hasToggledAriaLabel=!1,r}return lo(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return du},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return dm},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},hasClass:function(){return!1},notifyChange:function(){},removeClass:function(){},getAttr:function(){return null},setAttr:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){var t=this.adapter.getAttr(dm.DATA_ARIA_LABEL_ON),n=this.adapter.getAttr(dm.DATA_ARIA_LABEL_OFF);if(t&&n){if(null!==this.adapter.getAttr(dm.ARIA_PRESSED))throw Error("MDCIconButtonToggleFoundation: Button should not set `aria-pressed` if it has a toggled aria label.");this.hasToggledAriaLabel=!0}else this.adapter.setAttr(dm.ARIA_PRESSED,String(this.isOn()))},n.prototype.handleClick=function(){this.toggle(),this.adapter.notifyChange({isOn:this.isOn()})},n.prototype.isOn=function(){return this.adapter.hasClass(du.ICON_BUTTON_ON)},n.prototype.toggle=function(t){if(void 0===t&&(t=!this.isOn()),t?this.adapter.addClass(du.ICON_BUTTON_ON):this.adapter.removeClass(du.ICON_BUTTON_ON),this.hasToggledAriaLabel){var n=t?this.adapter.getAttr(dm.DATA_ARIA_LABEL_ON):this.adapter.getAttr(dm.DATA_ARIA_LABEL_OFF);this.adapter.setAttr(dm.ARIA_LABEL,n||"")}else this.adapter.setAttr(dm.ARIA_PRESSED,""+t)},n}(lc),dp=dh.strings,df=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.rippleComponent=n.createRipple(),n}return lo(n,t),n.attachTo=function(t){return new n(t)},n.prototype.initialSyncWithDOM=function(){var t=this;this.handleClick=function(){t.foundation.handleClick()},this.listen("click",this.handleClick)},n.prototype.destroy=function(){this.unlisten("click",this.handleClick),this.ripple.destroy(),t.prototype.destroy.call(this)},n.prototype.getDefaultFoundation=function(){var t=this;return new dh({addClass:function(n){return t.root.classList.add(n)},hasClass:function(n){return t.root.classList.contains(n)},notifyChange:function(n){t.emit(dp.CHANGE_EVENT,n)},removeClass:function(n){return t.root.classList.remove(n)},getAttr:function(n){return t.root.getAttribute(n)},setAttr:function(n,i){return t.root.setAttribute(n,i)}})},Object.defineProperty(n.prototype,"ripple",{get:function(){return this.rippleComponent},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"on",{get:function(){return this.foundation.isOn()},set:function(t){this.foundation.toggle(t)},enumerable:!0,configurable:!0}),n.prototype.createRipple=function(){var t=new lL(this.root);return t.unbounded=!0,t},n}(ld);let db="important",dg=" !"+db,d_=aQ(class extends a0{constructor(t){if(super(t),1!==t.type||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((n,i)=>{let r=t[i];return null==r?n:n+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(t,[n]){let{style:i}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(n)),this.render(n);for(let t of this.ft)null==n[t]&&(this.ft.delete(t),t.includes("-")?i.removeProperty(t):i[t]=null);for(let t in n){let r=n[t];if(null!=r){this.ft.add(t);let n="string"==typeof r&&r.endsWith(dg);t.includes("-")||n?i.setProperty(t,n?r.slice(0,-11):r,n?db:""):i[t]=r}}return aP}}),dy=t=>n=>class extends n{constructor(){super(...arguments),this._i18nextJustInitialized=!1,this._language=t.language,this.initCallback=t=>{this._i18nextJustInitialized=!0,this.requestUpdate&&this.requestUpdate()},this.langChangedCallback=()=>{this.requestUpdate&&(this._language=t.language,this.requestUpdate("_language"))}}connectedCallback(){t.language||t.on("initialized",this.initCallback),t.on("languageChanged",this.langChangedCallback),super.connectedCallback&&super.connectedCallback()}disconnectedCallback(){t.off("initialized",this.initCallback),t.off("languageChanged",this.langChangedCallback),super.disconnectedCallback&&super.disconnectedCallback()}shouldUpdate(t){return this._i18nextJustInitialized?(this._i18nextJustInitialized=!1,!0):super.shouldUpdate&&super.shouldUpdate(t)}};var dv=function(t,n,i,r){var o,a=arguments.length,s=a<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,n,i,r);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(s=(a<3?o(s):a>3?o(n,i,s):o(n,i))||s);return a>3&&s&&Object.defineProperty(n,i,s),s};let dx=class extends dy(nj)(aK){render(){return aL`
480
+ `,sC([a6({type:Number,reflect:!0,attribute:!0})],sL.prototype,"lat",void 0),sC([a6({type:Number,reflect:!0})],sL.prototype,"lng",void 0),sC([a6({type:Number,reflect:!0})],sL.prototype,"radius",void 0),sC([a6({reflect:!0})],sL.prototype,"displayValue",void 0),sC([a6({reflect:!0})],sL.prototype,"direction",void 0),sC([a6({type:Boolean})],sL.prototype,"visible",void 0),sC([a6({type:String})],sL.prototype,"icon",void 0),sC([a6({type:String})],sL.prototype,"color",void 0),sC([a6({type:String})],sL.prototype,"activeColor",void 0),sC([a6({type:Boolean})],sL.prototype,"interactive",void 0),sC([a6({type:Boolean})],sL.prototype,"active",void 0),sC([a9("slot")],sL.prototype,"_slot",void 0),sL=tI=sC([a3("or-map-marker")],sL);var sN=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};function sj(t,n){if(t&&n&&t[n])return t[n]}function sH(t,n){let i=sj(t,n);if(i)return i.attributeName}let sU=class extends sd(sx)(sL){constructor(){super(),this.assetTypeAsIcon=!0,this.visible=!1}set type(t){let n,i=sj(this.config,t);if(i&&i.attributeName&&this.asset&&this.asset.attributes&&this.asset.attributes[i.attributeName]&&i.colours){let t=this.asset.attributes[i.attributeName].value;n={markerConfig:i.colours,currentValue:t}}let r=sB(t,n);if(!r){this.visible=!1;return}this.assetTypeAsIcon&&(this.icon=r.icon),this._markerColor=Array.isArray(r.color)?r.color[0].colour:r.color||void 0,this._updateColor(this.markerContainer),this.visible=!0}shouldUpdate(t){if(t.has("assetId")&&(this.lat=void 0,this.lng=void 0,this.type=void 0,this.direction=void 0,this.displayValue=void 0,this.assetIds=this.assetId&&this.assetId.length>0?[this.assetId]:void 0,1===Object.keys(t).length))return!1;if(t.has("asset"))try{this._onAssetChanged(this.asset)}catch(t){console.error(t)}return super.shouldUpdate(t)}_onEvent(t){if("attribute"===t.eventType)return"location"===t.ref.name?void this._updateLocation(t.value):void(this.asset&&(this.asset=n1(this.asset,t),this.requestUpdate()));if("asset"===t.eventType)switch(t.cause){case"READ":case"CREATE":case"UPDATE":this._onAssetChanged(t.asset);break;case"DELETE":this._onAssetChanged(void 0)}}_onAssetChanged(t){var n,i,r,o;return n=this,i=void 0,r=void 0,o=function*(){if(t){this.direction=void 0,this.displayValue=void 0;let r=t.attributes?t.attributes.location:void 0;this._updateLocation(r?r.value:null);let o=sj(this.config,t.type),a=!o||!o.hideDirection,s=o&&!0===o.showLabel&&!!o.attributeName,l=!!(o&&!1!==o.showUnits);if(s&&t.attributes&&t.attributes[null==o?void 0:o.attributeName]){var n,i;let r=t.attributes[o.attributeName],a=tq.getAttributeAndValueDescriptors(t.type,r.name,r);this.displayValue=(n=a[0],i=t.type,nZ(r,n,i,l,!0,"-"))}if(a&&t.attributes&&t.attributes.direction){let n=t.attributes.direction.value;null!=n&&(this.direction=n.toString())}this.type=t.type}else this.lat=void 0,this.lng=void 0},new(r||(r=Promise))(function(t,a){function s(t){try{c(o.next(t))}catch(t){a(t)}}function l(t){try{c(o.throw(t))}catch(t){a(t)}}function c(n){var i;n.done?t(n.value):((i=n.value)instanceof r?i:new r(function(t){t(i)})).then(s,l)}c((o=o.apply(n,i||[])).next())})}_updateLocation(t){this.lat=t&&t.coordinates?t.coordinates[1]:void 0,this.lng=t&&t.coordinates?t.coordinates[0]:void 0}_getColor(){return this._markerColor&&!this.color?"#"+this._markerColor:super._getColor()}_getActiveColor(){return this._markerColor&&!this.activeColor?"#"+this._markerColor:super._getActiveColor()}};sN([a6({type:String,reflect:!0,attribute:!0})],sU.prototype,"assetId",void 0),sN([a6({type:Object,attribute:!0})],sU.prototype,"asset",void 0),sN([a6()],sU.prototype,"config",void 0),sU=sN([a3("or-map-marker-asset")],sU);let{I:sV}={M:ap,P:af,A:ab,C:1,L:aY,R:aH,D:aw,V:aj,I:aU,H:aV,N:aG,U:a$,B:aq,F:aW},sq=(t,n)=>{let i=t._$AN;if(void 0===i)return!1;for(let t of i)t._$AO?.(n,!1),sq(t,n);return!0},sG=t=>{let n,i;do{if(void 0===(n=t._$AM))break;(i=n._$AN).delete(t),t=n}while(0===i?.size)},s$=t=>{for(let n;n=t._$AM;t=n){let i=n._$AN;if(void 0===i)n._$AN=i=new Set;else if(i.has(t))break;i.add(t),sZ(n)}};function sW(t){void 0!==this._$AN?(sG(this),this._$AM=t,s$(this)):this._$AM=t}function sX(t,n=!1,i=0){let r=this._$AH,o=this._$AN;if(void 0!==o&&0!==o.size)if(n)if(Array.isArray(r))for(let t=i;t<r.length;t++)sq(r[t],!1),sG(r[t]);else null!=r&&(sq(r,!1),sG(r));else sq(this,t)}let sZ=t=>{2==t.type&&(t._$AP??=sX,t._$AQ??=sW)};class sK extends a0{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,n,i){super._$AT(t,n,i),s$(this),this.isConnected=t._$AU}_$AO(t,n=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),n&&(sq(this,t),sG(this))}setValue(t){if(void 0===this._$Ct.strings)this._$Ct._$AI(t,this);else{let n=[...this._$Ct._$AH];n[this._$Ci]=t,this._$Ct._$AI(n,this,0)}}disconnected(){}reconnected(){}}let sJ=new WeakMap;aQ(class extends sK{render(t){return aO}update(t,[n]){let i=n!==this.G;return i&&void 0!==this.G&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.G=n,this.ht=t.options?.host,this.rt(this.ct=t.element)),aO}rt(t){if(this.isConnected||(t=void 0),"function"==typeof this.G){let n=this.ht??globalThis,i=sJ.get(n);void 0===i&&(i=new WeakMap,sJ.set(n,i)),void 0!==i.get(this.G)&&this.G.call(this.ht,void 0),i.set(this.G,t),void 0!==t&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){return"function"==typeof this.G?sJ.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});let sQ=aQ(class extends a0{constructor(t){if(super(t),1!==t.type||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(n=>t[n]).join(" ")+" "}update(t,[n]){if(void 0===this.st){for(let i in this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t))),n)n[i]&&!this.nt?.has(i)&&this.st.add(i);return this.render(n)}let i=t.element.classList;for(let t of this.st)t in n||(i.remove(t),this.st.delete(t));for(let t in n){let r=!!n[t];r===this.st.has(t)||this.nt?.has(t)||(r?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return aP}});class s0{constructor(t){this.G=t}disconnect(){this.G=void 0}reconnect(t){this.G=t}deref(){return this.G}}class s1{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise(t=>this.Z=t)}resume(){this.Z?.(),this.Y=this.Z=void 0}}let s2=t=>null!==t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then,s5=aQ(class extends sK{constructor(){super(...arguments),this._$Cwt=0x3fffffff,this._$Cbt=[],this._$CK=new s0(this),this._$CX=new s1}render(...t){return t.find(t=>!s2(t))??aP}update(t,n){let i=this._$Cbt,r=i.length;this._$Cbt=n;let o=this._$CK,a=this._$CX;this.isConnected||this.disconnected();for(let t=0;t<n.length&&!(t>this._$Cwt);t++){let s=n[t];if(!s2(s))return this._$Cwt=t,s;t<r&&s===i[t]||(this._$Cwt=0x3fffffff,r=0,Promise.resolve(s).then(async t=>{for(;a.get();)await a.get();let n=o.deref();if(void 0!==n){let i=n._$Cbt.indexOf(s);i>-1&&i<n._$Cwt&&(n._$Cwt=i,n.setValue(t))}}))}return aP}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}});var s3=function(t,n){return(s3=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])})(t,n)};function s4(t,n){function i(){this.constructor=t}s3(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var s6=function(){return(s6=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++)for(var o in n=arguments[i])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)};function s8(t){var n="function"==typeof Symbol&&Symbol.iterator,i=n&&t[n],r=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw TypeError(n?"Object is not iterable.":"Symbol.iterator is not defined.")}function s7(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(function(t,n){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var r,o,a=i.call(t),s=[];try{for(;(void 0===n||n-- >0)&&!(r=a.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(i=a.return)&&i.call(a)}finally{if(o)throw o.error}}return s}(arguments[n]));return t}var s9=function(){function t(t){void 0===t&&(t={}),this.adapter=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}(),le=function(){function t(t,n){for(var i=[],r=2;r<arguments.length;r++)i[r-2]=arguments[r];this.root=t,this.initialize.apply(this,s7(i)),this.foundation=void 0===n?this.getDefaultFoundation():n,this.foundation.init(),this.initialSyncWithDOM()}return t.attachTo=function(n){return new t(n,new s9({}))},t.prototype.initialize=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n]},t.prototype.getDefaultFoundation=function(){throw Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},t.prototype.initialSyncWithDOM=function(){},t.prototype.destroy=function(){this.foundation.destroy()},t.prototype.listen=function(t,n,i){this.root.addEventListener(t,n,i)},t.prototype.unlisten=function(t,n,i){this.root.removeEventListener(t,n,i)},t.prototype.emit=function(t,n,i){var r;void 0===i&&(i=!1),"function"==typeof CustomEvent?r=new CustomEvent(t,{bubbles:i,detail:n}):(r=document.createEvent("CustomEvent")).initCustomEvent(t,i,!1,n),this.root.dispatchEvent(r)},t}();function lt(t){return void 0===t&&(t=window),!!function(t){void 0===t&&(t=window);var n=!1;try{var i={get passive(){return n=!0,!1}},r=function(){};t.document.addEventListener("test",r,i),t.document.removeEventListener("test",r,i)}catch(t){n=!1}return n}(t)&&{passive:!0}}function ln(t,n){if(t.closest)return t.closest(n);for(var i=t;i;){if(li(i,n))return i;i=i.parentElement}return null}function li(t,n){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,n)}var lr={LABEL_FLOAT_ABOVE:"mdc-floating-label--float-above",LABEL_REQUIRED:"mdc-floating-label--required",LABEL_SHAKE:"mdc-floating-label--shake",ROOT:"mdc-floating-label"},lo=function(t){function n(i){var r=t.call(this,s6(s6({},n.defaultAdapter),i))||this;return r.shakeAnimationEndHandler_=function(){return r.handleShakeAnimationEnd_()},r}return s4(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return lr},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},getWidth:function(){return 0},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){this.adapter.registerInteractionHandler("animationend",this.shakeAnimationEndHandler_)},n.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("animationend",this.shakeAnimationEndHandler_)},n.prototype.getWidth=function(){return this.adapter.getWidth()},n.prototype.shake=function(t){var i=n.cssClasses.LABEL_SHAKE;t?this.adapter.addClass(i):this.adapter.removeClass(i)},n.prototype.float=function(t){var i=n.cssClasses,r=i.LABEL_FLOAT_ABOVE,o=i.LABEL_SHAKE;t?this.adapter.addClass(r):(this.adapter.removeClass(r),this.adapter.removeClass(o))},n.prototype.setRequired=function(t){var i=n.cssClasses.LABEL_REQUIRED;t?this.adapter.addClass(i):this.adapter.removeClass(i)},n.prototype.handleShakeAnimationEnd_=function(){var t=n.cssClasses.LABEL_SHAKE;this.adapter.removeClass(t)},n}(s9),la=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return s4(n,t),n.attachTo=function(t){return new n(t)},n.prototype.shake=function(t){this.foundation.shake(t)},n.prototype.float=function(t){this.foundation.float(t)},n.prototype.setRequired=function(t){this.foundation.setRequired(t)},n.prototype.getWidth=function(){return this.foundation.getWidth()},n.prototype.getDefaultFoundation=function(){var t=this;return new lo({addClass:function(n){return t.root.classList.add(n)},removeClass:function(n){return t.root.classList.remove(n)},getWidth:function(){var n=t.root;if(null!==n.offsetParent)return n.scrollWidth;var i=n.cloneNode(!0);i.style.setProperty("position","absolute"),i.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(i);var r=i.scrollWidth;return document.documentElement.removeChild(i),r},registerInteractionHandler:function(n,i){return t.listen(n,i)},deregisterInteractionHandler:function(n,i){return t.unlisten(n,i)}})},n}(le),ls={LINE_RIPPLE_ACTIVE:"mdc-line-ripple--active",LINE_RIPPLE_DEACTIVATING:"mdc-line-ripple--deactivating"},ll=function(t){function n(i){var r=t.call(this,s6(s6({},n.defaultAdapter),i))||this;return r.transitionEndHandler_=function(t){return r.handleTransitionEnd(t)},r}return s4(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return ls},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setStyle:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){this.adapter.registerEventHandler("transitionend",this.transitionEndHandler_)},n.prototype.destroy=function(){this.adapter.deregisterEventHandler("transitionend",this.transitionEndHandler_)},n.prototype.activate=function(){this.adapter.removeClass(ls.LINE_RIPPLE_DEACTIVATING),this.adapter.addClass(ls.LINE_RIPPLE_ACTIVE)},n.prototype.setRippleCenter=function(t){this.adapter.setStyle("transform-origin",t+"px center")},n.prototype.deactivate=function(){this.adapter.addClass(ls.LINE_RIPPLE_DEACTIVATING)},n.prototype.handleTransitionEnd=function(t){var n=this.adapter.hasClass(ls.LINE_RIPPLE_DEACTIVATING);"opacity"===t.propertyName&&n&&(this.adapter.removeClass(ls.LINE_RIPPLE_ACTIVE),this.adapter.removeClass(ls.LINE_RIPPLE_DEACTIVATING))},n}(s9),lc=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return s4(n,t),n.attachTo=function(t){return new n(t)},n.prototype.activate=function(){this.foundation.activate()},n.prototype.deactivate=function(){this.foundation.deactivate()},n.prototype.setRippleCenter=function(t){this.foundation.setRippleCenter(t)},n.prototype.getDefaultFoundation=function(){var t=this;return new ll({addClass:function(n){return t.root.classList.add(n)},removeClass:function(n){return t.root.classList.remove(n)},hasClass:function(n){return t.root.classList.contains(n)},setStyle:function(n,i){return t.root.style.setProperty(n,i)},registerEventHandler:function(n,i){return t.listen(n,i)},deregisterEventHandler:function(n,i){return t.unlisten(n,i)}})},n}(le),ld={NOTCH_ELEMENT_SELECTOR:".mdc-notched-outline__notch"},lu={NOTCH_ELEMENT_PADDING:8},lm={NO_LABEL:"mdc-notched-outline--no-label",OUTLINE_NOTCHED:"mdc-notched-outline--notched",OUTLINE_UPGRADED:"mdc-notched-outline--upgraded"},lh=function(t){function n(i){return t.call(this,s6(s6({},n.defaultAdapter),i))||this}return s4(n,t),Object.defineProperty(n,"strings",{get:function(){return ld},enumerable:!0,configurable:!0}),Object.defineProperty(n,"cssClasses",{get:function(){return lm},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return lu},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNotchWidthProperty:function(){},removeNotchWidthProperty:function(){}}},enumerable:!0,configurable:!0}),n.prototype.notch=function(t){var i=n.cssClasses.OUTLINE_NOTCHED;t>0&&(t+=lu.NOTCH_ELEMENT_PADDING),this.adapter.setNotchWidthProperty(t),this.adapter.addClass(i)},n.prototype.closeNotch=function(){var t=n.cssClasses.OUTLINE_NOTCHED;this.adapter.removeClass(t),this.adapter.removeNotchWidthProperty()},n}(s9),lp=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return s4(n,t),n.attachTo=function(t){return new n(t)},n.prototype.initialSyncWithDOM=function(){this.notchElement_=this.root.querySelector(ld.NOTCH_ELEMENT_SELECTOR);var t=this.root.querySelector("."+lo.cssClasses.ROOT);t?(t.style.transitionDuration="0s",this.root.classList.add(lm.OUTLINE_UPGRADED),requestAnimationFrame(function(){t.style.transitionDuration=""})):this.root.classList.add(lm.NO_LABEL)},n.prototype.notch=function(t){this.foundation.notch(t)},n.prototype.closeNotch=function(){this.foundation.closeNotch()},n.prototype.getDefaultFoundation=function(){var t=this;return new lh({addClass:function(n){return t.root.classList.add(n)},removeClass:function(n){return t.root.classList.remove(n)},setNotchWidthProperty:function(n){return t.notchElement_.style.setProperty("width",n+"px")},removeNotchWidthProperty:function(){return t.notchElement_.style.removeProperty("width")}})},n}(le),lf={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},lb={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},lg={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300},l_=["touchstart","pointerdown","mousedown","keydown"],ly=["touchend","pointerup","mouseup","contextmenu"],lv=[],lx=function(t){function n(i){var r=t.call(this,s6(s6({},n.defaultAdapter),i))||this;return r.activationAnimationHasEnded_=!1,r.activationTimer_=0,r.fgDeactivationRemovalTimer_=0,r.fgScale_="0",r.frame_={width:0,height:0},r.initialSize_=0,r.layoutFrame_=0,r.maxRadius_=0,r.unboundedCoords_={left:0,top:0},r.activationState_=r.defaultActivationState_(),r.activationTimerCallback_=function(){r.activationAnimationHasEnded_=!0,r.runDeactivationUXLogicIfReady_()},r.activateHandler_=function(t){return r.activate_(t)},r.deactivateHandler_=function(){return r.deactivate_()},r.focusHandler_=function(){return r.handleFocus()},r.blurHandler_=function(){return r.handleBlur()},r.resizeHandler_=function(){return r.layout()},r}return s4(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return lf},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return lb},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return lg},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){var t=this,i=this.supportsPressRipple_();if(this.registerRootHandlers_(i),i){var r=n.cssClasses,o=r.ROOT,a=r.UNBOUNDED;requestAnimationFrame(function(){t.adapter.addClass(o),t.adapter.isUnbounded()&&(t.adapter.addClass(a),t.layoutInternal_())})}},n.prototype.destroy=function(){var t=this;if(this.supportsPressRipple_()){this.activationTimer_&&(clearTimeout(this.activationTimer_),this.activationTimer_=0,this.adapter.removeClass(n.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer_&&(clearTimeout(this.fgDeactivationRemovalTimer_),this.fgDeactivationRemovalTimer_=0,this.adapter.removeClass(n.cssClasses.FG_DEACTIVATION));var i=n.cssClasses,r=i.ROOT,o=i.UNBOUNDED;requestAnimationFrame(function(){t.adapter.removeClass(r),t.adapter.removeClass(o),t.removeCssVars_()})}this.deregisterRootHandlers_(),this.deregisterDeactivationHandlers_()},n.prototype.activate=function(t){this.activate_(t)},n.prototype.deactivate=function(){this.deactivate_()},n.prototype.layout=function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame(function(){t.layoutInternal_(),t.layoutFrame_=0})},n.prototype.setUnbounded=function(t){var i=n.cssClasses.UNBOUNDED;t?this.adapter.addClass(i):this.adapter.removeClass(i)},n.prototype.handleFocus=function(){var t=this;requestAnimationFrame(function(){return t.adapter.addClass(n.cssClasses.BG_FOCUSED)})},n.prototype.handleBlur=function(){var t=this;requestAnimationFrame(function(){return t.adapter.removeClass(n.cssClasses.BG_FOCUSED)})},n.prototype.supportsPressRipple_=function(){return this.adapter.browserSupportsCssVars()},n.prototype.defaultActivationState_=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},n.prototype.registerRootHandlers_=function(t){var n=this;t&&(l_.forEach(function(t){n.adapter.registerInteractionHandler(t,n.activateHandler_)}),this.adapter.isUnbounded()&&this.adapter.registerResizeHandler(this.resizeHandler_)),this.adapter.registerInteractionHandler("focus",this.focusHandler_),this.adapter.registerInteractionHandler("blur",this.blurHandler_)},n.prototype.registerDeactivationHandlers_=function(t){var n=this;"keydown"===t.type?this.adapter.registerInteractionHandler("keyup",this.deactivateHandler_):ly.forEach(function(t){n.adapter.registerDocumentInteractionHandler(t,n.deactivateHandler_)})},n.prototype.deregisterRootHandlers_=function(){var t=this;l_.forEach(function(n){t.adapter.deregisterInteractionHandler(n,t.activateHandler_)}),this.adapter.deregisterInteractionHandler("focus",this.focusHandler_),this.adapter.deregisterInteractionHandler("blur",this.blurHandler_),this.adapter.isUnbounded()&&this.adapter.deregisterResizeHandler(this.resizeHandler_)},n.prototype.deregisterDeactivationHandlers_=function(){var t=this;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler_),ly.forEach(function(n){t.adapter.deregisterDocumentInteractionHandler(n,t.deactivateHandler_)})},n.prototype.removeCssVars_=function(){var t=this,i=n.strings;Object.keys(i).forEach(function(n){0===n.indexOf("VAR_")&&t.adapter.updateCssVariable(i[n],null)})},n.prototype.activate_=function(t){var n=this;if(!this.adapter.isSurfaceDisabled()){var i=this.activationState_;if(!i.isActivated){var r=this.previousActivationEvent_;if(!(r&&void 0!==t&&r.type!==t.type)){if(i.isActivated=!0,i.isProgrammatic=void 0===t,i.activationEvent=t,i.wasActivatedByPointer=!i.isProgrammatic&&void 0!==t&&("mousedown"===t.type||"touchstart"===t.type||"pointerdown"===t.type),void 0!==t&&lv.length>0&&lv.some(function(t){return n.adapter.containsEventTarget(t)}))return void this.resetActivationState_();void 0!==t&&(lv.push(t.target),this.registerDeactivationHandlers_(t)),i.wasElementMadeActive=this.checkElementMadeActive_(t),i.wasElementMadeActive&&this.animateActivation_(),requestAnimationFrame(function(){lv=[],!i.wasElementMadeActive&&void 0!==t&&(" "===t.key||32===t.keyCode)&&(i.wasElementMadeActive=n.checkElementMadeActive_(t),i.wasElementMadeActive&&n.animateActivation_()),i.wasElementMadeActive||(n.activationState_=n.defaultActivationState_())})}}}},n.prototype.checkElementMadeActive_=function(t){return void 0===t||"keydown"!==t.type||this.adapter.isSurfaceActive()},n.prototype.animateActivation_=function(){var t=this,i=n.strings,r=i.VAR_FG_TRANSLATE_START,o=i.VAR_FG_TRANSLATE_END,a=n.cssClasses,s=a.FG_DEACTIVATION,l=a.FG_ACTIVATION,c=n.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal_();var d="",u="";if(!this.adapter.isUnbounded()){var m=this.getFgTranslationCoordinates_(),h=m.startPoint,p=m.endPoint;d=h.x+"px, "+h.y+"px",u=p.x+"px, "+p.y+"px"}this.adapter.updateCssVariable(r,d),this.adapter.updateCssVariable(o,u),clearTimeout(this.activationTimer_),clearTimeout(this.fgDeactivationRemovalTimer_),this.rmBoundedActivationClasses_(),this.adapter.removeClass(s),this.adapter.computeBoundingRect(),this.adapter.addClass(l),this.activationTimer_=setTimeout(function(){return t.activationTimerCallback_()},c)},n.prototype.getFgTranslationCoordinates_=function(){var t,n=this.activationState_,i=n.activationEvent;return{startPoint:t={x:(t=n.wasActivatedByPointer?function(t,n,i){if(!t)return{x:0,y:0};var r,o,a=n.x,s=n.y,l=a+i.left,c=s+i.top;return"touchstart"===t.type?(r=t.changedTouches[0].pageX-l,o=t.changedTouches[0].pageY-c):(r=t.pageX-l,o=t.pageY-c),{x:r,y:o}}(i,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect()):{x:this.frame_.width/2,y:this.frame_.height/2}).x-this.initialSize_/2,y:t.y-this.initialSize_/2},endPoint:{x:this.frame_.width/2-this.initialSize_/2,y:this.frame_.height/2-this.initialSize_/2}}},n.prototype.runDeactivationUXLogicIfReady_=function(){var t=this,i=n.cssClasses.FG_DEACTIVATION,r=this.activationState_,o=r.hasDeactivationUXRun,a=r.isActivated;(o||!a)&&this.activationAnimationHasEnded_&&(this.rmBoundedActivationClasses_(),this.adapter.addClass(i),this.fgDeactivationRemovalTimer_=setTimeout(function(){t.adapter.removeClass(i)},lg.FG_DEACTIVATION_MS))},n.prototype.rmBoundedActivationClasses_=function(){var t=n.cssClasses.FG_ACTIVATION;this.adapter.removeClass(t),this.activationAnimationHasEnded_=!1,this.adapter.computeBoundingRect()},n.prototype.resetActivationState_=function(){var t=this;this.previousActivationEvent_=this.activationState_.activationEvent,this.activationState_=this.defaultActivationState_(),setTimeout(function(){return t.previousActivationEvent_=void 0},n.numbers.TAP_DELAY_MS)},n.prototype.deactivate_=function(){var t=this,n=this.activationState_;if(n.isActivated){var i=s6({},n);n.isProgrammatic?(requestAnimationFrame(function(){return t.animateDeactivation_(i)}),this.resetActivationState_()):(this.deregisterDeactivationHandlers_(),requestAnimationFrame(function(){t.activationState_.hasDeactivationUXRun=!0,t.animateDeactivation_(i),t.resetActivationState_()}))}},n.prototype.animateDeactivation_=function(t){var n=t.wasActivatedByPointer,i=t.wasElementMadeActive;(n||i)&&this.runDeactivationUXLogicIfReady_()},n.prototype.layoutInternal_=function(){this.frame_=this.adapter.computeBoundingRect();var t=Math.max(this.frame_.height,this.frame_.width);this.maxRadius_=this.adapter.isUnbounded()?t:Math.sqrt(Math.pow(this.frame_.width,2)+Math.pow(this.frame_.height,2))+n.numbers.PADDING;var i=Math.floor(t*n.numbers.INITIAL_ORIGIN_SCALE);this.adapter.isUnbounded()&&i%2!=0?this.initialSize_=i-1:this.initialSize_=i,this.fgScale_=""+this.maxRadius_/this.initialSize_,this.updateLayoutCssVars_()},n.prototype.updateLayoutCssVars_=function(){var t=n.strings,i=t.VAR_FG_SIZE,r=t.VAR_LEFT,o=t.VAR_TOP,a=t.VAR_FG_SCALE;this.adapter.updateCssVariable(i,this.initialSize_+"px"),this.adapter.updateCssVariable(a,this.fgScale_),this.adapter.isUnbounded()&&(this.unboundedCoords_={left:Math.round(this.frame_.width/2-this.initialSize_/2),top:Math.round(this.frame_.height/2-this.initialSize_/2)},this.adapter.updateCssVariable(r,this.unboundedCoords_.left+"px"),this.adapter.updateCssVariable(o,this.unboundedCoords_.top+"px"))},n}(s9),lw=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.disabled=!1,n}return s4(n,t),n.attachTo=function(t,i){void 0===i&&(i={isUnbounded:void 0});var r=new n(t);return void 0!==i.isUnbounded&&(r.unbounded=i.isUnbounded),r},n.createAdapter=function(t){return{addClass:function(n){return t.root.classList.add(n)},browserSupportsCssVars:function(){return function(t,n){void 0===n&&(n=!1);var i=t.CSS,r=tP;if("boolean"==typeof tP&&!n)return tP;if(!(i&&"function"==typeof i.supports))return!1;var o=i.supports("--css-vars","yes"),a=i.supports("(--css-vars: yes)")&&i.supports("color","#00000000");return r=o||a,n||(tP=r),r}(window)},computeBoundingRect:function(){return t.root.getBoundingClientRect()},containsEventTarget:function(n){return t.root.contains(n)},deregisterDocumentInteractionHandler:function(t,n){return document.documentElement.removeEventListener(t,n,lt())},deregisterInteractionHandler:function(n,i){return t.root.removeEventListener(n,i,lt())},deregisterResizeHandler:function(t){return window.removeEventListener("resize",t)},getWindowPageOffset:function(){return{x:window.pageXOffset,y:window.pageYOffset}},isSurfaceActive:function(){return li(t.root,":active")},isSurfaceDisabled:function(){return!!t.disabled},isUnbounded:function(){return!!t.unbounded},registerDocumentInteractionHandler:function(t,n){return document.documentElement.addEventListener(t,n,lt())},registerInteractionHandler:function(n,i){return t.root.addEventListener(n,i,lt())},registerResizeHandler:function(t){return window.addEventListener("resize",t)},removeClass:function(n){return t.root.classList.remove(n)},updateCssVariable:function(n,i){return t.root.style.setProperty(n,i)}}},Object.defineProperty(n.prototype,"unbounded",{get:function(){return!!this.unbounded_},set:function(t){this.unbounded_=!!t,this.setUnbounded_()},enumerable:!0,configurable:!0}),n.prototype.activate=function(){this.foundation.activate()},n.prototype.deactivate=function(){this.foundation.deactivate()},n.prototype.layout=function(){this.foundation.layout()},n.prototype.getDefaultFoundation=function(){return new lx(n.createAdapter(this))},n.prototype.initialSyncWithDOM=function(){var t=this.root;this.unbounded="mdcRippleIsUnbounded"in t.dataset},n.prototype.setUnbounded_=function(){this.foundation.setUnbounded(!!this.unbounded_)},n}(le),lF={ROOT:"mdc-text-field-character-counter"},lk={ROOT_SELECTOR:"."+lF.ROOT},lE=function(t){function n(i){return t.call(this,s6(s6({},n.defaultAdapter),i))||this}return s4(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return lF},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return lk},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{setContent:function(){}}},enumerable:!0,configurable:!0}),n.prototype.setCounterValue=function(t,n){t=Math.min(t,n),this.adapter.setContent(t+" / "+n)},n}(s9),lT=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return s4(n,t),n.attachTo=function(t){return new n(t)},Object.defineProperty(n.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),n.prototype.getDefaultFoundation=function(){var t=this;return new lE({setContent:function(n){t.root.textContent=n}})},n}(le),lM={ARIA_CONTROLS:"aria-controls",ARIA_DESCRIBEDBY:"aria-describedby",INPUT_SELECTOR:".mdc-text-field__input",LABEL_SELECTOR:".mdc-floating-label",LEADING_ICON_SELECTOR:".mdc-text-field__icon--leading",LINE_RIPPLE_SELECTOR:".mdc-line-ripple",OUTLINE_SELECTOR:".mdc-notched-outline",PREFIX_SELECTOR:".mdc-text-field__affix--prefix",SUFFIX_SELECTOR:".mdc-text-field__affix--suffix",TRAILING_ICON_SELECTOR:".mdc-text-field__icon--trailing"},lA={DISABLED:"mdc-text-field--disabled",FOCUSED:"mdc-text-field--focused",HELPER_LINE:"mdc-text-field-helper-line",INVALID:"mdc-text-field--invalid",LABEL_FLOATING:"mdc-text-field--label-floating",NO_LABEL:"mdc-text-field--no-label",OUTLINED:"mdc-text-field--outlined",ROOT:"mdc-text-field",TEXTAREA:"mdc-text-field--textarea",WITH_LEADING_ICON:"mdc-text-field--with-leading-icon",WITH_TRAILING_ICON:"mdc-text-field--with-trailing-icon"},lC={LABEL_SCALE:.75},lS=["pattern","min","max","required","step","minlength","maxlength"],lD=["color","date","datetime-local","month","range","time","week"],lL=["mousedown","touchstart"],lI=["click","keydown"],lP=function(t){function n(i,r){void 0===r&&(r={});var o=t.call(this,s6(s6({},n.defaultAdapter),i))||this;return o.isFocused_=!1,o.receivedUserInput_=!1,o.isValid_=!0,o.useNativeValidation_=!0,o.validateOnValueChange_=!0,o.helperText_=r.helperText,o.characterCounter_=r.characterCounter,o.leadingIcon_=r.leadingIcon,o.trailingIcon_=r.trailingIcon,o.inputFocusHandler_=function(){return o.activateFocus()},o.inputBlurHandler_=function(){return o.deactivateFocus()},o.inputInputHandler_=function(){return o.handleInput()},o.setPointerXOffset_=function(t){return o.setTransformOrigin(t)},o.textFieldInteractionHandler_=function(){return o.handleTextFieldInteraction()},o.validationAttributeChangeHandler_=function(t){return o.handleValidationAttributeChange(t)},o}return s4(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return lA},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return lM},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return lC},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"shouldAlwaysFloat_",{get:function(){var t=this.getNativeInput_().type;return lD.indexOf(t)>=0},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"shouldFloat",{get:function(){return this.shouldAlwaysFloat_||this.isFocused_||!!this.getValue()||this.isBadInput_()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"shouldShake",{get:function(){return!this.isFocused_&&!this.isValid()&&!!this.getValue()},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!0},setInputAttr:function(){},removeInputAttr:function(){},registerTextFieldInteractionHandler:function(){},deregisterTextFieldInteractionHandler:function(){},registerInputInteractionHandler:function(){},deregisterInputInteractionHandler:function(){},registerValidationAttributeChangeHandler:function(){return new MutationObserver(function(){})},deregisterValidationAttributeChangeHandler:function(){},getNativeInput:function(){return null},isFocused:function(){return!1},activateLineRipple:function(){},deactivateLineRipple:function(){},setLineRippleTransformOrigin:function(){},shakeLabel:function(){},floatLabel:function(){},setLabelRequired:function(){},hasLabel:function(){return!1},getLabelWidth:function(){return 0},hasOutline:function(){return!1},notchOutline:function(){},closeOutline:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){var t=this;this.adapter.hasLabel()&&this.getNativeInput_().required&&this.adapter.setLabelRequired(!0),this.adapter.isFocused()?this.inputFocusHandler_():this.adapter.hasLabel()&&this.shouldFloat&&(this.notchOutline(!0),this.adapter.floatLabel(!0),this.styleFloating_(!0)),this.adapter.registerInputInteractionHandler("focus",this.inputFocusHandler_),this.adapter.registerInputInteractionHandler("blur",this.inputBlurHandler_),this.adapter.registerInputInteractionHandler("input",this.inputInputHandler_),lL.forEach(function(n){t.adapter.registerInputInteractionHandler(n,t.setPointerXOffset_)}),lI.forEach(function(n){t.adapter.registerTextFieldInteractionHandler(n,t.textFieldInteractionHandler_)}),this.validationObserver_=this.adapter.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler_),this.setCharacterCounter_(this.getValue().length)},n.prototype.destroy=function(){var t=this;this.adapter.deregisterInputInteractionHandler("focus",this.inputFocusHandler_),this.adapter.deregisterInputInteractionHandler("blur",this.inputBlurHandler_),this.adapter.deregisterInputInteractionHandler("input",this.inputInputHandler_),lL.forEach(function(n){t.adapter.deregisterInputInteractionHandler(n,t.setPointerXOffset_)}),lI.forEach(function(n){t.adapter.deregisterTextFieldInteractionHandler(n,t.textFieldInteractionHandler_)}),this.adapter.deregisterValidationAttributeChangeHandler(this.validationObserver_)},n.prototype.handleTextFieldInteraction=function(){var t=this.adapter.getNativeInput();t&&t.disabled||(this.receivedUserInput_=!0)},n.prototype.handleValidationAttributeChange=function(t){var n=this;t.some(function(t){return lS.indexOf(t)>-1&&(n.styleValidity_(!0),n.adapter.setLabelRequired(n.getNativeInput_().required),!0)}),t.indexOf("maxlength")>-1&&this.setCharacterCounter_(this.getValue().length)},n.prototype.notchOutline=function(t){if(this.adapter.hasOutline()&&this.adapter.hasLabel())if(t){var n=this.adapter.getLabelWidth()*lC.LABEL_SCALE;this.adapter.notchOutline(n)}else this.adapter.closeOutline()},n.prototype.activateFocus=function(){this.isFocused_=!0,this.styleFocused_(this.isFocused_),this.adapter.activateLineRipple(),this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.adapter.shakeLabel(this.shouldShake)),this.helperText_&&(this.helperText_.isPersistent()||!this.helperText_.isValidation()||!this.isValid_)&&this.helperText_.showToScreenReader()},n.prototype.setTransformOrigin=function(t){if(!(this.isDisabled()||this.adapter.hasOutline())){var n=t.touches,i=n?n[0]:t,r=i.target.getBoundingClientRect(),o=i.clientX-r.left;this.adapter.setLineRippleTransformOrigin(o)}},n.prototype.handleInput=function(){this.autoCompleteFocus(),this.setCharacterCounter_(this.getValue().length)},n.prototype.autoCompleteFocus=function(){this.receivedUserInput_||this.activateFocus()},n.prototype.deactivateFocus=function(){this.isFocused_=!1,this.adapter.deactivateLineRipple();var t=this.isValid();this.styleValidity_(t),this.styleFocused_(this.isFocused_),this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.adapter.shakeLabel(this.shouldShake)),this.shouldFloat||(this.receivedUserInput_=!1)},n.prototype.getValue=function(){return this.getNativeInput_().value},n.prototype.setValue=function(t){if(this.getValue()!==t&&(this.getNativeInput_().value=t),this.setCharacterCounter_(t.length),this.validateOnValueChange_){var n=this.isValid();this.styleValidity_(n)}this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.validateOnValueChange_&&this.adapter.shakeLabel(this.shouldShake))},n.prototype.isValid=function(){return this.useNativeValidation_?this.isNativeInputValid_():this.isValid_},n.prototype.setValid=function(t){this.isValid_=t,this.styleValidity_(t);var n=!t&&!this.isFocused_&&!!this.getValue();this.adapter.hasLabel()&&this.adapter.shakeLabel(n)},n.prototype.setValidateOnValueChange=function(t){this.validateOnValueChange_=t},n.prototype.getValidateOnValueChange=function(){return this.validateOnValueChange_},n.prototype.setUseNativeValidation=function(t){this.useNativeValidation_=t},n.prototype.isDisabled=function(){return this.getNativeInput_().disabled},n.prototype.setDisabled=function(t){this.getNativeInput_().disabled=t,this.styleDisabled_(t)},n.prototype.setHelperTextContent=function(t){this.helperText_&&this.helperText_.setContent(t)},n.prototype.setLeadingIconAriaLabel=function(t){this.leadingIcon_&&this.leadingIcon_.setAriaLabel(t)},n.prototype.setLeadingIconContent=function(t){this.leadingIcon_&&this.leadingIcon_.setContent(t)},n.prototype.setTrailingIconAriaLabel=function(t){this.trailingIcon_&&this.trailingIcon_.setAriaLabel(t)},n.prototype.setTrailingIconContent=function(t){this.trailingIcon_&&this.trailingIcon_.setContent(t)},n.prototype.setCharacterCounter_=function(t){if(this.characterCounter_){var n=this.getNativeInput_().maxLength;if(-1===n)throw Error("MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.");this.characterCounter_.setCounterValue(t,n)}},n.prototype.isBadInput_=function(){return this.getNativeInput_().validity.badInput||!1},n.prototype.isNativeInputValid_=function(){return this.getNativeInput_().validity.valid},n.prototype.styleValidity_=function(t){var i=n.cssClasses.INVALID;if(t?this.adapter.removeClass(i):this.adapter.addClass(i),this.helperText_){if(this.helperText_.setValidity(t),!this.helperText_.isValidation())return;var r=this.helperText_.isVisible(),o=this.helperText_.getId();r&&o?this.adapter.setInputAttr(lM.ARIA_DESCRIBEDBY,o):this.adapter.removeInputAttr(lM.ARIA_DESCRIBEDBY)}},n.prototype.styleFocused_=function(t){var i=n.cssClasses.FOCUSED;t?this.adapter.addClass(i):this.adapter.removeClass(i)},n.prototype.styleDisabled_=function(t){var i=n.cssClasses,r=i.DISABLED,o=i.INVALID;t?(this.adapter.addClass(r),this.adapter.removeClass(o)):this.adapter.removeClass(r),this.leadingIcon_&&this.leadingIcon_.setDisabled(t),this.trailingIcon_&&this.trailingIcon_.setDisabled(t)},n.prototype.styleFloating_=function(t){var i=n.cssClasses.LABEL_FLOATING;t?this.adapter.addClass(i):this.adapter.removeClass(i)},n.prototype.getNativeInput_=function(){return(this.adapter?this.adapter.getNativeInput():null)||{disabled:!1,maxLength:-1,required:!1,type:"input",validity:{badInput:!1,valid:!0},value:""}},n}(s9),lO={HELPER_TEXT_PERSISTENT:"mdc-text-field-helper-text--persistent",HELPER_TEXT_VALIDATION_MSG:"mdc-text-field-helper-text--validation-msg",ROOT:"mdc-text-field-helper-text"},lR={ARIA_HIDDEN:"aria-hidden",ROLE:"role",ROOT_SELECTOR:"."+lO.ROOT},lB=function(t){function n(i){return t.call(this,s6(s6({},n.defaultAdapter),i))||this}return s4(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return lO},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return lR},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){}}},enumerable:!0,configurable:!0}),n.prototype.getId=function(){return this.adapter.getAttr("id")},n.prototype.isVisible=function(){return"true"!==this.adapter.getAttr(lR.ARIA_HIDDEN)},n.prototype.setContent=function(t){this.adapter.setContent(t)},n.prototype.isPersistent=function(){return this.adapter.hasClass(lO.HELPER_TEXT_PERSISTENT)},n.prototype.setPersistent=function(t){t?this.adapter.addClass(lO.HELPER_TEXT_PERSISTENT):this.adapter.removeClass(lO.HELPER_TEXT_PERSISTENT)},n.prototype.isValidation=function(){return this.adapter.hasClass(lO.HELPER_TEXT_VALIDATION_MSG)},n.prototype.setValidation=function(t){t?this.adapter.addClass(lO.HELPER_TEXT_VALIDATION_MSG):this.adapter.removeClass(lO.HELPER_TEXT_VALIDATION_MSG)},n.prototype.showToScreenReader=function(){this.adapter.removeAttr(lR.ARIA_HIDDEN)},n.prototype.setValidity=function(t){var n=this.adapter.hasClass(lO.HELPER_TEXT_PERSISTENT),i=this.adapter.hasClass(lO.HELPER_TEXT_VALIDATION_MSG)&&!t;i?(this.showToScreenReader(),this.adapter.setAttr(lR.ROLE,"alert")):this.adapter.removeAttr(lR.ROLE),n||i||this.hide_()},n.prototype.hide_=function(){this.adapter.setAttr(lR.ARIA_HIDDEN,"true")},n}(s9),lz=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return s4(n,t),n.attachTo=function(t){return new n(t)},Object.defineProperty(n.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),n.prototype.getDefaultFoundation=function(){var t=this;return new lB({addClass:function(n){return t.root.classList.add(n)},removeClass:function(n){return t.root.classList.remove(n)},hasClass:function(n){return t.root.classList.contains(n)},getAttr:function(n){return t.root.getAttribute(n)},setAttr:function(n,i){return t.root.setAttribute(n,i)},removeAttr:function(n){return t.root.removeAttribute(n)},setContent:function(n){t.root.textContent=n}})},n}(le),lY={ICON_EVENT:"MDCTextField:icon",ICON_ROLE:"button"},lN={ROOT:"mdc-text-field__icon"},lj=["click","keydown"],lH=function(t){function n(i){var r=t.call(this,s6(s6({},n.defaultAdapter),i))||this;return r.savedTabIndex_=null,r.interactionHandler_=function(t){return r.handleInteraction(t)},r}return s4(n,t),Object.defineProperty(n,"strings",{get:function(){return lY},enumerable:!0,configurable:!0}),Object.defineProperty(n,"cssClasses",{get:function(){return lN},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},notifyIconAction:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){var t=this;this.savedTabIndex_=this.adapter.getAttr("tabindex"),lj.forEach(function(n){t.adapter.registerInteractionHandler(n,t.interactionHandler_)})},n.prototype.destroy=function(){var t=this;lj.forEach(function(n){t.adapter.deregisterInteractionHandler(n,t.interactionHandler_)})},n.prototype.setDisabled=function(t){this.savedTabIndex_&&(t?(this.adapter.setAttr("tabindex","-1"),this.adapter.removeAttr("role")):(this.adapter.setAttr("tabindex",this.savedTabIndex_),this.adapter.setAttr("role",lY.ICON_ROLE)))},n.prototype.setAriaLabel=function(t){this.adapter.setAttr("aria-label",t)},n.prototype.setContent=function(t){this.adapter.setContent(t)},n.prototype.handleInteraction=function(t){var n="Enter"===t.key||13===t.keyCode;("click"===t.type||n)&&(t.preventDefault(),this.adapter.notifyIconAction())},n}(s9),lU=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return s4(n,t),n.attachTo=function(t){return new n(t)},Object.defineProperty(n.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),n.prototype.getDefaultFoundation=function(){var t=this;return new lH({getAttr:function(n){return t.root.getAttribute(n)},setAttr:function(n,i){return t.root.setAttribute(n,i)},removeAttr:function(n){return t.root.removeAttribute(n)},setContent:function(n){t.root.textContent=n},registerInteractionHandler:function(n,i){return t.listen(n,i)},deregisterInteractionHandler:function(n,i){return t.unlisten(n,i)},notifyIconAction:function(){return t.emit(lH.strings.ICON_EVENT,{},!0)}})},n}(le),lV=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return s4(n,t),n.attachTo=function(t){return new n(t)},n.prototype.initialize=function(t,n,i,r,o,a,s){void 0===t&&(t=function(t,n){return new lw(t,n)}),void 0===n&&(n=function(t){return new lc(t)}),void 0===i&&(i=function(t){return new lz(t)}),void 0===r&&(r=function(t){return new lT(t)}),void 0===o&&(o=function(t){return new lU(t)}),void 0===a&&(a=function(t){return new la(t)}),void 0===s&&(s=function(t){return new lp(t)}),this.input_=this.root.querySelector(lM.INPUT_SELECTOR);var l=this.root.querySelector(lM.LABEL_SELECTOR);this.label_=l?a(l):null;var c=this.root.querySelector(lM.LINE_RIPPLE_SELECTOR);this.lineRipple_=c?n(c):null;var d=this.root.querySelector(lM.OUTLINE_SELECTOR);this.outline_=d?s(d):null;var u=lB.strings,m=this.root.nextElementSibling,h=m&&m.classList.contains(lA.HELPER_LINE),p=h&&m&&m.querySelector(u.ROOT_SELECTOR);this.helperText_=p?i(p):null;var f=lE.strings,b=this.root.querySelector(f.ROOT_SELECTOR);!b&&h&&m&&(b=m.querySelector(f.ROOT_SELECTOR)),this.characterCounter_=b?r(b):null;var g=this.root.querySelector(lM.LEADING_ICON_SELECTOR);this.leadingIcon_=g?o(g):null;var _=this.root.querySelector(lM.TRAILING_ICON_SELECTOR);this.trailingIcon_=_?o(_):null,this.prefix_=this.root.querySelector(lM.PREFIX_SELECTOR),this.suffix_=this.root.querySelector(lM.SUFFIX_SELECTOR),this.ripple=this.createRipple_(t)},n.prototype.destroy=function(){this.ripple&&this.ripple.destroy(),this.lineRipple_&&this.lineRipple_.destroy(),this.helperText_&&this.helperText_.destroy(),this.characterCounter_&&this.characterCounter_.destroy(),this.leadingIcon_&&this.leadingIcon_.destroy(),this.trailingIcon_&&this.trailingIcon_.destroy(),this.label_&&this.label_.destroy(),this.outline_&&this.outline_.destroy(),t.prototype.destroy.call(this)},n.prototype.initialSyncWithDOM=function(){this.disabled=this.input_.disabled},Object.defineProperty(n.prototype,"value",{get:function(){return this.foundation.getValue()},set:function(t){this.foundation.setValue(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this.foundation.isDisabled()},set:function(t){this.foundation.setDisabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"valid",{get:function(){return this.foundation.isValid()},set:function(t){this.foundation.setValid(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"required",{get:function(){return this.input_.required},set:function(t){this.input_.required=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"pattern",{get:function(){return this.input_.pattern},set:function(t){this.input_.pattern=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"minLength",{get:function(){return this.input_.minLength},set:function(t){this.input_.minLength=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"maxLength",{get:function(){return this.input_.maxLength},set:function(t){t<0?this.input_.removeAttribute("maxLength"):this.input_.maxLength=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.input_.min},set:function(t){this.input_.min=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.input_.max},set:function(t){this.input_.max=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"step",{get:function(){return this.input_.step},set:function(t){this.input_.step=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"helperTextContent",{set:function(t){this.foundation.setHelperTextContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"leadingIconAriaLabel",{set:function(t){this.foundation.setLeadingIconAriaLabel(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"leadingIconContent",{set:function(t){this.foundation.setLeadingIconContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"trailingIconAriaLabel",{set:function(t){this.foundation.setTrailingIconAriaLabel(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"trailingIconContent",{set:function(t){this.foundation.setTrailingIconContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"useNativeValidation",{set:function(t){this.foundation.setUseNativeValidation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"prefixText",{get:function(){return this.prefix_?this.prefix_.textContent:null},set:function(t){this.prefix_&&(this.prefix_.textContent=t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"suffixText",{get:function(){return this.suffix_?this.suffix_.textContent:null},set:function(t){this.suffix_&&(this.suffix_.textContent=t)},enumerable:!0,configurable:!0}),n.prototype.focus=function(){this.input_.focus()},n.prototype.layout=function(){var t=this.foundation.shouldFloat;this.foundation.notchOutline(t)},n.prototype.getDefaultFoundation=function(){return new lP(s6(s6(s6(s6(s6({},this.getRootAdapterMethods_()),this.getInputAdapterMethods_()),this.getLabelAdapterMethods_()),this.getLineRippleAdapterMethods_()),this.getOutlineAdapterMethods_()),this.getFoundationMap_())},n.prototype.getRootAdapterMethods_=function(){var t=this;return{addClass:function(n){return t.root.classList.add(n)},removeClass:function(n){return t.root.classList.remove(n)},hasClass:function(n){return t.root.classList.contains(n)},registerTextFieldInteractionHandler:function(n,i){t.listen(n,i)},deregisterTextFieldInteractionHandler:function(n,i){t.unlisten(n,i)},registerValidationAttributeChangeHandler:function(n){var i=new MutationObserver(function(t){return n(t.map(function(t){return t.attributeName}).filter(function(t){return t}))});return i.observe(t.input_,{attributes:!0}),i},deregisterValidationAttributeChangeHandler:function(t){t.disconnect()}}},n.prototype.getInputAdapterMethods_=function(){var t=this;return{getNativeInput:function(){return t.input_},setInputAttr:function(n,i){t.input_.setAttribute(n,i)},removeInputAttr:function(n){t.input_.removeAttribute(n)},isFocused:function(){return document.activeElement===t.input_},registerInputInteractionHandler:function(n,i){t.input_.addEventListener(n,i,lt())},deregisterInputInteractionHandler:function(n,i){t.input_.removeEventListener(n,i,lt())}}},n.prototype.getLabelAdapterMethods_=function(){var t=this;return{floatLabel:function(n){return t.label_&&t.label_.float(n)},getLabelWidth:function(){return t.label_?t.label_.getWidth():0},hasLabel:function(){return!!t.label_},shakeLabel:function(n){return t.label_&&t.label_.shake(n)},setLabelRequired:function(n){return t.label_&&t.label_.setRequired(n)}}},n.prototype.getLineRippleAdapterMethods_=function(){var t=this;return{activateLineRipple:function(){t.lineRipple_&&t.lineRipple_.activate()},deactivateLineRipple:function(){t.lineRipple_&&t.lineRipple_.deactivate()},setLineRippleTransformOrigin:function(n){t.lineRipple_&&t.lineRipple_.setRippleCenter(n)}}},n.prototype.getOutlineAdapterMethods_=function(){var t=this;return{closeOutline:function(){return t.outline_&&t.outline_.closeNotch()},hasOutline:function(){return!!t.outline_},notchOutline:function(n){return t.outline_&&t.outline_.notch(n)}}},n.prototype.getFoundationMap_=function(){return{characterCounter:this.characterCounter_?this.characterCounter_.foundationForTextField:void 0,helperText:this.helperText_?this.helperText_.foundationForTextField:void 0,leadingIcon:this.leadingIcon_?this.leadingIcon_.foundationForTextField:void 0,trailingIcon:this.trailingIcon_?this.trailingIcon_.foundationForTextField:void 0}},n.prototype.createRipple_=function(t){var n=this,i=this.root.classList.contains(lA.TEXTAREA),r=this.root.classList.contains(lA.OUTLINED);if(i||r)return null;var o=s6(s6({},lw.createAdapter(this)),{isSurfaceActive:function(){return li(n.input_,":active")},registerInteractionHandler:function(t,i){return n.input_.addEventListener(t,i,lt())},deregisterInteractionHandler:function(t,i){return n.input_.removeEventListener(t,i,lt())}});return t(this.root,new lx(o))},n}(le),lq={animation:{prefixed:"-webkit-animation",standard:"animation"},transform:{prefixed:"-webkit-transform",standard:"transform"},transition:{prefixed:"-webkit-transition",standard:"transition"}},lG={animationend:{cssProperty:"animation",prefixed:"webkitAnimationEnd",standard:"animationend"},animationiteration:{cssProperty:"animation",prefixed:"webkitAnimationIteration",standard:"animationiteration"},animationstart:{cssProperty:"animation",prefixed:"webkitAnimationStart",standard:"animationstart"},transitionend:{cssProperty:"transition",prefixed:"webkitTransitionEnd",standard:"transitionend"}};function l$(t){return!!t.document&&"function"==typeof t.document.createElement}function lW(t,n){if(l$(t)&&n in lq){var i=t.document.createElement("div"),r=lq[n],o=r.standard,a=r.prefixed;return o in i.style?o:a}return n}function lX(t,n){if(l$(t)&&n in lG){var i=t.document.createElement("div"),r=lG[n],o=r.standard,a=r.prefixed;return r.cssProperty in i.style?o:a}return n}var lZ={ANIM_CHECKED_INDETERMINATE:"mdc-checkbox--anim-checked-indeterminate",ANIM_CHECKED_UNCHECKED:"mdc-checkbox--anim-checked-unchecked",ANIM_INDETERMINATE_CHECKED:"mdc-checkbox--anim-indeterminate-checked",ANIM_INDETERMINATE_UNCHECKED:"mdc-checkbox--anim-indeterminate-unchecked",ANIM_UNCHECKED_CHECKED:"mdc-checkbox--anim-unchecked-checked",ANIM_UNCHECKED_INDETERMINATE:"mdc-checkbox--anim-unchecked-indeterminate",BACKGROUND:"mdc-checkbox__background",CHECKED:"mdc-checkbox--checked",CHECKMARK:"mdc-checkbox__checkmark",CHECKMARK_PATH:"mdc-checkbox__checkmark-path",DISABLED:"mdc-checkbox--disabled",INDETERMINATE:"mdc-checkbox--indeterminate",MIXEDMARK:"mdc-checkbox__mixedmark",NATIVE_CONTROL:"mdc-checkbox__native-control",ROOT:"mdc-checkbox",SELECTED:"mdc-checkbox--selected",UPGRADED:"mdc-checkbox--upgraded"},lK={ARIA_CHECKED_ATTR:"aria-checked",ARIA_CHECKED_INDETERMINATE_VALUE:"mixed",DATA_INDETERMINATE_ATTR:"data-indeterminate",NATIVE_CONTROL_SELECTOR:".mdc-checkbox__native-control",TRANSITION_STATE_CHECKED:"checked",TRANSITION_STATE_INDETERMINATE:"indeterminate",TRANSITION_STATE_INIT:"init",TRANSITION_STATE_UNCHECKED:"unchecked"},lJ={ANIM_END_LATCH_MS:250},lQ=function(t){function n(i){var r=t.call(this,s6(s6({},n.defaultAdapter),i))||this;return r.currentCheckState_=lK.TRANSITION_STATE_INIT,r.currentAnimationClass_="",r.animEndLatchTimer_=0,r.enableAnimationEndHandler_=!1,r}return s4(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return lZ},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return lK},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return lJ},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},forceLayout:function(){},hasNativeControl:function(){return!1},isAttachedToDOM:function(){return!1},isChecked:function(){return!1},isIndeterminate:function(){return!1},removeClass:function(){},removeNativeControlAttr:function(){},setNativeControlAttr:function(){},setNativeControlDisabled:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){this.currentCheckState_=this.determineCheckState_(),this.updateAriaChecked_(),this.adapter.addClass(lZ.UPGRADED)},n.prototype.destroy=function(){clearTimeout(this.animEndLatchTimer_)},n.prototype.setDisabled=function(t){this.adapter.setNativeControlDisabled(t),t?this.adapter.addClass(lZ.DISABLED):this.adapter.removeClass(lZ.DISABLED)},n.prototype.handleAnimationEnd=function(){var t=this;this.enableAnimationEndHandler_&&(clearTimeout(this.animEndLatchTimer_),this.animEndLatchTimer_=setTimeout(function(){t.adapter.removeClass(t.currentAnimationClass_),t.enableAnimationEndHandler_=!1},lJ.ANIM_END_LATCH_MS))},n.prototype.handleChange=function(){this.transitionCheckState_()},n.prototype.transitionCheckState_=function(){if(this.adapter.hasNativeControl()){var t=this.currentCheckState_,n=this.determineCheckState_();if(t!==n){this.updateAriaChecked_();var i=lK.TRANSITION_STATE_UNCHECKED,r=lZ.SELECTED;n===i?this.adapter.removeClass(r):this.adapter.addClass(r),this.currentAnimationClass_.length>0&&(clearTimeout(this.animEndLatchTimer_),this.adapter.forceLayout(),this.adapter.removeClass(this.currentAnimationClass_)),this.currentAnimationClass_=this.getTransitionAnimationClass_(t,n),this.currentCheckState_=n,this.adapter.isAttachedToDOM()&&this.currentAnimationClass_.length>0&&(this.adapter.addClass(this.currentAnimationClass_),this.enableAnimationEndHandler_=!0)}}},n.prototype.determineCheckState_=function(){var t=lK.TRANSITION_STATE_INDETERMINATE,n=lK.TRANSITION_STATE_CHECKED,i=lK.TRANSITION_STATE_UNCHECKED;return this.adapter.isIndeterminate()?t:this.adapter.isChecked()?n:i},n.prototype.getTransitionAnimationClass_=function(t,i){var r=lK.TRANSITION_STATE_INIT,o=lK.TRANSITION_STATE_CHECKED,a=lK.TRANSITION_STATE_UNCHECKED,s=n.cssClasses,l=s.ANIM_UNCHECKED_CHECKED,c=s.ANIM_UNCHECKED_INDETERMINATE,d=s.ANIM_CHECKED_UNCHECKED,u=s.ANIM_CHECKED_INDETERMINATE,m=s.ANIM_INDETERMINATE_CHECKED,h=s.ANIM_INDETERMINATE_UNCHECKED;switch(t){case r:if(i===a)return"";return i===o?m:h;case a:return i===o?l:c;case o:return i===a?d:u;default:return i===o?m:h}},n.prototype.updateAriaChecked_=function(){this.adapter.isIndeterminate()?this.adapter.setNativeControlAttr(lK.ARIA_CHECKED_ATTR,lK.ARIA_CHECKED_INDETERMINATE_VALUE):this.adapter.removeNativeControlAttr(lK.ARIA_CHECKED_ATTR)},n}(s9),l0=["checked","indeterminate"],l1=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.ripple_=n.createRipple_(),n}return s4(n,t),n.attachTo=function(t){return new n(t)},Object.defineProperty(n.prototype,"ripple",{get:function(){return this.ripple_},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"checked",{get:function(){return this.nativeControl_.checked},set:function(t){this.nativeControl_.checked=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"indeterminate",{get:function(){return this.nativeControl_.indeterminate},set:function(t){this.nativeControl_.indeterminate=t},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this.nativeControl_.disabled},set:function(t){this.foundation.setDisabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.nativeControl_.value},set:function(t){this.nativeControl_.value=t},enumerable:!0,configurable:!0}),n.prototype.initialize=function(){var t=lK.DATA_INDETERMINATE_ATTR;this.nativeControl_.indeterminate="true"===this.nativeControl_.getAttribute(t),this.nativeControl_.removeAttribute(t)},n.prototype.initialSyncWithDOM=function(){var t=this;this.handleChange_=function(){return t.foundation.handleChange()},this.handleAnimationEnd_=function(){return t.foundation.handleAnimationEnd()},this.nativeControl_.addEventListener("change",this.handleChange_),this.listen(lX(window,"animationend"),this.handleAnimationEnd_),this.installPropertyChangeHooks_()},n.prototype.destroy=function(){this.ripple_.destroy(),this.nativeControl_.removeEventListener("change",this.handleChange_),this.unlisten(lX(window,"animationend"),this.handleAnimationEnd_),this.uninstallPropertyChangeHooks_(),t.prototype.destroy.call(this)},n.prototype.getDefaultFoundation=function(){var t=this;return new lQ({addClass:function(n){return t.root.classList.add(n)},forceLayout:function(){return t.root.offsetWidth},hasNativeControl:function(){return!!t.nativeControl_},isAttachedToDOM:function(){return!!t.root.parentNode},isChecked:function(){return t.checked},isIndeterminate:function(){return t.indeterminate},removeClass:function(n){t.root.classList.remove(n)},removeNativeControlAttr:function(n){t.nativeControl_.removeAttribute(n)},setNativeControlAttr:function(n,i){t.nativeControl_.setAttribute(n,i)},setNativeControlDisabled:function(n){t.nativeControl_.disabled=n}})},n.prototype.createRipple_=function(){var t=this,n=s6(s6({},lw.createAdapter(this)),{deregisterInteractionHandler:function(n,i){return t.nativeControl_.removeEventListener(n,i,lt())},isSurfaceActive:function(){return li(t.nativeControl_,":active")},isUnbounded:function(){return!0},registerInteractionHandler:function(n,i){return t.nativeControl_.addEventListener(n,i,lt())}});return new lw(this.root,new lx(n))},n.prototype.installPropertyChangeHooks_=function(){var t=this,n=this.nativeControl_,i=Object.getPrototypeOf(n);l0.forEach(function(r){var o=Object.getOwnPropertyDescriptor(i,r);if(l2(o)){var a=o.get,s={configurable:o.configurable,enumerable:o.enumerable,get:a,set:function(i){o.set.call(n,i),t.foundation.handleChange()}};Object.defineProperty(n,r,s)}})},n.prototype.uninstallPropertyChangeHooks_=function(){var t=this.nativeControl_,n=Object.getPrototypeOf(t);l0.forEach(function(i){var r=Object.getOwnPropertyDescriptor(n,i);l2(r)&&Object.defineProperty(t,i,r)})},Object.defineProperty(n.prototype,"nativeControl_",{get:function(){var t=lK.NATIVE_CONTROL_SELECTOR,n=this.root.querySelector(t);if(!n)throw Error("Checkbox component requires a "+t+" element");return n},enumerable:!0,configurable:!0}),n}(le);function l2(t){return!!t&&"function"==typeof t.set}var l5={CHECKED:"mdc-switch--checked",DISABLED:"mdc-switch--disabled"},l3={ARIA_CHECKED_ATTR:"aria-checked",NATIVE_CONTROL_SELECTOR:".mdc-switch__native-control",RIPPLE_SURFACE_SELECTOR:".mdc-switch__thumb-underlay"},l4=function(t){function n(i){return t.call(this,s6(s6({},n.defaultAdapter),i))||this}return s4(n,t),Object.defineProperty(n,"strings",{get:function(){return l3},enumerable:!0,configurable:!0}),Object.defineProperty(n,"cssClasses",{get:function(){return l5},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNativeControlChecked:function(){},setNativeControlDisabled:function(){},setNativeControlAttr:function(){}}},enumerable:!0,configurable:!0}),n.prototype.setChecked=function(t){this.adapter.setNativeControlChecked(t),this.updateAriaChecked_(t),this.updateCheckedStyling_(t)},n.prototype.setDisabled=function(t){this.adapter.setNativeControlDisabled(t),t?this.adapter.addClass(l5.DISABLED):this.adapter.removeClass(l5.DISABLED)},n.prototype.handleChange=function(t){var n=t.target;this.updateAriaChecked_(n.checked),this.updateCheckedStyling_(n.checked)},n.prototype.updateCheckedStyling_=function(t){t?this.adapter.addClass(l5.CHECKED):this.adapter.removeClass(l5.CHECKED)},n.prototype.updateAriaChecked_=function(t){this.adapter.setNativeControlAttr(l3.ARIA_CHECKED_ATTR,""+!!t)},n}(s9),l6=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.ripple_=n.createRipple_(),n}return s4(n,t),n.attachTo=function(t){return new n(t)},n.prototype.destroy=function(){t.prototype.destroy.call(this),this.ripple_.destroy(),this.nativeControl_.removeEventListener("change",this.changeHandler_)},n.prototype.initialSyncWithDOM=function(){var t=this;this.changeHandler_=function(){for(var n,i=[],r=0;r<arguments.length;r++)i[r]=arguments[r];return(n=t.foundation).handleChange.apply(n,s7(i))},this.nativeControl_.addEventListener("change",this.changeHandler_),this.checked=this.checked},n.prototype.getDefaultFoundation=function(){var t=this;return new l4({addClass:function(n){return t.root.classList.add(n)},removeClass:function(n){return t.root.classList.remove(n)},setNativeControlChecked:function(n){return t.nativeControl_.checked=n},setNativeControlDisabled:function(n){return t.nativeControl_.disabled=n},setNativeControlAttr:function(n,i){return t.nativeControl_.setAttribute(n,i)}})},Object.defineProperty(n.prototype,"ripple",{get:function(){return this.ripple_},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"checked",{get:function(){return this.nativeControl_.checked},set:function(t){this.foundation.setChecked(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this.nativeControl_.disabled},set:function(t){this.foundation.setDisabled(t)},enumerable:!0,configurable:!0}),n.prototype.createRipple_=function(){var t=this,n=l4.strings.RIPPLE_SURFACE_SELECTOR,i=this.root.querySelector(n),r=s6(s6({},lw.createAdapter(this)),{addClass:function(t){return i.classList.add(t)},computeBoundingRect:function(){return i.getBoundingClientRect()},deregisterInteractionHandler:function(n,i){t.nativeControl_.removeEventListener(n,i,lt())},isSurfaceActive:function(){return li(t.nativeControl_,":active")},isUnbounded:function(){return!0},registerInteractionHandler:function(n,i){t.nativeControl_.addEventListener(n,i,lt())},removeClass:function(t){i.classList.remove(t)},updateCssVariable:function(t,n){i.style.setProperty(t,n)}});return new lw(this.root,new lx(r))},Object.defineProperty(n.prototype,"nativeControl_",{get:function(){var t=l4.strings.NATIVE_CONTROL_SELECTOR;return this.root.querySelector(t)},enumerable:!0,configurable:!0}),n}(le),l8="mdc-slider--disabled",l7="mdc-slider__thumb",l9="mdc-slider__thumb--top",ce="mdc-slider__thumb--with-indicator",ct="mdc-slider__tick-marks",cn="mdc-slider__tick-mark--active",ci="mdc-slider__tick-mark--inactive",cr="disabled",co="value",ca="step";(ew=tO||(tO={}))[ew.ACTIVE=0]="ACTIVE",ew[ew.INACTIVE=1]="INACTIVE",(eF=tR||(tR={}))[eF.START=1]="START",eF[eF.END=2]="END";var cs="u">typeof window,cl=function(t){function n(i){var r=t.call(this,s6(s6({},n.defaultAdapter),i))||this;return r.initialStylesRemoved=!1,r.isDisabled=!1,r.isDiscrete=!1,r.step=1,r.hasTickMarks=!1,r.isRange=!1,r.thumb=null,r.downEventClientX=null,r.startThumbKnobWidth=0,r.endThumbKnobWidth=0,r}return s4(n,t),Object.defineProperty(n,"defaultAdapter",{get:function(){return{hasClass:function(){return!1},addClass:function(){},removeClass:function(){},addThumbClass:function(){},removeThumbClass:function(){},getAttribute:function(){return null},getInputValue:function(){return""},setInputValue:function(){},getInputAttribute:function(){return null},setInputAttribute:function(){return null},removeInputAttribute:function(){return null},focusInput:function(){},isInputFocused:function(){return!1},getThumbKnobWidth:function(){return 0},getThumbBoundingClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},getBoundingClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},isRTL:function(){return!1},setThumbStyleProperty:function(){},removeThumbStyleProperty:function(){},setTrackActiveStyleProperty:function(){},removeTrackActiveStyleProperty:function(){},setValueIndicatorText:function(){},getValueToAriaValueTextFn:function(){return null},updateTickMarks:function(){},setPointerCapture:function(){},emitChangeEvent:function(){},emitInputEvent:function(){},emitDragStartEvent:function(){},emitDragEndEvent:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){},registerThumbEventHandler:function(){},deregisterThumbEventHandler:function(){},registerInputEventHandler:function(){},deregisterInputEventHandler:function(){},registerBodyEventHandler:function(){},deregisterBodyEventHandler:function(){},registerWindowEventHandler:function(){},deregisterWindowEventHandler:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){var t=this;this.isDisabled=this.adapter.hasClass(l8),this.isDiscrete=this.adapter.hasClass("mdc-slider--discrete"),this.hasTickMarks=this.adapter.hasClass("mdc-slider--tick-marks"),this.isRange=this.adapter.hasClass("mdc-slider--range");var n=this.convertAttributeValueToNumber(this.adapter.getInputAttribute("min",this.isRange?tR.START:tR.END),"min"),i=this.convertAttributeValueToNumber(this.adapter.getInputAttribute("max",tR.END),"max"),r=this.convertAttributeValueToNumber(this.adapter.getInputAttribute(co,tR.END),co),o=this.isRange?this.convertAttributeValueToNumber(this.adapter.getInputAttribute(co,tR.START),co):n;this.validateProperties({min:n,max:i,value:r,valueStart:o}),this.min=n,this.max=i,this.value=r,this.valueStart=o,this.valueBeforeDownEvent=r,this.valueStartBeforeDownEvent=o;var a=this.adapter.getInputAttribute(ca,tR.END);if(a&&(this.step=this.convertAttributeValueToNumber(a,ca)),this.step<=0)throw Error("MDCSliderFoundation: step must be a positive number. Current step: "+this.step);this.mousedownOrTouchstartListener=this.handleMousedownOrTouchstart.bind(this),this.moveListener=this.handleMove.bind(this),this.pointerdownListener=this.handlePointerdown.bind(this),this.pointerupListener=this.handlePointerup.bind(this),this.thumbMouseenterListener=this.handleThumbMouseenter.bind(this),this.thumbMouseleaveListener=this.handleThumbMouseleave.bind(this),this.inputStartChangeListener=function(){t.handleInputChange(tR.START)},this.inputEndChangeListener=function(){t.handleInputChange(tR.END)},this.inputStartFocusListener=function(){t.handleInputFocus(tR.START)},this.inputEndFocusListener=function(){t.handleInputFocus(tR.END)},this.inputStartBlurListener=function(){t.handleInputBlur(tR.START)},this.inputEndBlurListener=function(){t.handleInputBlur(tR.END)},this.resizeListener=this.handleResize.bind(this),this.registerEventHandlers()},n.prototype.destroy=function(){this.deregisterEventHandlers()},n.prototype.getMin=function(){return this.min},n.prototype.getMax=function(){return this.max},n.prototype.getValue=function(){return this.value},n.prototype.setValue=function(t){if(this.isRange&&t<this.valueStart)throw Error("end thumb value ("+t+") must be >= start thumb value ("+this.valueStart+")");this.updateValue(t,tR.END)},n.prototype.getValueStart=function(){if(!this.isRange)throw Error("`valueStart` is only applicable for range sliders.");return this.valueStart},n.prototype.setValueStart=function(t){if(!this.isRange)throw Error("`valueStart` is only applicable for range sliders.");if(this.isRange&&t>this.value)throw Error("start thumb value ("+t+") must be <= end thumb value ("+this.value+")");this.updateValue(t,tR.START)},n.prototype.getStep=function(){return this.step},n.prototype.getDisabled=function(){return this.isDisabled},n.prototype.setDisabled=function(t){this.isDisabled=t,t?(this.adapter.addClass(l8),this.isRange&&this.adapter.setInputAttribute(cr,"",tR.START),this.adapter.setInputAttribute(cr,"",tR.END)):(this.adapter.removeClass(l8),this.isRange&&this.adapter.removeInputAttribute(cr,tR.START),this.adapter.removeInputAttribute(cr,tR.END))},n.prototype.getIsRange=function(){return this.isRange},n.prototype.layout=function(t){var n=(void 0===t?{}:t).skipUpdateUI;this.rect=this.adapter.getBoundingClientRect(),this.isRange&&(this.startThumbKnobWidth=this.adapter.getThumbKnobWidth(tR.START),this.endThumbKnobWidth=this.adapter.getThumbKnobWidth(tR.END)),n||this.updateUI()},n.prototype.handleResize=function(){this.layout()},n.prototype.handleDown=function(t){if(!this.isDisabled){this.valueStartBeforeDownEvent=this.valueStart,this.valueBeforeDownEvent=this.value;var n=null!=t.clientX?t.clientX:t.targetTouches[0].clientX;this.downEventClientX=n;var i=this.mapClientXOnSliderScale(n);this.thumb=this.getThumbFromDownEvent(n,i),null===this.thumb||(this.handleDragStart(t,i,this.thumb),this.isRange&&i>=this.valueStart&&i<=this.value||this.updateValue(i,this.thumb,{emitInputEvent:!0}))}},n.prototype.handleMove=function(t){if(!this.isDisabled){t.preventDefault();var n=null!=t.clientX?t.clientX:t.targetTouches[0].clientX,i=null!=this.thumb;if(this.thumb=this.getThumbFromMoveEvent(n),null!==this.thumb){var r=this.mapClientXOnSliderScale(n);i||(this.handleDragStart(t,r,this.thumb),this.adapter.emitDragStartEvent(r,this.thumb)),this.updateValue(r,this.thumb,{emitInputEvent:!0})}}},n.prototype.handleUp=function(){if(!this.isDisabled&&null!==this.thumb){var t=this.thumb===tR.START?this.valueStartBeforeDownEvent:this.valueBeforeDownEvent,n=this.thumb===tR.START?this.valueStart:this.value;t!==n&&this.adapter.emitChangeEvent(n,this.thumb),this.adapter.emitDragEndEvent(n,this.thumb),this.thumb=null}},n.prototype.handleThumbMouseenter=function(){this.isDiscrete&&this.isRange&&(this.adapter.addThumbClass(ce,tR.START),this.adapter.addThumbClass(ce,tR.END))},n.prototype.handleThumbMouseleave=function(){!this.isDiscrete||!this.isRange||this.adapter.isInputFocused(tR.START)||this.adapter.isInputFocused(tR.END)||(this.adapter.removeThumbClass(ce,tR.START),this.adapter.removeThumbClass(ce,tR.END))},n.prototype.handleMousedownOrTouchstart=function(t){var n=this,i="mousedown"===t.type?"mousemove":"touchmove";this.adapter.registerBodyEventHandler(i,this.moveListener);var r=function(){n.handleUp(),n.adapter.deregisterBodyEventHandler(i,n.moveListener),n.adapter.deregisterEventHandler("mouseup",r),n.adapter.deregisterEventHandler("touchend",r)};this.adapter.registerBodyEventHandler("mouseup",r),this.adapter.registerBodyEventHandler("touchend",r),this.handleDown(t)},n.prototype.handlePointerdown=function(t){this.adapter.setPointerCapture(t.pointerId),this.adapter.registerEventHandler("pointermove",this.moveListener),this.handleDown(t)},n.prototype.handleInputChange=function(t){var n=Number(this.adapter.getInputValue(t));t===tR.START?this.setValueStart(n):this.setValue(n)},n.prototype.handleInputFocus=function(t){if(this.isDiscrete&&(this.adapter.addThumbClass(ce,t),this.isRange)){var n=t===tR.START?tR.END:tR.START;this.adapter.addThumbClass(ce,n)}},n.prototype.handleInputBlur=function(t){if(this.isDiscrete&&(this.adapter.removeThumbClass(ce,t),this.isRange)){var n=t===tR.START?tR.END:tR.START;this.adapter.removeThumbClass(ce,n)}},n.prototype.handleDragStart=function(t,n,i){this.adapter.focusInput(i),t.preventDefault(),this.adapter.emitDragStartEvent(n,i)},n.prototype.getThumbFromDownEvent=function(t,n){if(!this.isRange)return tR.END;var i=this.adapter.getThumbBoundingClientRect(tR.START),r=this.adapter.getThumbBoundingClientRect(tR.END),o=t>=i.left&&t<=i.right,a=t>=r.left&&t<=r.right;return o&&a?null:o?tR.START:a?tR.END:n<this.valueStart?tR.START:n>this.value?tR.END:null},n.prototype.getThumbFromMoveEvent=function(t){if(null!==this.thumb)return this.thumb;if(null===this.downEventClientX)throw Error("`downEventClientX` is null after move event.");return 5>Math.abs(this.downEventClientX-t)?this.thumb:t<this.downEventClientX?this.adapter.isRTL()?tR.END:tR.START:this.adapter.isRTL()?tR.START:tR.END},n.prototype.updateUI=function(t){this.updateThumbAndInputAttributes(t),this.updateThumbAndTrackUI(t),this.updateValueIndicatorUI(t),this.updateTickMarksUI()},n.prototype.updateThumbAndInputAttributes=function(t){if(t){var n=this.isRange&&t===tR.START?this.valueStart:this.value,i=String(n);this.adapter.setInputAttribute(co,i,t),this.isRange&&t===tR.START?this.adapter.setInputAttribute("min",i,tR.END):this.isRange&&t===tR.END&&this.adapter.setInputAttribute("max",i,tR.START),this.adapter.getInputValue(t)!==i&&this.adapter.setInputValue(i,t);var r=this.adapter.getValueToAriaValueTextFn();r&&this.adapter.setInputAttribute("aria-valuetext",r(n),t)}},n.prototype.updateValueIndicatorUI=function(t){if(this.isDiscrete){var n=this.isRange&&t===tR.START?this.valueStart:this.value;this.adapter.setValueIndicatorText(n,t===tR.START?tR.START:tR.END),!t&&this.isRange&&this.adapter.setValueIndicatorText(this.valueStart,tR.START)}},n.prototype.updateTickMarksUI=function(){if(this.isDiscrete&&this.hasTickMarks){var t=(this.valueStart-this.min)/this.step,n=(this.value-this.valueStart)/this.step+1,i=(this.max-this.value)/this.step,r=Array.from({length:t}).fill(tO.INACTIVE),o=Array.from({length:n}).fill(tO.ACTIVE),a=Array.from({length:i}).fill(tO.INACTIVE);this.adapter.updateTickMarks(r.concat(o).concat(a))}},n.prototype.mapClientXOnSliderScale=function(t){var n=(t-this.rect.left)/this.rect.width;this.adapter.isRTL()&&(n=1-n);var i=this.min+n*(this.max-this.min);return i===this.max||i===this.min?i:this.quantize(i)},n.prototype.updateValue=function(t,n,i){var r=void 0===i?{}:i,o=r.emitInputEvent,a=r.emitChangeEvent;if(t=this.clampValue(t,n),this.isRange&&n===tR.START){if(this.valueStart===t)return;this.valueStart=t}else{if(this.value===t)return;this.value=t}this.updateUI(n),o&&this.adapter.emitInputEvent(n===tR.START?this.valueStart:this.value,n),a&&this.adapter.emitChangeEvent(n===tR.START?this.valueStart:this.value,n)},n.prototype.quantize=function(t){return Math.round(t/this.step)*this.step},n.prototype.clampValue=function(t,n){return(t=Math.min(Math.max(t,this.min),this.max),this.isRange&&n===tR.START&&t>this.value)?this.value:this.isRange&&n===tR.END&&t<this.valueStart?this.valueStart:t},n.prototype.updateThumbAndTrackUI=function(t){var n=this,i=this.max,r=this.min,o=(this.value-this.valueStart)/(i-r),a=o*this.rect.width,s=this.adapter.isRTL(),l=cs?lW(window,"transform"):"transform";if(this.isRange){var c=this.adapter.isRTL()?(i-this.value)/(i-r)*this.rect.width:(this.valueStart-r)/(i-r)*this.rect.width,d=c+a;requestAnimationFrame(function(){!s&&t===tR.START||s&&t!==tR.START?(n.adapter.setTrackActiveStyleProperty("transform-origin","right"),n.adapter.setTrackActiveStyleProperty("left","unset"),n.adapter.setTrackActiveStyleProperty("right",n.rect.width-d+"px")):(n.adapter.setTrackActiveStyleProperty("transform-origin","left"),n.adapter.setTrackActiveStyleProperty("right","unset"),n.adapter.setTrackActiveStyleProperty("left",c+"px")),n.adapter.setTrackActiveStyleProperty(l,"scaleX("+o+")");var i=s?d:c,r=n.adapter.isRTL()?c:d;t!==tR.START&&t&&n.initialStylesRemoved||n.adapter.setThumbStyleProperty(l,"translateX("+i+"px)",tR.START),t!==tR.END&&t&&n.initialStylesRemoved||n.adapter.setThumbStyleProperty(l,"translateX("+r+"px)",tR.END),n.removeInitialStyles(s),n.updateOverlappingThumbsUI(i,r,t)})}else requestAnimationFrame(function(){var t=s?n.rect.width-a:a;n.adapter.setThumbStyleProperty(l,"translateX("+t+"px)",tR.END),n.adapter.setTrackActiveStyleProperty(l,"scaleX("+o+")"),n.removeInitialStyles(s)})},n.prototype.removeInitialStyles=function(t){if(!this.initialStylesRemoved){var n=t?"right":"left";this.adapter.removeThumbStyleProperty(n,tR.END),this.isRange&&this.adapter.removeThumbStyleProperty(n,tR.START),this.initialStylesRemoved=!0,this.resetTrackAndThumbAnimation()}},n.prototype.resetTrackAndThumbAnimation=function(){var t=this;if(this.isDiscrete){var n=cs?lW(window,"transition"):"transition",i="all 0s ease 0s";this.adapter.setThumbStyleProperty(n,i,tR.END),this.isRange&&this.adapter.setThumbStyleProperty(n,i,tR.START),this.adapter.setTrackActiveStyleProperty(n,i),requestAnimationFrame(function(){t.adapter.removeThumbStyleProperty(n,tR.END),t.adapter.removeTrackActiveStyleProperty(n),t.isRange&&t.adapter.removeThumbStyleProperty(n,tR.START)})}},n.prototype.updateOverlappingThumbsUI=function(t,n,i){var r=!1;if(this.adapter.isRTL()){var o=t-this.startThumbKnobWidth/2;r=n+this.endThumbKnobWidth/2>=o}else r=t+this.startThumbKnobWidth/2>=n-this.endThumbKnobWidth/2;r?(this.adapter.addThumbClass(l9,i||tR.END),this.adapter.removeThumbClass(l9,i===tR.START?tR.END:tR.START)):(this.adapter.removeThumbClass(l9,tR.START),this.adapter.removeThumbClass(l9,tR.END))},n.prototype.convertAttributeValueToNumber=function(t,n){if(null===t)throw Error("MDCSliderFoundation: `"+n+"` must be non-null.");var i=Number(t);if(isNaN(i))throw Error("MDCSliderFoundation: `"+n+"` value is `"+t+"`, but must be a number.");return i},n.prototype.validateProperties=function(t){var n=t.min,i=t.max,r=t.value,o=t.valueStart;if(n>=i)throw Error("MDCSliderFoundation: min must be strictly less than max. "+("Current: [min: "+n+", max: ")+i+"]");if(this.isRange){if(r<n||r>i||o<n||o>i)throw Error("MDCSliderFoundation: values must be in [min, max] range. "+("Current values: [start value: "+o+", end value: ")+r+"]");if(o>r)throw Error("MDCSliderFoundation: start value must be <= end value. "+("Current values: [start value: "+o+", end value: ")+r+"]")}else if(r<n||r>i)throw Error("MDCSliderFoundation: value must be in [min, max] range. Current value: "+r)},n.prototype.registerEventHandlers=function(){this.adapter.registerWindowEventHandler("resize",this.resizeListener),n.SUPPORTS_POINTER_EVENTS?(this.adapter.registerEventHandler("pointerdown",this.pointerdownListener),this.adapter.registerEventHandler("pointerup",this.pointerupListener)):(this.adapter.registerEventHandler("mousedown",this.mousedownOrTouchstartListener),this.adapter.registerEventHandler("touchstart",this.mousedownOrTouchstartListener)),this.isRange&&(this.adapter.registerThumbEventHandler(tR.START,"mouseenter",this.thumbMouseenterListener),this.adapter.registerThumbEventHandler(tR.START,"mouseleave",this.thumbMouseleaveListener),this.adapter.registerInputEventHandler(tR.START,"change",this.inputStartChangeListener),this.adapter.registerInputEventHandler(tR.START,"focus",this.inputStartFocusListener),this.adapter.registerInputEventHandler(tR.START,"blur",this.inputStartBlurListener)),this.adapter.registerThumbEventHandler(tR.END,"mouseenter",this.thumbMouseenterListener),this.adapter.registerThumbEventHandler(tR.END,"mouseleave",this.thumbMouseleaveListener),this.adapter.registerInputEventHandler(tR.END,"change",this.inputEndChangeListener),this.adapter.registerInputEventHandler(tR.END,"focus",this.inputEndFocusListener),this.adapter.registerInputEventHandler(tR.END,"blur",this.inputEndBlurListener)},n.prototype.deregisterEventHandlers=function(){this.adapter.deregisterWindowEventHandler("resize",this.resizeListener),n.SUPPORTS_POINTER_EVENTS?(this.adapter.deregisterEventHandler("pointerdown",this.pointerdownListener),this.adapter.deregisterEventHandler("pointerup",this.pointerupListener)):(this.adapter.deregisterEventHandler("mousedown",this.mousedownOrTouchstartListener),this.adapter.deregisterEventHandler("touchstart",this.mousedownOrTouchstartListener)),this.isRange&&(this.adapter.deregisterThumbEventHandler(tR.START,"mouseenter",this.thumbMouseenterListener),this.adapter.deregisterThumbEventHandler(tR.START,"mouseleave",this.thumbMouseleaveListener),this.adapter.deregisterInputEventHandler(tR.START,"change",this.inputStartChangeListener),this.adapter.deregisterInputEventHandler(tR.START,"focus",this.inputStartFocusListener),this.adapter.deregisterInputEventHandler(tR.START,"blur",this.inputStartBlurListener)),this.adapter.deregisterThumbEventHandler(tR.END,"mouseenter",this.thumbMouseenterListener),this.adapter.deregisterThumbEventHandler(tR.END,"mouseleave",this.thumbMouseleaveListener),this.adapter.deregisterInputEventHandler(tR.END,"change",this.inputEndChangeListener),this.adapter.deregisterInputEventHandler(tR.END,"focus",this.inputEndFocusListener),this.adapter.deregisterInputEventHandler(tR.END,"blur",this.inputEndBlurListener)},n.prototype.handlePointerup=function(){this.handleUp(),this.adapter.deregisterEventHandler("pointermove",this.moveListener)},n.SUPPORTS_POINTER_EVENTS=cs&&!!window.PointerEvent,n}(s9),cc=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.skipInitialUIUpdate=!1,n.valueToAriaValueTextFn=null,n}return s4(n,t),n.attachTo=function(t,i){return void 0===i&&(i={}),new n(t,void 0,i)},n.prototype.getDefaultFoundation=function(){var t=this;return new cl({hasClass:function(n){return t.root.classList.contains(n)},addClass:function(n){t.root.classList.add(n)},removeClass:function(n){t.root.classList.remove(n)},addThumbClass:function(n,i){t.getThumbEl(i).classList.add(n)},removeThumbClass:function(n,i){t.getThumbEl(i).classList.remove(n)},getAttribute:function(n){return t.root.getAttribute(n)},getInputValue:function(n){return t.getInput(n).value},setInputValue:function(n,i){t.getInput(i).value=n},getInputAttribute:function(n,i){return t.getInput(i).getAttribute(n)},setInputAttribute:function(n,i,r){t.getInput(r).setAttribute(n,i)},removeInputAttribute:function(n,i){t.getInput(i).removeAttribute(n)},focusInput:function(n){t.getInput(n).focus()},isInputFocused:function(n){return t.getInput(n)===document.activeElement},getThumbKnobWidth:function(n){return t.getThumbEl(n).querySelector(".mdc-slider__thumb-knob").getBoundingClientRect().width},getThumbBoundingClientRect:function(n){return t.getThumbEl(n).getBoundingClientRect()},getBoundingClientRect:function(){return t.root.getBoundingClientRect()},isRTL:function(){return"rtl"===getComputedStyle(t.root).direction},setThumbStyleProperty:function(n,i,r){t.getThumbEl(r).style.setProperty(n,i)},removeThumbStyleProperty:function(n,i){t.getThumbEl(i).style.removeProperty(n)},setTrackActiveStyleProperty:function(n,i){t.trackActive.style.setProperty(n,i)},removeTrackActiveStyleProperty:function(n){t.trackActive.style.removeProperty(n)},setValueIndicatorText:function(n,i){t.getThumbEl(i).querySelector(".mdc-slider__value-indicator-text").textContent=String(n)},getValueToAriaValueTextFn:function(){return t.valueToAriaValueTextFn},updateTickMarks:function(n){var i=t.root.querySelector("."+ct);i||((i=document.createElement("div")).classList.add(ct),t.root.querySelector(".mdc-slider__track").appendChild(i)),n.length!==i.children.length?(i.innerHTML="",t.addTickMarks(i,n)):t.updateTickMarks(i,n)},setPointerCapture:function(n){t.root.setPointerCapture(n)},emitChangeEvent:function(n,i){t.emit("MDCSlider:change",{value:n,thumb:i})},emitInputEvent:function(n,i){t.emit("MDCSlider:input",{value:n,thumb:i})},emitDragStartEvent:function(n,i){t.getRipple(i).activate()},emitDragEndEvent:function(n,i){t.getRipple(i).deactivate()},registerEventHandler:function(n,i){t.listen(n,i)},deregisterEventHandler:function(n,i){t.unlisten(n,i)},registerThumbEventHandler:function(n,i,r){t.getThumbEl(n).addEventListener(i,r)},deregisterThumbEventHandler:function(n,i,r){t.getThumbEl(n).removeEventListener(i,r)},registerInputEventHandler:function(n,i,r){t.getInput(n).addEventListener(i,r)},deregisterInputEventHandler:function(n,i,r){t.getInput(n).removeEventListener(i,r)},registerBodyEventHandler:function(t,n){document.body.addEventListener(t,n)},deregisterBodyEventHandler:function(t,n){document.body.removeEventListener(t,n)},registerWindowEventHandler:function(t,n){window.addEventListener(t,n)},deregisterWindowEventHandler:function(t,n){window.removeEventListener(t,n)}})},n.prototype.initialize=function(t){var n=(void 0===t?{}:t).skipInitialUIUpdate;this.inputs=[].slice.call(this.root.querySelectorAll(".mdc-slider__input")),this.thumbs=[].slice.call(this.root.querySelectorAll("."+l7)),this.trackActive=this.root.querySelector(".mdc-slider__track--active_fill"),this.ripples=this.createRipples(),n&&(this.skipInitialUIUpdate=!0)},n.prototype.initialSyncWithDOM=function(){this.foundation.layout({skipUpdateUI:this.skipInitialUIUpdate})},n.prototype.layout=function(){this.foundation.layout()},n.prototype.getValueStart=function(){return this.foundation.getValueStart()},n.prototype.setValueStart=function(t){this.foundation.setValueStart(t)},n.prototype.getValue=function(){return this.foundation.getValue()},n.prototype.setValue=function(t){this.foundation.setValue(t)},n.prototype.getDisabled=function(){return this.foundation.getDisabled()},n.prototype.setDisabled=function(t){this.foundation.setDisabled(t)},n.prototype.setValueToAriaValueTextFn=function(t){this.valueToAriaValueTextFn=t},n.prototype.getThumbEl=function(t){return t===tR.END?this.thumbs[this.thumbs.length-1]:this.thumbs[0]},n.prototype.getInput=function(t){return t===tR.END?this.inputs[this.inputs.length-1]:this.inputs[0]},n.prototype.getRipple=function(t){return t===tR.END?this.ripples[this.ripples.length-1]:this.ripples[0]},n.prototype.addTickMarks=function(t,n){for(var i=document.createDocumentFragment(),r=0;r<n.length;r++){var o=document.createElement("div"),a=n[r]===tO.ACTIVE?cn:ci;o.classList.add(a),i.appendChild(o)}t.appendChild(i)},n.prototype.updateTickMarks=function(t,n){for(var i=Array.from(t.children),r=0;r<i.length;r++)n[r]===tO.ACTIVE?(i[r].classList.add(cn),i[r].classList.remove(ci)):(i[r].classList.add(ci),i[r].classList.remove(cn))},n.prototype.createRipples=function(){for(var t=[],n=[].slice.call(this.root.querySelectorAll("."+l7)),i=this,r=0;r<n.length;r++)!function(r){var o=n[r],a=i.inputs[r],s=s6(s6({},lw.createAdapter(i)),{addClass:function(t){o.classList.add(t)},computeBoundingRect:function(){return o.getBoundingClientRect()},deregisterInteractionHandler:function(t,n){a.removeEventListener(t,n)},isSurfaceActive:function(){return li(a,":active")},isUnbounded:function(){return!0},registerInteractionHandler:function(t,n){a.addEventListener(t,n)},removeClass:function(t){o.classList.remove(t)},updateCssVariable:function(t,n){o.style.setProperty(t,n)}}),l=new lw(o,new lx(s));l.unbounded=!0,t.push(l)}(r);return t},n}(le),cd={ANCHOR:"mdc-menu-surface--anchor",ANIMATING_CLOSED:"mdc-menu-surface--animating-closed",ANIMATING_OPEN:"mdc-menu-surface--animating-open",FIXED:"mdc-menu-surface--fixed",IS_OPEN_BELOW:"mdc-menu-surface--is-open-below",OPEN:"mdc-menu-surface--open",ROOT:"mdc-menu-surface"},cu={CLOSED_EVENT:"MDCMenuSurface:closed",OPENED_EVENT:"MDCMenuSurface:opened",FOCUSABLE_ELEMENTS:'button:not(:disabled), [href]:not([aria-disabled="true"]), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])'},cm={TRANSITION_OPEN_DURATION:120,TRANSITION_CLOSE_DURATION:75,MARGIN_TO_EDGE:32,ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO:.67};(ek=tB||(tB={}))[ek.BOTTOM=1]="BOTTOM",ek[ek.CENTER=2]="CENTER",ek[ek.RIGHT=4]="RIGHT",ek[ek.FLIP_RTL=8]="FLIP_RTL",(eE=tz||(tz={}))[eE.TOP_LEFT=0]="TOP_LEFT",eE[eE.TOP_RIGHT=4]="TOP_RIGHT",eE[eE.BOTTOM_LEFT=1]="BOTTOM_LEFT",eE[eE.BOTTOM_RIGHT=5]="BOTTOM_RIGHT",eE[eE.TOP_START=8]="TOP_START",eE[eE.TOP_END=12]="TOP_END",eE[eE.BOTTOM_START=9]="BOTTOM_START",eE[eE.BOTTOM_END=13]="BOTTOM_END";var ch={LIST_ITEM_ACTIVATED_CLASS:"mdc-list-item--activated",LIST_ITEM_CLASS:"mdc-list-item",LIST_ITEM_DISABLED_CLASS:"mdc-list-item--disabled",LIST_ITEM_SELECTED_CLASS:"mdc-list-item--selected",LIST_ITEM_TEXT_CLASS:"mdc-list-item__text",LIST_ITEM_PRIMARY_TEXT_CLASS:"mdc-list-item__primary-text",ROOT:"mdc-list"},cp={ACTION_EVENT:"MDCList:action",ARIA_CHECKED:"aria-checked",ARIA_CHECKED_CHECKBOX_SELECTOR:'[role="checkbox"][aria-checked="true"]',ARIA_CHECKED_RADIO_SELECTOR:'[role="radio"][aria-checked="true"]',ARIA_CURRENT:"aria-current",ARIA_DISABLED:"aria-disabled",ARIA_ORIENTATION:"aria-orientation",ARIA_ORIENTATION_HORIZONTAL:"horizontal",ARIA_ROLE_CHECKBOX_SELECTOR:'[role="checkbox"]',ARIA_SELECTED:"aria-selected",CHECKBOX_RADIO_SELECTOR:'input[type="checkbox"], input[type="radio"]',CHECKBOX_SELECTOR:'input[type="checkbox"]',CHILD_ELEMENTS_TO_TOGGLE_TABINDEX:"\n ."+ch.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+ch.LIST_ITEM_CLASS+" a\n ",FOCUSABLE_CHILD_ELEMENTS:"\n ."+ch.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+ch.LIST_ITEM_CLASS+" a,\n ."+ch.LIST_ITEM_CLASS+' input[type="radio"]:not(:disabled),\n .'+ch.LIST_ITEM_CLASS+' input[type="checkbox"]:not(:disabled)\n ',RADIO_SELECTOR:'input[type="radio"]'},cf={UNSET_INDEX:-1,TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS:300},cb="Backspace",cg="Enter",c_="Spacebar",cy="PageUp",cv="PageDown",cx="Home",cw="ArrowLeft",cF="ArrowUp",ck="ArrowRight",cE="ArrowDown",cT="Delete",cM="Escape",cA=new Set;cA.add(cb),cA.add(cg),cA.add(c_),cA.add(cy),cA.add(cv),cA.add("End"),cA.add(cx),cA.add(cw),cA.add(cF),cA.add(ck),cA.add(cE),cA.add(cT),cA.add(cM);var cC=new Map;cC.set(8,cb),cC.set(13,cg),cC.set(32,c_),cC.set(33,cy),cC.set(34,cv),cC.set(35,"End"),cC.set(36,cx),cC.set(37,cw),cC.set(38,cF),cC.set(39,ck),cC.set(40,cE),cC.set(46,cT),cC.set(27,cM);var cS=new Set;function cD(t){var n=t.key;if(cA.has(n))return n;var i=cC.get(t.keyCode);return i||"Unknown"}cS.add(cy),cS.add(cv),cS.add("End"),cS.add(cx),cS.add(cw),cS.add(cF),cS.add(ck),cS.add(cE);var cL=["input","button","textarea","select"],cI=function(t){var n=t.target;if(n){var i=(""+n.tagName).toLowerCase();-1===cL.indexOf(i)&&t.preventDefault()}};function cP(t,n){var i,r=t.nextChar,o=t.focusItemAtIndex,a=t.sortedIndexByFirstChar,s=t.focusedItemIndex,l=t.skipFocus,c=t.isItemAtIndexDisabled;return clearTimeout(n.bufferClearTimeout),n.bufferClearTimeout=setTimeout(function(){cR(n)},cf.TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS),n.typeaheadBuffer=n.typeaheadBuffer+r,-1===(i=1===n.typeaheadBuffer.length?function(t,n,i,r){var o,a=r.typeaheadBuffer[0],s=t.get(a);if(!s)return -1;if(a===r.currentFirstChar&&s[r.sortedIndexCursor].index===n){r.sortedIndexCursor=(r.sortedIndexCursor+1)%s.length;var l=s[r.sortedIndexCursor].index;if(!i(l))return l}r.currentFirstChar=a;var c=-1;for(o=0;o<s.length;o++)if(!i(s[o].index)){c=o;break}for(;o<s.length;o++)if(s[o].index>n&&!i(s[o].index)){c=o;break}return -1!==c?(r.sortedIndexCursor=c,s[r.sortedIndexCursor].index):-1}(a,s,c,n):function(t,n,i){var r=i.typeaheadBuffer[0],o=t.get(r);if(!o)return -1;var a=o[i.sortedIndexCursor];if(0===a.text.lastIndexOf(i.typeaheadBuffer,0)&&!n(a.index))return a.index;for(var s=(i.sortedIndexCursor+1)%o.length,l=-1;s!==i.sortedIndexCursor;){var c=o[s],d=0===c.text.lastIndexOf(i.typeaheadBuffer,0),u=!n(c.index);if(d&&u){l=s;break}s=(s+1)%o.length}return -1!==l?(i.sortedIndexCursor=l,o[i.sortedIndexCursor].index):-1}(a,c,n))||l||o(i),i}function cO(t){return t.typeaheadBuffer.length>0}function cR(t){t.typeaheadBuffer=""}function cB(t,n){var i=t.event,r=t.isTargetListItem,o=t.focusedItemIndex,a=t.focusItemAtIndex,s=t.sortedIndexByFirstChar,l=t.isItemAtIndexDisabled,c="ArrowLeft"===cD(i),d="ArrowUp"===cD(i),u="ArrowRight"===cD(i),m="ArrowDown"===cD(i),h="Home"===cD(i),p="End"===cD(i),f="Enter"===cD(i),b="Spacebar"===cD(i);if(c||d||u||m||h||p||f)return -1;if(!b&&1===i.key.length){cI(i);var g={focusItemAtIndex:a,focusedItemIndex:o,nextChar:i.key.toLowerCase(),sortedIndexByFirstChar:s,skipFocus:!1,isItemAtIndexDisabled:l};return cP(g,n)}if(!b)return -1;if(r&&cI(i),r&&cO(n)){var g={focusItemAtIndex:a,focusedItemIndex:o,nextChar:" ",sortedIndexByFirstChar:s,skipFocus:!1,isItemAtIndexDisabled:l};return cP(g,n)}return -1}var cz=function(t){function n(i){var r=t.call(this,s6(s6({},n.defaultAdapter),i))||this;return r.wrapFocus_=!1,r.isVertical_=!0,r.isSingleSelectionList_=!1,r.selectedIndex_=cf.UNSET_INDEX,r.focusedItemIndex=cf.UNSET_INDEX,r.useActivatedClass_=!1,r.useSelectedAttr_=!1,r.ariaCurrentAttrValue_=null,r.isCheckboxList_=!1,r.isRadioList_=!1,r.hasTypeahead=!1,r.typeaheadState={bufferClearTimeout:0,currentFirstChar:"",sortedIndexCursor:0,typeaheadBuffer:""},r.sortedIndexByFirstChar=new Map,r}return s4(n,t),Object.defineProperty(n,"strings",{get:function(){return cp},enumerable:!0,configurable:!0}),Object.defineProperty(n,"cssClasses",{get:function(){return ch},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return cf},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClassForElementIndex:function(){},focusItemAtIndex:function(){},getAttributeForElementIndex:function(){return null},getFocusedElementIndex:function(){return 0},getListItemCount:function(){return 0},hasCheckboxAtIndex:function(){return!1},hasRadioAtIndex:function(){return!1},isCheckboxCheckedAtIndex:function(){return!1},isFocusInsideList:function(){return!1},isRootFocused:function(){return!1},listItemAtIndexHasClass:function(){return!1},notifyAction:function(){},removeClassForElementIndex:function(){},setAttributeForElementIndex:function(){},setCheckedCheckboxOrRadioAtIndex:function(){},setTabIndexForListItemChildren:function(){},getPrimaryTextAtIndex:function(){return""}}},enumerable:!0,configurable:!0}),n.prototype.layout=function(){0!==this.adapter.getListItemCount()&&(this.adapter.hasCheckboxAtIndex(0)?this.isCheckboxList_=!0:this.adapter.hasRadioAtIndex(0)?this.isRadioList_=!0:this.maybeInitializeSingleSelection(),this.hasTypeahead&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex()))},n.prototype.setWrapFocus=function(t){this.wrapFocus_=t},n.prototype.setVerticalOrientation=function(t){this.isVertical_=t},n.prototype.setSingleSelection=function(t){this.isSingleSelectionList_=t,t&&this.maybeInitializeSingleSelection()},n.prototype.maybeInitializeSingleSelection=function(){for(var t=0;t<this.adapter.getListItemCount();t++){var n=this.adapter.listItemAtIndexHasClass(t,ch.LIST_ITEM_SELECTED_CLASS),i=this.adapter.listItemAtIndexHasClass(t,ch.LIST_ITEM_ACTIVATED_CLASS);if(n||i){i&&this.setUseActivatedClass(!0),this.isSingleSelectionList_=!0,this.selectedIndex_=t;return}}},n.prototype.setHasTypeahead=function(t){this.hasTypeahead=t,t&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex())},n.prototype.isTypeaheadInProgress=function(){return this.hasTypeahead&&cO(this.typeaheadState)},n.prototype.setUseActivatedClass=function(t){this.useActivatedClass_=t},n.prototype.setUseSelectedAttribute=function(t){this.useSelectedAttr_=t},n.prototype.getSelectedIndex=function(){return this.selectedIndex_},n.prototype.setSelectedIndex=function(t){this.isIndexValid_(t)&&(this.isCheckboxList_?this.setCheckboxAtIndex_(t):this.isRadioList_?this.setRadioAtIndex_(t):this.setSingleSelectionAtIndex_(t))},n.prototype.handleFocusIn=function(t,n){n>=0&&(this.focusedItemIndex=n,this.adapter.setAttributeForElementIndex(n,"tabindex","0"),this.adapter.setTabIndexForListItemChildren(n,"0"))},n.prototype.handleFocusOut=function(t,n){var i=this;n>=0&&(this.adapter.setAttributeForElementIndex(n,"tabindex","-1"),this.adapter.setTabIndexForListItemChildren(n,"-1")),setTimeout(function(){i.adapter.isFocusInsideList()||i.setTabindexToFirstSelectedOrFocusedItem()},0)},n.prototype.handleKeydown=function(t,n,i){var r=this,o="ArrowLeft"===cD(t),a="ArrowUp"===cD(t),s="ArrowRight"===cD(t),l="ArrowDown"===cD(t),c="Home"===cD(t),d="End"===cD(t),u="Enter"===cD(t),m="Spacebar"===cD(t),h="A"===t.key||"a"===t.key;if(this.adapter.isRootFocused()){if(a||d?(t.preventDefault(),this.focusLastElement()):(l||c)&&(t.preventDefault(),this.focusFirstElement()),this.hasTypeahead){var p={event:t,focusItemAtIndex:function(t){r.focusItemAtIndex(t)},focusedItemIndex:-1,isTargetListItem:n,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return r.adapter.listItemAtIndexHasClass(t,ch.LIST_ITEM_DISABLED_CLASS)}};cB(p,this.typeaheadState)}return}var f=this.adapter.getFocusedElementIndex();if(-1!==f||!((f=i)<0)){if(this.isVertical_&&l||!this.isVertical_&&s)cI(t),this.focusNextElement(f);else if(this.isVertical_&&a||!this.isVertical_&&o)cI(t),this.focusPrevElement(f);else if(c)cI(t),this.focusFirstElement();else if(d)cI(t),this.focusLastElement();else if(h&&t.ctrlKey&&this.isCheckboxList_)t.preventDefault(),this.toggleAll(this.selectedIndex_===cf.UNSET_INDEX?[]:this.selectedIndex_);else if((u||m)&&n){var b=t.target;if(b&&"A"===b.tagName&&u||(cI(t),this.adapter.listItemAtIndexHasClass(f,ch.LIST_ITEM_DISABLED_CLASS)))return;this.isTypeaheadInProgress()||(this.isSelectableList_()&&this.setSelectedIndexOnAction_(f),this.adapter.notifyAction(f))}if(this.hasTypeahead){var p={event:t,focusItemAtIndex:function(t){r.focusItemAtIndex(t)},focusedItemIndex:this.focusedItemIndex,isTargetListItem:n,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return r.adapter.listItemAtIndexHasClass(t,ch.LIST_ITEM_DISABLED_CLASS)}};cB(p,this.typeaheadState)}}},n.prototype.handleClick=function(t,n){t===cf.UNSET_INDEX||this.adapter.listItemAtIndexHasClass(t,ch.LIST_ITEM_DISABLED_CLASS)||(this.isSelectableList_()&&this.setSelectedIndexOnAction_(t,n),this.adapter.notifyAction(t))},n.prototype.focusNextElement=function(t){var n=this.adapter.getListItemCount(),i=t+1;if(i>=n)if(!this.wrapFocus_)return t;else i=0;return this.focusItemAtIndex(i),i},n.prototype.focusPrevElement=function(t){var n=t-1;if(n<0)if(!this.wrapFocus_)return t;else n=this.adapter.getListItemCount()-1;return this.focusItemAtIndex(n),n},n.prototype.focusFirstElement=function(){return this.focusItemAtIndex(0),0},n.prototype.focusLastElement=function(){var t=this.adapter.getListItemCount()-1;return this.focusItemAtIndex(t),t},n.prototype.focusInitialElement=function(){var t=this.getFirstSelectedOrFocusedItemIndex();return this.focusItemAtIndex(t),t},n.prototype.setEnabled=function(t,n){this.isIndexValid_(t)&&(n?(this.adapter.removeClassForElementIndex(t,ch.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,cp.ARIA_DISABLED,"false")):(this.adapter.addClassForElementIndex(t,ch.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,cp.ARIA_DISABLED,"true")))},n.prototype.setSingleSelectionAtIndex_=function(t){if(this.selectedIndex_!==t){var n=ch.LIST_ITEM_SELECTED_CLASS;this.useActivatedClass_&&(n=ch.LIST_ITEM_ACTIVATED_CLASS),this.selectedIndex_!==cf.UNSET_INDEX&&this.adapter.removeClassForElementIndex(this.selectedIndex_,n),this.setAriaForSingleSelectionAtIndex_(t),this.setTabindexAtIndex(t),t!==cf.UNSET_INDEX&&this.adapter.addClassForElementIndex(t,n),this.selectedIndex_=t}},n.prototype.setAriaForSingleSelectionAtIndex_=function(t){this.selectedIndex_===cf.UNSET_INDEX&&(this.ariaCurrentAttrValue_=this.adapter.getAttributeForElementIndex(t,cp.ARIA_CURRENT));var n=null!==this.ariaCurrentAttrValue_,i=n?cp.ARIA_CURRENT:cp.ARIA_SELECTED;if(this.selectedIndex_!==cf.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex_,i,"false"),t!==cf.UNSET_INDEX){var r=n?this.ariaCurrentAttrValue_:"true";this.adapter.setAttributeForElementIndex(t,i,r)}},n.prototype.getSelectionAttribute=function(){return this.useSelectedAttr_?cp.ARIA_SELECTED:cp.ARIA_CHECKED},n.prototype.setRadioAtIndex_=function(t){var n=this.getSelectionAttribute();this.adapter.setCheckedCheckboxOrRadioAtIndex(t,!0),this.selectedIndex_!==cf.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex_,n,"false"),this.adapter.setAttributeForElementIndex(t,n,"true"),this.selectedIndex_=t},n.prototype.setCheckboxAtIndex_=function(t){for(var n=this.getSelectionAttribute(),i=0;i<this.adapter.getListItemCount();i++){var r=!1;t.indexOf(i)>=0&&(r=!0),this.adapter.setCheckedCheckboxOrRadioAtIndex(i,r),this.adapter.setAttributeForElementIndex(i,n,r?"true":"false")}this.selectedIndex_=t},n.prototype.setTabindexAtIndex=function(t){this.focusedItemIndex===cf.UNSET_INDEX&&0!==t?this.adapter.setAttributeForElementIndex(0,"tabindex","-1"):this.focusedItemIndex>=0&&this.focusedItemIndex!==t&&this.adapter.setAttributeForElementIndex(this.focusedItemIndex,"tabindex","-1"),this.selectedIndex_ instanceof Array||this.selectedIndex_===t||this.adapter.setAttributeForElementIndex(this.selectedIndex_,"tabindex","-1"),t!==cf.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(t,"tabindex","0")},n.prototype.isSelectableList_=function(){return this.isSingleSelectionList_||this.isCheckboxList_||this.isRadioList_},n.prototype.setTabindexToFirstSelectedOrFocusedItem=function(){var t=this.getFirstSelectedOrFocusedItemIndex();this.setTabindexAtIndex(t)},n.prototype.getFirstSelectedOrFocusedItemIndex=function(){var t=this.focusedItemIndex>=0?this.focusedItemIndex:0;return this.isSelectableList_()&&("number"==typeof this.selectedIndex_&&this.selectedIndex_!==cf.UNSET_INDEX?t=this.selectedIndex_:this.selectedIndex_ instanceof Array&&this.selectedIndex_.length>0&&(t=this.selectedIndex_.reduce(function(t,n){return Math.min(t,n)}))),t},n.prototype.isIndexValid_=function(t){var n=this;if(t instanceof Array){if(!this.isCheckboxList_)throw Error("MDCListFoundation: Array of index is only supported for checkbox based list");return 0===t.length||t.some(function(t){return n.isIndexInRange_(t)})}if("number"!=typeof t)return!1;if(this.isCheckboxList_)throw Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+t);return this.isIndexInRange_(t)||this.isSingleSelectionList_&&t===cf.UNSET_INDEX},n.prototype.isIndexInRange_=function(t){var n=this.adapter.getListItemCount();return t>=0&&t<n},n.prototype.setSelectedIndexOnAction_=function(t,n){void 0===n&&(n=!0),this.isCheckboxList_?this.toggleCheckboxAtIndex_(t,n):this.setSelectedIndex(t)},n.prototype.toggleCheckboxAtIndex_=function(t,n){var i=this.getSelectionAttribute(),r=this.adapter.isCheckboxCheckedAtIndex(t);n&&(r=!r,this.adapter.setCheckedCheckboxOrRadioAtIndex(t,r)),this.adapter.setAttributeForElementIndex(t,i,r?"true":"false");var o=this.selectedIndex_===cf.UNSET_INDEX?[]:this.selectedIndex_.slice();r?o.push(t):o=o.filter(function(n){return n!==t}),this.selectedIndex_=o},n.prototype.focusItemAtIndex=function(t){this.adapter.focusItemAtIndex(t),this.focusedItemIndex=t},n.prototype.toggleAll=function(t){var n=this.adapter.getListItemCount();if(t.length===n)this.setCheckboxAtIndex_([]);else{for(var i=[],r=0;r<n;r++)(!this.adapter.listItemAtIndexHasClass(r,ch.LIST_ITEM_DISABLED_CLASS)||t.indexOf(r)>-1)&&i.push(r);this.setCheckboxAtIndex_(i)}},n.prototype.typeaheadMatchItem=function(t,n,i){var r=this;return void 0===i&&(i=!1),cP({focusItemAtIndex:function(t){r.focusItemAtIndex(t)},focusedItemIndex:n||this.focusedItemIndex,nextChar:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,skipFocus:i,isItemAtIndexDisabled:function(t){return r.adapter.listItemAtIndexHasClass(t,ch.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState)},n.prototype.typeaheadInitSortedIndex=function(){return function(t,n){for(var i=new Map,r=0;r<t;r++){var o=n(r).trim();if(o){var a=o[0].toLowerCase();i.has(a)||i.set(a,[]),i.get(a).push({text:o.toLowerCase(),index:r})}}return i.forEach(function(t){t.sort(function(t,n){return t.index-n.index})}),i}(this.adapter.getListItemCount(),this.adapter.getPrimaryTextAtIndex)},n.prototype.clearTypeaheadBuffer=function(){cR(this.typeaheadState)},n}(s9),cY=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return s4(n,t),Object.defineProperty(n.prototype,"vertical",{set:function(t){this.foundation.setVerticalOrientation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"listElements",{get:function(){return[].slice.call(this.root.querySelectorAll("."+ch.LIST_ITEM_CLASS))},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"wrapFocus",{set:function(t){this.foundation.setWrapFocus(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"typeaheadInProgress",{get:function(){return this.foundation.isTypeaheadInProgress()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hasTypeahead",{set:function(t){this.foundation.setHasTypeahead(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"singleSelection",{set:function(t){this.foundation.setSingleSelection(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(t){this.foundation.setSelectedIndex(t)},enumerable:!0,configurable:!0}),n.attachTo=function(t){return new n(t)},n.prototype.initialSyncWithDOM=function(){this.handleClick_=this.handleClickEvent_.bind(this),this.handleKeydown_=this.handleKeydownEvent_.bind(this),this.focusInEventListener_=this.handleFocusInEvent_.bind(this),this.focusOutEventListener_=this.handleFocusOutEvent_.bind(this),this.listen("keydown",this.handleKeydown_),this.listen("click",this.handleClick_),this.listen("focusin",this.focusInEventListener_),this.listen("focusout",this.focusOutEventListener_),this.layout(),this.initializeListType()},n.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown_),this.unlisten("click",this.handleClick_),this.unlisten("focusin",this.focusInEventListener_),this.unlisten("focusout",this.focusOutEventListener_)},n.prototype.layout=function(){var t=this.root.getAttribute(cp.ARIA_ORIENTATION);this.vertical=t!==cp.ARIA_ORIENTATION_HORIZONTAL,[].slice.call(this.root.querySelectorAll(".mdc-list-item:not([tabindex])")).forEach(function(t){t.setAttribute("tabindex","-1")}),[].slice.call(this.root.querySelectorAll(cp.FOCUSABLE_CHILD_ELEMENTS)).forEach(function(t){return t.setAttribute("tabindex","-1")}),this.foundation.layout()},n.prototype.getPrimaryText=function(t){var n=t.querySelector("."+ch.LIST_ITEM_PRIMARY_TEXT_CLASS);if(n)return n.textContent||"";var i=t.querySelector("."+ch.LIST_ITEM_TEXT_CLASS);return i&&i.textContent||""},n.prototype.initializeListType=function(){var t=this,n=this.root.querySelectorAll(cp.ARIA_ROLE_CHECKBOX_SELECTOR),i=this.root.querySelector(cp.ARIA_CHECKED_RADIO_SELECTOR);if(n.length){var r=this.root.querySelectorAll(cp.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=[].map.call(r,function(n){return t.listElements.indexOf(n)})}else i&&(this.selectedIndex=this.listElements.indexOf(i))},n.prototype.setEnabled=function(t,n){this.foundation.setEnabled(t,n)},n.prototype.typeaheadMatchItem=function(t,n){return this.foundation.typeaheadMatchItem(t,n,!0)},n.prototype.getDefaultFoundation=function(){var t=this;return new cz({addClassForElementIndex:function(n,i){var r=t.listElements[n];r&&r.classList.add(i)},focusItemAtIndex:function(n){var i=t.listElements[n];i&&i.focus()},getAttributeForElementIndex:function(n,i){return t.listElements[n].getAttribute(i)},getFocusedElementIndex:function(){return t.listElements.indexOf(document.activeElement)},getListItemCount:function(){return t.listElements.length},getPrimaryTextAtIndex:function(n){return t.getPrimaryText(t.listElements[n])},hasCheckboxAtIndex:function(n){return!!t.listElements[n].querySelector(cp.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(n){return!!t.listElements[n].querySelector(cp.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(n){return t.listElements[n].querySelector(cp.CHECKBOX_SELECTOR).checked},isFocusInsideList:function(){return t.root!==document.activeElement&&t.root.contains(document.activeElement)},isRootFocused:function(){return document.activeElement===t.root},listItemAtIndexHasClass:function(n,i){return t.listElements[n].classList.contains(i)},notifyAction:function(n){t.emit(cp.ACTION_EVENT,{index:n},!0)},removeClassForElementIndex:function(n,i){var r=t.listElements[n];r&&r.classList.remove(i)},setAttributeForElementIndex:function(n,i,r){var o=t.listElements[n];o&&o.setAttribute(i,r)},setCheckedCheckboxOrRadioAtIndex:function(n,i){var r=t.listElements[n].querySelector(cp.CHECKBOX_RADIO_SELECTOR);r.checked=i;var o=document.createEvent("Event");o.initEvent("change",!0,!0),r.dispatchEvent(o)},setTabIndexForListItemChildren:function(n,i){var r=t.listElements[n];[].slice.call(r.querySelectorAll(cp.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX)).forEach(function(t){return t.setAttribute("tabindex",i)})}})},n.prototype.getListItemIndex_=function(t){var n=ln(t.target,"."+ch.LIST_ITEM_CLASS+", ."+ch.ROOT);return n&&li(n,"."+ch.LIST_ITEM_CLASS)?this.listElements.indexOf(n):-1},n.prototype.handleFocusInEvent_=function(t){var n=this.getListItemIndex_(t);this.foundation.handleFocusIn(t,n)},n.prototype.handleFocusOutEvent_=function(t){var n=this.getListItemIndex_(t);this.foundation.handleFocusOut(t,n)},n.prototype.handleKeydownEvent_=function(t){var n=this.getListItemIndex_(t),i=t.target;this.foundation.handleKeydown(t,i.classList.contains(ch.LIST_ITEM_CLASS),n)},n.prototype.handleClickEvent_=function(t){var n=this.getListItemIndex_(t),i=!li(t.target,cp.CHECKBOX_RADIO_SELECTOR);this.foundation.handleClick(n,i)},n}(le),cN=function(t){function n(i){var r=t.call(this,s6(s6({},n.defaultAdapter),i))||this;return r.isSurfaceOpen=!1,r.isQuickOpen=!1,r.isHoistedElement=!1,r.isFixedPosition=!1,r.openAnimationEndTimerId=0,r.closeAnimationEndTimerId=0,r.animationRequestId=0,r.anchorCorner=tz.TOP_START,r.originCorner=tz.TOP_START,r.anchorMargin={top:0,right:0,bottom:0,left:0},r.position={x:0,y:0},r}return s4(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return cd},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return cu},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return cm},enumerable:!0,configurable:!0}),Object.defineProperty(n,"Corner",{get:function(){return tz},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},hasAnchor:function(){return!1},isElementInContainer:function(){return!1},isFocused:function(){return!1},isRtl:function(){return!1},getInnerDimensions:function(){return{height:0,width:0}},getAnchorDimensions:function(){return null},getWindowDimensions:function(){return{height:0,width:0}},getBodyDimensions:function(){return{height:0,width:0}},getWindowScroll:function(){return{x:0,y:0}},setPosition:function(){},setMaxHeight:function(){},setTransformOrigin:function(){},saveFocus:function(){},restoreFocus:function(){},notifyClose:function(){},notifyOpen:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){var t=n.cssClasses,i=t.ROOT,r=t.OPEN;if(!this.adapter.hasClass(i))throw Error(i+" class required in root element.");this.adapter.hasClass(r)&&(this.isSurfaceOpen=!0)},n.prototype.destroy=function(){clearTimeout(this.openAnimationEndTimerId),clearTimeout(this.closeAnimationEndTimerId),cancelAnimationFrame(this.animationRequestId)},n.prototype.setAnchorCorner=function(t){this.anchorCorner=t},n.prototype.flipCornerHorizontally=function(){this.originCorner=this.originCorner^tB.RIGHT},n.prototype.setAnchorMargin=function(t){this.anchorMargin.top=t.top||0,this.anchorMargin.right=t.right||0,this.anchorMargin.bottom=t.bottom||0,this.anchorMargin.left=t.left||0},n.prototype.setIsHoisted=function(t){this.isHoistedElement=t},n.prototype.setFixedPosition=function(t){this.isFixedPosition=t},n.prototype.setAbsolutePosition=function(t,n){this.position.x=this.isFinite(t)?t:0,this.position.y=this.isFinite(n)?n:0},n.prototype.setQuickOpen=function(t){this.isQuickOpen=t},n.prototype.isOpen=function(){return this.isSurfaceOpen},n.prototype.open=function(){var t=this;this.isSurfaceOpen||(this.adapter.saveFocus(),this.isQuickOpen?(this.isSurfaceOpen=!0,this.adapter.addClass(n.cssClasses.OPEN),this.dimensions=this.adapter.getInnerDimensions(),this.autoposition(),this.adapter.notifyOpen()):(this.adapter.addClass(n.cssClasses.ANIMATING_OPEN),this.animationRequestId=requestAnimationFrame(function(){t.adapter.addClass(n.cssClasses.OPEN),t.dimensions=t.adapter.getInnerDimensions(),t.autoposition(),t.openAnimationEndTimerId=setTimeout(function(){t.openAnimationEndTimerId=0,t.adapter.removeClass(n.cssClasses.ANIMATING_OPEN),t.adapter.notifyOpen()},cm.TRANSITION_OPEN_DURATION)}),this.isSurfaceOpen=!0))},n.prototype.close=function(t){var i=this;void 0===t&&(t=!1),this.isSurfaceOpen&&(this.isQuickOpen?(this.isSurfaceOpen=!1,t||this.maybeRestoreFocus(),this.adapter.removeClass(n.cssClasses.OPEN),this.adapter.removeClass(n.cssClasses.IS_OPEN_BELOW),this.adapter.notifyClose()):(this.adapter.addClass(n.cssClasses.ANIMATING_CLOSED),requestAnimationFrame(function(){i.adapter.removeClass(n.cssClasses.OPEN),i.adapter.removeClass(n.cssClasses.IS_OPEN_BELOW),i.closeAnimationEndTimerId=setTimeout(function(){i.closeAnimationEndTimerId=0,i.adapter.removeClass(n.cssClasses.ANIMATING_CLOSED),i.adapter.notifyClose()},cm.TRANSITION_CLOSE_DURATION)}),this.isSurfaceOpen=!1,t||this.maybeRestoreFocus()))},n.prototype.handleBodyClick=function(t){var n=t.target;this.adapter.isElementInContainer(n)||this.close()},n.prototype.handleKeydown=function(t){var n=t.keyCode;("Escape"===t.key||27===n)&&this.close()},n.prototype.autoposition=function(){this.measurements=this.getAutoLayoutmeasurements();var t,i=this.getoriginCorner(),r=this.getMenuSurfaceMaxHeight(i),o=this.hasBit(i,tB.BOTTOM)?"bottom":"top",a=this.hasBit(i,tB.RIGHT)?"right":"left",s=this.getHorizontalOriginOffset(i),l=this.getVerticalOriginOffset(i),c=this.measurements,d=c.anchorSize,u=c.surfaceSize,m=((t={})[a]=s,t[o]=l,t);d.width/u.width>cm.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO&&(a="center"),(this.isHoistedElement||this.isFixedPosition)&&this.adjustPositionForHoistedElement(m),this.adapter.setTransformOrigin(a+" "+o),this.adapter.setPosition(m),this.adapter.setMaxHeight(r?r+"px":""),this.hasBit(i,tB.BOTTOM)||this.adapter.addClass(n.cssClasses.IS_OPEN_BELOW)},n.prototype.getAutoLayoutmeasurements=function(){var t=this.adapter.getAnchorDimensions(),n=this.adapter.getBodyDimensions(),i=this.adapter.getWindowDimensions(),r=this.adapter.getWindowScroll();return t||(t={top:this.position.y,right:this.position.x,bottom:this.position.y,left:this.position.x,width:0,height:0}),{anchorSize:t,bodySize:n,surfaceSize:this.dimensions,viewportDistance:{top:t.top,right:i.width-t.right,bottom:i.height-t.bottom,left:t.left},viewportSize:i,windowScroll:r}},n.prototype.getoriginCorner=function(){var t,i,r,o,a=this.originCorner,s=this.measurements,l=s.viewportDistance,c=s.anchorSize,d=s.surfaceSize,u=n.numbers.MARGIN_TO_EDGE;this.hasBit(this.anchorCorner,tB.BOTTOM)?(t=l.top-u+c.height+this.anchorMargin.bottom,i=l.bottom-u-this.anchorMargin.bottom):(t=l.top-u+this.anchorMargin.top,i=l.bottom-u+c.height-this.anchorMargin.top),!(i-d.height>0)&&t>=i&&(a=this.setBit(a,tB.BOTTOM));var m=this.adapter.isRtl(),h=this.hasBit(this.anchorCorner,tB.FLIP_RTL),p=this.hasBit(this.anchorCorner,tB.RIGHT)||this.hasBit(a,tB.RIGHT),f=!1;(f=m&&h?!p:p)?(r=l.left+c.width+this.anchorMargin.right,o=l.right-this.anchorMargin.right):(r=l.left+this.anchorMargin.left,o=l.right+c.width-this.anchorMargin.left);var b=r-d.width>0,g=o-d.width>0,_=this.hasBit(a,tB.FLIP_RTL)&&this.hasBit(a,tB.RIGHT);return g&&_&&m||!b&&_?a=this.unsetBit(a,tB.RIGHT):(b&&f&&m||b&&!f&&p||!g&&r>=o)&&(a=this.setBit(a,tB.RIGHT)),a},n.prototype.getMenuSurfaceMaxHeight=function(t){var i=this.measurements.viewportDistance,r=0,o=this.hasBit(t,tB.BOTTOM),a=this.hasBit(this.anchorCorner,tB.BOTTOM),s=n.numbers.MARGIN_TO_EDGE;return o?(r=i.top+this.anchorMargin.top-s,a||(r+=this.measurements.anchorSize.height)):(r=i.bottom-this.anchorMargin.bottom+this.measurements.anchorSize.height-s,a&&(r-=this.measurements.anchorSize.height)),r},n.prototype.getHorizontalOriginOffset=function(t){var n=this.measurements.anchorSize,i=this.hasBit(t,tB.RIGHT),r=this.hasBit(this.anchorCorner,tB.RIGHT);if(i){var o=r?n.width-this.anchorMargin.left:this.anchorMargin.right;return this.isHoistedElement||this.isFixedPosition?o-(this.measurements.viewportSize.width-this.measurements.bodySize.width):o}return r?n.width-this.anchorMargin.right:this.anchorMargin.left},n.prototype.getVerticalOriginOffset=function(t){var n=this.measurements.anchorSize,i=this.hasBit(t,tB.BOTTOM),r=this.hasBit(this.anchorCorner,tB.BOTTOM);return i?r?n.height-this.anchorMargin.top:-this.anchorMargin.bottom:r?n.height+this.anchorMargin.bottom:this.anchorMargin.top},n.prototype.adjustPositionForHoistedElement=function(t){var n,i,r=this.measurements,o=r.windowScroll,a=r.viewportDistance,s=Object.keys(t);try{for(var l=s8(s),c=l.next();!c.done;c=l.next()){var d=c.value,u=t[d]||0;u+=a[d],this.isFixedPosition||("top"===d?u+=o.y:"bottom"===d?u-=o.y:"left"===d?u+=o.x:u-=o.x),t[d]=u}}catch(t){n={error:t}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}},n.prototype.maybeRestoreFocus=function(){var t=this.adapter.isFocused(),n=document.activeElement&&this.adapter.isElementInContainer(document.activeElement);(t||n)&&this.adapter.restoreFocus()},n.prototype.hasBit=function(t,n){return!!(t&n)},n.prototype.setBit=function(t,n){return t|n},n.prototype.unsetBit=function(t,n){return t^n},n.prototype.isFinite=function(t){return"number"==typeof t&&isFinite(t)},n}(s9),cj=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return s4(n,t),n.attachTo=function(t){return new n(t)},n.prototype.initialSyncWithDOM=function(){var t=this,n=this.root.parentElement;this.anchorElement=n&&n.classList.contains(cd.ANCHOR)?n:null,this.root.classList.contains(cd.FIXED)&&this.setFixedPosition(!0),this.handleKeydown=function(n){t.foundation.handleKeydown(n)},this.handleBodyClick=function(n){t.foundation.handleBodyClick(n)},this.registerBodyClickListener=function(){document.body.addEventListener("click",t.handleBodyClick,{capture:!0})},this.deregisterBodyClickListener=function(){document.body.removeEventListener("click",t.handleBodyClick,{capture:!0})},this.listen("keydown",this.handleKeydown),this.listen(cu.OPENED_EVENT,this.registerBodyClickListener),this.listen(cu.CLOSED_EVENT,this.deregisterBodyClickListener)},n.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown),this.unlisten(cu.OPENED_EVENT,this.registerBodyClickListener),this.unlisten(cu.CLOSED_EVENT,this.deregisterBodyClickListener),t.prototype.destroy.call(this)},n.prototype.isOpen=function(){return this.foundation.isOpen()},n.prototype.open=function(){this.foundation.open()},n.prototype.close=function(t){void 0===t&&(t=!1),this.foundation.close(t)},Object.defineProperty(n.prototype,"quickOpen",{set:function(t){this.foundation.setQuickOpen(t)},enumerable:!0,configurable:!0}),n.prototype.setIsHoisted=function(t){this.foundation.setIsHoisted(t)},n.prototype.setMenuSurfaceAnchorElement=function(t){this.anchorElement=t},n.prototype.setFixedPosition=function(t){t?this.root.classList.add(cd.FIXED):this.root.classList.remove(cd.FIXED),this.foundation.setFixedPosition(t)},n.prototype.setAbsolutePosition=function(t,n){this.foundation.setAbsolutePosition(t,n),this.setIsHoisted(!0)},n.prototype.setAnchorCorner=function(t){this.foundation.setAnchorCorner(t)},n.prototype.setAnchorMargin=function(t){this.foundation.setAnchorMargin(t)},n.prototype.getDefaultFoundation=function(){var t=this;return new cN({addClass:function(n){return t.root.classList.add(n)},removeClass:function(n){return t.root.classList.remove(n)},hasClass:function(n){return t.root.classList.contains(n)},hasAnchor:function(){return!!t.anchorElement},notifyClose:function(){return t.emit(cN.strings.CLOSED_EVENT,{})},notifyOpen:function(){return t.emit(cN.strings.OPENED_EVENT,{})},isElementInContainer:function(n){return t.root.contains(n)},isRtl:function(){return"rtl"===getComputedStyle(t.root).getPropertyValue("direction")},setTransformOrigin:function(n){var i,r,o=(i=window,void 0===r&&(r=!1),(void 0===tY||r)&&(tY="transform"in i.document.createElement("div").style?"transform":"webkitTransform"),tY+"-origin");t.root.style.setProperty(o,n)},isFocused:function(){return document.activeElement===t.root},saveFocus:function(){t.previousFocus=document.activeElement},restoreFocus:function(){t.root.contains(document.activeElement)&&t.previousFocus&&t.previousFocus.focus&&t.previousFocus.focus()},getInnerDimensions:function(){return{width:t.root.offsetWidth,height:t.root.offsetHeight}},getAnchorDimensions:function(){return t.anchorElement?t.anchorElement.getBoundingClientRect():null},getWindowDimensions:function(){return{width:window.innerWidth,height:window.innerHeight}},getBodyDimensions:function(){return{width:document.body.clientWidth,height:document.body.clientHeight}},getWindowScroll:function(){return{x:window.pageXOffset,y:window.pageYOffset}},setPosition:function(n){var i=t.root;i.style.left="left"in n?n.left+"px":"",i.style.right="right"in n?n.right+"px":"",i.style.top="top"in n?n.top+"px":"",i.style.bottom="bottom"in n?n.bottom+"px":""},setMaxHeight:function(n){t.root.style.maxHeight=n}})},n}(le),cH={MENU_SELECTED_LIST_ITEM:"mdc-menu-item--selected",MENU_SELECTION_GROUP:"mdc-menu__selection-group",ROOT:"mdc-menu"},cU={ARIA_CHECKED_ATTR:"aria-checked",ARIA_DISABLED_ATTR:"aria-disabled",CHECKBOX_SELECTOR:'input[type="checkbox"]',LIST_SELECTOR:".mdc-list",SELECTED_EVENT:"MDCMenu:selected"},cV={FOCUS_ROOT_INDEX:-1};(eT=tN||(tN={}))[eT.NONE=0]="NONE",eT[eT.LIST_ROOT=1]="LIST_ROOT",eT[eT.FIRST_ITEM=2]="FIRST_ITEM",eT[eT.LAST_ITEM=3]="LAST_ITEM";var cq=function(t){function n(i){var r=t.call(this,s6(s6({},n.defaultAdapter),i))||this;return r.closeAnimationEndTimerId_=0,r.defaultFocusState_=tN.LIST_ROOT,r}return s4(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return cH},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return cU},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return cV},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClassToElementAtIndex:function(){},removeClassFromElementAtIndex:function(){},addAttributeToElementAtIndex:function(){},removeAttributeFromElementAtIndex:function(){},elementContainsClass:function(){return!1},closeSurface:function(){},getElementIndex:function(){return -1},notifySelected:function(){},getMenuItemCount:function(){return 0},focusItemAtIndex:function(){},focusListRoot:function(){},getSelectedSiblingOfItemAtIndex:function(){return -1},isSelectableItemAtIndex:function(){return!1}}},enumerable:!0,configurable:!0}),n.prototype.destroy=function(){this.closeAnimationEndTimerId_&&clearTimeout(this.closeAnimationEndTimerId_),this.adapter.closeSurface()},n.prototype.handleKeydown=function(t){var n=t.key,i=t.keyCode;("Tab"===n||9===i)&&this.adapter.closeSurface(!0)},n.prototype.handleItemAction=function(t){var n=this,i=this.adapter.getElementIndex(t);i<0||(this.adapter.notifySelected({index:i}),this.adapter.closeSurface(),this.closeAnimationEndTimerId_=setTimeout(function(){var i=n.adapter.getElementIndex(t);i>=0&&n.adapter.isSelectableItemAtIndex(i)&&n.setSelectedIndex(i)},cN.numbers.TRANSITION_CLOSE_DURATION))},n.prototype.handleMenuSurfaceOpened=function(){switch(this.defaultFocusState_){case tN.FIRST_ITEM:this.adapter.focusItemAtIndex(0);break;case tN.LAST_ITEM:this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount()-1);break;case tN.NONE:break;default:this.adapter.focusListRoot()}},n.prototype.setDefaultFocusState=function(t){this.defaultFocusState_=t},n.prototype.setSelectedIndex=function(t){if(this.validatedIndex_(t),!this.adapter.isSelectableItemAtIndex(t))throw Error("MDCMenuFoundation: No selection group at specified index.");var n=this.adapter.getSelectedSiblingOfItemAtIndex(t);n>=0&&(this.adapter.removeAttributeFromElementAtIndex(n,cU.ARIA_CHECKED_ATTR),this.adapter.removeClassFromElementAtIndex(n,cH.MENU_SELECTED_LIST_ITEM)),this.adapter.addClassToElementAtIndex(t,cH.MENU_SELECTED_LIST_ITEM),this.adapter.addAttributeToElementAtIndex(t,cU.ARIA_CHECKED_ATTR,"true")},n.prototype.setEnabled=function(t,n){this.validatedIndex_(t),n?(this.adapter.removeClassFromElementAtIndex(t,ch.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(t,cU.ARIA_DISABLED_ATTR,"false")):(this.adapter.addClassToElementAtIndex(t,ch.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(t,cU.ARIA_DISABLED_ATTR,"true"))},n.prototype.validatedIndex_=function(t){var n=this.adapter.getMenuItemCount();if(!(t>=0&&t<n))throw Error("MDCMenuFoundation: No list item at specified index.")},n}(s9),cG=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return s4(n,t),n.attachTo=function(t){return new n(t)},n.prototype.initialize=function(t,n){void 0===t&&(t=function(t){return new cj(t)}),void 0===n&&(n=function(t){return new cY(t)}),this.menuSurfaceFactory_=t,this.listFactory_=n},n.prototype.initialSyncWithDOM=function(){var t=this;this.menuSurface_=this.menuSurfaceFactory_(this.root);var n=this.root.querySelector(cU.LIST_SELECTOR);n?(this.list_=this.listFactory_(n),this.list_.wrapFocus=!0):this.list_=null,this.handleKeydown_=function(n){return t.foundation.handleKeydown(n)},this.handleItemAction_=function(n){return t.foundation.handleItemAction(t.items[n.detail.index])},this.handleMenuSurfaceOpened_=function(){return t.foundation.handleMenuSurfaceOpened()},this.menuSurface_.listen(cN.strings.OPENED_EVENT,this.handleMenuSurfaceOpened_),this.listen("keydown",this.handleKeydown_),this.listen(cz.strings.ACTION_EVENT,this.handleItemAction_)},n.prototype.destroy=function(){this.list_&&this.list_.destroy(),this.menuSurface_.destroy(),this.menuSurface_.unlisten(cN.strings.OPENED_EVENT,this.handleMenuSurfaceOpened_),this.unlisten("keydown",this.handleKeydown_),this.unlisten(cz.strings.ACTION_EVENT,this.handleItemAction_),t.prototype.destroy.call(this)},Object.defineProperty(n.prototype,"open",{get:function(){return this.menuSurface_.isOpen()},set:function(t){t?this.menuSurface_.open():this.menuSurface_.close()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"wrapFocus",{get:function(){return!!this.list_&&this.list_.wrapFocus},set:function(t){this.list_&&(this.list_.wrapFocus=t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hasTypeahead",{set:function(t){this.list_&&(this.list_.hasTypeahead=t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"typeaheadInProgress",{get:function(){return!!this.list_&&this.list_.typeaheadInProgress},enumerable:!0,configurable:!0}),n.prototype.typeaheadMatchItem=function(t,n){return this.list_?this.list_.typeaheadMatchItem(t,n):-1},n.prototype.layout=function(){this.list_&&this.list_.layout()},Object.defineProperty(n.prototype,"items",{get:function(){return this.list_?this.list_.listElements:[]},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"singleSelection",{set:function(t){this.list_&&(this.list_.singleSelection=t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"selectedIndex",{get:function(){return this.list_?this.list_.selectedIndex:cf.UNSET_INDEX},set:function(t){this.list_&&(this.list_.selectedIndex=t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"quickOpen",{set:function(t){this.menuSurface_.quickOpen=t},enumerable:!0,configurable:!0}),n.prototype.setDefaultFocusState=function(t){this.foundation.setDefaultFocusState(t)},n.prototype.setAnchorCorner=function(t){this.menuSurface_.setAnchorCorner(t)},n.prototype.setAnchorMargin=function(t){this.menuSurface_.setAnchorMargin(t)},n.prototype.setSelectedIndex=function(t){this.foundation.setSelectedIndex(t)},n.prototype.setEnabled=function(t,n){this.foundation.setEnabled(t,n)},n.prototype.getOptionByIndex=function(t){return t<this.items.length?this.items[t]:null},n.prototype.getPrimaryTextAtIndex=function(t){var n=this.getOptionByIndex(t);return n&&this.list_&&this.list_.getPrimaryText(n)||""},n.prototype.setFixedPosition=function(t){this.menuSurface_.setFixedPosition(t)},n.prototype.setIsHoisted=function(t){this.menuSurface_.setIsHoisted(t)},n.prototype.setAbsolutePosition=function(t,n){this.menuSurface_.setAbsolutePosition(t,n)},n.prototype.setAnchorElement=function(t){this.menuSurface_.anchorElement=t},n.prototype.getDefaultFoundation=function(){var t=this;return new cq({addClassToElementAtIndex:function(n,i){t.items[n].classList.add(i)},removeClassFromElementAtIndex:function(n,i){t.items[n].classList.remove(i)},addAttributeToElementAtIndex:function(n,i,r){t.items[n].setAttribute(i,r)},removeAttributeFromElementAtIndex:function(n,i){t.items[n].removeAttribute(i)},elementContainsClass:function(t,n){return t.classList.contains(n)},closeSurface:function(n){return t.menuSurface_.close(n)},getElementIndex:function(n){return t.items.indexOf(n)},notifySelected:function(n){return t.emit(cU.SELECTED_EVENT,{index:n.index,item:t.items[n.index]})},getMenuItemCount:function(){return t.items.length},focusItemAtIndex:function(n){return t.items[n].focus()},focusListRoot:function(){return t.root.querySelector(cU.LIST_SELECTOR).focus()},isSelectableItemAtIndex:function(n){return!!ln(t.items[n],"."+cH.MENU_SELECTION_GROUP)},getSelectedSiblingOfItemAtIndex:function(n){var i=ln(t.items[n],"."+cH.MENU_SELECTION_GROUP).querySelector("."+cH.MENU_SELECTED_LIST_ITEM);return i?t.items.indexOf(i):-1}})},n}(le),c$={ACTIVATED:"mdc-select--activated",DISABLED:"mdc-select--disabled",FOCUSED:"mdc-select--focused",INVALID:"mdc-select--invalid",MENU_INVALID:"mdc-select__menu--invalid",OUTLINED:"mdc-select--outlined",REQUIRED:"mdc-select--required",ROOT:"mdc-select",WITH_LEADING_ICON:"mdc-select--with-leading-icon"},cW={ARIA_CONTROLS:"aria-controls",ARIA_DESCRIBEDBY:"aria-describedby",ARIA_SELECTED_ATTR:"aria-selected",CHANGE_EVENT:"MDCSelect:change",HIDDEN_INPUT_SELECTOR:'input[type="hidden"]',LABEL_SELECTOR:".mdc-floating-label",LEADING_ICON_SELECTOR:".mdc-select__icon",LINE_RIPPLE_SELECTOR:".mdc-line-ripple",MENU_SELECTOR:".mdc-select__menu",OUTLINE_SELECTOR:".mdc-notched-outline",SELECTED_TEXT_SELECTOR:".mdc-select__selected-text",SELECT_ANCHOR_SELECTOR:".mdc-select__anchor",VALUE_ATTR:"data-value"},cX={LABEL_SCALE:.75,UNSET_INDEX:-1,CLICK_DEBOUNCE_TIMEOUT_MS:330},cZ=function(t){function n(i,r){void 0===r&&(r={});var o=t.call(this,s6(s6({},n.defaultAdapter),i))||this;return o.disabled=!1,o.isMenuOpen=!1,o.useDefaultValidation=!0,o.customValidity=!0,o.lastSelectedIndex=cX.UNSET_INDEX,o.clickDebounceTimeout=0,o.recentlyClicked=!1,o.leadingIcon=r.leadingIcon,o.helperText=r.helperText,o}return s4(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return c$},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return cX},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return cW},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},activateBottomLine:function(){},deactivateBottomLine:function(){},getSelectedIndex:function(){return -1},setSelectedIndex:function(){},hasLabel:function(){return!1},floatLabel:function(){},getLabelWidth:function(){return 0},setLabelRequired:function(){},hasOutline:function(){return!1},notchOutline:function(){},closeOutline:function(){},setRippleCenter:function(){},notifyChange:function(){},setSelectedText:function(){},isSelectAnchorFocused:function(){return!1},getSelectAnchorAttr:function(){return""},setSelectAnchorAttr:function(){},removeSelectAnchorAttr:function(){},addMenuClass:function(){},removeMenuClass:function(){},openMenu:function(){},closeMenu:function(){},getAnchorElement:function(){return null},setMenuAnchorElement:function(){},setMenuAnchorCorner:function(){},setMenuWrapFocus:function(){},focusMenuItemAtIndex:function(){},getMenuItemCount:function(){return 0},getMenuItemValues:function(){return[]},getMenuItemTextAtIndex:function(){return""},isTypeaheadInProgress:function(){return!1},typeaheadMatchItem:function(){return -1}}},enumerable:!0,configurable:!0}),n.prototype.getSelectedIndex=function(){return this.adapter.getSelectedIndex()},n.prototype.setSelectedIndex=function(t,n,i){void 0===n&&(n=!1),void 0===i&&(i=!1),t>=this.adapter.getMenuItemCount()||(t===cX.UNSET_INDEX?this.adapter.setSelectedText(""):this.adapter.setSelectedText(this.adapter.getMenuItemTextAtIndex(t).trim()),this.adapter.setSelectedIndex(t),n&&this.adapter.closeMenu(),i||this.lastSelectedIndex===t||this.handleChange(),this.lastSelectedIndex=t)},n.prototype.setValue=function(t,n){void 0===n&&(n=!1);var i=this.adapter.getMenuItemValues().indexOf(t);this.setSelectedIndex(i,!1,n)},n.prototype.getValue=function(){var t=this.adapter.getSelectedIndex(),n=this.adapter.getMenuItemValues();return t!==cX.UNSET_INDEX?n[t]:""},n.prototype.getDisabled=function(){return this.disabled},n.prototype.setDisabled=function(t){this.disabled=t,this.disabled?(this.adapter.addClass(c$.DISABLED),this.adapter.closeMenu()):this.adapter.removeClass(c$.DISABLED),this.leadingIcon&&this.leadingIcon.setDisabled(this.disabled),this.disabled?this.adapter.removeSelectAnchorAttr("tabindex"):this.adapter.setSelectAnchorAttr("tabindex","0"),this.adapter.setSelectAnchorAttr("aria-disabled",this.disabled.toString())},n.prototype.openMenu=function(){this.adapter.addClass(c$.ACTIVATED),this.adapter.openMenu(),this.isMenuOpen=!0,this.adapter.setSelectAnchorAttr("aria-expanded","true")},n.prototype.setHelperTextContent=function(t){this.helperText&&this.helperText.setContent(t)},n.prototype.layout=function(){if(this.adapter.hasLabel()){var t=this.getValue().length>0,n=this.adapter.hasClass(c$.FOCUSED),i=t||n,r=this.adapter.hasClass(c$.REQUIRED);this.notchOutline(i),this.adapter.floatLabel(i),this.adapter.setLabelRequired(r)}},n.prototype.layoutOptions=function(){var t=this.adapter.getMenuItemValues().indexOf(this.getValue());this.setSelectedIndex(t,!1,!0)},n.prototype.handleMenuOpened=function(){if(0!==this.adapter.getMenuItemValues().length){var t=this.getSelectedIndex();this.adapter.focusMenuItemAtIndex(t>=0?t:0)}},n.prototype.handleMenuClosed=function(){this.adapter.removeClass(c$.ACTIVATED),this.isMenuOpen=!1,this.adapter.setSelectAnchorAttr("aria-expanded","false"),this.adapter.isSelectAnchorFocused()||this.blur()},n.prototype.handleChange=function(){this.layout(),this.adapter.notifyChange(this.getValue()),this.adapter.hasClass(c$.REQUIRED)&&this.useDefaultValidation&&this.setValid(this.isValid())},n.prototype.handleMenuItemAction=function(t){this.setSelectedIndex(t,!0)},n.prototype.handleFocus=function(){this.adapter.addClass(c$.FOCUSED),this.layout(),this.adapter.activateBottomLine()},n.prototype.handleBlur=function(){this.isMenuOpen||this.blur()},n.prototype.handleClick=function(t){if(!this.disabled&&!this.recentlyClicked){if(this.setClickDebounceTimeout(),this.isMenuOpen)return void this.adapter.closeMenu();this.adapter.setRippleCenter(t),this.openMenu()}},n.prototype.handleKeydown=function(t){if(!this.isMenuOpen&&this.adapter.hasClass(c$.FOCUSED)){var n=cD(t)===cg,i=cD(t)===c_,r=cD(t)===cF,o=cD(t)===cE;if(!i&&t.key&&1===t.key.length||i&&this.adapter.isTypeaheadInProgress()){var a=i?" ":t.key,s=this.adapter.typeaheadMatchItem(a,this.getSelectedIndex());s>=0&&this.setSelectedIndex(s),t.preventDefault();return}(n||i||r||o)&&(r&&this.getSelectedIndex()>0?this.setSelectedIndex(this.getSelectedIndex()-1):o&&this.getSelectedIndex()<this.adapter.getMenuItemCount()-1&&this.setSelectedIndex(this.getSelectedIndex()+1),this.openMenu(),t.preventDefault())}},n.prototype.notchOutline=function(t){if(this.adapter.hasOutline()){var n=this.adapter.hasClass(c$.FOCUSED);if(t){var i=cX.LABEL_SCALE,r=this.adapter.getLabelWidth()*i;this.adapter.notchOutline(r)}else n||this.adapter.closeOutline()}},n.prototype.setLeadingIconAriaLabel=function(t){this.leadingIcon&&this.leadingIcon.setAriaLabel(t)},n.prototype.setLeadingIconContent=function(t){this.leadingIcon&&this.leadingIcon.setContent(t)},n.prototype.setUseDefaultValidation=function(t){this.useDefaultValidation=t},n.prototype.setValid=function(t){this.useDefaultValidation||(this.customValidity=t),this.adapter.setSelectAnchorAttr("aria-invalid",(!t).toString()),t?(this.adapter.removeClass(c$.INVALID),this.adapter.removeMenuClass(c$.MENU_INVALID)):(this.adapter.addClass(c$.INVALID),this.adapter.addMenuClass(c$.MENU_INVALID)),this.syncHelperTextValidity(t)},n.prototype.isValid=function(){return this.useDefaultValidation&&this.adapter.hasClass(c$.REQUIRED)&&!this.adapter.hasClass(c$.DISABLED)?this.getSelectedIndex()!==cX.UNSET_INDEX&&(0!==this.getSelectedIndex()||!!this.getValue()):this.customValidity},n.prototype.setRequired=function(t){t?this.adapter.addClass(c$.REQUIRED):this.adapter.removeClass(c$.REQUIRED),this.adapter.setSelectAnchorAttr("aria-required",t.toString()),this.adapter.setLabelRequired(t)},n.prototype.getRequired=function(){return"true"===this.adapter.getSelectAnchorAttr("aria-required")},n.prototype.init=function(){var t=this.adapter.getAnchorElement();t&&(this.adapter.setMenuAnchorElement(t),this.adapter.setMenuAnchorCorner(tz.BOTTOM_START)),this.adapter.setMenuWrapFocus(!1),this.setDisabled(this.adapter.hasClass(c$.DISABLED)),this.syncHelperTextValidity(!this.adapter.hasClass(c$.INVALID)),this.layout(),this.layoutOptions()},n.prototype.blur=function(){this.adapter.removeClass(c$.FOCUSED),this.layout(),this.adapter.deactivateBottomLine(),this.adapter.hasClass(c$.REQUIRED)&&this.useDefaultValidation&&this.setValid(this.isValid())},n.prototype.syncHelperTextValidity=function(t){if(this.helperText){this.helperText.setValidity(t);var n=this.helperText.isVisible(),i=this.helperText.getId();n&&i?this.adapter.setSelectAnchorAttr(cW.ARIA_DESCRIBEDBY,i):this.adapter.removeSelectAnchorAttr(cW.ARIA_DESCRIBEDBY)}},n.prototype.setClickDebounceTimeout=function(){var t=this;clearTimeout(this.clickDebounceTimeout),this.clickDebounceTimeout=setTimeout(function(){t.recentlyClicked=!1},cX.CLICK_DEBOUNCE_TIMEOUT_MS),this.recentlyClicked=!0},n}(s9),cK={ARIA_HIDDEN:"aria-hidden",ROLE:"role"},cJ={HELPER_TEXT_VALIDATION_MSG:"mdc-select-helper-text--validation-msg",HELPER_TEXT_VALIDATION_MSG_PERSISTENT:"mdc-select-helper-text--validation-msg-persistent"},cQ=function(t){function n(i){return t.call(this,s6(s6({},n.defaultAdapter),i))||this}return s4(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return cJ},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return cK},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setAttr:function(){},getAttr:function(){return null},removeAttr:function(){},setContent:function(){}}},enumerable:!0,configurable:!0}),n.prototype.getId=function(){return this.adapter.getAttr("id")},n.prototype.isVisible=function(){return"true"!==this.adapter.getAttr(cK.ARIA_HIDDEN)},n.prototype.setContent=function(t){this.adapter.setContent(t)},n.prototype.setValidation=function(t){t?this.adapter.addClass(cJ.HELPER_TEXT_VALIDATION_MSG):this.adapter.removeClass(cJ.HELPER_TEXT_VALIDATION_MSG)},n.prototype.setValidationMsgPersistent=function(t){t?this.adapter.addClass(cJ.HELPER_TEXT_VALIDATION_MSG_PERSISTENT):this.adapter.removeClass(cJ.HELPER_TEXT_VALIDATION_MSG_PERSISTENT)},n.prototype.setValidity=function(t){if(this.adapter.hasClass(cJ.HELPER_TEXT_VALIDATION_MSG)){var n=this.adapter.hasClass(cJ.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);if(!t||n){this.showToScreenReader(),t?this.adapter.removeAttr(cK.ROLE):this.adapter.setAttr(cK.ROLE,"alert");return}this.adapter.removeAttr(cK.ROLE),this.hide()}},n.prototype.showToScreenReader=function(){this.adapter.removeAttr(cK.ARIA_HIDDEN)},n.prototype.hide=function(){this.adapter.setAttr(cK.ARIA_HIDDEN,"true")},n}(s9),c0=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return s4(n,t),n.attachTo=function(t){return new n(t)},Object.defineProperty(n.prototype,"foundationForSelect",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),n.prototype.getDefaultFoundation=function(){var t=this;return new cQ({addClass:function(n){return t.root.classList.add(n)},removeClass:function(n){return t.root.classList.remove(n)},hasClass:function(n){return t.root.classList.contains(n)},getAttr:function(n){return t.root.getAttribute(n)},setAttr:function(n,i){return t.root.setAttribute(n,i)},removeAttr:function(n){return t.root.removeAttribute(n)},setContent:function(n){t.root.textContent=n}})},n}(le),c1={ICON_EVENT:"MDCSelect:icon",ICON_ROLE:"button"},c2=["click","keydown"],c5=function(t){function n(i){var r=t.call(this,s6(s6({},n.defaultAdapter),i))||this;return r.savedTabIndex_=null,r.interactionHandler_=function(t){return r.handleInteraction(t)},r}return s4(n,t),Object.defineProperty(n,"strings",{get:function(){return c1},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},notifyIconAction:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){var t=this;this.savedTabIndex_=this.adapter.getAttr("tabindex"),c2.forEach(function(n){t.adapter.registerInteractionHandler(n,t.interactionHandler_)})},n.prototype.destroy=function(){var t=this;c2.forEach(function(n){t.adapter.deregisterInteractionHandler(n,t.interactionHandler_)})},n.prototype.setDisabled=function(t){this.savedTabIndex_&&(t?(this.adapter.setAttr("tabindex","-1"),this.adapter.removeAttr("role")):(this.adapter.setAttr("tabindex",this.savedTabIndex_),this.adapter.setAttr("role",c1.ICON_ROLE)))},n.prototype.setAriaLabel=function(t){this.adapter.setAttr("aria-label",t)},n.prototype.setContent=function(t){this.adapter.setContent(t)},n.prototype.handleInteraction=function(t){var n="Enter"===t.key||13===t.keyCode;("click"===t.type||n)&&this.adapter.notifyIconAction()},n}(s9),c3=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return s4(n,t),n.attachTo=function(t){return new n(t)},Object.defineProperty(n.prototype,"foundationForSelect",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),n.prototype.getDefaultFoundation=function(){var t=this;return new c5({getAttr:function(n){return t.root.getAttribute(n)},setAttr:function(n,i){return t.root.setAttribute(n,i)},removeAttr:function(n){return t.root.removeAttribute(n)},setContent:function(n){t.root.textContent=n},registerInteractionHandler:function(n,i){return t.listen(n,i)},deregisterInteractionHandler:function(n,i){return t.unlisten(n,i)},notifyIconAction:function(){return t.emit(c5.strings.ICON_EVENT,{},!0)}})},n}(le),c4=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return s4(n,t),n.attachTo=function(t){return new n(t)},n.prototype.initialize=function(t,n,i,r,o,a){if(void 0===t&&(t=function(t){return new la(t)}),void 0===n&&(n=function(t){return new lc(t)}),void 0===i&&(i=function(t){return new lp(t)}),void 0===r&&(r=function(t){return new cG(t)}),void 0===o&&(o=function(t){return new c3(t)}),void 0===a&&(a=function(t){return new c0(t)}),this.selectAnchor=this.root.querySelector(cW.SELECT_ANCHOR_SELECTOR),this.selectedText=this.root.querySelector(cW.SELECTED_TEXT_SELECTOR),this.hiddenInput=this.root.querySelector(cW.HIDDEN_INPUT_SELECTOR),!this.selectedText)throw Error("MDCSelect: Missing required element: The following selector must be present: '"+cW.SELECTED_TEXT_SELECTOR+"'");if(this.selectAnchor.hasAttribute(cW.ARIA_CONTROLS)){var s=document.getElementById(this.selectAnchor.getAttribute(cW.ARIA_CONTROLS));s&&(this.helperText=a(s))}this.menuSetup(r);var l=this.root.querySelector(cW.LABEL_SELECTOR);this.label=l?t(l):null;var c=this.root.querySelector(cW.LINE_RIPPLE_SELECTOR);this.lineRipple=c?n(c):null;var d=this.root.querySelector(cW.OUTLINE_SELECTOR);this.outline=d?i(d):null;var u=this.root.querySelector(cW.LEADING_ICON_SELECTOR);u&&(this.leadingIcon=o(u)),this.root.classList.contains(c$.OUTLINED)||(this.ripple=this.createRipple())},n.prototype.initialSyncWithDOM=function(){var t=this;if(this.handleFocus=function(){t.foundation.handleFocus()},this.handleBlur=function(){t.foundation.handleBlur()},this.handleClick=function(n){t.selectAnchor.focus(),t.foundation.handleClick(t.getNormalizedXCoordinate(n))},this.handleKeydown=function(n){t.foundation.handleKeydown(n)},this.handleMenuItemAction=function(n){t.foundation.handleMenuItemAction(n.detail.index)},this.handleMenuOpened=function(){t.foundation.handleMenuOpened()},this.handleMenuClosed=function(){t.foundation.handleMenuClosed()},this.selectAnchor.addEventListener("focus",this.handleFocus),this.selectAnchor.addEventListener("blur",this.handleBlur),this.selectAnchor.addEventListener("click",this.handleClick),this.selectAnchor.addEventListener("keydown",this.handleKeydown),this.menu.listen(cu.CLOSED_EVENT,this.handleMenuClosed),this.menu.listen(cu.OPENED_EVENT,this.handleMenuOpened),this.menu.listen(cU.SELECTED_EVENT,this.handleMenuItemAction),this.hiddenInput){if(this.hiddenInput.value){this.foundation.setValue(this.hiddenInput.value,!0),this.foundation.layout();return}this.hiddenInput.value=this.value}},n.prototype.destroy=function(){this.selectAnchor.removeEventListener("focus",this.handleFocus),this.selectAnchor.removeEventListener("blur",this.handleBlur),this.selectAnchor.removeEventListener("keydown",this.handleKeydown),this.selectAnchor.removeEventListener("click",this.handleClick),this.menu.unlisten(cu.CLOSED_EVENT,this.handleMenuClosed),this.menu.unlisten(cu.OPENED_EVENT,this.handleMenuOpened),this.menu.unlisten(cU.SELECTED_EVENT,this.handleMenuItemAction),this.menu.destroy(),this.ripple&&this.ripple.destroy(),this.outline&&this.outline.destroy(),this.leadingIcon&&this.leadingIcon.destroy(),this.helperText&&this.helperText.destroy(),t.prototype.destroy.call(this)},Object.defineProperty(n.prototype,"value",{get:function(){return this.foundation.getValue()},set:function(t){this.foundation.setValue(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(t){this.foundation.setSelectedIndex(t,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"disabled",{get:function(){return this.foundation.getDisabled()},set:function(t){this.foundation.setDisabled(t),this.hiddenInput&&(this.hiddenInput.disabled=t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"leadingIconAriaLabel",{set:function(t){this.foundation.setLeadingIconAriaLabel(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"leadingIconContent",{set:function(t){this.foundation.setLeadingIconContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"helperTextContent",{set:function(t){this.foundation.setHelperTextContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"useDefaultValidation",{set:function(t){this.foundation.setUseDefaultValidation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"valid",{get:function(){return this.foundation.isValid()},set:function(t){this.foundation.setValid(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"required",{get:function(){return this.foundation.getRequired()},set:function(t){this.foundation.setRequired(t)},enumerable:!0,configurable:!0}),n.prototype.layout=function(){this.foundation.layout()},n.prototype.layoutOptions=function(){this.foundation.layoutOptions(),this.menu.layout(),this.menuItemValues=this.menu.items.map(function(t){return t.getAttribute(cW.VALUE_ATTR)||""}),this.hiddenInput&&(this.hiddenInput.value=this.value)},n.prototype.getDefaultFoundation=function(){return new cZ(s6(s6(s6(s6({},this.getSelectAdapterMethods()),this.getCommonAdapterMethods()),this.getOutlineAdapterMethods()),this.getLabelAdapterMethods()),this.getFoundationMap())},n.prototype.menuSetup=function(t){this.menuElement=this.root.querySelector(cW.MENU_SELECTOR),this.menu=t(this.menuElement),this.menu.hasTypeahead=!0,this.menu.singleSelection=!0,this.menuItemValues=this.menu.items.map(function(t){return t.getAttribute(cW.VALUE_ATTR)||""})},n.prototype.createRipple=function(){var t=this,n=s6(s6({},lw.createAdapter({root:this.selectAnchor})),{registerInteractionHandler:function(n,i){t.selectAnchor.addEventListener(n,i)},deregisterInteractionHandler:function(n,i){t.selectAnchor.removeEventListener(n,i)}});return new lw(this.selectAnchor,new lx(n))},n.prototype.getSelectAdapterMethods=function(){var t=this;return{getMenuItemAttr:function(t,n){return t.getAttribute(n)},setSelectedText:function(n){t.selectedText.textContent=n},isSelectAnchorFocused:function(){return document.activeElement===t.selectAnchor},getSelectAnchorAttr:function(n){return t.selectAnchor.getAttribute(n)},setSelectAnchorAttr:function(n,i){t.selectAnchor.setAttribute(n,i)},removeSelectAnchorAttr:function(n){t.selectAnchor.removeAttribute(n)},addMenuClass:function(n){t.menuElement.classList.add(n)},removeMenuClass:function(n){t.menuElement.classList.remove(n)},openMenu:function(){t.menu.open=!0},closeMenu:function(){t.menu.open=!1},getAnchorElement:function(){return t.root.querySelector(cW.SELECT_ANCHOR_SELECTOR)},setMenuAnchorElement:function(n){t.menu.setAnchorElement(n)},setMenuAnchorCorner:function(n){t.menu.setAnchorCorner(n)},setMenuWrapFocus:function(n){t.menu.wrapFocus=n},getSelectedIndex:function(){var n=t.menu.selectedIndex;return n instanceof Array?n[0]:n},setSelectedIndex:function(n){t.menu.selectedIndex=n},focusMenuItemAtIndex:function(n){t.menu.items[n].focus()},getMenuItemCount:function(){return t.menu.items.length},getMenuItemValues:function(){return t.menuItemValues},getMenuItemTextAtIndex:function(n){return t.menu.getPrimaryTextAtIndex(n)},isTypeaheadInProgress:function(){return t.menu.typeaheadInProgress},typeaheadMatchItem:function(n,i){return t.menu.typeaheadMatchItem(n,i)}}},n.prototype.getCommonAdapterMethods=function(){var t=this;return{addClass:function(n){t.root.classList.add(n)},removeClass:function(n){t.root.classList.remove(n)},hasClass:function(n){return t.root.classList.contains(n)},setRippleCenter:function(n){t.lineRipple&&t.lineRipple.setRippleCenter(n)},activateBottomLine:function(){t.lineRipple&&t.lineRipple.activate()},deactivateBottomLine:function(){t.lineRipple&&t.lineRipple.deactivate()},notifyChange:function(n){var i=t.selectedIndex;t.emit(cW.CHANGE_EVENT,{value:n,index:i},!0),t.hiddenInput&&(t.hiddenInput.value=n)}}},n.prototype.getOutlineAdapterMethods=function(){var t=this;return{hasOutline:function(){return!!t.outline},notchOutline:function(n){t.outline&&t.outline.notch(n)},closeOutline:function(){t.outline&&t.outline.closeNotch()}}},n.prototype.getLabelAdapterMethods=function(){var t=this;return{hasLabel:function(){return!!t.label},floatLabel:function(n){t.label&&t.label.float(n)},getLabelWidth:function(){return t.label?t.label.getWidth():0},setLabelRequired:function(n){t.label&&t.label.setRequired(n)}}},n.prototype.getNormalizedXCoordinate=function(t){var n=t.target.getBoundingClientRect();return(this.isTouchEvent(t)?t.touches[0].clientX:t.clientX)-n.left},n.prototype.isTouchEvent=function(t){return!!t.touches},n.prototype.getFoundationMap=function(){return{helperText:this.helperText?this.helperText.foundationForSelect:void 0,leadingIcon:this.leadingIcon?this.leadingIcon.foundationForSelect:void 0}},n}(le),c6={ROOT:"mdc-form-field"},c8={LABEL_SELECTOR:".mdc-form-field > label"},c7=function(t){function n(i){var r=t.call(this,s6(s6({},n.defaultAdapter),i))||this;return r.click=function(){r.handleClick()},r}return s4(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return c6},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return c8},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{activateInputRipple:function(){},deactivateInputRipple:function(){},deregisterInteractionHandler:function(){},registerInteractionHandler:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){this.adapter.registerInteractionHandler("click",this.click)},n.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("click",this.click)},n.prototype.handleClick=function(){var t=this;this.adapter.activateInputRipple(),requestAnimationFrame(function(){t.adapter.deactivateInputRipple()})},n}(s9),c9=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return s4(n,t),n.attachTo=function(t){return new n(t)},n.prototype.labelEl=function(){var t=c7.strings.LABEL_SELECTOR;return this.root.querySelector(t)},n.prototype.getDefaultFoundation=function(){var t=this;return new c7({activateInputRipple:function(){t.input&&t.input.ripple&&t.input.ripple.activate()},deactivateInputRipple:function(){t.input&&t.input.ripple&&t.input.ripple.deactivate()},deregisterInteractionHandler:function(n,i){var r=t.labelEl();r&&r.removeEventListener(n,i)},registerInteractionHandler:function(n,i){var r=t.labelEl();r&&r.addEventListener(n,i)}})},n}(le),de={ICON_BUTTON_ON:"mdc-icon-button--on",ROOT:"mdc-icon-button"},dt={ARIA_LABEL:"aria-label",ARIA_PRESSED:"aria-pressed",DATA_ARIA_LABEL_OFF:"data-aria-label-off",DATA_ARIA_LABEL_ON:"data-aria-label-on",CHANGE_EVENT:"MDCIconButtonToggle:change"},dn=function(t){function n(i){var r=t.call(this,s6(s6({},n.defaultAdapter),i))||this;return r.hasToggledAriaLabel=!1,r}return s4(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return de},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return dt},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addClass:function(){},hasClass:function(){return!1},notifyChange:function(){},removeClass:function(){},getAttr:function(){return null},setAttr:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){var t=this.adapter.getAttr(dt.DATA_ARIA_LABEL_ON),n=this.adapter.getAttr(dt.DATA_ARIA_LABEL_OFF);if(t&&n){if(null!==this.adapter.getAttr(dt.ARIA_PRESSED))throw Error("MDCIconButtonToggleFoundation: Button should not set `aria-pressed` if it has a toggled aria label.");this.hasToggledAriaLabel=!0}else this.adapter.setAttr(dt.ARIA_PRESSED,String(this.isOn()))},n.prototype.handleClick=function(){this.toggle(),this.adapter.notifyChange({isOn:this.isOn()})},n.prototype.isOn=function(){return this.adapter.hasClass(de.ICON_BUTTON_ON)},n.prototype.toggle=function(t){if(void 0===t&&(t=!this.isOn()),t?this.adapter.addClass(de.ICON_BUTTON_ON):this.adapter.removeClass(de.ICON_BUTTON_ON),this.hasToggledAriaLabel){var n=t?this.adapter.getAttr(dt.DATA_ARIA_LABEL_ON):this.adapter.getAttr(dt.DATA_ARIA_LABEL_OFF);this.adapter.setAttr(dt.ARIA_LABEL,n||"")}else this.adapter.setAttr(dt.ARIA_PRESSED,""+t)},n}(s9),di=dn.strings,dr=function(t){function n(){var n=null!==t&&t.apply(this,arguments)||this;return n.rippleComponent=n.createRipple(),n}return s4(n,t),n.attachTo=function(t){return new n(t)},n.prototype.initialSyncWithDOM=function(){var t=this;this.handleClick=function(){t.foundation.handleClick()},this.listen("click",this.handleClick)},n.prototype.destroy=function(){this.unlisten("click",this.handleClick),this.ripple.destroy(),t.prototype.destroy.call(this)},n.prototype.getDefaultFoundation=function(){var t=this;return new dn({addClass:function(n){return t.root.classList.add(n)},hasClass:function(n){return t.root.classList.contains(n)},notifyChange:function(n){t.emit(di.CHANGE_EVENT,n)},removeClass:function(n){return t.root.classList.remove(n)},getAttr:function(n){return t.root.getAttribute(n)},setAttr:function(n,i){return t.root.setAttribute(n,i)}})},Object.defineProperty(n.prototype,"ripple",{get:function(){return this.rippleComponent},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"on",{get:function(){return this.foundation.isOn()},set:function(t){this.foundation.toggle(t)},enumerable:!0,configurable:!0}),n.prototype.createRipple=function(){var t=new lw(this.root);return t.unbounded=!0,t},n}(le);let da="important",ds=" !"+da,dl=aQ(class extends a0{constructor(t){if(super(t),1!==t.type||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((n,i)=>{let r=t[i];return null==r?n:n+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(t,[n]){let{style:i}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(n)),this.render(n);for(let t of this.ft)null==n[t]&&(this.ft.delete(t),t.includes("-")?i.removeProperty(t):i[t]=null);for(let t in n){let r=n[t];if(null!=r){this.ft.add(t);let n="string"==typeof r&&r.endsWith(ds);t.includes("-")||n?i.setProperty(t,n?r.slice(0,-11):r,n?da:""):i[t]=r}}return aP}}),dc=t=>n=>class extends n{constructor(){super(...arguments),this._i18nextJustInitialized=!1,this._language=t.language,this.initCallback=t=>{this._i18nextJustInitialized=!0,this.requestUpdate&&this.requestUpdate()},this.langChangedCallback=()=>{this.requestUpdate&&(this._language=t.language,this.requestUpdate("_language"))}}connectedCallback(){t.language||t.on("initialized",this.initCallback),t.on("languageChanged",this.langChangedCallback),super.connectedCallback&&super.connectedCallback()}disconnectedCallback(){t.off("initialized",this.initCallback),t.off("languageChanged",this.langChangedCallback),super.disconnectedCallback&&super.disconnectedCallback()}shouldUpdate(t){return this._i18nextJustInitialized?(this._i18nextJustInitialized=!1,!0):super.shouldUpdate&&super.shouldUpdate(t)}};var dd=function(t,n,i,r){var o,a=arguments.length,s=a<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,n,i,r);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(s=(a<3?o(s):a>3?o(n,i,s):o(n,i))||s);return a>3&&s&&Object.defineProperty(n,i,s),s};let du=class extends dc(nj)(aK){render(){return aL`
501
481
  ${this._getTranslatedValue()}
502
- `}_getTranslatedValue(){return this.value?nj.isInitialized?nj.t(this.value,this.options):this.value:""}};dx.styles=o4`
482
+ `}_getTranslatedValue(){return this.value?nj.isInitialized?nj.t(this.value,this.options):this.value:""}};du.styles=o4`
503
483
  :host {
504
484
  display: inline-block;
505
485
  }
@@ -507,11 +487,11 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
507
487
  :host([hidden]) {
508
488
  display: none;
509
489
  }
510
- `,dv([a6({type:String})],dx.prototype,"value",void 0),dv([a6({type:Object})],dx.prototype,"options",void 0),dx=dv([a3("or-translate")],dx);var dw=function(t,n,i,r){var o,a=arguments.length,s=a<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,n,i,r);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(s=(a<3?o(s):a>3?o(n,i,s):o(n,i))||s);return a>3&&s&&Object.defineProperty(n,i,s),s};let dF=o(6612),dk=o(9188);class dE extends CustomEvent{constructor(t){super(dE.NAME,{detail:t,bubbles:!0,composed:!0})}}function dT(t,n,i,r,o){switch(r=r||"listbox",t){case tj.RADIO:r="radiogroup";break;case tj.MULTI_CHECKBOX:r="group"}return aL`
490
+ `,dd([a6({type:String})],du.prototype,"value",void 0),dd([a6({type:Object})],du.prototype,"options",void 0),du=dd([a3("or-translate")],du);var dm=function(t,n,i,r){var o,a=arguments.length,s=a<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,n,i,r);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(s=(a<3?o(s):a>3?o(n,i,s):o(n,i))||s);return a>3&&s&&Object.defineProperty(n,i,s),s};let dh=o(6612),dp=o(9188);class df extends CustomEvent{constructor(t){super(df.NAME,{detail:t,bubbles:!0,composed:!0})}}function db(t,n,i,r,o){switch(r=r||"listbox",t){case tj.RADIO:r="radiogroup";break;case tj.MULTI_CHECKBOX:r="group"}return aL`
511
491
  <ul id="list" class="mdc-list${i?" mdc-list--two-line":""}" role="${r??aO}" @MDCList:action="${t=>o&&o(t)}" aria-hidden="true" aria-orientation="vertical" tabindex="-1">
512
492
  ${n}
513
493
  </ul>
514
- `}function dM(t,n,i,r,o,a){let s,l,c;if(null===t)return aL`<li role="separator" class="mdc-list-divider"></li>`;let d=r===tj.MULTI_CHECKBOX||r===tj.MULTI_TICK,u=t.value,m=r!==tj.PLAIN&&i.length>0&&i.some(t=>t===u),h=void 0!==t.text?t.text:t.value,p=t.secondaryText,f="menuitem",b="",g="",_="",y=t.icon,v="mdc-list-item--selected";switch(o=o||t.translate,d&&r===tj.MULTI_TICK&&(y=m?"checkbox-marked":"checkbox-blank-outline"),(r===tj.MULTI_TICK||y)&&(g=aL`
494
+ `}function dg(t,n,i,r,o,a){let s,l,c;if(null===t)return aL`<li role="separator" class="mdc-list-divider"></li>`;let d=r===tj.MULTI_CHECKBOX||r===tj.MULTI_TICK,u=t.value,m=r!==tj.PLAIN&&i.length>0&&i.some(t=>t===u),h=void 0!==t.text?t.text:t.value,p=t.secondaryText,f="menuitem",b="",g="",_="",y=t.icon,v="mdc-list-item--selected";switch(o=o||t.translate,d&&r===tj.MULTI_TICK&&(y=m?"checkbox-marked":"checkbox-blank-outline"),(r===tj.MULTI_TICK||y)&&(g=aL`
515
495
  <span class="mdc-list-item__graphic">
516
496
  <or-icon icon="${y}"></or-icon>
517
497
  </span>
@@ -545,13 +525,13 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
545
525
  <span class="mdc-list-item__secondary-text">${o&&p?aL`<or-translate value="${p}"></or-translate>`:p}</span>
546
526
  </span>
547
527
  `:r===tj.RADIO?aL`<label class="mdc-list-item__text" for="radio-item-${n+1}">${o&&h?aL`<or-translate value="${h}"></or-translate>`:h}</label>`:aL`<span class="mdc-list-item__text" title="${o&&h?nj.t(h):h}">${o&&h?aL`<or-translate value="${h}"></or-translate>`:h}</span>`),aL`
548
- <li @click="${n=>{a&&a(n,t)}}" style="${t.styleMap?d_(t.styleMap):""}" class="mdc-list-item ${m?v:""}" role="${f??aO}" tabindex="${c??aO}" aria-checked="${l??aO}" aria-selected="${s??aO}" data-value="${u}">
528
+ <li @click="${n=>{a&&a(n,t)}}" style="${t.styleMap?dl(t.styleMap):""}" class="mdc-list-item ${m?v:""}" role="${f??aO}" tabindex="${c??aO}" aria-checked="${l??aO}" aria-selected="${s??aO}" data-value="${u}">
549
529
  <span class="mdc-list-item__ripple"></span>
550
530
  ${g}
551
531
  ${b}
552
532
  ${_}
553
533
  </li>
554
- `}dE.NAME="or-mwc-list-changed",(eM=tj||(tj={})).PLAIN="PLAIN",eM.SELECT="SELECT",eM.RADIO="RADIO",eM.MULTI_CHECKBOX="MULTI_CHECKBOX",eM.MULTI_TICK="MULTI_TICK";let dA=o4`
534
+ `}df.NAME="or-mwc-list-changed",(eM=tj||(tj={})).PLAIN="PLAIN",eM.SELECT="SELECT",eM.RADIO="RADIO",eM.MULTI_CHECKBOX="MULTI_CHECKBOX",eM.MULTI_TICK="MULTI_TICK";let d_=o4`
555
535
  :host {
556
536
  white-space: nowrap;
557
537
  --internal-or-mwc-input-color: var(--or-mwc-input-color, var(--or-app-color4, ${o3(su)}));
@@ -570,7 +550,7 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
570
550
  text-decoration: none;
571
551
  color: rgba(0, 0, 0, 0.87);
572
552
  }
573
- `,dC=class extends aK{static get styles(){return[o4`${o3(dF)}`,o4`${o3(dk)}`,dA]}constructor(){super(),this.type=tj.SELECT}disconnectedCallback(){super.disconnectedCallback(),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0)}shouldUpdate(t){if(this._mdcComponent&&t.has("values")&&!n$(this.values,t.get("values"))){let t=this.values?Array.isArray(this.values)?this.values:[this.values]:[];this.setSelectedItems(this.values&&this.listItems?this.listItems.filter(n=>n&&(null==t?void 0:t.includes(n.value))):void 0)}return!0}render(){let t=this.listItems?aL`${this.listItems.map((t,n)=>dM(t,n,Array.isArray(this.values)?this.values:this.values?[this.values]:[],this.type))}`:aL``,n=this.listItems&&this.listItems.some(t=>t&&!!t.secondaryText);return dT(this.type,t,n,void 0,t=>this._onSelected(t))}firstUpdated(t){super.firstUpdated(t),this._mdcElem&&(this._mdcComponent=new cX(this._mdcElem),(this.type===tj.SELECT||this.type===tj.RADIO)&&(this._mdcComponent.singleSelection=!0))}get selectedItems(){if(!this._mdcComponent)return[];let t=Array.isArray(this._mdcComponent.selectedIndex)?this._mdcComponent.selectedIndex:[this._mdcComponent.selectedIndex],n=this.listItems?this.listItems.filter(t=>null!==t):[];return t.map(t=>n[t])}setSelectedItems(t){if(!this._mdcComponent||!this.listItems)return;if(!t){this._mdcComponent.selectedIndex=-1;return}let n=(!Array.isArray(t)?[t]:t).map(t=>"string"==typeof t?t:t.value),i=this.listItems.filter(t=>null!==t).reduce((t,i,r)=>(i&&n.includes(i.value)&&t.push(r),t),[]);this._mdcComponent.selectedIndex=this.type===tj.MULTI_CHECKBOX?i:i.length>=1?i[0]:-1}_onSelected(t){this.values=this.selectedItems.map(t=>t.value),t.stopPropagation(),this.dispatchEvent(new dE(this.selectedItems))}};dw([a6({type:Array})],dC.prototype,"listItems",void 0),dw([a6({type:Array})],dC.prototype,"values",void 0),dw([a6({type:String,attribute:!0})],dC.prototype,"type",void 0),dw([a9("#wrapper")],dC.prototype,"_wrapperElem",void 0),dw([a9("#list")],dC.prototype,"_mdcElem",void 0),dC=dw([a3("or-mwc-list")],dC);var dS=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},dD=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 dL=o(9028),dI=o(4702),dP=o(3168),dO=o(914),dR=o(104),dB=o(5618),dz=o(7788),dY=o(5360),dN=o(9188),dj=o(814),dH=o(1324),dU=o(3512),dV=o(6612),dq=o(5724),dG=o(7015),d$=o(376);class dW extends CustomEvent{constructor(t,n,i){super(dW.NAME,{detail:{value:t,previousValue:n,enterPressed:i},bubbles:!0,composed:!0})}}dW.NAME="or-mwc-input-changed",(eA=tH||(tH={})).BUTTON="button",eA.BUTTON_TOGGLE="button-toggle",eA.BUTTON_MOMENTARY="button-momentary",eA.CHECKBOX="checkbox",eA.CHECKBOX_LIST="checkbox-list",eA.COLOUR="color",eA.DATE="date",eA.DATETIME="datetime-local",eA.EMAIL="email",eA.JSON="json",eA.JSON_OBJECT="json-object",eA.MONTH="month",eA.NUMBER="number",eA.BIG_INT="big-int",eA.PASSWORD="password",eA.RADIO="radio",eA.SWITCH="switch",eA.RANGE="range",eA.TELEPHONE="tel",eA.TEXT="text",eA.TEXTAREA="textarea",eA.TIME="time",eA.URL="url",eA.WEEK="week",eA.SELECT="select",eA.LIST="list",eA.CRON="cron",eA.DURATION="duration",eA.DURATION_TIME="duration-time",eA.DURATION_PERIOD="duration-period";let dX=o4`
553
+ `,dy=class extends aK{static get styles(){return[o4`${o3(dh)}`,o4`${o3(dp)}`,d_]}constructor(){super(),this.type=tj.SELECT}disconnectedCallback(){super.disconnectedCallback(),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0)}shouldUpdate(t){if(this._mdcComponent&&t.has("values")&&!n$(this.values,t.get("values"))){let t=this.values?Array.isArray(this.values)?this.values:[this.values]:[];this.setSelectedItems(this.values&&this.listItems?this.listItems.filter(n=>n&&(null==t?void 0:t.includes(n.value))):void 0)}return!0}render(){let t=this.listItems?aL`${this.listItems.map((t,n)=>dg(t,n,Array.isArray(this.values)?this.values:this.values?[this.values]:[],this.type))}`:aL``,n=this.listItems&&this.listItems.some(t=>t&&!!t.secondaryText);return db(this.type,t,n,void 0,t=>this._onSelected(t))}firstUpdated(t){super.firstUpdated(t),this._mdcElem&&(this._mdcComponent=new cY(this._mdcElem),(this.type===tj.SELECT||this.type===tj.RADIO)&&(this._mdcComponent.singleSelection=!0))}get selectedItems(){if(!this._mdcComponent)return[];let t=Array.isArray(this._mdcComponent.selectedIndex)?this._mdcComponent.selectedIndex:[this._mdcComponent.selectedIndex],n=this.listItems?this.listItems.filter(t=>null!==t):[];return t.map(t=>n[t])}setSelectedItems(t){if(!this._mdcComponent||!this.listItems)return;if(!t){this._mdcComponent.selectedIndex=-1;return}let n=(!Array.isArray(t)?[t]:t).map(t=>"string"==typeof t?t:t.value),i=this.listItems.filter(t=>null!==t).reduce((t,i,r)=>(i&&n.includes(i.value)&&t.push(r),t),[]);this._mdcComponent.selectedIndex=this.type===tj.MULTI_CHECKBOX?i:i.length>=1?i[0]:-1}_onSelected(t){this.values=this.selectedItems.map(t=>t.value),t.stopPropagation(),this.dispatchEvent(new df(this.selectedItems))}};dm([a6({type:Array})],dy.prototype,"listItems",void 0),dm([a6({type:Array})],dy.prototype,"values",void 0),dm([a6({type:String,attribute:!0})],dy.prototype,"type",void 0),dm([a9("#wrapper")],dy.prototype,"_wrapperElem",void 0),dm([a9("#list")],dy.prototype,"_mdcElem",void 0),dy=dm([a3("or-mwc-list")],dy);var dv=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},dx=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 dw=o(9028),dF=o(4702),dk=o(3168),dE=o(914),dT=o(104),dM=o(5618),dA=o(7788),dC=o(5360),dS=o(9188),dD=o(814),dL=o(1324),dI=o(3512),dP=o(6612),dO=o(5724),dR=o(7015),dB=o(376);class dz extends CustomEvent{constructor(t,n,i){super(dz.NAME,{detail:{value:t,previousValue:n,enterPressed:i},bubbles:!0,composed:!0})}}dz.NAME="or-mwc-input-changed",(eA=tH||(tH={})).BUTTON="button",eA.BUTTON_TOGGLE="button-toggle",eA.BUTTON_MOMENTARY="button-momentary",eA.CHECKBOX="checkbox",eA.CHECKBOX_LIST="checkbox-list",eA.COLOUR="color",eA.DATE="date",eA.DATETIME="datetime-local",eA.EMAIL="email",eA.JSON="json",eA.JSON_OBJECT="json-object",eA.MONTH="month",eA.NUMBER="number",eA.BIG_INT="big-int",eA.PASSWORD="password",eA.RADIO="radio",eA.SWITCH="switch",eA.RANGE="range",eA.TELEPHONE="tel",eA.TEXT="text",eA.TEXTAREA="textarea",eA.TIME="time",eA.URL="url",eA.WEEK="week",eA.SELECT="select",eA.LIST="list",eA.CRON="cron",eA.DURATION="duration",eA.DURATION_TIME="duration-time",eA.DURATION_PERIOD="duration-period";let dY=o4`
574
554
 
575
555
  :host {
576
556
  display: inline-block;
@@ -771,7 +751,7 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
771
751
  .mdc-list-item__graphic > or-icon {
772
752
  pointer-events: none;
773
753
  }
774
- `,dZ=class extends aK{constructor(){super(...arguments),this.readonly=!1,this.required=!1,this.checked=!1,this.indeterminate=!1,this.multiple=!1,this.searchLabel="search",this.compact=!1,this.comfortable=!1,this.raised=!1,this.action=!1,this.unElevated=!1,this.outlined=!1,this.rounded=!1,this.disableSliderNumberInput=!1,this.fullWidth=!1,this.helperPersistent=!1,this.autoValidate=!1,this.charCounter=!1,this.disabled=!1,this.continuous=!1,this.resizeVertical=!1,this.censored=!1,this.advertised=!1,this._selectedIndex=-1,this.isUiValid=!0}static get styles(){return[o4`${o3(dP)}`,o4`${o3(dL)}`,o4`${o3(dI)}`,o4`${o3(dO)}`,o4`${o3(dR)}`,o4`${o3(dB)}`,o4`${o3(dz)}`,o4`${o3(dY)}`,o4`${o3(dN)}`,o4`${o3(dj)}`,o4`${o3(dH)}`,o4`${o3(dU)}`,o4`${o3(dV)}`,o4`${o3(dG)}`,o4`${o3(dq)}`,o4`${o3(d$)}`,dX]}get nativeValue(){if(this._mdcComponent)return this._mdcComponent.value}disconnectedCallback(){var t,n;super.disconnectedCallback(),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0,null==(t=this._menuObserver)||t.disconnect()),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0,null==(n=this._menuObserver)||n.disconnect())}shouldUpdate(t){return t.has("indeterminate")&&this._mdcComponent&&this.type===tH.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),t.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===tH.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),t.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===tH.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=tH.DATETIME:"boolean"==typeof this.value?this.type=tH.CHECKBOX:"number"==typeof this.value?this.type=tH.NUMBER:"string"==typeof this.value?this.type=tH.TEXT:this.type=tH.JSON),!0}focus(){this.type===tH.RANGE&&this._mdcComponent2&&"function"==typeof this._mdcComponent2.focus?this._mdcComponent2.focus():this._mdcComponent&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}render(){if(this.type){let a=!this.fullWidth&&this.label,s=!this.fullWidth&&this.outlined,l=!!this.helperText,c=!this.isUiValid&&(!!this.errorMessage||!!this.validationMessage),d={"mdc-text-field-helper-text--persistent":!c&&this.helperPersistent,"mdc-text-field-helper-text--validation-msg":c},u=null!==this.value&&void 0!==this.value||!1===this.value,m=a?aL`<span class="mdc-floating-label ${u?"mdc-floating-label--float-above":""}" id="label">${this.label}</span>`:void 0;switch(this.type){case tH.RADIO:let h=this.resolveOptions(this.options);return aL`
754
+ `,dN=class extends aK{constructor(){super(...arguments),this.readonly=!1,this.required=!1,this.checked=!1,this.indeterminate=!1,this.multiple=!1,this.searchLabel="search",this.compact=!1,this.comfortable=!1,this.raised=!1,this.action=!1,this.unElevated=!1,this.outlined=!1,this.rounded=!1,this.disableSliderNumberInput=!1,this.fullWidth=!1,this.helperPersistent=!1,this.autoValidate=!1,this.charCounter=!1,this.disabled=!1,this.continuous=!1,this.resizeVertical=!1,this.censored=!1,this.advertised=!1,this._selectedIndex=-1,this.isUiValid=!0}static get styles(){return[o4`${o3(dk)}`,o4`${o3(dw)}`,o4`${o3(dF)}`,o4`${o3(dE)}`,o4`${o3(dT)}`,o4`${o3(dM)}`,o4`${o3(dA)}`,o4`${o3(dC)}`,o4`${o3(dS)}`,o4`${o3(dD)}`,o4`${o3(dL)}`,o4`${o3(dI)}`,o4`${o3(dP)}`,o4`${o3(dR)}`,o4`${o3(dO)}`,o4`${o3(dB)}`,dY]}get nativeValue(){if(this._mdcComponent)return this._mdcComponent.value}disconnectedCallback(){var t,n;super.disconnectedCallback(),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0,null==(t=this._menuObserver)||t.disconnect()),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0,null==(n=this._menuObserver)||n.disconnect())}shouldUpdate(t){return t.has("indeterminate")&&this._mdcComponent&&this.type===tH.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),t.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===tH.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),t.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===tH.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=tH.DATETIME:"boolean"==typeof this.value?this.type=tH.CHECKBOX:"number"==typeof this.value?this.type=tH.NUMBER:"string"==typeof this.value?this.type=tH.TEXT:this.type=tH.JSON),!0}focus(){this.type===tH.RANGE&&this._mdcComponent2&&"function"==typeof this._mdcComponent2.focus?this._mdcComponent2.focus():this._mdcComponent&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}render(){if(this.type){let a=!this.fullWidth&&this.label,s=!this.fullWidth&&this.outlined,l=!!this.helperText,c=!this.isUiValid&&(!!this.errorMessage||!!this.validationMessage),d={"mdc-text-field-helper-text--persistent":!c&&this.helperPersistent,"mdc-text-field-helper-text--validation-msg":c},u=null!==this.value&&void 0!==this.value||!1===this.value,m=a?aL`<span class="mdc-floating-label ${u?"mdc-floating-label--float-above":""}" id="label">${this.label}</span>`:void 0;switch(this.type){case tH.RADIO:let h=this.resolveOptions(this.options);return aL`
775
755
  <div class="mdc-radio-container">
776
756
  ${h?h.map(([t,n])=>aL`
777
757
  <div id="field" class="mdc-form-field">
@@ -797,7 +777,7 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
797
777
  `;case tH.SWITCH:let p={"mdc-switch--disabled":this.disabled||this.readonly,"mdc-switch--full-width":this.fullWidth,"mdc-switch--checked":this.value};return aL`
798
778
  <span id="wrapper">
799
779
  ${this.label?aL`<label for="elem" class="${this.disabled?"mdc-switch--disabled":""}">${this.label}</label>`:""}
800
- <div id="component" class="mdc-switch ${s9(p)}">
780
+ <div id="component" class="mdc-switch ${sQ(p)}">
801
781
  <div class="mdc-switch__track"></div>
802
782
  <div class="mdc-switch__thumb-underlay">
803
783
  <div class="mdc-switch__thumb">
@@ -812,15 +792,15 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
812
792
  </div>
813
793
  </span>
814
794
  `;case tH.LIST:let f={"mdc-select--outlined":s,"mdc-select--disabled":this.disabled,"mdc-select--required":this.required,"mdc-select--dense":!1,"mdc-select--no-label":!this.label,"mdc-select--with-leading-icon":!!this.icon},b=this.resolveOptions(this.options);return this._selectedIndex=-1,aL`
815
- <div id="component" class="mdc-list mdc-select ${s9(f)}" @MDCList:action="${t=>this.onValueChange(void 0,-1===t.detail.index?void 0:Array.isArray(this.options[t.detail.index])?this.options[t.detail.index][0]:this.options[t.detail.index])}">
795
+ <div id="component" class="mdc-list mdc-select ${sQ(f)}" @MDCList:action="${t=>this.onValueChange(void 0,-1===t.detail.index?void 0:Array.isArray(this.options[t.detail.index])?this.options[t.detail.index][0]:this.options[t.detail.index])}">
816
796
  <ul class="mdc-list">
817
- ${b?b.map(([t,n],i)=>(this.value===t&&(this._selectedIndex=i),aL`<li class="${s9({"mdc-list-item":!0,"mdc-list-item--selected":this.value===t})}" role="option" data-value="${t}"><or-translate value="${n}"></or-translate></li>`)):""}
797
+ ${b?b.map(([t,n],i)=>(this.value===t&&(this._selectedIndex=i),aL`<li class="${sQ({"mdc-list-item":!0,"mdc-list-item--selected":this.value===t})}" role="option" data-value="${t}"><or-translate value="${n}"></or-translate></li>`)):""}
818
798
  </ul>
819
799
  </div>
820
- `;case tH.SELECT:var t,n,i,r,o;let g,_={"mdc-select--outlined":s,"mdc-select--filled":!s,"mdc-select--disabled":this.disabled||this.readonly,"mdc-select--required":this.required,"mdc-select--dense":!1,"dense-comfortable":this.comfortable,"mdc-select--no-label":!this.label,"mdc-select--with-leading-icon":!!this.icon,"or-mwc-input--rounded":this.rounded};g=void 0!=this.searchProvider?this.searchProvider(this.searchableValue):this.resolveOptions(this.options);let y=(t,n)=>{var i;let r=n.value;if(this.multiple){t.stopPropagation();let n=null!=(i=this._tempValue)?i:Array.isArray(this.value)?[...this.value]:void 0!==this.value?[this.value]:[],o=n.findIndex(t=>t===r);o>=0?n.splice(o,1):n.push(r);let a=t.composedPath()[0].closest("li"),s=a.getElementsByTagName("or-icon")[0];a&&(o>=0?a.classList.remove("mdc-list-item--selected"):a.classList.add("mdc-list-item--selected")),s&&(s.icon=o>=0?"checkbox-blank-outline":"checkbox-marked"),this._tempValue=n}else void 0==this.searchProvider&&Array.isArray(g)||this.onValueChange(void 0,n.value)},v=()=>{var t;let n=null!=(t=this._tempValue)?t:this.value;if(window.setTimeout(()=>{this._mdcComponent&&this._mdcComponent.foundation.adapter.floatLabel(n&&(!Array.isArray(n)||n.length>0))}),!this._tempValue)return;let i=[...this._tempValue];this._tempValue=void 0,this.onValueChange(void 0,i)},x=t=>void 0==this.searchProvider||t&&0!=t.length?dT(this.multiple?tj.MULTI_TICK:tj.SELECT,aL`${null==t?void 0:t.map(([t,n],i)=>dM({text:n,value:t},i,Array.isArray(this.value)?this.value:this.value?[this.value]:[],this.multiple?tj.MULTI_TICK:tj.SELECT,!1,y))}`,!1,void 0):aL`<span class="mdc-text-field-helper-line" style="margin: 8px 8px 8px 0;">${nj.t("noResults")}</span>`;return aL`
800
+ `;case tH.SELECT:var t,n,i,r,o;let g,_={"mdc-select--outlined":s,"mdc-select--filled":!s,"mdc-select--disabled":this.disabled||this.readonly,"mdc-select--required":this.required,"mdc-select--dense":!1,"dense-comfortable":this.comfortable,"mdc-select--no-label":!this.label,"mdc-select--with-leading-icon":!!this.icon,"or-mwc-input--rounded":this.rounded};g=void 0!=this.searchProvider?this.searchProvider(this.searchableValue):this.resolveOptions(this.options);let y=(t,n)=>{var i;let r=n.value;if(this.multiple){t.stopPropagation();let n=null!=(i=this._tempValue)?i:Array.isArray(this.value)?[...this.value]:void 0!==this.value?[this.value]:[],o=n.findIndex(t=>t===r);o>=0?n.splice(o,1):n.push(r);let a=t.composedPath()[0].closest("li"),s=a.getElementsByTagName("or-icon")[0];a&&(o>=0?a.classList.remove("mdc-list-item--selected"):a.classList.add("mdc-list-item--selected")),s&&(s.icon=o>=0?"checkbox-blank-outline":"checkbox-marked"),this._tempValue=n}else void 0==this.searchProvider&&Array.isArray(g)||this.onValueChange(void 0,n.value)},v=()=>{var t;let n=null!=(t=this._tempValue)?t:this.value;if(window.setTimeout(()=>{this._mdcComponent&&this._mdcComponent.foundation.adapter.floatLabel(n&&(!Array.isArray(n)||n.length>0))}),!this._tempValue)return;let i=[...this._tempValue];this._tempValue=void 0,this.onValueChange(void 0,i)},x=t=>void 0==this.searchProvider||t&&0!=t.length?db(this.multiple?tj.MULTI_TICK:tj.SELECT,aL`${null==t?void 0:t.map(([t,n],i)=>dg({text:n,value:t},i,Array.isArray(this.value)?this.value:this.value?[this.value]:[],this.multiple?tj.MULTI_TICK:tj.SELECT,!1,y))}`,!1,void 0):aL`<span class="mdc-text-field-helper-line" style="margin: 8px 8px 8px 0;">${nj.t("noResults")}</span>`;return aL`
821
801
  <div id="component"
822
- class="mdc-select ${s9(_)}"
823
- @MDCSelect:change="${t=>dD(this,void 0,void 0,function*(){let n=Array.isArray(g)?g:yield g;this.onValueChange(void 0,-1===t.detail.index?void 0:Array.isArray(n[t.detail.index])?n[t.detail.index][0]:n[t.detail.index])})}">
802
+ class="mdc-select ${sQ(_)}"
803
+ @MDCSelect:change="${t=>dx(this,void 0,void 0,function*(){let n=Array.isArray(g)?g:yield g;this.onValueChange(void 0,-1===t.detail.index?void 0:Array.isArray(n[t.detail.index])?n[t.detail.index][0]:n[t.detail.index])})}">
824
804
  <div class="mdc-select__anchor" role="button"
825
805
  aria-haspopup="listbox"
826
806
  aria-expanded="false"
@@ -862,10 +842,10 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
862
842
  />
863
843
  </label>
864
844
  `,t?n(t):void 0}
865
- ${i=Array.isArray(g),r=()=>x(g),o=()=>li(new Promise(t=>dD(this,void 0,void 0,function*(){t(x((yield g)))})),aL`<span class="mdc-text-field-helper-line" style="margin: 8px 8px 8px 0;">${nj.t("loading")}</span>`),i?r(i):o?.(i)}
845
+ ${i=Array.isArray(g),r=()=>x(g),o=()=>s5(new Promise(t=>dx(this,void 0,void 0,function*(){t(x((yield g)))})),aL`<span class="mdc-text-field-helper-line" style="margin: 8px 8px 8px 0;">${nj.t("loading")}</span>`),i?r(i):o?.(i)}
866
846
  </div>
867
847
  ${l||c?aL`
868
- <p id="component-helper-text" class="mdc-select-helper-text ${s9(d)}" aria-hidden="true">
848
+ <p id="component-helper-text" class="mdc-select-helper-text ${sQ(d)}" aria-hidden="true">
869
849
  ${c?this.errorMessage||this.validationMessage:this.helperText}
870
850
  </p>`:""}
871
851
  </div>
@@ -877,8 +857,8 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
877
857
  ${this.icon?aL`<or-icon class="mdc-icon-button__icon" aria-hidden="true" icon="${this.icon}"></or-icon>`:""}
878
858
  ${this.iconOn?aL`<or-icon class="mdc-icon-button__icon mdc-icon-button__icon--on" aria-hidden="true" icon="${this.iconOn}"></or-icon>`:""}
879
859
  </button>
880
- `;case tH.BUTTON:case tH.BUTTON_MOMENTARY:{let t=t=>{this.disabled&&t.stopPropagation(),r&&this.dispatchEvent(new dW(!0,null))},n=t=>{this.disabled&&t.stopPropagation(),r&&this.dispatchEvent(new dW(!1,!0))},i=t=>{this.disabled&&t.stopPropagation(),r||this.dispatchEvent(new dW(!0,null))},r=this.type===tH.BUTTON_MOMENTARY,o=!this.action&&!this.label;!o||this.iconTrailing||this.icon||(this.icon="circle");let a={"mdc-icon-button":o,"mdc-fab":!o&&this.action,"mdc-fab--extended":!o&&this.action&&!!this.label,"mdc-fab--mini":!o&&this.action&&(this.compact||this.comfortable),"mdc-button":!o&&!this.action,"mdc-button--raised":!o&&!this.action&&this.raised,"mdc-button--unelevated":!o&&!this.action&&this.unElevated,"mdc-button--outlined":!o&&!this.action&&(this.outlined||r),"mdc-button--rounded":!o&&!this.action&&this.rounded,"mdc-button--fullwidth":this.fullWidth};return aL`
881
- <button id="component" class="${s9(a)}"
860
+ `;case tH.BUTTON:case tH.BUTTON_MOMENTARY:{let t=t=>{this.disabled&&t.stopPropagation(),r&&this.dispatchEvent(new dz(!0,null))},n=t=>{this.disabled&&t.stopPropagation(),r&&this.dispatchEvent(new dz(!1,!0))},i=t=>{this.disabled&&t.stopPropagation(),r||this.dispatchEvent(new dz(!0,null))},r=this.type===tH.BUTTON_MOMENTARY,o=!this.action&&!this.label;!o||this.iconTrailing||this.icon||(this.icon="circle");let a={"mdc-icon-button":o,"mdc-fab":!o&&this.action,"mdc-fab--extended":!o&&this.action&&!!this.label,"mdc-fab--mini":!o&&this.action&&(this.compact||this.comfortable),"mdc-button":!o&&!this.action,"mdc-button--raised":!o&&!this.action&&this.raised,"mdc-button--unelevated":!o&&!this.action&&this.unElevated,"mdc-button--outlined":!o&&!this.action&&(this.outlined||r),"mdc-button--rounded":!o&&!this.action&&this.rounded,"mdc-button--fullwidth":this.fullWidth};return aL`
861
+ <button id="component" class="${sQ(a)}"
882
862
  ?readonly="${this.readonly}"
883
863
  ?disabled="${this.disabled}"
884
864
  @click="${t=>i(t)}"
@@ -910,7 +890,7 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
910
890
  </div>
911
891
  `;case tH.CHECKBOX:let F={"mdc-checkbox":!0,"mdc-checkbox--disabled":this.disabled||this.readonly};return aL`
912
892
  <div id="field" class="mdc-form-field">
913
- <div id="component" class="${s9(F)}">
893
+ <div id="component" class="${sQ(F)}">
914
894
  <input type="checkbox"
915
895
  id="elem"
916
896
  data-indeterminate="${this.indeterminate}"
@@ -954,7 +934,7 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
954
934
  @keydown="${t=>{("Enter"===t.code||"NumpadEnter"===t.code)&&this.onValueChange(t.target,t.target.value,!0)}}"
955
935
  @blur="${t=>{""===t.target.value&&this.reportValidity()}}"
956
936
  @change="${t=>this.onValueChange(t.target,t.target.value)}" />`,t=aL`
957
- <label id="${o}" class="${s9(a)}">
937
+ <label id="${o}" class="${sQ(a)}">
958
938
  ${this.icon?aL`<or-icon class="mdc-text-field__icon mdc-text-field__icon--leading" style="color: ${this.iconColor?"#"+this.iconColor:"unset"}" aria-hidden="true" icon="${this.icon}"></or-icon>`:""}
959
939
  ${s?"":aL`<span class="mdc-text-field__ripple"></span>`}
960
940
  ${t}
@@ -965,14 +945,14 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
965
945
  </label>
966
946
  ${l||c?aL`
967
947
  <div class="mdc-text-field-helper-line">
968
- <div class="mdc-text-field-helper-text ${s9(d)}">${c?this.errorMessage||this.validationMessage:this.helperText}</div>
948
+ <div class="mdc-text-field-helper-text ${sQ(d)}">${c?this.errorMessage||this.validationMessage:this.helperText}</div>
969
949
  ${this.charCounter&&!this.readonly?aL`<div class="mdc-text-field-character-counter"></div>`:""}
970
950
  </div>
971
951
  `:""}
972
952
  `}if(this.type===tH.RANGE){let i={"mdc-slider":!0,"mdc-slider--range":this.continuous,"mdc-slider--discreet":!this.continuous,"mdc-slider--disabled":this.disabled||this.readonly};t=aL`
973
953
  <span id="wrapper">
974
954
  ${this.label?aL`<label for="component" class="${this.disabled?"mdc-switch--disabled":""}">${this.label}</label>`:""}
975
- <div id="component" class="${s9(i)}" @MDCSlider:change="${t=>this.onValueChange(void 0,t.detail.value)}">
955
+ <div id="component" class="${sQ(i)}" @MDCSlider:change="${t=>this.onValueChange(void 0,t.detail.value)}">
976
956
  <input id="elem" class="mdc-slider__input" type="range" min="${n[1]??aO}" max="${n[2]??aO}" value="${n[0]||n[1]||0}" name="slider" step="${this.step||1}" ?readonly="${this.readonly}" ?disabled="${this.disabled}" aria-label="${this.label??aO}" />
977
957
  <div class="mdc-slider__track">
978
958
  <div class="mdc-slider__track--inactive"></div>
@@ -993,7 +973,7 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
993
973
  </div>
994
974
  ${t?aL`<div style="min-width: 70px; width: 70px;">${t}</div>`:""}
995
975
  </span>
996
- `}return t}}}return aL`<span>INPUT TYPE NOT IMPLEMENTED</span>`}_getFormat(){if(this.format)return this.format}update(t){if(t.has("autoValidate")&&this._mdcComponent){let t=this._mdcComponent;t.foundation&&t.foundation.setValidateOnValueChange&&t.foundation.setValidateOnValueChange(this.autoValidate)}super.update(t)}firstUpdated(t){super.firstUpdated(t),this.autoValidate&&this.reportValidity()}updated(t){var n,i;if(super.updated(t),t.has("type")){let t=this.shadowRoot.getElementById("component");if(this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0),t&&this.type){switch(this.type){case tH.LIST:let n=new cX(t);this._mdcComponent=n,n.selectedIndex=this._selectedIndex;break;case tH.SELECT:let i=new da(t);this._mdcComponent=i,(null===this.value||void 0===this.value)&&(i.selectedIndex=-1),this.multiple&&(this._mdcComponent.foundation.adapter.getSelectedIndex=()=>{if(!Array.isArray(this.value)||0===this.value.length)return -1;let t=this.value[0];return this._mdcComponent.foundation.adapter.getMenuItemValues().indexOf(t)}),i.useDefaultValidation=!this.multiple,i.valid=!this.required||!this.multiple&&i.valid||this.multiple&&Array.isArray(this.value)&&this.value.length>0;let r=this.getSelectedTextValue();this._mdcComponent.foundation.adapter.setSelectedText(r),this._mdcComponent.foundation.adapter.floatLabel(!!r),this._menuObserver||(this._menuObserver=new IntersectionObserver((t,n)=>{var i,r;t[0].target.style.minWidth!=(null==(i=t[0].target.parentElement)?void 0:i.clientWidth)+"px"&&(t[0].target.style.minWidth=(null==(r=t[0].target.parentElement)?void 0:r.clientWidth)+"px")}),this._menuObserver.observe(this.shadowRoot.getElementById("mdc-select-menu")));let o=void 0!==this.searchProvider,a=this.multiple;i.menu.menuSurface_.foundation.handleBodyClick=function(t){let n=t.composedPath()[0];if(this.adapter.isElementInContainer(n)){if(!o)return;else if(n instanceof Element&&!n.className.includes("mdc-list-item"))return;else if(a)return}i.menu.menuSurface_.close()};break;case tH.RADIO:case tH.CHECKBOX_LIST:case tH.COLOUR:break;case tH.BUTTON:case tH.BUTTON_MOMENTARY:let s=!this.action&&!this.label,l=new lL(t);s&&(l.unbounded=!0),this._mdcComponent=l;break;case tH.BUTTON_TOGGLE:this._mdcComponent=new df(t);break;case tH.CHECKBOX:this._mdcComponent=new ct(t);let c=this.shadowRoot.getElementById("field");if(c){let t=new dd(c);t.input=this._mdcComponent,this._mdcComponent2=t}break;case tH.SWITCH:this._mdcComponent=new ca(t);break;case tH.RANGE:this._mdcComponent=new cy(t);let d=this.shadowRoot.getElementById("number");if(d){let t=new l0(d);t.useNativeValidation=!1,this._mdcComponent2=t}break;default:let u=new l0(t);u.useNativeValidation=!1,this._mdcComponent=u}this._mdcComponent&&this.focused&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}}else{if(this.type===tH.SELECT&&this._mdcComponent){t.has("options")&&this._mdcComponent.layoutOptions(),this._mdcComponent.disabled=!!(this.disabled||this.readonly),this._mdcComponent.useDefaultValidation=!this.multiple,this._mdcComponent.valid=!this.required||!this.multiple&&this._mdcComponent.valid||this.multiple&&Array.isArray(this.value)&&this.value.length>0;let n=this.getSelectedTextValue();this._mdcComponent.foundation.adapter.setSelectedText(n),this._mdcComponent.foundation.adapter.floatLabel(!!n)}else if(this.type===tH.RANGE&&this._mdcComponent){let t=this._mdcComponent;t.setDisabled(this.disabled||this.readonly),t.setValue(this.value)}else if(this.type===tH.SWITCH&&this._mdcComponent)this._mdcComponent.checked=this.value;else if(this.type===tH.CHECKBOX&&this._mdcComponent){let t=this._mdcComponent;t.checked=!!this.value,t.disabled=!!(this.disabled||this.readonly)}this._mdcComponent&&(this._mdcComponent.required=!!this.required)}t.has("label")&&(null==(i=null==(n=this._mdcComponent)?void 0:n.layout)||i.call(n)),this.autoValidate&&this.reportValidity()}renderOutlined(t){return aL`
976
+ `}return t}}}return aL`<span>INPUT TYPE NOT IMPLEMENTED</span>`}_getFormat(){if(this.format)return this.format}update(t){if(t.has("autoValidate")&&this._mdcComponent){let t=this._mdcComponent;t.foundation&&t.foundation.setValidateOnValueChange&&t.foundation.setValidateOnValueChange(this.autoValidate)}super.update(t)}firstUpdated(t){super.firstUpdated(t),this.autoValidate&&this.reportValidity()}updated(t){var n,i;if(super.updated(t),t.has("type")){let t=this.shadowRoot.getElementById("component");if(this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0),t&&this.type){switch(this.type){case tH.LIST:let n=new cY(t);this._mdcComponent=n,n.selectedIndex=this._selectedIndex;break;case tH.SELECT:let i=new c4(t);this._mdcComponent=i,(null===this.value||void 0===this.value)&&(i.selectedIndex=-1),this.multiple&&(this._mdcComponent.foundation.adapter.getSelectedIndex=()=>{if(!Array.isArray(this.value)||0===this.value.length)return -1;let t=this.value[0];return this._mdcComponent.foundation.adapter.getMenuItemValues().indexOf(t)}),i.useDefaultValidation=!this.multiple,i.valid=!this.required||!this.multiple&&i.valid||this.multiple&&Array.isArray(this.value)&&this.value.length>0;let r=this.getSelectedTextValue();this._mdcComponent.foundation.adapter.setSelectedText(r),this._mdcComponent.foundation.adapter.floatLabel(!!r),this._menuObserver||(this._menuObserver=new IntersectionObserver((t,n)=>{var i,r;t[0].target.style.minWidth!=(null==(i=t[0].target.parentElement)?void 0:i.clientWidth)+"px"&&(t[0].target.style.minWidth=(null==(r=t[0].target.parentElement)?void 0:r.clientWidth)+"px")}),this._menuObserver.observe(this.shadowRoot.getElementById("mdc-select-menu")));let o=void 0!==this.searchProvider,a=this.multiple;i.menu.menuSurface_.foundation.handleBodyClick=function(t){let n=t.composedPath()[0];if(this.adapter.isElementInContainer(n)){if(!o)return;else if(n instanceof Element&&!n.className.includes("mdc-list-item"))return;else if(a)return}i.menu.menuSurface_.close()};break;case tH.RADIO:case tH.CHECKBOX_LIST:case tH.COLOUR:break;case tH.BUTTON:case tH.BUTTON_MOMENTARY:let s=!this.action&&!this.label,l=new lw(t);s&&(l.unbounded=!0),this._mdcComponent=l;break;case tH.BUTTON_TOGGLE:this._mdcComponent=new dr(t);break;case tH.CHECKBOX:this._mdcComponent=new l1(t);let c=this.shadowRoot.getElementById("field");if(c){let t=new c9(c);t.input=this._mdcComponent,this._mdcComponent2=t}break;case tH.SWITCH:this._mdcComponent=new l6(t);break;case tH.RANGE:this._mdcComponent=new cc(t);let d=this.shadowRoot.getElementById("number");if(d){let t=new lV(d);t.useNativeValidation=!1,this._mdcComponent2=t}break;default:let u=new lV(t);u.useNativeValidation=!1,this._mdcComponent=u}this._mdcComponent&&this.focused&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}}else{if(this.type===tH.SELECT&&this._mdcComponent){t.has("options")&&this._mdcComponent.layoutOptions(),this._mdcComponent.disabled=!!(this.disabled||this.readonly),this._mdcComponent.useDefaultValidation=!this.multiple,this._mdcComponent.valid=!this.required||!this.multiple&&this._mdcComponent.valid||this.multiple&&Array.isArray(this.value)&&this.value.length>0;let n=this.getSelectedTextValue();this._mdcComponent.foundation.adapter.setSelectedText(n),this._mdcComponent.foundation.adapter.floatLabel(!!n)}else if(this.type===tH.RANGE&&this._mdcComponent){let t=this._mdcComponent;t.setDisabled(this.disabled||this.readonly),t.setValue(this.value)}else if(this.type===tH.SWITCH&&this._mdcComponent)this._mdcComponent.checked=this.value;else if(this.type===tH.CHECKBOX&&this._mdcComponent){let t=this._mdcComponent;t.checked=!!this.value,t.disabled=!!(this.disabled||this.readonly)}this._mdcComponent&&(this._mdcComponent.required=!!this.required)}t.has("label")&&(null==(i=null==(n=this._mdcComponent)?void 0:n.layout)||i.call(n)),this.autoValidate&&this.reportValidity()}renderOutlined(t){return aL`
997
977
  <span class="mdc-notched-outline">
998
978
  <span class="mdc-notched-outline__leading"></span>
999
979
  ${t?aL`
@@ -1003,7 +983,7 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
1003
983
  `:""}
1004
984
  <span class="mdc-notched-outline__trailing"></span>
1005
985
  </span>
1006
- `}setCustomValidity(t){this.errorMessage=t;let n=this.shadowRoot.getElementById("elem");n&&n.setCustomValidity&&n.setCustomValidity(null!=t?t:""),this.reportValidity()}checkValidity(){let t=this.shadowRoot.getElementById("elem"),n=!0;return t&&t.validity&&(n=t.validity.valid),n&&(this.type===tH.JSON||this.type===tH.JSON_OBJECT)&&void 0!==this.value&&null!==this.value&&""===this._mdcComponent.value&&(n=!1),n}reportValidity(){let t=this.checkValidity();return this.isUiValid=t,this._mdcComponent&&(this._mdcComponent.valid=t),t}onValueChange(t,n,i){var r,o;let a,s=this.value;if("undefined"===n&&(s=null,n=void 0),"null"===n&&(s=void 0,n=null),"string"==typeof n)switch(this.type){case tH.CHECKBOX:case tH.SWITCH:n="on"===n;break;case tH.JSON:case tH.JSON_OBJECT:case tH.NUMBER:case tH.RANGE:if(""===n)n=null;else try{n=JSON.parse(n),this.type===tH.JSON_OBJECT&&("object"!=typeof n||Array.isArray(n))&&(n=this.value,a=nj.t("validation.invalidJSON"))}catch(t){n=this.value,a=this.type===tH.JSON||this.type==tH.JSON_OBJECT?nj.t("validation.invalidJSON"):nj.t("validation.invalidNumber")}break;case tH.DATETIME:if(""===n)n=null;else try{n=Date.parse(n)}catch(t){n=this.value,a=nj.t("validation.invalidDate")}}if(this.value=n,this.setCustomValidity(a),this.reportValidity(),this.type!==tH.CHECKBOX_LIST&&n!==s&&(this.type===tH.RANGE&&(this._mdcComponent.setValue(n),this._mdcComponent2&&(this._mdcComponent2.value=n)),this.dispatchEvent(new dW(this.value,s,i))),void 0!=this.searchProvider&&this.type===tH.SELECT){let t=null==(o=null==(r=this.shadowRoot)?void 0:r.getElementById("select-searchable"))?void 0:o.children[1];t&&(this.searchableValue=void 0,t.value="")}this.type!==tH.CHECKBOX_LIST||n$(n,s,!0)||this.dispatchEvent(new dW(n,s,i))}get valid(){let t=this.shadowRoot.getElementById("elem");return!t||!t.checkValidity||t.checkValidity()}get currentValue(){let t=this.shadowRoot.getElementById("elem");if(t&&t.value)return t.value}resolveOptions(t){let n;return t&&t.length>0&&(n=t.map(t=>{if(Array.isArray(t))return t;{let n=""+t;return[t,nj.t(n,{defaultValue:nW(n)})]}})),n}getSelectedTextValue(t){let n=this.value,i=Array.isArray(n)?n:null!=n?[n]:void 0;if(!i)return"";let r=t||this.resolveOptions(this.options);return r&&i?i.map(t=>r.find(([n,i],r)=>t===n)).map(t=>t?t[1]:"").join(", "):""}};dS([a6({type:Boolean})],dZ.prototype,"focused",void 0),dS([a6()],dZ.prototype,"value",void 0),dS([a6({type:String})],dZ.prototype,"type",void 0),dS([a6({type:String})],dZ.prototype,"name",void 0),dS([a6({type:Boolean})],dZ.prototype,"readonly",void 0),dS([a6({type:Boolean})],dZ.prototype,"required",void 0),dS([a6()],dZ.prototype,"max",void 0),dS([a6()],dZ.prototype,"min",void 0),dS([a6({type:Number})],dZ.prototype,"step",void 0),dS([a6({type:Boolean})],dZ.prototype,"checked",void 0),dS([a6({type:Boolean})],dZ.prototype,"indeterminate",void 0),dS([a6({type:Number})],dZ.prototype,"maxLength",void 0),dS([a6({type:Number})],dZ.prototype,"minLength",void 0),dS([a6({type:Number})],dZ.prototype,"rows",void 0),dS([a6({type:Number})],dZ.prototype,"cols",void 0),dS([a6({type:Boolean})],dZ.prototype,"multiple",void 0),dS([a6({type:String,attribute:!0,reflect:!1})],dZ.prototype,"pattern",void 0),dS([a6({type:String})],dZ.prototype,"placeHolder",void 0),dS([a6({type:Array})],dZ.prototype,"options",void 0),dS([a6({type:Boolean})],dZ.prototype,"autoSelect",void 0),dS([a6({type:Object})],dZ.prototype,"searchProvider",void 0),dS([a6({type:String})],dZ.prototype,"searchLabel",void 0),dS([a6({type:String})],dZ.prototype,"icon",void 0),dS([a6({type:String})],dZ.prototype,"iconColor",void 0),dS([a6({type:String})],dZ.prototype,"iconOn",void 0),dS([a6({type:String})],dZ.prototype,"iconTrailing",void 0),dS([a6({type:Boolean})],dZ.prototype,"compact",void 0),dS([a6({type:Boolean})],dZ.prototype,"comfortable",void 0),dS([a6({type:Boolean})],dZ.prototype,"raised",void 0),dS([a6({type:Boolean})],dZ.prototype,"action",void 0),dS([a6({type:Boolean})],dZ.prototype,"unElevated",void 0),dS([a6({type:Boolean})],dZ.prototype,"outlined",void 0),dS([a6({type:Boolean})],dZ.prototype,"rounded",void 0),dS([a6({type:Object})],dZ.prototype,"format",void 0),dS([a6({type:Boolean})],dZ.prototype,"disableSliderNumberInput",void 0),dS([a6({type:Boolean})],dZ.prototype,"fullWidth",void 0),dS([a6({type:String})],dZ.prototype,"helperText",void 0),dS([a6({type:Boolean})],dZ.prototype,"helperPersistent",void 0),dS([a6({type:String,attribute:!0})],dZ.prototype,"validationMessage",void 0),dS([a6({type:Boolean})],dZ.prototype,"autoValidate",void 0),dS([a6({type:Boolean})],dZ.prototype,"charCounter",void 0),dS([a6({type:String})],dZ.prototype,"label",void 0),dS([a6({type:Boolean})],dZ.prototype,"disabled",void 0),dS([a6({type:Boolean})],dZ.prototype,"continuous",void 0),dS([a6({type:Boolean})],dZ.prototype,"resizeVertical",void 0),dS([a6({type:Boolean})],dZ.prototype,"censored",void 0),dS([a6({type:Boolean,reflect:!0})],dZ.prototype,"advertised",void 0),dS([a8()],dZ.prototype,"isUiValid",void 0),dS([a8()],dZ.prototype,"searchableValue",void 0),dS([a8()],dZ.prototype,"errorMessage",void 0),dZ=dS([a3("or-mwc-input")],dZ);var dK="mdc-dom-focus-sentinel",dJ=function(){function t(t,n){void 0===n&&(n={}),this.root=t,this.options=n,this.elFocusedBeforeTrapFocus=null}return t.prototype.trapFocus=function(){var t=this.getFocusableElements(this.root);if(0===t.length)throw Error("FocusTrap: Element must have at least one focusable child.");this.elFocusedBeforeTrapFocus=document.activeElement instanceof HTMLElement?document.activeElement:null,this.wrapTabFocus(this.root,t),this.options.skipInitialFocus||this.focusInitialElement(t,this.options.initialFocusEl)},t.prototype.releaseFocus=function(){[].slice.call(this.root.querySelectorAll("."+dK)).forEach(function(t){t.parentElement.removeChild(t)}),this.elFocusedBeforeTrapFocus&&this.elFocusedBeforeTrapFocus.focus()},t.prototype.wrapTabFocus=function(t,n){var i=this.createSentinel(),r=this.createSentinel();i.addEventListener("focus",function(){n.length>0&&n[n.length-1].focus()}),r.addEventListener("focus",function(){n.length>0&&n[0].focus()}),t.insertBefore(i,t.children[0]),t.appendChild(r)},t.prototype.focusInitialElement=function(t,n){var i=0;n&&(i=Math.max(t.indexOf(n),0)),t[i].focus()},t.prototype.getFocusableElements=function(t){return[].slice.call(t.querySelectorAll("[autofocus], [tabindex], a, input, textarea, select, button")).filter(function(t){var n="true"===t.getAttribute("aria-disabled")||null!=t.getAttribute("disabled")||null!=t.getAttribute("hidden")||"true"===t.getAttribute("aria-hidden"),i=t.tabIndex>=0&&t.getBoundingClientRect().width>0&&!t.classList.contains(dK)&&!n,r=!1;if(i){var o=getComputedStyle(t);r="none"===o.display||"hidden"===o.visibility}return i&&!r})},t.prototype.createSentinel=function(){var t=document.createElement("div");return t.setAttribute("tabindex","0"),t.setAttribute("aria-hidden","true"),t.classList.add(dK),t},t}(),dQ={CLOSING:"mdc-dialog--closing",OPEN:"mdc-dialog--open",OPENING:"mdc-dialog--opening",SCROLLABLE:"mdc-dialog--scrollable",SCROLL_LOCK:"mdc-dialog-scroll-lock",STACKED:"mdc-dialog--stacked"},d0={ACTION_ATTRIBUTE:"data-mdc-dialog-action",BUTTON_DEFAULT_ATTRIBUTE:"data-mdc-dialog-button-default",BUTTON_SELECTOR:".mdc-dialog__button",CLOSED_EVENT:"MDCDialog:closed",CLOSE_ACTION:"close",CLOSING_EVENT:"MDCDialog:closing",CONTAINER_SELECTOR:".mdc-dialog__container",CONTENT_SELECTOR:".mdc-dialog__content",DESTROY_ACTION:"destroy",INITIAL_FOCUS_ATTRIBUTE:"data-mdc-dialog-initial-focus",OPENED_EVENT:"MDCDialog:opened",OPENING_EVENT:"MDCDialog:opening",SCRIM_SELECTOR:".mdc-dialog__scrim",SUPPRESS_DEFAULT_PRESS_SELECTOR:"textarea, .mdc-menu .mdc-list-item",SURFACE_SELECTOR:".mdc-dialog__surface"},d1={DIALOG_ANIMATION_CLOSE_TIME_MS:75,DIALOG_ANIMATION_OPEN_TIME_MS:150},d2=function(t){function n(i){var r=t.call(this,la(la({},n.defaultAdapter),i))||this;return r.isOpen_=!1,r.animationFrame_=0,r.animationTimer_=0,r.layoutFrame_=0,r.escapeKeyAction_=d0.CLOSE_ACTION,r.scrimClickAction_=d0.CLOSE_ACTION,r.autoStackButtons_=!0,r.areButtonsStacked_=!1,r.suppressDefaultPressSelector=d0.SUPPRESS_DEFAULT_PRESS_SELECTOR,r}return lo(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return dQ},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return d0},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return d1},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addBodyClass:function(){},addClass:function(){},areButtonsStacked:function(){return!1},clickDefaultButton:function(){},eventTargetMatches:function(){return!1},getActionFromEvent:function(){return""},getInitialFocusEl:function(){return null},hasClass:function(){return!1},isContentScrollable:function(){return!1},notifyClosed:function(){},notifyClosing:function(){},notifyOpened:function(){},notifyOpening:function(){},releaseFocus:function(){},removeBodyClass:function(){},removeClass:function(){},reverseButtons:function(){},trapFocus:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){this.adapter.hasClass(dQ.STACKED)&&this.setAutoStackButtons(!1)},n.prototype.destroy=function(){this.isOpen_&&this.close(d0.DESTROY_ACTION),this.animationTimer_&&(clearTimeout(this.animationTimer_),this.handleAnimationTimerEnd_()),this.layoutFrame_&&(cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=0)},n.prototype.open=function(){var t=this;this.isOpen_=!0,this.adapter.notifyOpening(),this.adapter.addClass(dQ.OPENING),this.runNextAnimationFrame_(function(){t.adapter.addClass(dQ.OPEN),t.adapter.addBodyClass(dQ.SCROLL_LOCK),t.layout(),t.animationTimer_=setTimeout(function(){t.handleAnimationTimerEnd_(),t.adapter.trapFocus(t.adapter.getInitialFocusEl()),t.adapter.notifyOpened()},d1.DIALOG_ANIMATION_OPEN_TIME_MS)})},n.prototype.close=function(t){var n=this;void 0===t&&(t=""),this.isOpen_&&(this.isOpen_=!1,this.adapter.notifyClosing(t),this.adapter.addClass(dQ.CLOSING),this.adapter.removeClass(dQ.OPEN),this.adapter.removeBodyClass(dQ.SCROLL_LOCK),cancelAnimationFrame(this.animationFrame_),this.animationFrame_=0,clearTimeout(this.animationTimer_),this.animationTimer_=setTimeout(function(){n.adapter.releaseFocus(),n.handleAnimationTimerEnd_(),n.adapter.notifyClosed(t)},d1.DIALOG_ANIMATION_CLOSE_TIME_MS))},n.prototype.isOpen=function(){return this.isOpen_},n.prototype.getEscapeKeyAction=function(){return this.escapeKeyAction_},n.prototype.setEscapeKeyAction=function(t){this.escapeKeyAction_=t},n.prototype.getScrimClickAction=function(){return this.scrimClickAction_},n.prototype.setScrimClickAction=function(t){this.scrimClickAction_=t},n.prototype.getAutoStackButtons=function(){return this.autoStackButtons_},n.prototype.setAutoStackButtons=function(t){this.autoStackButtons_=t},n.prototype.getSuppressDefaultPressSelector=function(){return this.suppressDefaultPressSelector},n.prototype.setSuppressDefaultPressSelector=function(t){this.suppressDefaultPressSelector=t},n.prototype.layout=function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame(function(){t.layoutInternal_(),t.layoutFrame_=0})},n.prototype.handleClick=function(t){if(this.adapter.eventTargetMatches(t.target,d0.SCRIM_SELECTOR)&&""!==this.scrimClickAction_)this.close(this.scrimClickAction_);else{var n=this.adapter.getActionFromEvent(t);n&&this.close(n)}},n.prototype.handleKeydown=function(t){var n="Enter"===t.key||13===t.keyCode;if(n&&!this.adapter.getActionFromEvent(t)){var i=t.composedPath?t.composedPath()[0]:t.target,r=!this.adapter.eventTargetMatches(i,this.suppressDefaultPressSelector);n&&r&&this.adapter.clickDefaultButton()}},n.prototype.handleDocumentKeydown=function(t){("Escape"===t.key||27===t.keyCode)&&""!==this.escapeKeyAction_&&this.close(this.escapeKeyAction_)},n.prototype.layoutInternal_=function(){this.autoStackButtons_&&this.detectStackedButtons_(),this.detectScrollableContent_()},n.prototype.handleAnimationTimerEnd_=function(){this.animationTimer_=0,this.adapter.removeClass(dQ.OPENING),this.adapter.removeClass(dQ.CLOSING)},n.prototype.runNextAnimationFrame_=function(t){var n=this;cancelAnimationFrame(this.animationFrame_),this.animationFrame_=requestAnimationFrame(function(){n.animationFrame_=0,clearTimeout(n.animationTimer_),n.animationTimer_=setTimeout(t,0)})},n.prototype.detectStackedButtons_=function(){this.adapter.removeClass(dQ.STACKED);var t=this.adapter.areButtonsStacked();t&&this.adapter.addClass(dQ.STACKED),t!==this.areButtonsStacked_&&(this.adapter.reverseButtons(),this.areButtonsStacked_=t)},n.prototype.detectScrollableContent_=function(){this.adapter.removeClass(dQ.SCROLLABLE),this.adapter.isContentScrollable()&&this.adapter.addClass(dQ.SCROLLABLE)},n}(lc),d5=d2.strings,d3=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return lo(n,t),Object.defineProperty(n.prototype,"isOpen",{get:function(){return this.foundation.isOpen()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"escapeKeyAction",{get:function(){return this.foundation.getEscapeKeyAction()},set:function(t){this.foundation.setEscapeKeyAction(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"scrimClickAction",{get:function(){return this.foundation.getScrimClickAction()},set:function(t){this.foundation.setScrimClickAction(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"autoStackButtons",{get:function(){return this.foundation.getAutoStackButtons()},set:function(t){this.foundation.setAutoStackButtons(t)},enumerable:!0,configurable:!0}),n.attachTo=function(t){return new n(t)},n.prototype.initialize=function(t){void 0===t&&(t=function(t,n){return new dJ(t,n)});var n,i,r=this.root.querySelector(d5.CONTAINER_SELECTOR);if(!r)throw Error("Dialog component requires a "+d5.CONTAINER_SELECTOR+" container element");this.container_=r,this.content_=this.root.querySelector(d5.CONTENT_SELECTOR),this.buttons_=[].slice.call(this.root.querySelectorAll(d5.BUTTON_SELECTOR)),this.defaultButton_=this.root.querySelector("["+d5.BUTTON_DEFAULT_ATTRIBUTE+"]"),this.focusTrapFactory_=t,this.buttonRipples_=[];try{for(var o=ls(this.buttons_),a=o.next();!a.done;a=o.next()){var s=a.value;this.buttonRipples_.push(new lL(s))}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},n.prototype.initialSyncWithDOM=function(){var t,n=this;this.focusTrap_=(t=this.container_,(0,this.focusTrapFactory_)(t,{initialFocusEl:this.getInitialFocusEl_()||void 0})),this.handleClick_=this.foundation.handleClick.bind(this.foundation),this.handleKeydown_=this.foundation.handleKeydown.bind(this.foundation),this.handleDocumentKeydown_=this.foundation.handleDocumentKeydown.bind(this.foundation),this.handleLayout_=this.layout.bind(this);var i=["resize","orientationchange"];this.handleOpening_=function(){i.forEach(function(t){return window.addEventListener(t,n.handleLayout_)}),document.addEventListener("keydown",n.handleDocumentKeydown_)},this.handleClosing_=function(){i.forEach(function(t){return window.removeEventListener(t,n.handleLayout_)}),document.removeEventListener("keydown",n.handleDocumentKeydown_)},this.listen("click",this.handleClick_),this.listen("keydown",this.handleKeydown_),this.listen(d5.OPENING_EVENT,this.handleOpening_),this.listen(d5.CLOSING_EVENT,this.handleClosing_)},n.prototype.destroy=function(){this.unlisten("click",this.handleClick_),this.unlisten("keydown",this.handleKeydown_),this.unlisten(d5.OPENING_EVENT,this.handleOpening_),this.unlisten(d5.CLOSING_EVENT,this.handleClosing_),this.handleClosing_(),this.buttonRipples_.forEach(function(t){return t.destroy()}),t.prototype.destroy.call(this)},n.prototype.layout=function(){this.foundation.layout()},n.prototype.open=function(){this.foundation.open()},n.prototype.close=function(t){void 0===t&&(t=""),this.foundation.close(t)},n.prototype.getDefaultFoundation=function(){var t=this;return new d2({addBodyClass:function(t){return document.body.classList.add(t)},addClass:function(n){return t.root.classList.add(n)},areButtonsStacked:function(){var n,i;return n=t.buttons_,i=new Set,[].forEach.call(n,function(t){return i.add(t.offsetTop)}),i.size>1},clickDefaultButton:function(){return t.defaultButton_&&t.defaultButton_.click()},eventTargetMatches:function(t,n){return!!t&&lh(t,n)},getActionFromEvent:function(t){if(!t.target)return"";var n=lm(t.target,"["+d5.ACTION_ATTRIBUTE+"]");return n&&n.getAttribute(d5.ACTION_ATTRIBUTE)},getInitialFocusEl:function(){return t.getInitialFocusEl_()},hasClass:function(n){return t.root.classList.contains(n)},isContentScrollable:function(){var n;return!!(n=t.content_)&&n.scrollHeight>n.offsetHeight},notifyClosed:function(n){return t.emit(d5.CLOSED_EVENT,n?{action:n}:{})},notifyClosing:function(n){return t.emit(d5.CLOSING_EVENT,n?{action:n}:{})},notifyOpened:function(){return t.emit(d5.OPENED_EVENT,{})},notifyOpening:function(){return t.emit(d5.OPENING_EVENT,{})},releaseFocus:function(){return t.focusTrap_.releaseFocus()},removeBodyClass:function(t){return document.body.classList.remove(t)},removeClass:function(n){return t.root.classList.remove(n)},reverseButtons:function(){t.buttons_.reverse(),t.buttons_.forEach(function(t){t.parentElement.appendChild(t)})},trapFocus:function(){return t.focusTrap_.trapFocus()}})},n.prototype.getInitialFocusEl_=function(){return this.root.querySelector("["+d5.INITIAL_FOCUS_ATTRIBUTE+"]")},n}(ld),d4=function(t,n,i,r){var o,a=arguments.length,s=a<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,n,i,r);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(s=(a<3?o(s):a>3?o(n,i,s):o(n,i))||s);return a>3&&s&&Object.defineProperty(n,i,s),s};let d6=o(3384),d8=o(6612);class d7 extends CustomEvent{constructor(){super(d7.NAME,{bubbles:!0,composed:!0})}}d7.NAME="or-mwc-dialog-opened";class d9 extends CustomEvent{constructor(t){super(d9.NAME,{detail:t,bubbles:!0,composed:!0})}}d9.NAME="or-mwc-dialog-closed";let ue=o4`
986
+ `}setCustomValidity(t){this.errorMessage=t;let n=this.shadowRoot.getElementById("elem");n&&n.setCustomValidity&&n.setCustomValidity(null!=t?t:""),this.reportValidity()}checkValidity(){let t=this.shadowRoot.getElementById("elem"),n=!0;return t&&t.validity&&(n=t.validity.valid),n&&(this.type===tH.JSON||this.type===tH.JSON_OBJECT)&&void 0!==this.value&&null!==this.value&&""===this._mdcComponent.value&&(n=!1),n}reportValidity(){let t=this.checkValidity();return this.isUiValid=t,this._mdcComponent&&(this._mdcComponent.valid=t),t}onValueChange(t,n,i){var r,o;let a,s=this.value;if("undefined"===n&&(s=null,n=void 0),"null"===n&&(s=void 0,n=null),"string"==typeof n)switch(this.type){case tH.CHECKBOX:case tH.SWITCH:n="on"===n;break;case tH.JSON:case tH.JSON_OBJECT:case tH.NUMBER:case tH.RANGE:if(""===n)n=null;else try{n=JSON.parse(n),this.type===tH.JSON_OBJECT&&("object"!=typeof n||Array.isArray(n))&&(n=this.value,a=nj.t("validation.invalidJSON"))}catch(t){n=this.value,a=this.type===tH.JSON||this.type==tH.JSON_OBJECT?nj.t("validation.invalidJSON"):nj.t("validation.invalidNumber")}break;case tH.DATETIME:if(""===n)n=null;else try{n=Date.parse(n)}catch(t){n=this.value,a=nj.t("validation.invalidDate")}}if(this.value=n,this.setCustomValidity(a),this.reportValidity(),this.type!==tH.CHECKBOX_LIST&&n!==s&&(this.type===tH.RANGE&&(this._mdcComponent.setValue(n),this._mdcComponent2&&(this._mdcComponent2.value=n)),this.dispatchEvent(new dz(this.value,s,i))),void 0!=this.searchProvider&&this.type===tH.SELECT){let t=null==(o=null==(r=this.shadowRoot)?void 0:r.getElementById("select-searchable"))?void 0:o.children[1];t&&(this.searchableValue=void 0,t.value="")}this.type!==tH.CHECKBOX_LIST||n$(n,s,!0)||this.dispatchEvent(new dz(n,s,i))}get valid(){let t=this.shadowRoot.getElementById("elem");return!t||!t.checkValidity||t.checkValidity()}get currentValue(){let t=this.shadowRoot.getElementById("elem");if(t&&t.value)return t.value}resolveOptions(t){let n;return t&&t.length>0&&(n=t.map(t=>{if(Array.isArray(t))return t;{let n=""+t;return[t,nj.t(n,{defaultValue:nW(n)})]}})),n}getSelectedTextValue(t){let n=this.value,i=Array.isArray(n)?n:null!=n?[n]:void 0;if(!i)return"";let r=t||this.resolveOptions(this.options);return r&&i?i.map(t=>r.find(([n,i],r)=>t===n)).map(t=>t?t[1]:"").join(", "):""}};dv([a6({type:Boolean})],dN.prototype,"focused",void 0),dv([a6()],dN.prototype,"value",void 0),dv([a6({type:String})],dN.prototype,"type",void 0),dv([a6({type:String})],dN.prototype,"name",void 0),dv([a6({type:Boolean})],dN.prototype,"readonly",void 0),dv([a6({type:Boolean})],dN.prototype,"required",void 0),dv([a6()],dN.prototype,"max",void 0),dv([a6()],dN.prototype,"min",void 0),dv([a6({type:Number})],dN.prototype,"step",void 0),dv([a6({type:Boolean})],dN.prototype,"checked",void 0),dv([a6({type:Boolean})],dN.prototype,"indeterminate",void 0),dv([a6({type:Number})],dN.prototype,"maxLength",void 0),dv([a6({type:Number})],dN.prototype,"minLength",void 0),dv([a6({type:Number})],dN.prototype,"rows",void 0),dv([a6({type:Number})],dN.prototype,"cols",void 0),dv([a6({type:Boolean})],dN.prototype,"multiple",void 0),dv([a6({type:String,attribute:!0,reflect:!1})],dN.prototype,"pattern",void 0),dv([a6({type:String})],dN.prototype,"placeHolder",void 0),dv([a6({type:Array})],dN.prototype,"options",void 0),dv([a6({type:Boolean})],dN.prototype,"autoSelect",void 0),dv([a6({type:Object})],dN.prototype,"searchProvider",void 0),dv([a6({type:String})],dN.prototype,"searchLabel",void 0),dv([a6({type:String})],dN.prototype,"icon",void 0),dv([a6({type:String})],dN.prototype,"iconColor",void 0),dv([a6({type:String})],dN.prototype,"iconOn",void 0),dv([a6({type:String})],dN.prototype,"iconTrailing",void 0),dv([a6({type:Boolean})],dN.prototype,"compact",void 0),dv([a6({type:Boolean})],dN.prototype,"comfortable",void 0),dv([a6({type:Boolean})],dN.prototype,"raised",void 0),dv([a6({type:Boolean})],dN.prototype,"action",void 0),dv([a6({type:Boolean})],dN.prototype,"unElevated",void 0),dv([a6({type:Boolean})],dN.prototype,"outlined",void 0),dv([a6({type:Boolean})],dN.prototype,"rounded",void 0),dv([a6({type:Object})],dN.prototype,"format",void 0),dv([a6({type:Boolean})],dN.prototype,"disableSliderNumberInput",void 0),dv([a6({type:Boolean})],dN.prototype,"fullWidth",void 0),dv([a6({type:String})],dN.prototype,"helperText",void 0),dv([a6({type:Boolean})],dN.prototype,"helperPersistent",void 0),dv([a6({type:String,attribute:!0})],dN.prototype,"validationMessage",void 0),dv([a6({type:Boolean})],dN.prototype,"autoValidate",void 0),dv([a6({type:Boolean})],dN.prototype,"charCounter",void 0),dv([a6({type:String})],dN.prototype,"label",void 0),dv([a6({type:Boolean})],dN.prototype,"disabled",void 0),dv([a6({type:Boolean})],dN.prototype,"continuous",void 0),dv([a6({type:Boolean})],dN.prototype,"resizeVertical",void 0),dv([a6({type:Boolean})],dN.prototype,"censored",void 0),dv([a6({type:Boolean,reflect:!0})],dN.prototype,"advertised",void 0),dv([a8()],dN.prototype,"isUiValid",void 0),dv([a8()],dN.prototype,"searchableValue",void 0),dv([a8()],dN.prototype,"errorMessage",void 0),dN=dv([a3("or-mwc-input")],dN);var dj="mdc-dom-focus-sentinel",dH=function(){function t(t,n){void 0===n&&(n={}),this.root=t,this.options=n,this.elFocusedBeforeTrapFocus=null}return t.prototype.trapFocus=function(){var t=this.getFocusableElements(this.root);if(0===t.length)throw Error("FocusTrap: Element must have at least one focusable child.");this.elFocusedBeforeTrapFocus=document.activeElement instanceof HTMLElement?document.activeElement:null,this.wrapTabFocus(this.root,t),this.options.skipInitialFocus||this.focusInitialElement(t,this.options.initialFocusEl)},t.prototype.releaseFocus=function(){[].slice.call(this.root.querySelectorAll("."+dj)).forEach(function(t){t.parentElement.removeChild(t)}),this.elFocusedBeforeTrapFocus&&this.elFocusedBeforeTrapFocus.focus()},t.prototype.wrapTabFocus=function(t,n){var i=this.createSentinel(),r=this.createSentinel();i.addEventListener("focus",function(){n.length>0&&n[n.length-1].focus()}),r.addEventListener("focus",function(){n.length>0&&n[0].focus()}),t.insertBefore(i,t.children[0]),t.appendChild(r)},t.prototype.focusInitialElement=function(t,n){var i=0;n&&(i=Math.max(t.indexOf(n),0)),t[i].focus()},t.prototype.getFocusableElements=function(t){return[].slice.call(t.querySelectorAll("[autofocus], [tabindex], a, input, textarea, select, button")).filter(function(t){var n="true"===t.getAttribute("aria-disabled")||null!=t.getAttribute("disabled")||null!=t.getAttribute("hidden")||"true"===t.getAttribute("aria-hidden"),i=t.tabIndex>=0&&t.getBoundingClientRect().width>0&&!t.classList.contains(dj)&&!n,r=!1;if(i){var o=getComputedStyle(t);r="none"===o.display||"hidden"===o.visibility}return i&&!r})},t.prototype.createSentinel=function(){var t=document.createElement("div");return t.setAttribute("tabindex","0"),t.setAttribute("aria-hidden","true"),t.classList.add(dj),t},t}(),dU={CLOSING:"mdc-dialog--closing",OPEN:"mdc-dialog--open",OPENING:"mdc-dialog--opening",SCROLLABLE:"mdc-dialog--scrollable",SCROLL_LOCK:"mdc-dialog-scroll-lock",STACKED:"mdc-dialog--stacked"},dV={ACTION_ATTRIBUTE:"data-mdc-dialog-action",BUTTON_DEFAULT_ATTRIBUTE:"data-mdc-dialog-button-default",BUTTON_SELECTOR:".mdc-dialog__button",CLOSED_EVENT:"MDCDialog:closed",CLOSE_ACTION:"close",CLOSING_EVENT:"MDCDialog:closing",CONTAINER_SELECTOR:".mdc-dialog__container",CONTENT_SELECTOR:".mdc-dialog__content",DESTROY_ACTION:"destroy",INITIAL_FOCUS_ATTRIBUTE:"data-mdc-dialog-initial-focus",OPENED_EVENT:"MDCDialog:opened",OPENING_EVENT:"MDCDialog:opening",SCRIM_SELECTOR:".mdc-dialog__scrim",SUPPRESS_DEFAULT_PRESS_SELECTOR:"textarea, .mdc-menu .mdc-list-item",SURFACE_SELECTOR:".mdc-dialog__surface"},dq={DIALOG_ANIMATION_CLOSE_TIME_MS:75,DIALOG_ANIMATION_OPEN_TIME_MS:150},dG=function(t){function n(i){var r=t.call(this,s6(s6({},n.defaultAdapter),i))||this;return r.isOpen_=!1,r.animationFrame_=0,r.animationTimer_=0,r.layoutFrame_=0,r.escapeKeyAction_=dV.CLOSE_ACTION,r.scrimClickAction_=dV.CLOSE_ACTION,r.autoStackButtons_=!0,r.areButtonsStacked_=!1,r.suppressDefaultPressSelector=dV.SUPPRESS_DEFAULT_PRESS_SELECTOR,r}return s4(n,t),Object.defineProperty(n,"cssClasses",{get:function(){return dU},enumerable:!0,configurable:!0}),Object.defineProperty(n,"strings",{get:function(){return dV},enumerable:!0,configurable:!0}),Object.defineProperty(n,"numbers",{get:function(){return dq},enumerable:!0,configurable:!0}),Object.defineProperty(n,"defaultAdapter",{get:function(){return{addBodyClass:function(){},addClass:function(){},areButtonsStacked:function(){return!1},clickDefaultButton:function(){},eventTargetMatches:function(){return!1},getActionFromEvent:function(){return""},getInitialFocusEl:function(){return null},hasClass:function(){return!1},isContentScrollable:function(){return!1},notifyClosed:function(){},notifyClosing:function(){},notifyOpened:function(){},notifyOpening:function(){},releaseFocus:function(){},removeBodyClass:function(){},removeClass:function(){},reverseButtons:function(){},trapFocus:function(){}}},enumerable:!0,configurable:!0}),n.prototype.init=function(){this.adapter.hasClass(dU.STACKED)&&this.setAutoStackButtons(!1)},n.prototype.destroy=function(){this.isOpen_&&this.close(dV.DESTROY_ACTION),this.animationTimer_&&(clearTimeout(this.animationTimer_),this.handleAnimationTimerEnd_()),this.layoutFrame_&&(cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=0)},n.prototype.open=function(){var t=this;this.isOpen_=!0,this.adapter.notifyOpening(),this.adapter.addClass(dU.OPENING),this.runNextAnimationFrame_(function(){t.adapter.addClass(dU.OPEN),t.adapter.addBodyClass(dU.SCROLL_LOCK),t.layout(),t.animationTimer_=setTimeout(function(){t.handleAnimationTimerEnd_(),t.adapter.trapFocus(t.adapter.getInitialFocusEl()),t.adapter.notifyOpened()},dq.DIALOG_ANIMATION_OPEN_TIME_MS)})},n.prototype.close=function(t){var n=this;void 0===t&&(t=""),this.isOpen_&&(this.isOpen_=!1,this.adapter.notifyClosing(t),this.adapter.addClass(dU.CLOSING),this.adapter.removeClass(dU.OPEN),this.adapter.removeBodyClass(dU.SCROLL_LOCK),cancelAnimationFrame(this.animationFrame_),this.animationFrame_=0,clearTimeout(this.animationTimer_),this.animationTimer_=setTimeout(function(){n.adapter.releaseFocus(),n.handleAnimationTimerEnd_(),n.adapter.notifyClosed(t)},dq.DIALOG_ANIMATION_CLOSE_TIME_MS))},n.prototype.isOpen=function(){return this.isOpen_},n.prototype.getEscapeKeyAction=function(){return this.escapeKeyAction_},n.prototype.setEscapeKeyAction=function(t){this.escapeKeyAction_=t},n.prototype.getScrimClickAction=function(){return this.scrimClickAction_},n.prototype.setScrimClickAction=function(t){this.scrimClickAction_=t},n.prototype.getAutoStackButtons=function(){return this.autoStackButtons_},n.prototype.setAutoStackButtons=function(t){this.autoStackButtons_=t},n.prototype.getSuppressDefaultPressSelector=function(){return this.suppressDefaultPressSelector},n.prototype.setSuppressDefaultPressSelector=function(t){this.suppressDefaultPressSelector=t},n.prototype.layout=function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame(function(){t.layoutInternal_(),t.layoutFrame_=0})},n.prototype.handleClick=function(t){if(this.adapter.eventTargetMatches(t.target,dV.SCRIM_SELECTOR)&&""!==this.scrimClickAction_)this.close(this.scrimClickAction_);else{var n=this.adapter.getActionFromEvent(t);n&&this.close(n)}},n.prototype.handleKeydown=function(t){var n="Enter"===t.key||13===t.keyCode;if(n&&!this.adapter.getActionFromEvent(t)){var i=t.composedPath?t.composedPath()[0]:t.target,r=!this.adapter.eventTargetMatches(i,this.suppressDefaultPressSelector);n&&r&&this.adapter.clickDefaultButton()}},n.prototype.handleDocumentKeydown=function(t){("Escape"===t.key||27===t.keyCode)&&""!==this.escapeKeyAction_&&this.close(this.escapeKeyAction_)},n.prototype.layoutInternal_=function(){this.autoStackButtons_&&this.detectStackedButtons_(),this.detectScrollableContent_()},n.prototype.handleAnimationTimerEnd_=function(){this.animationTimer_=0,this.adapter.removeClass(dU.OPENING),this.adapter.removeClass(dU.CLOSING)},n.prototype.runNextAnimationFrame_=function(t){var n=this;cancelAnimationFrame(this.animationFrame_),this.animationFrame_=requestAnimationFrame(function(){n.animationFrame_=0,clearTimeout(n.animationTimer_),n.animationTimer_=setTimeout(t,0)})},n.prototype.detectStackedButtons_=function(){this.adapter.removeClass(dU.STACKED);var t=this.adapter.areButtonsStacked();t&&this.adapter.addClass(dU.STACKED),t!==this.areButtonsStacked_&&(this.adapter.reverseButtons(),this.areButtonsStacked_=t)},n.prototype.detectScrollableContent_=function(){this.adapter.removeClass(dU.SCROLLABLE),this.adapter.isContentScrollable()&&this.adapter.addClass(dU.SCROLLABLE)},n}(s9),d$=dG.strings,dW=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return s4(n,t),Object.defineProperty(n.prototype,"isOpen",{get:function(){return this.foundation.isOpen()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"escapeKeyAction",{get:function(){return this.foundation.getEscapeKeyAction()},set:function(t){this.foundation.setEscapeKeyAction(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"scrimClickAction",{get:function(){return this.foundation.getScrimClickAction()},set:function(t){this.foundation.setScrimClickAction(t)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"autoStackButtons",{get:function(){return this.foundation.getAutoStackButtons()},set:function(t){this.foundation.setAutoStackButtons(t)},enumerable:!0,configurable:!0}),n.attachTo=function(t){return new n(t)},n.prototype.initialize=function(t){void 0===t&&(t=function(t,n){return new dH(t,n)});var n,i,r=this.root.querySelector(d$.CONTAINER_SELECTOR);if(!r)throw Error("Dialog component requires a "+d$.CONTAINER_SELECTOR+" container element");this.container_=r,this.content_=this.root.querySelector(d$.CONTENT_SELECTOR),this.buttons_=[].slice.call(this.root.querySelectorAll(d$.BUTTON_SELECTOR)),this.defaultButton_=this.root.querySelector("["+d$.BUTTON_DEFAULT_ATTRIBUTE+"]"),this.focusTrapFactory_=t,this.buttonRipples_=[];try{for(var o=s8(this.buttons_),a=o.next();!a.done;a=o.next()){var s=a.value;this.buttonRipples_.push(new lw(s))}}catch(t){n={error:t}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},n.prototype.initialSyncWithDOM=function(){var t,n=this;this.focusTrap_=(t=this.container_,(0,this.focusTrapFactory_)(t,{initialFocusEl:this.getInitialFocusEl_()||void 0})),this.handleClick_=this.foundation.handleClick.bind(this.foundation),this.handleKeydown_=this.foundation.handleKeydown.bind(this.foundation),this.handleDocumentKeydown_=this.foundation.handleDocumentKeydown.bind(this.foundation),this.handleLayout_=this.layout.bind(this);var i=["resize","orientationchange"];this.handleOpening_=function(){i.forEach(function(t){return window.addEventListener(t,n.handleLayout_)}),document.addEventListener("keydown",n.handleDocumentKeydown_)},this.handleClosing_=function(){i.forEach(function(t){return window.removeEventListener(t,n.handleLayout_)}),document.removeEventListener("keydown",n.handleDocumentKeydown_)},this.listen("click",this.handleClick_),this.listen("keydown",this.handleKeydown_),this.listen(d$.OPENING_EVENT,this.handleOpening_),this.listen(d$.CLOSING_EVENT,this.handleClosing_)},n.prototype.destroy=function(){this.unlisten("click",this.handleClick_),this.unlisten("keydown",this.handleKeydown_),this.unlisten(d$.OPENING_EVENT,this.handleOpening_),this.unlisten(d$.CLOSING_EVENT,this.handleClosing_),this.handleClosing_(),this.buttonRipples_.forEach(function(t){return t.destroy()}),t.prototype.destroy.call(this)},n.prototype.layout=function(){this.foundation.layout()},n.prototype.open=function(){this.foundation.open()},n.prototype.close=function(t){void 0===t&&(t=""),this.foundation.close(t)},n.prototype.getDefaultFoundation=function(){var t=this;return new dG({addBodyClass:function(t){return document.body.classList.add(t)},addClass:function(n){return t.root.classList.add(n)},areButtonsStacked:function(){var n,i;return n=t.buttons_,i=new Set,[].forEach.call(n,function(t){return i.add(t.offsetTop)}),i.size>1},clickDefaultButton:function(){return t.defaultButton_&&t.defaultButton_.click()},eventTargetMatches:function(t,n){return!!t&&li(t,n)},getActionFromEvent:function(t){if(!t.target)return"";var n=ln(t.target,"["+d$.ACTION_ATTRIBUTE+"]");return n&&n.getAttribute(d$.ACTION_ATTRIBUTE)},getInitialFocusEl:function(){return t.getInitialFocusEl_()},hasClass:function(n){return t.root.classList.contains(n)},isContentScrollable:function(){var n;return!!(n=t.content_)&&n.scrollHeight>n.offsetHeight},notifyClosed:function(n){return t.emit(d$.CLOSED_EVENT,n?{action:n}:{})},notifyClosing:function(n){return t.emit(d$.CLOSING_EVENT,n?{action:n}:{})},notifyOpened:function(){return t.emit(d$.OPENED_EVENT,{})},notifyOpening:function(){return t.emit(d$.OPENING_EVENT,{})},releaseFocus:function(){return t.focusTrap_.releaseFocus()},removeBodyClass:function(t){return document.body.classList.remove(t)},removeClass:function(n){return t.root.classList.remove(n)},reverseButtons:function(){t.buttons_.reverse(),t.buttons_.forEach(function(t){t.parentElement.appendChild(t)})},trapFocus:function(){return t.focusTrap_.trapFocus()}})},n.prototype.getInitialFocusEl_=function(){return this.root.querySelector("["+d$.INITIAL_FOCUS_ATTRIBUTE+"]")},n}(le),dX=function(t,n,i,r){var o,a=arguments.length,s=a<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,n,i,r);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(s=(a<3?o(s):a>3?o(n,i,s):o(n,i))||s);return a>3&&s&&Object.defineProperty(n,i,s),s};let dZ=o(3384),dK=o(6612);class dJ extends CustomEvent{constructor(){super(dJ.NAME,{bubbles:!0,composed:!0})}}dJ.NAME="or-mwc-dialog-opened";class dQ extends CustomEvent{constructor(t){super(dQ.NAME,{detail:t,bubbles:!0,composed:!0})}}dQ.NAME="or-mwc-dialog-closed";let d0=o4`
1007
987
  :host {
1008
988
  position: relative;
1009
989
  }
@@ -1030,7 +1010,7 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
1030
1010
  max-width: 1024px;
1031
1011
  }
1032
1012
  }
1033
- `,ut=class extends aK{constructor(){super(...arguments),this._open=!1,this._popstateEventBind=t=>this._onBrowserNavigate(t)}static get styles(){return[o4`${o3(d6)}`,o4`${o3(d8)}`,ue]}get isOpen(){return!!this._mdcComponent&&this._mdcComponent.isOpen}setOpen(t){return this._open=!0,this}setHeading(t){return this.heading=t,this}setContent(t){return this.content=t,this}setActions(t){return this.actions=t,this}setDismissAction(t){return this.dismissAction=t,this}setStyles(t){return this.styles=t,this}setAvatar(t){return this.avatar=t,this}open(){this._mdcElem&&!this._mdcComponent&&(this._mdcComponent=new d3(this._mdcElem),this._mdcComponent.scrimClickAction=this.dismissAction||null===this.dismissAction?"close":""),this._mdcComponent&&this._mdcComponent.open()}close(t){this._mdcComponent&&this._mdcComponent.close(t)}connectedCallback(){super.connectedCallback(),window.addEventListener("popstate",this._popstateEventBind)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("popstate",this._popstateEventBind),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0)}render(){return aL`
1013
+ `,d1=class extends aK{constructor(){super(...arguments),this._open=!1,this._popstateEventBind=t=>this._onBrowserNavigate(t)}static get styles(){return[o4`${o3(dZ)}`,o4`${o3(dK)}`,d0]}get isOpen(){return!!this._mdcComponent&&this._mdcComponent.isOpen}setOpen(t){return this._open=!0,this}setHeading(t){return this.heading=t,this}setContent(t){return this.content=t,this}setActions(t){return this.actions=t,this}setDismissAction(t){return this.dismissAction=t,this}setStyles(t){return this.styles=t,this}setAvatar(t){return this.avatar=t,this}open(){this._mdcElem&&!this._mdcComponent&&(this._mdcComponent=new dW(this._mdcElem),this._mdcComponent.scrimClickAction=this.dismissAction||null===this.dismissAction?"close":""),this._mdcComponent&&this._mdcComponent.open()}close(t){this._mdcComponent&&this._mdcComponent.close(t)}connectedCallback(){super.connectedCallback(),window.addEventListener("popstate",this._popstateEventBind)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("popstate",this._popstateEventBind),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0)}render(){return aL`
1034
1014
  ${"string"==typeof this.styles?aL`<style>${this.styles}</style>`:this.styles||""}
1035
1015
 
1036
1016
  <div id="dialog"
@@ -1063,7 +1043,27 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
1063
1043
  </div>
1064
1044
  <div class="mdc-dialog__scrim"></div>
1065
1045
  </div>
1066
- `}updated(t){super.updated(t),t.has("_open")&&this._open&&this.open()}_onDialogOpened(){this.dispatchEvent(new d7)}_onDialogClosed(t){if("close"===t&&this.dismissAction&&this.dismissAction.action)this.dismissAction.action(this);else if(t&&this.actions){let n=this.actions.find(n=>n.actionName===t);n&&n.action&&n.action(this)}this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0),this.dispatchEvent(new d9(t))}_onBrowserNavigate(t){this.close("close")}};d4([a6({type:String})],ut.prototype,"heading",void 0),d4([a6({type:Object,attribute:!1})],ut.prototype,"content",void 0),d4([a6({type:Array,attribute:!1})],ut.prototype,"actions",void 0),d4([a6({type:Object,attribute:!1})],ut.prototype,"dismissAction",void 0),d4([a6({type:Boolean})],ut.prototype,"avatar",void 0),d4([a6()],ut.prototype,"styles",void 0),d4([a6({attribute:!1})],ut.prototype,"_open",void 0),d4([a9("#dialog")],ut.prototype,"_mdcElem",void 0),ut=d4([a3("or-mwc-dialog")],ut);let un="^[ ]*(?:Lat: )?(-?\\d+\\.?\\d*)[, ]+(?:Lng: )?(-?\\d+\\.?\\d*)[ ]*$";function ui(t){return n=>{if("Enter"===n.code||"NumpadEnter"===n.code){let i=n.target.value,r=i?{}:void 0;if(i){let t=i.split(/[ ,]/).filter(t=>!!t);2===t.length&&(r=new sw.LngLat(Number.parseFloat(t[0]),Number.parseFloat(t[1])))}t(r)}}}class ur{constructor(t=!1,n){this._readonly=!1,this._readonly=t,this._valueChangedHandler=n}onAdd(t){this.map=t;let n=document.createElement("div");n.classList.add("maplibregl-ctrl"),n.classList.add("maplibregl-ctrl-group");let i=new dZ;return i.type=tH.TEXT,i.outlined=!0,i.compact=!0,i.readonly=this._readonly,i.icon="crosshairs-gps",i.value=this._value,i.pattern=un,i.onkeyup=ui(this._valueChangedHandler),n.appendChild(i),this.elem=n,this.input=i,n}onRemove(t){this.map=void 0,this.elem=void 0}set readonly(t){this._readonly=t,this.input&&(this.input.readonly=t)}set value(t){this._value=t,this.input&&(this.input.value=t)}}class uo{onAdd(t){this.map=t;let n=document.createElement("div");n.classList.add("maplibregl-ctrl"),n.classList.add("maplibregl-ctrl-group");let i=document.createElement("button");i.className="maplibregl-ctrl-compass",i.addEventListener("click",n=>t.flyTo({center:this.pos,zoom:t.getZoom()}));let r=document.createElement("span");return r.className="maplibregl-ctrl-icon",i.appendChild(r),n.appendChild(i),this.elem=n,n}onRemove(t){this.map=void 0,this.elem=void 0}}var ua=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 us extends CustomEvent{constructor(t){super(us.NAME,{bubbles:!0,composed:!0,detail:t})}}us.NAME="or-map-asset-card-load-asset";let ul={default:{exclude:["notes"]},assetTypes:{}},uc=class extends sd(sx)(aK){constructor(){super(...arguments),this.useAssetColor=!0}static get styles(){return sV}shouldUpdate(t){return(!t.has("assetId")||(this.title="",this.assetIds=this.assetId&&this.assetId.length>0?[this.assetId]:void 0,1!==t.size))&&super.shouldUpdate(t)}_onEvent(t){if("asset"===t.eventType)switch(t.cause){case"READ":case"CREATE":case"UPDATE":this.asset=t.asset;break;case"DELETE":this.asset=void 0}"attribute"===t.eventType&&this.asset&&(this.asset=n1(this.asset,t),this.requestUpdate())}_getCardConfig(){let t=this.config||ul;return this.asset&&t.assetTypes&&t.assetTypes.hasOwnProperty(this.asset.type)?t.assetTypes[this.asset.type]:t.default}render(){var t;if(!this.asset)return aL``;let n=this._getIcon(),i=this._getColor(),r=this._getCardConfig(),o=Object.values(this.asset.attributes).filter(t=>"location"!==t.name),a=r&&r.include?r.include:void 0,s=r&&r.exclude?r.exclude:[],l=o.filter(t=>(!a||a.indexOf(t.name)>=0)&&(!s||0>s.indexOf(t.name))&&(!t.meta||!t.meta.hasOwnProperty("showOnDashboard")||!!nX("showOnDashboard",t))).sort((t=t=>t.name,(n,i)=>{let r=t(n),o=t(i);return r||o?r&&!o?1:!r&&o?-1:r.localeCompare(o):0})),c=sJ(this.markerconfig,this.asset.type);return aL`
1046
+ `}updated(t){super.updated(t),t.has("_open")&&this._open&&this.open()}_onDialogOpened(){this.dispatchEvent(new dJ)}_onDialogClosed(t){if("close"===t&&this.dismissAction&&this.dismissAction.action)this.dismissAction.action(this);else if(t&&this.actions){let n=this.actions.find(n=>n.actionName===t);n&&n.action&&n.action(this)}this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0),this.dispatchEvent(new dQ(t))}_onBrowserNavigate(t){this.close("close")}};dX([a6({type:String})],d1.prototype,"heading",void 0),dX([a6({type:Object,attribute:!1})],d1.prototype,"content",void 0),dX([a6({type:Array,attribute:!1})],d1.prototype,"actions",void 0),dX([a6({type:Object,attribute:!1})],d1.prototype,"dismissAction",void 0),dX([a6({type:Boolean})],d1.prototype,"avatar",void 0),dX([a6()],d1.prototype,"styles",void 0),dX([a6({attribute:!1})],d1.prototype,"_open",void 0),dX([a9("#dialog")],d1.prototype,"_mdcElem",void 0),d1=dX([a3("or-mwc-dialog")],d1);var d2=o(2051),d5=o.n(d2);let d3="^[ ]*(?:Lat: )?(-?\\d+\\.?\\d*)[, ]+(?:Lng: )?(-?\\d+\\.?\\d*)[ ]*$";function d4(t){return n=>{if("Enter"===n.code||"NumpadEnter"===n.code){let i=n.target.value,r=i?{}:void 0;if(i){let t=i.split(/[ ,]/).filter(t=>!!t);2===t.length&&(r=new sw.LngLat(Number.parseFloat(t[0]),Number.parseFloat(t[1])))}t(r)}}}class d6{constructor(t=!1,n){this._readonly=!1,this._readonly=t,this._valueChangedHandler=n}onAdd(t){this.map=t;let n=document.createElement("div");n.classList.add("maplibregl-ctrl"),n.classList.add("maplibregl-ctrl-group");let i=new dN;return i.type=tH.TEXT,i.outlined=!0,i.compact=!0,i.readonly=this._readonly,i.icon="crosshairs-gps",i.value=this._value,i.pattern=d3,i.onkeyup=d4(this._valueChangedHandler),n.appendChild(i),this.elem=n,this.input=i,n}onRemove(t){this.map=void 0,this.elem=void 0}set readonly(t){this._readonly=t,this.input&&(this.input.readonly=t)}set value(t){this._value=t,this.input&&(this.input.value=t)}}o(7561);var d8=o(3087),d7=o.n(d8);function d9(t){let n=t.match(/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/);if(!n)throw Error("Unable to parse URL object");return{protocol:n[1],authority:n[2],path:n[3]||"/",params:n[4]?n[4].split("&"):[]}}function ue(t,n){let i=d9("https://api.mapbox.com");t.protocol=i.protocol,t.authority=i.authority,t.params.push(`access_token=${n}`);let r=t.params.length?`?${t.params.join("&")}`:"";return`${t.protocol}://${t.authority}${t.path}${r}`}var ut=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 un=o(6126),ui=o(7561);class ur{constructor(t,n,i=!1,r=!1,o=!0,a=!0){this._loaded=!1,this._markers=new Map,this._geoJsonSources=[],this._geoJsonLayers=new Map,this._showGeoCodingControl=!1,this._showBoundaryBox=!1,this._useZoomControls=!0,this._showGeoJson=!0,this._clickHandlers=new Map,this._styleParent=t,this._mapContainer=n,this._showGeoCodingControl=i,this._showBoundaryBox=r,this._useZoomControls=o,this._showGeoJson=a}setCenter(t){return this._center=sP(t),this._map&&this._center&&this._map.setCenter(this._center),this}flyTo(t,n){return t||(t=this._center?this._center:this._viewSettings?this._viewSettings.center:void 0),n||(n=this._zoom?this._zoom:this._viewSettings&&this._viewSettings.zoom?this._viewSettings.zoom:void 0),this._map?t&&this._map.flyTo({center:t,zoom:n}):(this._center=t,this._zoom=n),this}resize(){return this._map&&this._map.resize(),this}setZoom(t){return this._zoom=t,this._map&&this._zoom&&this._map.setZoom(this._zoom),this}setControls(t){return this._controls=t,this._map&&(this._controls?this._controls.forEach(t=>{Array.isArray(t)?this._map.addControl(t[0],t[1]):this._map.addControl(t)}):this._map.addControl(new sw.NavigationControl)),this}setGeoJson(t){var n;return this._geoJsonConfig=t,this._map&&(this._geoJsonConfig?this._loadGeoJSON(this._geoJsonConfig):this._loadGeoJSON(null==(n=this._viewSettings)?void 0:n.geoJson)),this}loadViewSettings(){return ut(this,void 0,void 0,function*(){var t;let n=(yield sx.rest.api.MapResource.getSettings()).data;if(n.override)return n.override;let i=sx.displayRealm||"default";return this._viewSettings=n.options?n.options[i]?n.options[i]:n.options.default:null,this._viewSettings&&(this._map&&(this._map.setMinZoom(this._viewSettings.minZoom),this._map.setMaxZoom(this._viewSettings.maxZoom),this._viewSettings.bounds&&this._map.setMaxBounds(this._viewSettings.bounds),this._geoJsonConfig?yield this._loadGeoJSON(this._geoJsonConfig):yield this._loadGeoJSON(null==(t=this._viewSettings)?void 0:t.geoJson)),this._center?this.setCenter(this._center):this.setCenter(this._viewSettings.center)),n})}build(){return ut(this,void 0,void 0,function*(){var n;if(this._loaded)return;let i=document.createElement("style");i.id="maplibreGlStyle",i.textContent=un,this._styleParent.appendChild(i),(i=document.createElement("style")).id="maplibreGeoCoderStyles",i.textContent=ui,this._styleParent.appendChild(i);let r=yield Promise.resolve().then(o.t.bind(o,7415,23)),a=yield this.loadViewSettings(),s={attributionControl:{compact:!0},container:this._mapContainer,style:a,transformRequest:(n,i)=>{if(t||(t=new URL(n).searchParams.get("access_token")||""),0===n.indexOf("mapbox:")){var r,o,a,s,l,c,d,u,m;let h,p,f,b,g,_,y,v;return r=t,n.indexOf("/styles/")>-1&&-1===n.indexOf("/sprite")?{url:(o=n,a=r,(h=d9(o)).path=`/styles/v1${h.path}`,ue(h,a))}:n.indexOf("/sprites/")>-1?{url:(s=n,l=r,b=(f=(p=d9(s)).path.split("."))[0],g=f[1],_="",b.indexOf("@2x")&&(b=b.split("@2x")[0],_="@2x"),p.path=`/styles/v1${b}/sprite${_}.${g}`,ue(p,l))}:n.indexOf("/fonts/")>-1?{url:(c=n,d=r,(y=d9(c)).path=`/fonts/v1${y.path}`,ue(y,d))}:n.indexOf("/v4/")>-1||"Source"===i?{url:(u=n,m=r,(v=d9(u)).path=`/v4/${v.authority}.json`,v.params.push("secure"),ue(v,m))}:void 0}return{headers:new URL(window.origin).hostname===new URL(n).hostname?{Authorization:sx.getAuthorizationHeader()}:{},url:n}}};(this._viewSettings&&(this._useZoomControls&&(s.maxZoom=this._viewSettings.maxZoom,s.minZoom=this._viewSettings.minZoom),this._viewSettings.bounds&&!this._showBoundaryBox&&(s.maxBounds=this._viewSettings.bounds),s.boxZoom=this._viewSettings.boxZoom,s.zoom=this._viewSettings.zoom,s.center=this._viewSettings.center),this._center=this._center||(this._viewSettings?this._viewSettings.center:void 0),s.center=this._center,this._zoom&&(s.zoom=this._zoom),sz())?(this._map=new r.Map(s),yield this._styleLoaded(),this._map.on("click",t=>{this._onMapClick(t.lngLat)}),this._map.on("dblclick",t=>{this._onMapClick(t.lngLat,!0)}),this._showGeoCodingControl&&this._viewSettings&&this._viewSettings.geocodeUrl&&(this._geocoder=new(d7())({forwardGeocode:this._forwardGeocode.bind(this),reverseGeocode:this._reverseGeocode},{maplibregl:sF(),showResultsWhileTyping:!0}),this._geocoder._onKeyDown=d5()(t=>{if(27===t.keyCode&&this._geocoder.options.clearAndBlurOnEsc)return this._geocoder._clear(t),this._geocoder._inputEl.blur();var n=this._geocoder._inputEl.value||t.key;if(!n)return this._geocoder.fresh=!0,9!==t.keyCode&&this._geocoder.clear(t),this._geocoder._clearEl.style.display="none";if(!t.metaKey&&-1===[9,27,37,39,38,40].indexOf(t.keyCode)){if(13===t.keyCode)if(this._geocoder.options.showResultsWhileTyping){this._geocoder.options.showResultMarkers&&this._geocoder._fitBoundsForMarkers(),this._geocoder._inputEl.value=this._geocoder._typeahead.query,this._geocoder.lastSelected=null,this._geocoder._typeahead.selected=null;return}else this._geocoder._typeahead.list.selectingListItem||this._geocoder._geocode(n);n.length>=this._geocoder.options.minLength&&this._geocoder.options.showResultsWhileTyping&&this._geocoder._geocode(n)}},300),this._map.addControl(this._geocoder,"top-left"),this._geocoder._inputEl.addEventListener("change",()=>{var t=this._geocoder._typeahead.selected;this._onGeocodeChange(t)})),this._controls?this._controls.forEach(t=>{Array.isArray(t)?this._map.addControl(t[0],t[1]):this._map.addControl(t)}):(this._map.addControl(new sw.NavigationControl),this._map.addControl(new sw.GeolocateControl({positionOptions:{enableHighAccuracy:!0},showAccuracyCircle:!0,showUserLocation:!0}))),this._geoJsonConfig?yield this._loadGeoJSON(this._geoJsonConfig):yield this._loadGeoJSON(null==(n=this._viewSettings)?void 0:n.geoJson),this._initLongPressEvent(),this.createBoundaryBox()):console.warn("WebGL is not supported in this environment. The map cannot be initialized.")})}_styleLoaded(){return new Promise(t=>{this._map&&this._map.once("style.load",t)})}unload(){this._map&&(this._map.remove(),this._map=void 0)}_onMapClick(t,n=!1){this._mapContainer.dispatchEvent(new u_(t,n))}_loadGeoJSON(t){return ut(this,void 0,void 0,function*(){if(this._geoJsonLayers.size>0&&(this._geoJsonLayers.forEach((t,n)=>this._map.removeLayer(n)),this._geoJsonLayers=new Map),this._geoJsonSources.length>0&&(this._geoJsonSources.forEach(t=>this._map.removeSource(t)),this._geoJsonSources=[]),this._showGeoJson&&t)if("FeatureCollection"==t.source.type){let n=this.groupSourcesByGeometryType(t.source);null==n||n.forEach((t,n)=>{let i=this.addGeoJSONSource({type:"geojson",data:{type:"FeatureCollection",features:t}});i&&this.addGeoJSONLayer(n,i.sourceId)})}else if("Feature"==t.source.type){let n=this.addGeoJSONSource(t.source);n&&this.addGeoJSONLayer(n.source.type,n.sourceId)}else console.error("Could not create layer since source type is neither 'FeatureCollection' nor 'Feature'.")})}groupSourcesByGeometryType(t){let n=new Map;return t.features.forEach(t=>{var i;let r=null!=(i=n.get(t.geometry.type))?i:[];r.push(t),n.set(t.geometry.type,r)}),n}addGeoJSONSource(t){if(!this._map)return void console.error("mapGl instance not found!");let n=Date.now()+"-"+(this._geoJsonSources.length+1);return this._map.addSource(n,t),this._geoJsonSources.push(n),{source:t,sourceId:n}}addGeoJSONLayer(t,n){if(!this._map)return void console.error("mapGl instance not found!");let i=n+"-"+t;if(void 0==this._geoJsonLayers.get(i)){let r=getComputedStyle(this._mapContainer).getPropertyValue("--or-app-color4");(void 0==r||0==r.length)&&(r=su);let o={id:i,source:n};switch(t){case"Point":case"MultiPoint":o.type="circle",o.paint={"circle-radius":12,"circle-color":r},this._geoJsonLayers.set(i,o),this._map.addLayer(o);break;case"LineString":case"MultiLineString":o.type="line",o.paint={"line-color":r,"line-width":4},this._geoJsonLayers.set(i,o),this._map.addLayer(o);break;case"Polygon":case"MultiPolygon":{o.type="fill",o.paint={"fill-color":r,"fill-opacity":.3},this._geoJsonLayers.set(i,o),this._map.addLayer(o);let t=i+"-outline",a={id:t,source:n,type:"line",paint:{"line-color":r,"line-width":2}};this._geoJsonLayers.set(t,a),this._map.addLayer(a);break}case"GeometryCollection":return void console.error("GeometryCollection GeoJSON is not implemented yet!")}}}addMarker(t){t.hasPosition()&&this._updateMarkerElement(t,!0)}removeMarker(t){this._removeMarkerRadius(t),this._updateMarkerElement(t,!1)}onMarkerChanged(t,n){if(this._loaded)switch(n){case"lat":case"lng":case"radius":t.hasPosition()?t._actualMarkerElement?this._updateMarkerPosition(t):this._updateMarkerElement(t,!0):t._actualMarkerElement&&this._updateMarkerElement(t,!1)}}_updateMarkerPosition(t){var n;null==(n=this._markers.get(t))||n.setLngLat([t.lng,t.lat]),this._createMarkerRadius(t)}_updateMarkerElement(t,n){let i=this._markers.get(t);if(i&&(t._actualMarkerElement=void 0,this._removeMarkerClickHandler(t,i.getElement()),i.remove(),this._markers.delete(t)),n){let n=t._createMarkerElement();n&&(i=new sw.Marker({element:n,anchor:"top-left"}).setLngLat([t.lng,t.lat]).addTo(this._map),this._markers.set(t,i),t._actualMarkerElement=i.getElement(),t.interactive&&this._addMarkerClickHandler(t,i.getElement())),t.radius&&this._createMarkerRadius(t)}}_removeMarkerRadius(t){this._map&&this._loaded&&t.radius&&t.lat&&t.lng&&this._map.getSource("circleData")&&(this._map.removeLayer("marker-radius-circle"),this._map.removeSource("circleData"))}_createMarkerRadius(t){this._map&&this._loaded&&t.radius&&t.lat&&t.lng&&(this._removeMarkerRadius(t),this._map.addSource("circleData",{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[t.lng,t.lat]},properties:{}}]}}),this._map.addLayer({id:"marker-radius-circle",type:"circle",source:"circleData",paint:{"circle-radius":["interpolate",["exponential",2],["zoom"],0,0,20,sI(t.radius,t.lat)],"circle-color":"red","circle-opacity":.3,"circle-pitch-alignment":"map"}}))}createBoundaryBox(t=[]){var n,i;if(this._map&&this._loaded&&this._showBoundaryBox&&(null==(n=this._viewSettings)?void 0:n.bounds)){this._map.getSource("bounds")&&(this._map.removeLayer("bounds"),this._map.removeSource("bounds")),4!==t.length&&(t=null==(i=this._viewSettings)?void 0:i.bounds.toString().split(","));var r=[[[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]],[t[0],t[3]]]];this._map.fitBounds([parseFloat(t[0])+.01,parseFloat(t[1])-.01,parseFloat(t[2])-.01,parseFloat(t[3])+.01]),this._map.addSource("bounds",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:r}}}),this._map.addLayer({id:"bounds",type:"fill",source:"bounds",paint:{"fill-color":"#FF0000","fill-opacity":.4}})}}_addMarkerClickHandler(t,n){if(n){let i=n=>{n.stopPropagation(),t._onClick(n)};this._clickHandlers.set(t,i),n.addEventListener("click",i)}}_removeMarkerClickHandler(t,n){let i=this._clickHandlers.get(t);i&&n&&(n.removeEventListener("click",i),this._clickHandlers.delete(t))}_forwardGeocode(t){return ut(this,void 0,void 0,function*(){let n=[];try{let i=this._viewSettings.geocodeUrl+"/search?q="+t.query+"&format=geojson&polygon_geojson=1&addressdetails=1",r=yield fetch(i);for(let t of(yield r.json()).features){let i=[t.bbox[0]+(t.bbox[2]-t.bbox[0])/2,t.bbox[1]+(t.bbox[3]-t.bbox[1])/2],r={type:"Feature",geometry:{type:"Point",coordinates:i},place_name:t.properties.display_name,properties:t.properties,text:t.properties.display_name,place_type:["place"],center:i};n.push(r)}}catch(t){console.error(`Failed to forwardGeocode with error: ${t}`)}return{features:n}})}_reverseGeocode(t){return ut(this,void 0,void 0,function*(){let n=[];try{let i=this._viewSettings.geocodeUrl+"/reverse?lat="+t.lat+"&lon="+t.lon+"&format=geojson&polygon_geojson=1&addressdetails=1",r=yield fetch(i);for(let t of(yield r.json()).features){let i=[t.bbox[0]+(t.bbox[2]-t.bbox[0])/2,t.bbox[1]+(t.bbox[3]-t.bbox[1])/2],r={type:"Feature",geometry:{type:"Point",coordinates:i},place_name:t.properties.display_name,properties:t.properties,text:t.properties.display_name,place_type:["place"],center:i};n.push(r)}}catch(t){console.error(`Failed to reverseGeocode with error: ${t}`)}return{features:n}})}_initLongPressEvent(){if(this._map){let t,n,i=()=>{t&&clearTimeout(t),t=null};this._map.on("touchstart",i=>{i.originalEvent.touches.length>1||(n=i.lngLat,t=setTimeout(()=>{this._onLongPress(n)},500))}),this._map.on("mousedown",i=>{t||(n=i.lngLat,t=setTimeout(()=>{this._onLongPress(n),t=null},500))}),this._map.on("dragstart",i),this._map.on("mouseup",i),this._map.on("touchend",i),this._map.on("touchcancel",i),this._map.on("touchmove",i),this._map.on("moveend",i),this._map.on("gesturestart",i),this._map.on("gesturechange",i),this._map.on("gestureend",i)}}_onLongPress(t){this._mapContainer.dispatchEvent(new uy(t))}_onGeocodeChange(t){this._mapContainer.dispatchEvent(new uv(t))}}let uo=class extends aK{constructor(t,n,i,r,o){super(),this._slices=[],this._highThreshold=99,this._midTreshold=this._highThreshold/10,this._lowTreshold=this._midTreshold/10,this._clusterId=n,this._slices=t,this.lng=i,this.lat=r,this._map=o}slicesMatch(t){for(let[n,,i]of this._slices)if(t[n]!==i)return!1;return!0}render(){return aI`${this._createDonutChart(this._slices)}`}_createDonutChart(t){let n=0;for(let i of t)i.push(n),n+=i[2];let i=n>=this._highThreshold?18:n>=this._midTreshold?16:n>=this._lowTreshold?14:12,r=n>=this._highThreshold?32:n>=this._midTreshold?26:n>=this._lowTreshold?16:12,o=n>=this._highThreshold?28:n>=this._midTreshold?24:n>=this._lowTreshold?16:8,a=r-o,s=Math.round(.6*r),l=2*r,c=n>this._highThreshold;return aI`
1047
+ <svg
1048
+ width="${l}"
1049
+ height="${l}"
1050
+ viewbox="0 0 ${l} ${l}"
1051
+ text-anchor="middle"
1052
+ style="cursor: pointer; pointer-events: auto; font: ${i}px Helvetica Neue,Arial,Helvetica,sans-serif; display: block">
1053
+ ${t.map(([,t,i,r])=>this._donutSegment(r/n,(r+i)/n,o,s,t,a))}
1054
+ <circle cx="${r}" cy="${r}" r="${s}" fill="white" />
1055
+ <text dominant-baseline="central" transform="translate(${r}, ${r})">
1056
+ ${(c?this._highThreshold:n).toLocaleString()+(c?"+":"")}
1057
+ </text>
1058
+ </svg>
1059
+ `}_donutSegment(t,n,i,r,o,a){n-t==1&&(n-=1e-5);let s=2*Math.PI*(t-.25),l=2*Math.PI*(n-.25),c=Math.cos(s),d=Math.sin(s),u=Math.cos(l),m=Math.sin(l),h=+(n-t>.5);return aI`<path fill="#${o}" transform="translate(${a}, ${a})" d="
1060
+ M ${i+r*c} ${i+r*d}
1061
+ L ${i+i*c} ${i+i*d}
1062
+ A ${i} ${i} 0 ${h} 1 ${i+i*u} ${i+i*m}
1063
+ L ${i+r*u} ${i+r*m}
1064
+ A ${r} ${r} 0 ${h} 0 ${i+r*c} ${i+r*d}
1065
+ "
1066
+ />`}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.onClick)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.onClick)}onClick(){var t,n,i,r;return t=this,n=void 0,i=void 0,r=function*(){if(null!=this.lng&&null!=this.lat){let t=yield this._map.getSource("assets").getClusterExpansionZoom(this._clusterId);this._map.easeTo({center:[this.lng,this.lat],zoom:t},{marker:this})}},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())})}};uo=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}([a3("or-cluster-marker")],uo);var ua=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())})};class us extends ur{constructor(t,n,i=!1,r=!1,o=!0,a=!0,s){super(t,n,i,r,o,a),this._assets={},this._assetTypeColors={},this._assetsOnScreen={},this._cachedClusters={},this._clustersOnScreen={},this._onMove=()=>this._updateMarkers(),this._onMoveEnd=t=>{requestAnimationFrame(()=>{var n;t.marker instanceof uo&&(null==(n=this._clustersOnScreen[t.marker._clusterId])||n.remove()),this._updateMarkers()})},this._onData=t=>{this._map&&t.isSourceLoaded&&"assets"===t.sourceId&&(this._map.on("move",this._onMove),this._map.on("moveend",this._onMoveEnd),this._updateMarkers())},this._clusterConfig=s}build(){let t=Object.create(null,{build:{get:()=>super.build}});return ua(this,void 0,void 0,function*(){return t.build.call(this).then(()=>{var t;null==(t=this._map)||t.on("load",()=>ua(this,void 0,void 0,function*(){return yield this.load()}))})})}addAsset(t){var n;if(!this._source)return;let i=this._map.querySourceFeatures("assets");this._hasRequired(t)&&this._isMissing(t,i)&&(t.type in this._assetTypeColors||(this._assetTypeColors[t.type]=null==(n=sB(t.type))?void 0:n.color,this._source.workerOptions.clusterProperties=this._getClusterProperties()),this._assets[t.id]=t,this._source.updateData({add:[us._assetToFeature(t)]}))}addAssets(t){var n;if(!this._source)return;let i=this._map.querySourceFeatures("assets"),r=t.filter(this._hasRequired);if((null==i?void 0:i.length)&&(r=r.filter(t=>this._isMissing(t,i))),r.length){for(let t of r)t.type in this._assetTypeColors||(this._assetTypeColors[t.type]=null==(n=sB(t.type))?void 0:n.color),this._assets[t.id]=t;this._source.workerOptions.clusterProperties=this._getClusterProperties(),this._source.updateData({add:r.map(us._assetToFeature)})}}updateAttribute(t){var n,i,r,o;let a=null==(n=null==t?void 0:t.ref)?void 0:n.id;if(!this._source||!a||!this._assets[a])return;if(null==t.value&&(null==(i=t.ref)?void 0:i.name)==="location"){this._assets[a]=null,null==(r=this._source)||r.updateData({remove:[a]});return}let s=this._assets[a]=n1(structuredClone(this._assets[a]),t),l=s.attributes.location.value,c=Object.entries(us._assetToFeature(s).properties).map(([t,n])=>({key:t,value:n}));null==(o=this._source)||o.updateData({update:[{id:a,newGeometry:l,addOrUpdateProperties:c}]})}removeAssets(t){var n;for(let n of t)this._assets[n]=null;null==(n=this._source)||n.updateData({remove:t})}removeAllAssets(){var t;this._assets={},null==(t=this._source)||t.updateData({removeAll:!0})}load(){return ua(this,void 0,void 0,function*(){var t,n,i,r,o,a;if(!this._map)return void console.warn("MapLibre Map not initialized!");if(this._loaded)return;this._map.getSource("assets")&&(this._map.getLayer("asset")&&this._map.removeLayer("asset"),this._map.getLayer("cluster")&&this._map.removeLayer("cluster"),this._map.removeSource("assets"));let s={type:"circle",source:"assets",paint:{"circle-radius":0}};this._map.addSource("assets",{type:"geojson",cluster:null==(n=null==(t=this._clusterConfig)?void 0:t.cluster)||n,clusterRadius:null!=(r=null==(i=this._clusterConfig)?void 0:i.clusterRadius)?r:180,clusterMaxZoom:null!=(a=null==(o=this._clusterConfig)?void 0:o.clusterMaxZoom)?a:17,clusterProperties:this._getClusterProperties(),promoteId:"id",data:{type:"FeatureCollection",features:[]}}).addLayer(Object.assign(Object.assign({},s),{id:"cluster",filter:["has","point_count"]})).addLayer(Object.assign(Object.assign({},s),{id:"asset",filter:["!",["has","point_count"]]})),this._source=this._map.getSource("assets"),this._map.on("data",this._onData),this._mapContainer.dispatchEvent(new ug),this._loaded=!0})}_updateMarkers(){if(!this._map)return;let t=this._map.querySourceFeatures("assets"),n=this._updateAssets(t);this._updateClusters(t),this._mapContainer.dispatchEvent(new ux(n))}_updateAssets(t){let n={};for(let i of t){if(!i.properties.id)continue;let t=i.properties.id;this._assets[t]&&(n[t]=this._assets[t])}for(let t in this._assetsOnScreen)n[t]||delete this._assetsOnScreen[t];return this._assetsOnScreen=n,Object.values(this._assetsOnScreen)}_updateClusters(t){var n,i;let r={};for(let i of t){if(!i.properties.cluster)continue;let t=i.properties.cluster_id,o=null!=(n=this._cachedClusters[t])?n:this._getClusterMarker(i);o._element instanceof uo&&!o._element.slicesMatch(i.properties)&&(o.remove(),o=this._getClusterMarker(i).addTo(this._map)),r[t]=o,this._clustersOnScreen[t]||o.addTo(this._map)}for(let t in this._clustersOnScreen)r[t]||null==(i=this._clustersOnScreen[t])||i.remove();this._clustersOnScreen=r}_getClusterMarker(t){let n=t.properties.cluster_id,[i,r]=t.geometry.coordinates,o=Object.entries(t.properties).filter(([t])=>t in this._assetTypeColors).map(([t,n])=>[t,this._assetTypeColors[t],n]);return this._cachedClusters[n]=new sw.Marker({element:new uo(o,n,i,r,this._map)}).setLngLat([i,r])}_hasRequired(t){return!!((null==t?void 0:t.id)&&(null==t?void 0:t.type))}_isMissing(t,n){return!(null==n?void 0:n.some(n=>{var i;return(null==(i=n.properties)?void 0:i.id)===t.id}))}_getClusterProperties(){return Object.fromEntries(Object.keys(this._assetTypeColors).map(us._getClusterPropertyExpression))}static _getClusterPropertyExpression(t){return[t,["+",["case",["==",["get",us._clusterProperty],t],1,0]]]}static _assetToFeature({id:t,type:n,name:i,attributes:r}){return{type:"Feature",geometry:r.location.value,properties:{id:t,name:i,[us._clusterProperty]:n}}}}us._clusterProperty="assetType";class ul{onAdd(t){this.map=t;let n=document.createElement("div");n.classList.add("maplibregl-ctrl"),n.classList.add("maplibregl-ctrl-group");let i=document.createElement("button");i.className="maplibregl-ctrl-compass",i.addEventListener("click",n=>t.flyTo({center:this.pos,zoom:t.getZoom()}));let r=document.createElement("span");return r.className="maplibregl-ctrl-icon",i.appendChild(r),n.appendChild(i),this.elem=n,n}onRemove(t){this.map=void 0,this.elem=void 0}}var uc=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 ud extends CustomEvent{constructor(t){super(ud.NAME,{bubbles:!0,composed:!0,detail:t})}}ud.NAME="or-map-asset-card-load-asset";let uu={default:{exclude:["notes"]},assetTypes:{}},um=class extends sd(sx)(aK){constructor(){super(...arguments),this.useAssetColor=!0}static get styles(){return sM}shouldUpdate(t){return(!t.has("assetId")||(this.title="",this.assetIds=this.assetId&&this.assetId.length>0?[this.assetId]:void 0,1!==t.size))&&super.shouldUpdate(t)}_onEvent(t){if("asset"===t.eventType)switch(t.cause){case"READ":case"CREATE":case"UPDATE":this.asset=t.asset;break;case"DELETE":this.asset=void 0}"attribute"===t.eventType&&this.asset&&(this.asset=n1(this.asset,t),this.requestUpdate())}_getCardConfig(){let t=this.config||uu;return this.asset&&t.assetTypes&&t.assetTypes.hasOwnProperty(this.asset.type)?t.assetTypes[this.asset.type]:t.default}render(){var t;if(!this.asset)return aL``;let n=this._getIcon(),i=this._getColor(),r=this._getCardConfig(),o=Object.values(this.asset.attributes).filter(t=>"location"!==t.name),a=r&&r.include?r.include:void 0,s=r&&r.exclude?r.exclude:[],l=o.filter(t=>(!a||a.indexOf(t.name)>=0)&&(!s||0>s.indexOf(t.name))&&(!t.meta||!t.meta.hasOwnProperty("showOnDashboard")||!!nX("showOnDashboard",t))).sort((t=t=>t.name,(n,i)=>{let r=t(n),o=t(i);return r||o?r&&!o?1:!r&&o?-1:r.localeCompare(o):0})),c=sH(this.markerconfig,this.asset.type);return aL`
1067
1067
  <div id="card-container" style="${i?"--internal-or-map-asset-card-header-color: #"+i+";":""}">
1068
1068
  <div id="header">
1069
1069
  ${n?aL`<or-icon icon="${n}"></or-icon>`:""}
@@ -1071,7 +1071,7 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
1071
1071
  </div>
1072
1072
  <div id="attribute-list">
1073
1073
  <ul>
1074
- ${l.map(t=>{if(!this.asset||!this.asset.type)return;let n=tq.getAttributeAndValueDescriptors(this.asset.type,t.name,t);if(n&&n.length){var i,r,o;let a=(i=n[0],function(t,n,i,r,o,a){let s=n0("label",t,n,i,o),l="";if(s||(s=nX("label",t,n&&n.meta?n:void 0)),r&&(l=nJ(nQ("units",t,n,i,o))),!s){let i=t?t.name:n?"string"==typeof n?n:n.name:void 0;s=a||(i?nW(i):void 0)}return s?s+(l?" ("+l+")":""):l}(t,i,this.asset.type,!0,!0,void 0)),s=(r=n[0],o=this.asset.type,nZ(t,r,o,!1,!0,"-")),l={highlighted:c===t.name};return aL`<li class="${s9(l)}"><span class="attribute-name">${a}</span><span class="attribute-value">${s}</span></li>`}})}
1074
+ ${l.map(t=>{if(!this.asset||!this.asset.type)return;let n=tq.getAttributeAndValueDescriptors(this.asset.type,t.name,t);if(n&&n.length){var i,r,o;let a=(i=n[0],function(t,n,i,r,o,a){let s=n0("label",t,n,i,o),l="";if(s||(s=nX("label",t,n&&n.meta?n:void 0)),r&&(l=nJ(nQ("units",t,n,i,o))),!s){let i=t?t.name:n?"string"==typeof n?n:n.name:void 0;s=a||(i?nW(i):void 0)}return s?s+(l?" ("+l+")":""):l}(t,i,this.asset.type,!0,!0,void 0)),s=(r=n[0],o=this.asset.type,nZ(t,r,o,!1,!0,"-")),l={highlighted:c===t.name};return aL`<li class="${sQ(l)}"><span class="attribute-name">${a}</span><span class="attribute-value">${s}</span></li>`}})}
1075
1075
  </ul>
1076
1076
  </div>
1077
1077
  ${r&&r.hideViewAsset?aL``:aL`
@@ -1080,14 +1080,14 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
1080
1080
  </div>
1081
1081
  `}
1082
1082
  </div>
1083
- `}_loadAsset(t){this.dispatchEvent(new us(t))}_getIcon(){var t;if(this.asset)return(null==(t=sD(tq.getAssetDescriptor(this.asset.type)))?void 0:t.icon)||void 0}_getColor(){var t;if(this.asset){let n=null==(t=sD(tq.getAssetDescriptor(this.asset.type)))?void 0:t.color;if(n)return"string"==typeof n?n:n[0].colour}}};ua([a6({type:String,reflect:!0,attribute:!0})],uc.prototype,"assetId",void 0),ua([a6({type:Object,attribute:!0})],uc.prototype,"asset",void 0),ua([a6({type:Object})],uc.prototype,"config",void 0),ua([a6({type:Object})],uc.prototype,"markerconfig",void 0),ua([a6({type:Boolean,attribute:!0})],uc.prototype,"useAssetColor",void 0),uc=ua([a3("or-map-asset-card")],uc);var ud=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 uu extends CustomEvent{constructor(t){super(uu.NAME,{bubbles:!1,composed:!1,detail:t})}}uu.NAME="or-map-legend-changed";let um=class extends aK{constructor(){super(...arguments),this.assetTypes=[],this._excludedTypes=[]}static get styles(){return sq}shouldUpdate(t){return t.has("assetTypes")&&(this._assetTypesInfo={},this.assetTypes.forEach(t=>{var n,i,r;let o=tq.getAssetDescriptor(t),a=null==(n=sD(o))?void 0:n.icon,s=null==(i=sD(o))?void 0:i.color,l=("string"==typeof(r=o)&&(r=tq.getAssetDescriptor(r)),r)?nj.t("label.asset."+r.name,{defaultValue:nW(r.name)}):"";this._assetTypesInfo[t]={icon:a,color:s,label:l}})),super.shouldUpdate(t)}_onHeaderClick(){this._showLegend&&(this._showLegend.hidden=!this._showLegend.hidden)}render(){return aL`
1083
+ `}_loadAsset(t){this.dispatchEvent(new ud(t))}_getIcon(){var t;if(this.asset)return(null==(t=sB(tq.getAssetDescriptor(this.asset.type)))?void 0:t.icon)||void 0}_getColor(){var t;if(this.asset){let n=null==(t=sB(tq.getAssetDescriptor(this.asset.type)))?void 0:t.color;if(n)return"string"==typeof n?n:n[0].colour}}};uc([a6({type:String,reflect:!0,attribute:!0})],um.prototype,"assetId",void 0),uc([a6({type:Object,attribute:!0})],um.prototype,"asset",void 0),uc([a6({type:Object})],um.prototype,"config",void 0),uc([a6({type:Object})],um.prototype,"markerconfig",void 0),uc([a6({type:Boolean,attribute:!0})],um.prototype,"useAssetColor",void 0),um=uc([a3("or-map-asset-card")],um);var uh=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 up extends CustomEvent{constructor(t){super(up.NAME,{bubbles:!1,composed:!1,detail:t})}}up.NAME="or-map-legend-changed";let uf=class extends aK{constructor(){super(...arguments),this.assetTypes=[],this.excludedTypes=[]}static get styles(){return sA}shouldUpdate(t){return t.has("assetTypes")&&(this._assetTypesInfo={},this.assetTypes.forEach(t=>{var n,i,r;let o=tq.getAssetDescriptor(t),a=null==(n=sB(o))?void 0:n.icon,s=null==(i=sB(o))?void 0:i.color,l=("string"==typeof(r=o)&&(r=tq.getAssetDescriptor(r)),r)?nj.t("label.asset."+r.name,{defaultValue:nW(r.name)}):"";this._assetTypesInfo[t]={icon:a,color:s,label:l}})),super.shouldUpdate(t)}_onHeaderClick(){this._showLegend&&(this._showLegend.hidden=!this._showLegend.hidden)}render(){return aL`
1084
1084
  <div id="legend">
1085
1085
  <div id="legend-title" @click="${()=>this._onHeaderClick()}">
1086
1086
  <or-translate value="mapPage.legendTitle"></or-translate><or-icon style="cursor: pointer" icon="menu"></or-icon>
1087
1087
  </div>
1088
1088
  <div id="legend-content" hidden>
1089
1089
  <ul>
1090
- ${this.assetTypes.map(t=>aL` <li id="asset-legend" data-asset-type="${t}" style="display: flex;">
1090
+ ${this.assetTypes.map(t=>aL`<li id="asset-legend" data-asset-type="${t}" style="display: flex;">
1091
1091
  <or-icon
1092
1092
  icon="${this._assetTypesInfo[t].icon}"
1093
1093
  style="color: #${this._assetTypesInfo[t].color}"
@@ -1095,14 +1095,14 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
1095
1095
  <span id="asset-label" style="flex: 1">${this._assetTypesInfo[t].label}</span>
1096
1096
  <or-mwc-input
1097
1097
  .type="${tH.CHECKBOX}"
1098
- .value="${!this._excludedTypes.includes(t)}"
1099
- @or-mwc-input-changed="${n=>{n.detail.value?this._excludedTypes.splice(this._excludedTypes.indexOf(t),1):this._excludedTypes.push(t),this.dispatchEvent(new uu(this._excludedTypes))}}"
1098
+ .value="${!this.excludedTypes.includes(t)}"
1099
+ @or-mwc-input-changed="${n=>{n.detail.value?this.excludedTypes.splice(this.excludedTypes.indexOf(t),1):this.excludedTypes.push(t),this.requestUpdate(),this.dispatchEvent(new up(this.excludedTypes))}}"
1100
1100
  ></or-mwc-input>
1101
1101
  </li>`)}
1102
1102
  </ul>
1103
1103
  </div>
1104
1104
  </div>
1105
- `}};ud([a6({type:Array})],um.prototype,"assetTypes",void 0),ud([a9("#legend-content")],um.prototype,"_showLegend",void 0),um=ud([a3("or-map-legend")],um);var uh=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 up extends CustomEvent{constructor(){super(up.NAME,{bubbles:!0,composed:!0})}}up.NAME="or-map-loaded";class uf extends CustomEvent{constructor(t,n=!1){super(uf.NAME,{detail:{doubleClick:n,lngLat:t},bubbles:!0,composed:!0})}}uf.NAME="or-map-clicked";class ub extends CustomEvent{constructor(t){super(ub.NAME,{detail:{doubleClick:!1,lngLat:t},bubbles:!0,composed:!0})}}ub.NAME="or-map-long-press";class ug extends CustomEvent{constructor(t){super(ug.NAME,{detail:{geocode:t},bubbles:!0,composed:!0})}}ug.NAME="or-map-geocoder-change";class u_ extends CustomEvent{constructor(t){super(u_.NAME,{detail:t,bubbles:!0,composed:!0})}}u_.NAME="or-map-markers-changed";let uy=(t,n,i,r,o,a)=>{let s,l=!!(a&&a.disabled),c=!!(a&&a.readonly),d=!!(a&&a.compact),u=!!(a&&a.comfortable),m=new uo,h=t=>{o&&(void 0!==t?o({value:t?sC(t):null}):o(void 0))},p=new ur(l,h);return{templateFunction:(n,i,r,o,a,f)=>{let b,g;n&&(b=(s=sA(n))?Object.values(s):void 0);let _=b?b.join(", "):void 0;m.pos=s||void 0,p.readonly=l||c||o||r,p.value=_;let y=sD(t),v=t=>{if(!c&&!l)if(s=t?sA(t):null,g){let t=g.shadowRoot.getElementById("geo-json-point-marker");t.lng=s?s.lng:void 0,t.lat=s?s.lat:void 0,p.value=(b=s?Object.values(s):void 0)?b.join(", "):void 0}else h(s)},x=[[m,"bottom-left"],[p,"top-right"]];if(!c){let t=new sw.GeolocateControl({positionOptions:{enableHighAccuracy:!0},showAccuracyCircle:!1,showUserLocation:!1});t.on("geolocate",t=>{v(new sw.LngLat(t.coords.longitude,t.coords.latitude))}),t.on("outofmaxbounds",t=>{v(new sw.LngLat(t.coords.longitude,t.coords.latitude))}),x.push([t,"bottom-left"])}let w=aL`
1105
+ `}};uh([a6({type:Array})],uf.prototype,"assetTypes",void 0),uh([a6({type:Array})],uf.prototype,"excludedTypes",void 0),uh([a9("#legend-content")],uf.prototype,"_showLegend",void 0),uf=uh([a3("or-map-legend")],uf);var ub=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 ug extends CustomEvent{constructor(){super(ug.NAME,{bubbles:!0,composed:!0})}}ug.NAME="or-map-loaded";class u_ extends CustomEvent{constructor(t,n=!1){super(u_.NAME,{detail:{doubleClick:n,lngLat:t},bubbles:!0,composed:!0})}}u_.NAME="or-map-clicked";class uy extends CustomEvent{constructor(t){super(uy.NAME,{detail:{doubleClick:!1,lngLat:t},bubbles:!0,composed:!0})}}uy.NAME="or-map-long-press";class uv extends CustomEvent{constructor(t){super(uv.NAME,{detail:{geocode:t},bubbles:!0,composed:!0})}}uv.NAME="or-map-geocoder-change";class ux extends CustomEvent{constructor(t){super(ux.NAME,{detail:t,bubbles:!0,composed:!0})}}ux.NAME="or-map-markers-changed";let uw=(t,n,i,r,o,a)=>{let s,l=!!(a&&a.disabled),c=!!(a&&a.readonly),d=!!(a&&a.compact),u=!!(a&&a.comfortable),m=new ul,h=t=>{o&&(void 0!==t?o({value:t?sO(t):null}):o(void 0))},p=new d6(l,h);return{templateFunction:(n,i,r,o,a,f)=>{let b,g;n&&(b=(s=sP(n))?Object.values(s):void 0);let _=b?b.join(", "):void 0;m.pos=s||void 0,p.readonly=l||c||o||r,p.value=_;let y=sB(t),v=t=>{if(!c&&!l)if(s=t?sP(t):null,g){let t=g.shadowRoot.getElementById("geo-json-point-marker");t.lng=s?s.lng:void 0,t.lat=s?s.lat:void 0,p.value=(b=s?Object.values(s):void 0)?b.join(", "):void 0}else h(s)},x=[[m,"bottom-left"],[p,"top-right"]];if(!c){let t=new sw.GeolocateControl({positionOptions:{enableHighAccuracy:!0},showAccuracyCircle:!1,showUserLocation:!1});t.on("geolocate",t=>{v(new sw.LngLat(t.coords.longitude,t.coords.latitude))}),t.on("outofmaxbounds",t=>{v(new sw.LngLat(t.coords.longitude,t.coords.latitude))}),x.push([t,"bottom-left"])}let w=aL`
1106
1106
  <or-map id="geo-json-point-map" class="or-map" @or-map-long-press="${t=>{v(t.detail.lngLat)}}" .center="${b}" .controls="${x}" .showGeoCodingControl=${!c}>
1107
1107
  <or-map-marker id="geo-json-point-marker" active .lng="${s?s.lng:void 0}" .lat="${s?s.lat:void 0}" .icon="${y?y.icon:void 0}" .activeColor="${y?"#"+y.color:void 0}" .colour="${y?"#"+y.color:void 0}"></or-map-marker>
1108
1108
  </or-map>
@@ -1117,8 +1117,8 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
1117
1117
  }
1118
1118
  </style>
1119
1119
  <div id="geo-json-point-input-compact-wrapper">
1120
- <or-mwc-input style="width: auto;" .comfortable="${u}" .type="${tH.TEXT}" .value="${_}" .pattern="${un}" @keyup="${t=>ui(h)(t)}"></or-mwc-input>
1121
- <or-mwc-input style="width: auto;" .type="${tH.BUTTON}" compact icon="crosshairs-gps" @or-mwc-input-changed="${()=>{var n,i;n=new ut().setContent(t).setStyles(aL`
1120
+ <or-mwc-input style="width: auto;" .comfortable="${u}" .type="${tH.TEXT}" .value="${_}" .pattern="${d3}" @keyup="${t=>d4(h)(t)}"></or-mwc-input>
1121
+ <or-mwc-input style="width: auto;" .type="${tH.BUTTON}" compact icon="crosshairs-gps" @or-mwc-input-changed="${()=>{var n,i;n=new d1().setContent(t).setStyles(aL`
1122
1122
  <style>
1123
1123
  .dialog-container {
1124
1124
  flex-direction: column !important;
@@ -1132,9 +1132,9 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
1132
1132
  min-height: 600px !important;
1133
1133
  }
1134
1134
  </style>
1135
- `).setActions([{actionName:"none",content:"none",action:()=>{v(null),h(s)}},{actionName:"ok",content:"ok",action:()=>{h(s)}},{default:!0,actionName:"cancel",content:"cancel"}]),i||(i=ut.DialogHostElement||document.body),n.setOpen(!0),n.addEventListener(d7.NAME,t=>{t.stopPropagation()}),n.addEventListener(d9.NAME,t=>{t.stopPropagation(),window.setTimeout(()=>{n.parentElement&&n.parentElement.removeChild(n)},0)}),i.append(n),g=n}}"></or-mwc-input>
1135
+ `).setActions([{actionName:"none",content:"none",action:()=>{v(null),h(s)}},{actionName:"ok",content:"ok",action:()=>{h(s)}},{default:!0,actionName:"cancel",content:"cancel"}]),i||(i=d1.DialogHostElement||document.body),n.setOpen(!0),n.addEventListener(dJ.NAME,t=>{t.stopPropagation()}),n.addEventListener(dQ.NAME,t=>{t.stopPropagation(),window.setTimeout(()=>{n.parentElement&&n.parentElement.removeChild(n)},0)}),i.append(n),g=n}}"></or-mwc-input>
1136
1136
  </div>
1137
- `}return w},supportsHelperText:!1,supportsLabel:!1,supportsSendButton:!1,validator:()=>!s||void 0!==s.lat&&null!==s.lat&&void 0!==s.lng&&null!==s.lng}},uv=class extends aK{constructor(){super(),this.showGeoCodingControl=!1,this.showBoundaryBoxControl=!1,this.useZoomControl=!0,this.showGeoJson=!0,this.boundary=[],this._loaded=!1,this.addEventListener(s$.NAME,this._onMarkerChangedEvent)}addAssetMarker(t){var n,i,r,o,a;let s=null==(n=null==t?void 0:t.attributes)?void 0:n.location.value;(null==s?void 0:s.coordinates)&&(null==(i=this._map)||i.addAssetMarker(null!=(r=t.id)?r:"",null!=(o=t.name)?o:"",null!=(a=t.type)?a:"",s.coordinates[0],s.coordinates[1],t))}cleanUpAssetMarkers(){var t;null==(t=this._map)||t.cleanUpAssetMarkers()}reload(){var t,n,i,r;return t=this,n=void 0,i=void 0,r=function*(){var t;yield null==(t=this._map)?void 0:t.load()},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())})}firstUpdated(t){super.firstUpdated(t),sx.ready&&this.loadMap()}connectedCallback(){super.connectedCallback()}disconnectedCallback(){var t;super.disconnectedCallback(),this._resizeObserver&&this._resizeObserver.disconnect(),null==(t=this._map)||t.unload()}render(){return aL`
1137
+ `}return w},supportsHelperText:!1,supportsLabel:!1,supportsSendButton:!1,validator:()=>!s||void 0!==s.lat&&null!==s.lat&&void 0!==s.lng&&null!==s.lng}},uF=class extends aK{constructor(){super(),this.showGeoCodingControl=!1,this.showBoundaryBoxControl=!1,this.useZoomControl=!0,this.showGeoJson=!0,this.boundary=[],this._loaded=!1,this.addEventListener(sS.NAME,this._onMarkerChangedEvent)}addAsset(t){var n;null==(n=this._map)||n.addAsset(t)}addAssets(t){var n;null==(n=this._map)||n.addAssets(t)}updateAttribute(t){var n;null==(n=this._map)||n.updateAttribute(t)}removeAssets(t){var n;null==(n=this._map)||n.removeAssets(t)}removeAllAssets(){var t;null==(t=this._map)||t.removeAllAssets()}firstUpdated(t){super.firstUpdated(t),sx.ready&&this.loadMap()}disconnectedCallback(){var t;super.disconnectedCallback(),this._resizeObserver&&this._resizeObserver.disconnect(),null==(t=this._map)||t.unload()}render(){return aL`
1138
1138
  <div id="container">
1139
1139
  <div id="map"></div>
1140
1140
  <slot></slot>
@@ -1142,5 +1142,5 @@ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionDat
1142
1142
  <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAABGdBTUEAAYagMeiWXwAAAAJiS0dEAP+Hj8y/AAAESUlEQVRIx5XVbWzdZRnH8c//f07POe36sK7SrYXZjYGzbBokOqd4QtKATdnMDFFSkoFzmWGRQOAFSoYnsBSzxBdmGsN4Y7LEFwZkUdHpDoja/AnJjBvp1sm2upW5PtAV+zBS+7Tz//tiLe0emPF+d9/39fvmunJf9+8K3HBF1drFzurVn5+5XkTwPwBNOt1s0pCjDnnT+Xzy/wOa5jaXnLLfLwzlF0WENwaYckyvUTHS1tnjl+6JFqk+JoMOqqy2JqjPVpXP1k7U1+Ty8paBPk97NX/pYwEdgZUetNkdlirDrHGnyv6y5r3lm4M2WVzwpJfz8XUBHTntnrJO6qqLWE9u/125zBNq0WebN/PXAjqq/cBOVWDasCEsd5MsmEzt/3xP+S6fwNsezPdfBejI6fCEDMa95oAT/t31pVxDQ6p6oy2WYSb18w0D2V3Klez2w3y8CNAR2G6vShxXUCxMkXLvS7Y6E/5+3emaJ92JqezzG+8M2nHW/flTi59xladU4phtfluYgnsDWUt8Nv7+8UfO73UUuenvDLxuCKu0RQt90BFo14wxzzpamD8uExtHSsu5HSP7XMCtZ5uTPyO0SdVCBlXahHjNG4WFrGY9Y4tXzODL7zb7NYJS64eHzWK92xYAa9yBKa8Wphf0xaQ4XOz0qF9JhMnXh//mIm4dnDSMOusWALepwQUnrm2t4pi9hrGyP+ccloxV6kOZFemoWi2mOpclaQycqGlt9R8XHS/GixinnVWvbDpjDEEpNpdnWrtd+HvZWzMQT9xjj1iXzUau6MPS9X9NKOeTmqzPpZWwfMkEKnza2ivimqxCKZjQa9BMmFI2D+gxibql4z7EiobYOSy1o7V6Xt1aYacGvD/7lse1+GZ9t0Zc8kHaGcOa1K6o+FePL1iy7K7wYHy70FZa9+qVWOm7tgslfpecKcy46GS0xXKM6g6d14VU+RfTnRJ8Y223w8j4tkMOOeR1j6nAMT8tzkCUcvlbn3ImbJn0RyWC+1af1Iv6ukcbf+aIRKDR3b5ipVCiy+PenaupWRsSfzCWim0ftUmdiqrJwWLpbmk3196UfXG0X6NKIWKDXva0I0UQZT2nRaDfc/mhgCj0PS9ImZzefbg5fliIvuTA++/0ZaYDTDqqpzhn6lHoW36iSuLHnslfCiBqdMBGDI6/0LUhfkgGiWFbC29c+epRaJMX3YJuD+R75l15wG4DaKh5dsPJsj0GXLaawavkWY/MyUcU/JOPHCkK7fAjNZiIf/PeX/vWx1814muF0Y/EKWs95mFVuKhgX352EYAoY5vnNSDRF/9p/MgHfQ2dldNIqbPeJm2aBBix20vzg26RpUUpLfb43FxZU4YMmEJGoxXKQeIfCg4uzMkrTDVitZ0ecst1B05i0Cv26Vk8H68JjFKabXa/Zkul5w5Lxp120EHdlyu/AQCiQI1P+YxaGcwY1+20kasnM/wXCa5/Ik1hKTEAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTktMDgtMjBUMTU6MTc6NTUrMDA6MDCwJSdSAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE5LTA4LTIwVDE1OjE3OjU1KzAwOjAwwXif7gAAAABJRU5ErkJggg==" />
1143
1143
  </a>
1144
1144
  </div>
1145
- `}updated(t){var n;super.updated(t),(t.has("center")||t.has("zoom"))&&this.flyTo(this.center,this.zoom),t.has("boundary")&&this.showBoundaryBoxControl&&(null==(n=this._map)||n.createBoundaryBox(this.boundary))}refresh(){this._map&&this._map.loadViewSettings().then(()=>{this._map&&(this._map.setCenter(),this._map.flyTo())})}loadMap(){this._loaded||(this._mapContainer&&this._slotElement&&(this._map=new sN(this.shadowRoot,this._mapContainer,this.showGeoCodingControl,this.showBoundaryBoxControl,this.useZoomControl,this.showGeoJson,this.cluster).setCenter(this.center).setZoom(this.zoom).setControls(this.controls).setGeoJson(this.geoJson),this._map.build().then(()=>{var t,n;null==(t=this._resizeObserver)||t.disconnect(),this._resizeObserver=new ResizeObserver(sM()(()=>{this.resize()},200));let i=null==(n=this._mapContainer)?void 0:n.parentElement;i&&this._resizeObserver.observe(i),this._slotElement.assignedNodes({flatten:!0}).forEach(t=>{t instanceof sX&&this._map.addMarker(t)})})),this._loaded=!0)}resize(){this._map&&this._map.resize()}flyTo(t,n){this._map&&this._map.flyTo(t,n)}_removeMarker(t){var n;null==(n=this._map)||n.removeMarker(t)}_onMarkerChangedEvent(t){this._map&&this._map.onMarkerChanged(t.detail.marker,t.detail.property)}};uv.styles=sU,uh([a6({type:Object})],uv.prototype,"cluster",void 0),uh([a6({type:String,converter:{fromAttribute(t,n){if(!t)return;let i=t.split(",");if(2!==i.length)return;let r=Number(i[0]),o=Number(i[1]);return new sw.LngLat(r,o)},toAttribute(t,n){let i=sA(t);return i?""+i.lng+","+i.lat:""}}})],uv.prototype,"center",void 0),uh([a6({type:Number})],uv.prototype,"zoom",void 0),uh([a6({type:Boolean})],uv.prototype,"showGeoCodingControl",void 0),uh([a6({type:Boolean})],uv.prototype,"showBoundaryBoxControl",void 0),uh([a6({type:Boolean})],uv.prototype,"useZoomControl",void 0),uh([a6({type:Object})],uv.prototype,"geoJson",void 0),uh([a6({type:Boolean})],uv.prototype,"showGeoJson",void 0),uh([a6({type:Array})],uv.prototype,"boundary",void 0),uh([a9("#map")],uv.prototype,"_mapContainer",void 0),uh([a9("slot")],uv.prototype,"_slotElement",void 0),uv=uh([a3("or-map")],uv)})(),a})());
1145
+ `}updated(t){var n;super.updated(t),(t.has("center")||t.has("zoom"))&&this.flyTo(this.center,this.zoom),t.has("boundary")&&this.showBoundaryBoxControl&&(null==(n=this._map)||n.createBoundaryBox(this.boundary))}refresh(){this._map&&this._map.loadViewSettings().then(()=>{this._map&&(this._map.setCenter(),this._map.flyTo())})}loadMap(){this._loaded||(this._mapContainer&&this._slotElement&&(this._map=new us(this.shadowRoot,this._mapContainer,this.showGeoCodingControl,this.showBoundaryBoxControl,this.useZoomControl,this.showGeoJson,this.cluster).setCenter(this.center).setZoom(this.zoom).setControls(this.controls).setGeoJson(this.geoJson),this._map.build().then(()=>{var t,n;null==(t=this._resizeObserver)||t.disconnect(),this._resizeObserver=new ResizeObserver(d5()(()=>{this.resize()},200));let i=null==(n=this._mapContainer)?void 0:n.parentElement;i&&this._resizeObserver.observe(i),this._slotElement.assignedNodes({flatten:!0}).forEach(t=>{t instanceof sL&&this._map.addMarker(t)})})),this._loaded=!0)}resize(){this._map&&this._map.resize()}flyTo(t,n){this._map&&this._map.flyTo(t,n)}_removeMarker(t){var n;null==(n=this._map)||n.removeMarker(t)}_onMarkerChangedEvent(t){this._map&&this._map.onMarkerChanged(t.detail.marker,t.detail.property)}};uF.styles=sT,ub([a6({type:Object})],uF.prototype,"cluster",void 0),ub([a6({type:String,converter:{fromAttribute(t,n){if(!t)return;let i=t.split(",");if(2!==i.length)return;let r=Number(i[0]),o=Number(i[1]);return new sw.LngLat(r,o)},toAttribute(t,n){let i=sP(t);return i?""+i.lng+","+i.lat:""}}})],uF.prototype,"center",void 0),ub([a6({type:Number})],uF.prototype,"zoom",void 0),ub([a6({type:Boolean})],uF.prototype,"showGeoCodingControl",void 0),ub([a6({type:Boolean})],uF.prototype,"showBoundaryBoxControl",void 0),ub([a6({type:Boolean})],uF.prototype,"useZoomControl",void 0),ub([a6({type:Object})],uF.prototype,"geoJson",void 0),ub([a6({type:Boolean})],uF.prototype,"showGeoJson",void 0),ub([a6({type:Array})],uF.prototype,"boundary",void 0),ub([a9("#map")],uF.prototype,"_mapContainer",void 0),ub([a9("slot")],uF.prototype,"_slotElement",void 0),uF=ub([a3("or-map")],uF)})(),a})());
1146
1146
  //# sourceMappingURL=index.orbundle.js.map