mobility-toolbox-js 2.0.0-beta.33 → 2.0.0-beta.36

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 (116) hide show
  1. package/api/RealtimeAPI.d.ts +6 -6
  2. package/api/RealtimeAPI.d.ts.map +1 -1
  3. package/api/RealtimeAPI.js +613 -0
  4. package/api/RoutingAPI.d.ts.map +1 -1
  5. package/api/RoutingAPI.js +35 -0
  6. package/api/StopsAPI.d.ts +1 -1
  7. package/api/StopsAPI.d.ts.map +1 -1
  8. package/api/StopsAPI.js +38 -0
  9. package/api/index.d.ts +3 -4
  10. package/api/index.d.ts.map +1 -1
  11. package/api/index.js +3 -0
  12. package/api/typedefs.js +73 -0
  13. package/common/api/HttpAPI.d.ts.map +1 -1
  14. package/common/api/HttpAPI.js +57 -0
  15. package/common/api/WebSocketAPI.d.ts +2 -2
  16. package/common/api/WebSocketAPI.d.ts.map +1 -1
  17. package/common/api/WebSocketAPI.js +290 -0
  18. package/common/controls/Control.d.ts +5 -5
  19. package/common/controls/Control.d.ts.map +1 -1
  20. package/common/controls/Control.js +137 -0
  21. package/common/index.js +2 -0
  22. package/common/layers/Layer.d.ts +11 -11
  23. package/common/layers/Layer.d.ts.map +1 -1
  24. package/common/layers/Layer.js +223 -0
  25. package/common/mixins/CopyrightMixin.js +43 -0
  26. package/common/mixins/MapboxLayerMixin.js +198 -0
  27. package/common/mixins/RealtimeLayerMixin.js +650 -0
  28. package/common/mixins/StopFinderMixin.d.ts +3 -3
  29. package/common/mixins/StopFinderMixin.d.ts.map +1 -1
  30. package/common/mixins/StopFinderMixin.js +156 -0
  31. package/common/mixins/UserInteractionsLayerMixin.js +192 -0
  32. package/common/styles/index.js +4 -0
  33. package/common/styles/realtimeDefaultStyle.js +239 -0
  34. package/common/styles/realtimeDelayStyle.js +13 -0
  35. package/common/styles/realtimeSimpleStyle.js +22 -0
  36. package/common/typedefs.js +22 -0
  37. package/common/utils/cleanStopTime.js +28 -0
  38. package/common/utils/compareDepartures.d.ts +1 -1
  39. package/common/utils/compareDepartures.d.ts.map +1 -1
  40. package/common/utils/compareDepartures.js +34 -0
  41. package/common/utils/createCanvas.js +27 -0
  42. package/common/utils/createTrackerFilters.d.ts +1 -1
  43. package/common/utils/createTrackerFilters.d.ts.map +1 -1
  44. package/common/utils/createTrackerFilters.js +67 -0
  45. package/common/utils/getLayersAsFlatArray.js +14 -0
  46. package/common/utils/getMapboxMapCopyrights.js +24 -0
  47. package/common/utils/getMapboxRender.js +74 -0
  48. package/common/utils/getMaplibreRender.js +35 -0
  49. package/common/utils/getRealtimeModeSuffix.js +7 -0
  50. package/common/utils/getUrlWithParams.js +18 -0
  51. package/common/utils/getVehiclePosition.js +63 -0
  52. package/common/utils/index.js +12 -0
  53. package/common/utils/removeDuplicate.d.ts +1 -1
  54. package/common/utils/removeDuplicate.d.ts.map +1 -1
  55. package/common/utils/removeDuplicate.js +15 -0
  56. package/common/utils/renderTrajectories.js +107 -0
  57. package/common/utils/sortByDelay.js +20 -0
  58. package/common/utils/timeUtils.js +39 -0
  59. package/common/utils/trackerConfig.js +170 -0
  60. package/iife.js +5 -0
  61. package/index.d.ts +4 -0
  62. package/index.js +10 -0
  63. package/mapbox/controls/CopyrightControl.d.ts +0 -1
  64. package/mapbox/controls/CopyrightControl.d.ts.map +1 -1
  65. package/mapbox/controls/CopyrightControl.js +53 -0
  66. package/mapbox/controls/index.js +2 -0
  67. package/mapbox/index.js +4 -0
  68. package/mapbox/layers/Layer.d.ts +1 -1
  69. package/mapbox/layers/Layer.d.ts.map +1 -1
  70. package/mapbox/layers/Layer.js +97 -0
  71. package/mapbox/layers/RealtimeLayer.d.ts +4 -4
  72. package/mapbox/layers/RealtimeLayer.d.ts.map +1 -1
  73. package/mapbox/layers/RealtimeLayer.js +270 -0
  74. package/mapbox/layers/index.js +2 -0
  75. package/mapbox/utils.js +43 -0
  76. package/mbt.js +6 -5
  77. package/mbt.js.map +2 -2
  78. package/mbt.min.js +2 -2
  79. package/mbt.min.js.map +2 -2
  80. package/ol/controls/CopyrightControl.js +69 -0
  81. package/ol/controls/RoutingControl.d.ts +6 -5
  82. package/ol/controls/RoutingControl.d.ts.map +1 -1
  83. package/ol/controls/RoutingControl.js +622 -0
  84. package/ol/controls/StopFinderControl.js +36 -0
  85. package/ol/controls/index.js +3 -0
  86. package/ol/index.js +5 -0
  87. package/ol/layers/Layer.d.ts +1 -1
  88. package/ol/layers/Layer.d.ts.map +1 -1
  89. package/ol/layers/Layer.js +148 -0
  90. package/ol/layers/MapboxLayer.d.ts +7 -7
  91. package/ol/layers/MapboxLayer.d.ts.map +1 -1
  92. package/ol/layers/MapboxLayer.js +101 -0
  93. package/ol/layers/MapboxStyleLayer.d.ts +3 -3
  94. package/ol/layers/MapboxStyleLayer.d.ts.map +1 -1
  95. package/ol/layers/MapboxStyleLayer.js +340 -0
  96. package/ol/layers/MaplibreLayer.d.ts +1 -1
  97. package/ol/layers/MaplibreLayer.d.ts.map +1 -1
  98. package/ol/layers/MaplibreLayer.js +35 -0
  99. package/ol/layers/RealtimeLayer.d.ts +2 -2
  100. package/ol/layers/RealtimeLayer.d.ts.map +1 -1
  101. package/ol/layers/RealtimeLayer.js +294 -0
  102. package/ol/layers/RoutingLayer.d.ts +2 -2
  103. package/ol/layers/RoutingLayer.d.ts.map +1 -1
  104. package/ol/layers/RoutingLayer.js +84 -0
  105. package/ol/layers/VectorLayer.d.ts +1 -1
  106. package/ol/layers/VectorLayer.d.ts.map +1 -1
  107. package/ol/layers/VectorLayer.js +38 -0
  108. package/ol/layers/WMSLayer.d.ts +1 -1
  109. package/ol/layers/WMSLayer.d.ts.map +1 -1
  110. package/ol/layers/WMSLayer.js +72 -0
  111. package/ol/layers/index.js +8 -0
  112. package/ol/styles/fullTrajectoryDelayStyle.js +33 -0
  113. package/ol/styles/fullTrajectoryStyle.js +44 -0
  114. package/ol/styles/index.js +2 -0
  115. package/package.json +2 -2
  116. package/setupTests.js +13 -0
package/mbt.min.js CHANGED
@@ -1,4 +1,4 @@
1
- (()=>{var U1=Object.create;var Jg=Object.defineProperty;var N1=Object.getOwnPropertyDescriptor;var V1=Object.getOwnPropertyNames;var G1=Object.getPrototypeOf,j1=Object.prototype.hasOwnProperty;var Vf=(v,l)=>()=>(l||v((l={exports:{}}).exports,l),l.exports),Qg=(v,l)=>{for(var o in l)Jg(v,o,{get:l[o],enumerable:!0})},q1=(v,l,o,c)=>{if(l&&typeof l=="object"||typeof l=="function")for(let i of V1(l))!j1.call(v,i)&&i!==o&&Jg(v,i,{get:()=>l[i],enumerable:!(c=N1(l,i))||c.enumerable});return v};var Fp=(v,l,o)=>(o=v!=null?U1(G1(v)):{},q1(l||!v||!v.__esModule?Jg(o,"default",{value:v,enumerable:!0}):o,v));var Jy=Vf((Yy,Hy)=>{(function(v,l){typeof Yy=="object"&&typeof Hy<"u"?Hy.exports=l():typeof define=="function"&&define.amd?define(l):(v=v||self).RBush=l()})(Yy,function(){"use strict";function v(wt,Lt,Zt,Jt,se){(function ce(oe,ye,be,Me,ir){for(;Me>be;){if(Me-be>600){var Be=Me-be+1,qe=ye-be+1,rr=Math.log(Be),Ce=.5*Math.exp(2*rr/3),Lr=.5*Math.sqrt(rr*Ce*(Be-Ce)/Be)*(qe-Be/2<0?-1:1),yr=Math.max(be,Math.floor(ye-qe*Ce/Be+Lr)),_r=Math.min(Me,Math.floor(ye+(Be-qe)*Ce/Be+Lr));ce(oe,ye,yr,_r,ir)}var br=oe[ye],xr=be,pr=Me;for(l(oe,be,ye),ir(oe[Me],br)>0&&l(oe,be,Me);xr<pr;){for(l(oe,xr,pr),xr++,pr--;ir(oe[xr],br)<0;)xr++;for(;ir(oe[pr],br)>0;)pr--}ir(oe[be],br)===0?l(oe,be,pr):l(oe,++pr,Me),pr<=ye&&(be=pr+1),ye<=pr&&(Me=pr-1)}})(wt,Lt,Zt||0,Jt||wt.length-1,se||o)}function l(wt,Lt,Zt){var Jt=wt[Lt];wt[Lt]=wt[Zt],wt[Zt]=Jt}function o(wt,Lt){return wt<Lt?-1:wt>Lt?1:0}var c=function(wt){wt===void 0&&(wt=9),this._maxEntries=Math.max(4,wt),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function i(wt,Lt,Zt){if(!Zt)return Lt.indexOf(wt);for(var Jt=0;Jt<Lt.length;Jt++)if(Zt(wt,Lt[Jt]))return Jt;return-1}function u(wt,Lt){P(wt,0,wt.children.length,Lt,wt)}function P(wt,Lt,Zt,Jt,se){se||(se=kt(null)),se.minX=1/0,se.minY=1/0,se.maxX=-1/0,se.maxY=-1/0;for(var ce=Lt;ce<Zt;ce++){var oe=wt.children[ce];D(se,wt.leaf?Jt(oe):oe)}return se}function D(wt,Lt){return wt.minX=Math.min(wt.minX,Lt.minX),wt.minY=Math.min(wt.minY,Lt.minY),wt.maxX=Math.max(wt.maxX,Lt.maxX),wt.maxY=Math.max(wt.maxY,Lt.maxY),wt}function F(wt,Lt){return wt.minX-Lt.minX}function U(wt,Lt){return wt.minY-Lt.minY}function N(wt){return(wt.maxX-wt.minX)*(wt.maxY-wt.minY)}function at(wt){return wt.maxX-wt.minX+(wt.maxY-wt.minY)}function yt(wt,Lt){return wt.minX<=Lt.minX&&wt.minY<=Lt.minY&&Lt.maxX<=wt.maxX&&Lt.maxY<=wt.maxY}function Tt(wt,Lt){return Lt.minX<=wt.maxX&&Lt.minY<=wt.maxY&&Lt.maxX>=wt.minX&&Lt.maxY>=wt.minY}function kt(wt){return{children:wt,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Vt(wt,Lt,Zt,Jt,se){for(var ce=[Lt,Zt];ce.length;)if(!((Zt=ce.pop())-(Lt=ce.pop())<=Jt)){var oe=Lt+Math.ceil((Zt-Lt)/Jt/2)*Jt;v(wt,oe,Lt,Zt,se),ce.push(Lt,oe,oe,Zt)}}return c.prototype.all=function(){return this._all(this.data,[])},c.prototype.search=function(wt){var Lt=this.data,Zt=[];if(!Tt(wt,Lt))return Zt;for(var Jt=this.toBBox,se=[];Lt;){for(var ce=0;ce<Lt.children.length;ce++){var oe=Lt.children[ce],ye=Lt.leaf?Jt(oe):oe;Tt(wt,ye)&&(Lt.leaf?Zt.push(oe):yt(wt,ye)?this._all(oe,Zt):se.push(oe))}Lt=se.pop()}return Zt},c.prototype.collides=function(wt){var Lt=this.data;if(!Tt(wt,Lt))return!1;for(var Zt=[];Lt;){for(var Jt=0;Jt<Lt.children.length;Jt++){var se=Lt.children[Jt],ce=Lt.leaf?this.toBBox(se):se;if(Tt(wt,ce)){if(Lt.leaf||yt(wt,ce))return!0;Zt.push(se)}}Lt=Zt.pop()}return!1},c.prototype.load=function(wt){if(!wt||!wt.length)return this;if(wt.length<this._minEntries){for(var Lt=0;Lt<wt.length;Lt++)this.insert(wt[Lt]);return this}var Zt=this._build(wt.slice(),0,wt.length-1,0);if(this.data.children.length)if(this.data.height===Zt.height)this._splitRoot(this.data,Zt);else{if(this.data.height<Zt.height){var Jt=this.data;this.data=Zt,Zt=Jt}this._insert(Zt,this.data.height-Zt.height-1,!0)}else this.data=Zt;return this},c.prototype.insert=function(wt){return wt&&this._insert(wt,this.data.height-1),this},c.prototype.clear=function(){return this.data=kt([]),this},c.prototype.remove=function(wt,Lt){if(!wt)return this;for(var Zt,Jt,se,ce=this.data,oe=this.toBBox(wt),ye=[],be=[];ce||ye.length;){if(ce||(ce=ye.pop(),Jt=ye[ye.length-1],Zt=be.pop(),se=!0),ce.leaf){var Me=i(wt,ce.children,Lt);if(Me!==-1)return ce.children.splice(Me,1),ye.push(ce),this._condense(ye),this}se||ce.leaf||!yt(ce,oe)?Jt?(Zt++,ce=Jt.children[Zt],se=!1):ce=null:(ye.push(ce),be.push(Zt),Zt=0,Jt=ce,ce=ce.children[0])}return this},c.prototype.toBBox=function(wt){return wt},c.prototype.compareMinX=function(wt,Lt){return wt.minX-Lt.minX},c.prototype.compareMinY=function(wt,Lt){return wt.minY-Lt.minY},c.prototype.toJSON=function(){return this.data},c.prototype.fromJSON=function(wt){return this.data=wt,this},c.prototype._all=function(wt,Lt){for(var Zt=[];wt;)wt.leaf?Lt.push.apply(Lt,wt.children):Zt.push.apply(Zt,wt.children),wt=Zt.pop();return Lt},c.prototype._build=function(wt,Lt,Zt,Jt){var se,ce=Zt-Lt+1,oe=this._maxEntries;if(ce<=oe)return u(se=kt(wt.slice(Lt,Zt+1)),this.toBBox),se;Jt||(Jt=Math.ceil(Math.log(ce)/Math.log(oe)),oe=Math.ceil(ce/Math.pow(oe,Jt-1))),(se=kt([])).leaf=!1,se.height=Jt;var ye=Math.ceil(ce/oe),be=ye*Math.ceil(Math.sqrt(oe));Vt(wt,Lt,Zt,be,this.compareMinX);for(var Me=Lt;Me<=Zt;Me+=be){var ir=Math.min(Me+be-1,Zt);Vt(wt,Me,ir,ye,this.compareMinY);for(var Be=Me;Be<=ir;Be+=ye){var qe=Math.min(Be+ye-1,ir);se.children.push(this._build(wt,Be,qe,Jt-1))}}return u(se,this.toBBox),se},c.prototype._chooseSubtree=function(wt,Lt,Zt,Jt){for(;Jt.push(Lt),!Lt.leaf&&Jt.length-1!==Zt;){for(var se=1/0,ce=1/0,oe=void 0,ye=0;ye<Lt.children.length;ye++){var be=Lt.children[ye],Me=N(be),ir=(Be=wt,qe=be,(Math.max(qe.maxX,Be.maxX)-Math.min(qe.minX,Be.minX))*(Math.max(qe.maxY,Be.maxY)-Math.min(qe.minY,Be.minY))-Me);ir<ce?(ce=ir,se=Me<se?Me:se,oe=be):ir===ce&&Me<se&&(se=Me,oe=be)}Lt=oe||Lt.children[0]}var Be,qe;return Lt},c.prototype._insert=function(wt,Lt,Zt){var Jt=Zt?wt:this.toBBox(wt),se=[],ce=this._chooseSubtree(Jt,this.data,Lt,se);for(ce.children.push(wt),D(ce,Jt);Lt>=0&&se[Lt].children.length>this._maxEntries;)this._split(se,Lt),Lt--;this._adjustParentBBoxes(Jt,se,Lt)},c.prototype._split=function(wt,Lt){var Zt=wt[Lt],Jt=Zt.children.length,se=this._minEntries;this._chooseSplitAxis(Zt,se,Jt);var ce=this._chooseSplitIndex(Zt,se,Jt),oe=kt(Zt.children.splice(ce,Zt.children.length-ce));oe.height=Zt.height,oe.leaf=Zt.leaf,u(Zt,this.toBBox),u(oe,this.toBBox),Lt?wt[Lt-1].children.push(oe):this._splitRoot(Zt,oe)},c.prototype._splitRoot=function(wt,Lt){this.data=kt([wt,Lt]),this.data.height=wt.height+1,this.data.leaf=!1,u(this.data,this.toBBox)},c.prototype._chooseSplitIndex=function(wt,Lt,Zt){for(var Jt,se,ce,oe,ye,be,Me,ir=1/0,Be=1/0,qe=Lt;qe<=Zt-Lt;qe++){var rr=P(wt,0,qe,this.toBBox),Ce=P(wt,qe,Zt,this.toBBox),Lr=(se=rr,ce=Ce,oe=void 0,ye=void 0,be=void 0,Me=void 0,oe=Math.max(se.minX,ce.minX),ye=Math.max(se.minY,ce.minY),be=Math.min(se.maxX,ce.maxX),Me=Math.min(se.maxY,ce.maxY),Math.max(0,be-oe)*Math.max(0,Me-ye)),yr=N(rr)+N(Ce);Lr<ir?(ir=Lr,Jt=qe,Be=yr<Be?yr:Be):Lr===ir&&yr<Be&&(Be=yr,Jt=qe)}return Jt||Zt-Lt},c.prototype._chooseSplitAxis=function(wt,Lt,Zt){var Jt=wt.leaf?this.compareMinX:F,se=wt.leaf?this.compareMinY:U;this._allDistMargin(wt,Lt,Zt,Jt)<this._allDistMargin(wt,Lt,Zt,se)&&wt.children.sort(Jt)},c.prototype._allDistMargin=function(wt,Lt,Zt,Jt){wt.children.sort(Jt);for(var se=this.toBBox,ce=P(wt,0,Lt,se),oe=P(wt,Zt-Lt,Zt,se),ye=at(ce)+at(oe),be=Lt;be<Zt-Lt;be++){var Me=wt.children[be];D(ce,wt.leaf?se(Me):Me),ye+=at(ce)}for(var ir=Zt-Lt-1;ir>=Lt;ir--){var Be=wt.children[ir];D(oe,wt.leaf?se(Be):Be),ye+=at(oe)}return ye},c.prototype._adjustParentBBoxes=function(wt,Lt,Zt){for(var Jt=Zt;Jt>=0;Jt--)D(Lt[Jt],wt)},c.prototype._condense=function(wt){for(var Lt=wt.length-1,Zt=void 0;Lt>=0;Lt--)wt[Lt].children.length===0?Lt>0?(Zt=wt[Lt-1].children).splice(Zt.indexOf(wt[Lt]),1):this.clear():u(wt[Lt],this.toBBox)},c})});var X0=Vf((w_,E_)=>{(function(v,l){typeof w_=="object"&&typeof E_<"u"?E_.exports=l():typeof define=="function"&&define.amd?define(l):(v=v||self,v.mapboxgl=l())})(w_,function(){"use strict";var v,l,o;function c(i,u){if(!v)v=u;else if(!l)l=u;else{var P="var sharedChunk = {}; ("+v+")(sharedChunk); ("+l+")(sharedChunk);",D={};v(D),o=u(D),typeof window<"u"&&(o.workerUrl=window.URL.createObjectURL(new Blob([P],{type:"text/javascript"})))}}return c(["exports"],function(i){"use strict";function u(t,n){return t(n={exports:{}},n.exports),n.exports}var P=D;function D(t,n,h,_){this.cx=3*t,this.bx=3*(h-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*n,this.by=3*(_-n)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=_,this.p2x=h,this.p2y=_}D.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},D.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},D.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},D.prototype.solveCurveX=function(t,n){var h,_,w,C,r;for(n===void 0&&(n=1e-6),w=t,r=0;r<8;r++){if(C=this.sampleCurveX(w)-t,Math.abs(C)<n)return w;var e=this.sampleCurveDerivativeX(w);if(Math.abs(e)<1e-6)break;w-=C/e}if((w=t)<(h=0))return h;if(w>(_=1))return _;for(;h<_;){if(C=this.sampleCurveX(w),Math.abs(C-t)<n)return w;t>C?h=w:_=w,w=.5*(_-h)+h}return w},D.prototype.solve=function(t,n){return this.sampleCurveY(this.solveCurveX(t,n))};var F=U;function U(t,n){this.x=t,this.y=n}U.prototype={clone:function(){return new U(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,n){return this.clone()._rotateAround(t,n)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var n=t.x-this.x,h=t.y-this.y;return n*n+h*h},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,n){return Math.atan2(this.x*n-this.y*t,this.x*t+this.y*n)},_matMult:function(t){var n=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=n,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var n=Math.cos(t),h=Math.sin(t),_=h*this.x+n*this.y;return this.x=n*this.x-h*this.y,this.y=_,this},_rotateAround:function(t,n){var h=Math.cos(t),_=Math.sin(t),w=n.y+_*(this.x-n.x)+h*(this.y-n.y);return this.x=n.x+h*(this.x-n.x)-_*(this.y-n.y),this.y=w,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},U.convert=function(t){return t instanceof U?t:Array.isArray(t)?new U(t[0],t[1]):t};var N=typeof self<"u"?self:{},at=Math.pow(2,53)-1;function yt(t,n,h,_){var w=new P(t,n,h,_);return function(C){return w.solve(C)}}var Tt=yt(.25,.1,.25,1);function kt(t,n,h){return Math.min(h,Math.max(n,t))}function Vt(t,n,h){var _=h-n,w=((t-n)%_+_)%_+n;return w===n?h:w}function wt(t){for(var n=[],h=arguments.length-1;h-- >0;)n[h]=arguments[h+1];for(var _=0,w=n;_<w.length;_+=1){var C=w[_];for(var r in C)t[r]=C[r]}return t}var Lt=1;function Zt(){return Lt++}function Jt(){return function t(n){return n?(n^16*Math.random()>>n/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function se(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function ce(t,n){t.forEach(function(h){n[h]&&(n[h]=n[h].bind(n))})}function oe(t,n){return t.indexOf(n,t.length-n.length)!==-1}function ye(t,n,h){var _={};for(var w in t)_[w]=n.call(h||this,t[w],w,t);return _}function be(t,n,h){var _={};for(var w in t)n.call(h||this,t[w],w,t)&&(_[w]=t[w]);return _}function Me(t){return Array.isArray(t)?t.map(Me):typeof t=="object"&&t?ye(t,Me):t}var ir={};function Be(t){ir[t]||(typeof console<"u"&&console.warn(t),ir[t]=!0)}function qe(t,n,h){return(h.y-t.y)*(n.x-t.x)>(n.y-t.y)*(h.x-t.x)}function rr(t){for(var n=0,h=0,_=t.length,w=_-1,C=void 0,r=void 0;h<_;w=h++)n+=((r=t[w]).x-(C=t[h]).x)*(C.y+r.y);return n}function Ce(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function Lr(t){var n={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(_,w,C,r){var e=C||r;return n[w]=!e||e.toLowerCase(),""}),n["max-age"]){var h=parseInt(n["max-age"],10);isNaN(h)?delete n["max-age"]:n["max-age"]=h}return n}var yr=null;function _r(t){if(yr==null){var n=t.navigator?t.navigator.userAgent:null;yr=!!t.safari||!(!n||!(/\b(iPad|iPhone|iPod)\b/.test(n)||n.match("Safari")&&!n.match("Chrome")))}return yr}function br(t){try{var n=N[t];return n.setItem("_mapbox_test_",1),n.removeItem("_mapbox_test_"),!0}catch{return!1}}var xr,pr,$r,Fe,ti=N.performance&&N.performance.now?N.performance.now.bind(N.performance):Date.now.bind(Date),oi=N.requestAnimationFrame||N.mozRequestAnimationFrame||N.webkitRequestAnimationFrame||N.msRequestAnimationFrame,ci=N.cancelAnimationFrame||N.mozCancelAnimationFrame||N.webkitCancelAnimationFrame||N.msCancelAnimationFrame,Ri={now:ti,frame:function(t){var n=oi(t);return{cancel:function(){return ci(n)}}},getImageData:function(t,n){n===void 0&&(n=0);var h=N.document.createElement("canvas"),_=h.getContext("2d");if(!_)throw new Error("failed to create canvas 2d context");return h.width=t.width,h.height=t.height,_.drawImage(t,0,0,t.width,t.height),_.getImageData(-n,-n,t.width+2*n,t.height+2*n)},resolveURL:function(t){return xr||(xr=N.document.createElement("a")),xr.href=t,xr.href},hardwareConcurrency:N.navigator&&N.navigator.hardwareConcurrency||4,get devicePixelRatio(){return N.devicePixelRatio},get prefersReducedMotion(){return!!N.matchMedia&&(pr==null&&(pr=N.matchMedia("(prefers-reduced-motion: reduce)")),pr.matches)}},Wr={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Di={supported:!1,testSupport:function(t){!vn&&Fe&&(sn?dr(t):$r=t)}},vn=!1,sn=!1;function dr(t){var n=t.createTexture();t.bindTexture(t.TEXTURE_2D,n);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,Fe),t.isContextLost())return;Di.supported=!0}catch{}t.deleteTexture(n),vn=!0}N.document&&((Fe=N.document.createElement("img")).onload=function(){$r&&dr($r),$r=null,sn=!0},Fe.onerror=function(){vn=!0,$r=null},Fe.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var xn="01",en=function(t,n){this._transformRequestFn=t,this._customAccessToken=n,this._createSkuToken()};function ji(t){return t.indexOf("mapbox:")===0}en.prototype._createSkuToken=function(){var t=function(){for(var n="",h=0;h<10;h++)n+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",xn,n].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},en.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},en.prototype.transformRequest=function(t,n){return this._transformRequestFn&&this._transformRequestFn(t,n)||{url:t}},en.prototype.normalizeStyleURL=function(t,n){if(!ji(t))return t;var h=Wi(t);return h.path="/styles/v1"+h.path,this._makeAPIURL(h,this._customAccessToken||n)},en.prototype.normalizeGlyphsURL=function(t,n){if(!ji(t))return t;var h=Wi(t);return h.path="/fonts/v1"+h.path,this._makeAPIURL(h,this._customAccessToken||n)},en.prototype.normalizeSourceURL=function(t,n){if(!ji(t))return t;var h=Wi(t);return h.path="/v4/"+h.authority+".json",h.params.push("secure"),this._makeAPIURL(h,this._customAccessToken||n)},en.prototype.normalizeSpriteURL=function(t,n,h,_){var w=Wi(t);return ji(t)?(w.path="/styles/v1"+w.path+"/sprite"+n+h,this._makeAPIURL(w,this._customAccessToken||_)):(w.path+=""+n+h,bn(w))},en.prototype.normalizeTileURL=function(t,n){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!ji(t))return t;var h=Wi(t);h.path=h.path.replace(/(\.(png|jpg)\d*)(?=$)/,(Ri.devicePixelRatio>=2||n===512?"@2x":"")+(Di.supported?".webp":"$1")),h.path=h.path.replace(/^.+\/v4\//,"/"),h.path="/v4"+h.path;var _=this._customAccessToken||function(w){for(var C=0,r=w;C<r.length;C+=1){var e=r[C].match(/^access_token=(.*)$/);if(e)return e[1]}return null}(h.params)||Wr.ACCESS_TOKEN;return Wr.REQUIRE_ACCESS_TOKEN&&_&&this._skuToken&&h.params.push("sku="+this._skuToken),this._makeAPIURL(h,_)},en.prototype.canonicalizeTileURL=function(t,n){var h=Wi(t);if(!h.path.match(/(^\/v4\/)/)||!h.path.match(/\.[\w]+$/))return t;var _="mapbox://tiles/";_+=h.path.replace("/v4/","");var w=h.params;return n&&(w=w.filter(function(C){return!C.match(/^access_token=/)})),w.length&&(_+="?"+w.join("&")),_},en.prototype.canonicalizeTileset=function(t,n){for(var h=!!n&&ji(n),_=[],w=0,C=t.tiles||[];w<C.length;w+=1){var r=C[w];Zn(r)?_.push(this.canonicalizeTileURL(r,h)):_.push(r)}return _},en.prototype._makeAPIURL=function(t,n){var h="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",_=Wi(Wr.API_URL);if(t.protocol=_.protocol,t.authority=_.authority,t.protocol==="http"){var w=t.params.indexOf("secure");w>=0&&t.params.splice(w,1)}if(_.path!=="/"&&(t.path=""+_.path+t.path),!Wr.REQUIRE_ACCESS_TOKEN)return bn(t);if(!(n=n||Wr.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+h);if(n[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+h);return t.params=t.params.filter(function(C){return C.indexOf("access_token")===-1}),t.params.push("access_token="+n),bn(t)};var qn=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Zn(t){return qn.test(t)}var io=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Wi(t){var n=t.match(io);if(!n)throw new Error("Unable to parse URL object");return{protocol:n[1],authority:n[2],path:n[3]||"/",params:n[4]?n[4].split("&"):[]}}function bn(t){var n=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+n}function co(t){if(!t)return null;var n=t.split(".");if(!n||n.length!==3)return null;try{return JSON.parse(decodeURIComponent(N.atob(n[1]).split("").map(function(h){return"%"+("00"+h.charCodeAt(0).toString(16)).slice(-2)}).join("")))}catch{return null}}var zr=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};zr.prototype.getStorageKey=function(t){var n,h=co(Wr.ACCESS_TOKEN);return n=h&&h.u?N.btoa(encodeURIComponent(h.u).replace(/%([0-9A-F]{2})/g,function(_,w){return String.fromCharCode(Number("0x"+w))})):Wr.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+n:"mapbox.eventData:"+n},zr.prototype.fetchEventData=function(){var t=br("localStorage"),n=this.getStorageKey(),h=this.getStorageKey("uuid");if(t)try{var _=N.localStorage.getItem(n);_&&(this.eventData=JSON.parse(_));var w=N.localStorage.getItem(h);w&&(this.anonId=w)}catch{Be("Unable to read from LocalStorage")}},zr.prototype.saveEventData=function(){var t=br("localStorage"),n=this.getStorageKey(),h=this.getStorageKey("uuid");if(t)try{N.localStorage.setItem(h,this.anonId),Object.keys(this.eventData).length>=1&&N.localStorage.setItem(n,JSON.stringify(this.eventData))}catch{Be("Unable to write to LocalStorage")}},zr.prototype.processRequests=function(t){},zr.prototype.postEvent=function(t,n,h,_){var w=this;if(Wr.EVENTS_URL){var C=Wi(Wr.EVENTS_URL);C.params.push("access_token="+(_||Wr.ACCESS_TOKEN||""));var r={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.2",skuId:xn,userId:this.anonId},e=n?wt(r,n):r,s={url:bn(C),headers:{"Content-Type":"text/plain"},body:JSON.stringify([e])};this.pendingRequest=hi(s,function(f){w.pendingRequest=null,h(f),w.saveEventData(),w.processRequests(_)})}},zr.prototype.queueRequest=function(t,n){this.queue.push(t),this.processRequests(n)};var $i,dn,ln=function(t){function n(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.postMapLoadEvent=function(h,_,w,C){this.skuToken=w,(Wr.EVENTS_URL&&C||Wr.ACCESS_TOKEN&&Array.isArray(h)&&h.some(function(r){return ji(r)||Zn(r)}))&&this.queueRequest({id:_,timestamp:Date.now()},C)},n.prototype.processRequests=function(h){var _=this;if(!this.pendingRequest&&this.queue.length!==0){var w=this.queue.shift(),C=w.id,r=w.timestamp;C&&this.success[C]||(this.anonId||this.fetchEventData(),se(this.anonId)||(this.anonId=Jt()),this.postEvent(r,{skuToken:this.skuToken},function(e){e||C&&(_.success[C]=!0)},h))}},n}(zr),na=new(function(t){function n(h){t.call(this,"appUserTurnstile"),this._customAccessToken=h}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.postTurnstileEvent=function(h,_){Wr.EVENTS_URL&&Wr.ACCESS_TOKEN&&Array.isArray(h)&&h.some(function(w){return ji(w)||Zn(w)})&&this.queueRequest(Date.now(),_)},n.prototype.processRequests=function(h){var _=this;if(!this.pendingRequest&&this.queue.length!==0){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var w=co(Wr.ACCESS_TOKEN),C=w?w.u:Wr.ACCESS_TOKEN,r=C!==this.eventData.tokenU;se(this.anonId)||(this.anonId=Jt(),r=!0);var e=this.queue.shift();if(this.eventData.lastSuccess){var s=new Date(this.eventData.lastSuccess),f=new Date(e),y=(e-this.eventData.lastSuccess)/864e5;r=r||y>=1||y<-1||s.getDate()!==f.getDate()}else r=!0;if(!r)return this.processRequests();this.postEvent(e,{"enabled.telemetry":!1},function(b){b||(_.eventData.lastSuccess=e,_.eventData.tokenU=C)},h)}},n}(zr)),fe=na.postTurnstileEvent.bind(na),Ze=new ln,no=Ze.postMapLoadEvent.bind(Ze),wn=500,ii=50;function En(){N.caches&&!$i&&($i=N.caches.open("mapbox-tiles"))}function Ei(t){var n=t.indexOf("?");return n<0?t:t.slice(0,n)}var Xn,ai=1/0;function Ge(){return Xn==null&&(Xn=N.OffscreenCanvas&&new N.OffscreenCanvas(1,1).getContext("2d")&&typeof N.createImageBitmap=="function"),Xn}var Rr={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(Rr);var kr=function(t){function n(h,_,w){_===401&&Zn(w)&&(h+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,h),this.status=_,this.url=w,this.name=this.constructor.name,this.message=h}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},n}(Error),qi=Ce()?function(){return self.worker&&self.worker.referrer}:function(){return(N.location.protocol==="blob:"?N.parent:N).location.href},Ki,Tr,ho=function(t,n){if(!(/^file:/.test(h=t.url)||/^file:/.test(qi())&&!/^\w+:/.test(h))){if(N.fetch&&N.Request&&N.AbortController&&N.Request.prototype.hasOwnProperty("signal"))return function(_,w){var C,r=new N.AbortController,e=new N.Request(_.url,{method:_.method||"GET",body:_.body,credentials:_.credentials,headers:_.headers,referrer:qi(),signal:r.signal}),s=!1,f=!1,y=(C=e.url).indexOf("sku=")>0&&Zn(C);_.type==="json"&&e.headers.set("Accept","application/json");var b=function(M,z,O){if(!f){if(M&&M.message!=="SecurityError"&&Be(M),z&&O)return E(z);var G=Date.now();N.fetch(e).then(function(V){if(V.ok){var W=y?V.clone():null;return E(V,W,G)}return w(new kr(V.statusText,V.status,_.url))}).catch(function(V){V.code!==20&&w(new Error(V.message))})}},E=function(M,z,O){(_.type==="arrayBuffer"?M.arrayBuffer():_.type==="json"?M.json():M.text()).then(function(G){f||(z&&O&&function(V,W,Y){if(En(),$i){var H={status:W.status,statusText:W.statusText,headers:new N.Headers};W.headers.forEach(function(ht,Pt){return H.headers.set(Pt,ht)});var ot=Lr(W.headers.get("Cache-Control")||"");ot["no-store"]||(ot["max-age"]&&H.headers.set("Expires",new Date(Y+1e3*ot["max-age"]).toUTCString()),new Date(H.headers.get("Expires")).getTime()-Y<42e4||function(ht,Pt){if(dn===void 0)try{new Response(new ReadableStream),dn=!0}catch{dn=!1}dn?Pt(ht.body):ht.blob().then(Pt)}(W,function(ht){var Pt=new N.Response(ht,H);En(),$i&&$i.then(function(Ut){return Ut.put(Ei(V.url),Pt)}).catch(function(Ut){return Be(Ut.message)})}))}}(e,z,O),s=!0,w(null,G,M.headers.get("Cache-Control"),M.headers.get("Expires")))}).catch(function(G){f||w(new Error(G.message))})};return y?function(M,z){if(En(),!$i)return z(null);var O=Ei(M.url);$i.then(function(G){G.match(O).then(function(V){var W=function(Y){if(!Y)return!1;var H=new Date(Y.headers.get("Expires")||0),ot=Lr(Y.headers.get("Cache-Control")||"");return H>Date.now()&&!ot["no-cache"]}(V);G.delete(O),W&&G.put(O,V.clone()),z(null,V,W)}).catch(z)}).catch(z)}(e,b):b(null,null),{cancel:function(){f=!0,s||r.abort()}}}(t,n);if(Ce()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,n,void 0,!0)}var h;return function(_,w){var C=new N.XMLHttpRequest;for(var r in C.open(_.method||"GET",_.url,!0),_.type==="arrayBuffer"&&(C.responseType="arraybuffer"),_.headers)C.setRequestHeader(r,_.headers[r]);return _.type==="json"&&(C.responseType="text",C.setRequestHeader("Accept","application/json")),C.withCredentials=_.credentials==="include",C.onerror=function(){w(new Error(C.statusText))},C.onload=function(){if((C.status>=200&&C.status<300||C.status===0)&&C.response!==null){var e=C.response;if(_.type==="json")try{e=JSON.parse(C.response)}catch(s){return w(s)}w(null,e,C.getResponseHeader("Cache-Control"),C.getResponseHeader("Expires"))}else w(new kr(C.statusText,C.status,_.url))},C.send(_.body),{cancel:function(){return C.abort()}}}(t,n)},Rn=function(t,n){return ho(wt(t,{type:"arrayBuffer"}),n)},hi=function(t,n){return ho(wt(t,{method:"POST"}),n)},Q="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";Ki=[],Tr=0;var it=function(t,n){if(Di.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),Tr>=Wr.MAX_PARALLEL_IMAGE_REQUESTS){var h={requestParameters:t,callback:n,cancelled:!1,cancel:function(){this.cancelled=!0}};return Ki.push(h),h}Tr++;var _=!1,w=function(){if(!_)for(_=!0,Tr--;Ki.length&&Tr<Wr.MAX_PARALLEL_IMAGE_REQUESTS;){var r=Ki.shift();r.cancelled||(r.cancel=it(r.requestParameters,r.callback).cancel)}},C=Rn(t,function(r,e,s,f){w(),r?n(r):e&&(Ge()?function(y,b){var E=new N.Blob([new Uint8Array(y)],{type:"image/png"});N.createImageBitmap(E).then(function(M){b(null,M)}).catch(function(M){b(new Error("Could not load image because of "+M.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}(e,n):function(y,b,E,M){var z=new N.Image,O=N.URL;z.onload=function(){b(null,z),O.revokeObjectURL(z.src),z.onload=null,N.requestAnimationFrame(function(){z.src=Q})},z.onerror=function(){return b(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var G=new N.Blob([new Uint8Array(y)],{type:"image/png"});z.cacheControl=E,z.expires=M,z.src=y.byteLength?O.createObjectURL(G):Q}(e,n,s,f))});return{cancel:function(){C.cancel(),w()}}};function st(t,n,h){h[t]&&h[t].indexOf(n)!==-1||(h[t]=h[t]||[],h[t].push(n))}function _t(t,n,h){if(h&&h[t]){var _=h[t].indexOf(n);_!==-1&&h[t].splice(_,1)}}var It=function(t,n){n===void 0&&(n={}),wt(this,n),this.type=t},Bt=function(t){function n(h,_){_===void 0&&(_={}),t.call(this,"error",wt({error:h},_))}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n}(It),Gt=function(){};Gt.prototype.on=function(t,n){return this._listeners=this._listeners||{},st(t,n,this._listeners),this},Gt.prototype.off=function(t,n){return _t(t,n,this._listeners),_t(t,n,this._oneTimeListeners),this},Gt.prototype.once=function(t,n){return this._oneTimeListeners=this._oneTimeListeners||{},st(t,n,this._oneTimeListeners),this},Gt.prototype.fire=function(t,n){typeof t=="string"&&(t=new It(t,n||{}));var h=t.type;if(this.listens(h)){t.target=this;for(var _=0,w=this._listeners&&this._listeners[h]?this._listeners[h].slice():[];_<w.length;_+=1)w[_].call(this,t);for(var C=0,r=this._oneTimeListeners&&this._oneTimeListeners[h]?this._oneTimeListeners[h].slice():[];C<r.length;C+=1){var e=r[C];_t(h,e,this._oneTimeListeners),e.call(this,t)}var s=this._eventedParent;s&&(wt(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),s.fire(t))}else t instanceof Bt&&console.error(t.error);return this},Gt.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Gt.prototype.setEventedParent=function(t,n){return this._eventedParent=t,this._eventedParentData=n,this};var dt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},zt=function(t,n,h,_){this.message=(t?t+": ":"")+h,_&&(this.identifier=_),n!=null&&n.__line__&&(this.line=n.__line__)};function Qt(t){var n=t.value;return n?[new zt(t.key,n,"constants have been deprecated as of v8")]:[]}function nt(t){for(var n=[],h=arguments.length-1;h-- >0;)n[h]=arguments[h+1];for(var _=0,w=n;_<w.length;_+=1){var C=w[_];for(var r in C)t[r]=C[r]}return t}function X(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Z(t){if(Array.isArray(t))return t.map(Z);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var n={};for(var h in t)n[h]=Z(t[h]);return n}return X(t)}var rt=function(t){function n(h,_){t.call(this,_),this.message=_,this.key=h}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n}(Error),lt=function(t,n){n===void 0&&(n=[]),this.parent=t,this.bindings={};for(var h=0,_=n;h<_.length;h+=1){var w=_[h];this.bindings[w[0]]=w[1]}};lt.prototype.concat=function(t){return new lt(this,t)},lt.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},lt.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var gt={kind:"null"},pt={kind:"number"},St={kind:"string"},Et={kind:"boolean"},Ct={kind:"color"},te={kind:"object"},$t={kind:"value"},ee={kind:"collator"},De={kind:"formatted"},Se={kind:"resolvedImage"};function ze(t,n){return{kind:"array",itemType:t,N:n}}function Ue(t){if(t.kind==="array"){var n=Ue(t.itemType);return typeof t.N=="number"?"array<"+n+", "+t.N+">":t.itemType.kind==="value"?"array":"array<"+n+">"}return t.kind}var Dr=[gt,pt,St,Et,Ct,De,te,ze($t),Se];function ur(t,n){if(n.kind==="error")return null;if(t.kind==="array"){if(n.kind==="array"&&(n.N===0&&n.itemType.kind==="value"||!ur(t.itemType,n.itemType))&&(typeof t.N!="number"||t.N===n.N))return null}else{if(t.kind===n.kind)return null;if(t.kind==="value"){for(var h=0,_=Dr;h<_.length;h+=1)if(!ur(_[h],n))return null}}return"Expected "+Ue(t)+" but found "+Ue(n)+" instead."}function mr(t,n){return n.some(function(h){return h.kind===t.kind})}function nr(t,n){return n.some(function(h){return h==="null"?t===null:h==="array"?Array.isArray(t):h==="object"?t&&!Array.isArray(t)&&typeof t=="object":h===typeof t})}var Xe=u(function(t,n){var h={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function _(e){return(e=Math.round(e))<0?0:e>255?255:e}function w(e){return _(e[e.length-1]==="%"?parseFloat(e)/100*255:parseInt(e))}function C(e){return(s=e[e.length-1]==="%"?parseFloat(e)/100:parseFloat(e))<0?0:s>1?1:s;var s}function r(e,s,f){return f<0?f+=1:f>1&&(f-=1),6*f<1?e+(s-e)*f*6:2*f<1?s:3*f<2?e+(s-e)*(2/3-f)*6:e}try{n.parseCSSColor=function(e){var s,f=e.replace(/ /g,"").toLowerCase();if(f in h)return h[f].slice();if(f[0]==="#")return f.length===4?(s=parseInt(f.substr(1),16))>=0&&s<=4095?[(3840&s)>>4|(3840&s)>>8,240&s|(240&s)>>4,15&s|(15&s)<<4,1]:null:f.length===7&&(s=parseInt(f.substr(1),16))>=0&&s<=16777215?[(16711680&s)>>16,(65280&s)>>8,255&s,1]:null;var y=f.indexOf("("),b=f.indexOf(")");if(y!==-1&&b+1===f.length){var E=f.substr(0,y),M=f.substr(y+1,b-(y+1)).split(","),z=1;switch(E){case"rgba":if(M.length!==4)return null;z=C(M.pop());case"rgb":return M.length!==3?null:[w(M[0]),w(M[1]),w(M[2]),z];case"hsla":if(M.length!==4)return null;z=C(M.pop());case"hsl":if(M.length!==3)return null;var O=(parseFloat(M[0])%360+360)%360/360,G=C(M[1]),V=C(M[2]),W=V<=.5?V*(G+1):V+G-V*G,Y=2*V-W;return[_(255*r(Y,W,O+1/3)),_(255*r(Y,W,O)),_(255*r(Y,W,O-1/3)),z];default:return null}}return null}}catch{}}).parseCSSColor,Sr=function(t,n,h,_){_===void 0&&(_=1),this.r=t,this.g=n,this.b=h,this.a=_};Sr.parse=function(t){if(t){if(t instanceof Sr)return t;if(typeof t=="string"){var n=Xe(t);if(n)return new Sr(n[0]/255*n[3],n[1]/255*n[3],n[2]/255*n[3],n[3])}}},Sr.prototype.toString=function(){var t=this.toArray(),n=t[1],h=t[2],_=t[3];return"rgba("+Math.round(t[0])+","+Math.round(n)+","+Math.round(h)+","+_+")"},Sr.prototype.toArray=function(){var t=this.a;return t===0?[0,0,0,0]:[255*this.r/t,255*this.g/t,255*this.b/t,t]},Sr.black=new Sr(0,0,0,1),Sr.white=new Sr(1,1,1,1),Sr.transparent=new Sr(0,0,0,0),Sr.red=new Sr(1,0,0,1);var ni=function(t,n,h){this.sensitivity=t?n?"variant":"case":n?"accent":"base",this.locale=h,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};ni.prototype.compare=function(t,n){return this.collator.compare(t,n)},ni.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var rn=function(t,n,h,_,w){this.text=t,this.image=n,this.scale=h,this.fontStack=_,this.textColor=w},si=function(t){this.sections=t};si.fromString=function(t){return new si([new rn(t,null,null,null,null)])},si.prototype.isEmpty=function(){return this.sections.length===0||!this.sections.some(function(t){return t.text.length!==0||t.image&&t.image.name.length!==0})},si.factory=function(t){return t instanceof si?t:si.fromString(t)},si.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(t){return t.text}).join("")},si.prototype.serialize=function(){for(var t=["format"],n=0,h=this.sections;n<h.length;n+=1){var _=h[n];if(_.image)t.push(["image",_.image.name]);else{t.push(_.text);var w={};_.fontStack&&(w["text-font"]=["literal",_.fontStack.split(",")]),_.scale&&(w["font-scale"]=_.scale),_.textColor&&(w["text-color"]=["rgba"].concat(_.textColor.toArray())),t.push(w)}}return t};var Nn=function(t){this.name=t.name,this.available=t.available};function sl(t,n,h,_){return typeof t=="number"&&t>=0&&t<=255&&typeof n=="number"&&n>=0&&n<=255&&typeof h=="number"&&h>=0&&h<=255?_===void 0||typeof _=="number"&&_>=0&&_<=1?null:"Invalid rgba value ["+[t,n,h,_].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+(typeof _=="number"?[t,n,h,_]:[t,n,h]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function gi(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof Sr||t instanceof ni||t instanceof si||t instanceof Nn)return!0;if(Array.isArray(t)){for(var n=0,h=t;n<h.length;n+=1)if(!gi(h[n]))return!1;return!0}if(typeof t=="object"){for(var _ in t)if(!gi(t[_]))return!1;return!0}return!1}function Yi(t){if(t===null)return gt;if(typeof t=="string")return St;if(typeof t=="boolean")return Et;if(typeof t=="number")return pt;if(t instanceof Sr)return Ct;if(t instanceof ni)return ee;if(t instanceof si)return De;if(t instanceof Nn)return Se;if(Array.isArray(t)){for(var n,h=t.length,_=0,w=t;_<w.length;_+=1){var C=Yi(w[_]);if(n){if(n===C)continue;n=$t;break}n=C}return ze(n||$t,h)}return te}function gs(t){var n=typeof t;return t===null?"":n==="string"||n==="number"||n==="boolean"?String(t):t instanceof Sr||t instanceof si||t instanceof Nn?t.toString():JSON.stringify(t)}Nn.prototype.toString=function(){return this.name},Nn.fromString=function(t){return t?new Nn({name:t,available:!1}):null},Nn.prototype.serialize=function(){return["image",this.name]};var Wn=function(t,n){this.type=t,this.value=n};Wn.parse=function(t,n){if(t.length!==2)return n.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!gi(t[1]))return n.error("invalid value");var h=t[1],_=Yi(h),w=n.expectedType;return _.kind!=="array"||_.N!==0||!w||w.kind!=="array"||typeof w.N=="number"&&w.N!==0||(_=w),new Wn(_,h)},Wn.prototype.evaluate=function(){return this.value},Wn.prototype.eachChild=function(){},Wn.prototype.outputDefined=function(){return!0},Wn.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Sr?["rgba"].concat(this.value.toArray()):this.value instanceof si?this.value.serialize():this.value};var un=function(t){this.name="ExpressionEvaluationError",this.message=t};un.prototype.toJSON=function(){return this.message};var Po={string:St,number:pt,boolean:Et,object:te},Si=function(t,n){this.type=t,this.args=n};Si.parse=function(t,n){if(t.length<2)return n.error("Expected at least one argument.");var h,_=1,w=t[0];if(w==="array"){var C,r;if(t.length>2){var e=t[1];if(typeof e!="string"||!(e in Po)||e==="object")return n.error('The item type argument of "array" must be one of string, number, boolean',1);C=Po[e],_++}else C=$t;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return n.error('The length argument to "array" must be a positive integer literal',2);r=t[2],_++}h=ze(C,r)}else h=Po[w];for(var s=[];_<t.length;_++){var f=n.parse(t[_],_,$t);if(!f)return null;s.push(f)}return new Si(h,s)},Si.prototype.evaluate=function(t){for(var n=0;n<this.args.length;n++){var h=this.args[n].evaluate(t);if(!ur(this.type,Yi(h)))return h;if(n===this.args.length-1)throw new un("Expected value to be of type "+Ue(this.type)+", but found "+Ue(Yi(h))+" instead.")}return null},Si.prototype.eachChild=function(t){this.args.forEach(t)},Si.prototype.outputDefined=function(){return this.args.every(function(t){return t.outputDefined()})},Si.prototype.serialize=function(){var t=this.type,n=[t.kind];if(t.kind==="array"){var h=t.itemType;if(h.kind==="string"||h.kind==="number"||h.kind==="boolean"){n.push(h.kind);var _=t.N;(typeof _=="number"||this.args.length>1)&&n.push(_)}}return n.concat(this.args.map(function(w){return w.serialize()}))};var Mo=function(t){this.type=De,this.sections=t};Mo.parse=function(t,n){if(t.length<2)return n.error("Expected at least one argument.");var h=t[1];if(!Array.isArray(h)&&typeof h=="object")return n.error("First argument must be an image or text section.");for(var _=[],w=!1,C=1;C<=t.length-1;++C){var r=t[C];if(w&&typeof r=="object"&&!Array.isArray(r)){w=!1;var e=null;if(r["font-scale"]&&!(e=n.parse(r["font-scale"],1,pt)))return null;var s=null;if(r["text-font"]&&!(s=n.parse(r["text-font"],1,ze(St))))return null;var f=null;if(r["text-color"]&&!(f=n.parse(r["text-color"],1,Ct)))return null;var y=_[_.length-1];y.scale=e,y.font=s,y.textColor=f}else{var b=n.parse(t[C],1,$t);if(!b)return null;var E=b.type.kind;if(E!=="string"&&E!=="value"&&E!=="null"&&E!=="resolvedImage")return n.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");w=!0,_.push({content:b,scale:null,font:null,textColor:null})}}return new Mo(_)},Mo.prototype.evaluate=function(t){return new si(this.sections.map(function(n){var h=n.content.evaluate(t);return Yi(h)===Se?new rn("",h,null,null,null):new rn(gs(h),null,n.scale?n.scale.evaluate(t):null,n.font?n.font.evaluate(t).join(","):null,n.textColor?n.textColor.evaluate(t):null)}))},Mo.prototype.eachChild=function(t){for(var n=0,h=this.sections;n<h.length;n+=1){var _=h[n];t(_.content),_.scale&&t(_.scale),_.font&&t(_.font),_.textColor&&t(_.textColor)}},Mo.prototype.outputDefined=function(){return!1},Mo.prototype.serialize=function(){for(var t=["format"],n=0,h=this.sections;n<h.length;n+=1){var _=h[n];t.push(_.content.serialize());var w={};_.scale&&(w["font-scale"]=_.scale.serialize()),_.font&&(w["text-font"]=_.font.serialize()),_.textColor&&(w["text-color"]=_.textColor.serialize()),t.push(w)}return t};var oo=function(t){this.type=Se,this.input=t};oo.parse=function(t,n){if(t.length!==2)return n.error("Expected two arguments.");var h=n.parse(t[1],1,St);return h?new oo(h):n.error("No image name provided.")},oo.prototype.evaluate=function(t){var n=this.input.evaluate(t),h=Nn.fromString(n);return h&&t.availableImages&&(h.available=t.availableImages.indexOf(n)>-1),h},oo.prototype.eachChild=function(t){t(this.input)},oo.prototype.outputDefined=function(){return!1},oo.prototype.serialize=function(){return["image",this.input.serialize()]};var Ou={"to-boolean":Et,"to-color":Ct,"to-number":pt,"to-string":St},Lo=function(t,n){this.type=t,this.args=n};Lo.parse=function(t,n){if(t.length<2)return n.error("Expected at least one argument.");var h=t[0];if((h==="to-boolean"||h==="to-string")&&t.length!==2)return n.error("Expected one argument.");for(var _=Ou[h],w=[],C=1;C<t.length;C++){var r=n.parse(t[C],C,$t);if(!r)return null;w.push(r)}return new Lo(_,w)},Lo.prototype.evaluate=function(t){if(this.type.kind==="boolean")return Boolean(this.args[0].evaluate(t));if(this.type.kind==="color"){for(var n,h,_=0,w=this.args;_<w.length;_+=1){if(h=null,(n=w[_].evaluate(t))instanceof Sr)return n;if(typeof n=="string"){var C=t.parseColor(n);if(C)return C}else if(Array.isArray(n)&&!(h=n.length<3||n.length>4?"Invalid rbga value "+JSON.stringify(n)+": expected an array containing either three or four numeric values.":sl(n[0],n[1],n[2],n[3])))return new Sr(n[0]/255,n[1]/255,n[2]/255,n[3])}throw new un(h||"Could not parse color from value '"+(typeof n=="string"?n:String(JSON.stringify(n)))+"'")}if(this.type.kind==="number"){for(var r=null,e=0,s=this.args;e<s.length;e+=1){if((r=s[e].evaluate(t))===null)return 0;var f=Number(r);if(!isNaN(f))return f}throw new un("Could not convert "+JSON.stringify(r)+" to number.")}return this.type.kind==="formatted"?si.fromString(gs(this.args[0].evaluate(t))):this.type.kind==="resolvedImage"?Nn.fromString(gs(this.args[0].evaluate(t))):gs(this.args[0].evaluate(t))},Lo.prototype.eachChild=function(t){this.args.forEach(t)},Lo.prototype.outputDefined=function(){return this.args.every(function(t){return t.outputDefined()})},Lo.prototype.serialize=function(){if(this.type.kind==="formatted")return new Mo([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new oo(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild(function(n){t.push(n.serialize())}),t};var ys=["Unknown","Point","LineString","Polygon"],Bo=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};Bo.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Bo.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?ys[this.feature.type]:this.feature.type:null},Bo.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Bo.prototype.canonicalID=function(){return this.canonical},Bo.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Bo.prototype.parseColor=function(t){var n=this._parseColorCache[t];return n||(n=this._parseColorCache[t]=Sr.parse(t)),n};var Hi=function(t,n,h,_){this.name=t,this.type=n,this._evaluate=h,this.args=_};Hi.prototype.evaluate=function(t){return this._evaluate(t,this.args)},Hi.prototype.eachChild=function(t){this.args.forEach(t)},Hi.prototype.outputDefined=function(){return!1},Hi.prototype.serialize=function(){return[this.name].concat(this.args.map(function(t){return t.serialize()}))},Hi.parse=function(t,n){var h,_=t[0],w=Hi.definitions[_];if(!w)return n.error('Unknown expression "'+_+'". If you wanted a literal array, use ["literal", [...]].',0);for(var C=Array.isArray(w)?w[0]:w.type,r=Array.isArray(w)?[[w[1],w[2]]]:w.overloads,e=r.filter(function(re){var Xt=re[0];return!Array.isArray(Xt)||Xt.length===t.length-1}),s=null,f=0,y=e;f<y.length;f+=1){var b=y[f],E=b[0],M=b[1];s=new Za(n.registry,n.path,null,n.scope);for(var z=[],O=!1,G=1;G<t.length;G++){var V=t[G],W=Array.isArray(E)?E[G-1]:E.type,Y=s.parse(V,1+z.length,W);if(!Y){O=!0;break}z.push(Y)}if(!O)if(Array.isArray(E)&&E.length!==z.length)s.error("Expected "+E.length+" arguments, but found "+z.length+" instead.");else{for(var H=0;H<z.length;H++){var ot=Array.isArray(E)?E[H]:E.type,ht=z[H];s.concat(H+1).checkSubtype(ot,ht.type)}if(s.errors.length===0)return new Hi(_,C,M,z)}}if(e.length===1)(h=n.errors).push.apply(h,s.errors);else{for(var Pt=(e.length?e:r).map(function(re){var Xt;return Xt=re[0],Array.isArray(Xt)?"("+Xt.map(Ue).join(", ")+")":"("+Ue(Xt.type)+"...)"}).join(" | "),Ut=[],jt=1;jt<t.length;jt++){var qt=n.parse(t[jt],1+Ut.length);if(!qt)return null;Ut.push(Ue(qt.type))}n.error("Expected arguments of type "+Pt+", but found ("+Ut.join(", ")+") instead.")}return null},Hi.register=function(t,n){for(var h in Hi.definitions=n,n)t[h]=Hi};var po=function(t,n,h){this.type=ee,this.locale=h,this.caseSensitive=t,this.diacriticSensitive=n};function Sn(t,n){t[0]=Math.min(t[0],n[0]),t[1]=Math.min(t[1],n[1]),t[2]=Math.max(t[2],n[0]),t[3]=Math.max(t[3],n[1])}function oa(t,n){return!(t[0]<=n[0]||t[2]>=n[2]||t[1]<=n[1]||t[3]>=n[3])}function ll(t,n){var h=(180+t[0])/360,_=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,w=Math.pow(2,n.z);return[Math.round(h*w*8192),Math.round(_*w*8192)]}function Kl(t,n,h){return n[1]>t[1]!=h[1]>t[1]&&t[0]<(h[0]-n[0])*(t[1]-n[1])/(h[1]-n[1])+n[0]}function _s(t,n){for(var h,_,w,C,r,e,s,f=!1,y=0,b=n.length;y<b;y++)for(var E=n[y],M=0,z=E.length;M<z-1;M++){if((C=(h=t)[0]-(_=E[M])[0])*(s=h[1]-(w=E[M+1])[1])-(e=h[0]-w[0])*(r=h[1]-_[1])==0&&C*e<=0&&r*s<=0)return!1;Kl(t,E[M],E[M+1])&&(f=!f)}return f}function mn(t,n){for(var h=0;h<n.length;h++)if(_s(t,n[h]))return!0;return!1}function Fs(t,n,h,_){var w=_[0]-h[0],C=_[1]-h[1],r=(t[0]-h[0])*C-w*(t[1]-h[1]),e=(n[0]-h[0])*C-w*(n[1]-h[1]);return r>0&&e<0||r<0&&e>0}function Fu(t,n,h){for(var _=0,w=h;_<w.length;_+=1)for(var C=w[_],r=0;r<C.length-1;++r)if((b=[(y=C[r+1])[0]-(f=C[r])[0],y[1]-f[1]])[0]*(E=[(s=n)[0]-(e=t)[0],s[1]-e[1]])[1]-b[1]*E[0]!=0&&Fs(e,s,f,y)&&Fs(f,y,e,s))return!0;var e,s,f,y,b,E;return!1}function Bu(t,n){for(var h=0;h<t.length;++h)if(!_s(t[h],n))return!1;for(var _=0;_<t.length-1;++_)if(Fu(t[_],t[_+1],n))return!1;return!0}function Uu(t,n){for(var h=0;h<n.length;h++)if(Bu(t,n[h]))return!0;return!1}function ba(t,n,h){for(var _=[],w=0;w<t.length;w++){for(var C=[],r=0;r<t[w].length;r++){var e=ll(t[w][r],h);Sn(n,e),C.push(e)}_.push(C)}return _}function ul(t,n,h){for(var _=[],w=0;w<t.length;w++){var C=ba(t[w],n,h);_.push(C)}return _}function cl(t,n,h,_){if(t[0]<h[0]||t[0]>h[2]){var w=.5*_,C=t[0]-h[0]>w?-_:h[0]-t[0]>w?_:0;C===0&&(C=t[0]-h[2]>w?-_:h[2]-t[0]>w?_:0),t[0]+=C}Sn(n,t)}function Cc(t,n,h,_){for(var w=8192*Math.pow(2,_.z),C=[8192*_.x,8192*_.y],r=[],e=0,s=t;e<s.length;e+=1)for(var f=0,y=s[e];f<y.length;f+=1){var b=y[f],E=[b.x+C[0],b.y+C[1]];cl(E,n,h,w),r.push(E)}return r}function Bs(t,n,h,_){for(var w,C=8192*Math.pow(2,_.z),r=[8192*_.x,8192*_.y],e=[],s=0,f=t;s<f.length;s+=1){for(var y=[],b=0,E=f[s];b<E.length;b+=1){var M=E[b],z=[M.x+r[0],M.y+r[1]];Sn(n,z),y.push(z)}e.push(y)}if(n[2]-n[0]<=C/2){(w=n)[0]=w[1]=1/0,w[2]=w[3]=-1/0;for(var O=0,G=e;O<G.length;O+=1)for(var V=0,W=G[O];V<W.length;V+=1)cl(W[V],n,h,C)}return e}po.parse=function(t,n){if(t.length!==2)return n.error("Expected one argument.");var h=t[1];if(typeof h!="object"||Array.isArray(h))return n.error("Collator options argument must be an object.");var _=n.parse(h["case-sensitive"]!==void 0&&h["case-sensitive"],1,Et);if(!_)return null;var w=n.parse(h["diacritic-sensitive"]!==void 0&&h["diacritic-sensitive"],1,Et);if(!w)return null;var C=null;return h.locale&&!(C=n.parse(h.locale,1,St))?null:new po(_,w,C)},po.prototype.evaluate=function(t){return new ni(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},po.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},po.prototype.outputDefined=function(){return!1},po.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var fo=function(t,n){this.type=Et,this.geojson=t,this.geometries=n};function aa(t){if(t instanceof Hi&&(t.name==="get"&&t.args.length===1||t.name==="feature-state"||t.name==="has"&&t.args.length===1||t.name==="properties"||t.name==="geometry-type"||t.name==="id"||/^filter-/.test(t.name))||t instanceof fo)return!1;var n=!0;return t.eachChild(function(h){n&&!aa(h)&&(n=!1)}),n}function sa(t){if(t instanceof Hi&&t.name==="feature-state")return!1;var n=!0;return t.eachChild(function(h){n&&!sa(h)&&(n=!1)}),n}function qa(t,n){if(t instanceof Hi&&n.indexOf(t.name)>=0)return!1;var h=!0;return t.eachChild(function(_){h&&!qa(_,n)&&(h=!1)}),h}fo.parse=function(t,n){if(t.length!==2)return n.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(gi(t[1])){var h=t[1];if(h.type==="FeatureCollection")for(var _=0;_<h.features.length;++_){var w=h.features[_].geometry.type;if(w==="Polygon"||w==="MultiPolygon")return new fo(h,h.features[_].geometry)}else if(h.type==="Feature"){var C=h.geometry.type;if(C==="Polygon"||C==="MultiPolygon")return new fo(h,h.geometry)}else if(h.type==="Polygon"||h.type==="MultiPolygon")return new fo(h,h)}return n.error("'within' expression requires valid geojson object that contains polygon geometry type.")},fo.prototype.evaluate=function(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(n,h){var _=[1/0,1/0,-1/0,-1/0],w=[1/0,1/0,-1/0,-1/0],C=n.canonicalID();if(h.type==="Polygon"){var r=ba(h.coordinates,w,C),e=Cc(n.geometry(),_,w,C);if(!oa(_,w))return!1;for(var s=0,f=e;s<f.length;s+=1)if(!_s(f[s],r))return!1}if(h.type==="MultiPolygon"){var y=ul(h.coordinates,w,C),b=Cc(n.geometry(),_,w,C);if(!oa(_,w))return!1;for(var E=0,M=b;E<M.length;E+=1)if(!mn(M[E],y))return!1}return!0}(t,this.geometries);if(t.geometryType()==="LineString")return function(n,h){var _=[1/0,1/0,-1/0,-1/0],w=[1/0,1/0,-1/0,-1/0],C=n.canonicalID();if(h.type==="Polygon"){var r=ba(h.coordinates,w,C),e=Bs(n.geometry(),_,w,C);if(!oa(_,w))return!1;for(var s=0,f=e;s<f.length;s+=1)if(!Bu(f[s],r))return!1}if(h.type==="MultiPolygon"){var y=ul(h.coordinates,w,C),b=Bs(n.geometry(),_,w,C);if(!oa(_,w))return!1;for(var E=0,M=b;E<M.length;E+=1)if(!Uu(M[E],y))return!1}return!0}(t,this.geometries)}return!1},fo.prototype.eachChild=function(){},fo.prototype.outputDefined=function(){return!0},fo.prototype.serialize=function(){return["within",this.geojson]};var Yr=function(t,n){this.type=n.type,this.name=t,this.boundExpression=n};Yr.parse=function(t,n){if(t.length!==2||typeof t[1]!="string")return n.error("'var' expression requires exactly one string literal argument.");var h=t[1];return n.scope.has(h)?new Yr(h,n.scope.get(h)):n.error('Unknown variable "'+h+'". Make sure "'+h+'" has been bound in an enclosing "let" expression before using it.',1)},Yr.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Yr.prototype.eachChild=function(){},Yr.prototype.outputDefined=function(){return!1},Yr.prototype.serialize=function(){return["var",this.name]};var Za=function(t,n,h,_,w){n===void 0&&(n=[]),_===void 0&&(_=new lt),w===void 0&&(w=[]),this.registry=t,this.path=n,this.key=n.map(function(C){return"["+C+"]"}).join(""),this.scope=_,this.errors=w,this.expectedType=h};function Xa(t,n){for(var h,_=t.length-1,w=0,C=_,r=0;w<=C;)if((h=t[r=Math.floor((w+C)/2)])<=n){if(r===_||n<t[r+1])return r;w=r+1}else{if(!(h>n))throw new un("Input is not a number.");C=r-1}return 0}Za.prototype.parse=function(t,n,h,_,w){return w===void 0&&(w={}),n?this.concat(n,h,_)._parse(t,w):this._parse(t,w)},Za.prototype._parse=function(t,n){function h(f,y,b){return b==="assert"?new Si(y,[f]):b==="coerce"?new Lo(y,[f]):f}if(t!==null&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"||(t=["literal",t]),Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var _=t[0];if(typeof _!="string")return this.error("Expression name must be a string, but found "+typeof _+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var w=this.registry[_];if(w){var C=w.parse(t,this);if(!C)return null;if(this.expectedType){var r=this.expectedType,e=C.type;if(r.kind!=="string"&&r.kind!=="number"&&r.kind!=="boolean"&&r.kind!=="object"&&r.kind!=="array"||e.kind!=="value")if(r.kind!=="color"&&r.kind!=="formatted"&&r.kind!=="resolvedImage"||e.kind!=="value"&&e.kind!=="string"){if(this.checkSubtype(r,e))return null}else C=h(C,r,n.typeAnnotation||"coerce");else C=h(C,r,n.typeAnnotation||"assert")}if(!(C instanceof Wn)&&C.type.kind!=="resolvedImage"&&function f(y){if(y instanceof Yr)return f(y.boundExpression);if(y instanceof Hi&&y.name==="error"||y instanceof po||y instanceof fo)return!1;var b=y instanceof Lo||y instanceof Si,E=!0;return y.eachChild(function(M){E=b?E&&f(M):E&&M instanceof Wn}),!!E&&aa(y)&&qa(y,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(C)){var s=new Bo;try{C=new Wn(C.type,C.evaluate(s))}catch(f){return this.error(f.message),null}}return C}return this.error('Unknown expression "'+_+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(t===void 0?"'undefined' value invalid. Use null instead.":typeof t=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},Za.prototype.concat=function(t,n,h){var _=typeof t=="number"?this.path.concat(t):this.path,w=h?this.scope.concat(h):this.scope;return new Za(this.registry,_,n||null,w,this.errors)},Za.prototype.error=function(t){for(var n=[],h=arguments.length-1;h-- >0;)n[h]=arguments[h+1];var _=""+this.key+n.map(function(w){return"["+w+"]"}).join("");this.errors.push(new rt(_,t))},Za.prototype.checkSubtype=function(t,n){var h=ur(t,n);return h&&this.error(h),h};var Dn=function(t,n,h){this.type=t,this.input=n,this.labels=[],this.outputs=[];for(var _=0,w=h;_<w.length;_+=1){var C=w[_],r=C[1];this.labels.push(C[0]),this.outputs.push(r)}};function Ji(t,n,h){return t*(1-h)+n*h}Dn.parse=function(t,n){if(t.length-1<4)return n.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return n.error("Expected an even number of arguments.");var h=n.parse(t[1],1,pt);if(!h)return null;var _=[],w=null;n.expectedType&&n.expectedType.kind!=="value"&&(w=n.expectedType);for(var C=1;C<t.length;C+=2){var r=C===1?-1/0:t[C],e=t[C+1],s=C,f=C+1;if(typeof r!="number")return n.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(_.length&&_[_.length-1][0]>=r)return n.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);var y=n.parse(e,f,w);if(!y)return null;w=w||y.type,_.push([r,y])}return new Dn(w,h,_)},Dn.prototype.evaluate=function(t){var n=this.labels,h=this.outputs;if(n.length===1)return h[0].evaluate(t);var _=this.input.evaluate(t);if(_<=n[0])return h[0].evaluate(t);var w=n.length;return _>=n[w-1]?h[w-1].evaluate(t):h[Xa(n,_)].evaluate(t)},Dn.prototype.eachChild=function(t){t(this.input);for(var n=0,h=this.outputs;n<h.length;n+=1)t(h[n])},Dn.prototype.outputDefined=function(){return this.outputs.every(function(t){return t.outputDefined()})},Dn.prototype.serialize=function(){for(var t=["step",this.input.serialize()],n=0;n<this.labels.length;n++)n>0&&t.push(this.labels[n]),t.push(this.outputs[n].serialize());return t};var On=Object.freeze({__proto__:null,number:Ji,color:function(t,n,h){return new Sr(Ji(t.r,n.r,h),Ji(t.g,n.g,h),Ji(t.b,n.b,h),Ji(t.a,n.a,h))},array:function(t,n,h){return t.map(function(_,w){return Ji(_,n[w],h)})}}),Yl=6/29*3*(6/29),Hl=Math.PI/180,Jl=180/Math.PI;function hl(t){return t>.008856451679035631?Math.pow(t,1/3):t/Yl+4/29}function pl(t){return t>6/29?t*t*t:Yl*(t-4/29)}function Us(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function fl(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ql(t){var n=fl(t.r),h=fl(t.g),_=fl(t.b),w=hl((.4124564*n+.3575761*h+.1804375*_)/.95047),C=hl((.2126729*n+.7151522*h+.072175*_)/1);return{l:116*C-16,a:500*(w-C),b:200*(C-hl((.0193339*n+.119192*h+.9503041*_)/1.08883)),alpha:t.a}}function dl(t){var n=(t.l+16)/116,h=isNaN(t.a)?n:n+t.a/500,_=isNaN(t.b)?n:n-t.b/200;return n=1*pl(n),h=.95047*pl(h),_=1.08883*pl(_),new Sr(Us(3.2404542*h-1.5371385*n-.4985314*_),Us(-.969266*h+1.8760108*n+.041556*_),Us(.0556434*h-.2040259*n+1.0572252*_),t.alpha)}function Ac(t,n,h){var _=n-t;return t+h*(_>180||_<-180?_-360*Math.round(_/360):_)}var Ns={forward:Ql,reverse:dl,interpolate:function(t,n,h){return{l:Ji(t.l,n.l,h),a:Ji(t.a,n.a,h),b:Ji(t.b,n.b,h),alpha:Ji(t.alpha,n.alpha,h)}}},la={forward:function(t){var n=Ql(t),h=n.l,_=n.a,w=n.b,C=Math.atan2(w,_)*Jl;return{h:C<0?C+360:C,c:Math.sqrt(_*_+w*w),l:h,alpha:t.a}},reverse:function(t){var n=t.h*Hl,h=t.c;return dl({l:t.l,a:Math.cos(n)*h,b:Math.sin(n)*h,alpha:t.alpha})},interpolate:function(t,n,h){return{h:Ac(t.h,n.h,h),c:Ji(t.c,n.c,h),l:Ji(t.l,n.l,h),alpha:Ji(t.alpha,n.alpha,h)}}},Pc=Object.freeze({__proto__:null,lab:Ns,hcl:la}),Fn=function(t,n,h,_,w){this.type=t,this.operator=n,this.interpolation=h,this.input=_,this.labels=[],this.outputs=[];for(var C=0,r=w;C<r.length;C+=1){var e=r[C],s=e[1];this.labels.push(e[0]),this.outputs.push(s)}};function Nu(t,n,h,_){var w=_-h,C=t-h;return w===0?0:n===1?C/w:(Math.pow(n,C)-1)/(Math.pow(n,w)-1)}Fn.interpolationFactor=function(t,n,h,_){var w=0;if(t.name==="exponential")w=Nu(n,t.base,h,_);else if(t.name==="linear")w=Nu(n,1,h,_);else if(t.name==="cubic-bezier"){var C=t.controlPoints;w=new P(C[0],C[1],C[2],C[3]).solve(Nu(n,1,h,_))}return w},Fn.parse=function(t,n){var h=t[0],_=t[1],w=t[2],C=t.slice(3);if(!Array.isArray(_)||_.length===0)return n.error("Expected an interpolation type expression.",1);if(_[0]==="linear")_={name:"linear"};else if(_[0]==="exponential"){var r=_[1];if(typeof r!="number")return n.error("Exponential interpolation requires a numeric base.",1,1);_={name:"exponential",base:r}}else{if(_[0]!=="cubic-bezier")return n.error("Unknown interpolation type "+String(_[0]),1,0);var e=_.slice(1);if(e.length!==4||e.some(function(G){return typeof G!="number"||G<0||G>1}))return n.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);_={name:"cubic-bezier",controlPoints:e}}if(t.length-1<4)return n.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return n.error("Expected an even number of arguments.");if(!(w=n.parse(w,2,pt)))return null;var s=[],f=null;h==="interpolate-hcl"||h==="interpolate-lab"?f=Ct:n.expectedType&&n.expectedType.kind!=="value"&&(f=n.expectedType);for(var y=0;y<C.length;y+=2){var b=C[y],E=C[y+1],M=y+3,z=y+4;if(typeof b!="number")return n.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',M);if(s.length&&s[s.length-1][0]>=b)return n.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',M);var O=n.parse(E,z,f);if(!O)return null;f=f||O.type,s.push([b,O])}return f.kind==="number"||f.kind==="color"||f.kind==="array"&&f.itemType.kind==="number"&&typeof f.N=="number"?new Fn(f,h,_,w,s):n.error("Type "+Ue(f)+" is not interpolatable.")},Fn.prototype.evaluate=function(t){var n=this.labels,h=this.outputs;if(n.length===1)return h[0].evaluate(t);var _=this.input.evaluate(t);if(_<=n[0])return h[0].evaluate(t);var w=n.length;if(_>=n[w-1])return h[w-1].evaluate(t);var C=Xa(n,_),r=Fn.interpolationFactor(this.interpolation,_,n[C],n[C+1]),e=h[C].evaluate(t),s=h[C+1].evaluate(t);return this.operator==="interpolate"?On[this.type.kind.toLowerCase()](e,s,r):this.operator==="interpolate-hcl"?la.reverse(la.interpolate(la.forward(e),la.forward(s),r)):Ns.reverse(Ns.interpolate(Ns.forward(e),Ns.forward(s),r))},Fn.prototype.eachChild=function(t){t(this.input);for(var n=0,h=this.outputs;n<h.length;n+=1)t(h[n])},Fn.prototype.outputDefined=function(){return this.outputs.every(function(t){return t.outputDefined()})},Fn.prototype.serialize=function(){var t;t=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var n=[this.operator,t,this.input.serialize()],h=0;h<this.labels.length;h++)n.push(this.labels[h],this.outputs[h].serialize());return n};var Wa=function(t,n){this.type=t,this.args=n};Wa.parse=function(t,n){if(t.length<2)return n.error("Expectected at least one argument.");var h=null,_=n.expectedType;_&&_.kind!=="value"&&(h=_);for(var w=[],C=0,r=t.slice(1);C<r.length;C+=1){var e=n.parse(r[C],1+w.length,h,void 0,{typeAnnotation:"omit"});if(!e)return null;h=h||e.type,w.push(e)}var s=_&&w.some(function(f){return ur(_,f.type)});return new Wa(s?$t:h,w)},Wa.prototype.evaluate=function(t){for(var n,h=null,_=0,w=0,C=this.args;w<C.length&&(_++,(h=C[w].evaluate(t))&&h instanceof Nn&&!h.available&&(n||(n=h.name),h=null,_===this.args.length&&(h=n)),h===null);w+=1);return h},Wa.prototype.eachChild=function(t){this.args.forEach(t)},Wa.prototype.outputDefined=function(){return this.args.every(function(t){return t.outputDefined()})},Wa.prototype.serialize=function(){var t=["coalesce"];return this.eachChild(function(n){t.push(n.serialize())}),t};var $a=function(t,n){this.type=n.type,this.bindings=[].concat(t),this.result=n};$a.prototype.evaluate=function(t){return this.result.evaluate(t)},$a.prototype.eachChild=function(t){for(var n=0,h=this.bindings;n<h.length;n+=1)t(h[n][1]);t(this.result)},$a.parse=function(t,n){if(t.length<4)return n.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var h=[],_=1;_<t.length-1;_+=2){var w=t[_];if(typeof w!="string")return n.error("Expected string, but found "+typeof w+" instead.",_);if(/[^a-zA-Z0-9_]/.test(w))return n.error("Variable names must contain only alphanumeric characters or '_'.",_);var C=n.parse(t[_+1],_+1);if(!C)return null;h.push([w,C])}var r=n.parse(t[t.length-1],t.length-1,n.expectedType,h);return r?new $a(h,r):null},$a.prototype.outputDefined=function(){return this.result.outputDefined()},$a.prototype.serialize=function(){for(var t=["let"],n=0,h=this.bindings;n<h.length;n+=1){var _=h[n];t.push(_[0],_[1].serialize())}return t.push(this.result.serialize()),t};var vs=function(t,n,h){this.type=t,this.index=n,this.input=h};vs.parse=function(t,n){if(t.length!==3)return n.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var h=n.parse(t[1],1,pt),_=n.parse(t[2],2,ze(n.expectedType||$t));return h&&_?new vs(_.type.itemType,h,_):null},vs.prototype.evaluate=function(t){var n=this.index.evaluate(t),h=this.input.evaluate(t);if(n<0)throw new un("Array index out of bounds: "+n+" < 0.");if(n>=h.length)throw new un("Array index out of bounds: "+n+" > "+(h.length-1)+".");if(n!==Math.floor(n))throw new un("Array index must be an integer, but found "+n+" instead.");return h[n]},vs.prototype.eachChild=function(t){t(this.index),t(this.input)},vs.prototype.outputDefined=function(){return!1},vs.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var wa=function(t,n){this.type=Et,this.needle=t,this.haystack=n};wa.parse=function(t,n){if(t.length!==3)return n.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var h=n.parse(t[1],1,$t),_=n.parse(t[2],2,$t);return h&&_?mr(h.type,[Et,St,pt,gt,$t])?new wa(h,_):n.error("Expected first argument to be of type boolean, string, number or null, but found "+Ue(h.type)+" instead"):null},wa.prototype.evaluate=function(t){var n=this.needle.evaluate(t),h=this.haystack.evaluate(t);if(!h)return!1;if(!nr(n,["boolean","string","number","null"]))throw new un("Expected first argument to be of type boolean, string, number or null, but found "+Ue(Yi(n))+" instead.");if(!nr(h,["string","array"]))throw new un("Expected second argument to be of type array or string, but found "+Ue(Yi(h))+" instead.");return h.indexOf(n)>=0},wa.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},wa.prototype.outputDefined=function(){return!0},wa.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var ua=function(t,n,h){this.type=pt,this.needle=t,this.haystack=n,this.fromIndex=h};ua.parse=function(t,n){if(t.length<=2||t.length>=5)return n.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var h=n.parse(t[1],1,$t),_=n.parse(t[2],2,$t);if(!h||!_)return null;if(!mr(h.type,[Et,St,pt,gt,$t]))return n.error("Expected first argument to be of type boolean, string, number or null, but found "+Ue(h.type)+" instead");if(t.length===4){var w=n.parse(t[3],3,pt);return w?new ua(h,_,w):null}return new ua(h,_)},ua.prototype.evaluate=function(t){var n=this.needle.evaluate(t),h=this.haystack.evaluate(t);if(!nr(n,["boolean","string","number","null"]))throw new un("Expected first argument to be of type boolean, string, number or null, but found "+Ue(Yi(n))+" instead.");if(!nr(h,["string","array"]))throw new un("Expected second argument to be of type array or string, but found "+Ue(Yi(h))+" instead.");if(this.fromIndex){var _=this.fromIndex.evaluate(t);return h.indexOf(n,_)}return h.indexOf(n)},ua.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},ua.prototype.outputDefined=function(){return!1},ua.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Uo=function(t,n,h,_,w,C){this.inputType=t,this.type=n,this.input=h,this.cases=_,this.outputs=w,this.otherwise=C};Uo.parse=function(t,n){if(t.length<5)return n.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return n.error("Expected an even number of arguments.");var h,_;n.expectedType&&n.expectedType.kind!=="value"&&(_=n.expectedType);for(var w={},C=[],r=2;r<t.length-1;r+=2){var e=t[r],s=t[r+1];Array.isArray(e)||(e=[e]);var f=n.concat(r);if(e.length===0)return f.error("Expected at least one branch label.");for(var y=0,b=e;y<b.length;y+=1){var E=b[y];if(typeof E!="number"&&typeof E!="string")return f.error("Branch labels must be numbers or strings.");if(typeof E=="number"&&Math.abs(E)>Number.MAX_SAFE_INTEGER)return f.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof E=="number"&&Math.floor(E)!==E)return f.error("Numeric branch labels must be integer values.");if(h){if(f.checkSubtype(h,Yi(E)))return null}else h=Yi(E);if(w[String(E)]!==void 0)return f.error("Branch labels must be unique.");w[String(E)]=C.length}var M=n.parse(s,r,_);if(!M)return null;_=_||M.type,C.push(M)}var z=n.parse(t[1],1,$t);if(!z)return null;var O=n.parse(t[t.length-1],t.length-1,_);return O?z.type.kind!=="value"&&n.concat(1).checkSubtype(h,z.type)?null:new Uo(h,_,z,w,C,O):null},Uo.prototype.evaluate=function(t){var n=this.input.evaluate(t);return(Yi(n)===this.inputType&&this.outputs[this.cases[n]]||this.otherwise).evaluate(t)},Uo.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Uo.prototype.outputDefined=function(){return this.outputs.every(function(t){return t.outputDefined()})&&this.otherwise.outputDefined()},Uo.prototype.serialize=function(){for(var t=this,n=["match",this.input.serialize()],h=[],_={},w=0,C=Object.keys(this.cases).sort();w<C.length;w+=1){var r=C[w];(b=_[this.cases[r]])===void 0?(_[this.cases[r]]=h.length,h.push([this.cases[r],[r]])):h[b][1].push(r)}for(var e=function(M){return t.inputType.kind==="number"?Number(M):M},s=0,f=h;s<f.length;s+=1){var y=f[s],b=y[0],E=y[1];n.push(E.length===1?e(E[0]):E.map(e)),n.push(this.outputs[outputIndex$1].serialize())}return n.push(this.otherwise.serialize()),n};var Ka=function(t,n,h){this.type=t,this.branches=n,this.otherwise=h};Ka.parse=function(t,n){if(t.length<4)return n.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return n.error("Expected an odd number of arguments.");var h;n.expectedType&&n.expectedType.kind!=="value"&&(h=n.expectedType);for(var _=[],w=1;w<t.length-1;w+=2){var C=n.parse(t[w],w,Et);if(!C)return null;var r=n.parse(t[w+1],w+1,h);if(!r)return null;_.push([C,r]),h=h||r.type}var e=n.parse(t[t.length-1],t.length-1,h);return e?new Ka(h,_,e):null},Ka.prototype.evaluate=function(t){for(var n=0,h=this.branches;n<h.length;n+=1){var _=h[n],w=_[1];if(_[0].evaluate(t))return w.evaluate(t)}return this.otherwise.evaluate(t)},Ka.prototype.eachChild=function(t){for(var n=0,h=this.branches;n<h.length;n+=1){var _=h[n],w=_[1];t(_[0]),t(w)}t(this.otherwise)},Ka.prototype.outputDefined=function(){return this.branches.every(function(t){return t[1].outputDefined()})&&this.otherwise.outputDefined()},Ka.prototype.serialize=function(){var t=["case"];return this.eachChild(function(n){t.push(n.serialize())}),t};var Ea=function(t,n,h,_){this.type=t,this.input=n,this.beginIndex=h,this.endIndex=_};function tu(t,n){return t==="=="||t==="!="?n.kind==="boolean"||n.kind==="string"||n.kind==="number"||n.kind==="null"||n.kind==="value":n.kind==="string"||n.kind==="number"||n.kind==="value"}function Ya(t,n,h,_){return _.compare(n,h)===0}function yi(t,n,h){var _=t!=="=="&&t!=="!=";return function(){function w(C,r,e){this.type=Et,this.lhs=C,this.rhs=r,this.collator=e,this.hasUntypedArgument=C.type.kind==="value"||r.type.kind==="value"}return w.parse=function(C,r){if(C.length!==3&&C.length!==4)return r.error("Expected two or three arguments.");var e=C[0],s=r.parse(C[1],1,$t);if(!s)return null;if(!tu(e,s.type))return r.concat(1).error('"'+e+`" comparisons are not supported for type '`+Ue(s.type)+"'.");var f=r.parse(C[2],2,$t);if(!f)return null;if(!tu(e,f.type))return r.concat(2).error('"'+e+`" comparisons are not supported for type '`+Ue(f.type)+"'.");if(s.type.kind!==f.type.kind&&s.type.kind!=="value"&&f.type.kind!=="value")return r.error("Cannot compare types '"+Ue(s.type)+"' and '"+Ue(f.type)+"'.");_&&(s.type.kind==="value"&&f.type.kind!=="value"?s=new Si(f.type,[s]):s.type.kind!=="value"&&f.type.kind==="value"&&(f=new Si(s.type,[f])));var y=null;if(C.length===4){if(s.type.kind!=="string"&&f.type.kind!=="string"&&s.type.kind!=="value"&&f.type.kind!=="value")return r.error("Cannot use collator to compare non-string types.");if(!(y=r.parse(C[3],3,ee)))return null}return new w(s,f,y)},w.prototype.evaluate=function(C){var r=this.lhs.evaluate(C),e=this.rhs.evaluate(C);if(_&&this.hasUntypedArgument){var s=Yi(r),f=Yi(e);if(s.kind!==f.kind||s.kind!=="string"&&s.kind!=="number")throw new un('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+f.kind+") instead.")}if(this.collator&&!_&&this.hasUntypedArgument){var y=Yi(r),b=Yi(e);if(y.kind!=="string"||b.kind!=="string")return n(C,r,e)}return this.collator?h(C,r,e,this.collator.evaluate(C)):n(C,r,e)},w.prototype.eachChild=function(C){C(this.lhs),C(this.rhs),this.collator&&C(this.collator)},w.prototype.outputDefined=function(){return!0},w.prototype.serialize=function(){var C=[t];return this.eachChild(function(r){C.push(r.serialize())}),C},w}()}Ea.parse=function(t,n){if(t.length<=2||t.length>=5)return n.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var h=n.parse(t[1],1,$t),_=n.parse(t[2],2,pt);if(!h||!_)return null;if(!mr(h.type,[ze($t),St,$t]))return n.error("Expected first argument to be of type array or string, but found "+Ue(h.type)+" instead");if(t.length===4){var w=n.parse(t[3],3,pt);return w?new Ea(h.type,h,_,w):null}return new Ea(h.type,h,_)},Ea.prototype.evaluate=function(t){var n=this.input.evaluate(t),h=this.beginIndex.evaluate(t);if(!nr(n,["string","array"]))throw new un("Expected first argument to be of type array or string, but found "+Ue(Yi(n))+" instead.");if(this.endIndex){var _=this.endIndex.evaluate(t);return n.slice(h,_)}return n.slice(h)},Ea.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},Ea.prototype.outputDefined=function(){return!1},Ea.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var xs=yi("==",function(t,n,h){return n===h},Ya),Sa=yi("!=",function(t,n,h){return n!==h},function(t,n,h,_){return!Ya(0,n,h,_)}),Vu=yi("<",function(t,n,h){return n<h},function(t,n,h,_){return _.compare(n,h)<0}),eu=yi(">",function(t,n,h){return n>h},function(t,n,h,_){return _.compare(n,h)>0}),Ur=yi("<=",function(t,n,h){return n<=h},function(t,n,h,_){return _.compare(n,h)<=0}),ml=yi(">=",function(t,n,h){return n>=h},function(t,n,h,_){return _.compare(n,h)>=0}),ei=function(t,n,h,_,w){this.type=St,this.number=t,this.locale=n,this.currency=h,this.minFractionDigits=_,this.maxFractionDigits=w};ei.parse=function(t,n){if(t.length!==3)return n.error("Expected two arguments.");var h=n.parse(t[1],1,pt);if(!h)return null;var _=t[2];if(typeof _!="object"||Array.isArray(_))return n.error("NumberFormat options argument must be an object.");var w=null;if(_.locale&&!(w=n.parse(_.locale,1,St)))return null;var C=null;if(_.currency&&!(C=n.parse(_.currency,1,St)))return null;var r=null;if(_["min-fraction-digits"]&&!(r=n.parse(_["min-fraction-digits"],1,pt)))return null;var e=null;return _["max-fraction-digits"]&&!(e=n.parse(_["max-fraction-digits"],1,pt))?null:new ei(h,w,C,r,e)},ei.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},ei.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},ei.prototype.outputDefined=function(){return!1},ei.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Wo=function(t){this.type=pt,this.input=t};Wo.parse=function(t,n){if(t.length!==2)return n.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var h=n.parse(t[1],1);return h?h.type.kind!=="array"&&h.type.kind!=="string"&&h.type.kind!=="value"?n.error("Expected argument of type string or array, but found "+Ue(h.type)+" instead."):new Wo(h):null},Wo.prototype.evaluate=function(t){var n=this.input.evaluate(t);if(typeof n=="string"||Array.isArray(n))return n.length;throw new un("Expected value to be of type string or array, but found "+Ue(Yi(n))+" instead.")},Wo.prototype.eachChild=function(t){t(this.input)},Wo.prototype.outputDefined=function(){return!1},Wo.prototype.serialize=function(){var t=["length"];return this.eachChild(function(n){t.push(n.serialize())}),t};var xi={"==":xs,"!=":Sa,">":eu,"<":Vu,">=":ml,"<=":Ur,array:Si,at:vs,boolean:Si,case:Ka,coalesce:Wa,collator:po,format:Mo,image:oo,in:wa,"index-of":ua,interpolate:Fn,"interpolate-hcl":Fn,"interpolate-lab":Fn,length:Wo,let:$a,literal:Wn,match:Uo,number:Si,"number-format":ei,object:Si,slice:Ea,step:Dn,string:Si,"to-boolean":Lo,"to-color":Lo,"to-number":Lo,"to-string":Lo,var:Yr,within:fo};function Qi(t,n){var h=n[0],_=n[1],w=n[2],C=n[3];h=h.evaluate(t),_=_.evaluate(t),w=w.evaluate(t);var r=C?C.evaluate(t):1,e=sl(h,_,w,r);if(e)throw new un(e);return new Sr(h/255*r,_/255*r,w/255*r,r)}function gl(t,n){return t in n}function yl(t,n){var h=n[t];return h===void 0?null:h}function bs(t){return{type:t}}function ru(t){return{result:"success",value:t}}function ca(t){return{result:"error",value:t}}function ha(t){return t["property-type"]==="data-driven"||t["property-type"]==="cross-faded-data-driven"}function _l(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Ha(t){return!!t.expression&&t.expression.interpolated}function bi(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":t===null?"null":typeof t}function Ta(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function iu(t){return t}function $n(t,n,h){return t!==void 0?t:n!==void 0?n:h!==void 0?h:void 0}function Gu(t,n,h,_,w){return $n(typeof h===w?_[h]:void 0,t.default,n.default)}function Mc(t,n,h){if(bi(h)!=="number")return $n(t.default,n.default);var _=t.stops.length;if(_===1||h<=t.stops[0][0])return t.stops[0][1];if(h>=t.stops[_-1][0])return t.stops[_-1][1];var w=Xa(t.stops.map(function(C){return C[0]}),h);return t.stops[w][1]}function ju(t,n,h){var _=t.base!==void 0?t.base:1;if(bi(h)!=="number")return $n(t.default,n.default);var w=t.stops.length;if(w===1||h<=t.stops[0][0])return t.stops[0][1];if(h>=t.stops[w-1][0])return t.stops[w-1][1];var C=Xa(t.stops.map(function(b){return b[0]}),h),r=function(b,E,M,z){var O=z-M,G=b-M;return O===0?0:E===1?G/O:(Math.pow(E,G)-1)/(Math.pow(E,O)-1)}(h,_,t.stops[C][0],t.stops[C+1][0]),e=t.stops[C][1],s=t.stops[C+1][1],f=On[n.type]||iu;if(t.colorSpace&&t.colorSpace!=="rgb"){var y=Pc[t.colorSpace];f=function(b,E){return y.reverse(y.interpolate(y.forward(b),y.forward(E),r))}}return typeof e.evaluate=="function"?{evaluate:function(){for(var b=[],E=arguments.length;E--;)b[E]=arguments[E];var M=e.evaluate.apply(void 0,b),z=s.evaluate.apply(void 0,b);if(M!==void 0&&z!==void 0)return f(M,z,r)}}:f(e,s,r)}function Ia(t,n,h){return n.type==="color"?h=Sr.parse(h):n.type==="formatted"?h=si.fromString(h.toString()):n.type==="resolvedImage"?h=Nn.fromString(h.toString()):bi(h)===n.type||n.type==="enum"&&n.values[h]||(h=void 0),$n(h,t.default,n.default)}Hi.register(xi,{error:[{kind:"error"},[St],function(t,n){throw new un(n[0].evaluate(t))}],typeof:[St,[$t],function(t,n){return Ue(Yi(n[0].evaluate(t)))}],"to-rgba":[ze(pt,4),[Ct],function(t,n){return n[0].evaluate(t).toArray()}],rgb:[Ct,[pt,pt,pt],Qi],rgba:[Ct,[pt,pt,pt,pt],Qi],has:{type:Et,overloads:[[[St],function(t,n){return gl(n[0].evaluate(t),t.properties())}],[[St,te],function(t,n){var h=n[1];return gl(n[0].evaluate(t),h.evaluate(t))}]]},get:{type:$t,overloads:[[[St],function(t,n){return yl(n[0].evaluate(t),t.properties())}],[[St,te],function(t,n){var h=n[1];return yl(n[0].evaluate(t),h.evaluate(t))}]]},"feature-state":[$t,[St],function(t,n){return yl(n[0].evaluate(t),t.featureState||{})}],properties:[te,[],function(t){return t.properties()}],"geometry-type":[St,[],function(t){return t.geometryType()}],id:[$t,[],function(t){return t.id()}],zoom:[pt,[],function(t){return t.globals.zoom}],"heatmap-density":[pt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[pt,[],function(t){return t.globals.lineProgress||0}],accumulated:[$t,[],function(t){return t.globals.accumulated===void 0?null:t.globals.accumulated}],"+":[pt,bs(pt),function(t,n){for(var h=0,_=0,w=n;_<w.length;_+=1)h+=w[_].evaluate(t);return h}],"*":[pt,bs(pt),function(t,n){for(var h=1,_=0,w=n;_<w.length;_+=1)h*=w[_].evaluate(t);return h}],"-":{type:pt,overloads:[[[pt,pt],function(t,n){var h=n[1];return n[0].evaluate(t)-h.evaluate(t)}],[[pt],function(t,n){return-n[0].evaluate(t)}]]},"/":[pt,[pt,pt],function(t,n){var h=n[1];return n[0].evaluate(t)/h.evaluate(t)}],"%":[pt,[pt,pt],function(t,n){var h=n[1];return n[0].evaluate(t)%h.evaluate(t)}],ln2:[pt,[],function(){return Math.LN2}],pi:[pt,[],function(){return Math.PI}],e:[pt,[],function(){return Math.E}],"^":[pt,[pt,pt],function(t,n){var h=n[1];return Math.pow(n[0].evaluate(t),h.evaluate(t))}],sqrt:[pt,[pt],function(t,n){return Math.sqrt(n[0].evaluate(t))}],log10:[pt,[pt],function(t,n){return Math.log(n[0].evaluate(t))/Math.LN10}],ln:[pt,[pt],function(t,n){return Math.log(n[0].evaluate(t))}],log2:[pt,[pt],function(t,n){return Math.log(n[0].evaluate(t))/Math.LN2}],sin:[pt,[pt],function(t,n){return Math.sin(n[0].evaluate(t))}],cos:[pt,[pt],function(t,n){return Math.cos(n[0].evaluate(t))}],tan:[pt,[pt],function(t,n){return Math.tan(n[0].evaluate(t))}],asin:[pt,[pt],function(t,n){return Math.asin(n[0].evaluate(t))}],acos:[pt,[pt],function(t,n){return Math.acos(n[0].evaluate(t))}],atan:[pt,[pt],function(t,n){return Math.atan(n[0].evaluate(t))}],min:[pt,bs(pt),function(t,n){return Math.min.apply(Math,n.map(function(h){return h.evaluate(t)}))}],max:[pt,bs(pt),function(t,n){return Math.max.apply(Math,n.map(function(h){return h.evaluate(t)}))}],abs:[pt,[pt],function(t,n){return Math.abs(n[0].evaluate(t))}],round:[pt,[pt],function(t,n){var h=n[0].evaluate(t);return h<0?-Math.round(-h):Math.round(h)}],floor:[pt,[pt],function(t,n){return Math.floor(n[0].evaluate(t))}],ceil:[pt,[pt],function(t,n){return Math.ceil(n[0].evaluate(t))}],"filter-==":[Et,[St,$t],function(t,n){var h=n[0],_=n[1];return t.properties()[h.value]===_.value}],"filter-id-==":[Et,[$t],function(t,n){var h=n[0];return t.id()===h.value}],"filter-type-==":[Et,[St],function(t,n){var h=n[0];return t.geometryType()===h.value}],"filter-<":[Et,[St,$t],function(t,n){var h=n[0],_=n[1],w=t.properties()[h.value],C=_.value;return typeof w==typeof C&&w<C}],"filter-id-<":[Et,[$t],function(t,n){var h=n[0],_=t.id(),w=h.value;return typeof _==typeof w&&_<w}],"filter->":[Et,[St,$t],function(t,n){var h=n[0],_=n[1],w=t.properties()[h.value],C=_.value;return typeof w==typeof C&&w>C}],"filter-id->":[Et,[$t],function(t,n){var h=n[0],_=t.id(),w=h.value;return typeof _==typeof w&&_>w}],"filter-<=":[Et,[St,$t],function(t,n){var h=n[0],_=n[1],w=t.properties()[h.value],C=_.value;return typeof w==typeof C&&w<=C}],"filter-id-<=":[Et,[$t],function(t,n){var h=n[0],_=t.id(),w=h.value;return typeof _==typeof w&&_<=w}],"filter->=":[Et,[St,$t],function(t,n){var h=n[0],_=n[1],w=t.properties()[h.value],C=_.value;return typeof w==typeof C&&w>=C}],"filter-id->=":[Et,[$t],function(t,n){var h=n[0],_=t.id(),w=h.value;return typeof _==typeof w&&_>=w}],"filter-has":[Et,[$t],function(t,n){return n[0].value in t.properties()}],"filter-has-id":[Et,[],function(t){return t.id()!==null&&t.id()!==void 0}],"filter-type-in":[Et,[ze(St)],function(t,n){return n[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Et,[ze($t)],function(t,n){return n[0].value.indexOf(t.id())>=0}],"filter-in-small":[Et,[St,ze($t)],function(t,n){var h=n[0];return n[1].value.indexOf(t.properties()[h.value])>=0}],"filter-in-large":[Et,[St,ze($t)],function(t,n){var h=n[0],_=n[1];return function(w,C,r,e){for(;r<=e;){var s=r+e>>1;if(C[s]===w)return!0;C[s]>w?e=s-1:r=s+1}return!1}(t.properties()[h.value],_.value,0,_.value.length-1)}],all:{type:Et,overloads:[[[Et,Et],function(t,n){var h=n[1];return n[0].evaluate(t)&&h.evaluate(t)}],[bs(Et),function(t,n){for(var h=0,_=n;h<_.length;h+=1)if(!_[h].evaluate(t))return!1;return!0}]]},any:{type:Et,overloads:[[[Et,Et],function(t,n){var h=n[1];return n[0].evaluate(t)||h.evaluate(t)}],[bs(Et),function(t,n){for(var h=0,_=n;h<_.length;h+=1)if(_[h].evaluate(t))return!0;return!1}]]},"!":[Et,[Et],function(t,n){return!n[0].evaluate(t)}],"is-supported-script":[Et,[St],function(t,n){var h=t.globals&&t.globals.isSupportedScript;return!h||h(n[0].evaluate(t))}],upcase:[St,[St],function(t,n){return n[0].evaluate(t).toUpperCase()}],downcase:[St,[St],function(t,n){return n[0].evaluate(t).toLowerCase()}],concat:[St,bs($t),function(t,n){return n.map(function(h){return gs(h.evaluate(t))}).join("")}],"resolved-locale":[St,[ee],function(t,n){return n[0].evaluate(t).resolvedLocale()}]});var Ca=function(t,n){this.expression=t,this._warningHistory={},this._evaluator=new Bo,this._defaultValue=n?function(h){return h.type==="color"&&Ta(h.default)?new Sr(0,0,0,0):h.type==="color"?Sr.parse(h.default)||null:h.default===void 0?null:h.default}(n):null,this._enumValues=n&&n.type==="enum"?n.values:null};function ws(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&t[0]in xi}function vl(t,n){var h=new Za(xi,[],n?function(w){var C={color:Ct,string:St,number:pt,enum:St,boolean:Et,formatted:De,resolvedImage:Se};return w.type==="array"?ze(C[w.value]||$t,w.length):C[w.type]}(n):void 0),_=h.parse(t,void 0,void 0,void 0,n&&n.type==="string"?{typeAnnotation:"coerce"}:void 0);return _?ru(new Ca(_,n)):ca(h.errors)}Ca.prototype.evaluateWithoutErrorHandling=function(t,n,h,_,w,C){return this._evaluator.globals=t,this._evaluator.feature=n,this._evaluator.featureState=h,this._evaluator.canonical=_,this._evaluator.availableImages=w||null,this._evaluator.formattedSection=C,this.expression.evaluate(this._evaluator)},Ca.prototype.evaluate=function(t,n,h,_,w,C){this._evaluator.globals=t,this._evaluator.feature=n||null,this._evaluator.featureState=h||null,this._evaluator.canonical=_,this._evaluator.availableImages=w||null,this._evaluator.formattedSection=C||null;try{var r=this.expression.evaluate(this._evaluator);if(r==null||typeof r=="number"&&r!=r)return this._defaultValue;if(this._enumValues&&!(r in this._enumValues))throw new un("Expected value to be one of "+Object.keys(this._enumValues).map(function(e){return JSON.stringify(e)}).join(", ")+", but found "+JSON.stringify(r)+" instead.");return r}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,typeof console<"u"&&console.warn(e.message)),this._defaultValue}};var Ja=function(t,n){this.kind=t,this._styleExpression=n,this.isStateDependent=t!=="constant"&&!sa(n.expression)};Ja.prototype.evaluateWithoutErrorHandling=function(t,n,h,_,w,C){return this._styleExpression.evaluateWithoutErrorHandling(t,n,h,_,w,C)},Ja.prototype.evaluate=function(t,n,h,_,w,C){return this._styleExpression.evaluate(t,n,h,_,w,C)};var Aa=function(t,n,h,_){this.kind=t,this.zoomStops=h,this._styleExpression=n,this.isStateDependent=t!=="camera"&&!sa(n.expression),this.interpolationType=_};function qu(t,n){if((t=vl(t,n)).result==="error")return t;var h=t.value.expression,_=aa(h);if(!_&&!ha(n))return ca([new rt("","data expressions not supported")]);var w=qa(h,["zoom"]);if(!w&&!_l(n))return ca([new rt("","zoom expressions not supported")]);var C=function r(e){var s=null;if(e instanceof $a)s=r(e.result);else if(e instanceof Wa)for(var f=0,y=e.args;f<y.length&&!(s=r(y[f]));f+=1);else(e instanceof Dn||e instanceof Fn)&&e.input instanceof Hi&&e.input.name==="zoom"&&(s=e);return s instanceof rt||e.eachChild(function(b){var E=r(b);E instanceof rt?s=E:!s&&E?s=new rt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):s&&E&&s!==E&&(s=new rt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),s}(h);return C||w?C instanceof rt?ca([C]):C instanceof Fn&&!Ha(n)?ca([new rt("",'"interpolate" expressions cannot be used with this property')]):ru(C?new Aa(_?"camera":"composite",t.value,C.labels,C instanceof Fn?C.interpolation:void 0):new Ja(_?"constant":"source",t.value)):ca([new rt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Aa.prototype.evaluateWithoutErrorHandling=function(t,n,h,_,w,C){return this._styleExpression.evaluateWithoutErrorHandling(t,n,h,_,w,C)},Aa.prototype.evaluate=function(t,n,h,_,w,C){return this._styleExpression.evaluate(t,n,h,_,w,C)},Aa.prototype.interpolationFactor=function(t,n,h){return this.interpolationType?Fn.interpolationFactor(this.interpolationType,t,n,h):0};var pa=function(t,n){this._parameters=t,this._specification=n,nt(this,function h(_,w){var C,r,e,s=w.type==="color",f=_.stops&&typeof _.stops[0][0]=="object",y=f||!(f||_.property!==void 0),b=_.type||(Ha(w)?"exponential":"interval");if(s&&((_=nt({},_)).stops&&(_.stops=_.stops.map(function(qt){return[qt[0],Sr.parse(qt[1])]})),_.default=Sr.parse(_.default?_.default:w.default)),_.colorSpace&&_.colorSpace!=="rgb"&&!Pc[_.colorSpace])throw new Error("Unknown color space: "+_.colorSpace);if(b==="exponential")C=ju;else if(b==="interval")C=Mc;else if(b==="categorical"){C=Gu,r=Object.create(null);for(var E=0,M=_.stops;E<M.length;E+=1){var z=M[E];r[z[0]]=z[1]}e=typeof _.stops[0][0]}else{if(b!=="identity")throw new Error('Unknown function type "'+b+'"');C=Ia}if(f){for(var O={},G=[],V=0;V<_.stops.length;V++){var W=_.stops[V],Y=W[0].zoom;O[Y]===void 0&&(O[Y]={zoom:Y,type:_.type,property:_.property,default:_.default,stops:[]},G.push(Y)),O[Y].stops.push([W[0].value,W[1]])}for(var H=[],ot=0,ht=G;ot<ht.length;ot+=1){var Pt=ht[ot];H.push([O[Pt].zoom,h(O[Pt],w)])}var Ut={name:"linear"};return{kind:"composite",interpolationType:Ut,interpolationFactor:Fn.interpolationFactor.bind(void 0,Ut),zoomStops:H.map(function(qt){return qt[0]}),evaluate:function(qt,re){var Xt=qt.zoom;return ju({stops:H,base:_.base},w,Xt).evaluate(Xt,re)}}}if(y){var jt=b==="exponential"?{name:"exponential",base:_.base!==void 0?_.base:1}:null;return{kind:"camera",interpolationType:jt,interpolationFactor:Fn.interpolationFactor.bind(void 0,jt),zoomStops:_.stops.map(function(qt){return qt[0]}),evaluate:function(qt){return C(_,w,qt.zoom,r,e)}}}return{kind:"source",evaluate:function(qt,re){var Xt=re&&re.properties?re.properties[_.property]:void 0;return Xt===void 0?$n(_.default,w.default):C(_,w,Xt,r,e)}}}(this._parameters,this._specification))};function ko(t){var n=t.key,h=t.value,_=t.valueSpec||{},w=t.objectElementValidators||{},C=t.style,r=t.styleSpec,e=[],s=bi(h);if(s!=="object")return[new zt(n,h,"object expected, "+s+" found")];for(var f in h){var y=f.split(".")[0],b=_[y]||_["*"],E=void 0;if(w[y])E=w[y];else if(_[y])E=Gr;else if(w["*"])E=w["*"];else{if(!_["*"]){e.push(new zt(n,h[f],'unknown property "'+f+'"'));continue}E=Gr}e=e.concat(E({key:(n&&n+".")+f,value:h[f],valueSpec:b,style:C,styleSpec:r,object:h,objectKey:f},h))}for(var M in _)w[M]||_[M].required&&_[M].default===void 0&&h[M]===void 0&&e.push(new zt(n,h,'missing required property "'+M+'"'));return e}function xl(t){var n=t.value,h=t.valueSpec,_=t.style,w=t.styleSpec,C=t.key,r=t.arrayElementValidator||Gr;if(bi(n)!=="array")return[new zt(C,n,"array expected, "+bi(n)+" found")];if(h.length&&n.length!==h.length)return[new zt(C,n,"array length "+h.length+" expected, length "+n.length+" found")];if(h["min-length"]&&n.length<h["min-length"])return[new zt(C,n,"array length at least "+h["min-length"]+" expected, length "+n.length+" found")];var e={type:h.value,values:h.values};w.$version<7&&(e.function=h.function),bi(h.value)==="object"&&(e=h.value);for(var s=[],f=0;f<n.length;f++)s=s.concat(r({array:n,arrayIndex:f,value:n[f],valueSpec:e,style:_,styleSpec:w,key:C+"["+f+"]"}));return s}function bl(t){var n=t.key,h=t.value,_=t.valueSpec,w=bi(h);return w==="number"&&h!=h&&(w="NaN"),w!=="number"?[new zt(n,h,"number expected, "+w+" found")]:"minimum"in _&&h<_.minimum?[new zt(n,h,h+" is less than the minimum value "+_.minimum)]:"maximum"in _&&h>_.maximum?[new zt(n,h,h+" is greater than the maximum value "+_.maximum)]:[]}function Es(t){var n,h,_,w=t.valueSpec,C=X(t.value.type),r={},e=C!=="categorical"&&t.value.property===void 0,s=!e,f=bi(t.value.stops)==="array"&&bi(t.value.stops[0])==="array"&&bi(t.value.stops[0][0])==="object",y=ko({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(M){if(C==="identity")return[new zt(M.key,M.value,'identity function may not have a "stops" property')];var z=[],O=M.value;return z=z.concat(xl({key:M.key,value:O,valueSpec:M.valueSpec,style:M.style,styleSpec:M.styleSpec,arrayElementValidator:b})),bi(O)==="array"&&O.length===0&&z.push(new zt(M.key,O,"array must have at least one stop")),z},default:function(M){return Gr({key:M.key,value:M.value,valueSpec:w,style:M.style,styleSpec:M.styleSpec})}}});return C==="identity"&&e&&y.push(new zt(t.key,t.value,'missing required property "property"')),C==="identity"||t.value.stops||y.push(new zt(t.key,t.value,'missing required property "stops"')),C==="exponential"&&t.valueSpec.expression&&!Ha(t.valueSpec)&&y.push(new zt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(s&&!ha(t.valueSpec)?y.push(new zt(t.key,t.value,"property functions not supported")):e&&!_l(t.valueSpec)&&y.push(new zt(t.key,t.value,"zoom functions not supported"))),C!=="categorical"&&!f||t.value.property!==void 0||y.push(new zt(t.key,t.value,'"property" property is required')),y;function b(M){var z=[],O=M.value,G=M.key;if(bi(O)!=="array")return[new zt(G,O,"array expected, "+bi(O)+" found")];if(O.length!==2)return[new zt(G,O,"array length 2 expected, length "+O.length+" found")];if(f){if(bi(O[0])!=="object")return[new zt(G,O,"object expected, "+bi(O[0])+" found")];if(O[0].zoom===void 0)return[new zt(G,O,"object stop key must have zoom")];if(O[0].value===void 0)return[new zt(G,O,"object stop key must have value")];if(_&&_>X(O[0].zoom))return[new zt(G,O[0].zoom,"stop zoom values must appear in ascending order")];X(O[0].zoom)!==_&&(_=X(O[0].zoom),h=void 0,r={}),z=z.concat(ko({key:G+"[0]",value:O[0],valueSpec:{zoom:{}},style:M.style,styleSpec:M.styleSpec,objectElementValidators:{zoom:bl,value:E}}))}else z=z.concat(E({key:G+"[0]",value:O[0],valueSpec:{},style:M.style,styleSpec:M.styleSpec},O));return ws(Z(O[1]))?z.concat([new zt(G+"[1]",O[1],"expressions are not allowed in function stops.")]):z.concat(Gr({key:G+"[1]",value:O[1],valueSpec:w,style:M.style,styleSpec:M.styleSpec}))}function E(M,z){var O=bi(M.value),G=X(M.value),V=M.value!==null?M.value:z;if(n){if(O!==n)return[new zt(M.key,V,O+" stop domain type must match previous stop domain type "+n)]}else n=O;if(O!=="number"&&O!=="string"&&O!=="boolean")return[new zt(M.key,V,"stop domain value must be a number, string, or boolean")];if(O!=="number"&&C!=="categorical"){var W="number expected, "+O+" found";return ha(w)&&C===void 0&&(W+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new zt(M.key,V,W)]}return C!=="categorical"||O!=="number"||isFinite(G)&&Math.floor(G)===G?C!=="categorical"&&O==="number"&&h!==void 0&&G<h?[new zt(M.key,V,"stop domain values must appear in ascending order")]:(h=G,C==="categorical"&&G in r?[new zt(M.key,V,"stop domain values must be unique")]:(r[G]=!0,[])):[new zt(M.key,V,"integer expected, found "+G)]}}function $o(t){var n=(t.expressionContext==="property"?qu:vl)(Z(t.value),t.valueSpec);if(n.result==="error")return n.value.map(function(_){return new zt(""+t.key+_.key,t.value,_.message)});var h=n.value.expression||n.value._styleExpression.expression;if(t.expressionContext==="property"&&t.propertyKey==="text-font"&&!h.outputDefined())return[new zt(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if(t.expressionContext==="property"&&t.propertyType==="layout"&&!sa(h))return[new zt(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if(t.expressionContext==="filter"&&!sa(h))return[new zt(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&t.expressionContext.indexOf("cluster")===0){if(!qa(h,["zoom","feature-state"]))return[new zt(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(t.expressionContext==="cluster-initial"&&!aa(h))return[new zt(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Vs(t){var n=t.key,h=t.value,_=t.valueSpec,w=[];return Array.isArray(_.values)?_.values.indexOf(X(h))===-1&&w.push(new zt(n,h,"expected one of ["+_.values.join(", ")+"], "+JSON.stringify(h)+" found")):Object.keys(_.values).indexOf(X(h))===-1&&w.push(new zt(n,h,"expected one of ["+Object.keys(_.values).join(", ")+"], "+JSON.stringify(h)+" found")),w}function Qa(t){if(t===!0||t===!1)return!0;if(!Array.isArray(t)||t.length===0)return!1;switch(t[0]){case"has":return t.length>=2&&t[1]!=="$id"&&t[1]!=="$type";case"in":return t.length>=3&&(typeof t[1]!="string"||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var n=0,h=t.slice(1);n<h.length;n+=1){var _=h[n];if(!Qa(_)&&typeof _!="boolean")return!1}return!0;default:return!0}}pa.deserialize=function(t){return new pa(t._parameters,t._specification)},pa.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var nu={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function wl(t){if(t==null)return{filter:function(){return!0},needGeometry:!1};Qa(t)||(t=Pa(t));var n=vl(t,nu);if(n.result==="error")throw new Error(n.value.map(function(h){return h.key+": "+h.message}).join(", "));return{filter:function(h,_,w){return n.value.evaluate(h,_,{},w)},needGeometry:function h(_){if(!Array.isArray(_))return!1;if(_[0]==="within")return!0;for(var w=1;w<_.length;w++)if(h(_[w]))return!0;return!1}(t)}}function Lc(t,n){return t<n?-1:t>n?1:0}function Pa(t){if(!t)return!0;var n,h=t[0];return t.length<=1?h!=="any":h==="=="?ou(t[1],t[2],"=="):h==="!="?Kn(ou(t[1],t[2],"==")):h==="<"||h===">"||h==="<="||h===">="?ou(t[1],t[2],h):h==="any"?(n=t.slice(1),["any"].concat(n.map(Pa))):h==="all"?["all"].concat(t.slice(1).map(Pa)):h==="none"?["all"].concat(t.slice(1).map(Pa).map(Kn)):h==="in"?Gs(t[1],t.slice(2)):h==="!in"?Kn(Gs(t[1],t.slice(2))):h==="has"?js(t[1]):h==="!has"?Kn(js(t[1])):h!=="within"||t}function ou(t,n,h){switch(t){case"$type":return["filter-type-"+h,n];case"$id":return["filter-id-"+h,n];default:return["filter-"+h,t,n]}}function Gs(t,n){if(n.length===0)return!1;switch(t){case"$type":return["filter-type-in",["literal",n]];case"$id":return["filter-id-in",["literal",n]];default:return n.length>200&&!n.some(function(h){return typeof h!=typeof n[0]})?["filter-in-large",t,["literal",n.sort(Lc)]]:["filter-in-small",t,["literal",n]]}}function js(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Kn(t){return["!",t]}function Yn(t){return Qa(Z(t.value))?$o(nt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function n(h){var _=h.value,w=h.key;if(bi(_)!=="array")return[new zt(w,_,"array expected, "+bi(_)+" found")];var C,r=h.styleSpec,e=[];if(_.length<1)return[new zt(w,_,"filter array must have at least 1 element")];switch(e=e.concat(Vs({key:w+"[0]",value:_[0],valueSpec:r.filter_operator,style:h.style,styleSpec:h.styleSpec})),X(_[0])){case"<":case"<=":case">":case">=":_.length>=2&&X(_[1])==="$type"&&e.push(new zt(w,_,'"$type" cannot be use with operator "'+_[0]+'"'));case"==":case"!=":_.length!==3&&e.push(new zt(w,_,'filter array for operator "'+_[0]+'" must have 3 elements'));case"in":case"!in":_.length>=2&&(C=bi(_[1]))!=="string"&&e.push(new zt(w+"[1]",_[1],"string expected, "+C+" found"));for(var s=2;s<_.length;s++)C=bi(_[s]),X(_[1])==="$type"?e=e.concat(Vs({key:w+"["+s+"]",value:_[s],valueSpec:r.geometry_type,style:h.style,styleSpec:h.styleSpec})):C!=="string"&&C!=="number"&&C!=="boolean"&&e.push(new zt(w+"["+s+"]",_[s],"string, number, or boolean expected, "+C+" found"));break;case"any":case"all":case"none":for(var f=1;f<_.length;f++)e=e.concat(n({key:w+"["+f+"]",value:_[f],style:h.style,styleSpec:h.styleSpec}));break;case"has":case"!has":C=bi(_[1]),_.length!==2?e.push(new zt(w,_,'filter array for "'+_[0]+'" operator must have 2 elements')):C!=="string"&&e.push(new zt(w+"[1]",_[1],"string expected, "+C+" found"));break;case"within":C=bi(_[1]),_.length!==2?e.push(new zt(w,_,'filter array for "'+_[0]+'" operator must have 2 elements')):C!=="object"&&e.push(new zt(w+"[1]",_[1],"object expected, "+C+" found"))}return e}(t)}function Zu(t,n){var h=t.key,_=t.style,w=t.styleSpec,C=t.value,r=t.objectKey,e=w[n+"_"+t.layerType];if(!e)return[];var s=r.match(/^(.*)-transition$/);if(n==="paint"&&s&&e[s[1]]&&e[s[1]].transition)return Gr({key:h,value:C,valueSpec:w.transition,style:_,styleSpec:w});var f,y=t.valueSpec||e[r];if(!y)return[new zt(h,C,'unknown property "'+r+'"')];if(bi(C)==="string"&&ha(y)&&!y.tokens&&(f=/^{([^}]+)}$/.exec(C)))return[new zt(h,C,'"'+r+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(f[1])+" }`.")];var b=[];return t.layerType==="symbol"&&(r==="text-field"&&_&&!_.glyphs&&b.push(new zt(h,C,'use of "text-field" requires a style "glyphs" property')),r==="text-font"&&Ta(Z(C))&&X(C.type)==="identity"&&b.push(new zt(h,C,'"text-font" does not support identity functions'))),b.concat(Gr({key:t.key,value:C,valueSpec:y,style:_,styleSpec:w,expressionContext:"property",propertyType:n,propertyKey:r}))}function Ma(t){return Zu(t,"paint")}function qs(t){return Zu(t,"layout")}function Ss(t){var n=[],h=t.value,_=t.key,w=t.style,C=t.styleSpec;h.type||h.ref||n.push(new zt(_,h,'either "type" or "ref" is required'));var r,e=X(h.type),s=X(h.ref);if(h.id)for(var f=X(h.id),y=0;y<t.arrayIndex;y++){var b=w.layers[y];X(b.id)===f&&n.push(new zt(_,h.id,'duplicate layer id "'+h.id+'", previously used at line '+b.id.__line__))}if("ref"in h)["type","source","source-layer","filter","layout"].forEach(function(z){z in h&&n.push(new zt(_,h[z],'"'+z+'" is prohibited for ref layers'))}),w.layers.forEach(function(z){X(z.id)===s&&(r=z)}),r?r.ref?n.push(new zt(_,h.ref,"ref cannot reference another ref layer")):e=X(r.type):n.push(new zt(_,h.ref,'ref layer "'+s+'" not found'));else if(e!=="background")if(h.source){var E=w.sources&&w.sources[h.source],M=E&&X(E.type);E?M==="vector"&&e==="raster"?n.push(new zt(_,h.source,'layer "'+h.id+'" requires a raster source')):M==="raster"&&e!=="raster"?n.push(new zt(_,h.source,'layer "'+h.id+'" requires a vector source')):M!=="vector"||h["source-layer"]?M==="raster-dem"&&e!=="hillshade"?n.push(new zt(_,h.source,"raster-dem source can only be used with layer type 'hillshade'.")):e!=="line"||!h.paint||!h.paint["line-gradient"]||M==="geojson"&&E.lineMetrics||n.push(new zt(_,h,'layer "'+h.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):n.push(new zt(_,h,'layer "'+h.id+'" must specify a "source-layer"')):n.push(new zt(_,h.source,'source "'+h.source+'" not found'))}else n.push(new zt(_,h,'missing required property "source"'));return n=n.concat(ko({key:_,value:h,valueSpec:C.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Gr({key:_+".type",value:h.type,valueSpec:C.layer.type,style:t.style,styleSpec:t.styleSpec,object:h,objectKey:"type"})},filter:Yn,layout:function(z){return ko({layer:h,key:z.key,value:z.value,style:z.style,styleSpec:z.styleSpec,objectElementValidators:{"*":function(O){return qs(nt({layerType:e},O))}}})},paint:function(z){return ko({layer:h,key:z.key,value:z.value,style:z.style,styleSpec:z.styleSpec,objectElementValidators:{"*":function(O){return Ma(nt({layerType:e},O))}}})}}}))}function zo(t){var n=t.value,h=t.key,_=bi(n);return _!=="string"?[new zt(h,n,"string expected, "+_+" found")]:[]}var Pi={promoteId:function(t){var n=t.key,h=t.value;if(bi(h)==="string")return zo({key:n,value:h});var _=[];for(var w in h)_.push.apply(_,zo({key:n+"."+w,value:h[w]}));return _}};function Zs(t){var n=t.value,h=t.key,_=t.styleSpec,w=t.style;if(!n.type)return[new zt(h,n,'"type" is required')];var C,r=X(n.type);switch(r){case"vector":case"raster":case"raster-dem":return ko({key:h,value:n,valueSpec:_["source_"+r.replace("-","_")],style:t.style,styleSpec:_,objectElementValidators:Pi});case"geojson":if(C=ko({key:h,value:n,valueSpec:_.source_geojson,style:w,styleSpec:_,objectElementValidators:Pi}),n.cluster)for(var e in n.clusterProperties){var s=n.clusterProperties[e],f=s[0],y=typeof f=="string"?[f,["accumulated"],["get",e]]:f;C.push.apply(C,$o({key:h+"."+e+".map",value:s[1],expressionContext:"cluster-map"})),C.push.apply(C,$o({key:h+"."+e+".reduce",value:y,expressionContext:"cluster-reduce"}))}return C;case"video":return ko({key:h,value:n,valueSpec:_.source_video,style:w,styleSpec:_});case"image":return ko({key:h,value:n,valueSpec:_.source_image,style:w,styleSpec:_});case"canvas":return[new zt(h,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Vs({key:h+".type",value:n.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:w,styleSpec:_})}}function Ts(t){var n=t.value,h=t.styleSpec,_=h.light,w=t.style,C=[],r=bi(n);if(n===void 0)return C;if(r!=="object")return C.concat([new zt("light",n,"object expected, "+r+" found")]);for(var e in n){var s=e.match(/^(.*)-transition$/);C=C.concat(s&&_[s[1]]&&_[s[1]].transition?Gr({key:e,value:n[e],valueSpec:h.transition,style:w,styleSpec:h}):_[e]?Gr({key:e,value:n[e],valueSpec:_[e],style:w,styleSpec:h}):[new zt(e,n[e],'unknown property "'+e+'"')])}return C}var La={"*":function(){return[]},array:xl,boolean:function(t){var n=t.value,h=t.key,_=bi(n);return _!=="boolean"?[new zt(h,n,"boolean expected, "+_+" found")]:[]},number:bl,color:function(t){var n=t.key,h=t.value,_=bi(h);return _!=="string"?[new zt(n,h,"color expected, "+_+" found")]:Xe(h)===null?[new zt(n,h,'color expected, "'+h+'" found')]:[]},constants:Qt,enum:Vs,filter:Yn,function:Es,layer:Ss,object:ko,source:Zs,light:Ts,string:zo,formatted:function(t){return zo(t).length===0?[]:$o(t)},resolvedImage:function(t){return zo(t).length===0?[]:$o(t)}};function Gr(t){var n=t.value,h=t.valueSpec,_=t.styleSpec;return h.expression&&Ta(X(n))?Es(t):h.expression&&ws(Z(n))?$o(t):h.type&&La[h.type]?La[h.type](t):ko(nt({},t,{valueSpec:h.type?_[h.type]:h}))}function pi(t){var n=t.value,h=t.key,_=zo(t);return _.length||(n.indexOf("{fontstack}")===-1&&_.push(new zt(h,n,'"glyphs" url must include a "{fontstack}" token')),n.indexOf("{range}")===-1&&_.push(new zt(h,n,'"glyphs" url must include a "{range}" token'))),_}function We(t,n){n===void 0&&(n=dt);var h=[];return h=h.concat(Gr({key:"",value:t,valueSpec:n.$root,styleSpec:n,style:t,objectElementValidators:{glyphs:pi,"*":function(){return[]}}})),t.constants&&(h=h.concat(Qt({key:"constants",value:t.constants,style:t,styleSpec:n}))),Is(h)}function Is(t){return[].concat(t).sort(function(n,h){return n.line-h.line})}function fa(t){return function(){for(var n=[],h=arguments.length;h--;)n[h]=arguments[h];return Is(t.apply(this,n))}}We.source=fa(Zs),We.light=fa(Ts),We.layer=fa(Ss),We.filter=fa(Yn),We.paintProperty=fa(Ma),We.layoutProperty=fa(qs);var Ko=We,El=Ko.light,Je=Ko.paintProperty,Cs=Ko.layoutProperty;function Xs(t,n){var h=!1;if(n&&n.length)for(var _=0,w=n;_<w.length;_+=1)t.fire(new Bt(new Error(w[_].message))),h=!0;return h}var ka=Oi;function Oi(t,n,h){var _=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var w=new Int32Array(this.arrayBuffer);t=w[0],this.d=(n=w[1])+2*(h=w[2]);for(var C=0;C<this.d*this.d;C++){var r=w[3+C],e=w[3+C+1];_.push(r===e?null:w.subarray(r,e))}var s=w[3+_.length+1];this.keys=w.subarray(w[3+_.length],s),this.bboxes=w.subarray(s),this.insert=this._insertReadonly}else{this.d=n+2*h;for(var f=0;f<this.d*this.d;f++)_.push([]);this.keys=[],this.bboxes=[]}this.n=n,this.extent=t,this.padding=h,this.scale=n/t,this.uid=0;var y=h/n*t;this.min=-y,this.max=t+y}Oi.prototype.insert=function(t,n,h,_,w){this._forEachCell(n,h,_,w,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(n),this.bboxes.push(h),this.bboxes.push(_),this.bboxes.push(w)},Oi.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Oi.prototype._insertCell=function(t,n,h,_,w,C){this.cells[w].push(C)},Oi.prototype.query=function(t,n,h,_,w){var C=this.min,r=this.max;if(t<=C&&n<=C&&r<=h&&r<=_&&!w)return Array.prototype.slice.call(this.keys);var e=[];return this._forEachCell(t,n,h,_,this._queryCell,e,{},w),e},Oi.prototype._queryCell=function(t,n,h,_,w,C,r,e){var s=this.cells[w];if(s!==null)for(var f=this.keys,y=this.bboxes,b=0;b<s.length;b++){var E=s[b];if(r[E]===void 0){var M=4*E;(e?e(y[M+0],y[M+1],y[M+2],y[M+3]):t<=y[M+2]&&n<=y[M+3]&&h>=y[M+0]&&_>=y[M+1])?(r[E]=!0,C.push(f[E])):r[E]=!1}}},Oi.prototype._forEachCell=function(t,n,h,_,w,C,r,e){for(var s=this._convertToCellCoord(t),f=this._convertToCellCoord(n),y=this._convertToCellCoord(h),b=this._convertToCellCoord(_),E=s;E<=y;E++)for(var M=f;M<=b;M++){var z=this.d*M+E;if((!e||e(this._convertFromCellCoord(E),this._convertFromCellCoord(M),this._convertFromCellCoord(E+1),this._convertFromCellCoord(M+1)))&&w.call(this,t,n,h,_,z,C,r,e))return}},Oi.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Oi.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Oi.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,n=3+this.cells.length+1+1,h=0,_=0;_<this.cells.length;_++)h+=this.cells[_].length;var w=new Int32Array(n+h+this.keys.length+this.bboxes.length);w[0]=this.extent,w[1]=this.n,w[2]=this.padding;for(var C=n,r=0;r<t.length;r++){var e=t[r];w[3+r]=C,w.set(e,C),C+=e.length}return w[3+t.length]=C,w.set(this.keys,C),w[3+t.length+1]=C+=this.keys.length,w.set(this.bboxes,C),C+=this.bboxes.length,w.buffer};var Ws=N.ImageData,Xu=N.ImageBitmap,nn={};function tr(t,n,h){h===void 0&&(h={}),Object.defineProperty(n,"_classRegistryKey",{value:t,writeable:!1}),nn[t]={klass:n,omit:h.omit||[],shallow:h.shallow||[]}}for(var Vn in tr("Object",Object),ka.serialize=function(t,n){var h=t.toArrayBuffer();return n&&n.push(h),{buffer:h}},ka.deserialize=function(t){return new ka(t.buffer)},tr("Grid",ka),tr("Color",Sr),tr("Error",Error),tr("ResolvedImage",Nn),tr("StylePropertyFunction",pa),tr("StyleExpression",Ca,{omit:["_evaluator"]}),tr("ZoomDependentExpression",Aa),tr("ZoomConstantExpression",Ja),tr("CompoundExpression",Hi,{omit:["_evaluate"]}),xi)xi[Vn]._classRegistryKey||tr("Expression_"+Vn,xi[Vn]);function $s(t){return t&&typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}function ts(t){return Xu&&t instanceof Xu}function Ro(t,n){if(t==null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if($s(t)||ts(t))return n&&n.push(t),t;if(ArrayBuffer.isView(t)){var h=t;return n&&n.push(h.buffer),h}if(t instanceof Ws)return n&&n.push(t.data.buffer),t;if(Array.isArray(t)){for(var _=[],w=0,C=t;w<C.length;w+=1)_.push(Ro(C[w],n));return _}if(typeof t=="object"){var r=t.constructor,e=r._classRegistryKey;if(!e)throw new Error("can't serialize object of unregistered class");var s=r.serialize?r.serialize(t,n):{};if(!r.serialize){for(var f in t)if(t.hasOwnProperty(f)&&!(nn[e].omit.indexOf(f)>=0)){var y=t[f];s[f]=nn[e].shallow.indexOf(f)>=0?y:Ro(y,n)}t instanceof Error&&(s.message=t.message)}if(s.$name)throw new Error("$name property is reserved for worker serialization logic.");return e!=="Object"&&(s.$name=e),s}throw new Error("can't serialize object of type "+typeof t)}function Mi(t){if(t==null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||$s(t)||ts(t)||ArrayBuffer.isView(t)||t instanceof Ws)return t;if(Array.isArray(t))return t.map(Mi);if(typeof t=="object"){var n=t.$name||"Object",h=nn[n].klass;if(!h)throw new Error("can't deserialize unregistered class "+n);if(h.deserialize)return h.deserialize(t);for(var _=Object.create(h.prototype),w=0,C=Object.keys(t);w<C.length;w+=1){var r=C[w];if(r!=="$name"){var e=t[r];_[r]=nn[n].shallow.indexOf(r)>=0?e:Mi(e)}}return _}throw new Error("can't deserialize object of type "+typeof t)}var da=function(){this.first=!0};da.prototype.update=function(t,n){var h=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=h,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=h,!0):(this.lastFloorZoom>h?(this.lastIntegerZoom=h+1,this.lastIntegerZoomTime=n):this.lastFloorZoom<h&&(this.lastIntegerZoom=h,this.lastIntegerZoomTime=n),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=h,!0))};var Ne={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function Sl(t){for(var n=0,h=t;n<h.length;n+=1)if(za(h[n].charCodeAt(0)))return!0;return!1}function za(t){return!(t!==746&&t!==747&&(t<4352||!(Ne["Bopomofo Extended"](t)||Ne.Bopomofo(t)||Ne["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Ne["CJK Compatibility Ideographs"](t)||Ne["CJK Compatibility"](t)||Ne["CJK Radicals Supplement"](t)||Ne["CJK Strokes"](t)||!(!Ne["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||t===12336)||Ne["CJK Unified Ideographs Extension A"](t)||Ne["CJK Unified Ideographs"](t)||Ne["Enclosed CJK Letters and Months"](t)||Ne["Hangul Compatibility Jamo"](t)||Ne["Hangul Jamo Extended-A"](t)||Ne["Hangul Jamo Extended-B"](t)||Ne["Hangul Jamo"](t)||Ne["Hangul Syllables"](t)||Ne.Hiragana(t)||Ne["Ideographic Description Characters"](t)||Ne.Kanbun(t)||Ne["Kangxi Radicals"](t)||Ne["Katakana Phonetic Extensions"](t)||Ne.Katakana(t)&&t!==12540||!(!Ne["Halfwidth and Fullwidth Forms"](t)||t===65288||t===65289||t===65293||t>=65306&&t<=65310||t===65339||t===65341||t===65343||t>=65371&&t<=65503||t===65507||t>=65512&&t<=65519)||!(!Ne["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Ne["Unified Canadian Aboriginal Syllabics"](t)||Ne["Unified Canadian Aboriginal Syllabics Extended"](t)||Ne["Vertical Forms"](t)||Ne["Yijing Hexagram Symbols"](t)||Ne["Yi Syllables"](t)||Ne["Yi Radicals"](t))))}function Tl(t){return!(za(t)||function(n){return!!(Ne["Latin-1 Supplement"](n)&&(n===167||n===169||n===174||n===177||n===188||n===189||n===190||n===215||n===247)||Ne["General Punctuation"](n)&&(n===8214||n===8224||n===8225||n===8240||n===8241||n===8251||n===8252||n===8258||n===8263||n===8264||n===8265||n===8273)||Ne["Letterlike Symbols"](n)||Ne["Number Forms"](n)||Ne["Miscellaneous Technical"](n)&&(n>=8960&&n<=8967||n>=8972&&n<=8991||n>=8996&&n<=9e3||n===9003||n>=9085&&n<=9114||n>=9150&&n<=9165||n===9167||n>=9169&&n<=9179||n>=9186&&n<=9215)||Ne["Control Pictures"](n)&&n!==9251||Ne["Optical Character Recognition"](n)||Ne["Enclosed Alphanumerics"](n)||Ne["Geometric Shapes"](n)||Ne["Miscellaneous Symbols"](n)&&!(n>=9754&&n<=9759)||Ne["Miscellaneous Symbols and Arrows"](n)&&(n>=11026&&n<=11055||n>=11088&&n<=11097||n>=11192&&n<=11243)||Ne["CJK Symbols and Punctuation"](n)||Ne.Katakana(n)||Ne["Private Use Area"](n)||Ne["CJK Compatibility Forms"](n)||Ne["Small Form Variants"](n)||Ne["Halfwidth and Fullwidth Forms"](n)||n===8734||n===8756||n===8757||n>=9984&&n<=10087||n>=10102&&n<=10131||n===65532||n===65533)}(t))}function ao(t){return t>=1424&&t<=2303||Ne["Arabic Presentation Forms-A"](t)||Ne["Arabic Presentation Forms-B"](t)}function Fi(t,n){return!(!n&&ao(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Ne.Khmer(t))}function Ii(t){for(var n=0,h=t;n<h.length;n+=1)if(ao(h[n].charCodeAt(0)))return!0;return!1}var As=null,Gn="unavailable",Yo=null,Wu=function(t){t&&typeof t=="string"&&t.indexOf("NetworkError")>-1&&(Gn="error"),As&&As(t)};function Ks(){$u.fire(new It("pluginStateChange",{pluginStatus:Gn,pluginURL:Yo}))}var $u=new Gt,No=function(){return Gn},mo=function(){if(Gn!=="deferred"||!Yo)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Gn="loading",Ks(),Yo&&Rn({url:Yo},function(t){t?Wu(t):(Gn="loaded",Ks())})},er={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Gn==="loaded"||er.applyArabicShaping!=null},isLoading:function(){return Gn==="loading"},setState:function(t){Gn=t.pluginStatus,Yo=t.pluginURL},isParsed:function(){return er.applyArabicShaping!=null&&er.processBidirectionalText!=null&&er.processStyledBidirectionalText!=null},getPluginURL:function(){return Yo}},Oe=function(t,n){this.zoom=t,n?(this.now=n.now,this.fadeDuration=n.fadeDuration,this.zoomHistory=n.zoomHistory,this.transition=n.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new da,this.transition={})};Oe.prototype.isSupportedScript=function(t){return function(n,h){for(var _=0,w=n;_<w.length;_+=1)if(!Fi(w[_].charCodeAt(0),h))return!1;return!0}(t,er.isLoaded())},Oe.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Oe.prototype.getCrossfadeParameters=function(){var t=this.zoom,n=t-Math.floor(t),h=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:n+(1-n)*h}:{fromScale:.5,toScale:1,t:1-(1-h)*n}};var go=function(t,n){this.property=t,this.value=n,this.expression=function(h,_){if(Ta(h))return new pa(h,_);if(ws(h)){var w=qu(h,_);if(w.result==="error")throw new Error(w.value.map(function(r){return r.key+": "+r.message}).join(", "));return w.value}var C=h;return typeof h=="string"&&_.type==="color"&&(C=Sr.parse(h)),{kind:"constant",evaluate:function(){return C}}}(n===void 0?t.specification.default:n,t.specification)};go.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},go.prototype.possiblyEvaluate=function(t,n,h){return this.property.possiblyEvaluate(this,t,n,h)};var Hn=function(t){this.property=t,this.value=new go(t,void 0)};Hn.prototype.transitioned=function(t,n){return new Bi(this.property,this.value,n,wt({},t.transition,this.transition),t.now)},Hn.prototype.untransitioned=function(){return new Bi(this.property,this.value,null,{},0)};var gn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};gn.prototype.getValue=function(t){return Me(this._values[t].value.value)},gn.prototype.setValue=function(t,n){this._values.hasOwnProperty(t)||(this._values[t]=new Hn(this._values[t].property)),this._values[t].value=new go(this._values[t].property,n===null?void 0:Me(n))},gn.prototype.getTransition=function(t){return Me(this._values[t].transition)},gn.prototype.setTransition=function(t,n){this._values.hasOwnProperty(t)||(this._values[t]=new Hn(this._values[t].property)),this._values[t].transition=Me(n)||void 0},gn.prototype.serialize=function(){for(var t={},n=0,h=Object.keys(this._values);n<h.length;n+=1){var _=h[n],w=this.getValue(_);w!==void 0&&(t[_]=w);var C=this.getTransition(_);C!==void 0&&(t[_+"-transition"]=C)}return t},gn.prototype.transitioned=function(t,n){for(var h=new yo(this._properties),_=0,w=Object.keys(this._values);_<w.length;_+=1){var C=w[_];h._values[C]=this._values[C].transitioned(t,n._values[C])}return h},gn.prototype.untransitioned=function(){for(var t=new yo(this._properties),n=0,h=Object.keys(this._values);n<h.length;n+=1){var _=h[n];t._values[_]=this._values[_].untransitioned()}return t};var Bi=function(t,n,h,_,w){this.property=t,this.value=n,this.begin=w+_.delay||0,this.end=this.begin+_.duration||0,t.specification.transition&&(_.delay||_.duration)&&(this.prior=h)};Bi.prototype.possiblyEvaluate=function(t,n,h){var _=t.now||0,w=this.value.possiblyEvaluate(t,n,h),C=this.prior;if(C){if(_>this.end)return this.prior=null,w;if(this.value.isDataDriven())return this.prior=null,w;if(_<this.begin)return C.possiblyEvaluate(t,n,h);var r=(_-this.begin)/(this.end-this.begin);return this.property.interpolate(C.possiblyEvaluate(t,n,h),w,function(e){if(e<=0)return 0;if(e>=1)return 1;var s=e*e,f=s*e;return 4*(e<.5?f:3*(e-s)+f-.75)}(r))}return w};var yo=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};yo.prototype.possiblyEvaluate=function(t,n,h){for(var _=new Ra(this._properties),w=0,C=Object.keys(this._values);w<C.length;w+=1){var r=C[w];_._values[r]=this._values[r].possiblyEvaluate(t,n,h)}return _},yo.prototype.hasTransition=function(){for(var t=0,n=Object.keys(this._values);t<n.length;t+=1)if(this._values[n[t]].prior)return!0;return!1};var Zi=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};Zi.prototype.getValue=function(t){return Me(this._values[t].value)},Zi.prototype.setValue=function(t,n){this._values[t]=new go(this._values[t].property,n===null?void 0:Me(n))},Zi.prototype.serialize=function(){for(var t={},n=0,h=Object.keys(this._values);n<h.length;n+=1){var _=h[n],w=this.getValue(_);w!==void 0&&(t[_]=w)}return t},Zi.prototype.possiblyEvaluate=function(t,n,h){for(var _=new Ra(this._properties),w=0,C=Object.keys(this._values);w<C.length;w+=1){var r=C[w];_._values[r]=this._values[r].possiblyEvaluate(t,n,h)}return _};var Jn=function(t,n,h){this.property=t,this.value=n,this.parameters=h};Jn.prototype.isConstant=function(){return this.value.kind==="constant"},Jn.prototype.constantOr=function(t){return this.value.kind==="constant"?this.value.value:t},Jn.prototype.evaluate=function(t,n,h,_){return this.property.evaluate(this.value,this.parameters,t,n,h,_)};var Ra=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};Ra.prototype.get=function(t){return this._values[t]};var je=function(t){this.specification=t};je.prototype.possiblyEvaluate=function(t,n){return t.expression.evaluate(n)},je.prototype.interpolate=function(t,n,h){var _=On[this.specification.type];return _?_(t,n,h):t};var Ve=function(t,n){this.specification=t,this.overrides=n};Ve.prototype.possiblyEvaluate=function(t,n,h,_){return new Jn(this,t.expression.kind==="constant"||t.expression.kind==="camera"?{kind:"constant",value:t.expression.evaluate(n,null,{},h,_)}:t.expression,n)},Ve.prototype.interpolate=function(t,n,h){if(t.value.kind!=="constant"||n.value.kind!=="constant")return t;if(t.value.value===void 0||n.value.value===void 0)return new Jn(this,{kind:"constant",value:void 0},t.parameters);var _=On[this.specification.type];return _?new Jn(this,{kind:"constant",value:_(t.value.value,n.value.value,h)},t.parameters):t},Ve.prototype.evaluate=function(t,n,h,_,w,C){return t.kind==="constant"?t.value:t.evaluate(n,h,_,w,C)};var Il=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.possiblyEvaluate=function(h,_,w,C){if(h.value===void 0)return new Jn(this,{kind:"constant",value:void 0},_);if(h.expression.kind==="constant"){var r=h.expression.evaluate(_,null,{},w,C),e=h.property.specification.type==="resolvedImage"&&typeof r!="string"?r.name:r,s=this._calculate(e,e,e,_);return new Jn(this,{kind:"constant",value:s},_)}if(h.expression.kind==="camera"){var f=this._calculate(h.expression.evaluate({zoom:_.zoom-1}),h.expression.evaluate({zoom:_.zoom}),h.expression.evaluate({zoom:_.zoom+1}),_);return new Jn(this,{kind:"constant",value:f},_)}return new Jn(this,h.expression,_)},n.prototype.evaluate=function(h,_,w,C,r,e){if(h.kind==="source"){var s=h.evaluate(_,w,C,r,e);return this._calculate(s,s,s,_)}return h.kind==="composite"?this._calculate(h.evaluate({zoom:Math.floor(_.zoom)-1},w,C),h.evaluate({zoom:Math.floor(_.zoom)},w,C),h.evaluate({zoom:Math.floor(_.zoom)+1},w,C),_):h.value},n.prototype._calculate=function(h,_,w,C){return C.zoom>C.zoomHistory.lastIntegerZoom?{from:h,to:_}:{from:w,to:_}},n.prototype.interpolate=function(h){return h},n}(Ve),cn=function(t){this.specification=t};cn.prototype.possiblyEvaluate=function(t,n,h,_){if(t.value!==void 0){if(t.expression.kind==="constant"){var w=t.expression.evaluate(n,null,{},h,_);return this._calculate(w,w,w,n)}return this._calculate(t.expression.evaluate(new Oe(Math.floor(n.zoom-1),n)),t.expression.evaluate(new Oe(Math.floor(n.zoom),n)),t.expression.evaluate(new Oe(Math.floor(n.zoom+1),n)),n)}},cn.prototype._calculate=function(t,n,h,_){return _.zoom>_.zoomHistory.lastIntegerZoom?{from:t,to:n}:{from:h,to:n}},cn.prototype.interpolate=function(t){return t};var so=function(t){this.specification=t};so.prototype.possiblyEvaluate=function(t,n,h,_){return!!t.expression.evaluate(n,null,{},h,_)},so.prototype.interpolate=function(){return!1};var T=function(t){for(var n in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var h=t[n];h.specification.overridable&&this.overridableProperties.push(n);var _=this.defaultPropertyValues[n]=new go(h,void 0),w=this.defaultTransitionablePropertyValues[n]=new Hn(h);this.defaultTransitioningPropertyValues[n]=w.untransitioned(),this.defaultPossiblyEvaluatedValues[n]=_.possiblyEvaluate({})}};tr("DataDrivenProperty",Ve),tr("DataConstantProperty",je),tr("CrossFadedDataDrivenProperty",Il),tr("CrossFadedProperty",cn),tr("ColorRampProperty",so);var a=function(t){function n(h,_){if(t.call(this),this.id=h.id,this.type=h.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},h.type!=="custom"&&(this.metadata=(h=h).metadata,this.minzoom=h.minzoom,this.maxzoom=h.maxzoom,h.type!=="background"&&(this.source=h.source,this.sourceLayer=h["source-layer"],this.filter=h.filter),_.layout&&(this._unevaluatedLayout=new Zi(_.layout)),_.paint)){for(var w in this._transitionablePaint=new gn(_.paint),h.paint)this.setPaintProperty(w,h.paint[w],{validate:!1});for(var C in h.layout)this.setLayoutProperty(C,h.layout[C],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ra(_.paint)}}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},n.prototype.getLayoutProperty=function(h){return h==="visibility"?this.visibility:this._unevaluatedLayout.getValue(h)},n.prototype.setLayoutProperty=function(h,_,w){w===void 0&&(w={}),_!=null&&this._validate(Cs,"layers."+this.id+".layout."+h,h,_,w)||(h!=="visibility"?this._unevaluatedLayout.setValue(h,_):this.visibility=_)},n.prototype.getPaintProperty=function(h){return oe(h,"-transition")?this._transitionablePaint.getTransition(h.slice(0,-11)):this._transitionablePaint.getValue(h)},n.prototype.setPaintProperty=function(h,_,w){if(w===void 0&&(w={}),_!=null&&this._validate(Je,"layers."+this.id+".paint."+h,h,_,w))return!1;if(oe(h,"-transition"))return this._transitionablePaint.setTransition(h.slice(0,-11),_||void 0),!1;var C=this._transitionablePaint._values[h],r=C.property.specification["property-type"]==="cross-faded-data-driven",e=C.value.isDataDriven(),s=C.value;this._transitionablePaint.setValue(h,_),this._handleSpecialPaintPropertyUpdate(h);var f=this._transitionablePaint._values[h].value;return f.isDataDriven()||e||r||this._handleOverridablePaintPropertyUpdate(h,s,f)},n.prototype._handleSpecialPaintPropertyUpdate=function(h){},n.prototype._handleOverridablePaintPropertyUpdate=function(h,_,w){return!1},n.prototype.isHidden=function(h){return!!(this.minzoom&&h<this.minzoom)||!!(this.maxzoom&&h>=this.maxzoom)||this.visibility==="none"},n.prototype.updateTransitions=function(h){this._transitioningPaint=this._transitionablePaint.transitioned(h,this._transitioningPaint)},n.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},n.prototype.recalculate=function(h,_){h.getCrossfadeParameters&&(this._crossfadeParameters=h.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(h,void 0,_)),this.paint=this._transitioningPaint.possiblyEvaluate(h,void 0,_)},n.prototype.serialize=function(){var h={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(h.layout=h.layout||{},h.layout.visibility=this.visibility),be(h,function(_,w){return!(_===void 0||w==="layout"&&!Object.keys(_).length||w==="paint"&&!Object.keys(_).length)})},n.prototype._validate=function(h,_,w,C,r){return r===void 0&&(r={}),(!r||r.validate!==!1)&&Xs(this,h.call(Ko,{key:_,layerType:this.type,objectKey:w,value:C,styleSpec:dt,style:{glyphs:!0,sprite:!0}}))},n.prototype.is3D=function(){return!1},n.prototype.isTileClipped=function(){return!1},n.prototype.hasOffscreenPass=function(){return!1},n.prototype.resize=function(){},n.prototype.isStateDependent=function(){for(var h in this.paint._values){var _=this.paint.get(h);if(_ instanceof Jn&&ha(_.property.specification)&&(_.value.kind==="source"||_.value.kind==="composite")&&_.value.isStateDependent)return!0}return!1},n}(Gt),g={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},S=function(t,n){this._structArray=t,this._pos1=n*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},I=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function L(t,n){n===void 0&&(n=1);var h=0,_=0;return{members:t.map(function(w){var C=g[w.type].BYTES_PER_ELEMENT,r=h=B(h,Math.max(n,C)),e=w.components||1;return _=Math.max(_,C),h+=C*e,{name:w.name,type:w.type,components:e,offset:r}}),size:B(h,Math.max(_,n)),alignment:n}}function B(t,n){return Math.ceil(t/n)*n}I.serialize=function(t,n){return t._trim(),n&&(t.isTransferred=!0,n.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},I.deserialize=function(t){var n=Object.create(this.prototype);return n.arrayBuffer=t.arrayBuffer,n.length=t.length,n.capacity=t.arrayBuffer.byteLength/n.bytesPerElement,n._refreshViews(),n},I.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},I.prototype.clear=function(){this.length=0},I.prototype.resize=function(t){this.reserve(t),this.length=t},I.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var n=this.uint8;this._refreshViews(),n&&this.uint8.set(n)}},I.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var q=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_){var w=this.length;return this.resize(w+1),this.emplace(w,h,_)},n.prototype.emplace=function(h,_,w){var C=2*h;return this.int16[C+0]=_,this.int16[C+1]=w,h},n}(I);q.prototype.bytesPerElement=4,tr("StructArrayLayout2i4",q);var $=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C){var r=this.length;return this.resize(r+1),this.emplace(r,h,_,w,C)},n.prototype.emplace=function(h,_,w,C,r){var e=4*h;return this.int16[e+0]=_,this.int16[e+1]=w,this.int16[e+2]=C,this.int16[e+3]=r,h},n}(I);$.prototype.bytesPerElement=8,tr("StructArrayLayout4i8",$);var J=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C,r,e){var s=this.length;return this.resize(s+1),this.emplace(s,h,_,w,C,r,e)},n.prototype.emplace=function(h,_,w,C,r,e,s){var f=6*h;return this.int16[f+0]=_,this.int16[f+1]=w,this.int16[f+2]=C,this.int16[f+3]=r,this.int16[f+4]=e,this.int16[f+5]=s,h},n}(I);J.prototype.bytesPerElement=12,tr("StructArrayLayout2i4i12",J);var et=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C,r,e){var s=this.length;return this.resize(s+1),this.emplace(s,h,_,w,C,r,e)},n.prototype.emplace=function(h,_,w,C,r,e,s){var f=4*h,y=8*h;return this.int16[f+0]=_,this.int16[f+1]=w,this.uint8[y+4]=C,this.uint8[y+5]=r,this.uint8[y+6]=e,this.uint8[y+7]=s,h},n}(I);et.prototype.bytesPerElement=8,tr("StructArrayLayout2i4ub8",et);var ut=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_){var w=this.length;return this.resize(w+1),this.emplace(w,h,_)},n.prototype.emplace=function(h,_,w){var C=2*h;return this.float32[C+0]=_,this.float32[C+1]=w,h},n}(I);ut.prototype.bytesPerElement=8,tr("StructArrayLayout2f8",ut);var vt=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C,r,e,s,f,y,b){var E=this.length;return this.resize(E+1),this.emplace(E,h,_,w,C,r,e,s,f,y,b)},n.prototype.emplace=function(h,_,w,C,r,e,s,f,y,b,E){var M=10*h;return this.uint16[M+0]=_,this.uint16[M+1]=w,this.uint16[M+2]=C,this.uint16[M+3]=r,this.uint16[M+4]=e,this.uint16[M+5]=s,this.uint16[M+6]=f,this.uint16[M+7]=y,this.uint16[M+8]=b,this.uint16[M+9]=E,h},n}(I);vt.prototype.bytesPerElement=20,tr("StructArrayLayout10ui20",vt);var Ft=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C,r,e,s,f,y,b,E,M){var z=this.length;return this.resize(z+1),this.emplace(z,h,_,w,C,r,e,s,f,y,b,E,M)},n.prototype.emplace=function(h,_,w,C,r,e,s,f,y,b,E,M,z){var O=12*h;return this.int16[O+0]=_,this.int16[O+1]=w,this.int16[O+2]=C,this.int16[O+3]=r,this.uint16[O+4]=e,this.uint16[O+5]=s,this.uint16[O+6]=f,this.uint16[O+7]=y,this.int16[O+8]=b,this.int16[O+9]=E,this.int16[O+10]=M,this.int16[O+11]=z,h},n}(I);Ft.prototype.bytesPerElement=24,tr("StructArrayLayout4i4ui4i24",Ft);var bt=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w){var C=this.length;return this.resize(C+1),this.emplace(C,h,_,w)},n.prototype.emplace=function(h,_,w,C){var r=3*h;return this.float32[r+0]=_,this.float32[r+1]=w,this.float32[r+2]=C,h},n}(I);bt.prototype.bytesPerElement=12,tr("StructArrayLayout3f12",bt);var Ot=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h){var _=this.length;return this.resize(_+1),this.emplace(_,h)},n.prototype.emplace=function(h,_){return this.uint32[1*h+0]=_,h},n}(I);Ot.prototype.bytesPerElement=4,tr("StructArrayLayout1ul4",Ot);var Kt=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C,r,e,s,f,y){var b=this.length;return this.resize(b+1),this.emplace(b,h,_,w,C,r,e,s,f,y)},n.prototype.emplace=function(h,_,w,C,r,e,s,f,y,b){var E=10*h,M=5*h;return this.int16[E+0]=_,this.int16[E+1]=w,this.int16[E+2]=C,this.int16[E+3]=r,this.int16[E+4]=e,this.int16[E+5]=s,this.uint32[M+3]=f,this.uint16[E+8]=y,this.uint16[E+9]=b,h},n}(I);Kt.prototype.bytesPerElement=20,tr("StructArrayLayout6i1ul2ui20",Kt);var Wt=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C,r,e){var s=this.length;return this.resize(s+1),this.emplace(s,h,_,w,C,r,e)},n.prototype.emplace=function(h,_,w,C,r,e,s){var f=6*h;return this.int16[f+0]=_,this.int16[f+1]=w,this.int16[f+2]=C,this.int16[f+3]=r,this.int16[f+4]=e,this.int16[f+5]=s,h},n}(I);Wt.prototype.bytesPerElement=12,tr("StructArrayLayout2i2i2i12",Wt);var ie=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C,r){var e=this.length;return this.resize(e+1),this.emplace(e,h,_,w,C,r)},n.prototype.emplace=function(h,_,w,C,r,e){var s=4*h,f=8*h;return this.float32[s+0]=_,this.float32[s+1]=w,this.float32[s+2]=C,this.int16[f+6]=r,this.int16[f+7]=e,h},n}(I);ie.prototype.bytesPerElement=16,tr("StructArrayLayout2f1f2i16",ie);var Ht=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C){var r=this.length;return this.resize(r+1),this.emplace(r,h,_,w,C)},n.prototype.emplace=function(h,_,w,C,r){var e=12*h,s=3*h;return this.uint8[e+0]=_,this.uint8[e+1]=w,this.float32[s+1]=C,this.float32[s+2]=r,h},n}(I);Ht.prototype.bytesPerElement=12,tr("StructArrayLayout2ub2f12",Ht);var _e=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w){var C=this.length;return this.resize(C+1),this.emplace(C,h,_,w)},n.prototype.emplace=function(h,_,w,C){var r=3*h;return this.uint16[r+0]=_,this.uint16[r+1]=w,this.uint16[r+2]=C,h},n}(I);_e.prototype.bytesPerElement=6,tr("StructArrayLayout3ui6",_e);var he=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C,r,e,s,f,y,b,E,M,z,O,G,V,W){var Y=this.length;return this.resize(Y+1),this.emplace(Y,h,_,w,C,r,e,s,f,y,b,E,M,z,O,G,V,W)},n.prototype.emplace=function(h,_,w,C,r,e,s,f,y,b,E,M,z,O,G,V,W,Y){var H=24*h,ot=12*h,ht=48*h;return this.int16[H+0]=_,this.int16[H+1]=w,this.uint16[H+2]=C,this.uint16[H+3]=r,this.uint32[ot+2]=e,this.uint32[ot+3]=s,this.uint32[ot+4]=f,this.uint16[H+10]=y,this.uint16[H+11]=b,this.uint16[H+12]=E,this.float32[ot+7]=M,this.float32[ot+8]=z,this.uint8[ht+36]=O,this.uint8[ht+37]=G,this.uint8[ht+38]=V,this.uint32[ot+10]=W,this.int16[H+22]=Y,h},n}(I);he.prototype.bytesPerElement=48,tr("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",he);var de=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C,r,e,s,f,y,b,E,M,z,O,G,V,W,Y,H,ot,ht,Pt,Ut,jt,qt,re,Xt,Te){var Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,h,_,w,C,r,e,s,f,y,b,E,M,z,O,G,V,W,Y,H,ot,ht,Pt,Ut,jt,qt,re,Xt,Te)},n.prototype.emplace=function(h,_,w,C,r,e,s,f,y,b,E,M,z,O,G,V,W,Y,H,ot,ht,Pt,Ut,jt,qt,re,Xt,Te,Ee){var ue=34*h,we=17*h;return this.int16[ue+0]=_,this.int16[ue+1]=w,this.int16[ue+2]=C,this.int16[ue+3]=r,this.int16[ue+4]=e,this.int16[ue+5]=s,this.int16[ue+6]=f,this.int16[ue+7]=y,this.uint16[ue+8]=b,this.uint16[ue+9]=E,this.uint16[ue+10]=M,this.uint16[ue+11]=z,this.uint16[ue+12]=O,this.uint16[ue+13]=G,this.uint16[ue+14]=V,this.uint16[ue+15]=W,this.uint16[ue+16]=Y,this.uint16[ue+17]=H,this.uint16[ue+18]=ot,this.uint16[ue+19]=ht,this.uint16[ue+20]=Pt,this.uint16[ue+21]=Ut,this.uint16[ue+22]=jt,this.uint32[we+12]=qt,this.float32[we+13]=re,this.float32[we+14]=Xt,this.float32[we+15]=Te,this.float32[we+16]=Ee,h},n}(I);de.prototype.bytesPerElement=68,tr("StructArrayLayout8i15ui1ul4f68",de);var Pe=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h){var _=this.length;return this.resize(_+1),this.emplace(_,h)},n.prototype.emplace=function(h,_){return this.float32[1*h+0]=_,h},n}(I);Pe.prototype.bytesPerElement=4,tr("StructArrayLayout1f4",Pe);var Re=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w){var C=this.length;return this.resize(C+1),this.emplace(C,h,_,w)},n.prototype.emplace=function(h,_,w,C){var r=3*h;return this.int16[r+0]=_,this.int16[r+1]=w,this.int16[r+2]=C,h},n}(I);Re.prototype.bytesPerElement=6,tr("StructArrayLayout3i6",Re);var ve=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w){var C=this.length;return this.resize(C+1),this.emplace(C,h,_,w)},n.prototype.emplace=function(h,_,w,C){var r=4*h;return this.uint32[2*h+0]=_,this.uint16[r+2]=w,this.uint16[r+3]=C,h},n}(I);ve.prototype.bytesPerElement=8,tr("StructArrayLayout1ul2ui8",ve);var ar=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_){var w=this.length;return this.resize(w+1),this.emplace(w,h,_)},n.prototype.emplace=function(h,_,w){var C=2*h;return this.uint16[C+0]=_,this.uint16[C+1]=w,h},n}(I);ar.prototype.bytesPerElement=4,tr("StructArrayLayout2ui4",ar);var Ye=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h){var _=this.length;return this.resize(_+1),this.emplace(_,h)},n.prototype.emplace=function(h,_){return this.uint16[1*h+0]=_,h},n}(I);Ye.prototype.bytesPerElement=2,tr("StructArrayLayout1ui2",Ye);var Ar=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C){var r=this.length;return this.resize(r+1),this.emplace(r,h,_,w,C)},n.prototype.emplace=function(h,_,w,C,r){var e=4*h;return this.float32[e+0]=_,this.float32[e+1]=w,this.float32[e+2]=C,this.float32[e+3]=r,h},n}(I);Ar.prototype.bytesPerElement=16,tr("StructArrayLayout4f16",Ar);var p=function(t){function n(){t.apply(this,arguments)}t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n;var h={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return h.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},h.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},h.x1.get=function(){return this._structArray.int16[this._pos2+2]},h.y1.get=function(){return this._structArray.int16[this._pos2+3]},h.x2.get=function(){return this._structArray.int16[this._pos2+4]},h.y2.get=function(){return this._structArray.int16[this._pos2+5]},h.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},h.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},h.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},h.anchorPoint.get=function(){return new F(this.anchorPointX,this.anchorPointY)},Object.defineProperties(n.prototype,h),n}(S);p.prototype.size=20;var m=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.get=function(h){return new p(this,h)},n}(Kt);tr("CollisionBoxArray",m);var d=function(t){function n(){t.apply(this,arguments)}t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n;var h={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return h.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},h.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},h.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},h.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},h.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},h.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},h.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},h.segment.get=function(){return this._structArray.uint16[this._pos2+10]},h.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},h.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},h.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},h.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},h.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},h.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},h.placedOrientation.set=function(_){this._structArray.uint8[this._pos1+37]=_},h.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},h.hidden.set=function(_){this._structArray.uint8[this._pos1+38]=_},h.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},h.crossTileID.set=function(_){this._structArray.uint32[this._pos4+10]=_},h.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(n.prototype,h),n}(S);d.prototype.size=48;var x=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.get=function(h){return new d(this,h)},n}(he);tr("PlacedSymbolArray",x);var A=function(t){function n(){t.apply(this,arguments)}t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n;var h={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return h.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},h.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},h.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},h.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},h.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},h.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},h.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},h.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},h.key.get=function(){return this._structArray.uint16[this._pos2+8]},h.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},h.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},h.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},h.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},h.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},h.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},h.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},h.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},h.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},h.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},h.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},h.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},h.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},h.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},h.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},h.crossTileID.set=function(_){this._structArray.uint32[this._pos4+12]=_},h.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},h.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},h.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},h.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(n.prototype,h),n}(S);A.prototype.size=68;var k=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.get=function(h){return new A(this,h)},n}(de);tr("SymbolInstanceArray",k);var R=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.getoffsetX=function(h){return this.float32[1*h+0]},n}(Pe);tr("GlyphOffsetArray",R);var j=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.getx=function(h){return this.int16[3*h+0]},n.prototype.gety=function(h){return this.int16[3*h+1]},n.prototype.gettileUnitDistanceFromAnchor=function(h){return this.int16[3*h+2]},n}(Re);tr("SymbolLineVertexArray",j);var K=function(t){function n(){t.apply(this,arguments)}t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n;var h={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return h.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},h.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},h.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(n.prototype,h),n}(S);K.prototype.size=8;var tt=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.get=function(h){return new K(this,h)},n}(ve);tr("FeatureIndexArray",tt);var ct=L([{name:"a_pos",components:2,type:"Int16"}],4).members,ft=function(t){t===void 0&&(t=[]),this.segments=t};function mt(t,n){return 256*(t=kt(Math.floor(t),0,255))+kt(Math.floor(n),0,255)}ft.prototype.prepareSegment=function(t,n,h,_){var w=this.segments[this.segments.length-1];return t>ft.MAX_VERTEX_ARRAY_LENGTH&&Be("Max vertices per segment is "+ft.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!w||w.vertexLength+t>ft.MAX_VERTEX_ARRAY_LENGTH||w.sortKey!==_)&&(w={vertexOffset:n.length,primitiveOffset:h.length,vertexLength:0,primitiveLength:0},_!==void 0&&(w.sortKey=_),this.segments.push(w)),w},ft.prototype.get=function(){return this.segments},ft.prototype.destroy=function(){for(var t=0,n=this.segments;t<n.length;t+=1){var h=n[t];for(var _ in h.vaos)h.vaos[_].destroy()}},ft.simpleSegment=function(t,n,h,_){return new ft([{vertexOffset:t,primitiveOffset:n,vertexLength:h,primitiveLength:_,vaos:{},sortKey:0}])},ft.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,tr("SegmentVector",ft);var Mt=L([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),At=u(function(t){t.exports=function(n,h){var _,w,C,r,e,s,f,y;for(w=n.length-(_=3&n.length),C=h,e=3432918353,s=461845907,y=0;y<w;)f=255&n.charCodeAt(y)|(255&n.charCodeAt(++y))<<8|(255&n.charCodeAt(++y))<<16|(255&n.charCodeAt(++y))<<24,++y,C=27492+(65535&(r=5*(65535&(C=(C^=f=(65535&(f=(f=(65535&f)*e+(((f>>>16)*e&65535)<<16)&4294967295)<<15|f>>>17))*s+(((f>>>16)*s&65535)<<16)&4294967295)<<13|C>>>19))+((5*(C>>>16)&65535)<<16)&4294967295))+((58964+(r>>>16)&65535)<<16);switch(f=0,_){case 3:f^=(255&n.charCodeAt(y+2))<<16;case 2:f^=(255&n.charCodeAt(y+1))<<8;case 1:C^=f=(65535&(f=(f=(65535&(f^=255&n.charCodeAt(y)))*e+(((f>>>16)*e&65535)<<16)&4294967295)<<15|f>>>17))*s+(((f>>>16)*s&65535)<<16)&4294967295}return C^=n.length,C=2246822507*(65535&(C^=C>>>16))+((2246822507*(C>>>16)&65535)<<16)&4294967295,C=3266489909*(65535&(C^=C>>>13))+((3266489909*(C>>>16)&65535)<<16)&4294967295,(C^=C>>>16)>>>0}}),Dt=u(function(t){t.exports=function(n,h){for(var _,w=n.length,C=h^w,r=0;w>=4;)_=1540483477*(65535&(_=255&n.charCodeAt(r)|(255&n.charCodeAt(++r))<<8|(255&n.charCodeAt(++r))<<16|(255&n.charCodeAt(++r))<<24))+((1540483477*(_>>>16)&65535)<<16),C=1540483477*(65535&C)+((1540483477*(C>>>16)&65535)<<16)^(_=1540483477*(65535&(_^=_>>>24))+((1540483477*(_>>>16)&65535)<<16)),w-=4,++r;switch(w){case 3:C^=(255&n.charCodeAt(r+2))<<16;case 2:C^=(255&n.charCodeAt(r+1))<<8;case 1:C=1540483477*(65535&(C^=255&n.charCodeAt(r)))+((1540483477*(C>>>16)&65535)<<16)}return C=1540483477*(65535&(C^=C>>>13))+((1540483477*(C>>>16)&65535)<<16),(C^=C>>>15)>>>0}}),xt=At,Rt=Dt;xt.murmur3=At,xt.murmur2=Rt;var Nt=function(){this.ids=[],this.positions=[],this.indexed=!1};Nt.prototype.add=function(t,n,h,_){this.ids.push(ne(t)),this.positions.push(n,h,_)},Nt.prototype.getPositions=function(t){for(var n=ne(t),h=0,_=this.ids.length-1;h<_;){var w=h+_>>1;this.ids[w]>=n?_=w:h=w+1}for(var C=[];this.ids[h]===n;)C.push({index:this.positions[3*h],start:this.positions[3*h+1],end:this.positions[3*h+2]}),h++;return C},Nt.serialize=function(t,n){var h=new Float64Array(t.ids),_=new Uint32Array(t.positions);return function w(C,r,e,s){for(;e<s;){for(var f=C[e+s>>1],y=e-1,b=s+1;;){do y++;while(C[y]<f);do b--;while(C[b]>f);if(y>=b)break;ae(C,y,b),ae(r,3*y,3*b),ae(r,3*y+1,3*b+1),ae(r,3*y+2,3*b+2)}b-e<s-b?(w(C,r,e,b),e=b+1):(w(C,r,b+1,s),s=b)}}(h,_,0,h.length-1),n&&n.push(h.buffer,_.buffer),{ids:h,positions:_}},Nt.deserialize=function(t){var n=new Nt;return n.ids=t.ids,n.positions=t.positions,n.indexed=!0,n};var Yt=Math.pow(2,53)-1;function ne(t){var n=+t;return!isNaN(n)&&n<=Yt?n:xt(String(t))}function ae(t,n,h){var _=t[n];t[n]=t[h],t[h]=_}tr("FeaturePositionMap",Nt);var le=function(t,n){this.gl=t.gl,this.location=n},xe=function(t){function n(h,_){t.call(this,h,_),this.current=0}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.set=function(h){this.current!==h&&(this.current=h,this.gl.uniform1i(this.location,h))},n}(le),ke=function(t){function n(h,_){t.call(this,h,_),this.current=0}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.set=function(h){this.current!==h&&(this.current=h,this.gl.uniform1f(this.location,h))},n}(le),Le=function(t){function n(h,_){t.call(this,h,_),this.current=[0,0]}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.set=function(h){h[0]===this.current[0]&&h[1]===this.current[1]||(this.current=h,this.gl.uniform2f(this.location,h[0],h[1]))},n}(le),$e=function(t){function n(h,_){t.call(this,h,_),this.current=[0,0,0]}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.set=function(h){h[0]===this.current[0]&&h[1]===this.current[1]&&h[2]===this.current[2]||(this.current=h,this.gl.uniform3f(this.location,h[0],h[1],h[2]))},n}(le),lr=function(t){function n(h,_){t.call(this,h,_),this.current=[0,0,0,0]}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.set=function(h){h[0]===this.current[0]&&h[1]===this.current[1]&&h[2]===this.current[2]&&h[3]===this.current[3]||(this.current=h,this.gl.uniform4f(this.location,h[0],h[1],h[2],h[3]))},n}(le),hr=function(t){function n(h,_){t.call(this,h,_),this.current=Sr.transparent}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.set=function(h){h.r===this.current.r&&h.g===this.current.g&&h.b===this.current.b&&h.a===this.current.a||(this.current=h,this.gl.uniform4f(this.location,h.r,h.g,h.b,h.a))},n}(le),sr=new Float32Array(16),Zr=function(t){function n(h,_){t.call(this,h,_),this.current=sr}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.set=function(h){if(h[12]!==this.current[12]||h[0]!==this.current[0])return this.current=h,void this.gl.uniformMatrix4fv(this.location,!1,h);for(var _=1;_<16;_++)if(h[_]!==this.current[_]){this.current=h,this.gl.uniformMatrix4fv(this.location,!1,h);break}},n}(le);function Qe(t){return[mt(255*t.r,255*t.g),mt(255*t.b,255*t.a)]}var Ir=function(t,n,h){this.value=t,this.uniformNames=n.map(function(_){return"u_"+_}),this.type=h};Ir.prototype.setUniform=function(t,n,h){t.set(h.constantOr(this.value))},Ir.prototype.getBinding=function(t,n,h){return this.type==="color"?new hr(t,n):new ke(t,n)};var jr=function(t,n){this.uniformNames=n.map(function(h){return"u_"+h}),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};jr.prototype.setConstantPatternPositions=function(t,n){this.pixelRatioFrom=n.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=n.tlbr,this.patternTo=t.tlbr},jr.prototype.setUniform=function(t,n,h,_){var w=_==="u_pattern_to"?this.patternTo:_==="u_pattern_from"?this.patternFrom:_==="u_pixel_ratio_to"?this.pixelRatioTo:_==="u_pixel_ratio_from"?this.pixelRatioFrom:null;w&&t.set(w)},jr.prototype.getBinding=function(t,n,h){return h.substr(0,9)==="u_pattern"?new lr(t,n):new ke(t,n)};var Er=function(t,n,h,_){this.expression=t,this.type=h,this.maxValue=0,this.paintVertexAttributes=n.map(function(w){return{name:"a_"+w,type:"Float32",components:h==="color"?2:1,offset:0}}),this.paintVertexArray=new _};Er.prototype.populatePaintArray=function(t,n,h,_,w){var C=this.paintVertexArray.length,r=this.expression.evaluate(new Oe(0),n,{},_,[],w);this.paintVertexArray.resize(t),this._setPaintValue(C,t,r)},Er.prototype.updatePaintArray=function(t,n,h,_){var w=this.expression.evaluate({zoom:0},h,_);this._setPaintValue(t,n,w)},Er.prototype._setPaintValue=function(t,n,h){if(this.type==="color")for(var _=Qe(h),w=t;w<n;w++)this.paintVertexArray.emplace(w,_[0],_[1]);else{for(var C=t;C<n;C++)this.paintVertexArray.emplace(C,h);this.maxValue=Math.max(this.maxValue,Math.abs(h))}},Er.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Er.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var vr=function(t,n,h,_,w,C){this.expression=t,this.uniformNames=n.map(function(r){return"u_"+r+"_t"}),this.type=h,this.useIntegerZoom=_,this.zoom=w,this.maxValue=0,this.paintVertexAttributes=n.map(function(r){return{name:"a_"+r,type:"Float32",components:h==="color"?4:2,offset:0}}),this.paintVertexArray=new C};vr.prototype.populatePaintArray=function(t,n,h,_,w){var C=this.expression.evaluate(new Oe(this.zoom),n,{},_,[],w),r=this.expression.evaluate(new Oe(this.zoom+1),n,{},_,[],w),e=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(e,t,C,r)},vr.prototype.updatePaintArray=function(t,n,h,_){var w=this.expression.evaluate({zoom:this.zoom},h,_),C=this.expression.evaluate({zoom:this.zoom+1},h,_);this._setPaintValue(t,n,w,C)},vr.prototype._setPaintValue=function(t,n,h,_){if(this.type==="color")for(var w=Qe(h),C=Qe(_),r=t;r<n;r++)this.paintVertexArray.emplace(r,w[0],w[1],C[0],C[1]);else{for(var e=t;e<n;e++)this.paintVertexArray.emplace(e,h,_);this.maxValue=Math.max(this.maxValue,Math.abs(h),Math.abs(_))}},vr.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},vr.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},vr.prototype.setUniform=function(t,n){var h=this.useIntegerZoom?Math.floor(n.zoom):n.zoom,_=kt(this.expression.interpolationFactor(h,this.zoom,this.zoom+1),0,1);t.set(_)},vr.prototype.getBinding=function(t,n,h){return new ke(t,n)};var Pr=function(t,n,h,_,w,C){this.expression=t,this.type=n,this.useIntegerZoom=h,this.zoom=_,this.layerId=C,this.zoomInPaintVertexArray=new w,this.zoomOutPaintVertexArray=new w};Pr.prototype.populatePaintArray=function(t,n,h){var _=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(_,t,n.patterns&&n.patterns[this.layerId],h)},Pr.prototype.updatePaintArray=function(t,n,h,_,w){this._setPaintValues(t,n,h.patterns&&h.patterns[this.layerId],w)},Pr.prototype._setPaintValues=function(t,n,h,_){if(_&&h){var w=_[h.min],C=_[h.mid],r=_[h.max];if(w&&C&&r)for(var e=t;e<n;e++)this.zoomInPaintVertexArray.emplace(e,C.tl[0],C.tl[1],C.br[0],C.br[1],w.tl[0],w.tl[1],w.br[0],w.br[1],C.pixelRatio,w.pixelRatio),this.zoomOutPaintVertexArray.emplace(e,C.tl[0],C.tl[1],C.br[0],C.br[1],r.tl[0],r.tl[1],r.br[0],r.br[1],C.pixelRatio,r.pixelRatio)}},Pr.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,Mt.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,Mt.members,this.expression.isStateDependent))},Pr.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var fr=function(t,n,h){this.binders={},this._buffers=[];var _=[];for(var w in t.paint._values)if(h(w)){var C=t.paint.get(w);if(C instanceof Jn&&ha(C.property.specification)){var r=Ui(w,t.type),e=C.value,s=C.property.specification.type,f=C.property.useIntegerZoom,y=C.property.specification["property-type"],b=y==="cross-faded"||y==="cross-faded-data-driven";if(e.kind==="constant")this.binders[w]=b?new jr(e.value,r):new Ir(e.value,r,s),_.push("/u_"+w);else if(e.kind==="source"||b){var E=tn(w,s,"source");this.binders[w]=b?new Pr(e,s,f,n,E,t.id):new Er(e,r,s,E),_.push("/a_"+w)}else{var M=tn(w,s,"composite");this.binders[w]=new vr(e,r,s,f,n,M),_.push("/z_"+w)}}}this.cacheKey=_.sort().join("")};fr.prototype.getMaxValue=function(t){var n=this.binders[t];return n instanceof Er||n instanceof vr?n.maxValue:0},fr.prototype.populatePaintArrays=function(t,n,h,_,w){for(var C in this.binders){var r=this.binders[C];(r instanceof Er||r instanceof vr||r instanceof Pr)&&r.populatePaintArray(t,n,h,_,w)}},fr.prototype.setConstantPatternPositions=function(t,n){for(var h in this.binders){var _=this.binders[h];_ instanceof jr&&_.setConstantPatternPositions(t,n)}},fr.prototype.updatePaintArrays=function(t,n,h,_,w){var C=!1;for(var r in t)for(var e=0,s=n.getPositions(r);e<s.length;e+=1){var f=s[e],y=h.feature(f.index);for(var b in this.binders){var E=this.binders[b];if((E instanceof Er||E instanceof vr||E instanceof Pr)&&E.expression.isStateDependent===!0){var M=_.paint.get(b);E.expression=M.value,E.updatePaintArray(f.start,f.end,y,t[r],w),C=!0}}}return C},fr.prototype.defines=function(){var t=[];for(var n in this.binders){var h=this.binders[n];(h instanceof Ir||h instanceof jr)&&t.push.apply(t,h.uniformNames.map(function(_){return"#define HAS_UNIFORM_"+_}))}return t},fr.prototype.getBinderAttributes=function(){var t=[];for(var n in this.binders){var h=this.binders[n];if(h instanceof Er||h instanceof vr)for(var _=0;_<h.paintVertexAttributes.length;_++)t.push(h.paintVertexAttributes[_].name);else if(h instanceof Pr)for(var w=0;w<Mt.members.length;w++)t.push(Mt.members[w].name)}return t},fr.prototype.getBinderUniforms=function(){var t=[];for(var n in this.binders){var h=this.binders[n];if(h instanceof Ir||h instanceof jr||h instanceof vr)for(var _=0,w=h.uniformNames;_<w.length;_+=1)t.push(w[_])}return t},fr.prototype.getPaintVertexBuffers=function(){return this._buffers},fr.prototype.getUniforms=function(t,n){var h=[];for(var _ in this.binders){var w=this.binders[_];if(w instanceof Ir||w instanceof jr||w instanceof vr)for(var C=0,r=w.uniformNames;C<r.length;C+=1){var e=r[C];if(n[e]){var s=w.getBinding(t,n[e],e);h.push({name:e,property:_,binding:s})}}}return h},fr.prototype.setUniforms=function(t,n,h,_){for(var w=0,C=n;w<C.length;w+=1){var r=C[w],e=r.name,s=r.property;this.binders[s].setUniform(r.binding,_,h.get(s),e)}},fr.prototype.updatePaintBuffers=function(t){for(var n in this._buffers=[],this.binders){var h=this.binders[n];if(t&&h instanceof Pr){var _=t.fromScale===2?h.zoomInPaintVertexBuffer:h.zoomOutPaintVertexBuffer;_&&this._buffers.push(_)}else(h instanceof Er||h instanceof vr)&&h.paintVertexBuffer&&this._buffers.push(h.paintVertexBuffer)}},fr.prototype.upload=function(t){for(var n in this.binders){var h=this.binders[n];(h instanceof Er||h instanceof vr||h instanceof Pr)&&h.upload(t)}this.updatePaintBuffers()},fr.prototype.destroy=function(){for(var t in this.binders){var n=this.binders[t];(n instanceof Er||n instanceof vr||n instanceof Pr)&&n.destroy()}};var cr=function(t,n,h){h===void 0&&(h=function(){return!0}),this.programConfigurations={};for(var _=0,w=t;_<w.length;_+=1){var C=w[_];this.programConfigurations[C.id]=new fr(C,n,h)}this.needsUpload=!1,this._featureMap=new Nt,this._bufferOffset=0};function Ui(t,n){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(n+"-","").replace(/-/g,"_")]}function tn(t,n,h){var _={color:{source:ut,composite:Ar},number:{source:Pe,composite:ut}},w=function(C){return{"line-pattern":{source:vt,composite:vt},"fill-pattern":{source:vt,composite:vt},"fill-extrusion-pattern":{source:vt,composite:vt}}[C]}(t);return w&&w[h]||_[n][h]}cr.prototype.populatePaintArrays=function(t,n,h,_,w,C){for(var r in this.programConfigurations)this.programConfigurations[r].populatePaintArrays(t,n,_,w,C);n.id!==void 0&&this._featureMap.add(n.id,h,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0},cr.prototype.updatePaintArrays=function(t,n,h,_){for(var w=0,C=h;w<C.length;w+=1){var r=C[w];this.needsUpload=this.programConfigurations[r.id].updatePaintArrays(t,this._featureMap,n,r,_)||this.needsUpload}},cr.prototype.get=function(t){return this.programConfigurations[t]},cr.prototype.upload=function(t){if(this.needsUpload){for(var n in this.programConfigurations)this.programConfigurations[n].upload(t);this.needsUpload=!1}},cr.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},tr("ConstantBinder",Ir),tr("CrossFadedConstantBinder",jr),tr("SourceExpressionBinder",Er),tr("CrossFadedCompositeBinder",Pr),tr("CompositeExpressionBinder",vr),tr("ProgramConfiguration",fr,{omit:["_buffers"]}),tr("ProgramConfigurationSet",cr);var hn=Math.pow(2,14)-1,jn=-hn-1;function Xi(t){for(var n=8192/t.extent,h=t.loadGeometry(),_=0;_<h.length;_++)for(var w=h[_],C=0;C<w.length;C++){var r=w[C],e=Math.round(r.x*n),s=Math.round(r.y*n);r.x=kt(e,jn,hn),r.y=kt(s,jn,hn),(e<r.x||e>r.x+1||s<r.y||s>r.y+1)&&Be("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return h}function Kr(t,n){return{type:t.type,id:t.id,properties:t.properties,geometry:n?Xi(t):[]}}function _o(t,n,h,_,w){t.emplaceBack(2*n+(_+1)/2,2*h+(w+1)/2)}var lo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(n){return n.id}),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new q,this.indexArray=new _e,this.segments=new ft,this.programConfigurations=new cr(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(function(n){return n.isStateDependent()}).map(function(n){return n.id})};function Vo(t,n){for(var h=0;h<t.length;h++)if(es(n,t[h]))return!0;for(var _=0;_<n.length;_++)if(es(t,n[_]))return!0;return!!au(t,n)}function Tn(t,n,h){return!!es(t,n)||!!Ps(n,t,h)}function Go(t,n){if(t.length===1)return Cl(n,t[0]);for(var h=0;h<n.length;h++)for(var _=n[h],w=0;w<_.length;w++)if(es(t,_[w]))return!0;for(var C=0;C<t.length;C++)if(Cl(n,t[C]))return!0;for(var r=0;r<n.length;r++)if(au(t,n[r]))return!0;return!1}function jo(t,n,h){if(t.length>1){if(au(t,n))return!0;for(var _=0;_<n.length;_++)if(Ps(n[_],t,h))return!0}for(var w=0;w<t.length;w++)if(Ps(t[w],n,h))return!0;return!1}function au(t,n){if(t.length===0||n.length===0)return!1;for(var h=0;h<t.length-1;h++)for(var _=t[h],w=t[h+1],C=0;C<n.length-1;C++)if(su(_,w,n[C],n[C+1]))return!0;return!1}function su(t,n,h,_){return qe(t,h,_)!==qe(n,h,_)&&qe(t,n,h)!==qe(t,n,_)}function Ps(t,n,h){var _=h*h;if(n.length===1)return t.distSqr(n[0])<_;for(var w=1;w<n.length;w++)if(lu(t,n[w-1],n[w])<_)return!0;return!1}function lu(t,n,h){var _=n.distSqr(h);if(_===0)return t.distSqr(n);var w=((t.x-n.x)*(h.x-n.x)+(t.y-n.y)*(h.y-n.y))/_;return t.distSqr(w<0?n:w>1?h:h.sub(n)._mult(w)._add(n))}function Cl(t,n){for(var h,_,w,C=!1,r=0;r<t.length;r++)for(var e=0,s=(h=t[r]).length-1;e<h.length;s=e++)(_=h[e]).y>n.y!=(w=h[s]).y>n.y&&n.x<(w.x-_.x)*(n.y-_.y)/(w.y-_.y)+_.x&&(C=!C);return C}function es(t,n){for(var h=!1,_=0,w=t.length-1;_<t.length;w=_++){var C=t[_],r=t[w];C.y>n.y!=r.y>n.y&&n.x<(r.x-C.x)*(n.y-C.y)/(r.y-C.y)+C.x&&(h=!h)}return h}function Al(t,n,h){var _=h[0],w=h[2];if(t.x<_.x&&n.x<_.x||t.x>w.x&&n.x>w.x||t.y<_.y&&n.y<_.y||t.y>w.y&&n.y>w.y)return!1;var C=qe(t,n,h[0]);return C!==qe(t,n,h[1])||C!==qe(t,n,h[2])||C!==qe(t,n,h[3])}function Da(t,n,h){var _=n.paint.get(t).value;return _.kind==="constant"?_.value:h.programConfigurations.get(n.id).getMaxValue(t)}function In(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function qo(t,n,h,_,w){if(!n[0]&&!n[1])return t;var C=F.convert(n)._mult(w);h==="viewport"&&C._rotate(-_);for(var r=[],e=0;e<t.length;e++)r.push(t[e].sub(C));return r}lo.prototype.populate=function(t,n,h){var _=this.layers[0],w=[],C=null;_.type==="circle"&&(C=_.layout.get("circle-sort-key"));for(var r=0,e=t;r<e.length;r+=1){var s=e[r],f=s.feature,y=s.id,b=s.index,E=s.sourceLayerIndex,M=this.layers[0]._featureFilter.needGeometry,z=Kr(f,M);if(this.layers[0]._featureFilter.filter(new Oe(this.zoom),z,h)){var O=C?C.evaluate(z,{},h):void 0,G={id:y,properties:f.properties,type:f.type,sourceLayerIndex:E,index:b,geometry:M?z.geometry:Xi(f),patterns:{},sortKey:O};w.push(G)}}C&&w.sort(function(Ut,jt){return Ut.sortKey-jt.sortKey});for(var V=0,W=w;V<W.length;V+=1){var Y=W[V],H=Y.geometry,ot=Y.index,ht=Y.sourceLayerIndex,Pt=t[ot].feature;this.addFeature(Y,H,ot,h),n.featureIndex.insert(Pt,H,ot,ht,this.index)}},lo.prototype.update=function(t,n,h){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,n,this.stateDependentLayers,h)},lo.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},lo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},lo.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ct),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},lo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},lo.prototype.addFeature=function(t,n,h,_){for(var w=0,C=n;w<C.length;w+=1)for(var r=0,e=C[w];r<e.length;r+=1){var s=e[r],f=s.x,y=s.y;if(!(f<0||f>=8192||y<0||y>=8192)){var b=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),E=b.vertexLength;_o(this.layoutVertexArray,f,y,-1,-1),_o(this.layoutVertexArray,f,y,1,-1),_o(this.layoutVertexArray,f,y,1,1),_o(this.layoutVertexArray,f,y,-1,1),this.indexArray.emplaceBack(E,E+1,E+2),this.indexArray.emplaceBack(E,E+3,E+2),b.vertexLength+=4,b.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,h,{},_)},tr("CircleBucket",lo,{omit:["layers"]});var Ys=new T({"circle-sort-key":new Ve(dt.layout_circle["circle-sort-key"])}),Oa={paint:new T({"circle-radius":new Ve(dt.paint_circle["circle-radius"]),"circle-color":new Ve(dt.paint_circle["circle-color"]),"circle-blur":new Ve(dt.paint_circle["circle-blur"]),"circle-opacity":new Ve(dt.paint_circle["circle-opacity"]),"circle-translate":new je(dt.paint_circle["circle-translate"]),"circle-translate-anchor":new je(dt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new je(dt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new je(dt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ve(dt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ve(dt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ve(dt.paint_circle["circle-stroke-opacity"])}),layout:Ys},ri=typeof Float32Array<"u"?Float32Array:Array;function vo(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Do(t,n,h){var _=n[0],w=n[1],C=n[2],r=n[3],e=n[4],s=n[5],f=n[6],y=n[7],b=n[8],E=n[9],M=n[10],z=n[11],O=n[12],G=n[13],V=n[14],W=n[15],Y=h[0],H=h[1],ot=h[2],ht=h[3];return t[0]=Y*_+H*e+ot*b+ht*O,t[1]=Y*w+H*s+ot*E+ht*G,t[2]=Y*C+H*f+ot*M+ht*V,t[3]=Y*r+H*y+ot*z+ht*W,t[4]=(Y=h[4])*_+(H=h[5])*e+(ot=h[6])*b+(ht=h[7])*O,t[5]=Y*w+H*s+ot*E+ht*G,t[6]=Y*C+H*f+ot*M+ht*V,t[7]=Y*r+H*y+ot*z+ht*W,t[8]=(Y=h[8])*_+(H=h[9])*e+(ot=h[10])*b+(ht=h[11])*O,t[9]=Y*w+H*s+ot*E+ht*G,t[10]=Y*C+H*f+ot*M+ht*V,t[11]=Y*r+H*y+ot*z+ht*W,t[12]=(Y=h[12])*_+(H=h[13])*e+(ot=h[14])*b+(ht=h[15])*O,t[13]=Y*w+H*s+ot*E+ht*G,t[14]=Y*C+H*f+ot*M+ht*V,t[15]=Y*r+H*y+ot*z+ht*W,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,n=0,h=arguments.length;h--;)n+=t[h]*t[h];return Math.sqrt(n)});var Pl,uu=Do;function cu(t,n,h){var _=n[0],w=n[1],C=n[2],r=n[3];return t[0]=h[0]*_+h[4]*w+h[8]*C+h[12]*r,t[1]=h[1]*_+h[5]*w+h[9]*C+h[13]*r,t[2]=h[2]*_+h[6]*w+h[10]*C+h[14]*r,t[3]=h[3]*_+h[7]*w+h[11]*C+h[15]*r,t}Pl=new ri(3),ri!=Float32Array&&(Pl[0]=0,Pl[1]=0,Pl[2]=0),function(){var t=new ri(4);ri!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var cp=(function(){var t=new ri(2);ri!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function n(h){t.call(this,h,Oa)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.createBucket=function(h){return new lo(h)},n.prototype.queryRadius=function(h){var _=h;return Da("circle-radius",this,_)+Da("circle-stroke-width",this,_)+In(this.paint.get("circle-translate"))},n.prototype.queryIntersectsFeature=function(h,_,w,C,r,e,s,f){for(var y=qo(h,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),e.angle,s),b=this.paint.get("circle-radius").evaluate(_,w)+this.paint.get("circle-stroke-width").evaluate(_,w),E=this.paint.get("circle-pitch-alignment")==="map",M=E?y:function(Pt,Ut){return Pt.map(function(jt){return Ms(jt,Ut)})}(y,f),z=E?b*s:b,O=0,G=C;O<G.length;O+=1)for(var V=0,W=G[O];V<W.length;V+=1){var Y=W[V],H=E?Y:Ms(Y,f),ot=z,ht=cu([],[Y.x,Y.y,0,1],f);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?ot*=ht[3]/e.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(ot*=e.cameraToCenterDistance/ht[3]),Tn(M,H,ot))return!0}return!1},n}(a));function Ms(t,n){var h=cu([],[t.x,t.y,0,1],n);return new F(h[0]/h[3],h[1]/h[3])}var hp=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n}(lo);function Ls(t,n,h,_){var w=n.width,C=n.height;if(_){if(_ instanceof Uint8ClampedArray)_=new Uint8Array(_.buffer);else if(_.length!==w*C*h)throw new RangeError("mismatched image size")}else _=new Uint8Array(w*C*h);return t.width=w,t.height=C,t.data=_,t}function Ku(t,n,h){var _=n.width,w=n.height;if(_!==t.width||w!==t.height){var C=Ls({},{width:_,height:w},h);pp(t,C,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,_),height:Math.min(t.height,w)},h),t.width=_,t.height=w,t.data=C.data}}function pp(t,n,h,_,w,C){if(w.width===0||w.height===0)return n;if(w.width>t.width||w.height>t.height||h.x>t.width-w.width||h.y>t.height-w.height)throw new RangeError("out of range source coordinates for image copy");if(w.width>n.width||w.height>n.height||_.x>n.width-w.width||_.y>n.height-w.height)throw new RangeError("out of range destination coordinates for image copy");for(var r=t.data,e=n.data,s=0;s<w.height;s++)for(var f=((h.y+s)*t.width+h.x)*C,y=((_.y+s)*n.width+_.x)*C,b=0;b<w.width*C;b++)e[y+b]=r[f+b];return n}tr("HeatmapBucket",hp,{omit:["layers"]});var Yu=function(t,n){Ls(this,t,1,n)};Yu.prototype.resize=function(t){Ku(this,t,1)},Yu.prototype.clone=function(){return new Yu({width:this.width,height:this.height},new Uint8Array(this.data))},Yu.copy=function(t,n,h,_,w){pp(t,n,h,_,w,1)};var xo=function(t,n){Ls(this,t,4,n)};xo.prototype.resize=function(t){Ku(this,t,4)},xo.prototype.replace=function(t,n){n?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t},xo.prototype.clone=function(){return new xo({width:this.width,height:this.height},new Uint8Array(this.data))},xo.copy=function(t,n,h,_,w){pp(t,n,h,_,w,4)},tr("AlphaImage",Yu),tr("RGBAImage",xo);var Ad={paint:new T({"heatmap-radius":new Ve(dt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ve(dt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new je(dt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new so(dt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new je(dt.paint_heatmap["heatmap-opacity"])})};function fp(t){var n={},h=t.resolution||256,_=t.clips?t.clips.length:1,w=t.image||new xo({width:h,height:_}),C=function(z,O,G){n[t.evaluationKey]=G;var V=t.expression.evaluate(n);w.data[z+O+0]=Math.floor(255*V.r/V.a),w.data[z+O+1]=Math.floor(255*V.g/V.a),w.data[z+O+2]=Math.floor(255*V.b/V.a),w.data[z+O+3]=Math.floor(255*V.a)};if(t.clips)for(var r=0,e=0;r<_;++r,e+=4*h)for(var s=0,f=0;s<h;s++,f+=4){var y=s/(h-1),b=t.clips[r];C(e,f,b.start*(1-y)+b.end*y)}else for(var E=0,M=0;E<h;E++,M+=4)C(0,M,E/(h-1));return w}var wh=function(t){function n(h){t.call(this,h,Ad),this._updateColorRamp()}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.createBucket=function(h){return new hp(h)},n.prototype._handleSpecialPaintPropertyUpdate=function(h){h==="heatmap-color"&&this._updateColorRamp()},n.prototype._updateColorRamp=function(){this.colorRamp=fp({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},n.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},n.prototype.queryRadius=function(){return 0},n.prototype.queryIntersectsFeature=function(){return!1},n.prototype.hasOffscreenPass=function(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"},n}(a),Fa={paint:new T({"hillshade-illumination-direction":new je(dt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new je(dt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new je(dt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new je(dt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new je(dt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new je(dt.paint_hillshade["hillshade-accent-color"])})},Pd=function(t){function n(h){t.call(this,h,Fa)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.hasOffscreenPass=function(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"},n}(a),ng=L([{name:"a_pos",components:2,type:"Int16"}],4).members,af=kc,og=kc;function kc(t,n,h){h=h||2;var _,w,C,r,e,s,f,y=n&&n.length,b=y?n[0]*h:t.length,E=Eh(t,0,b,h,!0),M=[];if(!E||E.next===E.prev)return M;if(y&&(E=function(O,G,V,W){var Y,H,ot,ht=[];for(Y=0,H=G.length;Y<H;Y++)(ot=Eh(O,G[Y]*W,Y<H-1?G[Y+1]*W:O.length,W,!1))===ot.next&&(ot.steiner=!0),ht.push(lf(ot));for(ht.sort(ug),Y=0;Y<ht.length;Y++)cg(ht[Y],V),V=Ml(V,V.next);return V}(t,n,E,h)),t.length>80*h){_=C=t[0],w=r=t[1];for(var z=h;z<b;z+=h)(e=t[z])<_&&(_=e),(s=t[z+1])<w&&(w=s),e>C&&(C=e),s>r&&(r=s);f=(f=Math.max(C-_,r-w))!==0?1/f:0}return rs(E,M,h,_,w,f),M}function Eh(t,n,h,_,w){var C,r;if(w===Ch(t,n,h,_)>0)for(C=n;C<h;C+=_)r=uf(C,t[C],t[C+1],r);else for(C=h-_;C>=n;C-=_)r=uf(C,t[C],t[C+1],r);return r&&on(r,r.next)&&(Oc(r),r=r.next),r}function Ml(t,n){if(!t)return t;n||(n=t);var h,_=t;do if(h=!1,_.steiner||!on(_,_.next)&&Cn(_.prev,_,_.next)!==0)_=_.next;else{if(Oc(_),(_=n=_.prev)===_.next)break;h=!0}while(h||_!==n);return n}function rs(t,n,h,_,w,C,r){if(t){!r&&C&&function(y,b,E,M){var z=y;do z.z===null&&(z.z=sf(z.x,z.y,b,E,M)),z.prevZ=z.prev,z.nextZ=z.next,z=z.next;while(z!==y);z.prevZ.nextZ=null,z.prevZ=null,function(O){var G,V,W,Y,H,ot,ht,Pt,Ut=1;do{for(V=O,O=null,H=null,ot=0;V;){for(ot++,W=V,ht=0,G=0;G<Ut&&(ht++,W=W.nextZ);G++);for(Pt=Ut;ht>0||Pt>0&&W;)ht!==0&&(Pt===0||!W||V.z<=W.z)?(Y=V,V=V.nextZ,ht--):(Y=W,W=W.nextZ,Pt--),H?H.nextZ=Y:O=Y,Y.prevZ=H,H=Y;V=W}H.nextZ=null,Ut*=2}while(ot>1)}(z)}(t,_,w,C);for(var e,s,f=t;t.prev!==t.next;)if(e=t.prev,s=t.next,C?ag(t,_,w,C):Sh(t))n.push(e.i/h),n.push(t.i/h),n.push(s.i/h),Oc(t),t=s.next,f=s.next;else if((t=s)===f){r?r===1?rs(t=sg(Ml(t),n,h),n,h,_,w,C,2):r===2&&lg(t,n,h,_,w,C):rs(Ml(t),n,h,_,w,C,1);break}}}function Sh(t){var n=t.prev,h=t,_=t.next;if(Cn(n,h,_)>=0)return!1;for(var w=t.next.next;w!==t.prev;){if(zc(n.x,n.y,h.x,h.y,_.x,_.y,w.x,w.y)&&Cn(w.prev,w,w.next)>=0)return!1;w=w.next}return!0}function ag(t,n,h,_){var w=t.prev,C=t,r=t.next;if(Cn(w,C,r)>=0)return!1;for(var e=w.x>C.x?w.x>r.x?w.x:r.x:C.x>r.x?C.x:r.x,s=w.y>C.y?w.y>r.y?w.y:r.y:C.y>r.y?C.y:r.y,f=sf(w.x<C.x?w.x<r.x?w.x:r.x:C.x<r.x?C.x:r.x,w.y<C.y?w.y<r.y?w.y:r.y:C.y<r.y?C.y:r.y,n,h,_),y=sf(e,s,n,h,_),b=t.prevZ,E=t.nextZ;b&&b.z>=f&&E&&E.z<=y;){if(b!==t.prev&&b!==t.next&&zc(w.x,w.y,C.x,C.y,r.x,r.y,b.x,b.y)&&Cn(b.prev,b,b.next)>=0||(b=b.prevZ,E!==t.prev&&E!==t.next&&zc(w.x,w.y,C.x,C.y,r.x,r.y,E.x,E.y)&&Cn(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;b&&b.z>=f;){if(b!==t.prev&&b!==t.next&&zc(w.x,w.y,C.x,C.y,r.x,r.y,b.x,b.y)&&Cn(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;E&&E.z<=y;){if(E!==t.prev&&E!==t.next&&zc(w.x,w.y,C.x,C.y,r.x,r.y,E.x,E.y)&&Cn(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function sg(t,n,h){var _=t;do{var w=_.prev,C=_.next.next;!on(w,C)&&Th(w,_,_.next,C)&&hu(w,C)&&hu(C,w)&&(n.push(w.i/h),n.push(_.i/h),n.push(C.i/h),Oc(_),Oc(_.next),_=t=C),_=_.next}while(_!==t);return Ml(_)}function lg(t,n,h,_,w,C){var r=t;do{for(var e=r.next.next;e!==r.prev;){if(r.i!==e.i&&Rc(r,e)){var s=Dc(r,e);return r=Ml(r,r.next),s=Ml(s,s.next),rs(r,n,h,_,w,C),void rs(s,n,h,_,w,C)}e=e.next}r=r.next}while(r!==t)}function ug(t,n){return t.x-n.x}function cg(t,n){if(n=function(_,w){var C,r=w,e=_.x,s=_.y,f=-1/0;do{if(s<=r.y&&s>=r.next.y&&r.next.y!==r.y){var y=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(y<=e&&y>f){if(f=y,y===e){if(s===r.y)return r;if(s===r.next.y)return r.next}C=r.x<r.next.x?r:r.next}}r=r.next}while(r!==w);if(!C)return null;if(e===f)return C;var b,E=C,M=C.x,z=C.y,O=1/0;r=C;do e>=r.x&&r.x>=M&&e!==r.x&&zc(s<z?e:f,s,M,z,s<z?f:e,s,r.x,r.y)&&(b=Math.abs(s-r.y)/(e-r.x),hu(r,_)&&(b<O||b===O&&(r.x>C.x||r.x===C.x&&hg(C,r)))&&(C=r,O=b)),r=r.next;while(r!==E);return C}(t,n)){var h=Dc(n,t);Ml(n,n.next),Ml(h,h.next)}}function hg(t,n){return Cn(t.prev,t,n.prev)<0&&Cn(n.next,t,t.next)<0}function sf(t,n,h,_,w){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-h)*w)|t<<8))|t<<4))|t<<2))|t<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-_)*w)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function lf(t){var n=t,h=t;do(n.x<h.x||n.x===h.x&&n.y<h.y)&&(h=n),n=n.next;while(n!==t);return h}function zc(t,n,h,_,w,C,r,e){return(w-r)*(n-e)-(t-r)*(C-e)>=0&&(t-r)*(_-e)-(h-r)*(n-e)>=0&&(h-r)*(C-e)-(w-r)*(_-e)>=0}function Rc(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!function(h,_){var w=h;do{if(w.i!==h.i&&w.next.i!==h.i&&w.i!==_.i&&w.next.i!==_.i&&Th(w,w.next,h,_))return!0;w=w.next}while(w!==h);return!1}(t,n)&&(hu(t,n)&&hu(n,t)&&function(h,_){var w=h,C=!1,r=(h.x+_.x)/2,e=(h.y+_.y)/2;do w.y>e!=w.next.y>e&&w.next.y!==w.y&&r<(w.next.x-w.x)*(e-w.y)/(w.next.y-w.y)+w.x&&(C=!C),w=w.next;while(w!==h);return C}(t,n)&&(Cn(t.prev,t,n.prev)||Cn(t,n.prev,n))||on(t,n)&&Cn(t.prev,t,t.next)>0&&Cn(n.prev,n,n.next)>0)}function Cn(t,n,h){return(n.y-t.y)*(h.x-n.x)-(n.x-t.x)*(h.y-n.y)}function on(t,n){return t.x===n.x&&t.y===n.y}function Th(t,n,h,_){var w=Hu(Cn(t,n,h)),C=Hu(Cn(t,n,_)),r=Hu(Cn(h,_,t)),e=Hu(Cn(h,_,n));return w!==C&&r!==e||!(w!==0||!Ih(t,h,n))||!(C!==0||!Ih(t,_,n))||!(r!==0||!Ih(h,t,_))||!(e!==0||!Ih(h,n,_))}function Ih(t,n,h){return n.x<=Math.max(t.x,h.x)&&n.x>=Math.min(t.x,h.x)&&n.y<=Math.max(t.y,h.y)&&n.y>=Math.min(t.y,h.y)}function Hu(t){return t>0?1:t<0?-1:0}function hu(t,n){return Cn(t.prev,t,t.next)<0?Cn(t,n,t.next)>=0&&Cn(t,t.prev,n)>=0:Cn(t,n,t.prev)<0||Cn(t,t.next,n)<0}function Dc(t,n){var h=new Ju(t.i,t.x,t.y),_=new Ju(n.i,n.x,n.y),w=t.next,C=n.prev;return t.next=n,n.prev=t,h.next=w,w.prev=h,_.next=h,h.prev=_,C.next=_,_.prev=C,_}function uf(t,n,h,_){var w=new Ju(t,n,h);return _?(w.next=_.next,w.prev=_,_.next.prev=w,_.next=w):(w.prev=w,w.next=w),w}function Oc(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ju(t,n,h){this.i=t,this.x=n,this.y=h,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ch(t,n,h,_){for(var w=0,C=n,r=h-_;C<h;C+=_)w+=(t[r]-t[C])*(t[C+1]+t[r+1]),r=C;return w}function cf(t,n,h,_,w){(function C(r,e,s,f,y){for(;f>s;){if(f-s>600){var b=f-s+1,E=e-s+1,M=Math.log(b),z=.5*Math.exp(2*M/3),O=.5*Math.sqrt(M*z*(b-z)/b)*(E-b/2<0?-1:1);C(r,e,Math.max(s,Math.floor(e-E*z/b+O)),Math.min(f,Math.floor(e+(b-E)*z/b+O)),y)}var G=r[e],V=s,W=f;for(Fc(r,s,e),y(r[f],G)>0&&Fc(r,s,f);V<W;){for(Fc(r,V,W),V++,W--;y(r[V],G)<0;)V++;for(;y(r[W],G)>0;)W--}y(r[s],G)===0?Fc(r,s,W):Fc(r,++W,f),W<=e&&(s=W+1),e<=W&&(f=W-1)}})(t,n,h||0,_||t.length-1,w||pg)}function Fc(t,n,h){var _=t[n];t[n]=t[h],t[h]=_}function pg(t,n){return t<n?-1:t>n?1:0}function dp(t,n){var h=t.length;if(h<=1)return[t];for(var _,w,C=[],r=0;r<h;r++){var e=rr(t[r]);e!==0&&(t[r].area=Math.abs(e),w===void 0&&(w=e<0),w===e<0?(_&&C.push(_),_=[t[r]]):_.push(t[r]))}if(_&&C.push(_),n>1)for(var s=0;s<C.length;s++)C[s].length<=n||(cf(C[s],n,1,C[s].length-1,Ah),C[s]=C[s].slice(0,n));return C}function Ah(t,n){return n.area-t.area}function hf(t,n,h){for(var _=h.patternDependencies,w=!1,C=0,r=n;C<r.length;C+=1){var e=r[C].paint.get(t+"-pattern");e.isConstant()||(w=!0);var s=e.constantOr(null);s&&(w=!0,_[s.to]=!0,_[s.from]=!0)}return w}function Ph(t,n,h,_,w){for(var C=w.patternDependencies,r=0,e=n;r<e.length;r+=1){var s=e[r],f=s.paint.get(t+"-pattern").value;if(f.kind!=="constant"){var y=f.evaluate({zoom:_-1},h,{},w.availableImages),b=f.evaluate({zoom:_},h,{},w.availableImages),E=f.evaluate({zoom:_+1},h,{},w.availableImages);b=b&&b.name?b.name:b,E=E&&E.name?E.name:E,C[y=y&&y.name?y.name:y]=!0,C[b]=!0,C[E]=!0,h.patterns[s.id]={min:y,mid:b,max:E}}}return h}kc.deviation=function(t,n,h,_){var w=n&&n.length,C=Math.abs(Ch(t,0,w?n[0]*h:t.length,h));if(w)for(var r=0,e=n.length;r<e;r++)C-=Math.abs(Ch(t,n[r]*h,r<e-1?n[r+1]*h:t.length,h));var s=0;for(r=0;r<_.length;r+=3){var f=_[r]*h,y=_[r+1]*h,b=_[r+2]*h;s+=Math.abs((t[f]-t[b])*(t[y+1]-t[f+1])-(t[f]-t[y])*(t[b+1]-t[f+1]))}return C===0&&s===0?0:Math.abs((s-C)/C)},kc.flatten=function(t){for(var n=t[0][0].length,h={vertices:[],holes:[],dimensions:n},_=0,w=0;w<t.length;w++){for(var C=0;C<t[w].length;C++)for(var r=0;r<n;r++)h.vertices.push(t[w][C][r]);w>0&&h.holes.push(_+=t[w-1].length)}return h},af.default=og;var ks=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(n){return n.id}),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new q,this.indexArray=new _e,this.indexArray2=new ar,this.programConfigurations=new cr(t.layers,t.zoom),this.segments=new ft,this.segments2=new ft,this.stateDependentLayerIds=this.layers.filter(function(n){return n.isStateDependent()}).map(function(n){return n.id})};ks.prototype.populate=function(t,n,h){this.hasPattern=hf("fill",this.layers,n);for(var _=this.layers[0].layout.get("fill-sort-key"),w=[],C=0,r=t;C<r.length;C+=1){var e=r[C],s=e.feature,f=e.id,y=e.index,b=e.sourceLayerIndex,E=this.layers[0]._featureFilter.needGeometry,M=Kr(s,E);if(this.layers[0]._featureFilter.filter(new Oe(this.zoom),M,h)){var z=_?_.evaluate(M,{},h,n.availableImages):void 0,O={id:f,properties:s.properties,type:s.type,sourceLayerIndex:b,index:y,geometry:E?M.geometry:Xi(s),patterns:{},sortKey:z};w.push(O)}}_&&w.sort(function(Pt,Ut){return Pt.sortKey-Ut.sortKey});for(var G=0,V=w;G<V.length;G+=1){var W=V[G],Y=W.geometry,H=W.index,ot=W.sourceLayerIndex;if(this.hasPattern){var ht=Ph("fill",this.layers,W,this.zoom,n);this.patternFeatures.push(ht)}else this.addFeature(W,Y,H,h,{});n.featureIndex.insert(t[H].feature,Y,H,ot,this.index)}},ks.prototype.update=function(t,n,h){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,n,this.stateDependentLayers,h)},ks.prototype.addFeatures=function(t,n,h){for(var _=0,w=this.patternFeatures;_<w.length;_+=1){var C=w[_];this.addFeature(C,C.geometry,C.index,n,h)}},ks.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},ks.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ks.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ng),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},ks.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},ks.prototype.addFeature=function(t,n,h,_,w){for(var C=0,r=dp(n,500);C<r.length;C+=1){for(var e=r[C],s=0,f=0,y=e;f<y.length;f+=1)s+=y[f].length;for(var b=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray),E=b.vertexLength,M=[],z=[],O=0,G=e;O<G.length;O+=1){var V=G[O];if(V.length!==0){V!==e[0]&&z.push(M.length/2);var W=this.segments2.prepareSegment(V.length,this.layoutVertexArray,this.indexArray2),Y=W.vertexLength;this.layoutVertexArray.emplaceBack(V[0].x,V[0].y),this.indexArray2.emplaceBack(Y+V.length-1,Y),M.push(V[0].x),M.push(V[0].y);for(var H=1;H<V.length;H++)this.layoutVertexArray.emplaceBack(V[H].x,V[H].y),this.indexArray2.emplaceBack(Y+H-1,Y+H),M.push(V[H].x),M.push(V[H].y);W.vertexLength+=V.length,W.primitiveLength+=V.length}}for(var ot=af(M,z),ht=0;ht<ot.length;ht+=3)this.indexArray.emplaceBack(E+ot[ht],E+ot[ht+1],E+ot[ht+2]);b.vertexLength+=s,b.primitiveLength+=ot.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,h,w,_)},tr("FillBucket",ks,{omit:["layers","patternFeatures"]});var pf=new T({"fill-sort-key":new Ve(dt.layout_fill["fill-sort-key"])}),ff={paint:new T({"fill-antialias":new je(dt.paint_fill["fill-antialias"]),"fill-opacity":new Ve(dt.paint_fill["fill-opacity"]),"fill-color":new Ve(dt.paint_fill["fill-color"]),"fill-outline-color":new Ve(dt.paint_fill["fill-outline-color"]),"fill-translate":new je(dt.paint_fill["fill-translate"]),"fill-translate-anchor":new je(dt.paint_fill["fill-translate-anchor"]),"fill-pattern":new Il(dt.paint_fill["fill-pattern"])}),layout:pf},df=function(t){function n(h){t.call(this,h,ff)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.recalculate=function(h,_){t.prototype.recalculate.call(this,h,_);var w=this.paint._values["fill-outline-color"];w.value.kind==="constant"&&w.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},n.prototype.createBucket=function(h){return new ks(h)},n.prototype.queryRadius=function(){return In(this.paint.get("fill-translate"))},n.prototype.queryIntersectsFeature=function(h,_,w,C,r,e,s){return Go(qo(h,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),e.angle,s),C)},n.prototype.isTileClipped=function(){return!0},n}(a),fg=L([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,Md=Bc;function Bc(t,n,h,_,w){this.properties={},this.extent=h,this.type=0,this._pbf=t,this._geometry=-1,this._keys=_,this._values=w,t.readFields(dg,this,n)}function dg(t,n,h){t==1?n.id=h.readVarint():t==2?function(_,w){for(var C=_.readVarint()+_.pos;_.pos<C;){var r=w._keys[_.readVarint()],e=w._values[_.readVarint()];w.properties[r]=e}}(h,n):t==3?n.type=h.readVarint():t==4&&(n._geometry=h.pos)}function pu(t){for(var n,h,_=0,w=0,C=t.length,r=C-1;w<C;r=w++)_+=((h=t[r]).x-(n=t[w]).x)*(n.y+h.y);return _}Bc.types=["Unknown","Point","LineString","Polygon"],Bc.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var n,h=t.readVarint()+t.pos,_=1,w=0,C=0,r=0,e=[];t.pos<h;){if(w<=0){var s=t.readVarint();_=7&s,w=s>>3}if(w--,_===1||_===2)C+=t.readSVarint(),r+=t.readSVarint(),_===1&&(n&&e.push(n),n=[]),n.push(new F(C,r));else{if(_!==7)throw new Error("unknown command "+_);n&&n.push(n[0].clone())}}return n&&e.push(n),e},Bc.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var n=t.readVarint()+t.pos,h=1,_=0,w=0,C=0,r=1/0,e=-1/0,s=1/0,f=-1/0;t.pos<n;){if(_<=0){var y=t.readVarint();h=7&y,_=y>>3}if(_--,h===1||h===2)(w+=t.readSVarint())<r&&(r=w),w>e&&(e=w),(C+=t.readSVarint())<s&&(s=C),C>f&&(f=C);else if(h!==7)throw new Error("unknown command "+h)}return[r,s,e,f]},Bc.prototype.toGeoJSON=function(t,n,h){var _,w,C=this.extent*Math.pow(2,h),r=this.extent*t,e=this.extent*n,s=this.loadGeometry(),f=Bc.types[this.type];function y(M){for(var z=0;z<M.length;z++){var O=M[z];M[z]=[360*(O.x+r)/C-180,360/Math.PI*Math.atan(Math.exp((180-360*(O.y+e)/C)*Math.PI/180))-90]}}switch(this.type){case 1:var b=[];for(_=0;_<s.length;_++)b[_]=s[_][0];y(s=b);break;case 2:for(_=0;_<s.length;_++)y(s[_]);break;case 3:for(s=function(M){var z=M.length;if(z<=1)return[M];for(var O,G,V=[],W=0;W<z;W++){var Y=pu(M[W]);Y!==0&&(G===void 0&&(G=Y<0),G===Y<0?(O&&V.push(O),O=[M[W]]):O.push(M[W]))}return O&&V.push(O),V}(s),_=0;_<s.length;_++)for(w=0;w<s[_].length;w++)y(s[_][w])}s.length===1?s=s[0]:f="Multi"+f;var E={type:"Feature",geometry:{type:f,coordinates:s},properties:this.properties};return"id"in this&&(E.id=this.id),E};var Ld=mf;function mf(t,n){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(Uc,this,n),this.length=this._features.length}function Uc(t,n,h){t===15?n.version=h.readVarint():t===1?n.name=h.readString():t===5?n.extent=h.readVarint():t===2?n._features.push(h.pos):t===3?n._keys.push(h.readString()):t===4&&n._values.push(function(_){for(var w=null,C=_.readVarint()+_.pos;_.pos<C;){var r=_.readVarint()>>3;w=r===1?_.readString():r===2?_.readFloat():r===3?_.readDouble():r===4?_.readVarint64():r===5?_.readVarint():r===6?_.readSVarint():r===7?_.readBoolean():null}return w}(h))}function mg(t,n,h){if(t===3){var _=new Ld(h,h.readVarint()+h.pos);_.length&&(n[_.name]=_)}}mf.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var n=this._pbf.readVarint()+this._pbf.pos;return new Md(this._pbf,n,this.extent,this._keys,this._values)};var Nc={VectorTile:function(t,n){this.layers=t.readFields(mg,{},n)},VectorTileFeature:Md,VectorTileLayer:Ld},gg=Nc.VectorTileFeature.types,mp=Math.pow(2,13);function Vc(t,n,h,_,w,C,r,e){t.emplaceBack(n,h,2*Math.floor(_*mp)+r,w*mp*2,C*mp*2,Math.round(e))}var zs=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(n){return n.id}),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new J,this.indexArray=new _e,this.programConfigurations=new cr(t.layers,t.zoom),this.segments=new ft,this.stateDependentLayerIds=this.layers.filter(function(n){return n.isStateDependent()}).map(function(n){return n.id})};function yg(t,n){return t.x===n.x&&(t.x<0||t.x>8192)||t.y===n.y&&(t.y<0||t.y>8192)}zs.prototype.populate=function(t,n,h){this.features=[],this.hasPattern=hf("fill-extrusion",this.layers,n);for(var _=0,w=t;_<w.length;_+=1){var C=w[_],r=C.feature,e=C.id,s=C.index,f=C.sourceLayerIndex,y=this.layers[0]._featureFilter.needGeometry,b=Kr(r,y);if(this.layers[0]._featureFilter.filter(new Oe(this.zoom),b,h)){var E={id:e,sourceLayerIndex:f,index:s,geometry:y?b.geometry:Xi(r),properties:r.properties,type:r.type,patterns:{}};this.hasPattern?this.features.push(Ph("fill-extrusion",this.layers,E,this.zoom,n)):this.addFeature(E,E.geometry,s,h,{}),n.featureIndex.insert(r,E.geometry,s,f,this.index,!0)}}},zs.prototype.addFeatures=function(t,n,h){for(var _=0,w=this.features;_<w.length;_+=1){var C=w[_];this.addFeature(C,C.geometry,C.index,n,h)}},zs.prototype.update=function(t,n,h){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,n,this.stateDependentLayers,h)},zs.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},zs.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},zs.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,fg),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},zs.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},zs.prototype.addFeature=function(t,n,h,_,w){for(var C=0,r=dp(n,500);C<r.length;C+=1){for(var e=r[C],s=0,f=0,y=e;f<y.length;f+=1)s+=y[f].length;for(var b=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),E=0,M=e;E<M.length;E+=1){var z=M[E];if(z.length!==0&&!((we=z).every(function(me){return me.x<0})||we.every(function(me){return me.x>8192})||we.every(function(me){return me.y<0})||we.every(function(me){return me.y>8192})))for(var O=0,G=0;G<z.length;G++){var V=z[G];if(G>=1){var W=z[G-1];if(!yg(V,W)){b.vertexLength+4>ft.MAX_VERTEX_ARRAY_LENGTH&&(b=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var Y=V.sub(W)._perp()._unit(),H=W.dist(V);O+H>32768&&(O=0),Vc(this.layoutVertexArray,V.x,V.y,Y.x,Y.y,0,0,O),Vc(this.layoutVertexArray,V.x,V.y,Y.x,Y.y,0,1,O),Vc(this.layoutVertexArray,W.x,W.y,Y.x,Y.y,0,0,O+=H),Vc(this.layoutVertexArray,W.x,W.y,Y.x,Y.y,0,1,O);var ot=b.vertexLength;this.indexArray.emplaceBack(ot,ot+2,ot+1),this.indexArray.emplaceBack(ot+1,ot+2,ot+3),b.vertexLength+=4,b.primitiveLength+=2}}}}if(b.vertexLength+s>ft.MAX_VERTEX_ARRAY_LENGTH&&(b=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray)),gg[t.type]==="Polygon"){for(var ht=[],Pt=[],Ut=b.vertexLength,jt=0,qt=e;jt<qt.length;jt+=1){var re=qt[jt];if(re.length!==0){re!==e[0]&&Pt.push(ht.length/2);for(var Xt=0;Xt<re.length;Xt++){var Te=re[Xt];Vc(this.layoutVertexArray,Te.x,Te.y,0,0,1,1,0),ht.push(Te.x),ht.push(Te.y)}}}for(var Ee=af(ht,Pt),ue=0;ue<Ee.length;ue+=3)this.indexArray.emplaceBack(Ut+Ee[ue],Ut+Ee[ue+2],Ut+Ee[ue+1]);b.primitiveLength+=Ee.length/3,b.vertexLength+=s}}var we;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,h,w,_)},tr("FillExtrusionBucket",zs,{omit:["layers","features"]});var _g={paint:new T({"fill-extrusion-opacity":new je(dt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ve(dt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new je(dt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new je(dt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Il(dt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ve(dt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ve(dt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new je(dt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},vg=function(t){function n(h){t.call(this,h,_g)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.createBucket=function(h){return new zs(h)},n.prototype.queryRadius=function(){return In(this.paint.get("fill-extrusion-translate"))},n.prototype.is3D=function(){return!0},n.prototype.queryIntersectsFeature=function(h,_,w,C,r,e,s,f){var y=qo(h,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),e.angle,s),b=this.paint.get("fill-extrusion-height").evaluate(_,w),E=this.paint.get("fill-extrusion-base").evaluate(_,w),M=function(O,G,V,W){for(var Y=[],H=0,ot=O;H<ot.length;H+=1){var ht=ot[H],Pt=[ht.x,ht.y,0,1];cu(Pt,Pt,G),Y.push(new F(Pt[0]/Pt[3],Pt[1]/Pt[3]))}return Y}(y,f),z=function(O,G,V,W){for(var Y=[],H=[],ot=W[8]*G,ht=W[9]*G,Pt=W[10]*G,Ut=W[11]*G,jt=W[8]*V,qt=W[9]*V,re=W[10]*V,Xt=W[11]*V,Te=0,Ee=O;Te<Ee.length;Te+=1){for(var ue=[],we=[],me=0,Ae=Ee[Te];me<Ae.length;me+=1){var pe=Ae[me],ge=pe.x,He=pe.y,Ke=W[0]*ge+W[4]*He+W[12],gr=W[1]*ge+W[5]*He+W[13],wr=W[2]*ge+W[6]*He+W[14],Nr=W[3]*ge+W[7]*He+W[15],Xr=wr+Pt,li=Nr+Ut,ui=Ke+jt,Jr=gr+qt,di=wr+re,Qr=Nr+Xt,mi=new F((Ke+ot)/li,(gr+ht)/li);mi.z=Xr/li,ue.push(mi);var Cr=new F(ui/Qr,Jr/Qr);Cr.z=di/Qr,we.push(Cr)}Y.push(ue),H.push(we)}return[Y,H]}(C,E,b,f);return function(O,G,V){var W=1/0;Go(V,G)&&(W=Gc(V,G[0]));for(var Y=0;Y<G.length;Y++)for(var H=G[Y],ot=O[Y],ht=0;ht<H.length-1;ht++){var Pt=H[ht],Ut=[Pt,H[ht+1],ot[ht+1],ot[ht],Pt];Vo(V,Ut)&&(W=Math.min(W,Gc(V,Ut)))}return W!==1/0&&W}(z[0],z[1],M)},n}(a);function Qu(t,n){return t.x*n.x+t.y*n.y}function Gc(t,n){if(t.length===1){for(var h,_=0,w=n[_++];!h||w.equals(h);)if(!(h=n[_++]))return 1/0;for(;_<n.length;_++){var C=n[_],r=t[0],e=h.sub(w),s=C.sub(w),f=r.sub(w),y=Qu(e,e),b=Qu(e,s),E=Qu(s,s),M=Qu(f,e),z=Qu(f,s),O=y*E-b*b,G=(E*M-b*z)/O,V=(y*z-b*M)/O,W=w.z*(1-G-V)+h.z*G+C.z*V;if(isFinite(W))return W}return 1/0}for(var Y=1/0,H=0,ot=n;H<ot.length;H+=1)Y=Math.min(Y,ot[H].z);return Y}var gf=L([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,xg=L([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,bg=Nc.VectorTileFeature.types,wg=Math.cos(Math.PI/180*37.5),jc=Math.pow(2,14)/.5,bo=function(t){var n=this;this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(h){return h.id}),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(function(h){n.gradients[h.id]={}}),this.layoutVertexArray=new et,this.layoutVertexArray2=new ut,this.indexArray=new _e,this.programConfigurations=new cr(t.layers,t.zoom),this.segments=new ft,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(function(h){return h.isStateDependent()}).map(function(h){return h.id})};bo.prototype.populate=function(t,n,h){this.hasPattern=hf("line",this.layers,n);for(var _=this.layers[0].layout.get("line-sort-key"),w=[],C=0,r=t;C<r.length;C+=1){var e=r[C],s=e.feature,f=e.id,y=e.index,b=e.sourceLayerIndex,E=this.layers[0]._featureFilter.needGeometry,M=Kr(s,E);if(this.layers[0]._featureFilter.filter(new Oe(this.zoom),M,h)){var z=_?_.evaluate(M,{},h):void 0,O={id:f,properties:s.properties,type:s.type,sourceLayerIndex:b,index:y,geometry:E?M.geometry:Xi(s),patterns:{},sortKey:z};w.push(O)}}_&&w.sort(function(Pt,Ut){return Pt.sortKey-Ut.sortKey});for(var G=0,V=w;G<V.length;G+=1){var W=V[G],Y=W.geometry,H=W.index,ot=W.sourceLayerIndex;if(this.hasPattern){var ht=Ph("line",this.layers,W,this.zoom,n);this.patternFeatures.push(ht)}else this.addFeature(W,Y,H,h,{});n.featureIndex.insert(t[H].feature,Y,H,ot,this.index)}},bo.prototype.update=function(t,n,h){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,n,this.stateDependentLayers,h)},bo.prototype.addFeatures=function(t,n,h){for(var _=0,w=this.patternFeatures;_<w.length;_+=1){var C=w[_];this.addFeature(C,C.geometry,C.index,n,h)}},bo.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},bo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},bo.prototype.upload=function(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,xg)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,gf),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},bo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},bo.prototype.lineFeatureClips=function(t){if(t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}},bo.prototype.addFeature=function(t,n,h,_,w){var C=this.layers[0].layout,r=C.get("line-join").evaluate(t,{}),e=C.get("line-cap"),s=C.get("line-miter-limit"),f=C.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(var y=0,b=n;y<b.length;y+=1)this.addLine(b[y],t,r,e,s,f);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,h,w,_)},bo.prototype.addLine=function(t,n,h,_,w,C){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var r=0;r<t.length-1;r++)this.totalDistance+=t[r].dist(t[r+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var e=bg[n.type]==="Polygon",s=t.length;s>=2&&t[s-1].equals(t[s-2]);)s--;for(var f=0;f<s-1&&t[f].equals(t[f+1]);)f++;if(!(s<(e?3:2))){h==="bevel"&&(w=1.05);var y,b=this.overscaling<=16?122880/(512*this.overscaling):0,E=this.segments.prepareSegment(10*s,this.layoutVertexArray,this.indexArray),M=void 0,z=void 0,O=void 0,G=void 0;this.e1=this.e2=-1,e&&(G=t[f].sub(y=t[s-2])._unit()._perp());for(var V=f;V<s;V++)if(!(z=V===s-1?e?t[f+1]:void 0:t[V+1])||!t[V].equals(z)){G&&(O=G),y&&(M=y),y=t[V],G=z?z.sub(y)._unit()._perp():O;var W=(O=O||G).add(G);W.x===0&&W.y===0||W._unit();var Y=O.x*G.x+O.y*G.y,H=W.x*G.x+W.y*G.y,ot=H!==0?1/H:1/0,ht=2*Math.sqrt(2-2*H),Pt=H<wg&&M&&z,Ut=O.x*G.y-O.y*G.x>0;if(Pt&&V>f){var jt=y.dist(M);if(jt>2*b){var qt=y.sub(y.sub(M)._mult(b/jt)._round());this.updateDistance(M,qt),this.addCurrentVertex(qt,O,0,0,E),M=qt}}var re=M&&z,Xt=re?h:e?"butt":_;if(re&&Xt==="round"&&(ot<C?Xt="miter":ot<=2&&(Xt="fakeround")),Xt==="miter"&&ot>w&&(Xt="bevel"),Xt==="bevel"&&(ot>2&&(Xt="flipbevel"),ot<w&&(Xt="miter")),M&&this.updateDistance(M,y),Xt==="miter")W._mult(ot),this.addCurrentVertex(y,W,0,0,E);else if(Xt==="flipbevel"){if(ot>100)W=G.mult(-1);else{var Te=ot*O.add(G).mag()/O.sub(G).mag();W._perp()._mult(Te*(Ut?-1:1))}this.addCurrentVertex(y,W,0,0,E),this.addCurrentVertex(y,W.mult(-1),0,0,E)}else if(Xt==="bevel"||Xt==="fakeround"){var Ee=-Math.sqrt(ot*ot-1),ue=Ut?Ee:0,we=Ut?0:Ee;if(M&&this.addCurrentVertex(y,O,ue,we,E),Xt==="fakeround")for(var me=Math.round(180*ht/Math.PI/20),Ae=1;Ae<me;Ae++){var pe=Ae/me;if(pe!==.5){var ge=pe-.5;pe+=pe*ge*(pe-1)*((1.0904+Y*(Y*(3.55645-1.43519*Y)-3.2452))*ge*ge+(.848013+Y*(.215638*Y-1.06021)))}var He=G.sub(O)._mult(pe)._add(O)._unit()._mult(Ut?-1:1);this.addHalfVertex(y,He.x,He.y,!1,Ut,0,E)}z&&this.addCurrentVertex(y,G,-ue,-we,E)}else if(Xt==="butt")this.addCurrentVertex(y,W,0,0,E);else if(Xt==="square"){var Ke=M?1:-1;this.addCurrentVertex(y,W,Ke,Ke,E)}else Xt==="round"&&(M&&(this.addCurrentVertex(y,O,0,0,E),this.addCurrentVertex(y,O,1,1,E,!0)),z&&(this.addCurrentVertex(y,G,-1,-1,E,!0),this.addCurrentVertex(y,G,0,0,E)));if(Pt&&V<s-1){var gr=y.dist(z);if(gr>2*b){var wr=y.add(z.sub(y)._mult(b/gr)._round());this.updateDistance(y,wr),this.addCurrentVertex(wr,G,0,0,E),y=wr}}}}},bo.prototype.addCurrentVertex=function(t,n,h,_,w,C){C===void 0&&(C=!1);var r=n.y*_-n.x,e=-n.y-n.x*_;this.addHalfVertex(t,n.x+n.y*h,n.y-n.x*h,C,!1,h,w),this.addHalfVertex(t,r,e,C,!0,-_,w),this.distance>jc/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(t,n,h,_,w,C))},bo.prototype.addHalfVertex=function(t,n,h,_,w,C,r){var e=.5*(this.lineClips?this.scaledDistance*(jc-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t.x<<1)+(_?1:0),(t.y<<1)+(w?1:0),Math.round(63*n)+128,Math.round(63*h)+128,1+(C===0?0:C<0?-1:1)|(63&e)<<2,e>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var s=r.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,s),r.primitiveLength++),w?this.e2=s:this.e1=s},bo.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},bo.prototype.updateDistance=function(t,n){this.distance+=t.dist(n),this.updateScaledDistance()},tr("LineBucket",bo,{omit:["layers","patternFeatures"]});var Eg=new T({"line-cap":new je(dt.layout_line["line-cap"]),"line-join":new Ve(dt.layout_line["line-join"]),"line-miter-limit":new je(dt.layout_line["line-miter-limit"]),"line-round-limit":new je(dt.layout_line["line-round-limit"]),"line-sort-key":new Ve(dt.layout_line["line-sort-key"])}),kd={paint:new T({"line-opacity":new Ve(dt.paint_line["line-opacity"]),"line-color":new Ve(dt.paint_line["line-color"]),"line-translate":new je(dt.paint_line["line-translate"]),"line-translate-anchor":new je(dt.paint_line["line-translate-anchor"]),"line-width":new Ve(dt.paint_line["line-width"]),"line-gap-width":new Ve(dt.paint_line["line-gap-width"]),"line-offset":new Ve(dt.paint_line["line-offset"]),"line-blur":new Ve(dt.paint_line["line-blur"]),"line-dasharray":new cn(dt.paint_line["line-dasharray"]),"line-pattern":new Il(dt.paint_line["line-pattern"]),"line-gradient":new so(dt.paint_line["line-gradient"])}),layout:Eg},zd=new(function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.possiblyEvaluate=function(h,_){return _=new Oe(Math.floor(_.zoom),{now:_.now,fadeDuration:_.fadeDuration,zoomHistory:_.zoomHistory,transition:_.transition}),t.prototype.possiblyEvaluate.call(this,h,_)},n.prototype.evaluate=function(h,_,w,C){return _=wt({},_,{zoom:Math.floor(_.zoom)}),t.prototype.evaluate.call(this,h,_,w,C)},n}(Ve))(kd.paint.properties["line-width"].specification);zd.useIntegerZoom=!0;var Sg=function(t){function n(h){t.call(this,h,kd),this.gradientVersion=0}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._handleSpecialPaintPropertyUpdate=function(h){h==="line-gradient"&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Dn,this.gradientVersion=(this.gradientVersion+1)%at)},n.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},n.prototype.recalculate=function(h,_){t.prototype.recalculate.call(this,h,_),this.paint._values["line-floorwidth"]=zd.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,h)},n.prototype.createBucket=function(h){return new bo(h)},n.prototype.queryRadius=function(h){var _=h,w=Rd(Da("line-width",this,_),Da("line-gap-width",this,_)),C=Da("line-offset",this,_);return w/2+Math.abs(C)+In(this.paint.get("line-translate"))},n.prototype.queryIntersectsFeature=function(h,_,w,C,r,e,s){var f=qo(h,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),e.angle,s),y=s/2*Rd(this.paint.get("line-width").evaluate(_,w),this.paint.get("line-gap-width").evaluate(_,w)),b=this.paint.get("line-offset").evaluate(_,w);return b&&(C=function(E,M){for(var z=[],O=new F(0,0),G=0;G<E.length;G++){for(var V=E[G],W=[],Y=0;Y<V.length;Y++){var H=V[Y],ot=V[Y+1],ht=Y===0?O:H.sub(V[Y-1])._unit()._perp(),Pt=Y===V.length-1?O:ot.sub(H)._unit()._perp(),Ut=ht._add(Pt)._unit();Ut._mult(1/(Ut.x*Pt.x+Ut.y*Pt.y)),W.push(Ut._mult(M)._add(H))}z.push(W)}return z}(C,b*s)),function(E,M,z){for(var O=0;O<M.length;O++){var G=M[O];if(E.length>=3){for(var V=0;V<G.length;V++)if(es(E,G[V]))return!0}if(jo(E,G,z))return!0}return!1}(f,C,y)},n.prototype.isTileClipped=function(){return!0},n}(a);function Rd(t,n){return n>0?n+2*t:t}var Tg=L([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Dd=L([{name:"a_projected_pos",components:3,type:"Float32"}],4),yf=(L([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),L([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Od=(L([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),L([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Fd=L([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Bd(t,n,h){return t.sections.forEach(function(_){_.text=function(w,C,r){var e=C.layout.get("text-transform").evaluate(r,{});return e==="uppercase"?w=w.toLocaleUpperCase():e==="lowercase"&&(w=w.toLocaleLowerCase()),er.applyArabicShaping&&(w=er.applyArabicShaping(w)),w}(_.text,n,h)}),t}L([{name:"triangle",components:3,type:"Uint16"}]),L([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),L([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),L([{type:"Float32",name:"offsetX"}]),L([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var qc={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"},Ud=function(t,n,h,_,w){var C,r,e=8*w-_-1,s=(1<<e)-1,f=s>>1,y=-7,b=h?w-1:0,E=h?-1:1,M=t[n+b];for(b+=E,C=M&(1<<-y)-1,M>>=-y,y+=e;y>0;C=256*C+t[n+b],b+=E,y-=8);for(r=C&(1<<-y)-1,C>>=-y,y+=_;y>0;r=256*r+t[n+b],b+=E,y-=8);if(C===0)C=1-f;else{if(C===s)return r?NaN:1/0*(M?-1:1);r+=Math.pow(2,_),C-=f}return(M?-1:1)*r*Math.pow(2,C-_)},Nd=function(t,n,h,_,w,C){var r,e,s,f=8*C-w-1,y=(1<<f)-1,b=y>>1,E=w===23?Math.pow(2,-24)-Math.pow(2,-77):0,M=_?0:C-1,z=_?1:-1,O=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(e=isNaN(n)?1:0,r=y):(r=Math.floor(Math.log(n)/Math.LN2),n*(s=Math.pow(2,-r))<1&&(r--,s*=2),(n+=r+b>=1?E/s:E*Math.pow(2,1-b))*s>=2&&(r++,s/=2),r+b>=y?(e=0,r=y):r+b>=1?(e=(n*s-1)*Math.pow(2,w),r+=b):(e=n*Math.pow(2,b-1)*Math.pow(2,w),r=0));w>=8;t[h+M]=255&e,M+=z,e/=256,w-=8);for(r=r<<w|e,f+=w;f>0;t[h+M]=255&r,M+=z,r/=256,f-=8);t[h+M-z]|=128*O},gp=Ci;function Ci(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Ci.Varint=0,Ci.Fixed64=1,Ci.Bytes=2,Ci.Fixed32=5;var Vd=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Ll(t){return t.type===Ci.Bytes?t.readVarint()+t.pos:t.pos+1}function Hs(t,n,h){return h?4294967296*n+(t>>>0):4294967296*(n>>>0)+(t>>>0)}function Qn(t,n,h){var _=n<=16383?1:n<=2097151?2:n<=268435455?3:Math.floor(Math.log(n)/(7*Math.LN2));h.realloc(_);for(var w=h.pos-1;w>=t;w--)h.buf[w+_]=h.buf[w]}function _f(t,n){for(var h=0;h<t.length;h++)n.writeVarint(t[h])}function Gd(t,n){for(var h=0;h<t.length;h++)n.writeSVarint(t[h])}function jd(t,n){for(var h=0;h<t.length;h++)n.writeFloat(t[h])}function Li(t,n){for(var h=0;h<t.length;h++)n.writeDouble(t[h])}function fu(t,n){for(var h=0;h<t.length;h++)n.writeBoolean(t[h])}function vf(t,n){for(var h=0;h<t.length;h++)n.writeFixed32(t[h])}function qd(t,n){for(var h=0;h<t.length;h++)n.writeSFixed32(t[h])}function Zd(t,n){for(var h=0;h<t.length;h++)n.writeFixed64(t[h])}function kl(t,n){for(var h=0;h<t.length;h++)n.writeSFixed64(t[h])}function zl(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16)+16777216*t[n+3]}function tc(t,n,h){t[h]=n,t[h+1]=n>>>8,t[h+2]=n>>>16,t[h+3]=n>>>24}function Xd(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16)+(t[n+3]<<24)}function Ig(t,n,h){t===1&&h.readMessage(Cg,n)}function Cg(t,n,h){if(t===3){var _=h.readMessage(Ag,{}),w=_.width,C=_.height,r=_.left,e=_.top,s=_.advance;n.push({id:_.id,bitmap:new Yu({width:w+6,height:C+6},_.bitmap),metrics:{width:w,height:C,left:r,top:e,advance:s}})}}function Ag(t,n,h){t===1?n.id=h.readVarint():t===2?n.bitmap=h.readBytes():t===3?n.width=h.readVarint():t===4?n.height=h.readVarint():t===5?n.left=h.readSVarint():t===6?n.top=h.readSVarint():t===7&&(n.advance=h.readVarint())}function Wd(t){for(var n=0,h=0,_=0,w=t;_<w.length;_+=1){var C=w[_];n+=C.w*C.h,h=Math.max(h,C.w)}t.sort(function(O,G){return G.h-O.h});for(var r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(n/.95)),h),h:1/0}],e=0,s=0,f=0,y=t;f<y.length;f+=1)for(var b=y[f],E=r.length-1;E>=0;E--){var M=r[E];if(!(b.w>M.w||b.h>M.h)){if(b.x=M.x,b.y=M.y,s=Math.max(s,b.y+b.h),e=Math.max(e,b.x+b.w),b.w===M.w&&b.h===M.h){var z=r.pop();E<r.length&&(r[E]=z)}else b.h===M.h?(M.x+=b.w,M.w-=b.w):b.w===M.w?(M.y+=b.h,M.h-=b.h):(r.push({x:M.x+b.w,y:M.y,w:M.w-b.w,h:b.h}),M.y+=b.h,M.h-=b.h);break}}return{w:e,h:s,fill:n/(e*s)||0}}Ci.prototype={destroy:function(){this.buf=null},readFields:function(t,n,h){for(h=h||this.length;this.pos<h;){var _=this.readVarint(),w=_>>3,C=this.pos;this.type=7&_,t(w,n,this),this.pos===C&&this.skip(_)}return n},readMessage:function(t,n){return this.readFields(t,n,this.readVarint()+this.pos)},readFixed32:function(){var t=zl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Xd(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=zl(this.buf,this.pos)+4294967296*zl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=zl(this.buf,this.pos)+4294967296*Xd(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Ud(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ud(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var n,h,_=this.buf;return n=127&(h=_[this.pos++]),h<128?n:(n|=(127&(h=_[this.pos++]))<<7,h<128?n:(n|=(127&(h=_[this.pos++]))<<14,h<128?n:(n|=(127&(h=_[this.pos++]))<<21,h<128?n:function(w,C,r){var e,s,f=r.buf;if(e=(112&(s=f[r.pos++]))>>4,s<128||(e|=(127&(s=f[r.pos++]))<<3,s<128)||(e|=(127&(s=f[r.pos++]))<<10,s<128)||(e|=(127&(s=f[r.pos++]))<<17,s<128)||(e|=(127&(s=f[r.pos++]))<<24,s<128)||(e|=(1&(s=f[r.pos++]))<<31,s<128))return Hs(w,e,C);throw new Error("Expected varint not more than 10 bytes")}(n|=(15&(h=_[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,n=this.pos;return this.pos=t,t-n>=12&&Vd?function(h,_,w){return Vd.decode(h.subarray(_,w))}(this.buf,n,t):function(h,_,w){for(var C="",r=_;r<w;){var e,s,f,y=h[r],b=null,E=y>239?4:y>223?3:y>191?2:1;if(r+E>w)break;E===1?y<128&&(b=y):E===2?(192&(e=h[r+1]))==128&&(b=(31&y)<<6|63&e)<=127&&(b=null):E===3?(s=h[r+2],(192&(e=h[r+1]))==128&&(192&s)==128&&((b=(15&y)<<12|(63&e)<<6|63&s)<=2047||b>=55296&&b<=57343)&&(b=null)):E===4&&(s=h[r+2],f=h[r+3],(192&(e=h[r+1]))==128&&(192&s)==128&&(192&f)==128&&((b=(15&y)<<18|(63&e)<<12|(63&s)<<6|63&f)<=65535||b>=1114112)&&(b=null)),b===null?(b=65533,E=1):b>65535&&(b-=65536,C+=String.fromCharCode(b>>>10&1023|55296),b=56320|1023&b),C+=String.fromCharCode(b),r+=E}return C}(this.buf,n,t)},readBytes:function(){var t=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,t);return this.pos=t,n},readPackedVarint:function(t,n){if(this.type!==Ci.Bytes)return t.push(this.readVarint(n));var h=Ll(this);for(t=t||[];this.pos<h;)t.push(this.readVarint(n));return t},readPackedSVarint:function(t){if(this.type!==Ci.Bytes)return t.push(this.readSVarint());var n=Ll(this);for(t=t||[];this.pos<n;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Ci.Bytes)return t.push(this.readBoolean());var n=Ll(this);for(t=t||[];this.pos<n;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Ci.Bytes)return t.push(this.readFloat());var n=Ll(this);for(t=t||[];this.pos<n;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Ci.Bytes)return t.push(this.readDouble());var n=Ll(this);for(t=t||[];this.pos<n;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Ci.Bytes)return t.push(this.readFixed32());var n=Ll(this);for(t=t||[];this.pos<n;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Ci.Bytes)return t.push(this.readSFixed32());var n=Ll(this);for(t=t||[];this.pos<n;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Ci.Bytes)return t.push(this.readFixed64());var n=Ll(this);for(t=t||[];this.pos<n;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Ci.Bytes)return t.push(this.readSFixed64());var n=Ll(this);for(t=t||[];this.pos<n;)t.push(this.readSFixed64());return t},skip:function(t){var n=7&t;if(n===Ci.Varint)for(;this.buf[this.pos++]>127;);else if(n===Ci.Bytes)this.pos=this.readVarint()+this.pos;else if(n===Ci.Fixed32)this.pos+=4;else{if(n!==Ci.Fixed64)throw new Error("Unimplemented type: "+n);this.pos+=8}},writeTag:function(t,n){this.writeVarint(t<<3|n)},realloc:function(t){for(var n=this.length||16;n<this.pos+t;)n*=2;if(n!==this.length){var h=new Uint8Array(n);h.set(this.buf),this.buf=h,this.length=n}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),tc(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),tc(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),tc(this.buf,-1&t,this.pos),tc(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),tc(this.buf,-1&t,this.pos),tc(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(n,h){var _,w;if(n>=0?(_=n%4294967296|0,w=n/4294967296|0):(w=~(-n/4294967296),4294967295^(_=~(-n%4294967296))?_=_+1|0:(_=0,w=w+1|0)),n>=18446744073709552e3||n<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");h.realloc(10),function(C,r,e){e.buf[e.pos++]=127&C|128,C>>>=7,e.buf[e.pos++]=127&C|128,C>>>=7,e.buf[e.pos++]=127&C|128,C>>>=7,e.buf[e.pos++]=127&C|128,e.buf[e.pos]=127&(C>>>=7)}(_,0,h),function(C,r){var e=(7&C)<<4;r.buf[r.pos++]|=e|((C>>>=3)?128:0),C&&(r.buf[r.pos++]=127&C|((C>>>=7)?128:0),C&&(r.buf[r.pos++]=127&C|((C>>>=7)?128:0),C&&(r.buf[r.pos++]=127&C|((C>>>=7)?128:0),C&&(r.buf[r.pos++]=127&C|((C>>>=7)?128:0),C&&(r.buf[r.pos++]=127&C)))))}(w,h)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var n=this.pos;this.pos=function(_,w,C){for(var r,e,s=0;s<w.length;s++){if((r=w.charCodeAt(s))>55295&&r<57344){if(!e){r>56319||s+1===w.length?(_[C++]=239,_[C++]=191,_[C++]=189):e=r;continue}if(r<56320){_[C++]=239,_[C++]=191,_[C++]=189,e=r;continue}r=e-55296<<10|r-56320|65536,e=null}else e&&(_[C++]=239,_[C++]=191,_[C++]=189,e=null);r<128?_[C++]=r:(r<2048?_[C++]=r>>6|192:(r<65536?_[C++]=r>>12|224:(_[C++]=r>>18|240,_[C++]=r>>12&63|128),_[C++]=r>>6&63|128),_[C++]=63&r|128)}return C}(this.buf,t,this.pos);var h=this.pos-n;h>=128&&Qn(n,h,this),this.pos=n-1,this.writeVarint(h),this.pos+=h},writeFloat:function(t){this.realloc(4),Nd(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Nd(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var n=t.length;this.writeVarint(n),this.realloc(n);for(var h=0;h<n;h++)this.buf[this.pos++]=t[h]},writeRawMessage:function(t,n){this.pos++;var h=this.pos;t(n,this);var _=this.pos-h;_>=128&&Qn(h,_,this),this.pos=h-1,this.writeVarint(_),this.pos+=_},writeMessage:function(t,n,h){this.writeTag(t,Ci.Bytes),this.writeRawMessage(n,h)},writePackedVarint:function(t,n){n.length&&this.writeMessage(t,_f,n)},writePackedSVarint:function(t,n){n.length&&this.writeMessage(t,Gd,n)},writePackedBoolean:function(t,n){n.length&&this.writeMessage(t,fu,n)},writePackedFloat:function(t,n){n.length&&this.writeMessage(t,jd,n)},writePackedDouble:function(t,n){n.length&&this.writeMessage(t,Li,n)},writePackedFixed32:function(t,n){n.length&&this.writeMessage(t,vf,n)},writePackedSFixed32:function(t,n){n.length&&this.writeMessage(t,qd,n)},writePackedFixed64:function(t,n){n.length&&this.writeMessage(t,Zd,n)},writePackedSFixed64:function(t,n){n.length&&this.writeMessage(t,kl,n)},writeBytesField:function(t,n){this.writeTag(t,Ci.Bytes),this.writeBytes(n)},writeFixed32Field:function(t,n){this.writeTag(t,Ci.Fixed32),this.writeFixed32(n)},writeSFixed32Field:function(t,n){this.writeTag(t,Ci.Fixed32),this.writeSFixed32(n)},writeFixed64Field:function(t,n){this.writeTag(t,Ci.Fixed64),this.writeFixed64(n)},writeSFixed64Field:function(t,n){this.writeTag(t,Ci.Fixed64),this.writeSFixed64(n)},writeVarintField:function(t,n){this.writeTag(t,Ci.Varint),this.writeVarint(n)},writeSVarintField:function(t,n){this.writeTag(t,Ci.Varint),this.writeSVarint(n)},writeStringField:function(t,n){this.writeTag(t,Ci.Bytes),this.writeString(n)},writeFloatField:function(t,n){this.writeTag(t,Ci.Fixed32),this.writeFloat(n)},writeDoubleField:function(t,n){this.writeTag(t,Ci.Fixed64),this.writeDouble(n)},writeBooleanField:function(t,n){this.writeVarintField(t,Boolean(n))}};var yp=function(t,n){var h=n.pixelRatio,_=n.version,w=n.stretchX,C=n.stretchY,r=n.content;this.paddedRect=t,this.pixelRatio=h,this.stretchX=w,this.stretchY=C,this.content=r,this.version=_},Mh={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Mh.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Mh.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Mh.tlbr.get=function(){return this.tl.concat(this.br)},Mh.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(yp.prototype,Mh);var Lh=function(t,n){var h={},_={};this.haveRenderCallbacks=[];var w=[];this.addImages(t,h,w),this.addImages(n,_,w);var C=Wd(w),r=new xo({width:C.w||1,height:C.h||1});for(var e in t){var s=t[e],f=h[e].paddedRect;xo.copy(s.data,r,{x:0,y:0},{x:f.x+1,y:f.y+1},s.data)}for(var y in n){var b=n[y],E=_[y].paddedRect,M=E.x+1,z=E.y+1,O=b.data.width,G=b.data.height;xo.copy(b.data,r,{x:0,y:0},{x:M,y:z},b.data),xo.copy(b.data,r,{x:0,y:G-1},{x:M,y:z-1},{width:O,height:1}),xo.copy(b.data,r,{x:0,y:0},{x:M,y:z+G},{width:O,height:1}),xo.copy(b.data,r,{x:O-1,y:0},{x:M-1,y:z},{width:1,height:G}),xo.copy(b.data,r,{x:0,y:0},{x:M+O,y:z},{width:1,height:G})}this.image=r,this.iconPositions=h,this.patternPositions=_};Lh.prototype.addImages=function(t,n,h){for(var _ in t){var w=t[_],C={x:0,y:0,w:w.data.width+2,h:w.data.height+2};h.push(C),n[_]=new yp(C,w),w.hasRenderCallback&&this.haveRenderCallbacks.push(_)}},Lh.prototype.patchUpdatedImages=function(t,n){for(var h in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[h],t.getImage(h),n),this.patchUpdatedImage(this.patternPositions[h],t.getImage(h),n)},Lh.prototype.patchUpdatedImage=function(t,n,h){if(t&&n&&t.version!==n.version){t.version=n.version;var _=t.tl;h.update(n.data,void 0,{x:_[0],y:_[1]})}},tr("ImagePosition",yp),tr("ImageAtlas",Lh);var ma={horizontal:1,vertical:2,horizontalOnly:3},Rl=function(){this.scale=1,this.fontStack="",this.imageName=null};Rl.forText=function(t,n){var h=new Rl;return h.scale=t||1,h.fontStack=n,h},Rl.forImage=function(t){var n=new Rl;return n.imageName=t,n};var An=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function kh(t,n,h,_,w,C,r,e,s,f,y,b,E,M,z,O){var G,V=An.fromFeature(t,w);b===ma.vertical&&V.verticalizePunctuation();var W=er.processBidirectionalText,Y=er.processStyledBidirectionalText;if(W&&V.sections.length===1){G=[];for(var H=0,ot=W(V.toString(),Zc(V,f,C,n,_,M,z));H<ot.length;H+=1){var ht=ot[H],Pt=new An;Pt.text=ht,Pt.sections=V.sections;for(var Ut=0;Ut<ht.length;Ut++)Pt.sectionIndex.push(0);G.push(Pt)}}else if(Y){G=[];for(var jt=0,qt=Y(V.text,V.sectionIndex,Zc(V,f,C,n,_,M,z));jt<qt.length;jt+=1){var re=qt[jt],Xt=new An;Xt.text=re[0],Xt.sectionIndex=re[1],Xt.sections=V.sections,G.push(Xt)}}else G=function(ue,we){for(var me=[],Ae=ue.text,pe=0,ge=0,He=we;ge<He.length;ge+=1){var Ke=He[ge];me.push(ue.substring(pe,Ke)),pe=Ke}return pe<Ae.length&&me.push(ue.substring(pe,Ae.length)),me}(V,Zc(V,f,C,n,_,M,z));var Te=[],Ee={positionedLines:Te,text:V.toString(),top:y[1],bottom:y[1],left:y[0],right:y[0],writingMode:b,iconsInText:!1,verticalizable:!1};return function(ue,we,me,Ae,pe,ge,He,Ke,gr,wr,Nr,Xr){for(var li=0,ui=-17,Jr=0,di=0,Qr=Ke==="right"?1:Ke==="left"?0:.5,mi=0,Cr=0,Or=pe;Cr<Or.length;Cr+=1){var Vr=Or[Cr];Vr.trim();var Mr=Vr.getMaxScale(),Ai=24*(Mr-1),Ti={positionedGlyphs:[],lineOffset:0};ue.positionedLines[mi]=Ti;var Hr=Ti.positionedGlyphs,qr=0;if(Vr.length()){for(var fi=0;fi<Vr.length();fi++){var or=Vr.getSection(fi),Mn=Vr.getSectionIndex(fi),ki=Vr.getCharCode(fi),an=0,vi=null,to=null,Un=null,ga=24,wo=!(gr===ma.horizontal||!Nr&&!za(ki)||Nr&&(_p[ki]||(tl=ki,Ne.Arabic(tl)||Ne["Arabic Supplement"](tl)||Ne["Arabic Extended-A"](tl)||Ne["Arabic Presentation Forms-A"](tl)||Ne["Arabic Presentation Forms-B"](tl))));if(or.imageName){var Eo=Ae[or.imageName];if(!Eo)continue;Un=or.imageName,ue.iconsInText=ue.iconsInText||!0,to=Eo.paddedRect;var Ln=Eo.displaySize;or.scale=24*or.scale/Xr,an=Ai+(24-Ln[1]*or.scale),ga=(vi={width:Ln[0],height:Ln[1],left:1,top:-3,advance:wo?Ln[1]:Ln[0]}).advance;var ya=wo?Ln[0]*or.scale-24*Mr:Ln[1]*or.scale-24*Mr;ya>0&&ya>qr&&(qr=ya)}else{var xu=me[or.fontStack],sc=xu&&xu[ki];if(sc&&sc.rect)to=sc.rect,vi=sc.metrics;else{var lc=we[or.fontStack],Jc=lc&&lc[ki];if(!Jc)continue;vi=Jc.metrics}an=24*(Mr-or.scale)}wo?(ue.verticalizable=!0,Hr.push({glyph:ki,imageName:Un,x:li,y:ui+an,vertical:wo,scale:or.scale,fontStack:or.fontStack,sectionIndex:Mn,metrics:vi,rect:to}),li+=ga*or.scale+wr):(Hr.push({glyph:ki,imageName:Un,x:li,y:ui+an,vertical:wo,scale:or.scale,fontStack:or.fontStack,sectionIndex:Mn,metrics:vi,rect:to}),li+=vi.advance*or.scale+wr)}Hr.length!==0&&(Jr=Math.max(li-wr,Jr),Xc(Hr,0,Hr.length-1,Qr,qr)),li=0;var ns=ge*Mr+qr;Ti.lineOffset=Math.max(qr,Ai),ui+=ns,di=Math.max(ns,di),++mi}else ui+=ge,++mi}var tl,uc=ui- -17,bu=ec(He),Bl=bu.horizontalAlign,Qc=bu.verticalAlign;(function(Mp,Lp,Gh,jh,kp,qh,Zh,Jo,cc){var hc,So=(Lp-Gh)*kp;hc=qh!==Zh?-Jo*jh- -17:(-jh*cc+.5)*Zh;for(var Qo=0,Ul=Mp;Qo<Ul.length;Qo+=1)for(var Rs=0,th=Ul[Qo].positionedGlyphs;Rs<th.length;Rs+=1){var os=th[Rs];os.x+=So,os.y+=hc}})(ue.positionedLines,Qr,Bl,Qc,Jr,di,ge,uc,pe.length),ue.top+=-Qc*uc,ue.bottom=ue.top+uc,ue.left+=-Bl*Jr,ue.right=ue.left+Jr}(Ee,n,h,_,G,r,e,s,b,f,E,O),!function(ue){for(var we=0,me=ue;we<me.length;we+=1)if(me[we].positionedGlyphs.length!==0)return!1;return!0}(Te)&&Ee}An.fromFeature=function(t,n){for(var h=new An,_=0;_<t.sections.length;_++){var w=t.sections[_];w.image?h.addImageSection(w):h.addTextSection(w,n)}return h},An.prototype.length=function(){return this.text.length},An.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},An.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},An.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},An.prototype.verticalizePunctuation=function(){this.text=function(t){for(var n="",h=0;h<t.length;h++){var _=t.charCodeAt(h+1)||null,w=t.charCodeAt(h-1)||null;n+=_&&Tl(_)&&!qc[t[h+1]]||w&&Tl(w)&&!qc[t[h-1]]||!qc[t[h]]?t[h]:qc[t[h]]}return n}(this.text)},An.prototype.trim=function(){for(var t=0,n=0;n<this.text.length&&_p[this.text.charCodeAt(n)];n++)t++;for(var h=this.text.length,_=this.text.length-1;_>=0&&_>=t&&_p[this.text.charCodeAt(_)];_--)h--;this.text=this.text.substring(t,h),this.sectionIndex=this.sectionIndex.slice(t,h)},An.prototype.substring=function(t,n){var h=new An;return h.text=this.text.substring(t,n),h.sectionIndex=this.sectionIndex.slice(t,n),h.sections=this.sections,h},An.prototype.toString=function(){return this.text},An.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce(function(n,h){return Math.max(n,t.sections[h].scale)},0)},An.prototype.addTextSection=function(t,n){this.text+=t.text,this.sections.push(Rl.forText(t.scale,t.fontStack||n));for(var h=this.sections.length-1,_=0;_<t.text.length;++_)this.sectionIndex.push(h)},An.prototype.addImageSection=function(t){var n=t.image?t.image.name:"";if(n.length!==0){var h=this.getNextImageSectionCharCode();h?(this.text+=String.fromCharCode(h),this.sections.push(Rl.forImage(n)),this.sectionIndex.push(this.sections.length-1)):Be("Reached maximum number of images 6401")}else Be("Can't add FormattedSection with an empty image.")},An.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var _p={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Ho={};function $d(t,n,h,_,w,C){if(n.imageName){var r=_[n.imageName];return r?r.displaySize[0]*n.scale*24/C+w:0}var e=h[n.fontStack],s=e&&e[t];return s?s.metrics.advance*n.scale+w:0}function xf(t,n,h,_){var w=Math.pow(t-n,2);return _?t<n?w/2:2*w:w+Math.abs(h)*h}function bf(t,n,h){var _=0;return t===10&&(_-=1e4),h&&(_+=150),t!==40&&t!==65288||(_+=50),n!==41&&n!==65289||(_+=50),_}function wf(t,n,h,_,w,C){for(var r=null,e=xf(n,h,w,C),s=0,f=_;s<f.length;s+=1){var y=f[s],b=xf(n-y.x,h,w,C)+y.badness;b<=e&&(r=y,e=b)}return{index:t,x:n,priorBreak:r,badness:e}}function Zc(t,n,h,_,w,C,r){if(C!=="point")return[];if(!t)return[];for(var e,s=[],f=function(G,V,W,Y,H,ot){for(var ht=0,Pt=0;Pt<G.length();Pt++){var Ut=G.getSection(Pt);ht+=$d(G.getCharCode(Pt),Ut,Y,H,V,ot)}return ht/Math.max(1,Math.ceil(ht/W))}(t,n,h,_,w,r),y=t.text.indexOf("\u200B")>=0,b=0,E=0;E<t.length();E++){var M=t.getSection(E),z=t.getCharCode(E);if(_p[z]||(b+=$d(z,M,_,w,n,r)),E<t.length()-1){var O=!((e=z)<11904||!(Ne["Bopomofo Extended"](e)||Ne.Bopomofo(e)||Ne["CJK Compatibility Forms"](e)||Ne["CJK Compatibility Ideographs"](e)||Ne["CJK Compatibility"](e)||Ne["CJK Radicals Supplement"](e)||Ne["CJK Strokes"](e)||Ne["CJK Symbols and Punctuation"](e)||Ne["CJK Unified Ideographs Extension A"](e)||Ne["CJK Unified Ideographs"](e)||Ne["Enclosed CJK Letters and Months"](e)||Ne["Halfwidth and Fullwidth Forms"](e)||Ne.Hiragana(e)||Ne["Ideographic Description Characters"](e)||Ne["Kangxi Radicals"](e)||Ne["Katakana Phonetic Extensions"](e)||Ne.Katakana(e)||Ne["Vertical Forms"](e)||Ne["Yi Radicals"](e)||Ne["Yi Syllables"](e)));(Ho[z]||O||M.imageName)&&s.push(wf(E+1,b,f,s,bf(z,t.getCharCode(E+1),O&&y),!1))}}return function G(V){return V?G(V.priorBreak).concat(V.index):[]}(wf(t.length(),b,f,s,0,!0))}function ec(t){var n=.5,h=.5;switch(t){case"right":case"top-right":case"bottom-right":n=1;break;case"left":case"top-left":case"bottom-left":n=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":h=1;break;case"top":case"top-right":case"top-left":h=0}return{horizontalAlign:n,verticalAlign:h}}function Xc(t,n,h,_,w){if(_||w)for(var C=t[h],r=(t[h].x+C.metrics.advance*C.scale)*_,e=n;e<=h;e++)t[e].x-=r,t[e].y+=w}function zh(t,n,h,_,w,C){var r,e=t.image;if(e.content){var s=e.content,f=e.pixelRatio||1;r=[s[0]/f,s[1]/f,e.displaySize[0]-s[2]/f,e.displaySize[1]-s[3]/f]}var y,b,E,M,z=n.left*C,O=n.right*C;h==="width"||h==="both"?(M=w[0]+z-_[3],b=w[0]+O+_[1]):b=(M=w[0]+(z+O-e.displaySize[0])/2)+e.displaySize[0];var G=n.top*C,V=n.bottom*C;return h==="height"||h==="both"?(y=w[1]+G-_[0],E=w[1]+V+_[2]):E=(y=w[1]+(G+V-e.displaySize[1])/2)+e.displaySize[1],{image:e,top:y,right:b,bottom:E,left:M,collisionPadding:r}}Ho[10]=!0,Ho[32]=!0,Ho[38]=!0,Ho[40]=!0,Ho[41]=!0,Ho[43]=!0,Ho[45]=!0,Ho[47]=!0,Ho[173]=!0,Ho[183]=!0,Ho[8203]=!0,Ho[8208]=!0,Ho[8211]=!0,Ho[8231]=!0;var Dl=function(t){function n(h,_,w,C){t.call(this,h,_),this.angle=w,C!==void 0&&(this.segment=C)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.clone=function(){return new n(this.x,this.y,this.angle,this.segment)},n}(F);function Ef(t,n){var h=n.expression;if(h.kind==="constant")return{kind:"constant",layoutSize:h.evaluate(new Oe(t+1))};if(h.kind==="source")return{kind:"source"};for(var _=h.zoomStops,w=h.interpolationType,C=0;C<_.length&&_[C]<=t;)C++;for(var r=C=Math.max(0,C-1);r<_.length&&_[r]<t+1;)r++;r=Math.min(_.length-1,r);var e=_[C],s=_[r];return h.kind==="composite"?{kind:"composite",minZoom:e,maxZoom:s,interpolationType:w}:{kind:"camera",minZoom:e,maxZoom:s,minSize:h.evaluate(new Oe(e)),maxSize:h.evaluate(new Oe(s)),interpolationType:w}}function Sf(t,n,h){var _=n.uSize,w=h.lowerSize;return t.kind==="source"?w/128:t.kind==="composite"?Ji(w/128,h.upperSize/128,n.uSizeT):_}function Tf(t,n){var h=0,_=0;if(t.kind==="constant")_=t.layoutSize;else if(t.kind!=="source"){var w=t.interpolationType,C=w?kt(Fn.interpolationFactor(w,n,t.minZoom,t.maxZoom),0,1):0;t.kind==="camera"?_=Ji(t.minSize,t.maxSize,C):h=C}return{uSizeT:h,uSize:_}}tr("Anchor",Dl);var Pg=Object.freeze({__proto__:null,getSizeData:Ef,evaluateSizeForFeature:Sf,evaluateSizeForZoom:Tf,SIZE_PACK_FACTOR:128});function If(t,n,h,_,w){if(n.segment===void 0)return!0;for(var C=n,r=n.segment+1,e=0;e>-h/2;){if(--r<0)return!1;e-=t[r].dist(C),C=t[r]}e+=t[r].dist(t[r+1]),r++;for(var s=[],f=0;e<h/2;){var y=t[r],b=t[r+1];if(!b)return!1;var E=t[r-1].angleTo(y)-y.angleTo(b);for(E=Math.abs((E+3*Math.PI)%(2*Math.PI)-Math.PI),s.push({distance:e,angleDelta:E}),f+=E;e-s[0].distance>_;)f-=s.shift().angleDelta;if(f>w)return!1;r++,e+=y.dist(b)}return!0}function Cf(t){for(var n=0,h=0;h<t.length-1;h++)n+=t[h].dist(t[h+1]);return n}function vp(t,n,h){return t?.6*n*h:0}function xp(t,n){return Math.max(t?t.right-t.left:0,n?n.right-n.left:0)}function Mg(t,n,h,_,w,C){for(var r=vp(h,w,C),e=xp(h,_)*C,s=0,f=Cf(t)/2,y=0;y<t.length-1;y++){var b=t[y],E=t[y+1],M=b.dist(E);if(s+M>f){var z=(f-s)/M,O=Ji(b.x,E.x,z),G=Ji(b.y,E.y,z),V=new Dl(O,G,E.angleTo(b),y);return V._round(),!r||If(t,V,e,r,n)?V:void 0}s+=M}}function Lg(t,n,h,_,w,C,r,e,s){var f=vp(_,C,r),y=xp(_,w),b=y*r,E=t[0].x===0||t[0].x===s||t[0].y===0||t[0].y===s;return n-b<n/4&&(n=b+n/4),function M(z,O,G,V,W,Y,H,ot,ht){for(var Pt=Y/2,Ut=Cf(z),jt=0,qt=O-G,re=[],Xt=0;Xt<z.length-1;Xt++){for(var Te=z[Xt],Ee=z[Xt+1],ue=Te.dist(Ee),we=Ee.angleTo(Te);qt+G<jt+ue;){var me=((qt+=G)-jt)/ue,Ae=Ji(Te.x,Ee.x,me),pe=Ji(Te.y,Ee.y,me);if(Ae>=0&&Ae<ht&&pe>=0&&pe<ht&&qt-Pt>=0&&qt+Pt<=Ut){var ge=new Dl(Ae,pe,we,Xt);ge._round(),V&&!If(z,ge,Y,V,W)||re.push(ge)}}jt+=ue}return ot||re.length||H||(re=M(z,jt/2,G,V,W,Y,H,!0,ht)),re}(t,E?n/2*e%n:(y/2+2*C)*r*e%n,n,f,h,b,E,!1,s)}function Af(t,n,h,_,w){for(var C=[],r=0;r<t.length;r++)for(var e=t[r],s=void 0,f=0;f<e.length-1;f++){var y=e[f],b=e[f+1];y.x<n&&b.x<n||(y.x<n?y=new F(n,y.y+(n-y.x)/(b.x-y.x)*(b.y-y.y))._round():b.x<n&&(b=new F(n,y.y+(n-y.x)/(b.x-y.x)*(b.y-y.y))._round()),y.y<h&&b.y<h||(y.y<h?y=new F(y.x+(h-y.y)/(b.y-y.y)*(b.x-y.x),h)._round():b.y<h&&(b=new F(y.x+(h-y.y)/(b.y-y.y)*(b.x-y.x),h)._round()),y.x>=_&&b.x>=_||(y.x>=_?y=new F(_,y.y+(_-y.x)/(b.x-y.x)*(b.y-y.y))._round():b.x>=_&&(b=new F(_,y.y+(_-y.x)/(b.x-y.x)*(b.y-y.y))._round()),y.y>=w&&b.y>=w||(y.y>=w?y=new F(y.x+(w-y.y)/(b.y-y.y)*(b.x-y.x),w)._round():b.y>=w&&(b=new F(y.x+(w-y.y)/(b.y-y.y)*(b.x-y.x),w)._round()),s&&y.equals(s[s.length-1])||C.push(s=[y]),s.push(b)))))}return C}function Js(t,n,h,_){var w=[],C=t.image,r=C.pixelRatio,e=C.paddedRect.w-2,s=C.paddedRect.h-2,f=t.right-t.left,y=t.bottom-t.top,b=C.stretchX||[[0,e]],E=C.stretchY||[[0,s]],M=function(Ae,pe){return Ae+pe[1]-pe[0]},z=b.reduce(M,0),O=E.reduce(M,0),G=e-z,V=s-O,W=0,Y=z,H=0,ot=O,ht=0,Pt=G,Ut=0,jt=V;if(C.content&&_){var qt=C.content;W=Rh(b,0,qt[0]),H=Rh(E,0,qt[1]),Y=Rh(b,qt[0],qt[2]),ot=Rh(E,qt[1],qt[3]),ht=qt[0]-W,Ut=qt[1]-H,Pt=qt[2]-qt[0]-Y,jt=qt[3]-qt[1]-ot}var re=function(Ae,pe,ge,He){var Ke=Dh(Ae.stretch-W,Y,f,t.left),gr=Oh(Ae.fixed-ht,Pt,Ae.stretch,z),wr=Dh(pe.stretch-H,ot,y,t.top),Nr=Oh(pe.fixed-Ut,jt,pe.stretch,O),Xr=Dh(ge.stretch-W,Y,f,t.left),li=Oh(ge.fixed-ht,Pt,ge.stretch,z),ui=Dh(He.stretch-H,ot,y,t.top),Jr=Oh(He.fixed-Ut,jt,He.stretch,O),di=new F(Ke,wr),Qr=new F(Xr,wr),mi=new F(Xr,ui),Cr=new F(Ke,ui),Or=new F(gr/r,Nr/r),Vr=new F(li/r,Jr/r),Mr=n*Math.PI/180;if(Mr){var Ai=Math.sin(Mr),Ti=Math.cos(Mr),Hr=[Ti,-Ai,Ai,Ti];di._matMult(Hr),Qr._matMult(Hr),Cr._matMult(Hr),mi._matMult(Hr)}var qr=Ae.stretch+Ae.fixed,fi=pe.stretch+pe.fixed;return{tl:di,tr:Qr,bl:Cr,br:mi,tex:{x:C.paddedRect.x+1+qr,y:C.paddedRect.y+1+fi,w:ge.stretch+ge.fixed-qr,h:He.stretch+He.fixed-fi},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Or,pixelOffsetBR:Vr,minFontScaleX:Pt/r/f,minFontScaleY:jt/r/y,isSDF:h}};if(_&&(C.stretchX||C.stretchY))for(var Xt=Ol(b,G,z),Te=Ol(E,V,O),Ee=0;Ee<Xt.length-1;Ee++)for(var ue=Xt[Ee],we=Xt[Ee+1],me=0;me<Te.length-1;me++)w.push(re(ue,Te[me],we,Te[me+1]));else w.push(re({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:e+1},{fixed:0,stretch:s+1}));return w}function Rh(t,n,h){for(var _=0,w=0,C=t;w<C.length;w+=1){var r=C[w];_+=Math.max(n,Math.min(h,r[1]))-Math.max(n,Math.min(h,r[0]))}return _}function Ol(t,n,h){for(var _=[{fixed:-1,stretch:0}],w=0,C=t;w<C.length;w+=1){var r=C[w],e=r[0],s=r[1],f=_[_.length-1];_.push({fixed:e-f.stretch,stretch:f.stretch}),_.push({fixed:e-f.stretch,stretch:f.stretch+(s-e)})}return _.push({fixed:n+1,stretch:h}),_}function Dh(t,n,h,_){return t/n*h+_}function Oh(t,n,h,_){return t-n*h/_}var Fh=function(t,n,h,_,w,C,r,e,s,f){if(this.boxStartIndex=t.length,s){var y=C.top,b=C.bottom,E=C.collisionPadding;E&&(y-=E[1],b+=E[3]);var M=b-y;M>0&&(M=Math.max(10,M),this.circleDiameter=M)}else{var z=C.top*r-e,O=C.bottom*r+e,G=C.left*r-e,V=C.right*r+e,W=C.collisionPadding;if(W&&(G-=W[0]*r,z-=W[1]*r,V+=W[2]*r,O+=W[3]*r),f){var Y=new F(G,z),H=new F(V,z),ot=new F(G,O),ht=new F(V,O),Pt=f*Math.PI/180;Y._rotate(Pt),H._rotate(Pt),ot._rotate(Pt),ht._rotate(Pt),G=Math.min(Y.x,H.x,ot.x,ht.x),V=Math.max(Y.x,H.x,ot.x,ht.x),z=Math.min(Y.y,H.y,ot.y,ht.y),O=Math.max(Y.y,H.y,ot.y,ht.y)}t.emplaceBack(n.x,n.y,G,z,V,O,h,_,w)}this.boxEndIndex=t.length},rc=function(t,n){if(t===void 0&&(t=[]),n===void 0&&(n=kg),this.data=t,this.length=this.data.length,this.compare=n,this.length>0)for(var h=(this.length>>1)-1;h>=0;h--)this._down(h)};function kg(t,n){return t<n?-1:t>n?1:0}function zg(t,n,h){n===void 0&&(n=1),h===void 0&&(h=!1);for(var _=1/0,w=1/0,C=-1/0,r=-1/0,e=t[0],s=0;s<e.length;s++){var f=e[s];(!s||f.x<_)&&(_=f.x),(!s||f.y<w)&&(w=f.y),(!s||f.x>C)&&(C=f.x),(!s||f.y>r)&&(r=f.y)}var y=Math.min(C-_,r-w),b=y/2,E=new rc([],Kd);if(y===0)return new F(_,w);for(var M=_;M<C;M+=y)for(var z=w;z<r;z+=y)E.push(new ic(M+b,z+b,b,t));for(var O=function(W){for(var Y=0,H=0,ot=0,ht=W[0],Pt=0,Ut=ht.length,jt=Ut-1;Pt<Ut;jt=Pt++){var qt=ht[Pt],re=ht[jt],Xt=qt.x*re.y-re.x*qt.y;H+=(qt.x+re.x)*Xt,ot+=(qt.y+re.y)*Xt,Y+=3*Xt}return new ic(H/Y,ot/Y,0,W)}(t),G=E.length;E.length;){var V=E.pop();(V.d>O.d||!O.d)&&(O=V,h&&console.log("found best %d after %d probes",Math.round(1e4*V.d)/1e4,G)),V.max-O.d<=n||(E.push(new ic(V.p.x-(b=V.h/2),V.p.y-b,b,t)),E.push(new ic(V.p.x+b,V.p.y-b,b,t)),E.push(new ic(V.p.x-b,V.p.y+b,b,t)),E.push(new ic(V.p.x+b,V.p.y+b,b,t)),G+=4)}return h&&(console.log("num probes: "+G),console.log("best distance: "+O.d)),O.p}function Kd(t,n){return n.max-t.max}function ic(t,n,h,_){this.p=new F(t,n),this.h=h,this.d=function(w,C){for(var r=!1,e=1/0,s=0;s<C.length;s++)for(var f=C[s],y=0,b=f.length,E=b-1;y<b;E=y++){var M=f[y],z=f[E];M.y>w.y!=z.y>w.y&&w.x<(z.x-M.x)*(w.y-M.y)/(z.y-M.y)+M.x&&(r=!r),e=Math.min(e,lu(w,M,z))}return(r?1:-1)*Math.sqrt(e)}(this.p,_),this.max=this.d+this.h*Math.SQRT2}rc.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},rc.prototype.pop=function(){if(this.length!==0){var t=this.data[0],n=this.data.pop();return this.length--,this.length>0&&(this.data[0]=n,this._down(0)),t}},rc.prototype.peek=function(){return this.data[0]},rc.prototype._up=function(t){for(var n=this.data,h=this.compare,_=n[t];t>0;){var w=t-1>>1,C=n[w];if(h(_,C)>=0)break;n[t]=C,t=w}n[t]=_},rc.prototype._down=function(t){for(var n=this.data,h=this.compare,_=this.length>>1,w=n[t];t<_;){var C=1+(t<<1),r=n[C],e=C+1;if(e<this.length&&h(n[e],r)<0&&(C=e,r=n[e]),h(r,w)>=0)break;n[t]=r,t=C}n[t]=w};var bp=Number.POSITIVE_INFINITY;function Bh(t,n){return n[1]!==bp?function(h,_,w){var C=0,r=0;switch(_=Math.abs(_),w=Math.abs(w),h){case"top-right":case"top-left":case"top":r=w-7;break;case"bottom-right":case"bottom-left":case"bottom":r=7-w}switch(h){case"top-right":case"bottom-right":case"right":C=-_;break;case"top-left":case"bottom-left":case"left":C=_}return[C,r]}(t,n[0],n[1]):function(h,_){var w=0,C=0;_<0&&(_=0);var r=_/Math.sqrt(2);switch(h){case"top-right":case"top-left":C=r-7;break;case"bottom-right":case"bottom-left":C=7-r;break;case"bottom":C=7-_;break;case"top":C=_-7}switch(h){case"top-right":case"bottom-right":w=-r;break;case"top-left":case"bottom-left":w=r;break;case"left":w=_;break;case"right":w=-_}return[w,C]}(t,n[0])}function wp(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Uh(t,n,h,_,w,C,r,e,s,f,y,b,E,M,z){var O=function(H,ot,ht,Pt,Ut,jt,qt,re){for(var Xt=Pt.layout.get("text-rotate").evaluate(jt,{})*Math.PI/180,Te=[],Ee=0,ue=ot.positionedLines;Ee<ue.length;Ee+=1)for(var we=ue[Ee],me=0,Ae=we.positionedGlyphs;me<Ae.length;me+=1){var pe=Ae[me];if(pe.rect){var ge=pe.rect||{},He=4,Ke=!0,gr=1,wr=0,Nr=(Ut||re)&&pe.vertical,Xr=pe.metrics.advance*pe.scale/2;if(re&&ot.verticalizable&&(wr=we.lineOffset/2-(pe.imageName?-(24-pe.metrics.width*pe.scale)/2:24*(pe.scale-1))),pe.imageName){var li=qt[pe.imageName];Ke=li.sdf,He=1/(gr=li.pixelRatio)}var ui=Ut?[pe.x+Xr,pe.y]:[0,0],Jr=Ut?[0,0]:[pe.x+Xr+ht[0],pe.y+ht[1]-wr],di=[0,0];Nr&&(di=Jr,Jr=[0,0]);var Qr=(pe.metrics.left-He)*pe.scale-Xr+Jr[0],mi=(-pe.metrics.top-He)*pe.scale+Jr[1],Cr=Qr+ge.w*pe.scale/gr,Or=mi+ge.h*pe.scale/gr,Vr=new F(Qr,mi),Mr=new F(Cr,mi),Ai=new F(Qr,Or),Ti=new F(Cr,Or);if(Nr){var Hr=new F(-Xr,Xr- -17),qr=-Math.PI/2,fi=12-Xr,or=new F(22-fi,-(pe.imageName?fi:0)),Mn=new(Function.prototype.bind.apply(F,[null].concat(di)));Vr._rotateAround(qr,Hr)._add(or)._add(Mn),Mr._rotateAround(qr,Hr)._add(or)._add(Mn),Ai._rotateAround(qr,Hr)._add(or)._add(Mn),Ti._rotateAround(qr,Hr)._add(or)._add(Mn)}if(Xt){var ki=Math.sin(Xt),an=Math.cos(Xt),vi=[an,-ki,ki,an];Vr._matMult(vi),Mr._matMult(vi),Ai._matMult(vi),Ti._matMult(vi)}var to=new F(0,0),Un=new F(0,0);Te.push({tl:Vr,tr:Mr,bl:Ai,br:Ti,tex:ge,writingMode:ot.writingMode,glyphOffset:ui,sectionIndex:pe.sectionIndex,isSDF:Ke,pixelOffsetTL:to,pixelOffsetBR:Un,minFontScaleX:0,minFontScaleY:0})}}return Te}(0,h,e,w,C,r,_,t.allowVerticalPlacement),G=t.textSizeData,V=null;G.kind==="source"?(V=[128*w.layout.get("text-size").evaluate(r,{})])[0]>32640&&Be(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):G.kind==="composite"&&((V=[128*M.compositeTextSizes[0].evaluate(r,{},z),128*M.compositeTextSizes[1].evaluate(r,{},z)])[0]>32640||V[1]>32640)&&Be(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,O,V,e,C,r,f,n,s.lineStartIndex,s.lineLength,E,z);for(var W=0,Y=y;W<Y.length;W+=1)b[Y[W]]=t.text.placedSymbolArray.length-1;return 4*O.length}function Nh(t){for(var n in t)return t[n];return null}function Ep(t,n,h,_){var w=t.compareText;if(n in w){for(var C=w[n],r=C.length-1;r>=0;r--)if(_.dist(C[r])<h)return!0}else w[n]=[];return w[n].push(_),!1}var Rg=Nc.VectorTileFeature.types,Dg=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Sp(t,n,h,_,w,C,r,e,s,f,y,b,E){var M=e?Math.min(32640,Math.round(e[0])):0,z=e?Math.min(32640,Math.round(e[1])):0;t.emplaceBack(n,h,Math.round(32*_),Math.round(32*w),C,r,(M<<1)+(s?1:0),z,16*f,16*y,256*b,256*E)}function Pf(t,n,h){t.emplaceBack(n.x,n.y,h),t.emplaceBack(n.x,n.y,h),t.emplaceBack(n.x,n.y,h),t.emplaceBack(n.x,n.y,h)}function Wc(t){for(var n=0,h=t.sections;n<h.length;n+=1)if(Ii(h[n].text))return!0;return!1}var du=function(t){this.layoutVertexArray=new Ft,this.indexArray=new _e,this.programConfigurations=t,this.segments=new ft,this.dynamicLayoutVertexArray=new bt,this.opacityVertexArray=new Ot,this.placedSymbolArray=new x};du.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},du.prototype.upload=function(t,n,h,_){this.isEmpty()||(h&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Tg.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,n),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Dd.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,Dg,!0),this.opacityVertexBuffer.itemSize=1),(h||_)&&this.programConfigurations.upload(t))},du.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},tr("SymbolBuffers",du);var $c=function(t,n,h){this.layoutVertexArray=new t,this.layoutAttributes=n,this.indexArray=new h,this.segments=new ft,this.collisionVertexArray=new Ht};$c.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,yf.members,!0)},$c.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},tr("CollisionBuffers",$c);var _i=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(C){return C.id}),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=vo([]),this.placementViewportMatrix=vo([]);var n=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Ef(this.zoom,n["text-size"]),this.iconSizeData=Ef(this.zoom,n["icon-size"]);var h=this.layers[0].layout,_=h.get("symbol-sort-key"),w=h.get("symbol-z-order");this.canOverlap=h.get("text-allow-overlap")||h.get("icon-allow-overlap")||h.get("text-ignore-placement")||h.get("icon-ignore-placement"),this.sortFeaturesByKey=w!=="viewport-y"&&_.constantOr(1)!==void 0,this.sortFeaturesByY=(w==="viewport-y"||w==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,h.get("symbol-placement")==="point"&&(this.writingModes=h.get("text-writing-mode").map(function(C){return ma[C]})),this.stateDependentLayerIds=this.layers.filter(function(C){return C.isStateDependent()}).map(function(C){return C.id}),this.sourceID=t.sourceID};_i.prototype.createArrays=function(){this.text=new du(new cr(this.layers,this.zoom,function(t){return/^text/.test(t)})),this.icon=new du(new cr(this.layers,this.zoom,function(t){return/^icon/.test(t)})),this.glyphOffsetArray=new R,this.lineVertexArray=new j,this.symbolInstances=new k},_i.prototype.calculateGlyphDependencies=function(t,n,h,_,w){for(var C=0;C<t.length;C++)if(n[t.charCodeAt(C)]=!0,(h||_)&&w){var r=qc[t.charAt(C)];r&&(n[r.charCodeAt(0)]=!0)}},_i.prototype.populate=function(t,n,h){var _=this.layers[0],w=_.layout,C=w.get("text-font"),r=w.get("text-field"),e=w.get("icon-image"),s=(r.value.kind!=="constant"||r.value.value instanceof si&&!r.value.value.isEmpty()||r.value.value.toString().length>0)&&(C.value.kind!=="constant"||C.value.value.length>0),f=e.value.kind!=="constant"||!!e.value.value||Object.keys(e.parameters).length>0,y=w.get("symbol-sort-key");if(this.features=[],s||f){for(var b=n.iconDependencies,E=n.glyphDependencies,M=n.availableImages,z=new Oe(this.zoom),O=0,G=t;O<G.length;O+=1){var V=G[O],W=V.feature,Y=V.id,H=V.index,ot=V.sourceLayerIndex,ht=_._featureFilter.needGeometry,Pt=Kr(W,ht);if(_._featureFilter.filter(z,Pt,h)){ht||(Pt.geometry=Xi(W));var Ut=void 0;if(s){var jt=_.getValueAndResolveTokens("text-field",Pt,h,M),qt=si.factory(jt);Wc(qt)&&(this.hasRTLText=!0),(!this.hasRTLText||No()==="unavailable"||this.hasRTLText&&er.isParsed())&&(Ut=Bd(qt,_,Pt))}var re=void 0;if(f){var Xt=_.getValueAndResolveTokens("icon-image",Pt,h,M);re=Xt instanceof Nn?Xt:Nn.fromString(Xt)}if(Ut||re){var Te=this.sortFeaturesByKey?y.evaluate(Pt,{},h):void 0;if(this.features.push({id:Y,text:Ut,icon:re,index:H,sourceLayerIndex:ot,geometry:Pt.geometry,properties:W.properties,type:Rg[W.type],sortKey:Te}),re&&(b[re.name]=!0),Ut){var Ee=C.evaluate(Pt,{},h).join(","),ue=w.get("text-rotation-alignment")==="map"&&w.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(ma.vertical)>=0;for(var we=0,me=Ut.sections;we<me.length;we+=1){var Ae=me[we];if(Ae.image)b[Ae.image.name]=!0;else{var pe=Sl(Ut.toString()),ge=Ae.fontStack||Ee,He=E[ge]=E[ge]||{};this.calculateGlyphDependencies(Ae.text,He,ue,this.allowVerticalPlacement,pe)}}}}}}w.get("symbol-placement")==="line"&&(this.features=function(Ke){var gr={},wr={},Nr=[],Xr=0;function li(Hr){Nr.push(Ke[Hr]),Xr++}function ui(Hr,qr,fi){var or=wr[Hr];return delete wr[Hr],wr[qr]=or,Nr[or].geometry[0].pop(),Nr[or].geometry[0]=Nr[or].geometry[0].concat(fi[0]),or}function Jr(Hr,qr,fi){var or=gr[qr];return delete gr[qr],gr[Hr]=or,Nr[or].geometry[0].shift(),Nr[or].geometry[0]=fi[0].concat(Nr[or].geometry[0]),or}function di(Hr,qr,fi){var or=fi?qr[0][qr[0].length-1]:qr[0][0];return Hr+":"+or.x+":"+or.y}for(var Qr=0;Qr<Ke.length;Qr++){var mi=Ke[Qr],Cr=mi.geometry,Or=mi.text?mi.text.toString():null;if(Or){var Vr=di(Or,Cr),Mr=di(Or,Cr,!0);if(Vr in wr&&Mr in gr&&wr[Vr]!==gr[Mr]){var Ai=Jr(Vr,Mr,Cr),Ti=ui(Vr,Mr,Nr[Ai].geometry);delete gr[Vr],delete wr[Mr],wr[di(Or,Nr[Ti].geometry,!0)]=Ti,Nr[Ai].geometry=null}else Vr in wr?ui(Vr,Mr,Cr):Mr in gr?Jr(Vr,Mr,Cr):(li(Qr),gr[Vr]=Xr-1,wr[Mr]=Xr-1)}else li(Qr)}return Nr.filter(function(Hr){return Hr.geometry})}(this.features)),this.sortFeaturesByKey&&this.features.sort(function(Ke,gr){return Ke.sortKey-gr.sortKey})}},_i.prototype.update=function(t,n,h){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,n,this.layers,h),this.icon.programConfigurations.updatePaintArrays(t,n,this.layers,h))},_i.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},_i.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},_i.prototype.upload=function(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},_i.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},_i.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},_i.prototype.addToLineVertexArray=function(t,n){var h=this.lineVertexArray.length;if(t.segment!==void 0){for(var _=t.dist(n[t.segment+1]),w=t.dist(n[t.segment]),C={},r=t.segment+1;r<n.length;r++)C[r]={x:n[r].x,y:n[r].y,tileUnitDistanceFromAnchor:_},r<n.length-1&&(_+=n[r+1].dist(n[r]));for(var e=t.segment||0;e>=0;e--)C[e]={x:n[e].x,y:n[e].y,tileUnitDistanceFromAnchor:w},e>0&&(w+=n[e-1].dist(n[e]));for(var s=0;s<n.length;s++){var f=C[s];this.lineVertexArray.emplaceBack(f.x,f.y,f.tileUnitDistanceFromAnchor)}}return{lineStartIndex:h,lineLength:this.lineVertexArray.length-h}},_i.prototype.addSymbols=function(t,n,h,_,w,C,r,e,s,f,y,b){for(var E=t.indexArray,M=t.layoutVertexArray,z=t.segments.prepareSegment(4*n.length,M,E,this.canOverlap?C.sortKey:void 0),O=this.glyphOffsetArray.length,G=z.vertexLength,V=this.allowVerticalPlacement&&r===ma.vertical?Math.PI/2:0,W=C.text&&C.text.sections,Y=0;Y<n.length;Y++){var H=n[Y],ot=H.tl,ht=H.tr,Pt=H.bl,Ut=H.br,jt=H.tex,qt=H.pixelOffsetTL,re=H.pixelOffsetBR,Xt=H.minFontScaleX,Te=H.minFontScaleY,Ee=H.glyphOffset,ue=H.isSDF,we=H.sectionIndex,me=z.vertexLength,Ae=Ee[1];Sp(M,e.x,e.y,ot.x,Ae+ot.y,jt.x,jt.y,h,ue,qt.x,qt.y,Xt,Te),Sp(M,e.x,e.y,ht.x,Ae+ht.y,jt.x+jt.w,jt.y,h,ue,re.x,qt.y,Xt,Te),Sp(M,e.x,e.y,Pt.x,Ae+Pt.y,jt.x,jt.y+jt.h,h,ue,qt.x,re.y,Xt,Te),Sp(M,e.x,e.y,Ut.x,Ae+Ut.y,jt.x+jt.w,jt.y+jt.h,h,ue,re.x,re.y,Xt,Te),Pf(t.dynamicLayoutVertexArray,e,V),E.emplaceBack(me,me+1,me+2),E.emplaceBack(me+1,me+2,me+3),z.vertexLength+=4,z.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Ee[0]),Y!==n.length-1&&we===n[Y+1].sectionIndex||t.programConfigurations.populatePaintArrays(M.length,C,C.index,{},b,W&&W[we])}t.placedSymbolArray.emplaceBack(e.x,e.y,O,this.glyphOffsetArray.length-O,G,s,f,e.segment,h?h[0]:0,h?h[1]:0,_[0],_[1],r,0,!1,0,y)},_i.prototype._addCollisionDebugVertex=function(t,n,h,_,w,C){return n.emplaceBack(0,0),t.emplaceBack(h.x,h.y,_,w,Math.round(C.x),Math.round(C.y))},_i.prototype.addCollisionDebugVertices=function(t,n,h,_,w,C,r){var e=w.segments.prepareSegment(4,w.layoutVertexArray,w.indexArray),s=e.vertexLength,f=w.layoutVertexArray,y=w.collisionVertexArray,b=r.anchorX,E=r.anchorY;this._addCollisionDebugVertex(f,y,C,b,E,new F(t,n)),this._addCollisionDebugVertex(f,y,C,b,E,new F(h,n)),this._addCollisionDebugVertex(f,y,C,b,E,new F(h,_)),this._addCollisionDebugVertex(f,y,C,b,E,new F(t,_)),e.vertexLength+=4;var M=w.indexArray;M.emplaceBack(s,s+1),M.emplaceBack(s+1,s+2),M.emplaceBack(s+2,s+3),M.emplaceBack(s+3,s),e.primitiveLength+=4},_i.prototype.addDebugCollisionBoxes=function(t,n,h,_){for(var w=t;w<n;w++){var C=this.collisionBoxArray.get(w);this.addCollisionDebugVertices(C.x1,C.y1,C.x2,C.y2,_?this.textCollisionBox:this.iconCollisionBox,C.anchorPoint,h)}},_i.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new $c(Wt,Od.members,ar),this.iconCollisionBox=new $c(Wt,Od.members,ar);for(var t=0;t<this.symbolInstances.length;t++){var n=this.symbolInstances.get(t);this.addDebugCollisionBoxes(n.textBoxStartIndex,n.textBoxEndIndex,n,!0),this.addDebugCollisionBoxes(n.verticalTextBoxStartIndex,n.verticalTextBoxEndIndex,n,!0),this.addDebugCollisionBoxes(n.iconBoxStartIndex,n.iconBoxEndIndex,n,!1),this.addDebugCollisionBoxes(n.verticalIconBoxStartIndex,n.verticalIconBoxEndIndex,n,!1)}},_i.prototype._deserializeCollisionBoxesForSymbol=function(t,n,h,_,w,C,r,e,s){for(var f={},y=n;y<h;y++){var b=t.get(y);f.textBox={x1:b.x1,y1:b.y1,x2:b.x2,y2:b.y2,anchorPointX:b.anchorPointX,anchorPointY:b.anchorPointY},f.textFeatureIndex=b.featureIndex;break}for(var E=_;E<w;E++){var M=t.get(E);f.verticalTextBox={x1:M.x1,y1:M.y1,x2:M.x2,y2:M.y2,anchorPointX:M.anchorPointX,anchorPointY:M.anchorPointY},f.verticalTextFeatureIndex=M.featureIndex;break}for(var z=C;z<r;z++){var O=t.get(z);f.iconBox={x1:O.x1,y1:O.y1,x2:O.x2,y2:O.y2,anchorPointX:O.anchorPointX,anchorPointY:O.anchorPointY},f.iconFeatureIndex=O.featureIndex;break}for(var G=e;G<s;G++){var V=t.get(G);f.verticalIconBox={x1:V.x1,y1:V.y1,x2:V.x2,y2:V.y2,anchorPointX:V.anchorPointX,anchorPointY:V.anchorPointY},f.verticalIconFeatureIndex=V.featureIndex;break}return f},_i.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var n=0;n<this.symbolInstances.length;n++){var h=this.symbolInstances.get(n);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,h.textBoxStartIndex,h.textBoxEndIndex,h.verticalTextBoxStartIndex,h.verticalTextBoxEndIndex,h.iconBoxStartIndex,h.iconBoxEndIndex,h.verticalIconBoxStartIndex,h.verticalIconBoxEndIndex))}},_i.prototype.hasTextData=function(){return this.text.segments.get().length>0},_i.prototype.hasIconData=function(){return this.icon.segments.get().length>0},_i.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},_i.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},_i.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},_i.prototype.addIndicesForPlacedSymbol=function(t,n){for(var h=t.placedSymbolArray.get(n),_=h.vertexStartIndex+4*h.numGlyphs,w=h.vertexStartIndex;w<_;w+=4)t.indexArray.emplaceBack(w,w+1,w+2),t.indexArray.emplaceBack(w+1,w+2,w+3)},_i.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var n=Math.sin(t),h=Math.cos(t),_=[],w=[],C=[],r=0;r<this.symbolInstances.length;++r){C.push(r);var e=this.symbolInstances.get(r);_.push(0|Math.round(n*e.anchorX+h*e.anchorY)),w.push(e.featureIndex)}return C.sort(function(s,f){return _[s]-_[f]||w[f]-w[s]}),C},_i.prototype.addToSortKeyRanges=function(t,n){var h=this.sortKeyRanges[this.sortKeyRanges.length-1];h&&h.sortKey===n?h.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:n,symbolInstanceStart:t,symbolInstanceEnd:t+1})},_i.prototype.sortFeatures=function(t){var n=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var h=0,_=this.symbolInstanceIndexes;h<_.length;h+=1){var w=this.symbolInstances.get(_[h]);this.featureSortOrder.push(w.featureIndex),[w.rightJustifiedTextSymbolIndex,w.centerJustifiedTextSymbolIndex,w.leftJustifiedTextSymbolIndex].forEach(function(C,r,e){C>=0&&e.indexOf(C)===r&&n.addIndicesForPlacedSymbol(n.text,C)}),w.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,w.verticalPlacedTextSymbolIndex),w.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,w.placedIconSymbolIndex),w.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,w.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},tr("SymbolBucket",_i,{omit:["layers","collisionBoxArray","features","compareText"]}),_i.MAX_GLYPHS=65535,_i.addDynamicAttributes=Pf;var Og=new T({"symbol-placement":new je(dt.layout_symbol["symbol-placement"]),"symbol-spacing":new je(dt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new je(dt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ve(dt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new je(dt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new je(dt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new je(dt.layout_symbol["icon-ignore-placement"]),"icon-optional":new je(dt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new je(dt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ve(dt.layout_symbol["icon-size"]),"icon-text-fit":new je(dt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new je(dt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ve(dt.layout_symbol["icon-image"]),"icon-rotate":new Ve(dt.layout_symbol["icon-rotate"]),"icon-padding":new je(dt.layout_symbol["icon-padding"]),"icon-keep-upright":new je(dt.layout_symbol["icon-keep-upright"]),"icon-offset":new Ve(dt.layout_symbol["icon-offset"]),"icon-anchor":new Ve(dt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new je(dt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new je(dt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new je(dt.layout_symbol["text-rotation-alignment"]),"text-field":new Ve(dt.layout_symbol["text-field"]),"text-font":new Ve(dt.layout_symbol["text-font"]),"text-size":new Ve(dt.layout_symbol["text-size"]),"text-max-width":new Ve(dt.layout_symbol["text-max-width"]),"text-line-height":new je(dt.layout_symbol["text-line-height"]),"text-letter-spacing":new Ve(dt.layout_symbol["text-letter-spacing"]),"text-justify":new Ve(dt.layout_symbol["text-justify"]),"text-radial-offset":new Ve(dt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new je(dt.layout_symbol["text-variable-anchor"]),"text-anchor":new Ve(dt.layout_symbol["text-anchor"]),"text-max-angle":new je(dt.layout_symbol["text-max-angle"]),"text-writing-mode":new je(dt.layout_symbol["text-writing-mode"]),"text-rotate":new Ve(dt.layout_symbol["text-rotate"]),"text-padding":new je(dt.layout_symbol["text-padding"]),"text-keep-upright":new je(dt.layout_symbol["text-keep-upright"]),"text-transform":new Ve(dt.layout_symbol["text-transform"]),"text-offset":new Ve(dt.layout_symbol["text-offset"]),"text-allow-overlap":new je(dt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new je(dt.layout_symbol["text-ignore-placement"]),"text-optional":new je(dt.layout_symbol["text-optional"])}),Qs={paint:new T({"icon-opacity":new Ve(dt.paint_symbol["icon-opacity"]),"icon-color":new Ve(dt.paint_symbol["icon-color"]),"icon-halo-color":new Ve(dt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ve(dt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ve(dt.paint_symbol["icon-halo-blur"]),"icon-translate":new je(dt.paint_symbol["icon-translate"]),"icon-translate-anchor":new je(dt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ve(dt.paint_symbol["text-opacity"]),"text-color":new Ve(dt.paint_symbol["text-color"],{runtimeType:Ct,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new Ve(dt.paint_symbol["text-halo-color"]),"text-halo-width":new Ve(dt.paint_symbol["text-halo-width"]),"text-halo-blur":new Ve(dt.paint_symbol["text-halo-blur"]),"text-translate":new je(dt.paint_symbol["text-translate"]),"text-translate-anchor":new je(dt.paint_symbol["text-translate-anchor"])}),layout:Og},nc=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:gt,this.defaultValue=t};nc.prototype.evaluate=function(t){if(t.formattedSection){var n=this.defaultValue.property.overrides;if(n&&n.hasOverride(t.formattedSection))return n.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},nc.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},nc.prototype.outputDefined=function(){return!1},nc.prototype.serialize=function(){return null},tr("FormatSectionOverride",nc,{omit:["defaultValue"]});var Yd=function(t){function n(h){t.call(this,h,Qs)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.recalculate=function(h,_){if(t.prototype.recalculate.call(this,h,_),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var w=this.layout.get("text-writing-mode");if(w){for(var C=[],r=0,e=w;r<e.length;r+=1){var s=e[r];C.indexOf(s)<0&&C.push(s)}this.layout._values["text-writing-mode"]=C}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},n.prototype.getValueAndResolveTokens=function(h,_,w,C){var r=this.layout.get(h).evaluate(_,{},w,C),e=this._unevaluatedLayout._values[h];return e.isDataDriven()||ws(e.value)||!r?r:function(s,f){return f.replace(/{([^{}]+)}/g,function(y,b){return b in s?String(s[b]):""})}(_.properties,r)},n.prototype.createBucket=function(h){return new _i(h)},n.prototype.queryRadius=function(){return 0},n.prototype.queryIntersectsFeature=function(){return!1},n.prototype._setPaintOverrides=function(){for(var h=0,_=Qs.paint.overridableProperties;h<_.length;h+=1){var w=_[h];if(n.hasPaintOverride(this.layout,w)){var C,r=this.paint.get(w),e=new nc(r),s=new Ca(e,r.property.specification);C=r.value.kind==="constant"||r.value.kind==="source"?new Ja("source",s):new Aa("composite",s,r.value.zoomStops,r.value._interpolationType),this.paint._values[w]=new Jn(r.property,C,r.parameters)}}},n.prototype._handleOverridablePaintPropertyUpdate=function(h,_,w){return!(!this.layout||_.isDataDriven()||w.isDataDriven())&&n.hasPaintOverride(this.layout,h)},n.hasPaintOverride=function(h,_){var w=h.get("text-field"),C=Qs.paint.properties[_],r=!1,e=function(y){for(var b=0,E=y;b<E.length;b+=1)if(C.overrides&&C.overrides.hasOverride(E[b]))return void(r=!0)};if(w.value.kind==="constant"&&w.value.value instanceof si)e(w.value.value.sections);else if(w.value.kind==="source"){var s=function(y){r||(y instanceof Wn&&Yi(y.value)===De?e(y.value.sections):y instanceof Mo?e(y.sections):y.eachChild(s))},f=w.value;f._styleExpression&&s(f._styleExpression.expression)}return r},n}(a),Fg={paint:new T({"background-color":new je(dt.paint_background["background-color"]),"background-pattern":new cn(dt.paint_background["background-pattern"]),"background-opacity":new je(dt.paint_background["background-opacity"])})},Bg=function(t){function n(h){t.call(this,h,Fg)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n}(a),Ug={paint:new T({"raster-opacity":new je(dt.paint_raster["raster-opacity"]),"raster-hue-rotate":new je(dt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new je(dt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new je(dt.paint_raster["raster-brightness-max"]),"raster-saturation":new je(dt.paint_raster["raster-saturation"]),"raster-contrast":new je(dt.paint_raster["raster-contrast"]),"raster-resampling":new je(dt.paint_raster["raster-resampling"]),"raster-fade-duration":new je(dt.paint_raster["raster-fade-duration"])})},Tp=function(t){function n(h){t.call(this,h,Ug)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n}(a),Mf=function(t){function n(h){t.call(this,h,{}),this.implementation=h}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.is3D=function(){return this.implementation.renderingMode==="3d"},n.prototype.hasOffscreenPass=function(){return this.implementation.prerender!==void 0},n.prototype.recalculate=function(){},n.prototype.updateTransitions=function(){},n.prototype.hasTransition=function(){},n.prototype.serialize=function(){},n.prototype.onAdd=function(h){this.implementation.onAdd&&this.implementation.onAdd(h,h.painter.context.gl)},n.prototype.onRemove=function(h){this.implementation.onRemove&&this.implementation.onRemove(h,h.painter.context.gl)},n}(a),Ng={circle:cp,heatmap:wh,hillshade:Pd,fill:df,"fill-extrusion":vg,line:Sg,symbol:Yd,background:Bg,raster:Tp},Ip=N.HTMLImageElement,Cp=N.HTMLCanvasElement,oc=N.HTMLVideoElement,Hd=N.ImageData,Kc=N.ImageBitmap,mu=function(t,n,h,_){this.context=t,this.format=h,this.texture=t.gl.createTexture(),this.update(n,_)};mu.prototype.update=function(t,n,h){var _=t.width,w=t.height,C=!(this.size&&this.size[0]===_&&this.size[1]===w||h),r=this.context,e=r.gl;if(this.useMipmap=Boolean(n&&n.useMipmap),e.bindTexture(e.TEXTURE_2D,this.texture),r.pixelStoreUnpackFlipY.set(!1),r.pixelStoreUnpack.set(1),r.pixelStoreUnpackPremultiplyAlpha.set(this.format===e.RGBA&&(!n||n.premultiply!==!1)),C)this.size=[_,w],t instanceof Ip||t instanceof Cp||t instanceof oc||t instanceof Hd||Kc&&t instanceof Kc?e.texImage2D(e.TEXTURE_2D,0,this.format,this.format,e.UNSIGNED_BYTE,t):e.texImage2D(e.TEXTURE_2D,0,this.format,_,w,0,this.format,e.UNSIGNED_BYTE,t.data);else{var s=h||{x:0,y:0},f=s.x,y=s.y;t instanceof Ip||t instanceof Cp||t instanceof oc||t instanceof Hd||Kc&&t instanceof Kc?e.texSubImage2D(e.TEXTURE_2D,0,f,y,e.RGBA,e.UNSIGNED_BYTE,t):e.texSubImage2D(e.TEXTURE_2D,0,f,y,_,w,e.RGBA,e.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&e.generateMipmap(e.TEXTURE_2D)},mu.prototype.bind=function(t,n,h){var _=this.context.gl;_.bindTexture(_.TEXTURE_2D,this.texture),h!==_.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(h=_.LINEAR),t!==this.filter&&(_.texParameteri(_.TEXTURE_2D,_.TEXTURE_MAG_FILTER,t),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_MIN_FILTER,h||t),this.filter=t),n!==this.wrap&&(_.texParameteri(_.TEXTURE_2D,_.TEXTURE_WRAP_S,n),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_WRAP_T,n),this.wrap=n)},mu.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},mu.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Yc=function(t){var n=this;this._callback=t,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){n._triggered=!1,n._callback()})};Yc.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(function(){t._triggered=!1,t._callback()},0))},Yc.prototype.remove=function(){delete this._channel,this._callback=function(){}};var gu=function(t,n,h){this.target=t,this.parent=n,this.mapId=h,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},ce(["receive","process"],this),this.invoker=new Yc(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Ce()?t:N};function Jd(t,n,h){var _=2*Math.PI*6378137/256/Math.pow(2,h);return[t*_-2*Math.PI*6378137/2,n*_-2*Math.PI*6378137/2]}gu.prototype.send=function(t,n,h,_,w){var C=this;w===void 0&&(w=!1);var r=Math.round(1e18*Math.random()).toString(36).substring(0,10);h&&(this.callbacks[r]=h);var e=_r(this.globalScope)?void 0:[];return this.target.postMessage({id:r,type:t,hasCallback:!!h,targetMapId:_,mustQueue:w,sourceMapId:this.mapId,data:Ro(n,e)},e),{cancel:function(){h&&delete C.callbacks[r],C.target.postMessage({id:r,type:"<cancel>",targetMapId:_,sourceMapId:C.mapId})}}},gu.prototype.receive=function(t){var n=t.data,h=n.id;if(h&&(!n.targetMapId||this.mapId===n.targetMapId))if(n.type==="<cancel>"){delete this.tasks[h];var _=this.cancelCallbacks[h];delete this.cancelCallbacks[h],_&&_()}else Ce()||n.mustQueue?(this.tasks[h]=n,this.taskQueue.push(h),this.invoker.trigger()):this.processTask(h,n)},gu.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),n=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),n&&this.processTask(t,n)}},gu.prototype.processTask=function(t,n){var h=this;if(n.type==="<response>"){var _=this.callbacks[t];delete this.callbacks[t],_&&(n.error?_(Mi(n.error)):_(null,Mi(n.data)))}else{var w=!1,C=_r(this.globalScope)?void 0:[],r=n.hasCallback?function(y,b){w=!0,delete h.cancelCallbacks[t],h.target.postMessage({id:t,type:"<response>",sourceMapId:h.mapId,error:y?Ro(y):null,data:Ro(b,C)},C)}:function(y){w=!0},e=null,s=Mi(n.data);if(this.parent[n.type])e=this.parent[n.type](n.sourceMapId,s,r);else if(this.parent.getWorkerSource){var f=n.type.split(".");e=this.parent.getWorkerSource(n.sourceMapId,f[0],s.source)[f[1]](s,r)}else r(new Error("Could not find function "+n.type));!w&&e&&e.cancel&&(this.cancelCallbacks[t]=e.cancel)}},gu.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Pn=function(t,n){t&&(n?this.setSouthWest(t).setNorthEast(n):t.length===4?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Pn.prototype.setNorthEast=function(t){return this._ne=t instanceof Ni?new Ni(t.lng,t.lat):Ni.convert(t),this},Pn.prototype.setSouthWest=function(t){return this._sw=t instanceof Ni?new Ni(t.lng,t.lat):Ni.convert(t),this},Pn.prototype.extend=function(t){var n,h,_=this._sw,w=this._ne;if(t instanceof Ni)n=t,h=t;else{if(!(t instanceof Pn))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(Pn.convert(t)):this.extend(Ni.convert(t)):this;if(h=t._ne,!(n=t._sw)||!h)return this}return _||w?(_.lng=Math.min(n.lng,_.lng),_.lat=Math.min(n.lat,_.lat),w.lng=Math.max(h.lng,w.lng),w.lat=Math.max(h.lat,w.lat)):(this._sw=new Ni(n.lng,n.lat),this._ne=new Ni(h.lng,h.lat)),this},Pn.prototype.getCenter=function(){return new Ni((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Pn.prototype.getSouthWest=function(){return this._sw},Pn.prototype.getNorthEast=function(){return this._ne},Pn.prototype.getNorthWest=function(){return new Ni(this.getWest(),this.getNorth())},Pn.prototype.getSouthEast=function(){return new Ni(this.getEast(),this.getSouth())},Pn.prototype.getWest=function(){return this._sw.lng},Pn.prototype.getSouth=function(){return this._sw.lat},Pn.prototype.getEast=function(){return this._ne.lng},Pn.prototype.getNorth=function(){return this._ne.lat},Pn.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Pn.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Pn.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Pn.prototype.contains=function(t){var n=Ni.convert(t),h=n.lng,_=n.lat,w=this._sw.lng<=h&&h<=this._ne.lng;return this._sw.lng>this._ne.lng&&(w=this._sw.lng>=h&&h>=this._ne.lng),this._sw.lat<=_&&_<=this._ne.lat&&w},Pn.convert=function(t){return!t||t instanceof Pn?t:new Pn(t)};var Ni=function(t,n){if(isNaN(t)||isNaN(n))throw new Error("Invalid LngLat object: ("+t+", "+n+")");if(this.lng=+t,this.lat=+n,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Ni.prototype.wrap=function(){return new Ni(Vt(this.lng,-180,180),this.lat)},Ni.prototype.toArray=function(){return[this.lng,this.lat]},Ni.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Ni.prototype.distanceTo=function(t){var n=Math.PI/180,h=this.lat*n,_=t.lat*n,w=Math.sin(h)*Math.sin(_)+Math.cos(h)*Math.cos(_)*Math.cos((t.lng-this.lng)*n);return 63710088e-1*Math.acos(Math.min(w,1))},Ni.prototype.toBounds=function(t){t===void 0&&(t=0);var n=360*t/40075017,h=n/Math.cos(Math.PI/180*this.lat);return new Pn(new Ni(this.lng-h,this.lat-n),new Ni(this.lng+h,this.lat+n))},Ni.convert=function(t){if(t instanceof Ni)return t;if(Array.isArray(t)&&(t.length===2||t.length===3))return new Ni(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&typeof t=="object"&&t!==null)return new Ni(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var Qd=2*Math.PI*63710088e-1;function tm(t){return Qd*Math.cos(t*Math.PI/180)}function Lf(t){return(180+t)/360}function pn(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function yu(t,n){return t/tm(n)}function Ap(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var _u=function(t,n,h){h===void 0&&(h=0),this.x=+t,this.y=+n,this.z=+h};_u.fromLngLat=function(t,n){n===void 0&&(n=0);var h=Ni.convert(t);return new _u(Lf(h.lng),pn(h.lat),yu(n,h.lat))},_u.prototype.toLngLat=function(){return new Ni(360*this.x-180,Ap(this.y))},_u.prototype.toAltitude=function(){return this.z*tm(Ap(this.y))},_u.prototype.meterInMercatorCoordinateUnits=function(){return 1/Qd*(t=Ap(this.y),1/Math.cos(t*Math.PI/180));var t};var vu=function(t,n,h){this.z=t,this.x=n,this.y=h,this.key=ac(0,t,t,n,h)};vu.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},vu.prototype.url=function(t,n){var h,_,w,C,r,e=(_=this.y,w=this.z,C=Jd(256*(h=this.x),256*(_=Math.pow(2,w)-_-1),w),r=Jd(256*(h+1),256*(_+1),w),C[0]+","+C[1]+","+r[0]+","+r[1]),s=function(f,y,b){for(var E,M="",z=f;z>0;z--)M+=(y&(E=1<<z-1)?1:0)+(b&E?2:0);return M}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(n==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",s).replace("{bbox-epsg-3857}",e)},vu.prototype.getTilePoint=function(t){var n=Math.pow(2,this.z);return new F(8192*(t.x*n-this.x),8192*(t.y*n-this.y))},vu.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var kf=function(t,n){this.wrap=t,this.canonical=n,this.key=ac(t,n.z,n.z,n.x,n.y)},yn=function(t,n,h,_,w){this.overscaledZ=t,this.wrap=n,this.canonical=new vu(h,+_,+w),this.key=ac(n,t,h,_,w)};function ac(t,n,h,_,w){(t*=2)<0&&(t=-1*t-1);var C=1<<h;return(C*C*t+C*w+_).toString(36)+h.toString(36)+n.toString(36)}yn.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},yn.prototype.scaledTo=function(t){var n=this.canonical.z-t;return t>this.canonical.z?new yn(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new yn(t,this.wrap,t,this.canonical.x>>n,this.canonical.y>>n)},yn.prototype.calculateScaledKey=function(t,n){var h=this.canonical.z-t;return t>this.canonical.z?ac(this.wrap*+n,t,this.canonical.z,this.canonical.x,this.canonical.y):ac(this.wrap*+n,t,t,this.canonical.x>>h,this.canonical.y>>h)},yn.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var n=this.canonical.z-t.canonical.z;return t.overscaledZ===0||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>n&&t.canonical.y===this.canonical.y>>n},yn.prototype.children=function(t){if(this.overscaledZ>=t)return[new yn(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var n=this.canonical.z+1,h=2*this.canonical.x,_=2*this.canonical.y;return[new yn(n,this.wrap,n,h,_),new yn(n,this.wrap,n,h+1,_),new yn(n,this.wrap,n,h,_+1),new yn(n,this.wrap,n,h+1,_+1)]},yn.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},yn.prototype.wrapped=function(){return new yn(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},yn.prototype.unwrapTo=function(t){return new yn(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},yn.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},yn.prototype.toUnwrapped=function(){return new kf(this.wrap,this.canonical)},yn.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},yn.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new _u(t.x-this.wrap,t.y))},tr("CanonicalTileID",vu),tr("OverscaledTileID",yn,{omit:["posMatrix"]});var is=function(t,n,h){if(this.uid=t,n.height!==n.width)throw new RangeError("DEM tiles must be square");if(h&&h!=="mapbox"&&h!=="terrarium")return Be('"'+h+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=n.height;var _=this.dim=n.height-2;this.data=new Uint32Array(n.data.buffer),this.encoding=h||"mapbox";for(var w=0;w<_;w++)this.data[this._idx(-1,w)]=this.data[this._idx(0,w)],this.data[this._idx(_,w)]=this.data[this._idx(_-1,w)],this.data[this._idx(w,-1)]=this.data[this._idx(w,0)],this.data[this._idx(w,_)]=this.data[this._idx(w,_-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(_,-1)]=this.data[this._idx(_-1,0)],this.data[this._idx(-1,_)]=this.data[this._idx(0,_-1)],this.data[this._idx(_,_)]=this.data[this._idx(_-1,_-1)]};is.prototype.get=function(t,n){var h=new Uint8Array(this.data.buffer),_=4*this._idx(t,n);return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(h[_],h[_+1],h[_+2])},is.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},is.prototype._idx=function(t,n){if(t<-1||t>=this.dim+1||n<-1||n>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(n+1)*this.stride+(t+1)},is.prototype._unpackMapbox=function(t,n,h){return(256*t*256+256*n+h)/10-1e4},is.prototype._unpackTerrarium=function(t,n,h){return 256*t+n+h/256-32768},is.prototype.getPixels=function(){return new xo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},is.prototype.backfillBorder=function(t,n,h){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var _=n*this.dim,w=n*this.dim+this.dim,C=h*this.dim,r=h*this.dim+this.dim;switch(n){case-1:_=w-1;break;case 1:w=_+1}switch(h){case-1:C=r-1;break;case 1:r=C+1}for(var e=-n*this.dim,s=-h*this.dim,f=C;f<r;f++)for(var y=_;y<w;y++)this.data[this._idx(y,f)]=t.data[this._idx(y+e,f+s)]},tr("DEMData",is);var Vh=function(t){this._stringToNumber={},this._numberToString=[];for(var n=0;n<t.length;n++){var h=t[n];this._stringToNumber[h]=n,this._numberToString[n]=h}};Vh.prototype.encode=function(t){return this._stringToNumber[t]},Vh.prototype.decode=function(t){return this._numberToString[t]};var Hc=function(t,n,h,_,w){this.type="Feature",this._vectorTileFeature=t,t._z=n,t._x=h,t._y=_,this.properties=t.properties,this.id=w},Pp={geometry:{configurable:!0}};Pp.geometry.get=function(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},Pp.geometry.set=function(t){this._geometry=t},Hc.prototype.toJSON=function(){var t={geometry:this.geometry};for(var n in this)n!=="_geometry"&&n!=="_vectorTileFeature"&&(t[n]=this[n]);return t},Object.defineProperties(Hc.prototype,Pp);var Oo=function(){this.state={},this.stateChanges={},this.deletedStates={}};Oo.prototype.updateState=function(t,n,h){var _=String(n);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][_]=this.stateChanges[t][_]||{},wt(this.stateChanges[t][_],h),this.deletedStates[t]===null)for(var w in this.deletedStates[t]={},this.state[t])w!==_&&(this.deletedStates[t][w]=null);else if(this.deletedStates[t]&&this.deletedStates[t][_]===null)for(var C in this.deletedStates[t][_]={},this.state[t][_])h[C]||(this.deletedStates[t][_][C]=null);else for(var r in h)this.deletedStates[t]&&this.deletedStates[t][_]&&this.deletedStates[t][_][r]===null&&delete this.deletedStates[t][_][r]},Oo.prototype.removeFeatureState=function(t,n,h){if(this.deletedStates[t]!==null){var _=String(n);if(this.deletedStates[t]=this.deletedStates[t]||{},h&&n!==void 0)this.deletedStates[t][_]!==null&&(this.deletedStates[t][_]=this.deletedStates[t][_]||{},this.deletedStates[t][_][h]=null);else if(n!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][_])for(h in this.deletedStates[t][_]={},this.stateChanges[t][_])this.deletedStates[t][_][h]=null;else this.deletedStates[t][_]=null;else this.deletedStates[t]=null}},Oo.prototype.getState=function(t,n){var h=String(n),_=wt({},(this.state[t]||{})[h],(this.stateChanges[t]||{})[h]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){var w=this.deletedStates[t][n];if(w===null)return{};for(var C in w)delete _[C]}return _},Oo.prototype.initializeTileState=function(t,n){t.setFeatureState(this.state,n)},Oo.prototype.coalesceChanges=function(t,n){var h={};for(var _ in this.stateChanges){this.state[_]=this.state[_]||{};var w={};for(var C in this.stateChanges[_])this.state[_][C]||(this.state[_][C]={}),wt(this.state[_][C],this.stateChanges[_][C]),w[C]=this.state[_][C];h[_]=w}for(var r in this.deletedStates){this.state[r]=this.state[r]||{};var e={};if(this.deletedStates[r]===null)for(var s in this.state[r])e[s]={},this.state[r][s]={};else for(var f in this.deletedStates[r]){if(this.deletedStates[r][f]===null)this.state[r][f]={};else for(var y=0,b=Object.keys(this.deletedStates[r][f]);y<b.length;y+=1)delete this.state[r][f][b[y]];e[f]=this.state[r][f]}h[r]=h[r]||{},wt(h[r],e)}if(this.stateChanges={},this.deletedStates={},Object.keys(h).length!==0)for(var E in t)t[E].setFeatureState(h,n)};var Ba=function(t,n){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new ka(8192,16,0),this.grid3D=new ka(8192,16,0),this.featureIndexArray=new tt,this.promoteId=n};function zf(t,n,h,_,w){return ye(t,function(C,r){var e=n instanceof Ra?n.get(r):null;return e&&e.evaluate?e.evaluate(h,_,w):e})}function Rf(t){for(var n=1/0,h=1/0,_=-1/0,w=-1/0,C=0,r=t;C<r.length;C+=1){var e=r[C];n=Math.min(n,e.x),h=Math.min(h,e.y),_=Math.max(_,e.x),w=Math.max(w,e.y)}return{minX:n,minY:h,maxX:_,maxY:w}}function em(t,n){return n-t}Ba.prototype.insert=function(t,n,h,_,w,C){var r=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(h,_,w);for(var e=C?this.grid3D:this.grid,s=0;s<n.length;s++){for(var f=n[s],y=[1/0,1/0,-1/0,-1/0],b=0;b<f.length;b++){var E=f[b];y[0]=Math.min(y[0],E.x),y[1]=Math.min(y[1],E.y),y[2]=Math.max(y[2],E.x),y[3]=Math.max(y[3],E.y)}y[0]<8192&&y[1]<8192&&y[2]>=0&&y[3]>=0&&e.insert(r,y[0],y[1],y[2],y[3])}},Ba.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Nc.VectorTile(new gp(this.rawTileData)).layers,this.sourceLayerCoder=new Vh(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Ba.prototype.query=function(t,n,h,_){var w=this;this.loadVTLayers();for(var C=t.params||{},r=8192/t.tileSize/t.scale,e=wl(C.filter),s=t.queryGeometry,f=t.queryPadding*r,y=Rf(s),b=this.grid.query(y.minX-f,y.minY-f,y.maxX+f,y.maxY+f),E=Rf(t.cameraQueryGeometry),M=this.grid3D.query(E.minX-f,E.minY-f,E.maxX+f,E.maxY+f,function(H,ot,ht,Pt){return function(Ut,jt,qt,re,Xt){for(var Te=0,Ee=Ut;Te<Ee.length;Te+=1){var ue=Ee[Te];if(jt<=ue.x&&qt<=ue.y&&re>=ue.x&&Xt>=ue.y)return!0}var we=[new F(jt,qt),new F(jt,Xt),new F(re,Xt),new F(re,qt)];if(Ut.length>2){for(var me=0,Ae=we;me<Ae.length;me+=1)if(es(Ut,Ae[me]))return!0}for(var pe=0;pe<Ut.length-1;pe++)if(Al(Ut[pe],Ut[pe+1],we))return!0;return!1}(t.cameraQueryGeometry,H-f,ot-f,ht+f,Pt+f)}),z=0,O=M;z<O.length;z+=1)b.push(O[z]);b.sort(em);for(var G,V={},W=function(H){var ot=b[H];if(ot!==G){G=ot;var ht=w.featureIndexArray.get(ot),Pt=null;w.loadMatchingFeature(V,ht.bucketIndex,ht.sourceLayerIndex,ht.featureIndex,e,C.layers,C.availableImages,n,h,_,function(Ut,jt,qt){return Pt||(Pt=Xi(Ut)),jt.queryIntersectsFeature(s,Ut,qt,Pt,w.z,t.transform,r,t.pixelPosMatrix)})}},Y=0;Y<b.length;Y++)W(Y);return V},Ba.prototype.loadMatchingFeature=function(t,n,h,_,w,C,r,e,s,f,y){var b=this.bucketLayerIDs[n];if(!C||function(Ut,jt){for(var qt=0;qt<Ut.length;qt++)if(jt.indexOf(Ut[qt])>=0)return!0;return!1}(C,b)){var E=this.sourceLayerCoder.decode(h),M=this.vtLayers[E].feature(_);if(w.needGeometry){var z=Kr(M,!0);if(!w.filter(new Oe(this.tileID.overscaledZ),z,this.tileID.canonical))return}else if(!w.filter(new Oe(this.tileID.overscaledZ),M))return;for(var O=this.getId(M,E),G=0;G<b.length;G++){var V=b[G];if(!(C&&C.indexOf(V)<0)){var W=e[V];if(W){var Y={};O!==void 0&&f&&(Y=f.getState(W.sourceLayer||"_geojsonTileLayer",O));var H=wt({},s[V]);H.paint=zf(H.paint,W.paint,M,Y,r),H.layout=zf(H.layout,W.layout,M,Y,r);var ot=!y||y(M,W,Y);if(ot){var ht=new Hc(M,this.z,this.x,this.y,O);ht.layer=H;var Pt=t[V];Pt===void 0&&(Pt=t[V]=[]),Pt.push({featureIndex:_,feature:ht,intersectionZ:ot})}}}}}},Ba.prototype.lookupSymbolFeatures=function(t,n,h,_,w,C,r,e){var s={};this.loadVTLayers();for(var f=wl(w),y=0,b=t;y<b.length;y+=1)this.loadMatchingFeature(s,h,_,b[y],f,C,r,e,n);return s},Ba.prototype.hasLayer=function(t){for(var n=0,h=this.bucketLayerIDs;n<h.length;n+=1)for(var _=0,w=h[n];_<w.length;_+=1)if(t===w[_])return!0;return!1},Ba.prototype.getId=function(t,n){var h=t.id;return this.promoteId&&typeof(h=t.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[n]])=="boolean"&&(h=Number(h)),h},tr("FeatureIndex",Ba,{omit:["rawTileData","sourceLayerCoder"]});var Bn=function(t,n){this.tileID=t,this.uid=Zt(),this.uses=0,this.tileSize=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};Bn.prototype.registerFadeDuration=function(t){var n=t+this.timeAdded;n<Ri.now()||this.fadeEndTime&&n<this.fadeEndTime||(this.fadeEndTime=n)},Bn.prototype.wasRequested=function(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"},Bn.prototype.loadVectorData=function(t,n,h){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var _ in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(f,y){var b={};if(!y)return b;for(var E=function(){var O=z[M],G=O.layerIds.map(function(Y){return y.getLayer(Y)}).filter(Boolean);if(G.length!==0){O.layers=G,O.stateDependentLayerIds&&(O.stateDependentLayers=O.stateDependentLayerIds.map(function(Y){return G.filter(function(H){return H.id===Y})[0]}));for(var V=0,W=G;V<W.length;V+=1)b[W[V].id]=O}},M=0,z=f;M<z.length;M+=1)E();return b}(t.buckets,n.style),this.hasSymbolBuckets=!1,this.buckets){var w=this.buckets[_];if(w instanceof _i){if(this.hasSymbolBuckets=!0,!h)break;w.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var C in this.buckets){var r=this.buckets[C];if(r instanceof _i&&r.hasRTLText){this.hasRTLText=!0,er.isLoading()||er.isLoaded()||No()!=="deferred"||mo();break}}for(var e in this.queryPadding=0,this.buckets){var s=this.buckets[e];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(e).queryRadius(s))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new m},Bn.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},Bn.prototype.getBucket=function(t){return this.buckets[t.id]},Bn.prototype.upload=function(t){for(var n in this.buckets){var h=this.buckets[n];h.uploadPending()&&h.upload(t)}var _=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new mu(t,this.imageAtlas.image,_.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new mu(t,this.glyphAtlasImage,_.ALPHA),this.glyphAtlasImage=null)},Bn.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},Bn.prototype.queryRenderedFeatures=function(t,n,h,_,w,C,r,e,s,f){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:_,cameraQueryGeometry:w,scale:C,tileSize:this.tileSize,pixelPosMatrix:f,transform:e,params:r,queryPadding:this.queryPadding*s},t,n,h):{}},Bn.prototype.querySourceFeatures=function(t,n){var h=this.latestFeatureIndex;if(h&&h.rawTileData){var _=h.loadVTLayers(),w=n?n.sourceLayer:"",C=_._geojsonTileLayer||_[w];if(C)for(var r=wl(n&&n.filter),e=this.tileID.canonical,s=e.z,f=e.x,y=e.y,b={z:s,x:f,y},E=0;E<C.length;E++){var M=C.feature(E);if(r.needGeometry){var z=Kr(M,!0);if(!r.filter(new Oe(this.tileID.overscaledZ),z,this.tileID.canonical))continue}else if(!r.filter(new Oe(this.tileID.overscaledZ),M))continue;var O=h.getId(M,w),G=new Hc(M,s,f,y,O);G.tile=b,t.push(G)}}},Bn.prototype.hasData=function(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"},Bn.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Bn.prototype.setExpiryData=function(t){var n=this.expirationTime;if(t.cacheControl){var h=Lr(t.cacheControl);h["max-age"]&&(this.expirationTime=Date.now()+1e3*h["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var _=Date.now(),w=!1;if(this.expirationTime>_)w=!1;else if(n)if(this.expirationTime<n)w=!0;else{var C=this.expirationTime-n;C?this.expirationTime=_+Math.max(C,3e4):w=!0}else w=!0;w?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},Bn.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)},Bn.prototype.setFeatureState=function(t,n){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&Object.keys(t).length!==0){var h=this.latestFeatureIndex.loadVTLayers();for(var _ in this.buckets)if(n.style.hasLayer(_)){var w=this.buckets[_],C=w.layers[0].sourceLayer||"_geojsonTileLayer",r=h[C],e=t[C];if(r&&e&&Object.keys(e).length!==0){w.update(e,r,this.imageAtlas&&this.imageAtlas.patternPositions||{});var s=n&&n.style&&n.style.getLayer(_);s&&(this.queryPadding=Math.max(this.queryPadding,s.queryRadius(w)))}}}},Bn.prototype.holdingForFade=function(){return this.symbolFadeHoldUntil!==void 0},Bn.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Ri.now()},Bn.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},Bn.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=Ri.now()+t},Bn.prototype.setDependencies=function(t,n){for(var h={},_=0,w=n;_<w.length;_+=1)h[w[_]]=!0;this.dependencies[t]=h},Bn.prototype.hasDependency=function(t,n){for(var h=0,_=t;h<_.length;h+=1){var w=this.dependencies[_[h]];if(w){for(var C=0,r=n;C<r.length;C+=1)if(w[r[C]])return!0}}return!1};var Fl=N.performance,Df=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},Fl.mark(this._marks.start)};Df.prototype.finish=function(){Fl.mark(this._marks.end);var t=Fl.getEntriesByName(this._marks.measure);return t.length===0&&(Fl.measure(this._marks.measure,this._marks.start,this._marks.end),t=Fl.getEntriesByName(this._marks.measure),Fl.clearMarks(this._marks.start),Fl.clearMarks(this._marks.end),Fl.clearMeasures(this._marks.measure)),t},i.Actor=gu,i.AlphaImage=Yu,i.CanonicalTileID=vu,i.CollisionBoxArray=m,i.Color=Sr,i.DEMData=is,i.DataConstantProperty=je,i.DictionaryCoder=Vh,i.EXTENT=8192,i.ErrorEvent=Bt,i.EvaluationParameters=Oe,i.Event=It,i.Evented=Gt,i.FeatureIndex=Ba,i.FillBucket=ks,i.FillExtrusionBucket=zs,i.ImageAtlas=Lh,i.ImagePosition=yp,i.LineBucket=bo,i.LngLat=Ni,i.LngLatBounds=Pn,i.MercatorCoordinate=_u,i.ONE_EM=24,i.OverscaledTileID=yn,i.Point=F,i.Point$1=F,i.Properties=T,i.Protobuf=gp,i.RGBAImage=xo,i.RequestManager=en,i.RequestPerformance=Df,i.ResourceType=Rr,i.SegmentVector=ft,i.SourceFeatureState=Oo,i.StructArrayLayout1ui2=Ye,i.StructArrayLayout2f1f2i16=ie,i.StructArrayLayout2i4=q,i.StructArrayLayout3ui6=_e,i.StructArrayLayout4i8=$,i.SymbolBucket=_i,i.Texture=mu,i.Tile=Bn,i.Transitionable=gn,i.Uniform1f=ke,i.Uniform1i=xe,i.Uniform2f=Le,i.Uniform3f=$e,i.Uniform4f=lr,i.UniformColor=hr,i.UniformMatrix4f=Zr,i.UnwrappedTileID=kf,i.ValidationError=zt,i.WritingMode=ma,i.ZoomHistory=da,i.add=function(t,n,h){return t[0]=n[0]+h[0],t[1]=n[1]+h[1],t[2]=n[2]+h[2],t},i.addDynamicAttributes=Pf,i.asyncAll=function(t,n,h){if(!t.length)return h(null,[]);var _=t.length,w=new Array(t.length),C=null;t.forEach(function(r,e){n(r,function(s,f){s&&(C=s),w[e]=f,--_==0&&h(C,w)})})},i.bezier=yt,i.bindAll=ce,i.browser=Ri,i.cacheEntryPossiblyAdded=function(t){++ai>ii&&(t.getActor().send("enforceCacheSizeLimit",wn),ai=0)},i.clamp=kt,i.clearTileCache=function(t){var n=N.caches.delete("mapbox-tiles");t&&n.catch(t).then(function(){return t()})},i.clipLine=Af,i.clone=function(t){var n=new ri(16);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},i.clone$1=Me,i.clone$2=function(t){var n=new ri(3);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n},i.collisionCircleLayout=Fd,i.config=Wr,i.create=function(){var t=new ri(16);return ri!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},i.create$1=function(){var t=new ri(9);return ri!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},i.create$2=function(){var t=new ri(4);return ri!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},i.createCommonjsModule=u,i.createExpression=vl,i.createLayout=L,i.createStyleLayer=function(t){return t.type==="custom"?new Mf(t):new Ng[t.type](t)},i.cross=function(t,n,h){var _=n[0],w=n[1],C=n[2],r=h[0],e=h[1],s=h[2];return t[0]=w*s-C*e,t[1]=C*r-_*s,t[2]=_*e-w*r,t},i.deepEqual=function t(n,h){if(Array.isArray(n)){if(!Array.isArray(h)||n.length!==h.length)return!1;for(var _=0;_<n.length;_++)if(!t(n[_],h[_]))return!1;return!0}if(typeof n=="object"&&n!==null&&h!==null){if(typeof h!="object"||Object.keys(n).length!==Object.keys(h).length)return!1;for(var w in n)if(!t(n[w],h[w]))return!1;return!0}return n===h},i.dot=function(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]},i.dot$1=function(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]},i.ease=Tt,i.emitValidationErrors=Xs,i.endsWith=oe,i.enforceCacheSizeLimit=function(t){En(),$i&&$i.then(function(n){n.keys().then(function(h){for(var _=0;_<h.length-t;_++)n.delete(h[_])})})},i.evaluateSizeForFeature=Sf,i.evaluateSizeForZoom=Tf,i.evaluateVariableOffset=Bh,i.evented=$u,i.extend=wt,i.featureFilter=wl,i.filterObject=be,i.fromRotation=function(t,n){var h=Math.sin(n),_=Math.cos(n);return t[0]=_,t[1]=h,t[2]=0,t[3]=-h,t[4]=_,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},i.getAnchorAlignment=ec,i.getAnchorJustification=wp,i.getArrayBuffer=Rn,i.getImage=it,i.getJSON=function(t,n){return ho(wt(t,{type:"json"}),n)},i.getRTLTextPluginStatus=No,i.getReferrer=qi,i.getVideo=function(t,n){var h,_,w=N.document.createElement("video");w.muted=!0,w.onloadstart=function(){n(null,w)};for(var C=0;C<t.length;C++){var r=N.document.createElement("source");h=t[C],_=void 0,(_=N.document.createElement("a")).href=h,(_.protocol!==N.document.location.protocol||_.host!==N.document.location.host)&&(w.crossOrigin="Anonymous"),r.src=t[C],w.appendChild(r)}return{cancel:function(){}}},i.identity=vo,i.invert=function(t,n){var h=n[0],_=n[1],w=n[2],C=n[3],r=n[4],e=n[5],s=n[6],f=n[7],y=n[8],b=n[9],E=n[10],M=n[11],z=n[12],O=n[13],G=n[14],V=n[15],W=h*e-_*r,Y=h*s-w*r,H=h*f-C*r,ot=_*s-w*e,ht=_*f-C*e,Pt=w*f-C*s,Ut=y*O-b*z,jt=y*G-E*z,qt=y*V-M*z,re=b*G-E*O,Xt=b*V-M*O,Te=E*V-M*G,Ee=W*Te-Y*Xt+H*re+ot*qt-ht*jt+Pt*Ut;return Ee?(t[0]=(e*Te-s*Xt+f*re)*(Ee=1/Ee),t[1]=(w*Xt-_*Te-C*re)*Ee,t[2]=(O*Pt-G*ht+V*ot)*Ee,t[3]=(E*ht-b*Pt-M*ot)*Ee,t[4]=(s*qt-r*Te-f*jt)*Ee,t[5]=(h*Te-w*qt+C*jt)*Ee,t[6]=(G*H-z*Pt-V*Y)*Ee,t[7]=(y*Pt-E*H+M*Y)*Ee,t[8]=(r*Xt-e*qt+f*Ut)*Ee,t[9]=(_*qt-h*Xt-C*Ut)*Ee,t[10]=(z*ht-O*H+V*W)*Ee,t[11]=(b*H-y*ht-M*W)*Ee,t[12]=(e*jt-r*re-s*Ut)*Ee,t[13]=(h*re-_*jt+w*Ut)*Ee,t[14]=(O*Y-z*ot-G*W)*Ee,t[15]=(y*ot-b*Y+E*W)*Ee,t):null},i.isChar=Ne,i.isMapboxURL=ji,i.keysDifference=function(t,n){var h=[];for(var _ in t)_ in n||h.push(_);return h},i.makeRequest=ho,i.mapObject=ye,i.mercatorXfromLng=Lf,i.mercatorYfromLat=pn,i.mercatorZfromAltitude=yu,i.mul=uu,i.multiply=Do,i.mvt=Nc,i.nextPowerOfTwo=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},i.normalize=function(t,n){var h=n[0],_=n[1],w=n[2],C=h*h+_*_+w*w;return C>0&&(C=1/Math.sqrt(C)),t[0]=n[0]*C,t[1]=n[1]*C,t[2]=n[2]*C,t},i.number=Ji,i.offscreenCanvasSupported=Ge,i.ortho=function(t,n,h,_,w,C,r){var e=1/(n-h),s=1/(_-w),f=1/(C-r);return t[0]=-2*e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*f,t[11]=0,t[12]=(n+h)*e,t[13]=(w+_)*s,t[14]=(r+C)*f,t[15]=1,t},i.parseGlyphPBF=function(t){return new gp(t).readFields(Ig,[])},i.pbf=gp,i.performSymbolLayout=function(t,n,h,_,w,C,r){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var e=t.layers[0].layout,s=t.layers[0]._unevaluatedLayout._values,f={};if(t.textSizeData.kind==="composite"){var y=t.textSizeData,b=y.maxZoom;f.compositeTextSizes=[s["text-size"].possiblyEvaluate(new Oe(y.minZoom),r),s["text-size"].possiblyEvaluate(new Oe(b),r)]}if(t.iconSizeData.kind==="composite"){var E=t.iconSizeData,M=E.maxZoom;f.compositeIconSizes=[s["icon-size"].possiblyEvaluate(new Oe(E.minZoom),r),s["icon-size"].possiblyEvaluate(new Oe(M),r)]}f.layoutTextSize=s["text-size"].possiblyEvaluate(new Oe(t.zoom+1),r),f.layoutIconSize=s["icon-size"].possiblyEvaluate(new Oe(t.zoom+1),r),f.textMaxSize=s["text-size"].possiblyEvaluate(new Oe(18));for(var z=24*e.get("text-line-height"),O=e.get("text-rotation-alignment")==="map"&&e.get("symbol-placement")!=="point",G=e.get("text-keep-upright"),V=e.get("text-size"),W=function(){var ot=H[Y],ht=e.get("text-font").evaluate(ot,{},r).join(","),Pt=V.evaluate(ot,{},r),Ut=f.layoutTextSize.evaluate(ot,{},r),jt=f.layoutIconSize.evaluate(ot,{},r),qt={horizontal:{},vertical:void 0},re=ot.text,Xt=[0,0];if(re){var Te=re.toString(),Ee=24*e.get("text-letter-spacing").evaluate(ot,{},r),ue=function(Cr){for(var Or=0,Vr=Cr;Or<Vr.length;Or+=1)if(Mr=Vr[Or].charCodeAt(0),Ne.Arabic(Mr)||Ne["Arabic Supplement"](Mr)||Ne["Arabic Extended-A"](Mr)||Ne["Arabic Presentation Forms-A"](Mr)||Ne["Arabic Presentation Forms-B"](Mr))return!1;var Mr;return!0}(Te)?Ee:0,we=e.get("text-anchor").evaluate(ot,{},r),me=e.get("text-variable-anchor");if(!me){var Ae=e.get("text-radial-offset").evaluate(ot,{},r);Xt=Ae?Bh(we,[24*Ae,bp]):e.get("text-offset").evaluate(ot,{},r).map(function(Cr){return 24*Cr})}var pe=O?"center":e.get("text-justify").evaluate(ot,{},r),ge=e.get("symbol-placement"),He=ge==="point"?24*e.get("text-max-width").evaluate(ot,{},r):0,Ke=function(){t.allowVerticalPlacement&&Sl(Te)&&(qt.vertical=kh(re,n,h,w,ht,He,z,we,"left",ue,Xt,ma.vertical,!0,ge,Ut,Pt))};if(!O&&me){for(var gr=pe==="auto"?me.map(function(Cr){return wp(Cr)}):[pe],wr=!1,Nr=0;Nr<gr.length;Nr++){var Xr=gr[Nr];if(!qt.horizontal[Xr])if(wr)qt.horizontal[Xr]=qt.horizontal[0];else{var li=kh(re,n,h,w,ht,He,z,"center",Xr,ue,Xt,ma.horizontal,!1,ge,Ut,Pt);li&&(qt.horizontal[Xr]=li,wr=li.positionedLines.length===1)}}Ke()}else{pe==="auto"&&(pe=wp(we));var ui=kh(re,n,h,w,ht,He,z,we,pe,ue,Xt,ma.horizontal,!1,ge,Ut,Pt);ui&&(qt.horizontal[pe]=ui),Ke(),Sl(Te)&&O&&G&&(qt.vertical=kh(re,n,h,w,ht,He,z,we,pe,ue,Xt,ma.vertical,!1,ge,Ut,Pt))}}var Jr=void 0,di=!1;if(ot.icon&&ot.icon.name){var Qr=_[ot.icon.name];Qr&&(Jr=function(Cr,Or,Vr){var Mr=ec(Vr),Ai=Or[0]-Cr.displaySize[0]*Mr.horizontalAlign,Ti=Or[1]-Cr.displaySize[1]*Mr.verticalAlign;return{image:Cr,top:Ti,bottom:Ti+Cr.displaySize[1],left:Ai,right:Ai+Cr.displaySize[0]}}(w[ot.icon.name],e.get("icon-offset").evaluate(ot,{},r),e.get("icon-anchor").evaluate(ot,{},r)),di=Qr.sdf,t.sdfIcons===void 0?t.sdfIcons=Qr.sdf:t.sdfIcons!==Qr.sdf&&Be("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Qr.pixelRatio!==t.pixelRatio||e.get("icon-rotate").constantOr(1)!==0)&&(t.iconsNeedLinear=!0))}var mi=Nh(qt.horizontal)||qt.vertical;t.iconsInText=!!mi&&mi.iconsInText,(mi||Jr)&&function(Cr,Or,Vr,Mr,Ai,Ti,Hr,qr,fi,or,Mn){var ki=Ti.textMaxSize.evaluate(Or,{});ki===void 0&&(ki=Hr);var an,vi=Cr.layers[0].layout,to=vi.get("icon-offset").evaluate(Or,{},Mn),Un=Nh(Vr.horizontal),ga=Hr/24,wo=Cr.tilePixelRatio*ga,Eo=Cr.tilePixelRatio*ki/24,Ln=Cr.tilePixelRatio*qr,ya=Cr.tilePixelRatio*vi.get("symbol-spacing"),xu=vi.get("text-padding")*Cr.tilePixelRatio,sc=vi.get("icon-padding")*Cr.tilePixelRatio,lc=vi.get("text-max-angle")/180*Math.PI,Jc=vi.get("text-rotation-alignment")==="map"&&vi.get("symbol-placement")!=="point",ns=vi.get("icon-rotation-alignment")==="map"&&vi.get("symbol-placement")!=="point",tl=vi.get("symbol-placement"),uc=ya/2,bu=vi.get("icon-text-fit");Mr&&bu!=="none"&&(Cr.allowVerticalPlacement&&Vr.vertical&&(an=zh(Mr,Vr.vertical,bu,vi.get("icon-text-fit-padding"),to,ga)),Un&&(Mr=zh(Mr,Un,bu,vi.get("icon-text-fit-padding"),to,ga)));var Bl=function(C1,Of){Of.x<0||Of.x>=8192||Of.y<0||Of.y>=8192||function(kn,Nl,A1,eh,qg,V_,rm,wu,im,Ff,nm,om,Zg,G_,Bf,j_,q_,Z_,X_,W_,as,am,$_,Eu,P1){var K_,Xh,zp,Rp,Dp,Op=kn.addToLineVertexArray(Nl,A1),Y_=0,H_=0,J_=0,Q_=0,Xg=-1,Wg=-1,pc={},tv=xt(""),$g=0,Kg=0;if(wu._unevaluatedLayout.getValue("text-radial-offset")===void 0?($g=(K_=wu.layout.get("text-offset").evaluate(as,{},Eu).map(function(Nf){return 24*Nf}))[0],Kg=K_[1]):($g=24*wu.layout.get("text-radial-offset").evaluate(as,{},Eu),Kg=bp),kn.allowVerticalPlacement&&eh.vertical){var ev=wu.layout.get("text-rotate").evaluate(as,{},Eu)+90;Rp=new Fh(im,Nl,Ff,nm,om,eh.vertical,Zg,G_,Bf,ev),rm&&(Dp=new Fh(im,Nl,Ff,nm,om,rm,q_,Z_,Bf,ev))}if(qg){var Yg=wu.layout.get("icon-rotate").evaluate(as,{}),rv=wu.layout.get("icon-text-fit")!=="none",iv=Js(qg,Yg,$_,rv),Hg=rm?Js(rm,Yg,$_,rv):void 0;zp=new Fh(im,Nl,Ff,nm,om,qg,q_,Z_,!1,Yg),Y_=4*iv.length;var nv=kn.iconSizeData,Uf=null;nv.kind==="source"?(Uf=[128*wu.layout.get("icon-size").evaluate(as,{})])[0]>32640&&Be(kn.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):nv.kind==="composite"&&((Uf=[128*am.compositeIconSizes[0].evaluate(as,{},Eu),128*am.compositeIconSizes[1].evaluate(as,{},Eu)])[0]>32640||Uf[1]>32640)&&Be(kn.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),kn.addSymbols(kn.icon,iv,Uf,W_,X_,as,!1,Nl,Op.lineStartIndex,Op.lineLength,-1,Eu),Xg=kn.icon.placedSymbolArray.length-1,Hg&&(H_=4*Hg.length,kn.addSymbols(kn.icon,Hg,Uf,W_,X_,as,ma.vertical,Nl,Op.lineStartIndex,Op.lineLength,-1,Eu),Wg=kn.icon.placedSymbolArray.length-1)}for(var ov in eh.horizontal){var sm=eh.horizontal[ov];if(!Xh){tv=xt(sm.text);var M1=wu.layout.get("text-rotate").evaluate(as,{},Eu);Xh=new Fh(im,Nl,Ff,nm,om,sm,Zg,G_,Bf,M1)}var av=sm.positionedLines.length===1;if(J_+=Uh(kn,Nl,sm,V_,wu,Bf,as,j_,Op,eh.vertical?ma.horizontal:ma.horizontalOnly,av?Object.keys(eh.horizontal):[ov],pc,Xg,am,Eu),av)break}eh.vertical&&(Q_+=Uh(kn,Nl,eh.vertical,V_,wu,Bf,as,j_,Op,ma.vertical,["vertical"],pc,Wg,am,Eu));var L1=Xh?Xh.boxStartIndex:kn.collisionBoxArray.length,k1=Xh?Xh.boxEndIndex:kn.collisionBoxArray.length,z1=Rp?Rp.boxStartIndex:kn.collisionBoxArray.length,R1=Rp?Rp.boxEndIndex:kn.collisionBoxArray.length,D1=zp?zp.boxStartIndex:kn.collisionBoxArray.length,O1=zp?zp.boxEndIndex:kn.collisionBoxArray.length,F1=Dp?Dp.boxStartIndex:kn.collisionBoxArray.length,B1=Dp?Dp.boxEndIndex:kn.collisionBoxArray.length,Su=-1,lm=function(Nf,lv){return Nf&&Nf.circleDiameter?Math.max(Nf.circleDiameter,lv):lv};Su=lm(Xh,Su),Su=lm(Rp,Su),Su=lm(zp,Su);var sv=(Su=lm(Dp,Su))>-1?1:0;sv&&(Su*=P1/24),kn.glyphOffsetArray.length>=_i.MAX_GLYPHS&&Be("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),as.sortKey!==void 0&&kn.addToSortKeyRanges(kn.symbolInstances.length,as.sortKey),kn.symbolInstances.emplaceBack(Nl.x,Nl.y,pc.right>=0?pc.right:-1,pc.center>=0?pc.center:-1,pc.left>=0?pc.left:-1,pc.vertical||-1,Xg,Wg,tv,L1,k1,z1,R1,D1,O1,F1,B1,Ff,J_,Q_,Y_,H_,sv,0,Zg,$g,Kg,Su)}(Cr,Of,C1,Vr,Mr,Ai,an,Cr.layers[0],Cr.collisionBoxArray,Or.index,Or.sourceLayerIndex,Cr.index,wo,xu,Jc,fi,Ln,sc,ns,to,Or,Ti,or,Mn,Hr)};if(tl==="line")for(var Qc=0,Mp=Af(Or.geometry,0,0,8192,8192);Qc<Mp.length;Qc+=1)for(var Lp=Mp[Qc],Gh=0,jh=Lg(Lp,ya,lc,Vr.vertical||Un,Mr,24,Eo,Cr.overscaling,8192);Gh<jh.length;Gh+=1){var kp=jh[Gh];Un&&Ep(Cr,Un.text,uc,kp)||Bl(Lp,kp)}else if(tl==="line-center")for(var qh=0,Zh=Or.geometry;qh<Zh.length;qh+=1){var Jo=Zh[qh];if(Jo.length>1){var cc=Mg(Jo,lc,Vr.vertical||Un,Mr,24,Eo);cc&&Bl(Jo,cc)}}else if(Or.type==="Polygon")for(var hc=0,So=dp(Or.geometry,0);hc<So.length;hc+=1){var Qo=So[hc],Ul=zg(Qo,16);Bl(Qo[0],new Dl(Ul.x,Ul.y,0))}else if(Or.type==="LineString")for(var Rs=0,th=Or.geometry;Rs<th.length;Rs+=1){var os=th[Rs];Bl(os,new Dl(os[0].x,os[0].y,0))}else if(Or.type==="Point")for(var Vg=0,U_=Or.geometry;Vg<U_.length;Vg+=1)for(var Gg=0,N_=U_[Vg];Gg<N_.length;Gg+=1){var jg=N_[Gg];Bl([jg],new Dl(jg.x,jg.y,0))}}(t,ot,qt,Jr,_,f,Ut,jt,Xt,di,r)},Y=0,H=t.features;Y<H.length;Y+=1)W();C&&t.generateCollisionDebugBuffers()},i.perspective=function(t,n,h,_,w){var C,r=1/Math.tan(n/2);return t[0]=r/h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,w!=null&&w!==1/0?(t[10]=(w+_)*(C=1/(_-w)),t[14]=2*w*_*C):(t[10]=-1,t[14]=-2*_),t},i.pick=function(t,n){for(var h={},_=0;_<n.length;_++){var w=n[_];w in t&&(h[w]=t[w])}return h},i.plugin=er,i.polygonIntersectsPolygon=Vo,i.postMapLoadEvent=no,i.postTurnstileEvent=fe,i.potpack=Wd,i.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],i.register=tr,i.registerForPluginStateChange=function(t){return t({pluginStatus:Gn,pluginURL:Yo}),$u.on("pluginStateChange",t),t},i.renderColorRamp=fp,i.rotate=function(t,n,h){var _=n[0],w=n[1],C=n[2],r=n[3],e=Math.sin(h),s=Math.cos(h);return t[0]=_*s+C*e,t[1]=w*s+r*e,t[2]=_*-e+C*s,t[3]=w*-e+r*s,t},i.rotateX=function(t,n,h){var _=Math.sin(h),w=Math.cos(h),C=n[4],r=n[5],e=n[6],s=n[7],f=n[8],y=n[9],b=n[10],E=n[11];return n!==t&&(t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[4]=C*w+f*_,t[5]=r*w+y*_,t[6]=e*w+b*_,t[7]=s*w+E*_,t[8]=f*w-C*_,t[9]=y*w-r*_,t[10]=b*w-e*_,t[11]=E*w-s*_,t},i.rotateZ=function(t,n,h){var _=Math.sin(h),w=Math.cos(h),C=n[0],r=n[1],e=n[2],s=n[3],f=n[4],y=n[5],b=n[6],E=n[7];return n!==t&&(t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[0]=C*w+f*_,t[1]=r*w+y*_,t[2]=e*w+b*_,t[3]=s*w+E*_,t[4]=f*w-C*_,t[5]=y*w-r*_,t[6]=b*w-e*_,t[7]=E*w-s*_,t},i.scale=function(t,n,h){var _=h[0],w=h[1],C=h[2];return t[0]=n[0]*_,t[1]=n[1]*_,t[2]=n[2]*_,t[3]=n[3]*_,t[4]=n[4]*w,t[5]=n[5]*w,t[6]=n[6]*w,t[7]=n[7]*w,t[8]=n[8]*C,t[9]=n[9]*C,t[10]=n[10]*C,t[11]=n[11]*C,t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t},i.scale$1=function(t,n,h){return t[0]=n[0]*h,t[1]=n[1]*h,t[2]=n[2]*h,t[3]=n[3]*h,t},i.scale$2=function(t,n,h){return t[0]=n[0]*h,t[1]=n[1]*h,t[2]=n[2]*h,t},i.setCacheLimits=function(t,n){wn=t,ii=n},i.setRTLTextPlugin=function(t,n,h){if(h===void 0&&(h=!1),Gn==="deferred"||Gn==="loading"||Gn==="loaded")throw new Error("setRTLTextPlugin cannot be called multiple times.");Yo=Ri.resolveURL(t),Gn="deferred",As=n,Ks(),h||mo()},i.sphericalToCartesian=function(t){var n=t[0],h=t[1],_=t[2];return h+=90,h*=Math.PI/180,_*=Math.PI/180,{x:n*Math.cos(h)*Math.sin(_),y:n*Math.sin(h)*Math.sin(_),z:n*Math.cos(_)}},i.sqrLen=function(t){var n=t[0],h=t[1];return n*n+h*h},i.styleSpec=dt,i.sub=function(t,n,h){return t[0]=n[0]-h[0],t[1]=n[1]-h[1],t[2]=n[2]-h[2],t},i.symbolSize=Pg,i.transformMat3=function(t,n,h){var _=n[0],w=n[1],C=n[2];return t[0]=_*h[0]+w*h[3]+C*h[6],t[1]=_*h[1]+w*h[4]+C*h[7],t[2]=_*h[2]+w*h[5]+C*h[8],t},i.transformMat4=cu,i.translate=function(t,n,h){var _,w,C,r,e,s,f,y,b,E,M,z,O=h[0],G=h[1],V=h[2];return n===t?(t[12]=n[0]*O+n[4]*G+n[8]*V+n[12],t[13]=n[1]*O+n[5]*G+n[9]*V+n[13],t[14]=n[2]*O+n[6]*G+n[10]*V+n[14],t[15]=n[3]*O+n[7]*G+n[11]*V+n[15]):(w=n[1],C=n[2],r=n[3],e=n[4],s=n[5],f=n[6],y=n[7],b=n[8],E=n[9],M=n[10],z=n[11],t[0]=_=n[0],t[1]=w,t[2]=C,t[3]=r,t[4]=e,t[5]=s,t[6]=f,t[7]=y,t[8]=b,t[9]=E,t[10]=M,t[11]=z,t[12]=_*O+e*G+b*V+n[12],t[13]=w*O+s*G+E*V+n[13],t[14]=C*O+f*G+M*V+n[14],t[15]=r*O+y*G+z*V+n[15]),t},i.triggerPluginCompletionEvent=Wu,i.uniqueId=Zt,i.validateCustomStyleLayer=function(t){var n=[],h=t.id;return h===void 0&&n.push({message:"layers."+h+': missing required property "id"'}),t.render===void 0&&n.push({message:"layers."+h+': missing required method "render"'}),t.renderingMode&&t.renderingMode!=="2d"&&t.renderingMode!=="3d"&&n.push({message:"layers."+h+': property "renderingMode" must be either "2d" or "3d"'}),n},i.validateLight=El,i.validateStyle=Ko,i.values=function(t){var n=[];for(var h in t)n.push(t[h]);return n},i.vectorTile=Nc,i.version="1.13.2",i.warnOnce=Be,i.webpSupported=Di,i.window=N,i.wrap=Vt}),c(["./shared"],function(i){"use strict";function u(Q){var it=typeof Q;if(it==="number"||it==="boolean"||it==="string"||Q==null)return JSON.stringify(Q);if(Array.isArray(Q)){for(var st="[",_t=0,It=Q;_t<It.length;_t+=1)st+=u(It[_t])+",";return st+"]"}for(var Bt=Object.keys(Q).sort(),Gt="{",dt=0;dt<Bt.length;dt++)Gt+=JSON.stringify(Bt[dt])+":"+u(Q[Bt[dt]])+",";return Gt+"}"}function P(Q){for(var it="",st=0,_t=i.refProperties;st<_t.length;st+=1)it+="/"+u(Q[_t[st]]);return it}var D=function(Q){this.keyCache={},Q&&this.replace(Q)};D.prototype.replace=function(Q){this._layerConfigs={},this._layers={},this.update(Q,[])},D.prototype.update=function(Q,it){for(var st=this,_t=0,It=Q;_t<It.length;_t+=1){var Bt=It[_t];this._layerConfigs[Bt.id]=Bt;var Gt=this._layers[Bt.id]=i.createStyleLayer(Bt);Gt._featureFilter=i.featureFilter(Gt.filter),this.keyCache[Bt.id]&&delete this.keyCache[Bt.id]}for(var dt=0,zt=it;dt<zt.length;dt+=1){var Qt=zt[dt];delete this.keyCache[Qt],delete this._layerConfigs[Qt],delete this._layers[Qt]}this.familiesBySource={};for(var nt=0,X=function(Et,Ct){for(var te={},$t=0;$t<Et.length;$t++){var ee=Ct&&Ct[Et[$t].id]||P(Et[$t]);Ct&&(Ct[Et[$t].id]=ee);var De=te[ee];De||(De=te[ee]=[]),De.push(Et[$t])}var Se=[];for(var ze in te)Se.push(te[ze]);return Se}(i.values(this._layerConfigs),this.keyCache);nt<X.length;nt+=1){var Z=X[nt].map(function(Et){return st._layers[Et.id]}),rt=Z[0];if(rt.visibility!=="none"){var lt=rt.source||"",gt=this.familiesBySource[lt];gt||(gt=this.familiesBySource[lt]={});var pt=rt.sourceLayer||"_geojsonTileLayer",St=gt[pt];St||(St=gt[pt]=[]),St.push(Z)}}};var F=function(Q){var it={},st=[];for(var _t in Q){var It=Q[_t],Bt=it[_t]={};for(var Gt in It){var dt=It[+Gt];if(dt&&dt.bitmap.width!==0&&dt.bitmap.height!==0){var zt={x:0,y:0,w:dt.bitmap.width+2,h:dt.bitmap.height+2};st.push(zt),Bt[Gt]={rect:zt,metrics:dt.metrics}}}}var Qt=i.potpack(st),nt=new i.AlphaImage({width:Qt.w||1,height:Qt.h||1});for(var X in Q){var Z=Q[X];for(var rt in Z){var lt=Z[+rt];if(lt&&lt.bitmap.width!==0&&lt.bitmap.height!==0){var gt=it[X][rt].rect;i.AlphaImage.copy(lt.bitmap,nt,{x:0,y:0},{x:gt.x+1,y:gt.y+1},lt.bitmap)}}}this.image=nt,this.positions=it};i.register("GlyphAtlas",F);var U=function(Q){this.tileID=new i.OverscaledTileID(Q.tileID.overscaledZ,Q.tileID.wrap,Q.tileID.canonical.z,Q.tileID.canonical.x,Q.tileID.canonical.y),this.uid=Q.uid,this.zoom=Q.zoom,this.pixelRatio=Q.pixelRatio,this.tileSize=Q.tileSize,this.source=Q.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=Q.showCollisionBoxes,this.collectResourceTiming=!!Q.collectResourceTiming,this.returnDependencies=!!Q.returnDependencies,this.promoteId=Q.promoteId};function N(Q,it,st){for(var _t=new i.EvaluationParameters(it),It=0,Bt=Q;It<Bt.length;It+=1)Bt[It].recalculate(_t,st)}function at(Q,it){var st=i.getArrayBuffer(Q.request,function(_t,It,Bt,Gt){_t?it(_t):It&&it(null,{vectorTile:new i.vectorTile.VectorTile(new i.pbf(It)),rawData:It,cacheControl:Bt,expires:Gt})});return function(){st.cancel(),it()}}U.prototype.parse=function(Q,it,st,_t,It){var Bt=this;this.status="parsing",this.data=Q,this.collisionBoxArray=new i.CollisionBoxArray;var Gt=new i.DictionaryCoder(Object.keys(Q.layers).sort()),dt=new i.FeatureIndex(this.tileID,this.promoteId);dt.bucketLayerIDs=[];var zt,Qt,nt,X,Z={},rt={featureIndex:dt,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:st},lt=it.familiesBySource[this.source];for(var gt in lt){var pt=Q.layers[gt];if(pt){pt.version===1&&i.warnOnce('Vector tile source "'+this.source+'" layer "'+gt+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var St=Gt.encode(gt),Et=[],Ct=0;Ct<pt.length;Ct++){var te=pt.feature(Ct),$t=dt.getId(te,gt);Et.push({feature:te,id:$t,index:Ct,sourceLayerIndex:St})}for(var ee=0,De=lt[gt];ee<De.length;ee+=1){var Se=De[ee],ze=Se[0];ze.minzoom&&this.zoom<Math.floor(ze.minzoom)||ze.maxzoom&&this.zoom>=ze.maxzoom||ze.visibility!=="none"&&(N(Se,this.zoom,st),(Z[ze.id]=ze.createBucket({index:dt.bucketLayerIDs.length,layers:Se,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:St,sourceID:this.source})).populate(Et,rt,this.tileID.canonical),dt.bucketLayerIDs.push(Se.map(function(nr){return nr.id})))}}}var Ue=i.mapObject(rt.glyphDependencies,function(nr){return Object.keys(nr).map(Number)});Object.keys(Ue).length?_t.send("getGlyphs",{uid:this.uid,stacks:Ue},function(nr,Xe){zt||(zt=nr,Qt=Xe,mr.call(Bt))}):Qt={};var Dr=Object.keys(rt.iconDependencies);Dr.length?_t.send("getImages",{icons:Dr,source:this.source,tileID:this.tileID,type:"icons"},function(nr,Xe){zt||(zt=nr,nt=Xe,mr.call(Bt))}):nt={};var ur=Object.keys(rt.patternDependencies);function mr(){if(zt)return It(zt);if(Qt&&nt&&X){var nr=new F(Qt),Xe=new i.ImageAtlas(nt,X);for(var Sr in Z){var ni=Z[Sr];ni instanceof i.SymbolBucket?(N(ni.layers,this.zoom,st),i.performSymbolLayout(ni,Qt,nr.positions,nt,Xe.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):ni.hasPattern&&(ni instanceof i.LineBucket||ni instanceof i.FillBucket||ni instanceof i.FillExtrusionBucket)&&(N(ni.layers,this.zoom,st),ni.addFeatures(rt,this.tileID.canonical,Xe.patternPositions))}this.status="done",It(null,{buckets:i.values(Z).filter(function(rn){return!rn.isEmpty()}),featureIndex:dt,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:nr.image,imageAtlas:Xe,glyphMap:this.returnDependencies?Qt:null,iconMap:this.returnDependencies?nt:null,glyphPositions:this.returnDependencies?nr.positions:null})}}ur.length?_t.send("getImages",{icons:ur,source:this.source,tileID:this.tileID,type:"patterns"},function(nr,Xe){zt||(zt=nr,X=Xe,mr.call(Bt))}):X={},mr.call(this)};var yt=function(Q,it,st,_t){this.actor=Q,this.layerIndex=it,this.availableImages=st,this.loadVectorData=_t||at,this.loading={},this.loaded={}};yt.prototype.loadTile=function(Q,it){var st=this,_t=Q.uid;this.loading||(this.loading={});var It=!!(Q&&Q.request&&Q.request.collectResourceTiming)&&new i.RequestPerformance(Q.request),Bt=this.loading[_t]=new U(Q);Bt.abort=this.loadVectorData(Q,function(Gt,dt){if(delete st.loading[_t],Gt||!dt)return Bt.status="done",st.loaded[_t]=Bt,it(Gt);var zt=dt.rawData,Qt={};dt.expires&&(Qt.expires=dt.expires),dt.cacheControl&&(Qt.cacheControl=dt.cacheControl);var nt={};if(It){var X=It.finish();X&&(nt.resourceTiming=JSON.parse(JSON.stringify(X)))}Bt.vectorTile=dt.vectorTile,Bt.parse(dt.vectorTile,st.layerIndex,st.availableImages,st.actor,function(Z,rt){if(Z||!rt)return it(Z);it(null,i.extend({rawTileData:zt.slice(0)},rt,Qt,nt))}),st.loaded=st.loaded||{},st.loaded[_t]=Bt})},yt.prototype.reloadTile=function(Q,it){var st=this,_t=this.loaded,It=Q.uid,Bt=this;if(_t&&_t[It]){var Gt=_t[It];Gt.showCollisionBoxes=Q.showCollisionBoxes;var dt=function(zt,Qt){var nt=Gt.reloadCallback;nt&&(delete Gt.reloadCallback,Gt.parse(Gt.vectorTile,Bt.layerIndex,st.availableImages,Bt.actor,nt)),it(zt,Qt)};Gt.status==="parsing"?Gt.reloadCallback=dt:Gt.status==="done"&&(Gt.vectorTile?Gt.parse(Gt.vectorTile,this.layerIndex,this.availableImages,this.actor,dt):dt())}},yt.prototype.abortTile=function(Q,it){var st=this.loading,_t=Q.uid;st&&st[_t]&&st[_t].abort&&(st[_t].abort(),delete st[_t]),it()},yt.prototype.removeTile=function(Q,it){var st=this.loaded,_t=Q.uid;st&&st[_t]&&delete st[_t],it()};var Tt=i.window.ImageBitmap,kt=function(){this.loaded={}};function Vt(Q,it){if(Q.length!==0){wt(Q[0],it);for(var st=1;st<Q.length;st++)wt(Q[st],!it)}}function wt(Q,it){for(var st=0,_t=0,It=Q.length,Bt=It-1;_t<It;Bt=_t++)st+=(Q[_t][0]-Q[Bt][0])*(Q[Bt][1]+Q[_t][1]);st>=0!=!!it&&Q.reverse()}kt.prototype.loadTile=function(Q,it){var st=Q.uid,_t=Q.encoding,It=Q.rawImageData,Bt=Tt&&It instanceof Tt?this.getImageData(It):It,Gt=new i.DEMData(st,Bt,_t);this.loaded=this.loaded||{},this.loaded[st]=Gt,it(null,Gt)},kt.prototype.getImageData=function(Q){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(Q.width,Q.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=Q.width,this.offscreenCanvas.height=Q.height,this.offscreenCanvasContext.drawImage(Q,0,0,Q.width,Q.height);var it=this.offscreenCanvasContext.getImageData(-1,-1,Q.width+2,Q.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new i.RGBAImage({width:it.width,height:it.height},it.data)},kt.prototype.removeTile=function(Q){var it=this.loaded,st=Q.uid;it&&it[st]&&delete it[st]};var Lt=i.vectorTile.VectorTileFeature.prototype.toGeoJSON,Zt=function(Q){this._feature=Q,this.extent=i.EXTENT,this.type=Q.type,this.properties=Q.tags,"id"in Q&&!isNaN(Q.id)&&(this.id=parseInt(Q.id,10))};Zt.prototype.loadGeometry=function(){if(this._feature.type===1){for(var Q=[],it=0,st=this._feature.geometry;it<st.length;it+=1){var _t=st[it];Q.push([new i.Point$1(_t[0],_t[1])])}return Q}for(var It=[],Bt=0,Gt=this._feature.geometry;Bt<Gt.length;Bt+=1){for(var dt=[],zt=0,Qt=Gt[Bt];zt<Qt.length;zt+=1){var nt=Qt[zt];dt.push(new i.Point$1(nt[0],nt[1]))}It.push(dt)}return It},Zt.prototype.toGeoJSON=function(Q,it,st){return Lt.call(this,Q,it,st)};var Jt=function(Q){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=i.EXTENT,this.length=Q.length,this._features=Q};Jt.prototype.feature=function(Q){return new Zt(this._features[Q])};var se=i.vectorTile.VectorTileFeature,ce=oe;function oe(Q,it){this.options=it||{},this.features=Q,this.length=Q.length}function ye(Q,it){this.id=typeof Q.id=="number"?Q.id:void 0,this.type=Q.type,this.rawGeometry=Q.type===1?[Q.geometry]:Q.geometry,this.properties=Q.tags,this.extent=it||4096}oe.prototype.feature=function(Q){return new ye(this.features[Q],this.options.extent)},ye.prototype.loadGeometry=function(){var Q=this.rawGeometry;this.geometry=[];for(var it=0;it<Q.length;it++){for(var st=Q[it],_t=[],It=0;It<st.length;It++)_t.push(new i.Point$1(st[It][0],st[It][1]));this.geometry.push(_t)}return this.geometry},ye.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var Q=this.geometry,it=1/0,st=-1/0,_t=1/0,It=-1/0,Bt=0;Bt<Q.length;Bt++)for(var Gt=Q[Bt],dt=0;dt<Gt.length;dt++){var zt=Gt[dt];it=Math.min(it,zt.x),st=Math.max(st,zt.x),_t=Math.min(_t,zt.y),It=Math.max(It,zt.y)}return[it,_t,st,It]},ye.prototype.toGeoJSON=se.prototype.toGeoJSON;var be=ir,Me=ce;function ir(Q){var it=new i.pbf;return function(st,_t){for(var It in st.layers)_t.writeMessage(3,Be,st.layers[It])}(Q,it),it.finish()}function Be(Q,it){var st;it.writeVarintField(15,Q.version||1),it.writeStringField(1,Q.name||""),it.writeVarintField(5,Q.extent||4096);var _t={keys:[],values:[],keycache:{},valuecache:{}};for(st=0;st<Q.length;st++)_t.feature=Q.feature(st),it.writeMessage(2,qe,_t);var It=_t.keys;for(st=0;st<It.length;st++)it.writeStringField(3,It[st]);var Bt=_t.values;for(st=0;st<Bt.length;st++)it.writeMessage(4,_r,Bt[st])}function qe(Q,it){var st=Q.feature;st.id!==void 0&&it.writeVarintField(1,st.id),it.writeMessage(2,rr,Q),it.writeVarintField(3,st.type),it.writeMessage(4,yr,st)}function rr(Q,it){var st=Q.feature,_t=Q.keys,It=Q.values,Bt=Q.keycache,Gt=Q.valuecache;for(var dt in st.properties){var zt=Bt[dt];zt===void 0&&(_t.push(dt),Bt[dt]=zt=_t.length-1),it.writeVarint(zt);var Qt=st.properties[dt],nt=typeof Qt;nt!=="string"&&nt!=="boolean"&&nt!=="number"&&(Qt=JSON.stringify(Qt));var X=nt+":"+Qt,Z=Gt[X];Z===void 0&&(It.push(Qt),Gt[X]=Z=It.length-1),it.writeVarint(Z)}}function Ce(Q,it){return(it<<3)+(7&Q)}function Lr(Q){return Q<<1^Q>>31}function yr(Q,it){for(var st=Q.loadGeometry(),_t=Q.type,It=0,Bt=0,Gt=st.length,dt=0;dt<Gt;dt++){var zt=st[dt],Qt=1;_t===1&&(Qt=zt.length),it.writeVarint(Ce(1,Qt));for(var nt=_t===3?zt.length-1:zt.length,X=0;X<nt;X++){X===1&&_t!==1&&it.writeVarint(Ce(2,nt-1));var Z=zt[X].x-It,rt=zt[X].y-Bt;it.writeVarint(Lr(Z)),it.writeVarint(Lr(rt)),It+=Z,Bt+=rt}_t===3&&it.writeVarint(Ce(7,1))}}function _r(Q,it){var st=typeof Q;st==="string"?it.writeStringField(1,Q):st==="boolean"?it.writeBooleanField(7,Q):st==="number"&&(Q%1!=0?it.writeDoubleField(3,Q):Q<0?it.writeSVarintField(6,Q):it.writeVarintField(5,Q))}function br(Q,it,st,_t){xr(Q,st,_t),xr(it,2*st,2*_t),xr(it,2*st+1,2*_t+1)}function xr(Q,it,st){var _t=Q[it];Q[it]=Q[st],Q[st]=_t}function pr(Q,it,st,_t){var It=Q-st,Bt=it-_t;return It*It+Bt*Bt}be.fromVectorTileJs=ir,be.fromGeojsonVt=function(Q,it){it=it||{};var st={};for(var _t in Q)st[_t]=new ce(Q[_t].features,it),st[_t].name=_t,st[_t].version=it.version,st[_t].extent=it.extent;return ir({layers:st})},be.GeoJSONWrapper=Me;var $r=function(Q){return Q[0]},Fe=function(Q){return Q[1]},ti=function(Q,it,st,_t,It){it===void 0&&(it=$r),st===void 0&&(st=Fe),_t===void 0&&(_t=64),It===void 0&&(It=Float64Array),this.nodeSize=_t,this.points=Q;for(var Bt=Q.length<65536?Uint16Array:Uint32Array,Gt=this.ids=new Bt(Q.length),dt=this.coords=new It(2*Q.length),zt=0;zt<Q.length;zt++)Gt[zt]=zt,dt[2*zt]=it(Q[zt]),dt[2*zt+1]=st(Q[zt]);(function Qt(nt,X,Z,rt,lt,gt){if(!(lt-rt<=Z)){var pt=rt+lt>>1;(function St(Et,Ct,te,$t,ee,De){for(;ee>$t;){if(ee-$t>600){var Se=ee-$t+1,ze=te-$t+1,Ue=Math.log(Se),Dr=.5*Math.exp(2*Ue/3),ur=.5*Math.sqrt(Ue*Dr*(Se-Dr)/Se)*(ze-Se/2<0?-1:1);St(Et,Ct,te,Math.max($t,Math.floor(te-ze*Dr/Se+ur)),Math.min(ee,Math.floor(te+(Se-ze)*Dr/Se+ur)),De)}var mr=Ct[2*te+De],nr=$t,Xe=ee;for(br(Et,Ct,$t,te),Ct[2*ee+De]>mr&&br(Et,Ct,$t,ee);nr<Xe;){for(br(Et,Ct,nr,Xe),nr++,Xe--;Ct[2*nr+De]<mr;)nr++;for(;Ct[2*Xe+De]>mr;)Xe--}Ct[2*$t+De]===mr?br(Et,Ct,$t,Xe):br(Et,Ct,++Xe,ee),Xe<=te&&($t=Xe+1),te<=Xe&&(ee=Xe-1)}})(nt,X,pt,rt,lt,gt%2),Qt(nt,X,Z,rt,pt-1,gt+1),Qt(nt,X,Z,pt+1,lt,gt+1)}})(Gt,dt,_t,0,Gt.length-1,0)};ti.prototype.range=function(Q,it,st,_t){return function(It,Bt,Gt,dt,zt,Qt,nt){for(var X,Z,rt=[0,It.length-1,0],lt=[];rt.length;){var gt=rt.pop(),pt=rt.pop(),St=rt.pop();if(pt-St<=nt)for(var Et=St;Et<=pt;Et++)Z=Bt[2*Et+1],(X=Bt[2*Et])>=Gt&&X<=zt&&Z>=dt&&Z<=Qt&&lt.push(It[Et]);else{var Ct=Math.floor((St+pt)/2);Z=Bt[2*Ct+1],(X=Bt[2*Ct])>=Gt&&X<=zt&&Z>=dt&&Z<=Qt&&lt.push(It[Ct]);var te=(gt+1)%2;(gt===0?Gt<=X:dt<=Z)&&(rt.push(St),rt.push(Ct-1),rt.push(te)),(gt===0?zt>=X:Qt>=Z)&&(rt.push(Ct+1),rt.push(pt),rt.push(te))}}return lt}(this.ids,this.coords,Q,it,st,_t,this.nodeSize)},ti.prototype.within=function(Q,it,st){return function(_t,It,Bt,Gt,dt,zt){for(var Qt=[0,_t.length-1,0],nt=[],X=dt*dt;Qt.length;){var Z=Qt.pop(),rt=Qt.pop(),lt=Qt.pop();if(rt-lt<=zt)for(var gt=lt;gt<=rt;gt++)pr(It[2*gt],It[2*gt+1],Bt,Gt)<=X&&nt.push(_t[gt]);else{var pt=Math.floor((lt+rt)/2),St=It[2*pt],Et=It[2*pt+1];pr(St,Et,Bt,Gt)<=X&&nt.push(_t[pt]);var Ct=(Z+1)%2;(Z===0?Bt-dt<=St:Gt-dt<=Et)&&(Qt.push(lt),Qt.push(pt-1),Qt.push(Ct)),(Z===0?Bt+dt>=St:Gt+dt>=Et)&&(Qt.push(pt+1),Qt.push(rt),Qt.push(Ct))}}return nt}(this.ids,this.coords,Q,it,st,this.nodeSize)};var oi={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(Q){return Q}},ci=function(Q){this.options=xn(Object.create(oi),Q),this.trees=new Array(this.options.maxZoom+1)};function Ri(Q,it,st,_t,It){return{x:Q,y:it,zoom:1/0,id:st,parentId:-1,numPoints:_t,properties:It}}function Wr(Q,it){var st=Q.geometry.coordinates,_t=st[1];return{x:sn(st[0]),y:dr(_t),zoom:1/0,index:it,parentId:-1}}function Di(Q){return{type:"Feature",id:Q.id,properties:vn(Q),geometry:{type:"Point",coordinates:[(_t=Q.x,360*(_t-.5)),(it=Q.y,st=(180-360*it)*Math.PI/180,360*Math.atan(Math.exp(st))/Math.PI-90)]}};var it,st,_t}function vn(Q){var it=Q.numPoints,st=it>=1e4?Math.round(it/1e3)+"k":it>=1e3?Math.round(it/100)/10+"k":it;return xn(xn({},Q.properties),{cluster:!0,cluster_id:Q.id,point_count:it,point_count_abbreviated:st})}function sn(Q){return Q/360+.5}function dr(Q){var it=Math.sin(Q*Math.PI/180),st=.5-.25*Math.log((1+it)/(1-it))/Math.PI;return st<0?0:st>1?1:st}function xn(Q,it){for(var st in it)Q[st]=it[st];return Q}function en(Q){return Q.x}function ji(Q){return Q.y}function qn(Q,it,st,_t,It,Bt){var Gt=It-st,dt=Bt-_t;if(Gt!==0||dt!==0){var zt=((Q-st)*Gt+(it-_t)*dt)/(Gt*Gt+dt*dt);zt>1?(st=It,_t=Bt):zt>0&&(st+=Gt*zt,_t+=dt*zt)}return(Gt=Q-st)*Gt+(dt=it-_t)*dt}function Zn(Q,it,st,_t){var It={id:Q===void 0?null:Q,type:it,geometry:st,tags:_t,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(Bt){var Gt=Bt.geometry,dt=Bt.type;if(dt==="Point"||dt==="MultiPoint"||dt==="LineString")io(Bt,Gt);else if(dt==="Polygon"||dt==="MultiLineString")for(var zt=0;zt<Gt.length;zt++)io(Bt,Gt[zt]);else if(dt==="MultiPolygon")for(zt=0;zt<Gt.length;zt++)for(var Qt=0;Qt<Gt[zt].length;Qt++)io(Bt,Gt[zt][Qt])}(It),It}function io(Q,it){for(var st=0;st<it.length;st+=3)Q.minX=Math.min(Q.minX,it[st]),Q.minY=Math.min(Q.minY,it[st+1]),Q.maxX=Math.max(Q.maxX,it[st]),Q.maxY=Math.max(Q.maxY,it[st+1])}function Wi(Q,it,st,_t){if(it.geometry){var It=it.geometry.coordinates,Bt=it.geometry.type,Gt=Math.pow(st.tolerance/((1<<st.maxZoom)*st.extent),2),dt=[],zt=it.id;if(st.promoteId?zt=it.properties[st.promoteId]:st.generateId&&(zt=_t||0),Bt==="Point")bn(It,dt);else if(Bt==="MultiPoint")for(var Qt=0;Qt<It.length;Qt++)bn(It[Qt],dt);else if(Bt==="LineString")co(It,dt,Gt,!1);else if(Bt==="MultiLineString"){if(st.lineMetrics){for(Qt=0;Qt<It.length;Qt++)co(It[Qt],dt=[],Gt,!1),Q.push(Zn(zt,"LineString",dt,it.properties));return}zr(It,dt,Gt,!1)}else if(Bt==="Polygon")zr(It,dt,Gt,!0);else{if(Bt!=="MultiPolygon"){if(Bt==="GeometryCollection"){for(Qt=0;Qt<it.geometry.geometries.length;Qt++)Wi(Q,{id:zt,geometry:it.geometry.geometries[Qt],properties:it.properties},st,_t);return}throw new Error("Input data is not a valid GeoJSON object.")}for(Qt=0;Qt<It.length;Qt++){var nt=[];zr(It[Qt],nt,Gt,!0),dt.push(nt)}}Q.push(Zn(zt,Bt,dt,it.properties))}}function bn(Q,it){it.push($i(Q[0])),it.push(dn(Q[1])),it.push(0)}function co(Q,it,st,_t){for(var It,Bt,Gt=0,dt=0;dt<Q.length;dt++){var zt=$i(Q[dt][0]),Qt=dn(Q[dt][1]);it.push(zt),it.push(Qt),it.push(0),dt>0&&(Gt+=_t?(It*Qt-zt*Bt)/2:Math.sqrt(Math.pow(zt-It,2)+Math.pow(Qt-Bt,2))),It=zt,Bt=Qt}var nt=it.length-3;it[2]=1,function X(Z,rt,lt,gt){for(var pt,St=gt,Et=lt-rt>>1,Ct=lt-rt,te=Z[rt],$t=Z[rt+1],ee=Z[lt],De=Z[lt+1],Se=rt+3;Se<lt;Se+=3){var ze=qn(Z[Se],Z[Se+1],te,$t,ee,De);if(ze>St)pt=Se,St=ze;else if(ze===St){var Ue=Math.abs(Se-Et);Ue<Ct&&(pt=Se,Ct=Ue)}}St>gt&&(pt-rt>3&&X(Z,rt,pt,gt),Z[pt+2]=St,lt-pt>3&&X(Z,pt,lt,gt))}(it,0,nt,st),it[nt+2]=1,it.size=Math.abs(Gt),it.start=0,it.end=it.size}function zr(Q,it,st,_t){for(var It=0;It<Q.length;It++){var Bt=[];co(Q[It],Bt,st,_t),it.push(Bt)}}function $i(Q){return Q/360+.5}function dn(Q){var it=Math.sin(Q*Math.PI/180),st=.5-.25*Math.log((1+it)/(1-it))/Math.PI;return st<0?0:st>1?1:st}function ln(Q,it,st,_t,It,Bt,Gt,dt){if(_t/=it,Bt>=(st/=it)&&Gt<_t)return Q;if(Gt<st||Bt>=_t)return null;for(var zt=[],Qt=0;Qt<Q.length;Qt++){var nt=Q[Qt],X=nt.geometry,Z=nt.type,rt=It===0?nt.minX:nt.minY,lt=It===0?nt.maxX:nt.maxY;if(rt>=st&&lt<_t)zt.push(nt);else if(!(lt<st||rt>=_t)){var gt=[];if(Z==="Point"||Z==="MultiPoint")na(X,gt,st,_t,It);else if(Z==="LineString")fe(X,gt,st,_t,It,!1,dt.lineMetrics);else if(Z==="MultiLineString")no(X,gt,st,_t,It,!1);else if(Z==="Polygon")no(X,gt,st,_t,It,!0);else if(Z==="MultiPolygon")for(var pt=0;pt<X.length;pt++){var St=[];no(X[pt],St,st,_t,It,!0),St.length&&gt.push(St)}if(gt.length){if(dt.lineMetrics&&Z==="LineString"){for(pt=0;pt<gt.length;pt++)zt.push(Zn(nt.id,Z,gt[pt],nt.tags));continue}Z!=="LineString"&&Z!=="MultiLineString"||(gt.length===1?(Z="LineString",gt=gt[0]):Z="MultiLineString"),Z!=="Point"&&Z!=="MultiPoint"||(Z=gt.length===3?"Point":"MultiPoint"),zt.push(Zn(nt.id,Z,gt,nt.tags))}}}return zt.length?zt:null}function na(Q,it,st,_t,It){for(var Bt=0;Bt<Q.length;Bt+=3){var Gt=Q[Bt+It];Gt>=st&&Gt<=_t&&(it.push(Q[Bt]),it.push(Q[Bt+1]),it.push(Q[Bt+2]))}}function fe(Q,it,st,_t,It,Bt,Gt){for(var dt,zt,Qt=Ze(Q),nt=It===0?ii:En,X=Q.start,Z=0;Z<Q.length-3;Z+=3){var rt=Q[Z],lt=Q[Z+1],gt=Q[Z+2],pt=Q[Z+3],St=Q[Z+4],Et=It===0?rt:lt,Ct=It===0?pt:St,te=!1;Gt&&(dt=Math.sqrt(Math.pow(rt-pt,2)+Math.pow(lt-St,2))),Et<st?Ct>st&&(zt=nt(Qt,rt,lt,pt,St,st),Gt&&(Qt.start=X+dt*zt)):Et>_t?Ct<_t&&(zt=nt(Qt,rt,lt,pt,St,_t),Gt&&(Qt.start=X+dt*zt)):wn(Qt,rt,lt,gt),Ct<st&&Et>=st&&(zt=nt(Qt,rt,lt,pt,St,st),te=!0),Ct>_t&&Et<=_t&&(zt=nt(Qt,rt,lt,pt,St,_t),te=!0),!Bt&&te&&(Gt&&(Qt.end=X+dt*zt),it.push(Qt),Qt=Ze(Q)),Gt&&(X+=dt)}var $t=Q.length-3;rt=Q[$t],lt=Q[$t+1],gt=Q[$t+2],(Et=It===0?rt:lt)>=st&&Et<=_t&&wn(Qt,rt,lt,gt),$t=Qt.length-3,Bt&&$t>=3&&(Qt[$t]!==Qt[0]||Qt[$t+1]!==Qt[1])&&wn(Qt,Qt[0],Qt[1],Qt[2]),Qt.length&&it.push(Qt)}function Ze(Q){var it=[];return it.size=Q.size,it.start=Q.start,it.end=Q.end,it}function no(Q,it,st,_t,It,Bt){for(var Gt=0;Gt<Q.length;Gt++)fe(Q[Gt],it,st,_t,It,Bt,!1)}function wn(Q,it,st,_t){Q.push(it),Q.push(st),Q.push(_t)}function ii(Q,it,st,_t,It,Bt){var Gt=(Bt-it)/(_t-it);return Q.push(Bt),Q.push(st+(It-st)*Gt),Q.push(1),Gt}function En(Q,it,st,_t,It,Bt){var Gt=(Bt-st)/(It-st);return Q.push(it+(_t-it)*Gt),Q.push(Bt),Q.push(1),Gt}function Ei(Q,it){for(var st=[],_t=0;_t<Q.length;_t++){var It,Bt=Q[_t],Gt=Bt.type;if(Gt==="Point"||Gt==="MultiPoint"||Gt==="LineString")It=Xn(Bt.geometry,it);else if(Gt==="MultiLineString"||Gt==="Polygon"){It=[];for(var dt=0;dt<Bt.geometry.length;dt++)It.push(Xn(Bt.geometry[dt],it))}else if(Gt==="MultiPolygon")for(It=[],dt=0;dt<Bt.geometry.length;dt++){for(var zt=[],Qt=0;Qt<Bt.geometry[dt].length;Qt++)zt.push(Xn(Bt.geometry[dt][Qt],it));It.push(zt)}st.push(Zn(Bt.id,Gt,It,Bt.tags))}return st}function Xn(Q,it){var st=[];st.size=Q.size,Q.start!==void 0&&(st.start=Q.start,st.end=Q.end);for(var _t=0;_t<Q.length;_t+=3)st.push(Q[_t]+it,Q[_t+1],Q[_t+2]);return st}function ai(Q,it){if(Q.transformed)return Q;var st,_t,It,Bt=1<<Q.z,Gt=Q.x,dt=Q.y;for(st=0;st<Q.features.length;st++){var zt=Q.features[st],Qt=zt.geometry,nt=zt.type;if(zt.geometry=[],nt===1)for(_t=0;_t<Qt.length;_t+=2)zt.geometry.push(Ge(Qt[_t],Qt[_t+1],it,Bt,Gt,dt));else for(_t=0;_t<Qt.length;_t++){var X=[];for(It=0;It<Qt[_t].length;It+=2)X.push(Ge(Qt[_t][It],Qt[_t][It+1],it,Bt,Gt,dt));zt.geometry.push(X)}}return Q.transformed=!0,Q}function Ge(Q,it,st,_t,It,Bt){return[Math.round(st*(Q*_t-It)),Math.round(st*(it*_t-Bt))]}function Rr(Q,it,st,_t,It){for(var Bt=it===It.maxZoom?0:It.tolerance/((1<<it)*It.extent),Gt={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:st,y:_t,z:it,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},dt=0;dt<Q.length;dt++){Gt.numFeatures++,kr(Gt,Q[dt],Bt,It);var zt=Q[dt].minX,Qt=Q[dt].minY,nt=Q[dt].maxX,X=Q[dt].maxY;zt<Gt.minX&&(Gt.minX=zt),Qt<Gt.minY&&(Gt.minY=Qt),nt>Gt.maxX&&(Gt.maxX=nt),X>Gt.maxY&&(Gt.maxY=X)}return Gt}function kr(Q,it,st,_t){var It=it.geometry,Bt=it.type,Gt=[];if(Bt==="Point"||Bt==="MultiPoint")for(var dt=0;dt<It.length;dt+=3)Gt.push(It[dt]),Gt.push(It[dt+1]),Q.numPoints++,Q.numSimplified++;else if(Bt==="LineString")qi(Gt,It,Q,st,!1,!1);else if(Bt==="MultiLineString"||Bt==="Polygon")for(dt=0;dt<It.length;dt++)qi(Gt,It[dt],Q,st,Bt==="Polygon",dt===0);else if(Bt==="MultiPolygon")for(var zt=0;zt<It.length;zt++){var Qt=It[zt];for(dt=0;dt<Qt.length;dt++)qi(Gt,Qt[dt],Q,st,!0,dt===0)}if(Gt.length){var nt=it.tags||null;if(Bt==="LineString"&&_t.lineMetrics){for(var X in nt={},it.tags)nt[X]=it.tags[X];nt.mapbox_clip_start=It.start/It.size,nt.mapbox_clip_end=It.end/It.size}var Z={geometry:Gt,type:Bt==="Polygon"||Bt==="MultiPolygon"?3:Bt==="LineString"||Bt==="MultiLineString"?2:1,tags:nt};it.id!==null&&(Z.id=it.id),Q.features.push(Z)}}function qi(Q,it,st,_t,It,Bt){var Gt=_t*_t;if(_t>0&&it.size<(It?Gt:_t))st.numPoints+=it.length/3;else{for(var dt=[],zt=0;zt<it.length;zt+=3)(_t===0||it[zt+2]>Gt)&&(st.numSimplified++,dt.push(it[zt]),dt.push(it[zt+1])),st.numPoints++;It&&function(Qt,nt){for(var X=0,Z=0,rt=Qt.length,lt=rt-2;Z<rt;lt=Z,Z+=2)X+=(Qt[Z]-Qt[lt])*(Qt[Z+1]+Qt[lt+1]);if(X>0===nt)for(Z=0,rt=Qt.length;Z<rt/2;Z+=2){var gt=Qt[Z],pt=Qt[Z+1];Qt[Z]=Qt[rt-2-Z],Qt[Z+1]=Qt[rt-1-Z],Qt[rt-2-Z]=gt,Qt[rt-1-Z]=pt}}(dt,Bt),Q.push(dt)}}function Ki(Q,it){var st=(it=this.options=function(It,Bt){for(var Gt in Bt)It[Gt]=Bt[Gt];return It}(Object.create(this.options),it)).debug;if(st&&console.time("preprocess data"),it.maxZoom<0||it.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(it.promoteId&&it.generateId)throw new Error("promoteId and generateId cannot be used together.");var _t=function(It,Bt){var Gt=[];if(It.type==="FeatureCollection")for(var dt=0;dt<It.features.length;dt++)Wi(Gt,It.features[dt],Bt,dt);else Wi(Gt,It.type==="Feature"?It:{geometry:It},Bt);return Gt}(Q,it);this.tiles={},this.tileCoords=[],st&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",it.indexMaxZoom,it.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(_t=function(It,Bt){var Gt=Bt.buffer/Bt.extent,dt=It,zt=ln(It,1,-1-Gt,Gt,0,-1,2,Bt),Qt=ln(It,1,1-Gt,2+Gt,0,-1,2,Bt);return(zt||Qt)&&(dt=ln(It,1,-Gt,1+Gt,0,-1,2,Bt)||[],zt&&(dt=Ei(zt,1).concat(dt)),Qt&&(dt=dt.concat(Ei(Qt,-1)))),dt}(_t,it)).length&&this.splitTile(_t,0,0,0),st&&(_t.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function Tr(Q,it,st){return 32*((1<<Q)*st+it)+Q}function ho(Q,it){var st=Q.tileID.canonical;if(!this._geoJSONIndex)return it(null,null);var _t=this._geoJSONIndex.getTile(st.z,st.x,st.y);if(!_t)return it(null,null);var It=new Jt(_t.features),Bt=be(It);Bt.byteOffset===0&&Bt.byteLength===Bt.buffer.byteLength||(Bt=new Uint8Array(Bt)),it(null,{vectorTile:It,rawData:Bt.buffer})}ci.prototype.load=function(Q){var it=this.options,st=it.log,_t=it.minZoom,It=it.maxZoom,Bt=it.nodeSize;st&&console.time("total time");var Gt="prepare "+Q.length+" points";st&&console.time(Gt),this.points=Q;for(var dt=[],zt=0;zt<Q.length;zt++)Q[zt].geometry&&dt.push(Wr(Q[zt],zt));this.trees[It+1]=new ti(dt,en,ji,Bt,Float32Array),st&&console.timeEnd(Gt);for(var Qt=It;Qt>=_t;Qt--){var nt=+Date.now();dt=this._cluster(dt,Qt),this.trees[Qt]=new ti(dt,en,ji,Bt,Float32Array),st&&console.log("z%d: %d clusters in %dms",Qt,dt.length,+Date.now()-nt)}return st&&console.timeEnd("total time"),this},ci.prototype.getClusters=function(Q,it){var st=((Q[0]+180)%360+360)%360-180,_t=Math.max(-90,Math.min(90,Q[1])),It=Q[2]===180?180:((Q[2]+180)%360+360)%360-180,Bt=Math.max(-90,Math.min(90,Q[3]));if(Q[2]-Q[0]>=360)st=-180,It=180;else if(st>It){var Gt=this.getClusters([st,_t,180,Bt],it),dt=this.getClusters([-180,_t,It,Bt],it);return Gt.concat(dt)}for(var zt=this.trees[this._limitZoom(it)],Qt=[],nt=0,X=zt.range(sn(st),dr(Bt),sn(It),dr(_t));nt<X.length;nt+=1){var Z=zt.points[X[nt]];Qt.push(Z.numPoints?Di(Z):this.points[Z.index])}return Qt},ci.prototype.getChildren=function(Q){var it=this._getOriginId(Q),st=this._getOriginZoom(Q),_t="No cluster with the specified id.",It=this.trees[st];if(!It)throw new Error(_t);var Bt=It.points[it];if(!Bt)throw new Error(_t);for(var Gt=this.options.radius/(this.options.extent*Math.pow(2,st-1)),dt=[],zt=0,Qt=It.within(Bt.x,Bt.y,Gt);zt<Qt.length;zt+=1){var nt=It.points[Qt[zt]];nt.parentId===Q&&dt.push(nt.numPoints?Di(nt):this.points[nt.index])}if(dt.length===0)throw new Error(_t);return dt},ci.prototype.getLeaves=function(Q,it,st){var _t=[];return this._appendLeaves(_t,Q,it=it||10,st=st||0,0),_t},ci.prototype.getTile=function(Q,it,st){var _t=this.trees[this._limitZoom(Q)],It=Math.pow(2,Q),Bt=this.options,Gt=Bt.radius/Bt.extent,dt=(st-Gt)/It,zt=(st+1+Gt)/It,Qt={features:[]};return this._addTileFeatures(_t.range((it-Gt)/It,dt,(it+1+Gt)/It,zt),_t.points,it,st,It,Qt),it===0&&this._addTileFeatures(_t.range(1-Gt/It,dt,1,zt),_t.points,It,st,It,Qt),it===It-1&&this._addTileFeatures(_t.range(0,dt,Gt/It,zt),_t.points,-1,st,It,Qt),Qt.features.length?Qt:null},ci.prototype.getClusterExpansionZoom=function(Q){for(var it=this._getOriginZoom(Q)-1;it<=this.options.maxZoom;){var st=this.getChildren(Q);if(it++,st.length!==1)break;Q=st[0].properties.cluster_id}return it},ci.prototype._appendLeaves=function(Q,it,st,_t,It){for(var Bt=0,Gt=this.getChildren(it);Bt<Gt.length;Bt+=1){var dt=Gt[Bt],zt=dt.properties;if(zt&&zt.cluster?It+zt.point_count<=_t?It+=zt.point_count:It=this._appendLeaves(Q,zt.cluster_id,st,_t,It):It<_t?It++:Q.push(dt),Q.length===st)break}return It},ci.prototype._addTileFeatures=function(Q,it,st,_t,It,Bt){for(var Gt=0,dt=Q;Gt<dt.length;Gt+=1){var zt=it[dt[Gt]],Qt=zt.numPoints,nt={type:1,geometry:[[Math.round(this.options.extent*(zt.x*It-st)),Math.round(this.options.extent*(zt.y*It-_t))]],tags:Qt?vn(zt):this.points[zt.index].properties},X=void 0;Qt?X=zt.id:this.options.generateId?X=zt.index:this.points[zt.index].id&&(X=this.points[zt.index].id),X!==void 0&&(nt.id=X),Bt.features.push(nt)}},ci.prototype._limitZoom=function(Q){return Math.max(this.options.minZoom,Math.min(+Q,this.options.maxZoom+1))},ci.prototype._cluster=function(Q,it){for(var st=[],_t=this.options,It=_t.reduce,Bt=_t.minPoints,Gt=_t.radius/(_t.extent*Math.pow(2,it)),dt=0;dt<Q.length;dt++){var zt=Q[dt];if(!(zt.zoom<=it)){zt.zoom=it;for(var Qt=this.trees[it+1],nt=Qt.within(zt.x,zt.y,Gt),X=zt.numPoints||1,Z=X,rt=0,lt=nt;rt<lt.length;rt+=1){var gt=Qt.points[lt[rt]];gt.zoom>it&&(Z+=gt.numPoints||1)}if(Z>=Bt){for(var pt=zt.x*X,St=zt.y*X,Et=It&&X>1?this._map(zt,!0):null,Ct=(dt<<5)+(it+1)+this.points.length,te=0,$t=nt;te<$t.length;te+=1){var ee=Qt.points[$t[te]];if(!(ee.zoom<=it)){ee.zoom=it;var De=ee.numPoints||1;pt+=ee.x*De,St+=ee.y*De,ee.parentId=Ct,It&&(Et||(Et=this._map(zt,!0)),It(Et,this._map(ee)))}}zt.parentId=Ct,st.push(Ri(pt/Z,St/Z,Ct,Z,Et))}else if(st.push(zt),Z>1)for(var Se=0,ze=nt;Se<ze.length;Se+=1){var Ue=Qt.points[ze[Se]];Ue.zoom<=it||(Ue.zoom=it,st.push(Ue))}}}return st},ci.prototype._getOriginId=function(Q){return Q-this.points.length>>5},ci.prototype._getOriginZoom=function(Q){return(Q-this.points.length)%32},ci.prototype._map=function(Q,it){if(Q.numPoints)return it?xn({},Q.properties):Q.properties;var st=this.points[Q.index].properties,_t=this.options.map(st);return it&&_t===st?xn({},_t):_t},Ki.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Ki.prototype.splitTile=function(Q,it,st,_t,It,Bt,Gt){for(var dt=[Q,it,st,_t],zt=this.options,Qt=zt.debug;dt.length;){_t=dt.pop(),st=dt.pop(),it=dt.pop(),Q=dt.pop();var nt=1<<it,X=Tr(it,st,_t),Z=this.tiles[X];if(!Z&&(Qt>1&&console.time("creation"),Z=this.tiles[X]=Rr(Q,it,st,_t,zt),this.tileCoords.push({z:it,x:st,y:_t}),Qt)){Qt>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",it,st,_t,Z.numFeatures,Z.numPoints,Z.numSimplified),console.timeEnd("creation"));var rt="z"+it;this.stats[rt]=(this.stats[rt]||0)+1,this.total++}if(Z.source=Q,It){if(it===zt.maxZoom||it===It)continue;var lt=1<<It-it;if(st!==Math.floor(Bt/lt)||_t!==Math.floor(Gt/lt))continue}else if(it===zt.indexMaxZoom||Z.numPoints<=zt.indexMaxPoints)continue;if(Z.source=null,Q.length!==0){Qt>1&&console.time("clipping");var gt,pt,St,Et,Ct,te,$t=.5*zt.buffer/zt.extent,ee=.5-$t,De=.5+$t,Se=1+$t;gt=pt=St=Et=null,Ct=ln(Q,nt,st-$t,st+De,0,Z.minX,Z.maxX,zt),te=ln(Q,nt,st+ee,st+Se,0,Z.minX,Z.maxX,zt),Q=null,Ct&&(gt=ln(Ct,nt,_t-$t,_t+De,1,Z.minY,Z.maxY,zt),pt=ln(Ct,nt,_t+ee,_t+Se,1,Z.minY,Z.maxY,zt),Ct=null),te&&(St=ln(te,nt,_t-$t,_t+De,1,Z.minY,Z.maxY,zt),Et=ln(te,nt,_t+ee,_t+Se,1,Z.minY,Z.maxY,zt),te=null),Qt>1&&console.timeEnd("clipping"),dt.push(gt||[],it+1,2*st,2*_t),dt.push(pt||[],it+1,2*st,2*_t+1),dt.push(St||[],it+1,2*st+1,2*_t),dt.push(Et||[],it+1,2*st+1,2*_t+1)}}},Ki.prototype.getTile=function(Q,it,st){var _t=this.options,It=_t.extent,Bt=_t.debug;if(Q<0||Q>24)return null;var Gt=1<<Q,dt=Tr(Q,it=(it%Gt+Gt)%Gt,st);if(this.tiles[dt])return ai(this.tiles[dt],It);Bt>1&&console.log("drilling down to z%d-%d-%d",Q,it,st);for(var zt,Qt=Q,nt=it,X=st;!zt&&Qt>0;)Qt--,nt=Math.floor(nt/2),X=Math.floor(X/2),zt=this.tiles[Tr(Qt,nt,X)];return zt&&zt.source?(Bt>1&&console.log("found parent tile z%d-%d-%d",Qt,nt,X),Bt>1&&console.time("drilling down"),this.splitTile(zt.source,Qt,nt,X,Q,it,st),Bt>1&&console.timeEnd("drilling down"),this.tiles[dt]?ai(this.tiles[dt],It):null):null};var Rn=function(Q){function it(st,_t,It,Bt){Q.call(this,st,_t,It,ho),Bt&&(this.loadGeoJSON=Bt)}return Q&&(it.__proto__=Q),(it.prototype=Object.create(Q&&Q.prototype)).constructor=it,it.prototype.loadData=function(st,_t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=_t,this._pendingLoadDataParams=st,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},it.prototype._loadData=function(){var st=this;if(this._pendingCallback&&this._pendingLoadDataParams){var _t=this._pendingCallback,It=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var Bt=!!(It&&It.request&&It.request.collectResourceTiming)&&new i.RequestPerformance(It.request);this.loadGeoJSON(It,function(Gt,dt){if(Gt||!dt)return _t(Gt);if(typeof dt!="object")return _t(new Error("Input data given to '"+It.source+"' is not a valid GeoJSON object."));(function Z(rt,lt){var gt,pt=rt&&rt.type;if(pt==="FeatureCollection")for(gt=0;gt<rt.features.length;gt++)Z(rt.features[gt],lt);else if(pt==="GeometryCollection")for(gt=0;gt<rt.geometries.length;gt++)Z(rt.geometries[gt],lt);else if(pt==="Feature")Z(rt.geometry,lt);else if(pt==="Polygon")Vt(rt.coordinates,lt);else if(pt==="MultiPolygon")for(gt=0;gt<rt.coordinates.length;gt++)Vt(rt.coordinates[gt],lt);return rt})(dt,!0);try{if(It.filter){var zt=i.createExpression(It.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(zt.result==="error")throw new Error(zt.value.map(function(Z){return Z.key+": "+Z.message}).join(", "));var Qt=dt.features.filter(function(Z){return zt.value.evaluate({zoom:0},Z)});dt={type:"FeatureCollection",features:Qt}}st._geoJSONIndex=It.cluster?new ci(function(Z){var rt=Z.superclusterOptions,lt=Z.clusterProperties;if(!lt||!rt)return rt;for(var gt={},pt={},St={accumulated:null,zoom:0},Et={properties:null},Ct=Object.keys(lt),te=0,$t=Ct;te<$t.length;te+=1){var ee=$t[te],De=lt[ee],Se=De[0],ze=i.createExpression(De[1]),Ue=i.createExpression(typeof Se=="string"?[Se,["accumulated"],["get",ee]]:Se);gt[ee]=ze.value,pt[ee]=Ue.value}return rt.map=function(Dr){Et.properties=Dr;for(var ur={},mr=0,nr=Ct;mr<nr.length;mr+=1){var Xe=nr[mr];ur[Xe]=gt[Xe].evaluate(St,Et)}return ur},rt.reduce=function(Dr,ur){Et.properties=ur;for(var mr=0,nr=Ct;mr<nr.length;mr+=1){var Xe=nr[mr];St.accumulated=Dr[Xe],Dr[Xe]=pt[Xe].evaluate(St,Et)}},rt}(It)).load(dt.features):function(Z,rt){return new Ki(Z,rt)}(dt,It.geojsonVtOptions)}catch(Z){return _t(Z)}st.loaded={};var nt={};if(Bt){var X=Bt.finish();X&&(nt.resourceTiming={},nt.resourceTiming[It.source]=JSON.parse(JSON.stringify(X)))}_t(null,nt)})}},it.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},it.prototype.reloadTile=function(st,_t){var It=this.loaded;return It&&It[st.uid]?Q.prototype.reloadTile.call(this,st,_t):this.loadTile(st,_t)},it.prototype.loadGeoJSON=function(st,_t){if(st.request)i.getJSON(st.request,_t);else{if(typeof st.data!="string")return _t(new Error("Input data given to '"+st.source+"' is not a valid GeoJSON object."));try{return _t(null,JSON.parse(st.data))}catch{return _t(new Error("Input data given to '"+st.source+"' is not a valid GeoJSON object."))}}},it.prototype.removeSource=function(st,_t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),_t()},it.prototype.getClusterExpansionZoom=function(st,_t){try{_t(null,this._geoJSONIndex.getClusterExpansionZoom(st.clusterId))}catch(It){_t(It)}},it.prototype.getClusterChildren=function(st,_t){try{_t(null,this._geoJSONIndex.getChildren(st.clusterId))}catch(It){_t(It)}},it.prototype.getClusterLeaves=function(st,_t){try{_t(null,this._geoJSONIndex.getLeaves(st.clusterId,st.limit,st.offset))}catch(It){_t(It)}},it}(yt),hi=function(Q){var it=this;this.self=Q,this.actor=new i.Actor(Q,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:yt,geojson:Rn},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(st,_t){if(it.workerSourceTypes[st])throw new Error('Worker source with name "'+st+'" already registered.');it.workerSourceTypes[st]=_t},this.self.registerRTLTextPlugin=function(st){if(i.plugin.isParsed())throw new Error("RTL text plugin already registered.");i.plugin.applyArabicShaping=st.applyArabicShaping,i.plugin.processBidirectionalText=st.processBidirectionalText,i.plugin.processStyledBidirectionalText=st.processStyledBidirectionalText}};return hi.prototype.setReferrer=function(Q,it){this.referrer=it},hi.prototype.setImages=function(Q,it,st){for(var _t in this.availableImages[Q]=it,this.workerSources[Q]){var It=this.workerSources[Q][_t];for(var Bt in It)It[Bt].availableImages=it}st()},hi.prototype.setLayers=function(Q,it,st){this.getLayerIndex(Q).replace(it),st()},hi.prototype.updateLayers=function(Q,it,st){this.getLayerIndex(Q).update(it.layers,it.removedIds),st()},hi.prototype.loadTile=function(Q,it,st){this.getWorkerSource(Q,it.type,it.source).loadTile(it,st)},hi.prototype.loadDEMTile=function(Q,it,st){this.getDEMWorkerSource(Q,it.source).loadTile(it,st)},hi.prototype.reloadTile=function(Q,it,st){this.getWorkerSource(Q,it.type,it.source).reloadTile(it,st)},hi.prototype.abortTile=function(Q,it,st){this.getWorkerSource(Q,it.type,it.source).abortTile(it,st)},hi.prototype.removeTile=function(Q,it,st){this.getWorkerSource(Q,it.type,it.source).removeTile(it,st)},hi.prototype.removeDEMTile=function(Q,it){this.getDEMWorkerSource(Q,it.source).removeTile(it)},hi.prototype.removeSource=function(Q,it,st){if(this.workerSources[Q]&&this.workerSources[Q][it.type]&&this.workerSources[Q][it.type][it.source]){var _t=this.workerSources[Q][it.type][it.source];delete this.workerSources[Q][it.type][it.source],_t.removeSource!==void 0?_t.removeSource(it,st):st()}},hi.prototype.loadWorkerSource=function(Q,it,st){try{this.self.importScripts(it.url),st()}catch(_t){st(_t.toString())}},hi.prototype.syncRTLPluginState=function(Q,it,st){try{i.plugin.setState(it);var _t=i.plugin.getPluginURL();if(i.plugin.isLoaded()&&!i.plugin.isParsed()&&_t!=null){this.self.importScripts(_t);var It=i.plugin.isParsed();st(It?void 0:new Error("RTL Text Plugin failed to import scripts from "+_t),It)}}catch(Bt){st(Bt.toString())}},hi.prototype.getAvailableImages=function(Q){var it=this.availableImages[Q];return it||(it=[]),it},hi.prototype.getLayerIndex=function(Q){var it=this.layerIndexes[Q];return it||(it=this.layerIndexes[Q]=new D),it},hi.prototype.getWorkerSource=function(Q,it,st){var _t=this;return this.workerSources[Q]||(this.workerSources[Q]={}),this.workerSources[Q][it]||(this.workerSources[Q][it]={}),this.workerSources[Q][it][st]||(this.workerSources[Q][it][st]=new this.workerSourceTypes[it]({send:function(It,Bt,Gt){_t.actor.send(It,Bt,Gt,Q)}},this.getLayerIndex(Q),this.getAvailableImages(Q))),this.workerSources[Q][it][st]},hi.prototype.getDEMWorkerSource=function(Q,it){return this.demWorkerSources[Q]||(this.demWorkerSources[Q]={}),this.demWorkerSources[Q][it]||(this.demWorkerSources[Q][it]=new kt),this.demWorkerSources[Q][it]},hi.prototype.enforceCacheSizeLimit=function(Q,it){i.enforceCacheSizeLimit(it)},typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new hi(self)),hi}),c(["./shared"],function(i){"use strict";var u=i.createCommonjsModule(function(p){function m(A){return!d(A)}function d(A){return typeof window>"u"||typeof document>"u"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var R,j,K=new Blob([""],{type:"text/javascript"}),tt=URL.createObjectURL(K);try{j=new Worker(tt),R=!0}catch{R=!1}return j&&j.terminate(),URL.revokeObjectURL(tt),R}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var R=document.createElement("canvas");R.width=R.height=1;var j=R.getContext("2d");if(!j)return!1;var K=j.getImageData(0,0,1,1);return K&&K.width===R.width}()?(x[k=A&&A.failIfMajorPerformanceCaveat]===void 0&&(x[k]=function(R){var j=function(tt){var ct=document.createElement("canvas"),ft=Object.create(m.webGLContextAttributes);return ft.failIfMajorPerformanceCaveat=tt,ct.probablySupportsContext?ct.probablySupportsContext("webgl",ft)||ct.probablySupportsContext("experimental-webgl",ft):ct.supportsContext?ct.supportsContext("webgl",ft)||ct.supportsContext("experimental-webgl",ft):ct.getContext("webgl",ft)||ct.getContext("experimental-webgl",ft)}(R);if(!j)return!1;var K=j.createShader(j.VERTEX_SHADER);return!(!K||j.isContextLost())&&(j.shaderSource(K,"void main() {}"),j.compileShader(K),j.getShaderParameter(K,j.COMPILE_STATUS)===!0)}(k)),x[k]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var k}p.exports?p.exports=m:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=m,window.mapboxgl.notSupportedReason=d);var x={};m.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}}),P={create:function(p,m,d){var x=i.window.document.createElement(p);return m!==void 0&&(x.className=m),d&&d.appendChild(x),x},createNS:function(p,m){return i.window.document.createElementNS(p,m)}},D=i.window.document&&i.window.document.documentElement.style;function F(p){if(!D)return p[0];for(var m=0;m<p.length;m++)if(p[m]in D)return p[m];return p[0]}var U,N=F(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);P.disableDrag=function(){D&&N&&(U=D[N],D[N]="none")},P.enableDrag=function(){D&&N&&(D[N]=U)};var at=F(["transform","WebkitTransform"]);P.setTransform=function(p,m){p.style[at]=m};var yt=!1;try{var Tt=Object.defineProperty({},"passive",{get:function(){yt=!0}});i.window.addEventListener("test",Tt,Tt),i.window.removeEventListener("test",Tt,Tt)}catch{yt=!1}P.addEventListener=function(p,m,d,x){x===void 0&&(x={}),p.addEventListener(m,d,"passive"in x&&yt?x:x.capture)},P.removeEventListener=function(p,m,d,x){x===void 0&&(x={}),p.removeEventListener(m,d,"passive"in x&&yt?x:x.capture)};var kt=function(p){p.preventDefault(),p.stopPropagation(),i.window.removeEventListener("click",kt,!0)};function Vt(p){var m=p.userImage;return!!(m&&m.render&&m.render())&&(p.data.replace(new Uint8Array(m.data.buffer)),!0)}P.suppressClick=function(){i.window.addEventListener("click",kt,!0),i.window.setTimeout(function(){i.window.removeEventListener("click",kt,!0)},0)},P.mousePos=function(p,m){var d=p.getBoundingClientRect();return new i.Point(m.clientX-d.left-p.clientLeft,m.clientY-d.top-p.clientTop)},P.touchPos=function(p,m){for(var d=p.getBoundingClientRect(),x=[],A=0;A<m.length;A++)x.push(new i.Point(m[A].clientX-d.left-p.clientLeft,m[A].clientY-d.top-p.clientTop));return x},P.mouseButton=function(p){return i.window.InstallTrigger!==void 0&&p.button===2&&p.ctrlKey&&i.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:p.button},P.remove=function(p){p.parentNode&&p.parentNode.removeChild(p)};var wt=function(p){function m(){p.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new i.RGBAImage({width:1,height:1}),this.dirty=!0}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.isLoaded=function(){return this.loaded},m.prototype.setLoaded=function(d){if(this.loaded!==d&&(this.loaded=d,d)){for(var x=0,A=this.requestors;x<A.length;x+=1){var k=A[x];this._notify(k.ids,k.callback)}this.requestors=[]}},m.prototype.getImage=function(d){return this.images[d]},m.prototype.addImage=function(d,x){this._validate(d,x)&&(this.images[d]=x)},m.prototype._validate=function(d,x){var A=!0;return this._validateStretch(x.stretchX,x.data&&x.data.width)||(this.fire(new i.ErrorEvent(new Error('Image "'+d+'" has invalid "stretchX" value'))),A=!1),this._validateStretch(x.stretchY,x.data&&x.data.height)||(this.fire(new i.ErrorEvent(new Error('Image "'+d+'" has invalid "stretchY" value'))),A=!1),this._validateContent(x.content,x)||(this.fire(new i.ErrorEvent(new Error('Image "'+d+'" has invalid "content" value'))),A=!1),A},m.prototype._validateStretch=function(d,x){if(!d)return!0;for(var A=0,k=0,R=d;k<R.length;k+=1){var j=R[k];if(j[0]<A||j[1]<j[0]||x<j[1])return!1;A=j[1]}return!0},m.prototype._validateContent=function(d,x){return!(d&&(d.length!==4||d[0]<0||x.data.width<d[0]||d[1]<0||x.data.height<d[1]||d[2]<0||x.data.width<d[2]||d[3]<0||x.data.height<d[3]||d[2]<d[0]||d[3]<d[1]))},m.prototype.updateImage=function(d,x){x.version=this.images[d].version+1,this.images[d]=x,this.updatedImages[d]=!0},m.prototype.removeImage=function(d){var x=this.images[d];delete this.images[d],delete this.patterns[d],x.userImage&&x.userImage.onRemove&&x.userImage.onRemove()},m.prototype.listImages=function(){return Object.keys(this.images)},m.prototype.getImages=function(d,x){var A=!0;if(!this.isLoaded())for(var k=0,R=d;k<R.length;k+=1)this.images[R[k]]||(A=!1);this.isLoaded()||A?this._notify(d,x):this.requestors.push({ids:d,callback:x})},m.prototype._notify=function(d,x){for(var A={},k=0,R=d;k<R.length;k+=1){var j=R[k];this.images[j]||this.fire(new i.Event("styleimagemissing",{id:j}));var K=this.images[j];K?A[j]={data:K.data.clone(),pixelRatio:K.pixelRatio,sdf:K.sdf,version:K.version,stretchX:K.stretchX,stretchY:K.stretchY,content:K.content,hasRenderCallback:Boolean(K.userImage&&K.userImage.render)}:i.warnOnce('Image "'+j+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}x(null,A)},m.prototype.getPixelSize=function(){var d=this.atlasImage;return{width:d.width,height:d.height}},m.prototype.getPattern=function(d){var x=this.patterns[d],A=this.getImage(d);if(!A)return null;if(x&&x.position.version===A.version)return x.position;if(x)x.position.version=A.version;else{var k={w:A.data.width+2,h:A.data.height+2,x:0,y:0},R=new i.ImagePosition(k,A);this.patterns[d]={bin:k,position:R}}return this._updatePatternAtlas(),this.patterns[d].position},m.prototype.bind=function(d){var x=d.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new i.Texture(d,this.atlasImage,x.RGBA),this.atlasTexture.bind(x.LINEAR,x.CLAMP_TO_EDGE)},m.prototype._updatePatternAtlas=function(){var d=[];for(var x in this.patterns)d.push(this.patterns[x].bin);var A=i.potpack(d),k=A.w,R=A.h,j=this.atlasImage;for(var K in j.resize({width:k||1,height:R||1}),this.patterns){var tt=this.patterns[K].bin,ct=tt.x+1,ft=tt.y+1,mt=this.images[K].data,Mt=mt.width,At=mt.height;i.RGBAImage.copy(mt,j,{x:0,y:0},{x:ct,y:ft},{width:Mt,height:At}),i.RGBAImage.copy(mt,j,{x:0,y:At-1},{x:ct,y:ft-1},{width:Mt,height:1}),i.RGBAImage.copy(mt,j,{x:0,y:0},{x:ct,y:ft+At},{width:Mt,height:1}),i.RGBAImage.copy(mt,j,{x:Mt-1,y:0},{x:ct-1,y:ft},{width:1,height:At}),i.RGBAImage.copy(mt,j,{x:0,y:0},{x:ct+Mt,y:ft},{width:1,height:At})}this.dirty=!0},m.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},m.prototype.dispatchRenderCallbacks=function(d){for(var x=0,A=d;x<A.length;x+=1){var k=A[x];if(!this.callbackDispatchedThisFrame[k]){this.callbackDispatchedThisFrame[k]=!0;var R=this.images[k];Vt(R)&&this.updateImage(k,R)}}},m}(i.Evented),Lt=se,Zt=se,Jt=1e20;function se(p,m,d,x,A,k){this.fontSize=p||24,this.buffer=m===void 0?3:m,this.cutoff=x||.25,this.fontFamily=A||"sans-serif",this.fontWeight=k||"normal",this.radius=d||8;var R=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=R,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(R*R),this.gridInner=new Float64Array(R*R),this.f=new Float64Array(R),this.d=new Float64Array(R),this.z=new Float64Array(R+1),this.v=new Int16Array(R),this.middle=Math.round(R/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function ce(p,m,d,x,A,k,R){for(var j=0;j<m;j++){for(var K=0;K<d;K++)x[K]=p[K*m+j];for(oe(x,A,k,R,d),K=0;K<d;K++)p[K*m+j]=A[K]}for(K=0;K<d;K++){for(j=0;j<m;j++)x[j]=p[K*m+j];for(oe(x,A,k,R,m),j=0;j<m;j++)p[K*m+j]=Math.sqrt(A[j])}}function oe(p,m,d,x,A){d[0]=0,x[0]=-Jt,x[1]=+Jt;for(var k=1,R=0;k<A;k++){for(var j=(p[k]+k*k-(p[d[R]]+d[R]*d[R]))/(2*k-2*d[R]);j<=x[R];)R--,j=(p[k]+k*k-(p[d[R]]+d[R]*d[R]))/(2*k-2*d[R]);d[++R]=k,x[R]=j,x[R+1]=+Jt}for(k=0,R=0;k<A;k++){for(;x[R+1]<k;)R++;m[k]=(k-d[R])*(k-d[R])+p[d[R]]}}se.prototype.draw=function(p){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(p,this.buffer,this.middle);for(var m=this.ctx.getImageData(0,0,this.size,this.size),d=new Uint8ClampedArray(this.size*this.size),x=0;x<this.size*this.size;x++){var A=m.data[4*x+3]/255;this.gridOuter[x]=A===1?0:A===0?Jt:Math.pow(Math.max(0,.5-A),2),this.gridInner[x]=A===1?Jt:A===0?0:Math.pow(Math.max(0,A-.5),2)}for(ce(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),ce(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),x=0;x<this.size*this.size;x++)d[x]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[x]-this.gridInner[x])/this.radius+this.cutoff))));return d},Lt.default=Zt;var ye=function(p,m){this.requestManager=p,this.localIdeographFontFamily=m,this.entries={}};ye.prototype.setURL=function(p){this.url=p},ye.prototype.getGlyphs=function(p,m){var d=this,x=[];for(var A in p)for(var k=0,R=p[A];k<R.length;k+=1)x.push({stack:A,id:R[k]});i.asyncAll(x,function(j,K){var tt=j.stack,ct=j.id,ft=d.entries[tt];ft||(ft=d.entries[tt]={glyphs:{},requests:{},ranges:{}});var mt=ft.glyphs[ct];if(mt===void 0){if(mt=d._tinySDF(ft,tt,ct))return ft.glyphs[ct]=mt,void K(null,{stack:tt,id:ct,glyph:mt});var Mt=Math.floor(ct/256);if(256*Mt>65535)K(new Error("glyphs > 65535 not supported"));else if(ft.ranges[Mt])K(null,{stack:tt,id:ct,glyph:mt});else{var At=ft.requests[Mt];At||(At=ft.requests[Mt]=[],ye.loadGlyphRange(tt,Mt,d.url,d.requestManager,function(Dt,xt){if(xt){for(var Rt in xt)d._doesCharSupportLocalGlyph(+Rt)||(ft.glyphs[+Rt]=xt[+Rt]);ft.ranges[Mt]=!0}for(var Nt=0,Yt=At;Nt<Yt.length;Nt+=1)(0,Yt[Nt])(Dt,xt);delete ft.requests[Mt]})),At.push(function(Dt,xt){Dt?K(Dt):xt&&K(null,{stack:tt,id:ct,glyph:xt[ct]||null})})}}else K(null,{stack:tt,id:ct,glyph:mt})},function(j,K){if(j)m(j);else if(K){for(var tt={},ct=0,ft=K;ct<ft.length;ct+=1){var mt=ft[ct],Mt=mt.stack,At=mt.id,Dt=mt.glyph;(tt[Mt]||(tt[Mt]={}))[At]=Dt&&{id:Dt.id,bitmap:Dt.bitmap.clone(),metrics:Dt.metrics}}m(null,tt)}})},ye.prototype._doesCharSupportLocalGlyph=function(p){return!!this.localIdeographFontFamily&&(i.isChar["CJK Unified Ideographs"](p)||i.isChar["Hangul Syllables"](p)||i.isChar.Hiragana(p)||i.isChar.Katakana(p))},ye.prototype._tinySDF=function(p,m,d){var x=this.localIdeographFontFamily;if(x&&this._doesCharSupportLocalGlyph(d)){var A=p.tinySDF;if(!A){var k="400";/bold/i.test(m)?k="900":/medium/i.test(m)?k="500":/light/i.test(m)&&(k="200"),A=p.tinySDF=new ye.TinySDF(24,3,8,.25,x,k)}return{id:d,bitmap:new i.AlphaImage({width:30,height:30},A.draw(String.fromCharCode(d))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},ye.loadGlyphRange=function(p,m,d,x,A){var k=256*m,R=k+255,j=x.transformRequest(x.normalizeGlyphsURL(d).replace("{fontstack}",p).replace("{range}",k+"-"+R),i.ResourceType.Glyphs);i.getArrayBuffer(j,function(K,tt){if(K)A(K);else if(tt){for(var ct={},ft=0,mt=i.parseGlyphPBF(tt);ft<mt.length;ft+=1){var Mt=mt[ft];ct[Mt.id]=Mt}A(null,ct)}})},ye.TinySDF=Lt;var be=function(){this.specification=i.styleSpec.light.position};be.prototype.possiblyEvaluate=function(p,m){return i.sphericalToCartesian(p.expression.evaluate(m))},be.prototype.interpolate=function(p,m,d){return{x:i.number(p.x,m.x,d),y:i.number(p.y,m.y,d),z:i.number(p.z,m.z,d)}};var Me=new i.Properties({anchor:new i.DataConstantProperty(i.styleSpec.light.anchor),position:new be,color:new i.DataConstantProperty(i.styleSpec.light.color),intensity:new i.DataConstantProperty(i.styleSpec.light.intensity)}),ir=function(p){function m(d){p.call(this),this._transitionable=new i.Transitionable(Me),this.setLight(d),this._transitioning=this._transitionable.untransitioned()}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getLight=function(){return this._transitionable.serialize()},m.prototype.setLight=function(d,x){if(x===void 0&&(x={}),!this._validate(i.validateLight,d,x))for(var A in d){var k=d[A];i.endsWith(A,"-transition")?this._transitionable.setTransition(A.slice(0,-11),k):this._transitionable.setValue(A,k)}},m.prototype.updateTransitions=function(d){this._transitioning=this._transitionable.transitioned(d,this._transitioning)},m.prototype.hasTransition=function(){return this._transitioning.hasTransition()},m.prototype.recalculate=function(d){this.properties=this._transitioning.possiblyEvaluate(d)},m.prototype._validate=function(d,x,A){return(!A||A.validate!==!1)&&i.emitValidationErrors(this,d.call(i.validateStyle,i.extend({value:x,style:{glyphs:!0,sprite:!0},styleSpec:i.styleSpec})))},m}(i.Evented),Be=function(p,m){this.width=p,this.height=m,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};Be.prototype.getDash=function(p,m){var d=p.join(",")+String(m);return this.dashEntry[d]||(this.dashEntry[d]=this.addDash(p,m)),this.dashEntry[d]},Be.prototype.getDashRanges=function(p,m,d){var x=[],A=p.length%2==1?-p[p.length-1]*d:0,k=p[0]*d,R=!0;x.push({left:A,right:k,isDash:R,zeroLength:p[0]===0});for(var j=p[0],K=1;K<p.length;K++){var tt=p[K];x.push({left:A=j*d,right:k=(j+=tt)*d,isDash:R=!R,zeroLength:tt===0})}return x},Be.prototype.addRoundDash=function(p,m,d){for(var x=m/2,A=-d;A<=d;A++)for(var k=this.width*(this.nextRow+d+A),R=0,j=p[R],K=0;K<this.width;K++){K/j.right>1&&(j=p[++R]);var tt=Math.abs(K-j.left),ct=Math.abs(K-j.right),ft=Math.min(tt,ct),mt=void 0,Mt=A/d*(x+1);if(j.isDash){var At=x-Math.abs(Mt);mt=Math.sqrt(ft*ft+At*At)}else mt=x-Math.sqrt(ft*ft+Mt*Mt);this.data[k+K]=Math.max(0,Math.min(255,mt+128))}},Be.prototype.addRegularDash=function(p){for(var m=p.length-1;m>=0;--m){var d=p[m],x=p[m+1];d.zeroLength?p.splice(m,1):x&&x.isDash===d.isDash&&(x.left=d.left,p.splice(m,1))}var A=p[0],k=p[p.length-1];A.isDash===k.isDash&&(A.left=k.left-this.width,k.right=A.right+this.width);for(var R=this.width*this.nextRow,j=0,K=p[j],tt=0;tt<this.width;tt++){tt/K.right>1&&(K=p[++j]);var ct=Math.abs(tt-K.left),ft=Math.abs(tt-K.right),mt=Math.min(ct,ft);this.data[R+tt]=Math.max(0,Math.min(255,(K.isDash?mt:-mt)+128))}},Be.prototype.addDash=function(p,m){var d=m?7:0,x=2*d+1;if(this.nextRow+x>this.height)return i.warnOnce("LineAtlas out of space"),null;for(var A=0,k=0;k<p.length;k++)A+=p[k];if(A!==0){var R=this.width/A,j=this.getDashRanges(p,this.width,R);m?this.addRoundDash(j,R,d):this.addRegularDash(j)}var K={y:(this.nextRow+d+.5)/this.height,height:2*d/this.height,width:A};return this.nextRow+=x,this.dirty=!0,K},Be.prototype.bind=function(p){var m=p.gl;this.texture?(m.bindTexture(m.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,m.texSubImage2D(m.TEXTURE_2D,0,0,0,this.width,this.height,m.ALPHA,m.UNSIGNED_BYTE,this.data))):(this.texture=m.createTexture(),m.bindTexture(m.TEXTURE_2D,this.texture),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.REPEAT),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.REPEAT),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.LINEAR),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.LINEAR),m.texImage2D(m.TEXTURE_2D,0,m.ALPHA,this.width,this.height,0,m.ALPHA,m.UNSIGNED_BYTE,this.data))};var qe=function p(m,d){this.workerPool=m,this.actors=[],this.currentActor=0,this.id=i.uniqueId();for(var x=this.workerPool.acquire(this.id),A=0;A<x.length;A++){var k=new p.Actor(x[A],d,this.id);k.name="Worker "+A,this.actors.push(k)}};function rr(p,m,d){var x=function(A,k){if(A)return d(A);if(k){var R=i.pick(i.extend(k,p),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);k.vector_layers&&(R.vectorLayers=k.vector_layers,R.vectorLayerIds=R.vectorLayers.map(function(j){return j.id})),R.tiles=m.canonicalizeTileset(R,p.url),d(null,R)}};return p.url?i.getJSON(m.transformRequest(m.normalizeSourceURL(p.url),i.ResourceType.Source),x):i.browser.frame(function(){return x(null,p)})}qe.prototype.broadcast=function(p,m,d){i.asyncAll(this.actors,function(x,A){x.send(p,m,A)},d=d||function(){})},qe.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},qe.prototype.remove=function(){this.actors.forEach(function(p){p.remove()}),this.actors=[],this.workerPool.release(this.id)},qe.Actor=i.Actor;var Ce=function(p,m,d){this.bounds=i.LngLatBounds.convert(this.validateBounds(p)),this.minzoom=m||0,this.maxzoom=d||24};Ce.prototype.validateBounds=function(p){return Array.isArray(p)&&p.length===4?[Math.max(-180,p[0]),Math.max(-90,p[1]),Math.min(180,p[2]),Math.min(90,p[3])]:[-180,-90,180,90]},Ce.prototype.contains=function(p){var m=Math.pow(2,p.z),d=Math.floor(i.mercatorXfromLng(this.bounds.getWest())*m),x=Math.floor(i.mercatorYfromLat(this.bounds.getNorth())*m),A=Math.ceil(i.mercatorXfromLng(this.bounds.getEast())*m),k=Math.ceil(i.mercatorYfromLat(this.bounds.getSouth())*m);return p.x>=d&&p.x<A&&p.y>=x&&p.y<k};var Lr=function(p){function m(d,x,A,k){if(p.call(this),this.id=d,this.dispatcher=A,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,i.extend(this,i.pick(x,["url","scheme","tileSize","promoteId"])),this._options=i.extend({type:"vector"},x),this._collectResourceTiming=x.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(k)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.load=function(){var d=this;this._loaded=!1,this.fire(new i.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=rr(this._options,this.map._requestManager,function(x,A){d._tileJSONRequest=null,d._loaded=!0,x?d.fire(new i.ErrorEvent(x)):A&&(i.extend(d,A),A.bounds&&(d.tileBounds=new Ce(A.bounds,d.minzoom,d.maxzoom)),i.postTurnstileEvent(A.tiles,d.map._requestManager._customAccessToken),i.postMapLoadEvent(A.tiles,d.map._getMapId(),d.map._requestManager._skuToken,d.map._requestManager._customAccessToken),d.fire(new i.Event("data",{dataType:"source",sourceDataType:"metadata"})),d.fire(new i.Event("data",{dataType:"source",sourceDataType:"content"})))})},m.prototype.loaded=function(){return this._loaded},m.prototype.hasTile=function(d){return!this.tileBounds||this.tileBounds.contains(d.canonical)},m.prototype.onAdd=function(d){this.map=d,this.load()},m.prototype.setSourceProperty=function(d){this._tileJSONRequest&&this._tileJSONRequest.cancel(),d(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},m.prototype.setTiles=function(d){var x=this;return this.setSourceProperty(function(){x._options.tiles=d}),this},m.prototype.setUrl=function(d){var x=this;return this.setSourceProperty(function(){x.url=d,x._options.url=d}),this},m.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},m.prototype.serialize=function(){return i.extend({},this._options)},m.prototype.loadTile=function(d,x){var A=this.map._requestManager.normalizeTileURL(d.tileID.canonical.url(this.tiles,this.scheme)),k={request:this.map._requestManager.transformRequest(A,i.ResourceType.Tile),uid:d.uid,tileID:d.tileID,zoom:d.tileID.overscaledZ,tileSize:this.tileSize*d.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:i.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function R(j,K){return delete d.request,d.aborted?x(null):j&&j.status!==404?x(j):(K&&K.resourceTiming&&(d.resourceTiming=K.resourceTiming),this.map._refreshExpiredTiles&&K&&d.setExpiryData(K),d.loadVectorData(K,this.map.painter),i.cacheEntryPossiblyAdded(this.dispatcher),x(null),void(d.reloadCallback&&(this.loadTile(d,d.reloadCallback),d.reloadCallback=null)))}k.request.collectResourceTiming=this._collectResourceTiming,d.actor&&d.state!=="expired"?d.state==="loading"?d.reloadCallback=x:d.request=d.actor.send("reloadTile",k,R.bind(this)):(d.actor=this.dispatcher.getActor(),d.request=d.actor.send("loadTile",k,R.bind(this)))},m.prototype.abortTile=function(d){d.request&&(d.request.cancel(),delete d.request),d.actor&&d.actor.send("abortTile",{uid:d.uid,type:this.type,source:this.id},void 0)},m.prototype.unloadTile=function(d){d.unloadVectorData(),d.actor&&d.actor.send("removeTile",{uid:d.uid,type:this.type,source:this.id},void 0)},m.prototype.hasTransition=function(){return!1},m}(i.Evented),yr=function(p){function m(d,x,A,k){p.call(this),this.id=d,this.dispatcher=A,this.setEventedParent(k),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=i.extend({type:"raster"},x),i.extend(this,i.pick(x,["url","scheme","tileSize"]))}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.load=function(){var d=this;this._loaded=!1,this.fire(new i.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=rr(this._options,this.map._requestManager,function(x,A){d._tileJSONRequest=null,d._loaded=!0,x?d.fire(new i.ErrorEvent(x)):A&&(i.extend(d,A),A.bounds&&(d.tileBounds=new Ce(A.bounds,d.minzoom,d.maxzoom)),i.postTurnstileEvent(A.tiles),i.postMapLoadEvent(A.tiles,d.map._getMapId(),d.map._requestManager._skuToken),d.fire(new i.Event("data",{dataType:"source",sourceDataType:"metadata"})),d.fire(new i.Event("data",{dataType:"source",sourceDataType:"content"})))})},m.prototype.loaded=function(){return this._loaded},m.prototype.onAdd=function(d){this.map=d,this.load()},m.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},m.prototype.serialize=function(){return i.extend({},this._options)},m.prototype.hasTile=function(d){return!this.tileBounds||this.tileBounds.contains(d.canonical)},m.prototype.loadTile=function(d,x){var A=this,k=this.map._requestManager.normalizeTileURL(d.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);d.request=i.getImage(this.map._requestManager.transformRequest(k,i.ResourceType.Tile),function(R,j){if(delete d.request,d.aborted)d.state="unloaded",x(null);else if(R)d.state="errored",x(R);else if(j){A.map._refreshExpiredTiles&&d.setExpiryData(j),delete j.cacheControl,delete j.expires;var K=A.map.painter.context,tt=K.gl;d.texture=A.map.painter.getTileTexture(j.width),d.texture?d.texture.update(j,{useMipmap:!0}):(d.texture=new i.Texture(K,j,tt.RGBA,{useMipmap:!0}),d.texture.bind(tt.LINEAR,tt.CLAMP_TO_EDGE,tt.LINEAR_MIPMAP_NEAREST),K.extTextureFilterAnisotropic&&tt.texParameterf(tt.TEXTURE_2D,K.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,K.extTextureFilterAnisotropicMax)),d.state="loaded",i.cacheEntryPossiblyAdded(A.dispatcher),x(null)}})},m.prototype.abortTile=function(d,x){d.request&&(d.request.cancel(),delete d.request),x()},m.prototype.unloadTile=function(d,x){d.texture&&this.map.painter.saveTileTexture(d.texture),x()},m.prototype.hasTransition=function(){return!1},m}(i.Evented),_r=function(p){function m(d,x,A,k){p.call(this,d,x,A,k),this.type="raster-dem",this.maxzoom=22,this._options=i.extend({type:"raster-dem"},x),this.encoding=x.encoding||"mapbox"}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},m.prototype.loadTile=function(d,x){var A=this.map._requestManager.normalizeTileURL(d.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function k(R,j){R&&(d.state="errored",x(R)),j&&(d.dem=j,d.needsHillshadePrepare=!0,d.state="loaded",x(null))}d.request=i.getImage(this.map._requestManager.transformRequest(A,i.ResourceType.Tile),function(R,j){if(delete d.request,d.aborted)d.state="unloaded",x(null);else if(R)d.state="errored",x(R);else if(j){this.map._refreshExpiredTiles&&d.setExpiryData(j),delete j.cacheControl,delete j.expires;var K=i.window.ImageBitmap&&j instanceof i.window.ImageBitmap&&i.offscreenCanvasSupported()?j:i.browser.getImageData(j,1),tt={uid:d.uid,coord:d.tileID,source:this.id,rawImageData:K,encoding:this.encoding};d.actor&&d.state!=="expired"||(d.actor=this.dispatcher.getActor(),d.actor.send("loadDEMTile",tt,k.bind(this)))}}.bind(this)),d.neighboringTiles=this._getNeighboringTiles(d.tileID)},m.prototype._getNeighboringTiles=function(d){var x=d.canonical,A=Math.pow(2,x.z),k=(x.x-1+A)%A,R=x.x===0?d.wrap-1:d.wrap,j=(x.x+1+A)%A,K=x.x+1===A?d.wrap+1:d.wrap,tt={};return tt[new i.OverscaledTileID(d.overscaledZ,R,x.z,k,x.y).key]={backfilled:!1},tt[new i.OverscaledTileID(d.overscaledZ,K,x.z,j,x.y).key]={backfilled:!1},x.y>0&&(tt[new i.OverscaledTileID(d.overscaledZ,R,x.z,k,x.y-1).key]={backfilled:!1},tt[new i.OverscaledTileID(d.overscaledZ,d.wrap,x.z,x.x,x.y-1).key]={backfilled:!1},tt[new i.OverscaledTileID(d.overscaledZ,K,x.z,j,x.y-1).key]={backfilled:!1}),x.y+1<A&&(tt[new i.OverscaledTileID(d.overscaledZ,R,x.z,k,x.y+1).key]={backfilled:!1},tt[new i.OverscaledTileID(d.overscaledZ,d.wrap,x.z,x.x,x.y+1).key]={backfilled:!1},tt[new i.OverscaledTileID(d.overscaledZ,K,x.z,j,x.y+1).key]={backfilled:!1}),tt},m.prototype.unloadTile=function(d){d.demTexture&&this.map.painter.saveTileTexture(d.demTexture),d.fbo&&(d.fbo.destroy(),delete d.fbo),d.dem&&delete d.dem,delete d.neighboringTiles,d.state="unloaded",d.actor&&d.actor.send("removeDEMTile",{uid:d.uid,source:this.id})},m}(yr),br=function(p){function m(d,x,A,k){p.call(this),this.id=d,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=A.getActor(),this.setEventedParent(k),this._data=x.data,this._options=i.extend({},x),this._collectResourceTiming=x.collectResourceTiming,this._resourceTiming=[],x.maxzoom!==void 0&&(this.maxzoom=x.maxzoom),x.type&&(this.type=x.type),x.attribution&&(this.attribution=x.attribution),this.promoteId=x.promoteId;var R=i.EXTENT/this.tileSize;this.workerOptions=i.extend({source:this.id,cluster:x.cluster||!1,geojsonVtOptions:{buffer:(x.buffer!==void 0?x.buffer:128)*R,tolerance:(x.tolerance!==void 0?x.tolerance:.375)*R,extent:i.EXTENT,maxZoom:this.maxzoom,lineMetrics:x.lineMetrics||!1,generateId:x.generateId||!1},superclusterOptions:{maxZoom:x.clusterMaxZoom!==void 0?Math.min(x.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,x.clusterMinPoints||2),extent:i.EXTENT,radius:(x.clusterRadius||50)*R,log:!1,generateId:x.generateId||!1},clusterProperties:x.clusterProperties,filter:x.filter},x.workerOptions)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.load=function(){var d=this;this.fire(new i.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(x){if(x)d.fire(new i.ErrorEvent(x));else{var A={dataType:"source",sourceDataType:"metadata"};d._collectResourceTiming&&d._resourceTiming&&d._resourceTiming.length>0&&(A.resourceTiming=d._resourceTiming,d._resourceTiming=[]),d.fire(new i.Event("data",A))}})},m.prototype.onAdd=function(d){this.map=d,this.load()},m.prototype.setData=function(d){var x=this;return this._data=d,this.fire(new i.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(A){if(A)x.fire(new i.ErrorEvent(A));else{var k={dataType:"source",sourceDataType:"content"};x._collectResourceTiming&&x._resourceTiming&&x._resourceTiming.length>0&&(k.resourceTiming=x._resourceTiming,x._resourceTiming=[]),x.fire(new i.Event("data",k))}}),this},m.prototype.getClusterExpansionZoom=function(d,x){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:d,source:this.id},x),this},m.prototype.getClusterChildren=function(d,x){return this.actor.send("geojson.getClusterChildren",{clusterId:d,source:this.id},x),this},m.prototype.getClusterLeaves=function(d,x,A,k){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:d,limit:x,offset:A},k),this},m.prototype._updateWorkerData=function(d){var x=this;this._loaded=!1;var A=i.extend({},this.workerOptions),k=this._data;typeof k=="string"?(A.request=this.map._requestManager.transformRequest(i.browser.resolveURL(k),i.ResourceType.Source),A.request.collectResourceTiming=this._collectResourceTiming):A.data=JSON.stringify(k),this.actor.send(this.type+".loadData",A,function(R,j){x._removed||j&&j.abandoned||(x._loaded=!0,j&&j.resourceTiming&&j.resourceTiming[x.id]&&(x._resourceTiming=j.resourceTiming[x.id].slice(0)),x.actor.send(x.type+".coalesce",{source:A.source},null),d(R))})},m.prototype.loaded=function(){return this._loaded},m.prototype.loadTile=function(d,x){var A=this,k=d.actor?"reloadTile":"loadTile";d.actor=this.actor,d.request=this.actor.send(k,{type:this.type,uid:d.uid,tileID:d.tileID,zoom:d.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:i.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},function(R,j){return delete d.request,d.unloadVectorData(),d.aborted?x(null):R?x(R):(d.loadVectorData(j,A.map.painter,k==="reloadTile"),x(null))})},m.prototype.abortTile=function(d){d.request&&(d.request.cancel(),delete d.request),d.aborted=!0},m.prototype.unloadTile=function(d){d.unloadVectorData(),this.actor.send("removeTile",{uid:d.uid,type:this.type,source:this.id})},m.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},m.prototype.serialize=function(){return i.extend({},this._options,{type:this.type,data:this._data})},m.prototype.hasTransition=function(){return!1},m}(i.Evented),xr=i.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),pr=function(p){function m(d,x,A,k){p.call(this),this.id=d,this.dispatcher=A,this.coordinates=x.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(k),this.options=x}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.load=function(d,x){var A=this;this._loaded=!1,this.fire(new i.Event("dataloading",{dataType:"source"})),this.url=this.options.url,i.getImage(this.map._requestManager.transformRequest(this.url,i.ResourceType.Image),function(k,R){A._loaded=!0,k?A.fire(new i.ErrorEvent(k)):R&&(A.image=R,d&&(A.coordinates=d),x&&x(),A._finishLoading())})},m.prototype.loaded=function(){return this._loaded},m.prototype.updateImage=function(d){var x=this;return this.image&&d.url?(this.options.url=d.url,this.load(d.coordinates,function(){x.texture=null}),this):this},m.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new i.Event("data",{dataType:"source",sourceDataType:"metadata"})))},m.prototype.onAdd=function(d){this.map=d,this.load()},m.prototype.setCoordinates=function(d){var x=this;this.coordinates=d;var A=d.map(i.MercatorCoordinate.fromLngLat);this.tileID=function(R){for(var j=1/0,K=1/0,tt=-1/0,ct=-1/0,ft=0,mt=R;ft<mt.length;ft+=1){var Mt=mt[ft];j=Math.min(j,Mt.x),K=Math.min(K,Mt.y),tt=Math.max(tt,Mt.x),ct=Math.max(ct,Mt.y)}var At=Math.max(tt-j,ct-K),Dt=Math.max(0,Math.floor(-Math.log(At)/Math.LN2)),xt=Math.pow(2,Dt);return new i.CanonicalTileID(Dt,Math.floor((j+tt)/2*xt),Math.floor((K+ct)/2*xt))}(A),this.minzoom=this.maxzoom=this.tileID.z;var k=A.map(function(R){return x.tileID.getTilePoint(R)._round()});return this._boundsArray=new i.StructArrayLayout4i8,this._boundsArray.emplaceBack(k[0].x,k[0].y,0,0),this._boundsArray.emplaceBack(k[1].x,k[1].y,i.EXTENT,0),this._boundsArray.emplaceBack(k[3].x,k[3].y,0,i.EXTENT),this._boundsArray.emplaceBack(k[2].x,k[2].y,i.EXTENT,i.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new i.Event("data",{dataType:"source",sourceDataType:"content"})),this},m.prototype.prepare=function(){if(Object.keys(this.tiles).length!==0&&this.image){var d=this.map.painter.context,x=d.gl;for(var A in this.boundsBuffer||(this.boundsBuffer=d.createVertexBuffer(this._boundsArray,xr.members)),this.boundsSegments||(this.boundsSegments=i.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new i.Texture(d,this.image,x.RGBA),this.texture.bind(x.LINEAR,x.CLAMP_TO_EDGE)),this.tiles){var k=this.tiles[A];k.state!=="loaded"&&(k.state="loaded",k.texture=this.texture)}}},m.prototype.loadTile=function(d,x){this.tileID&&this.tileID.equals(d.tileID.canonical)?(this.tiles[String(d.tileID.wrap)]=d,d.buckets={},x(null)):(d.state="errored",x(null))},m.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},m.prototype.hasTransition=function(){return!1},m}(i.Evented),$r=function(p){function m(d,x,A,k){p.call(this,d,x,A,k),this.roundZoom=!0,this.type="video",this.options=x}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.load=function(){var d=this;this._loaded=!1;var x=this.options;this.urls=[];for(var A=0,k=x.urls;A<k.length;A+=1)this.urls.push(this.map._requestManager.transformRequest(k[A],i.ResourceType.Source).url);i.getVideo(this.urls,function(R,j){d._loaded=!0,R?d.fire(new i.ErrorEvent(R)):j&&(d.video=j,d.video.loop=!0,d.video.addEventListener("playing",function(){d.map.triggerRepaint()}),d.map&&d.video.play(),d._finishLoading())})},m.prototype.pause=function(){this.video&&this.video.pause()},m.prototype.play=function(){this.video&&this.video.play()},m.prototype.seek=function(d){if(this.video){var x=this.video.seekable;d<x.start(0)||d>x.end(0)?this.fire(new i.ErrorEvent(new i.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+x.start(0)+" and "+x.end(0)+"-second mark."))):this.video.currentTime=d}},m.prototype.getVideo=function(){return this.video},m.prototype.onAdd=function(d){this.map||(this.map=d,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},m.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var d=this.map.painter.context,x=d.gl;for(var A in this.boundsBuffer||(this.boundsBuffer=d.createVertexBuffer(this._boundsArray,xr.members)),this.boundsSegments||(this.boundsSegments=i.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(x.LINEAR,x.CLAMP_TO_EDGE),x.texSubImage2D(x.TEXTURE_2D,0,0,0,x.RGBA,x.UNSIGNED_BYTE,this.video)):(this.texture=new i.Texture(d,this.video,x.RGBA),this.texture.bind(x.LINEAR,x.CLAMP_TO_EDGE)),this.tiles){var k=this.tiles[A];k.state!=="loaded"&&(k.state="loaded",k.texture=this.texture)}}},m.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},m.prototype.hasTransition=function(){return this.video&&!this.video.paused},m}(pr),Fe=function(p){function m(d,x,A,k){p.call(this,d,x,A,k),x.coordinates?Array.isArray(x.coordinates)&&x.coordinates.length===4&&!x.coordinates.some(function(R){return!Array.isArray(R)||R.length!==2||R.some(function(j){return typeof j!="number"})})||this.fire(new i.ErrorEvent(new i.ValidationError("sources."+d,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new i.ErrorEvent(new i.ValidationError("sources."+d,null,'missing required property "coordinates"'))),x.animate&&typeof x.animate!="boolean"&&this.fire(new i.ErrorEvent(new i.ValidationError("sources."+d,null,'optional "animate" property must be a boolean value'))),x.canvas?typeof x.canvas=="string"||x.canvas instanceof i.window.HTMLCanvasElement||this.fire(new i.ErrorEvent(new i.ValidationError("sources."+d,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new i.ErrorEvent(new i.ValidationError("sources."+d,null,'missing required property "canvas"'))),this.options=x,this.animate=x.animate===void 0||x.animate}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof i.window.HTMLCanvasElement?this.options.canvas:i.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new i.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},m.prototype.getCanvas=function(){return this.canvas},m.prototype.onAdd=function(d){this.map=d,this.load(),this.canvas&&this.animate&&this.play()},m.prototype.onRemove=function(){this.pause()},m.prototype.prepare=function(){var d=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,d=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,d=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var x=this.map.painter.context,A=x.gl;for(var k in this.boundsBuffer||(this.boundsBuffer=x.createVertexBuffer(this._boundsArray,xr.members)),this.boundsSegments||(this.boundsSegments=i.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(d||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new i.Texture(x,this.canvas,A.RGBA,{premultiply:!0}),this.tiles){var R=this.tiles[k];R.state!=="loaded"&&(R.state="loaded",R.texture=this.texture)}}},m.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},m.prototype.hasTransition=function(){return this._playing},m.prototype._hasInvalidDimensions=function(){for(var d=0,x=[this.canvas.width,this.canvas.height];d<x.length;d+=1){var A=x[d];if(isNaN(A)||A<=0)return!0}return!1},m}(pr),ti={vector:Lr,raster:yr,"raster-dem":_r,geojson:br,video:$r,image:pr,canvas:Fe};function oi(p,m){var d=i.identity([]);return i.translate(d,d,[1,1,0]),i.scale(d,d,[.5*p.width,.5*p.height,1]),i.multiply(d,d,p.calculatePosMatrix(m.toUnwrapped()))}function ci(p,m,d,x,A,k){var R=function(Dt,xt,Rt){if(Dt)for(var Nt=0,Yt=Dt;Nt<Yt.length;Nt+=1){var ne=xt[Yt[Nt]];if(ne&&ne.source===Rt&&ne.type==="fill-extrusion")return!0}else for(var ae in xt){var le=xt[ae];if(le.source===Rt&&le.type==="fill-extrusion")return!0}return!1}(A&&A.layers,m,p.id),j=k.maxPitchScaleFactor(),K=p.tilesIn(x,j,R);K.sort(Ri);for(var tt=[],ct=0,ft=K;ct<ft.length;ct+=1){var mt=ft[ct];tt.push({wrappedTileID:mt.tileID.wrapped().key,queryResults:mt.tile.queryRenderedFeatures(m,d,p._state,mt.queryGeometry,mt.cameraQueryGeometry,mt.scale,A,k,j,oi(p.transform,mt.tileID))})}var Mt=function(Dt){for(var xt={},Rt={},Nt=0,Yt=Dt;Nt<Yt.length;Nt+=1){var ne=Yt[Nt],ae=ne.queryResults,le=ne.wrappedTileID,xe=Rt[le]=Rt[le]||{};for(var ke in ae)for(var Le=ae[ke],$e=xe[ke]=xe[ke]||{},lr=xt[ke]=xt[ke]||[],hr=0,sr=Le;hr<sr.length;hr+=1){var Zr=sr[hr];$e[Zr.featureIndex]||($e[Zr.featureIndex]=!0,lr.push(Zr))}}return xt}(tt);for(var At in Mt)Mt[At].forEach(function(Dt){var xt=Dt.feature,Rt=p.getFeatureState(xt.layer["source-layer"],xt.id);xt.source=xt.layer.source,xt.layer["source-layer"]&&(xt.sourceLayer=xt.layer["source-layer"]),xt.state=Rt});return Mt}function Ri(p,m){var d=p.tileID,x=m.tileID;return d.overscaledZ-x.overscaledZ||d.canonical.y-x.canonical.y||d.wrap-x.wrap||d.canonical.x-x.canonical.x}var Wr=function(p,m){this.max=p,this.onRemove=m,this.reset()};Wr.prototype.reset=function(){for(var p in this.data)for(var m=0,d=this.data[p];m<d.length;m+=1){var x=d[m];x.timeout&&clearTimeout(x.timeout),this.onRemove(x.value)}return this.data={},this.order=[],this},Wr.prototype.add=function(p,m,d){var x=this,A=p.wrapped().key;this.data[A]===void 0&&(this.data[A]=[]);var k={value:m,timeout:void 0};if(d!==void 0&&(k.timeout=setTimeout(function(){x.remove(p,k)},d)),this.data[A].push(k),this.order.push(A),this.order.length>this.max){var R=this._getAndRemoveByKey(this.order[0]);R&&this.onRemove(R)}return this},Wr.prototype.has=function(p){return p.wrapped().key in this.data},Wr.prototype.getAndRemove=function(p){return this.has(p)?this._getAndRemoveByKey(p.wrapped().key):null},Wr.prototype._getAndRemoveByKey=function(p){var m=this.data[p].shift();return m.timeout&&clearTimeout(m.timeout),this.data[p].length===0&&delete this.data[p],this.order.splice(this.order.indexOf(p),1),m.value},Wr.prototype.getByKey=function(p){var m=this.data[p];return m?m[0].value:null},Wr.prototype.get=function(p){return this.has(p)?this.data[p.wrapped().key][0].value:null},Wr.prototype.remove=function(p,m){if(!this.has(p))return this;var d=p.wrapped().key,x=m===void 0?0:this.data[d].indexOf(m),A=this.data[d][x];return this.data[d].splice(x,1),A.timeout&&clearTimeout(A.timeout),this.data[d].length===0&&delete this.data[d],this.onRemove(A.value),this.order.splice(this.order.indexOf(d),1),this},Wr.prototype.setMaxSize=function(p){for(this.max=p;this.order.length>this.max;){var m=this._getAndRemoveByKey(this.order[0]);m&&this.onRemove(m)}return this},Wr.prototype.filter=function(p){var m=[];for(var d in this.data)for(var x=0,A=this.data[d];x<A.length;x+=1){var k=A[x];p(k.value)||m.push(k)}for(var R=0,j=m;R<j.length;R+=1){var K=j[R];this.remove(K.value.tileID,K)}};var Di=function(p,m,d){this.context=p;var x=p.gl;this.buffer=x.createBuffer(),this.dynamicDraw=Boolean(d),this.context.unbindVAO(),p.bindElementBuffer.set(this.buffer),x.bufferData(x.ELEMENT_ARRAY_BUFFER,m.arrayBuffer,this.dynamicDraw?x.DYNAMIC_DRAW:x.STATIC_DRAW),this.dynamicDraw||delete m.arrayBuffer};Di.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Di.prototype.updateData=function(p){var m=this.context.gl;this.context.unbindVAO(),this.bind(),m.bufferSubData(m.ELEMENT_ARRAY_BUFFER,0,p.arrayBuffer)},Di.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var vn={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},sn=function(p,m,d,x){this.length=m.length,this.attributes=d,this.itemSize=m.bytesPerElement,this.dynamicDraw=x,this.context=p;var A=p.gl;this.buffer=A.createBuffer(),p.bindVertexBuffer.set(this.buffer),A.bufferData(A.ARRAY_BUFFER,m.arrayBuffer,this.dynamicDraw?A.DYNAMIC_DRAW:A.STATIC_DRAW),this.dynamicDraw||delete m.arrayBuffer};sn.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},sn.prototype.updateData=function(p){var m=this.context.gl;this.bind(),m.bufferSubData(m.ARRAY_BUFFER,0,p.arrayBuffer)},sn.prototype.enableAttributes=function(p,m){for(var d=0;d<this.attributes.length;d++){var x=m.attributes[this.attributes[d].name];x!==void 0&&p.enableVertexAttribArray(x)}},sn.prototype.setVertexAttribPointers=function(p,m,d){for(var x=0;x<this.attributes.length;x++){var A=this.attributes[x],k=m.attributes[A.name];k!==void 0&&p.vertexAttribPointer(k,A.components,p[vn[A.type]],!1,this.itemSize,A.offset+this.itemSize*(d||0))}},sn.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var dr=function(p){this.gl=p.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};dr.prototype.get=function(){return this.current},dr.prototype.set=function(p){},dr.prototype.getDefault=function(){return this.default},dr.prototype.setDefault=function(){this.set(this.default)};var xn=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return i.Color.transparent},m.prototype.set=function(d){var x=this.current;(d.r!==x.r||d.g!==x.g||d.b!==x.b||d.a!==x.a||this.dirty)&&(this.gl.clearColor(d.r,d.g,d.b,d.a),this.current=d,this.dirty=!1)},m}(dr),en=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return 1},m.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.clearDepth(d),this.current=d,this.dirty=!1)},m}(dr),ji=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return 0},m.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.clearStencil(d),this.current=d,this.dirty=!1)},m}(dr),qn=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return[!0,!0,!0,!0]},m.prototype.set=function(d){var x=this.current;(d[0]!==x[0]||d[1]!==x[1]||d[2]!==x[2]||d[3]!==x[3]||this.dirty)&&(this.gl.colorMask(d[0],d[1],d[2],d[3]),this.current=d,this.dirty=!1)},m}(dr),Zn=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return!0},m.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.depthMask(d),this.current=d,this.dirty=!1)},m}(dr),io=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return 255},m.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.stencilMask(d),this.current=d,this.dirty=!1)},m}(dr),Wi=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},m.prototype.set=function(d){var x=this.current;(d.func!==x.func||d.ref!==x.ref||d.mask!==x.mask||this.dirty)&&(this.gl.stencilFunc(d.func,d.ref,d.mask),this.current=d,this.dirty=!1)},m}(dr),bn=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){var d=this.gl;return[d.KEEP,d.KEEP,d.KEEP]},m.prototype.set=function(d){var x=this.current;(d[0]!==x[0]||d[1]!==x[1]||d[2]!==x[2]||this.dirty)&&(this.gl.stencilOp(d[0],d[1],d[2]),this.current=d,this.dirty=!1)},m}(dr),co=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return!1},m.prototype.set=function(d){if(d!==this.current||this.dirty){var x=this.gl;d?x.enable(x.STENCIL_TEST):x.disable(x.STENCIL_TEST),this.current=d,this.dirty=!1}},m}(dr),zr=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return[0,1]},m.prototype.set=function(d){var x=this.current;(d[0]!==x[0]||d[1]!==x[1]||this.dirty)&&(this.gl.depthRange(d[0],d[1]),this.current=d,this.dirty=!1)},m}(dr),$i=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return!1},m.prototype.set=function(d){if(d!==this.current||this.dirty){var x=this.gl;d?x.enable(x.DEPTH_TEST):x.disable(x.DEPTH_TEST),this.current=d,this.dirty=!1}},m}(dr),dn=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return this.gl.LESS},m.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.depthFunc(d),this.current=d,this.dirty=!1)},m}(dr),ln=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return!1},m.prototype.set=function(d){if(d!==this.current||this.dirty){var x=this.gl;d?x.enable(x.BLEND):x.disable(x.BLEND),this.current=d,this.dirty=!1}},m}(dr),na=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){var d=this.gl;return[d.ONE,d.ZERO]},m.prototype.set=function(d){var x=this.current;(d[0]!==x[0]||d[1]!==x[1]||this.dirty)&&(this.gl.blendFunc(d[0],d[1]),this.current=d,this.dirty=!1)},m}(dr),fe=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return i.Color.transparent},m.prototype.set=function(d){var x=this.current;(d.r!==x.r||d.g!==x.g||d.b!==x.b||d.a!==x.a||this.dirty)&&(this.gl.blendColor(d.r,d.g,d.b,d.a),this.current=d,this.dirty=!1)},m}(dr),Ze=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return this.gl.FUNC_ADD},m.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.blendEquation(d),this.current=d,this.dirty=!1)},m}(dr),no=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return!1},m.prototype.set=function(d){if(d!==this.current||this.dirty){var x=this.gl;d?x.enable(x.CULL_FACE):x.disable(x.CULL_FACE),this.current=d,this.dirty=!1}},m}(dr),wn=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return this.gl.BACK},m.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.cullFace(d),this.current=d,this.dirty=!1)},m}(dr),ii=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return this.gl.CCW},m.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.frontFace(d),this.current=d,this.dirty=!1)},m}(dr),En=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return null},m.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.useProgram(d),this.current=d,this.dirty=!1)},m}(dr),Ei=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return this.gl.TEXTURE0},m.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.activeTexture(d),this.current=d,this.dirty=!1)},m}(dr),Xn=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){var d=this.gl;return[0,0,d.drawingBufferWidth,d.drawingBufferHeight]},m.prototype.set=function(d){var x=this.current;(d[0]!==x[0]||d[1]!==x[1]||d[2]!==x[2]||d[3]!==x[3]||this.dirty)&&(this.gl.viewport(d[0],d[1],d[2],d[3]),this.current=d,this.dirty=!1)},m}(dr),ai=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return null},m.prototype.set=function(d){if(d!==this.current||this.dirty){var x=this.gl;x.bindFramebuffer(x.FRAMEBUFFER,d),this.current=d,this.dirty=!1}},m}(dr),Ge=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return null},m.prototype.set=function(d){if(d!==this.current||this.dirty){var x=this.gl;x.bindRenderbuffer(x.RENDERBUFFER,d),this.current=d,this.dirty=!1}},m}(dr),Rr=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return null},m.prototype.set=function(d){if(d!==this.current||this.dirty){var x=this.gl;x.bindTexture(x.TEXTURE_2D,d),this.current=d,this.dirty=!1}},m}(dr),kr=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return null},m.prototype.set=function(d){if(d!==this.current||this.dirty){var x=this.gl;x.bindBuffer(x.ARRAY_BUFFER,d),this.current=d,this.dirty=!1}},m}(dr),qi=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return null},m.prototype.set=function(d){var x=this.gl;x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,d),this.current=d,this.dirty=!1},m}(dr),Ki=function(p){function m(d){p.call(this,d),this.vao=d.extVertexArrayObject}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return null},m.prototype.set=function(d){this.vao&&(d!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(d),this.current=d,this.dirty=!1)},m}(dr),Tr=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return 4},m.prototype.set=function(d){if(d!==this.current||this.dirty){var x=this.gl;x.pixelStorei(x.UNPACK_ALIGNMENT,d),this.current=d,this.dirty=!1}},m}(dr),ho=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return!1},m.prototype.set=function(d){if(d!==this.current||this.dirty){var x=this.gl;x.pixelStorei(x.UNPACK_PREMULTIPLY_ALPHA_WEBGL,d),this.current=d,this.dirty=!1}},m}(dr),Rn=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return!1},m.prototype.set=function(d){if(d!==this.current||this.dirty){var x=this.gl;x.pixelStorei(x.UNPACK_FLIP_Y_WEBGL,d),this.current=d,this.dirty=!1}},m}(dr),hi=function(p){function m(d,x){p.call(this,d),this.context=d,this.parent=x}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return null},m}(dr),Q=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.setDirty=function(){this.dirty=!0},m.prototype.set=function(d){if(d!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var x=this.gl;x.framebufferTexture2D(x.FRAMEBUFFER,x.COLOR_ATTACHMENT0,x.TEXTURE_2D,d,0),this.current=d,this.dirty=!1}},m}(hi),it=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.set=function(d){if(d!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var x=this.gl;x.framebufferRenderbuffer(x.FRAMEBUFFER,x.DEPTH_ATTACHMENT,x.RENDERBUFFER,d),this.current=d,this.dirty=!1}},m}(hi),st=function(p,m,d,x){this.context=p,this.width=m,this.height=d;var A=this.framebuffer=p.gl.createFramebuffer();this.colorAttachment=new Q(p,A),x&&(this.depthAttachment=new it(p,A))};st.prototype.destroy=function(){var p=this.context.gl,m=this.colorAttachment.get();if(m&&p.deleteTexture(m),this.depthAttachment){var d=this.depthAttachment.get();d&&p.deleteRenderbuffer(d)}p.deleteFramebuffer(this.framebuffer)};var _t=function(p,m,d){this.func=p,this.mask=m,this.range=d};_t.ReadOnly=!1,_t.ReadWrite=!0,_t.disabled=new _t(519,_t.ReadOnly,[0,1]);var It=function(p,m,d,x,A,k){this.test=p,this.ref=m,this.mask=d,this.fail=x,this.depthFail=A,this.pass=k};It.disabled=new It({func:519,mask:0},0,0,7680,7680,7680);var Bt=function(p,m,d){this.blendFunction=p,this.blendColor=m,this.mask=d};Bt.disabled=new Bt(Bt.Replace=[1,0],i.Color.transparent,[!1,!1,!1,!1]),Bt.unblended=new Bt(Bt.Replace,i.Color.transparent,[!0,!0,!0,!0]),Bt.alphaBlended=new Bt([1,771],i.Color.transparent,[!0,!0,!0,!0]);var Gt=function(p,m,d){this.enable=p,this.mode=m,this.frontFace=d};Gt.disabled=new Gt(!1,1029,2305),Gt.backCCW=new Gt(!0,1029,2305);var dt=function(p){this.gl=p,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new xn(this),this.clearDepth=new en(this),this.clearStencil=new ji(this),this.colorMask=new qn(this),this.depthMask=new Zn(this),this.stencilMask=new io(this),this.stencilFunc=new Wi(this),this.stencilOp=new bn(this),this.stencilTest=new co(this),this.depthRange=new zr(this),this.depthTest=new $i(this),this.depthFunc=new dn(this),this.blend=new ln(this),this.blendFunc=new na(this),this.blendColor=new fe(this),this.blendEquation=new Ze(this),this.cullFace=new no(this),this.cullFaceSide=new wn(this),this.frontFace=new ii(this),this.program=new En(this),this.activeTexture=new Ei(this),this.viewport=new Xn(this),this.bindFramebuffer=new ai(this),this.bindRenderbuffer=new Ge(this),this.bindTexture=new Rr(this),this.bindVertexBuffer=new kr(this),this.bindElementBuffer=new qi(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new Ki(this),this.pixelStoreUnpack=new Tr(this),this.pixelStoreUnpackPremultiplyAlpha=new ho(this),this.pixelStoreUnpackFlipY=new Rn(this),this.extTextureFilterAnisotropic=p.getExtension("EXT_texture_filter_anisotropic")||p.getExtension("MOZ_EXT_texture_filter_anisotropic")||p.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=p.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=p.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(p.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=p.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=p.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=p.getParameter(p.MAX_TEXTURE_SIZE)};dt.prototype.setDefault=function(){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()},dt.prototype.setDirty=function(){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.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},dt.prototype.createIndexBuffer=function(p,m){return new Di(this,p,m)},dt.prototype.createVertexBuffer=function(p,m,d){return new sn(this,p,m,d)},dt.prototype.createRenderbuffer=function(p,m,d){var x=this.gl,A=x.createRenderbuffer();return this.bindRenderbuffer.set(A),x.renderbufferStorage(x.RENDERBUFFER,p,m,d),this.bindRenderbuffer.set(null),A},dt.prototype.createFramebuffer=function(p,m,d){return new st(this,p,m,d)},dt.prototype.clear=function(p){var m=p.color,d=p.depth,x=this.gl,A=0;m&&(A|=x.COLOR_BUFFER_BIT,this.clearColor.set(m),this.colorMask.set([!0,!0,!0,!0])),d!==void 0&&(A|=x.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(d),this.depthMask.set(!0)),x.clear(A)},dt.prototype.setCullFace=function(p){p.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(p.mode),this.frontFace.set(p.frontFace))},dt.prototype.setDepthMode=function(p){p.func!==this.gl.ALWAYS||p.mask?(this.depthTest.set(!0),this.depthFunc.set(p.func),this.depthMask.set(p.mask),this.depthRange.set(p.range)):this.depthTest.set(!1)},dt.prototype.setStencilMode=function(p){p.test.func!==this.gl.ALWAYS||p.mask?(this.stencilTest.set(!0),this.stencilMask.set(p.mask),this.stencilOp.set([p.fail,p.depthFail,p.pass]),this.stencilFunc.set({func:p.test.func,ref:p.ref,mask:p.test.mask})):this.stencilTest.set(!1)},dt.prototype.setColorMode=function(p){i.deepEqual(p.blendFunction,Bt.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(p.blendFunction),this.blendColor.set(p.blendColor)),this.colorMask.set(p.mask)},dt.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var zt=function(p){function m(d,x,A){var k=this;p.call(this),this.id=d,this.dispatcher=A,this.on("data",function(R){R.dataType==="source"&&R.sourceDataType==="metadata"&&(k._sourceLoaded=!0),k._sourceLoaded&&!k._paused&&R.dataType==="source"&&R.sourceDataType==="content"&&(k.reload(),k.transform&&k.update(k.transform))}),this.on("error",function(){k._sourceErrored=!0}),this._source=function(R,j,K,tt){var ct=new ti[j.type](R,j,K,tt);if(ct.id!==R)throw new Error("Expected Source id to be "+R+" instead of "+ct.id);return i.bindAll(["load","abort","unload","serialize","prepare"],ct),ct}(d,x,A,this),this._tiles={},this._cache=new Wr(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new i.SourceFeatureState}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.onAdd=function(d){this.map=d,this._maxTileCacheSize=d?d._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(d)},m.prototype.onRemove=function(d){this._source&&this._source.onRemove&&this._source.onRemove(d)},m.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(var d in this._tiles){var x=this._tiles[d];if(x.state!=="loaded"&&x.state!=="errored")return!1}return!0},m.prototype.getSource=function(){return this._source},m.prototype.pause=function(){this._paused=!0},m.prototype.resume=function(){if(this._paused){var d=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,d&&this.reload(),this.transform&&this.update(this.transform)}},m.prototype._loadTile=function(d,x){return this._source.loadTile(d,x)},m.prototype._unloadTile=function(d){if(this._source.unloadTile)return this._source.unloadTile(d,function(){})},m.prototype._abortTile=function(d){if(this._source.abortTile)return this._source.abortTile(d,function(){})},m.prototype.serialize=function(){return this._source.serialize()},m.prototype.prepare=function(d){for(var x in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var A=this._tiles[x];A.upload(d),A.prepare(this.map.style.imageManager)}},m.prototype.getIds=function(){return i.values(this._tiles).map(function(d){return d.tileID}).sort(Qt).map(function(d){return d.key})},m.prototype.getRenderableIds=function(d){var x=this,A=[];for(var k in this._tiles)this._isIdRenderable(k,d)&&A.push(this._tiles[k]);return d?A.sort(function(R,j){var K=R.tileID,tt=j.tileID,ct=new i.Point(K.canonical.x,K.canonical.y)._rotate(x.transform.angle),ft=new i.Point(tt.canonical.x,tt.canonical.y)._rotate(x.transform.angle);return K.overscaledZ-tt.overscaledZ||ft.y-ct.y||ft.x-ct.x}).map(function(R){return R.tileID.key}):A.map(function(R){return R.tileID}).sort(Qt).map(function(R){return R.key})},m.prototype.hasRenderableParent=function(d){var x=this.findLoadedParent(d,0);return!!x&&this._isIdRenderable(x.tileID.key)},m.prototype._isIdRenderable=function(d,x){return this._tiles[d]&&this._tiles[d].hasData()&&!this._coveredTiles[d]&&(x||!this._tiles[d].holdingForFade())},m.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var d in this._cache.reset(),this._tiles)this._tiles[d].state!=="errored"&&this._reloadTile(d,"reloading")},m.prototype._reloadTile=function(d,x){var A=this._tiles[d];A&&(A.state!=="loading"&&(A.state=x),this._loadTile(A,this._tileLoaded.bind(this,A,d,x)))},m.prototype._tileLoaded=function(d,x,A,k){if(k)return d.state="errored",void(k.status!==404?this._source.fire(new i.ErrorEvent(k,{tile:d})):this.update(this.transform));d.timeAdded=i.browser.now(),A==="expired"&&(d.refreshedUponExpiration=!0),this._setTileReloadTimer(x,d),this.getSource().type==="raster-dem"&&d.dem&&this._backfillDEM(d),this._state.initializeTileState(d,this.map?this.map.painter:null),this._source.fire(new i.Event("data",{dataType:"source",tile:d,coord:d.tileID}))},m.prototype._backfillDEM=function(d){for(var x=this.getRenderableIds(),A=0;A<x.length;A++){var k=x[A];if(d.neighboringTiles&&d.neighboringTiles[k]){var R=this.getTileByID(k);j(d,R),j(R,d)}}function j(K,tt){K.needsHillshadePrepare=!0;var ct=tt.tileID.canonical.x-K.tileID.canonical.x,ft=tt.tileID.canonical.y-K.tileID.canonical.y,mt=Math.pow(2,K.tileID.canonical.z),Mt=tt.tileID.key;ct===0&&ft===0||Math.abs(ft)>1||(Math.abs(ct)>1&&(Math.abs(ct+mt)===1?ct+=mt:Math.abs(ct-mt)===1&&(ct-=mt)),tt.dem&&K.dem&&(K.dem.backfillBorder(tt.dem,ct,ft),K.neighboringTiles&&K.neighboringTiles[Mt]&&(K.neighboringTiles[Mt].backfilled=!0)))}},m.prototype.getTile=function(d){return this.getTileByID(d.key)},m.prototype.getTileByID=function(d){return this._tiles[d]},m.prototype._retainLoadedChildren=function(d,x,A,k){for(var R in this._tiles){var j=this._tiles[R];if(!(k[R]||!j.hasData()||j.tileID.overscaledZ<=x||j.tileID.overscaledZ>A)){for(var K=j.tileID;j&&j.tileID.overscaledZ>x+1;){var tt=j.tileID.scaledTo(j.tileID.overscaledZ-1);(j=this._tiles[tt.key])&&j.hasData()&&(K=tt)}for(var ct=K;ct.overscaledZ>x;)if(d[(ct=ct.scaledTo(ct.overscaledZ-1)).key]){k[K.key]=K;break}}}},m.prototype.findLoadedParent=function(d,x){if(d.key in this._loadedParentTiles){var A=this._loadedParentTiles[d.key];return A&&A.tileID.overscaledZ>=x?A:null}for(var k=d.overscaledZ-1;k>=x;k--){var R=d.scaledTo(k),j=this._getLoadedTile(R);if(j)return j}},m.prototype._getLoadedTile=function(d){var x=this._tiles[d.key];return x&&x.hasData()?x:this._cache.getByKey(d.wrapped().key)},m.prototype.updateCacheSize=function(d){var x=Math.ceil(d.width/this._source.tileSize)+1,A=Math.ceil(d.height/this._source.tileSize)+1,k=Math.floor(x*A*5),R=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,k):k;this._cache.setMaxSize(R)},m.prototype.handleWrapJump=function(d){var x=Math.round((d-(this._prevLng===void 0?d:this._prevLng))/360);if(this._prevLng=d,x){var A={};for(var k in this._tiles){var R=this._tiles[k];R.tileID=R.tileID.unwrapTo(R.tileID.wrap+x),A[R.tileID.key]=R}for(var j in this._tiles=A,this._timers)clearTimeout(this._timers[j]),delete this._timers[j];for(var K in this._tiles)this._setTileReloadTimer(K,this._tiles[K])}},m.prototype.update=function(d){var x=this;if(this.transform=d,this._sourceLoaded&&!this._paused){var A;this.updateCacheSize(d),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?A=d.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(xe){return new i.OverscaledTileID(xe.canonical.z,xe.wrap,xe.canonical.z,xe.canonical.x,xe.canonical.y)}):(A=d.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(A=A.filter(function(xe){return x._source.hasTile(xe)}))):A=[];var k=d.coveringZoomLevel(this._source),R=Math.max(k-m.maxOverzooming,this._source.minzoom),j=Math.max(k+m.maxUnderzooming,this._source.minzoom),K=this._updateRetainedTiles(A,k);if(nt(this._source.type)){for(var tt={},ct={},ft=0,mt=Object.keys(K);ft<mt.length;ft+=1){var Mt=mt[ft],At=K[Mt],Dt=this._tiles[Mt];if(Dt&&!(Dt.fadeEndTime&&Dt.fadeEndTime<=i.browser.now())){var xt=this.findLoadedParent(At,R);xt&&(this._addTile(xt.tileID),tt[xt.tileID.key]=xt.tileID),ct[Mt]=At}}for(var Rt in this._retainLoadedChildren(ct,k,j,K),tt)K[Rt]||(this._coveredTiles[Rt]=!0,K[Rt]=tt[Rt])}for(var Nt in K)this._tiles[Nt].clearFadeHold();for(var Yt=0,ne=i.keysDifference(this._tiles,K);Yt<ne.length;Yt+=1){var ae=ne[Yt],le=this._tiles[ae];le.hasSymbolBuckets&&!le.holdingForFade()?le.setHoldDuration(this.map._fadeDuration):le.hasSymbolBuckets&&!le.symbolFadeFinished()||this._removeTile(ae)}this._updateLoadedParentTileCache()}},m.prototype.releaseSymbolFadeTiles=function(){for(var d in this._tiles)this._tiles[d].holdingForFade()&&this._removeTile(d)},m.prototype._updateRetainedTiles=function(d,x){for(var A={},k={},R=Math.max(x-m.maxOverzooming,this._source.minzoom),j=Math.max(x+m.maxUnderzooming,this._source.minzoom),K={},tt=0,ct=d;tt<ct.length;tt+=1){var ft=ct[tt],mt=this._addTile(ft);A[ft.key]=ft,mt.hasData()||x<this._source.maxzoom&&(K[ft.key]=ft)}this._retainLoadedChildren(K,x,j,A);for(var Mt=0,At=d;Mt<At.length;Mt+=1){var Dt=At[Mt],xt=this._tiles[Dt.key];if(!xt.hasData()){if(x+1>this._source.maxzoom){var Rt=Dt.children(this._source.maxzoom)[0],Nt=this.getTile(Rt);if(Nt&&Nt.hasData()){A[Rt.key]=Rt;continue}}else{var Yt=Dt.children(this._source.maxzoom);if(A[Yt[0].key]&&A[Yt[1].key]&&A[Yt[2].key]&&A[Yt[3].key])continue}for(var ne=xt.wasRequested(),ae=Dt.overscaledZ-1;ae>=R;--ae){var le=Dt.scaledTo(ae);if(k[le.key]||(k[le.key]=!0,!(xt=this.getTile(le))&&ne&&(xt=this._addTile(le)),xt&&(A[le.key]=le,ne=xt.wasRequested(),xt.hasData())))break}}}return A},m.prototype._updateLoadedParentTileCache=function(){for(var d in this._loadedParentTiles={},this._tiles){for(var x=[],A=void 0,k=this._tiles[d].tileID;k.overscaledZ>0;){if(k.key in this._loadedParentTiles){A=this._loadedParentTiles[k.key];break}x.push(k.key);var R=k.scaledTo(k.overscaledZ-1);if(A=this._getLoadedTile(R))break;k=R}for(var j=0,K=x;j<K.length;j+=1)this._loadedParentTiles[K[j]]=A}},m.prototype._addTile=function(d){var x=this._tiles[d.key];if(x)return x;(x=this._cache.getAndRemove(d))&&(this._setTileReloadTimer(d.key,x),x.tileID=d,this._state.initializeTileState(x,this.map?this.map.painter:null),this._cacheTimers[d.key]&&(clearTimeout(this._cacheTimers[d.key]),delete this._cacheTimers[d.key],this._setTileReloadTimer(d.key,x)));var A=Boolean(x);return A||(x=new i.Tile(d,this._source.tileSize*d.overscaleFactor()),this._loadTile(x,this._tileLoaded.bind(this,x,d.key,x.state))),x?(x.uses++,this._tiles[d.key]=x,A||this._source.fire(new i.Event("dataloading",{tile:x,coord:x.tileID,dataType:"source"})),x):null},m.prototype._setTileReloadTimer=function(d,x){var A=this;d in this._timers&&(clearTimeout(this._timers[d]),delete this._timers[d]);var k=x.getExpiryTimeout();k&&(this._timers[d]=setTimeout(function(){A._reloadTile(d,"expired"),delete A._timers[d]},k))},m.prototype._removeTile=function(d){var x=this._tiles[d];x&&(x.uses--,delete this._tiles[d],this._timers[d]&&(clearTimeout(this._timers[d]),delete this._timers[d]),x.uses>0||(x.hasData()&&x.state!=="reloading"?this._cache.add(x.tileID,x,x.getExpiryTimeout()):(x.aborted=!0,this._abortTile(x),this._unloadTile(x))))},m.prototype.clearTiles=function(){for(var d in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(d);this._cache.reset()},m.prototype.tilesIn=function(d,x,A){var k=this,R=[],j=this.transform;if(!j)return R;for(var K=A?j.getCameraQueryGeometry(d):d,tt=d.map(function(ae){return j.pointCoordinate(ae)}),ct=K.map(function(ae){return j.pointCoordinate(ae)}),ft=this.getIds(),mt=1/0,Mt=1/0,At=-1/0,Dt=-1/0,xt=0,Rt=ct;xt<Rt.length;xt+=1){var Nt=Rt[xt];mt=Math.min(mt,Nt.x),Mt=Math.min(Mt,Nt.y),At=Math.max(At,Nt.x),Dt=Math.max(Dt,Nt.y)}for(var Yt=function(ae){var le=k._tiles[ft[ae]];if(!le.holdingForFade()){var xe=le.tileID,ke=Math.pow(2,j.zoom-le.tileID.overscaledZ),Le=x*le.queryPadding*i.EXTENT/le.tileSize/ke,$e=[xe.getTilePoint(new i.MercatorCoordinate(mt,Mt)),xe.getTilePoint(new i.MercatorCoordinate(At,Dt))];if($e[0].x-Le<i.EXTENT&&$e[0].y-Le<i.EXTENT&&$e[1].x+Le>=0&&$e[1].y+Le>=0){var lr=tt.map(function(sr){return xe.getTilePoint(sr)}),hr=ct.map(function(sr){return xe.getTilePoint(sr)});R.push({tile:le,tileID:xe,queryGeometry:lr,cameraQueryGeometry:hr,scale:ke})}}},ne=0;ne<ft.length;ne++)Yt(ne);return R},m.prototype.getVisibleCoordinates=function(d){for(var x=this,A=this.getRenderableIds(d).map(function(K){return x._tiles[K].tileID}),k=0,R=A;k<R.length;k+=1){var j=R[k];j.posMatrix=this.transform.calculatePosMatrix(j.toUnwrapped())}return A},m.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(nt(this._source.type))for(var d in this._tiles){var x=this._tiles[d];if(x.fadeEndTime!==void 0&&x.fadeEndTime>=i.browser.now())return!0}return!1},m.prototype.setFeatureState=function(d,x,A){this._state.updateState(d=d||"_geojsonTileLayer",x,A)},m.prototype.removeFeatureState=function(d,x,A){this._state.removeFeatureState(d=d||"_geojsonTileLayer",x,A)},m.prototype.getFeatureState=function(d,x){return this._state.getState(d=d||"_geojsonTileLayer",x)},m.prototype.setDependencies=function(d,x,A){var k=this._tiles[d];k&&k.setDependencies(x,A)},m.prototype.reloadTilesForDependencies=function(d,x){for(var A in this._tiles)this._tiles[A].hasDependency(d,x)&&this._reloadTile(A,"reloading");this._cache.filter(function(k){return!k.hasDependency(d,x)})},m}(i.Evented);function Qt(p,m){var d=Math.abs(2*p.wrap)-+(p.wrap<0),x=Math.abs(2*m.wrap)-+(m.wrap<0);return p.overscaledZ-m.overscaledZ||x-d||m.canonical.y-p.canonical.y||m.canonical.x-p.canonical.x}function nt(p){return p==="raster"||p==="image"||p==="video"}function X(){return new i.window.Worker(Ar.workerUrl)}zt.maxOverzooming=10,zt.maxUnderzooming=3;var Z="mapboxgl_preloaded_worker_pool",rt=function(){this.active={}};rt.prototype.acquire=function(p){if(!this.workers)for(this.workers=[];this.workers.length<rt.workerCount;)this.workers.push(new X);return this.active[p]=!0,this.workers.slice()},rt.prototype.release=function(p){delete this.active[p],this.numActive()===0&&(this.workers.forEach(function(m){m.terminate()}),this.workers=null)},rt.prototype.isPreloaded=function(){return!!this.active[Z]},rt.prototype.numActive=function(){return Object.keys(this.active).length};var lt,gt=Math.floor(i.browser.hardwareConcurrency/2);function pt(){return lt||(lt=new rt),lt}function St(p,m){var d={};for(var x in p)x!=="ref"&&(d[x]=p[x]);return i.refProperties.forEach(function(A){A in m&&(d[A]=m[A])}),d}function Et(p){p=p.slice();for(var m=Object.create(null),d=0;d<p.length;d++)m[p[d].id]=p[d];for(var x=0;x<p.length;x++)"ref"in p[x]&&(p[x]=St(p[x],m[p[x].ref]));return p}rt.workerCount=Math.max(Math.min(gt,6),1);var Ct={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function te(p,m,d){d.push({command:Ct.addSource,args:[p,m[p]]})}function $t(p,m,d){m.push({command:Ct.removeSource,args:[p]}),d[p]=!0}function ee(p,m,d,x){$t(p,d,x),te(p,m,d)}function De(p,m,d){var x;for(x in p[d])if(p[d].hasOwnProperty(x)&&x!=="data"&&!i.deepEqual(p[d][x],m[d][x]))return!1;for(x in m[d])if(m[d].hasOwnProperty(x)&&x!=="data"&&!i.deepEqual(p[d][x],m[d][x]))return!1;return!0}function Se(p,m,d,x,A,k){var R;for(R in m=m||{},p=p||{})p.hasOwnProperty(R)&&(i.deepEqual(p[R],m[R])||d.push({command:k,args:[x,R,m[R],A]}));for(R in m)m.hasOwnProperty(R)&&!p.hasOwnProperty(R)&&(i.deepEqual(p[R],m[R])||d.push({command:k,args:[x,R,m[R],A]}))}function ze(p){return p.id}function Ue(p,m){return p[m.id]=m,p}var Dr=function(p,m){this.reset(p,m)};Dr.prototype.reset=function(p,m){this.points=p||[],this._distances=[0];for(var d=1;d<this.points.length;d++)this._distances[d]=this._distances[d-1]+this.points[d].dist(this.points[d-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(m||0,.5*this.length),this.paddedLength=this.length-2*this.padding},Dr.prototype.lerp=function(p){if(this.points.length===1)return this.points[0];p=i.clamp(p,0,1);for(var m=1,d=this._distances[m],x=p*this.paddedLength+this.padding;d<x&&m<this._distances.length;)d=this._distances[++m];var A=m-1,k=this._distances[A],R=d-k,j=R>0?(x-k)/R:0;return this.points[A].mult(1-j).add(this.points[m].mult(j))};var ur=function(p,m,d){var x=this.boxCells=[],A=this.circleCells=[];this.xCellCount=Math.ceil(p/d),this.yCellCount=Math.ceil(m/d);for(var k=0;k<this.xCellCount*this.yCellCount;k++)x.push([]),A.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=p,this.height=m,this.xScale=this.xCellCount/p,this.yScale=this.yCellCount/m,this.boxUid=0,this.circleUid=0};function mr(p,m,d,x,A){var k=i.create();return m?(i.scale(k,k,[1/A,1/A,1]),d||i.rotateZ(k,k,x.angle)):i.multiply(k,x.labelPlaneMatrix,p),k}function nr(p,m,d,x,A){if(m){var k=i.clone(p);return i.scale(k,k,[A,A,1]),d||i.rotateZ(k,k,-x.angle),k}return x.glCoordMatrix}function Xe(p,m){var d=[p.x,p.y,0,1];un(d,d,m);var x=d[3];return{point:new i.Point(d[0]/x,d[1]/x),signedDistanceFromCamera:x}}function Sr(p,m){return .5+p/m*.5}function ni(p,m){var d=p[0]/p[3],x=p[1]/p[3];return d>=-m[0]&&d<=m[0]&&x>=-m[1]&&x<=m[1]}function rn(p,m,d,x,A,k,R,j){var K=x?p.textSizeData:p.iconSizeData,tt=i.evaluateSizeForZoom(K,d.transform.zoom),ct=[256/d.width*2+1,256/d.height*2+1],ft=x?p.text.dynamicLayoutVertexArray:p.icon.dynamicLayoutVertexArray;ft.clear();for(var mt=p.lineVertexArray,Mt=x?p.text.placedSymbolArray:p.icon.placedSymbolArray,At=d.transform.width/d.transform.height,Dt=!1,xt=0;xt<Mt.length;xt++){var Rt=Mt.get(xt);if(Rt.hidden||Rt.writingMode===i.WritingMode.vertical&&!Dt)Wn(Rt.numGlyphs,ft);else{Dt=!1;var Nt=[Rt.anchorX,Rt.anchorY,0,1];if(i.transformMat4(Nt,Nt,m),ni(Nt,ct)){var Yt=Sr(d.transform.cameraToCenterDistance,Nt[3]),ne=i.evaluateSizeForFeature(K,tt,Rt),ae=R?ne/Yt:ne*Yt,le=new i.Point(Rt.anchorX,Rt.anchorY),xe=Xe(le,A).point,ke={},Le=sl(Rt,ae,!1,j,m,A,k,p.glyphOffsetArray,mt,ft,xe,le,ke,At);Dt=Le.useVertical,(Le.notEnoughRoom||Dt||Le.needsFlipping&&sl(Rt,ae,!0,j,m,A,k,p.glyphOffsetArray,mt,ft,xe,le,ke,At).notEnoughRoom)&&Wn(Rt.numGlyphs,ft)}else Wn(Rt.numGlyphs,ft)}}x?p.text.dynamicLayoutVertexBuffer.updateData(ft):p.icon.dynamicLayoutVertexBuffer.updateData(ft)}function si(p,m,d,x,A,k,R,j,K,tt,ct){var ft=j.glyphStartIndex+j.numGlyphs,mt=j.lineStartIndex,Mt=j.lineStartIndex+j.lineLength,At=m.getoffsetX(j.glyphStartIndex),Dt=m.getoffsetX(ft-1),xt=Yi(p*At,d,x,A,k,R,j.segment,mt,Mt,K,tt,ct);if(!xt)return null;var Rt=Yi(p*Dt,d,x,A,k,R,j.segment,mt,Mt,K,tt,ct);return Rt?{first:xt,last:Rt}:null}function Nn(p,m,d,x){return p===i.WritingMode.horizontal&&Math.abs(d.y-m.y)>Math.abs(d.x-m.x)*x?{useVertical:!0}:(p===i.WritingMode.vertical?m.y<d.y:m.x>d.x)?{needsFlipping:!0}:null}function sl(p,m,d,x,A,k,R,j,K,tt,ct,ft,mt,Mt){var At,Dt=m/24,xt=p.lineOffsetX*Dt,Rt=p.lineOffsetY*Dt;if(p.numGlyphs>1){var Nt=p.glyphStartIndex+p.numGlyphs,Yt=p.lineStartIndex,ne=p.lineStartIndex+p.lineLength,ae=si(Dt,j,xt,Rt,d,ct,ft,p,K,k,mt);if(!ae)return{notEnoughRoom:!0};var le=Xe(ae.first.point,R).point,xe=Xe(ae.last.point,R).point;if(x&&!d){var ke=Nn(p.writingMode,le,xe,Mt);if(ke)return ke}At=[ae.first];for(var Le=p.glyphStartIndex+1;Le<Nt-1;Le++)At.push(Yi(Dt*j.getoffsetX(Le),xt,Rt,d,ct,ft,p.segment,Yt,ne,K,k,mt));At.push(ae.last)}else{if(x&&!d){var $e=Xe(ft,A).point,lr=p.lineStartIndex+p.segment+1,hr=new i.Point(K.getx(lr),K.gety(lr)),sr=Xe(hr,A),Zr=sr.signedDistanceFromCamera>0?sr.point:gi(ft,hr,$e,1,A),Qe=Nn(p.writingMode,$e,Zr,Mt);if(Qe)return Qe}var Ir=Yi(Dt*j.getoffsetX(p.glyphStartIndex),xt,Rt,d,ct,ft,p.segment,p.lineStartIndex,p.lineStartIndex+p.lineLength,K,k,mt);if(!Ir)return{notEnoughRoom:!0};At=[Ir]}for(var jr=0,Er=At;jr<Er.length;jr+=1){var vr=Er[jr];i.addDynamicAttributes(tt,vr.point,vr.angle)}return{}}function gi(p,m,d,x,A){var k=Xe(p.add(p.sub(m)._unit()),A).point,R=d.sub(k);return d.add(R._mult(x/R.mag()))}function Yi(p,m,d,x,A,k,R,j,K,tt,ct,ft){var mt=x?p-m:p+m,Mt=mt>0?1:-1,At=0;x&&(Mt*=-1,At=Math.PI),Mt<0&&(At+=Math.PI);for(var Dt=Mt>0?j+R:j+R+1,xt=A,Rt=A,Nt=0,Yt=0,ne=Math.abs(mt),ae=[];Nt+Yt<=ne;){if((Dt+=Mt)<j||Dt>=K)return null;if(Rt=xt,ae.push(xt),(xt=ft[Dt])===void 0){var le=new i.Point(tt.getx(Dt),tt.gety(Dt)),xe=Xe(le,ct);if(xe.signedDistanceFromCamera>0)xt=ft[Dt]=xe.point;else{var ke=Dt-Mt;xt=gi(Nt===0?k:new i.Point(tt.getx(ke),tt.gety(ke)),le,Rt,ne-Nt+1,ct)}}Nt+=Yt,Yt=Rt.dist(xt)}var Le=(ne-Nt)/Yt,$e=xt.sub(Rt),lr=$e.mult(Le)._add(Rt);lr._add($e._unit()._perp()._mult(d*Mt));var hr=At+Math.atan2(xt.y-Rt.y,xt.x-Rt.x);return ae.push(lr),{point:lr,angle:hr,path:ae}}ur.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},ur.prototype.insert=function(p,m,d,x,A){this._forEachCell(m,d,x,A,this._insertBoxCell,this.boxUid++),this.boxKeys.push(p),this.bboxes.push(m),this.bboxes.push(d),this.bboxes.push(x),this.bboxes.push(A)},ur.prototype.insertCircle=function(p,m,d,x){this._forEachCell(m-x,d-x,m+x,d+x,this._insertCircleCell,this.circleUid++),this.circleKeys.push(p),this.circles.push(m),this.circles.push(d),this.circles.push(x)},ur.prototype._insertBoxCell=function(p,m,d,x,A,k){this.boxCells[A].push(k)},ur.prototype._insertCircleCell=function(p,m,d,x,A,k){this.circleCells[A].push(k)},ur.prototype._query=function(p,m,d,x,A,k){if(d<0||p>this.width||x<0||m>this.height)return!A&&[];var R=[];if(p<=0&&m<=0&&this.width<=d&&this.height<=x){if(A)return!0;for(var j=0;j<this.boxKeys.length;j++)R.push({key:this.boxKeys[j],x1:this.bboxes[4*j],y1:this.bboxes[4*j+1],x2:this.bboxes[4*j+2],y2:this.bboxes[4*j+3]});for(var K=0;K<this.circleKeys.length;K++){var tt=this.circles[3*K],ct=this.circles[3*K+1],ft=this.circles[3*K+2];R.push({key:this.circleKeys[K],x1:tt-ft,y1:ct-ft,x2:tt+ft,y2:ct+ft})}return k?R.filter(k):R}return this._forEachCell(p,m,d,x,this._queryCell,R,{hitTest:A,seenUids:{box:{},circle:{}}},k),A?R.length>0:R},ur.prototype._queryCircle=function(p,m,d,x,A){var k=p-d,R=p+d,j=m-d,K=m+d;if(R<0||k>this.width||K<0||j>this.height)return!x&&[];var tt=[];return this._forEachCell(k,j,R,K,this._queryCellCircle,tt,{hitTest:x,circle:{x:p,y:m,radius:d},seenUids:{box:{},circle:{}}},A),x?tt.length>0:tt},ur.prototype.query=function(p,m,d,x,A){return this._query(p,m,d,x,!1,A)},ur.prototype.hitTest=function(p,m,d,x,A){return this._query(p,m,d,x,!0,A)},ur.prototype.hitTestCircle=function(p,m,d,x){return this._queryCircle(p,m,d,!0,x)},ur.prototype._queryCell=function(p,m,d,x,A,k,R,j){var K=R.seenUids,tt=this.boxCells[A];if(tt!==null)for(var ct=this.bboxes,ft=0,mt=tt;ft<mt.length;ft+=1){var Mt=mt[ft];if(!K.box[Mt]){K.box[Mt]=!0;var At=4*Mt;if(p<=ct[At+2]&&m<=ct[At+3]&&d>=ct[At+0]&&x>=ct[At+1]&&(!j||j(this.boxKeys[Mt]))){if(R.hitTest)return k.push(!0),!0;k.push({key:this.boxKeys[Mt],x1:ct[At],y1:ct[At+1],x2:ct[At+2],y2:ct[At+3]})}}}var Dt=this.circleCells[A];if(Dt!==null)for(var xt=this.circles,Rt=0,Nt=Dt;Rt<Nt.length;Rt+=1){var Yt=Nt[Rt];if(!K.circle[Yt]){K.circle[Yt]=!0;var ne=3*Yt;if(this._circleAndRectCollide(xt[ne],xt[ne+1],xt[ne+2],p,m,d,x)&&(!j||j(this.circleKeys[Yt]))){if(R.hitTest)return k.push(!0),!0;var ae=xt[ne],le=xt[ne+1],xe=xt[ne+2];k.push({key:this.circleKeys[Yt],x1:ae-xe,y1:le-xe,x2:ae+xe,y2:le+xe})}}}},ur.prototype._queryCellCircle=function(p,m,d,x,A,k,R,j){var K=R.circle,tt=R.seenUids,ct=this.boxCells[A];if(ct!==null)for(var ft=this.bboxes,mt=0,Mt=ct;mt<Mt.length;mt+=1){var At=Mt[mt];if(!tt.box[At]){tt.box[At]=!0;var Dt=4*At;if(this._circleAndRectCollide(K.x,K.y,K.radius,ft[Dt+0],ft[Dt+1],ft[Dt+2],ft[Dt+3])&&(!j||j(this.boxKeys[At])))return k.push(!0),!0}}var xt=this.circleCells[A];if(xt!==null)for(var Rt=this.circles,Nt=0,Yt=xt;Nt<Yt.length;Nt+=1){var ne=Yt[Nt];if(!tt.circle[ne]){tt.circle[ne]=!0;var ae=3*ne;if(this._circlesCollide(Rt[ae],Rt[ae+1],Rt[ae+2],K.x,K.y,K.radius)&&(!j||j(this.circleKeys[ne])))return k.push(!0),!0}}},ur.prototype._forEachCell=function(p,m,d,x,A,k,R,j){for(var K=this._convertToXCellCoord(p),tt=this._convertToYCellCoord(m),ct=this._convertToXCellCoord(d),ft=this._convertToYCellCoord(x),mt=K;mt<=ct;mt++)for(var Mt=tt;Mt<=ft;Mt++)if(A.call(this,p,m,d,x,this.xCellCount*Mt+mt,k,R,j))return},ur.prototype._convertToXCellCoord=function(p){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(p*this.xScale)))},ur.prototype._convertToYCellCoord=function(p){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(p*this.yScale)))},ur.prototype._circlesCollide=function(p,m,d,x,A,k){var R=x-p,j=A-m,K=d+k;return K*K>R*R+j*j},ur.prototype._circleAndRectCollide=function(p,m,d,x,A,k,R){var j=(k-x)/2,K=Math.abs(p-(x+j));if(K>j+d)return!1;var tt=(R-A)/2,ct=Math.abs(m-(A+tt));if(ct>tt+d)return!1;if(K<=j||ct<=tt)return!0;var ft=K-j,mt=ct-tt;return ft*ft+mt*mt<=d*d};var gs=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Wn(p,m){for(var d=0;d<p;d++){var x=m.length;m.resize(x+4),m.float32.set(gs,3*x)}}function un(p,m,d){var x=m[0],A=m[1];return p[0]=d[0]*x+d[4]*A+d[12],p[1]=d[1]*x+d[5]*A+d[13],p[3]=d[3]*x+d[7]*A+d[15],p}var Po=function(p,m,d){m===void 0&&(m=new ur(p.width+200,p.height+200,25)),d===void 0&&(d=new ur(p.width+200,p.height+200,25)),this.transform=p,this.grid=m,this.ignoredGrid=d,this.pitchfactor=Math.cos(p._pitch)*p.cameraToCenterDistance,this.screenRightBoundary=p.width+100,this.screenBottomBoundary=p.height+100,this.gridRightBoundary=p.width+200,this.gridBottomBoundary=p.height+200};function Si(p,m,d){return m*(i.EXTENT/(p.tileSize*Math.pow(2,d-p.tileID.overscaledZ)))}Po.prototype.placeCollisionBox=function(p,m,d,x,A){var k=this.projectAndGetPerspectiveRatio(x,p.anchorPointX,p.anchorPointY),R=d*k.perspectiveRatio,j=p.x1*R+k.point.x,K=p.y1*R+k.point.y,tt=p.x2*R+k.point.x,ct=p.y2*R+k.point.y;return!this.isInsideGrid(j,K,tt,ct)||!m&&this.grid.hitTest(j,K,tt,ct,A)?{box:[],offscreen:!1}:{box:[j,K,tt,ct],offscreen:this.isOffscreen(j,K,tt,ct)}},Po.prototype.placeCollisionCircles=function(p,m,d,x,A,k,R,j,K,tt,ct,ft,mt){var Mt=[],At=new i.Point(m.anchorX,m.anchorY),Dt=Xe(At,k),xt=Sr(this.transform.cameraToCenterDistance,Dt.signedDistanceFromCamera),Rt=(tt?A/xt:A*xt)/i.ONE_EM,Nt=Xe(At,R).point,Yt=si(Rt,x,m.lineOffsetX*Rt,m.lineOffsetY*Rt,!1,Nt,At,m,d,R,{}),ne=!1,ae=!1,le=!0;if(Yt){for(var xe=.5*ft*xt+mt,ke=new i.Point(-100,-100),Le=new i.Point(this.screenRightBoundary,this.screenBottomBoundary),$e=new Dr,lr=Yt.first,hr=Yt.last,sr=[],Zr=lr.path.length-1;Zr>=1;Zr--)sr.push(lr.path[Zr]);for(var Qe=1;Qe<hr.path.length;Qe++)sr.push(hr.path[Qe]);var Ir=2.5*xe;if(j){var jr=sr.map(function(jo){return Xe(jo,j)});sr=jr.some(function(jo){return jo.signedDistanceFromCamera<=0})?[]:jr.map(function(jo){return jo.point})}var Er=[];if(sr.length>0){for(var vr=sr[0].clone(),Pr=sr[0].clone(),fr=1;fr<sr.length;fr++)vr.x=Math.min(vr.x,sr[fr].x),vr.y=Math.min(vr.y,sr[fr].y),Pr.x=Math.max(Pr.x,sr[fr].x),Pr.y=Math.max(Pr.y,sr[fr].y);Er=vr.x>=ke.x&&Pr.x<=Le.x&&vr.y>=ke.y&&Pr.y<=Le.y?[sr]:Pr.x<ke.x||vr.x>Le.x||Pr.y<ke.y||vr.y>Le.y?[]:i.clipLine([sr],ke.x,ke.y,Le.x,Le.y)}for(var cr=0,Ui=Er;cr<Ui.length;cr+=1){var tn;$e.reset(Ui[cr],.25*xe),tn=$e.length<=.5*xe?1:Math.ceil($e.paddedLength/Ir)+1;for(var hn=0;hn<tn;hn++){var jn=hn/Math.max(tn-1,1),Xi=$e.lerp(jn),Kr=Xi.x+100,_o=Xi.y+100;Mt.push(Kr,_o,xe,0);var lo=Kr-xe,Vo=_o-xe,Tn=Kr+xe,Go=_o+xe;if(le=le&&this.isOffscreen(lo,Vo,Tn,Go),ae=ae||this.isInsideGrid(lo,Vo,Tn,Go),!p&&this.grid.hitTestCircle(Kr,_o,xe,ct)&&(ne=!0,!K))return{circles:[],offscreen:!1,collisionDetected:ne}}}}return{circles:!K&&ne||!ae?[]:Mt,offscreen:le,collisionDetected:ne}},Po.prototype.queryRenderedSymbols=function(p){if(p.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};for(var m=[],d=1/0,x=1/0,A=-1/0,k=-1/0,R=0,j=p;R<j.length;R+=1){var K=j[R],tt=new i.Point(K.x+100,K.y+100);d=Math.min(d,tt.x),x=Math.min(x,tt.y),A=Math.max(A,tt.x),k=Math.max(k,tt.y),m.push(tt)}for(var ct={},ft={},mt=0,Mt=this.grid.query(d,x,A,k).concat(this.ignoredGrid.query(d,x,A,k));mt<Mt.length;mt+=1){var At=Mt[mt],Dt=At.key;if(ct[Dt.bucketInstanceId]===void 0&&(ct[Dt.bucketInstanceId]={}),!ct[Dt.bucketInstanceId][Dt.featureIndex]){var xt=[new i.Point(At.x1,At.y1),new i.Point(At.x2,At.y1),new i.Point(At.x2,At.y2),new i.Point(At.x1,At.y2)];i.polygonIntersectsPolygon(m,xt)&&(ct[Dt.bucketInstanceId][Dt.featureIndex]=!0,ft[Dt.bucketInstanceId]===void 0&&(ft[Dt.bucketInstanceId]=[]),ft[Dt.bucketInstanceId].push(Dt.featureIndex))}}return ft},Po.prototype.insertCollisionBox=function(p,m,d,x,A){(m?this.ignoredGrid:this.grid).insert({bucketInstanceId:d,featureIndex:x,collisionGroupID:A},p[0],p[1],p[2],p[3])},Po.prototype.insertCollisionCircles=function(p,m,d,x,A){for(var k=m?this.ignoredGrid:this.grid,R={bucketInstanceId:d,featureIndex:x,collisionGroupID:A},j=0;j<p.length;j+=4)k.insertCircle(R,p[j],p[j+1],p[j+2])},Po.prototype.projectAndGetPerspectiveRatio=function(p,m,d){var x=[m,d,0,1];return un(x,x,p),{point:new i.Point((x[0]/x[3]+1)/2*this.transform.width+100,(-x[1]/x[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/x[3]*.5}},Po.prototype.isOffscreen=function(p,m,d,x){return d<100||p>=this.screenRightBoundary||x<100||m>this.screenBottomBoundary},Po.prototype.isInsideGrid=function(p,m,d,x){return d>=0&&p<this.gridRightBoundary&&x>=0&&m<this.gridBottomBoundary},Po.prototype.getViewportMatrix=function(){var p=i.identity([]);return i.translate(p,p,[-100,-100,0]),p};var Mo=function(p,m,d,x){this.opacity=p?Math.max(0,Math.min(1,p.opacity+(p.placed?m:-m))):x&&d?1:0,this.placed=d};Mo.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var oo=function(p,m,d,x,A){this.text=new Mo(p?p.text:null,m,d,A),this.icon=new Mo(p?p.icon:null,m,x,A)};oo.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var Ou=function(p,m,d){this.text=p,this.icon=m,this.skipFade=d},Lo=function(){this.invProjMatrix=i.create(),this.viewportMatrix=i.create(),this.circles=[]},ys=function(p,m,d,x,A){this.bucketInstanceId=p,this.featureIndex=m,this.sourceLayerIndex=d,this.bucketIndex=x,this.tileID=A},Bo=function(p){this.crossSourceCollisions=p,this.maxGroupID=0,this.collisionGroups={}};function Hi(p,m,d,x,A){var k=i.getAnchorAlignment(p),R=-(k.horizontalAlign-.5)*m,j=-(k.verticalAlign-.5)*d,K=i.evaluateVariableOffset(p,x);return new i.Point(R+K[0]*A,j+K[1]*A)}function po(p,m,d,x,A,k){var R=p.x1,j=p.x2,K=p.y1,tt=p.y2,ct=p.anchorPointX,ft=p.anchorPointY,mt=new i.Point(m,d);return x&&mt._rotate(A?k:-k),{x1:R+mt.x,y1:K+mt.y,x2:j+mt.x,y2:tt+mt.y,anchorPointX:ct,anchorPointY:ft}}Bo.prototype.get=function(p){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[p]){var m=++this.maxGroupID;this.collisionGroups[p]={ID:m,predicate:function(d){return d.collisionGroupID===m}}}return this.collisionGroups[p]};var Sn=function(p,m,d,x){this.transform=p.clone(),this.collisionIndex=new Po(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=m,this.retainedQueryData={},this.collisionGroups=new Bo(d),this.collisionCircleArrays={},this.prevPlacement=x,x&&(x.prevPlacement=void 0),this.placedOrientations={}};function oa(p,m,d,x,A){p.emplaceBack(m?1:0,d?1:0,x||0,A||0),p.emplaceBack(m?1:0,d?1:0,x||0,A||0),p.emplaceBack(m?1:0,d?1:0,x||0,A||0),p.emplaceBack(m?1:0,d?1:0,x||0,A||0)}Sn.prototype.getBucketParts=function(p,m,d,x){var A=d.getBucket(m),k=d.latestFeatureIndex;if(A&&k&&m.id===A.layerIds[0]){var R=d.collisionBoxArray,j=A.layers[0].layout,K=Math.pow(2,this.transform.zoom-d.tileID.overscaledZ),tt=d.tileSize/i.EXTENT,ct=this.transform.calculatePosMatrix(d.tileID.toUnwrapped()),ft=j.get("text-pitch-alignment")==="map",mt=j.get("text-rotation-alignment")==="map",Mt=Si(d,1,this.transform.zoom),At=mr(ct,ft,mt,this.transform,Mt),Dt=null;if(ft){var xt=nr(ct,ft,mt,this.transform,Mt);Dt=i.multiply([],this.transform.labelPlaneMatrix,xt)}this.retainedQueryData[A.bucketInstanceId]=new ys(A.bucketInstanceId,k,A.sourceLayerIndex,A.index,d.tileID);var Rt={bucket:A,layout:j,posMatrix:ct,textLabelPlaneMatrix:At,labelToScreenMatrix:Dt,scale:K,textPixelRatio:tt,holdingForFade:d.holdingForFade(),collisionBoxArray:R,partiallyEvaluatedTextSize:i.evaluateSizeForZoom(A.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(A.sourceID)};if(x)for(var Nt=0,Yt=A.sortKeyRanges;Nt<Yt.length;Nt+=1){var ne=Yt[Nt];p.push({sortKey:ne.sortKey,symbolInstanceStart:ne.symbolInstanceStart,symbolInstanceEnd:ne.symbolInstanceEnd,parameters:Rt})}else p.push({symbolInstanceStart:0,symbolInstanceEnd:A.symbolInstances.length,parameters:Rt})}},Sn.prototype.attemptAnchorPlacement=function(p,m,d,x,A,k,R,j,K,tt,ct,ft,mt,Mt,At){var Dt,xt=[ft.textOffset0,ft.textOffset1],Rt=Hi(p,d,x,xt,A),Nt=this.collisionIndex.placeCollisionBox(po(m,Rt.x,Rt.y,k,R,this.transform.angle),ct,j,K,tt.predicate);if(!At||this.collisionIndex.placeCollisionBox(po(At,Rt.x,Rt.y,k,R,this.transform.angle),ct,j,K,tt.predicate).box.length!==0)return Nt.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[ft.crossTileID]&&this.prevPlacement.placements[ft.crossTileID]&&this.prevPlacement.placements[ft.crossTileID].text&&(Dt=this.prevPlacement.variableOffsets[ft.crossTileID].anchor),this.variableOffsets[ft.crossTileID]={textOffset:xt,width:d,height:x,anchor:p,textBoxScale:A,prevAnchor:Dt},this.markUsedJustification(mt,p,ft,Mt),mt.allowVerticalPlacement&&(this.markUsedOrientation(mt,Mt,ft),this.placedOrientations[ft.crossTileID]=Mt),{shift:Rt,placedGlyphBoxes:Nt}):void 0},Sn.prototype.placeLayerBucketPart=function(p,m,d){var x=this,A=p.parameters,k=A.bucket,R=A.layout,j=A.posMatrix,K=A.textLabelPlaneMatrix,tt=A.labelToScreenMatrix,ct=A.textPixelRatio,ft=A.holdingForFade,mt=A.collisionBoxArray,Mt=A.partiallyEvaluatedTextSize,At=A.collisionGroup,Dt=R.get("text-optional"),xt=R.get("icon-optional"),Rt=R.get("text-allow-overlap"),Nt=R.get("icon-allow-overlap"),Yt=R.get("text-rotation-alignment")==="map",ne=R.get("text-pitch-alignment")==="map",ae=R.get("icon-text-fit")!=="none",le=R.get("symbol-z-order")==="viewport-y",xe=Rt&&(Nt||!k.hasIconData()||xt),ke=Nt&&(Rt||!k.hasTextData()||Dt);!k.collisionArrays&&mt&&k.deserializeCollisionBoxes(mt);var Le=function(Qe,Ir){if(!m[Qe.crossTileID])if(ft)x.placements[Qe.crossTileID]=new Ou(!1,!1,!1);else{var jr,Er=!1,vr=!1,Pr=!0,fr=null,cr={box:null,offscreen:null},Ui={box:null,offscreen:null},tn=null,hn=null,jn=0,Xi=0,Kr=0;Ir.textFeatureIndex?jn=Ir.textFeatureIndex:Qe.useRuntimeCollisionCircles&&(jn=Qe.featureIndex),Ir.verticalTextFeatureIndex&&(Xi=Ir.verticalTextFeatureIndex);var _o=Ir.textBox;if(_o){var lo=function(ri){var vo=i.WritingMode.horizontal;if(k.allowVerticalPlacement&&!ri&&x.prevPlacement){var Do=x.prevPlacement.placedOrientations[Qe.crossTileID];Do&&(x.placedOrientations[Qe.crossTileID]=Do,x.markUsedOrientation(k,vo=Do,Qe))}return vo},Vo=function(ri,vo){if(k.allowVerticalPlacement&&Qe.numVerticalGlyphVertices>0&&Ir.verticalTextBox)for(var Do=0,Pl=k.writingModes;Do<Pl.length&&(Pl[Do]===i.WritingMode.vertical?(cr=vo(),Ui=cr):cr=ri(),!(cr&&cr.box&&cr.box.length));Do+=1);else cr=ri()};if(R.get("text-variable-anchor")){var Tn=R.get("text-variable-anchor");if(x.prevPlacement&&x.prevPlacement.variableOffsets[Qe.crossTileID]){var Go=x.prevPlacement.variableOffsets[Qe.crossTileID];Tn.indexOf(Go.anchor)>0&&(Tn=Tn.filter(function(ri){return ri!==Go.anchor})).unshift(Go.anchor)}var jo=function(ri,vo,Do){for(var Pl=ri.x2-ri.x1,uu=ri.y2-ri.y1,cu=Qe.textBoxScale,cp=ae&&!Nt?vo:null,Ms={box:[],offscreen:!1},hp=Rt?2*Tn.length:Tn.length,Ls=0;Ls<hp;++Ls){var Ku=x.attemptAnchorPlacement(Tn[Ls%Tn.length],ri,Pl,uu,cu,Yt,ne,ct,j,At,Ls>=Tn.length,Qe,k,Do,cp);if(Ku&&(Ms=Ku.placedGlyphBoxes)&&Ms.box&&Ms.box.length){Er=!0,fr=Ku.shift;break}}return Ms};Vo(function(){return jo(_o,Ir.iconBox,i.WritingMode.horizontal)},function(){var ri=Ir.verticalTextBox;return k.allowVerticalPlacement&&!(cr&&cr.box&&cr.box.length)&&Qe.numVerticalGlyphVertices>0&&ri?jo(ri,Ir.verticalIconBox,i.WritingMode.vertical):{box:null,offscreen:null}}),cr&&(Er=cr.box,Pr=cr.offscreen);var au=lo(cr&&cr.box);if(!Er&&x.prevPlacement){var su=x.prevPlacement.variableOffsets[Qe.crossTileID];su&&(x.variableOffsets[Qe.crossTileID]=su,x.markUsedJustification(k,su.anchor,Qe,au))}}else{var Ps=function(ri,vo){var Do=x.collisionIndex.placeCollisionBox(ri,Rt,ct,j,At.predicate);return Do&&Do.box&&Do.box.length&&(x.markUsedOrientation(k,vo,Qe),x.placedOrientations[Qe.crossTileID]=vo),Do};Vo(function(){return Ps(_o,i.WritingMode.horizontal)},function(){var ri=Ir.verticalTextBox;return k.allowVerticalPlacement&&Qe.numVerticalGlyphVertices>0&&ri?Ps(ri,i.WritingMode.vertical):{box:null,offscreen:null}}),lo(cr&&cr.box&&cr.box.length)}}if(Er=(jr=cr)&&jr.box&&jr.box.length>0,Pr=jr&&jr.offscreen,Qe.useRuntimeCollisionCircles){var lu=k.text.placedSymbolArray.get(Qe.centerJustifiedTextSymbolIndex),Cl=i.evaluateSizeForFeature(k.textSizeData,Mt,lu),es=R.get("text-padding");tn=x.collisionIndex.placeCollisionCircles(Rt,lu,k.lineVertexArray,k.glyphOffsetArray,Cl,j,K,tt,d,ne,At.predicate,Qe.collisionCircleDiameter,es),Er=Rt||tn.circles.length>0&&!tn.collisionDetected,Pr=Pr&&tn.offscreen}if(Ir.iconFeatureIndex&&(Kr=Ir.iconFeatureIndex),Ir.iconBox){var Al=function(ri){var vo=ae&&fr?po(ri,fr.x,fr.y,Yt,ne,x.transform.angle):ri;return x.collisionIndex.placeCollisionBox(vo,Nt,ct,j,At.predicate)};vr=Ui&&Ui.box&&Ui.box.length&&Ir.verticalIconBox?(hn=Al(Ir.verticalIconBox)).box.length>0:(hn=Al(Ir.iconBox)).box.length>0,Pr=Pr&&hn.offscreen}var Da=Dt||Qe.numHorizontalGlyphVertices===0&&Qe.numVerticalGlyphVertices===0,In=xt||Qe.numIconVertices===0;if(Da||In?In?Da||(vr=vr&&Er):Er=vr&&Er:vr=Er=vr&&Er,Er&&jr&&jr.box&&x.collisionIndex.insertCollisionBox(jr.box,R.get("text-ignore-placement"),k.bucketInstanceId,Ui&&Ui.box&&Xi?Xi:jn,At.ID),vr&&hn&&x.collisionIndex.insertCollisionBox(hn.box,R.get("icon-ignore-placement"),k.bucketInstanceId,Kr,At.ID),tn&&(Er&&x.collisionIndex.insertCollisionCircles(tn.circles,R.get("text-ignore-placement"),k.bucketInstanceId,jn,At.ID),d)){var qo=k.bucketInstanceId,Ys=x.collisionCircleArrays[qo];Ys===void 0&&(Ys=x.collisionCircleArrays[qo]=new Lo);for(var Oa=0;Oa<tn.circles.length;Oa+=4)Ys.circles.push(tn.circles[Oa+0]),Ys.circles.push(tn.circles[Oa+1]),Ys.circles.push(tn.circles[Oa+2]),Ys.circles.push(tn.collisionDetected?1:0)}x.placements[Qe.crossTileID]=new Ou(Er||xe,vr||ke,Pr||k.justReloaded),m[Qe.crossTileID]=!0}};if(le)for(var $e=k.getSortedSymbolIndexes(this.transform.angle),lr=$e.length-1;lr>=0;--lr){var hr=$e[lr];Le(k.symbolInstances.get(hr),k.collisionArrays[hr])}else for(var sr=p.symbolInstanceStart;sr<p.symbolInstanceEnd;sr++)Le(k.symbolInstances.get(sr),k.collisionArrays[sr]);if(d&&k.bucketInstanceId in this.collisionCircleArrays){var Zr=this.collisionCircleArrays[k.bucketInstanceId];i.invert(Zr.invProjMatrix,j),Zr.viewportMatrix=this.collisionIndex.getViewportMatrix()}k.justReloaded=!1},Sn.prototype.markUsedJustification=function(p,m,d,x){var A;A=x===i.WritingMode.vertical?d.verticalPlacedTextSymbolIndex:{left:d.leftJustifiedTextSymbolIndex,center:d.centerJustifiedTextSymbolIndex,right:d.rightJustifiedTextSymbolIndex}[i.getAnchorJustification(m)];for(var k=0,R=[d.leftJustifiedTextSymbolIndex,d.centerJustifiedTextSymbolIndex,d.rightJustifiedTextSymbolIndex,d.verticalPlacedTextSymbolIndex];k<R.length;k+=1){var j=R[k];j>=0&&(p.text.placedSymbolArray.get(j).crossTileID=A>=0&&j!==A?0:d.crossTileID)}},Sn.prototype.markUsedOrientation=function(p,m,d){for(var x=m===i.WritingMode.horizontal||m===i.WritingMode.horizontalOnly?m:0,A=m===i.WritingMode.vertical?m:0,k=0,R=[d.leftJustifiedTextSymbolIndex,d.centerJustifiedTextSymbolIndex,d.rightJustifiedTextSymbolIndex];k<R.length;k+=1)p.text.placedSymbolArray.get(R[k]).placedOrientation=x;d.verticalPlacedTextSymbolIndex&&(p.text.placedSymbolArray.get(d.verticalPlacedTextSymbolIndex).placedOrientation=A)},Sn.prototype.commit=function(p){this.commitTime=p,this.zoomAtLastRecencyCheck=this.transform.zoom;var m=this.prevPlacement,d=!1;this.prevZoomAdjustment=m?m.zoomAdjustment(this.transform.zoom):0;var x=m?m.symbolFadeChange(p):1,A=m?m.opacities:{},k=m?m.variableOffsets:{},R=m?m.placedOrientations:{};for(var j in this.placements){var K=this.placements[j],tt=A[j];tt?(this.opacities[j]=new oo(tt,x,K.text,K.icon),d=d||K.text!==tt.text.placed||K.icon!==tt.icon.placed):(this.opacities[j]=new oo(null,x,K.text,K.icon,K.skipFade),d=d||K.text||K.icon)}for(var ct in A){var ft=A[ct];if(!this.opacities[ct]){var mt=new oo(ft,x,!1,!1);mt.isHidden()||(this.opacities[ct]=mt,d=d||ft.text.placed||ft.icon.placed)}}for(var Mt in k)this.variableOffsets[Mt]||!this.opacities[Mt]||this.opacities[Mt].isHidden()||(this.variableOffsets[Mt]=k[Mt]);for(var At in R)this.placedOrientations[At]||!this.opacities[At]||this.opacities[At].isHidden()||(this.placedOrientations[At]=R[At]);d?this.lastPlacementChangeTime=p:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=m?m.lastPlacementChangeTime:p)},Sn.prototype.updateLayerOpacities=function(p,m){for(var d={},x=0,A=m;x<A.length;x+=1){var k=A[x],R=k.getBucket(p);R&&k.latestFeatureIndex&&p.id===R.layerIds[0]&&this.updateBucketOpacities(R,d,k.collisionBoxArray)}},Sn.prototype.updateBucketOpacities=function(p,m,d){var x=this;p.hasTextData()&&p.text.opacityVertexArray.clear(),p.hasIconData()&&p.icon.opacityVertexArray.clear(),p.hasIconCollisionBoxData()&&p.iconCollisionBox.collisionVertexArray.clear(),p.hasTextCollisionBoxData()&&p.textCollisionBox.collisionVertexArray.clear();var A=p.layers[0].layout,k=new oo(null,0,!1,!1,!0),R=A.get("text-allow-overlap"),j=A.get("icon-allow-overlap"),K=A.get("text-variable-anchor"),tt=A.get("text-rotation-alignment")==="map",ct=A.get("text-pitch-alignment")==="map",ft=A.get("icon-text-fit")!=="none",mt=new oo(null,0,R&&(j||!p.hasIconData()||A.get("icon-optional")),j&&(R||!p.hasTextData()||A.get("text-optional")),!0);!p.collisionArrays&&d&&(p.hasIconCollisionBoxData()||p.hasTextCollisionBoxData())&&p.deserializeCollisionBoxes(d);for(var Mt=function(Rt,Nt,Yt){for(var ne=0;ne<Nt/4;ne++)Rt.opacityVertexArray.emplaceBack(Yt)},At=function(Rt){var Nt=p.symbolInstances.get(Rt),Yt=Nt.numHorizontalGlyphVertices,ne=Nt.numVerticalGlyphVertices,ae=Nt.crossTileID,le=x.opacities[ae];m[ae]?le=k:le||(x.opacities[ae]=le=mt),m[ae]=!0;var xe=Nt.numIconVertices>0,ke=x.placedOrientations[Nt.crossTileID],Le=ke===i.WritingMode.vertical,$e=ke===i.WritingMode.horizontal||ke===i.WritingMode.horizontalOnly;if(Yt>0||ne>0){var lr=Uu(le.text);Mt(p.text,Yt,Le?ba:lr),Mt(p.text,ne,$e?ba:lr);var hr=le.text.isHidden();[Nt.rightJustifiedTextSymbolIndex,Nt.centerJustifiedTextSymbolIndex,Nt.leftJustifiedTextSymbolIndex].forEach(function(cr){cr>=0&&(p.text.placedSymbolArray.get(cr).hidden=hr||Le?1:0)}),Nt.verticalPlacedTextSymbolIndex>=0&&(p.text.placedSymbolArray.get(Nt.verticalPlacedTextSymbolIndex).hidden=hr||$e?1:0);var sr=x.variableOffsets[Nt.crossTileID];sr&&x.markUsedJustification(p,sr.anchor,Nt,ke);var Zr=x.placedOrientations[Nt.crossTileID];Zr&&(x.markUsedJustification(p,"left",Nt,Zr),x.markUsedOrientation(p,Zr,Nt))}if(xe){var Qe=Uu(le.icon),Ir=!(ft&&Nt.verticalPlacedIconSymbolIndex&&Le);Nt.placedIconSymbolIndex>=0&&(Mt(p.icon,Nt.numIconVertices,Ir?Qe:ba),p.icon.placedSymbolArray.get(Nt.placedIconSymbolIndex).hidden=le.icon.isHidden()),Nt.verticalPlacedIconSymbolIndex>=0&&(Mt(p.icon,Nt.numVerticalIconVertices,Ir?ba:Qe),p.icon.placedSymbolArray.get(Nt.verticalPlacedIconSymbolIndex).hidden=le.icon.isHidden())}if(p.hasIconCollisionBoxData()||p.hasTextCollisionBoxData()){var jr=p.collisionArrays[Rt];if(jr){var Er=new i.Point(0,0);if(jr.textBox||jr.verticalTextBox){var vr=!0;if(K){var Pr=x.variableOffsets[ae];Pr?(Er=Hi(Pr.anchor,Pr.width,Pr.height,Pr.textOffset,Pr.textBoxScale),tt&&Er._rotate(ct?x.transform.angle:-x.transform.angle)):vr=!1}jr.textBox&&oa(p.textCollisionBox.collisionVertexArray,le.text.placed,!vr||Le,Er.x,Er.y),jr.verticalTextBox&&oa(p.textCollisionBox.collisionVertexArray,le.text.placed,!vr||$e,Er.x,Er.y)}var fr=Boolean(!$e&&jr.verticalIconBox);jr.iconBox&&oa(p.iconCollisionBox.collisionVertexArray,le.icon.placed,fr,ft?Er.x:0,ft?Er.y:0),jr.verticalIconBox&&oa(p.iconCollisionBox.collisionVertexArray,le.icon.placed,!fr,ft?Er.x:0,ft?Er.y:0)}}},Dt=0;Dt<p.symbolInstances.length;Dt++)At(Dt);if(p.sortFeatures(this.transform.angle),this.retainedQueryData[p.bucketInstanceId]&&(this.retainedQueryData[p.bucketInstanceId].featureSortOrder=p.featureSortOrder),p.hasTextData()&&p.text.opacityVertexBuffer&&p.text.opacityVertexBuffer.updateData(p.text.opacityVertexArray),p.hasIconData()&&p.icon.opacityVertexBuffer&&p.icon.opacityVertexBuffer.updateData(p.icon.opacityVertexArray),p.hasIconCollisionBoxData()&&p.iconCollisionBox.collisionVertexBuffer&&p.iconCollisionBox.collisionVertexBuffer.updateData(p.iconCollisionBox.collisionVertexArray),p.hasTextCollisionBoxData()&&p.textCollisionBox.collisionVertexBuffer&&p.textCollisionBox.collisionVertexBuffer.updateData(p.textCollisionBox.collisionVertexArray),p.bucketInstanceId in this.collisionCircleArrays){var xt=this.collisionCircleArrays[p.bucketInstanceId];p.placementInvProjMatrix=xt.invProjMatrix,p.placementViewportMatrix=xt.viewportMatrix,p.collisionCircleArray=xt.circles,delete this.collisionCircleArrays[p.bucketInstanceId]}},Sn.prototype.symbolFadeChange=function(p){return this.fadeDuration===0?1:(p-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},Sn.prototype.zoomAdjustment=function(p){return Math.max(0,(this.transform.zoom-p)/1.5)},Sn.prototype.hasTransitions=function(p){return this.stale||p-this.lastPlacementChangeTime<this.fadeDuration},Sn.prototype.stillRecent=function(p,m){var d=this.zoomAtLastRecencyCheck===m?1-this.zoomAdjustment(m):1;return this.zoomAtLastRecencyCheck=m,this.commitTime+this.fadeDuration*d>p},Sn.prototype.setStale=function(){this.stale=!0};var ll=Math.pow(2,25),Kl=Math.pow(2,24),_s=Math.pow(2,17),mn=Math.pow(2,16),Fs=Math.pow(2,9),Fu=Math.pow(2,8),Bu=Math.pow(2,1);function Uu(p){if(p.opacity===0&&!p.placed)return 0;if(p.opacity===1&&p.placed)return 4294967295;var m=p.placed?1:0,d=Math.floor(127*p.opacity);return d*ll+m*Kl+d*_s+m*mn+d*Fs+m*Fu+d*Bu+m}var ba=0,ul=function(p){this._sortAcrossTiles=p.layout.get("symbol-z-order")!=="viewport-y"&&p.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};ul.prototype.continuePlacement=function(p,m,d,x,A){for(var k=this._bucketParts;this._currentTileIndex<p.length;)if(m.getBucketParts(k,x,p[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,A())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,k.sort(function(R,j){return R.sortKey-j.sortKey}));this._currentPartIndex<k.length;)if(m.placeLayerBucketPart(k[this._currentPartIndex],this._seenCrossTileIDs,d),this._currentPartIndex++,A())return!0;return!1};var cl=function(p,m,d,x,A,k,R){this.placement=new Sn(p,A,k,R),this._currentPlacementIndex=m.length-1,this._forceFullPlacement=d,this._showCollisionBoxes=x,this._done=!1};cl.prototype.isDone=function(){return this._done},cl.prototype.continuePlacement=function(p,m,d){for(var x=this,A=i.browser.now(),k=function(){var K=i.browser.now()-A;return!x._forceFullPlacement&&K>2};this._currentPlacementIndex>=0;){var R=m[p[this._currentPlacementIndex]],j=this.placement.collisionIndex.transform.zoom;if(R.type==="symbol"&&(!R.minzoom||R.minzoom<=j)&&(!R.maxzoom||R.maxzoom>j)){if(this._inProgressLayer||(this._inProgressLayer=new ul(R)),this._inProgressLayer.continuePlacement(d[R.source],this.placement,this._showCollisionBoxes,R,k))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},cl.prototype.commit=function(p){return this.placement.commit(p),this.placement};var Cc=512/i.EXTENT/2,Bs=function(p,m,d){this.tileID=p,this.indexedSymbolInstances={},this.bucketInstanceId=d;for(var x=0;x<m.length;x++){var A=m.get(x),k=A.key;this.indexedSymbolInstances[k]||(this.indexedSymbolInstances[k]=[]),this.indexedSymbolInstances[k].push({crossTileID:A.crossTileID,coord:this.getScaledCoordinates(A,p)})}};Bs.prototype.getScaledCoordinates=function(p,m){var d=Cc/Math.pow(2,m.canonical.z-this.tileID.canonical.z);return{x:Math.floor((m.canonical.x*i.EXTENT+p.anchorX)*d),y:Math.floor((m.canonical.y*i.EXTENT+p.anchorY)*d)}},Bs.prototype.findMatches=function(p,m,d){for(var x=this.tileID.canonical.z<m.canonical.z?1:Math.pow(2,this.tileID.canonical.z-m.canonical.z),A=0;A<p.length;A++){var k=p.get(A);if(!k.crossTileID){var R=this.indexedSymbolInstances[k.key];if(R)for(var j=this.getScaledCoordinates(k,m),K=0,tt=R;K<tt.length;K+=1){var ct=tt[K];if(Math.abs(ct.coord.x-j.x)<=x&&Math.abs(ct.coord.y-j.y)<=x&&!d[ct.crossTileID]){d[ct.crossTileID]=!0,k.crossTileID=ct.crossTileID;break}}}}};var fo=function(){this.maxCrossTileID=0};fo.prototype.generate=function(){return++this.maxCrossTileID};var aa=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};aa.prototype.handleWrapJump=function(p){var m=Math.round((p-this.lng)/360);if(m!==0)for(var d in this.indexes){var x=this.indexes[d],A={};for(var k in x){var R=x[k];R.tileID=R.tileID.unwrapTo(R.tileID.wrap+m),A[R.tileID.key]=R}this.indexes[d]=A}this.lng=p},aa.prototype.addBucket=function(p,m,d){if(this.indexes[p.overscaledZ]&&this.indexes[p.overscaledZ][p.key]){if(this.indexes[p.overscaledZ][p.key].bucketInstanceId===m.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(p.overscaledZ,this.indexes[p.overscaledZ][p.key])}for(var x=0;x<m.symbolInstances.length;x++)m.symbolInstances.get(x).crossTileID=0;this.usedCrossTileIDs[p.overscaledZ]||(this.usedCrossTileIDs[p.overscaledZ]={});var A=this.usedCrossTileIDs[p.overscaledZ];for(var k in this.indexes){var R=this.indexes[k];if(Number(k)>p.overscaledZ)for(var j in R){var K=R[j];K.tileID.isChildOf(p)&&K.findMatches(m.symbolInstances,p,A)}else{var tt=R[p.scaledTo(Number(k)).key];tt&&tt.findMatches(m.symbolInstances,p,A)}}for(var ct=0;ct<m.symbolInstances.length;ct++){var ft=m.symbolInstances.get(ct);ft.crossTileID||(ft.crossTileID=d.generate(),A[ft.crossTileID]=!0)}return this.indexes[p.overscaledZ]===void 0&&(this.indexes[p.overscaledZ]={}),this.indexes[p.overscaledZ][p.key]=new Bs(p,m.symbolInstances,m.bucketInstanceId),!0},aa.prototype.removeBucketCrossTileIDs=function(p,m){for(var d in m.indexedSymbolInstances)for(var x=0,A=m.indexedSymbolInstances[d];x<A.length;x+=1)delete this.usedCrossTileIDs[p][A[x].crossTileID]},aa.prototype.removeStaleBuckets=function(p){var m=!1;for(var d in this.indexes){var x=this.indexes[d];for(var A in x)p[x[A].bucketInstanceId]||(this.removeBucketCrossTileIDs(d,x[A]),delete x[A],m=!0)}return m};var sa=function(){this.layerIndexes={},this.crossTileIDs=new fo,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};sa.prototype.addLayer=function(p,m,d){var x=this.layerIndexes[p.id];x===void 0&&(x=this.layerIndexes[p.id]=new aa);var A=!1,k={};x.handleWrapJump(d);for(var R=0,j=m;R<j.length;R+=1){var K=j[R],tt=K.getBucket(p);tt&&p.id===tt.layerIds[0]&&(tt.bucketInstanceId||(tt.bucketInstanceId=++this.maxBucketInstanceId),x.addBucket(K.tileID,tt,this.crossTileIDs)&&(A=!0),k[tt.bucketInstanceId]=!0)}return x.removeStaleBuckets(k)&&(A=!0),A},sa.prototype.pruneUnusedLayers=function(p){var m={};for(var d in p.forEach(function(x){m[x]=!0}),this.layerIndexes)m[d]||delete this.layerIndexes[d]};var qa=function(p,m){return i.emitValidationErrors(p,m&&m.filter(function(d){return d.identifier!=="source.canvas"}))},Yr=i.pick(Ct,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Za=i.pick(Ct,["setCenter","setZoom","setBearing","setPitch"]),Xa=function(){var p={},m=i.styleSpec.$version;for(var d in i.styleSpec.$root){var x,A=i.styleSpec.$root[d];A.required&&(x=d==="version"?m:A.type==="array"?[]:{})!=null&&(p[d]=x)}return p}(),Dn=function(p){function m(d,x){var A=this;x===void 0&&(x={}),p.call(this),this.map=d,this.dispatcher=new qe(pt(),this),this.imageManager=new wt,this.imageManager.setEventedParent(this),this.glyphManager=new ye(d._requestManager,x.localIdeographFontFamily),this.lineAtlas=new Be(256,512),this.crossTileSymbolIndex=new sa,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new i.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",i.getReferrer());var k=this;this._rtlTextPluginCallback=m.registerForPluginStateChange(function(R){k.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:R.pluginStatus,pluginURL:R.pluginURL},function(j,K){if(i.triggerPluginCompletionEvent(j),K&&K.every(function(ct){return ct}))for(var tt in k.sourceCaches)k.sourceCaches[tt].reload()})}),this.on("data",function(R){if(R.dataType==="source"&&R.sourceDataType==="metadata"){var j=A.sourceCaches[R.sourceId];if(j){var K=j.getSource();if(K&&K.vectorLayerIds)for(var tt in A._layers){var ct=A._layers[tt];ct.source===K.id&&A._validateLayer(ct)}}}})}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.loadURL=function(d,x){var A=this;x===void 0&&(x={}),this.fire(new i.Event("dataloading",{dataType:"style"}));var k=typeof x.validate=="boolean"?x.validate:!i.isMapboxURL(d);d=this.map._requestManager.normalizeStyleURL(d,x.accessToken);var R=this.map._requestManager.transformRequest(d,i.ResourceType.Style);this._request=i.getJSON(R,function(j,K){A._request=null,j?A.fire(new i.ErrorEvent(j)):K&&A._load(K,k)})},m.prototype.loadJSON=function(d,x){var A=this;x===void 0&&(x={}),this.fire(new i.Event("dataloading",{dataType:"style"})),this._request=i.browser.frame(function(){A._request=null,A._load(d,x.validate!==!1)})},m.prototype.loadEmpty=function(){this.fire(new i.Event("dataloading",{dataType:"style"})),this._load(Xa,!1)},m.prototype._load=function(d,x){if(!x||!qa(this,i.validateStyle(d))){for(var A in this._loaded=!0,this.stylesheet=d,d.sources)this.addSource(A,d.sources[A],{validate:!1});d.sprite?this._loadSprite(d.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(d.glyphs);var k=Et(this.stylesheet.layers);this._order=k.map(function(tt){return tt.id}),this._layers={},this._serializedLayers={};for(var R=0,j=k;R<j.length;R+=1){var K=j[R];(K=i.createStyleLayer(K)).setEventedParent(this,{layer:{id:K.id}}),this._layers[K.id]=K,this._serializedLayers[K.id]=K.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new ir(this.stylesheet.light),this.fire(new i.Event("data",{dataType:"style"})),this.fire(new i.Event("style.load"))}},m.prototype._loadSprite=function(d){var x=this;this._spriteRequest=function(A,k,R){var j,K,tt,ct=i.browser.devicePixelRatio>1?"@2x":"",ft=i.getJSON(k.transformRequest(k.normalizeSpriteURL(A,ct,".json"),i.ResourceType.SpriteJSON),function(At,Dt){ft=null,tt||(tt=At,j=Dt,Mt())}),mt=i.getImage(k.transformRequest(k.normalizeSpriteURL(A,ct,".png"),i.ResourceType.SpriteImage),function(At,Dt){mt=null,tt||(tt=At,K=Dt,Mt())});function Mt(){if(tt)R(tt);else if(j&&K){var At=i.browser.getImageData(K),Dt={};for(var xt in j){var Rt=j[xt],Nt=Rt.width,Yt=Rt.height,ne=Rt.x,ae=Rt.y,le=Rt.sdf,xe=Rt.pixelRatio,ke=Rt.stretchX,Le=Rt.stretchY,$e=Rt.content,lr=new i.RGBAImage({width:Nt,height:Yt});i.RGBAImage.copy(At,lr,{x:ne,y:ae},{x:0,y:0},{width:Nt,height:Yt}),Dt[xt]={data:lr,pixelRatio:xe,sdf:le,stretchX:ke,stretchY:Le,content:$e}}R(null,Dt)}}return{cancel:function(){ft&&(ft.cancel(),ft=null),mt&&(mt.cancel(),mt=null)}}}(d,this.map._requestManager,function(A,k){if(x._spriteRequest=null,A)x.fire(new i.ErrorEvent(A));else if(k)for(var R in k)x.imageManager.addImage(R,k[R]);x.imageManager.setLoaded(!0),x._availableImages=x.imageManager.listImages(),x.dispatcher.broadcast("setImages",x._availableImages),x.fire(new i.Event("data",{dataType:"style"}))})},m.prototype._validateLayer=function(d){var x=this.sourceCaches[d.source];if(x){var A=d.sourceLayer;if(A){var k=x.getSource();(k.type==="geojson"||k.vectorLayerIds&&k.vectorLayerIds.indexOf(A)===-1)&&this.fire(new i.ErrorEvent(new Error('Source layer "'+A+'" does not exist on source "'+k.id+'" as specified by style layer "'+d.id+'"')))}}},m.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var d in this.sourceCaches)if(!this.sourceCaches[d].loaded())return!1;return!!this.imageManager.isLoaded()},m.prototype._serializeLayers=function(d){for(var x=[],A=0,k=d;A<k.length;A+=1){var R=this._layers[k[A]];R.type!=="custom"&&x.push(R.serialize())}return x},m.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var d in this.sourceCaches)if(this.sourceCaches[d].hasTransition())return!0;for(var x in this._layers)if(this._layers[x].hasTransition())return!0;return!1},m.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},m.prototype.update=function(d){if(this._loaded){var x=this._changed;if(this._changed){var A=Object.keys(this._updatedLayers),k=Object.keys(this._removedLayers);for(var R in(A.length||k.length)&&this._updateWorkerLayers(A,k),this._updatedSources){var j=this._updatedSources[R];j==="reload"?this._reloadSource(R):j==="clear"&&this._clearSource(R)}for(var K in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[K].updateTransitions(d);this.light.updateTransitions(d),this._resetUpdates()}var tt={};for(var ct in this.sourceCaches){var ft=this.sourceCaches[ct];tt[ct]=ft.used,ft.used=!1}for(var mt=0,Mt=this._order;mt<Mt.length;mt+=1){var At=this._layers[Mt[mt]];At.recalculate(d,this._availableImages),!At.isHidden(d.zoom)&&At.source&&(this.sourceCaches[At.source].used=!0)}for(var Dt in tt){var xt=this.sourceCaches[Dt];tt[Dt]!==xt.used&&xt.fire(new i.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:Dt}))}this.light.recalculate(d),this.z=d.zoom,x&&this.fire(new i.Event("data",{dataType:"style"}))}},m.prototype._updateTilesForChangedImages=function(){var d=Object.keys(this._changedImages);if(d.length){for(var x in this.sourceCaches)this.sourceCaches[x].reloadTilesForDependencies(["icons","patterns"],d);this._changedImages={}}},m.prototype._updateWorkerLayers=function(d,x){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(d),removedIds:x})},m.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},m.prototype.setState=function(d){var x=this;if(this._checkLoaded(),qa(this,i.validateStyle(d)))return!1;(d=i.clone$1(d)).layers=Et(d.layers);var A=function(R,j){if(!R)return[{command:Ct.setStyle,args:[j]}];var K=[];try{if(!i.deepEqual(R.version,j.version))return[{command:Ct.setStyle,args:[j]}];i.deepEqual(R.center,j.center)||K.push({command:Ct.setCenter,args:[j.center]}),i.deepEqual(R.zoom,j.zoom)||K.push({command:Ct.setZoom,args:[j.zoom]}),i.deepEqual(R.bearing,j.bearing)||K.push({command:Ct.setBearing,args:[j.bearing]}),i.deepEqual(R.pitch,j.pitch)||K.push({command:Ct.setPitch,args:[j.pitch]}),i.deepEqual(R.sprite,j.sprite)||K.push({command:Ct.setSprite,args:[j.sprite]}),i.deepEqual(R.glyphs,j.glyphs)||K.push({command:Ct.setGlyphs,args:[j.glyphs]}),i.deepEqual(R.transition,j.transition)||K.push({command:Ct.setTransition,args:[j.transition]}),i.deepEqual(R.light,j.light)||K.push({command:Ct.setLight,args:[j.light]});var tt={},ct=[];(function(mt,Mt,At,Dt){var xt;for(xt in Mt=Mt||{},mt=mt||{})mt.hasOwnProperty(xt)&&(Mt.hasOwnProperty(xt)||$t(xt,At,Dt));for(xt in Mt)Mt.hasOwnProperty(xt)&&(mt.hasOwnProperty(xt)?i.deepEqual(mt[xt],Mt[xt])||(mt[xt].type==="geojson"&&Mt[xt].type==="geojson"&&De(mt,Mt,xt)?At.push({command:Ct.setGeoJSONSourceData,args:[xt,Mt[xt].data]}):ee(xt,Mt,At,Dt)):te(xt,Mt,At))})(R.sources,j.sources,ct,tt);var ft=[];R.layers&&R.layers.forEach(function(mt){tt[mt.source]?K.push({command:Ct.removeLayer,args:[mt.id]}):ft.push(mt)}),K=K.concat(ct),function(mt,Mt,At){Mt=Mt||[];var Dt,xt,Rt,Nt,Yt,ne,ae,le=(mt=mt||[]).map(ze),xe=Mt.map(ze),ke=mt.reduce(Ue,{}),Le=Mt.reduce(Ue,{}),$e=le.slice(),lr=Object.create(null);for(Dt=0,xt=0;Dt<le.length;Dt++)Le.hasOwnProperty(Rt=le[Dt])?xt++:(At.push({command:Ct.removeLayer,args:[Rt]}),$e.splice($e.indexOf(Rt,xt),1));for(Dt=0,xt=0;Dt<xe.length;Dt++)$e[$e.length-1-Dt]!==(Rt=xe[xe.length-1-Dt])&&(ke.hasOwnProperty(Rt)?(At.push({command:Ct.removeLayer,args:[Rt]}),$e.splice($e.lastIndexOf(Rt,$e.length-xt),1)):xt++,At.push({command:Ct.addLayer,args:[Le[Rt],ne=$e[$e.length-Dt]]}),$e.splice($e.length-Dt,0,Rt),lr[Rt]=!0);for(Dt=0;Dt<xe.length;Dt++)if(Nt=ke[Rt=xe[Dt]],Yt=Le[Rt],!lr[Rt]&&!i.deepEqual(Nt,Yt))if(i.deepEqual(Nt.source,Yt.source)&&i.deepEqual(Nt["source-layer"],Yt["source-layer"])&&i.deepEqual(Nt.type,Yt.type)){for(ae in Se(Nt.layout,Yt.layout,At,Rt,null,Ct.setLayoutProperty),Se(Nt.paint,Yt.paint,At,Rt,null,Ct.setPaintProperty),i.deepEqual(Nt.filter,Yt.filter)||At.push({command:Ct.setFilter,args:[Rt,Yt.filter]}),i.deepEqual(Nt.minzoom,Yt.minzoom)&&i.deepEqual(Nt.maxzoom,Yt.maxzoom)||At.push({command:Ct.setLayerZoomRange,args:[Rt,Yt.minzoom,Yt.maxzoom]}),Nt)Nt.hasOwnProperty(ae)&&ae!=="layout"&&ae!=="paint"&&ae!=="filter"&&ae!=="metadata"&&ae!=="minzoom"&&ae!=="maxzoom"&&(ae.indexOf("paint.")===0?Se(Nt[ae],Yt[ae],At,Rt,ae.slice(6),Ct.setPaintProperty):i.deepEqual(Nt[ae],Yt[ae])||At.push({command:Ct.setLayerProperty,args:[Rt,ae,Yt[ae]]}));for(ae in Yt)Yt.hasOwnProperty(ae)&&!Nt.hasOwnProperty(ae)&&ae!=="layout"&&ae!=="paint"&&ae!=="filter"&&ae!=="metadata"&&ae!=="minzoom"&&ae!=="maxzoom"&&(ae.indexOf("paint.")===0?Se(Nt[ae],Yt[ae],At,Rt,ae.slice(6),Ct.setPaintProperty):i.deepEqual(Nt[ae],Yt[ae])||At.push({command:Ct.setLayerProperty,args:[Rt,ae,Yt[ae]]}))}else At.push({command:Ct.removeLayer,args:[Rt]}),ne=$e[$e.lastIndexOf(Rt)+1],At.push({command:Ct.addLayer,args:[Yt,ne]})}(ft,j.layers,K)}catch(mt){console.warn("Unable to compute style diff:",mt),K=[{command:Ct.setStyle,args:[j]}]}return K}(this.serialize(),d).filter(function(R){return!(R.command in Za)});if(A.length===0)return!1;var k=A.filter(function(R){return!(R.command in Yr)});if(k.length>0)throw new Error("Unimplemented: "+k.map(function(R){return R.command}).join(", ")+".");return A.forEach(function(R){R.command!=="setTransition"&&x[R.command].apply(x,R.args)}),this.stylesheet=d,!0},m.prototype.addImage=function(d,x){if(this.getImage(d))return this.fire(new i.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(d,x),this._afterImageUpdated(d)},m.prototype.updateImage=function(d,x){this.imageManager.updateImage(d,x)},m.prototype.getImage=function(d){return this.imageManager.getImage(d)},m.prototype.removeImage=function(d){if(!this.getImage(d))return this.fire(new i.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(d),this._afterImageUpdated(d)},m.prototype._afterImageUpdated=function(d){this._availableImages=this.imageManager.listImages(),this._changedImages[d]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new i.Event("data",{dataType:"style"}))},m.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},m.prototype.addSource=function(d,x,A){var k=this;if(A===void 0&&(A={}),this._checkLoaded(),this.sourceCaches[d]!==void 0)throw new Error("There is already a source with this ID");if(!x.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(x).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(x.type)>=0&&this._validate(i.validateStyle.source,"sources."+d,x,null,A))){this.map&&this.map._collectResourceTiming&&(x.collectResourceTiming=!0);var R=this.sourceCaches[d]=new zt(d,x,this.dispatcher);R.style=this,R.setEventedParent(this,function(){return{isSourceLoaded:k.loaded(),source:R.serialize(),sourceId:d}}),R.onAdd(this.map),this._changed=!0}},m.prototype.removeSource=function(d){if(this._checkLoaded(),this.sourceCaches[d]===void 0)throw new Error("There is no source with this ID");for(var x in this._layers)if(this._layers[x].source===d)return this.fire(new i.ErrorEvent(new Error('Source "'+d+'" cannot be removed while layer "'+x+'" is using it.')));var A=this.sourceCaches[d];delete this.sourceCaches[d],delete this._updatedSources[d],A.fire(new i.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:d})),A.setEventedParent(null),A.clearTiles(),A.onRemove&&A.onRemove(this.map),this._changed=!0},m.prototype.setGeoJSONSourceData=function(d,x){this._checkLoaded(),this.sourceCaches[d].getSource().setData(x),this._changed=!0},m.prototype.getSource=function(d){return this.sourceCaches[d]&&this.sourceCaches[d].getSource()},m.prototype.addLayer=function(d,x,A){A===void 0&&(A={}),this._checkLoaded();var k=d.id;if(this.getLayer(k))this.fire(new i.ErrorEvent(new Error('Layer with id "'+k+'" already exists on this map')));else{var R;if(d.type==="custom"){if(qa(this,i.validateCustomStyleLayer(d)))return;R=i.createStyleLayer(d)}else{if(typeof d.source=="object"&&(this.addSource(k,d.source),d=i.clone$1(d),d=i.extend(d,{source:k})),this._validate(i.validateStyle.layer,"layers."+k,d,{arrayIndex:-1},A))return;R=i.createStyleLayer(d),this._validateLayer(R),R.setEventedParent(this,{layer:{id:k}}),this._serializedLayers[R.id]=R.serialize()}var j=x?this._order.indexOf(x):this._order.length;if(x&&j===-1)this.fire(new i.ErrorEvent(new Error('Layer with id "'+x+'" does not exist on this map.')));else{if(this._order.splice(j,0,k),this._layerOrderChanged=!0,this._layers[k]=R,this._removedLayers[k]&&R.source&&R.type!=="custom"){var K=this._removedLayers[k];delete this._removedLayers[k],K.type!==R.type?this._updatedSources[R.source]="clear":(this._updatedSources[R.source]="reload",this.sourceCaches[R.source].pause())}this._updateLayer(R),R.onAdd&&R.onAdd(this.map)}}},m.prototype.moveLayer=function(d,x){if(this._checkLoaded(),this._changed=!0,this._layers[d]){if(d!==x){var A=this._order.indexOf(d);this._order.splice(A,1);var k=x?this._order.indexOf(x):this._order.length;x&&k===-1?this.fire(new i.ErrorEvent(new Error('Layer with id "'+x+'" does not exist on this map.'))):(this._order.splice(k,0,d),this._layerOrderChanged=!0)}}else this.fire(new i.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be moved.")))},m.prototype.removeLayer=function(d){this._checkLoaded();var x=this._layers[d];if(x){x.setEventedParent(null);var A=this._order.indexOf(d);this._order.splice(A,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[d]=x,delete this._layers[d],delete this._serializedLayers[d],delete this._updatedLayers[d],delete this._updatedPaintProps[d],x.onRemove&&x.onRemove(this.map)}else this.fire(new i.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be removed.")))},m.prototype.getLayer=function(d){return this._layers[d]},m.prototype.hasLayer=function(d){return d in this._layers},m.prototype.setLayerZoomRange=function(d,x,A){this._checkLoaded();var k=this.getLayer(d);k?k.minzoom===x&&k.maxzoom===A||(x!=null&&(k.minzoom=x),A!=null&&(k.maxzoom=A),this._updateLayer(k)):this.fire(new i.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot have zoom extent.")))},m.prototype.setFilter=function(d,x,A){A===void 0&&(A={}),this._checkLoaded();var k=this.getLayer(d);if(k){if(!i.deepEqual(k.filter,x))return x==null?(k.filter=void 0,void this._updateLayer(k)):void(this._validate(i.validateStyle.filter,"layers."+k.id+".filter",x,null,A)||(k.filter=i.clone$1(x),this._updateLayer(k)))}else this.fire(new i.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be filtered.")))},m.prototype.getFilter=function(d){return i.clone$1(this.getLayer(d).filter)},m.prototype.setLayoutProperty=function(d,x,A,k){k===void 0&&(k={}),this._checkLoaded();var R=this.getLayer(d);R?i.deepEqual(R.getLayoutProperty(x),A)||(R.setLayoutProperty(x,A,k),this._updateLayer(R)):this.fire(new i.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be styled.")))},m.prototype.getLayoutProperty=function(d,x){var A=this.getLayer(d);if(A)return A.getLayoutProperty(x);this.fire(new i.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style.")))},m.prototype.setPaintProperty=function(d,x,A,k){k===void 0&&(k={}),this._checkLoaded();var R=this.getLayer(d);R?i.deepEqual(R.getPaintProperty(x),A)||(R.setPaintProperty(x,A,k)&&this._updateLayer(R),this._changed=!0,this._updatedPaintProps[d]=!0):this.fire(new i.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be styled.")))},m.prototype.getPaintProperty=function(d,x){return this.getLayer(d).getPaintProperty(x)},m.prototype.setFeatureState=function(d,x){this._checkLoaded();var A=d.source,k=d.sourceLayer,R=this.sourceCaches[A];if(R!==void 0){var j=R.getSource().type;j==="geojson"&&k?this.fire(new i.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):j!=="vector"||k?(d.id===void 0&&this.fire(new i.ErrorEvent(new Error("The feature id parameter must be provided."))),R.setFeatureState(k,d.id,x)):this.fire(new i.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new i.ErrorEvent(new Error("The source '"+A+"' does not exist in the map's style.")))},m.prototype.removeFeatureState=function(d,x){this._checkLoaded();var A=d.source,k=this.sourceCaches[A];if(k!==void 0){var R=k.getSource().type,j=R==="vector"?d.sourceLayer:void 0;R!=="vector"||j?x&&typeof d.id!="string"&&typeof d.id!="number"?this.fire(new i.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):k.removeFeatureState(j,d.id,x):this.fire(new i.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new i.ErrorEvent(new Error("The source '"+A+"' does not exist in the map's style.")))},m.prototype.getFeatureState=function(d){this._checkLoaded();var x=d.source,A=d.sourceLayer,k=this.sourceCaches[x];if(k!==void 0){if(k.getSource().type!=="vector"||A)return d.id===void 0&&this.fire(new i.ErrorEvent(new Error("The feature id parameter must be provided."))),k.getFeatureState(A,d.id);this.fire(new i.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new i.ErrorEvent(new Error("The source '"+x+"' does not exist in the map's style.")))},m.prototype.getTransition=function(){return i.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},m.prototype.serialize=function(){return i.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:i.mapObject(this.sourceCaches,function(d){return d.serialize()}),layers:this._serializeLayers(this._order)},function(d){return d!==void 0})},m.prototype._updateLayer=function(d){this._updatedLayers[d.id]=!0,d.source&&!this._updatedSources[d.source]&&this.sourceCaches[d.source].getSource().type!=="raster"&&(this._updatedSources[d.source]="reload",this.sourceCaches[d.source].pause()),this._changed=!0},m.prototype._flattenAndSortRenderedFeatures=function(d){for(var x=this,A=function(ke){return x._layers[ke].type==="fill-extrusion"},k={},R=[],j=this._order.length-1;j>=0;j--){var K=this._order[j];if(A(K)){k[K]=j;for(var tt=0,ct=d;tt<ct.length;tt+=1){var ft=ct[tt][K];if(ft)for(var mt=0,Mt=ft;mt<Mt.length;mt+=1)R.push(Mt[mt])}}}R.sort(function(ke,Le){return Le.intersectionZ-ke.intersectionZ});for(var At=[],Dt=this._order.length-1;Dt>=0;Dt--){var xt=this._order[Dt];if(A(xt))for(var Rt=R.length-1;Rt>=0;Rt--){var Nt=R[Rt].feature;if(k[Nt.layer.id]<Dt)break;At.push(Nt),R.pop()}else for(var Yt=0,ne=d;Yt<ne.length;Yt+=1){var ae=ne[Yt][xt];if(ae)for(var le=0,xe=ae;le<xe.length;le+=1)At.push(xe[le].feature)}}return At},m.prototype.queryRenderedFeatures=function(d,x,A){x&&x.filter&&this._validate(i.validateStyle.filter,"queryRenderedFeatures.filter",x.filter,null,x);var k={};if(x&&x.layers){if(!Array.isArray(x.layers))return this.fire(new i.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var R=0,j=x.layers;R<j.length;R+=1){var K=j[R],tt=this._layers[K];if(!tt)return this.fire(new i.ErrorEvent(new Error("The layer '"+K+"' does not exist in the map's style and cannot be queried for features."))),[];k[tt.source]=!0}}var ct=[];for(var ft in x.availableImages=this._availableImages,this.sourceCaches)x.layers&&!k[ft]||ct.push(ci(this.sourceCaches[ft],this._layers,this._serializedLayers,d,x,A));return this.placement&&ct.push(function(mt,Mt,At,Dt,xt,Rt,Nt){for(var Yt={},ne=Rt.queryRenderedSymbols(Dt),ae=[],le=0,xe=Object.keys(ne).map(Number);le<xe.length;le+=1)ae.push(Nt[xe[le]]);ae.sort(Ri);for(var ke=function(){var sr=$e[Le],Zr=sr.featureIndex.lookupSymbolFeatures(ne[sr.bucketInstanceId],Mt,sr.bucketIndex,sr.sourceLayerIndex,xt.filter,xt.layers,xt.availableImages,mt);for(var Qe in Zr){var Ir=Yt[Qe]=Yt[Qe]||[],jr=Zr[Qe];jr.sort(function(Pr,fr){var cr=sr.featureSortOrder;if(cr){var Ui=cr.indexOf(Pr.featureIndex);return cr.indexOf(fr.featureIndex)-Ui}return fr.featureIndex-Pr.featureIndex});for(var Er=0,vr=jr;Er<vr.length;Er+=1)Ir.push(vr[Er])}},Le=0,$e=ae;Le<$e.length;Le+=1)ke();var lr=function(sr){Yt[sr].forEach(function(Zr){var Qe=Zr.feature,Ir=At[mt[sr].source].getFeatureState(Qe.layer["source-layer"],Qe.id);Qe.source=Qe.layer.source,Qe.layer["source-layer"]&&(Qe.sourceLayer=Qe.layer["source-layer"]),Qe.state=Ir})};for(var hr in Yt)lr(hr);return Yt}(this._layers,this._serializedLayers,this.sourceCaches,d,x,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(ct)},m.prototype.querySourceFeatures=function(d,x){x&&x.filter&&this._validate(i.validateStyle.filter,"querySourceFeatures.filter",x.filter,null,x);var A=this.sourceCaches[d];return A?function(k,R){for(var j=k.getRenderableIds().map(function(Mt){return k.getTileByID(Mt)}),K=[],tt={},ct=0;ct<j.length;ct++){var ft=j[ct],mt=ft.tileID.canonical.key;tt[mt]||(tt[mt]=!0,ft.querySourceFeatures(K,R))}return K}(A,x):[]},m.prototype.addSourceType=function(d,x,A){return m.getSourceType(d)?A(new Error('A source type called "'+d+'" already exists.')):(m.setSourceType(d,x),x.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:d,url:x.workerSourceURL},A):A(null,null))},m.prototype.getLight=function(){return this.light.getLight()},m.prototype.setLight=function(d,x){x===void 0&&(x={}),this._checkLoaded();var A=this.light.getLight(),k=!1;for(var R in d)if(!i.deepEqual(d[R],A[R])){k=!0;break}if(k){var j={now:i.browser.now(),transition:i.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(d,x),this.light.updateTransitions(j)}},m.prototype._validate=function(d,x,A,k,R){return R===void 0&&(R={}),(!R||R.validate!==!1)&&qa(this,d.call(i.validateStyle,i.extend({key:x,style:this.serialize(),value:A,styleSpec:i.styleSpec},k)))},m.prototype._remove=function(){for(var d in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),i.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[d].setEventedParent(null);for(var x in this.sourceCaches)this.sourceCaches[x].clearTiles(),this.sourceCaches[x].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},m.prototype._clearSource=function(d){this.sourceCaches[d].clearTiles()},m.prototype._reloadSource=function(d){this.sourceCaches[d].resume(),this.sourceCaches[d].reload()},m.prototype._updateSources=function(d){for(var x in this.sourceCaches)this.sourceCaches[x].update(d)},m.prototype._generateCollisionBoxes=function(){for(var d in this.sourceCaches)this._reloadSource(d)},m.prototype._updatePlacement=function(d,x,A,k,R){R===void 0&&(R=!1);for(var j=!1,K=!1,tt={},ct=0,ft=this._order;ct<ft.length;ct+=1){var mt=this._layers[ft[ct]];if(mt.type==="symbol"){if(!tt[mt.source]){var Mt=this.sourceCaches[mt.source];tt[mt.source]=Mt.getRenderableIds(!0).map(function(Nt){return Mt.getTileByID(Nt)}).sort(function(Nt,Yt){return Yt.tileID.overscaledZ-Nt.tileID.overscaledZ||(Nt.tileID.isLessThan(Yt.tileID)?-1:1)})}var At=this.crossTileSymbolIndex.addLayer(mt,tt[mt.source],d.center.lng);j=j||At}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((R=R||this._layerOrderChanged||A===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(i.browser.now(),d.zoom))&&(this.pauseablePlacement=new cl(d,this._order,R,x,A,k,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,tt),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(i.browser.now()),K=!0),j&&this.pauseablePlacement.placement.setStale()),K||j)for(var Dt=0,xt=this._order;Dt<xt.length;Dt+=1){var Rt=this._layers[xt[Dt]];Rt.type==="symbol"&&this.placement.updateLayerOpacities(Rt,tt[Rt.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(i.browser.now())},m.prototype._releaseSymbolFadeTiles=function(){for(var d in this.sourceCaches)this.sourceCaches[d].releaseSymbolFadeTiles()},m.prototype.getImages=function(d,x,A){this.imageManager.getImages(x.icons,A),this._updateTilesForChangedImages();var k=this.sourceCaches[x.source];k&&k.setDependencies(x.tileID.key,x.type,x.icons)},m.prototype.getGlyphs=function(d,x,A){this.glyphManager.getGlyphs(x.stacks,A)},m.prototype.getResource=function(d,x,A){return i.makeRequest(x,A)},m}(i.Evented);Dn.getSourceType=function(p){return ti[p]},Dn.setSourceType=function(p,m){ti[p]=m},Dn.registerForPluginStateChange=i.registerForPluginStateChange;var Ji=i.createLayout([{name:"a_pos",type:"Int16",components:2}]),On=yi(`#ifdef GL_ES
1
+ "use strict";(()=>{var U1=Object.create;var Jg=Object.defineProperty;var N1=Object.getOwnPropertyDescriptor;var V1=Object.getOwnPropertyNames;var G1=Object.getPrototypeOf,j1=Object.prototype.hasOwnProperty;var Vf=(v,l)=>()=>(l||v((l={exports:{}}).exports,l),l.exports),Qg=(v,l)=>{for(var o in l)Jg(v,o,{get:l[o],enumerable:!0})},q1=(v,l,o,c)=>{if(l&&typeof l=="object"||typeof l=="function")for(let i of V1(l))!j1.call(v,i)&&i!==o&&Jg(v,i,{get:()=>l[i],enumerable:!(c=N1(l,i))||c.enumerable});return v};var Fp=(v,l,o)=>(o=v!=null?U1(G1(v)):{},q1(l||!v||!v.__esModule?Jg(o,"default",{value:v,enumerable:!0}):o,v));var Jy=Vf((Yy,Hy)=>{(function(v,l){typeof Yy=="object"&&typeof Hy<"u"?Hy.exports=l():typeof define=="function"&&define.amd?define(l):(v=v||self).RBush=l()})(Yy,function(){"use strict";function v(wt,Lt,Zt,Jt,se){(function ce(oe,ye,be,Me,ir){for(;Me>be;){if(Me-be>600){var Be=Me-be+1,qe=ye-be+1,rr=Math.log(Be),Ce=.5*Math.exp(2*rr/3),Lr=.5*Math.sqrt(rr*Ce*(Be-Ce)/Be)*(qe-Be/2<0?-1:1),yr=Math.max(be,Math.floor(ye-qe*Ce/Be+Lr)),_r=Math.min(Me,Math.floor(ye+(Be-qe)*Ce/Be+Lr));ce(oe,ye,yr,_r,ir)}var br=oe[ye],xr=be,pr=Me;for(l(oe,be,ye),ir(oe[Me],br)>0&&l(oe,be,Me);xr<pr;){for(l(oe,xr,pr),xr++,pr--;ir(oe[xr],br)<0;)xr++;for(;ir(oe[pr],br)>0;)pr--}ir(oe[be],br)===0?l(oe,be,pr):l(oe,++pr,Me),pr<=ye&&(be=pr+1),ye<=pr&&(Me=pr-1)}})(wt,Lt,Zt||0,Jt||wt.length-1,se||o)}function l(wt,Lt,Zt){var Jt=wt[Lt];wt[Lt]=wt[Zt],wt[Zt]=Jt}function o(wt,Lt){return wt<Lt?-1:wt>Lt?1:0}var c=function(wt){wt===void 0&&(wt=9),this._maxEntries=Math.max(4,wt),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function i(wt,Lt,Zt){if(!Zt)return Lt.indexOf(wt);for(var Jt=0;Jt<Lt.length;Jt++)if(Zt(wt,Lt[Jt]))return Jt;return-1}function u(wt,Lt){P(wt,0,wt.children.length,Lt,wt)}function P(wt,Lt,Zt,Jt,se){se||(se=kt(null)),se.minX=1/0,se.minY=1/0,se.maxX=-1/0,se.maxY=-1/0;for(var ce=Lt;ce<Zt;ce++){var oe=wt.children[ce];D(se,wt.leaf?Jt(oe):oe)}return se}function D(wt,Lt){return wt.minX=Math.min(wt.minX,Lt.minX),wt.minY=Math.min(wt.minY,Lt.minY),wt.maxX=Math.max(wt.maxX,Lt.maxX),wt.maxY=Math.max(wt.maxY,Lt.maxY),wt}function F(wt,Lt){return wt.minX-Lt.minX}function U(wt,Lt){return wt.minY-Lt.minY}function N(wt){return(wt.maxX-wt.minX)*(wt.maxY-wt.minY)}function at(wt){return wt.maxX-wt.minX+(wt.maxY-wt.minY)}function yt(wt,Lt){return wt.minX<=Lt.minX&&wt.minY<=Lt.minY&&Lt.maxX<=wt.maxX&&Lt.maxY<=wt.maxY}function Tt(wt,Lt){return Lt.minX<=wt.maxX&&Lt.minY<=wt.maxY&&Lt.maxX>=wt.minX&&Lt.maxY>=wt.minY}function kt(wt){return{children:wt,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Vt(wt,Lt,Zt,Jt,se){for(var ce=[Lt,Zt];ce.length;)if(!((Zt=ce.pop())-(Lt=ce.pop())<=Jt)){var oe=Lt+Math.ceil((Zt-Lt)/Jt/2)*Jt;v(wt,oe,Lt,Zt,se),ce.push(Lt,oe,oe,Zt)}}return c.prototype.all=function(){return this._all(this.data,[])},c.prototype.search=function(wt){var Lt=this.data,Zt=[];if(!Tt(wt,Lt))return Zt;for(var Jt=this.toBBox,se=[];Lt;){for(var ce=0;ce<Lt.children.length;ce++){var oe=Lt.children[ce],ye=Lt.leaf?Jt(oe):oe;Tt(wt,ye)&&(Lt.leaf?Zt.push(oe):yt(wt,ye)?this._all(oe,Zt):se.push(oe))}Lt=se.pop()}return Zt},c.prototype.collides=function(wt){var Lt=this.data;if(!Tt(wt,Lt))return!1;for(var Zt=[];Lt;){for(var Jt=0;Jt<Lt.children.length;Jt++){var se=Lt.children[Jt],ce=Lt.leaf?this.toBBox(se):se;if(Tt(wt,ce)){if(Lt.leaf||yt(wt,ce))return!0;Zt.push(se)}}Lt=Zt.pop()}return!1},c.prototype.load=function(wt){if(!wt||!wt.length)return this;if(wt.length<this._minEntries){for(var Lt=0;Lt<wt.length;Lt++)this.insert(wt[Lt]);return this}var Zt=this._build(wt.slice(),0,wt.length-1,0);if(this.data.children.length)if(this.data.height===Zt.height)this._splitRoot(this.data,Zt);else{if(this.data.height<Zt.height){var Jt=this.data;this.data=Zt,Zt=Jt}this._insert(Zt,this.data.height-Zt.height-1,!0)}else this.data=Zt;return this},c.prototype.insert=function(wt){return wt&&this._insert(wt,this.data.height-1),this},c.prototype.clear=function(){return this.data=kt([]),this},c.prototype.remove=function(wt,Lt){if(!wt)return this;for(var Zt,Jt,se,ce=this.data,oe=this.toBBox(wt),ye=[],be=[];ce||ye.length;){if(ce||(ce=ye.pop(),Jt=ye[ye.length-1],Zt=be.pop(),se=!0),ce.leaf){var Me=i(wt,ce.children,Lt);if(Me!==-1)return ce.children.splice(Me,1),ye.push(ce),this._condense(ye),this}se||ce.leaf||!yt(ce,oe)?Jt?(Zt++,ce=Jt.children[Zt],se=!1):ce=null:(ye.push(ce),be.push(Zt),Zt=0,Jt=ce,ce=ce.children[0])}return this},c.prototype.toBBox=function(wt){return wt},c.prototype.compareMinX=function(wt,Lt){return wt.minX-Lt.minX},c.prototype.compareMinY=function(wt,Lt){return wt.minY-Lt.minY},c.prototype.toJSON=function(){return this.data},c.prototype.fromJSON=function(wt){return this.data=wt,this},c.prototype._all=function(wt,Lt){for(var Zt=[];wt;)wt.leaf?Lt.push.apply(Lt,wt.children):Zt.push.apply(Zt,wt.children),wt=Zt.pop();return Lt},c.prototype._build=function(wt,Lt,Zt,Jt){var se,ce=Zt-Lt+1,oe=this._maxEntries;if(ce<=oe)return u(se=kt(wt.slice(Lt,Zt+1)),this.toBBox),se;Jt||(Jt=Math.ceil(Math.log(ce)/Math.log(oe)),oe=Math.ceil(ce/Math.pow(oe,Jt-1))),(se=kt([])).leaf=!1,se.height=Jt;var ye=Math.ceil(ce/oe),be=ye*Math.ceil(Math.sqrt(oe));Vt(wt,Lt,Zt,be,this.compareMinX);for(var Me=Lt;Me<=Zt;Me+=be){var ir=Math.min(Me+be-1,Zt);Vt(wt,Me,ir,ye,this.compareMinY);for(var Be=Me;Be<=ir;Be+=ye){var qe=Math.min(Be+ye-1,ir);se.children.push(this._build(wt,Be,qe,Jt-1))}}return u(se,this.toBBox),se},c.prototype._chooseSubtree=function(wt,Lt,Zt,Jt){for(;Jt.push(Lt),!Lt.leaf&&Jt.length-1!==Zt;){for(var se=1/0,ce=1/0,oe=void 0,ye=0;ye<Lt.children.length;ye++){var be=Lt.children[ye],Me=N(be),ir=(Be=wt,qe=be,(Math.max(qe.maxX,Be.maxX)-Math.min(qe.minX,Be.minX))*(Math.max(qe.maxY,Be.maxY)-Math.min(qe.minY,Be.minY))-Me);ir<ce?(ce=ir,se=Me<se?Me:se,oe=be):ir===ce&&Me<se&&(se=Me,oe=be)}Lt=oe||Lt.children[0]}var Be,qe;return Lt},c.prototype._insert=function(wt,Lt,Zt){var Jt=Zt?wt:this.toBBox(wt),se=[],ce=this._chooseSubtree(Jt,this.data,Lt,se);for(ce.children.push(wt),D(ce,Jt);Lt>=0&&se[Lt].children.length>this._maxEntries;)this._split(se,Lt),Lt--;this._adjustParentBBoxes(Jt,se,Lt)},c.prototype._split=function(wt,Lt){var Zt=wt[Lt],Jt=Zt.children.length,se=this._minEntries;this._chooseSplitAxis(Zt,se,Jt);var ce=this._chooseSplitIndex(Zt,se,Jt),oe=kt(Zt.children.splice(ce,Zt.children.length-ce));oe.height=Zt.height,oe.leaf=Zt.leaf,u(Zt,this.toBBox),u(oe,this.toBBox),Lt?wt[Lt-1].children.push(oe):this._splitRoot(Zt,oe)},c.prototype._splitRoot=function(wt,Lt){this.data=kt([wt,Lt]),this.data.height=wt.height+1,this.data.leaf=!1,u(this.data,this.toBBox)},c.prototype._chooseSplitIndex=function(wt,Lt,Zt){for(var Jt,se,ce,oe,ye,be,Me,ir=1/0,Be=1/0,qe=Lt;qe<=Zt-Lt;qe++){var rr=P(wt,0,qe,this.toBBox),Ce=P(wt,qe,Zt,this.toBBox),Lr=(se=rr,ce=Ce,oe=void 0,ye=void 0,be=void 0,Me=void 0,oe=Math.max(se.minX,ce.minX),ye=Math.max(se.minY,ce.minY),be=Math.min(se.maxX,ce.maxX),Me=Math.min(se.maxY,ce.maxY),Math.max(0,be-oe)*Math.max(0,Me-ye)),yr=N(rr)+N(Ce);Lr<ir?(ir=Lr,Jt=qe,Be=yr<Be?yr:Be):Lr===ir&&yr<Be&&(Be=yr,Jt=qe)}return Jt||Zt-Lt},c.prototype._chooseSplitAxis=function(wt,Lt,Zt){var Jt=wt.leaf?this.compareMinX:F,se=wt.leaf?this.compareMinY:U;this._allDistMargin(wt,Lt,Zt,Jt)<this._allDistMargin(wt,Lt,Zt,se)&&wt.children.sort(Jt)},c.prototype._allDistMargin=function(wt,Lt,Zt,Jt){wt.children.sort(Jt);for(var se=this.toBBox,ce=P(wt,0,Lt,se),oe=P(wt,Zt-Lt,Zt,se),ye=at(ce)+at(oe),be=Lt;be<Zt-Lt;be++){var Me=wt.children[be];D(ce,wt.leaf?se(Me):Me),ye+=at(ce)}for(var ir=Zt-Lt-1;ir>=Lt;ir--){var Be=wt.children[ir];D(oe,wt.leaf?se(Be):Be),ye+=at(oe)}return ye},c.prototype._adjustParentBBoxes=function(wt,Lt,Zt){for(var Jt=Zt;Jt>=0;Jt--)D(Lt[Jt],wt)},c.prototype._condense=function(wt){for(var Lt=wt.length-1,Zt=void 0;Lt>=0;Lt--)wt[Lt].children.length===0?Lt>0?(Zt=wt[Lt-1].children).splice(Zt.indexOf(wt[Lt]),1):this.clear():u(wt[Lt],this.toBBox)},c})});var X0=Vf((w_,E_)=>{(function(v,l){typeof w_=="object"&&typeof E_<"u"?E_.exports=l():typeof define=="function"&&define.amd?define(l):(v=v||self,v.mapboxgl=l())})(w_,function(){"use strict";var v,l,o;function c(i,u){if(!v)v=u;else if(!l)l=u;else{var P="var sharedChunk = {}; ("+v+")(sharedChunk); ("+l+")(sharedChunk);",D={};v(D),o=u(D),typeof window<"u"&&(o.workerUrl=window.URL.createObjectURL(new Blob([P],{type:"text/javascript"})))}}return c(["exports"],function(i){"use strict";function u(t,n){return t(n={exports:{}},n.exports),n.exports}var P=D;function D(t,n,h,_){this.cx=3*t,this.bx=3*(h-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*n,this.by=3*(_-n)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=_,this.p2x=h,this.p2y=_}D.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},D.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},D.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},D.prototype.solveCurveX=function(t,n){var h,_,w,C,r;for(n===void 0&&(n=1e-6),w=t,r=0;r<8;r++){if(C=this.sampleCurveX(w)-t,Math.abs(C)<n)return w;var e=this.sampleCurveDerivativeX(w);if(Math.abs(e)<1e-6)break;w-=C/e}if((w=t)<(h=0))return h;if(w>(_=1))return _;for(;h<_;){if(C=this.sampleCurveX(w),Math.abs(C-t)<n)return w;t>C?h=w:_=w,w=.5*(_-h)+h}return w},D.prototype.solve=function(t,n){return this.sampleCurveY(this.solveCurveX(t,n))};var F=U;function U(t,n){this.x=t,this.y=n}U.prototype={clone:function(){return new U(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,n){return this.clone()._rotateAround(t,n)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var n=t.x-this.x,h=t.y-this.y;return n*n+h*h},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,n){return Math.atan2(this.x*n-this.y*t,this.x*t+this.y*n)},_matMult:function(t){var n=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=n,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var n=Math.cos(t),h=Math.sin(t),_=h*this.x+n*this.y;return this.x=n*this.x-h*this.y,this.y=_,this},_rotateAround:function(t,n){var h=Math.cos(t),_=Math.sin(t),w=n.y+_*(this.x-n.x)+h*(this.y-n.y);return this.x=n.x+h*(this.x-n.x)-_*(this.y-n.y),this.y=w,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},U.convert=function(t){return t instanceof U?t:Array.isArray(t)?new U(t[0],t[1]):t};var N=typeof self<"u"?self:{},at=Math.pow(2,53)-1;function yt(t,n,h,_){var w=new P(t,n,h,_);return function(C){return w.solve(C)}}var Tt=yt(.25,.1,.25,1);function kt(t,n,h){return Math.min(h,Math.max(n,t))}function Vt(t,n,h){var _=h-n,w=((t-n)%_+_)%_+n;return w===n?h:w}function wt(t){for(var n=[],h=arguments.length-1;h-- >0;)n[h]=arguments[h+1];for(var _=0,w=n;_<w.length;_+=1){var C=w[_];for(var r in C)t[r]=C[r]}return t}var Lt=1;function Zt(){return Lt++}function Jt(){return function t(n){return n?(n^16*Math.random()>>n/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function se(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function ce(t,n){t.forEach(function(h){n[h]&&(n[h]=n[h].bind(n))})}function oe(t,n){return t.indexOf(n,t.length-n.length)!==-1}function ye(t,n,h){var _={};for(var w in t)_[w]=n.call(h||this,t[w],w,t);return _}function be(t,n,h){var _={};for(var w in t)n.call(h||this,t[w],w,t)&&(_[w]=t[w]);return _}function Me(t){return Array.isArray(t)?t.map(Me):typeof t=="object"&&t?ye(t,Me):t}var ir={};function Be(t){ir[t]||(typeof console<"u"&&console.warn(t),ir[t]=!0)}function qe(t,n,h){return(h.y-t.y)*(n.x-t.x)>(n.y-t.y)*(h.x-t.x)}function rr(t){for(var n=0,h=0,_=t.length,w=_-1,C=void 0,r=void 0;h<_;w=h++)n+=((r=t[w]).x-(C=t[h]).x)*(C.y+r.y);return n}function Ce(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function Lr(t){var n={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(_,w,C,r){var e=C||r;return n[w]=!e||e.toLowerCase(),""}),n["max-age"]){var h=parseInt(n["max-age"],10);isNaN(h)?delete n["max-age"]:n["max-age"]=h}return n}var yr=null;function _r(t){if(yr==null){var n=t.navigator?t.navigator.userAgent:null;yr=!!t.safari||!(!n||!(/\b(iPad|iPhone|iPod)\b/.test(n)||n.match("Safari")&&!n.match("Chrome")))}return yr}function br(t){try{var n=N[t];return n.setItem("_mapbox_test_",1),n.removeItem("_mapbox_test_"),!0}catch{return!1}}var xr,pr,$r,Fe,ti=N.performance&&N.performance.now?N.performance.now.bind(N.performance):Date.now.bind(Date),oi=N.requestAnimationFrame||N.mozRequestAnimationFrame||N.webkitRequestAnimationFrame||N.msRequestAnimationFrame,ci=N.cancelAnimationFrame||N.mozCancelAnimationFrame||N.webkitCancelAnimationFrame||N.msCancelAnimationFrame,Ri={now:ti,frame:function(t){var n=oi(t);return{cancel:function(){return ci(n)}}},getImageData:function(t,n){n===void 0&&(n=0);var h=N.document.createElement("canvas"),_=h.getContext("2d");if(!_)throw new Error("failed to create canvas 2d context");return h.width=t.width,h.height=t.height,_.drawImage(t,0,0,t.width,t.height),_.getImageData(-n,-n,t.width+2*n,t.height+2*n)},resolveURL:function(t){return xr||(xr=N.document.createElement("a")),xr.href=t,xr.href},hardwareConcurrency:N.navigator&&N.navigator.hardwareConcurrency||4,get devicePixelRatio(){return N.devicePixelRatio},get prefersReducedMotion(){return!!N.matchMedia&&(pr==null&&(pr=N.matchMedia("(prefers-reduced-motion: reduce)")),pr.matches)}},Wr={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Di={supported:!1,testSupport:function(t){!vn&&Fe&&(sn?dr(t):$r=t)}},vn=!1,sn=!1;function dr(t){var n=t.createTexture();t.bindTexture(t.TEXTURE_2D,n);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,Fe),t.isContextLost())return;Di.supported=!0}catch{}t.deleteTexture(n),vn=!0}N.document&&((Fe=N.document.createElement("img")).onload=function(){$r&&dr($r),$r=null,sn=!0},Fe.onerror=function(){vn=!0,$r=null},Fe.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var xn="01",en=function(t,n){this._transformRequestFn=t,this._customAccessToken=n,this._createSkuToken()};function ji(t){return t.indexOf("mapbox:")===0}en.prototype._createSkuToken=function(){var t=function(){for(var n="",h=0;h<10;h++)n+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",xn,n].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},en.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},en.prototype.transformRequest=function(t,n){return this._transformRequestFn&&this._transformRequestFn(t,n)||{url:t}},en.prototype.normalizeStyleURL=function(t,n){if(!ji(t))return t;var h=Wi(t);return h.path="/styles/v1"+h.path,this._makeAPIURL(h,this._customAccessToken||n)},en.prototype.normalizeGlyphsURL=function(t,n){if(!ji(t))return t;var h=Wi(t);return h.path="/fonts/v1"+h.path,this._makeAPIURL(h,this._customAccessToken||n)},en.prototype.normalizeSourceURL=function(t,n){if(!ji(t))return t;var h=Wi(t);return h.path="/v4/"+h.authority+".json",h.params.push("secure"),this._makeAPIURL(h,this._customAccessToken||n)},en.prototype.normalizeSpriteURL=function(t,n,h,_){var w=Wi(t);return ji(t)?(w.path="/styles/v1"+w.path+"/sprite"+n+h,this._makeAPIURL(w,this._customAccessToken||_)):(w.path+=""+n+h,bn(w))},en.prototype.normalizeTileURL=function(t,n){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!ji(t))return t;var h=Wi(t);h.path=h.path.replace(/(\.(png|jpg)\d*)(?=$)/,(Ri.devicePixelRatio>=2||n===512?"@2x":"")+(Di.supported?".webp":"$1")),h.path=h.path.replace(/^.+\/v4\//,"/"),h.path="/v4"+h.path;var _=this._customAccessToken||function(w){for(var C=0,r=w;C<r.length;C+=1){var e=r[C].match(/^access_token=(.*)$/);if(e)return e[1]}return null}(h.params)||Wr.ACCESS_TOKEN;return Wr.REQUIRE_ACCESS_TOKEN&&_&&this._skuToken&&h.params.push("sku="+this._skuToken),this._makeAPIURL(h,_)},en.prototype.canonicalizeTileURL=function(t,n){var h=Wi(t);if(!h.path.match(/(^\/v4\/)/)||!h.path.match(/\.[\w]+$/))return t;var _="mapbox://tiles/";_+=h.path.replace("/v4/","");var w=h.params;return n&&(w=w.filter(function(C){return!C.match(/^access_token=/)})),w.length&&(_+="?"+w.join("&")),_},en.prototype.canonicalizeTileset=function(t,n){for(var h=!!n&&ji(n),_=[],w=0,C=t.tiles||[];w<C.length;w+=1){var r=C[w];Zn(r)?_.push(this.canonicalizeTileURL(r,h)):_.push(r)}return _},en.prototype._makeAPIURL=function(t,n){var h="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",_=Wi(Wr.API_URL);if(t.protocol=_.protocol,t.authority=_.authority,t.protocol==="http"){var w=t.params.indexOf("secure");w>=0&&t.params.splice(w,1)}if(_.path!=="/"&&(t.path=""+_.path+t.path),!Wr.REQUIRE_ACCESS_TOKEN)return bn(t);if(!(n=n||Wr.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+h);if(n[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+h);return t.params=t.params.filter(function(C){return C.indexOf("access_token")===-1}),t.params.push("access_token="+n),bn(t)};var qn=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Zn(t){return qn.test(t)}var io=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Wi(t){var n=t.match(io);if(!n)throw new Error("Unable to parse URL object");return{protocol:n[1],authority:n[2],path:n[3]||"/",params:n[4]?n[4].split("&"):[]}}function bn(t){var n=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+n}function co(t){if(!t)return null;var n=t.split(".");if(!n||n.length!==3)return null;try{return JSON.parse(decodeURIComponent(N.atob(n[1]).split("").map(function(h){return"%"+("00"+h.charCodeAt(0).toString(16)).slice(-2)}).join("")))}catch{return null}}var zr=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};zr.prototype.getStorageKey=function(t){var n,h=co(Wr.ACCESS_TOKEN);return n=h&&h.u?N.btoa(encodeURIComponent(h.u).replace(/%([0-9A-F]{2})/g,function(_,w){return String.fromCharCode(Number("0x"+w))})):Wr.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+n:"mapbox.eventData:"+n},zr.prototype.fetchEventData=function(){var t=br("localStorage"),n=this.getStorageKey(),h=this.getStorageKey("uuid");if(t)try{var _=N.localStorage.getItem(n);_&&(this.eventData=JSON.parse(_));var w=N.localStorage.getItem(h);w&&(this.anonId=w)}catch{Be("Unable to read from LocalStorage")}},zr.prototype.saveEventData=function(){var t=br("localStorage"),n=this.getStorageKey(),h=this.getStorageKey("uuid");if(t)try{N.localStorage.setItem(h,this.anonId),Object.keys(this.eventData).length>=1&&N.localStorage.setItem(n,JSON.stringify(this.eventData))}catch{Be("Unable to write to LocalStorage")}},zr.prototype.processRequests=function(t){},zr.prototype.postEvent=function(t,n,h,_){var w=this;if(Wr.EVENTS_URL){var C=Wi(Wr.EVENTS_URL);C.params.push("access_token="+(_||Wr.ACCESS_TOKEN||""));var r={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.2",skuId:xn,userId:this.anonId},e=n?wt(r,n):r,s={url:bn(C),headers:{"Content-Type":"text/plain"},body:JSON.stringify([e])};this.pendingRequest=hi(s,function(f){w.pendingRequest=null,h(f),w.saveEventData(),w.processRequests(_)})}},zr.prototype.queueRequest=function(t,n){this.queue.push(t),this.processRequests(n)};var $i,dn,ln=function(t){function n(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.postMapLoadEvent=function(h,_,w,C){this.skuToken=w,(Wr.EVENTS_URL&&C||Wr.ACCESS_TOKEN&&Array.isArray(h)&&h.some(function(r){return ji(r)||Zn(r)}))&&this.queueRequest({id:_,timestamp:Date.now()},C)},n.prototype.processRequests=function(h){var _=this;if(!this.pendingRequest&&this.queue.length!==0){var w=this.queue.shift(),C=w.id,r=w.timestamp;C&&this.success[C]||(this.anonId||this.fetchEventData(),se(this.anonId)||(this.anonId=Jt()),this.postEvent(r,{skuToken:this.skuToken},function(e){e||C&&(_.success[C]=!0)},h))}},n}(zr),na=new(function(t){function n(h){t.call(this,"appUserTurnstile"),this._customAccessToken=h}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.postTurnstileEvent=function(h,_){Wr.EVENTS_URL&&Wr.ACCESS_TOKEN&&Array.isArray(h)&&h.some(function(w){return ji(w)||Zn(w)})&&this.queueRequest(Date.now(),_)},n.prototype.processRequests=function(h){var _=this;if(!this.pendingRequest&&this.queue.length!==0){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var w=co(Wr.ACCESS_TOKEN),C=w?w.u:Wr.ACCESS_TOKEN,r=C!==this.eventData.tokenU;se(this.anonId)||(this.anonId=Jt(),r=!0);var e=this.queue.shift();if(this.eventData.lastSuccess){var s=new Date(this.eventData.lastSuccess),f=new Date(e),y=(e-this.eventData.lastSuccess)/864e5;r=r||y>=1||y<-1||s.getDate()!==f.getDate()}else r=!0;if(!r)return this.processRequests();this.postEvent(e,{"enabled.telemetry":!1},function(b){b||(_.eventData.lastSuccess=e,_.eventData.tokenU=C)},h)}},n}(zr)),fe=na.postTurnstileEvent.bind(na),Ze=new ln,no=Ze.postMapLoadEvent.bind(Ze),wn=500,ii=50;function En(){N.caches&&!$i&&($i=N.caches.open("mapbox-tiles"))}function Ei(t){var n=t.indexOf("?");return n<0?t:t.slice(0,n)}var Xn,ai=1/0;function Ge(){return Xn==null&&(Xn=N.OffscreenCanvas&&new N.OffscreenCanvas(1,1).getContext("2d")&&typeof N.createImageBitmap=="function"),Xn}var Rr={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(Rr);var kr=function(t){function n(h,_,w){_===401&&Zn(w)&&(h+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,h),this.status=_,this.url=w,this.name=this.constructor.name,this.message=h}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},n}(Error),qi=Ce()?function(){return self.worker&&self.worker.referrer}:function(){return(N.location.protocol==="blob:"?N.parent:N).location.href},Ki,Tr,ho=function(t,n){if(!(/^file:/.test(h=t.url)||/^file:/.test(qi())&&!/^\w+:/.test(h))){if(N.fetch&&N.Request&&N.AbortController&&N.Request.prototype.hasOwnProperty("signal"))return function(_,w){var C,r=new N.AbortController,e=new N.Request(_.url,{method:_.method||"GET",body:_.body,credentials:_.credentials,headers:_.headers,referrer:qi(),signal:r.signal}),s=!1,f=!1,y=(C=e.url).indexOf("sku=")>0&&Zn(C);_.type==="json"&&e.headers.set("Accept","application/json");var b=function(M,z,O){if(!f){if(M&&M.message!=="SecurityError"&&Be(M),z&&O)return E(z);var G=Date.now();N.fetch(e).then(function(V){if(V.ok){var W=y?V.clone():null;return E(V,W,G)}return w(new kr(V.statusText,V.status,_.url))}).catch(function(V){V.code!==20&&w(new Error(V.message))})}},E=function(M,z,O){(_.type==="arrayBuffer"?M.arrayBuffer():_.type==="json"?M.json():M.text()).then(function(G){f||(z&&O&&function(V,W,Y){if(En(),$i){var H={status:W.status,statusText:W.statusText,headers:new N.Headers};W.headers.forEach(function(ht,Pt){return H.headers.set(Pt,ht)});var ot=Lr(W.headers.get("Cache-Control")||"");ot["no-store"]||(ot["max-age"]&&H.headers.set("Expires",new Date(Y+1e3*ot["max-age"]).toUTCString()),new Date(H.headers.get("Expires")).getTime()-Y<42e4||function(ht,Pt){if(dn===void 0)try{new Response(new ReadableStream),dn=!0}catch{dn=!1}dn?Pt(ht.body):ht.blob().then(Pt)}(W,function(ht){var Pt=new N.Response(ht,H);En(),$i&&$i.then(function(Ut){return Ut.put(Ei(V.url),Pt)}).catch(function(Ut){return Be(Ut.message)})}))}}(e,z,O),s=!0,w(null,G,M.headers.get("Cache-Control"),M.headers.get("Expires")))}).catch(function(G){f||w(new Error(G.message))})};return y?function(M,z){if(En(),!$i)return z(null);var O=Ei(M.url);$i.then(function(G){G.match(O).then(function(V){var W=function(Y){if(!Y)return!1;var H=new Date(Y.headers.get("Expires")||0),ot=Lr(Y.headers.get("Cache-Control")||"");return H>Date.now()&&!ot["no-cache"]}(V);G.delete(O),W&&G.put(O,V.clone()),z(null,V,W)}).catch(z)}).catch(z)}(e,b):b(null,null),{cancel:function(){f=!0,s||r.abort()}}}(t,n);if(Ce()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,n,void 0,!0)}var h;return function(_,w){var C=new N.XMLHttpRequest;for(var r in C.open(_.method||"GET",_.url,!0),_.type==="arrayBuffer"&&(C.responseType="arraybuffer"),_.headers)C.setRequestHeader(r,_.headers[r]);return _.type==="json"&&(C.responseType="text",C.setRequestHeader("Accept","application/json")),C.withCredentials=_.credentials==="include",C.onerror=function(){w(new Error(C.statusText))},C.onload=function(){if((C.status>=200&&C.status<300||C.status===0)&&C.response!==null){var e=C.response;if(_.type==="json")try{e=JSON.parse(C.response)}catch(s){return w(s)}w(null,e,C.getResponseHeader("Cache-Control"),C.getResponseHeader("Expires"))}else w(new kr(C.statusText,C.status,_.url))},C.send(_.body),{cancel:function(){return C.abort()}}}(t,n)},Rn=function(t,n){return ho(wt(t,{type:"arrayBuffer"}),n)},hi=function(t,n){return ho(wt(t,{method:"POST"}),n)},Q="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";Ki=[],Tr=0;var it=function(t,n){if(Di.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),Tr>=Wr.MAX_PARALLEL_IMAGE_REQUESTS){var h={requestParameters:t,callback:n,cancelled:!1,cancel:function(){this.cancelled=!0}};return Ki.push(h),h}Tr++;var _=!1,w=function(){if(!_)for(_=!0,Tr--;Ki.length&&Tr<Wr.MAX_PARALLEL_IMAGE_REQUESTS;){var r=Ki.shift();r.cancelled||(r.cancel=it(r.requestParameters,r.callback).cancel)}},C=Rn(t,function(r,e,s,f){w(),r?n(r):e&&(Ge()?function(y,b){var E=new N.Blob([new Uint8Array(y)],{type:"image/png"});N.createImageBitmap(E).then(function(M){b(null,M)}).catch(function(M){b(new Error("Could not load image because of "+M.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}(e,n):function(y,b,E,M){var z=new N.Image,O=N.URL;z.onload=function(){b(null,z),O.revokeObjectURL(z.src),z.onload=null,N.requestAnimationFrame(function(){z.src=Q})},z.onerror=function(){return b(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var G=new N.Blob([new Uint8Array(y)],{type:"image/png"});z.cacheControl=E,z.expires=M,z.src=y.byteLength?O.createObjectURL(G):Q}(e,n,s,f))});return{cancel:function(){C.cancel(),w()}}};function st(t,n,h){h[t]&&h[t].indexOf(n)!==-1||(h[t]=h[t]||[],h[t].push(n))}function _t(t,n,h){if(h&&h[t]){var _=h[t].indexOf(n);_!==-1&&h[t].splice(_,1)}}var It=function(t,n){n===void 0&&(n={}),wt(this,n),this.type=t},Bt=function(t){function n(h,_){_===void 0&&(_={}),t.call(this,"error",wt({error:h},_))}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n}(It),Gt=function(){};Gt.prototype.on=function(t,n){return this._listeners=this._listeners||{},st(t,n,this._listeners),this},Gt.prototype.off=function(t,n){return _t(t,n,this._listeners),_t(t,n,this._oneTimeListeners),this},Gt.prototype.once=function(t,n){return this._oneTimeListeners=this._oneTimeListeners||{},st(t,n,this._oneTimeListeners),this},Gt.prototype.fire=function(t,n){typeof t=="string"&&(t=new It(t,n||{}));var h=t.type;if(this.listens(h)){t.target=this;for(var _=0,w=this._listeners&&this._listeners[h]?this._listeners[h].slice():[];_<w.length;_+=1)w[_].call(this,t);for(var C=0,r=this._oneTimeListeners&&this._oneTimeListeners[h]?this._oneTimeListeners[h].slice():[];C<r.length;C+=1){var e=r[C];_t(h,e,this._oneTimeListeners),e.call(this,t)}var s=this._eventedParent;s&&(wt(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),s.fire(t))}else t instanceof Bt&&console.error(t.error);return this},Gt.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},Gt.prototype.setEventedParent=function(t,n){return this._eventedParent=t,this._eventedParentData=n,this};var dt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},zt=function(t,n,h,_){this.message=(t?t+": ":"")+h,_&&(this.identifier=_),n!=null&&n.__line__&&(this.line=n.__line__)};function Qt(t){var n=t.value;return n?[new zt(t.key,n,"constants have been deprecated as of v8")]:[]}function nt(t){for(var n=[],h=arguments.length-1;h-- >0;)n[h]=arguments[h+1];for(var _=0,w=n;_<w.length;_+=1){var C=w[_];for(var r in C)t[r]=C[r]}return t}function X(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Z(t){if(Array.isArray(t))return t.map(Z);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var n={};for(var h in t)n[h]=Z(t[h]);return n}return X(t)}var rt=function(t){function n(h,_){t.call(this,_),this.message=_,this.key=h}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n}(Error),lt=function(t,n){n===void 0&&(n=[]),this.parent=t,this.bindings={};for(var h=0,_=n;h<_.length;h+=1){var w=_[h];this.bindings[w[0]]=w[1]}};lt.prototype.concat=function(t){return new lt(this,t)},lt.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},lt.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var gt={kind:"null"},pt={kind:"number"},St={kind:"string"},Et={kind:"boolean"},Ct={kind:"color"},te={kind:"object"},$t={kind:"value"},ee={kind:"collator"},De={kind:"formatted"},Se={kind:"resolvedImage"};function ze(t,n){return{kind:"array",itemType:t,N:n}}function Ue(t){if(t.kind==="array"){var n=Ue(t.itemType);return typeof t.N=="number"?"array<"+n+", "+t.N+">":t.itemType.kind==="value"?"array":"array<"+n+">"}return t.kind}var Dr=[gt,pt,St,Et,Ct,De,te,ze($t),Se];function ur(t,n){if(n.kind==="error")return null;if(t.kind==="array"){if(n.kind==="array"&&(n.N===0&&n.itemType.kind==="value"||!ur(t.itemType,n.itemType))&&(typeof t.N!="number"||t.N===n.N))return null}else{if(t.kind===n.kind)return null;if(t.kind==="value"){for(var h=0,_=Dr;h<_.length;h+=1)if(!ur(_[h],n))return null}}return"Expected "+Ue(t)+" but found "+Ue(n)+" instead."}function mr(t,n){return n.some(function(h){return h.kind===t.kind})}function nr(t,n){return n.some(function(h){return h==="null"?t===null:h==="array"?Array.isArray(t):h==="object"?t&&!Array.isArray(t)&&typeof t=="object":h===typeof t})}var Xe=u(function(t,n){var h={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function _(e){return(e=Math.round(e))<0?0:e>255?255:e}function w(e){return _(e[e.length-1]==="%"?parseFloat(e)/100*255:parseInt(e))}function C(e){return(s=e[e.length-1]==="%"?parseFloat(e)/100:parseFloat(e))<0?0:s>1?1:s;var s}function r(e,s,f){return f<0?f+=1:f>1&&(f-=1),6*f<1?e+(s-e)*f*6:2*f<1?s:3*f<2?e+(s-e)*(2/3-f)*6:e}try{n.parseCSSColor=function(e){var s,f=e.replace(/ /g,"").toLowerCase();if(f in h)return h[f].slice();if(f[0]==="#")return f.length===4?(s=parseInt(f.substr(1),16))>=0&&s<=4095?[(3840&s)>>4|(3840&s)>>8,240&s|(240&s)>>4,15&s|(15&s)<<4,1]:null:f.length===7&&(s=parseInt(f.substr(1),16))>=0&&s<=16777215?[(16711680&s)>>16,(65280&s)>>8,255&s,1]:null;var y=f.indexOf("("),b=f.indexOf(")");if(y!==-1&&b+1===f.length){var E=f.substr(0,y),M=f.substr(y+1,b-(y+1)).split(","),z=1;switch(E){case"rgba":if(M.length!==4)return null;z=C(M.pop());case"rgb":return M.length!==3?null:[w(M[0]),w(M[1]),w(M[2]),z];case"hsla":if(M.length!==4)return null;z=C(M.pop());case"hsl":if(M.length!==3)return null;var O=(parseFloat(M[0])%360+360)%360/360,G=C(M[1]),V=C(M[2]),W=V<=.5?V*(G+1):V+G-V*G,Y=2*V-W;return[_(255*r(Y,W,O+1/3)),_(255*r(Y,W,O)),_(255*r(Y,W,O-1/3)),z];default:return null}}return null}}catch{}}).parseCSSColor,Sr=function(t,n,h,_){_===void 0&&(_=1),this.r=t,this.g=n,this.b=h,this.a=_};Sr.parse=function(t){if(t){if(t instanceof Sr)return t;if(typeof t=="string"){var n=Xe(t);if(n)return new Sr(n[0]/255*n[3],n[1]/255*n[3],n[2]/255*n[3],n[3])}}},Sr.prototype.toString=function(){var t=this.toArray(),n=t[1],h=t[2],_=t[3];return"rgba("+Math.round(t[0])+","+Math.round(n)+","+Math.round(h)+","+_+")"},Sr.prototype.toArray=function(){var t=this.a;return t===0?[0,0,0,0]:[255*this.r/t,255*this.g/t,255*this.b/t,t]},Sr.black=new Sr(0,0,0,1),Sr.white=new Sr(1,1,1,1),Sr.transparent=new Sr(0,0,0,0),Sr.red=new Sr(1,0,0,1);var ni=function(t,n,h){this.sensitivity=t?n?"variant":"case":n?"accent":"base",this.locale=h,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};ni.prototype.compare=function(t,n){return this.collator.compare(t,n)},ni.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var rn=function(t,n,h,_,w){this.text=t,this.image=n,this.scale=h,this.fontStack=_,this.textColor=w},si=function(t){this.sections=t};si.fromString=function(t){return new si([new rn(t,null,null,null,null)])},si.prototype.isEmpty=function(){return this.sections.length===0||!this.sections.some(function(t){return t.text.length!==0||t.image&&t.image.name.length!==0})},si.factory=function(t){return t instanceof si?t:si.fromString(t)},si.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(t){return t.text}).join("")},si.prototype.serialize=function(){for(var t=["format"],n=0,h=this.sections;n<h.length;n+=1){var _=h[n];if(_.image)t.push(["image",_.image.name]);else{t.push(_.text);var w={};_.fontStack&&(w["text-font"]=["literal",_.fontStack.split(",")]),_.scale&&(w["font-scale"]=_.scale),_.textColor&&(w["text-color"]=["rgba"].concat(_.textColor.toArray())),t.push(w)}}return t};var Nn=function(t){this.name=t.name,this.available=t.available};function sl(t,n,h,_){return typeof t=="number"&&t>=0&&t<=255&&typeof n=="number"&&n>=0&&n<=255&&typeof h=="number"&&h>=0&&h<=255?_===void 0||typeof _=="number"&&_>=0&&_<=1?null:"Invalid rgba value ["+[t,n,h,_].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+(typeof _=="number"?[t,n,h,_]:[t,n,h]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function gi(t){if(t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||t instanceof Sr||t instanceof ni||t instanceof si||t instanceof Nn)return!0;if(Array.isArray(t)){for(var n=0,h=t;n<h.length;n+=1)if(!gi(h[n]))return!1;return!0}if(typeof t=="object"){for(var _ in t)if(!gi(t[_]))return!1;return!0}return!1}function Yi(t){if(t===null)return gt;if(typeof t=="string")return St;if(typeof t=="boolean")return Et;if(typeof t=="number")return pt;if(t instanceof Sr)return Ct;if(t instanceof ni)return ee;if(t instanceof si)return De;if(t instanceof Nn)return Se;if(Array.isArray(t)){for(var n,h=t.length,_=0,w=t;_<w.length;_+=1){var C=Yi(w[_]);if(n){if(n===C)continue;n=$t;break}n=C}return ze(n||$t,h)}return te}function gs(t){var n=typeof t;return t===null?"":n==="string"||n==="number"||n==="boolean"?String(t):t instanceof Sr||t instanceof si||t instanceof Nn?t.toString():JSON.stringify(t)}Nn.prototype.toString=function(){return this.name},Nn.fromString=function(t){return t?new Nn({name:t,available:!1}):null},Nn.prototype.serialize=function(){return["image",this.name]};var Wn=function(t,n){this.type=t,this.value=n};Wn.parse=function(t,n){if(t.length!==2)return n.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!gi(t[1]))return n.error("invalid value");var h=t[1],_=Yi(h),w=n.expectedType;return _.kind!=="array"||_.N!==0||!w||w.kind!=="array"||typeof w.N=="number"&&w.N!==0||(_=w),new Wn(_,h)},Wn.prototype.evaluate=function(){return this.value},Wn.prototype.eachChild=function(){},Wn.prototype.outputDefined=function(){return!0},Wn.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Sr?["rgba"].concat(this.value.toArray()):this.value instanceof si?this.value.serialize():this.value};var un=function(t){this.name="ExpressionEvaluationError",this.message=t};un.prototype.toJSON=function(){return this.message};var Po={string:St,number:pt,boolean:Et,object:te},Si=function(t,n){this.type=t,this.args=n};Si.parse=function(t,n){if(t.length<2)return n.error("Expected at least one argument.");var h,_=1,w=t[0];if(w==="array"){var C,r;if(t.length>2){var e=t[1];if(typeof e!="string"||!(e in Po)||e==="object")return n.error('The item type argument of "array" must be one of string, number, boolean',1);C=Po[e],_++}else C=$t;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return n.error('The length argument to "array" must be a positive integer literal',2);r=t[2],_++}h=ze(C,r)}else h=Po[w];for(var s=[];_<t.length;_++){var f=n.parse(t[_],_,$t);if(!f)return null;s.push(f)}return new Si(h,s)},Si.prototype.evaluate=function(t){for(var n=0;n<this.args.length;n++){var h=this.args[n].evaluate(t);if(!ur(this.type,Yi(h)))return h;if(n===this.args.length-1)throw new un("Expected value to be of type "+Ue(this.type)+", but found "+Ue(Yi(h))+" instead.")}return null},Si.prototype.eachChild=function(t){this.args.forEach(t)},Si.prototype.outputDefined=function(){return this.args.every(function(t){return t.outputDefined()})},Si.prototype.serialize=function(){var t=this.type,n=[t.kind];if(t.kind==="array"){var h=t.itemType;if(h.kind==="string"||h.kind==="number"||h.kind==="boolean"){n.push(h.kind);var _=t.N;(typeof _=="number"||this.args.length>1)&&n.push(_)}}return n.concat(this.args.map(function(w){return w.serialize()}))};var Mo=function(t){this.type=De,this.sections=t};Mo.parse=function(t,n){if(t.length<2)return n.error("Expected at least one argument.");var h=t[1];if(!Array.isArray(h)&&typeof h=="object")return n.error("First argument must be an image or text section.");for(var _=[],w=!1,C=1;C<=t.length-1;++C){var r=t[C];if(w&&typeof r=="object"&&!Array.isArray(r)){w=!1;var e=null;if(r["font-scale"]&&!(e=n.parse(r["font-scale"],1,pt)))return null;var s=null;if(r["text-font"]&&!(s=n.parse(r["text-font"],1,ze(St))))return null;var f=null;if(r["text-color"]&&!(f=n.parse(r["text-color"],1,Ct)))return null;var y=_[_.length-1];y.scale=e,y.font=s,y.textColor=f}else{var b=n.parse(t[C],1,$t);if(!b)return null;var E=b.type.kind;if(E!=="string"&&E!=="value"&&E!=="null"&&E!=="resolvedImage")return n.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");w=!0,_.push({content:b,scale:null,font:null,textColor:null})}}return new Mo(_)},Mo.prototype.evaluate=function(t){return new si(this.sections.map(function(n){var h=n.content.evaluate(t);return Yi(h)===Se?new rn("",h,null,null,null):new rn(gs(h),null,n.scale?n.scale.evaluate(t):null,n.font?n.font.evaluate(t).join(","):null,n.textColor?n.textColor.evaluate(t):null)}))},Mo.prototype.eachChild=function(t){for(var n=0,h=this.sections;n<h.length;n+=1){var _=h[n];t(_.content),_.scale&&t(_.scale),_.font&&t(_.font),_.textColor&&t(_.textColor)}},Mo.prototype.outputDefined=function(){return!1},Mo.prototype.serialize=function(){for(var t=["format"],n=0,h=this.sections;n<h.length;n+=1){var _=h[n];t.push(_.content.serialize());var w={};_.scale&&(w["font-scale"]=_.scale.serialize()),_.font&&(w["text-font"]=_.font.serialize()),_.textColor&&(w["text-color"]=_.textColor.serialize()),t.push(w)}return t};var oo=function(t){this.type=Se,this.input=t};oo.parse=function(t,n){if(t.length!==2)return n.error("Expected two arguments.");var h=n.parse(t[1],1,St);return h?new oo(h):n.error("No image name provided.")},oo.prototype.evaluate=function(t){var n=this.input.evaluate(t),h=Nn.fromString(n);return h&&t.availableImages&&(h.available=t.availableImages.indexOf(n)>-1),h},oo.prototype.eachChild=function(t){t(this.input)},oo.prototype.outputDefined=function(){return!1},oo.prototype.serialize=function(){return["image",this.input.serialize()]};var Ou={"to-boolean":Et,"to-color":Ct,"to-number":pt,"to-string":St},Lo=function(t,n){this.type=t,this.args=n};Lo.parse=function(t,n){if(t.length<2)return n.error("Expected at least one argument.");var h=t[0];if((h==="to-boolean"||h==="to-string")&&t.length!==2)return n.error("Expected one argument.");for(var _=Ou[h],w=[],C=1;C<t.length;C++){var r=n.parse(t[C],C,$t);if(!r)return null;w.push(r)}return new Lo(_,w)},Lo.prototype.evaluate=function(t){if(this.type.kind==="boolean")return Boolean(this.args[0].evaluate(t));if(this.type.kind==="color"){for(var n,h,_=0,w=this.args;_<w.length;_+=1){if(h=null,(n=w[_].evaluate(t))instanceof Sr)return n;if(typeof n=="string"){var C=t.parseColor(n);if(C)return C}else if(Array.isArray(n)&&!(h=n.length<3||n.length>4?"Invalid rbga value "+JSON.stringify(n)+": expected an array containing either three or four numeric values.":sl(n[0],n[1],n[2],n[3])))return new Sr(n[0]/255,n[1]/255,n[2]/255,n[3])}throw new un(h||"Could not parse color from value '"+(typeof n=="string"?n:String(JSON.stringify(n)))+"'")}if(this.type.kind==="number"){for(var r=null,e=0,s=this.args;e<s.length;e+=1){if((r=s[e].evaluate(t))===null)return 0;var f=Number(r);if(!isNaN(f))return f}throw new un("Could not convert "+JSON.stringify(r)+" to number.")}return this.type.kind==="formatted"?si.fromString(gs(this.args[0].evaluate(t))):this.type.kind==="resolvedImage"?Nn.fromString(gs(this.args[0].evaluate(t))):gs(this.args[0].evaluate(t))},Lo.prototype.eachChild=function(t){this.args.forEach(t)},Lo.prototype.outputDefined=function(){return this.args.every(function(t){return t.outputDefined()})},Lo.prototype.serialize=function(){if(this.type.kind==="formatted")return new Mo([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new oo(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild(function(n){t.push(n.serialize())}),t};var ys=["Unknown","Point","LineString","Polygon"],Bo=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};Bo.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Bo.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?ys[this.feature.type]:this.feature.type:null},Bo.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Bo.prototype.canonicalID=function(){return this.canonical},Bo.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Bo.prototype.parseColor=function(t){var n=this._parseColorCache[t];return n||(n=this._parseColorCache[t]=Sr.parse(t)),n};var Hi=function(t,n,h,_){this.name=t,this.type=n,this._evaluate=h,this.args=_};Hi.prototype.evaluate=function(t){return this._evaluate(t,this.args)},Hi.prototype.eachChild=function(t){this.args.forEach(t)},Hi.prototype.outputDefined=function(){return!1},Hi.prototype.serialize=function(){return[this.name].concat(this.args.map(function(t){return t.serialize()}))},Hi.parse=function(t,n){var h,_=t[0],w=Hi.definitions[_];if(!w)return n.error('Unknown expression "'+_+'". If you wanted a literal array, use ["literal", [...]].',0);for(var C=Array.isArray(w)?w[0]:w.type,r=Array.isArray(w)?[[w[1],w[2]]]:w.overloads,e=r.filter(function(re){var Xt=re[0];return!Array.isArray(Xt)||Xt.length===t.length-1}),s=null,f=0,y=e;f<y.length;f+=1){var b=y[f],E=b[0],M=b[1];s=new Za(n.registry,n.path,null,n.scope);for(var z=[],O=!1,G=1;G<t.length;G++){var V=t[G],W=Array.isArray(E)?E[G-1]:E.type,Y=s.parse(V,1+z.length,W);if(!Y){O=!0;break}z.push(Y)}if(!O)if(Array.isArray(E)&&E.length!==z.length)s.error("Expected "+E.length+" arguments, but found "+z.length+" instead.");else{for(var H=0;H<z.length;H++){var ot=Array.isArray(E)?E[H]:E.type,ht=z[H];s.concat(H+1).checkSubtype(ot,ht.type)}if(s.errors.length===0)return new Hi(_,C,M,z)}}if(e.length===1)(h=n.errors).push.apply(h,s.errors);else{for(var Pt=(e.length?e:r).map(function(re){var Xt;return Xt=re[0],Array.isArray(Xt)?"("+Xt.map(Ue).join(", ")+")":"("+Ue(Xt.type)+"...)"}).join(" | "),Ut=[],jt=1;jt<t.length;jt++){var qt=n.parse(t[jt],1+Ut.length);if(!qt)return null;Ut.push(Ue(qt.type))}n.error("Expected arguments of type "+Pt+", but found ("+Ut.join(", ")+") instead.")}return null},Hi.register=function(t,n){for(var h in Hi.definitions=n,n)t[h]=Hi};var po=function(t,n,h){this.type=ee,this.locale=h,this.caseSensitive=t,this.diacriticSensitive=n};function Sn(t,n){t[0]=Math.min(t[0],n[0]),t[1]=Math.min(t[1],n[1]),t[2]=Math.max(t[2],n[0]),t[3]=Math.max(t[3],n[1])}function oa(t,n){return!(t[0]<=n[0]||t[2]>=n[2]||t[1]<=n[1]||t[3]>=n[3])}function ll(t,n){var h=(180+t[0])/360,_=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,w=Math.pow(2,n.z);return[Math.round(h*w*8192),Math.round(_*w*8192)]}function Kl(t,n,h){return n[1]>t[1]!=h[1]>t[1]&&t[0]<(h[0]-n[0])*(t[1]-n[1])/(h[1]-n[1])+n[0]}function _s(t,n){for(var h,_,w,C,r,e,s,f=!1,y=0,b=n.length;y<b;y++)for(var E=n[y],M=0,z=E.length;M<z-1;M++){if((C=(h=t)[0]-(_=E[M])[0])*(s=h[1]-(w=E[M+1])[1])-(e=h[0]-w[0])*(r=h[1]-_[1])==0&&C*e<=0&&r*s<=0)return!1;Kl(t,E[M],E[M+1])&&(f=!f)}return f}function mn(t,n){for(var h=0;h<n.length;h++)if(_s(t,n[h]))return!0;return!1}function Fs(t,n,h,_){var w=_[0]-h[0],C=_[1]-h[1],r=(t[0]-h[0])*C-w*(t[1]-h[1]),e=(n[0]-h[0])*C-w*(n[1]-h[1]);return r>0&&e<0||r<0&&e>0}function Fu(t,n,h){for(var _=0,w=h;_<w.length;_+=1)for(var C=w[_],r=0;r<C.length-1;++r)if((b=[(y=C[r+1])[0]-(f=C[r])[0],y[1]-f[1]])[0]*(E=[(s=n)[0]-(e=t)[0],s[1]-e[1]])[1]-b[1]*E[0]!=0&&Fs(e,s,f,y)&&Fs(f,y,e,s))return!0;var e,s,f,y,b,E;return!1}function Bu(t,n){for(var h=0;h<t.length;++h)if(!_s(t[h],n))return!1;for(var _=0;_<t.length-1;++_)if(Fu(t[_],t[_+1],n))return!1;return!0}function Uu(t,n){for(var h=0;h<n.length;h++)if(Bu(t,n[h]))return!0;return!1}function ba(t,n,h){for(var _=[],w=0;w<t.length;w++){for(var C=[],r=0;r<t[w].length;r++){var e=ll(t[w][r],h);Sn(n,e),C.push(e)}_.push(C)}return _}function ul(t,n,h){for(var _=[],w=0;w<t.length;w++){var C=ba(t[w],n,h);_.push(C)}return _}function cl(t,n,h,_){if(t[0]<h[0]||t[0]>h[2]){var w=.5*_,C=t[0]-h[0]>w?-_:h[0]-t[0]>w?_:0;C===0&&(C=t[0]-h[2]>w?-_:h[2]-t[0]>w?_:0),t[0]+=C}Sn(n,t)}function Cc(t,n,h,_){for(var w=8192*Math.pow(2,_.z),C=[8192*_.x,8192*_.y],r=[],e=0,s=t;e<s.length;e+=1)for(var f=0,y=s[e];f<y.length;f+=1){var b=y[f],E=[b.x+C[0],b.y+C[1]];cl(E,n,h,w),r.push(E)}return r}function Bs(t,n,h,_){for(var w,C=8192*Math.pow(2,_.z),r=[8192*_.x,8192*_.y],e=[],s=0,f=t;s<f.length;s+=1){for(var y=[],b=0,E=f[s];b<E.length;b+=1){var M=E[b],z=[M.x+r[0],M.y+r[1]];Sn(n,z),y.push(z)}e.push(y)}if(n[2]-n[0]<=C/2){(w=n)[0]=w[1]=1/0,w[2]=w[3]=-1/0;for(var O=0,G=e;O<G.length;O+=1)for(var V=0,W=G[O];V<W.length;V+=1)cl(W[V],n,h,C)}return e}po.parse=function(t,n){if(t.length!==2)return n.error("Expected one argument.");var h=t[1];if(typeof h!="object"||Array.isArray(h))return n.error("Collator options argument must be an object.");var _=n.parse(h["case-sensitive"]!==void 0&&h["case-sensitive"],1,Et);if(!_)return null;var w=n.parse(h["diacritic-sensitive"]!==void 0&&h["diacritic-sensitive"],1,Et);if(!w)return null;var C=null;return h.locale&&!(C=n.parse(h.locale,1,St))?null:new po(_,w,C)},po.prototype.evaluate=function(t){return new ni(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},po.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},po.prototype.outputDefined=function(){return!1},po.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var fo=function(t,n){this.type=Et,this.geojson=t,this.geometries=n};function aa(t){if(t instanceof Hi&&(t.name==="get"&&t.args.length===1||t.name==="feature-state"||t.name==="has"&&t.args.length===1||t.name==="properties"||t.name==="geometry-type"||t.name==="id"||/^filter-/.test(t.name))||t instanceof fo)return!1;var n=!0;return t.eachChild(function(h){n&&!aa(h)&&(n=!1)}),n}function sa(t){if(t instanceof Hi&&t.name==="feature-state")return!1;var n=!0;return t.eachChild(function(h){n&&!sa(h)&&(n=!1)}),n}function qa(t,n){if(t instanceof Hi&&n.indexOf(t.name)>=0)return!1;var h=!0;return t.eachChild(function(_){h&&!qa(_,n)&&(h=!1)}),h}fo.parse=function(t,n){if(t.length!==2)return n.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(gi(t[1])){var h=t[1];if(h.type==="FeatureCollection")for(var _=0;_<h.features.length;++_){var w=h.features[_].geometry.type;if(w==="Polygon"||w==="MultiPolygon")return new fo(h,h.features[_].geometry)}else if(h.type==="Feature"){var C=h.geometry.type;if(C==="Polygon"||C==="MultiPolygon")return new fo(h,h.geometry)}else if(h.type==="Polygon"||h.type==="MultiPolygon")return new fo(h,h)}return n.error("'within' expression requires valid geojson object that contains polygon geometry type.")},fo.prototype.evaluate=function(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(n,h){var _=[1/0,1/0,-1/0,-1/0],w=[1/0,1/0,-1/0,-1/0],C=n.canonicalID();if(h.type==="Polygon"){var r=ba(h.coordinates,w,C),e=Cc(n.geometry(),_,w,C);if(!oa(_,w))return!1;for(var s=0,f=e;s<f.length;s+=1)if(!_s(f[s],r))return!1}if(h.type==="MultiPolygon"){var y=ul(h.coordinates,w,C),b=Cc(n.geometry(),_,w,C);if(!oa(_,w))return!1;for(var E=0,M=b;E<M.length;E+=1)if(!mn(M[E],y))return!1}return!0}(t,this.geometries);if(t.geometryType()==="LineString")return function(n,h){var _=[1/0,1/0,-1/0,-1/0],w=[1/0,1/0,-1/0,-1/0],C=n.canonicalID();if(h.type==="Polygon"){var r=ba(h.coordinates,w,C),e=Bs(n.geometry(),_,w,C);if(!oa(_,w))return!1;for(var s=0,f=e;s<f.length;s+=1)if(!Bu(f[s],r))return!1}if(h.type==="MultiPolygon"){var y=ul(h.coordinates,w,C),b=Bs(n.geometry(),_,w,C);if(!oa(_,w))return!1;for(var E=0,M=b;E<M.length;E+=1)if(!Uu(M[E],y))return!1}return!0}(t,this.geometries)}return!1},fo.prototype.eachChild=function(){},fo.prototype.outputDefined=function(){return!0},fo.prototype.serialize=function(){return["within",this.geojson]};var Yr=function(t,n){this.type=n.type,this.name=t,this.boundExpression=n};Yr.parse=function(t,n){if(t.length!==2||typeof t[1]!="string")return n.error("'var' expression requires exactly one string literal argument.");var h=t[1];return n.scope.has(h)?new Yr(h,n.scope.get(h)):n.error('Unknown variable "'+h+'". Make sure "'+h+'" has been bound in an enclosing "let" expression before using it.',1)},Yr.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Yr.prototype.eachChild=function(){},Yr.prototype.outputDefined=function(){return!1},Yr.prototype.serialize=function(){return["var",this.name]};var Za=function(t,n,h,_,w){n===void 0&&(n=[]),_===void 0&&(_=new lt),w===void 0&&(w=[]),this.registry=t,this.path=n,this.key=n.map(function(C){return"["+C+"]"}).join(""),this.scope=_,this.errors=w,this.expectedType=h};function Xa(t,n){for(var h,_=t.length-1,w=0,C=_,r=0;w<=C;)if((h=t[r=Math.floor((w+C)/2)])<=n){if(r===_||n<t[r+1])return r;w=r+1}else{if(!(h>n))throw new un("Input is not a number.");C=r-1}return 0}Za.prototype.parse=function(t,n,h,_,w){return w===void 0&&(w={}),n?this.concat(n,h,_)._parse(t,w):this._parse(t,w)},Za.prototype._parse=function(t,n){function h(f,y,b){return b==="assert"?new Si(y,[f]):b==="coerce"?new Lo(y,[f]):f}if(t!==null&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"||(t=["literal",t]),Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var _=t[0];if(typeof _!="string")return this.error("Expression name must be a string, but found "+typeof _+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var w=this.registry[_];if(w){var C=w.parse(t,this);if(!C)return null;if(this.expectedType){var r=this.expectedType,e=C.type;if(r.kind!=="string"&&r.kind!=="number"&&r.kind!=="boolean"&&r.kind!=="object"&&r.kind!=="array"||e.kind!=="value")if(r.kind!=="color"&&r.kind!=="formatted"&&r.kind!=="resolvedImage"||e.kind!=="value"&&e.kind!=="string"){if(this.checkSubtype(r,e))return null}else C=h(C,r,n.typeAnnotation||"coerce");else C=h(C,r,n.typeAnnotation||"assert")}if(!(C instanceof Wn)&&C.type.kind!=="resolvedImage"&&function f(y){if(y instanceof Yr)return f(y.boundExpression);if(y instanceof Hi&&y.name==="error"||y instanceof po||y instanceof fo)return!1;var b=y instanceof Lo||y instanceof Si,E=!0;return y.eachChild(function(M){E=b?E&&f(M):E&&M instanceof Wn}),!!E&&aa(y)&&qa(y,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(C)){var s=new Bo;try{C=new Wn(C.type,C.evaluate(s))}catch(f){return this.error(f.message),null}}return C}return this.error('Unknown expression "'+_+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(t===void 0?"'undefined' value invalid. Use null instead.":typeof t=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},Za.prototype.concat=function(t,n,h){var _=typeof t=="number"?this.path.concat(t):this.path,w=h?this.scope.concat(h):this.scope;return new Za(this.registry,_,n||null,w,this.errors)},Za.prototype.error=function(t){for(var n=[],h=arguments.length-1;h-- >0;)n[h]=arguments[h+1];var _=""+this.key+n.map(function(w){return"["+w+"]"}).join("");this.errors.push(new rt(_,t))},Za.prototype.checkSubtype=function(t,n){var h=ur(t,n);return h&&this.error(h),h};var Dn=function(t,n,h){this.type=t,this.input=n,this.labels=[],this.outputs=[];for(var _=0,w=h;_<w.length;_+=1){var C=w[_],r=C[1];this.labels.push(C[0]),this.outputs.push(r)}};function Ji(t,n,h){return t*(1-h)+n*h}Dn.parse=function(t,n){if(t.length-1<4)return n.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return n.error("Expected an even number of arguments.");var h=n.parse(t[1],1,pt);if(!h)return null;var _=[],w=null;n.expectedType&&n.expectedType.kind!=="value"&&(w=n.expectedType);for(var C=1;C<t.length;C+=2){var r=C===1?-1/0:t[C],e=t[C+1],s=C,f=C+1;if(typeof r!="number")return n.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(_.length&&_[_.length-1][0]>=r)return n.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);var y=n.parse(e,f,w);if(!y)return null;w=w||y.type,_.push([r,y])}return new Dn(w,h,_)},Dn.prototype.evaluate=function(t){var n=this.labels,h=this.outputs;if(n.length===1)return h[0].evaluate(t);var _=this.input.evaluate(t);if(_<=n[0])return h[0].evaluate(t);var w=n.length;return _>=n[w-1]?h[w-1].evaluate(t):h[Xa(n,_)].evaluate(t)},Dn.prototype.eachChild=function(t){t(this.input);for(var n=0,h=this.outputs;n<h.length;n+=1)t(h[n])},Dn.prototype.outputDefined=function(){return this.outputs.every(function(t){return t.outputDefined()})},Dn.prototype.serialize=function(){for(var t=["step",this.input.serialize()],n=0;n<this.labels.length;n++)n>0&&t.push(this.labels[n]),t.push(this.outputs[n].serialize());return t};var On=Object.freeze({__proto__:null,number:Ji,color:function(t,n,h){return new Sr(Ji(t.r,n.r,h),Ji(t.g,n.g,h),Ji(t.b,n.b,h),Ji(t.a,n.a,h))},array:function(t,n,h){return t.map(function(_,w){return Ji(_,n[w],h)})}}),Yl=6/29*3*(6/29),Hl=Math.PI/180,Jl=180/Math.PI;function hl(t){return t>.008856451679035631?Math.pow(t,1/3):t/Yl+4/29}function pl(t){return t>6/29?t*t*t:Yl*(t-4/29)}function Us(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function fl(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ql(t){var n=fl(t.r),h=fl(t.g),_=fl(t.b),w=hl((.4124564*n+.3575761*h+.1804375*_)/.95047),C=hl((.2126729*n+.7151522*h+.072175*_)/1);return{l:116*C-16,a:500*(w-C),b:200*(C-hl((.0193339*n+.119192*h+.9503041*_)/1.08883)),alpha:t.a}}function dl(t){var n=(t.l+16)/116,h=isNaN(t.a)?n:n+t.a/500,_=isNaN(t.b)?n:n-t.b/200;return n=1*pl(n),h=.95047*pl(h),_=1.08883*pl(_),new Sr(Us(3.2404542*h-1.5371385*n-.4985314*_),Us(-.969266*h+1.8760108*n+.041556*_),Us(.0556434*h-.2040259*n+1.0572252*_),t.alpha)}function Ac(t,n,h){var _=n-t;return t+h*(_>180||_<-180?_-360*Math.round(_/360):_)}var Ns={forward:Ql,reverse:dl,interpolate:function(t,n,h){return{l:Ji(t.l,n.l,h),a:Ji(t.a,n.a,h),b:Ji(t.b,n.b,h),alpha:Ji(t.alpha,n.alpha,h)}}},la={forward:function(t){var n=Ql(t),h=n.l,_=n.a,w=n.b,C=Math.atan2(w,_)*Jl;return{h:C<0?C+360:C,c:Math.sqrt(_*_+w*w),l:h,alpha:t.a}},reverse:function(t){var n=t.h*Hl,h=t.c;return dl({l:t.l,a:Math.cos(n)*h,b:Math.sin(n)*h,alpha:t.alpha})},interpolate:function(t,n,h){return{h:Ac(t.h,n.h,h),c:Ji(t.c,n.c,h),l:Ji(t.l,n.l,h),alpha:Ji(t.alpha,n.alpha,h)}}},Pc=Object.freeze({__proto__:null,lab:Ns,hcl:la}),Fn=function(t,n,h,_,w){this.type=t,this.operator=n,this.interpolation=h,this.input=_,this.labels=[],this.outputs=[];for(var C=0,r=w;C<r.length;C+=1){var e=r[C],s=e[1];this.labels.push(e[0]),this.outputs.push(s)}};function Nu(t,n,h,_){var w=_-h,C=t-h;return w===0?0:n===1?C/w:(Math.pow(n,C)-1)/(Math.pow(n,w)-1)}Fn.interpolationFactor=function(t,n,h,_){var w=0;if(t.name==="exponential")w=Nu(n,t.base,h,_);else if(t.name==="linear")w=Nu(n,1,h,_);else if(t.name==="cubic-bezier"){var C=t.controlPoints;w=new P(C[0],C[1],C[2],C[3]).solve(Nu(n,1,h,_))}return w},Fn.parse=function(t,n){var h=t[0],_=t[1],w=t[2],C=t.slice(3);if(!Array.isArray(_)||_.length===0)return n.error("Expected an interpolation type expression.",1);if(_[0]==="linear")_={name:"linear"};else if(_[0]==="exponential"){var r=_[1];if(typeof r!="number")return n.error("Exponential interpolation requires a numeric base.",1,1);_={name:"exponential",base:r}}else{if(_[0]!=="cubic-bezier")return n.error("Unknown interpolation type "+String(_[0]),1,0);var e=_.slice(1);if(e.length!==4||e.some(function(G){return typeof G!="number"||G<0||G>1}))return n.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);_={name:"cubic-bezier",controlPoints:e}}if(t.length-1<4)return n.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return n.error("Expected an even number of arguments.");if(!(w=n.parse(w,2,pt)))return null;var s=[],f=null;h==="interpolate-hcl"||h==="interpolate-lab"?f=Ct:n.expectedType&&n.expectedType.kind!=="value"&&(f=n.expectedType);for(var y=0;y<C.length;y+=2){var b=C[y],E=C[y+1],M=y+3,z=y+4;if(typeof b!="number")return n.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',M);if(s.length&&s[s.length-1][0]>=b)return n.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',M);var O=n.parse(E,z,f);if(!O)return null;f=f||O.type,s.push([b,O])}return f.kind==="number"||f.kind==="color"||f.kind==="array"&&f.itemType.kind==="number"&&typeof f.N=="number"?new Fn(f,h,_,w,s):n.error("Type "+Ue(f)+" is not interpolatable.")},Fn.prototype.evaluate=function(t){var n=this.labels,h=this.outputs;if(n.length===1)return h[0].evaluate(t);var _=this.input.evaluate(t);if(_<=n[0])return h[0].evaluate(t);var w=n.length;if(_>=n[w-1])return h[w-1].evaluate(t);var C=Xa(n,_),r=Fn.interpolationFactor(this.interpolation,_,n[C],n[C+1]),e=h[C].evaluate(t),s=h[C+1].evaluate(t);return this.operator==="interpolate"?On[this.type.kind.toLowerCase()](e,s,r):this.operator==="interpolate-hcl"?la.reverse(la.interpolate(la.forward(e),la.forward(s),r)):Ns.reverse(Ns.interpolate(Ns.forward(e),Ns.forward(s),r))},Fn.prototype.eachChild=function(t){t(this.input);for(var n=0,h=this.outputs;n<h.length;n+=1)t(h[n])},Fn.prototype.outputDefined=function(){return this.outputs.every(function(t){return t.outputDefined()})},Fn.prototype.serialize=function(){var t;t=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var n=[this.operator,t,this.input.serialize()],h=0;h<this.labels.length;h++)n.push(this.labels[h],this.outputs[h].serialize());return n};var Wa=function(t,n){this.type=t,this.args=n};Wa.parse=function(t,n){if(t.length<2)return n.error("Expectected at least one argument.");var h=null,_=n.expectedType;_&&_.kind!=="value"&&(h=_);for(var w=[],C=0,r=t.slice(1);C<r.length;C+=1){var e=n.parse(r[C],1+w.length,h,void 0,{typeAnnotation:"omit"});if(!e)return null;h=h||e.type,w.push(e)}var s=_&&w.some(function(f){return ur(_,f.type)});return new Wa(s?$t:h,w)},Wa.prototype.evaluate=function(t){for(var n,h=null,_=0,w=0,C=this.args;w<C.length&&(_++,(h=C[w].evaluate(t))&&h instanceof Nn&&!h.available&&(n||(n=h.name),h=null,_===this.args.length&&(h=n)),h===null);w+=1);return h},Wa.prototype.eachChild=function(t){this.args.forEach(t)},Wa.prototype.outputDefined=function(){return this.args.every(function(t){return t.outputDefined()})},Wa.prototype.serialize=function(){var t=["coalesce"];return this.eachChild(function(n){t.push(n.serialize())}),t};var $a=function(t,n){this.type=n.type,this.bindings=[].concat(t),this.result=n};$a.prototype.evaluate=function(t){return this.result.evaluate(t)},$a.prototype.eachChild=function(t){for(var n=0,h=this.bindings;n<h.length;n+=1)t(h[n][1]);t(this.result)},$a.parse=function(t,n){if(t.length<4)return n.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var h=[],_=1;_<t.length-1;_+=2){var w=t[_];if(typeof w!="string")return n.error("Expected string, but found "+typeof w+" instead.",_);if(/[^a-zA-Z0-9_]/.test(w))return n.error("Variable names must contain only alphanumeric characters or '_'.",_);var C=n.parse(t[_+1],_+1);if(!C)return null;h.push([w,C])}var r=n.parse(t[t.length-1],t.length-1,n.expectedType,h);return r?new $a(h,r):null},$a.prototype.outputDefined=function(){return this.result.outputDefined()},$a.prototype.serialize=function(){for(var t=["let"],n=0,h=this.bindings;n<h.length;n+=1){var _=h[n];t.push(_[0],_[1].serialize())}return t.push(this.result.serialize()),t};var vs=function(t,n,h){this.type=t,this.index=n,this.input=h};vs.parse=function(t,n){if(t.length!==3)return n.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var h=n.parse(t[1],1,pt),_=n.parse(t[2],2,ze(n.expectedType||$t));return h&&_?new vs(_.type.itemType,h,_):null},vs.prototype.evaluate=function(t){var n=this.index.evaluate(t),h=this.input.evaluate(t);if(n<0)throw new un("Array index out of bounds: "+n+" < 0.");if(n>=h.length)throw new un("Array index out of bounds: "+n+" > "+(h.length-1)+".");if(n!==Math.floor(n))throw new un("Array index must be an integer, but found "+n+" instead.");return h[n]},vs.prototype.eachChild=function(t){t(this.index),t(this.input)},vs.prototype.outputDefined=function(){return!1},vs.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var wa=function(t,n){this.type=Et,this.needle=t,this.haystack=n};wa.parse=function(t,n){if(t.length!==3)return n.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var h=n.parse(t[1],1,$t),_=n.parse(t[2],2,$t);return h&&_?mr(h.type,[Et,St,pt,gt,$t])?new wa(h,_):n.error("Expected first argument to be of type boolean, string, number or null, but found "+Ue(h.type)+" instead"):null},wa.prototype.evaluate=function(t){var n=this.needle.evaluate(t),h=this.haystack.evaluate(t);if(!h)return!1;if(!nr(n,["boolean","string","number","null"]))throw new un("Expected first argument to be of type boolean, string, number or null, but found "+Ue(Yi(n))+" instead.");if(!nr(h,["string","array"]))throw new un("Expected second argument to be of type array or string, but found "+Ue(Yi(h))+" instead.");return h.indexOf(n)>=0},wa.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},wa.prototype.outputDefined=function(){return!0},wa.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var ua=function(t,n,h){this.type=pt,this.needle=t,this.haystack=n,this.fromIndex=h};ua.parse=function(t,n){if(t.length<=2||t.length>=5)return n.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var h=n.parse(t[1],1,$t),_=n.parse(t[2],2,$t);if(!h||!_)return null;if(!mr(h.type,[Et,St,pt,gt,$t]))return n.error("Expected first argument to be of type boolean, string, number or null, but found "+Ue(h.type)+" instead");if(t.length===4){var w=n.parse(t[3],3,pt);return w?new ua(h,_,w):null}return new ua(h,_)},ua.prototype.evaluate=function(t){var n=this.needle.evaluate(t),h=this.haystack.evaluate(t);if(!nr(n,["boolean","string","number","null"]))throw new un("Expected first argument to be of type boolean, string, number or null, but found "+Ue(Yi(n))+" instead.");if(!nr(h,["string","array"]))throw new un("Expected second argument to be of type array or string, but found "+Ue(Yi(h))+" instead.");if(this.fromIndex){var _=this.fromIndex.evaluate(t);return h.indexOf(n,_)}return h.indexOf(n)},ua.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},ua.prototype.outputDefined=function(){return!1},ua.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var Uo=function(t,n,h,_,w,C){this.inputType=t,this.type=n,this.input=h,this.cases=_,this.outputs=w,this.otherwise=C};Uo.parse=function(t,n){if(t.length<5)return n.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return n.error("Expected an even number of arguments.");var h,_;n.expectedType&&n.expectedType.kind!=="value"&&(_=n.expectedType);for(var w={},C=[],r=2;r<t.length-1;r+=2){var e=t[r],s=t[r+1];Array.isArray(e)||(e=[e]);var f=n.concat(r);if(e.length===0)return f.error("Expected at least one branch label.");for(var y=0,b=e;y<b.length;y+=1){var E=b[y];if(typeof E!="number"&&typeof E!="string")return f.error("Branch labels must be numbers or strings.");if(typeof E=="number"&&Math.abs(E)>Number.MAX_SAFE_INTEGER)return f.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof E=="number"&&Math.floor(E)!==E)return f.error("Numeric branch labels must be integer values.");if(h){if(f.checkSubtype(h,Yi(E)))return null}else h=Yi(E);if(w[String(E)]!==void 0)return f.error("Branch labels must be unique.");w[String(E)]=C.length}var M=n.parse(s,r,_);if(!M)return null;_=_||M.type,C.push(M)}var z=n.parse(t[1],1,$t);if(!z)return null;var O=n.parse(t[t.length-1],t.length-1,_);return O?z.type.kind!=="value"&&n.concat(1).checkSubtype(h,z.type)?null:new Uo(h,_,z,w,C,O):null},Uo.prototype.evaluate=function(t){var n=this.input.evaluate(t);return(Yi(n)===this.inputType&&this.outputs[this.cases[n]]||this.otherwise).evaluate(t)},Uo.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},Uo.prototype.outputDefined=function(){return this.outputs.every(function(t){return t.outputDefined()})&&this.otherwise.outputDefined()},Uo.prototype.serialize=function(){for(var t=this,n=["match",this.input.serialize()],h=[],_={},w=0,C=Object.keys(this.cases).sort();w<C.length;w+=1){var r=C[w];(b=_[this.cases[r]])===void 0?(_[this.cases[r]]=h.length,h.push([this.cases[r],[r]])):h[b][1].push(r)}for(var e=function(M){return t.inputType.kind==="number"?Number(M):M},s=0,f=h;s<f.length;s+=1){var y=f[s],b=y[0],E=y[1];n.push(E.length===1?e(E[0]):E.map(e)),n.push(this.outputs[outputIndex$1].serialize())}return n.push(this.otherwise.serialize()),n};var Ka=function(t,n,h){this.type=t,this.branches=n,this.otherwise=h};Ka.parse=function(t,n){if(t.length<4)return n.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return n.error("Expected an odd number of arguments.");var h;n.expectedType&&n.expectedType.kind!=="value"&&(h=n.expectedType);for(var _=[],w=1;w<t.length-1;w+=2){var C=n.parse(t[w],w,Et);if(!C)return null;var r=n.parse(t[w+1],w+1,h);if(!r)return null;_.push([C,r]),h=h||r.type}var e=n.parse(t[t.length-1],t.length-1,h);return e?new Ka(h,_,e):null},Ka.prototype.evaluate=function(t){for(var n=0,h=this.branches;n<h.length;n+=1){var _=h[n],w=_[1];if(_[0].evaluate(t))return w.evaluate(t)}return this.otherwise.evaluate(t)},Ka.prototype.eachChild=function(t){for(var n=0,h=this.branches;n<h.length;n+=1){var _=h[n],w=_[1];t(_[0]),t(w)}t(this.otherwise)},Ka.prototype.outputDefined=function(){return this.branches.every(function(t){return t[1].outputDefined()})&&this.otherwise.outputDefined()},Ka.prototype.serialize=function(){var t=["case"];return this.eachChild(function(n){t.push(n.serialize())}),t};var Ea=function(t,n,h,_){this.type=t,this.input=n,this.beginIndex=h,this.endIndex=_};function tu(t,n){return t==="=="||t==="!="?n.kind==="boolean"||n.kind==="string"||n.kind==="number"||n.kind==="null"||n.kind==="value":n.kind==="string"||n.kind==="number"||n.kind==="value"}function Ya(t,n,h,_){return _.compare(n,h)===0}function yi(t,n,h){var _=t!=="=="&&t!=="!=";return function(){function w(C,r,e){this.type=Et,this.lhs=C,this.rhs=r,this.collator=e,this.hasUntypedArgument=C.type.kind==="value"||r.type.kind==="value"}return w.parse=function(C,r){if(C.length!==3&&C.length!==4)return r.error("Expected two or three arguments.");var e=C[0],s=r.parse(C[1],1,$t);if(!s)return null;if(!tu(e,s.type))return r.concat(1).error('"'+e+`" comparisons are not supported for type '`+Ue(s.type)+"'.");var f=r.parse(C[2],2,$t);if(!f)return null;if(!tu(e,f.type))return r.concat(2).error('"'+e+`" comparisons are not supported for type '`+Ue(f.type)+"'.");if(s.type.kind!==f.type.kind&&s.type.kind!=="value"&&f.type.kind!=="value")return r.error("Cannot compare types '"+Ue(s.type)+"' and '"+Ue(f.type)+"'.");_&&(s.type.kind==="value"&&f.type.kind!=="value"?s=new Si(f.type,[s]):s.type.kind!=="value"&&f.type.kind==="value"&&(f=new Si(s.type,[f])));var y=null;if(C.length===4){if(s.type.kind!=="string"&&f.type.kind!=="string"&&s.type.kind!=="value"&&f.type.kind!=="value")return r.error("Cannot use collator to compare non-string types.");if(!(y=r.parse(C[3],3,ee)))return null}return new w(s,f,y)},w.prototype.evaluate=function(C){var r=this.lhs.evaluate(C),e=this.rhs.evaluate(C);if(_&&this.hasUntypedArgument){var s=Yi(r),f=Yi(e);if(s.kind!==f.kind||s.kind!=="string"&&s.kind!=="number")throw new un('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+f.kind+") instead.")}if(this.collator&&!_&&this.hasUntypedArgument){var y=Yi(r),b=Yi(e);if(y.kind!=="string"||b.kind!=="string")return n(C,r,e)}return this.collator?h(C,r,e,this.collator.evaluate(C)):n(C,r,e)},w.prototype.eachChild=function(C){C(this.lhs),C(this.rhs),this.collator&&C(this.collator)},w.prototype.outputDefined=function(){return!0},w.prototype.serialize=function(){var C=[t];return this.eachChild(function(r){C.push(r.serialize())}),C},w}()}Ea.parse=function(t,n){if(t.length<=2||t.length>=5)return n.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var h=n.parse(t[1],1,$t),_=n.parse(t[2],2,pt);if(!h||!_)return null;if(!mr(h.type,[ze($t),St,$t]))return n.error("Expected first argument to be of type array or string, but found "+Ue(h.type)+" instead");if(t.length===4){var w=n.parse(t[3],3,pt);return w?new Ea(h.type,h,_,w):null}return new Ea(h.type,h,_)},Ea.prototype.evaluate=function(t){var n=this.input.evaluate(t),h=this.beginIndex.evaluate(t);if(!nr(n,["string","array"]))throw new un("Expected first argument to be of type array or string, but found "+Ue(Yi(n))+" instead.");if(this.endIndex){var _=this.endIndex.evaluate(t);return n.slice(h,_)}return n.slice(h)},Ea.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},Ea.prototype.outputDefined=function(){return!1},Ea.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var xs=yi("==",function(t,n,h){return n===h},Ya),Sa=yi("!=",function(t,n,h){return n!==h},function(t,n,h,_){return!Ya(0,n,h,_)}),Vu=yi("<",function(t,n,h){return n<h},function(t,n,h,_){return _.compare(n,h)<0}),eu=yi(">",function(t,n,h){return n>h},function(t,n,h,_){return _.compare(n,h)>0}),Ur=yi("<=",function(t,n,h){return n<=h},function(t,n,h,_){return _.compare(n,h)<=0}),ml=yi(">=",function(t,n,h){return n>=h},function(t,n,h,_){return _.compare(n,h)>=0}),ei=function(t,n,h,_,w){this.type=St,this.number=t,this.locale=n,this.currency=h,this.minFractionDigits=_,this.maxFractionDigits=w};ei.parse=function(t,n){if(t.length!==3)return n.error("Expected two arguments.");var h=n.parse(t[1],1,pt);if(!h)return null;var _=t[2];if(typeof _!="object"||Array.isArray(_))return n.error("NumberFormat options argument must be an object.");var w=null;if(_.locale&&!(w=n.parse(_.locale,1,St)))return null;var C=null;if(_.currency&&!(C=n.parse(_.currency,1,St)))return null;var r=null;if(_["min-fraction-digits"]&&!(r=n.parse(_["min-fraction-digits"],1,pt)))return null;var e=null;return _["max-fraction-digits"]&&!(e=n.parse(_["max-fraction-digits"],1,pt))?null:new ei(h,w,C,r,e)},ei.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},ei.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},ei.prototype.outputDefined=function(){return!1},ei.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Wo=function(t){this.type=pt,this.input=t};Wo.parse=function(t,n){if(t.length!==2)return n.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var h=n.parse(t[1],1);return h?h.type.kind!=="array"&&h.type.kind!=="string"&&h.type.kind!=="value"?n.error("Expected argument of type string or array, but found "+Ue(h.type)+" instead."):new Wo(h):null},Wo.prototype.evaluate=function(t){var n=this.input.evaluate(t);if(typeof n=="string"||Array.isArray(n))return n.length;throw new un("Expected value to be of type string or array, but found "+Ue(Yi(n))+" instead.")},Wo.prototype.eachChild=function(t){t(this.input)},Wo.prototype.outputDefined=function(){return!1},Wo.prototype.serialize=function(){var t=["length"];return this.eachChild(function(n){t.push(n.serialize())}),t};var xi={"==":xs,"!=":Sa,">":eu,"<":Vu,">=":ml,"<=":Ur,array:Si,at:vs,boolean:Si,case:Ka,coalesce:Wa,collator:po,format:Mo,image:oo,in:wa,"index-of":ua,interpolate:Fn,"interpolate-hcl":Fn,"interpolate-lab":Fn,length:Wo,let:$a,literal:Wn,match:Uo,number:Si,"number-format":ei,object:Si,slice:Ea,step:Dn,string:Si,"to-boolean":Lo,"to-color":Lo,"to-number":Lo,"to-string":Lo,var:Yr,within:fo};function Qi(t,n){var h=n[0],_=n[1],w=n[2],C=n[3];h=h.evaluate(t),_=_.evaluate(t),w=w.evaluate(t);var r=C?C.evaluate(t):1,e=sl(h,_,w,r);if(e)throw new un(e);return new Sr(h/255*r,_/255*r,w/255*r,r)}function gl(t,n){return t in n}function yl(t,n){var h=n[t];return h===void 0?null:h}function bs(t){return{type:t}}function ru(t){return{result:"success",value:t}}function ca(t){return{result:"error",value:t}}function ha(t){return t["property-type"]==="data-driven"||t["property-type"]==="cross-faded-data-driven"}function _l(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Ha(t){return!!t.expression&&t.expression.interpolated}function bi(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":t===null?"null":typeof t}function Ta(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function iu(t){return t}function $n(t,n,h){return t!==void 0?t:n!==void 0?n:h!==void 0?h:void 0}function Gu(t,n,h,_,w){return $n(typeof h===w?_[h]:void 0,t.default,n.default)}function Mc(t,n,h){if(bi(h)!=="number")return $n(t.default,n.default);var _=t.stops.length;if(_===1||h<=t.stops[0][0])return t.stops[0][1];if(h>=t.stops[_-1][0])return t.stops[_-1][1];var w=Xa(t.stops.map(function(C){return C[0]}),h);return t.stops[w][1]}function ju(t,n,h){var _=t.base!==void 0?t.base:1;if(bi(h)!=="number")return $n(t.default,n.default);var w=t.stops.length;if(w===1||h<=t.stops[0][0])return t.stops[0][1];if(h>=t.stops[w-1][0])return t.stops[w-1][1];var C=Xa(t.stops.map(function(b){return b[0]}),h),r=function(b,E,M,z){var O=z-M,G=b-M;return O===0?0:E===1?G/O:(Math.pow(E,G)-1)/(Math.pow(E,O)-1)}(h,_,t.stops[C][0],t.stops[C+1][0]),e=t.stops[C][1],s=t.stops[C+1][1],f=On[n.type]||iu;if(t.colorSpace&&t.colorSpace!=="rgb"){var y=Pc[t.colorSpace];f=function(b,E){return y.reverse(y.interpolate(y.forward(b),y.forward(E),r))}}return typeof e.evaluate=="function"?{evaluate:function(){for(var b=[],E=arguments.length;E--;)b[E]=arguments[E];var M=e.evaluate.apply(void 0,b),z=s.evaluate.apply(void 0,b);if(M!==void 0&&z!==void 0)return f(M,z,r)}}:f(e,s,r)}function Ia(t,n,h){return n.type==="color"?h=Sr.parse(h):n.type==="formatted"?h=si.fromString(h.toString()):n.type==="resolvedImage"?h=Nn.fromString(h.toString()):bi(h)===n.type||n.type==="enum"&&n.values[h]||(h=void 0),$n(h,t.default,n.default)}Hi.register(xi,{error:[{kind:"error"},[St],function(t,n){throw new un(n[0].evaluate(t))}],typeof:[St,[$t],function(t,n){return Ue(Yi(n[0].evaluate(t)))}],"to-rgba":[ze(pt,4),[Ct],function(t,n){return n[0].evaluate(t).toArray()}],rgb:[Ct,[pt,pt,pt],Qi],rgba:[Ct,[pt,pt,pt,pt],Qi],has:{type:Et,overloads:[[[St],function(t,n){return gl(n[0].evaluate(t),t.properties())}],[[St,te],function(t,n){var h=n[1];return gl(n[0].evaluate(t),h.evaluate(t))}]]},get:{type:$t,overloads:[[[St],function(t,n){return yl(n[0].evaluate(t),t.properties())}],[[St,te],function(t,n){var h=n[1];return yl(n[0].evaluate(t),h.evaluate(t))}]]},"feature-state":[$t,[St],function(t,n){return yl(n[0].evaluate(t),t.featureState||{})}],properties:[te,[],function(t){return t.properties()}],"geometry-type":[St,[],function(t){return t.geometryType()}],id:[$t,[],function(t){return t.id()}],zoom:[pt,[],function(t){return t.globals.zoom}],"heatmap-density":[pt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[pt,[],function(t){return t.globals.lineProgress||0}],accumulated:[$t,[],function(t){return t.globals.accumulated===void 0?null:t.globals.accumulated}],"+":[pt,bs(pt),function(t,n){for(var h=0,_=0,w=n;_<w.length;_+=1)h+=w[_].evaluate(t);return h}],"*":[pt,bs(pt),function(t,n){for(var h=1,_=0,w=n;_<w.length;_+=1)h*=w[_].evaluate(t);return h}],"-":{type:pt,overloads:[[[pt,pt],function(t,n){var h=n[1];return n[0].evaluate(t)-h.evaluate(t)}],[[pt],function(t,n){return-n[0].evaluate(t)}]]},"/":[pt,[pt,pt],function(t,n){var h=n[1];return n[0].evaluate(t)/h.evaluate(t)}],"%":[pt,[pt,pt],function(t,n){var h=n[1];return n[0].evaluate(t)%h.evaluate(t)}],ln2:[pt,[],function(){return Math.LN2}],pi:[pt,[],function(){return Math.PI}],e:[pt,[],function(){return Math.E}],"^":[pt,[pt,pt],function(t,n){var h=n[1];return Math.pow(n[0].evaluate(t),h.evaluate(t))}],sqrt:[pt,[pt],function(t,n){return Math.sqrt(n[0].evaluate(t))}],log10:[pt,[pt],function(t,n){return Math.log(n[0].evaluate(t))/Math.LN10}],ln:[pt,[pt],function(t,n){return Math.log(n[0].evaluate(t))}],log2:[pt,[pt],function(t,n){return Math.log(n[0].evaluate(t))/Math.LN2}],sin:[pt,[pt],function(t,n){return Math.sin(n[0].evaluate(t))}],cos:[pt,[pt],function(t,n){return Math.cos(n[0].evaluate(t))}],tan:[pt,[pt],function(t,n){return Math.tan(n[0].evaluate(t))}],asin:[pt,[pt],function(t,n){return Math.asin(n[0].evaluate(t))}],acos:[pt,[pt],function(t,n){return Math.acos(n[0].evaluate(t))}],atan:[pt,[pt],function(t,n){return Math.atan(n[0].evaluate(t))}],min:[pt,bs(pt),function(t,n){return Math.min.apply(Math,n.map(function(h){return h.evaluate(t)}))}],max:[pt,bs(pt),function(t,n){return Math.max.apply(Math,n.map(function(h){return h.evaluate(t)}))}],abs:[pt,[pt],function(t,n){return Math.abs(n[0].evaluate(t))}],round:[pt,[pt],function(t,n){var h=n[0].evaluate(t);return h<0?-Math.round(-h):Math.round(h)}],floor:[pt,[pt],function(t,n){return Math.floor(n[0].evaluate(t))}],ceil:[pt,[pt],function(t,n){return Math.ceil(n[0].evaluate(t))}],"filter-==":[Et,[St,$t],function(t,n){var h=n[0],_=n[1];return t.properties()[h.value]===_.value}],"filter-id-==":[Et,[$t],function(t,n){var h=n[0];return t.id()===h.value}],"filter-type-==":[Et,[St],function(t,n){var h=n[0];return t.geometryType()===h.value}],"filter-<":[Et,[St,$t],function(t,n){var h=n[0],_=n[1],w=t.properties()[h.value],C=_.value;return typeof w==typeof C&&w<C}],"filter-id-<":[Et,[$t],function(t,n){var h=n[0],_=t.id(),w=h.value;return typeof _==typeof w&&_<w}],"filter->":[Et,[St,$t],function(t,n){var h=n[0],_=n[1],w=t.properties()[h.value],C=_.value;return typeof w==typeof C&&w>C}],"filter-id->":[Et,[$t],function(t,n){var h=n[0],_=t.id(),w=h.value;return typeof _==typeof w&&_>w}],"filter-<=":[Et,[St,$t],function(t,n){var h=n[0],_=n[1],w=t.properties()[h.value],C=_.value;return typeof w==typeof C&&w<=C}],"filter-id-<=":[Et,[$t],function(t,n){var h=n[0],_=t.id(),w=h.value;return typeof _==typeof w&&_<=w}],"filter->=":[Et,[St,$t],function(t,n){var h=n[0],_=n[1],w=t.properties()[h.value],C=_.value;return typeof w==typeof C&&w>=C}],"filter-id->=":[Et,[$t],function(t,n){var h=n[0],_=t.id(),w=h.value;return typeof _==typeof w&&_>=w}],"filter-has":[Et,[$t],function(t,n){return n[0].value in t.properties()}],"filter-has-id":[Et,[],function(t){return t.id()!==null&&t.id()!==void 0}],"filter-type-in":[Et,[ze(St)],function(t,n){return n[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Et,[ze($t)],function(t,n){return n[0].value.indexOf(t.id())>=0}],"filter-in-small":[Et,[St,ze($t)],function(t,n){var h=n[0];return n[1].value.indexOf(t.properties()[h.value])>=0}],"filter-in-large":[Et,[St,ze($t)],function(t,n){var h=n[0],_=n[1];return function(w,C,r,e){for(;r<=e;){var s=r+e>>1;if(C[s]===w)return!0;C[s]>w?e=s-1:r=s+1}return!1}(t.properties()[h.value],_.value,0,_.value.length-1)}],all:{type:Et,overloads:[[[Et,Et],function(t,n){var h=n[1];return n[0].evaluate(t)&&h.evaluate(t)}],[bs(Et),function(t,n){for(var h=0,_=n;h<_.length;h+=1)if(!_[h].evaluate(t))return!1;return!0}]]},any:{type:Et,overloads:[[[Et,Et],function(t,n){var h=n[1];return n[0].evaluate(t)||h.evaluate(t)}],[bs(Et),function(t,n){for(var h=0,_=n;h<_.length;h+=1)if(_[h].evaluate(t))return!0;return!1}]]},"!":[Et,[Et],function(t,n){return!n[0].evaluate(t)}],"is-supported-script":[Et,[St],function(t,n){var h=t.globals&&t.globals.isSupportedScript;return!h||h(n[0].evaluate(t))}],upcase:[St,[St],function(t,n){return n[0].evaluate(t).toUpperCase()}],downcase:[St,[St],function(t,n){return n[0].evaluate(t).toLowerCase()}],concat:[St,bs($t),function(t,n){return n.map(function(h){return gs(h.evaluate(t))}).join("")}],"resolved-locale":[St,[ee],function(t,n){return n[0].evaluate(t).resolvedLocale()}]});var Ca=function(t,n){this.expression=t,this._warningHistory={},this._evaluator=new Bo,this._defaultValue=n?function(h){return h.type==="color"&&Ta(h.default)?new Sr(0,0,0,0):h.type==="color"?Sr.parse(h.default)||null:h.default===void 0?null:h.default}(n):null,this._enumValues=n&&n.type==="enum"?n.values:null};function ws(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="string"&&t[0]in xi}function vl(t,n){var h=new Za(xi,[],n?function(w){var C={color:Ct,string:St,number:pt,enum:St,boolean:Et,formatted:De,resolvedImage:Se};return w.type==="array"?ze(C[w.value]||$t,w.length):C[w.type]}(n):void 0),_=h.parse(t,void 0,void 0,void 0,n&&n.type==="string"?{typeAnnotation:"coerce"}:void 0);return _?ru(new Ca(_,n)):ca(h.errors)}Ca.prototype.evaluateWithoutErrorHandling=function(t,n,h,_,w,C){return this._evaluator.globals=t,this._evaluator.feature=n,this._evaluator.featureState=h,this._evaluator.canonical=_,this._evaluator.availableImages=w||null,this._evaluator.formattedSection=C,this.expression.evaluate(this._evaluator)},Ca.prototype.evaluate=function(t,n,h,_,w,C){this._evaluator.globals=t,this._evaluator.feature=n||null,this._evaluator.featureState=h||null,this._evaluator.canonical=_,this._evaluator.availableImages=w||null,this._evaluator.formattedSection=C||null;try{var r=this.expression.evaluate(this._evaluator);if(r==null||typeof r=="number"&&r!=r)return this._defaultValue;if(this._enumValues&&!(r in this._enumValues))throw new un("Expected value to be one of "+Object.keys(this._enumValues).map(function(e){return JSON.stringify(e)}).join(", ")+", but found "+JSON.stringify(r)+" instead.");return r}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,typeof console<"u"&&console.warn(e.message)),this._defaultValue}};var Ja=function(t,n){this.kind=t,this._styleExpression=n,this.isStateDependent=t!=="constant"&&!sa(n.expression)};Ja.prototype.evaluateWithoutErrorHandling=function(t,n,h,_,w,C){return this._styleExpression.evaluateWithoutErrorHandling(t,n,h,_,w,C)},Ja.prototype.evaluate=function(t,n,h,_,w,C){return this._styleExpression.evaluate(t,n,h,_,w,C)};var Aa=function(t,n,h,_){this.kind=t,this.zoomStops=h,this._styleExpression=n,this.isStateDependent=t!=="camera"&&!sa(n.expression),this.interpolationType=_};function qu(t,n){if((t=vl(t,n)).result==="error")return t;var h=t.value.expression,_=aa(h);if(!_&&!ha(n))return ca([new rt("","data expressions not supported")]);var w=qa(h,["zoom"]);if(!w&&!_l(n))return ca([new rt("","zoom expressions not supported")]);var C=function r(e){var s=null;if(e instanceof $a)s=r(e.result);else if(e instanceof Wa)for(var f=0,y=e.args;f<y.length&&!(s=r(y[f]));f+=1);else(e instanceof Dn||e instanceof Fn)&&e.input instanceof Hi&&e.input.name==="zoom"&&(s=e);return s instanceof rt||e.eachChild(function(b){var E=r(b);E instanceof rt?s=E:!s&&E?s=new rt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):s&&E&&s!==E&&(s=new rt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),s}(h);return C||w?C instanceof rt?ca([C]):C instanceof Fn&&!Ha(n)?ca([new rt("",'"interpolate" expressions cannot be used with this property')]):ru(C?new Aa(_?"camera":"composite",t.value,C.labels,C instanceof Fn?C.interpolation:void 0):new Ja(_?"constant":"source",t.value)):ca([new rt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Aa.prototype.evaluateWithoutErrorHandling=function(t,n,h,_,w,C){return this._styleExpression.evaluateWithoutErrorHandling(t,n,h,_,w,C)},Aa.prototype.evaluate=function(t,n,h,_,w,C){return this._styleExpression.evaluate(t,n,h,_,w,C)},Aa.prototype.interpolationFactor=function(t,n,h){return this.interpolationType?Fn.interpolationFactor(this.interpolationType,t,n,h):0};var pa=function(t,n){this._parameters=t,this._specification=n,nt(this,function h(_,w){var C,r,e,s=w.type==="color",f=_.stops&&typeof _.stops[0][0]=="object",y=f||!(f||_.property!==void 0),b=_.type||(Ha(w)?"exponential":"interval");if(s&&((_=nt({},_)).stops&&(_.stops=_.stops.map(function(qt){return[qt[0],Sr.parse(qt[1])]})),_.default=Sr.parse(_.default?_.default:w.default)),_.colorSpace&&_.colorSpace!=="rgb"&&!Pc[_.colorSpace])throw new Error("Unknown color space: "+_.colorSpace);if(b==="exponential")C=ju;else if(b==="interval")C=Mc;else if(b==="categorical"){C=Gu,r=Object.create(null);for(var E=0,M=_.stops;E<M.length;E+=1){var z=M[E];r[z[0]]=z[1]}e=typeof _.stops[0][0]}else{if(b!=="identity")throw new Error('Unknown function type "'+b+'"');C=Ia}if(f){for(var O={},G=[],V=0;V<_.stops.length;V++){var W=_.stops[V],Y=W[0].zoom;O[Y]===void 0&&(O[Y]={zoom:Y,type:_.type,property:_.property,default:_.default,stops:[]},G.push(Y)),O[Y].stops.push([W[0].value,W[1]])}for(var H=[],ot=0,ht=G;ot<ht.length;ot+=1){var Pt=ht[ot];H.push([O[Pt].zoom,h(O[Pt],w)])}var Ut={name:"linear"};return{kind:"composite",interpolationType:Ut,interpolationFactor:Fn.interpolationFactor.bind(void 0,Ut),zoomStops:H.map(function(qt){return qt[0]}),evaluate:function(qt,re){var Xt=qt.zoom;return ju({stops:H,base:_.base},w,Xt).evaluate(Xt,re)}}}if(y){var jt=b==="exponential"?{name:"exponential",base:_.base!==void 0?_.base:1}:null;return{kind:"camera",interpolationType:jt,interpolationFactor:Fn.interpolationFactor.bind(void 0,jt),zoomStops:_.stops.map(function(qt){return qt[0]}),evaluate:function(qt){return C(_,w,qt.zoom,r,e)}}}return{kind:"source",evaluate:function(qt,re){var Xt=re&&re.properties?re.properties[_.property]:void 0;return Xt===void 0?$n(_.default,w.default):C(_,w,Xt,r,e)}}}(this._parameters,this._specification))};function ko(t){var n=t.key,h=t.value,_=t.valueSpec||{},w=t.objectElementValidators||{},C=t.style,r=t.styleSpec,e=[],s=bi(h);if(s!=="object")return[new zt(n,h,"object expected, "+s+" found")];for(var f in h){var y=f.split(".")[0],b=_[y]||_["*"],E=void 0;if(w[y])E=w[y];else if(_[y])E=Gr;else if(w["*"])E=w["*"];else{if(!_["*"]){e.push(new zt(n,h[f],'unknown property "'+f+'"'));continue}E=Gr}e=e.concat(E({key:(n&&n+".")+f,value:h[f],valueSpec:b,style:C,styleSpec:r,object:h,objectKey:f},h))}for(var M in _)w[M]||_[M].required&&_[M].default===void 0&&h[M]===void 0&&e.push(new zt(n,h,'missing required property "'+M+'"'));return e}function xl(t){var n=t.value,h=t.valueSpec,_=t.style,w=t.styleSpec,C=t.key,r=t.arrayElementValidator||Gr;if(bi(n)!=="array")return[new zt(C,n,"array expected, "+bi(n)+" found")];if(h.length&&n.length!==h.length)return[new zt(C,n,"array length "+h.length+" expected, length "+n.length+" found")];if(h["min-length"]&&n.length<h["min-length"])return[new zt(C,n,"array length at least "+h["min-length"]+" expected, length "+n.length+" found")];var e={type:h.value,values:h.values};w.$version<7&&(e.function=h.function),bi(h.value)==="object"&&(e=h.value);for(var s=[],f=0;f<n.length;f++)s=s.concat(r({array:n,arrayIndex:f,value:n[f],valueSpec:e,style:_,styleSpec:w,key:C+"["+f+"]"}));return s}function bl(t){var n=t.key,h=t.value,_=t.valueSpec,w=bi(h);return w==="number"&&h!=h&&(w="NaN"),w!=="number"?[new zt(n,h,"number expected, "+w+" found")]:"minimum"in _&&h<_.minimum?[new zt(n,h,h+" is less than the minimum value "+_.minimum)]:"maximum"in _&&h>_.maximum?[new zt(n,h,h+" is greater than the maximum value "+_.maximum)]:[]}function Es(t){var n,h,_,w=t.valueSpec,C=X(t.value.type),r={},e=C!=="categorical"&&t.value.property===void 0,s=!e,f=bi(t.value.stops)==="array"&&bi(t.value.stops[0])==="array"&&bi(t.value.stops[0][0])==="object",y=ko({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(M){if(C==="identity")return[new zt(M.key,M.value,'identity function may not have a "stops" property')];var z=[],O=M.value;return z=z.concat(xl({key:M.key,value:O,valueSpec:M.valueSpec,style:M.style,styleSpec:M.styleSpec,arrayElementValidator:b})),bi(O)==="array"&&O.length===0&&z.push(new zt(M.key,O,"array must have at least one stop")),z},default:function(M){return Gr({key:M.key,value:M.value,valueSpec:w,style:M.style,styleSpec:M.styleSpec})}}});return C==="identity"&&e&&y.push(new zt(t.key,t.value,'missing required property "property"')),C==="identity"||t.value.stops||y.push(new zt(t.key,t.value,'missing required property "stops"')),C==="exponential"&&t.valueSpec.expression&&!Ha(t.valueSpec)&&y.push(new zt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(s&&!ha(t.valueSpec)?y.push(new zt(t.key,t.value,"property functions not supported")):e&&!_l(t.valueSpec)&&y.push(new zt(t.key,t.value,"zoom functions not supported"))),C!=="categorical"&&!f||t.value.property!==void 0||y.push(new zt(t.key,t.value,'"property" property is required')),y;function b(M){var z=[],O=M.value,G=M.key;if(bi(O)!=="array")return[new zt(G,O,"array expected, "+bi(O)+" found")];if(O.length!==2)return[new zt(G,O,"array length 2 expected, length "+O.length+" found")];if(f){if(bi(O[0])!=="object")return[new zt(G,O,"object expected, "+bi(O[0])+" found")];if(O[0].zoom===void 0)return[new zt(G,O,"object stop key must have zoom")];if(O[0].value===void 0)return[new zt(G,O,"object stop key must have value")];if(_&&_>X(O[0].zoom))return[new zt(G,O[0].zoom,"stop zoom values must appear in ascending order")];X(O[0].zoom)!==_&&(_=X(O[0].zoom),h=void 0,r={}),z=z.concat(ko({key:G+"[0]",value:O[0],valueSpec:{zoom:{}},style:M.style,styleSpec:M.styleSpec,objectElementValidators:{zoom:bl,value:E}}))}else z=z.concat(E({key:G+"[0]",value:O[0],valueSpec:{},style:M.style,styleSpec:M.styleSpec},O));return ws(Z(O[1]))?z.concat([new zt(G+"[1]",O[1],"expressions are not allowed in function stops.")]):z.concat(Gr({key:G+"[1]",value:O[1],valueSpec:w,style:M.style,styleSpec:M.styleSpec}))}function E(M,z){var O=bi(M.value),G=X(M.value),V=M.value!==null?M.value:z;if(n){if(O!==n)return[new zt(M.key,V,O+" stop domain type must match previous stop domain type "+n)]}else n=O;if(O!=="number"&&O!=="string"&&O!=="boolean")return[new zt(M.key,V,"stop domain value must be a number, string, or boolean")];if(O!=="number"&&C!=="categorical"){var W="number expected, "+O+" found";return ha(w)&&C===void 0&&(W+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new zt(M.key,V,W)]}return C!=="categorical"||O!=="number"||isFinite(G)&&Math.floor(G)===G?C!=="categorical"&&O==="number"&&h!==void 0&&G<h?[new zt(M.key,V,"stop domain values must appear in ascending order")]:(h=G,C==="categorical"&&G in r?[new zt(M.key,V,"stop domain values must be unique")]:(r[G]=!0,[])):[new zt(M.key,V,"integer expected, found "+G)]}}function $o(t){var n=(t.expressionContext==="property"?qu:vl)(Z(t.value),t.valueSpec);if(n.result==="error")return n.value.map(function(_){return new zt(""+t.key+_.key,t.value,_.message)});var h=n.value.expression||n.value._styleExpression.expression;if(t.expressionContext==="property"&&t.propertyKey==="text-font"&&!h.outputDefined())return[new zt(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if(t.expressionContext==="property"&&t.propertyType==="layout"&&!sa(h))return[new zt(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if(t.expressionContext==="filter"&&!sa(h))return[new zt(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&t.expressionContext.indexOf("cluster")===0){if(!qa(h,["zoom","feature-state"]))return[new zt(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(t.expressionContext==="cluster-initial"&&!aa(h))return[new zt(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Vs(t){var n=t.key,h=t.value,_=t.valueSpec,w=[];return Array.isArray(_.values)?_.values.indexOf(X(h))===-1&&w.push(new zt(n,h,"expected one of ["+_.values.join(", ")+"], "+JSON.stringify(h)+" found")):Object.keys(_.values).indexOf(X(h))===-1&&w.push(new zt(n,h,"expected one of ["+Object.keys(_.values).join(", ")+"], "+JSON.stringify(h)+" found")),w}function Qa(t){if(t===!0||t===!1)return!0;if(!Array.isArray(t)||t.length===0)return!1;switch(t[0]){case"has":return t.length>=2&&t[1]!=="$id"&&t[1]!=="$type";case"in":return t.length>=3&&(typeof t[1]!="string"||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return t.length!==3||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var n=0,h=t.slice(1);n<h.length;n+=1){var _=h[n];if(!Qa(_)&&typeof _!="boolean")return!1}return!0;default:return!0}}pa.deserialize=function(t){return new pa(t._parameters,t._specification)},pa.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var nu={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function wl(t){if(t==null)return{filter:function(){return!0},needGeometry:!1};Qa(t)||(t=Pa(t));var n=vl(t,nu);if(n.result==="error")throw new Error(n.value.map(function(h){return h.key+": "+h.message}).join(", "));return{filter:function(h,_,w){return n.value.evaluate(h,_,{},w)},needGeometry:function h(_){if(!Array.isArray(_))return!1;if(_[0]==="within")return!0;for(var w=1;w<_.length;w++)if(h(_[w]))return!0;return!1}(t)}}function Lc(t,n){return t<n?-1:t>n?1:0}function Pa(t){if(!t)return!0;var n,h=t[0];return t.length<=1?h!=="any":h==="=="?ou(t[1],t[2],"=="):h==="!="?Kn(ou(t[1],t[2],"==")):h==="<"||h===">"||h==="<="||h===">="?ou(t[1],t[2],h):h==="any"?(n=t.slice(1),["any"].concat(n.map(Pa))):h==="all"?["all"].concat(t.slice(1).map(Pa)):h==="none"?["all"].concat(t.slice(1).map(Pa).map(Kn)):h==="in"?Gs(t[1],t.slice(2)):h==="!in"?Kn(Gs(t[1],t.slice(2))):h==="has"?js(t[1]):h==="!has"?Kn(js(t[1])):h!=="within"||t}function ou(t,n,h){switch(t){case"$type":return["filter-type-"+h,n];case"$id":return["filter-id-"+h,n];default:return["filter-"+h,t,n]}}function Gs(t,n){if(n.length===0)return!1;switch(t){case"$type":return["filter-type-in",["literal",n]];case"$id":return["filter-id-in",["literal",n]];default:return n.length>200&&!n.some(function(h){return typeof h!=typeof n[0]})?["filter-in-large",t,["literal",n.sort(Lc)]]:["filter-in-small",t,["literal",n]]}}function js(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Kn(t){return["!",t]}function Yn(t){return Qa(Z(t.value))?$o(nt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function n(h){var _=h.value,w=h.key;if(bi(_)!=="array")return[new zt(w,_,"array expected, "+bi(_)+" found")];var C,r=h.styleSpec,e=[];if(_.length<1)return[new zt(w,_,"filter array must have at least 1 element")];switch(e=e.concat(Vs({key:w+"[0]",value:_[0],valueSpec:r.filter_operator,style:h.style,styleSpec:h.styleSpec})),X(_[0])){case"<":case"<=":case">":case">=":_.length>=2&&X(_[1])==="$type"&&e.push(new zt(w,_,'"$type" cannot be use with operator "'+_[0]+'"'));case"==":case"!=":_.length!==3&&e.push(new zt(w,_,'filter array for operator "'+_[0]+'" must have 3 elements'));case"in":case"!in":_.length>=2&&(C=bi(_[1]))!=="string"&&e.push(new zt(w+"[1]",_[1],"string expected, "+C+" found"));for(var s=2;s<_.length;s++)C=bi(_[s]),X(_[1])==="$type"?e=e.concat(Vs({key:w+"["+s+"]",value:_[s],valueSpec:r.geometry_type,style:h.style,styleSpec:h.styleSpec})):C!=="string"&&C!=="number"&&C!=="boolean"&&e.push(new zt(w+"["+s+"]",_[s],"string, number, or boolean expected, "+C+" found"));break;case"any":case"all":case"none":for(var f=1;f<_.length;f++)e=e.concat(n({key:w+"["+f+"]",value:_[f],style:h.style,styleSpec:h.styleSpec}));break;case"has":case"!has":C=bi(_[1]),_.length!==2?e.push(new zt(w,_,'filter array for "'+_[0]+'" operator must have 2 elements')):C!=="string"&&e.push(new zt(w+"[1]",_[1],"string expected, "+C+" found"));break;case"within":C=bi(_[1]),_.length!==2?e.push(new zt(w,_,'filter array for "'+_[0]+'" operator must have 2 elements')):C!=="object"&&e.push(new zt(w+"[1]",_[1],"object expected, "+C+" found"))}return e}(t)}function Zu(t,n){var h=t.key,_=t.style,w=t.styleSpec,C=t.value,r=t.objectKey,e=w[n+"_"+t.layerType];if(!e)return[];var s=r.match(/^(.*)-transition$/);if(n==="paint"&&s&&e[s[1]]&&e[s[1]].transition)return Gr({key:h,value:C,valueSpec:w.transition,style:_,styleSpec:w});var f,y=t.valueSpec||e[r];if(!y)return[new zt(h,C,'unknown property "'+r+'"')];if(bi(C)==="string"&&ha(y)&&!y.tokens&&(f=/^{([^}]+)}$/.exec(C)))return[new zt(h,C,'"'+r+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(f[1])+" }`.")];var b=[];return t.layerType==="symbol"&&(r==="text-field"&&_&&!_.glyphs&&b.push(new zt(h,C,'use of "text-field" requires a style "glyphs" property')),r==="text-font"&&Ta(Z(C))&&X(C.type)==="identity"&&b.push(new zt(h,C,'"text-font" does not support identity functions'))),b.concat(Gr({key:t.key,value:C,valueSpec:y,style:_,styleSpec:w,expressionContext:"property",propertyType:n,propertyKey:r}))}function Ma(t){return Zu(t,"paint")}function qs(t){return Zu(t,"layout")}function Ss(t){var n=[],h=t.value,_=t.key,w=t.style,C=t.styleSpec;h.type||h.ref||n.push(new zt(_,h,'either "type" or "ref" is required'));var r,e=X(h.type),s=X(h.ref);if(h.id)for(var f=X(h.id),y=0;y<t.arrayIndex;y++){var b=w.layers[y];X(b.id)===f&&n.push(new zt(_,h.id,'duplicate layer id "'+h.id+'", previously used at line '+b.id.__line__))}if("ref"in h)["type","source","source-layer","filter","layout"].forEach(function(z){z in h&&n.push(new zt(_,h[z],'"'+z+'" is prohibited for ref layers'))}),w.layers.forEach(function(z){X(z.id)===s&&(r=z)}),r?r.ref?n.push(new zt(_,h.ref,"ref cannot reference another ref layer")):e=X(r.type):n.push(new zt(_,h.ref,'ref layer "'+s+'" not found'));else if(e!=="background")if(h.source){var E=w.sources&&w.sources[h.source],M=E&&X(E.type);E?M==="vector"&&e==="raster"?n.push(new zt(_,h.source,'layer "'+h.id+'" requires a raster source')):M==="raster"&&e!=="raster"?n.push(new zt(_,h.source,'layer "'+h.id+'" requires a vector source')):M!=="vector"||h["source-layer"]?M==="raster-dem"&&e!=="hillshade"?n.push(new zt(_,h.source,"raster-dem source can only be used with layer type 'hillshade'.")):e!=="line"||!h.paint||!h.paint["line-gradient"]||M==="geojson"&&E.lineMetrics||n.push(new zt(_,h,'layer "'+h.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):n.push(new zt(_,h,'layer "'+h.id+'" must specify a "source-layer"')):n.push(new zt(_,h.source,'source "'+h.source+'" not found'))}else n.push(new zt(_,h,'missing required property "source"'));return n=n.concat(ko({key:_,value:h,valueSpec:C.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return Gr({key:_+".type",value:h.type,valueSpec:C.layer.type,style:t.style,styleSpec:t.styleSpec,object:h,objectKey:"type"})},filter:Yn,layout:function(z){return ko({layer:h,key:z.key,value:z.value,style:z.style,styleSpec:z.styleSpec,objectElementValidators:{"*":function(O){return qs(nt({layerType:e},O))}}})},paint:function(z){return ko({layer:h,key:z.key,value:z.value,style:z.style,styleSpec:z.styleSpec,objectElementValidators:{"*":function(O){return Ma(nt({layerType:e},O))}}})}}}))}function zo(t){var n=t.value,h=t.key,_=bi(n);return _!=="string"?[new zt(h,n,"string expected, "+_+" found")]:[]}var Pi={promoteId:function(t){var n=t.key,h=t.value;if(bi(h)==="string")return zo({key:n,value:h});var _=[];for(var w in h)_.push.apply(_,zo({key:n+"."+w,value:h[w]}));return _}};function Zs(t){var n=t.value,h=t.key,_=t.styleSpec,w=t.style;if(!n.type)return[new zt(h,n,'"type" is required')];var C,r=X(n.type);switch(r){case"vector":case"raster":case"raster-dem":return ko({key:h,value:n,valueSpec:_["source_"+r.replace("-","_")],style:t.style,styleSpec:_,objectElementValidators:Pi});case"geojson":if(C=ko({key:h,value:n,valueSpec:_.source_geojson,style:w,styleSpec:_,objectElementValidators:Pi}),n.cluster)for(var e in n.clusterProperties){var s=n.clusterProperties[e],f=s[0],y=typeof f=="string"?[f,["accumulated"],["get",e]]:f;C.push.apply(C,$o({key:h+"."+e+".map",value:s[1],expressionContext:"cluster-map"})),C.push.apply(C,$o({key:h+"."+e+".reduce",value:y,expressionContext:"cluster-reduce"}))}return C;case"video":return ko({key:h,value:n,valueSpec:_.source_video,style:w,styleSpec:_});case"image":return ko({key:h,value:n,valueSpec:_.source_image,style:w,styleSpec:_});case"canvas":return[new zt(h,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Vs({key:h+".type",value:n.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:w,styleSpec:_})}}function Ts(t){var n=t.value,h=t.styleSpec,_=h.light,w=t.style,C=[],r=bi(n);if(n===void 0)return C;if(r!=="object")return C.concat([new zt("light",n,"object expected, "+r+" found")]);for(var e in n){var s=e.match(/^(.*)-transition$/);C=C.concat(s&&_[s[1]]&&_[s[1]].transition?Gr({key:e,value:n[e],valueSpec:h.transition,style:w,styleSpec:h}):_[e]?Gr({key:e,value:n[e],valueSpec:_[e],style:w,styleSpec:h}):[new zt(e,n[e],'unknown property "'+e+'"')])}return C}var La={"*":function(){return[]},array:xl,boolean:function(t){var n=t.value,h=t.key,_=bi(n);return _!=="boolean"?[new zt(h,n,"boolean expected, "+_+" found")]:[]},number:bl,color:function(t){var n=t.key,h=t.value,_=bi(h);return _!=="string"?[new zt(n,h,"color expected, "+_+" found")]:Xe(h)===null?[new zt(n,h,'color expected, "'+h+'" found')]:[]},constants:Qt,enum:Vs,filter:Yn,function:Es,layer:Ss,object:ko,source:Zs,light:Ts,string:zo,formatted:function(t){return zo(t).length===0?[]:$o(t)},resolvedImage:function(t){return zo(t).length===0?[]:$o(t)}};function Gr(t){var n=t.value,h=t.valueSpec,_=t.styleSpec;return h.expression&&Ta(X(n))?Es(t):h.expression&&ws(Z(n))?$o(t):h.type&&La[h.type]?La[h.type](t):ko(nt({},t,{valueSpec:h.type?_[h.type]:h}))}function pi(t){var n=t.value,h=t.key,_=zo(t);return _.length||(n.indexOf("{fontstack}")===-1&&_.push(new zt(h,n,'"glyphs" url must include a "{fontstack}" token')),n.indexOf("{range}")===-1&&_.push(new zt(h,n,'"glyphs" url must include a "{range}" token'))),_}function We(t,n){n===void 0&&(n=dt);var h=[];return h=h.concat(Gr({key:"",value:t,valueSpec:n.$root,styleSpec:n,style:t,objectElementValidators:{glyphs:pi,"*":function(){return[]}}})),t.constants&&(h=h.concat(Qt({key:"constants",value:t.constants,style:t,styleSpec:n}))),Is(h)}function Is(t){return[].concat(t).sort(function(n,h){return n.line-h.line})}function fa(t){return function(){for(var n=[],h=arguments.length;h--;)n[h]=arguments[h];return Is(t.apply(this,n))}}We.source=fa(Zs),We.light=fa(Ts),We.layer=fa(Ss),We.filter=fa(Yn),We.paintProperty=fa(Ma),We.layoutProperty=fa(qs);var Ko=We,El=Ko.light,Je=Ko.paintProperty,Cs=Ko.layoutProperty;function Xs(t,n){var h=!1;if(n&&n.length)for(var _=0,w=n;_<w.length;_+=1)t.fire(new Bt(new Error(w[_].message))),h=!0;return h}var ka=Oi;function Oi(t,n,h){var _=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var w=new Int32Array(this.arrayBuffer);t=w[0],this.d=(n=w[1])+2*(h=w[2]);for(var C=0;C<this.d*this.d;C++){var r=w[3+C],e=w[3+C+1];_.push(r===e?null:w.subarray(r,e))}var s=w[3+_.length+1];this.keys=w.subarray(w[3+_.length],s),this.bboxes=w.subarray(s),this.insert=this._insertReadonly}else{this.d=n+2*h;for(var f=0;f<this.d*this.d;f++)_.push([]);this.keys=[],this.bboxes=[]}this.n=n,this.extent=t,this.padding=h,this.scale=n/t,this.uid=0;var y=h/n*t;this.min=-y,this.max=t+y}Oi.prototype.insert=function(t,n,h,_,w){this._forEachCell(n,h,_,w,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(n),this.bboxes.push(h),this.bboxes.push(_),this.bboxes.push(w)},Oi.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},Oi.prototype._insertCell=function(t,n,h,_,w,C){this.cells[w].push(C)},Oi.prototype.query=function(t,n,h,_,w){var C=this.min,r=this.max;if(t<=C&&n<=C&&r<=h&&r<=_&&!w)return Array.prototype.slice.call(this.keys);var e=[];return this._forEachCell(t,n,h,_,this._queryCell,e,{},w),e},Oi.prototype._queryCell=function(t,n,h,_,w,C,r,e){var s=this.cells[w];if(s!==null)for(var f=this.keys,y=this.bboxes,b=0;b<s.length;b++){var E=s[b];if(r[E]===void 0){var M=4*E;(e?e(y[M+0],y[M+1],y[M+2],y[M+3]):t<=y[M+2]&&n<=y[M+3]&&h>=y[M+0]&&_>=y[M+1])?(r[E]=!0,C.push(f[E])):r[E]=!1}}},Oi.prototype._forEachCell=function(t,n,h,_,w,C,r,e){for(var s=this._convertToCellCoord(t),f=this._convertToCellCoord(n),y=this._convertToCellCoord(h),b=this._convertToCellCoord(_),E=s;E<=y;E++)for(var M=f;M<=b;M++){var z=this.d*M+E;if((!e||e(this._convertFromCellCoord(E),this._convertFromCellCoord(M),this._convertFromCellCoord(E+1),this._convertFromCellCoord(M+1)))&&w.call(this,t,n,h,_,z,C,r,e))return}},Oi.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},Oi.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},Oi.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,n=3+this.cells.length+1+1,h=0,_=0;_<this.cells.length;_++)h+=this.cells[_].length;var w=new Int32Array(n+h+this.keys.length+this.bboxes.length);w[0]=this.extent,w[1]=this.n,w[2]=this.padding;for(var C=n,r=0;r<t.length;r++){var e=t[r];w[3+r]=C,w.set(e,C),C+=e.length}return w[3+t.length]=C,w.set(this.keys,C),w[3+t.length+1]=C+=this.keys.length,w.set(this.bboxes,C),C+=this.bboxes.length,w.buffer};var Ws=N.ImageData,Xu=N.ImageBitmap,nn={};function tr(t,n,h){h===void 0&&(h={}),Object.defineProperty(n,"_classRegistryKey",{value:t,writeable:!1}),nn[t]={klass:n,omit:h.omit||[],shallow:h.shallow||[]}}for(var Vn in tr("Object",Object),ka.serialize=function(t,n){var h=t.toArrayBuffer();return n&&n.push(h),{buffer:h}},ka.deserialize=function(t){return new ka(t.buffer)},tr("Grid",ka),tr("Color",Sr),tr("Error",Error),tr("ResolvedImage",Nn),tr("StylePropertyFunction",pa),tr("StyleExpression",Ca,{omit:["_evaluator"]}),tr("ZoomDependentExpression",Aa),tr("ZoomConstantExpression",Ja),tr("CompoundExpression",Hi,{omit:["_evaluate"]}),xi)xi[Vn]._classRegistryKey||tr("Expression_"+Vn,xi[Vn]);function $s(t){return t&&typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}function ts(t){return Xu&&t instanceof Xu}function Ro(t,n){if(t==null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if($s(t)||ts(t))return n&&n.push(t),t;if(ArrayBuffer.isView(t)){var h=t;return n&&n.push(h.buffer),h}if(t instanceof Ws)return n&&n.push(t.data.buffer),t;if(Array.isArray(t)){for(var _=[],w=0,C=t;w<C.length;w+=1)_.push(Ro(C[w],n));return _}if(typeof t=="object"){var r=t.constructor,e=r._classRegistryKey;if(!e)throw new Error("can't serialize object of unregistered class");var s=r.serialize?r.serialize(t,n):{};if(!r.serialize){for(var f in t)if(t.hasOwnProperty(f)&&!(nn[e].omit.indexOf(f)>=0)){var y=t[f];s[f]=nn[e].shallow.indexOf(f)>=0?y:Ro(y,n)}t instanceof Error&&(s.message=t.message)}if(s.$name)throw new Error("$name property is reserved for worker serialization logic.");return e!=="Object"&&(s.$name=e),s}throw new Error("can't serialize object of type "+typeof t)}function Mi(t){if(t==null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||$s(t)||ts(t)||ArrayBuffer.isView(t)||t instanceof Ws)return t;if(Array.isArray(t))return t.map(Mi);if(typeof t=="object"){var n=t.$name||"Object",h=nn[n].klass;if(!h)throw new Error("can't deserialize unregistered class "+n);if(h.deserialize)return h.deserialize(t);for(var _=Object.create(h.prototype),w=0,C=Object.keys(t);w<C.length;w+=1){var r=C[w];if(r!=="$name"){var e=t[r];_[r]=nn[n].shallow.indexOf(r)>=0?e:Mi(e)}}return _}throw new Error("can't deserialize object of type "+typeof t)}var da=function(){this.first=!0};da.prototype.update=function(t,n){var h=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=h,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=h,!0):(this.lastFloorZoom>h?(this.lastIntegerZoom=h+1,this.lastIntegerZoomTime=n):this.lastFloorZoom<h&&(this.lastIntegerZoom=h,this.lastIntegerZoomTime=n),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=h,!0))};var Ne={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function Sl(t){for(var n=0,h=t;n<h.length;n+=1)if(za(h[n].charCodeAt(0)))return!0;return!1}function za(t){return!(t!==746&&t!==747&&(t<4352||!(Ne["Bopomofo Extended"](t)||Ne.Bopomofo(t)||Ne["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Ne["CJK Compatibility Ideographs"](t)||Ne["CJK Compatibility"](t)||Ne["CJK Radicals Supplement"](t)||Ne["CJK Strokes"](t)||!(!Ne["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||t===12336)||Ne["CJK Unified Ideographs Extension A"](t)||Ne["CJK Unified Ideographs"](t)||Ne["Enclosed CJK Letters and Months"](t)||Ne["Hangul Compatibility Jamo"](t)||Ne["Hangul Jamo Extended-A"](t)||Ne["Hangul Jamo Extended-B"](t)||Ne["Hangul Jamo"](t)||Ne["Hangul Syllables"](t)||Ne.Hiragana(t)||Ne["Ideographic Description Characters"](t)||Ne.Kanbun(t)||Ne["Kangxi Radicals"](t)||Ne["Katakana Phonetic Extensions"](t)||Ne.Katakana(t)&&t!==12540||!(!Ne["Halfwidth and Fullwidth Forms"](t)||t===65288||t===65289||t===65293||t>=65306&&t<=65310||t===65339||t===65341||t===65343||t>=65371&&t<=65503||t===65507||t>=65512&&t<=65519)||!(!Ne["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Ne["Unified Canadian Aboriginal Syllabics"](t)||Ne["Unified Canadian Aboriginal Syllabics Extended"](t)||Ne["Vertical Forms"](t)||Ne["Yijing Hexagram Symbols"](t)||Ne["Yi Syllables"](t)||Ne["Yi Radicals"](t))))}function Tl(t){return!(za(t)||function(n){return!!(Ne["Latin-1 Supplement"](n)&&(n===167||n===169||n===174||n===177||n===188||n===189||n===190||n===215||n===247)||Ne["General Punctuation"](n)&&(n===8214||n===8224||n===8225||n===8240||n===8241||n===8251||n===8252||n===8258||n===8263||n===8264||n===8265||n===8273)||Ne["Letterlike Symbols"](n)||Ne["Number Forms"](n)||Ne["Miscellaneous Technical"](n)&&(n>=8960&&n<=8967||n>=8972&&n<=8991||n>=8996&&n<=9e3||n===9003||n>=9085&&n<=9114||n>=9150&&n<=9165||n===9167||n>=9169&&n<=9179||n>=9186&&n<=9215)||Ne["Control Pictures"](n)&&n!==9251||Ne["Optical Character Recognition"](n)||Ne["Enclosed Alphanumerics"](n)||Ne["Geometric Shapes"](n)||Ne["Miscellaneous Symbols"](n)&&!(n>=9754&&n<=9759)||Ne["Miscellaneous Symbols and Arrows"](n)&&(n>=11026&&n<=11055||n>=11088&&n<=11097||n>=11192&&n<=11243)||Ne["CJK Symbols and Punctuation"](n)||Ne.Katakana(n)||Ne["Private Use Area"](n)||Ne["CJK Compatibility Forms"](n)||Ne["Small Form Variants"](n)||Ne["Halfwidth and Fullwidth Forms"](n)||n===8734||n===8756||n===8757||n>=9984&&n<=10087||n>=10102&&n<=10131||n===65532||n===65533)}(t))}function ao(t){return t>=1424&&t<=2303||Ne["Arabic Presentation Forms-A"](t)||Ne["Arabic Presentation Forms-B"](t)}function Fi(t,n){return!(!n&&ao(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Ne.Khmer(t))}function Ii(t){for(var n=0,h=t;n<h.length;n+=1)if(ao(h[n].charCodeAt(0)))return!0;return!1}var As=null,Gn="unavailable",Yo=null,Wu=function(t){t&&typeof t=="string"&&t.indexOf("NetworkError")>-1&&(Gn="error"),As&&As(t)};function Ks(){$u.fire(new It("pluginStateChange",{pluginStatus:Gn,pluginURL:Yo}))}var $u=new Gt,No=function(){return Gn},mo=function(){if(Gn!=="deferred"||!Yo)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Gn="loading",Ks(),Yo&&Rn({url:Yo},function(t){t?Wu(t):(Gn="loaded",Ks())})},er={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Gn==="loaded"||er.applyArabicShaping!=null},isLoading:function(){return Gn==="loading"},setState:function(t){Gn=t.pluginStatus,Yo=t.pluginURL},isParsed:function(){return er.applyArabicShaping!=null&&er.processBidirectionalText!=null&&er.processStyledBidirectionalText!=null},getPluginURL:function(){return Yo}},Oe=function(t,n){this.zoom=t,n?(this.now=n.now,this.fadeDuration=n.fadeDuration,this.zoomHistory=n.zoomHistory,this.transition=n.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new da,this.transition={})};Oe.prototype.isSupportedScript=function(t){return function(n,h){for(var _=0,w=n;_<w.length;_+=1)if(!Fi(w[_].charCodeAt(0),h))return!1;return!0}(t,er.isLoaded())},Oe.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Oe.prototype.getCrossfadeParameters=function(){var t=this.zoom,n=t-Math.floor(t),h=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:n+(1-n)*h}:{fromScale:.5,toScale:1,t:1-(1-h)*n}};var go=function(t,n){this.property=t,this.value=n,this.expression=function(h,_){if(Ta(h))return new pa(h,_);if(ws(h)){var w=qu(h,_);if(w.result==="error")throw new Error(w.value.map(function(r){return r.key+": "+r.message}).join(", "));return w.value}var C=h;return typeof h=="string"&&_.type==="color"&&(C=Sr.parse(h)),{kind:"constant",evaluate:function(){return C}}}(n===void 0?t.specification.default:n,t.specification)};go.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},go.prototype.possiblyEvaluate=function(t,n,h){return this.property.possiblyEvaluate(this,t,n,h)};var Hn=function(t){this.property=t,this.value=new go(t,void 0)};Hn.prototype.transitioned=function(t,n){return new Bi(this.property,this.value,n,wt({},t.transition,this.transition),t.now)},Hn.prototype.untransitioned=function(){return new Bi(this.property,this.value,null,{},0)};var gn=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};gn.prototype.getValue=function(t){return Me(this._values[t].value.value)},gn.prototype.setValue=function(t,n){this._values.hasOwnProperty(t)||(this._values[t]=new Hn(this._values[t].property)),this._values[t].value=new go(this._values[t].property,n===null?void 0:Me(n))},gn.prototype.getTransition=function(t){return Me(this._values[t].transition)},gn.prototype.setTransition=function(t,n){this._values.hasOwnProperty(t)||(this._values[t]=new Hn(this._values[t].property)),this._values[t].transition=Me(n)||void 0},gn.prototype.serialize=function(){for(var t={},n=0,h=Object.keys(this._values);n<h.length;n+=1){var _=h[n],w=this.getValue(_);w!==void 0&&(t[_]=w);var C=this.getTransition(_);C!==void 0&&(t[_+"-transition"]=C)}return t},gn.prototype.transitioned=function(t,n){for(var h=new yo(this._properties),_=0,w=Object.keys(this._values);_<w.length;_+=1){var C=w[_];h._values[C]=this._values[C].transitioned(t,n._values[C])}return h},gn.prototype.untransitioned=function(){for(var t=new yo(this._properties),n=0,h=Object.keys(this._values);n<h.length;n+=1){var _=h[n];t._values[_]=this._values[_].untransitioned()}return t};var Bi=function(t,n,h,_,w){this.property=t,this.value=n,this.begin=w+_.delay||0,this.end=this.begin+_.duration||0,t.specification.transition&&(_.delay||_.duration)&&(this.prior=h)};Bi.prototype.possiblyEvaluate=function(t,n,h){var _=t.now||0,w=this.value.possiblyEvaluate(t,n,h),C=this.prior;if(C){if(_>this.end)return this.prior=null,w;if(this.value.isDataDriven())return this.prior=null,w;if(_<this.begin)return C.possiblyEvaluate(t,n,h);var r=(_-this.begin)/(this.end-this.begin);return this.property.interpolate(C.possiblyEvaluate(t,n,h),w,function(e){if(e<=0)return 0;if(e>=1)return 1;var s=e*e,f=s*e;return 4*(e<.5?f:3*(e-s)+f-.75)}(r))}return w};var yo=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};yo.prototype.possiblyEvaluate=function(t,n,h){for(var _=new Ra(this._properties),w=0,C=Object.keys(this._values);w<C.length;w+=1){var r=C[w];_._values[r]=this._values[r].possiblyEvaluate(t,n,h)}return _},yo.prototype.hasTransition=function(){for(var t=0,n=Object.keys(this._values);t<n.length;t+=1)if(this._values[n[t]].prior)return!0;return!1};var Zi=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};Zi.prototype.getValue=function(t){return Me(this._values[t].value)},Zi.prototype.setValue=function(t,n){this._values[t]=new go(this._values[t].property,n===null?void 0:Me(n))},Zi.prototype.serialize=function(){for(var t={},n=0,h=Object.keys(this._values);n<h.length;n+=1){var _=h[n],w=this.getValue(_);w!==void 0&&(t[_]=w)}return t},Zi.prototype.possiblyEvaluate=function(t,n,h){for(var _=new Ra(this._properties),w=0,C=Object.keys(this._values);w<C.length;w+=1){var r=C[w];_._values[r]=this._values[r].possiblyEvaluate(t,n,h)}return _};var Jn=function(t,n,h){this.property=t,this.value=n,this.parameters=h};Jn.prototype.isConstant=function(){return this.value.kind==="constant"},Jn.prototype.constantOr=function(t){return this.value.kind==="constant"?this.value.value:t},Jn.prototype.evaluate=function(t,n,h,_){return this.property.evaluate(this.value,this.parameters,t,n,h,_)};var Ra=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};Ra.prototype.get=function(t){return this._values[t]};var je=function(t){this.specification=t};je.prototype.possiblyEvaluate=function(t,n){return t.expression.evaluate(n)},je.prototype.interpolate=function(t,n,h){var _=On[this.specification.type];return _?_(t,n,h):t};var Ve=function(t,n){this.specification=t,this.overrides=n};Ve.prototype.possiblyEvaluate=function(t,n,h,_){return new Jn(this,t.expression.kind==="constant"||t.expression.kind==="camera"?{kind:"constant",value:t.expression.evaluate(n,null,{},h,_)}:t.expression,n)},Ve.prototype.interpolate=function(t,n,h){if(t.value.kind!=="constant"||n.value.kind!=="constant")return t;if(t.value.value===void 0||n.value.value===void 0)return new Jn(this,{kind:"constant",value:void 0},t.parameters);var _=On[this.specification.type];return _?new Jn(this,{kind:"constant",value:_(t.value.value,n.value.value,h)},t.parameters):t},Ve.prototype.evaluate=function(t,n,h,_,w,C){return t.kind==="constant"?t.value:t.evaluate(n,h,_,w,C)};var Il=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.possiblyEvaluate=function(h,_,w,C){if(h.value===void 0)return new Jn(this,{kind:"constant",value:void 0},_);if(h.expression.kind==="constant"){var r=h.expression.evaluate(_,null,{},w,C),e=h.property.specification.type==="resolvedImage"&&typeof r!="string"?r.name:r,s=this._calculate(e,e,e,_);return new Jn(this,{kind:"constant",value:s},_)}if(h.expression.kind==="camera"){var f=this._calculate(h.expression.evaluate({zoom:_.zoom-1}),h.expression.evaluate({zoom:_.zoom}),h.expression.evaluate({zoom:_.zoom+1}),_);return new Jn(this,{kind:"constant",value:f},_)}return new Jn(this,h.expression,_)},n.prototype.evaluate=function(h,_,w,C,r,e){if(h.kind==="source"){var s=h.evaluate(_,w,C,r,e);return this._calculate(s,s,s,_)}return h.kind==="composite"?this._calculate(h.evaluate({zoom:Math.floor(_.zoom)-1},w,C),h.evaluate({zoom:Math.floor(_.zoom)},w,C),h.evaluate({zoom:Math.floor(_.zoom)+1},w,C),_):h.value},n.prototype._calculate=function(h,_,w,C){return C.zoom>C.zoomHistory.lastIntegerZoom?{from:h,to:_}:{from:w,to:_}},n.prototype.interpolate=function(h){return h},n}(Ve),cn=function(t){this.specification=t};cn.prototype.possiblyEvaluate=function(t,n,h,_){if(t.value!==void 0){if(t.expression.kind==="constant"){var w=t.expression.evaluate(n,null,{},h,_);return this._calculate(w,w,w,n)}return this._calculate(t.expression.evaluate(new Oe(Math.floor(n.zoom-1),n)),t.expression.evaluate(new Oe(Math.floor(n.zoom),n)),t.expression.evaluate(new Oe(Math.floor(n.zoom+1),n)),n)}},cn.prototype._calculate=function(t,n,h,_){return _.zoom>_.zoomHistory.lastIntegerZoom?{from:t,to:n}:{from:h,to:n}},cn.prototype.interpolate=function(t){return t};var so=function(t){this.specification=t};so.prototype.possiblyEvaluate=function(t,n,h,_){return!!t.expression.evaluate(n,null,{},h,_)},so.prototype.interpolate=function(){return!1};var T=function(t){for(var n in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var h=t[n];h.specification.overridable&&this.overridableProperties.push(n);var _=this.defaultPropertyValues[n]=new go(h,void 0),w=this.defaultTransitionablePropertyValues[n]=new Hn(h);this.defaultTransitioningPropertyValues[n]=w.untransitioned(),this.defaultPossiblyEvaluatedValues[n]=_.possiblyEvaluate({})}};tr("DataDrivenProperty",Ve),tr("DataConstantProperty",je),tr("CrossFadedDataDrivenProperty",Il),tr("CrossFadedProperty",cn),tr("ColorRampProperty",so);var a=function(t){function n(h,_){if(t.call(this),this.id=h.id,this.type=h.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},h.type!=="custom"&&(this.metadata=(h=h).metadata,this.minzoom=h.minzoom,this.maxzoom=h.maxzoom,h.type!=="background"&&(this.source=h.source,this.sourceLayer=h["source-layer"],this.filter=h.filter),_.layout&&(this._unevaluatedLayout=new Zi(_.layout)),_.paint)){for(var w in this._transitionablePaint=new gn(_.paint),h.paint)this.setPaintProperty(w,h.paint[w],{validate:!1});for(var C in h.layout)this.setLayoutProperty(C,h.layout[C],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ra(_.paint)}}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},n.prototype.getLayoutProperty=function(h){return h==="visibility"?this.visibility:this._unevaluatedLayout.getValue(h)},n.prototype.setLayoutProperty=function(h,_,w){w===void 0&&(w={}),_!=null&&this._validate(Cs,"layers."+this.id+".layout."+h,h,_,w)||(h!=="visibility"?this._unevaluatedLayout.setValue(h,_):this.visibility=_)},n.prototype.getPaintProperty=function(h){return oe(h,"-transition")?this._transitionablePaint.getTransition(h.slice(0,-11)):this._transitionablePaint.getValue(h)},n.prototype.setPaintProperty=function(h,_,w){if(w===void 0&&(w={}),_!=null&&this._validate(Je,"layers."+this.id+".paint."+h,h,_,w))return!1;if(oe(h,"-transition"))return this._transitionablePaint.setTransition(h.slice(0,-11),_||void 0),!1;var C=this._transitionablePaint._values[h],r=C.property.specification["property-type"]==="cross-faded-data-driven",e=C.value.isDataDriven(),s=C.value;this._transitionablePaint.setValue(h,_),this._handleSpecialPaintPropertyUpdate(h);var f=this._transitionablePaint._values[h].value;return f.isDataDriven()||e||r||this._handleOverridablePaintPropertyUpdate(h,s,f)},n.prototype._handleSpecialPaintPropertyUpdate=function(h){},n.prototype._handleOverridablePaintPropertyUpdate=function(h,_,w){return!1},n.prototype.isHidden=function(h){return!!(this.minzoom&&h<this.minzoom)||!!(this.maxzoom&&h>=this.maxzoom)||this.visibility==="none"},n.prototype.updateTransitions=function(h){this._transitioningPaint=this._transitionablePaint.transitioned(h,this._transitioningPaint)},n.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},n.prototype.recalculate=function(h,_){h.getCrossfadeParameters&&(this._crossfadeParameters=h.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(h,void 0,_)),this.paint=this._transitioningPaint.possiblyEvaluate(h,void 0,_)},n.prototype.serialize=function(){var h={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(h.layout=h.layout||{},h.layout.visibility=this.visibility),be(h,function(_,w){return!(_===void 0||w==="layout"&&!Object.keys(_).length||w==="paint"&&!Object.keys(_).length)})},n.prototype._validate=function(h,_,w,C,r){return r===void 0&&(r={}),(!r||r.validate!==!1)&&Xs(this,h.call(Ko,{key:_,layerType:this.type,objectKey:w,value:C,styleSpec:dt,style:{glyphs:!0,sprite:!0}}))},n.prototype.is3D=function(){return!1},n.prototype.isTileClipped=function(){return!1},n.prototype.hasOffscreenPass=function(){return!1},n.prototype.resize=function(){},n.prototype.isStateDependent=function(){for(var h in this.paint._values){var _=this.paint.get(h);if(_ instanceof Jn&&ha(_.property.specification)&&(_.value.kind==="source"||_.value.kind==="composite")&&_.value.isStateDependent)return!0}return!1},n}(Gt),g={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},S=function(t,n){this._structArray=t,this._pos1=n*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},I=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function L(t,n){n===void 0&&(n=1);var h=0,_=0;return{members:t.map(function(w){var C=g[w.type].BYTES_PER_ELEMENT,r=h=B(h,Math.max(n,C)),e=w.components||1;return _=Math.max(_,C),h+=C*e,{name:w.name,type:w.type,components:e,offset:r}}),size:B(h,Math.max(_,n)),alignment:n}}function B(t,n){return Math.ceil(t/n)*n}I.serialize=function(t,n){return t._trim(),n&&(t.isTransferred=!0,n.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},I.deserialize=function(t){var n=Object.create(this.prototype);return n.arrayBuffer=t.arrayBuffer,n.length=t.length,n.capacity=t.arrayBuffer.byteLength/n.bytesPerElement,n._refreshViews(),n},I.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},I.prototype.clear=function(){this.length=0},I.prototype.resize=function(t){this.reserve(t),this.length=t},I.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var n=this.uint8;this._refreshViews(),n&&this.uint8.set(n)}},I.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var q=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_){var w=this.length;return this.resize(w+1),this.emplace(w,h,_)},n.prototype.emplace=function(h,_,w){var C=2*h;return this.int16[C+0]=_,this.int16[C+1]=w,h},n}(I);q.prototype.bytesPerElement=4,tr("StructArrayLayout2i4",q);var $=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C){var r=this.length;return this.resize(r+1),this.emplace(r,h,_,w,C)},n.prototype.emplace=function(h,_,w,C,r){var e=4*h;return this.int16[e+0]=_,this.int16[e+1]=w,this.int16[e+2]=C,this.int16[e+3]=r,h},n}(I);$.prototype.bytesPerElement=8,tr("StructArrayLayout4i8",$);var J=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C,r,e){var s=this.length;return this.resize(s+1),this.emplace(s,h,_,w,C,r,e)},n.prototype.emplace=function(h,_,w,C,r,e,s){var f=6*h;return this.int16[f+0]=_,this.int16[f+1]=w,this.int16[f+2]=C,this.int16[f+3]=r,this.int16[f+4]=e,this.int16[f+5]=s,h},n}(I);J.prototype.bytesPerElement=12,tr("StructArrayLayout2i4i12",J);var et=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C,r,e){var s=this.length;return this.resize(s+1),this.emplace(s,h,_,w,C,r,e)},n.prototype.emplace=function(h,_,w,C,r,e,s){var f=4*h,y=8*h;return this.int16[f+0]=_,this.int16[f+1]=w,this.uint8[y+4]=C,this.uint8[y+5]=r,this.uint8[y+6]=e,this.uint8[y+7]=s,h},n}(I);et.prototype.bytesPerElement=8,tr("StructArrayLayout2i4ub8",et);var ut=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_){var w=this.length;return this.resize(w+1),this.emplace(w,h,_)},n.prototype.emplace=function(h,_,w){var C=2*h;return this.float32[C+0]=_,this.float32[C+1]=w,h},n}(I);ut.prototype.bytesPerElement=8,tr("StructArrayLayout2f8",ut);var vt=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C,r,e,s,f,y,b){var E=this.length;return this.resize(E+1),this.emplace(E,h,_,w,C,r,e,s,f,y,b)},n.prototype.emplace=function(h,_,w,C,r,e,s,f,y,b,E){var M=10*h;return this.uint16[M+0]=_,this.uint16[M+1]=w,this.uint16[M+2]=C,this.uint16[M+3]=r,this.uint16[M+4]=e,this.uint16[M+5]=s,this.uint16[M+6]=f,this.uint16[M+7]=y,this.uint16[M+8]=b,this.uint16[M+9]=E,h},n}(I);vt.prototype.bytesPerElement=20,tr("StructArrayLayout10ui20",vt);var Ft=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C,r,e,s,f,y,b,E,M){var z=this.length;return this.resize(z+1),this.emplace(z,h,_,w,C,r,e,s,f,y,b,E,M)},n.prototype.emplace=function(h,_,w,C,r,e,s,f,y,b,E,M,z){var O=12*h;return this.int16[O+0]=_,this.int16[O+1]=w,this.int16[O+2]=C,this.int16[O+3]=r,this.uint16[O+4]=e,this.uint16[O+5]=s,this.uint16[O+6]=f,this.uint16[O+7]=y,this.int16[O+8]=b,this.int16[O+9]=E,this.int16[O+10]=M,this.int16[O+11]=z,h},n}(I);Ft.prototype.bytesPerElement=24,tr("StructArrayLayout4i4ui4i24",Ft);var bt=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w){var C=this.length;return this.resize(C+1),this.emplace(C,h,_,w)},n.prototype.emplace=function(h,_,w,C){var r=3*h;return this.float32[r+0]=_,this.float32[r+1]=w,this.float32[r+2]=C,h},n}(I);bt.prototype.bytesPerElement=12,tr("StructArrayLayout3f12",bt);var Ot=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h){var _=this.length;return this.resize(_+1),this.emplace(_,h)},n.prototype.emplace=function(h,_){return this.uint32[1*h+0]=_,h},n}(I);Ot.prototype.bytesPerElement=4,tr("StructArrayLayout1ul4",Ot);var Kt=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C,r,e,s,f,y){var b=this.length;return this.resize(b+1),this.emplace(b,h,_,w,C,r,e,s,f,y)},n.prototype.emplace=function(h,_,w,C,r,e,s,f,y,b){var E=10*h,M=5*h;return this.int16[E+0]=_,this.int16[E+1]=w,this.int16[E+2]=C,this.int16[E+3]=r,this.int16[E+4]=e,this.int16[E+5]=s,this.uint32[M+3]=f,this.uint16[E+8]=y,this.uint16[E+9]=b,h},n}(I);Kt.prototype.bytesPerElement=20,tr("StructArrayLayout6i1ul2ui20",Kt);var Wt=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C,r,e){var s=this.length;return this.resize(s+1),this.emplace(s,h,_,w,C,r,e)},n.prototype.emplace=function(h,_,w,C,r,e,s){var f=6*h;return this.int16[f+0]=_,this.int16[f+1]=w,this.int16[f+2]=C,this.int16[f+3]=r,this.int16[f+4]=e,this.int16[f+5]=s,h},n}(I);Wt.prototype.bytesPerElement=12,tr("StructArrayLayout2i2i2i12",Wt);var ie=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C,r){var e=this.length;return this.resize(e+1),this.emplace(e,h,_,w,C,r)},n.prototype.emplace=function(h,_,w,C,r,e){var s=4*h,f=8*h;return this.float32[s+0]=_,this.float32[s+1]=w,this.float32[s+2]=C,this.int16[f+6]=r,this.int16[f+7]=e,h},n}(I);ie.prototype.bytesPerElement=16,tr("StructArrayLayout2f1f2i16",ie);var Ht=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C){var r=this.length;return this.resize(r+1),this.emplace(r,h,_,w,C)},n.prototype.emplace=function(h,_,w,C,r){var e=12*h,s=3*h;return this.uint8[e+0]=_,this.uint8[e+1]=w,this.float32[s+1]=C,this.float32[s+2]=r,h},n}(I);Ht.prototype.bytesPerElement=12,tr("StructArrayLayout2ub2f12",Ht);var _e=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w){var C=this.length;return this.resize(C+1),this.emplace(C,h,_,w)},n.prototype.emplace=function(h,_,w,C){var r=3*h;return this.uint16[r+0]=_,this.uint16[r+1]=w,this.uint16[r+2]=C,h},n}(I);_e.prototype.bytesPerElement=6,tr("StructArrayLayout3ui6",_e);var he=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C,r,e,s,f,y,b,E,M,z,O,G,V,W){var Y=this.length;return this.resize(Y+1),this.emplace(Y,h,_,w,C,r,e,s,f,y,b,E,M,z,O,G,V,W)},n.prototype.emplace=function(h,_,w,C,r,e,s,f,y,b,E,M,z,O,G,V,W,Y){var H=24*h,ot=12*h,ht=48*h;return this.int16[H+0]=_,this.int16[H+1]=w,this.uint16[H+2]=C,this.uint16[H+3]=r,this.uint32[ot+2]=e,this.uint32[ot+3]=s,this.uint32[ot+4]=f,this.uint16[H+10]=y,this.uint16[H+11]=b,this.uint16[H+12]=E,this.float32[ot+7]=M,this.float32[ot+8]=z,this.uint8[ht+36]=O,this.uint8[ht+37]=G,this.uint8[ht+38]=V,this.uint32[ot+10]=W,this.int16[H+22]=Y,h},n}(I);he.prototype.bytesPerElement=48,tr("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",he);var de=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C,r,e,s,f,y,b,E,M,z,O,G,V,W,Y,H,ot,ht,Pt,Ut,jt,qt,re,Xt,Te){var Ee=this.length;return this.resize(Ee+1),this.emplace(Ee,h,_,w,C,r,e,s,f,y,b,E,M,z,O,G,V,W,Y,H,ot,ht,Pt,Ut,jt,qt,re,Xt,Te)},n.prototype.emplace=function(h,_,w,C,r,e,s,f,y,b,E,M,z,O,G,V,W,Y,H,ot,ht,Pt,Ut,jt,qt,re,Xt,Te,Ee){var ue=34*h,we=17*h;return this.int16[ue+0]=_,this.int16[ue+1]=w,this.int16[ue+2]=C,this.int16[ue+3]=r,this.int16[ue+4]=e,this.int16[ue+5]=s,this.int16[ue+6]=f,this.int16[ue+7]=y,this.uint16[ue+8]=b,this.uint16[ue+9]=E,this.uint16[ue+10]=M,this.uint16[ue+11]=z,this.uint16[ue+12]=O,this.uint16[ue+13]=G,this.uint16[ue+14]=V,this.uint16[ue+15]=W,this.uint16[ue+16]=Y,this.uint16[ue+17]=H,this.uint16[ue+18]=ot,this.uint16[ue+19]=ht,this.uint16[ue+20]=Pt,this.uint16[ue+21]=Ut,this.uint16[ue+22]=jt,this.uint32[we+12]=qt,this.float32[we+13]=re,this.float32[we+14]=Xt,this.float32[we+15]=Te,this.float32[we+16]=Ee,h},n}(I);de.prototype.bytesPerElement=68,tr("StructArrayLayout8i15ui1ul4f68",de);var Pe=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h){var _=this.length;return this.resize(_+1),this.emplace(_,h)},n.prototype.emplace=function(h,_){return this.float32[1*h+0]=_,h},n}(I);Pe.prototype.bytesPerElement=4,tr("StructArrayLayout1f4",Pe);var Re=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w){var C=this.length;return this.resize(C+1),this.emplace(C,h,_,w)},n.prototype.emplace=function(h,_,w,C){var r=3*h;return this.int16[r+0]=_,this.int16[r+1]=w,this.int16[r+2]=C,h},n}(I);Re.prototype.bytesPerElement=6,tr("StructArrayLayout3i6",Re);var ve=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w){var C=this.length;return this.resize(C+1),this.emplace(C,h,_,w)},n.prototype.emplace=function(h,_,w,C){var r=4*h;return this.uint32[2*h+0]=_,this.uint16[r+2]=w,this.uint16[r+3]=C,h},n}(I);ve.prototype.bytesPerElement=8,tr("StructArrayLayout1ul2ui8",ve);var ar=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_){var w=this.length;return this.resize(w+1),this.emplace(w,h,_)},n.prototype.emplace=function(h,_,w){var C=2*h;return this.uint16[C+0]=_,this.uint16[C+1]=w,h},n}(I);ar.prototype.bytesPerElement=4,tr("StructArrayLayout2ui4",ar);var Ye=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h){var _=this.length;return this.resize(_+1),this.emplace(_,h)},n.prototype.emplace=function(h,_){return this.uint16[1*h+0]=_,h},n}(I);Ye.prototype.bytesPerElement=2,tr("StructArrayLayout1ui2",Ye);var Ar=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},n.prototype.emplaceBack=function(h,_,w,C){var r=this.length;return this.resize(r+1),this.emplace(r,h,_,w,C)},n.prototype.emplace=function(h,_,w,C,r){var e=4*h;return this.float32[e+0]=_,this.float32[e+1]=w,this.float32[e+2]=C,this.float32[e+3]=r,h},n}(I);Ar.prototype.bytesPerElement=16,tr("StructArrayLayout4f16",Ar);var p=function(t){function n(){t.apply(this,arguments)}t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n;var h={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return h.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},h.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},h.x1.get=function(){return this._structArray.int16[this._pos2+2]},h.y1.get=function(){return this._structArray.int16[this._pos2+3]},h.x2.get=function(){return this._structArray.int16[this._pos2+4]},h.y2.get=function(){return this._structArray.int16[this._pos2+5]},h.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},h.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},h.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},h.anchorPoint.get=function(){return new F(this.anchorPointX,this.anchorPointY)},Object.defineProperties(n.prototype,h),n}(S);p.prototype.size=20;var m=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.get=function(h){return new p(this,h)},n}(Kt);tr("CollisionBoxArray",m);var d=function(t){function n(){t.apply(this,arguments)}t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n;var h={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return h.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},h.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},h.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},h.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},h.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},h.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},h.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},h.segment.get=function(){return this._structArray.uint16[this._pos2+10]},h.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},h.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},h.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},h.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},h.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},h.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},h.placedOrientation.set=function(_){this._structArray.uint8[this._pos1+37]=_},h.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},h.hidden.set=function(_){this._structArray.uint8[this._pos1+38]=_},h.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},h.crossTileID.set=function(_){this._structArray.uint32[this._pos4+10]=_},h.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(n.prototype,h),n}(S);d.prototype.size=48;var x=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.get=function(h){return new d(this,h)},n}(he);tr("PlacedSymbolArray",x);var A=function(t){function n(){t.apply(this,arguments)}t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n;var h={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return h.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},h.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},h.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},h.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},h.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},h.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},h.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},h.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},h.key.get=function(){return this._structArray.uint16[this._pos2+8]},h.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},h.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},h.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},h.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},h.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},h.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},h.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},h.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},h.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},h.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},h.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},h.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},h.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},h.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},h.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},h.crossTileID.set=function(_){this._structArray.uint32[this._pos4+12]=_},h.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},h.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},h.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},h.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(n.prototype,h),n}(S);A.prototype.size=68;var k=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.get=function(h){return new A(this,h)},n}(de);tr("SymbolInstanceArray",k);var R=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.getoffsetX=function(h){return this.float32[1*h+0]},n}(Pe);tr("GlyphOffsetArray",R);var j=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.getx=function(h){return this.int16[3*h+0]},n.prototype.gety=function(h){return this.int16[3*h+1]},n.prototype.gettileUnitDistanceFromAnchor=function(h){return this.int16[3*h+2]},n}(Re);tr("SymbolLineVertexArray",j);var K=function(t){function n(){t.apply(this,arguments)}t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n;var h={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return h.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},h.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},h.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(n.prototype,h),n}(S);K.prototype.size=8;var tt=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.get=function(h){return new K(this,h)},n}(ve);tr("FeatureIndexArray",tt);var ct=L([{name:"a_pos",components:2,type:"Int16"}],4).members,ft=function(t){t===void 0&&(t=[]),this.segments=t};function mt(t,n){return 256*(t=kt(Math.floor(t),0,255))+kt(Math.floor(n),0,255)}ft.prototype.prepareSegment=function(t,n,h,_){var w=this.segments[this.segments.length-1];return t>ft.MAX_VERTEX_ARRAY_LENGTH&&Be("Max vertices per segment is "+ft.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!w||w.vertexLength+t>ft.MAX_VERTEX_ARRAY_LENGTH||w.sortKey!==_)&&(w={vertexOffset:n.length,primitiveOffset:h.length,vertexLength:0,primitiveLength:0},_!==void 0&&(w.sortKey=_),this.segments.push(w)),w},ft.prototype.get=function(){return this.segments},ft.prototype.destroy=function(){for(var t=0,n=this.segments;t<n.length;t+=1){var h=n[t];for(var _ in h.vaos)h.vaos[_].destroy()}},ft.simpleSegment=function(t,n,h,_){return new ft([{vertexOffset:t,primitiveOffset:n,vertexLength:h,primitiveLength:_,vaos:{},sortKey:0}])},ft.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,tr("SegmentVector",ft);var Mt=L([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),At=u(function(t){t.exports=function(n,h){var _,w,C,r,e,s,f,y;for(w=n.length-(_=3&n.length),C=h,e=3432918353,s=461845907,y=0;y<w;)f=255&n.charCodeAt(y)|(255&n.charCodeAt(++y))<<8|(255&n.charCodeAt(++y))<<16|(255&n.charCodeAt(++y))<<24,++y,C=27492+(65535&(r=5*(65535&(C=(C^=f=(65535&(f=(f=(65535&f)*e+(((f>>>16)*e&65535)<<16)&4294967295)<<15|f>>>17))*s+(((f>>>16)*s&65535)<<16)&4294967295)<<13|C>>>19))+((5*(C>>>16)&65535)<<16)&4294967295))+((58964+(r>>>16)&65535)<<16);switch(f=0,_){case 3:f^=(255&n.charCodeAt(y+2))<<16;case 2:f^=(255&n.charCodeAt(y+1))<<8;case 1:C^=f=(65535&(f=(f=(65535&(f^=255&n.charCodeAt(y)))*e+(((f>>>16)*e&65535)<<16)&4294967295)<<15|f>>>17))*s+(((f>>>16)*s&65535)<<16)&4294967295}return C^=n.length,C=2246822507*(65535&(C^=C>>>16))+((2246822507*(C>>>16)&65535)<<16)&4294967295,C=3266489909*(65535&(C^=C>>>13))+((3266489909*(C>>>16)&65535)<<16)&4294967295,(C^=C>>>16)>>>0}}),Dt=u(function(t){t.exports=function(n,h){for(var _,w=n.length,C=h^w,r=0;w>=4;)_=1540483477*(65535&(_=255&n.charCodeAt(r)|(255&n.charCodeAt(++r))<<8|(255&n.charCodeAt(++r))<<16|(255&n.charCodeAt(++r))<<24))+((1540483477*(_>>>16)&65535)<<16),C=1540483477*(65535&C)+((1540483477*(C>>>16)&65535)<<16)^(_=1540483477*(65535&(_^=_>>>24))+((1540483477*(_>>>16)&65535)<<16)),w-=4,++r;switch(w){case 3:C^=(255&n.charCodeAt(r+2))<<16;case 2:C^=(255&n.charCodeAt(r+1))<<8;case 1:C=1540483477*(65535&(C^=255&n.charCodeAt(r)))+((1540483477*(C>>>16)&65535)<<16)}return C=1540483477*(65535&(C^=C>>>13))+((1540483477*(C>>>16)&65535)<<16),(C^=C>>>15)>>>0}}),xt=At,Rt=Dt;xt.murmur3=At,xt.murmur2=Rt;var Nt=function(){this.ids=[],this.positions=[],this.indexed=!1};Nt.prototype.add=function(t,n,h,_){this.ids.push(ne(t)),this.positions.push(n,h,_)},Nt.prototype.getPositions=function(t){for(var n=ne(t),h=0,_=this.ids.length-1;h<_;){var w=h+_>>1;this.ids[w]>=n?_=w:h=w+1}for(var C=[];this.ids[h]===n;)C.push({index:this.positions[3*h],start:this.positions[3*h+1],end:this.positions[3*h+2]}),h++;return C},Nt.serialize=function(t,n){var h=new Float64Array(t.ids),_=new Uint32Array(t.positions);return function w(C,r,e,s){for(;e<s;){for(var f=C[e+s>>1],y=e-1,b=s+1;;){do y++;while(C[y]<f);do b--;while(C[b]>f);if(y>=b)break;ae(C,y,b),ae(r,3*y,3*b),ae(r,3*y+1,3*b+1),ae(r,3*y+2,3*b+2)}b-e<s-b?(w(C,r,e,b),e=b+1):(w(C,r,b+1,s),s=b)}}(h,_,0,h.length-1),n&&n.push(h.buffer,_.buffer),{ids:h,positions:_}},Nt.deserialize=function(t){var n=new Nt;return n.ids=t.ids,n.positions=t.positions,n.indexed=!0,n};var Yt=Math.pow(2,53)-1;function ne(t){var n=+t;return!isNaN(n)&&n<=Yt?n:xt(String(t))}function ae(t,n,h){var _=t[n];t[n]=t[h],t[h]=_}tr("FeaturePositionMap",Nt);var le=function(t,n){this.gl=t.gl,this.location=n},xe=function(t){function n(h,_){t.call(this,h,_),this.current=0}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.set=function(h){this.current!==h&&(this.current=h,this.gl.uniform1i(this.location,h))},n}(le),ke=function(t){function n(h,_){t.call(this,h,_),this.current=0}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.set=function(h){this.current!==h&&(this.current=h,this.gl.uniform1f(this.location,h))},n}(le),Le=function(t){function n(h,_){t.call(this,h,_),this.current=[0,0]}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.set=function(h){h[0]===this.current[0]&&h[1]===this.current[1]||(this.current=h,this.gl.uniform2f(this.location,h[0],h[1]))},n}(le),$e=function(t){function n(h,_){t.call(this,h,_),this.current=[0,0,0]}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.set=function(h){h[0]===this.current[0]&&h[1]===this.current[1]&&h[2]===this.current[2]||(this.current=h,this.gl.uniform3f(this.location,h[0],h[1],h[2]))},n}(le),lr=function(t){function n(h,_){t.call(this,h,_),this.current=[0,0,0,0]}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.set=function(h){h[0]===this.current[0]&&h[1]===this.current[1]&&h[2]===this.current[2]&&h[3]===this.current[3]||(this.current=h,this.gl.uniform4f(this.location,h[0],h[1],h[2],h[3]))},n}(le),hr=function(t){function n(h,_){t.call(this,h,_),this.current=Sr.transparent}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.set=function(h){h.r===this.current.r&&h.g===this.current.g&&h.b===this.current.b&&h.a===this.current.a||(this.current=h,this.gl.uniform4f(this.location,h.r,h.g,h.b,h.a))},n}(le),sr=new Float32Array(16),Zr=function(t){function n(h,_){t.call(this,h,_),this.current=sr}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.set=function(h){if(h[12]!==this.current[12]||h[0]!==this.current[0])return this.current=h,void this.gl.uniformMatrix4fv(this.location,!1,h);for(var _=1;_<16;_++)if(h[_]!==this.current[_]){this.current=h,this.gl.uniformMatrix4fv(this.location,!1,h);break}},n}(le);function Qe(t){return[mt(255*t.r,255*t.g),mt(255*t.b,255*t.a)]}var Ir=function(t,n,h){this.value=t,this.uniformNames=n.map(function(_){return"u_"+_}),this.type=h};Ir.prototype.setUniform=function(t,n,h){t.set(h.constantOr(this.value))},Ir.prototype.getBinding=function(t,n,h){return this.type==="color"?new hr(t,n):new ke(t,n)};var jr=function(t,n){this.uniformNames=n.map(function(h){return"u_"+h}),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};jr.prototype.setConstantPatternPositions=function(t,n){this.pixelRatioFrom=n.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=n.tlbr,this.patternTo=t.tlbr},jr.prototype.setUniform=function(t,n,h,_){var w=_==="u_pattern_to"?this.patternTo:_==="u_pattern_from"?this.patternFrom:_==="u_pixel_ratio_to"?this.pixelRatioTo:_==="u_pixel_ratio_from"?this.pixelRatioFrom:null;w&&t.set(w)},jr.prototype.getBinding=function(t,n,h){return h.substr(0,9)==="u_pattern"?new lr(t,n):new ke(t,n)};var Er=function(t,n,h,_){this.expression=t,this.type=h,this.maxValue=0,this.paintVertexAttributes=n.map(function(w){return{name:"a_"+w,type:"Float32",components:h==="color"?2:1,offset:0}}),this.paintVertexArray=new _};Er.prototype.populatePaintArray=function(t,n,h,_,w){var C=this.paintVertexArray.length,r=this.expression.evaluate(new Oe(0),n,{},_,[],w);this.paintVertexArray.resize(t),this._setPaintValue(C,t,r)},Er.prototype.updatePaintArray=function(t,n,h,_){var w=this.expression.evaluate({zoom:0},h,_);this._setPaintValue(t,n,w)},Er.prototype._setPaintValue=function(t,n,h){if(this.type==="color")for(var _=Qe(h),w=t;w<n;w++)this.paintVertexArray.emplace(w,_[0],_[1]);else{for(var C=t;C<n;C++)this.paintVertexArray.emplace(C,h);this.maxValue=Math.max(this.maxValue,Math.abs(h))}},Er.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Er.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var vr=function(t,n,h,_,w,C){this.expression=t,this.uniformNames=n.map(function(r){return"u_"+r+"_t"}),this.type=h,this.useIntegerZoom=_,this.zoom=w,this.maxValue=0,this.paintVertexAttributes=n.map(function(r){return{name:"a_"+r,type:"Float32",components:h==="color"?4:2,offset:0}}),this.paintVertexArray=new C};vr.prototype.populatePaintArray=function(t,n,h,_,w){var C=this.expression.evaluate(new Oe(this.zoom),n,{},_,[],w),r=this.expression.evaluate(new Oe(this.zoom+1),n,{},_,[],w),e=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(e,t,C,r)},vr.prototype.updatePaintArray=function(t,n,h,_){var w=this.expression.evaluate({zoom:this.zoom},h,_),C=this.expression.evaluate({zoom:this.zoom+1},h,_);this._setPaintValue(t,n,w,C)},vr.prototype._setPaintValue=function(t,n,h,_){if(this.type==="color")for(var w=Qe(h),C=Qe(_),r=t;r<n;r++)this.paintVertexArray.emplace(r,w[0],w[1],C[0],C[1]);else{for(var e=t;e<n;e++)this.paintVertexArray.emplace(e,h,_);this.maxValue=Math.max(this.maxValue,Math.abs(h),Math.abs(_))}},vr.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},vr.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},vr.prototype.setUniform=function(t,n){var h=this.useIntegerZoom?Math.floor(n.zoom):n.zoom,_=kt(this.expression.interpolationFactor(h,this.zoom,this.zoom+1),0,1);t.set(_)},vr.prototype.getBinding=function(t,n,h){return new ke(t,n)};var Pr=function(t,n,h,_,w,C){this.expression=t,this.type=n,this.useIntegerZoom=h,this.zoom=_,this.layerId=C,this.zoomInPaintVertexArray=new w,this.zoomOutPaintVertexArray=new w};Pr.prototype.populatePaintArray=function(t,n,h){var _=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(_,t,n.patterns&&n.patterns[this.layerId],h)},Pr.prototype.updatePaintArray=function(t,n,h,_,w){this._setPaintValues(t,n,h.patterns&&h.patterns[this.layerId],w)},Pr.prototype._setPaintValues=function(t,n,h,_){if(_&&h){var w=_[h.min],C=_[h.mid],r=_[h.max];if(w&&C&&r)for(var e=t;e<n;e++)this.zoomInPaintVertexArray.emplace(e,C.tl[0],C.tl[1],C.br[0],C.br[1],w.tl[0],w.tl[1],w.br[0],w.br[1],C.pixelRatio,w.pixelRatio),this.zoomOutPaintVertexArray.emplace(e,C.tl[0],C.tl[1],C.br[0],C.br[1],r.tl[0],r.tl[1],r.br[0],r.br[1],C.pixelRatio,r.pixelRatio)}},Pr.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,Mt.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,Mt.members,this.expression.isStateDependent))},Pr.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var fr=function(t,n,h){this.binders={},this._buffers=[];var _=[];for(var w in t.paint._values)if(h(w)){var C=t.paint.get(w);if(C instanceof Jn&&ha(C.property.specification)){var r=Ui(w,t.type),e=C.value,s=C.property.specification.type,f=C.property.useIntegerZoom,y=C.property.specification["property-type"],b=y==="cross-faded"||y==="cross-faded-data-driven";if(e.kind==="constant")this.binders[w]=b?new jr(e.value,r):new Ir(e.value,r,s),_.push("/u_"+w);else if(e.kind==="source"||b){var E=tn(w,s,"source");this.binders[w]=b?new Pr(e,s,f,n,E,t.id):new Er(e,r,s,E),_.push("/a_"+w)}else{var M=tn(w,s,"composite");this.binders[w]=new vr(e,r,s,f,n,M),_.push("/z_"+w)}}}this.cacheKey=_.sort().join("")};fr.prototype.getMaxValue=function(t){var n=this.binders[t];return n instanceof Er||n instanceof vr?n.maxValue:0},fr.prototype.populatePaintArrays=function(t,n,h,_,w){for(var C in this.binders){var r=this.binders[C];(r instanceof Er||r instanceof vr||r instanceof Pr)&&r.populatePaintArray(t,n,h,_,w)}},fr.prototype.setConstantPatternPositions=function(t,n){for(var h in this.binders){var _=this.binders[h];_ instanceof jr&&_.setConstantPatternPositions(t,n)}},fr.prototype.updatePaintArrays=function(t,n,h,_,w){var C=!1;for(var r in t)for(var e=0,s=n.getPositions(r);e<s.length;e+=1){var f=s[e],y=h.feature(f.index);for(var b in this.binders){var E=this.binders[b];if((E instanceof Er||E instanceof vr||E instanceof Pr)&&E.expression.isStateDependent===!0){var M=_.paint.get(b);E.expression=M.value,E.updatePaintArray(f.start,f.end,y,t[r],w),C=!0}}}return C},fr.prototype.defines=function(){var t=[];for(var n in this.binders){var h=this.binders[n];(h instanceof Ir||h instanceof jr)&&t.push.apply(t,h.uniformNames.map(function(_){return"#define HAS_UNIFORM_"+_}))}return t},fr.prototype.getBinderAttributes=function(){var t=[];for(var n in this.binders){var h=this.binders[n];if(h instanceof Er||h instanceof vr)for(var _=0;_<h.paintVertexAttributes.length;_++)t.push(h.paintVertexAttributes[_].name);else if(h instanceof Pr)for(var w=0;w<Mt.members.length;w++)t.push(Mt.members[w].name)}return t},fr.prototype.getBinderUniforms=function(){var t=[];for(var n in this.binders){var h=this.binders[n];if(h instanceof Ir||h instanceof jr||h instanceof vr)for(var _=0,w=h.uniformNames;_<w.length;_+=1)t.push(w[_])}return t},fr.prototype.getPaintVertexBuffers=function(){return this._buffers},fr.prototype.getUniforms=function(t,n){var h=[];for(var _ in this.binders){var w=this.binders[_];if(w instanceof Ir||w instanceof jr||w instanceof vr)for(var C=0,r=w.uniformNames;C<r.length;C+=1){var e=r[C];if(n[e]){var s=w.getBinding(t,n[e],e);h.push({name:e,property:_,binding:s})}}}return h},fr.prototype.setUniforms=function(t,n,h,_){for(var w=0,C=n;w<C.length;w+=1){var r=C[w],e=r.name,s=r.property;this.binders[s].setUniform(r.binding,_,h.get(s),e)}},fr.prototype.updatePaintBuffers=function(t){for(var n in this._buffers=[],this.binders){var h=this.binders[n];if(t&&h instanceof Pr){var _=t.fromScale===2?h.zoomInPaintVertexBuffer:h.zoomOutPaintVertexBuffer;_&&this._buffers.push(_)}else(h instanceof Er||h instanceof vr)&&h.paintVertexBuffer&&this._buffers.push(h.paintVertexBuffer)}},fr.prototype.upload=function(t){for(var n in this.binders){var h=this.binders[n];(h instanceof Er||h instanceof vr||h instanceof Pr)&&h.upload(t)}this.updatePaintBuffers()},fr.prototype.destroy=function(){for(var t in this.binders){var n=this.binders[t];(n instanceof Er||n instanceof vr||n instanceof Pr)&&n.destroy()}};var cr=function(t,n,h){h===void 0&&(h=function(){return!0}),this.programConfigurations={};for(var _=0,w=t;_<w.length;_+=1){var C=w[_];this.programConfigurations[C.id]=new fr(C,n,h)}this.needsUpload=!1,this._featureMap=new Nt,this._bufferOffset=0};function Ui(t,n){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(n+"-","").replace(/-/g,"_")]}function tn(t,n,h){var _={color:{source:ut,composite:Ar},number:{source:Pe,composite:ut}},w=function(C){return{"line-pattern":{source:vt,composite:vt},"fill-pattern":{source:vt,composite:vt},"fill-extrusion-pattern":{source:vt,composite:vt}}[C]}(t);return w&&w[h]||_[n][h]}cr.prototype.populatePaintArrays=function(t,n,h,_,w,C){for(var r in this.programConfigurations)this.programConfigurations[r].populatePaintArrays(t,n,_,w,C);n.id!==void 0&&this._featureMap.add(n.id,h,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0},cr.prototype.updatePaintArrays=function(t,n,h,_){for(var w=0,C=h;w<C.length;w+=1){var r=C[w];this.needsUpload=this.programConfigurations[r.id].updatePaintArrays(t,this._featureMap,n,r,_)||this.needsUpload}},cr.prototype.get=function(t){return this.programConfigurations[t]},cr.prototype.upload=function(t){if(this.needsUpload){for(var n in this.programConfigurations)this.programConfigurations[n].upload(t);this.needsUpload=!1}},cr.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},tr("ConstantBinder",Ir),tr("CrossFadedConstantBinder",jr),tr("SourceExpressionBinder",Er),tr("CrossFadedCompositeBinder",Pr),tr("CompositeExpressionBinder",vr),tr("ProgramConfiguration",fr,{omit:["_buffers"]}),tr("ProgramConfigurationSet",cr);var hn=Math.pow(2,14)-1,jn=-hn-1;function Xi(t){for(var n=8192/t.extent,h=t.loadGeometry(),_=0;_<h.length;_++)for(var w=h[_],C=0;C<w.length;C++){var r=w[C],e=Math.round(r.x*n),s=Math.round(r.y*n);r.x=kt(e,jn,hn),r.y=kt(s,jn,hn),(e<r.x||e>r.x+1||s<r.y||s>r.y+1)&&Be("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return h}function Kr(t,n){return{type:t.type,id:t.id,properties:t.properties,geometry:n?Xi(t):[]}}function _o(t,n,h,_,w){t.emplaceBack(2*n+(_+1)/2,2*h+(w+1)/2)}var lo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(n){return n.id}),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new q,this.indexArray=new _e,this.segments=new ft,this.programConfigurations=new cr(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(function(n){return n.isStateDependent()}).map(function(n){return n.id})};function Vo(t,n){for(var h=0;h<t.length;h++)if(es(n,t[h]))return!0;for(var _=0;_<n.length;_++)if(es(t,n[_]))return!0;return!!au(t,n)}function Tn(t,n,h){return!!es(t,n)||!!Ps(n,t,h)}function Go(t,n){if(t.length===1)return Cl(n,t[0]);for(var h=0;h<n.length;h++)for(var _=n[h],w=0;w<_.length;w++)if(es(t,_[w]))return!0;for(var C=0;C<t.length;C++)if(Cl(n,t[C]))return!0;for(var r=0;r<n.length;r++)if(au(t,n[r]))return!0;return!1}function jo(t,n,h){if(t.length>1){if(au(t,n))return!0;for(var _=0;_<n.length;_++)if(Ps(n[_],t,h))return!0}for(var w=0;w<t.length;w++)if(Ps(t[w],n,h))return!0;return!1}function au(t,n){if(t.length===0||n.length===0)return!1;for(var h=0;h<t.length-1;h++)for(var _=t[h],w=t[h+1],C=0;C<n.length-1;C++)if(su(_,w,n[C],n[C+1]))return!0;return!1}function su(t,n,h,_){return qe(t,h,_)!==qe(n,h,_)&&qe(t,n,h)!==qe(t,n,_)}function Ps(t,n,h){var _=h*h;if(n.length===1)return t.distSqr(n[0])<_;for(var w=1;w<n.length;w++)if(lu(t,n[w-1],n[w])<_)return!0;return!1}function lu(t,n,h){var _=n.distSqr(h);if(_===0)return t.distSqr(n);var w=((t.x-n.x)*(h.x-n.x)+(t.y-n.y)*(h.y-n.y))/_;return t.distSqr(w<0?n:w>1?h:h.sub(n)._mult(w)._add(n))}function Cl(t,n){for(var h,_,w,C=!1,r=0;r<t.length;r++)for(var e=0,s=(h=t[r]).length-1;e<h.length;s=e++)(_=h[e]).y>n.y!=(w=h[s]).y>n.y&&n.x<(w.x-_.x)*(n.y-_.y)/(w.y-_.y)+_.x&&(C=!C);return C}function es(t,n){for(var h=!1,_=0,w=t.length-1;_<t.length;w=_++){var C=t[_],r=t[w];C.y>n.y!=r.y>n.y&&n.x<(r.x-C.x)*(n.y-C.y)/(r.y-C.y)+C.x&&(h=!h)}return h}function Al(t,n,h){var _=h[0],w=h[2];if(t.x<_.x&&n.x<_.x||t.x>w.x&&n.x>w.x||t.y<_.y&&n.y<_.y||t.y>w.y&&n.y>w.y)return!1;var C=qe(t,n,h[0]);return C!==qe(t,n,h[1])||C!==qe(t,n,h[2])||C!==qe(t,n,h[3])}function Da(t,n,h){var _=n.paint.get(t).value;return _.kind==="constant"?_.value:h.programConfigurations.get(n.id).getMaxValue(t)}function In(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function qo(t,n,h,_,w){if(!n[0]&&!n[1])return t;var C=F.convert(n)._mult(w);h==="viewport"&&C._rotate(-_);for(var r=[],e=0;e<t.length;e++)r.push(t[e].sub(C));return r}lo.prototype.populate=function(t,n,h){var _=this.layers[0],w=[],C=null;_.type==="circle"&&(C=_.layout.get("circle-sort-key"));for(var r=0,e=t;r<e.length;r+=1){var s=e[r],f=s.feature,y=s.id,b=s.index,E=s.sourceLayerIndex,M=this.layers[0]._featureFilter.needGeometry,z=Kr(f,M);if(this.layers[0]._featureFilter.filter(new Oe(this.zoom),z,h)){var O=C?C.evaluate(z,{},h):void 0,G={id:y,properties:f.properties,type:f.type,sourceLayerIndex:E,index:b,geometry:M?z.geometry:Xi(f),patterns:{},sortKey:O};w.push(G)}}C&&w.sort(function(Ut,jt){return Ut.sortKey-jt.sortKey});for(var V=0,W=w;V<W.length;V+=1){var Y=W[V],H=Y.geometry,ot=Y.index,ht=Y.sourceLayerIndex,Pt=t[ot].feature;this.addFeature(Y,H,ot,h),n.featureIndex.insert(Pt,H,ot,ht,this.index)}},lo.prototype.update=function(t,n,h){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,n,this.stateDependentLayers,h)},lo.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},lo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},lo.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ct),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},lo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},lo.prototype.addFeature=function(t,n,h,_){for(var w=0,C=n;w<C.length;w+=1)for(var r=0,e=C[w];r<e.length;r+=1){var s=e[r],f=s.x,y=s.y;if(!(f<0||f>=8192||y<0||y>=8192)){var b=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),E=b.vertexLength;_o(this.layoutVertexArray,f,y,-1,-1),_o(this.layoutVertexArray,f,y,1,-1),_o(this.layoutVertexArray,f,y,1,1),_o(this.layoutVertexArray,f,y,-1,1),this.indexArray.emplaceBack(E,E+1,E+2),this.indexArray.emplaceBack(E,E+3,E+2),b.vertexLength+=4,b.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,h,{},_)},tr("CircleBucket",lo,{omit:["layers"]});var Ys=new T({"circle-sort-key":new Ve(dt.layout_circle["circle-sort-key"])}),Oa={paint:new T({"circle-radius":new Ve(dt.paint_circle["circle-radius"]),"circle-color":new Ve(dt.paint_circle["circle-color"]),"circle-blur":new Ve(dt.paint_circle["circle-blur"]),"circle-opacity":new Ve(dt.paint_circle["circle-opacity"]),"circle-translate":new je(dt.paint_circle["circle-translate"]),"circle-translate-anchor":new je(dt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new je(dt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new je(dt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ve(dt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ve(dt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ve(dt.paint_circle["circle-stroke-opacity"])}),layout:Ys},ri=typeof Float32Array<"u"?Float32Array:Array;function vo(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Do(t,n,h){var _=n[0],w=n[1],C=n[2],r=n[3],e=n[4],s=n[5],f=n[6],y=n[7],b=n[8],E=n[9],M=n[10],z=n[11],O=n[12],G=n[13],V=n[14],W=n[15],Y=h[0],H=h[1],ot=h[2],ht=h[3];return t[0]=Y*_+H*e+ot*b+ht*O,t[1]=Y*w+H*s+ot*E+ht*G,t[2]=Y*C+H*f+ot*M+ht*V,t[3]=Y*r+H*y+ot*z+ht*W,t[4]=(Y=h[4])*_+(H=h[5])*e+(ot=h[6])*b+(ht=h[7])*O,t[5]=Y*w+H*s+ot*E+ht*G,t[6]=Y*C+H*f+ot*M+ht*V,t[7]=Y*r+H*y+ot*z+ht*W,t[8]=(Y=h[8])*_+(H=h[9])*e+(ot=h[10])*b+(ht=h[11])*O,t[9]=Y*w+H*s+ot*E+ht*G,t[10]=Y*C+H*f+ot*M+ht*V,t[11]=Y*r+H*y+ot*z+ht*W,t[12]=(Y=h[12])*_+(H=h[13])*e+(ot=h[14])*b+(ht=h[15])*O,t[13]=Y*w+H*s+ot*E+ht*G,t[14]=Y*C+H*f+ot*M+ht*V,t[15]=Y*r+H*y+ot*z+ht*W,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,n=0,h=arguments.length;h--;)n+=t[h]*t[h];return Math.sqrt(n)});var Pl,uu=Do;function cu(t,n,h){var _=n[0],w=n[1],C=n[2],r=n[3];return t[0]=h[0]*_+h[4]*w+h[8]*C+h[12]*r,t[1]=h[1]*_+h[5]*w+h[9]*C+h[13]*r,t[2]=h[2]*_+h[6]*w+h[10]*C+h[14]*r,t[3]=h[3]*_+h[7]*w+h[11]*C+h[15]*r,t}Pl=new ri(3),ri!=Float32Array&&(Pl[0]=0,Pl[1]=0,Pl[2]=0),function(){var t=new ri(4);ri!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var cp=(function(){var t=new ri(2);ri!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function n(h){t.call(this,h,Oa)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.createBucket=function(h){return new lo(h)},n.prototype.queryRadius=function(h){var _=h;return Da("circle-radius",this,_)+Da("circle-stroke-width",this,_)+In(this.paint.get("circle-translate"))},n.prototype.queryIntersectsFeature=function(h,_,w,C,r,e,s,f){for(var y=qo(h,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),e.angle,s),b=this.paint.get("circle-radius").evaluate(_,w)+this.paint.get("circle-stroke-width").evaluate(_,w),E=this.paint.get("circle-pitch-alignment")==="map",M=E?y:function(Pt,Ut){return Pt.map(function(jt){return Ms(jt,Ut)})}(y,f),z=E?b*s:b,O=0,G=C;O<G.length;O+=1)for(var V=0,W=G[O];V<W.length;V+=1){var Y=W[V],H=E?Y:Ms(Y,f),ot=z,ht=cu([],[Y.x,Y.y,0,1],f);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?ot*=ht[3]/e.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(ot*=e.cameraToCenterDistance/ht[3]),Tn(M,H,ot))return!0}return!1},n}(a));function Ms(t,n){var h=cu([],[t.x,t.y,0,1],n);return new F(h[0]/h[3],h[1]/h[3])}var hp=function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n}(lo);function Ls(t,n,h,_){var w=n.width,C=n.height;if(_){if(_ instanceof Uint8ClampedArray)_=new Uint8Array(_.buffer);else if(_.length!==w*C*h)throw new RangeError("mismatched image size")}else _=new Uint8Array(w*C*h);return t.width=w,t.height=C,t.data=_,t}function Ku(t,n,h){var _=n.width,w=n.height;if(_!==t.width||w!==t.height){var C=Ls({},{width:_,height:w},h);pp(t,C,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,_),height:Math.min(t.height,w)},h),t.width=_,t.height=w,t.data=C.data}}function pp(t,n,h,_,w,C){if(w.width===0||w.height===0)return n;if(w.width>t.width||w.height>t.height||h.x>t.width-w.width||h.y>t.height-w.height)throw new RangeError("out of range source coordinates for image copy");if(w.width>n.width||w.height>n.height||_.x>n.width-w.width||_.y>n.height-w.height)throw new RangeError("out of range destination coordinates for image copy");for(var r=t.data,e=n.data,s=0;s<w.height;s++)for(var f=((h.y+s)*t.width+h.x)*C,y=((_.y+s)*n.width+_.x)*C,b=0;b<w.width*C;b++)e[y+b]=r[f+b];return n}tr("HeatmapBucket",hp,{omit:["layers"]});var Yu=function(t,n){Ls(this,t,1,n)};Yu.prototype.resize=function(t){Ku(this,t,1)},Yu.prototype.clone=function(){return new Yu({width:this.width,height:this.height},new Uint8Array(this.data))},Yu.copy=function(t,n,h,_,w){pp(t,n,h,_,w,1)};var xo=function(t,n){Ls(this,t,4,n)};xo.prototype.resize=function(t){Ku(this,t,4)},xo.prototype.replace=function(t,n){n?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t},xo.prototype.clone=function(){return new xo({width:this.width,height:this.height},new Uint8Array(this.data))},xo.copy=function(t,n,h,_,w){pp(t,n,h,_,w,4)},tr("AlphaImage",Yu),tr("RGBAImage",xo);var Ad={paint:new T({"heatmap-radius":new Ve(dt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ve(dt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new je(dt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new so(dt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new je(dt.paint_heatmap["heatmap-opacity"])})};function fp(t){var n={},h=t.resolution||256,_=t.clips?t.clips.length:1,w=t.image||new xo({width:h,height:_}),C=function(z,O,G){n[t.evaluationKey]=G;var V=t.expression.evaluate(n);w.data[z+O+0]=Math.floor(255*V.r/V.a),w.data[z+O+1]=Math.floor(255*V.g/V.a),w.data[z+O+2]=Math.floor(255*V.b/V.a),w.data[z+O+3]=Math.floor(255*V.a)};if(t.clips)for(var r=0,e=0;r<_;++r,e+=4*h)for(var s=0,f=0;s<h;s++,f+=4){var y=s/(h-1),b=t.clips[r];C(e,f,b.start*(1-y)+b.end*y)}else for(var E=0,M=0;E<h;E++,M+=4)C(0,M,E/(h-1));return w}var wh=function(t){function n(h){t.call(this,h,Ad),this._updateColorRamp()}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.createBucket=function(h){return new hp(h)},n.prototype._handleSpecialPaintPropertyUpdate=function(h){h==="heatmap-color"&&this._updateColorRamp()},n.prototype._updateColorRamp=function(){this.colorRamp=fp({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},n.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},n.prototype.queryRadius=function(){return 0},n.prototype.queryIntersectsFeature=function(){return!1},n.prototype.hasOffscreenPass=function(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"},n}(a),Fa={paint:new T({"hillshade-illumination-direction":new je(dt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new je(dt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new je(dt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new je(dt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new je(dt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new je(dt.paint_hillshade["hillshade-accent-color"])})},Pd=function(t){function n(h){t.call(this,h,Fa)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.hasOffscreenPass=function(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"},n}(a),ng=L([{name:"a_pos",components:2,type:"Int16"}],4).members,af=kc,og=kc;function kc(t,n,h){h=h||2;var _,w,C,r,e,s,f,y=n&&n.length,b=y?n[0]*h:t.length,E=Eh(t,0,b,h,!0),M=[];if(!E||E.next===E.prev)return M;if(y&&(E=function(O,G,V,W){var Y,H,ot,ht=[];for(Y=0,H=G.length;Y<H;Y++)(ot=Eh(O,G[Y]*W,Y<H-1?G[Y+1]*W:O.length,W,!1))===ot.next&&(ot.steiner=!0),ht.push(lf(ot));for(ht.sort(ug),Y=0;Y<ht.length;Y++)cg(ht[Y],V),V=Ml(V,V.next);return V}(t,n,E,h)),t.length>80*h){_=C=t[0],w=r=t[1];for(var z=h;z<b;z+=h)(e=t[z])<_&&(_=e),(s=t[z+1])<w&&(w=s),e>C&&(C=e),s>r&&(r=s);f=(f=Math.max(C-_,r-w))!==0?1/f:0}return rs(E,M,h,_,w,f),M}function Eh(t,n,h,_,w){var C,r;if(w===Ch(t,n,h,_)>0)for(C=n;C<h;C+=_)r=uf(C,t[C],t[C+1],r);else for(C=h-_;C>=n;C-=_)r=uf(C,t[C],t[C+1],r);return r&&on(r,r.next)&&(Oc(r),r=r.next),r}function Ml(t,n){if(!t)return t;n||(n=t);var h,_=t;do if(h=!1,_.steiner||!on(_,_.next)&&Cn(_.prev,_,_.next)!==0)_=_.next;else{if(Oc(_),(_=n=_.prev)===_.next)break;h=!0}while(h||_!==n);return n}function rs(t,n,h,_,w,C,r){if(t){!r&&C&&function(y,b,E,M){var z=y;do z.z===null&&(z.z=sf(z.x,z.y,b,E,M)),z.prevZ=z.prev,z.nextZ=z.next,z=z.next;while(z!==y);z.prevZ.nextZ=null,z.prevZ=null,function(O){var G,V,W,Y,H,ot,ht,Pt,Ut=1;do{for(V=O,O=null,H=null,ot=0;V;){for(ot++,W=V,ht=0,G=0;G<Ut&&(ht++,W=W.nextZ);G++);for(Pt=Ut;ht>0||Pt>0&&W;)ht!==0&&(Pt===0||!W||V.z<=W.z)?(Y=V,V=V.nextZ,ht--):(Y=W,W=W.nextZ,Pt--),H?H.nextZ=Y:O=Y,Y.prevZ=H,H=Y;V=W}H.nextZ=null,Ut*=2}while(ot>1)}(z)}(t,_,w,C);for(var e,s,f=t;t.prev!==t.next;)if(e=t.prev,s=t.next,C?ag(t,_,w,C):Sh(t))n.push(e.i/h),n.push(t.i/h),n.push(s.i/h),Oc(t),t=s.next,f=s.next;else if((t=s)===f){r?r===1?rs(t=sg(Ml(t),n,h),n,h,_,w,C,2):r===2&&lg(t,n,h,_,w,C):rs(Ml(t),n,h,_,w,C,1);break}}}function Sh(t){var n=t.prev,h=t,_=t.next;if(Cn(n,h,_)>=0)return!1;for(var w=t.next.next;w!==t.prev;){if(zc(n.x,n.y,h.x,h.y,_.x,_.y,w.x,w.y)&&Cn(w.prev,w,w.next)>=0)return!1;w=w.next}return!0}function ag(t,n,h,_){var w=t.prev,C=t,r=t.next;if(Cn(w,C,r)>=0)return!1;for(var e=w.x>C.x?w.x>r.x?w.x:r.x:C.x>r.x?C.x:r.x,s=w.y>C.y?w.y>r.y?w.y:r.y:C.y>r.y?C.y:r.y,f=sf(w.x<C.x?w.x<r.x?w.x:r.x:C.x<r.x?C.x:r.x,w.y<C.y?w.y<r.y?w.y:r.y:C.y<r.y?C.y:r.y,n,h,_),y=sf(e,s,n,h,_),b=t.prevZ,E=t.nextZ;b&&b.z>=f&&E&&E.z<=y;){if(b!==t.prev&&b!==t.next&&zc(w.x,w.y,C.x,C.y,r.x,r.y,b.x,b.y)&&Cn(b.prev,b,b.next)>=0||(b=b.prevZ,E!==t.prev&&E!==t.next&&zc(w.x,w.y,C.x,C.y,r.x,r.y,E.x,E.y)&&Cn(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;b&&b.z>=f;){if(b!==t.prev&&b!==t.next&&zc(w.x,w.y,C.x,C.y,r.x,r.y,b.x,b.y)&&Cn(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;E&&E.z<=y;){if(E!==t.prev&&E!==t.next&&zc(w.x,w.y,C.x,C.y,r.x,r.y,E.x,E.y)&&Cn(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function sg(t,n,h){var _=t;do{var w=_.prev,C=_.next.next;!on(w,C)&&Th(w,_,_.next,C)&&hu(w,C)&&hu(C,w)&&(n.push(w.i/h),n.push(_.i/h),n.push(C.i/h),Oc(_),Oc(_.next),_=t=C),_=_.next}while(_!==t);return Ml(_)}function lg(t,n,h,_,w,C){var r=t;do{for(var e=r.next.next;e!==r.prev;){if(r.i!==e.i&&Rc(r,e)){var s=Dc(r,e);return r=Ml(r,r.next),s=Ml(s,s.next),rs(r,n,h,_,w,C),void rs(s,n,h,_,w,C)}e=e.next}r=r.next}while(r!==t)}function ug(t,n){return t.x-n.x}function cg(t,n){if(n=function(_,w){var C,r=w,e=_.x,s=_.y,f=-1/0;do{if(s<=r.y&&s>=r.next.y&&r.next.y!==r.y){var y=r.x+(s-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(y<=e&&y>f){if(f=y,y===e){if(s===r.y)return r;if(s===r.next.y)return r.next}C=r.x<r.next.x?r:r.next}}r=r.next}while(r!==w);if(!C)return null;if(e===f)return C;var b,E=C,M=C.x,z=C.y,O=1/0;r=C;do e>=r.x&&r.x>=M&&e!==r.x&&zc(s<z?e:f,s,M,z,s<z?f:e,s,r.x,r.y)&&(b=Math.abs(s-r.y)/(e-r.x),hu(r,_)&&(b<O||b===O&&(r.x>C.x||r.x===C.x&&hg(C,r)))&&(C=r,O=b)),r=r.next;while(r!==E);return C}(t,n)){var h=Dc(n,t);Ml(n,n.next),Ml(h,h.next)}}function hg(t,n){return Cn(t.prev,t,n.prev)<0&&Cn(n.next,t,t.next)<0}function sf(t,n,h,_,w){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-h)*w)|t<<8))|t<<4))|t<<2))|t<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-_)*w)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function lf(t){var n=t,h=t;do(n.x<h.x||n.x===h.x&&n.y<h.y)&&(h=n),n=n.next;while(n!==t);return h}function zc(t,n,h,_,w,C,r,e){return(w-r)*(n-e)-(t-r)*(C-e)>=0&&(t-r)*(_-e)-(h-r)*(n-e)>=0&&(h-r)*(C-e)-(w-r)*(_-e)>=0}function Rc(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!function(h,_){var w=h;do{if(w.i!==h.i&&w.next.i!==h.i&&w.i!==_.i&&w.next.i!==_.i&&Th(w,w.next,h,_))return!0;w=w.next}while(w!==h);return!1}(t,n)&&(hu(t,n)&&hu(n,t)&&function(h,_){var w=h,C=!1,r=(h.x+_.x)/2,e=(h.y+_.y)/2;do w.y>e!=w.next.y>e&&w.next.y!==w.y&&r<(w.next.x-w.x)*(e-w.y)/(w.next.y-w.y)+w.x&&(C=!C),w=w.next;while(w!==h);return C}(t,n)&&(Cn(t.prev,t,n.prev)||Cn(t,n.prev,n))||on(t,n)&&Cn(t.prev,t,t.next)>0&&Cn(n.prev,n,n.next)>0)}function Cn(t,n,h){return(n.y-t.y)*(h.x-n.x)-(n.x-t.x)*(h.y-n.y)}function on(t,n){return t.x===n.x&&t.y===n.y}function Th(t,n,h,_){var w=Hu(Cn(t,n,h)),C=Hu(Cn(t,n,_)),r=Hu(Cn(h,_,t)),e=Hu(Cn(h,_,n));return w!==C&&r!==e||!(w!==0||!Ih(t,h,n))||!(C!==0||!Ih(t,_,n))||!(r!==0||!Ih(h,t,_))||!(e!==0||!Ih(h,n,_))}function Ih(t,n,h){return n.x<=Math.max(t.x,h.x)&&n.x>=Math.min(t.x,h.x)&&n.y<=Math.max(t.y,h.y)&&n.y>=Math.min(t.y,h.y)}function Hu(t){return t>0?1:t<0?-1:0}function hu(t,n){return Cn(t.prev,t,t.next)<0?Cn(t,n,t.next)>=0&&Cn(t,t.prev,n)>=0:Cn(t,n,t.prev)<0||Cn(t,t.next,n)<0}function Dc(t,n){var h=new Ju(t.i,t.x,t.y),_=new Ju(n.i,n.x,n.y),w=t.next,C=n.prev;return t.next=n,n.prev=t,h.next=w,w.prev=h,_.next=h,h.prev=_,C.next=_,_.prev=C,_}function uf(t,n,h,_){var w=new Ju(t,n,h);return _?(w.next=_.next,w.prev=_,_.next.prev=w,_.next=w):(w.prev=w,w.next=w),w}function Oc(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ju(t,n,h){this.i=t,this.x=n,this.y=h,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Ch(t,n,h,_){for(var w=0,C=n,r=h-_;C<h;C+=_)w+=(t[r]-t[C])*(t[C+1]+t[r+1]),r=C;return w}function cf(t,n,h,_,w){(function C(r,e,s,f,y){for(;f>s;){if(f-s>600){var b=f-s+1,E=e-s+1,M=Math.log(b),z=.5*Math.exp(2*M/3),O=.5*Math.sqrt(M*z*(b-z)/b)*(E-b/2<0?-1:1);C(r,e,Math.max(s,Math.floor(e-E*z/b+O)),Math.min(f,Math.floor(e+(b-E)*z/b+O)),y)}var G=r[e],V=s,W=f;for(Fc(r,s,e),y(r[f],G)>0&&Fc(r,s,f);V<W;){for(Fc(r,V,W),V++,W--;y(r[V],G)<0;)V++;for(;y(r[W],G)>0;)W--}y(r[s],G)===0?Fc(r,s,W):Fc(r,++W,f),W<=e&&(s=W+1),e<=W&&(f=W-1)}})(t,n,h||0,_||t.length-1,w||pg)}function Fc(t,n,h){var _=t[n];t[n]=t[h],t[h]=_}function pg(t,n){return t<n?-1:t>n?1:0}function dp(t,n){var h=t.length;if(h<=1)return[t];for(var _,w,C=[],r=0;r<h;r++){var e=rr(t[r]);e!==0&&(t[r].area=Math.abs(e),w===void 0&&(w=e<0),w===e<0?(_&&C.push(_),_=[t[r]]):_.push(t[r]))}if(_&&C.push(_),n>1)for(var s=0;s<C.length;s++)C[s].length<=n||(cf(C[s],n,1,C[s].length-1,Ah),C[s]=C[s].slice(0,n));return C}function Ah(t,n){return n.area-t.area}function hf(t,n,h){for(var _=h.patternDependencies,w=!1,C=0,r=n;C<r.length;C+=1){var e=r[C].paint.get(t+"-pattern");e.isConstant()||(w=!0);var s=e.constantOr(null);s&&(w=!0,_[s.to]=!0,_[s.from]=!0)}return w}function Ph(t,n,h,_,w){for(var C=w.patternDependencies,r=0,e=n;r<e.length;r+=1){var s=e[r],f=s.paint.get(t+"-pattern").value;if(f.kind!=="constant"){var y=f.evaluate({zoom:_-1},h,{},w.availableImages),b=f.evaluate({zoom:_},h,{},w.availableImages),E=f.evaluate({zoom:_+1},h,{},w.availableImages);b=b&&b.name?b.name:b,E=E&&E.name?E.name:E,C[y=y&&y.name?y.name:y]=!0,C[b]=!0,C[E]=!0,h.patterns[s.id]={min:y,mid:b,max:E}}}return h}kc.deviation=function(t,n,h,_){var w=n&&n.length,C=Math.abs(Ch(t,0,w?n[0]*h:t.length,h));if(w)for(var r=0,e=n.length;r<e;r++)C-=Math.abs(Ch(t,n[r]*h,r<e-1?n[r+1]*h:t.length,h));var s=0;for(r=0;r<_.length;r+=3){var f=_[r]*h,y=_[r+1]*h,b=_[r+2]*h;s+=Math.abs((t[f]-t[b])*(t[y+1]-t[f+1])-(t[f]-t[y])*(t[b+1]-t[f+1]))}return C===0&&s===0?0:Math.abs((s-C)/C)},kc.flatten=function(t){for(var n=t[0][0].length,h={vertices:[],holes:[],dimensions:n},_=0,w=0;w<t.length;w++){for(var C=0;C<t[w].length;C++)for(var r=0;r<n;r++)h.vertices.push(t[w][C][r]);w>0&&h.holes.push(_+=t[w-1].length)}return h},af.default=og;var ks=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(n){return n.id}),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new q,this.indexArray=new _e,this.indexArray2=new ar,this.programConfigurations=new cr(t.layers,t.zoom),this.segments=new ft,this.segments2=new ft,this.stateDependentLayerIds=this.layers.filter(function(n){return n.isStateDependent()}).map(function(n){return n.id})};ks.prototype.populate=function(t,n,h){this.hasPattern=hf("fill",this.layers,n);for(var _=this.layers[0].layout.get("fill-sort-key"),w=[],C=0,r=t;C<r.length;C+=1){var e=r[C],s=e.feature,f=e.id,y=e.index,b=e.sourceLayerIndex,E=this.layers[0]._featureFilter.needGeometry,M=Kr(s,E);if(this.layers[0]._featureFilter.filter(new Oe(this.zoom),M,h)){var z=_?_.evaluate(M,{},h,n.availableImages):void 0,O={id:f,properties:s.properties,type:s.type,sourceLayerIndex:b,index:y,geometry:E?M.geometry:Xi(s),patterns:{},sortKey:z};w.push(O)}}_&&w.sort(function(Pt,Ut){return Pt.sortKey-Ut.sortKey});for(var G=0,V=w;G<V.length;G+=1){var W=V[G],Y=W.geometry,H=W.index,ot=W.sourceLayerIndex;if(this.hasPattern){var ht=Ph("fill",this.layers,W,this.zoom,n);this.patternFeatures.push(ht)}else this.addFeature(W,Y,H,h,{});n.featureIndex.insert(t[H].feature,Y,H,ot,this.index)}},ks.prototype.update=function(t,n,h){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,n,this.stateDependentLayers,h)},ks.prototype.addFeatures=function(t,n,h){for(var _=0,w=this.patternFeatures;_<w.length;_+=1){var C=w[_];this.addFeature(C,C.geometry,C.index,n,h)}},ks.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},ks.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ks.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ng),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},ks.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},ks.prototype.addFeature=function(t,n,h,_,w){for(var C=0,r=dp(n,500);C<r.length;C+=1){for(var e=r[C],s=0,f=0,y=e;f<y.length;f+=1)s+=y[f].length;for(var b=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray),E=b.vertexLength,M=[],z=[],O=0,G=e;O<G.length;O+=1){var V=G[O];if(V.length!==0){V!==e[0]&&z.push(M.length/2);var W=this.segments2.prepareSegment(V.length,this.layoutVertexArray,this.indexArray2),Y=W.vertexLength;this.layoutVertexArray.emplaceBack(V[0].x,V[0].y),this.indexArray2.emplaceBack(Y+V.length-1,Y),M.push(V[0].x),M.push(V[0].y);for(var H=1;H<V.length;H++)this.layoutVertexArray.emplaceBack(V[H].x,V[H].y),this.indexArray2.emplaceBack(Y+H-1,Y+H),M.push(V[H].x),M.push(V[H].y);W.vertexLength+=V.length,W.primitiveLength+=V.length}}for(var ot=af(M,z),ht=0;ht<ot.length;ht+=3)this.indexArray.emplaceBack(E+ot[ht],E+ot[ht+1],E+ot[ht+2]);b.vertexLength+=s,b.primitiveLength+=ot.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,h,w,_)},tr("FillBucket",ks,{omit:["layers","patternFeatures"]});var pf=new T({"fill-sort-key":new Ve(dt.layout_fill["fill-sort-key"])}),ff={paint:new T({"fill-antialias":new je(dt.paint_fill["fill-antialias"]),"fill-opacity":new Ve(dt.paint_fill["fill-opacity"]),"fill-color":new Ve(dt.paint_fill["fill-color"]),"fill-outline-color":new Ve(dt.paint_fill["fill-outline-color"]),"fill-translate":new je(dt.paint_fill["fill-translate"]),"fill-translate-anchor":new je(dt.paint_fill["fill-translate-anchor"]),"fill-pattern":new Il(dt.paint_fill["fill-pattern"])}),layout:pf},df=function(t){function n(h){t.call(this,h,ff)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.recalculate=function(h,_){t.prototype.recalculate.call(this,h,_);var w=this.paint._values["fill-outline-color"];w.value.kind==="constant"&&w.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},n.prototype.createBucket=function(h){return new ks(h)},n.prototype.queryRadius=function(){return In(this.paint.get("fill-translate"))},n.prototype.queryIntersectsFeature=function(h,_,w,C,r,e,s){return Go(qo(h,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),e.angle,s),C)},n.prototype.isTileClipped=function(){return!0},n}(a),fg=L([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,Md=Bc;function Bc(t,n,h,_,w){this.properties={},this.extent=h,this.type=0,this._pbf=t,this._geometry=-1,this._keys=_,this._values=w,t.readFields(dg,this,n)}function dg(t,n,h){t==1?n.id=h.readVarint():t==2?function(_,w){for(var C=_.readVarint()+_.pos;_.pos<C;){var r=w._keys[_.readVarint()],e=w._values[_.readVarint()];w.properties[r]=e}}(h,n):t==3?n.type=h.readVarint():t==4&&(n._geometry=h.pos)}function pu(t){for(var n,h,_=0,w=0,C=t.length,r=C-1;w<C;r=w++)_+=((h=t[r]).x-(n=t[w]).x)*(n.y+h.y);return _}Bc.types=["Unknown","Point","LineString","Polygon"],Bc.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var n,h=t.readVarint()+t.pos,_=1,w=0,C=0,r=0,e=[];t.pos<h;){if(w<=0){var s=t.readVarint();_=7&s,w=s>>3}if(w--,_===1||_===2)C+=t.readSVarint(),r+=t.readSVarint(),_===1&&(n&&e.push(n),n=[]),n.push(new F(C,r));else{if(_!==7)throw new Error("unknown command "+_);n&&n.push(n[0].clone())}}return n&&e.push(n),e},Bc.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var n=t.readVarint()+t.pos,h=1,_=0,w=0,C=0,r=1/0,e=-1/0,s=1/0,f=-1/0;t.pos<n;){if(_<=0){var y=t.readVarint();h=7&y,_=y>>3}if(_--,h===1||h===2)(w+=t.readSVarint())<r&&(r=w),w>e&&(e=w),(C+=t.readSVarint())<s&&(s=C),C>f&&(f=C);else if(h!==7)throw new Error("unknown command "+h)}return[r,s,e,f]},Bc.prototype.toGeoJSON=function(t,n,h){var _,w,C=this.extent*Math.pow(2,h),r=this.extent*t,e=this.extent*n,s=this.loadGeometry(),f=Bc.types[this.type];function y(M){for(var z=0;z<M.length;z++){var O=M[z];M[z]=[360*(O.x+r)/C-180,360/Math.PI*Math.atan(Math.exp((180-360*(O.y+e)/C)*Math.PI/180))-90]}}switch(this.type){case 1:var b=[];for(_=0;_<s.length;_++)b[_]=s[_][0];y(s=b);break;case 2:for(_=0;_<s.length;_++)y(s[_]);break;case 3:for(s=function(M){var z=M.length;if(z<=1)return[M];for(var O,G,V=[],W=0;W<z;W++){var Y=pu(M[W]);Y!==0&&(G===void 0&&(G=Y<0),G===Y<0?(O&&V.push(O),O=[M[W]]):O.push(M[W]))}return O&&V.push(O),V}(s),_=0;_<s.length;_++)for(w=0;w<s[_].length;w++)y(s[_][w])}s.length===1?s=s[0]:f="Multi"+f;var E={type:"Feature",geometry:{type:f,coordinates:s},properties:this.properties};return"id"in this&&(E.id=this.id),E};var Ld=mf;function mf(t,n){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(Uc,this,n),this.length=this._features.length}function Uc(t,n,h){t===15?n.version=h.readVarint():t===1?n.name=h.readString():t===5?n.extent=h.readVarint():t===2?n._features.push(h.pos):t===3?n._keys.push(h.readString()):t===4&&n._values.push(function(_){for(var w=null,C=_.readVarint()+_.pos;_.pos<C;){var r=_.readVarint()>>3;w=r===1?_.readString():r===2?_.readFloat():r===3?_.readDouble():r===4?_.readVarint64():r===5?_.readVarint():r===6?_.readSVarint():r===7?_.readBoolean():null}return w}(h))}function mg(t,n,h){if(t===3){var _=new Ld(h,h.readVarint()+h.pos);_.length&&(n[_.name]=_)}}mf.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var n=this._pbf.readVarint()+this._pbf.pos;return new Md(this._pbf,n,this.extent,this._keys,this._values)};var Nc={VectorTile:function(t,n){this.layers=t.readFields(mg,{},n)},VectorTileFeature:Md,VectorTileLayer:Ld},gg=Nc.VectorTileFeature.types,mp=Math.pow(2,13);function Vc(t,n,h,_,w,C,r,e){t.emplaceBack(n,h,2*Math.floor(_*mp)+r,w*mp*2,C*mp*2,Math.round(e))}var zs=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(n){return n.id}),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new J,this.indexArray=new _e,this.programConfigurations=new cr(t.layers,t.zoom),this.segments=new ft,this.stateDependentLayerIds=this.layers.filter(function(n){return n.isStateDependent()}).map(function(n){return n.id})};function yg(t,n){return t.x===n.x&&(t.x<0||t.x>8192)||t.y===n.y&&(t.y<0||t.y>8192)}zs.prototype.populate=function(t,n,h){this.features=[],this.hasPattern=hf("fill-extrusion",this.layers,n);for(var _=0,w=t;_<w.length;_+=1){var C=w[_],r=C.feature,e=C.id,s=C.index,f=C.sourceLayerIndex,y=this.layers[0]._featureFilter.needGeometry,b=Kr(r,y);if(this.layers[0]._featureFilter.filter(new Oe(this.zoom),b,h)){var E={id:e,sourceLayerIndex:f,index:s,geometry:y?b.geometry:Xi(r),properties:r.properties,type:r.type,patterns:{}};this.hasPattern?this.features.push(Ph("fill-extrusion",this.layers,E,this.zoom,n)):this.addFeature(E,E.geometry,s,h,{}),n.featureIndex.insert(r,E.geometry,s,f,this.index,!0)}}},zs.prototype.addFeatures=function(t,n,h){for(var _=0,w=this.features;_<w.length;_+=1){var C=w[_];this.addFeature(C,C.geometry,C.index,n,h)}},zs.prototype.update=function(t,n,h){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,n,this.stateDependentLayers,h)},zs.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},zs.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},zs.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,fg),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},zs.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},zs.prototype.addFeature=function(t,n,h,_,w){for(var C=0,r=dp(n,500);C<r.length;C+=1){for(var e=r[C],s=0,f=0,y=e;f<y.length;f+=1)s+=y[f].length;for(var b=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),E=0,M=e;E<M.length;E+=1){var z=M[E];if(z.length!==0&&!((we=z).every(function(me){return me.x<0})||we.every(function(me){return me.x>8192})||we.every(function(me){return me.y<0})||we.every(function(me){return me.y>8192})))for(var O=0,G=0;G<z.length;G++){var V=z[G];if(G>=1){var W=z[G-1];if(!yg(V,W)){b.vertexLength+4>ft.MAX_VERTEX_ARRAY_LENGTH&&(b=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var Y=V.sub(W)._perp()._unit(),H=W.dist(V);O+H>32768&&(O=0),Vc(this.layoutVertexArray,V.x,V.y,Y.x,Y.y,0,0,O),Vc(this.layoutVertexArray,V.x,V.y,Y.x,Y.y,0,1,O),Vc(this.layoutVertexArray,W.x,W.y,Y.x,Y.y,0,0,O+=H),Vc(this.layoutVertexArray,W.x,W.y,Y.x,Y.y,0,1,O);var ot=b.vertexLength;this.indexArray.emplaceBack(ot,ot+2,ot+1),this.indexArray.emplaceBack(ot+1,ot+2,ot+3),b.vertexLength+=4,b.primitiveLength+=2}}}}if(b.vertexLength+s>ft.MAX_VERTEX_ARRAY_LENGTH&&(b=this.segments.prepareSegment(s,this.layoutVertexArray,this.indexArray)),gg[t.type]==="Polygon"){for(var ht=[],Pt=[],Ut=b.vertexLength,jt=0,qt=e;jt<qt.length;jt+=1){var re=qt[jt];if(re.length!==0){re!==e[0]&&Pt.push(ht.length/2);for(var Xt=0;Xt<re.length;Xt++){var Te=re[Xt];Vc(this.layoutVertexArray,Te.x,Te.y,0,0,1,1,0),ht.push(Te.x),ht.push(Te.y)}}}for(var Ee=af(ht,Pt),ue=0;ue<Ee.length;ue+=3)this.indexArray.emplaceBack(Ut+Ee[ue],Ut+Ee[ue+2],Ut+Ee[ue+1]);b.primitiveLength+=Ee.length/3,b.vertexLength+=s}}var we;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,h,w,_)},tr("FillExtrusionBucket",zs,{omit:["layers","features"]});var _g={paint:new T({"fill-extrusion-opacity":new je(dt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ve(dt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new je(dt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new je(dt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Il(dt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ve(dt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ve(dt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new je(dt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},vg=function(t){function n(h){t.call(this,h,_g)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.createBucket=function(h){return new zs(h)},n.prototype.queryRadius=function(){return In(this.paint.get("fill-extrusion-translate"))},n.prototype.is3D=function(){return!0},n.prototype.queryIntersectsFeature=function(h,_,w,C,r,e,s,f){var y=qo(h,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),e.angle,s),b=this.paint.get("fill-extrusion-height").evaluate(_,w),E=this.paint.get("fill-extrusion-base").evaluate(_,w),M=function(O,G,V,W){for(var Y=[],H=0,ot=O;H<ot.length;H+=1){var ht=ot[H],Pt=[ht.x,ht.y,0,1];cu(Pt,Pt,G),Y.push(new F(Pt[0]/Pt[3],Pt[1]/Pt[3]))}return Y}(y,f),z=function(O,G,V,W){for(var Y=[],H=[],ot=W[8]*G,ht=W[9]*G,Pt=W[10]*G,Ut=W[11]*G,jt=W[8]*V,qt=W[9]*V,re=W[10]*V,Xt=W[11]*V,Te=0,Ee=O;Te<Ee.length;Te+=1){for(var ue=[],we=[],me=0,Ae=Ee[Te];me<Ae.length;me+=1){var pe=Ae[me],ge=pe.x,He=pe.y,Ke=W[0]*ge+W[4]*He+W[12],gr=W[1]*ge+W[5]*He+W[13],wr=W[2]*ge+W[6]*He+W[14],Nr=W[3]*ge+W[7]*He+W[15],Xr=wr+Pt,li=Nr+Ut,ui=Ke+jt,Jr=gr+qt,di=wr+re,Qr=Nr+Xt,mi=new F((Ke+ot)/li,(gr+ht)/li);mi.z=Xr/li,ue.push(mi);var Cr=new F(ui/Qr,Jr/Qr);Cr.z=di/Qr,we.push(Cr)}Y.push(ue),H.push(we)}return[Y,H]}(C,E,b,f);return function(O,G,V){var W=1/0;Go(V,G)&&(W=Gc(V,G[0]));for(var Y=0;Y<G.length;Y++)for(var H=G[Y],ot=O[Y],ht=0;ht<H.length-1;ht++){var Pt=H[ht],Ut=[Pt,H[ht+1],ot[ht+1],ot[ht],Pt];Vo(V,Ut)&&(W=Math.min(W,Gc(V,Ut)))}return W!==1/0&&W}(z[0],z[1],M)},n}(a);function Qu(t,n){return t.x*n.x+t.y*n.y}function Gc(t,n){if(t.length===1){for(var h,_=0,w=n[_++];!h||w.equals(h);)if(!(h=n[_++]))return 1/0;for(;_<n.length;_++){var C=n[_],r=t[0],e=h.sub(w),s=C.sub(w),f=r.sub(w),y=Qu(e,e),b=Qu(e,s),E=Qu(s,s),M=Qu(f,e),z=Qu(f,s),O=y*E-b*b,G=(E*M-b*z)/O,V=(y*z-b*M)/O,W=w.z*(1-G-V)+h.z*G+C.z*V;if(isFinite(W))return W}return 1/0}for(var Y=1/0,H=0,ot=n;H<ot.length;H+=1)Y=Math.min(Y,ot[H].z);return Y}var gf=L([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,xg=L([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,bg=Nc.VectorTileFeature.types,wg=Math.cos(Math.PI/180*37.5),jc=Math.pow(2,14)/.5,bo=function(t){var n=this;this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(h){return h.id}),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(function(h){n.gradients[h.id]={}}),this.layoutVertexArray=new et,this.layoutVertexArray2=new ut,this.indexArray=new _e,this.programConfigurations=new cr(t.layers,t.zoom),this.segments=new ft,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(function(h){return h.isStateDependent()}).map(function(h){return h.id})};bo.prototype.populate=function(t,n,h){this.hasPattern=hf("line",this.layers,n);for(var _=this.layers[0].layout.get("line-sort-key"),w=[],C=0,r=t;C<r.length;C+=1){var e=r[C],s=e.feature,f=e.id,y=e.index,b=e.sourceLayerIndex,E=this.layers[0]._featureFilter.needGeometry,M=Kr(s,E);if(this.layers[0]._featureFilter.filter(new Oe(this.zoom),M,h)){var z=_?_.evaluate(M,{},h):void 0,O={id:f,properties:s.properties,type:s.type,sourceLayerIndex:b,index:y,geometry:E?M.geometry:Xi(s),patterns:{},sortKey:z};w.push(O)}}_&&w.sort(function(Pt,Ut){return Pt.sortKey-Ut.sortKey});for(var G=0,V=w;G<V.length;G+=1){var W=V[G],Y=W.geometry,H=W.index,ot=W.sourceLayerIndex;if(this.hasPattern){var ht=Ph("line",this.layers,W,this.zoom,n);this.patternFeatures.push(ht)}else this.addFeature(W,Y,H,h,{});n.featureIndex.insert(t[H].feature,Y,H,ot,this.index)}},bo.prototype.update=function(t,n,h){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,n,this.stateDependentLayers,h)},bo.prototype.addFeatures=function(t,n,h){for(var _=0,w=this.patternFeatures;_<w.length;_+=1){var C=w[_];this.addFeature(C,C.geometry,C.index,n,h)}},bo.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},bo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},bo.prototype.upload=function(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,xg)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,gf),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},bo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},bo.prototype.lineFeatureClips=function(t){if(t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}},bo.prototype.addFeature=function(t,n,h,_,w){var C=this.layers[0].layout,r=C.get("line-join").evaluate(t,{}),e=C.get("line-cap"),s=C.get("line-miter-limit"),f=C.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(var y=0,b=n;y<b.length;y+=1)this.addLine(b[y],t,r,e,s,f);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,h,w,_)},bo.prototype.addLine=function(t,n,h,_,w,C){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var r=0;r<t.length-1;r++)this.totalDistance+=t[r].dist(t[r+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var e=bg[n.type]==="Polygon",s=t.length;s>=2&&t[s-1].equals(t[s-2]);)s--;for(var f=0;f<s-1&&t[f].equals(t[f+1]);)f++;if(!(s<(e?3:2))){h==="bevel"&&(w=1.05);var y,b=this.overscaling<=16?122880/(512*this.overscaling):0,E=this.segments.prepareSegment(10*s,this.layoutVertexArray,this.indexArray),M=void 0,z=void 0,O=void 0,G=void 0;this.e1=this.e2=-1,e&&(G=t[f].sub(y=t[s-2])._unit()._perp());for(var V=f;V<s;V++)if(!(z=V===s-1?e?t[f+1]:void 0:t[V+1])||!t[V].equals(z)){G&&(O=G),y&&(M=y),y=t[V],G=z?z.sub(y)._unit()._perp():O;var W=(O=O||G).add(G);W.x===0&&W.y===0||W._unit();var Y=O.x*G.x+O.y*G.y,H=W.x*G.x+W.y*G.y,ot=H!==0?1/H:1/0,ht=2*Math.sqrt(2-2*H),Pt=H<wg&&M&&z,Ut=O.x*G.y-O.y*G.x>0;if(Pt&&V>f){var jt=y.dist(M);if(jt>2*b){var qt=y.sub(y.sub(M)._mult(b/jt)._round());this.updateDistance(M,qt),this.addCurrentVertex(qt,O,0,0,E),M=qt}}var re=M&&z,Xt=re?h:e?"butt":_;if(re&&Xt==="round"&&(ot<C?Xt="miter":ot<=2&&(Xt="fakeround")),Xt==="miter"&&ot>w&&(Xt="bevel"),Xt==="bevel"&&(ot>2&&(Xt="flipbevel"),ot<w&&(Xt="miter")),M&&this.updateDistance(M,y),Xt==="miter")W._mult(ot),this.addCurrentVertex(y,W,0,0,E);else if(Xt==="flipbevel"){if(ot>100)W=G.mult(-1);else{var Te=ot*O.add(G).mag()/O.sub(G).mag();W._perp()._mult(Te*(Ut?-1:1))}this.addCurrentVertex(y,W,0,0,E),this.addCurrentVertex(y,W.mult(-1),0,0,E)}else if(Xt==="bevel"||Xt==="fakeround"){var Ee=-Math.sqrt(ot*ot-1),ue=Ut?Ee:0,we=Ut?0:Ee;if(M&&this.addCurrentVertex(y,O,ue,we,E),Xt==="fakeround")for(var me=Math.round(180*ht/Math.PI/20),Ae=1;Ae<me;Ae++){var pe=Ae/me;if(pe!==.5){var ge=pe-.5;pe+=pe*ge*(pe-1)*((1.0904+Y*(Y*(3.55645-1.43519*Y)-3.2452))*ge*ge+(.848013+Y*(.215638*Y-1.06021)))}var He=G.sub(O)._mult(pe)._add(O)._unit()._mult(Ut?-1:1);this.addHalfVertex(y,He.x,He.y,!1,Ut,0,E)}z&&this.addCurrentVertex(y,G,-ue,-we,E)}else if(Xt==="butt")this.addCurrentVertex(y,W,0,0,E);else if(Xt==="square"){var Ke=M?1:-1;this.addCurrentVertex(y,W,Ke,Ke,E)}else Xt==="round"&&(M&&(this.addCurrentVertex(y,O,0,0,E),this.addCurrentVertex(y,O,1,1,E,!0)),z&&(this.addCurrentVertex(y,G,-1,-1,E,!0),this.addCurrentVertex(y,G,0,0,E)));if(Pt&&V<s-1){var gr=y.dist(z);if(gr>2*b){var wr=y.add(z.sub(y)._mult(b/gr)._round());this.updateDistance(y,wr),this.addCurrentVertex(wr,G,0,0,E),y=wr}}}}},bo.prototype.addCurrentVertex=function(t,n,h,_,w,C){C===void 0&&(C=!1);var r=n.y*_-n.x,e=-n.y-n.x*_;this.addHalfVertex(t,n.x+n.y*h,n.y-n.x*h,C,!1,h,w),this.addHalfVertex(t,r,e,C,!0,-_,w),this.distance>jc/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(t,n,h,_,w,C))},bo.prototype.addHalfVertex=function(t,n,h,_,w,C,r){var e=.5*(this.lineClips?this.scaledDistance*(jc-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t.x<<1)+(_?1:0),(t.y<<1)+(w?1:0),Math.round(63*n)+128,Math.round(63*h)+128,1+(C===0?0:C<0?-1:1)|(63&e)<<2,e>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var s=r.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,s),r.primitiveLength++),w?this.e2=s:this.e1=s},bo.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},bo.prototype.updateDistance=function(t,n){this.distance+=t.dist(n),this.updateScaledDistance()},tr("LineBucket",bo,{omit:["layers","patternFeatures"]});var Eg=new T({"line-cap":new je(dt.layout_line["line-cap"]),"line-join":new Ve(dt.layout_line["line-join"]),"line-miter-limit":new je(dt.layout_line["line-miter-limit"]),"line-round-limit":new je(dt.layout_line["line-round-limit"]),"line-sort-key":new Ve(dt.layout_line["line-sort-key"])}),kd={paint:new T({"line-opacity":new Ve(dt.paint_line["line-opacity"]),"line-color":new Ve(dt.paint_line["line-color"]),"line-translate":new je(dt.paint_line["line-translate"]),"line-translate-anchor":new je(dt.paint_line["line-translate-anchor"]),"line-width":new Ve(dt.paint_line["line-width"]),"line-gap-width":new Ve(dt.paint_line["line-gap-width"]),"line-offset":new Ve(dt.paint_line["line-offset"]),"line-blur":new Ve(dt.paint_line["line-blur"]),"line-dasharray":new cn(dt.paint_line["line-dasharray"]),"line-pattern":new Il(dt.paint_line["line-pattern"]),"line-gradient":new so(dt.paint_line["line-gradient"])}),layout:Eg},zd=new(function(t){function n(){t.apply(this,arguments)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.possiblyEvaluate=function(h,_){return _=new Oe(Math.floor(_.zoom),{now:_.now,fadeDuration:_.fadeDuration,zoomHistory:_.zoomHistory,transition:_.transition}),t.prototype.possiblyEvaluate.call(this,h,_)},n.prototype.evaluate=function(h,_,w,C){return _=wt({},_,{zoom:Math.floor(_.zoom)}),t.prototype.evaluate.call(this,h,_,w,C)},n}(Ve))(kd.paint.properties["line-width"].specification);zd.useIntegerZoom=!0;var Sg=function(t){function n(h){t.call(this,h,kd),this.gradientVersion=0}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype._handleSpecialPaintPropertyUpdate=function(h){h==="line-gradient"&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Dn,this.gradientVersion=(this.gradientVersion+1)%at)},n.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},n.prototype.recalculate=function(h,_){t.prototype.recalculate.call(this,h,_),this.paint._values["line-floorwidth"]=zd.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,h)},n.prototype.createBucket=function(h){return new bo(h)},n.prototype.queryRadius=function(h){var _=h,w=Rd(Da("line-width",this,_),Da("line-gap-width",this,_)),C=Da("line-offset",this,_);return w/2+Math.abs(C)+In(this.paint.get("line-translate"))},n.prototype.queryIntersectsFeature=function(h,_,w,C,r,e,s){var f=qo(h,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),e.angle,s),y=s/2*Rd(this.paint.get("line-width").evaluate(_,w),this.paint.get("line-gap-width").evaluate(_,w)),b=this.paint.get("line-offset").evaluate(_,w);return b&&(C=function(E,M){for(var z=[],O=new F(0,0),G=0;G<E.length;G++){for(var V=E[G],W=[],Y=0;Y<V.length;Y++){var H=V[Y],ot=V[Y+1],ht=Y===0?O:H.sub(V[Y-1])._unit()._perp(),Pt=Y===V.length-1?O:ot.sub(H)._unit()._perp(),Ut=ht._add(Pt)._unit();Ut._mult(1/(Ut.x*Pt.x+Ut.y*Pt.y)),W.push(Ut._mult(M)._add(H))}z.push(W)}return z}(C,b*s)),function(E,M,z){for(var O=0;O<M.length;O++){var G=M[O];if(E.length>=3){for(var V=0;V<G.length;V++)if(es(E,G[V]))return!0}if(jo(E,G,z))return!0}return!1}(f,C,y)},n.prototype.isTileClipped=function(){return!0},n}(a);function Rd(t,n){return n>0?n+2*t:t}var Tg=L([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Dd=L([{name:"a_projected_pos",components:3,type:"Float32"}],4),yf=(L([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),L([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Od=(L([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),L([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Fd=L([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Bd(t,n,h){return t.sections.forEach(function(_){_.text=function(w,C,r){var e=C.layout.get("text-transform").evaluate(r,{});return e==="uppercase"?w=w.toLocaleUpperCase():e==="lowercase"&&(w=w.toLocaleLowerCase()),er.applyArabicShaping&&(w=er.applyArabicShaping(w)),w}(_.text,n,h)}),t}L([{name:"triangle",components:3,type:"Uint16"}]),L([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),L([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),L([{type:"Float32",name:"offsetX"}]),L([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var qc={"!":"\uFE15","#":"\uFF03",$:"\uFF04","%":"\uFF05","&":"\uFF06","(":"\uFE35",")":"\uFE36","*":"\uFF0A","+":"\uFF0B",",":"\uFE10","-":"\uFE32",".":"\u30FB","/":"\uFF0F",":":"\uFE13",";":"\uFE14","<":"\uFE3F","=":"\uFF1D",">":"\uFE40","?":"\uFE16","@":"\uFF20","[":"\uFE47","\\":"\uFF3C","]":"\uFE48","^":"\uFF3E",_:"\uFE33","`":"\uFF40","{":"\uFE37","|":"\u2015","}":"\uFE38","~":"\uFF5E","\xA2":"\uFFE0","\xA3":"\uFFE1","\xA5":"\uFFE5","\xA6":"\uFFE4","\xAC":"\uFFE2","\xAF":"\uFFE3","\u2013":"\uFE32","\u2014":"\uFE31","\u2018":"\uFE43","\u2019":"\uFE44","\u201C":"\uFE41","\u201D":"\uFE42","\u2026":"\uFE19","\u2027":"\u30FB","\u20A9":"\uFFE6","\u3001":"\uFE11","\u3002":"\uFE12","\u3008":"\uFE3F","\u3009":"\uFE40","\u300A":"\uFE3D","\u300B":"\uFE3E","\u300C":"\uFE41","\u300D":"\uFE42","\u300E":"\uFE43","\u300F":"\uFE44","\u3010":"\uFE3B","\u3011":"\uFE3C","\u3014":"\uFE39","\u3015":"\uFE3A","\u3016":"\uFE17","\u3017":"\uFE18","\uFF01":"\uFE15","\uFF08":"\uFE35","\uFF09":"\uFE36","\uFF0C":"\uFE10","\uFF0D":"\uFE32","\uFF0E":"\u30FB","\uFF1A":"\uFE13","\uFF1B":"\uFE14","\uFF1C":"\uFE3F","\uFF1E":"\uFE40","\uFF1F":"\uFE16","\uFF3B":"\uFE47","\uFF3D":"\uFE48","\uFF3F":"\uFE33","\uFF5B":"\uFE37","\uFF5C":"\u2015","\uFF5D":"\uFE38","\uFF5F":"\uFE35","\uFF60":"\uFE36","\uFF61":"\uFE12","\uFF62":"\uFE41","\uFF63":"\uFE42"},Ud=function(t,n,h,_,w){var C,r,e=8*w-_-1,s=(1<<e)-1,f=s>>1,y=-7,b=h?w-1:0,E=h?-1:1,M=t[n+b];for(b+=E,C=M&(1<<-y)-1,M>>=-y,y+=e;y>0;C=256*C+t[n+b],b+=E,y-=8);for(r=C&(1<<-y)-1,C>>=-y,y+=_;y>0;r=256*r+t[n+b],b+=E,y-=8);if(C===0)C=1-f;else{if(C===s)return r?NaN:1/0*(M?-1:1);r+=Math.pow(2,_),C-=f}return(M?-1:1)*r*Math.pow(2,C-_)},Nd=function(t,n,h,_,w,C){var r,e,s,f=8*C-w-1,y=(1<<f)-1,b=y>>1,E=w===23?Math.pow(2,-24)-Math.pow(2,-77):0,M=_?0:C-1,z=_?1:-1,O=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(e=isNaN(n)?1:0,r=y):(r=Math.floor(Math.log(n)/Math.LN2),n*(s=Math.pow(2,-r))<1&&(r--,s*=2),(n+=r+b>=1?E/s:E*Math.pow(2,1-b))*s>=2&&(r++,s/=2),r+b>=y?(e=0,r=y):r+b>=1?(e=(n*s-1)*Math.pow(2,w),r+=b):(e=n*Math.pow(2,b-1)*Math.pow(2,w),r=0));w>=8;t[h+M]=255&e,M+=z,e/=256,w-=8);for(r=r<<w|e,f+=w;f>0;t[h+M]=255&r,M+=z,r/=256,f-=8);t[h+M-z]|=128*O},gp=Ci;function Ci(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Ci.Varint=0,Ci.Fixed64=1,Ci.Bytes=2,Ci.Fixed32=5;var Vd=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function Ll(t){return t.type===Ci.Bytes?t.readVarint()+t.pos:t.pos+1}function Hs(t,n,h){return h?4294967296*n+(t>>>0):4294967296*(n>>>0)+(t>>>0)}function Qn(t,n,h){var _=n<=16383?1:n<=2097151?2:n<=268435455?3:Math.floor(Math.log(n)/(7*Math.LN2));h.realloc(_);for(var w=h.pos-1;w>=t;w--)h.buf[w+_]=h.buf[w]}function _f(t,n){for(var h=0;h<t.length;h++)n.writeVarint(t[h])}function Gd(t,n){for(var h=0;h<t.length;h++)n.writeSVarint(t[h])}function jd(t,n){for(var h=0;h<t.length;h++)n.writeFloat(t[h])}function Li(t,n){for(var h=0;h<t.length;h++)n.writeDouble(t[h])}function fu(t,n){for(var h=0;h<t.length;h++)n.writeBoolean(t[h])}function vf(t,n){for(var h=0;h<t.length;h++)n.writeFixed32(t[h])}function qd(t,n){for(var h=0;h<t.length;h++)n.writeSFixed32(t[h])}function Zd(t,n){for(var h=0;h<t.length;h++)n.writeFixed64(t[h])}function kl(t,n){for(var h=0;h<t.length;h++)n.writeSFixed64(t[h])}function zl(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16)+16777216*t[n+3]}function tc(t,n,h){t[h]=n,t[h+1]=n>>>8,t[h+2]=n>>>16,t[h+3]=n>>>24}function Xd(t,n){return(t[n]|t[n+1]<<8|t[n+2]<<16)+(t[n+3]<<24)}function Ig(t,n,h){t===1&&h.readMessage(Cg,n)}function Cg(t,n,h){if(t===3){var _=h.readMessage(Ag,{}),w=_.width,C=_.height,r=_.left,e=_.top,s=_.advance;n.push({id:_.id,bitmap:new Yu({width:w+6,height:C+6},_.bitmap),metrics:{width:w,height:C,left:r,top:e,advance:s}})}}function Ag(t,n,h){t===1?n.id=h.readVarint():t===2?n.bitmap=h.readBytes():t===3?n.width=h.readVarint():t===4?n.height=h.readVarint():t===5?n.left=h.readSVarint():t===6?n.top=h.readSVarint():t===7&&(n.advance=h.readVarint())}function Wd(t){for(var n=0,h=0,_=0,w=t;_<w.length;_+=1){var C=w[_];n+=C.w*C.h,h=Math.max(h,C.w)}t.sort(function(O,G){return G.h-O.h});for(var r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(n/.95)),h),h:1/0}],e=0,s=0,f=0,y=t;f<y.length;f+=1)for(var b=y[f],E=r.length-1;E>=0;E--){var M=r[E];if(!(b.w>M.w||b.h>M.h)){if(b.x=M.x,b.y=M.y,s=Math.max(s,b.y+b.h),e=Math.max(e,b.x+b.w),b.w===M.w&&b.h===M.h){var z=r.pop();E<r.length&&(r[E]=z)}else b.h===M.h?(M.x+=b.w,M.w-=b.w):b.w===M.w?(M.y+=b.h,M.h-=b.h):(r.push({x:M.x+b.w,y:M.y,w:M.w-b.w,h:b.h}),M.y+=b.h,M.h-=b.h);break}}return{w:e,h:s,fill:n/(e*s)||0}}Ci.prototype={destroy:function(){this.buf=null},readFields:function(t,n,h){for(h=h||this.length;this.pos<h;){var _=this.readVarint(),w=_>>3,C=this.pos;this.type=7&_,t(w,n,this),this.pos===C&&this.skip(_)}return n},readMessage:function(t,n){return this.readFields(t,n,this.readVarint()+this.pos)},readFixed32:function(){var t=zl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Xd(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=zl(this.buf,this.pos)+4294967296*zl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=zl(this.buf,this.pos)+4294967296*Xd(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Ud(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ud(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var n,h,_=this.buf;return n=127&(h=_[this.pos++]),h<128?n:(n|=(127&(h=_[this.pos++]))<<7,h<128?n:(n|=(127&(h=_[this.pos++]))<<14,h<128?n:(n|=(127&(h=_[this.pos++]))<<21,h<128?n:function(w,C,r){var e,s,f=r.buf;if(e=(112&(s=f[r.pos++]))>>4,s<128||(e|=(127&(s=f[r.pos++]))<<3,s<128)||(e|=(127&(s=f[r.pos++]))<<10,s<128)||(e|=(127&(s=f[r.pos++]))<<17,s<128)||(e|=(127&(s=f[r.pos++]))<<24,s<128)||(e|=(1&(s=f[r.pos++]))<<31,s<128))return Hs(w,e,C);throw new Error("Expected varint not more than 10 bytes")}(n|=(15&(h=_[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,n=this.pos;return this.pos=t,t-n>=12&&Vd?function(h,_,w){return Vd.decode(h.subarray(_,w))}(this.buf,n,t):function(h,_,w){for(var C="",r=_;r<w;){var e,s,f,y=h[r],b=null,E=y>239?4:y>223?3:y>191?2:1;if(r+E>w)break;E===1?y<128&&(b=y):E===2?(192&(e=h[r+1]))==128&&(b=(31&y)<<6|63&e)<=127&&(b=null):E===3?(s=h[r+2],(192&(e=h[r+1]))==128&&(192&s)==128&&((b=(15&y)<<12|(63&e)<<6|63&s)<=2047||b>=55296&&b<=57343)&&(b=null)):E===4&&(s=h[r+2],f=h[r+3],(192&(e=h[r+1]))==128&&(192&s)==128&&(192&f)==128&&((b=(15&y)<<18|(63&e)<<12|(63&s)<<6|63&f)<=65535||b>=1114112)&&(b=null)),b===null?(b=65533,E=1):b>65535&&(b-=65536,C+=String.fromCharCode(b>>>10&1023|55296),b=56320|1023&b),C+=String.fromCharCode(b),r+=E}return C}(this.buf,n,t)},readBytes:function(){var t=this.readVarint()+this.pos,n=this.buf.subarray(this.pos,t);return this.pos=t,n},readPackedVarint:function(t,n){if(this.type!==Ci.Bytes)return t.push(this.readVarint(n));var h=Ll(this);for(t=t||[];this.pos<h;)t.push(this.readVarint(n));return t},readPackedSVarint:function(t){if(this.type!==Ci.Bytes)return t.push(this.readSVarint());var n=Ll(this);for(t=t||[];this.pos<n;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Ci.Bytes)return t.push(this.readBoolean());var n=Ll(this);for(t=t||[];this.pos<n;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Ci.Bytes)return t.push(this.readFloat());var n=Ll(this);for(t=t||[];this.pos<n;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Ci.Bytes)return t.push(this.readDouble());var n=Ll(this);for(t=t||[];this.pos<n;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Ci.Bytes)return t.push(this.readFixed32());var n=Ll(this);for(t=t||[];this.pos<n;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Ci.Bytes)return t.push(this.readSFixed32());var n=Ll(this);for(t=t||[];this.pos<n;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Ci.Bytes)return t.push(this.readFixed64());var n=Ll(this);for(t=t||[];this.pos<n;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Ci.Bytes)return t.push(this.readSFixed64());var n=Ll(this);for(t=t||[];this.pos<n;)t.push(this.readSFixed64());return t},skip:function(t){var n=7&t;if(n===Ci.Varint)for(;this.buf[this.pos++]>127;);else if(n===Ci.Bytes)this.pos=this.readVarint()+this.pos;else if(n===Ci.Fixed32)this.pos+=4;else{if(n!==Ci.Fixed64)throw new Error("Unimplemented type: "+n);this.pos+=8}},writeTag:function(t,n){this.writeVarint(t<<3|n)},realloc:function(t){for(var n=this.length||16;n<this.pos+t;)n*=2;if(n!==this.length){var h=new Uint8Array(n);h.set(this.buf),this.buf=h,this.length=n}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),tc(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),tc(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),tc(this.buf,-1&t,this.pos),tc(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),tc(this.buf,-1&t,this.pos),tc(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(n,h){var _,w;if(n>=0?(_=n%4294967296|0,w=n/4294967296|0):(w=~(-n/4294967296),4294967295^(_=~(-n%4294967296))?_=_+1|0:(_=0,w=w+1|0)),n>=18446744073709552e3||n<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");h.realloc(10),function(C,r,e){e.buf[e.pos++]=127&C|128,C>>>=7,e.buf[e.pos++]=127&C|128,C>>>=7,e.buf[e.pos++]=127&C|128,C>>>=7,e.buf[e.pos++]=127&C|128,e.buf[e.pos]=127&(C>>>=7)}(_,0,h),function(C,r){var e=(7&C)<<4;r.buf[r.pos++]|=e|((C>>>=3)?128:0),C&&(r.buf[r.pos++]=127&C|((C>>>=7)?128:0),C&&(r.buf[r.pos++]=127&C|((C>>>=7)?128:0),C&&(r.buf[r.pos++]=127&C|((C>>>=7)?128:0),C&&(r.buf[r.pos++]=127&C|((C>>>=7)?128:0),C&&(r.buf[r.pos++]=127&C)))))}(w,h)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var n=this.pos;this.pos=function(_,w,C){for(var r,e,s=0;s<w.length;s++){if((r=w.charCodeAt(s))>55295&&r<57344){if(!e){r>56319||s+1===w.length?(_[C++]=239,_[C++]=191,_[C++]=189):e=r;continue}if(r<56320){_[C++]=239,_[C++]=191,_[C++]=189,e=r;continue}r=e-55296<<10|r-56320|65536,e=null}else e&&(_[C++]=239,_[C++]=191,_[C++]=189,e=null);r<128?_[C++]=r:(r<2048?_[C++]=r>>6|192:(r<65536?_[C++]=r>>12|224:(_[C++]=r>>18|240,_[C++]=r>>12&63|128),_[C++]=r>>6&63|128),_[C++]=63&r|128)}return C}(this.buf,t,this.pos);var h=this.pos-n;h>=128&&Qn(n,h,this),this.pos=n-1,this.writeVarint(h),this.pos+=h},writeFloat:function(t){this.realloc(4),Nd(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Nd(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var n=t.length;this.writeVarint(n),this.realloc(n);for(var h=0;h<n;h++)this.buf[this.pos++]=t[h]},writeRawMessage:function(t,n){this.pos++;var h=this.pos;t(n,this);var _=this.pos-h;_>=128&&Qn(h,_,this),this.pos=h-1,this.writeVarint(_),this.pos+=_},writeMessage:function(t,n,h){this.writeTag(t,Ci.Bytes),this.writeRawMessage(n,h)},writePackedVarint:function(t,n){n.length&&this.writeMessage(t,_f,n)},writePackedSVarint:function(t,n){n.length&&this.writeMessage(t,Gd,n)},writePackedBoolean:function(t,n){n.length&&this.writeMessage(t,fu,n)},writePackedFloat:function(t,n){n.length&&this.writeMessage(t,jd,n)},writePackedDouble:function(t,n){n.length&&this.writeMessage(t,Li,n)},writePackedFixed32:function(t,n){n.length&&this.writeMessage(t,vf,n)},writePackedSFixed32:function(t,n){n.length&&this.writeMessage(t,qd,n)},writePackedFixed64:function(t,n){n.length&&this.writeMessage(t,Zd,n)},writePackedSFixed64:function(t,n){n.length&&this.writeMessage(t,kl,n)},writeBytesField:function(t,n){this.writeTag(t,Ci.Bytes),this.writeBytes(n)},writeFixed32Field:function(t,n){this.writeTag(t,Ci.Fixed32),this.writeFixed32(n)},writeSFixed32Field:function(t,n){this.writeTag(t,Ci.Fixed32),this.writeSFixed32(n)},writeFixed64Field:function(t,n){this.writeTag(t,Ci.Fixed64),this.writeFixed64(n)},writeSFixed64Field:function(t,n){this.writeTag(t,Ci.Fixed64),this.writeSFixed64(n)},writeVarintField:function(t,n){this.writeTag(t,Ci.Varint),this.writeVarint(n)},writeSVarintField:function(t,n){this.writeTag(t,Ci.Varint),this.writeSVarint(n)},writeStringField:function(t,n){this.writeTag(t,Ci.Bytes),this.writeString(n)},writeFloatField:function(t,n){this.writeTag(t,Ci.Fixed32),this.writeFloat(n)},writeDoubleField:function(t,n){this.writeTag(t,Ci.Fixed64),this.writeDouble(n)},writeBooleanField:function(t,n){this.writeVarintField(t,Boolean(n))}};var yp=function(t,n){var h=n.pixelRatio,_=n.version,w=n.stretchX,C=n.stretchY,r=n.content;this.paddedRect=t,this.pixelRatio=h,this.stretchX=w,this.stretchY=C,this.content=r,this.version=_},Mh={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Mh.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Mh.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Mh.tlbr.get=function(){return this.tl.concat(this.br)},Mh.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(yp.prototype,Mh);var Lh=function(t,n){var h={},_={};this.haveRenderCallbacks=[];var w=[];this.addImages(t,h,w),this.addImages(n,_,w);var C=Wd(w),r=new xo({width:C.w||1,height:C.h||1});for(var e in t){var s=t[e],f=h[e].paddedRect;xo.copy(s.data,r,{x:0,y:0},{x:f.x+1,y:f.y+1},s.data)}for(var y in n){var b=n[y],E=_[y].paddedRect,M=E.x+1,z=E.y+1,O=b.data.width,G=b.data.height;xo.copy(b.data,r,{x:0,y:0},{x:M,y:z},b.data),xo.copy(b.data,r,{x:0,y:G-1},{x:M,y:z-1},{width:O,height:1}),xo.copy(b.data,r,{x:0,y:0},{x:M,y:z+G},{width:O,height:1}),xo.copy(b.data,r,{x:O-1,y:0},{x:M-1,y:z},{width:1,height:G}),xo.copy(b.data,r,{x:0,y:0},{x:M+O,y:z},{width:1,height:G})}this.image=r,this.iconPositions=h,this.patternPositions=_};Lh.prototype.addImages=function(t,n,h){for(var _ in t){var w=t[_],C={x:0,y:0,w:w.data.width+2,h:w.data.height+2};h.push(C),n[_]=new yp(C,w),w.hasRenderCallback&&this.haveRenderCallbacks.push(_)}},Lh.prototype.patchUpdatedImages=function(t,n){for(var h in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[h],t.getImage(h),n),this.patchUpdatedImage(this.patternPositions[h],t.getImage(h),n)},Lh.prototype.patchUpdatedImage=function(t,n,h){if(t&&n&&t.version!==n.version){t.version=n.version;var _=t.tl;h.update(n.data,void 0,{x:_[0],y:_[1]})}},tr("ImagePosition",yp),tr("ImageAtlas",Lh);var ma={horizontal:1,vertical:2,horizontalOnly:3},Rl=function(){this.scale=1,this.fontStack="",this.imageName=null};Rl.forText=function(t,n){var h=new Rl;return h.scale=t||1,h.fontStack=n,h},Rl.forImage=function(t){var n=new Rl;return n.imageName=t,n};var An=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function kh(t,n,h,_,w,C,r,e,s,f,y,b,E,M,z,O){var G,V=An.fromFeature(t,w);b===ma.vertical&&V.verticalizePunctuation();var W=er.processBidirectionalText,Y=er.processStyledBidirectionalText;if(W&&V.sections.length===1){G=[];for(var H=0,ot=W(V.toString(),Zc(V,f,C,n,_,M,z));H<ot.length;H+=1){var ht=ot[H],Pt=new An;Pt.text=ht,Pt.sections=V.sections;for(var Ut=0;Ut<ht.length;Ut++)Pt.sectionIndex.push(0);G.push(Pt)}}else if(Y){G=[];for(var jt=0,qt=Y(V.text,V.sectionIndex,Zc(V,f,C,n,_,M,z));jt<qt.length;jt+=1){var re=qt[jt],Xt=new An;Xt.text=re[0],Xt.sectionIndex=re[1],Xt.sections=V.sections,G.push(Xt)}}else G=function(ue,we){for(var me=[],Ae=ue.text,pe=0,ge=0,He=we;ge<He.length;ge+=1){var Ke=He[ge];me.push(ue.substring(pe,Ke)),pe=Ke}return pe<Ae.length&&me.push(ue.substring(pe,Ae.length)),me}(V,Zc(V,f,C,n,_,M,z));var Te=[],Ee={positionedLines:Te,text:V.toString(),top:y[1],bottom:y[1],left:y[0],right:y[0],writingMode:b,iconsInText:!1,verticalizable:!1};return function(ue,we,me,Ae,pe,ge,He,Ke,gr,wr,Nr,Xr){for(var li=0,ui=-17,Jr=0,di=0,Qr=Ke==="right"?1:Ke==="left"?0:.5,mi=0,Cr=0,Or=pe;Cr<Or.length;Cr+=1){var Vr=Or[Cr];Vr.trim();var Mr=Vr.getMaxScale(),Ai=24*(Mr-1),Ti={positionedGlyphs:[],lineOffset:0};ue.positionedLines[mi]=Ti;var Hr=Ti.positionedGlyphs,qr=0;if(Vr.length()){for(var fi=0;fi<Vr.length();fi++){var or=Vr.getSection(fi),Mn=Vr.getSectionIndex(fi),ki=Vr.getCharCode(fi),an=0,vi=null,to=null,Un=null,ga=24,wo=!(gr===ma.horizontal||!Nr&&!za(ki)||Nr&&(_p[ki]||(tl=ki,Ne.Arabic(tl)||Ne["Arabic Supplement"](tl)||Ne["Arabic Extended-A"](tl)||Ne["Arabic Presentation Forms-A"](tl)||Ne["Arabic Presentation Forms-B"](tl))));if(or.imageName){var Eo=Ae[or.imageName];if(!Eo)continue;Un=or.imageName,ue.iconsInText=ue.iconsInText||!0,to=Eo.paddedRect;var Ln=Eo.displaySize;or.scale=24*or.scale/Xr,an=Ai+(24-Ln[1]*or.scale),ga=(vi={width:Ln[0],height:Ln[1],left:1,top:-3,advance:wo?Ln[1]:Ln[0]}).advance;var ya=wo?Ln[0]*or.scale-24*Mr:Ln[1]*or.scale-24*Mr;ya>0&&ya>qr&&(qr=ya)}else{var xu=me[or.fontStack],sc=xu&&xu[ki];if(sc&&sc.rect)to=sc.rect,vi=sc.metrics;else{var lc=we[or.fontStack],Jc=lc&&lc[ki];if(!Jc)continue;vi=Jc.metrics}an=24*(Mr-or.scale)}wo?(ue.verticalizable=!0,Hr.push({glyph:ki,imageName:Un,x:li,y:ui+an,vertical:wo,scale:or.scale,fontStack:or.fontStack,sectionIndex:Mn,metrics:vi,rect:to}),li+=ga*or.scale+wr):(Hr.push({glyph:ki,imageName:Un,x:li,y:ui+an,vertical:wo,scale:or.scale,fontStack:or.fontStack,sectionIndex:Mn,metrics:vi,rect:to}),li+=vi.advance*or.scale+wr)}Hr.length!==0&&(Jr=Math.max(li-wr,Jr),Xc(Hr,0,Hr.length-1,Qr,qr)),li=0;var ns=ge*Mr+qr;Ti.lineOffset=Math.max(qr,Ai),ui+=ns,di=Math.max(ns,di),++mi}else ui+=ge,++mi}var tl,uc=ui- -17,bu=ec(He),Bl=bu.horizontalAlign,Qc=bu.verticalAlign;(function(Mp,Lp,Gh,jh,kp,qh,Zh,Jo,cc){var hc,So=(Lp-Gh)*kp;hc=qh!==Zh?-Jo*jh- -17:(-jh*cc+.5)*Zh;for(var Qo=0,Ul=Mp;Qo<Ul.length;Qo+=1)for(var Rs=0,th=Ul[Qo].positionedGlyphs;Rs<th.length;Rs+=1){var os=th[Rs];os.x+=So,os.y+=hc}})(ue.positionedLines,Qr,Bl,Qc,Jr,di,ge,uc,pe.length),ue.top+=-Qc*uc,ue.bottom=ue.top+uc,ue.left+=-Bl*Jr,ue.right=ue.left+Jr}(Ee,n,h,_,G,r,e,s,b,f,E,O),!function(ue){for(var we=0,me=ue;we<me.length;we+=1)if(me[we].positionedGlyphs.length!==0)return!1;return!0}(Te)&&Ee}An.fromFeature=function(t,n){for(var h=new An,_=0;_<t.sections.length;_++){var w=t.sections[_];w.image?h.addImageSection(w):h.addTextSection(w,n)}return h},An.prototype.length=function(){return this.text.length},An.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},An.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},An.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},An.prototype.verticalizePunctuation=function(){this.text=function(t){for(var n="",h=0;h<t.length;h++){var _=t.charCodeAt(h+1)||null,w=t.charCodeAt(h-1)||null;n+=_&&Tl(_)&&!qc[t[h+1]]||w&&Tl(w)&&!qc[t[h-1]]||!qc[t[h]]?t[h]:qc[t[h]]}return n}(this.text)},An.prototype.trim=function(){for(var t=0,n=0;n<this.text.length&&_p[this.text.charCodeAt(n)];n++)t++;for(var h=this.text.length,_=this.text.length-1;_>=0&&_>=t&&_p[this.text.charCodeAt(_)];_--)h--;this.text=this.text.substring(t,h),this.sectionIndex=this.sectionIndex.slice(t,h)},An.prototype.substring=function(t,n){var h=new An;return h.text=this.text.substring(t,n),h.sectionIndex=this.sectionIndex.slice(t,n),h.sections=this.sections,h},An.prototype.toString=function(){return this.text},An.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce(function(n,h){return Math.max(n,t.sections[h].scale)},0)},An.prototype.addTextSection=function(t,n){this.text+=t.text,this.sections.push(Rl.forText(t.scale,t.fontStack||n));for(var h=this.sections.length-1,_=0;_<t.text.length;++_)this.sectionIndex.push(h)},An.prototype.addImageSection=function(t){var n=t.image?t.image.name:"";if(n.length!==0){var h=this.getNextImageSectionCharCode();h?(this.text+=String.fromCharCode(h),this.sections.push(Rl.forImage(n)),this.sectionIndex.push(this.sections.length-1)):Be("Reached maximum number of images 6401")}else Be("Can't add FormattedSection with an empty image.")},An.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var _p={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Ho={};function $d(t,n,h,_,w,C){if(n.imageName){var r=_[n.imageName];return r?r.displaySize[0]*n.scale*24/C+w:0}var e=h[n.fontStack],s=e&&e[t];return s?s.metrics.advance*n.scale+w:0}function xf(t,n,h,_){var w=Math.pow(t-n,2);return _?t<n?w/2:2*w:w+Math.abs(h)*h}function bf(t,n,h){var _=0;return t===10&&(_-=1e4),h&&(_+=150),t!==40&&t!==65288||(_+=50),n!==41&&n!==65289||(_+=50),_}function wf(t,n,h,_,w,C){for(var r=null,e=xf(n,h,w,C),s=0,f=_;s<f.length;s+=1){var y=f[s],b=xf(n-y.x,h,w,C)+y.badness;b<=e&&(r=y,e=b)}return{index:t,x:n,priorBreak:r,badness:e}}function Zc(t,n,h,_,w,C,r){if(C!=="point")return[];if(!t)return[];for(var e,s=[],f=function(G,V,W,Y,H,ot){for(var ht=0,Pt=0;Pt<G.length();Pt++){var Ut=G.getSection(Pt);ht+=$d(G.getCharCode(Pt),Ut,Y,H,V,ot)}return ht/Math.max(1,Math.ceil(ht/W))}(t,n,h,_,w,r),y=t.text.indexOf("\u200B")>=0,b=0,E=0;E<t.length();E++){var M=t.getSection(E),z=t.getCharCode(E);if(_p[z]||(b+=$d(z,M,_,w,n,r)),E<t.length()-1){var O=!((e=z)<11904||!(Ne["Bopomofo Extended"](e)||Ne.Bopomofo(e)||Ne["CJK Compatibility Forms"](e)||Ne["CJK Compatibility Ideographs"](e)||Ne["CJK Compatibility"](e)||Ne["CJK Radicals Supplement"](e)||Ne["CJK Strokes"](e)||Ne["CJK Symbols and Punctuation"](e)||Ne["CJK Unified Ideographs Extension A"](e)||Ne["CJK Unified Ideographs"](e)||Ne["Enclosed CJK Letters and Months"](e)||Ne["Halfwidth and Fullwidth Forms"](e)||Ne.Hiragana(e)||Ne["Ideographic Description Characters"](e)||Ne["Kangxi Radicals"](e)||Ne["Katakana Phonetic Extensions"](e)||Ne.Katakana(e)||Ne["Vertical Forms"](e)||Ne["Yi Radicals"](e)||Ne["Yi Syllables"](e)));(Ho[z]||O||M.imageName)&&s.push(wf(E+1,b,f,s,bf(z,t.getCharCode(E+1),O&&y),!1))}}return function G(V){return V?G(V.priorBreak).concat(V.index):[]}(wf(t.length(),b,f,s,0,!0))}function ec(t){var n=.5,h=.5;switch(t){case"right":case"top-right":case"bottom-right":n=1;break;case"left":case"top-left":case"bottom-left":n=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":h=1;break;case"top":case"top-right":case"top-left":h=0}return{horizontalAlign:n,verticalAlign:h}}function Xc(t,n,h,_,w){if(_||w)for(var C=t[h],r=(t[h].x+C.metrics.advance*C.scale)*_,e=n;e<=h;e++)t[e].x-=r,t[e].y+=w}function zh(t,n,h,_,w,C){var r,e=t.image;if(e.content){var s=e.content,f=e.pixelRatio||1;r=[s[0]/f,s[1]/f,e.displaySize[0]-s[2]/f,e.displaySize[1]-s[3]/f]}var y,b,E,M,z=n.left*C,O=n.right*C;h==="width"||h==="both"?(M=w[0]+z-_[3],b=w[0]+O+_[1]):b=(M=w[0]+(z+O-e.displaySize[0])/2)+e.displaySize[0];var G=n.top*C,V=n.bottom*C;return h==="height"||h==="both"?(y=w[1]+G-_[0],E=w[1]+V+_[2]):E=(y=w[1]+(G+V-e.displaySize[1])/2)+e.displaySize[1],{image:e,top:y,right:b,bottom:E,left:M,collisionPadding:r}}Ho[10]=!0,Ho[32]=!0,Ho[38]=!0,Ho[40]=!0,Ho[41]=!0,Ho[43]=!0,Ho[45]=!0,Ho[47]=!0,Ho[173]=!0,Ho[183]=!0,Ho[8203]=!0,Ho[8208]=!0,Ho[8211]=!0,Ho[8231]=!0;var Dl=function(t){function n(h,_,w,C){t.call(this,h,_),this.angle=w,C!==void 0&&(this.segment=C)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.clone=function(){return new n(this.x,this.y,this.angle,this.segment)},n}(F);function Ef(t,n){var h=n.expression;if(h.kind==="constant")return{kind:"constant",layoutSize:h.evaluate(new Oe(t+1))};if(h.kind==="source")return{kind:"source"};for(var _=h.zoomStops,w=h.interpolationType,C=0;C<_.length&&_[C]<=t;)C++;for(var r=C=Math.max(0,C-1);r<_.length&&_[r]<t+1;)r++;r=Math.min(_.length-1,r);var e=_[C],s=_[r];return h.kind==="composite"?{kind:"composite",minZoom:e,maxZoom:s,interpolationType:w}:{kind:"camera",minZoom:e,maxZoom:s,minSize:h.evaluate(new Oe(e)),maxSize:h.evaluate(new Oe(s)),interpolationType:w}}function Sf(t,n,h){var _=n.uSize,w=h.lowerSize;return t.kind==="source"?w/128:t.kind==="composite"?Ji(w/128,h.upperSize/128,n.uSizeT):_}function Tf(t,n){var h=0,_=0;if(t.kind==="constant")_=t.layoutSize;else if(t.kind!=="source"){var w=t.interpolationType,C=w?kt(Fn.interpolationFactor(w,n,t.minZoom,t.maxZoom),0,1):0;t.kind==="camera"?_=Ji(t.minSize,t.maxSize,C):h=C}return{uSizeT:h,uSize:_}}tr("Anchor",Dl);var Pg=Object.freeze({__proto__:null,getSizeData:Ef,evaluateSizeForFeature:Sf,evaluateSizeForZoom:Tf,SIZE_PACK_FACTOR:128});function If(t,n,h,_,w){if(n.segment===void 0)return!0;for(var C=n,r=n.segment+1,e=0;e>-h/2;){if(--r<0)return!1;e-=t[r].dist(C),C=t[r]}e+=t[r].dist(t[r+1]),r++;for(var s=[],f=0;e<h/2;){var y=t[r],b=t[r+1];if(!b)return!1;var E=t[r-1].angleTo(y)-y.angleTo(b);for(E=Math.abs((E+3*Math.PI)%(2*Math.PI)-Math.PI),s.push({distance:e,angleDelta:E}),f+=E;e-s[0].distance>_;)f-=s.shift().angleDelta;if(f>w)return!1;r++,e+=y.dist(b)}return!0}function Cf(t){for(var n=0,h=0;h<t.length-1;h++)n+=t[h].dist(t[h+1]);return n}function vp(t,n,h){return t?.6*n*h:0}function xp(t,n){return Math.max(t?t.right-t.left:0,n?n.right-n.left:0)}function Mg(t,n,h,_,w,C){for(var r=vp(h,w,C),e=xp(h,_)*C,s=0,f=Cf(t)/2,y=0;y<t.length-1;y++){var b=t[y],E=t[y+1],M=b.dist(E);if(s+M>f){var z=(f-s)/M,O=Ji(b.x,E.x,z),G=Ji(b.y,E.y,z),V=new Dl(O,G,E.angleTo(b),y);return V._round(),!r||If(t,V,e,r,n)?V:void 0}s+=M}}function Lg(t,n,h,_,w,C,r,e,s){var f=vp(_,C,r),y=xp(_,w),b=y*r,E=t[0].x===0||t[0].x===s||t[0].y===0||t[0].y===s;return n-b<n/4&&(n=b+n/4),function M(z,O,G,V,W,Y,H,ot,ht){for(var Pt=Y/2,Ut=Cf(z),jt=0,qt=O-G,re=[],Xt=0;Xt<z.length-1;Xt++){for(var Te=z[Xt],Ee=z[Xt+1],ue=Te.dist(Ee),we=Ee.angleTo(Te);qt+G<jt+ue;){var me=((qt+=G)-jt)/ue,Ae=Ji(Te.x,Ee.x,me),pe=Ji(Te.y,Ee.y,me);if(Ae>=0&&Ae<ht&&pe>=0&&pe<ht&&qt-Pt>=0&&qt+Pt<=Ut){var ge=new Dl(Ae,pe,we,Xt);ge._round(),V&&!If(z,ge,Y,V,W)||re.push(ge)}}jt+=ue}return ot||re.length||H||(re=M(z,jt/2,G,V,W,Y,H,!0,ht)),re}(t,E?n/2*e%n:(y/2+2*C)*r*e%n,n,f,h,b,E,!1,s)}function Af(t,n,h,_,w){for(var C=[],r=0;r<t.length;r++)for(var e=t[r],s=void 0,f=0;f<e.length-1;f++){var y=e[f],b=e[f+1];y.x<n&&b.x<n||(y.x<n?y=new F(n,y.y+(n-y.x)/(b.x-y.x)*(b.y-y.y))._round():b.x<n&&(b=new F(n,y.y+(n-y.x)/(b.x-y.x)*(b.y-y.y))._round()),y.y<h&&b.y<h||(y.y<h?y=new F(y.x+(h-y.y)/(b.y-y.y)*(b.x-y.x),h)._round():b.y<h&&(b=new F(y.x+(h-y.y)/(b.y-y.y)*(b.x-y.x),h)._round()),y.x>=_&&b.x>=_||(y.x>=_?y=new F(_,y.y+(_-y.x)/(b.x-y.x)*(b.y-y.y))._round():b.x>=_&&(b=new F(_,y.y+(_-y.x)/(b.x-y.x)*(b.y-y.y))._round()),y.y>=w&&b.y>=w||(y.y>=w?y=new F(y.x+(w-y.y)/(b.y-y.y)*(b.x-y.x),w)._round():b.y>=w&&(b=new F(y.x+(w-y.y)/(b.y-y.y)*(b.x-y.x),w)._round()),s&&y.equals(s[s.length-1])||C.push(s=[y]),s.push(b)))))}return C}function Js(t,n,h,_){var w=[],C=t.image,r=C.pixelRatio,e=C.paddedRect.w-2,s=C.paddedRect.h-2,f=t.right-t.left,y=t.bottom-t.top,b=C.stretchX||[[0,e]],E=C.stretchY||[[0,s]],M=function(Ae,pe){return Ae+pe[1]-pe[0]},z=b.reduce(M,0),O=E.reduce(M,0),G=e-z,V=s-O,W=0,Y=z,H=0,ot=O,ht=0,Pt=G,Ut=0,jt=V;if(C.content&&_){var qt=C.content;W=Rh(b,0,qt[0]),H=Rh(E,0,qt[1]),Y=Rh(b,qt[0],qt[2]),ot=Rh(E,qt[1],qt[3]),ht=qt[0]-W,Ut=qt[1]-H,Pt=qt[2]-qt[0]-Y,jt=qt[3]-qt[1]-ot}var re=function(Ae,pe,ge,He){var Ke=Dh(Ae.stretch-W,Y,f,t.left),gr=Oh(Ae.fixed-ht,Pt,Ae.stretch,z),wr=Dh(pe.stretch-H,ot,y,t.top),Nr=Oh(pe.fixed-Ut,jt,pe.stretch,O),Xr=Dh(ge.stretch-W,Y,f,t.left),li=Oh(ge.fixed-ht,Pt,ge.stretch,z),ui=Dh(He.stretch-H,ot,y,t.top),Jr=Oh(He.fixed-Ut,jt,He.stretch,O),di=new F(Ke,wr),Qr=new F(Xr,wr),mi=new F(Xr,ui),Cr=new F(Ke,ui),Or=new F(gr/r,Nr/r),Vr=new F(li/r,Jr/r),Mr=n*Math.PI/180;if(Mr){var Ai=Math.sin(Mr),Ti=Math.cos(Mr),Hr=[Ti,-Ai,Ai,Ti];di._matMult(Hr),Qr._matMult(Hr),Cr._matMult(Hr),mi._matMult(Hr)}var qr=Ae.stretch+Ae.fixed,fi=pe.stretch+pe.fixed;return{tl:di,tr:Qr,bl:Cr,br:mi,tex:{x:C.paddedRect.x+1+qr,y:C.paddedRect.y+1+fi,w:ge.stretch+ge.fixed-qr,h:He.stretch+He.fixed-fi},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Or,pixelOffsetBR:Vr,minFontScaleX:Pt/r/f,minFontScaleY:jt/r/y,isSDF:h}};if(_&&(C.stretchX||C.stretchY))for(var Xt=Ol(b,G,z),Te=Ol(E,V,O),Ee=0;Ee<Xt.length-1;Ee++)for(var ue=Xt[Ee],we=Xt[Ee+1],me=0;me<Te.length-1;me++)w.push(re(ue,Te[me],we,Te[me+1]));else w.push(re({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:e+1},{fixed:0,stretch:s+1}));return w}function Rh(t,n,h){for(var _=0,w=0,C=t;w<C.length;w+=1){var r=C[w];_+=Math.max(n,Math.min(h,r[1]))-Math.max(n,Math.min(h,r[0]))}return _}function Ol(t,n,h){for(var _=[{fixed:-1,stretch:0}],w=0,C=t;w<C.length;w+=1){var r=C[w],e=r[0],s=r[1],f=_[_.length-1];_.push({fixed:e-f.stretch,stretch:f.stretch}),_.push({fixed:e-f.stretch,stretch:f.stretch+(s-e)})}return _.push({fixed:n+1,stretch:h}),_}function Dh(t,n,h,_){return t/n*h+_}function Oh(t,n,h,_){return t-n*h/_}var Fh=function(t,n,h,_,w,C,r,e,s,f){if(this.boxStartIndex=t.length,s){var y=C.top,b=C.bottom,E=C.collisionPadding;E&&(y-=E[1],b+=E[3]);var M=b-y;M>0&&(M=Math.max(10,M),this.circleDiameter=M)}else{var z=C.top*r-e,O=C.bottom*r+e,G=C.left*r-e,V=C.right*r+e,W=C.collisionPadding;if(W&&(G-=W[0]*r,z-=W[1]*r,V+=W[2]*r,O+=W[3]*r),f){var Y=new F(G,z),H=new F(V,z),ot=new F(G,O),ht=new F(V,O),Pt=f*Math.PI/180;Y._rotate(Pt),H._rotate(Pt),ot._rotate(Pt),ht._rotate(Pt),G=Math.min(Y.x,H.x,ot.x,ht.x),V=Math.max(Y.x,H.x,ot.x,ht.x),z=Math.min(Y.y,H.y,ot.y,ht.y),O=Math.max(Y.y,H.y,ot.y,ht.y)}t.emplaceBack(n.x,n.y,G,z,V,O,h,_,w)}this.boxEndIndex=t.length},rc=function(t,n){if(t===void 0&&(t=[]),n===void 0&&(n=kg),this.data=t,this.length=this.data.length,this.compare=n,this.length>0)for(var h=(this.length>>1)-1;h>=0;h--)this._down(h)};function kg(t,n){return t<n?-1:t>n?1:0}function zg(t,n,h){n===void 0&&(n=1),h===void 0&&(h=!1);for(var _=1/0,w=1/0,C=-1/0,r=-1/0,e=t[0],s=0;s<e.length;s++){var f=e[s];(!s||f.x<_)&&(_=f.x),(!s||f.y<w)&&(w=f.y),(!s||f.x>C)&&(C=f.x),(!s||f.y>r)&&(r=f.y)}var y=Math.min(C-_,r-w),b=y/2,E=new rc([],Kd);if(y===0)return new F(_,w);for(var M=_;M<C;M+=y)for(var z=w;z<r;z+=y)E.push(new ic(M+b,z+b,b,t));for(var O=function(W){for(var Y=0,H=0,ot=0,ht=W[0],Pt=0,Ut=ht.length,jt=Ut-1;Pt<Ut;jt=Pt++){var qt=ht[Pt],re=ht[jt],Xt=qt.x*re.y-re.x*qt.y;H+=(qt.x+re.x)*Xt,ot+=(qt.y+re.y)*Xt,Y+=3*Xt}return new ic(H/Y,ot/Y,0,W)}(t),G=E.length;E.length;){var V=E.pop();(V.d>O.d||!O.d)&&(O=V,h&&console.log("found best %d after %d probes",Math.round(1e4*V.d)/1e4,G)),V.max-O.d<=n||(E.push(new ic(V.p.x-(b=V.h/2),V.p.y-b,b,t)),E.push(new ic(V.p.x+b,V.p.y-b,b,t)),E.push(new ic(V.p.x-b,V.p.y+b,b,t)),E.push(new ic(V.p.x+b,V.p.y+b,b,t)),G+=4)}return h&&(console.log("num probes: "+G),console.log("best distance: "+O.d)),O.p}function Kd(t,n){return n.max-t.max}function ic(t,n,h,_){this.p=new F(t,n),this.h=h,this.d=function(w,C){for(var r=!1,e=1/0,s=0;s<C.length;s++)for(var f=C[s],y=0,b=f.length,E=b-1;y<b;E=y++){var M=f[y],z=f[E];M.y>w.y!=z.y>w.y&&w.x<(z.x-M.x)*(w.y-M.y)/(z.y-M.y)+M.x&&(r=!r),e=Math.min(e,lu(w,M,z))}return(r?1:-1)*Math.sqrt(e)}(this.p,_),this.max=this.d+this.h*Math.SQRT2}rc.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},rc.prototype.pop=function(){if(this.length!==0){var t=this.data[0],n=this.data.pop();return this.length--,this.length>0&&(this.data[0]=n,this._down(0)),t}},rc.prototype.peek=function(){return this.data[0]},rc.prototype._up=function(t){for(var n=this.data,h=this.compare,_=n[t];t>0;){var w=t-1>>1,C=n[w];if(h(_,C)>=0)break;n[t]=C,t=w}n[t]=_},rc.prototype._down=function(t){for(var n=this.data,h=this.compare,_=this.length>>1,w=n[t];t<_;){var C=1+(t<<1),r=n[C],e=C+1;if(e<this.length&&h(n[e],r)<0&&(C=e,r=n[e]),h(r,w)>=0)break;n[t]=r,t=C}n[t]=w};var bp=Number.POSITIVE_INFINITY;function Bh(t,n){return n[1]!==bp?function(h,_,w){var C=0,r=0;switch(_=Math.abs(_),w=Math.abs(w),h){case"top-right":case"top-left":case"top":r=w-7;break;case"bottom-right":case"bottom-left":case"bottom":r=7-w}switch(h){case"top-right":case"bottom-right":case"right":C=-_;break;case"top-left":case"bottom-left":case"left":C=_}return[C,r]}(t,n[0],n[1]):function(h,_){var w=0,C=0;_<0&&(_=0);var r=_/Math.sqrt(2);switch(h){case"top-right":case"top-left":C=r-7;break;case"bottom-right":case"bottom-left":C=7-r;break;case"bottom":C=7-_;break;case"top":C=_-7}switch(h){case"top-right":case"bottom-right":w=-r;break;case"top-left":case"bottom-left":w=r;break;case"left":w=_;break;case"right":w=-_}return[w,C]}(t,n[0])}function wp(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Uh(t,n,h,_,w,C,r,e,s,f,y,b,E,M,z){var O=function(H,ot,ht,Pt,Ut,jt,qt,re){for(var Xt=Pt.layout.get("text-rotate").evaluate(jt,{})*Math.PI/180,Te=[],Ee=0,ue=ot.positionedLines;Ee<ue.length;Ee+=1)for(var we=ue[Ee],me=0,Ae=we.positionedGlyphs;me<Ae.length;me+=1){var pe=Ae[me];if(pe.rect){var ge=pe.rect||{},He=4,Ke=!0,gr=1,wr=0,Nr=(Ut||re)&&pe.vertical,Xr=pe.metrics.advance*pe.scale/2;if(re&&ot.verticalizable&&(wr=we.lineOffset/2-(pe.imageName?-(24-pe.metrics.width*pe.scale)/2:24*(pe.scale-1))),pe.imageName){var li=qt[pe.imageName];Ke=li.sdf,He=1/(gr=li.pixelRatio)}var ui=Ut?[pe.x+Xr,pe.y]:[0,0],Jr=Ut?[0,0]:[pe.x+Xr+ht[0],pe.y+ht[1]-wr],di=[0,0];Nr&&(di=Jr,Jr=[0,0]);var Qr=(pe.metrics.left-He)*pe.scale-Xr+Jr[0],mi=(-pe.metrics.top-He)*pe.scale+Jr[1],Cr=Qr+ge.w*pe.scale/gr,Or=mi+ge.h*pe.scale/gr,Vr=new F(Qr,mi),Mr=new F(Cr,mi),Ai=new F(Qr,Or),Ti=new F(Cr,Or);if(Nr){var Hr=new F(-Xr,Xr- -17),qr=-Math.PI/2,fi=12-Xr,or=new F(22-fi,-(pe.imageName?fi:0)),Mn=new(Function.prototype.bind.apply(F,[null].concat(di)));Vr._rotateAround(qr,Hr)._add(or)._add(Mn),Mr._rotateAround(qr,Hr)._add(or)._add(Mn),Ai._rotateAround(qr,Hr)._add(or)._add(Mn),Ti._rotateAround(qr,Hr)._add(or)._add(Mn)}if(Xt){var ki=Math.sin(Xt),an=Math.cos(Xt),vi=[an,-ki,ki,an];Vr._matMult(vi),Mr._matMult(vi),Ai._matMult(vi),Ti._matMult(vi)}var to=new F(0,0),Un=new F(0,0);Te.push({tl:Vr,tr:Mr,bl:Ai,br:Ti,tex:ge,writingMode:ot.writingMode,glyphOffset:ui,sectionIndex:pe.sectionIndex,isSDF:Ke,pixelOffsetTL:to,pixelOffsetBR:Un,minFontScaleX:0,minFontScaleY:0})}}return Te}(0,h,e,w,C,r,_,t.allowVerticalPlacement),G=t.textSizeData,V=null;G.kind==="source"?(V=[128*w.layout.get("text-size").evaluate(r,{})])[0]>32640&&Be(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):G.kind==="composite"&&((V=[128*M.compositeTextSizes[0].evaluate(r,{},z),128*M.compositeTextSizes[1].evaluate(r,{},z)])[0]>32640||V[1]>32640)&&Be(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,O,V,e,C,r,f,n,s.lineStartIndex,s.lineLength,E,z);for(var W=0,Y=y;W<Y.length;W+=1)b[Y[W]]=t.text.placedSymbolArray.length-1;return 4*O.length}function Nh(t){for(var n in t)return t[n];return null}function Ep(t,n,h,_){var w=t.compareText;if(n in w){for(var C=w[n],r=C.length-1;r>=0;r--)if(_.dist(C[r])<h)return!0}else w[n]=[];return w[n].push(_),!1}var Rg=Nc.VectorTileFeature.types,Dg=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Sp(t,n,h,_,w,C,r,e,s,f,y,b,E){var M=e?Math.min(32640,Math.round(e[0])):0,z=e?Math.min(32640,Math.round(e[1])):0;t.emplaceBack(n,h,Math.round(32*_),Math.round(32*w),C,r,(M<<1)+(s?1:0),z,16*f,16*y,256*b,256*E)}function Pf(t,n,h){t.emplaceBack(n.x,n.y,h),t.emplaceBack(n.x,n.y,h),t.emplaceBack(n.x,n.y,h),t.emplaceBack(n.x,n.y,h)}function Wc(t){for(var n=0,h=t.sections;n<h.length;n+=1)if(Ii(h[n].text))return!0;return!1}var du=function(t){this.layoutVertexArray=new Ft,this.indexArray=new _e,this.programConfigurations=t,this.segments=new ft,this.dynamicLayoutVertexArray=new bt,this.opacityVertexArray=new Ot,this.placedSymbolArray=new x};du.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},du.prototype.upload=function(t,n,h,_){this.isEmpty()||(h&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Tg.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,n),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Dd.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,Dg,!0),this.opacityVertexBuffer.itemSize=1),(h||_)&&this.programConfigurations.upload(t))},du.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},tr("SymbolBuffers",du);var $c=function(t,n,h){this.layoutVertexArray=new t,this.layoutAttributes=n,this.indexArray=new h,this.segments=new ft,this.collisionVertexArray=new Ht};$c.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,yf.members,!0)},$c.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},tr("CollisionBuffers",$c);var _i=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(function(C){return C.id}),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=vo([]),this.placementViewportMatrix=vo([]);var n=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Ef(this.zoom,n["text-size"]),this.iconSizeData=Ef(this.zoom,n["icon-size"]);var h=this.layers[0].layout,_=h.get("symbol-sort-key"),w=h.get("symbol-z-order");this.canOverlap=h.get("text-allow-overlap")||h.get("icon-allow-overlap")||h.get("text-ignore-placement")||h.get("icon-ignore-placement"),this.sortFeaturesByKey=w!=="viewport-y"&&_.constantOr(1)!==void 0,this.sortFeaturesByY=(w==="viewport-y"||w==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,h.get("symbol-placement")==="point"&&(this.writingModes=h.get("text-writing-mode").map(function(C){return ma[C]})),this.stateDependentLayerIds=this.layers.filter(function(C){return C.isStateDependent()}).map(function(C){return C.id}),this.sourceID=t.sourceID};_i.prototype.createArrays=function(){this.text=new du(new cr(this.layers,this.zoom,function(t){return/^text/.test(t)})),this.icon=new du(new cr(this.layers,this.zoom,function(t){return/^icon/.test(t)})),this.glyphOffsetArray=new R,this.lineVertexArray=new j,this.symbolInstances=new k},_i.prototype.calculateGlyphDependencies=function(t,n,h,_,w){for(var C=0;C<t.length;C++)if(n[t.charCodeAt(C)]=!0,(h||_)&&w){var r=qc[t.charAt(C)];r&&(n[r.charCodeAt(0)]=!0)}},_i.prototype.populate=function(t,n,h){var _=this.layers[0],w=_.layout,C=w.get("text-font"),r=w.get("text-field"),e=w.get("icon-image"),s=(r.value.kind!=="constant"||r.value.value instanceof si&&!r.value.value.isEmpty()||r.value.value.toString().length>0)&&(C.value.kind!=="constant"||C.value.value.length>0),f=e.value.kind!=="constant"||!!e.value.value||Object.keys(e.parameters).length>0,y=w.get("symbol-sort-key");if(this.features=[],s||f){for(var b=n.iconDependencies,E=n.glyphDependencies,M=n.availableImages,z=new Oe(this.zoom),O=0,G=t;O<G.length;O+=1){var V=G[O],W=V.feature,Y=V.id,H=V.index,ot=V.sourceLayerIndex,ht=_._featureFilter.needGeometry,Pt=Kr(W,ht);if(_._featureFilter.filter(z,Pt,h)){ht||(Pt.geometry=Xi(W));var Ut=void 0;if(s){var jt=_.getValueAndResolveTokens("text-field",Pt,h,M),qt=si.factory(jt);Wc(qt)&&(this.hasRTLText=!0),(!this.hasRTLText||No()==="unavailable"||this.hasRTLText&&er.isParsed())&&(Ut=Bd(qt,_,Pt))}var re=void 0;if(f){var Xt=_.getValueAndResolveTokens("icon-image",Pt,h,M);re=Xt instanceof Nn?Xt:Nn.fromString(Xt)}if(Ut||re){var Te=this.sortFeaturesByKey?y.evaluate(Pt,{},h):void 0;if(this.features.push({id:Y,text:Ut,icon:re,index:H,sourceLayerIndex:ot,geometry:Pt.geometry,properties:W.properties,type:Rg[W.type],sortKey:Te}),re&&(b[re.name]=!0),Ut){var Ee=C.evaluate(Pt,{},h).join(","),ue=w.get("text-rotation-alignment")==="map"&&w.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(ma.vertical)>=0;for(var we=0,me=Ut.sections;we<me.length;we+=1){var Ae=me[we];if(Ae.image)b[Ae.image.name]=!0;else{var pe=Sl(Ut.toString()),ge=Ae.fontStack||Ee,He=E[ge]=E[ge]||{};this.calculateGlyphDependencies(Ae.text,He,ue,this.allowVerticalPlacement,pe)}}}}}}w.get("symbol-placement")==="line"&&(this.features=function(Ke){var gr={},wr={},Nr=[],Xr=0;function li(Hr){Nr.push(Ke[Hr]),Xr++}function ui(Hr,qr,fi){var or=wr[Hr];return delete wr[Hr],wr[qr]=or,Nr[or].geometry[0].pop(),Nr[or].geometry[0]=Nr[or].geometry[0].concat(fi[0]),or}function Jr(Hr,qr,fi){var or=gr[qr];return delete gr[qr],gr[Hr]=or,Nr[or].geometry[0].shift(),Nr[or].geometry[0]=fi[0].concat(Nr[or].geometry[0]),or}function di(Hr,qr,fi){var or=fi?qr[0][qr[0].length-1]:qr[0][0];return Hr+":"+or.x+":"+or.y}for(var Qr=0;Qr<Ke.length;Qr++){var mi=Ke[Qr],Cr=mi.geometry,Or=mi.text?mi.text.toString():null;if(Or){var Vr=di(Or,Cr),Mr=di(Or,Cr,!0);if(Vr in wr&&Mr in gr&&wr[Vr]!==gr[Mr]){var Ai=Jr(Vr,Mr,Cr),Ti=ui(Vr,Mr,Nr[Ai].geometry);delete gr[Vr],delete wr[Mr],wr[di(Or,Nr[Ti].geometry,!0)]=Ti,Nr[Ai].geometry=null}else Vr in wr?ui(Vr,Mr,Cr):Mr in gr?Jr(Vr,Mr,Cr):(li(Qr),gr[Vr]=Xr-1,wr[Mr]=Xr-1)}else li(Qr)}return Nr.filter(function(Hr){return Hr.geometry})}(this.features)),this.sortFeaturesByKey&&this.features.sort(function(Ke,gr){return Ke.sortKey-gr.sortKey})}},_i.prototype.update=function(t,n,h){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,n,this.layers,h),this.icon.programConfigurations.updatePaintArrays(t,n,this.layers,h))},_i.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},_i.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},_i.prototype.upload=function(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},_i.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},_i.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},_i.prototype.addToLineVertexArray=function(t,n){var h=this.lineVertexArray.length;if(t.segment!==void 0){for(var _=t.dist(n[t.segment+1]),w=t.dist(n[t.segment]),C={},r=t.segment+1;r<n.length;r++)C[r]={x:n[r].x,y:n[r].y,tileUnitDistanceFromAnchor:_},r<n.length-1&&(_+=n[r+1].dist(n[r]));for(var e=t.segment||0;e>=0;e--)C[e]={x:n[e].x,y:n[e].y,tileUnitDistanceFromAnchor:w},e>0&&(w+=n[e-1].dist(n[e]));for(var s=0;s<n.length;s++){var f=C[s];this.lineVertexArray.emplaceBack(f.x,f.y,f.tileUnitDistanceFromAnchor)}}return{lineStartIndex:h,lineLength:this.lineVertexArray.length-h}},_i.prototype.addSymbols=function(t,n,h,_,w,C,r,e,s,f,y,b){for(var E=t.indexArray,M=t.layoutVertexArray,z=t.segments.prepareSegment(4*n.length,M,E,this.canOverlap?C.sortKey:void 0),O=this.glyphOffsetArray.length,G=z.vertexLength,V=this.allowVerticalPlacement&&r===ma.vertical?Math.PI/2:0,W=C.text&&C.text.sections,Y=0;Y<n.length;Y++){var H=n[Y],ot=H.tl,ht=H.tr,Pt=H.bl,Ut=H.br,jt=H.tex,qt=H.pixelOffsetTL,re=H.pixelOffsetBR,Xt=H.minFontScaleX,Te=H.minFontScaleY,Ee=H.glyphOffset,ue=H.isSDF,we=H.sectionIndex,me=z.vertexLength,Ae=Ee[1];Sp(M,e.x,e.y,ot.x,Ae+ot.y,jt.x,jt.y,h,ue,qt.x,qt.y,Xt,Te),Sp(M,e.x,e.y,ht.x,Ae+ht.y,jt.x+jt.w,jt.y,h,ue,re.x,qt.y,Xt,Te),Sp(M,e.x,e.y,Pt.x,Ae+Pt.y,jt.x,jt.y+jt.h,h,ue,qt.x,re.y,Xt,Te),Sp(M,e.x,e.y,Ut.x,Ae+Ut.y,jt.x+jt.w,jt.y+jt.h,h,ue,re.x,re.y,Xt,Te),Pf(t.dynamicLayoutVertexArray,e,V),E.emplaceBack(me,me+1,me+2),E.emplaceBack(me+1,me+2,me+3),z.vertexLength+=4,z.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Ee[0]),Y!==n.length-1&&we===n[Y+1].sectionIndex||t.programConfigurations.populatePaintArrays(M.length,C,C.index,{},b,W&&W[we])}t.placedSymbolArray.emplaceBack(e.x,e.y,O,this.glyphOffsetArray.length-O,G,s,f,e.segment,h?h[0]:0,h?h[1]:0,_[0],_[1],r,0,!1,0,y)},_i.prototype._addCollisionDebugVertex=function(t,n,h,_,w,C){return n.emplaceBack(0,0),t.emplaceBack(h.x,h.y,_,w,Math.round(C.x),Math.round(C.y))},_i.prototype.addCollisionDebugVertices=function(t,n,h,_,w,C,r){var e=w.segments.prepareSegment(4,w.layoutVertexArray,w.indexArray),s=e.vertexLength,f=w.layoutVertexArray,y=w.collisionVertexArray,b=r.anchorX,E=r.anchorY;this._addCollisionDebugVertex(f,y,C,b,E,new F(t,n)),this._addCollisionDebugVertex(f,y,C,b,E,new F(h,n)),this._addCollisionDebugVertex(f,y,C,b,E,new F(h,_)),this._addCollisionDebugVertex(f,y,C,b,E,new F(t,_)),e.vertexLength+=4;var M=w.indexArray;M.emplaceBack(s,s+1),M.emplaceBack(s+1,s+2),M.emplaceBack(s+2,s+3),M.emplaceBack(s+3,s),e.primitiveLength+=4},_i.prototype.addDebugCollisionBoxes=function(t,n,h,_){for(var w=t;w<n;w++){var C=this.collisionBoxArray.get(w);this.addCollisionDebugVertices(C.x1,C.y1,C.x2,C.y2,_?this.textCollisionBox:this.iconCollisionBox,C.anchorPoint,h)}},_i.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new $c(Wt,Od.members,ar),this.iconCollisionBox=new $c(Wt,Od.members,ar);for(var t=0;t<this.symbolInstances.length;t++){var n=this.symbolInstances.get(t);this.addDebugCollisionBoxes(n.textBoxStartIndex,n.textBoxEndIndex,n,!0),this.addDebugCollisionBoxes(n.verticalTextBoxStartIndex,n.verticalTextBoxEndIndex,n,!0),this.addDebugCollisionBoxes(n.iconBoxStartIndex,n.iconBoxEndIndex,n,!1),this.addDebugCollisionBoxes(n.verticalIconBoxStartIndex,n.verticalIconBoxEndIndex,n,!1)}},_i.prototype._deserializeCollisionBoxesForSymbol=function(t,n,h,_,w,C,r,e,s){for(var f={},y=n;y<h;y++){var b=t.get(y);f.textBox={x1:b.x1,y1:b.y1,x2:b.x2,y2:b.y2,anchorPointX:b.anchorPointX,anchorPointY:b.anchorPointY},f.textFeatureIndex=b.featureIndex;break}for(var E=_;E<w;E++){var M=t.get(E);f.verticalTextBox={x1:M.x1,y1:M.y1,x2:M.x2,y2:M.y2,anchorPointX:M.anchorPointX,anchorPointY:M.anchorPointY},f.verticalTextFeatureIndex=M.featureIndex;break}for(var z=C;z<r;z++){var O=t.get(z);f.iconBox={x1:O.x1,y1:O.y1,x2:O.x2,y2:O.y2,anchorPointX:O.anchorPointX,anchorPointY:O.anchorPointY},f.iconFeatureIndex=O.featureIndex;break}for(var G=e;G<s;G++){var V=t.get(G);f.verticalIconBox={x1:V.x1,y1:V.y1,x2:V.x2,y2:V.y2,anchorPointX:V.anchorPointX,anchorPointY:V.anchorPointY},f.verticalIconFeatureIndex=V.featureIndex;break}return f},_i.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var n=0;n<this.symbolInstances.length;n++){var h=this.symbolInstances.get(n);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,h.textBoxStartIndex,h.textBoxEndIndex,h.verticalTextBoxStartIndex,h.verticalTextBoxEndIndex,h.iconBoxStartIndex,h.iconBoxEndIndex,h.verticalIconBoxStartIndex,h.verticalIconBoxEndIndex))}},_i.prototype.hasTextData=function(){return this.text.segments.get().length>0},_i.prototype.hasIconData=function(){return this.icon.segments.get().length>0},_i.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},_i.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},_i.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},_i.prototype.addIndicesForPlacedSymbol=function(t,n){for(var h=t.placedSymbolArray.get(n),_=h.vertexStartIndex+4*h.numGlyphs,w=h.vertexStartIndex;w<_;w+=4)t.indexArray.emplaceBack(w,w+1,w+2),t.indexArray.emplaceBack(w+1,w+2,w+3)},_i.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var n=Math.sin(t),h=Math.cos(t),_=[],w=[],C=[],r=0;r<this.symbolInstances.length;++r){C.push(r);var e=this.symbolInstances.get(r);_.push(0|Math.round(n*e.anchorX+h*e.anchorY)),w.push(e.featureIndex)}return C.sort(function(s,f){return _[s]-_[f]||w[f]-w[s]}),C},_i.prototype.addToSortKeyRanges=function(t,n){var h=this.sortKeyRanges[this.sortKeyRanges.length-1];h&&h.sortKey===n?h.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:n,symbolInstanceStart:t,symbolInstanceEnd:t+1})},_i.prototype.sortFeatures=function(t){var n=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var h=0,_=this.symbolInstanceIndexes;h<_.length;h+=1){var w=this.symbolInstances.get(_[h]);this.featureSortOrder.push(w.featureIndex),[w.rightJustifiedTextSymbolIndex,w.centerJustifiedTextSymbolIndex,w.leftJustifiedTextSymbolIndex].forEach(function(C,r,e){C>=0&&e.indexOf(C)===r&&n.addIndicesForPlacedSymbol(n.text,C)}),w.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,w.verticalPlacedTextSymbolIndex),w.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,w.placedIconSymbolIndex),w.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,w.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},tr("SymbolBucket",_i,{omit:["layers","collisionBoxArray","features","compareText"]}),_i.MAX_GLYPHS=65535,_i.addDynamicAttributes=Pf;var Og=new T({"symbol-placement":new je(dt.layout_symbol["symbol-placement"]),"symbol-spacing":new je(dt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new je(dt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ve(dt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new je(dt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new je(dt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new je(dt.layout_symbol["icon-ignore-placement"]),"icon-optional":new je(dt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new je(dt.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ve(dt.layout_symbol["icon-size"]),"icon-text-fit":new je(dt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new je(dt.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ve(dt.layout_symbol["icon-image"]),"icon-rotate":new Ve(dt.layout_symbol["icon-rotate"]),"icon-padding":new je(dt.layout_symbol["icon-padding"]),"icon-keep-upright":new je(dt.layout_symbol["icon-keep-upright"]),"icon-offset":new Ve(dt.layout_symbol["icon-offset"]),"icon-anchor":new Ve(dt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new je(dt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new je(dt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new je(dt.layout_symbol["text-rotation-alignment"]),"text-field":new Ve(dt.layout_symbol["text-field"]),"text-font":new Ve(dt.layout_symbol["text-font"]),"text-size":new Ve(dt.layout_symbol["text-size"]),"text-max-width":new Ve(dt.layout_symbol["text-max-width"]),"text-line-height":new je(dt.layout_symbol["text-line-height"]),"text-letter-spacing":new Ve(dt.layout_symbol["text-letter-spacing"]),"text-justify":new Ve(dt.layout_symbol["text-justify"]),"text-radial-offset":new Ve(dt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new je(dt.layout_symbol["text-variable-anchor"]),"text-anchor":new Ve(dt.layout_symbol["text-anchor"]),"text-max-angle":new je(dt.layout_symbol["text-max-angle"]),"text-writing-mode":new je(dt.layout_symbol["text-writing-mode"]),"text-rotate":new Ve(dt.layout_symbol["text-rotate"]),"text-padding":new je(dt.layout_symbol["text-padding"]),"text-keep-upright":new je(dt.layout_symbol["text-keep-upright"]),"text-transform":new Ve(dt.layout_symbol["text-transform"]),"text-offset":new Ve(dt.layout_symbol["text-offset"]),"text-allow-overlap":new je(dt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new je(dt.layout_symbol["text-ignore-placement"]),"text-optional":new je(dt.layout_symbol["text-optional"])}),Qs={paint:new T({"icon-opacity":new Ve(dt.paint_symbol["icon-opacity"]),"icon-color":new Ve(dt.paint_symbol["icon-color"]),"icon-halo-color":new Ve(dt.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ve(dt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ve(dt.paint_symbol["icon-halo-blur"]),"icon-translate":new je(dt.paint_symbol["icon-translate"]),"icon-translate-anchor":new je(dt.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ve(dt.paint_symbol["text-opacity"]),"text-color":new Ve(dt.paint_symbol["text-color"],{runtimeType:Ct,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new Ve(dt.paint_symbol["text-halo-color"]),"text-halo-width":new Ve(dt.paint_symbol["text-halo-width"]),"text-halo-blur":new Ve(dt.paint_symbol["text-halo-blur"]),"text-translate":new je(dt.paint_symbol["text-translate"]),"text-translate-anchor":new je(dt.paint_symbol["text-translate-anchor"])}),layout:Og},nc=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:gt,this.defaultValue=t};nc.prototype.evaluate=function(t){if(t.formattedSection){var n=this.defaultValue.property.overrides;if(n&&n.hasOverride(t.formattedSection))return n.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},nc.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},nc.prototype.outputDefined=function(){return!1},nc.prototype.serialize=function(){return null},tr("FormatSectionOverride",nc,{omit:["defaultValue"]});var Yd=function(t){function n(h){t.call(this,h,Qs)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.recalculate=function(h,_){if(t.prototype.recalculate.call(this,h,_),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var w=this.layout.get("text-writing-mode");if(w){for(var C=[],r=0,e=w;r<e.length;r+=1){var s=e[r];C.indexOf(s)<0&&C.push(s)}this.layout._values["text-writing-mode"]=C}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},n.prototype.getValueAndResolveTokens=function(h,_,w,C){var r=this.layout.get(h).evaluate(_,{},w,C),e=this._unevaluatedLayout._values[h];return e.isDataDriven()||ws(e.value)||!r?r:function(s,f){return f.replace(/{([^{}]+)}/g,function(y,b){return b in s?String(s[b]):""})}(_.properties,r)},n.prototype.createBucket=function(h){return new _i(h)},n.prototype.queryRadius=function(){return 0},n.prototype.queryIntersectsFeature=function(){return!1},n.prototype._setPaintOverrides=function(){for(var h=0,_=Qs.paint.overridableProperties;h<_.length;h+=1){var w=_[h];if(n.hasPaintOverride(this.layout,w)){var C,r=this.paint.get(w),e=new nc(r),s=new Ca(e,r.property.specification);C=r.value.kind==="constant"||r.value.kind==="source"?new Ja("source",s):new Aa("composite",s,r.value.zoomStops,r.value._interpolationType),this.paint._values[w]=new Jn(r.property,C,r.parameters)}}},n.prototype._handleOverridablePaintPropertyUpdate=function(h,_,w){return!(!this.layout||_.isDataDriven()||w.isDataDriven())&&n.hasPaintOverride(this.layout,h)},n.hasPaintOverride=function(h,_){var w=h.get("text-field"),C=Qs.paint.properties[_],r=!1,e=function(y){for(var b=0,E=y;b<E.length;b+=1)if(C.overrides&&C.overrides.hasOverride(E[b]))return void(r=!0)};if(w.value.kind==="constant"&&w.value.value instanceof si)e(w.value.value.sections);else if(w.value.kind==="source"){var s=function(y){r||(y instanceof Wn&&Yi(y.value)===De?e(y.value.sections):y instanceof Mo?e(y.sections):y.eachChild(s))},f=w.value;f._styleExpression&&s(f._styleExpression.expression)}return r},n}(a),Fg={paint:new T({"background-color":new je(dt.paint_background["background-color"]),"background-pattern":new cn(dt.paint_background["background-pattern"]),"background-opacity":new je(dt.paint_background["background-opacity"])})},Bg=function(t){function n(h){t.call(this,h,Fg)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n}(a),Ug={paint:new T({"raster-opacity":new je(dt.paint_raster["raster-opacity"]),"raster-hue-rotate":new je(dt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new je(dt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new je(dt.paint_raster["raster-brightness-max"]),"raster-saturation":new je(dt.paint_raster["raster-saturation"]),"raster-contrast":new je(dt.paint_raster["raster-contrast"]),"raster-resampling":new je(dt.paint_raster["raster-resampling"]),"raster-fade-duration":new je(dt.paint_raster["raster-fade-duration"])})},Tp=function(t){function n(h){t.call(this,h,Ug)}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n}(a),Mf=function(t){function n(h){t.call(this,h,{}),this.implementation=h}return t&&(n.__proto__=t),(n.prototype=Object.create(t&&t.prototype)).constructor=n,n.prototype.is3D=function(){return this.implementation.renderingMode==="3d"},n.prototype.hasOffscreenPass=function(){return this.implementation.prerender!==void 0},n.prototype.recalculate=function(){},n.prototype.updateTransitions=function(){},n.prototype.hasTransition=function(){},n.prototype.serialize=function(){},n.prototype.onAdd=function(h){this.implementation.onAdd&&this.implementation.onAdd(h,h.painter.context.gl)},n.prototype.onRemove=function(h){this.implementation.onRemove&&this.implementation.onRemove(h,h.painter.context.gl)},n}(a),Ng={circle:cp,heatmap:wh,hillshade:Pd,fill:df,"fill-extrusion":vg,line:Sg,symbol:Yd,background:Bg,raster:Tp},Ip=N.HTMLImageElement,Cp=N.HTMLCanvasElement,oc=N.HTMLVideoElement,Hd=N.ImageData,Kc=N.ImageBitmap,mu=function(t,n,h,_){this.context=t,this.format=h,this.texture=t.gl.createTexture(),this.update(n,_)};mu.prototype.update=function(t,n,h){var _=t.width,w=t.height,C=!(this.size&&this.size[0]===_&&this.size[1]===w||h),r=this.context,e=r.gl;if(this.useMipmap=Boolean(n&&n.useMipmap),e.bindTexture(e.TEXTURE_2D,this.texture),r.pixelStoreUnpackFlipY.set(!1),r.pixelStoreUnpack.set(1),r.pixelStoreUnpackPremultiplyAlpha.set(this.format===e.RGBA&&(!n||n.premultiply!==!1)),C)this.size=[_,w],t instanceof Ip||t instanceof Cp||t instanceof oc||t instanceof Hd||Kc&&t instanceof Kc?e.texImage2D(e.TEXTURE_2D,0,this.format,this.format,e.UNSIGNED_BYTE,t):e.texImage2D(e.TEXTURE_2D,0,this.format,_,w,0,this.format,e.UNSIGNED_BYTE,t.data);else{var s=h||{x:0,y:0},f=s.x,y=s.y;t instanceof Ip||t instanceof Cp||t instanceof oc||t instanceof Hd||Kc&&t instanceof Kc?e.texSubImage2D(e.TEXTURE_2D,0,f,y,e.RGBA,e.UNSIGNED_BYTE,t):e.texSubImage2D(e.TEXTURE_2D,0,f,y,_,w,e.RGBA,e.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&e.generateMipmap(e.TEXTURE_2D)},mu.prototype.bind=function(t,n,h){var _=this.context.gl;_.bindTexture(_.TEXTURE_2D,this.texture),h!==_.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(h=_.LINEAR),t!==this.filter&&(_.texParameteri(_.TEXTURE_2D,_.TEXTURE_MAG_FILTER,t),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_MIN_FILTER,h||t),this.filter=t),n!==this.wrap&&(_.texParameteri(_.TEXTURE_2D,_.TEXTURE_WRAP_S,n),_.texParameteri(_.TEXTURE_2D,_.TEXTURE_WRAP_T,n),this.wrap=n)},mu.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},mu.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Yc=function(t){var n=this;this._callback=t,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){n._triggered=!1,n._callback()})};Yc.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(function(){t._triggered=!1,t._callback()},0))},Yc.prototype.remove=function(){delete this._channel,this._callback=function(){}};var gu=function(t,n,h){this.target=t,this.parent=n,this.mapId=h,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},ce(["receive","process"],this),this.invoker=new Yc(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=Ce()?t:N};function Jd(t,n,h){var _=2*Math.PI*6378137/256/Math.pow(2,h);return[t*_-2*Math.PI*6378137/2,n*_-2*Math.PI*6378137/2]}gu.prototype.send=function(t,n,h,_,w){var C=this;w===void 0&&(w=!1);var r=Math.round(1e18*Math.random()).toString(36).substring(0,10);h&&(this.callbacks[r]=h);var e=_r(this.globalScope)?void 0:[];return this.target.postMessage({id:r,type:t,hasCallback:!!h,targetMapId:_,mustQueue:w,sourceMapId:this.mapId,data:Ro(n,e)},e),{cancel:function(){h&&delete C.callbacks[r],C.target.postMessage({id:r,type:"<cancel>",targetMapId:_,sourceMapId:C.mapId})}}},gu.prototype.receive=function(t){var n=t.data,h=n.id;if(h&&(!n.targetMapId||this.mapId===n.targetMapId))if(n.type==="<cancel>"){delete this.tasks[h];var _=this.cancelCallbacks[h];delete this.cancelCallbacks[h],_&&_()}else Ce()||n.mustQueue?(this.tasks[h]=n,this.taskQueue.push(h),this.invoker.trigger()):this.processTask(h,n)},gu.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),n=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),n&&this.processTask(t,n)}},gu.prototype.processTask=function(t,n){var h=this;if(n.type==="<response>"){var _=this.callbacks[t];delete this.callbacks[t],_&&(n.error?_(Mi(n.error)):_(null,Mi(n.data)))}else{var w=!1,C=_r(this.globalScope)?void 0:[],r=n.hasCallback?function(y,b){w=!0,delete h.cancelCallbacks[t],h.target.postMessage({id:t,type:"<response>",sourceMapId:h.mapId,error:y?Ro(y):null,data:Ro(b,C)},C)}:function(y){w=!0},e=null,s=Mi(n.data);if(this.parent[n.type])e=this.parent[n.type](n.sourceMapId,s,r);else if(this.parent.getWorkerSource){var f=n.type.split(".");e=this.parent.getWorkerSource(n.sourceMapId,f[0],s.source)[f[1]](s,r)}else r(new Error("Could not find function "+n.type));!w&&e&&e.cancel&&(this.cancelCallbacks[t]=e.cancel)}},gu.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var Pn=function(t,n){t&&(n?this.setSouthWest(t).setNorthEast(n):t.length===4?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};Pn.prototype.setNorthEast=function(t){return this._ne=t instanceof Ni?new Ni(t.lng,t.lat):Ni.convert(t),this},Pn.prototype.setSouthWest=function(t){return this._sw=t instanceof Ni?new Ni(t.lng,t.lat):Ni.convert(t),this},Pn.prototype.extend=function(t){var n,h,_=this._sw,w=this._ne;if(t instanceof Ni)n=t,h=t;else{if(!(t instanceof Pn))return Array.isArray(t)?t.length===4||t.every(Array.isArray)?this.extend(Pn.convert(t)):this.extend(Ni.convert(t)):this;if(h=t._ne,!(n=t._sw)||!h)return this}return _||w?(_.lng=Math.min(n.lng,_.lng),_.lat=Math.min(n.lat,_.lat),w.lng=Math.max(h.lng,w.lng),w.lat=Math.max(h.lat,w.lat)):(this._sw=new Ni(n.lng,n.lat),this._ne=new Ni(h.lng,h.lat)),this},Pn.prototype.getCenter=function(){return new Ni((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},Pn.prototype.getSouthWest=function(){return this._sw},Pn.prototype.getNorthEast=function(){return this._ne},Pn.prototype.getNorthWest=function(){return new Ni(this.getWest(),this.getNorth())},Pn.prototype.getSouthEast=function(){return new Ni(this.getEast(),this.getSouth())},Pn.prototype.getWest=function(){return this._sw.lng},Pn.prototype.getSouth=function(){return this._sw.lat},Pn.prototype.getEast=function(){return this._ne.lng},Pn.prototype.getNorth=function(){return this._ne.lat},Pn.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},Pn.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},Pn.prototype.isEmpty=function(){return!(this._sw&&this._ne)},Pn.prototype.contains=function(t){var n=Ni.convert(t),h=n.lng,_=n.lat,w=this._sw.lng<=h&&h<=this._ne.lng;return this._sw.lng>this._ne.lng&&(w=this._sw.lng>=h&&h>=this._ne.lng),this._sw.lat<=_&&_<=this._ne.lat&&w},Pn.convert=function(t){return!t||t instanceof Pn?t:new Pn(t)};var Ni=function(t,n){if(isNaN(t)||isNaN(n))throw new Error("Invalid LngLat object: ("+t+", "+n+")");if(this.lng=+t,this.lat=+n,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Ni.prototype.wrap=function(){return new Ni(Vt(this.lng,-180,180),this.lat)},Ni.prototype.toArray=function(){return[this.lng,this.lat]},Ni.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Ni.prototype.distanceTo=function(t){var n=Math.PI/180,h=this.lat*n,_=t.lat*n,w=Math.sin(h)*Math.sin(_)+Math.cos(h)*Math.cos(_)*Math.cos((t.lng-this.lng)*n);return 63710088e-1*Math.acos(Math.min(w,1))},Ni.prototype.toBounds=function(t){t===void 0&&(t=0);var n=360*t/40075017,h=n/Math.cos(Math.PI/180*this.lat);return new Pn(new Ni(this.lng-h,this.lat-n),new Ni(this.lng+h,this.lat+n))},Ni.convert=function(t){if(t instanceof Ni)return t;if(Array.isArray(t)&&(t.length===2||t.length===3))return new Ni(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&typeof t=="object"&&t!==null)return new Ni(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var Qd=2*Math.PI*63710088e-1;function tm(t){return Qd*Math.cos(t*Math.PI/180)}function Lf(t){return(180+t)/360}function pn(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function yu(t,n){return t/tm(n)}function Ap(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var _u=function(t,n,h){h===void 0&&(h=0),this.x=+t,this.y=+n,this.z=+h};_u.fromLngLat=function(t,n){n===void 0&&(n=0);var h=Ni.convert(t);return new _u(Lf(h.lng),pn(h.lat),yu(n,h.lat))},_u.prototype.toLngLat=function(){return new Ni(360*this.x-180,Ap(this.y))},_u.prototype.toAltitude=function(){return this.z*tm(Ap(this.y))},_u.prototype.meterInMercatorCoordinateUnits=function(){return 1/Qd*(t=Ap(this.y),1/Math.cos(t*Math.PI/180));var t};var vu=function(t,n,h){this.z=t,this.x=n,this.y=h,this.key=ac(0,t,t,n,h)};vu.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},vu.prototype.url=function(t,n){var h,_,w,C,r,e=(_=this.y,w=this.z,C=Jd(256*(h=this.x),256*(_=Math.pow(2,w)-_-1),w),r=Jd(256*(h+1),256*(_+1),w),C[0]+","+C[1]+","+r[0]+","+r[1]),s=function(f,y,b){for(var E,M="",z=f;z>0;z--)M+=(y&(E=1<<z-1)?1:0)+(b&E?2:0);return M}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(n==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",s).replace("{bbox-epsg-3857}",e)},vu.prototype.getTilePoint=function(t){var n=Math.pow(2,this.z);return new F(8192*(t.x*n-this.x),8192*(t.y*n-this.y))},vu.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var kf=function(t,n){this.wrap=t,this.canonical=n,this.key=ac(t,n.z,n.z,n.x,n.y)},yn=function(t,n,h,_,w){this.overscaledZ=t,this.wrap=n,this.canonical=new vu(h,+_,+w),this.key=ac(n,t,h,_,w)};function ac(t,n,h,_,w){(t*=2)<0&&(t=-1*t-1);var C=1<<h;return(C*C*t+C*w+_).toString(36)+h.toString(36)+n.toString(36)}yn.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},yn.prototype.scaledTo=function(t){var n=this.canonical.z-t;return t>this.canonical.z?new yn(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new yn(t,this.wrap,t,this.canonical.x>>n,this.canonical.y>>n)},yn.prototype.calculateScaledKey=function(t,n){var h=this.canonical.z-t;return t>this.canonical.z?ac(this.wrap*+n,t,this.canonical.z,this.canonical.x,this.canonical.y):ac(this.wrap*+n,t,t,this.canonical.x>>h,this.canonical.y>>h)},yn.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var n=this.canonical.z-t.canonical.z;return t.overscaledZ===0||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>n&&t.canonical.y===this.canonical.y>>n},yn.prototype.children=function(t){if(this.overscaledZ>=t)return[new yn(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var n=this.canonical.z+1,h=2*this.canonical.x,_=2*this.canonical.y;return[new yn(n,this.wrap,n,h,_),new yn(n,this.wrap,n,h+1,_),new yn(n,this.wrap,n,h,_+1),new yn(n,this.wrap,n,h+1,_+1)]},yn.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},yn.prototype.wrapped=function(){return new yn(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},yn.prototype.unwrapTo=function(t){return new yn(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},yn.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},yn.prototype.toUnwrapped=function(){return new kf(this.wrap,this.canonical)},yn.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},yn.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new _u(t.x-this.wrap,t.y))},tr("CanonicalTileID",vu),tr("OverscaledTileID",yn,{omit:["posMatrix"]});var is=function(t,n,h){if(this.uid=t,n.height!==n.width)throw new RangeError("DEM tiles must be square");if(h&&h!=="mapbox"&&h!=="terrarium")return Be('"'+h+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=n.height;var _=this.dim=n.height-2;this.data=new Uint32Array(n.data.buffer),this.encoding=h||"mapbox";for(var w=0;w<_;w++)this.data[this._idx(-1,w)]=this.data[this._idx(0,w)],this.data[this._idx(_,w)]=this.data[this._idx(_-1,w)],this.data[this._idx(w,-1)]=this.data[this._idx(w,0)],this.data[this._idx(w,_)]=this.data[this._idx(w,_-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(_,-1)]=this.data[this._idx(_-1,0)],this.data[this._idx(-1,_)]=this.data[this._idx(0,_-1)],this.data[this._idx(_,_)]=this.data[this._idx(_-1,_-1)]};is.prototype.get=function(t,n){var h=new Uint8Array(this.data.buffer),_=4*this._idx(t,n);return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(h[_],h[_+1],h[_+2])},is.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},is.prototype._idx=function(t,n){if(t<-1||t>=this.dim+1||n<-1||n>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(n+1)*this.stride+(t+1)},is.prototype._unpackMapbox=function(t,n,h){return(256*t*256+256*n+h)/10-1e4},is.prototype._unpackTerrarium=function(t,n,h){return 256*t+n+h/256-32768},is.prototype.getPixels=function(){return new xo({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},is.prototype.backfillBorder=function(t,n,h){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var _=n*this.dim,w=n*this.dim+this.dim,C=h*this.dim,r=h*this.dim+this.dim;switch(n){case-1:_=w-1;break;case 1:w=_+1}switch(h){case-1:C=r-1;break;case 1:r=C+1}for(var e=-n*this.dim,s=-h*this.dim,f=C;f<r;f++)for(var y=_;y<w;y++)this.data[this._idx(y,f)]=t.data[this._idx(y+e,f+s)]},tr("DEMData",is);var Vh=function(t){this._stringToNumber={},this._numberToString=[];for(var n=0;n<t.length;n++){var h=t[n];this._stringToNumber[h]=n,this._numberToString[n]=h}};Vh.prototype.encode=function(t){return this._stringToNumber[t]},Vh.prototype.decode=function(t){return this._numberToString[t]};var Hc=function(t,n,h,_,w){this.type="Feature",this._vectorTileFeature=t,t._z=n,t._x=h,t._y=_,this.properties=t.properties,this.id=w},Pp={geometry:{configurable:!0}};Pp.geometry.get=function(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},Pp.geometry.set=function(t){this._geometry=t},Hc.prototype.toJSON=function(){var t={geometry:this.geometry};for(var n in this)n!=="_geometry"&&n!=="_vectorTileFeature"&&(t[n]=this[n]);return t},Object.defineProperties(Hc.prototype,Pp);var Oo=function(){this.state={},this.stateChanges={},this.deletedStates={}};Oo.prototype.updateState=function(t,n,h){var _=String(n);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][_]=this.stateChanges[t][_]||{},wt(this.stateChanges[t][_],h),this.deletedStates[t]===null)for(var w in this.deletedStates[t]={},this.state[t])w!==_&&(this.deletedStates[t][w]=null);else if(this.deletedStates[t]&&this.deletedStates[t][_]===null)for(var C in this.deletedStates[t][_]={},this.state[t][_])h[C]||(this.deletedStates[t][_][C]=null);else for(var r in h)this.deletedStates[t]&&this.deletedStates[t][_]&&this.deletedStates[t][_][r]===null&&delete this.deletedStates[t][_][r]},Oo.prototype.removeFeatureState=function(t,n,h){if(this.deletedStates[t]!==null){var _=String(n);if(this.deletedStates[t]=this.deletedStates[t]||{},h&&n!==void 0)this.deletedStates[t][_]!==null&&(this.deletedStates[t][_]=this.deletedStates[t][_]||{},this.deletedStates[t][_][h]=null);else if(n!==void 0)if(this.stateChanges[t]&&this.stateChanges[t][_])for(h in this.deletedStates[t][_]={},this.stateChanges[t][_])this.deletedStates[t][_][h]=null;else this.deletedStates[t][_]=null;else this.deletedStates[t]=null}},Oo.prototype.getState=function(t,n){var h=String(n),_=wt({},(this.state[t]||{})[h],(this.stateChanges[t]||{})[h]);if(this.deletedStates[t]===null)return{};if(this.deletedStates[t]){var w=this.deletedStates[t][n];if(w===null)return{};for(var C in w)delete _[C]}return _},Oo.prototype.initializeTileState=function(t,n){t.setFeatureState(this.state,n)},Oo.prototype.coalesceChanges=function(t,n){var h={};for(var _ in this.stateChanges){this.state[_]=this.state[_]||{};var w={};for(var C in this.stateChanges[_])this.state[_][C]||(this.state[_][C]={}),wt(this.state[_][C],this.stateChanges[_][C]),w[C]=this.state[_][C];h[_]=w}for(var r in this.deletedStates){this.state[r]=this.state[r]||{};var e={};if(this.deletedStates[r]===null)for(var s in this.state[r])e[s]={},this.state[r][s]={};else for(var f in this.deletedStates[r]){if(this.deletedStates[r][f]===null)this.state[r][f]={};else for(var y=0,b=Object.keys(this.deletedStates[r][f]);y<b.length;y+=1)delete this.state[r][f][b[y]];e[f]=this.state[r][f]}h[r]=h[r]||{},wt(h[r],e)}if(this.stateChanges={},this.deletedStates={},Object.keys(h).length!==0)for(var E in t)t[E].setFeatureState(h,n)};var Ba=function(t,n){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new ka(8192,16,0),this.grid3D=new ka(8192,16,0),this.featureIndexArray=new tt,this.promoteId=n};function zf(t,n,h,_,w){return ye(t,function(C,r){var e=n instanceof Ra?n.get(r):null;return e&&e.evaluate?e.evaluate(h,_,w):e})}function Rf(t){for(var n=1/0,h=1/0,_=-1/0,w=-1/0,C=0,r=t;C<r.length;C+=1){var e=r[C];n=Math.min(n,e.x),h=Math.min(h,e.y),_=Math.max(_,e.x),w=Math.max(w,e.y)}return{minX:n,minY:h,maxX:_,maxY:w}}function em(t,n){return n-t}Ba.prototype.insert=function(t,n,h,_,w,C){var r=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(h,_,w);for(var e=C?this.grid3D:this.grid,s=0;s<n.length;s++){for(var f=n[s],y=[1/0,1/0,-1/0,-1/0],b=0;b<f.length;b++){var E=f[b];y[0]=Math.min(y[0],E.x),y[1]=Math.min(y[1],E.y),y[2]=Math.max(y[2],E.x),y[3]=Math.max(y[3],E.y)}y[0]<8192&&y[1]<8192&&y[2]>=0&&y[3]>=0&&e.insert(r,y[0],y[1],y[2],y[3])}},Ba.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Nc.VectorTile(new gp(this.rawTileData)).layers,this.sourceLayerCoder=new Vh(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},Ba.prototype.query=function(t,n,h,_){var w=this;this.loadVTLayers();for(var C=t.params||{},r=8192/t.tileSize/t.scale,e=wl(C.filter),s=t.queryGeometry,f=t.queryPadding*r,y=Rf(s),b=this.grid.query(y.minX-f,y.minY-f,y.maxX+f,y.maxY+f),E=Rf(t.cameraQueryGeometry),M=this.grid3D.query(E.minX-f,E.minY-f,E.maxX+f,E.maxY+f,function(H,ot,ht,Pt){return function(Ut,jt,qt,re,Xt){for(var Te=0,Ee=Ut;Te<Ee.length;Te+=1){var ue=Ee[Te];if(jt<=ue.x&&qt<=ue.y&&re>=ue.x&&Xt>=ue.y)return!0}var we=[new F(jt,qt),new F(jt,Xt),new F(re,Xt),new F(re,qt)];if(Ut.length>2){for(var me=0,Ae=we;me<Ae.length;me+=1)if(es(Ut,Ae[me]))return!0}for(var pe=0;pe<Ut.length-1;pe++)if(Al(Ut[pe],Ut[pe+1],we))return!0;return!1}(t.cameraQueryGeometry,H-f,ot-f,ht+f,Pt+f)}),z=0,O=M;z<O.length;z+=1)b.push(O[z]);b.sort(em);for(var G,V={},W=function(H){var ot=b[H];if(ot!==G){G=ot;var ht=w.featureIndexArray.get(ot),Pt=null;w.loadMatchingFeature(V,ht.bucketIndex,ht.sourceLayerIndex,ht.featureIndex,e,C.layers,C.availableImages,n,h,_,function(Ut,jt,qt){return Pt||(Pt=Xi(Ut)),jt.queryIntersectsFeature(s,Ut,qt,Pt,w.z,t.transform,r,t.pixelPosMatrix)})}},Y=0;Y<b.length;Y++)W(Y);return V},Ba.prototype.loadMatchingFeature=function(t,n,h,_,w,C,r,e,s,f,y){var b=this.bucketLayerIDs[n];if(!C||function(Ut,jt){for(var qt=0;qt<Ut.length;qt++)if(jt.indexOf(Ut[qt])>=0)return!0;return!1}(C,b)){var E=this.sourceLayerCoder.decode(h),M=this.vtLayers[E].feature(_);if(w.needGeometry){var z=Kr(M,!0);if(!w.filter(new Oe(this.tileID.overscaledZ),z,this.tileID.canonical))return}else if(!w.filter(new Oe(this.tileID.overscaledZ),M))return;for(var O=this.getId(M,E),G=0;G<b.length;G++){var V=b[G];if(!(C&&C.indexOf(V)<0)){var W=e[V];if(W){var Y={};O!==void 0&&f&&(Y=f.getState(W.sourceLayer||"_geojsonTileLayer",O));var H=wt({},s[V]);H.paint=zf(H.paint,W.paint,M,Y,r),H.layout=zf(H.layout,W.layout,M,Y,r);var ot=!y||y(M,W,Y);if(ot){var ht=new Hc(M,this.z,this.x,this.y,O);ht.layer=H;var Pt=t[V];Pt===void 0&&(Pt=t[V]=[]),Pt.push({featureIndex:_,feature:ht,intersectionZ:ot})}}}}}},Ba.prototype.lookupSymbolFeatures=function(t,n,h,_,w,C,r,e){var s={};this.loadVTLayers();for(var f=wl(w),y=0,b=t;y<b.length;y+=1)this.loadMatchingFeature(s,h,_,b[y],f,C,r,e,n);return s},Ba.prototype.hasLayer=function(t){for(var n=0,h=this.bucketLayerIDs;n<h.length;n+=1)for(var _=0,w=h[n];_<w.length;_+=1)if(t===w[_])return!0;return!1},Ba.prototype.getId=function(t,n){var h=t.id;return this.promoteId&&typeof(h=t.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[n]])=="boolean"&&(h=Number(h)),h},tr("FeatureIndex",Ba,{omit:["rawTileData","sourceLayerCoder"]});var Bn=function(t,n){this.tileID=t,this.uid=Zt(),this.uses=0,this.tileSize=n,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};Bn.prototype.registerFadeDuration=function(t){var n=t+this.timeAdded;n<Ri.now()||this.fadeEndTime&&n<this.fadeEndTime||(this.fadeEndTime=n)},Bn.prototype.wasRequested=function(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"},Bn.prototype.loadVectorData=function(t,n,h){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var _ in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(f,y){var b={};if(!y)return b;for(var E=function(){var O=z[M],G=O.layerIds.map(function(Y){return y.getLayer(Y)}).filter(Boolean);if(G.length!==0){O.layers=G,O.stateDependentLayerIds&&(O.stateDependentLayers=O.stateDependentLayerIds.map(function(Y){return G.filter(function(H){return H.id===Y})[0]}));for(var V=0,W=G;V<W.length;V+=1)b[W[V].id]=O}},M=0,z=f;M<z.length;M+=1)E();return b}(t.buckets,n.style),this.hasSymbolBuckets=!1,this.buckets){var w=this.buckets[_];if(w instanceof _i){if(this.hasSymbolBuckets=!0,!h)break;w.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var C in this.buckets){var r=this.buckets[C];if(r instanceof _i&&r.hasRTLText){this.hasRTLText=!0,er.isLoading()||er.isLoaded()||No()!=="deferred"||mo();break}}for(var e in this.queryPadding=0,this.buckets){var s=this.buckets[e];this.queryPadding=Math.max(this.queryPadding,n.style.getLayer(e).queryRadius(s))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new m},Bn.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},Bn.prototype.getBucket=function(t){return this.buckets[t.id]},Bn.prototype.upload=function(t){for(var n in this.buckets){var h=this.buckets[n];h.uploadPending()&&h.upload(t)}var _=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new mu(t,this.imageAtlas.image,_.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new mu(t,this.glyphAtlasImage,_.ALPHA),this.glyphAtlasImage=null)},Bn.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},Bn.prototype.queryRenderedFeatures=function(t,n,h,_,w,C,r,e,s,f){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:_,cameraQueryGeometry:w,scale:C,tileSize:this.tileSize,pixelPosMatrix:f,transform:e,params:r,queryPadding:this.queryPadding*s},t,n,h):{}},Bn.prototype.querySourceFeatures=function(t,n){var h=this.latestFeatureIndex;if(h&&h.rawTileData){var _=h.loadVTLayers(),w=n?n.sourceLayer:"",C=_._geojsonTileLayer||_[w];if(C)for(var r=wl(n&&n.filter),e=this.tileID.canonical,s=e.z,f=e.x,y=e.y,b={z:s,x:f,y},E=0;E<C.length;E++){var M=C.feature(E);if(r.needGeometry){var z=Kr(M,!0);if(!r.filter(new Oe(this.tileID.overscaledZ),z,this.tileID.canonical))continue}else if(!r.filter(new Oe(this.tileID.overscaledZ),M))continue;var O=h.getId(M,w),G=new Hc(M,s,f,y,O);G.tile=b,t.push(G)}}},Bn.prototype.hasData=function(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"},Bn.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Bn.prototype.setExpiryData=function(t){var n=this.expirationTime;if(t.cacheControl){var h=Lr(t.cacheControl);h["max-age"]&&(this.expirationTime=Date.now()+1e3*h["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var _=Date.now(),w=!1;if(this.expirationTime>_)w=!1;else if(n)if(this.expirationTime<n)w=!0;else{var C=this.expirationTime-n;C?this.expirationTime=_+Math.max(C,3e4):w=!0}else w=!0;w?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},Bn.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)},Bn.prototype.setFeatureState=function(t,n){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&Object.keys(t).length!==0){var h=this.latestFeatureIndex.loadVTLayers();for(var _ in this.buckets)if(n.style.hasLayer(_)){var w=this.buckets[_],C=w.layers[0].sourceLayer||"_geojsonTileLayer",r=h[C],e=t[C];if(r&&e&&Object.keys(e).length!==0){w.update(e,r,this.imageAtlas&&this.imageAtlas.patternPositions||{});var s=n&&n.style&&n.style.getLayer(_);s&&(this.queryPadding=Math.max(this.queryPadding,s.queryRadius(w)))}}}},Bn.prototype.holdingForFade=function(){return this.symbolFadeHoldUntil!==void 0},Bn.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<Ri.now()},Bn.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},Bn.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=Ri.now()+t},Bn.prototype.setDependencies=function(t,n){for(var h={},_=0,w=n;_<w.length;_+=1)h[w[_]]=!0;this.dependencies[t]=h},Bn.prototype.hasDependency=function(t,n){for(var h=0,_=t;h<_.length;h+=1){var w=this.dependencies[_[h]];if(w){for(var C=0,r=n;C<r.length;C+=1)if(w[r[C]])return!0}}return!1};var Fl=N.performance,Df=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},Fl.mark(this._marks.start)};Df.prototype.finish=function(){Fl.mark(this._marks.end);var t=Fl.getEntriesByName(this._marks.measure);return t.length===0&&(Fl.measure(this._marks.measure,this._marks.start,this._marks.end),t=Fl.getEntriesByName(this._marks.measure),Fl.clearMarks(this._marks.start),Fl.clearMarks(this._marks.end),Fl.clearMeasures(this._marks.measure)),t},i.Actor=gu,i.AlphaImage=Yu,i.CanonicalTileID=vu,i.CollisionBoxArray=m,i.Color=Sr,i.DEMData=is,i.DataConstantProperty=je,i.DictionaryCoder=Vh,i.EXTENT=8192,i.ErrorEvent=Bt,i.EvaluationParameters=Oe,i.Event=It,i.Evented=Gt,i.FeatureIndex=Ba,i.FillBucket=ks,i.FillExtrusionBucket=zs,i.ImageAtlas=Lh,i.ImagePosition=yp,i.LineBucket=bo,i.LngLat=Ni,i.LngLatBounds=Pn,i.MercatorCoordinate=_u,i.ONE_EM=24,i.OverscaledTileID=yn,i.Point=F,i.Point$1=F,i.Properties=T,i.Protobuf=gp,i.RGBAImage=xo,i.RequestManager=en,i.RequestPerformance=Df,i.ResourceType=Rr,i.SegmentVector=ft,i.SourceFeatureState=Oo,i.StructArrayLayout1ui2=Ye,i.StructArrayLayout2f1f2i16=ie,i.StructArrayLayout2i4=q,i.StructArrayLayout3ui6=_e,i.StructArrayLayout4i8=$,i.SymbolBucket=_i,i.Texture=mu,i.Tile=Bn,i.Transitionable=gn,i.Uniform1f=ke,i.Uniform1i=xe,i.Uniform2f=Le,i.Uniform3f=$e,i.Uniform4f=lr,i.UniformColor=hr,i.UniformMatrix4f=Zr,i.UnwrappedTileID=kf,i.ValidationError=zt,i.WritingMode=ma,i.ZoomHistory=da,i.add=function(t,n,h){return t[0]=n[0]+h[0],t[1]=n[1]+h[1],t[2]=n[2]+h[2],t},i.addDynamicAttributes=Pf,i.asyncAll=function(t,n,h){if(!t.length)return h(null,[]);var _=t.length,w=new Array(t.length),C=null;t.forEach(function(r,e){n(r,function(s,f){s&&(C=s),w[e]=f,--_==0&&h(C,w)})})},i.bezier=yt,i.bindAll=ce,i.browser=Ri,i.cacheEntryPossiblyAdded=function(t){++ai>ii&&(t.getActor().send("enforceCacheSizeLimit",wn),ai=0)},i.clamp=kt,i.clearTileCache=function(t){var n=N.caches.delete("mapbox-tiles");t&&n.catch(t).then(function(){return t()})},i.clipLine=Af,i.clone=function(t){var n=new ri(16);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n},i.clone$1=Me,i.clone$2=function(t){var n=new ri(3);return n[0]=t[0],n[1]=t[1],n[2]=t[2],n},i.collisionCircleLayout=Fd,i.config=Wr,i.create=function(){var t=new ri(16);return ri!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},i.create$1=function(){var t=new ri(9);return ri!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},i.create$2=function(){var t=new ri(4);return ri!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},i.createCommonjsModule=u,i.createExpression=vl,i.createLayout=L,i.createStyleLayer=function(t){return t.type==="custom"?new Mf(t):new Ng[t.type](t)},i.cross=function(t,n,h){var _=n[0],w=n[1],C=n[2],r=h[0],e=h[1],s=h[2];return t[0]=w*s-C*e,t[1]=C*r-_*s,t[2]=_*e-w*r,t},i.deepEqual=function t(n,h){if(Array.isArray(n)){if(!Array.isArray(h)||n.length!==h.length)return!1;for(var _=0;_<n.length;_++)if(!t(n[_],h[_]))return!1;return!0}if(typeof n=="object"&&n!==null&&h!==null){if(typeof h!="object"||Object.keys(n).length!==Object.keys(h).length)return!1;for(var w in n)if(!t(n[w],h[w]))return!1;return!0}return n===h},i.dot=function(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]},i.dot$1=function(t,n){return t[0]*n[0]+t[1]*n[1]+t[2]*n[2]+t[3]*n[3]},i.ease=Tt,i.emitValidationErrors=Xs,i.endsWith=oe,i.enforceCacheSizeLimit=function(t){En(),$i&&$i.then(function(n){n.keys().then(function(h){for(var _=0;_<h.length-t;_++)n.delete(h[_])})})},i.evaluateSizeForFeature=Sf,i.evaluateSizeForZoom=Tf,i.evaluateVariableOffset=Bh,i.evented=$u,i.extend=wt,i.featureFilter=wl,i.filterObject=be,i.fromRotation=function(t,n){var h=Math.sin(n),_=Math.cos(n);return t[0]=_,t[1]=h,t[2]=0,t[3]=-h,t[4]=_,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},i.getAnchorAlignment=ec,i.getAnchorJustification=wp,i.getArrayBuffer=Rn,i.getImage=it,i.getJSON=function(t,n){return ho(wt(t,{type:"json"}),n)},i.getRTLTextPluginStatus=No,i.getReferrer=qi,i.getVideo=function(t,n){var h,_,w=N.document.createElement("video");w.muted=!0,w.onloadstart=function(){n(null,w)};for(var C=0;C<t.length;C++){var r=N.document.createElement("source");h=t[C],_=void 0,(_=N.document.createElement("a")).href=h,(_.protocol!==N.document.location.protocol||_.host!==N.document.location.host)&&(w.crossOrigin="Anonymous"),r.src=t[C],w.appendChild(r)}return{cancel:function(){}}},i.identity=vo,i.invert=function(t,n){var h=n[0],_=n[1],w=n[2],C=n[3],r=n[4],e=n[5],s=n[6],f=n[7],y=n[8],b=n[9],E=n[10],M=n[11],z=n[12],O=n[13],G=n[14],V=n[15],W=h*e-_*r,Y=h*s-w*r,H=h*f-C*r,ot=_*s-w*e,ht=_*f-C*e,Pt=w*f-C*s,Ut=y*O-b*z,jt=y*G-E*z,qt=y*V-M*z,re=b*G-E*O,Xt=b*V-M*O,Te=E*V-M*G,Ee=W*Te-Y*Xt+H*re+ot*qt-ht*jt+Pt*Ut;return Ee?(t[0]=(e*Te-s*Xt+f*re)*(Ee=1/Ee),t[1]=(w*Xt-_*Te-C*re)*Ee,t[2]=(O*Pt-G*ht+V*ot)*Ee,t[3]=(E*ht-b*Pt-M*ot)*Ee,t[4]=(s*qt-r*Te-f*jt)*Ee,t[5]=(h*Te-w*qt+C*jt)*Ee,t[6]=(G*H-z*Pt-V*Y)*Ee,t[7]=(y*Pt-E*H+M*Y)*Ee,t[8]=(r*Xt-e*qt+f*Ut)*Ee,t[9]=(_*qt-h*Xt-C*Ut)*Ee,t[10]=(z*ht-O*H+V*W)*Ee,t[11]=(b*H-y*ht-M*W)*Ee,t[12]=(e*jt-r*re-s*Ut)*Ee,t[13]=(h*re-_*jt+w*Ut)*Ee,t[14]=(O*Y-z*ot-G*W)*Ee,t[15]=(y*ot-b*Y+E*W)*Ee,t):null},i.isChar=Ne,i.isMapboxURL=ji,i.keysDifference=function(t,n){var h=[];for(var _ in t)_ in n||h.push(_);return h},i.makeRequest=ho,i.mapObject=ye,i.mercatorXfromLng=Lf,i.mercatorYfromLat=pn,i.mercatorZfromAltitude=yu,i.mul=uu,i.multiply=Do,i.mvt=Nc,i.nextPowerOfTwo=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},i.normalize=function(t,n){var h=n[0],_=n[1],w=n[2],C=h*h+_*_+w*w;return C>0&&(C=1/Math.sqrt(C)),t[0]=n[0]*C,t[1]=n[1]*C,t[2]=n[2]*C,t},i.number=Ji,i.offscreenCanvasSupported=Ge,i.ortho=function(t,n,h,_,w,C,r){var e=1/(n-h),s=1/(_-w),f=1/(C-r);return t[0]=-2*e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*f,t[11]=0,t[12]=(n+h)*e,t[13]=(w+_)*s,t[14]=(r+C)*f,t[15]=1,t},i.parseGlyphPBF=function(t){return new gp(t).readFields(Ig,[])},i.pbf=gp,i.performSymbolLayout=function(t,n,h,_,w,C,r){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var e=t.layers[0].layout,s=t.layers[0]._unevaluatedLayout._values,f={};if(t.textSizeData.kind==="composite"){var y=t.textSizeData,b=y.maxZoom;f.compositeTextSizes=[s["text-size"].possiblyEvaluate(new Oe(y.minZoom),r),s["text-size"].possiblyEvaluate(new Oe(b),r)]}if(t.iconSizeData.kind==="composite"){var E=t.iconSizeData,M=E.maxZoom;f.compositeIconSizes=[s["icon-size"].possiblyEvaluate(new Oe(E.minZoom),r),s["icon-size"].possiblyEvaluate(new Oe(M),r)]}f.layoutTextSize=s["text-size"].possiblyEvaluate(new Oe(t.zoom+1),r),f.layoutIconSize=s["icon-size"].possiblyEvaluate(new Oe(t.zoom+1),r),f.textMaxSize=s["text-size"].possiblyEvaluate(new Oe(18));for(var z=24*e.get("text-line-height"),O=e.get("text-rotation-alignment")==="map"&&e.get("symbol-placement")!=="point",G=e.get("text-keep-upright"),V=e.get("text-size"),W=function(){var ot=H[Y],ht=e.get("text-font").evaluate(ot,{},r).join(","),Pt=V.evaluate(ot,{},r),Ut=f.layoutTextSize.evaluate(ot,{},r),jt=f.layoutIconSize.evaluate(ot,{},r),qt={horizontal:{},vertical:void 0},re=ot.text,Xt=[0,0];if(re){var Te=re.toString(),Ee=24*e.get("text-letter-spacing").evaluate(ot,{},r),ue=function(Cr){for(var Or=0,Vr=Cr;Or<Vr.length;Or+=1)if(Mr=Vr[Or].charCodeAt(0),Ne.Arabic(Mr)||Ne["Arabic Supplement"](Mr)||Ne["Arabic Extended-A"](Mr)||Ne["Arabic Presentation Forms-A"](Mr)||Ne["Arabic Presentation Forms-B"](Mr))return!1;var Mr;return!0}(Te)?Ee:0,we=e.get("text-anchor").evaluate(ot,{},r),me=e.get("text-variable-anchor");if(!me){var Ae=e.get("text-radial-offset").evaluate(ot,{},r);Xt=Ae?Bh(we,[24*Ae,bp]):e.get("text-offset").evaluate(ot,{},r).map(function(Cr){return 24*Cr})}var pe=O?"center":e.get("text-justify").evaluate(ot,{},r),ge=e.get("symbol-placement"),He=ge==="point"?24*e.get("text-max-width").evaluate(ot,{},r):0,Ke=function(){t.allowVerticalPlacement&&Sl(Te)&&(qt.vertical=kh(re,n,h,w,ht,He,z,we,"left",ue,Xt,ma.vertical,!0,ge,Ut,Pt))};if(!O&&me){for(var gr=pe==="auto"?me.map(function(Cr){return wp(Cr)}):[pe],wr=!1,Nr=0;Nr<gr.length;Nr++){var Xr=gr[Nr];if(!qt.horizontal[Xr])if(wr)qt.horizontal[Xr]=qt.horizontal[0];else{var li=kh(re,n,h,w,ht,He,z,"center",Xr,ue,Xt,ma.horizontal,!1,ge,Ut,Pt);li&&(qt.horizontal[Xr]=li,wr=li.positionedLines.length===1)}}Ke()}else{pe==="auto"&&(pe=wp(we));var ui=kh(re,n,h,w,ht,He,z,we,pe,ue,Xt,ma.horizontal,!1,ge,Ut,Pt);ui&&(qt.horizontal[pe]=ui),Ke(),Sl(Te)&&O&&G&&(qt.vertical=kh(re,n,h,w,ht,He,z,we,pe,ue,Xt,ma.vertical,!1,ge,Ut,Pt))}}var Jr=void 0,di=!1;if(ot.icon&&ot.icon.name){var Qr=_[ot.icon.name];Qr&&(Jr=function(Cr,Or,Vr){var Mr=ec(Vr),Ai=Or[0]-Cr.displaySize[0]*Mr.horizontalAlign,Ti=Or[1]-Cr.displaySize[1]*Mr.verticalAlign;return{image:Cr,top:Ti,bottom:Ti+Cr.displaySize[1],left:Ai,right:Ai+Cr.displaySize[0]}}(w[ot.icon.name],e.get("icon-offset").evaluate(ot,{},r),e.get("icon-anchor").evaluate(ot,{},r)),di=Qr.sdf,t.sdfIcons===void 0?t.sdfIcons=Qr.sdf:t.sdfIcons!==Qr.sdf&&Be("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(Qr.pixelRatio!==t.pixelRatio||e.get("icon-rotate").constantOr(1)!==0)&&(t.iconsNeedLinear=!0))}var mi=Nh(qt.horizontal)||qt.vertical;t.iconsInText=!!mi&&mi.iconsInText,(mi||Jr)&&function(Cr,Or,Vr,Mr,Ai,Ti,Hr,qr,fi,or,Mn){var ki=Ti.textMaxSize.evaluate(Or,{});ki===void 0&&(ki=Hr);var an,vi=Cr.layers[0].layout,to=vi.get("icon-offset").evaluate(Or,{},Mn),Un=Nh(Vr.horizontal),ga=Hr/24,wo=Cr.tilePixelRatio*ga,Eo=Cr.tilePixelRatio*ki/24,Ln=Cr.tilePixelRatio*qr,ya=Cr.tilePixelRatio*vi.get("symbol-spacing"),xu=vi.get("text-padding")*Cr.tilePixelRatio,sc=vi.get("icon-padding")*Cr.tilePixelRatio,lc=vi.get("text-max-angle")/180*Math.PI,Jc=vi.get("text-rotation-alignment")==="map"&&vi.get("symbol-placement")!=="point",ns=vi.get("icon-rotation-alignment")==="map"&&vi.get("symbol-placement")!=="point",tl=vi.get("symbol-placement"),uc=ya/2,bu=vi.get("icon-text-fit");Mr&&bu!=="none"&&(Cr.allowVerticalPlacement&&Vr.vertical&&(an=zh(Mr,Vr.vertical,bu,vi.get("icon-text-fit-padding"),to,ga)),Un&&(Mr=zh(Mr,Un,bu,vi.get("icon-text-fit-padding"),to,ga)));var Bl=function(C1,Of){Of.x<0||Of.x>=8192||Of.y<0||Of.y>=8192||function(kn,Nl,A1,eh,qg,V_,rm,wu,im,Ff,nm,om,Zg,G_,Bf,j_,q_,Z_,X_,W_,as,am,$_,Eu,P1){var K_,Xh,zp,Rp,Dp,Op=kn.addToLineVertexArray(Nl,A1),Y_=0,H_=0,J_=0,Q_=0,Xg=-1,Wg=-1,pc={},tv=xt(""),$g=0,Kg=0;if(wu._unevaluatedLayout.getValue("text-radial-offset")===void 0?($g=(K_=wu.layout.get("text-offset").evaluate(as,{},Eu).map(function(Nf){return 24*Nf}))[0],Kg=K_[1]):($g=24*wu.layout.get("text-radial-offset").evaluate(as,{},Eu),Kg=bp),kn.allowVerticalPlacement&&eh.vertical){var ev=wu.layout.get("text-rotate").evaluate(as,{},Eu)+90;Rp=new Fh(im,Nl,Ff,nm,om,eh.vertical,Zg,G_,Bf,ev),rm&&(Dp=new Fh(im,Nl,Ff,nm,om,rm,q_,Z_,Bf,ev))}if(qg){var Yg=wu.layout.get("icon-rotate").evaluate(as,{}),rv=wu.layout.get("icon-text-fit")!=="none",iv=Js(qg,Yg,$_,rv),Hg=rm?Js(rm,Yg,$_,rv):void 0;zp=new Fh(im,Nl,Ff,nm,om,qg,q_,Z_,!1,Yg),Y_=4*iv.length;var nv=kn.iconSizeData,Uf=null;nv.kind==="source"?(Uf=[128*wu.layout.get("icon-size").evaluate(as,{})])[0]>32640&&Be(kn.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):nv.kind==="composite"&&((Uf=[128*am.compositeIconSizes[0].evaluate(as,{},Eu),128*am.compositeIconSizes[1].evaluate(as,{},Eu)])[0]>32640||Uf[1]>32640)&&Be(kn.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),kn.addSymbols(kn.icon,iv,Uf,W_,X_,as,!1,Nl,Op.lineStartIndex,Op.lineLength,-1,Eu),Xg=kn.icon.placedSymbolArray.length-1,Hg&&(H_=4*Hg.length,kn.addSymbols(kn.icon,Hg,Uf,W_,X_,as,ma.vertical,Nl,Op.lineStartIndex,Op.lineLength,-1,Eu),Wg=kn.icon.placedSymbolArray.length-1)}for(var ov in eh.horizontal){var sm=eh.horizontal[ov];if(!Xh){tv=xt(sm.text);var M1=wu.layout.get("text-rotate").evaluate(as,{},Eu);Xh=new Fh(im,Nl,Ff,nm,om,sm,Zg,G_,Bf,M1)}var av=sm.positionedLines.length===1;if(J_+=Uh(kn,Nl,sm,V_,wu,Bf,as,j_,Op,eh.vertical?ma.horizontal:ma.horizontalOnly,av?Object.keys(eh.horizontal):[ov],pc,Xg,am,Eu),av)break}eh.vertical&&(Q_+=Uh(kn,Nl,eh.vertical,V_,wu,Bf,as,j_,Op,ma.vertical,["vertical"],pc,Wg,am,Eu));var L1=Xh?Xh.boxStartIndex:kn.collisionBoxArray.length,k1=Xh?Xh.boxEndIndex:kn.collisionBoxArray.length,z1=Rp?Rp.boxStartIndex:kn.collisionBoxArray.length,R1=Rp?Rp.boxEndIndex:kn.collisionBoxArray.length,D1=zp?zp.boxStartIndex:kn.collisionBoxArray.length,O1=zp?zp.boxEndIndex:kn.collisionBoxArray.length,F1=Dp?Dp.boxStartIndex:kn.collisionBoxArray.length,B1=Dp?Dp.boxEndIndex:kn.collisionBoxArray.length,Su=-1,lm=function(Nf,lv){return Nf&&Nf.circleDiameter?Math.max(Nf.circleDiameter,lv):lv};Su=lm(Xh,Su),Su=lm(Rp,Su),Su=lm(zp,Su);var sv=(Su=lm(Dp,Su))>-1?1:0;sv&&(Su*=P1/24),kn.glyphOffsetArray.length>=_i.MAX_GLYPHS&&Be("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),as.sortKey!==void 0&&kn.addToSortKeyRanges(kn.symbolInstances.length,as.sortKey),kn.symbolInstances.emplaceBack(Nl.x,Nl.y,pc.right>=0?pc.right:-1,pc.center>=0?pc.center:-1,pc.left>=0?pc.left:-1,pc.vertical||-1,Xg,Wg,tv,L1,k1,z1,R1,D1,O1,F1,B1,Ff,J_,Q_,Y_,H_,sv,0,Zg,$g,Kg,Su)}(Cr,Of,C1,Vr,Mr,Ai,an,Cr.layers[0],Cr.collisionBoxArray,Or.index,Or.sourceLayerIndex,Cr.index,wo,xu,Jc,fi,Ln,sc,ns,to,Or,Ti,or,Mn,Hr)};if(tl==="line")for(var Qc=0,Mp=Af(Or.geometry,0,0,8192,8192);Qc<Mp.length;Qc+=1)for(var Lp=Mp[Qc],Gh=0,jh=Lg(Lp,ya,lc,Vr.vertical||Un,Mr,24,Eo,Cr.overscaling,8192);Gh<jh.length;Gh+=1){var kp=jh[Gh];Un&&Ep(Cr,Un.text,uc,kp)||Bl(Lp,kp)}else if(tl==="line-center")for(var qh=0,Zh=Or.geometry;qh<Zh.length;qh+=1){var Jo=Zh[qh];if(Jo.length>1){var cc=Mg(Jo,lc,Vr.vertical||Un,Mr,24,Eo);cc&&Bl(Jo,cc)}}else if(Or.type==="Polygon")for(var hc=0,So=dp(Or.geometry,0);hc<So.length;hc+=1){var Qo=So[hc],Ul=zg(Qo,16);Bl(Qo[0],new Dl(Ul.x,Ul.y,0))}else if(Or.type==="LineString")for(var Rs=0,th=Or.geometry;Rs<th.length;Rs+=1){var os=th[Rs];Bl(os,new Dl(os[0].x,os[0].y,0))}else if(Or.type==="Point")for(var Vg=0,U_=Or.geometry;Vg<U_.length;Vg+=1)for(var Gg=0,N_=U_[Vg];Gg<N_.length;Gg+=1){var jg=N_[Gg];Bl([jg],new Dl(jg.x,jg.y,0))}}(t,ot,qt,Jr,_,f,Ut,jt,Xt,di,r)},Y=0,H=t.features;Y<H.length;Y+=1)W();C&&t.generateCollisionDebugBuffers()},i.perspective=function(t,n,h,_,w){var C,r=1/Math.tan(n/2);return t[0]=r/h,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,w!=null&&w!==1/0?(t[10]=(w+_)*(C=1/(_-w)),t[14]=2*w*_*C):(t[10]=-1,t[14]=-2*_),t},i.pick=function(t,n){for(var h={},_=0;_<n.length;_++){var w=n[_];w in t&&(h[w]=t[w])}return h},i.plugin=er,i.polygonIntersectsPolygon=Vo,i.postMapLoadEvent=no,i.postTurnstileEvent=fe,i.potpack=Wd,i.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],i.register=tr,i.registerForPluginStateChange=function(t){return t({pluginStatus:Gn,pluginURL:Yo}),$u.on("pluginStateChange",t),t},i.renderColorRamp=fp,i.rotate=function(t,n,h){var _=n[0],w=n[1],C=n[2],r=n[3],e=Math.sin(h),s=Math.cos(h);return t[0]=_*s+C*e,t[1]=w*s+r*e,t[2]=_*-e+C*s,t[3]=w*-e+r*s,t},i.rotateX=function(t,n,h){var _=Math.sin(h),w=Math.cos(h),C=n[4],r=n[5],e=n[6],s=n[7],f=n[8],y=n[9],b=n[10],E=n[11];return n!==t&&(t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[4]=C*w+f*_,t[5]=r*w+y*_,t[6]=e*w+b*_,t[7]=s*w+E*_,t[8]=f*w-C*_,t[9]=y*w-r*_,t[10]=b*w-e*_,t[11]=E*w-s*_,t},i.rotateZ=function(t,n,h){var _=Math.sin(h),w=Math.cos(h),C=n[0],r=n[1],e=n[2],s=n[3],f=n[4],y=n[5],b=n[6],E=n[7];return n!==t&&(t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15]),t[0]=C*w+f*_,t[1]=r*w+y*_,t[2]=e*w+b*_,t[3]=s*w+E*_,t[4]=f*w-C*_,t[5]=y*w-r*_,t[6]=b*w-e*_,t[7]=E*w-s*_,t},i.scale=function(t,n,h){var _=h[0],w=h[1],C=h[2];return t[0]=n[0]*_,t[1]=n[1]*_,t[2]=n[2]*_,t[3]=n[3]*_,t[4]=n[4]*w,t[5]=n[5]*w,t[6]=n[6]*w,t[7]=n[7]*w,t[8]=n[8]*C,t[9]=n[9]*C,t[10]=n[10]*C,t[11]=n[11]*C,t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],t},i.scale$1=function(t,n,h){return t[0]=n[0]*h,t[1]=n[1]*h,t[2]=n[2]*h,t[3]=n[3]*h,t},i.scale$2=function(t,n,h){return t[0]=n[0]*h,t[1]=n[1]*h,t[2]=n[2]*h,t},i.setCacheLimits=function(t,n){wn=t,ii=n},i.setRTLTextPlugin=function(t,n,h){if(h===void 0&&(h=!1),Gn==="deferred"||Gn==="loading"||Gn==="loaded")throw new Error("setRTLTextPlugin cannot be called multiple times.");Yo=Ri.resolveURL(t),Gn="deferred",As=n,Ks(),h||mo()},i.sphericalToCartesian=function(t){var n=t[0],h=t[1],_=t[2];return h+=90,h*=Math.PI/180,_*=Math.PI/180,{x:n*Math.cos(h)*Math.sin(_),y:n*Math.sin(h)*Math.sin(_),z:n*Math.cos(_)}},i.sqrLen=function(t){var n=t[0],h=t[1];return n*n+h*h},i.styleSpec=dt,i.sub=function(t,n,h){return t[0]=n[0]-h[0],t[1]=n[1]-h[1],t[2]=n[2]-h[2],t},i.symbolSize=Pg,i.transformMat3=function(t,n,h){var _=n[0],w=n[1],C=n[2];return t[0]=_*h[0]+w*h[3]+C*h[6],t[1]=_*h[1]+w*h[4]+C*h[7],t[2]=_*h[2]+w*h[5]+C*h[8],t},i.transformMat4=cu,i.translate=function(t,n,h){var _,w,C,r,e,s,f,y,b,E,M,z,O=h[0],G=h[1],V=h[2];return n===t?(t[12]=n[0]*O+n[4]*G+n[8]*V+n[12],t[13]=n[1]*O+n[5]*G+n[9]*V+n[13],t[14]=n[2]*O+n[6]*G+n[10]*V+n[14],t[15]=n[3]*O+n[7]*G+n[11]*V+n[15]):(w=n[1],C=n[2],r=n[3],e=n[4],s=n[5],f=n[6],y=n[7],b=n[8],E=n[9],M=n[10],z=n[11],t[0]=_=n[0],t[1]=w,t[2]=C,t[3]=r,t[4]=e,t[5]=s,t[6]=f,t[7]=y,t[8]=b,t[9]=E,t[10]=M,t[11]=z,t[12]=_*O+e*G+b*V+n[12],t[13]=w*O+s*G+E*V+n[13],t[14]=C*O+f*G+M*V+n[14],t[15]=r*O+y*G+z*V+n[15]),t},i.triggerPluginCompletionEvent=Wu,i.uniqueId=Zt,i.validateCustomStyleLayer=function(t){var n=[],h=t.id;return h===void 0&&n.push({message:"layers."+h+': missing required property "id"'}),t.render===void 0&&n.push({message:"layers."+h+': missing required method "render"'}),t.renderingMode&&t.renderingMode!=="2d"&&t.renderingMode!=="3d"&&n.push({message:"layers."+h+': property "renderingMode" must be either "2d" or "3d"'}),n},i.validateLight=El,i.validateStyle=Ko,i.values=function(t){var n=[];for(var h in t)n.push(t[h]);return n},i.vectorTile=Nc,i.version="1.13.2",i.warnOnce=Be,i.webpSupported=Di,i.window=N,i.wrap=Vt}),c(["./shared"],function(i){"use strict";function u(Q){var it=typeof Q;if(it==="number"||it==="boolean"||it==="string"||Q==null)return JSON.stringify(Q);if(Array.isArray(Q)){for(var st="[",_t=0,It=Q;_t<It.length;_t+=1)st+=u(It[_t])+",";return st+"]"}for(var Bt=Object.keys(Q).sort(),Gt="{",dt=0;dt<Bt.length;dt++)Gt+=JSON.stringify(Bt[dt])+":"+u(Q[Bt[dt]])+",";return Gt+"}"}function P(Q){for(var it="",st=0,_t=i.refProperties;st<_t.length;st+=1)it+="/"+u(Q[_t[st]]);return it}var D=function(Q){this.keyCache={},Q&&this.replace(Q)};D.prototype.replace=function(Q){this._layerConfigs={},this._layers={},this.update(Q,[])},D.prototype.update=function(Q,it){for(var st=this,_t=0,It=Q;_t<It.length;_t+=1){var Bt=It[_t];this._layerConfigs[Bt.id]=Bt;var Gt=this._layers[Bt.id]=i.createStyleLayer(Bt);Gt._featureFilter=i.featureFilter(Gt.filter),this.keyCache[Bt.id]&&delete this.keyCache[Bt.id]}for(var dt=0,zt=it;dt<zt.length;dt+=1){var Qt=zt[dt];delete this.keyCache[Qt],delete this._layerConfigs[Qt],delete this._layers[Qt]}this.familiesBySource={};for(var nt=0,X=function(Et,Ct){for(var te={},$t=0;$t<Et.length;$t++){var ee=Ct&&Ct[Et[$t].id]||P(Et[$t]);Ct&&(Ct[Et[$t].id]=ee);var De=te[ee];De||(De=te[ee]=[]),De.push(Et[$t])}var Se=[];for(var ze in te)Se.push(te[ze]);return Se}(i.values(this._layerConfigs),this.keyCache);nt<X.length;nt+=1){var Z=X[nt].map(function(Et){return st._layers[Et.id]}),rt=Z[0];if(rt.visibility!=="none"){var lt=rt.source||"",gt=this.familiesBySource[lt];gt||(gt=this.familiesBySource[lt]={});var pt=rt.sourceLayer||"_geojsonTileLayer",St=gt[pt];St||(St=gt[pt]=[]),St.push(Z)}}};var F=function(Q){var it={},st=[];for(var _t in Q){var It=Q[_t],Bt=it[_t]={};for(var Gt in It){var dt=It[+Gt];if(dt&&dt.bitmap.width!==0&&dt.bitmap.height!==0){var zt={x:0,y:0,w:dt.bitmap.width+2,h:dt.bitmap.height+2};st.push(zt),Bt[Gt]={rect:zt,metrics:dt.metrics}}}}var Qt=i.potpack(st),nt=new i.AlphaImage({width:Qt.w||1,height:Qt.h||1});for(var X in Q){var Z=Q[X];for(var rt in Z){var lt=Z[+rt];if(lt&&lt.bitmap.width!==0&&lt.bitmap.height!==0){var gt=it[X][rt].rect;i.AlphaImage.copy(lt.bitmap,nt,{x:0,y:0},{x:gt.x+1,y:gt.y+1},lt.bitmap)}}}this.image=nt,this.positions=it};i.register("GlyphAtlas",F);var U=function(Q){this.tileID=new i.OverscaledTileID(Q.tileID.overscaledZ,Q.tileID.wrap,Q.tileID.canonical.z,Q.tileID.canonical.x,Q.tileID.canonical.y),this.uid=Q.uid,this.zoom=Q.zoom,this.pixelRatio=Q.pixelRatio,this.tileSize=Q.tileSize,this.source=Q.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=Q.showCollisionBoxes,this.collectResourceTiming=!!Q.collectResourceTiming,this.returnDependencies=!!Q.returnDependencies,this.promoteId=Q.promoteId};function N(Q,it,st){for(var _t=new i.EvaluationParameters(it),It=0,Bt=Q;It<Bt.length;It+=1)Bt[It].recalculate(_t,st)}function at(Q,it){var st=i.getArrayBuffer(Q.request,function(_t,It,Bt,Gt){_t?it(_t):It&&it(null,{vectorTile:new i.vectorTile.VectorTile(new i.pbf(It)),rawData:It,cacheControl:Bt,expires:Gt})});return function(){st.cancel(),it()}}U.prototype.parse=function(Q,it,st,_t,It){var Bt=this;this.status="parsing",this.data=Q,this.collisionBoxArray=new i.CollisionBoxArray;var Gt=new i.DictionaryCoder(Object.keys(Q.layers).sort()),dt=new i.FeatureIndex(this.tileID,this.promoteId);dt.bucketLayerIDs=[];var zt,Qt,nt,X,Z={},rt={featureIndex:dt,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:st},lt=it.familiesBySource[this.source];for(var gt in lt){var pt=Q.layers[gt];if(pt){pt.version===1&&i.warnOnce('Vector tile source "'+this.source+'" layer "'+gt+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var St=Gt.encode(gt),Et=[],Ct=0;Ct<pt.length;Ct++){var te=pt.feature(Ct),$t=dt.getId(te,gt);Et.push({feature:te,id:$t,index:Ct,sourceLayerIndex:St})}for(var ee=0,De=lt[gt];ee<De.length;ee+=1){var Se=De[ee],ze=Se[0];ze.minzoom&&this.zoom<Math.floor(ze.minzoom)||ze.maxzoom&&this.zoom>=ze.maxzoom||ze.visibility!=="none"&&(N(Se,this.zoom,st),(Z[ze.id]=ze.createBucket({index:dt.bucketLayerIDs.length,layers:Se,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:St,sourceID:this.source})).populate(Et,rt,this.tileID.canonical),dt.bucketLayerIDs.push(Se.map(function(nr){return nr.id})))}}}var Ue=i.mapObject(rt.glyphDependencies,function(nr){return Object.keys(nr).map(Number)});Object.keys(Ue).length?_t.send("getGlyphs",{uid:this.uid,stacks:Ue},function(nr,Xe){zt||(zt=nr,Qt=Xe,mr.call(Bt))}):Qt={};var Dr=Object.keys(rt.iconDependencies);Dr.length?_t.send("getImages",{icons:Dr,source:this.source,tileID:this.tileID,type:"icons"},function(nr,Xe){zt||(zt=nr,nt=Xe,mr.call(Bt))}):nt={};var ur=Object.keys(rt.patternDependencies);function mr(){if(zt)return It(zt);if(Qt&&nt&&X){var nr=new F(Qt),Xe=new i.ImageAtlas(nt,X);for(var Sr in Z){var ni=Z[Sr];ni instanceof i.SymbolBucket?(N(ni.layers,this.zoom,st),i.performSymbolLayout(ni,Qt,nr.positions,nt,Xe.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):ni.hasPattern&&(ni instanceof i.LineBucket||ni instanceof i.FillBucket||ni instanceof i.FillExtrusionBucket)&&(N(ni.layers,this.zoom,st),ni.addFeatures(rt,this.tileID.canonical,Xe.patternPositions))}this.status="done",It(null,{buckets:i.values(Z).filter(function(rn){return!rn.isEmpty()}),featureIndex:dt,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:nr.image,imageAtlas:Xe,glyphMap:this.returnDependencies?Qt:null,iconMap:this.returnDependencies?nt:null,glyphPositions:this.returnDependencies?nr.positions:null})}}ur.length?_t.send("getImages",{icons:ur,source:this.source,tileID:this.tileID,type:"patterns"},function(nr,Xe){zt||(zt=nr,X=Xe,mr.call(Bt))}):X={},mr.call(this)};var yt=function(Q,it,st,_t){this.actor=Q,this.layerIndex=it,this.availableImages=st,this.loadVectorData=_t||at,this.loading={},this.loaded={}};yt.prototype.loadTile=function(Q,it){var st=this,_t=Q.uid;this.loading||(this.loading={});var It=!!(Q&&Q.request&&Q.request.collectResourceTiming)&&new i.RequestPerformance(Q.request),Bt=this.loading[_t]=new U(Q);Bt.abort=this.loadVectorData(Q,function(Gt,dt){if(delete st.loading[_t],Gt||!dt)return Bt.status="done",st.loaded[_t]=Bt,it(Gt);var zt=dt.rawData,Qt={};dt.expires&&(Qt.expires=dt.expires),dt.cacheControl&&(Qt.cacheControl=dt.cacheControl);var nt={};if(It){var X=It.finish();X&&(nt.resourceTiming=JSON.parse(JSON.stringify(X)))}Bt.vectorTile=dt.vectorTile,Bt.parse(dt.vectorTile,st.layerIndex,st.availableImages,st.actor,function(Z,rt){if(Z||!rt)return it(Z);it(null,i.extend({rawTileData:zt.slice(0)},rt,Qt,nt))}),st.loaded=st.loaded||{},st.loaded[_t]=Bt})},yt.prototype.reloadTile=function(Q,it){var st=this,_t=this.loaded,It=Q.uid,Bt=this;if(_t&&_t[It]){var Gt=_t[It];Gt.showCollisionBoxes=Q.showCollisionBoxes;var dt=function(zt,Qt){var nt=Gt.reloadCallback;nt&&(delete Gt.reloadCallback,Gt.parse(Gt.vectorTile,Bt.layerIndex,st.availableImages,Bt.actor,nt)),it(zt,Qt)};Gt.status==="parsing"?Gt.reloadCallback=dt:Gt.status==="done"&&(Gt.vectorTile?Gt.parse(Gt.vectorTile,this.layerIndex,this.availableImages,this.actor,dt):dt())}},yt.prototype.abortTile=function(Q,it){var st=this.loading,_t=Q.uid;st&&st[_t]&&st[_t].abort&&(st[_t].abort(),delete st[_t]),it()},yt.prototype.removeTile=function(Q,it){var st=this.loaded,_t=Q.uid;st&&st[_t]&&delete st[_t],it()};var Tt=i.window.ImageBitmap,kt=function(){this.loaded={}};function Vt(Q,it){if(Q.length!==0){wt(Q[0],it);for(var st=1;st<Q.length;st++)wt(Q[st],!it)}}function wt(Q,it){for(var st=0,_t=0,It=Q.length,Bt=It-1;_t<It;Bt=_t++)st+=(Q[_t][0]-Q[Bt][0])*(Q[Bt][1]+Q[_t][1]);st>=0!=!!it&&Q.reverse()}kt.prototype.loadTile=function(Q,it){var st=Q.uid,_t=Q.encoding,It=Q.rawImageData,Bt=Tt&&It instanceof Tt?this.getImageData(It):It,Gt=new i.DEMData(st,Bt,_t);this.loaded=this.loaded||{},this.loaded[st]=Gt,it(null,Gt)},kt.prototype.getImageData=function(Q){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(Q.width,Q.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=Q.width,this.offscreenCanvas.height=Q.height,this.offscreenCanvasContext.drawImage(Q,0,0,Q.width,Q.height);var it=this.offscreenCanvasContext.getImageData(-1,-1,Q.width+2,Q.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new i.RGBAImage({width:it.width,height:it.height},it.data)},kt.prototype.removeTile=function(Q){var it=this.loaded,st=Q.uid;it&&it[st]&&delete it[st]};var Lt=i.vectorTile.VectorTileFeature.prototype.toGeoJSON,Zt=function(Q){this._feature=Q,this.extent=i.EXTENT,this.type=Q.type,this.properties=Q.tags,"id"in Q&&!isNaN(Q.id)&&(this.id=parseInt(Q.id,10))};Zt.prototype.loadGeometry=function(){if(this._feature.type===1){for(var Q=[],it=0,st=this._feature.geometry;it<st.length;it+=1){var _t=st[it];Q.push([new i.Point$1(_t[0],_t[1])])}return Q}for(var It=[],Bt=0,Gt=this._feature.geometry;Bt<Gt.length;Bt+=1){for(var dt=[],zt=0,Qt=Gt[Bt];zt<Qt.length;zt+=1){var nt=Qt[zt];dt.push(new i.Point$1(nt[0],nt[1]))}It.push(dt)}return It},Zt.prototype.toGeoJSON=function(Q,it,st){return Lt.call(this,Q,it,st)};var Jt=function(Q){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=i.EXTENT,this.length=Q.length,this._features=Q};Jt.prototype.feature=function(Q){return new Zt(this._features[Q])};var se=i.vectorTile.VectorTileFeature,ce=oe;function oe(Q,it){this.options=it||{},this.features=Q,this.length=Q.length}function ye(Q,it){this.id=typeof Q.id=="number"?Q.id:void 0,this.type=Q.type,this.rawGeometry=Q.type===1?[Q.geometry]:Q.geometry,this.properties=Q.tags,this.extent=it||4096}oe.prototype.feature=function(Q){return new ye(this.features[Q],this.options.extent)},ye.prototype.loadGeometry=function(){var Q=this.rawGeometry;this.geometry=[];for(var it=0;it<Q.length;it++){for(var st=Q[it],_t=[],It=0;It<st.length;It++)_t.push(new i.Point$1(st[It][0],st[It][1]));this.geometry.push(_t)}return this.geometry},ye.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var Q=this.geometry,it=1/0,st=-1/0,_t=1/0,It=-1/0,Bt=0;Bt<Q.length;Bt++)for(var Gt=Q[Bt],dt=0;dt<Gt.length;dt++){var zt=Gt[dt];it=Math.min(it,zt.x),st=Math.max(st,zt.x),_t=Math.min(_t,zt.y),It=Math.max(It,zt.y)}return[it,_t,st,It]},ye.prototype.toGeoJSON=se.prototype.toGeoJSON;var be=ir,Me=ce;function ir(Q){var it=new i.pbf;return function(st,_t){for(var It in st.layers)_t.writeMessage(3,Be,st.layers[It])}(Q,it),it.finish()}function Be(Q,it){var st;it.writeVarintField(15,Q.version||1),it.writeStringField(1,Q.name||""),it.writeVarintField(5,Q.extent||4096);var _t={keys:[],values:[],keycache:{},valuecache:{}};for(st=0;st<Q.length;st++)_t.feature=Q.feature(st),it.writeMessage(2,qe,_t);var It=_t.keys;for(st=0;st<It.length;st++)it.writeStringField(3,It[st]);var Bt=_t.values;for(st=0;st<Bt.length;st++)it.writeMessage(4,_r,Bt[st])}function qe(Q,it){var st=Q.feature;st.id!==void 0&&it.writeVarintField(1,st.id),it.writeMessage(2,rr,Q),it.writeVarintField(3,st.type),it.writeMessage(4,yr,st)}function rr(Q,it){var st=Q.feature,_t=Q.keys,It=Q.values,Bt=Q.keycache,Gt=Q.valuecache;for(var dt in st.properties){var zt=Bt[dt];zt===void 0&&(_t.push(dt),Bt[dt]=zt=_t.length-1),it.writeVarint(zt);var Qt=st.properties[dt],nt=typeof Qt;nt!=="string"&&nt!=="boolean"&&nt!=="number"&&(Qt=JSON.stringify(Qt));var X=nt+":"+Qt,Z=Gt[X];Z===void 0&&(It.push(Qt),Gt[X]=Z=It.length-1),it.writeVarint(Z)}}function Ce(Q,it){return(it<<3)+(7&Q)}function Lr(Q){return Q<<1^Q>>31}function yr(Q,it){for(var st=Q.loadGeometry(),_t=Q.type,It=0,Bt=0,Gt=st.length,dt=0;dt<Gt;dt++){var zt=st[dt],Qt=1;_t===1&&(Qt=zt.length),it.writeVarint(Ce(1,Qt));for(var nt=_t===3?zt.length-1:zt.length,X=0;X<nt;X++){X===1&&_t!==1&&it.writeVarint(Ce(2,nt-1));var Z=zt[X].x-It,rt=zt[X].y-Bt;it.writeVarint(Lr(Z)),it.writeVarint(Lr(rt)),It+=Z,Bt+=rt}_t===3&&it.writeVarint(Ce(7,1))}}function _r(Q,it){var st=typeof Q;st==="string"?it.writeStringField(1,Q):st==="boolean"?it.writeBooleanField(7,Q):st==="number"&&(Q%1!=0?it.writeDoubleField(3,Q):Q<0?it.writeSVarintField(6,Q):it.writeVarintField(5,Q))}function br(Q,it,st,_t){xr(Q,st,_t),xr(it,2*st,2*_t),xr(it,2*st+1,2*_t+1)}function xr(Q,it,st){var _t=Q[it];Q[it]=Q[st],Q[st]=_t}function pr(Q,it,st,_t){var It=Q-st,Bt=it-_t;return It*It+Bt*Bt}be.fromVectorTileJs=ir,be.fromGeojsonVt=function(Q,it){it=it||{};var st={};for(var _t in Q)st[_t]=new ce(Q[_t].features,it),st[_t].name=_t,st[_t].version=it.version,st[_t].extent=it.extent;return ir({layers:st})},be.GeoJSONWrapper=Me;var $r=function(Q){return Q[0]},Fe=function(Q){return Q[1]},ti=function(Q,it,st,_t,It){it===void 0&&(it=$r),st===void 0&&(st=Fe),_t===void 0&&(_t=64),It===void 0&&(It=Float64Array),this.nodeSize=_t,this.points=Q;for(var Bt=Q.length<65536?Uint16Array:Uint32Array,Gt=this.ids=new Bt(Q.length),dt=this.coords=new It(2*Q.length),zt=0;zt<Q.length;zt++)Gt[zt]=zt,dt[2*zt]=it(Q[zt]),dt[2*zt+1]=st(Q[zt]);(function Qt(nt,X,Z,rt,lt,gt){if(!(lt-rt<=Z)){var pt=rt+lt>>1;(function St(Et,Ct,te,$t,ee,De){for(;ee>$t;){if(ee-$t>600){var Se=ee-$t+1,ze=te-$t+1,Ue=Math.log(Se),Dr=.5*Math.exp(2*Ue/3),ur=.5*Math.sqrt(Ue*Dr*(Se-Dr)/Se)*(ze-Se/2<0?-1:1);St(Et,Ct,te,Math.max($t,Math.floor(te-ze*Dr/Se+ur)),Math.min(ee,Math.floor(te+(Se-ze)*Dr/Se+ur)),De)}var mr=Ct[2*te+De],nr=$t,Xe=ee;for(br(Et,Ct,$t,te),Ct[2*ee+De]>mr&&br(Et,Ct,$t,ee);nr<Xe;){for(br(Et,Ct,nr,Xe),nr++,Xe--;Ct[2*nr+De]<mr;)nr++;for(;Ct[2*Xe+De]>mr;)Xe--}Ct[2*$t+De]===mr?br(Et,Ct,$t,Xe):br(Et,Ct,++Xe,ee),Xe<=te&&($t=Xe+1),te<=Xe&&(ee=Xe-1)}})(nt,X,pt,rt,lt,gt%2),Qt(nt,X,Z,rt,pt-1,gt+1),Qt(nt,X,Z,pt+1,lt,gt+1)}})(Gt,dt,_t,0,Gt.length-1,0)};ti.prototype.range=function(Q,it,st,_t){return function(It,Bt,Gt,dt,zt,Qt,nt){for(var X,Z,rt=[0,It.length-1,0],lt=[];rt.length;){var gt=rt.pop(),pt=rt.pop(),St=rt.pop();if(pt-St<=nt)for(var Et=St;Et<=pt;Et++)Z=Bt[2*Et+1],(X=Bt[2*Et])>=Gt&&X<=zt&&Z>=dt&&Z<=Qt&&lt.push(It[Et]);else{var Ct=Math.floor((St+pt)/2);Z=Bt[2*Ct+1],(X=Bt[2*Ct])>=Gt&&X<=zt&&Z>=dt&&Z<=Qt&&lt.push(It[Ct]);var te=(gt+1)%2;(gt===0?Gt<=X:dt<=Z)&&(rt.push(St),rt.push(Ct-1),rt.push(te)),(gt===0?zt>=X:Qt>=Z)&&(rt.push(Ct+1),rt.push(pt),rt.push(te))}}return lt}(this.ids,this.coords,Q,it,st,_t,this.nodeSize)},ti.prototype.within=function(Q,it,st){return function(_t,It,Bt,Gt,dt,zt){for(var Qt=[0,_t.length-1,0],nt=[],X=dt*dt;Qt.length;){var Z=Qt.pop(),rt=Qt.pop(),lt=Qt.pop();if(rt-lt<=zt)for(var gt=lt;gt<=rt;gt++)pr(It[2*gt],It[2*gt+1],Bt,Gt)<=X&&nt.push(_t[gt]);else{var pt=Math.floor((lt+rt)/2),St=It[2*pt],Et=It[2*pt+1];pr(St,Et,Bt,Gt)<=X&&nt.push(_t[pt]);var Ct=(Z+1)%2;(Z===0?Bt-dt<=St:Gt-dt<=Et)&&(Qt.push(lt),Qt.push(pt-1),Qt.push(Ct)),(Z===0?Bt+dt>=St:Gt+dt>=Et)&&(Qt.push(pt+1),Qt.push(rt),Qt.push(Ct))}}return nt}(this.ids,this.coords,Q,it,st,this.nodeSize)};var oi={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(Q){return Q}},ci=function(Q){this.options=xn(Object.create(oi),Q),this.trees=new Array(this.options.maxZoom+1)};function Ri(Q,it,st,_t,It){return{x:Q,y:it,zoom:1/0,id:st,parentId:-1,numPoints:_t,properties:It}}function Wr(Q,it){var st=Q.geometry.coordinates,_t=st[1];return{x:sn(st[0]),y:dr(_t),zoom:1/0,index:it,parentId:-1}}function Di(Q){return{type:"Feature",id:Q.id,properties:vn(Q),geometry:{type:"Point",coordinates:[(_t=Q.x,360*(_t-.5)),(it=Q.y,st=(180-360*it)*Math.PI/180,360*Math.atan(Math.exp(st))/Math.PI-90)]}};var it,st,_t}function vn(Q){var it=Q.numPoints,st=it>=1e4?Math.round(it/1e3)+"k":it>=1e3?Math.round(it/100)/10+"k":it;return xn(xn({},Q.properties),{cluster:!0,cluster_id:Q.id,point_count:it,point_count_abbreviated:st})}function sn(Q){return Q/360+.5}function dr(Q){var it=Math.sin(Q*Math.PI/180),st=.5-.25*Math.log((1+it)/(1-it))/Math.PI;return st<0?0:st>1?1:st}function xn(Q,it){for(var st in it)Q[st]=it[st];return Q}function en(Q){return Q.x}function ji(Q){return Q.y}function qn(Q,it,st,_t,It,Bt){var Gt=It-st,dt=Bt-_t;if(Gt!==0||dt!==0){var zt=((Q-st)*Gt+(it-_t)*dt)/(Gt*Gt+dt*dt);zt>1?(st=It,_t=Bt):zt>0&&(st+=Gt*zt,_t+=dt*zt)}return(Gt=Q-st)*Gt+(dt=it-_t)*dt}function Zn(Q,it,st,_t){var It={id:Q===void 0?null:Q,type:it,geometry:st,tags:_t,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(Bt){var Gt=Bt.geometry,dt=Bt.type;if(dt==="Point"||dt==="MultiPoint"||dt==="LineString")io(Bt,Gt);else if(dt==="Polygon"||dt==="MultiLineString")for(var zt=0;zt<Gt.length;zt++)io(Bt,Gt[zt]);else if(dt==="MultiPolygon")for(zt=0;zt<Gt.length;zt++)for(var Qt=0;Qt<Gt[zt].length;Qt++)io(Bt,Gt[zt][Qt])}(It),It}function io(Q,it){for(var st=0;st<it.length;st+=3)Q.minX=Math.min(Q.minX,it[st]),Q.minY=Math.min(Q.minY,it[st+1]),Q.maxX=Math.max(Q.maxX,it[st]),Q.maxY=Math.max(Q.maxY,it[st+1])}function Wi(Q,it,st,_t){if(it.geometry){var It=it.geometry.coordinates,Bt=it.geometry.type,Gt=Math.pow(st.tolerance/((1<<st.maxZoom)*st.extent),2),dt=[],zt=it.id;if(st.promoteId?zt=it.properties[st.promoteId]:st.generateId&&(zt=_t||0),Bt==="Point")bn(It,dt);else if(Bt==="MultiPoint")for(var Qt=0;Qt<It.length;Qt++)bn(It[Qt],dt);else if(Bt==="LineString")co(It,dt,Gt,!1);else if(Bt==="MultiLineString"){if(st.lineMetrics){for(Qt=0;Qt<It.length;Qt++)co(It[Qt],dt=[],Gt,!1),Q.push(Zn(zt,"LineString",dt,it.properties));return}zr(It,dt,Gt,!1)}else if(Bt==="Polygon")zr(It,dt,Gt,!0);else{if(Bt!=="MultiPolygon"){if(Bt==="GeometryCollection"){for(Qt=0;Qt<it.geometry.geometries.length;Qt++)Wi(Q,{id:zt,geometry:it.geometry.geometries[Qt],properties:it.properties},st,_t);return}throw new Error("Input data is not a valid GeoJSON object.")}for(Qt=0;Qt<It.length;Qt++){var nt=[];zr(It[Qt],nt,Gt,!0),dt.push(nt)}}Q.push(Zn(zt,Bt,dt,it.properties))}}function bn(Q,it){it.push($i(Q[0])),it.push(dn(Q[1])),it.push(0)}function co(Q,it,st,_t){for(var It,Bt,Gt=0,dt=0;dt<Q.length;dt++){var zt=$i(Q[dt][0]),Qt=dn(Q[dt][1]);it.push(zt),it.push(Qt),it.push(0),dt>0&&(Gt+=_t?(It*Qt-zt*Bt)/2:Math.sqrt(Math.pow(zt-It,2)+Math.pow(Qt-Bt,2))),It=zt,Bt=Qt}var nt=it.length-3;it[2]=1,function X(Z,rt,lt,gt){for(var pt,St=gt,Et=lt-rt>>1,Ct=lt-rt,te=Z[rt],$t=Z[rt+1],ee=Z[lt],De=Z[lt+1],Se=rt+3;Se<lt;Se+=3){var ze=qn(Z[Se],Z[Se+1],te,$t,ee,De);if(ze>St)pt=Se,St=ze;else if(ze===St){var Ue=Math.abs(Se-Et);Ue<Ct&&(pt=Se,Ct=Ue)}}St>gt&&(pt-rt>3&&X(Z,rt,pt,gt),Z[pt+2]=St,lt-pt>3&&X(Z,pt,lt,gt))}(it,0,nt,st),it[nt+2]=1,it.size=Math.abs(Gt),it.start=0,it.end=it.size}function zr(Q,it,st,_t){for(var It=0;It<Q.length;It++){var Bt=[];co(Q[It],Bt,st,_t),it.push(Bt)}}function $i(Q){return Q/360+.5}function dn(Q){var it=Math.sin(Q*Math.PI/180),st=.5-.25*Math.log((1+it)/(1-it))/Math.PI;return st<0?0:st>1?1:st}function ln(Q,it,st,_t,It,Bt,Gt,dt){if(_t/=it,Bt>=(st/=it)&&Gt<_t)return Q;if(Gt<st||Bt>=_t)return null;for(var zt=[],Qt=0;Qt<Q.length;Qt++){var nt=Q[Qt],X=nt.geometry,Z=nt.type,rt=It===0?nt.minX:nt.minY,lt=It===0?nt.maxX:nt.maxY;if(rt>=st&&lt<_t)zt.push(nt);else if(!(lt<st||rt>=_t)){var gt=[];if(Z==="Point"||Z==="MultiPoint")na(X,gt,st,_t,It);else if(Z==="LineString")fe(X,gt,st,_t,It,!1,dt.lineMetrics);else if(Z==="MultiLineString")no(X,gt,st,_t,It,!1);else if(Z==="Polygon")no(X,gt,st,_t,It,!0);else if(Z==="MultiPolygon")for(var pt=0;pt<X.length;pt++){var St=[];no(X[pt],St,st,_t,It,!0),St.length&&gt.push(St)}if(gt.length){if(dt.lineMetrics&&Z==="LineString"){for(pt=0;pt<gt.length;pt++)zt.push(Zn(nt.id,Z,gt[pt],nt.tags));continue}Z!=="LineString"&&Z!=="MultiLineString"||(gt.length===1?(Z="LineString",gt=gt[0]):Z="MultiLineString"),Z!=="Point"&&Z!=="MultiPoint"||(Z=gt.length===3?"Point":"MultiPoint"),zt.push(Zn(nt.id,Z,gt,nt.tags))}}}return zt.length?zt:null}function na(Q,it,st,_t,It){for(var Bt=0;Bt<Q.length;Bt+=3){var Gt=Q[Bt+It];Gt>=st&&Gt<=_t&&(it.push(Q[Bt]),it.push(Q[Bt+1]),it.push(Q[Bt+2]))}}function fe(Q,it,st,_t,It,Bt,Gt){for(var dt,zt,Qt=Ze(Q),nt=It===0?ii:En,X=Q.start,Z=0;Z<Q.length-3;Z+=3){var rt=Q[Z],lt=Q[Z+1],gt=Q[Z+2],pt=Q[Z+3],St=Q[Z+4],Et=It===0?rt:lt,Ct=It===0?pt:St,te=!1;Gt&&(dt=Math.sqrt(Math.pow(rt-pt,2)+Math.pow(lt-St,2))),Et<st?Ct>st&&(zt=nt(Qt,rt,lt,pt,St,st),Gt&&(Qt.start=X+dt*zt)):Et>_t?Ct<_t&&(zt=nt(Qt,rt,lt,pt,St,_t),Gt&&(Qt.start=X+dt*zt)):wn(Qt,rt,lt,gt),Ct<st&&Et>=st&&(zt=nt(Qt,rt,lt,pt,St,st),te=!0),Ct>_t&&Et<=_t&&(zt=nt(Qt,rt,lt,pt,St,_t),te=!0),!Bt&&te&&(Gt&&(Qt.end=X+dt*zt),it.push(Qt),Qt=Ze(Q)),Gt&&(X+=dt)}var $t=Q.length-3;rt=Q[$t],lt=Q[$t+1],gt=Q[$t+2],(Et=It===0?rt:lt)>=st&&Et<=_t&&wn(Qt,rt,lt,gt),$t=Qt.length-3,Bt&&$t>=3&&(Qt[$t]!==Qt[0]||Qt[$t+1]!==Qt[1])&&wn(Qt,Qt[0],Qt[1],Qt[2]),Qt.length&&it.push(Qt)}function Ze(Q){var it=[];return it.size=Q.size,it.start=Q.start,it.end=Q.end,it}function no(Q,it,st,_t,It,Bt){for(var Gt=0;Gt<Q.length;Gt++)fe(Q[Gt],it,st,_t,It,Bt,!1)}function wn(Q,it,st,_t){Q.push(it),Q.push(st),Q.push(_t)}function ii(Q,it,st,_t,It,Bt){var Gt=(Bt-it)/(_t-it);return Q.push(Bt),Q.push(st+(It-st)*Gt),Q.push(1),Gt}function En(Q,it,st,_t,It,Bt){var Gt=(Bt-st)/(It-st);return Q.push(it+(_t-it)*Gt),Q.push(Bt),Q.push(1),Gt}function Ei(Q,it){for(var st=[],_t=0;_t<Q.length;_t++){var It,Bt=Q[_t],Gt=Bt.type;if(Gt==="Point"||Gt==="MultiPoint"||Gt==="LineString")It=Xn(Bt.geometry,it);else if(Gt==="MultiLineString"||Gt==="Polygon"){It=[];for(var dt=0;dt<Bt.geometry.length;dt++)It.push(Xn(Bt.geometry[dt],it))}else if(Gt==="MultiPolygon")for(It=[],dt=0;dt<Bt.geometry.length;dt++){for(var zt=[],Qt=0;Qt<Bt.geometry[dt].length;Qt++)zt.push(Xn(Bt.geometry[dt][Qt],it));It.push(zt)}st.push(Zn(Bt.id,Gt,It,Bt.tags))}return st}function Xn(Q,it){var st=[];st.size=Q.size,Q.start!==void 0&&(st.start=Q.start,st.end=Q.end);for(var _t=0;_t<Q.length;_t+=3)st.push(Q[_t]+it,Q[_t+1],Q[_t+2]);return st}function ai(Q,it){if(Q.transformed)return Q;var st,_t,It,Bt=1<<Q.z,Gt=Q.x,dt=Q.y;for(st=0;st<Q.features.length;st++){var zt=Q.features[st],Qt=zt.geometry,nt=zt.type;if(zt.geometry=[],nt===1)for(_t=0;_t<Qt.length;_t+=2)zt.geometry.push(Ge(Qt[_t],Qt[_t+1],it,Bt,Gt,dt));else for(_t=0;_t<Qt.length;_t++){var X=[];for(It=0;It<Qt[_t].length;It+=2)X.push(Ge(Qt[_t][It],Qt[_t][It+1],it,Bt,Gt,dt));zt.geometry.push(X)}}return Q.transformed=!0,Q}function Ge(Q,it,st,_t,It,Bt){return[Math.round(st*(Q*_t-It)),Math.round(st*(it*_t-Bt))]}function Rr(Q,it,st,_t,It){for(var Bt=it===It.maxZoom?0:It.tolerance/((1<<it)*It.extent),Gt={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:st,y:_t,z:it,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},dt=0;dt<Q.length;dt++){Gt.numFeatures++,kr(Gt,Q[dt],Bt,It);var zt=Q[dt].minX,Qt=Q[dt].minY,nt=Q[dt].maxX,X=Q[dt].maxY;zt<Gt.minX&&(Gt.minX=zt),Qt<Gt.minY&&(Gt.minY=Qt),nt>Gt.maxX&&(Gt.maxX=nt),X>Gt.maxY&&(Gt.maxY=X)}return Gt}function kr(Q,it,st,_t){var It=it.geometry,Bt=it.type,Gt=[];if(Bt==="Point"||Bt==="MultiPoint")for(var dt=0;dt<It.length;dt+=3)Gt.push(It[dt]),Gt.push(It[dt+1]),Q.numPoints++,Q.numSimplified++;else if(Bt==="LineString")qi(Gt,It,Q,st,!1,!1);else if(Bt==="MultiLineString"||Bt==="Polygon")for(dt=0;dt<It.length;dt++)qi(Gt,It[dt],Q,st,Bt==="Polygon",dt===0);else if(Bt==="MultiPolygon")for(var zt=0;zt<It.length;zt++){var Qt=It[zt];for(dt=0;dt<Qt.length;dt++)qi(Gt,Qt[dt],Q,st,!0,dt===0)}if(Gt.length){var nt=it.tags||null;if(Bt==="LineString"&&_t.lineMetrics){for(var X in nt={},it.tags)nt[X]=it.tags[X];nt.mapbox_clip_start=It.start/It.size,nt.mapbox_clip_end=It.end/It.size}var Z={geometry:Gt,type:Bt==="Polygon"||Bt==="MultiPolygon"?3:Bt==="LineString"||Bt==="MultiLineString"?2:1,tags:nt};it.id!==null&&(Z.id=it.id),Q.features.push(Z)}}function qi(Q,it,st,_t,It,Bt){var Gt=_t*_t;if(_t>0&&it.size<(It?Gt:_t))st.numPoints+=it.length/3;else{for(var dt=[],zt=0;zt<it.length;zt+=3)(_t===0||it[zt+2]>Gt)&&(st.numSimplified++,dt.push(it[zt]),dt.push(it[zt+1])),st.numPoints++;It&&function(Qt,nt){for(var X=0,Z=0,rt=Qt.length,lt=rt-2;Z<rt;lt=Z,Z+=2)X+=(Qt[Z]-Qt[lt])*(Qt[Z+1]+Qt[lt+1]);if(X>0===nt)for(Z=0,rt=Qt.length;Z<rt/2;Z+=2){var gt=Qt[Z],pt=Qt[Z+1];Qt[Z]=Qt[rt-2-Z],Qt[Z+1]=Qt[rt-1-Z],Qt[rt-2-Z]=gt,Qt[rt-1-Z]=pt}}(dt,Bt),Q.push(dt)}}function Ki(Q,it){var st=(it=this.options=function(It,Bt){for(var Gt in Bt)It[Gt]=Bt[Gt];return It}(Object.create(this.options),it)).debug;if(st&&console.time("preprocess data"),it.maxZoom<0||it.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(it.promoteId&&it.generateId)throw new Error("promoteId and generateId cannot be used together.");var _t=function(It,Bt){var Gt=[];if(It.type==="FeatureCollection")for(var dt=0;dt<It.features.length;dt++)Wi(Gt,It.features[dt],Bt,dt);else Wi(Gt,It.type==="Feature"?It:{geometry:It},Bt);return Gt}(Q,it);this.tiles={},this.tileCoords=[],st&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",it.indexMaxZoom,it.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(_t=function(It,Bt){var Gt=Bt.buffer/Bt.extent,dt=It,zt=ln(It,1,-1-Gt,Gt,0,-1,2,Bt),Qt=ln(It,1,1-Gt,2+Gt,0,-1,2,Bt);return(zt||Qt)&&(dt=ln(It,1,-Gt,1+Gt,0,-1,2,Bt)||[],zt&&(dt=Ei(zt,1).concat(dt)),Qt&&(dt=dt.concat(Ei(Qt,-1)))),dt}(_t,it)).length&&this.splitTile(_t,0,0,0),st&&(_t.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function Tr(Q,it,st){return 32*((1<<Q)*st+it)+Q}function ho(Q,it){var st=Q.tileID.canonical;if(!this._geoJSONIndex)return it(null,null);var _t=this._geoJSONIndex.getTile(st.z,st.x,st.y);if(!_t)return it(null,null);var It=new Jt(_t.features),Bt=be(It);Bt.byteOffset===0&&Bt.byteLength===Bt.buffer.byteLength||(Bt=new Uint8Array(Bt)),it(null,{vectorTile:It,rawData:Bt.buffer})}ci.prototype.load=function(Q){var it=this.options,st=it.log,_t=it.minZoom,It=it.maxZoom,Bt=it.nodeSize;st&&console.time("total time");var Gt="prepare "+Q.length+" points";st&&console.time(Gt),this.points=Q;for(var dt=[],zt=0;zt<Q.length;zt++)Q[zt].geometry&&dt.push(Wr(Q[zt],zt));this.trees[It+1]=new ti(dt,en,ji,Bt,Float32Array),st&&console.timeEnd(Gt);for(var Qt=It;Qt>=_t;Qt--){var nt=+Date.now();dt=this._cluster(dt,Qt),this.trees[Qt]=new ti(dt,en,ji,Bt,Float32Array),st&&console.log("z%d: %d clusters in %dms",Qt,dt.length,+Date.now()-nt)}return st&&console.timeEnd("total time"),this},ci.prototype.getClusters=function(Q,it){var st=((Q[0]+180)%360+360)%360-180,_t=Math.max(-90,Math.min(90,Q[1])),It=Q[2]===180?180:((Q[2]+180)%360+360)%360-180,Bt=Math.max(-90,Math.min(90,Q[3]));if(Q[2]-Q[0]>=360)st=-180,It=180;else if(st>It){var Gt=this.getClusters([st,_t,180,Bt],it),dt=this.getClusters([-180,_t,It,Bt],it);return Gt.concat(dt)}for(var zt=this.trees[this._limitZoom(it)],Qt=[],nt=0,X=zt.range(sn(st),dr(Bt),sn(It),dr(_t));nt<X.length;nt+=1){var Z=zt.points[X[nt]];Qt.push(Z.numPoints?Di(Z):this.points[Z.index])}return Qt},ci.prototype.getChildren=function(Q){var it=this._getOriginId(Q),st=this._getOriginZoom(Q),_t="No cluster with the specified id.",It=this.trees[st];if(!It)throw new Error(_t);var Bt=It.points[it];if(!Bt)throw new Error(_t);for(var Gt=this.options.radius/(this.options.extent*Math.pow(2,st-1)),dt=[],zt=0,Qt=It.within(Bt.x,Bt.y,Gt);zt<Qt.length;zt+=1){var nt=It.points[Qt[zt]];nt.parentId===Q&&dt.push(nt.numPoints?Di(nt):this.points[nt.index])}if(dt.length===0)throw new Error(_t);return dt},ci.prototype.getLeaves=function(Q,it,st){var _t=[];return this._appendLeaves(_t,Q,it=it||10,st=st||0,0),_t},ci.prototype.getTile=function(Q,it,st){var _t=this.trees[this._limitZoom(Q)],It=Math.pow(2,Q),Bt=this.options,Gt=Bt.radius/Bt.extent,dt=(st-Gt)/It,zt=(st+1+Gt)/It,Qt={features:[]};return this._addTileFeatures(_t.range((it-Gt)/It,dt,(it+1+Gt)/It,zt),_t.points,it,st,It,Qt),it===0&&this._addTileFeatures(_t.range(1-Gt/It,dt,1,zt),_t.points,It,st,It,Qt),it===It-1&&this._addTileFeatures(_t.range(0,dt,Gt/It,zt),_t.points,-1,st,It,Qt),Qt.features.length?Qt:null},ci.prototype.getClusterExpansionZoom=function(Q){for(var it=this._getOriginZoom(Q)-1;it<=this.options.maxZoom;){var st=this.getChildren(Q);if(it++,st.length!==1)break;Q=st[0].properties.cluster_id}return it},ci.prototype._appendLeaves=function(Q,it,st,_t,It){for(var Bt=0,Gt=this.getChildren(it);Bt<Gt.length;Bt+=1){var dt=Gt[Bt],zt=dt.properties;if(zt&&zt.cluster?It+zt.point_count<=_t?It+=zt.point_count:It=this._appendLeaves(Q,zt.cluster_id,st,_t,It):It<_t?It++:Q.push(dt),Q.length===st)break}return It},ci.prototype._addTileFeatures=function(Q,it,st,_t,It,Bt){for(var Gt=0,dt=Q;Gt<dt.length;Gt+=1){var zt=it[dt[Gt]],Qt=zt.numPoints,nt={type:1,geometry:[[Math.round(this.options.extent*(zt.x*It-st)),Math.round(this.options.extent*(zt.y*It-_t))]],tags:Qt?vn(zt):this.points[zt.index].properties},X=void 0;Qt?X=zt.id:this.options.generateId?X=zt.index:this.points[zt.index].id&&(X=this.points[zt.index].id),X!==void 0&&(nt.id=X),Bt.features.push(nt)}},ci.prototype._limitZoom=function(Q){return Math.max(this.options.minZoom,Math.min(+Q,this.options.maxZoom+1))},ci.prototype._cluster=function(Q,it){for(var st=[],_t=this.options,It=_t.reduce,Bt=_t.minPoints,Gt=_t.radius/(_t.extent*Math.pow(2,it)),dt=0;dt<Q.length;dt++){var zt=Q[dt];if(!(zt.zoom<=it)){zt.zoom=it;for(var Qt=this.trees[it+1],nt=Qt.within(zt.x,zt.y,Gt),X=zt.numPoints||1,Z=X,rt=0,lt=nt;rt<lt.length;rt+=1){var gt=Qt.points[lt[rt]];gt.zoom>it&&(Z+=gt.numPoints||1)}if(Z>=Bt){for(var pt=zt.x*X,St=zt.y*X,Et=It&&X>1?this._map(zt,!0):null,Ct=(dt<<5)+(it+1)+this.points.length,te=0,$t=nt;te<$t.length;te+=1){var ee=Qt.points[$t[te]];if(!(ee.zoom<=it)){ee.zoom=it;var De=ee.numPoints||1;pt+=ee.x*De,St+=ee.y*De,ee.parentId=Ct,It&&(Et||(Et=this._map(zt,!0)),It(Et,this._map(ee)))}}zt.parentId=Ct,st.push(Ri(pt/Z,St/Z,Ct,Z,Et))}else if(st.push(zt),Z>1)for(var Se=0,ze=nt;Se<ze.length;Se+=1){var Ue=Qt.points[ze[Se]];Ue.zoom<=it||(Ue.zoom=it,st.push(Ue))}}}return st},ci.prototype._getOriginId=function(Q){return Q-this.points.length>>5},ci.prototype._getOriginZoom=function(Q){return(Q-this.points.length)%32},ci.prototype._map=function(Q,it){if(Q.numPoints)return it?xn({},Q.properties):Q.properties;var st=this.points[Q.index].properties,_t=this.options.map(st);return it&&_t===st?xn({},_t):_t},Ki.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Ki.prototype.splitTile=function(Q,it,st,_t,It,Bt,Gt){for(var dt=[Q,it,st,_t],zt=this.options,Qt=zt.debug;dt.length;){_t=dt.pop(),st=dt.pop(),it=dt.pop(),Q=dt.pop();var nt=1<<it,X=Tr(it,st,_t),Z=this.tiles[X];if(!Z&&(Qt>1&&console.time("creation"),Z=this.tiles[X]=Rr(Q,it,st,_t,zt),this.tileCoords.push({z:it,x:st,y:_t}),Qt)){Qt>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",it,st,_t,Z.numFeatures,Z.numPoints,Z.numSimplified),console.timeEnd("creation"));var rt="z"+it;this.stats[rt]=(this.stats[rt]||0)+1,this.total++}if(Z.source=Q,It){if(it===zt.maxZoom||it===It)continue;var lt=1<<It-it;if(st!==Math.floor(Bt/lt)||_t!==Math.floor(Gt/lt))continue}else if(it===zt.indexMaxZoom||Z.numPoints<=zt.indexMaxPoints)continue;if(Z.source=null,Q.length!==0){Qt>1&&console.time("clipping");var gt,pt,St,Et,Ct,te,$t=.5*zt.buffer/zt.extent,ee=.5-$t,De=.5+$t,Se=1+$t;gt=pt=St=Et=null,Ct=ln(Q,nt,st-$t,st+De,0,Z.minX,Z.maxX,zt),te=ln(Q,nt,st+ee,st+Se,0,Z.minX,Z.maxX,zt),Q=null,Ct&&(gt=ln(Ct,nt,_t-$t,_t+De,1,Z.minY,Z.maxY,zt),pt=ln(Ct,nt,_t+ee,_t+Se,1,Z.minY,Z.maxY,zt),Ct=null),te&&(St=ln(te,nt,_t-$t,_t+De,1,Z.minY,Z.maxY,zt),Et=ln(te,nt,_t+ee,_t+Se,1,Z.minY,Z.maxY,zt),te=null),Qt>1&&console.timeEnd("clipping"),dt.push(gt||[],it+1,2*st,2*_t),dt.push(pt||[],it+1,2*st,2*_t+1),dt.push(St||[],it+1,2*st+1,2*_t),dt.push(Et||[],it+1,2*st+1,2*_t+1)}}},Ki.prototype.getTile=function(Q,it,st){var _t=this.options,It=_t.extent,Bt=_t.debug;if(Q<0||Q>24)return null;var Gt=1<<Q,dt=Tr(Q,it=(it%Gt+Gt)%Gt,st);if(this.tiles[dt])return ai(this.tiles[dt],It);Bt>1&&console.log("drilling down to z%d-%d-%d",Q,it,st);for(var zt,Qt=Q,nt=it,X=st;!zt&&Qt>0;)Qt--,nt=Math.floor(nt/2),X=Math.floor(X/2),zt=this.tiles[Tr(Qt,nt,X)];return zt&&zt.source?(Bt>1&&console.log("found parent tile z%d-%d-%d",Qt,nt,X),Bt>1&&console.time("drilling down"),this.splitTile(zt.source,Qt,nt,X,Q,it,st),Bt>1&&console.timeEnd("drilling down"),this.tiles[dt]?ai(this.tiles[dt],It):null):null};var Rn=function(Q){function it(st,_t,It,Bt){Q.call(this,st,_t,It,ho),Bt&&(this.loadGeoJSON=Bt)}return Q&&(it.__proto__=Q),(it.prototype=Object.create(Q&&Q.prototype)).constructor=it,it.prototype.loadData=function(st,_t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=_t,this._pendingLoadDataParams=st,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},it.prototype._loadData=function(){var st=this;if(this._pendingCallback&&this._pendingLoadDataParams){var _t=this._pendingCallback,It=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var Bt=!!(It&&It.request&&It.request.collectResourceTiming)&&new i.RequestPerformance(It.request);this.loadGeoJSON(It,function(Gt,dt){if(Gt||!dt)return _t(Gt);if(typeof dt!="object")return _t(new Error("Input data given to '"+It.source+"' is not a valid GeoJSON object."));(function Z(rt,lt){var gt,pt=rt&&rt.type;if(pt==="FeatureCollection")for(gt=0;gt<rt.features.length;gt++)Z(rt.features[gt],lt);else if(pt==="GeometryCollection")for(gt=0;gt<rt.geometries.length;gt++)Z(rt.geometries[gt],lt);else if(pt==="Feature")Z(rt.geometry,lt);else if(pt==="Polygon")Vt(rt.coordinates,lt);else if(pt==="MultiPolygon")for(gt=0;gt<rt.coordinates.length;gt++)Vt(rt.coordinates[gt],lt);return rt})(dt,!0);try{if(It.filter){var zt=i.createExpression(It.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(zt.result==="error")throw new Error(zt.value.map(function(Z){return Z.key+": "+Z.message}).join(", "));var Qt=dt.features.filter(function(Z){return zt.value.evaluate({zoom:0},Z)});dt={type:"FeatureCollection",features:Qt}}st._geoJSONIndex=It.cluster?new ci(function(Z){var rt=Z.superclusterOptions,lt=Z.clusterProperties;if(!lt||!rt)return rt;for(var gt={},pt={},St={accumulated:null,zoom:0},Et={properties:null},Ct=Object.keys(lt),te=0,$t=Ct;te<$t.length;te+=1){var ee=$t[te],De=lt[ee],Se=De[0],ze=i.createExpression(De[1]),Ue=i.createExpression(typeof Se=="string"?[Se,["accumulated"],["get",ee]]:Se);gt[ee]=ze.value,pt[ee]=Ue.value}return rt.map=function(Dr){Et.properties=Dr;for(var ur={},mr=0,nr=Ct;mr<nr.length;mr+=1){var Xe=nr[mr];ur[Xe]=gt[Xe].evaluate(St,Et)}return ur},rt.reduce=function(Dr,ur){Et.properties=ur;for(var mr=0,nr=Ct;mr<nr.length;mr+=1){var Xe=nr[mr];St.accumulated=Dr[Xe],Dr[Xe]=pt[Xe].evaluate(St,Et)}},rt}(It)).load(dt.features):function(Z,rt){return new Ki(Z,rt)}(dt,It.geojsonVtOptions)}catch(Z){return _t(Z)}st.loaded={};var nt={};if(Bt){var X=Bt.finish();X&&(nt.resourceTiming={},nt.resourceTiming[It.source]=JSON.parse(JSON.stringify(X)))}_t(null,nt)})}},it.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},it.prototype.reloadTile=function(st,_t){var It=this.loaded;return It&&It[st.uid]?Q.prototype.reloadTile.call(this,st,_t):this.loadTile(st,_t)},it.prototype.loadGeoJSON=function(st,_t){if(st.request)i.getJSON(st.request,_t);else{if(typeof st.data!="string")return _t(new Error("Input data given to '"+st.source+"' is not a valid GeoJSON object."));try{return _t(null,JSON.parse(st.data))}catch{return _t(new Error("Input data given to '"+st.source+"' is not a valid GeoJSON object."))}}},it.prototype.removeSource=function(st,_t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),_t()},it.prototype.getClusterExpansionZoom=function(st,_t){try{_t(null,this._geoJSONIndex.getClusterExpansionZoom(st.clusterId))}catch(It){_t(It)}},it.prototype.getClusterChildren=function(st,_t){try{_t(null,this._geoJSONIndex.getChildren(st.clusterId))}catch(It){_t(It)}},it.prototype.getClusterLeaves=function(st,_t){try{_t(null,this._geoJSONIndex.getLeaves(st.clusterId,st.limit,st.offset))}catch(It){_t(It)}},it}(yt),hi=function(Q){var it=this;this.self=Q,this.actor=new i.Actor(Q,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:yt,geojson:Rn},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(st,_t){if(it.workerSourceTypes[st])throw new Error('Worker source with name "'+st+'" already registered.');it.workerSourceTypes[st]=_t},this.self.registerRTLTextPlugin=function(st){if(i.plugin.isParsed())throw new Error("RTL text plugin already registered.");i.plugin.applyArabicShaping=st.applyArabicShaping,i.plugin.processBidirectionalText=st.processBidirectionalText,i.plugin.processStyledBidirectionalText=st.processStyledBidirectionalText}};return hi.prototype.setReferrer=function(Q,it){this.referrer=it},hi.prototype.setImages=function(Q,it,st){for(var _t in this.availableImages[Q]=it,this.workerSources[Q]){var It=this.workerSources[Q][_t];for(var Bt in It)It[Bt].availableImages=it}st()},hi.prototype.setLayers=function(Q,it,st){this.getLayerIndex(Q).replace(it),st()},hi.prototype.updateLayers=function(Q,it,st){this.getLayerIndex(Q).update(it.layers,it.removedIds),st()},hi.prototype.loadTile=function(Q,it,st){this.getWorkerSource(Q,it.type,it.source).loadTile(it,st)},hi.prototype.loadDEMTile=function(Q,it,st){this.getDEMWorkerSource(Q,it.source).loadTile(it,st)},hi.prototype.reloadTile=function(Q,it,st){this.getWorkerSource(Q,it.type,it.source).reloadTile(it,st)},hi.prototype.abortTile=function(Q,it,st){this.getWorkerSource(Q,it.type,it.source).abortTile(it,st)},hi.prototype.removeTile=function(Q,it,st){this.getWorkerSource(Q,it.type,it.source).removeTile(it,st)},hi.prototype.removeDEMTile=function(Q,it){this.getDEMWorkerSource(Q,it.source).removeTile(it)},hi.prototype.removeSource=function(Q,it,st){if(this.workerSources[Q]&&this.workerSources[Q][it.type]&&this.workerSources[Q][it.type][it.source]){var _t=this.workerSources[Q][it.type][it.source];delete this.workerSources[Q][it.type][it.source],_t.removeSource!==void 0?_t.removeSource(it,st):st()}},hi.prototype.loadWorkerSource=function(Q,it,st){try{this.self.importScripts(it.url),st()}catch(_t){st(_t.toString())}},hi.prototype.syncRTLPluginState=function(Q,it,st){try{i.plugin.setState(it);var _t=i.plugin.getPluginURL();if(i.plugin.isLoaded()&&!i.plugin.isParsed()&&_t!=null){this.self.importScripts(_t);var It=i.plugin.isParsed();st(It?void 0:new Error("RTL Text Plugin failed to import scripts from "+_t),It)}}catch(Bt){st(Bt.toString())}},hi.prototype.getAvailableImages=function(Q){var it=this.availableImages[Q];return it||(it=[]),it},hi.prototype.getLayerIndex=function(Q){var it=this.layerIndexes[Q];return it||(it=this.layerIndexes[Q]=new D),it},hi.prototype.getWorkerSource=function(Q,it,st){var _t=this;return this.workerSources[Q]||(this.workerSources[Q]={}),this.workerSources[Q][it]||(this.workerSources[Q][it]={}),this.workerSources[Q][it][st]||(this.workerSources[Q][it][st]=new this.workerSourceTypes[it]({send:function(It,Bt,Gt){_t.actor.send(It,Bt,Gt,Q)}},this.getLayerIndex(Q),this.getAvailableImages(Q))),this.workerSources[Q][it][st]},hi.prototype.getDEMWorkerSource=function(Q,it){return this.demWorkerSources[Q]||(this.demWorkerSources[Q]={}),this.demWorkerSources[Q][it]||(this.demWorkerSources[Q][it]=new kt),this.demWorkerSources[Q][it]},hi.prototype.enforceCacheSizeLimit=function(Q,it){i.enforceCacheSizeLimit(it)},typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new hi(self)),hi}),c(["./shared"],function(i){"use strict";var u=i.createCommonjsModule(function(p){function m(A){return!d(A)}function d(A){return typeof window>"u"||typeof document>"u"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var R,j,K=new Blob([""],{type:"text/javascript"}),tt=URL.createObjectURL(K);try{j=new Worker(tt),R=!0}catch{R=!1}return j&&j.terminate(),URL.revokeObjectURL(tt),R}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var R=document.createElement("canvas");R.width=R.height=1;var j=R.getContext("2d");if(!j)return!1;var K=j.getImageData(0,0,1,1);return K&&K.width===R.width}()?(x[k=A&&A.failIfMajorPerformanceCaveat]===void 0&&(x[k]=function(R){var j=function(tt){var ct=document.createElement("canvas"),ft=Object.create(m.webGLContextAttributes);return ft.failIfMajorPerformanceCaveat=tt,ct.probablySupportsContext?ct.probablySupportsContext("webgl",ft)||ct.probablySupportsContext("experimental-webgl",ft):ct.supportsContext?ct.supportsContext("webgl",ft)||ct.supportsContext("experimental-webgl",ft):ct.getContext("webgl",ft)||ct.getContext("experimental-webgl",ft)}(R);if(!j)return!1;var K=j.createShader(j.VERTEX_SHADER);return!(!K||j.isContextLost())&&(j.shaderSource(K,"void main() {}"),j.compileShader(K),j.getShaderParameter(K,j.COMPILE_STATUS)===!0)}(k)),x[k]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var k}p.exports?p.exports=m:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=m,window.mapboxgl.notSupportedReason=d);var x={};m.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}}),P={create:function(p,m,d){var x=i.window.document.createElement(p);return m!==void 0&&(x.className=m),d&&d.appendChild(x),x},createNS:function(p,m){return i.window.document.createElementNS(p,m)}},D=i.window.document&&i.window.document.documentElement.style;function F(p){if(!D)return p[0];for(var m=0;m<p.length;m++)if(p[m]in D)return p[m];return p[0]}var U,N=F(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);P.disableDrag=function(){D&&N&&(U=D[N],D[N]="none")},P.enableDrag=function(){D&&N&&(D[N]=U)};var at=F(["transform","WebkitTransform"]);P.setTransform=function(p,m){p.style[at]=m};var yt=!1;try{var Tt=Object.defineProperty({},"passive",{get:function(){yt=!0}});i.window.addEventListener("test",Tt,Tt),i.window.removeEventListener("test",Tt,Tt)}catch{yt=!1}P.addEventListener=function(p,m,d,x){x===void 0&&(x={}),p.addEventListener(m,d,"passive"in x&&yt?x:x.capture)},P.removeEventListener=function(p,m,d,x){x===void 0&&(x={}),p.removeEventListener(m,d,"passive"in x&&yt?x:x.capture)};var kt=function(p){p.preventDefault(),p.stopPropagation(),i.window.removeEventListener("click",kt,!0)};function Vt(p){var m=p.userImage;return!!(m&&m.render&&m.render())&&(p.data.replace(new Uint8Array(m.data.buffer)),!0)}P.suppressClick=function(){i.window.addEventListener("click",kt,!0),i.window.setTimeout(function(){i.window.removeEventListener("click",kt,!0)},0)},P.mousePos=function(p,m){var d=p.getBoundingClientRect();return new i.Point(m.clientX-d.left-p.clientLeft,m.clientY-d.top-p.clientTop)},P.touchPos=function(p,m){for(var d=p.getBoundingClientRect(),x=[],A=0;A<m.length;A++)x.push(new i.Point(m[A].clientX-d.left-p.clientLeft,m[A].clientY-d.top-p.clientTop));return x},P.mouseButton=function(p){return i.window.InstallTrigger!==void 0&&p.button===2&&p.ctrlKey&&i.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:p.button},P.remove=function(p){p.parentNode&&p.parentNode.removeChild(p)};var wt=function(p){function m(){p.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new i.RGBAImage({width:1,height:1}),this.dirty=!0}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.isLoaded=function(){return this.loaded},m.prototype.setLoaded=function(d){if(this.loaded!==d&&(this.loaded=d,d)){for(var x=0,A=this.requestors;x<A.length;x+=1){var k=A[x];this._notify(k.ids,k.callback)}this.requestors=[]}},m.prototype.getImage=function(d){return this.images[d]},m.prototype.addImage=function(d,x){this._validate(d,x)&&(this.images[d]=x)},m.prototype._validate=function(d,x){var A=!0;return this._validateStretch(x.stretchX,x.data&&x.data.width)||(this.fire(new i.ErrorEvent(new Error('Image "'+d+'" has invalid "stretchX" value'))),A=!1),this._validateStretch(x.stretchY,x.data&&x.data.height)||(this.fire(new i.ErrorEvent(new Error('Image "'+d+'" has invalid "stretchY" value'))),A=!1),this._validateContent(x.content,x)||(this.fire(new i.ErrorEvent(new Error('Image "'+d+'" has invalid "content" value'))),A=!1),A},m.prototype._validateStretch=function(d,x){if(!d)return!0;for(var A=0,k=0,R=d;k<R.length;k+=1){var j=R[k];if(j[0]<A||j[1]<j[0]||x<j[1])return!1;A=j[1]}return!0},m.prototype._validateContent=function(d,x){return!(d&&(d.length!==4||d[0]<0||x.data.width<d[0]||d[1]<0||x.data.height<d[1]||d[2]<0||x.data.width<d[2]||d[3]<0||x.data.height<d[3]||d[2]<d[0]||d[3]<d[1]))},m.prototype.updateImage=function(d,x){x.version=this.images[d].version+1,this.images[d]=x,this.updatedImages[d]=!0},m.prototype.removeImage=function(d){var x=this.images[d];delete this.images[d],delete this.patterns[d],x.userImage&&x.userImage.onRemove&&x.userImage.onRemove()},m.prototype.listImages=function(){return Object.keys(this.images)},m.prototype.getImages=function(d,x){var A=!0;if(!this.isLoaded())for(var k=0,R=d;k<R.length;k+=1)this.images[R[k]]||(A=!1);this.isLoaded()||A?this._notify(d,x):this.requestors.push({ids:d,callback:x})},m.prototype._notify=function(d,x){for(var A={},k=0,R=d;k<R.length;k+=1){var j=R[k];this.images[j]||this.fire(new i.Event("styleimagemissing",{id:j}));var K=this.images[j];K?A[j]={data:K.data.clone(),pixelRatio:K.pixelRatio,sdf:K.sdf,version:K.version,stretchX:K.stretchX,stretchY:K.stretchY,content:K.content,hasRenderCallback:Boolean(K.userImage&&K.userImage.render)}:i.warnOnce('Image "'+j+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}x(null,A)},m.prototype.getPixelSize=function(){var d=this.atlasImage;return{width:d.width,height:d.height}},m.prototype.getPattern=function(d){var x=this.patterns[d],A=this.getImage(d);if(!A)return null;if(x&&x.position.version===A.version)return x.position;if(x)x.position.version=A.version;else{var k={w:A.data.width+2,h:A.data.height+2,x:0,y:0},R=new i.ImagePosition(k,A);this.patterns[d]={bin:k,position:R}}return this._updatePatternAtlas(),this.patterns[d].position},m.prototype.bind=function(d){var x=d.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new i.Texture(d,this.atlasImage,x.RGBA),this.atlasTexture.bind(x.LINEAR,x.CLAMP_TO_EDGE)},m.prototype._updatePatternAtlas=function(){var d=[];for(var x in this.patterns)d.push(this.patterns[x].bin);var A=i.potpack(d),k=A.w,R=A.h,j=this.atlasImage;for(var K in j.resize({width:k||1,height:R||1}),this.patterns){var tt=this.patterns[K].bin,ct=tt.x+1,ft=tt.y+1,mt=this.images[K].data,Mt=mt.width,At=mt.height;i.RGBAImage.copy(mt,j,{x:0,y:0},{x:ct,y:ft},{width:Mt,height:At}),i.RGBAImage.copy(mt,j,{x:0,y:At-1},{x:ct,y:ft-1},{width:Mt,height:1}),i.RGBAImage.copy(mt,j,{x:0,y:0},{x:ct,y:ft+At},{width:Mt,height:1}),i.RGBAImage.copy(mt,j,{x:Mt-1,y:0},{x:ct-1,y:ft},{width:1,height:At}),i.RGBAImage.copy(mt,j,{x:0,y:0},{x:ct+Mt,y:ft},{width:1,height:At})}this.dirty=!0},m.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},m.prototype.dispatchRenderCallbacks=function(d){for(var x=0,A=d;x<A.length;x+=1){var k=A[x];if(!this.callbackDispatchedThisFrame[k]){this.callbackDispatchedThisFrame[k]=!0;var R=this.images[k];Vt(R)&&this.updateImage(k,R)}}},m}(i.Evented),Lt=se,Zt=se,Jt=1e20;function se(p,m,d,x,A,k){this.fontSize=p||24,this.buffer=m===void 0?3:m,this.cutoff=x||.25,this.fontFamily=A||"sans-serif",this.fontWeight=k||"normal",this.radius=d||8;var R=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=R,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(R*R),this.gridInner=new Float64Array(R*R),this.f=new Float64Array(R),this.d=new Float64Array(R),this.z=new Float64Array(R+1),this.v=new Int16Array(R),this.middle=Math.round(R/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function ce(p,m,d,x,A,k,R){for(var j=0;j<m;j++){for(var K=0;K<d;K++)x[K]=p[K*m+j];for(oe(x,A,k,R,d),K=0;K<d;K++)p[K*m+j]=A[K]}for(K=0;K<d;K++){for(j=0;j<m;j++)x[j]=p[K*m+j];for(oe(x,A,k,R,m),j=0;j<m;j++)p[K*m+j]=Math.sqrt(A[j])}}function oe(p,m,d,x,A){d[0]=0,x[0]=-Jt,x[1]=+Jt;for(var k=1,R=0;k<A;k++){for(var j=(p[k]+k*k-(p[d[R]]+d[R]*d[R]))/(2*k-2*d[R]);j<=x[R];)R--,j=(p[k]+k*k-(p[d[R]]+d[R]*d[R]))/(2*k-2*d[R]);d[++R]=k,x[R]=j,x[R+1]=+Jt}for(k=0,R=0;k<A;k++){for(;x[R+1]<k;)R++;m[k]=(k-d[R])*(k-d[R])+p[d[R]]}}se.prototype.draw=function(p){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(p,this.buffer,this.middle);for(var m=this.ctx.getImageData(0,0,this.size,this.size),d=new Uint8ClampedArray(this.size*this.size),x=0;x<this.size*this.size;x++){var A=m.data[4*x+3]/255;this.gridOuter[x]=A===1?0:A===0?Jt:Math.pow(Math.max(0,.5-A),2),this.gridInner[x]=A===1?Jt:A===0?0:Math.pow(Math.max(0,A-.5),2)}for(ce(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),ce(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),x=0;x<this.size*this.size;x++)d[x]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[x]-this.gridInner[x])/this.radius+this.cutoff))));return d},Lt.default=Zt;var ye=function(p,m){this.requestManager=p,this.localIdeographFontFamily=m,this.entries={}};ye.prototype.setURL=function(p){this.url=p},ye.prototype.getGlyphs=function(p,m){var d=this,x=[];for(var A in p)for(var k=0,R=p[A];k<R.length;k+=1)x.push({stack:A,id:R[k]});i.asyncAll(x,function(j,K){var tt=j.stack,ct=j.id,ft=d.entries[tt];ft||(ft=d.entries[tt]={glyphs:{},requests:{},ranges:{}});var mt=ft.glyphs[ct];if(mt===void 0){if(mt=d._tinySDF(ft,tt,ct))return ft.glyphs[ct]=mt,void K(null,{stack:tt,id:ct,glyph:mt});var Mt=Math.floor(ct/256);if(256*Mt>65535)K(new Error("glyphs > 65535 not supported"));else if(ft.ranges[Mt])K(null,{stack:tt,id:ct,glyph:mt});else{var At=ft.requests[Mt];At||(At=ft.requests[Mt]=[],ye.loadGlyphRange(tt,Mt,d.url,d.requestManager,function(Dt,xt){if(xt){for(var Rt in xt)d._doesCharSupportLocalGlyph(+Rt)||(ft.glyphs[+Rt]=xt[+Rt]);ft.ranges[Mt]=!0}for(var Nt=0,Yt=At;Nt<Yt.length;Nt+=1)(0,Yt[Nt])(Dt,xt);delete ft.requests[Mt]})),At.push(function(Dt,xt){Dt?K(Dt):xt&&K(null,{stack:tt,id:ct,glyph:xt[ct]||null})})}}else K(null,{stack:tt,id:ct,glyph:mt})},function(j,K){if(j)m(j);else if(K){for(var tt={},ct=0,ft=K;ct<ft.length;ct+=1){var mt=ft[ct],Mt=mt.stack,At=mt.id,Dt=mt.glyph;(tt[Mt]||(tt[Mt]={}))[At]=Dt&&{id:Dt.id,bitmap:Dt.bitmap.clone(),metrics:Dt.metrics}}m(null,tt)}})},ye.prototype._doesCharSupportLocalGlyph=function(p){return!!this.localIdeographFontFamily&&(i.isChar["CJK Unified Ideographs"](p)||i.isChar["Hangul Syllables"](p)||i.isChar.Hiragana(p)||i.isChar.Katakana(p))},ye.prototype._tinySDF=function(p,m,d){var x=this.localIdeographFontFamily;if(x&&this._doesCharSupportLocalGlyph(d)){var A=p.tinySDF;if(!A){var k="400";/bold/i.test(m)?k="900":/medium/i.test(m)?k="500":/light/i.test(m)&&(k="200"),A=p.tinySDF=new ye.TinySDF(24,3,8,.25,x,k)}return{id:d,bitmap:new i.AlphaImage({width:30,height:30},A.draw(String.fromCharCode(d))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},ye.loadGlyphRange=function(p,m,d,x,A){var k=256*m,R=k+255,j=x.transformRequest(x.normalizeGlyphsURL(d).replace("{fontstack}",p).replace("{range}",k+"-"+R),i.ResourceType.Glyphs);i.getArrayBuffer(j,function(K,tt){if(K)A(K);else if(tt){for(var ct={},ft=0,mt=i.parseGlyphPBF(tt);ft<mt.length;ft+=1){var Mt=mt[ft];ct[Mt.id]=Mt}A(null,ct)}})},ye.TinySDF=Lt;var be=function(){this.specification=i.styleSpec.light.position};be.prototype.possiblyEvaluate=function(p,m){return i.sphericalToCartesian(p.expression.evaluate(m))},be.prototype.interpolate=function(p,m,d){return{x:i.number(p.x,m.x,d),y:i.number(p.y,m.y,d),z:i.number(p.z,m.z,d)}};var Me=new i.Properties({anchor:new i.DataConstantProperty(i.styleSpec.light.anchor),position:new be,color:new i.DataConstantProperty(i.styleSpec.light.color),intensity:new i.DataConstantProperty(i.styleSpec.light.intensity)}),ir=function(p){function m(d){p.call(this),this._transitionable=new i.Transitionable(Me),this.setLight(d),this._transitioning=this._transitionable.untransitioned()}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getLight=function(){return this._transitionable.serialize()},m.prototype.setLight=function(d,x){if(x===void 0&&(x={}),!this._validate(i.validateLight,d,x))for(var A in d){var k=d[A];i.endsWith(A,"-transition")?this._transitionable.setTransition(A.slice(0,-11),k):this._transitionable.setValue(A,k)}},m.prototype.updateTransitions=function(d){this._transitioning=this._transitionable.transitioned(d,this._transitioning)},m.prototype.hasTransition=function(){return this._transitioning.hasTransition()},m.prototype.recalculate=function(d){this.properties=this._transitioning.possiblyEvaluate(d)},m.prototype._validate=function(d,x,A){return(!A||A.validate!==!1)&&i.emitValidationErrors(this,d.call(i.validateStyle,i.extend({value:x,style:{glyphs:!0,sprite:!0},styleSpec:i.styleSpec})))},m}(i.Evented),Be=function(p,m){this.width=p,this.height=m,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};Be.prototype.getDash=function(p,m){var d=p.join(",")+String(m);return this.dashEntry[d]||(this.dashEntry[d]=this.addDash(p,m)),this.dashEntry[d]},Be.prototype.getDashRanges=function(p,m,d){var x=[],A=p.length%2==1?-p[p.length-1]*d:0,k=p[0]*d,R=!0;x.push({left:A,right:k,isDash:R,zeroLength:p[0]===0});for(var j=p[0],K=1;K<p.length;K++){var tt=p[K];x.push({left:A=j*d,right:k=(j+=tt)*d,isDash:R=!R,zeroLength:tt===0})}return x},Be.prototype.addRoundDash=function(p,m,d){for(var x=m/2,A=-d;A<=d;A++)for(var k=this.width*(this.nextRow+d+A),R=0,j=p[R],K=0;K<this.width;K++){K/j.right>1&&(j=p[++R]);var tt=Math.abs(K-j.left),ct=Math.abs(K-j.right),ft=Math.min(tt,ct),mt=void 0,Mt=A/d*(x+1);if(j.isDash){var At=x-Math.abs(Mt);mt=Math.sqrt(ft*ft+At*At)}else mt=x-Math.sqrt(ft*ft+Mt*Mt);this.data[k+K]=Math.max(0,Math.min(255,mt+128))}},Be.prototype.addRegularDash=function(p){for(var m=p.length-1;m>=0;--m){var d=p[m],x=p[m+1];d.zeroLength?p.splice(m,1):x&&x.isDash===d.isDash&&(x.left=d.left,p.splice(m,1))}var A=p[0],k=p[p.length-1];A.isDash===k.isDash&&(A.left=k.left-this.width,k.right=A.right+this.width);for(var R=this.width*this.nextRow,j=0,K=p[j],tt=0;tt<this.width;tt++){tt/K.right>1&&(K=p[++j]);var ct=Math.abs(tt-K.left),ft=Math.abs(tt-K.right),mt=Math.min(ct,ft);this.data[R+tt]=Math.max(0,Math.min(255,(K.isDash?mt:-mt)+128))}},Be.prototype.addDash=function(p,m){var d=m?7:0,x=2*d+1;if(this.nextRow+x>this.height)return i.warnOnce("LineAtlas out of space"),null;for(var A=0,k=0;k<p.length;k++)A+=p[k];if(A!==0){var R=this.width/A,j=this.getDashRanges(p,this.width,R);m?this.addRoundDash(j,R,d):this.addRegularDash(j)}var K={y:(this.nextRow+d+.5)/this.height,height:2*d/this.height,width:A};return this.nextRow+=x,this.dirty=!0,K},Be.prototype.bind=function(p){var m=p.gl;this.texture?(m.bindTexture(m.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,m.texSubImage2D(m.TEXTURE_2D,0,0,0,this.width,this.height,m.ALPHA,m.UNSIGNED_BYTE,this.data))):(this.texture=m.createTexture(),m.bindTexture(m.TEXTURE_2D,this.texture),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.REPEAT),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.REPEAT),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.LINEAR),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.LINEAR),m.texImage2D(m.TEXTURE_2D,0,m.ALPHA,this.width,this.height,0,m.ALPHA,m.UNSIGNED_BYTE,this.data))};var qe=function p(m,d){this.workerPool=m,this.actors=[],this.currentActor=0,this.id=i.uniqueId();for(var x=this.workerPool.acquire(this.id),A=0;A<x.length;A++){var k=new p.Actor(x[A],d,this.id);k.name="Worker "+A,this.actors.push(k)}};function rr(p,m,d){var x=function(A,k){if(A)return d(A);if(k){var R=i.pick(i.extend(k,p),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);k.vector_layers&&(R.vectorLayers=k.vector_layers,R.vectorLayerIds=R.vectorLayers.map(function(j){return j.id})),R.tiles=m.canonicalizeTileset(R,p.url),d(null,R)}};return p.url?i.getJSON(m.transformRequest(m.normalizeSourceURL(p.url),i.ResourceType.Source),x):i.browser.frame(function(){return x(null,p)})}qe.prototype.broadcast=function(p,m,d){i.asyncAll(this.actors,function(x,A){x.send(p,m,A)},d=d||function(){})},qe.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},qe.prototype.remove=function(){this.actors.forEach(function(p){p.remove()}),this.actors=[],this.workerPool.release(this.id)},qe.Actor=i.Actor;var Ce=function(p,m,d){this.bounds=i.LngLatBounds.convert(this.validateBounds(p)),this.minzoom=m||0,this.maxzoom=d||24};Ce.prototype.validateBounds=function(p){return Array.isArray(p)&&p.length===4?[Math.max(-180,p[0]),Math.max(-90,p[1]),Math.min(180,p[2]),Math.min(90,p[3])]:[-180,-90,180,90]},Ce.prototype.contains=function(p){var m=Math.pow(2,p.z),d=Math.floor(i.mercatorXfromLng(this.bounds.getWest())*m),x=Math.floor(i.mercatorYfromLat(this.bounds.getNorth())*m),A=Math.ceil(i.mercatorXfromLng(this.bounds.getEast())*m),k=Math.ceil(i.mercatorYfromLat(this.bounds.getSouth())*m);return p.x>=d&&p.x<A&&p.y>=x&&p.y<k};var Lr=function(p){function m(d,x,A,k){if(p.call(this),this.id=d,this.dispatcher=A,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,i.extend(this,i.pick(x,["url","scheme","tileSize","promoteId"])),this._options=i.extend({type:"vector"},x),this._collectResourceTiming=x.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(k)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.load=function(){var d=this;this._loaded=!1,this.fire(new i.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=rr(this._options,this.map._requestManager,function(x,A){d._tileJSONRequest=null,d._loaded=!0,x?d.fire(new i.ErrorEvent(x)):A&&(i.extend(d,A),A.bounds&&(d.tileBounds=new Ce(A.bounds,d.minzoom,d.maxzoom)),i.postTurnstileEvent(A.tiles,d.map._requestManager._customAccessToken),i.postMapLoadEvent(A.tiles,d.map._getMapId(),d.map._requestManager._skuToken,d.map._requestManager._customAccessToken),d.fire(new i.Event("data",{dataType:"source",sourceDataType:"metadata"})),d.fire(new i.Event("data",{dataType:"source",sourceDataType:"content"})))})},m.prototype.loaded=function(){return this._loaded},m.prototype.hasTile=function(d){return!this.tileBounds||this.tileBounds.contains(d.canonical)},m.prototype.onAdd=function(d){this.map=d,this.load()},m.prototype.setSourceProperty=function(d){this._tileJSONRequest&&this._tileJSONRequest.cancel(),d(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},m.prototype.setTiles=function(d){var x=this;return this.setSourceProperty(function(){x._options.tiles=d}),this},m.prototype.setUrl=function(d){var x=this;return this.setSourceProperty(function(){x.url=d,x._options.url=d}),this},m.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},m.prototype.serialize=function(){return i.extend({},this._options)},m.prototype.loadTile=function(d,x){var A=this.map._requestManager.normalizeTileURL(d.tileID.canonical.url(this.tiles,this.scheme)),k={request:this.map._requestManager.transformRequest(A,i.ResourceType.Tile),uid:d.uid,tileID:d.tileID,zoom:d.tileID.overscaledZ,tileSize:this.tileSize*d.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:i.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function R(j,K){return delete d.request,d.aborted?x(null):j&&j.status!==404?x(j):(K&&K.resourceTiming&&(d.resourceTiming=K.resourceTiming),this.map._refreshExpiredTiles&&K&&d.setExpiryData(K),d.loadVectorData(K,this.map.painter),i.cacheEntryPossiblyAdded(this.dispatcher),x(null),void(d.reloadCallback&&(this.loadTile(d,d.reloadCallback),d.reloadCallback=null)))}k.request.collectResourceTiming=this._collectResourceTiming,d.actor&&d.state!=="expired"?d.state==="loading"?d.reloadCallback=x:d.request=d.actor.send("reloadTile",k,R.bind(this)):(d.actor=this.dispatcher.getActor(),d.request=d.actor.send("loadTile",k,R.bind(this)))},m.prototype.abortTile=function(d){d.request&&(d.request.cancel(),delete d.request),d.actor&&d.actor.send("abortTile",{uid:d.uid,type:this.type,source:this.id},void 0)},m.prototype.unloadTile=function(d){d.unloadVectorData(),d.actor&&d.actor.send("removeTile",{uid:d.uid,type:this.type,source:this.id},void 0)},m.prototype.hasTransition=function(){return!1},m}(i.Evented),yr=function(p){function m(d,x,A,k){p.call(this),this.id=d,this.dispatcher=A,this.setEventedParent(k),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=i.extend({type:"raster"},x),i.extend(this,i.pick(x,["url","scheme","tileSize"]))}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.load=function(){var d=this;this._loaded=!1,this.fire(new i.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=rr(this._options,this.map._requestManager,function(x,A){d._tileJSONRequest=null,d._loaded=!0,x?d.fire(new i.ErrorEvent(x)):A&&(i.extend(d,A),A.bounds&&(d.tileBounds=new Ce(A.bounds,d.minzoom,d.maxzoom)),i.postTurnstileEvent(A.tiles),i.postMapLoadEvent(A.tiles,d.map._getMapId(),d.map._requestManager._skuToken),d.fire(new i.Event("data",{dataType:"source",sourceDataType:"metadata"})),d.fire(new i.Event("data",{dataType:"source",sourceDataType:"content"})))})},m.prototype.loaded=function(){return this._loaded},m.prototype.onAdd=function(d){this.map=d,this.load()},m.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},m.prototype.serialize=function(){return i.extend({},this._options)},m.prototype.hasTile=function(d){return!this.tileBounds||this.tileBounds.contains(d.canonical)},m.prototype.loadTile=function(d,x){var A=this,k=this.map._requestManager.normalizeTileURL(d.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);d.request=i.getImage(this.map._requestManager.transformRequest(k,i.ResourceType.Tile),function(R,j){if(delete d.request,d.aborted)d.state="unloaded",x(null);else if(R)d.state="errored",x(R);else if(j){A.map._refreshExpiredTiles&&d.setExpiryData(j),delete j.cacheControl,delete j.expires;var K=A.map.painter.context,tt=K.gl;d.texture=A.map.painter.getTileTexture(j.width),d.texture?d.texture.update(j,{useMipmap:!0}):(d.texture=new i.Texture(K,j,tt.RGBA,{useMipmap:!0}),d.texture.bind(tt.LINEAR,tt.CLAMP_TO_EDGE,tt.LINEAR_MIPMAP_NEAREST),K.extTextureFilterAnisotropic&&tt.texParameterf(tt.TEXTURE_2D,K.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,K.extTextureFilterAnisotropicMax)),d.state="loaded",i.cacheEntryPossiblyAdded(A.dispatcher),x(null)}})},m.prototype.abortTile=function(d,x){d.request&&(d.request.cancel(),delete d.request),x()},m.prototype.unloadTile=function(d,x){d.texture&&this.map.painter.saveTileTexture(d.texture),x()},m.prototype.hasTransition=function(){return!1},m}(i.Evented),_r=function(p){function m(d,x,A,k){p.call(this,d,x,A,k),this.type="raster-dem",this.maxzoom=22,this._options=i.extend({type:"raster-dem"},x),this.encoding=x.encoding||"mapbox"}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},m.prototype.loadTile=function(d,x){var A=this.map._requestManager.normalizeTileURL(d.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function k(R,j){R&&(d.state="errored",x(R)),j&&(d.dem=j,d.needsHillshadePrepare=!0,d.state="loaded",x(null))}d.request=i.getImage(this.map._requestManager.transformRequest(A,i.ResourceType.Tile),function(R,j){if(delete d.request,d.aborted)d.state="unloaded",x(null);else if(R)d.state="errored",x(R);else if(j){this.map._refreshExpiredTiles&&d.setExpiryData(j),delete j.cacheControl,delete j.expires;var K=i.window.ImageBitmap&&j instanceof i.window.ImageBitmap&&i.offscreenCanvasSupported()?j:i.browser.getImageData(j,1),tt={uid:d.uid,coord:d.tileID,source:this.id,rawImageData:K,encoding:this.encoding};d.actor&&d.state!=="expired"||(d.actor=this.dispatcher.getActor(),d.actor.send("loadDEMTile",tt,k.bind(this)))}}.bind(this)),d.neighboringTiles=this._getNeighboringTiles(d.tileID)},m.prototype._getNeighboringTiles=function(d){var x=d.canonical,A=Math.pow(2,x.z),k=(x.x-1+A)%A,R=x.x===0?d.wrap-1:d.wrap,j=(x.x+1+A)%A,K=x.x+1===A?d.wrap+1:d.wrap,tt={};return tt[new i.OverscaledTileID(d.overscaledZ,R,x.z,k,x.y).key]={backfilled:!1},tt[new i.OverscaledTileID(d.overscaledZ,K,x.z,j,x.y).key]={backfilled:!1},x.y>0&&(tt[new i.OverscaledTileID(d.overscaledZ,R,x.z,k,x.y-1).key]={backfilled:!1},tt[new i.OverscaledTileID(d.overscaledZ,d.wrap,x.z,x.x,x.y-1).key]={backfilled:!1},tt[new i.OverscaledTileID(d.overscaledZ,K,x.z,j,x.y-1).key]={backfilled:!1}),x.y+1<A&&(tt[new i.OverscaledTileID(d.overscaledZ,R,x.z,k,x.y+1).key]={backfilled:!1},tt[new i.OverscaledTileID(d.overscaledZ,d.wrap,x.z,x.x,x.y+1).key]={backfilled:!1},tt[new i.OverscaledTileID(d.overscaledZ,K,x.z,j,x.y+1).key]={backfilled:!1}),tt},m.prototype.unloadTile=function(d){d.demTexture&&this.map.painter.saveTileTexture(d.demTexture),d.fbo&&(d.fbo.destroy(),delete d.fbo),d.dem&&delete d.dem,delete d.neighboringTiles,d.state="unloaded",d.actor&&d.actor.send("removeDEMTile",{uid:d.uid,source:this.id})},m}(yr),br=function(p){function m(d,x,A,k){p.call(this),this.id=d,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=A.getActor(),this.setEventedParent(k),this._data=x.data,this._options=i.extend({},x),this._collectResourceTiming=x.collectResourceTiming,this._resourceTiming=[],x.maxzoom!==void 0&&(this.maxzoom=x.maxzoom),x.type&&(this.type=x.type),x.attribution&&(this.attribution=x.attribution),this.promoteId=x.promoteId;var R=i.EXTENT/this.tileSize;this.workerOptions=i.extend({source:this.id,cluster:x.cluster||!1,geojsonVtOptions:{buffer:(x.buffer!==void 0?x.buffer:128)*R,tolerance:(x.tolerance!==void 0?x.tolerance:.375)*R,extent:i.EXTENT,maxZoom:this.maxzoom,lineMetrics:x.lineMetrics||!1,generateId:x.generateId||!1},superclusterOptions:{maxZoom:x.clusterMaxZoom!==void 0?Math.min(x.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,x.clusterMinPoints||2),extent:i.EXTENT,radius:(x.clusterRadius||50)*R,log:!1,generateId:x.generateId||!1},clusterProperties:x.clusterProperties,filter:x.filter},x.workerOptions)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.load=function(){var d=this;this.fire(new i.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(x){if(x)d.fire(new i.ErrorEvent(x));else{var A={dataType:"source",sourceDataType:"metadata"};d._collectResourceTiming&&d._resourceTiming&&d._resourceTiming.length>0&&(A.resourceTiming=d._resourceTiming,d._resourceTiming=[]),d.fire(new i.Event("data",A))}})},m.prototype.onAdd=function(d){this.map=d,this.load()},m.prototype.setData=function(d){var x=this;return this._data=d,this.fire(new i.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(A){if(A)x.fire(new i.ErrorEvent(A));else{var k={dataType:"source",sourceDataType:"content"};x._collectResourceTiming&&x._resourceTiming&&x._resourceTiming.length>0&&(k.resourceTiming=x._resourceTiming,x._resourceTiming=[]),x.fire(new i.Event("data",k))}}),this},m.prototype.getClusterExpansionZoom=function(d,x){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:d,source:this.id},x),this},m.prototype.getClusterChildren=function(d,x){return this.actor.send("geojson.getClusterChildren",{clusterId:d,source:this.id},x),this},m.prototype.getClusterLeaves=function(d,x,A,k){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:d,limit:x,offset:A},k),this},m.prototype._updateWorkerData=function(d){var x=this;this._loaded=!1;var A=i.extend({},this.workerOptions),k=this._data;typeof k=="string"?(A.request=this.map._requestManager.transformRequest(i.browser.resolveURL(k),i.ResourceType.Source),A.request.collectResourceTiming=this._collectResourceTiming):A.data=JSON.stringify(k),this.actor.send(this.type+".loadData",A,function(R,j){x._removed||j&&j.abandoned||(x._loaded=!0,j&&j.resourceTiming&&j.resourceTiming[x.id]&&(x._resourceTiming=j.resourceTiming[x.id].slice(0)),x.actor.send(x.type+".coalesce",{source:A.source},null),d(R))})},m.prototype.loaded=function(){return this._loaded},m.prototype.loadTile=function(d,x){var A=this,k=d.actor?"reloadTile":"loadTile";d.actor=this.actor,d.request=this.actor.send(k,{type:this.type,uid:d.uid,tileID:d.tileID,zoom:d.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:i.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},function(R,j){return delete d.request,d.unloadVectorData(),d.aborted?x(null):R?x(R):(d.loadVectorData(j,A.map.painter,k==="reloadTile"),x(null))})},m.prototype.abortTile=function(d){d.request&&(d.request.cancel(),delete d.request),d.aborted=!0},m.prototype.unloadTile=function(d){d.unloadVectorData(),this.actor.send("removeTile",{uid:d.uid,type:this.type,source:this.id})},m.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},m.prototype.serialize=function(){return i.extend({},this._options,{type:this.type,data:this._data})},m.prototype.hasTransition=function(){return!1},m}(i.Evented),xr=i.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),pr=function(p){function m(d,x,A,k){p.call(this),this.id=d,this.dispatcher=A,this.coordinates=x.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(k),this.options=x}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.load=function(d,x){var A=this;this._loaded=!1,this.fire(new i.Event("dataloading",{dataType:"source"})),this.url=this.options.url,i.getImage(this.map._requestManager.transformRequest(this.url,i.ResourceType.Image),function(k,R){A._loaded=!0,k?A.fire(new i.ErrorEvent(k)):R&&(A.image=R,d&&(A.coordinates=d),x&&x(),A._finishLoading())})},m.prototype.loaded=function(){return this._loaded},m.prototype.updateImage=function(d){var x=this;return this.image&&d.url?(this.options.url=d.url,this.load(d.coordinates,function(){x.texture=null}),this):this},m.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new i.Event("data",{dataType:"source",sourceDataType:"metadata"})))},m.prototype.onAdd=function(d){this.map=d,this.load()},m.prototype.setCoordinates=function(d){var x=this;this.coordinates=d;var A=d.map(i.MercatorCoordinate.fromLngLat);this.tileID=function(R){for(var j=1/0,K=1/0,tt=-1/0,ct=-1/0,ft=0,mt=R;ft<mt.length;ft+=1){var Mt=mt[ft];j=Math.min(j,Mt.x),K=Math.min(K,Mt.y),tt=Math.max(tt,Mt.x),ct=Math.max(ct,Mt.y)}var At=Math.max(tt-j,ct-K),Dt=Math.max(0,Math.floor(-Math.log(At)/Math.LN2)),xt=Math.pow(2,Dt);return new i.CanonicalTileID(Dt,Math.floor((j+tt)/2*xt),Math.floor((K+ct)/2*xt))}(A),this.minzoom=this.maxzoom=this.tileID.z;var k=A.map(function(R){return x.tileID.getTilePoint(R)._round()});return this._boundsArray=new i.StructArrayLayout4i8,this._boundsArray.emplaceBack(k[0].x,k[0].y,0,0),this._boundsArray.emplaceBack(k[1].x,k[1].y,i.EXTENT,0),this._boundsArray.emplaceBack(k[3].x,k[3].y,0,i.EXTENT),this._boundsArray.emplaceBack(k[2].x,k[2].y,i.EXTENT,i.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new i.Event("data",{dataType:"source",sourceDataType:"content"})),this},m.prototype.prepare=function(){if(Object.keys(this.tiles).length!==0&&this.image){var d=this.map.painter.context,x=d.gl;for(var A in this.boundsBuffer||(this.boundsBuffer=d.createVertexBuffer(this._boundsArray,xr.members)),this.boundsSegments||(this.boundsSegments=i.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new i.Texture(d,this.image,x.RGBA),this.texture.bind(x.LINEAR,x.CLAMP_TO_EDGE)),this.tiles){var k=this.tiles[A];k.state!=="loaded"&&(k.state="loaded",k.texture=this.texture)}}},m.prototype.loadTile=function(d,x){this.tileID&&this.tileID.equals(d.tileID.canonical)?(this.tiles[String(d.tileID.wrap)]=d,d.buckets={},x(null)):(d.state="errored",x(null))},m.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},m.prototype.hasTransition=function(){return!1},m}(i.Evented),$r=function(p){function m(d,x,A,k){p.call(this,d,x,A,k),this.roundZoom=!0,this.type="video",this.options=x}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.load=function(){var d=this;this._loaded=!1;var x=this.options;this.urls=[];for(var A=0,k=x.urls;A<k.length;A+=1)this.urls.push(this.map._requestManager.transformRequest(k[A],i.ResourceType.Source).url);i.getVideo(this.urls,function(R,j){d._loaded=!0,R?d.fire(new i.ErrorEvent(R)):j&&(d.video=j,d.video.loop=!0,d.video.addEventListener("playing",function(){d.map.triggerRepaint()}),d.map&&d.video.play(),d._finishLoading())})},m.prototype.pause=function(){this.video&&this.video.pause()},m.prototype.play=function(){this.video&&this.video.play()},m.prototype.seek=function(d){if(this.video){var x=this.video.seekable;d<x.start(0)||d>x.end(0)?this.fire(new i.ErrorEvent(new i.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+x.start(0)+" and "+x.end(0)+"-second mark."))):this.video.currentTime=d}},m.prototype.getVideo=function(){return this.video},m.prototype.onAdd=function(d){this.map||(this.map=d,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},m.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var d=this.map.painter.context,x=d.gl;for(var A in this.boundsBuffer||(this.boundsBuffer=d.createVertexBuffer(this._boundsArray,xr.members)),this.boundsSegments||(this.boundsSegments=i.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(x.LINEAR,x.CLAMP_TO_EDGE),x.texSubImage2D(x.TEXTURE_2D,0,0,0,x.RGBA,x.UNSIGNED_BYTE,this.video)):(this.texture=new i.Texture(d,this.video,x.RGBA),this.texture.bind(x.LINEAR,x.CLAMP_TO_EDGE)),this.tiles){var k=this.tiles[A];k.state!=="loaded"&&(k.state="loaded",k.texture=this.texture)}}},m.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},m.prototype.hasTransition=function(){return this.video&&!this.video.paused},m}(pr),Fe=function(p){function m(d,x,A,k){p.call(this,d,x,A,k),x.coordinates?Array.isArray(x.coordinates)&&x.coordinates.length===4&&!x.coordinates.some(function(R){return!Array.isArray(R)||R.length!==2||R.some(function(j){return typeof j!="number"})})||this.fire(new i.ErrorEvent(new i.ValidationError("sources."+d,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new i.ErrorEvent(new i.ValidationError("sources."+d,null,'missing required property "coordinates"'))),x.animate&&typeof x.animate!="boolean"&&this.fire(new i.ErrorEvent(new i.ValidationError("sources."+d,null,'optional "animate" property must be a boolean value'))),x.canvas?typeof x.canvas=="string"||x.canvas instanceof i.window.HTMLCanvasElement||this.fire(new i.ErrorEvent(new i.ValidationError("sources."+d,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new i.ErrorEvent(new i.ValidationError("sources."+d,null,'missing required property "canvas"'))),this.options=x,this.animate=x.animate===void 0||x.animate}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof i.window.HTMLCanvasElement?this.options.canvas:i.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new i.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},m.prototype.getCanvas=function(){return this.canvas},m.prototype.onAdd=function(d){this.map=d,this.load(),this.canvas&&this.animate&&this.play()},m.prototype.onRemove=function(){this.pause()},m.prototype.prepare=function(){var d=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,d=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,d=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var x=this.map.painter.context,A=x.gl;for(var k in this.boundsBuffer||(this.boundsBuffer=x.createVertexBuffer(this._boundsArray,xr.members)),this.boundsSegments||(this.boundsSegments=i.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(d||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new i.Texture(x,this.canvas,A.RGBA,{premultiply:!0}),this.tiles){var R=this.tiles[k];R.state!=="loaded"&&(R.state="loaded",R.texture=this.texture)}}},m.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},m.prototype.hasTransition=function(){return this._playing},m.prototype._hasInvalidDimensions=function(){for(var d=0,x=[this.canvas.width,this.canvas.height];d<x.length;d+=1){var A=x[d];if(isNaN(A)||A<=0)return!0}return!1},m}(pr),ti={vector:Lr,raster:yr,"raster-dem":_r,geojson:br,video:$r,image:pr,canvas:Fe};function oi(p,m){var d=i.identity([]);return i.translate(d,d,[1,1,0]),i.scale(d,d,[.5*p.width,.5*p.height,1]),i.multiply(d,d,p.calculatePosMatrix(m.toUnwrapped()))}function ci(p,m,d,x,A,k){var R=function(Dt,xt,Rt){if(Dt)for(var Nt=0,Yt=Dt;Nt<Yt.length;Nt+=1){var ne=xt[Yt[Nt]];if(ne&&ne.source===Rt&&ne.type==="fill-extrusion")return!0}else for(var ae in xt){var le=xt[ae];if(le.source===Rt&&le.type==="fill-extrusion")return!0}return!1}(A&&A.layers,m,p.id),j=k.maxPitchScaleFactor(),K=p.tilesIn(x,j,R);K.sort(Ri);for(var tt=[],ct=0,ft=K;ct<ft.length;ct+=1){var mt=ft[ct];tt.push({wrappedTileID:mt.tileID.wrapped().key,queryResults:mt.tile.queryRenderedFeatures(m,d,p._state,mt.queryGeometry,mt.cameraQueryGeometry,mt.scale,A,k,j,oi(p.transform,mt.tileID))})}var Mt=function(Dt){for(var xt={},Rt={},Nt=0,Yt=Dt;Nt<Yt.length;Nt+=1){var ne=Yt[Nt],ae=ne.queryResults,le=ne.wrappedTileID,xe=Rt[le]=Rt[le]||{};for(var ke in ae)for(var Le=ae[ke],$e=xe[ke]=xe[ke]||{},lr=xt[ke]=xt[ke]||[],hr=0,sr=Le;hr<sr.length;hr+=1){var Zr=sr[hr];$e[Zr.featureIndex]||($e[Zr.featureIndex]=!0,lr.push(Zr))}}return xt}(tt);for(var At in Mt)Mt[At].forEach(function(Dt){var xt=Dt.feature,Rt=p.getFeatureState(xt.layer["source-layer"],xt.id);xt.source=xt.layer.source,xt.layer["source-layer"]&&(xt.sourceLayer=xt.layer["source-layer"]),xt.state=Rt});return Mt}function Ri(p,m){var d=p.tileID,x=m.tileID;return d.overscaledZ-x.overscaledZ||d.canonical.y-x.canonical.y||d.wrap-x.wrap||d.canonical.x-x.canonical.x}var Wr=function(p,m){this.max=p,this.onRemove=m,this.reset()};Wr.prototype.reset=function(){for(var p in this.data)for(var m=0,d=this.data[p];m<d.length;m+=1){var x=d[m];x.timeout&&clearTimeout(x.timeout),this.onRemove(x.value)}return this.data={},this.order=[],this},Wr.prototype.add=function(p,m,d){var x=this,A=p.wrapped().key;this.data[A]===void 0&&(this.data[A]=[]);var k={value:m,timeout:void 0};if(d!==void 0&&(k.timeout=setTimeout(function(){x.remove(p,k)},d)),this.data[A].push(k),this.order.push(A),this.order.length>this.max){var R=this._getAndRemoveByKey(this.order[0]);R&&this.onRemove(R)}return this},Wr.prototype.has=function(p){return p.wrapped().key in this.data},Wr.prototype.getAndRemove=function(p){return this.has(p)?this._getAndRemoveByKey(p.wrapped().key):null},Wr.prototype._getAndRemoveByKey=function(p){var m=this.data[p].shift();return m.timeout&&clearTimeout(m.timeout),this.data[p].length===0&&delete this.data[p],this.order.splice(this.order.indexOf(p),1),m.value},Wr.prototype.getByKey=function(p){var m=this.data[p];return m?m[0].value:null},Wr.prototype.get=function(p){return this.has(p)?this.data[p.wrapped().key][0].value:null},Wr.prototype.remove=function(p,m){if(!this.has(p))return this;var d=p.wrapped().key,x=m===void 0?0:this.data[d].indexOf(m),A=this.data[d][x];return this.data[d].splice(x,1),A.timeout&&clearTimeout(A.timeout),this.data[d].length===0&&delete this.data[d],this.onRemove(A.value),this.order.splice(this.order.indexOf(d),1),this},Wr.prototype.setMaxSize=function(p){for(this.max=p;this.order.length>this.max;){var m=this._getAndRemoveByKey(this.order[0]);m&&this.onRemove(m)}return this},Wr.prototype.filter=function(p){var m=[];for(var d in this.data)for(var x=0,A=this.data[d];x<A.length;x+=1){var k=A[x];p(k.value)||m.push(k)}for(var R=0,j=m;R<j.length;R+=1){var K=j[R];this.remove(K.value.tileID,K)}};var Di=function(p,m,d){this.context=p;var x=p.gl;this.buffer=x.createBuffer(),this.dynamicDraw=Boolean(d),this.context.unbindVAO(),p.bindElementBuffer.set(this.buffer),x.bufferData(x.ELEMENT_ARRAY_BUFFER,m.arrayBuffer,this.dynamicDraw?x.DYNAMIC_DRAW:x.STATIC_DRAW),this.dynamicDraw||delete m.arrayBuffer};Di.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Di.prototype.updateData=function(p){var m=this.context.gl;this.context.unbindVAO(),this.bind(),m.bufferSubData(m.ELEMENT_ARRAY_BUFFER,0,p.arrayBuffer)},Di.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var vn={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},sn=function(p,m,d,x){this.length=m.length,this.attributes=d,this.itemSize=m.bytesPerElement,this.dynamicDraw=x,this.context=p;var A=p.gl;this.buffer=A.createBuffer(),p.bindVertexBuffer.set(this.buffer),A.bufferData(A.ARRAY_BUFFER,m.arrayBuffer,this.dynamicDraw?A.DYNAMIC_DRAW:A.STATIC_DRAW),this.dynamicDraw||delete m.arrayBuffer};sn.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},sn.prototype.updateData=function(p){var m=this.context.gl;this.bind(),m.bufferSubData(m.ARRAY_BUFFER,0,p.arrayBuffer)},sn.prototype.enableAttributes=function(p,m){for(var d=0;d<this.attributes.length;d++){var x=m.attributes[this.attributes[d].name];x!==void 0&&p.enableVertexAttribArray(x)}},sn.prototype.setVertexAttribPointers=function(p,m,d){for(var x=0;x<this.attributes.length;x++){var A=this.attributes[x],k=m.attributes[A.name];k!==void 0&&p.vertexAttribPointer(k,A.components,p[vn[A.type]],!1,this.itemSize,A.offset+this.itemSize*(d||0))}},sn.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var dr=function(p){this.gl=p.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};dr.prototype.get=function(){return this.current},dr.prototype.set=function(p){},dr.prototype.getDefault=function(){return this.default},dr.prototype.setDefault=function(){this.set(this.default)};var xn=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return i.Color.transparent},m.prototype.set=function(d){var x=this.current;(d.r!==x.r||d.g!==x.g||d.b!==x.b||d.a!==x.a||this.dirty)&&(this.gl.clearColor(d.r,d.g,d.b,d.a),this.current=d,this.dirty=!1)},m}(dr),en=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return 1},m.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.clearDepth(d),this.current=d,this.dirty=!1)},m}(dr),ji=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return 0},m.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.clearStencil(d),this.current=d,this.dirty=!1)},m}(dr),qn=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return[!0,!0,!0,!0]},m.prototype.set=function(d){var x=this.current;(d[0]!==x[0]||d[1]!==x[1]||d[2]!==x[2]||d[3]!==x[3]||this.dirty)&&(this.gl.colorMask(d[0],d[1],d[2],d[3]),this.current=d,this.dirty=!1)},m}(dr),Zn=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return!0},m.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.depthMask(d),this.current=d,this.dirty=!1)},m}(dr),io=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return 255},m.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.stencilMask(d),this.current=d,this.dirty=!1)},m}(dr),Wi=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},m.prototype.set=function(d){var x=this.current;(d.func!==x.func||d.ref!==x.ref||d.mask!==x.mask||this.dirty)&&(this.gl.stencilFunc(d.func,d.ref,d.mask),this.current=d,this.dirty=!1)},m}(dr),bn=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){var d=this.gl;return[d.KEEP,d.KEEP,d.KEEP]},m.prototype.set=function(d){var x=this.current;(d[0]!==x[0]||d[1]!==x[1]||d[2]!==x[2]||this.dirty)&&(this.gl.stencilOp(d[0],d[1],d[2]),this.current=d,this.dirty=!1)},m}(dr),co=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return!1},m.prototype.set=function(d){if(d!==this.current||this.dirty){var x=this.gl;d?x.enable(x.STENCIL_TEST):x.disable(x.STENCIL_TEST),this.current=d,this.dirty=!1}},m}(dr),zr=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return[0,1]},m.prototype.set=function(d){var x=this.current;(d[0]!==x[0]||d[1]!==x[1]||this.dirty)&&(this.gl.depthRange(d[0],d[1]),this.current=d,this.dirty=!1)},m}(dr),$i=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return!1},m.prototype.set=function(d){if(d!==this.current||this.dirty){var x=this.gl;d?x.enable(x.DEPTH_TEST):x.disable(x.DEPTH_TEST),this.current=d,this.dirty=!1}},m}(dr),dn=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return this.gl.LESS},m.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.depthFunc(d),this.current=d,this.dirty=!1)},m}(dr),ln=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return!1},m.prototype.set=function(d){if(d!==this.current||this.dirty){var x=this.gl;d?x.enable(x.BLEND):x.disable(x.BLEND),this.current=d,this.dirty=!1}},m}(dr),na=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){var d=this.gl;return[d.ONE,d.ZERO]},m.prototype.set=function(d){var x=this.current;(d[0]!==x[0]||d[1]!==x[1]||this.dirty)&&(this.gl.blendFunc(d[0],d[1]),this.current=d,this.dirty=!1)},m}(dr),fe=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return i.Color.transparent},m.prototype.set=function(d){var x=this.current;(d.r!==x.r||d.g!==x.g||d.b!==x.b||d.a!==x.a||this.dirty)&&(this.gl.blendColor(d.r,d.g,d.b,d.a),this.current=d,this.dirty=!1)},m}(dr),Ze=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return this.gl.FUNC_ADD},m.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.blendEquation(d),this.current=d,this.dirty=!1)},m}(dr),no=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return!1},m.prototype.set=function(d){if(d!==this.current||this.dirty){var x=this.gl;d?x.enable(x.CULL_FACE):x.disable(x.CULL_FACE),this.current=d,this.dirty=!1}},m}(dr),wn=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return this.gl.BACK},m.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.cullFace(d),this.current=d,this.dirty=!1)},m}(dr),ii=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return this.gl.CCW},m.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.frontFace(d),this.current=d,this.dirty=!1)},m}(dr),En=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return null},m.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.useProgram(d),this.current=d,this.dirty=!1)},m}(dr),Ei=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return this.gl.TEXTURE0},m.prototype.set=function(d){(d!==this.current||this.dirty)&&(this.gl.activeTexture(d),this.current=d,this.dirty=!1)},m}(dr),Xn=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){var d=this.gl;return[0,0,d.drawingBufferWidth,d.drawingBufferHeight]},m.prototype.set=function(d){var x=this.current;(d[0]!==x[0]||d[1]!==x[1]||d[2]!==x[2]||d[3]!==x[3]||this.dirty)&&(this.gl.viewport(d[0],d[1],d[2],d[3]),this.current=d,this.dirty=!1)},m}(dr),ai=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return null},m.prototype.set=function(d){if(d!==this.current||this.dirty){var x=this.gl;x.bindFramebuffer(x.FRAMEBUFFER,d),this.current=d,this.dirty=!1}},m}(dr),Ge=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return null},m.prototype.set=function(d){if(d!==this.current||this.dirty){var x=this.gl;x.bindRenderbuffer(x.RENDERBUFFER,d),this.current=d,this.dirty=!1}},m}(dr),Rr=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return null},m.prototype.set=function(d){if(d!==this.current||this.dirty){var x=this.gl;x.bindTexture(x.TEXTURE_2D,d),this.current=d,this.dirty=!1}},m}(dr),kr=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return null},m.prototype.set=function(d){if(d!==this.current||this.dirty){var x=this.gl;x.bindBuffer(x.ARRAY_BUFFER,d),this.current=d,this.dirty=!1}},m}(dr),qi=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return null},m.prototype.set=function(d){var x=this.gl;x.bindBuffer(x.ELEMENT_ARRAY_BUFFER,d),this.current=d,this.dirty=!1},m}(dr),Ki=function(p){function m(d){p.call(this,d),this.vao=d.extVertexArrayObject}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return null},m.prototype.set=function(d){this.vao&&(d!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(d),this.current=d,this.dirty=!1)},m}(dr),Tr=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return 4},m.prototype.set=function(d){if(d!==this.current||this.dirty){var x=this.gl;x.pixelStorei(x.UNPACK_ALIGNMENT,d),this.current=d,this.dirty=!1}},m}(dr),ho=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return!1},m.prototype.set=function(d){if(d!==this.current||this.dirty){var x=this.gl;x.pixelStorei(x.UNPACK_PREMULTIPLY_ALPHA_WEBGL,d),this.current=d,this.dirty=!1}},m}(dr),Rn=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return!1},m.prototype.set=function(d){if(d!==this.current||this.dirty){var x=this.gl;x.pixelStorei(x.UNPACK_FLIP_Y_WEBGL,d),this.current=d,this.dirty=!1}},m}(dr),hi=function(p){function m(d,x){p.call(this,d),this.context=d,this.parent=x}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.getDefault=function(){return null},m}(dr),Q=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.setDirty=function(){this.dirty=!0},m.prototype.set=function(d){if(d!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var x=this.gl;x.framebufferTexture2D(x.FRAMEBUFFER,x.COLOR_ATTACHMENT0,x.TEXTURE_2D,d,0),this.current=d,this.dirty=!1}},m}(hi),it=function(p){function m(){p.apply(this,arguments)}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.set=function(d){if(d!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var x=this.gl;x.framebufferRenderbuffer(x.FRAMEBUFFER,x.DEPTH_ATTACHMENT,x.RENDERBUFFER,d),this.current=d,this.dirty=!1}},m}(hi),st=function(p,m,d,x){this.context=p,this.width=m,this.height=d;var A=this.framebuffer=p.gl.createFramebuffer();this.colorAttachment=new Q(p,A),x&&(this.depthAttachment=new it(p,A))};st.prototype.destroy=function(){var p=this.context.gl,m=this.colorAttachment.get();if(m&&p.deleteTexture(m),this.depthAttachment){var d=this.depthAttachment.get();d&&p.deleteRenderbuffer(d)}p.deleteFramebuffer(this.framebuffer)};var _t=function(p,m,d){this.func=p,this.mask=m,this.range=d};_t.ReadOnly=!1,_t.ReadWrite=!0,_t.disabled=new _t(519,_t.ReadOnly,[0,1]);var It=function(p,m,d,x,A,k){this.test=p,this.ref=m,this.mask=d,this.fail=x,this.depthFail=A,this.pass=k};It.disabled=new It({func:519,mask:0},0,0,7680,7680,7680);var Bt=function(p,m,d){this.blendFunction=p,this.blendColor=m,this.mask=d};Bt.disabled=new Bt(Bt.Replace=[1,0],i.Color.transparent,[!1,!1,!1,!1]),Bt.unblended=new Bt(Bt.Replace,i.Color.transparent,[!0,!0,!0,!0]),Bt.alphaBlended=new Bt([1,771],i.Color.transparent,[!0,!0,!0,!0]);var Gt=function(p,m,d){this.enable=p,this.mode=m,this.frontFace=d};Gt.disabled=new Gt(!1,1029,2305),Gt.backCCW=new Gt(!0,1029,2305);var dt=function(p){this.gl=p,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new xn(this),this.clearDepth=new en(this),this.clearStencil=new ji(this),this.colorMask=new qn(this),this.depthMask=new Zn(this),this.stencilMask=new io(this),this.stencilFunc=new Wi(this),this.stencilOp=new bn(this),this.stencilTest=new co(this),this.depthRange=new zr(this),this.depthTest=new $i(this),this.depthFunc=new dn(this),this.blend=new ln(this),this.blendFunc=new na(this),this.blendColor=new fe(this),this.blendEquation=new Ze(this),this.cullFace=new no(this),this.cullFaceSide=new wn(this),this.frontFace=new ii(this),this.program=new En(this),this.activeTexture=new Ei(this),this.viewport=new Xn(this),this.bindFramebuffer=new ai(this),this.bindRenderbuffer=new Ge(this),this.bindTexture=new Rr(this),this.bindVertexBuffer=new kr(this),this.bindElementBuffer=new qi(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new Ki(this),this.pixelStoreUnpack=new Tr(this),this.pixelStoreUnpackPremultiplyAlpha=new ho(this),this.pixelStoreUnpackFlipY=new Rn(this),this.extTextureFilterAnisotropic=p.getExtension("EXT_texture_filter_anisotropic")||p.getExtension("MOZ_EXT_texture_filter_anisotropic")||p.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=p.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=p.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(p.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=p.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=p.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=p.getParameter(p.MAX_TEXTURE_SIZE)};dt.prototype.setDefault=function(){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()},dt.prototype.setDirty=function(){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.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},dt.prototype.createIndexBuffer=function(p,m){return new Di(this,p,m)},dt.prototype.createVertexBuffer=function(p,m,d){return new sn(this,p,m,d)},dt.prototype.createRenderbuffer=function(p,m,d){var x=this.gl,A=x.createRenderbuffer();return this.bindRenderbuffer.set(A),x.renderbufferStorage(x.RENDERBUFFER,p,m,d),this.bindRenderbuffer.set(null),A},dt.prototype.createFramebuffer=function(p,m,d){return new st(this,p,m,d)},dt.prototype.clear=function(p){var m=p.color,d=p.depth,x=this.gl,A=0;m&&(A|=x.COLOR_BUFFER_BIT,this.clearColor.set(m),this.colorMask.set([!0,!0,!0,!0])),d!==void 0&&(A|=x.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(d),this.depthMask.set(!0)),x.clear(A)},dt.prototype.setCullFace=function(p){p.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(p.mode),this.frontFace.set(p.frontFace))},dt.prototype.setDepthMode=function(p){p.func!==this.gl.ALWAYS||p.mask?(this.depthTest.set(!0),this.depthFunc.set(p.func),this.depthMask.set(p.mask),this.depthRange.set(p.range)):this.depthTest.set(!1)},dt.prototype.setStencilMode=function(p){p.test.func!==this.gl.ALWAYS||p.mask?(this.stencilTest.set(!0),this.stencilMask.set(p.mask),this.stencilOp.set([p.fail,p.depthFail,p.pass]),this.stencilFunc.set({func:p.test.func,ref:p.ref,mask:p.test.mask})):this.stencilTest.set(!1)},dt.prototype.setColorMode=function(p){i.deepEqual(p.blendFunction,Bt.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(p.blendFunction),this.blendColor.set(p.blendColor)),this.colorMask.set(p.mask)},dt.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var zt=function(p){function m(d,x,A){var k=this;p.call(this),this.id=d,this.dispatcher=A,this.on("data",function(R){R.dataType==="source"&&R.sourceDataType==="metadata"&&(k._sourceLoaded=!0),k._sourceLoaded&&!k._paused&&R.dataType==="source"&&R.sourceDataType==="content"&&(k.reload(),k.transform&&k.update(k.transform))}),this.on("error",function(){k._sourceErrored=!0}),this._source=function(R,j,K,tt){var ct=new ti[j.type](R,j,K,tt);if(ct.id!==R)throw new Error("Expected Source id to be "+R+" instead of "+ct.id);return i.bindAll(["load","abort","unload","serialize","prepare"],ct),ct}(d,x,A,this),this._tiles={},this._cache=new Wr(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new i.SourceFeatureState}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.onAdd=function(d){this.map=d,this._maxTileCacheSize=d?d._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(d)},m.prototype.onRemove=function(d){this._source&&this._source.onRemove&&this._source.onRemove(d)},m.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(var d in this._tiles){var x=this._tiles[d];if(x.state!=="loaded"&&x.state!=="errored")return!1}return!0},m.prototype.getSource=function(){return this._source},m.prototype.pause=function(){this._paused=!0},m.prototype.resume=function(){if(this._paused){var d=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,d&&this.reload(),this.transform&&this.update(this.transform)}},m.prototype._loadTile=function(d,x){return this._source.loadTile(d,x)},m.prototype._unloadTile=function(d){if(this._source.unloadTile)return this._source.unloadTile(d,function(){})},m.prototype._abortTile=function(d){if(this._source.abortTile)return this._source.abortTile(d,function(){})},m.prototype.serialize=function(){return this._source.serialize()},m.prototype.prepare=function(d){for(var x in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var A=this._tiles[x];A.upload(d),A.prepare(this.map.style.imageManager)}},m.prototype.getIds=function(){return i.values(this._tiles).map(function(d){return d.tileID}).sort(Qt).map(function(d){return d.key})},m.prototype.getRenderableIds=function(d){var x=this,A=[];for(var k in this._tiles)this._isIdRenderable(k,d)&&A.push(this._tiles[k]);return d?A.sort(function(R,j){var K=R.tileID,tt=j.tileID,ct=new i.Point(K.canonical.x,K.canonical.y)._rotate(x.transform.angle),ft=new i.Point(tt.canonical.x,tt.canonical.y)._rotate(x.transform.angle);return K.overscaledZ-tt.overscaledZ||ft.y-ct.y||ft.x-ct.x}).map(function(R){return R.tileID.key}):A.map(function(R){return R.tileID}).sort(Qt).map(function(R){return R.key})},m.prototype.hasRenderableParent=function(d){var x=this.findLoadedParent(d,0);return!!x&&this._isIdRenderable(x.tileID.key)},m.prototype._isIdRenderable=function(d,x){return this._tiles[d]&&this._tiles[d].hasData()&&!this._coveredTiles[d]&&(x||!this._tiles[d].holdingForFade())},m.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var d in this._cache.reset(),this._tiles)this._tiles[d].state!=="errored"&&this._reloadTile(d,"reloading")},m.prototype._reloadTile=function(d,x){var A=this._tiles[d];A&&(A.state!=="loading"&&(A.state=x),this._loadTile(A,this._tileLoaded.bind(this,A,d,x)))},m.prototype._tileLoaded=function(d,x,A,k){if(k)return d.state="errored",void(k.status!==404?this._source.fire(new i.ErrorEvent(k,{tile:d})):this.update(this.transform));d.timeAdded=i.browser.now(),A==="expired"&&(d.refreshedUponExpiration=!0),this._setTileReloadTimer(x,d),this.getSource().type==="raster-dem"&&d.dem&&this._backfillDEM(d),this._state.initializeTileState(d,this.map?this.map.painter:null),this._source.fire(new i.Event("data",{dataType:"source",tile:d,coord:d.tileID}))},m.prototype._backfillDEM=function(d){for(var x=this.getRenderableIds(),A=0;A<x.length;A++){var k=x[A];if(d.neighboringTiles&&d.neighboringTiles[k]){var R=this.getTileByID(k);j(d,R),j(R,d)}}function j(K,tt){K.needsHillshadePrepare=!0;var ct=tt.tileID.canonical.x-K.tileID.canonical.x,ft=tt.tileID.canonical.y-K.tileID.canonical.y,mt=Math.pow(2,K.tileID.canonical.z),Mt=tt.tileID.key;ct===0&&ft===0||Math.abs(ft)>1||(Math.abs(ct)>1&&(Math.abs(ct+mt)===1?ct+=mt:Math.abs(ct-mt)===1&&(ct-=mt)),tt.dem&&K.dem&&(K.dem.backfillBorder(tt.dem,ct,ft),K.neighboringTiles&&K.neighboringTiles[Mt]&&(K.neighboringTiles[Mt].backfilled=!0)))}},m.prototype.getTile=function(d){return this.getTileByID(d.key)},m.prototype.getTileByID=function(d){return this._tiles[d]},m.prototype._retainLoadedChildren=function(d,x,A,k){for(var R in this._tiles){var j=this._tiles[R];if(!(k[R]||!j.hasData()||j.tileID.overscaledZ<=x||j.tileID.overscaledZ>A)){for(var K=j.tileID;j&&j.tileID.overscaledZ>x+1;){var tt=j.tileID.scaledTo(j.tileID.overscaledZ-1);(j=this._tiles[tt.key])&&j.hasData()&&(K=tt)}for(var ct=K;ct.overscaledZ>x;)if(d[(ct=ct.scaledTo(ct.overscaledZ-1)).key]){k[K.key]=K;break}}}},m.prototype.findLoadedParent=function(d,x){if(d.key in this._loadedParentTiles){var A=this._loadedParentTiles[d.key];return A&&A.tileID.overscaledZ>=x?A:null}for(var k=d.overscaledZ-1;k>=x;k--){var R=d.scaledTo(k),j=this._getLoadedTile(R);if(j)return j}},m.prototype._getLoadedTile=function(d){var x=this._tiles[d.key];return x&&x.hasData()?x:this._cache.getByKey(d.wrapped().key)},m.prototype.updateCacheSize=function(d){var x=Math.ceil(d.width/this._source.tileSize)+1,A=Math.ceil(d.height/this._source.tileSize)+1,k=Math.floor(x*A*5),R=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,k):k;this._cache.setMaxSize(R)},m.prototype.handleWrapJump=function(d){var x=Math.round((d-(this._prevLng===void 0?d:this._prevLng))/360);if(this._prevLng=d,x){var A={};for(var k in this._tiles){var R=this._tiles[k];R.tileID=R.tileID.unwrapTo(R.tileID.wrap+x),A[R.tileID.key]=R}for(var j in this._tiles=A,this._timers)clearTimeout(this._timers[j]),delete this._timers[j];for(var K in this._tiles)this._setTileReloadTimer(K,this._tiles[K])}},m.prototype.update=function(d){var x=this;if(this.transform=d,this._sourceLoaded&&!this._paused){var A;this.updateCacheSize(d),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?A=d.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(xe){return new i.OverscaledTileID(xe.canonical.z,xe.wrap,xe.canonical.z,xe.canonical.x,xe.canonical.y)}):(A=d.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(A=A.filter(function(xe){return x._source.hasTile(xe)}))):A=[];var k=d.coveringZoomLevel(this._source),R=Math.max(k-m.maxOverzooming,this._source.minzoom),j=Math.max(k+m.maxUnderzooming,this._source.minzoom),K=this._updateRetainedTiles(A,k);if(nt(this._source.type)){for(var tt={},ct={},ft=0,mt=Object.keys(K);ft<mt.length;ft+=1){var Mt=mt[ft],At=K[Mt],Dt=this._tiles[Mt];if(Dt&&!(Dt.fadeEndTime&&Dt.fadeEndTime<=i.browser.now())){var xt=this.findLoadedParent(At,R);xt&&(this._addTile(xt.tileID),tt[xt.tileID.key]=xt.tileID),ct[Mt]=At}}for(var Rt in this._retainLoadedChildren(ct,k,j,K),tt)K[Rt]||(this._coveredTiles[Rt]=!0,K[Rt]=tt[Rt])}for(var Nt in K)this._tiles[Nt].clearFadeHold();for(var Yt=0,ne=i.keysDifference(this._tiles,K);Yt<ne.length;Yt+=1){var ae=ne[Yt],le=this._tiles[ae];le.hasSymbolBuckets&&!le.holdingForFade()?le.setHoldDuration(this.map._fadeDuration):le.hasSymbolBuckets&&!le.symbolFadeFinished()||this._removeTile(ae)}this._updateLoadedParentTileCache()}},m.prototype.releaseSymbolFadeTiles=function(){for(var d in this._tiles)this._tiles[d].holdingForFade()&&this._removeTile(d)},m.prototype._updateRetainedTiles=function(d,x){for(var A={},k={},R=Math.max(x-m.maxOverzooming,this._source.minzoom),j=Math.max(x+m.maxUnderzooming,this._source.minzoom),K={},tt=0,ct=d;tt<ct.length;tt+=1){var ft=ct[tt],mt=this._addTile(ft);A[ft.key]=ft,mt.hasData()||x<this._source.maxzoom&&(K[ft.key]=ft)}this._retainLoadedChildren(K,x,j,A);for(var Mt=0,At=d;Mt<At.length;Mt+=1){var Dt=At[Mt],xt=this._tiles[Dt.key];if(!xt.hasData()){if(x+1>this._source.maxzoom){var Rt=Dt.children(this._source.maxzoom)[0],Nt=this.getTile(Rt);if(Nt&&Nt.hasData()){A[Rt.key]=Rt;continue}}else{var Yt=Dt.children(this._source.maxzoom);if(A[Yt[0].key]&&A[Yt[1].key]&&A[Yt[2].key]&&A[Yt[3].key])continue}for(var ne=xt.wasRequested(),ae=Dt.overscaledZ-1;ae>=R;--ae){var le=Dt.scaledTo(ae);if(k[le.key]||(k[le.key]=!0,!(xt=this.getTile(le))&&ne&&(xt=this._addTile(le)),xt&&(A[le.key]=le,ne=xt.wasRequested(),xt.hasData())))break}}}return A},m.prototype._updateLoadedParentTileCache=function(){for(var d in this._loadedParentTiles={},this._tiles){for(var x=[],A=void 0,k=this._tiles[d].tileID;k.overscaledZ>0;){if(k.key in this._loadedParentTiles){A=this._loadedParentTiles[k.key];break}x.push(k.key);var R=k.scaledTo(k.overscaledZ-1);if(A=this._getLoadedTile(R))break;k=R}for(var j=0,K=x;j<K.length;j+=1)this._loadedParentTiles[K[j]]=A}},m.prototype._addTile=function(d){var x=this._tiles[d.key];if(x)return x;(x=this._cache.getAndRemove(d))&&(this._setTileReloadTimer(d.key,x),x.tileID=d,this._state.initializeTileState(x,this.map?this.map.painter:null),this._cacheTimers[d.key]&&(clearTimeout(this._cacheTimers[d.key]),delete this._cacheTimers[d.key],this._setTileReloadTimer(d.key,x)));var A=Boolean(x);return A||(x=new i.Tile(d,this._source.tileSize*d.overscaleFactor()),this._loadTile(x,this._tileLoaded.bind(this,x,d.key,x.state))),x?(x.uses++,this._tiles[d.key]=x,A||this._source.fire(new i.Event("dataloading",{tile:x,coord:x.tileID,dataType:"source"})),x):null},m.prototype._setTileReloadTimer=function(d,x){var A=this;d in this._timers&&(clearTimeout(this._timers[d]),delete this._timers[d]);var k=x.getExpiryTimeout();k&&(this._timers[d]=setTimeout(function(){A._reloadTile(d,"expired"),delete A._timers[d]},k))},m.prototype._removeTile=function(d){var x=this._tiles[d];x&&(x.uses--,delete this._tiles[d],this._timers[d]&&(clearTimeout(this._timers[d]),delete this._timers[d]),x.uses>0||(x.hasData()&&x.state!=="reloading"?this._cache.add(x.tileID,x,x.getExpiryTimeout()):(x.aborted=!0,this._abortTile(x),this._unloadTile(x))))},m.prototype.clearTiles=function(){for(var d in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(d);this._cache.reset()},m.prototype.tilesIn=function(d,x,A){var k=this,R=[],j=this.transform;if(!j)return R;for(var K=A?j.getCameraQueryGeometry(d):d,tt=d.map(function(ae){return j.pointCoordinate(ae)}),ct=K.map(function(ae){return j.pointCoordinate(ae)}),ft=this.getIds(),mt=1/0,Mt=1/0,At=-1/0,Dt=-1/0,xt=0,Rt=ct;xt<Rt.length;xt+=1){var Nt=Rt[xt];mt=Math.min(mt,Nt.x),Mt=Math.min(Mt,Nt.y),At=Math.max(At,Nt.x),Dt=Math.max(Dt,Nt.y)}for(var Yt=function(ae){var le=k._tiles[ft[ae]];if(!le.holdingForFade()){var xe=le.tileID,ke=Math.pow(2,j.zoom-le.tileID.overscaledZ),Le=x*le.queryPadding*i.EXTENT/le.tileSize/ke,$e=[xe.getTilePoint(new i.MercatorCoordinate(mt,Mt)),xe.getTilePoint(new i.MercatorCoordinate(At,Dt))];if($e[0].x-Le<i.EXTENT&&$e[0].y-Le<i.EXTENT&&$e[1].x+Le>=0&&$e[1].y+Le>=0){var lr=tt.map(function(sr){return xe.getTilePoint(sr)}),hr=ct.map(function(sr){return xe.getTilePoint(sr)});R.push({tile:le,tileID:xe,queryGeometry:lr,cameraQueryGeometry:hr,scale:ke})}}},ne=0;ne<ft.length;ne++)Yt(ne);return R},m.prototype.getVisibleCoordinates=function(d){for(var x=this,A=this.getRenderableIds(d).map(function(K){return x._tiles[K].tileID}),k=0,R=A;k<R.length;k+=1){var j=R[k];j.posMatrix=this.transform.calculatePosMatrix(j.toUnwrapped())}return A},m.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(nt(this._source.type))for(var d in this._tiles){var x=this._tiles[d];if(x.fadeEndTime!==void 0&&x.fadeEndTime>=i.browser.now())return!0}return!1},m.prototype.setFeatureState=function(d,x,A){this._state.updateState(d=d||"_geojsonTileLayer",x,A)},m.prototype.removeFeatureState=function(d,x,A){this._state.removeFeatureState(d=d||"_geojsonTileLayer",x,A)},m.prototype.getFeatureState=function(d,x){return this._state.getState(d=d||"_geojsonTileLayer",x)},m.prototype.setDependencies=function(d,x,A){var k=this._tiles[d];k&&k.setDependencies(x,A)},m.prototype.reloadTilesForDependencies=function(d,x){for(var A in this._tiles)this._tiles[A].hasDependency(d,x)&&this._reloadTile(A,"reloading");this._cache.filter(function(k){return!k.hasDependency(d,x)})},m}(i.Evented);function Qt(p,m){var d=Math.abs(2*p.wrap)-+(p.wrap<0),x=Math.abs(2*m.wrap)-+(m.wrap<0);return p.overscaledZ-m.overscaledZ||x-d||m.canonical.y-p.canonical.y||m.canonical.x-p.canonical.x}function nt(p){return p==="raster"||p==="image"||p==="video"}function X(){return new i.window.Worker(Ar.workerUrl)}zt.maxOverzooming=10,zt.maxUnderzooming=3;var Z="mapboxgl_preloaded_worker_pool",rt=function(){this.active={}};rt.prototype.acquire=function(p){if(!this.workers)for(this.workers=[];this.workers.length<rt.workerCount;)this.workers.push(new X);return this.active[p]=!0,this.workers.slice()},rt.prototype.release=function(p){delete this.active[p],this.numActive()===0&&(this.workers.forEach(function(m){m.terminate()}),this.workers=null)},rt.prototype.isPreloaded=function(){return!!this.active[Z]},rt.prototype.numActive=function(){return Object.keys(this.active).length};var lt,gt=Math.floor(i.browser.hardwareConcurrency/2);function pt(){return lt||(lt=new rt),lt}function St(p,m){var d={};for(var x in p)x!=="ref"&&(d[x]=p[x]);return i.refProperties.forEach(function(A){A in m&&(d[A]=m[A])}),d}function Et(p){p=p.slice();for(var m=Object.create(null),d=0;d<p.length;d++)m[p[d].id]=p[d];for(var x=0;x<p.length;x++)"ref"in p[x]&&(p[x]=St(p[x],m[p[x].ref]));return p}rt.workerCount=Math.max(Math.min(gt,6),1);var Ct={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function te(p,m,d){d.push({command:Ct.addSource,args:[p,m[p]]})}function $t(p,m,d){m.push({command:Ct.removeSource,args:[p]}),d[p]=!0}function ee(p,m,d,x){$t(p,d,x),te(p,m,d)}function De(p,m,d){var x;for(x in p[d])if(p[d].hasOwnProperty(x)&&x!=="data"&&!i.deepEqual(p[d][x],m[d][x]))return!1;for(x in m[d])if(m[d].hasOwnProperty(x)&&x!=="data"&&!i.deepEqual(p[d][x],m[d][x]))return!1;return!0}function Se(p,m,d,x,A,k){var R;for(R in m=m||{},p=p||{})p.hasOwnProperty(R)&&(i.deepEqual(p[R],m[R])||d.push({command:k,args:[x,R,m[R],A]}));for(R in m)m.hasOwnProperty(R)&&!p.hasOwnProperty(R)&&(i.deepEqual(p[R],m[R])||d.push({command:k,args:[x,R,m[R],A]}))}function ze(p){return p.id}function Ue(p,m){return p[m.id]=m,p}var Dr=function(p,m){this.reset(p,m)};Dr.prototype.reset=function(p,m){this.points=p||[],this._distances=[0];for(var d=1;d<this.points.length;d++)this._distances[d]=this._distances[d-1]+this.points[d].dist(this.points[d-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(m||0,.5*this.length),this.paddedLength=this.length-2*this.padding},Dr.prototype.lerp=function(p){if(this.points.length===1)return this.points[0];p=i.clamp(p,0,1);for(var m=1,d=this._distances[m],x=p*this.paddedLength+this.padding;d<x&&m<this._distances.length;)d=this._distances[++m];var A=m-1,k=this._distances[A],R=d-k,j=R>0?(x-k)/R:0;return this.points[A].mult(1-j).add(this.points[m].mult(j))};var ur=function(p,m,d){var x=this.boxCells=[],A=this.circleCells=[];this.xCellCount=Math.ceil(p/d),this.yCellCount=Math.ceil(m/d);for(var k=0;k<this.xCellCount*this.yCellCount;k++)x.push([]),A.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=p,this.height=m,this.xScale=this.xCellCount/p,this.yScale=this.yCellCount/m,this.boxUid=0,this.circleUid=0};function mr(p,m,d,x,A){var k=i.create();return m?(i.scale(k,k,[1/A,1/A,1]),d||i.rotateZ(k,k,x.angle)):i.multiply(k,x.labelPlaneMatrix,p),k}function nr(p,m,d,x,A){if(m){var k=i.clone(p);return i.scale(k,k,[A,A,1]),d||i.rotateZ(k,k,-x.angle),k}return x.glCoordMatrix}function Xe(p,m){var d=[p.x,p.y,0,1];un(d,d,m);var x=d[3];return{point:new i.Point(d[0]/x,d[1]/x),signedDistanceFromCamera:x}}function Sr(p,m){return .5+p/m*.5}function ni(p,m){var d=p[0]/p[3],x=p[1]/p[3];return d>=-m[0]&&d<=m[0]&&x>=-m[1]&&x<=m[1]}function rn(p,m,d,x,A,k,R,j){var K=x?p.textSizeData:p.iconSizeData,tt=i.evaluateSizeForZoom(K,d.transform.zoom),ct=[256/d.width*2+1,256/d.height*2+1],ft=x?p.text.dynamicLayoutVertexArray:p.icon.dynamicLayoutVertexArray;ft.clear();for(var mt=p.lineVertexArray,Mt=x?p.text.placedSymbolArray:p.icon.placedSymbolArray,At=d.transform.width/d.transform.height,Dt=!1,xt=0;xt<Mt.length;xt++){var Rt=Mt.get(xt);if(Rt.hidden||Rt.writingMode===i.WritingMode.vertical&&!Dt)Wn(Rt.numGlyphs,ft);else{Dt=!1;var Nt=[Rt.anchorX,Rt.anchorY,0,1];if(i.transformMat4(Nt,Nt,m),ni(Nt,ct)){var Yt=Sr(d.transform.cameraToCenterDistance,Nt[3]),ne=i.evaluateSizeForFeature(K,tt,Rt),ae=R?ne/Yt:ne*Yt,le=new i.Point(Rt.anchorX,Rt.anchorY),xe=Xe(le,A).point,ke={},Le=sl(Rt,ae,!1,j,m,A,k,p.glyphOffsetArray,mt,ft,xe,le,ke,At);Dt=Le.useVertical,(Le.notEnoughRoom||Dt||Le.needsFlipping&&sl(Rt,ae,!0,j,m,A,k,p.glyphOffsetArray,mt,ft,xe,le,ke,At).notEnoughRoom)&&Wn(Rt.numGlyphs,ft)}else Wn(Rt.numGlyphs,ft)}}x?p.text.dynamicLayoutVertexBuffer.updateData(ft):p.icon.dynamicLayoutVertexBuffer.updateData(ft)}function si(p,m,d,x,A,k,R,j,K,tt,ct){var ft=j.glyphStartIndex+j.numGlyphs,mt=j.lineStartIndex,Mt=j.lineStartIndex+j.lineLength,At=m.getoffsetX(j.glyphStartIndex),Dt=m.getoffsetX(ft-1),xt=Yi(p*At,d,x,A,k,R,j.segment,mt,Mt,K,tt,ct);if(!xt)return null;var Rt=Yi(p*Dt,d,x,A,k,R,j.segment,mt,Mt,K,tt,ct);return Rt?{first:xt,last:Rt}:null}function Nn(p,m,d,x){return p===i.WritingMode.horizontal&&Math.abs(d.y-m.y)>Math.abs(d.x-m.x)*x?{useVertical:!0}:(p===i.WritingMode.vertical?m.y<d.y:m.x>d.x)?{needsFlipping:!0}:null}function sl(p,m,d,x,A,k,R,j,K,tt,ct,ft,mt,Mt){var At,Dt=m/24,xt=p.lineOffsetX*Dt,Rt=p.lineOffsetY*Dt;if(p.numGlyphs>1){var Nt=p.glyphStartIndex+p.numGlyphs,Yt=p.lineStartIndex,ne=p.lineStartIndex+p.lineLength,ae=si(Dt,j,xt,Rt,d,ct,ft,p,K,k,mt);if(!ae)return{notEnoughRoom:!0};var le=Xe(ae.first.point,R).point,xe=Xe(ae.last.point,R).point;if(x&&!d){var ke=Nn(p.writingMode,le,xe,Mt);if(ke)return ke}At=[ae.first];for(var Le=p.glyphStartIndex+1;Le<Nt-1;Le++)At.push(Yi(Dt*j.getoffsetX(Le),xt,Rt,d,ct,ft,p.segment,Yt,ne,K,k,mt));At.push(ae.last)}else{if(x&&!d){var $e=Xe(ft,A).point,lr=p.lineStartIndex+p.segment+1,hr=new i.Point(K.getx(lr),K.gety(lr)),sr=Xe(hr,A),Zr=sr.signedDistanceFromCamera>0?sr.point:gi(ft,hr,$e,1,A),Qe=Nn(p.writingMode,$e,Zr,Mt);if(Qe)return Qe}var Ir=Yi(Dt*j.getoffsetX(p.glyphStartIndex),xt,Rt,d,ct,ft,p.segment,p.lineStartIndex,p.lineStartIndex+p.lineLength,K,k,mt);if(!Ir)return{notEnoughRoom:!0};At=[Ir]}for(var jr=0,Er=At;jr<Er.length;jr+=1){var vr=Er[jr];i.addDynamicAttributes(tt,vr.point,vr.angle)}return{}}function gi(p,m,d,x,A){var k=Xe(p.add(p.sub(m)._unit()),A).point,R=d.sub(k);return d.add(R._mult(x/R.mag()))}function Yi(p,m,d,x,A,k,R,j,K,tt,ct,ft){var mt=x?p-m:p+m,Mt=mt>0?1:-1,At=0;x&&(Mt*=-1,At=Math.PI),Mt<0&&(At+=Math.PI);for(var Dt=Mt>0?j+R:j+R+1,xt=A,Rt=A,Nt=0,Yt=0,ne=Math.abs(mt),ae=[];Nt+Yt<=ne;){if((Dt+=Mt)<j||Dt>=K)return null;if(Rt=xt,ae.push(xt),(xt=ft[Dt])===void 0){var le=new i.Point(tt.getx(Dt),tt.gety(Dt)),xe=Xe(le,ct);if(xe.signedDistanceFromCamera>0)xt=ft[Dt]=xe.point;else{var ke=Dt-Mt;xt=gi(Nt===0?k:new i.Point(tt.getx(ke),tt.gety(ke)),le,Rt,ne-Nt+1,ct)}}Nt+=Yt,Yt=Rt.dist(xt)}var Le=(ne-Nt)/Yt,$e=xt.sub(Rt),lr=$e.mult(Le)._add(Rt);lr._add($e._unit()._perp()._mult(d*Mt));var hr=At+Math.atan2(xt.y-Rt.y,xt.x-Rt.x);return ae.push(lr),{point:lr,angle:hr,path:ae}}ur.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},ur.prototype.insert=function(p,m,d,x,A){this._forEachCell(m,d,x,A,this._insertBoxCell,this.boxUid++),this.boxKeys.push(p),this.bboxes.push(m),this.bboxes.push(d),this.bboxes.push(x),this.bboxes.push(A)},ur.prototype.insertCircle=function(p,m,d,x){this._forEachCell(m-x,d-x,m+x,d+x,this._insertCircleCell,this.circleUid++),this.circleKeys.push(p),this.circles.push(m),this.circles.push(d),this.circles.push(x)},ur.prototype._insertBoxCell=function(p,m,d,x,A,k){this.boxCells[A].push(k)},ur.prototype._insertCircleCell=function(p,m,d,x,A,k){this.circleCells[A].push(k)},ur.prototype._query=function(p,m,d,x,A,k){if(d<0||p>this.width||x<0||m>this.height)return!A&&[];var R=[];if(p<=0&&m<=0&&this.width<=d&&this.height<=x){if(A)return!0;for(var j=0;j<this.boxKeys.length;j++)R.push({key:this.boxKeys[j],x1:this.bboxes[4*j],y1:this.bboxes[4*j+1],x2:this.bboxes[4*j+2],y2:this.bboxes[4*j+3]});for(var K=0;K<this.circleKeys.length;K++){var tt=this.circles[3*K],ct=this.circles[3*K+1],ft=this.circles[3*K+2];R.push({key:this.circleKeys[K],x1:tt-ft,y1:ct-ft,x2:tt+ft,y2:ct+ft})}return k?R.filter(k):R}return this._forEachCell(p,m,d,x,this._queryCell,R,{hitTest:A,seenUids:{box:{},circle:{}}},k),A?R.length>0:R},ur.prototype._queryCircle=function(p,m,d,x,A){var k=p-d,R=p+d,j=m-d,K=m+d;if(R<0||k>this.width||K<0||j>this.height)return!x&&[];var tt=[];return this._forEachCell(k,j,R,K,this._queryCellCircle,tt,{hitTest:x,circle:{x:p,y:m,radius:d},seenUids:{box:{},circle:{}}},A),x?tt.length>0:tt},ur.prototype.query=function(p,m,d,x,A){return this._query(p,m,d,x,!1,A)},ur.prototype.hitTest=function(p,m,d,x,A){return this._query(p,m,d,x,!0,A)},ur.prototype.hitTestCircle=function(p,m,d,x){return this._queryCircle(p,m,d,!0,x)},ur.prototype._queryCell=function(p,m,d,x,A,k,R,j){var K=R.seenUids,tt=this.boxCells[A];if(tt!==null)for(var ct=this.bboxes,ft=0,mt=tt;ft<mt.length;ft+=1){var Mt=mt[ft];if(!K.box[Mt]){K.box[Mt]=!0;var At=4*Mt;if(p<=ct[At+2]&&m<=ct[At+3]&&d>=ct[At+0]&&x>=ct[At+1]&&(!j||j(this.boxKeys[Mt]))){if(R.hitTest)return k.push(!0),!0;k.push({key:this.boxKeys[Mt],x1:ct[At],y1:ct[At+1],x2:ct[At+2],y2:ct[At+3]})}}}var Dt=this.circleCells[A];if(Dt!==null)for(var xt=this.circles,Rt=0,Nt=Dt;Rt<Nt.length;Rt+=1){var Yt=Nt[Rt];if(!K.circle[Yt]){K.circle[Yt]=!0;var ne=3*Yt;if(this._circleAndRectCollide(xt[ne],xt[ne+1],xt[ne+2],p,m,d,x)&&(!j||j(this.circleKeys[Yt]))){if(R.hitTest)return k.push(!0),!0;var ae=xt[ne],le=xt[ne+1],xe=xt[ne+2];k.push({key:this.circleKeys[Yt],x1:ae-xe,y1:le-xe,x2:ae+xe,y2:le+xe})}}}},ur.prototype._queryCellCircle=function(p,m,d,x,A,k,R,j){var K=R.circle,tt=R.seenUids,ct=this.boxCells[A];if(ct!==null)for(var ft=this.bboxes,mt=0,Mt=ct;mt<Mt.length;mt+=1){var At=Mt[mt];if(!tt.box[At]){tt.box[At]=!0;var Dt=4*At;if(this._circleAndRectCollide(K.x,K.y,K.radius,ft[Dt+0],ft[Dt+1],ft[Dt+2],ft[Dt+3])&&(!j||j(this.boxKeys[At])))return k.push(!0),!0}}var xt=this.circleCells[A];if(xt!==null)for(var Rt=this.circles,Nt=0,Yt=xt;Nt<Yt.length;Nt+=1){var ne=Yt[Nt];if(!tt.circle[ne]){tt.circle[ne]=!0;var ae=3*ne;if(this._circlesCollide(Rt[ae],Rt[ae+1],Rt[ae+2],K.x,K.y,K.radius)&&(!j||j(this.circleKeys[ne])))return k.push(!0),!0}}},ur.prototype._forEachCell=function(p,m,d,x,A,k,R,j){for(var K=this._convertToXCellCoord(p),tt=this._convertToYCellCoord(m),ct=this._convertToXCellCoord(d),ft=this._convertToYCellCoord(x),mt=K;mt<=ct;mt++)for(var Mt=tt;Mt<=ft;Mt++)if(A.call(this,p,m,d,x,this.xCellCount*Mt+mt,k,R,j))return},ur.prototype._convertToXCellCoord=function(p){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(p*this.xScale)))},ur.prototype._convertToYCellCoord=function(p){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(p*this.yScale)))},ur.prototype._circlesCollide=function(p,m,d,x,A,k){var R=x-p,j=A-m,K=d+k;return K*K>R*R+j*j},ur.prototype._circleAndRectCollide=function(p,m,d,x,A,k,R){var j=(k-x)/2,K=Math.abs(p-(x+j));if(K>j+d)return!1;var tt=(R-A)/2,ct=Math.abs(m-(A+tt));if(ct>tt+d)return!1;if(K<=j||ct<=tt)return!0;var ft=K-j,mt=ct-tt;return ft*ft+mt*mt<=d*d};var gs=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Wn(p,m){for(var d=0;d<p;d++){var x=m.length;m.resize(x+4),m.float32.set(gs,3*x)}}function un(p,m,d){var x=m[0],A=m[1];return p[0]=d[0]*x+d[4]*A+d[12],p[1]=d[1]*x+d[5]*A+d[13],p[3]=d[3]*x+d[7]*A+d[15],p}var Po=function(p,m,d){m===void 0&&(m=new ur(p.width+200,p.height+200,25)),d===void 0&&(d=new ur(p.width+200,p.height+200,25)),this.transform=p,this.grid=m,this.ignoredGrid=d,this.pitchfactor=Math.cos(p._pitch)*p.cameraToCenterDistance,this.screenRightBoundary=p.width+100,this.screenBottomBoundary=p.height+100,this.gridRightBoundary=p.width+200,this.gridBottomBoundary=p.height+200};function Si(p,m,d){return m*(i.EXTENT/(p.tileSize*Math.pow(2,d-p.tileID.overscaledZ)))}Po.prototype.placeCollisionBox=function(p,m,d,x,A){var k=this.projectAndGetPerspectiveRatio(x,p.anchorPointX,p.anchorPointY),R=d*k.perspectiveRatio,j=p.x1*R+k.point.x,K=p.y1*R+k.point.y,tt=p.x2*R+k.point.x,ct=p.y2*R+k.point.y;return!this.isInsideGrid(j,K,tt,ct)||!m&&this.grid.hitTest(j,K,tt,ct,A)?{box:[],offscreen:!1}:{box:[j,K,tt,ct],offscreen:this.isOffscreen(j,K,tt,ct)}},Po.prototype.placeCollisionCircles=function(p,m,d,x,A,k,R,j,K,tt,ct,ft,mt){var Mt=[],At=new i.Point(m.anchorX,m.anchorY),Dt=Xe(At,k),xt=Sr(this.transform.cameraToCenterDistance,Dt.signedDistanceFromCamera),Rt=(tt?A/xt:A*xt)/i.ONE_EM,Nt=Xe(At,R).point,Yt=si(Rt,x,m.lineOffsetX*Rt,m.lineOffsetY*Rt,!1,Nt,At,m,d,R,{}),ne=!1,ae=!1,le=!0;if(Yt){for(var xe=.5*ft*xt+mt,ke=new i.Point(-100,-100),Le=new i.Point(this.screenRightBoundary,this.screenBottomBoundary),$e=new Dr,lr=Yt.first,hr=Yt.last,sr=[],Zr=lr.path.length-1;Zr>=1;Zr--)sr.push(lr.path[Zr]);for(var Qe=1;Qe<hr.path.length;Qe++)sr.push(hr.path[Qe]);var Ir=2.5*xe;if(j){var jr=sr.map(function(jo){return Xe(jo,j)});sr=jr.some(function(jo){return jo.signedDistanceFromCamera<=0})?[]:jr.map(function(jo){return jo.point})}var Er=[];if(sr.length>0){for(var vr=sr[0].clone(),Pr=sr[0].clone(),fr=1;fr<sr.length;fr++)vr.x=Math.min(vr.x,sr[fr].x),vr.y=Math.min(vr.y,sr[fr].y),Pr.x=Math.max(Pr.x,sr[fr].x),Pr.y=Math.max(Pr.y,sr[fr].y);Er=vr.x>=ke.x&&Pr.x<=Le.x&&vr.y>=ke.y&&Pr.y<=Le.y?[sr]:Pr.x<ke.x||vr.x>Le.x||Pr.y<ke.y||vr.y>Le.y?[]:i.clipLine([sr],ke.x,ke.y,Le.x,Le.y)}for(var cr=0,Ui=Er;cr<Ui.length;cr+=1){var tn;$e.reset(Ui[cr],.25*xe),tn=$e.length<=.5*xe?1:Math.ceil($e.paddedLength/Ir)+1;for(var hn=0;hn<tn;hn++){var jn=hn/Math.max(tn-1,1),Xi=$e.lerp(jn),Kr=Xi.x+100,_o=Xi.y+100;Mt.push(Kr,_o,xe,0);var lo=Kr-xe,Vo=_o-xe,Tn=Kr+xe,Go=_o+xe;if(le=le&&this.isOffscreen(lo,Vo,Tn,Go),ae=ae||this.isInsideGrid(lo,Vo,Tn,Go),!p&&this.grid.hitTestCircle(Kr,_o,xe,ct)&&(ne=!0,!K))return{circles:[],offscreen:!1,collisionDetected:ne}}}}return{circles:!K&&ne||!ae?[]:Mt,offscreen:le,collisionDetected:ne}},Po.prototype.queryRenderedSymbols=function(p){if(p.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};for(var m=[],d=1/0,x=1/0,A=-1/0,k=-1/0,R=0,j=p;R<j.length;R+=1){var K=j[R],tt=new i.Point(K.x+100,K.y+100);d=Math.min(d,tt.x),x=Math.min(x,tt.y),A=Math.max(A,tt.x),k=Math.max(k,tt.y),m.push(tt)}for(var ct={},ft={},mt=0,Mt=this.grid.query(d,x,A,k).concat(this.ignoredGrid.query(d,x,A,k));mt<Mt.length;mt+=1){var At=Mt[mt],Dt=At.key;if(ct[Dt.bucketInstanceId]===void 0&&(ct[Dt.bucketInstanceId]={}),!ct[Dt.bucketInstanceId][Dt.featureIndex]){var xt=[new i.Point(At.x1,At.y1),new i.Point(At.x2,At.y1),new i.Point(At.x2,At.y2),new i.Point(At.x1,At.y2)];i.polygonIntersectsPolygon(m,xt)&&(ct[Dt.bucketInstanceId][Dt.featureIndex]=!0,ft[Dt.bucketInstanceId]===void 0&&(ft[Dt.bucketInstanceId]=[]),ft[Dt.bucketInstanceId].push(Dt.featureIndex))}}return ft},Po.prototype.insertCollisionBox=function(p,m,d,x,A){(m?this.ignoredGrid:this.grid).insert({bucketInstanceId:d,featureIndex:x,collisionGroupID:A},p[0],p[1],p[2],p[3])},Po.prototype.insertCollisionCircles=function(p,m,d,x,A){for(var k=m?this.ignoredGrid:this.grid,R={bucketInstanceId:d,featureIndex:x,collisionGroupID:A},j=0;j<p.length;j+=4)k.insertCircle(R,p[j],p[j+1],p[j+2])},Po.prototype.projectAndGetPerspectiveRatio=function(p,m,d){var x=[m,d,0,1];return un(x,x,p),{point:new i.Point((x[0]/x[3]+1)/2*this.transform.width+100,(-x[1]/x[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/x[3]*.5}},Po.prototype.isOffscreen=function(p,m,d,x){return d<100||p>=this.screenRightBoundary||x<100||m>this.screenBottomBoundary},Po.prototype.isInsideGrid=function(p,m,d,x){return d>=0&&p<this.gridRightBoundary&&x>=0&&m<this.gridBottomBoundary},Po.prototype.getViewportMatrix=function(){var p=i.identity([]);return i.translate(p,p,[-100,-100,0]),p};var Mo=function(p,m,d,x){this.opacity=p?Math.max(0,Math.min(1,p.opacity+(p.placed?m:-m))):x&&d?1:0,this.placed=d};Mo.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var oo=function(p,m,d,x,A){this.text=new Mo(p?p.text:null,m,d,A),this.icon=new Mo(p?p.icon:null,m,x,A)};oo.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var Ou=function(p,m,d){this.text=p,this.icon=m,this.skipFade=d},Lo=function(){this.invProjMatrix=i.create(),this.viewportMatrix=i.create(),this.circles=[]},ys=function(p,m,d,x,A){this.bucketInstanceId=p,this.featureIndex=m,this.sourceLayerIndex=d,this.bucketIndex=x,this.tileID=A},Bo=function(p){this.crossSourceCollisions=p,this.maxGroupID=0,this.collisionGroups={}};function Hi(p,m,d,x,A){var k=i.getAnchorAlignment(p),R=-(k.horizontalAlign-.5)*m,j=-(k.verticalAlign-.5)*d,K=i.evaluateVariableOffset(p,x);return new i.Point(R+K[0]*A,j+K[1]*A)}function po(p,m,d,x,A,k){var R=p.x1,j=p.x2,K=p.y1,tt=p.y2,ct=p.anchorPointX,ft=p.anchorPointY,mt=new i.Point(m,d);return x&&mt._rotate(A?k:-k),{x1:R+mt.x,y1:K+mt.y,x2:j+mt.x,y2:tt+mt.y,anchorPointX:ct,anchorPointY:ft}}Bo.prototype.get=function(p){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[p]){var m=++this.maxGroupID;this.collisionGroups[p]={ID:m,predicate:function(d){return d.collisionGroupID===m}}}return this.collisionGroups[p]};var Sn=function(p,m,d,x){this.transform=p.clone(),this.collisionIndex=new Po(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=m,this.retainedQueryData={},this.collisionGroups=new Bo(d),this.collisionCircleArrays={},this.prevPlacement=x,x&&(x.prevPlacement=void 0),this.placedOrientations={}};function oa(p,m,d,x,A){p.emplaceBack(m?1:0,d?1:0,x||0,A||0),p.emplaceBack(m?1:0,d?1:0,x||0,A||0),p.emplaceBack(m?1:0,d?1:0,x||0,A||0),p.emplaceBack(m?1:0,d?1:0,x||0,A||0)}Sn.prototype.getBucketParts=function(p,m,d,x){var A=d.getBucket(m),k=d.latestFeatureIndex;if(A&&k&&m.id===A.layerIds[0]){var R=d.collisionBoxArray,j=A.layers[0].layout,K=Math.pow(2,this.transform.zoom-d.tileID.overscaledZ),tt=d.tileSize/i.EXTENT,ct=this.transform.calculatePosMatrix(d.tileID.toUnwrapped()),ft=j.get("text-pitch-alignment")==="map",mt=j.get("text-rotation-alignment")==="map",Mt=Si(d,1,this.transform.zoom),At=mr(ct,ft,mt,this.transform,Mt),Dt=null;if(ft){var xt=nr(ct,ft,mt,this.transform,Mt);Dt=i.multiply([],this.transform.labelPlaneMatrix,xt)}this.retainedQueryData[A.bucketInstanceId]=new ys(A.bucketInstanceId,k,A.sourceLayerIndex,A.index,d.tileID);var Rt={bucket:A,layout:j,posMatrix:ct,textLabelPlaneMatrix:At,labelToScreenMatrix:Dt,scale:K,textPixelRatio:tt,holdingForFade:d.holdingForFade(),collisionBoxArray:R,partiallyEvaluatedTextSize:i.evaluateSizeForZoom(A.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(A.sourceID)};if(x)for(var Nt=0,Yt=A.sortKeyRanges;Nt<Yt.length;Nt+=1){var ne=Yt[Nt];p.push({sortKey:ne.sortKey,symbolInstanceStart:ne.symbolInstanceStart,symbolInstanceEnd:ne.symbolInstanceEnd,parameters:Rt})}else p.push({symbolInstanceStart:0,symbolInstanceEnd:A.symbolInstances.length,parameters:Rt})}},Sn.prototype.attemptAnchorPlacement=function(p,m,d,x,A,k,R,j,K,tt,ct,ft,mt,Mt,At){var Dt,xt=[ft.textOffset0,ft.textOffset1],Rt=Hi(p,d,x,xt,A),Nt=this.collisionIndex.placeCollisionBox(po(m,Rt.x,Rt.y,k,R,this.transform.angle),ct,j,K,tt.predicate);if(!At||this.collisionIndex.placeCollisionBox(po(At,Rt.x,Rt.y,k,R,this.transform.angle),ct,j,K,tt.predicate).box.length!==0)return Nt.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[ft.crossTileID]&&this.prevPlacement.placements[ft.crossTileID]&&this.prevPlacement.placements[ft.crossTileID].text&&(Dt=this.prevPlacement.variableOffsets[ft.crossTileID].anchor),this.variableOffsets[ft.crossTileID]={textOffset:xt,width:d,height:x,anchor:p,textBoxScale:A,prevAnchor:Dt},this.markUsedJustification(mt,p,ft,Mt),mt.allowVerticalPlacement&&(this.markUsedOrientation(mt,Mt,ft),this.placedOrientations[ft.crossTileID]=Mt),{shift:Rt,placedGlyphBoxes:Nt}):void 0},Sn.prototype.placeLayerBucketPart=function(p,m,d){var x=this,A=p.parameters,k=A.bucket,R=A.layout,j=A.posMatrix,K=A.textLabelPlaneMatrix,tt=A.labelToScreenMatrix,ct=A.textPixelRatio,ft=A.holdingForFade,mt=A.collisionBoxArray,Mt=A.partiallyEvaluatedTextSize,At=A.collisionGroup,Dt=R.get("text-optional"),xt=R.get("icon-optional"),Rt=R.get("text-allow-overlap"),Nt=R.get("icon-allow-overlap"),Yt=R.get("text-rotation-alignment")==="map",ne=R.get("text-pitch-alignment")==="map",ae=R.get("icon-text-fit")!=="none",le=R.get("symbol-z-order")==="viewport-y",xe=Rt&&(Nt||!k.hasIconData()||xt),ke=Nt&&(Rt||!k.hasTextData()||Dt);!k.collisionArrays&&mt&&k.deserializeCollisionBoxes(mt);var Le=function(Qe,Ir){if(!m[Qe.crossTileID])if(ft)x.placements[Qe.crossTileID]=new Ou(!1,!1,!1);else{var jr,Er=!1,vr=!1,Pr=!0,fr=null,cr={box:null,offscreen:null},Ui={box:null,offscreen:null},tn=null,hn=null,jn=0,Xi=0,Kr=0;Ir.textFeatureIndex?jn=Ir.textFeatureIndex:Qe.useRuntimeCollisionCircles&&(jn=Qe.featureIndex),Ir.verticalTextFeatureIndex&&(Xi=Ir.verticalTextFeatureIndex);var _o=Ir.textBox;if(_o){var lo=function(ri){var vo=i.WritingMode.horizontal;if(k.allowVerticalPlacement&&!ri&&x.prevPlacement){var Do=x.prevPlacement.placedOrientations[Qe.crossTileID];Do&&(x.placedOrientations[Qe.crossTileID]=Do,x.markUsedOrientation(k,vo=Do,Qe))}return vo},Vo=function(ri,vo){if(k.allowVerticalPlacement&&Qe.numVerticalGlyphVertices>0&&Ir.verticalTextBox)for(var Do=0,Pl=k.writingModes;Do<Pl.length&&(Pl[Do]===i.WritingMode.vertical?(cr=vo(),Ui=cr):cr=ri(),!(cr&&cr.box&&cr.box.length));Do+=1);else cr=ri()};if(R.get("text-variable-anchor")){var Tn=R.get("text-variable-anchor");if(x.prevPlacement&&x.prevPlacement.variableOffsets[Qe.crossTileID]){var Go=x.prevPlacement.variableOffsets[Qe.crossTileID];Tn.indexOf(Go.anchor)>0&&(Tn=Tn.filter(function(ri){return ri!==Go.anchor})).unshift(Go.anchor)}var jo=function(ri,vo,Do){for(var Pl=ri.x2-ri.x1,uu=ri.y2-ri.y1,cu=Qe.textBoxScale,cp=ae&&!Nt?vo:null,Ms={box:[],offscreen:!1},hp=Rt?2*Tn.length:Tn.length,Ls=0;Ls<hp;++Ls){var Ku=x.attemptAnchorPlacement(Tn[Ls%Tn.length],ri,Pl,uu,cu,Yt,ne,ct,j,At,Ls>=Tn.length,Qe,k,Do,cp);if(Ku&&(Ms=Ku.placedGlyphBoxes)&&Ms.box&&Ms.box.length){Er=!0,fr=Ku.shift;break}}return Ms};Vo(function(){return jo(_o,Ir.iconBox,i.WritingMode.horizontal)},function(){var ri=Ir.verticalTextBox;return k.allowVerticalPlacement&&!(cr&&cr.box&&cr.box.length)&&Qe.numVerticalGlyphVertices>0&&ri?jo(ri,Ir.verticalIconBox,i.WritingMode.vertical):{box:null,offscreen:null}}),cr&&(Er=cr.box,Pr=cr.offscreen);var au=lo(cr&&cr.box);if(!Er&&x.prevPlacement){var su=x.prevPlacement.variableOffsets[Qe.crossTileID];su&&(x.variableOffsets[Qe.crossTileID]=su,x.markUsedJustification(k,su.anchor,Qe,au))}}else{var Ps=function(ri,vo){var Do=x.collisionIndex.placeCollisionBox(ri,Rt,ct,j,At.predicate);return Do&&Do.box&&Do.box.length&&(x.markUsedOrientation(k,vo,Qe),x.placedOrientations[Qe.crossTileID]=vo),Do};Vo(function(){return Ps(_o,i.WritingMode.horizontal)},function(){var ri=Ir.verticalTextBox;return k.allowVerticalPlacement&&Qe.numVerticalGlyphVertices>0&&ri?Ps(ri,i.WritingMode.vertical):{box:null,offscreen:null}}),lo(cr&&cr.box&&cr.box.length)}}if(Er=(jr=cr)&&jr.box&&jr.box.length>0,Pr=jr&&jr.offscreen,Qe.useRuntimeCollisionCircles){var lu=k.text.placedSymbolArray.get(Qe.centerJustifiedTextSymbolIndex),Cl=i.evaluateSizeForFeature(k.textSizeData,Mt,lu),es=R.get("text-padding");tn=x.collisionIndex.placeCollisionCircles(Rt,lu,k.lineVertexArray,k.glyphOffsetArray,Cl,j,K,tt,d,ne,At.predicate,Qe.collisionCircleDiameter,es),Er=Rt||tn.circles.length>0&&!tn.collisionDetected,Pr=Pr&&tn.offscreen}if(Ir.iconFeatureIndex&&(Kr=Ir.iconFeatureIndex),Ir.iconBox){var Al=function(ri){var vo=ae&&fr?po(ri,fr.x,fr.y,Yt,ne,x.transform.angle):ri;return x.collisionIndex.placeCollisionBox(vo,Nt,ct,j,At.predicate)};vr=Ui&&Ui.box&&Ui.box.length&&Ir.verticalIconBox?(hn=Al(Ir.verticalIconBox)).box.length>0:(hn=Al(Ir.iconBox)).box.length>0,Pr=Pr&&hn.offscreen}var Da=Dt||Qe.numHorizontalGlyphVertices===0&&Qe.numVerticalGlyphVertices===0,In=xt||Qe.numIconVertices===0;if(Da||In?In?Da||(vr=vr&&Er):Er=vr&&Er:vr=Er=vr&&Er,Er&&jr&&jr.box&&x.collisionIndex.insertCollisionBox(jr.box,R.get("text-ignore-placement"),k.bucketInstanceId,Ui&&Ui.box&&Xi?Xi:jn,At.ID),vr&&hn&&x.collisionIndex.insertCollisionBox(hn.box,R.get("icon-ignore-placement"),k.bucketInstanceId,Kr,At.ID),tn&&(Er&&x.collisionIndex.insertCollisionCircles(tn.circles,R.get("text-ignore-placement"),k.bucketInstanceId,jn,At.ID),d)){var qo=k.bucketInstanceId,Ys=x.collisionCircleArrays[qo];Ys===void 0&&(Ys=x.collisionCircleArrays[qo]=new Lo);for(var Oa=0;Oa<tn.circles.length;Oa+=4)Ys.circles.push(tn.circles[Oa+0]),Ys.circles.push(tn.circles[Oa+1]),Ys.circles.push(tn.circles[Oa+2]),Ys.circles.push(tn.collisionDetected?1:0)}x.placements[Qe.crossTileID]=new Ou(Er||xe,vr||ke,Pr||k.justReloaded),m[Qe.crossTileID]=!0}};if(le)for(var $e=k.getSortedSymbolIndexes(this.transform.angle),lr=$e.length-1;lr>=0;--lr){var hr=$e[lr];Le(k.symbolInstances.get(hr),k.collisionArrays[hr])}else for(var sr=p.symbolInstanceStart;sr<p.symbolInstanceEnd;sr++)Le(k.symbolInstances.get(sr),k.collisionArrays[sr]);if(d&&k.bucketInstanceId in this.collisionCircleArrays){var Zr=this.collisionCircleArrays[k.bucketInstanceId];i.invert(Zr.invProjMatrix,j),Zr.viewportMatrix=this.collisionIndex.getViewportMatrix()}k.justReloaded=!1},Sn.prototype.markUsedJustification=function(p,m,d,x){var A;A=x===i.WritingMode.vertical?d.verticalPlacedTextSymbolIndex:{left:d.leftJustifiedTextSymbolIndex,center:d.centerJustifiedTextSymbolIndex,right:d.rightJustifiedTextSymbolIndex}[i.getAnchorJustification(m)];for(var k=0,R=[d.leftJustifiedTextSymbolIndex,d.centerJustifiedTextSymbolIndex,d.rightJustifiedTextSymbolIndex,d.verticalPlacedTextSymbolIndex];k<R.length;k+=1){var j=R[k];j>=0&&(p.text.placedSymbolArray.get(j).crossTileID=A>=0&&j!==A?0:d.crossTileID)}},Sn.prototype.markUsedOrientation=function(p,m,d){for(var x=m===i.WritingMode.horizontal||m===i.WritingMode.horizontalOnly?m:0,A=m===i.WritingMode.vertical?m:0,k=0,R=[d.leftJustifiedTextSymbolIndex,d.centerJustifiedTextSymbolIndex,d.rightJustifiedTextSymbolIndex];k<R.length;k+=1)p.text.placedSymbolArray.get(R[k]).placedOrientation=x;d.verticalPlacedTextSymbolIndex&&(p.text.placedSymbolArray.get(d.verticalPlacedTextSymbolIndex).placedOrientation=A)},Sn.prototype.commit=function(p){this.commitTime=p,this.zoomAtLastRecencyCheck=this.transform.zoom;var m=this.prevPlacement,d=!1;this.prevZoomAdjustment=m?m.zoomAdjustment(this.transform.zoom):0;var x=m?m.symbolFadeChange(p):1,A=m?m.opacities:{},k=m?m.variableOffsets:{},R=m?m.placedOrientations:{};for(var j in this.placements){var K=this.placements[j],tt=A[j];tt?(this.opacities[j]=new oo(tt,x,K.text,K.icon),d=d||K.text!==tt.text.placed||K.icon!==tt.icon.placed):(this.opacities[j]=new oo(null,x,K.text,K.icon,K.skipFade),d=d||K.text||K.icon)}for(var ct in A){var ft=A[ct];if(!this.opacities[ct]){var mt=new oo(ft,x,!1,!1);mt.isHidden()||(this.opacities[ct]=mt,d=d||ft.text.placed||ft.icon.placed)}}for(var Mt in k)this.variableOffsets[Mt]||!this.opacities[Mt]||this.opacities[Mt].isHidden()||(this.variableOffsets[Mt]=k[Mt]);for(var At in R)this.placedOrientations[At]||!this.opacities[At]||this.opacities[At].isHidden()||(this.placedOrientations[At]=R[At]);d?this.lastPlacementChangeTime=p:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=m?m.lastPlacementChangeTime:p)},Sn.prototype.updateLayerOpacities=function(p,m){for(var d={},x=0,A=m;x<A.length;x+=1){var k=A[x],R=k.getBucket(p);R&&k.latestFeatureIndex&&p.id===R.layerIds[0]&&this.updateBucketOpacities(R,d,k.collisionBoxArray)}},Sn.prototype.updateBucketOpacities=function(p,m,d){var x=this;p.hasTextData()&&p.text.opacityVertexArray.clear(),p.hasIconData()&&p.icon.opacityVertexArray.clear(),p.hasIconCollisionBoxData()&&p.iconCollisionBox.collisionVertexArray.clear(),p.hasTextCollisionBoxData()&&p.textCollisionBox.collisionVertexArray.clear();var A=p.layers[0].layout,k=new oo(null,0,!1,!1,!0),R=A.get("text-allow-overlap"),j=A.get("icon-allow-overlap"),K=A.get("text-variable-anchor"),tt=A.get("text-rotation-alignment")==="map",ct=A.get("text-pitch-alignment")==="map",ft=A.get("icon-text-fit")!=="none",mt=new oo(null,0,R&&(j||!p.hasIconData()||A.get("icon-optional")),j&&(R||!p.hasTextData()||A.get("text-optional")),!0);!p.collisionArrays&&d&&(p.hasIconCollisionBoxData()||p.hasTextCollisionBoxData())&&p.deserializeCollisionBoxes(d);for(var Mt=function(Rt,Nt,Yt){for(var ne=0;ne<Nt/4;ne++)Rt.opacityVertexArray.emplaceBack(Yt)},At=function(Rt){var Nt=p.symbolInstances.get(Rt),Yt=Nt.numHorizontalGlyphVertices,ne=Nt.numVerticalGlyphVertices,ae=Nt.crossTileID,le=x.opacities[ae];m[ae]?le=k:le||(x.opacities[ae]=le=mt),m[ae]=!0;var xe=Nt.numIconVertices>0,ke=x.placedOrientations[Nt.crossTileID],Le=ke===i.WritingMode.vertical,$e=ke===i.WritingMode.horizontal||ke===i.WritingMode.horizontalOnly;if(Yt>0||ne>0){var lr=Uu(le.text);Mt(p.text,Yt,Le?ba:lr),Mt(p.text,ne,$e?ba:lr);var hr=le.text.isHidden();[Nt.rightJustifiedTextSymbolIndex,Nt.centerJustifiedTextSymbolIndex,Nt.leftJustifiedTextSymbolIndex].forEach(function(cr){cr>=0&&(p.text.placedSymbolArray.get(cr).hidden=hr||Le?1:0)}),Nt.verticalPlacedTextSymbolIndex>=0&&(p.text.placedSymbolArray.get(Nt.verticalPlacedTextSymbolIndex).hidden=hr||$e?1:0);var sr=x.variableOffsets[Nt.crossTileID];sr&&x.markUsedJustification(p,sr.anchor,Nt,ke);var Zr=x.placedOrientations[Nt.crossTileID];Zr&&(x.markUsedJustification(p,"left",Nt,Zr),x.markUsedOrientation(p,Zr,Nt))}if(xe){var Qe=Uu(le.icon),Ir=!(ft&&Nt.verticalPlacedIconSymbolIndex&&Le);Nt.placedIconSymbolIndex>=0&&(Mt(p.icon,Nt.numIconVertices,Ir?Qe:ba),p.icon.placedSymbolArray.get(Nt.placedIconSymbolIndex).hidden=le.icon.isHidden()),Nt.verticalPlacedIconSymbolIndex>=0&&(Mt(p.icon,Nt.numVerticalIconVertices,Ir?ba:Qe),p.icon.placedSymbolArray.get(Nt.verticalPlacedIconSymbolIndex).hidden=le.icon.isHidden())}if(p.hasIconCollisionBoxData()||p.hasTextCollisionBoxData()){var jr=p.collisionArrays[Rt];if(jr){var Er=new i.Point(0,0);if(jr.textBox||jr.verticalTextBox){var vr=!0;if(K){var Pr=x.variableOffsets[ae];Pr?(Er=Hi(Pr.anchor,Pr.width,Pr.height,Pr.textOffset,Pr.textBoxScale),tt&&Er._rotate(ct?x.transform.angle:-x.transform.angle)):vr=!1}jr.textBox&&oa(p.textCollisionBox.collisionVertexArray,le.text.placed,!vr||Le,Er.x,Er.y),jr.verticalTextBox&&oa(p.textCollisionBox.collisionVertexArray,le.text.placed,!vr||$e,Er.x,Er.y)}var fr=Boolean(!$e&&jr.verticalIconBox);jr.iconBox&&oa(p.iconCollisionBox.collisionVertexArray,le.icon.placed,fr,ft?Er.x:0,ft?Er.y:0),jr.verticalIconBox&&oa(p.iconCollisionBox.collisionVertexArray,le.icon.placed,!fr,ft?Er.x:0,ft?Er.y:0)}}},Dt=0;Dt<p.symbolInstances.length;Dt++)At(Dt);if(p.sortFeatures(this.transform.angle),this.retainedQueryData[p.bucketInstanceId]&&(this.retainedQueryData[p.bucketInstanceId].featureSortOrder=p.featureSortOrder),p.hasTextData()&&p.text.opacityVertexBuffer&&p.text.opacityVertexBuffer.updateData(p.text.opacityVertexArray),p.hasIconData()&&p.icon.opacityVertexBuffer&&p.icon.opacityVertexBuffer.updateData(p.icon.opacityVertexArray),p.hasIconCollisionBoxData()&&p.iconCollisionBox.collisionVertexBuffer&&p.iconCollisionBox.collisionVertexBuffer.updateData(p.iconCollisionBox.collisionVertexArray),p.hasTextCollisionBoxData()&&p.textCollisionBox.collisionVertexBuffer&&p.textCollisionBox.collisionVertexBuffer.updateData(p.textCollisionBox.collisionVertexArray),p.bucketInstanceId in this.collisionCircleArrays){var xt=this.collisionCircleArrays[p.bucketInstanceId];p.placementInvProjMatrix=xt.invProjMatrix,p.placementViewportMatrix=xt.viewportMatrix,p.collisionCircleArray=xt.circles,delete this.collisionCircleArrays[p.bucketInstanceId]}},Sn.prototype.symbolFadeChange=function(p){return this.fadeDuration===0?1:(p-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},Sn.prototype.zoomAdjustment=function(p){return Math.max(0,(this.transform.zoom-p)/1.5)},Sn.prototype.hasTransitions=function(p){return this.stale||p-this.lastPlacementChangeTime<this.fadeDuration},Sn.prototype.stillRecent=function(p,m){var d=this.zoomAtLastRecencyCheck===m?1-this.zoomAdjustment(m):1;return this.zoomAtLastRecencyCheck=m,this.commitTime+this.fadeDuration*d>p},Sn.prototype.setStale=function(){this.stale=!0};var ll=Math.pow(2,25),Kl=Math.pow(2,24),_s=Math.pow(2,17),mn=Math.pow(2,16),Fs=Math.pow(2,9),Fu=Math.pow(2,8),Bu=Math.pow(2,1);function Uu(p){if(p.opacity===0&&!p.placed)return 0;if(p.opacity===1&&p.placed)return 4294967295;var m=p.placed?1:0,d=Math.floor(127*p.opacity);return d*ll+m*Kl+d*_s+m*mn+d*Fs+m*Fu+d*Bu+m}var ba=0,ul=function(p){this._sortAcrossTiles=p.layout.get("symbol-z-order")!=="viewport-y"&&p.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};ul.prototype.continuePlacement=function(p,m,d,x,A){for(var k=this._bucketParts;this._currentTileIndex<p.length;)if(m.getBucketParts(k,x,p[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,A())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,k.sort(function(R,j){return R.sortKey-j.sortKey}));this._currentPartIndex<k.length;)if(m.placeLayerBucketPart(k[this._currentPartIndex],this._seenCrossTileIDs,d),this._currentPartIndex++,A())return!0;return!1};var cl=function(p,m,d,x,A,k,R){this.placement=new Sn(p,A,k,R),this._currentPlacementIndex=m.length-1,this._forceFullPlacement=d,this._showCollisionBoxes=x,this._done=!1};cl.prototype.isDone=function(){return this._done},cl.prototype.continuePlacement=function(p,m,d){for(var x=this,A=i.browser.now(),k=function(){var K=i.browser.now()-A;return!x._forceFullPlacement&&K>2};this._currentPlacementIndex>=0;){var R=m[p[this._currentPlacementIndex]],j=this.placement.collisionIndex.transform.zoom;if(R.type==="symbol"&&(!R.minzoom||R.minzoom<=j)&&(!R.maxzoom||R.maxzoom>j)){if(this._inProgressLayer||(this._inProgressLayer=new ul(R)),this._inProgressLayer.continuePlacement(d[R.source],this.placement,this._showCollisionBoxes,R,k))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},cl.prototype.commit=function(p){return this.placement.commit(p),this.placement};var Cc=512/i.EXTENT/2,Bs=function(p,m,d){this.tileID=p,this.indexedSymbolInstances={},this.bucketInstanceId=d;for(var x=0;x<m.length;x++){var A=m.get(x),k=A.key;this.indexedSymbolInstances[k]||(this.indexedSymbolInstances[k]=[]),this.indexedSymbolInstances[k].push({crossTileID:A.crossTileID,coord:this.getScaledCoordinates(A,p)})}};Bs.prototype.getScaledCoordinates=function(p,m){var d=Cc/Math.pow(2,m.canonical.z-this.tileID.canonical.z);return{x:Math.floor((m.canonical.x*i.EXTENT+p.anchorX)*d),y:Math.floor((m.canonical.y*i.EXTENT+p.anchorY)*d)}},Bs.prototype.findMatches=function(p,m,d){for(var x=this.tileID.canonical.z<m.canonical.z?1:Math.pow(2,this.tileID.canonical.z-m.canonical.z),A=0;A<p.length;A++){var k=p.get(A);if(!k.crossTileID){var R=this.indexedSymbolInstances[k.key];if(R)for(var j=this.getScaledCoordinates(k,m),K=0,tt=R;K<tt.length;K+=1){var ct=tt[K];if(Math.abs(ct.coord.x-j.x)<=x&&Math.abs(ct.coord.y-j.y)<=x&&!d[ct.crossTileID]){d[ct.crossTileID]=!0,k.crossTileID=ct.crossTileID;break}}}}};var fo=function(){this.maxCrossTileID=0};fo.prototype.generate=function(){return++this.maxCrossTileID};var aa=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};aa.prototype.handleWrapJump=function(p){var m=Math.round((p-this.lng)/360);if(m!==0)for(var d in this.indexes){var x=this.indexes[d],A={};for(var k in x){var R=x[k];R.tileID=R.tileID.unwrapTo(R.tileID.wrap+m),A[R.tileID.key]=R}this.indexes[d]=A}this.lng=p},aa.prototype.addBucket=function(p,m,d){if(this.indexes[p.overscaledZ]&&this.indexes[p.overscaledZ][p.key]){if(this.indexes[p.overscaledZ][p.key].bucketInstanceId===m.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(p.overscaledZ,this.indexes[p.overscaledZ][p.key])}for(var x=0;x<m.symbolInstances.length;x++)m.symbolInstances.get(x).crossTileID=0;this.usedCrossTileIDs[p.overscaledZ]||(this.usedCrossTileIDs[p.overscaledZ]={});var A=this.usedCrossTileIDs[p.overscaledZ];for(var k in this.indexes){var R=this.indexes[k];if(Number(k)>p.overscaledZ)for(var j in R){var K=R[j];K.tileID.isChildOf(p)&&K.findMatches(m.symbolInstances,p,A)}else{var tt=R[p.scaledTo(Number(k)).key];tt&&tt.findMatches(m.symbolInstances,p,A)}}for(var ct=0;ct<m.symbolInstances.length;ct++){var ft=m.symbolInstances.get(ct);ft.crossTileID||(ft.crossTileID=d.generate(),A[ft.crossTileID]=!0)}return this.indexes[p.overscaledZ]===void 0&&(this.indexes[p.overscaledZ]={}),this.indexes[p.overscaledZ][p.key]=new Bs(p,m.symbolInstances,m.bucketInstanceId),!0},aa.prototype.removeBucketCrossTileIDs=function(p,m){for(var d in m.indexedSymbolInstances)for(var x=0,A=m.indexedSymbolInstances[d];x<A.length;x+=1)delete this.usedCrossTileIDs[p][A[x].crossTileID]},aa.prototype.removeStaleBuckets=function(p){var m=!1;for(var d in this.indexes){var x=this.indexes[d];for(var A in x)p[x[A].bucketInstanceId]||(this.removeBucketCrossTileIDs(d,x[A]),delete x[A],m=!0)}return m};var sa=function(){this.layerIndexes={},this.crossTileIDs=new fo,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};sa.prototype.addLayer=function(p,m,d){var x=this.layerIndexes[p.id];x===void 0&&(x=this.layerIndexes[p.id]=new aa);var A=!1,k={};x.handleWrapJump(d);for(var R=0,j=m;R<j.length;R+=1){var K=j[R],tt=K.getBucket(p);tt&&p.id===tt.layerIds[0]&&(tt.bucketInstanceId||(tt.bucketInstanceId=++this.maxBucketInstanceId),x.addBucket(K.tileID,tt,this.crossTileIDs)&&(A=!0),k[tt.bucketInstanceId]=!0)}return x.removeStaleBuckets(k)&&(A=!0),A},sa.prototype.pruneUnusedLayers=function(p){var m={};for(var d in p.forEach(function(x){m[x]=!0}),this.layerIndexes)m[d]||delete this.layerIndexes[d]};var qa=function(p,m){return i.emitValidationErrors(p,m&&m.filter(function(d){return d.identifier!=="source.canvas"}))},Yr=i.pick(Ct,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Za=i.pick(Ct,["setCenter","setZoom","setBearing","setPitch"]),Xa=function(){var p={},m=i.styleSpec.$version;for(var d in i.styleSpec.$root){var x,A=i.styleSpec.$root[d];A.required&&(x=d==="version"?m:A.type==="array"?[]:{})!=null&&(p[d]=x)}return p}(),Dn=function(p){function m(d,x){var A=this;x===void 0&&(x={}),p.call(this),this.map=d,this.dispatcher=new qe(pt(),this),this.imageManager=new wt,this.imageManager.setEventedParent(this),this.glyphManager=new ye(d._requestManager,x.localIdeographFontFamily),this.lineAtlas=new Be(256,512),this.crossTileSymbolIndex=new sa,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new i.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",i.getReferrer());var k=this;this._rtlTextPluginCallback=m.registerForPluginStateChange(function(R){k.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:R.pluginStatus,pluginURL:R.pluginURL},function(j,K){if(i.triggerPluginCompletionEvent(j),K&&K.every(function(ct){return ct}))for(var tt in k.sourceCaches)k.sourceCaches[tt].reload()})}),this.on("data",function(R){if(R.dataType==="source"&&R.sourceDataType==="metadata"){var j=A.sourceCaches[R.sourceId];if(j){var K=j.getSource();if(K&&K.vectorLayerIds)for(var tt in A._layers){var ct=A._layers[tt];ct.source===K.id&&A._validateLayer(ct)}}}})}return p&&(m.__proto__=p),(m.prototype=Object.create(p&&p.prototype)).constructor=m,m.prototype.loadURL=function(d,x){var A=this;x===void 0&&(x={}),this.fire(new i.Event("dataloading",{dataType:"style"}));var k=typeof x.validate=="boolean"?x.validate:!i.isMapboxURL(d);d=this.map._requestManager.normalizeStyleURL(d,x.accessToken);var R=this.map._requestManager.transformRequest(d,i.ResourceType.Style);this._request=i.getJSON(R,function(j,K){A._request=null,j?A.fire(new i.ErrorEvent(j)):K&&A._load(K,k)})},m.prototype.loadJSON=function(d,x){var A=this;x===void 0&&(x={}),this.fire(new i.Event("dataloading",{dataType:"style"})),this._request=i.browser.frame(function(){A._request=null,A._load(d,x.validate!==!1)})},m.prototype.loadEmpty=function(){this.fire(new i.Event("dataloading",{dataType:"style"})),this._load(Xa,!1)},m.prototype._load=function(d,x){if(!x||!qa(this,i.validateStyle(d))){for(var A in this._loaded=!0,this.stylesheet=d,d.sources)this.addSource(A,d.sources[A],{validate:!1});d.sprite?this._loadSprite(d.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(d.glyphs);var k=Et(this.stylesheet.layers);this._order=k.map(function(tt){return tt.id}),this._layers={},this._serializedLayers={};for(var R=0,j=k;R<j.length;R+=1){var K=j[R];(K=i.createStyleLayer(K)).setEventedParent(this,{layer:{id:K.id}}),this._layers[K.id]=K,this._serializedLayers[K.id]=K.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new ir(this.stylesheet.light),this.fire(new i.Event("data",{dataType:"style"})),this.fire(new i.Event("style.load"))}},m.prototype._loadSprite=function(d){var x=this;this._spriteRequest=function(A,k,R){var j,K,tt,ct=i.browser.devicePixelRatio>1?"@2x":"",ft=i.getJSON(k.transformRequest(k.normalizeSpriteURL(A,ct,".json"),i.ResourceType.SpriteJSON),function(At,Dt){ft=null,tt||(tt=At,j=Dt,Mt())}),mt=i.getImage(k.transformRequest(k.normalizeSpriteURL(A,ct,".png"),i.ResourceType.SpriteImage),function(At,Dt){mt=null,tt||(tt=At,K=Dt,Mt())});function Mt(){if(tt)R(tt);else if(j&&K){var At=i.browser.getImageData(K),Dt={};for(var xt in j){var Rt=j[xt],Nt=Rt.width,Yt=Rt.height,ne=Rt.x,ae=Rt.y,le=Rt.sdf,xe=Rt.pixelRatio,ke=Rt.stretchX,Le=Rt.stretchY,$e=Rt.content,lr=new i.RGBAImage({width:Nt,height:Yt});i.RGBAImage.copy(At,lr,{x:ne,y:ae},{x:0,y:0},{width:Nt,height:Yt}),Dt[xt]={data:lr,pixelRatio:xe,sdf:le,stretchX:ke,stretchY:Le,content:$e}}R(null,Dt)}}return{cancel:function(){ft&&(ft.cancel(),ft=null),mt&&(mt.cancel(),mt=null)}}}(d,this.map._requestManager,function(A,k){if(x._spriteRequest=null,A)x.fire(new i.ErrorEvent(A));else if(k)for(var R in k)x.imageManager.addImage(R,k[R]);x.imageManager.setLoaded(!0),x._availableImages=x.imageManager.listImages(),x.dispatcher.broadcast("setImages",x._availableImages),x.fire(new i.Event("data",{dataType:"style"}))})},m.prototype._validateLayer=function(d){var x=this.sourceCaches[d.source];if(x){var A=d.sourceLayer;if(A){var k=x.getSource();(k.type==="geojson"||k.vectorLayerIds&&k.vectorLayerIds.indexOf(A)===-1)&&this.fire(new i.ErrorEvent(new Error('Source layer "'+A+'" does not exist on source "'+k.id+'" as specified by style layer "'+d.id+'"')))}}},m.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var d in this.sourceCaches)if(!this.sourceCaches[d].loaded())return!1;return!!this.imageManager.isLoaded()},m.prototype._serializeLayers=function(d){for(var x=[],A=0,k=d;A<k.length;A+=1){var R=this._layers[k[A]];R.type!=="custom"&&x.push(R.serialize())}return x},m.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var d in this.sourceCaches)if(this.sourceCaches[d].hasTransition())return!0;for(var x in this._layers)if(this._layers[x].hasTransition())return!0;return!1},m.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},m.prototype.update=function(d){if(this._loaded){var x=this._changed;if(this._changed){var A=Object.keys(this._updatedLayers),k=Object.keys(this._removedLayers);for(var R in(A.length||k.length)&&this._updateWorkerLayers(A,k),this._updatedSources){var j=this._updatedSources[R];j==="reload"?this._reloadSource(R):j==="clear"&&this._clearSource(R)}for(var K in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[K].updateTransitions(d);this.light.updateTransitions(d),this._resetUpdates()}var tt={};for(var ct in this.sourceCaches){var ft=this.sourceCaches[ct];tt[ct]=ft.used,ft.used=!1}for(var mt=0,Mt=this._order;mt<Mt.length;mt+=1){var At=this._layers[Mt[mt]];At.recalculate(d,this._availableImages),!At.isHidden(d.zoom)&&At.source&&(this.sourceCaches[At.source].used=!0)}for(var Dt in tt){var xt=this.sourceCaches[Dt];tt[Dt]!==xt.used&&xt.fire(new i.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:Dt}))}this.light.recalculate(d),this.z=d.zoom,x&&this.fire(new i.Event("data",{dataType:"style"}))}},m.prototype._updateTilesForChangedImages=function(){var d=Object.keys(this._changedImages);if(d.length){for(var x in this.sourceCaches)this.sourceCaches[x].reloadTilesForDependencies(["icons","patterns"],d);this._changedImages={}}},m.prototype._updateWorkerLayers=function(d,x){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(d),removedIds:x})},m.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},m.prototype.setState=function(d){var x=this;if(this._checkLoaded(),qa(this,i.validateStyle(d)))return!1;(d=i.clone$1(d)).layers=Et(d.layers);var A=function(R,j){if(!R)return[{command:Ct.setStyle,args:[j]}];var K=[];try{if(!i.deepEqual(R.version,j.version))return[{command:Ct.setStyle,args:[j]}];i.deepEqual(R.center,j.center)||K.push({command:Ct.setCenter,args:[j.center]}),i.deepEqual(R.zoom,j.zoom)||K.push({command:Ct.setZoom,args:[j.zoom]}),i.deepEqual(R.bearing,j.bearing)||K.push({command:Ct.setBearing,args:[j.bearing]}),i.deepEqual(R.pitch,j.pitch)||K.push({command:Ct.setPitch,args:[j.pitch]}),i.deepEqual(R.sprite,j.sprite)||K.push({command:Ct.setSprite,args:[j.sprite]}),i.deepEqual(R.glyphs,j.glyphs)||K.push({command:Ct.setGlyphs,args:[j.glyphs]}),i.deepEqual(R.transition,j.transition)||K.push({command:Ct.setTransition,args:[j.transition]}),i.deepEqual(R.light,j.light)||K.push({command:Ct.setLight,args:[j.light]});var tt={},ct=[];(function(mt,Mt,At,Dt){var xt;for(xt in Mt=Mt||{},mt=mt||{})mt.hasOwnProperty(xt)&&(Mt.hasOwnProperty(xt)||$t(xt,At,Dt));for(xt in Mt)Mt.hasOwnProperty(xt)&&(mt.hasOwnProperty(xt)?i.deepEqual(mt[xt],Mt[xt])||(mt[xt].type==="geojson"&&Mt[xt].type==="geojson"&&De(mt,Mt,xt)?At.push({command:Ct.setGeoJSONSourceData,args:[xt,Mt[xt].data]}):ee(xt,Mt,At,Dt)):te(xt,Mt,At))})(R.sources,j.sources,ct,tt);var ft=[];R.layers&&R.layers.forEach(function(mt){tt[mt.source]?K.push({command:Ct.removeLayer,args:[mt.id]}):ft.push(mt)}),K=K.concat(ct),function(mt,Mt,At){Mt=Mt||[];var Dt,xt,Rt,Nt,Yt,ne,ae,le=(mt=mt||[]).map(ze),xe=Mt.map(ze),ke=mt.reduce(Ue,{}),Le=Mt.reduce(Ue,{}),$e=le.slice(),lr=Object.create(null);for(Dt=0,xt=0;Dt<le.length;Dt++)Le.hasOwnProperty(Rt=le[Dt])?xt++:(At.push({command:Ct.removeLayer,args:[Rt]}),$e.splice($e.indexOf(Rt,xt),1));for(Dt=0,xt=0;Dt<xe.length;Dt++)$e[$e.length-1-Dt]!==(Rt=xe[xe.length-1-Dt])&&(ke.hasOwnProperty(Rt)?(At.push({command:Ct.removeLayer,args:[Rt]}),$e.splice($e.lastIndexOf(Rt,$e.length-xt),1)):xt++,At.push({command:Ct.addLayer,args:[Le[Rt],ne=$e[$e.length-Dt]]}),$e.splice($e.length-Dt,0,Rt),lr[Rt]=!0);for(Dt=0;Dt<xe.length;Dt++)if(Nt=ke[Rt=xe[Dt]],Yt=Le[Rt],!lr[Rt]&&!i.deepEqual(Nt,Yt))if(i.deepEqual(Nt.source,Yt.source)&&i.deepEqual(Nt["source-layer"],Yt["source-layer"])&&i.deepEqual(Nt.type,Yt.type)){for(ae in Se(Nt.layout,Yt.layout,At,Rt,null,Ct.setLayoutProperty),Se(Nt.paint,Yt.paint,At,Rt,null,Ct.setPaintProperty),i.deepEqual(Nt.filter,Yt.filter)||At.push({command:Ct.setFilter,args:[Rt,Yt.filter]}),i.deepEqual(Nt.minzoom,Yt.minzoom)&&i.deepEqual(Nt.maxzoom,Yt.maxzoom)||At.push({command:Ct.setLayerZoomRange,args:[Rt,Yt.minzoom,Yt.maxzoom]}),Nt)Nt.hasOwnProperty(ae)&&ae!=="layout"&&ae!=="paint"&&ae!=="filter"&&ae!=="metadata"&&ae!=="minzoom"&&ae!=="maxzoom"&&(ae.indexOf("paint.")===0?Se(Nt[ae],Yt[ae],At,Rt,ae.slice(6),Ct.setPaintProperty):i.deepEqual(Nt[ae],Yt[ae])||At.push({command:Ct.setLayerProperty,args:[Rt,ae,Yt[ae]]}));for(ae in Yt)Yt.hasOwnProperty(ae)&&!Nt.hasOwnProperty(ae)&&ae!=="layout"&&ae!=="paint"&&ae!=="filter"&&ae!=="metadata"&&ae!=="minzoom"&&ae!=="maxzoom"&&(ae.indexOf("paint.")===0?Se(Nt[ae],Yt[ae],At,Rt,ae.slice(6),Ct.setPaintProperty):i.deepEqual(Nt[ae],Yt[ae])||At.push({command:Ct.setLayerProperty,args:[Rt,ae,Yt[ae]]}))}else At.push({command:Ct.removeLayer,args:[Rt]}),ne=$e[$e.lastIndexOf(Rt)+1],At.push({command:Ct.addLayer,args:[Yt,ne]})}(ft,j.layers,K)}catch(mt){console.warn("Unable to compute style diff:",mt),K=[{command:Ct.setStyle,args:[j]}]}return K}(this.serialize(),d).filter(function(R){return!(R.command in Za)});if(A.length===0)return!1;var k=A.filter(function(R){return!(R.command in Yr)});if(k.length>0)throw new Error("Unimplemented: "+k.map(function(R){return R.command}).join(", ")+".");return A.forEach(function(R){R.command!=="setTransition"&&x[R.command].apply(x,R.args)}),this.stylesheet=d,!0},m.prototype.addImage=function(d,x){if(this.getImage(d))return this.fire(new i.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(d,x),this._afterImageUpdated(d)},m.prototype.updateImage=function(d,x){this.imageManager.updateImage(d,x)},m.prototype.getImage=function(d){return this.imageManager.getImage(d)},m.prototype.removeImage=function(d){if(!this.getImage(d))return this.fire(new i.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(d),this._afterImageUpdated(d)},m.prototype._afterImageUpdated=function(d){this._availableImages=this.imageManager.listImages(),this._changedImages[d]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new i.Event("data",{dataType:"style"}))},m.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},m.prototype.addSource=function(d,x,A){var k=this;if(A===void 0&&(A={}),this._checkLoaded(),this.sourceCaches[d]!==void 0)throw new Error("There is already a source with this ID");if(!x.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(x).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(x.type)>=0&&this._validate(i.validateStyle.source,"sources."+d,x,null,A))){this.map&&this.map._collectResourceTiming&&(x.collectResourceTiming=!0);var R=this.sourceCaches[d]=new zt(d,x,this.dispatcher);R.style=this,R.setEventedParent(this,function(){return{isSourceLoaded:k.loaded(),source:R.serialize(),sourceId:d}}),R.onAdd(this.map),this._changed=!0}},m.prototype.removeSource=function(d){if(this._checkLoaded(),this.sourceCaches[d]===void 0)throw new Error("There is no source with this ID");for(var x in this._layers)if(this._layers[x].source===d)return this.fire(new i.ErrorEvent(new Error('Source "'+d+'" cannot be removed while layer "'+x+'" is using it.')));var A=this.sourceCaches[d];delete this.sourceCaches[d],delete this._updatedSources[d],A.fire(new i.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:d})),A.setEventedParent(null),A.clearTiles(),A.onRemove&&A.onRemove(this.map),this._changed=!0},m.prototype.setGeoJSONSourceData=function(d,x){this._checkLoaded(),this.sourceCaches[d].getSource().setData(x),this._changed=!0},m.prototype.getSource=function(d){return this.sourceCaches[d]&&this.sourceCaches[d].getSource()},m.prototype.addLayer=function(d,x,A){A===void 0&&(A={}),this._checkLoaded();var k=d.id;if(this.getLayer(k))this.fire(new i.ErrorEvent(new Error('Layer with id "'+k+'" already exists on this map')));else{var R;if(d.type==="custom"){if(qa(this,i.validateCustomStyleLayer(d)))return;R=i.createStyleLayer(d)}else{if(typeof d.source=="object"&&(this.addSource(k,d.source),d=i.clone$1(d),d=i.extend(d,{source:k})),this._validate(i.validateStyle.layer,"layers."+k,d,{arrayIndex:-1},A))return;R=i.createStyleLayer(d),this._validateLayer(R),R.setEventedParent(this,{layer:{id:k}}),this._serializedLayers[R.id]=R.serialize()}var j=x?this._order.indexOf(x):this._order.length;if(x&&j===-1)this.fire(new i.ErrorEvent(new Error('Layer with id "'+x+'" does not exist on this map.')));else{if(this._order.splice(j,0,k),this._layerOrderChanged=!0,this._layers[k]=R,this._removedLayers[k]&&R.source&&R.type!=="custom"){var K=this._removedLayers[k];delete this._removedLayers[k],K.type!==R.type?this._updatedSources[R.source]="clear":(this._updatedSources[R.source]="reload",this.sourceCaches[R.source].pause())}this._updateLayer(R),R.onAdd&&R.onAdd(this.map)}}},m.prototype.moveLayer=function(d,x){if(this._checkLoaded(),this._changed=!0,this._layers[d]){if(d!==x){var A=this._order.indexOf(d);this._order.splice(A,1);var k=x?this._order.indexOf(x):this._order.length;x&&k===-1?this.fire(new i.ErrorEvent(new Error('Layer with id "'+x+'" does not exist on this map.'))):(this._order.splice(k,0,d),this._layerOrderChanged=!0)}}else this.fire(new i.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be moved.")))},m.prototype.removeLayer=function(d){this._checkLoaded();var x=this._layers[d];if(x){x.setEventedParent(null);var A=this._order.indexOf(d);this._order.splice(A,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[d]=x,delete this._layers[d],delete this._serializedLayers[d],delete this._updatedLayers[d],delete this._updatedPaintProps[d],x.onRemove&&x.onRemove(this.map)}else this.fire(new i.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be removed.")))},m.prototype.getLayer=function(d){return this._layers[d]},m.prototype.hasLayer=function(d){return d in this._layers},m.prototype.setLayerZoomRange=function(d,x,A){this._checkLoaded();var k=this.getLayer(d);k?k.minzoom===x&&k.maxzoom===A||(x!=null&&(k.minzoom=x),A!=null&&(k.maxzoom=A),this._updateLayer(k)):this.fire(new i.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot have zoom extent.")))},m.prototype.setFilter=function(d,x,A){A===void 0&&(A={}),this._checkLoaded();var k=this.getLayer(d);if(k){if(!i.deepEqual(k.filter,x))return x==null?(k.filter=void 0,void this._updateLayer(k)):void(this._validate(i.validateStyle.filter,"layers."+k.id+".filter",x,null,A)||(k.filter=i.clone$1(x),this._updateLayer(k)))}else this.fire(new i.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be filtered.")))},m.prototype.getFilter=function(d){return i.clone$1(this.getLayer(d).filter)},m.prototype.setLayoutProperty=function(d,x,A,k){k===void 0&&(k={}),this._checkLoaded();var R=this.getLayer(d);R?i.deepEqual(R.getLayoutProperty(x),A)||(R.setLayoutProperty(x,A,k),this._updateLayer(R)):this.fire(new i.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be styled.")))},m.prototype.getLayoutProperty=function(d,x){var A=this.getLayer(d);if(A)return A.getLayoutProperty(x);this.fire(new i.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style.")))},m.prototype.setPaintProperty=function(d,x,A,k){k===void 0&&(k={}),this._checkLoaded();var R=this.getLayer(d);R?i.deepEqual(R.getPaintProperty(x),A)||(R.setPaintProperty(x,A,k)&&this._updateLayer(R),this._changed=!0,this._updatedPaintProps[d]=!0):this.fire(new i.ErrorEvent(new Error("The layer '"+d+"' does not exist in the map's style and cannot be styled.")))},m.prototype.getPaintProperty=function(d,x){return this.getLayer(d).getPaintProperty(x)},m.prototype.setFeatureState=function(d,x){this._checkLoaded();var A=d.source,k=d.sourceLayer,R=this.sourceCaches[A];if(R!==void 0){var j=R.getSource().type;j==="geojson"&&k?this.fire(new i.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):j!=="vector"||k?(d.id===void 0&&this.fire(new i.ErrorEvent(new Error("The feature id parameter must be provided."))),R.setFeatureState(k,d.id,x)):this.fire(new i.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new i.ErrorEvent(new Error("The source '"+A+"' does not exist in the map's style.")))},m.prototype.removeFeatureState=function(d,x){this._checkLoaded();var A=d.source,k=this.sourceCaches[A];if(k!==void 0){var R=k.getSource().type,j=R==="vector"?d.sourceLayer:void 0;R!=="vector"||j?x&&typeof d.id!="string"&&typeof d.id!="number"?this.fire(new i.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):k.removeFeatureState(j,d.id,x):this.fire(new i.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new i.ErrorEvent(new Error("The source '"+A+"' does not exist in the map's style.")))},m.prototype.getFeatureState=function(d){this._checkLoaded();var x=d.source,A=d.sourceLayer,k=this.sourceCaches[x];if(k!==void 0){if(k.getSource().type!=="vector"||A)return d.id===void 0&&this.fire(new i.ErrorEvent(new Error("The feature id parameter must be provided."))),k.getFeatureState(A,d.id);this.fire(new i.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new i.ErrorEvent(new Error("The source '"+x+"' does not exist in the map's style.")))},m.prototype.getTransition=function(){return i.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},m.prototype.serialize=function(){return i.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:i.mapObject(this.sourceCaches,function(d){return d.serialize()}),layers:this._serializeLayers(this._order)},function(d){return d!==void 0})},m.prototype._updateLayer=function(d){this._updatedLayers[d.id]=!0,d.source&&!this._updatedSources[d.source]&&this.sourceCaches[d.source].getSource().type!=="raster"&&(this._updatedSources[d.source]="reload",this.sourceCaches[d.source].pause()),this._changed=!0},m.prototype._flattenAndSortRenderedFeatures=function(d){for(var x=this,A=function(ke){return x._layers[ke].type==="fill-extrusion"},k={},R=[],j=this._order.length-1;j>=0;j--){var K=this._order[j];if(A(K)){k[K]=j;for(var tt=0,ct=d;tt<ct.length;tt+=1){var ft=ct[tt][K];if(ft)for(var mt=0,Mt=ft;mt<Mt.length;mt+=1)R.push(Mt[mt])}}}R.sort(function(ke,Le){return Le.intersectionZ-ke.intersectionZ});for(var At=[],Dt=this._order.length-1;Dt>=0;Dt--){var xt=this._order[Dt];if(A(xt))for(var Rt=R.length-1;Rt>=0;Rt--){var Nt=R[Rt].feature;if(k[Nt.layer.id]<Dt)break;At.push(Nt),R.pop()}else for(var Yt=0,ne=d;Yt<ne.length;Yt+=1){var ae=ne[Yt][xt];if(ae)for(var le=0,xe=ae;le<xe.length;le+=1)At.push(xe[le].feature)}}return At},m.prototype.queryRenderedFeatures=function(d,x,A){x&&x.filter&&this._validate(i.validateStyle.filter,"queryRenderedFeatures.filter",x.filter,null,x);var k={};if(x&&x.layers){if(!Array.isArray(x.layers))return this.fire(new i.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var R=0,j=x.layers;R<j.length;R+=1){var K=j[R],tt=this._layers[K];if(!tt)return this.fire(new i.ErrorEvent(new Error("The layer '"+K+"' does not exist in the map's style and cannot be queried for features."))),[];k[tt.source]=!0}}var ct=[];for(var ft in x.availableImages=this._availableImages,this.sourceCaches)x.layers&&!k[ft]||ct.push(ci(this.sourceCaches[ft],this._layers,this._serializedLayers,d,x,A));return this.placement&&ct.push(function(mt,Mt,At,Dt,xt,Rt,Nt){for(var Yt={},ne=Rt.queryRenderedSymbols(Dt),ae=[],le=0,xe=Object.keys(ne).map(Number);le<xe.length;le+=1)ae.push(Nt[xe[le]]);ae.sort(Ri);for(var ke=function(){var sr=$e[Le],Zr=sr.featureIndex.lookupSymbolFeatures(ne[sr.bucketInstanceId],Mt,sr.bucketIndex,sr.sourceLayerIndex,xt.filter,xt.layers,xt.availableImages,mt);for(var Qe in Zr){var Ir=Yt[Qe]=Yt[Qe]||[],jr=Zr[Qe];jr.sort(function(Pr,fr){var cr=sr.featureSortOrder;if(cr){var Ui=cr.indexOf(Pr.featureIndex);return cr.indexOf(fr.featureIndex)-Ui}return fr.featureIndex-Pr.featureIndex});for(var Er=0,vr=jr;Er<vr.length;Er+=1)Ir.push(vr[Er])}},Le=0,$e=ae;Le<$e.length;Le+=1)ke();var lr=function(sr){Yt[sr].forEach(function(Zr){var Qe=Zr.feature,Ir=At[mt[sr].source].getFeatureState(Qe.layer["source-layer"],Qe.id);Qe.source=Qe.layer.source,Qe.layer["source-layer"]&&(Qe.sourceLayer=Qe.layer["source-layer"]),Qe.state=Ir})};for(var hr in Yt)lr(hr);return Yt}(this._layers,this._serializedLayers,this.sourceCaches,d,x,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(ct)},m.prototype.querySourceFeatures=function(d,x){x&&x.filter&&this._validate(i.validateStyle.filter,"querySourceFeatures.filter",x.filter,null,x);var A=this.sourceCaches[d];return A?function(k,R){for(var j=k.getRenderableIds().map(function(Mt){return k.getTileByID(Mt)}),K=[],tt={},ct=0;ct<j.length;ct++){var ft=j[ct],mt=ft.tileID.canonical.key;tt[mt]||(tt[mt]=!0,ft.querySourceFeatures(K,R))}return K}(A,x):[]},m.prototype.addSourceType=function(d,x,A){return m.getSourceType(d)?A(new Error('A source type called "'+d+'" already exists.')):(m.setSourceType(d,x),x.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:d,url:x.workerSourceURL},A):A(null,null))},m.prototype.getLight=function(){return this.light.getLight()},m.prototype.setLight=function(d,x){x===void 0&&(x={}),this._checkLoaded();var A=this.light.getLight(),k=!1;for(var R in d)if(!i.deepEqual(d[R],A[R])){k=!0;break}if(k){var j={now:i.browser.now(),transition:i.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(d,x),this.light.updateTransitions(j)}},m.prototype._validate=function(d,x,A,k,R){return R===void 0&&(R={}),(!R||R.validate!==!1)&&qa(this,d.call(i.validateStyle,i.extend({key:x,style:this.serialize(),value:A,styleSpec:i.styleSpec},k)))},m.prototype._remove=function(){for(var d in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),i.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[d].setEventedParent(null);for(var x in this.sourceCaches)this.sourceCaches[x].clearTiles(),this.sourceCaches[x].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},m.prototype._clearSource=function(d){this.sourceCaches[d].clearTiles()},m.prototype._reloadSource=function(d){this.sourceCaches[d].resume(),this.sourceCaches[d].reload()},m.prototype._updateSources=function(d){for(var x in this.sourceCaches)this.sourceCaches[x].update(d)},m.prototype._generateCollisionBoxes=function(){for(var d in this.sourceCaches)this._reloadSource(d)},m.prototype._updatePlacement=function(d,x,A,k,R){R===void 0&&(R=!1);for(var j=!1,K=!1,tt={},ct=0,ft=this._order;ct<ft.length;ct+=1){var mt=this._layers[ft[ct]];if(mt.type==="symbol"){if(!tt[mt.source]){var Mt=this.sourceCaches[mt.source];tt[mt.source]=Mt.getRenderableIds(!0).map(function(Nt){return Mt.getTileByID(Nt)}).sort(function(Nt,Yt){return Yt.tileID.overscaledZ-Nt.tileID.overscaledZ||(Nt.tileID.isLessThan(Yt.tileID)?-1:1)})}var At=this.crossTileSymbolIndex.addLayer(mt,tt[mt.source],d.center.lng);j=j||At}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((R=R||this._layerOrderChanged||A===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(i.browser.now(),d.zoom))&&(this.pauseablePlacement=new cl(d,this._order,R,x,A,k,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,tt),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(i.browser.now()),K=!0),j&&this.pauseablePlacement.placement.setStale()),K||j)for(var Dt=0,xt=this._order;Dt<xt.length;Dt+=1){var Rt=this._layers[xt[Dt]];Rt.type==="symbol"&&this.placement.updateLayerOpacities(Rt,tt[Rt.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(i.browser.now())},m.prototype._releaseSymbolFadeTiles=function(){for(var d in this.sourceCaches)this.sourceCaches[d].releaseSymbolFadeTiles()},m.prototype.getImages=function(d,x,A){this.imageManager.getImages(x.icons,A),this._updateTilesForChangedImages();var k=this.sourceCaches[x.source];k&&k.setDependencies(x.tileID.key,x.type,x.icons)},m.prototype.getGlyphs=function(d,x,A){this.glyphManager.getGlyphs(x.stacks,A)},m.prototype.getResource=function(d,x,A){return i.makeRequest(x,A)},m}(i.Evented);Dn.getSourceType=function(p){return ti[p]},Dn.setSourceType=function(p,m){ti[p]=m},Dn.registerForPluginStateChange=i.registerForPluginStateChange;var Ji=i.createLayout([{name:"a_pos",type:"Int16",components:2}]),On=yi(`#ifdef GL_ES
2
2
  precision mediump float;
3
3
  #else
4
4
  #if !defined(lowp)
@@ -997,7 +997,7 @@ uniform ${et} ${ut} u_${vt};
997
997
  #endif
998
998
  `}),staticAttributes:S,staticUniforms:B}}class Yi{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(a,g,S,I,L,B,q,$){this.context=a;let J=this.boundPaintVertexBuffers.length!==I.length;for(let et=0;!J&&et<I.length;et++)this.boundPaintVertexBuffers[et]!==I[et]&&(J=!0);a.extVertexArrayObject&&this.vao&&this.boundProgram===g&&this.boundLayoutVertexBuffer===S&&!J&&this.boundIndexBuffer===L&&this.boundVertexOffset===B&&this.boundDynamicVertexBuffer===q&&this.boundDynamicVertexBuffer2===$?(a.bindVertexArrayOES.set(this.vao),q&&q.bind(),L&&L.dynamicDraw&&L.bind(),$&&$.bind()):this.freshBind(g,S,I,L,B,q,$)}freshBind(a,g,S,I,L,B,q){let $,J=a.numAttributes,et=this.context,ut=et.gl;if(et.extVertexArrayObject)this.vao&&this.destroy(),this.vao=et.extVertexArrayObject.createVertexArrayOES(),et.bindVertexArrayOES.set(this.vao),$=0,this.boundProgram=a,this.boundLayoutVertexBuffer=g,this.boundPaintVertexBuffers=S,this.boundIndexBuffer=I,this.boundVertexOffset=L,this.boundDynamicVertexBuffer=B,this.boundDynamicVertexBuffer2=q;else{$=et.currentNumAttributes||0;for(let vt=J;vt<$;vt++)ut.disableVertexAttribArray(vt)}g.enableAttributes(ut,a);for(let vt of S)vt.enableAttributes(ut,a);B&&B.enableAttributes(ut,a),q&&q.enableAttributes(ut,a),g.bind(),g.setVertexAttribPointers(ut,a,L);for(let vt of S)vt.bind(),vt.setVertexAttribPointers(ut,a,L);B&&(B.bind(),B.setVertexAttribPointers(ut,a,L)),I&&I.bind(),q&&(q.bind(),q.setVertexAttribPointers(ut,a,L)),et.currentNumAttributes=J}destroy(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)}}function gs(T){let a=[];for(let g=0;g<T.length;g++){if(T[g]===null)continue;let S=T[g].split(" ");a.push(S.pop())}return a}class Wn{constructor(a,g,S,I,L,B){let q=a.gl;this.program=q.createProgram();let $=gs(S.staticAttributes),J=I?I.getBinderAttributes():[],et=$.concat(J),ut=S.staticUniforms?gs(S.staticUniforms):[],vt=I?I.getBinderUniforms():[],Ft=ut.concat(vt),bt=[];for(let he of Ft)bt.indexOf(he)<0&&bt.push(he);let Ot=I?I.defines():[];B&&Ot.push("#define OVERDRAW_INSPECTOR;");let Kt=Ot.concat(sl.prelude.fragmentSource,S.fragmentSource).join(`
999
999
  `),Wt=Ot.concat(sl.prelude.vertexSource,S.vertexSource).join(`
1000
- `),ie=q.createShader(q.FRAGMENT_SHADER);if(q.isContextLost())return void(this.failedToCreate=!0);q.shaderSource(ie,Kt),q.compileShader(ie),q.attachShader(this.program,ie);let Ht=q.createShader(q.VERTEX_SHADER);if(q.isContextLost())return void(this.failedToCreate=!0);q.shaderSource(Ht,Wt),q.compileShader(Ht),q.attachShader(this.program,Ht),this.attributes={};let _e={};this.numAttributes=et.length;for(let he=0;he<this.numAttributes;he++)et[he]&&(q.bindAttribLocation(this.program,he,et[he]),this.attributes[et[he]]=he);q.linkProgram(this.program),q.deleteShader(Ht),q.deleteShader(ie);for(let he=0;he<bt.length;he++){let de=bt[he];if(de&&!_e[de]){let Pe=q.getUniformLocation(this.program,de);Pe&&(_e[de]=Pe)}}this.fixedUniforms=L(a,_e),this.binderUniforms=I?I.getUniforms(a,_e):[]}draw(a,g,S,I,L,B,q,$,J,et,ut,vt,Ft,bt,Ot,Kt){let Wt=a.gl;if(this.failedToCreate)return;a.program.set(this.program),a.setDepthMode(S),a.setStencilMode(I),a.setColorMode(L),a.setCullFace(B);for(let Ht in this.fixedUniforms)this.fixedUniforms[Ht].set(q[Ht]);bt&&bt.setUniforms(a,this.binderUniforms,vt,{zoom:Ft});let ie={[Wt.LINES]:2,[Wt.TRIANGLES]:3,[Wt.LINE_STRIP]:1}[g];for(let Ht of ut.get()){let _e=Ht.vaos||(Ht.vaos={});(_e[$]||(_e[$]=new Yi)).bind(a,this,J,bt?bt.getPaintVertexBuffers():[],et,Ht.vertexOffset,Ot,Kt),Wt.drawElements(g,Ht.primitiveLength*ie,Wt.UNSIGNED_SHORT,Ht.primitiveOffset*ie*2)}}}function un(T,a,g){let S=1/It(g,1,a.transform.tileZoom),I=Math.pow(2,g.tileID.overscaledZ),L=g.tileSize*Math.pow(2,a.transform.tileZoom)/I,B=L*(g.tileID.canonical.x+g.tileID.wrap*I),q=L*g.tileID.canonical.y;return{u_image:0,u_texsize:g.imageAtlasTexture.size,u_scale:[S,T.fromScale,T.toScale],u_fade:T.t,u_pixel_coord_upper:[B>>16,q>>16],u_pixel_coord_lower:[65535&B,65535&q]}}let Po=(T,a,g,S)=>{let I=a.style.light,L=I.properties.get("position"),B=[L.x,L.y,L.z],q=function(){var J=new u.ARRAY_TYPE(9);return u.ARRAY_TYPE!=Float32Array&&(J[1]=0,J[2]=0,J[3]=0,J[5]=0,J[6]=0,J[7]=0),J[0]=1,J[4]=1,J[8]=1,J}();I.properties.get("anchor")==="viewport"&&function(J,et){var ut=Math.sin(et),vt=Math.cos(et);J[0]=vt,J[1]=ut,J[2]=0,J[3]=-ut,J[4]=vt,J[5]=0,J[6]=0,J[7]=0,J[8]=1}(q,-a.transform.angle),function(J,et,ut){var vt=et[0],Ft=et[1],bt=et[2];J[0]=vt*ut[0]+Ft*ut[3]+bt*ut[6],J[1]=vt*ut[1]+Ft*ut[4]+bt*ut[7],J[2]=vt*ut[2]+Ft*ut[5]+bt*ut[8]}(B,B,q);let $=I.properties.get("color");return{u_matrix:T,u_lightpos:B,u_lightintensity:I.properties.get("intensity"),u_lightcolor:[$.r,$.g,$.b],u_vertical_gradient:+g,u_opacity:S}},Si=(T,a,g,S,I,L,B)=>u.extend(Po(T,a,g,S),un(L,a,B),{u_height_factor:-Math.pow(2,I.overscaledZ)/B.tileSize/8}),Mo=T=>({u_matrix:T}),oo=(T,a,g,S)=>u.extend(Mo(T),un(g,a,S)),Ou=(T,a)=>({u_matrix:T,u_world:a}),Lo=(T,a,g,S,I)=>u.extend(oo(T,a,g,S),{u_world:I}),ys=(T,a,g,S)=>{let I=T.transform,L,B;if(S.paint.get("circle-pitch-alignment")==="map"){let q=It(g,1,I.zoom);L=!0,B=[q,q]}else L=!1,B=I.pixelsToGLUnits;return{u_camera_to_center_distance:I.cameraToCenterDistance,u_scale_with_map:+(S.paint.get("circle-pitch-scale")==="map"),u_matrix:T.translatePosMatrix(a.posMatrix,g,S.paint.get("circle-translate"),S.paint.get("circle-translate-anchor")),u_pitch_with_map:+L,u_device_pixel_ratio:T.pixelRatio,u_extrude_scale:B}},Bo=(T,a,g)=>{let S=It(g,1,a.zoom),I=Math.pow(2,a.zoom-g.tileID.overscaledZ),L=g.tileID.overscaleFactor();return{u_matrix:T,u_camera_to_center_distance:a.cameraToCenterDistance,u_pixels_to_tile_units:S,u_extrude_scale:[a.pixelsToGLUnits[0]/(S*I),a.pixelsToGLUnits[1]/(S*I)],u_overscale_factor:L}},Hi=(T,a,g=1)=>({u_matrix:T,u_color:a,u_overlay:0,u_overlay_scale:g}),po=T=>({u_matrix:T}),Sn=(T,a,g,S)=>({u_matrix:T,u_extrude_scale:It(a,1,g),u_intensity:S});function oa(T,a){let g=Math.pow(2,a.canonical.z),S=a.canonical.y;return[new u.MercatorCoordinate(0,S/g).toLngLat().lat,new u.MercatorCoordinate(0,(S+1)/g).toLngLat().lat]}let ll=(T,a,g)=>{let S=T.transform;return{u_matrix:Fu(T,a,g),u_ratio:1/It(a,1,S.zoom),u_device_pixel_ratio:T.pixelRatio,u_units_to_pixels:[1/S.pixelsToGLUnits[0],1/S.pixelsToGLUnits[1]]}},Kl=(T,a,g,S)=>u.extend(ll(T,a,g),{u_image:0,u_image_height:S}),_s=(T,a,g,S)=>{let I=T.transform,L=Fs(a,I);return{u_matrix:Fu(T,a,g),u_texsize:a.imageAtlasTexture.size,u_ratio:1/It(a,1,I.zoom),u_device_pixel_ratio:T.pixelRatio,u_image:0,u_scale:[L,S.fromScale,S.toScale],u_fade:S.t,u_units_to_pixels:[1/I.pixelsToGLUnits[0],1/I.pixelsToGLUnits[1]]}},mn=(T,a,g,S,I)=>{let L=T.lineAtlas,B=Fs(a,T.transform),q=g.layout.get("line-cap")==="round",$=L.getDash(S.from,q),J=L.getDash(S.to,q),et=$.width*I.fromScale,ut=J.width*I.toScale;return u.extend(ll(T,a,g),{u_patternscale_a:[B/et,-$.height/2],u_patternscale_b:[B/ut,-J.height/2],u_sdfgamma:L.width/(256*Math.min(et,ut)*T.pixelRatio)/2,u_image:0,u_tex_y_a:$.y,u_tex_y_b:J.y,u_mix:I.t})};function Fs(T,a){return 1/It(T,1,a.tileZoom)}function Fu(T,a,g){return T.translatePosMatrix(a.tileID.posMatrix,a,g.paint.get("line-translate"),g.paint.get("line-translate-anchor"))}let Bu=(T,a,g,S,I)=>{return{u_matrix:T,u_tl_parent:a,u_scale_parent:g,u_buffer_scale:1,u_fade_t:S.mix,u_opacity:S.opacity*I.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:I.paint.get("raster-brightness-min"),u_brightness_high:I.paint.get("raster-brightness-max"),u_saturation_factor:(B=I.paint.get("raster-saturation"),B>0?1-1/(1.001-B):-B),u_contrast_factor:(L=I.paint.get("raster-contrast"),L>0?1/(1-L):1+L),u_spin_weights:Uu(I.paint.get("raster-hue-rotate"))};var L,B};function Uu(T){T*=Math.PI/180;let a=Math.sin(T),g=Math.cos(T);return[(2*g+1)/3,(-Math.sqrt(3)*a-g+1)/3,(Math.sqrt(3)*a-g+1)/3]}let ba=(T,a,g,S,I,L,B,q,$,J)=>{let et=I.transform;return{u_is_size_zoom_constant:+(T==="constant"||T==="source"),u_is_size_feature_constant:+(T==="constant"||T==="camera"),u_size_t:a?a.uSizeT:0,u_size:a?a.uSize:0,u_camera_to_center_distance:et.cameraToCenterDistance,u_pitch:et.pitch/360*2*Math.PI,u_rotate_symbol:+g,u_aspect_ratio:et.width/et.height,u_fade_change:I.options.fadeDuration?I.symbolFadeChange:1,u_matrix:L,u_label_plane_matrix:B,u_coord_matrix:q,u_is_text:+$,u_pitch_with_map:+S,u_texsize:J,u_texture:0}},ul=(T,a,g,S,I,L,B,q,$,J,et)=>{let ut=I.transform;return u.extend(ba(T,a,g,S,I,L,B,q,$,J),{u_gamma_scale:S?Math.cos(ut._pitch)*ut.cameraToCenterDistance:1,u_device_pixel_ratio:I.pixelRatio,u_is_halo:+et})},cl=(T,a,g,S,I,L,B,q,$,J)=>u.extend(ul(T,a,g,S,I,L,B,q,!0,$,!0),{u_texsize_icon:J,u_texture_icon:1}),Cc=(T,a,g)=>({u_matrix:T,u_opacity:a,u_color:g}),Bs=(T,a,g,S,I,L)=>u.extend(function(B,q,$,J){let et=$.imageManager.getPattern(B.from.toString()),ut=$.imageManager.getPattern(B.to.toString()),{width:vt,height:Ft}=$.imageManager.getPixelSize(),bt=Math.pow(2,J.tileID.overscaledZ),Ot=J.tileSize*Math.pow(2,$.transform.tileZoom)/bt,Kt=Ot*(J.tileID.canonical.x+J.tileID.wrap*bt),Wt=Ot*J.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:et.tl,u_pattern_br_a:et.br,u_pattern_tl_b:ut.tl,u_pattern_br_b:ut.br,u_texsize:[vt,Ft],u_mix:q.t,u_pattern_size_a:et.displaySize,u_pattern_size_b:ut.displaySize,u_scale_a:q.fromScale,u_scale_b:q.toScale,u_tile_units_to_pixels:1/It(J,1,$.transform.tileZoom),u_pixel_coord_upper:[Kt>>16,Wt>>16],u_pixel_coord_lower:[65535&Kt,65535&Wt]}}(S,L,g,I),{u_matrix:T,u_opacity:a}),fo={fillExtrusion:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_lightpos:new u.Uniform3f(T,a.u_lightpos),u_lightintensity:new u.Uniform1f(T,a.u_lightintensity),u_lightcolor:new u.Uniform3f(T,a.u_lightcolor),u_vertical_gradient:new u.Uniform1f(T,a.u_vertical_gradient),u_opacity:new u.Uniform1f(T,a.u_opacity)}),fillExtrusionPattern:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_lightpos:new u.Uniform3f(T,a.u_lightpos),u_lightintensity:new u.Uniform1f(T,a.u_lightintensity),u_lightcolor:new u.Uniform3f(T,a.u_lightcolor),u_vertical_gradient:new u.Uniform1f(T,a.u_vertical_gradient),u_height_factor:new u.Uniform1f(T,a.u_height_factor),u_image:new u.Uniform1i(T,a.u_image),u_texsize:new u.Uniform2f(T,a.u_texsize),u_pixel_coord_upper:new u.Uniform2f(T,a.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(T,a.u_pixel_coord_lower),u_scale:new u.Uniform3f(T,a.u_scale),u_fade:new u.Uniform1f(T,a.u_fade),u_opacity:new u.Uniform1f(T,a.u_opacity)}),fill:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix)}),fillPattern:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_image:new u.Uniform1i(T,a.u_image),u_texsize:new u.Uniform2f(T,a.u_texsize),u_pixel_coord_upper:new u.Uniform2f(T,a.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(T,a.u_pixel_coord_lower),u_scale:new u.Uniform3f(T,a.u_scale),u_fade:new u.Uniform1f(T,a.u_fade)}),fillOutline:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_world:new u.Uniform2f(T,a.u_world)}),fillOutlinePattern:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_world:new u.Uniform2f(T,a.u_world),u_image:new u.Uniform1i(T,a.u_image),u_texsize:new u.Uniform2f(T,a.u_texsize),u_pixel_coord_upper:new u.Uniform2f(T,a.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(T,a.u_pixel_coord_lower),u_scale:new u.Uniform3f(T,a.u_scale),u_fade:new u.Uniform1f(T,a.u_fade)}),circle:(T,a)=>({u_camera_to_center_distance:new u.Uniform1f(T,a.u_camera_to_center_distance),u_scale_with_map:new u.Uniform1i(T,a.u_scale_with_map),u_pitch_with_map:new u.Uniform1i(T,a.u_pitch_with_map),u_extrude_scale:new u.Uniform2f(T,a.u_extrude_scale),u_device_pixel_ratio:new u.Uniform1f(T,a.u_device_pixel_ratio),u_matrix:new u.UniformMatrix4f(T,a.u_matrix)}),collisionBox:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_camera_to_center_distance:new u.Uniform1f(T,a.u_camera_to_center_distance),u_pixels_to_tile_units:new u.Uniform1f(T,a.u_pixels_to_tile_units),u_extrude_scale:new u.Uniform2f(T,a.u_extrude_scale),u_overscale_factor:new u.Uniform1f(T,a.u_overscale_factor)}),collisionCircle:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_inv_matrix:new u.UniformMatrix4f(T,a.u_inv_matrix),u_camera_to_center_distance:new u.Uniform1f(T,a.u_camera_to_center_distance),u_viewport_size:new u.Uniform2f(T,a.u_viewport_size)}),debug:(T,a)=>({u_color:new u.UniformColor(T,a.u_color),u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_overlay:new u.Uniform1i(T,a.u_overlay),u_overlay_scale:new u.Uniform1f(T,a.u_overlay_scale)}),clippingMask:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix)}),heatmap:(T,a)=>({u_extrude_scale:new u.Uniform1f(T,a.u_extrude_scale),u_intensity:new u.Uniform1f(T,a.u_intensity),u_matrix:new u.UniformMatrix4f(T,a.u_matrix)}),heatmapTexture:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_world:new u.Uniform2f(T,a.u_world),u_image:new u.Uniform1i(T,a.u_image),u_color_ramp:new u.Uniform1i(T,a.u_color_ramp),u_opacity:new u.Uniform1f(T,a.u_opacity)}),hillshade:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_image:new u.Uniform1i(T,a.u_image),u_latrange:new u.Uniform2f(T,a.u_latrange),u_light:new u.Uniform2f(T,a.u_light),u_shadow:new u.UniformColor(T,a.u_shadow),u_highlight:new u.UniformColor(T,a.u_highlight),u_accent:new u.UniformColor(T,a.u_accent)}),hillshadePrepare:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_image:new u.Uniform1i(T,a.u_image),u_dimension:new u.Uniform2f(T,a.u_dimension),u_zoom:new u.Uniform1f(T,a.u_zoom),u_unpack:new u.Uniform4f(T,a.u_unpack)}),line:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_ratio:new u.Uniform1f(T,a.u_ratio),u_device_pixel_ratio:new u.Uniform1f(T,a.u_device_pixel_ratio),u_units_to_pixels:new u.Uniform2f(T,a.u_units_to_pixels)}),lineGradient:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_ratio:new u.Uniform1f(T,a.u_ratio),u_device_pixel_ratio:new u.Uniform1f(T,a.u_device_pixel_ratio),u_units_to_pixels:new u.Uniform2f(T,a.u_units_to_pixels),u_image:new u.Uniform1i(T,a.u_image),u_image_height:new u.Uniform1f(T,a.u_image_height)}),linePattern:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_texsize:new u.Uniform2f(T,a.u_texsize),u_ratio:new u.Uniform1f(T,a.u_ratio),u_device_pixel_ratio:new u.Uniform1f(T,a.u_device_pixel_ratio),u_image:new u.Uniform1i(T,a.u_image),u_units_to_pixels:new u.Uniform2f(T,a.u_units_to_pixels),u_scale:new u.Uniform3f(T,a.u_scale),u_fade:new u.Uniform1f(T,a.u_fade)}),lineSDF:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_ratio:new u.Uniform1f(T,a.u_ratio),u_device_pixel_ratio:new u.Uniform1f(T,a.u_device_pixel_ratio),u_units_to_pixels:new u.Uniform2f(T,a.u_units_to_pixels),u_patternscale_a:new u.Uniform2f(T,a.u_patternscale_a),u_patternscale_b:new u.Uniform2f(T,a.u_patternscale_b),u_sdfgamma:new u.Uniform1f(T,a.u_sdfgamma),u_image:new u.Uniform1i(T,a.u_image),u_tex_y_a:new u.Uniform1f(T,a.u_tex_y_a),u_tex_y_b:new u.Uniform1f(T,a.u_tex_y_b),u_mix:new u.Uniform1f(T,a.u_mix)}),raster:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_tl_parent:new u.Uniform2f(T,a.u_tl_parent),u_scale_parent:new u.Uniform1f(T,a.u_scale_parent),u_buffer_scale:new u.Uniform1f(T,a.u_buffer_scale),u_fade_t:new u.Uniform1f(T,a.u_fade_t),u_opacity:new u.Uniform1f(T,a.u_opacity),u_image0:new u.Uniform1i(T,a.u_image0),u_image1:new u.Uniform1i(T,a.u_image1),u_brightness_low:new u.Uniform1f(T,a.u_brightness_low),u_brightness_high:new u.Uniform1f(T,a.u_brightness_high),u_saturation_factor:new u.Uniform1f(T,a.u_saturation_factor),u_contrast_factor:new u.Uniform1f(T,a.u_contrast_factor),u_spin_weights:new u.Uniform3f(T,a.u_spin_weights)}),symbolIcon:(T,a)=>({u_is_size_zoom_constant:new u.Uniform1i(T,a.u_is_size_zoom_constant),u_is_size_feature_constant:new u.Uniform1i(T,a.u_is_size_feature_constant),u_size_t:new u.Uniform1f(T,a.u_size_t),u_size:new u.Uniform1f(T,a.u_size),u_camera_to_center_distance:new u.Uniform1f(T,a.u_camera_to_center_distance),u_pitch:new u.Uniform1f(T,a.u_pitch),u_rotate_symbol:new u.Uniform1i(T,a.u_rotate_symbol),u_aspect_ratio:new u.Uniform1f(T,a.u_aspect_ratio),u_fade_change:new u.Uniform1f(T,a.u_fade_change),u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_label_plane_matrix:new u.UniformMatrix4f(T,a.u_label_plane_matrix),u_coord_matrix:new u.UniformMatrix4f(T,a.u_coord_matrix),u_is_text:new u.Uniform1i(T,a.u_is_text),u_pitch_with_map:new u.Uniform1i(T,a.u_pitch_with_map),u_texsize:new u.Uniform2f(T,a.u_texsize),u_texture:new u.Uniform1i(T,a.u_texture)}),symbolSDF:(T,a)=>({u_is_size_zoom_constant:new u.Uniform1i(T,a.u_is_size_zoom_constant),u_is_size_feature_constant:new u.Uniform1i(T,a.u_is_size_feature_constant),u_size_t:new u.Uniform1f(T,a.u_size_t),u_size:new u.Uniform1f(T,a.u_size),u_camera_to_center_distance:new u.Uniform1f(T,a.u_camera_to_center_distance),u_pitch:new u.Uniform1f(T,a.u_pitch),u_rotate_symbol:new u.Uniform1i(T,a.u_rotate_symbol),u_aspect_ratio:new u.Uniform1f(T,a.u_aspect_ratio),u_fade_change:new u.Uniform1f(T,a.u_fade_change),u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_label_plane_matrix:new u.UniformMatrix4f(T,a.u_label_plane_matrix),u_coord_matrix:new u.UniformMatrix4f(T,a.u_coord_matrix),u_is_text:new u.Uniform1i(T,a.u_is_text),u_pitch_with_map:new u.Uniform1i(T,a.u_pitch_with_map),u_texsize:new u.Uniform2f(T,a.u_texsize),u_texture:new u.Uniform1i(T,a.u_texture),u_gamma_scale:new u.Uniform1f(T,a.u_gamma_scale),u_device_pixel_ratio:new u.Uniform1f(T,a.u_device_pixel_ratio),u_is_halo:new u.Uniform1i(T,a.u_is_halo)}),symbolTextAndIcon:(T,a)=>({u_is_size_zoom_constant:new u.Uniform1i(T,a.u_is_size_zoom_constant),u_is_size_feature_constant:new u.Uniform1i(T,a.u_is_size_feature_constant),u_size_t:new u.Uniform1f(T,a.u_size_t),u_size:new u.Uniform1f(T,a.u_size),u_camera_to_center_distance:new u.Uniform1f(T,a.u_camera_to_center_distance),u_pitch:new u.Uniform1f(T,a.u_pitch),u_rotate_symbol:new u.Uniform1i(T,a.u_rotate_symbol),u_aspect_ratio:new u.Uniform1f(T,a.u_aspect_ratio),u_fade_change:new u.Uniform1f(T,a.u_fade_change),u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_label_plane_matrix:new u.UniformMatrix4f(T,a.u_label_plane_matrix),u_coord_matrix:new u.UniformMatrix4f(T,a.u_coord_matrix),u_is_text:new u.Uniform1i(T,a.u_is_text),u_pitch_with_map:new u.Uniform1i(T,a.u_pitch_with_map),u_texsize:new u.Uniform2f(T,a.u_texsize),u_texsize_icon:new u.Uniform2f(T,a.u_texsize_icon),u_texture:new u.Uniform1i(T,a.u_texture),u_texture_icon:new u.Uniform1i(T,a.u_texture_icon),u_gamma_scale:new u.Uniform1f(T,a.u_gamma_scale),u_device_pixel_ratio:new u.Uniform1f(T,a.u_device_pixel_ratio),u_is_halo:new u.Uniform1i(T,a.u_is_halo)}),background:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_opacity:new u.Uniform1f(T,a.u_opacity),u_color:new u.UniformColor(T,a.u_color)}),backgroundPattern:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_opacity:new u.Uniform1f(T,a.u_opacity),u_image:new u.Uniform1i(T,a.u_image),u_pattern_tl_a:new u.Uniform2f(T,a.u_pattern_tl_a),u_pattern_br_a:new u.Uniform2f(T,a.u_pattern_br_a),u_pattern_tl_b:new u.Uniform2f(T,a.u_pattern_tl_b),u_pattern_br_b:new u.Uniform2f(T,a.u_pattern_br_b),u_texsize:new u.Uniform2f(T,a.u_texsize),u_mix:new u.Uniform1f(T,a.u_mix),u_pattern_size_a:new u.Uniform2f(T,a.u_pattern_size_a),u_pattern_size_b:new u.Uniform2f(T,a.u_pattern_size_b),u_scale_a:new u.Uniform1f(T,a.u_scale_a),u_scale_b:new u.Uniform1f(T,a.u_scale_b),u_pixel_coord_upper:new u.Uniform2f(T,a.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(T,a.u_pixel_coord_lower),u_tile_units_to_pixels:new u.Uniform1f(T,a.u_tile_units_to_pixels)})};class aa{constructor(a,g,S){this.context=a;let I=a.gl;this.buffer=I.createBuffer(),this.dynamicDraw=Boolean(S),this.context.unbindVAO(),a.bindElementBuffer.set(this.buffer),I.bufferData(I.ELEMENT_ARRAY_BUFFER,g.arrayBuffer,this.dynamicDraw?I.DYNAMIC_DRAW:I.STATIC_DRAW),this.dynamicDraw||delete g.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(a){let g=this.context.gl;this.context.unbindVAO(),this.bind(),g.bufferSubData(g.ELEMENT_ARRAY_BUFFER,0,a.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let sa={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class qa{constructor(a,g,S,I){this.length=g.length,this.attributes=S,this.itemSize=g.bytesPerElement,this.dynamicDraw=I,this.context=a;let L=a.gl;this.buffer=L.createBuffer(),a.bindVertexBuffer.set(this.buffer),L.bufferData(L.ARRAY_BUFFER,g.arrayBuffer,this.dynamicDraw?L.DYNAMIC_DRAW:L.STATIC_DRAW),this.dynamicDraw||delete g.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(a){let g=this.context.gl;this.bind(),g.bufferSubData(g.ARRAY_BUFFER,0,a.arrayBuffer)}enableAttributes(a,g){for(let S=0;S<this.attributes.length;S++){let I=g.attributes[this.attributes[S].name];I!==void 0&&a.enableVertexAttribArray(I)}}setVertexAttribPointers(a,g,S){for(let I=0;I<this.attributes.length;I++){let L=this.attributes[I],B=g.attributes[L.name];B!==void 0&&a.vertexAttribPointer(B,L.components,a[sa[L.type]],!1,this.itemSize,L.offset+this.itemSize*(S||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class Yr{constructor(a){this.gl=a.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(a){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Za extends Yr{getDefault(){return u.Color.transparent}set(a){let g=this.current;(a.r!==g.r||a.g!==g.g||a.b!==g.b||a.a!==g.a||this.dirty)&&(this.gl.clearColor(a.r,a.g,a.b,a.a),this.current=a,this.dirty=!1)}}class Xa extends Yr{getDefault(){return 1}set(a){(a!==this.current||this.dirty)&&(this.gl.clearDepth(a),this.current=a,this.dirty=!1)}}class Dn extends Yr{getDefault(){return 0}set(a){(a!==this.current||this.dirty)&&(this.gl.clearStencil(a),this.current=a,this.dirty=!1)}}class Ji extends Yr{getDefault(){return[!0,!0,!0,!0]}set(a){let g=this.current;(a[0]!==g[0]||a[1]!==g[1]||a[2]!==g[2]||a[3]!==g[3]||this.dirty)&&(this.gl.colorMask(a[0],a[1],a[2],a[3]),this.current=a,this.dirty=!1)}}class On extends Yr{getDefault(){return!0}set(a){(a!==this.current||this.dirty)&&(this.gl.depthMask(a),this.current=a,this.dirty=!1)}}class Yl extends Yr{getDefault(){return 255}set(a){(a!==this.current||this.dirty)&&(this.gl.stencilMask(a),this.current=a,this.dirty=!1)}}class Hl extends Yr{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(a){let g=this.current;(a.func!==g.func||a.ref!==g.ref||a.mask!==g.mask||this.dirty)&&(this.gl.stencilFunc(a.func,a.ref,a.mask),this.current=a,this.dirty=!1)}}class Jl extends Yr{getDefault(){let a=this.gl;return[a.KEEP,a.KEEP,a.KEEP]}set(a){let g=this.current;(a[0]!==g[0]||a[1]!==g[1]||a[2]!==g[2]||this.dirty)&&(this.gl.stencilOp(a[0],a[1],a[2]),this.current=a,this.dirty=!1)}}class hl extends Yr{getDefault(){return!1}set(a){if(a===this.current&&!this.dirty)return;let g=this.gl;a?g.enable(g.STENCIL_TEST):g.disable(g.STENCIL_TEST),this.current=a,this.dirty=!1}}class pl extends Yr{getDefault(){return[0,1]}set(a){let g=this.current;(a[0]!==g[0]||a[1]!==g[1]||this.dirty)&&(this.gl.depthRange(a[0],a[1]),this.current=a,this.dirty=!1)}}class Us extends Yr{getDefault(){return!1}set(a){if(a===this.current&&!this.dirty)return;let g=this.gl;a?g.enable(g.DEPTH_TEST):g.disable(g.DEPTH_TEST),this.current=a,this.dirty=!1}}class fl extends Yr{getDefault(){return this.gl.LESS}set(a){(a!==this.current||this.dirty)&&(this.gl.depthFunc(a),this.current=a,this.dirty=!1)}}class Ql extends Yr{getDefault(){return!1}set(a){if(a===this.current&&!this.dirty)return;let g=this.gl;a?g.enable(g.BLEND):g.disable(g.BLEND),this.current=a,this.dirty=!1}}class dl extends Yr{getDefault(){let a=this.gl;return[a.ONE,a.ZERO]}set(a){let g=this.current;(a[0]!==g[0]||a[1]!==g[1]||this.dirty)&&(this.gl.blendFunc(a[0],a[1]),this.current=a,this.dirty=!1)}}class Ac extends Yr{getDefault(){return u.Color.transparent}set(a){let g=this.current;(a.r!==g.r||a.g!==g.g||a.b!==g.b||a.a!==g.a||this.dirty)&&(this.gl.blendColor(a.r,a.g,a.b,a.a),this.current=a,this.dirty=!1)}}class Ns extends Yr{getDefault(){return this.gl.FUNC_ADD}set(a){(a!==this.current||this.dirty)&&(this.gl.blendEquation(a),this.current=a,this.dirty=!1)}}class la extends Yr{getDefault(){return!1}set(a){if(a===this.current&&!this.dirty)return;let g=this.gl;a?g.enable(g.CULL_FACE):g.disable(g.CULL_FACE),this.current=a,this.dirty=!1}}class Pc extends Yr{getDefault(){return this.gl.BACK}set(a){(a!==this.current||this.dirty)&&(this.gl.cullFace(a),this.current=a,this.dirty=!1)}}class Fn extends Yr{getDefault(){return this.gl.CCW}set(a){(a!==this.current||this.dirty)&&(this.gl.frontFace(a),this.current=a,this.dirty=!1)}}class Nu extends Yr{getDefault(){return null}set(a){(a!==this.current||this.dirty)&&(this.gl.useProgram(a),this.current=a,this.dirty=!1)}}class Wa extends Yr{getDefault(){return this.gl.TEXTURE0}set(a){(a!==this.current||this.dirty)&&(this.gl.activeTexture(a),this.current=a,this.dirty=!1)}}class $a extends Yr{getDefault(){let a=this.gl;return[0,0,a.drawingBufferWidth,a.drawingBufferHeight]}set(a){let g=this.current;(a[0]!==g[0]||a[1]!==g[1]||a[2]!==g[2]||a[3]!==g[3]||this.dirty)&&(this.gl.viewport(a[0],a[1],a[2],a[3]),this.current=a,this.dirty=!1)}}class vs extends Yr{getDefault(){return null}set(a){if(a===this.current&&!this.dirty)return;let g=this.gl;g.bindFramebuffer(g.FRAMEBUFFER,a),this.current=a,this.dirty=!1}}class wa extends Yr{getDefault(){return null}set(a){if(a===this.current&&!this.dirty)return;let g=this.gl;g.bindRenderbuffer(g.RENDERBUFFER,a),this.current=a,this.dirty=!1}}class ua extends Yr{getDefault(){return null}set(a){if(a===this.current&&!this.dirty)return;let g=this.gl;g.bindTexture(g.TEXTURE_2D,a),this.current=a,this.dirty=!1}}class Uo extends Yr{getDefault(){return null}set(a){if(a===this.current&&!this.dirty)return;let g=this.gl;g.bindBuffer(g.ARRAY_BUFFER,a),this.current=a,this.dirty=!1}}class Ka extends Yr{getDefault(){return null}set(a){let g=this.gl;g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,a),this.current=a,this.dirty=!1}}class Ea extends Yr{constructor(a){super(a),this.vao=a.extVertexArrayObject}getDefault(){return null}set(a){this.vao&&(a!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(a),this.current=a,this.dirty=!1)}}class tu extends Yr{getDefault(){return 4}set(a){if(a===this.current&&!this.dirty)return;let g=this.gl;g.pixelStorei(g.UNPACK_ALIGNMENT,a),this.current=a,this.dirty=!1}}class Ya extends Yr{getDefault(){return!1}set(a){if(a===this.current&&!this.dirty)return;let g=this.gl;g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a),this.current=a,this.dirty=!1}}class yi extends Yr{getDefault(){return!1}set(a){if(a===this.current&&!this.dirty)return;let g=this.gl;g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,a),this.current=a,this.dirty=!1}}class xs extends Yr{constructor(a,g){super(a),this.context=a,this.parent=g}getDefault(){return null}}class Sa extends xs{setDirty(){this.dirty=!0}set(a){if(a===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let g=this.gl;g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0,g.TEXTURE_2D,a,0),this.current=a,this.dirty=!1}}class Vu extends xs{set(a){if(a===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let g=this.gl;g.framebufferRenderbuffer(g.FRAMEBUFFER,g.DEPTH_ATTACHMENT,g.RENDERBUFFER,a),this.current=a,this.dirty=!1}}class eu{constructor(a,g,S,I){this.context=a,this.width=g,this.height=S;let L=this.framebuffer=a.gl.createFramebuffer();this.colorAttachment=new Sa(a,L),I&&(this.depthAttachment=new Vu(a,L))}destroy(){let a=this.context.gl,g=this.colorAttachment.get();if(g&&a.deleteTexture(g),this.depthAttachment){let S=this.depthAttachment.get();S&&a.deleteRenderbuffer(S)}a.deleteFramebuffer(this.framebuffer)}}class Ur{constructor(a,g,S){this.blendFunction=a,this.blendColor=g,this.mask=S}}Ur.Replace=[1,0],Ur.disabled=new Ur(Ur.Replace,u.Color.transparent,[!1,!1,!1,!1]),Ur.unblended=new Ur(Ur.Replace,u.Color.transparent,[!0,!0,!0,!0]),Ur.alphaBlended=new Ur([1,771],u.Color.transparent,[!0,!0,!0,!0]);class ml{constructor(a){this.gl=a,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new Za(this),this.clearDepth=new Xa(this),this.clearStencil=new Dn(this),this.colorMask=new Ji(this),this.depthMask=new On(this),this.stencilMask=new Yl(this),this.stencilFunc=new Hl(this),this.stencilOp=new Jl(this),this.stencilTest=new hl(this),this.depthRange=new pl(this),this.depthTest=new Us(this),this.depthFunc=new fl(this),this.blend=new Ql(this),this.blendFunc=new dl(this),this.blendColor=new Ac(this),this.blendEquation=new Ns(this),this.cullFace=new la(this),this.cullFaceSide=new Pc(this),this.frontFace=new Fn(this),this.program=new Nu(this),this.activeTexture=new Wa(this),this.viewport=new $a(this),this.bindFramebuffer=new vs(this),this.bindRenderbuffer=new wa(this),this.bindTexture=new ua(this),this.bindVertexBuffer=new Uo(this),this.bindElementBuffer=new Ka(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new Ea(this),this.pixelStoreUnpack=new tu(this),this.pixelStoreUnpackPremultiplyAlpha=new Ya(this),this.pixelStoreUnpackFlipY=new yi(this),this.extTextureFilterAnisotropic=a.getExtension("EXT_texture_filter_anisotropic")||a.getExtension("MOZ_EXT_texture_filter_anisotropic")||a.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=a.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=a.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(a.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=a.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=a.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=a.getParameter(a.MAX_TEXTURE_SIZE)}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.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(a,g){return new aa(this,a,g)}createVertexBuffer(a,g,S){return new qa(this,a,g,S)}createRenderbuffer(a,g,S){let I=this.gl,L=I.createRenderbuffer();return this.bindRenderbuffer.set(L),I.renderbufferStorage(I.RENDERBUFFER,a,g,S),this.bindRenderbuffer.set(null),L}createFramebuffer(a,g,S){return new eu(this,a,g,S)}clear({color:a,depth:g}){let S=this.gl,I=0;a&&(I|=S.COLOR_BUFFER_BIT,this.clearColor.set(a),this.colorMask.set([!0,!0,!0,!0])),g!==void 0&&(I|=S.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(g),this.depthMask.set(!0)),S.clear(I)}setCullFace(a){a.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(a.mode),this.frontFace.set(a.frontFace))}setDepthMode(a){a.func!==this.gl.ALWAYS||a.mask?(this.depthTest.set(!0),this.depthFunc.set(a.func),this.depthMask.set(a.mask),this.depthRange.set(a.range)):this.depthTest.set(!1)}setStencilMode(a){a.test.func!==this.gl.ALWAYS||a.mask?(this.stencilTest.set(!0),this.stencilMask.set(a.mask),this.stencilOp.set([a.fail,a.depthFail,a.pass]),this.stencilFunc.set({func:a.test.func,ref:a.ref,mask:a.test.mask})):this.stencilTest.set(!1)}setColorMode(a){U(a.blendFunction,Ur.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(a.blendFunction),this.blendColor.set(a.blendColor)),this.colorMask.set(a.mask)}unbindVAO(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)}}class ei{constructor(a,g,S){this.func=a,this.mask=g,this.range=S}}ei.ReadOnly=!1,ei.ReadWrite=!0,ei.disabled=new ei(519,ei.ReadOnly,[0,1]);let Wo=7680;class xi{constructor(a,g,S,I,L,B){this.test=a,this.ref=g,this.mask=S,this.fail=I,this.depthFail=L,this.pass=B}}xi.disabled=new xi({func:519,mask:0},0,0,Wo,Wo,Wo);class Qi{constructor(a,g,S){this.enable=a,this.mode=g,this.frontFace=S}}let gl;function yl(T,a,g,S,I,L,B){let q=T.context,$=q.gl,J=T.useProgram("collisionBox"),et=[],ut=0,vt=0;for(let Ht=0;Ht<S.length;Ht++){let _e=S[Ht],he=a.getTile(_e),de=he.getBucket(g);if(!de)continue;let Pe=_e.posMatrix;I[0]===0&&I[1]===0||(Pe=T.translatePosMatrix(_e.posMatrix,he,I,L));let Re=B?de.textCollisionBox:de.iconCollisionBox,ve=de.collisionCircleArray;if(ve.length>0){let ar=u.create(),Ye=Pe;u.mul(ar,de.placementInvProjMatrix,T.transform.glCoordMatrix),u.mul(ar,ar,de.placementViewportMatrix),et.push({circleArray:ve,circleOffset:vt,transform:Ye,invTransform:ar}),ut+=ve.length/4,vt=ut}Re&&J.draw(q,$.LINES,ei.disabled,xi.disabled,T.colorModeForRenderPass(),Qi.disabled,Bo(Pe,T.transform,he),g.id,Re.layoutVertexBuffer,Re.indexBuffer,Re.segments,null,T.transform.zoom,null,null,Re.collisionVertexBuffer)}if(!B||!et.length)return;let Ft=T.useProgram("collisionCircle"),bt=new u.CollisionCircleLayoutArray;bt.resize(4*ut),bt._trim();let Ot=0;for(let Ht of et)for(let _e=0;_e<Ht.circleArray.length/4;_e++){let he=4*_e,de=Ht.circleArray[he+0],Pe=Ht.circleArray[he+1],Re=Ht.circleArray[he+2],ve=Ht.circleArray[he+3];bt.emplace(Ot++,de,Pe,Re,ve,0),bt.emplace(Ot++,de,Pe,Re,ve,1),bt.emplace(Ot++,de,Pe,Re,ve,2),bt.emplace(Ot++,de,Pe,Re,ve,3)}(!gl||gl.length<2*ut)&&(gl=function(Ht){let _e=2*Ht,he=new u.QuadTriangleArray;he.resize(_e),he._trim();for(let de=0;de<_e;de++){let Pe=6*de;he.uint16[Pe+0]=4*de+0,he.uint16[Pe+1]=4*de+1,he.uint16[Pe+2]=4*de+2,he.uint16[Pe+3]=4*de+2,he.uint16[Pe+4]=4*de+3,he.uint16[Pe+5]=4*de+0}return he}(ut));let Kt=q.createIndexBuffer(gl,!0),Wt=q.createVertexBuffer(bt,u.collisionCircleLayout.members,!0);for(let Ht of et){let _e={u_matrix:Ht.transform,u_inv_matrix:Ht.invTransform,u_camera_to_center_distance:(ie=T.transform).cameraToCenterDistance,u_viewport_size:[ie.width,ie.height]};Ft.draw(q,$.TRIANGLES,ei.disabled,xi.disabled,T.colorModeForRenderPass(),Qi.disabled,_e,g.id,Wt,Kt,u.SegmentVector.simpleSegment(0,2*Ht.circleOffset,Ht.circleArray.length,Ht.circleArray.length/2),null,T.transform.zoom,null,null,null)}var ie;Wt.destroy(),Kt.destroy()}Qi.disabled=new Qi(!1,1029,2305),Qi.backCCW=new Qi(!0,1029,2305);let bs=u.identity(new Float32Array(16));function ru(T,a,g,S,I,L){let{horizontalAlign:B,verticalAlign:q}=u.getAnchorAlignment(T),$=-(B-.5)*a,J=-(q-.5)*g,et=u.evaluateVariableOffset(T,S);return new u.pointGeometry(($/I+et[0])*L,(J/I+et[1])*L)}function ca(T,a,g,S,I,L,B,q,$,J){let et=T.text.placedSymbolArray,ut=T.text.dynamicLayoutVertexArray,vt=T.icon.dynamicLayoutVertexArray,Ft={};ut.clear();for(let bt=0;bt<et.length;bt++){let Ot=et.get(bt),Kt=T.allowVerticalPlacement&&!Ot.placedOrientation,Wt=Ot.hidden||!Ot.crossTileID||Kt?null:S[Ot.crossTileID];if(Wt){let ie=new u.pointGeometry(Ot.anchorX,Ot.anchorY),Ht=ai(ie,g?B:L),_e=Ge(I.cameraToCenterDistance,Ht.signedDistanceFromCamera),he=u.evaluateSizeForFeature(T.textSizeData,$,Ot)*_e/u.ONE_EM;g&&(he*=T.tilePixelRatio/q);let{width:de,height:Pe,anchor:Re,textOffset:ve,textBoxScale:ar}=Wt,Ye=ru(Re,de,Pe,ve,ar,he),Ar=g?ai(ie.add(Ye),L).point:Ht.point.add(a?Ye.rotate(-I.angle):Ye),p=T.allowVerticalPlacement&&Ot.placedOrientation===u.WritingMode.vertical?Math.PI/2:0;for(let m=0;m<Ot.numGlyphs;m++)u.addDynamicAttributes(ut,Ar,p);J&&Ot.associatedIconIndex>=0&&(Ft[Ot.associatedIconIndex]={shiftedAnchor:Ar,angle:p})}else Q(Ot.numGlyphs,ut)}if(J){vt.clear();let bt=T.icon.placedSymbolArray;for(let Ot=0;Ot<bt.length;Ot++){let Kt=bt.get(Ot);if(Kt.hidden)Q(Kt.numGlyphs,vt);else{let Wt=Ft[Ot];if(Wt)for(let ie=0;ie<Kt.numGlyphs;ie++)u.addDynamicAttributes(vt,Wt.shiftedAnchor,Wt.angle);else Q(Kt.numGlyphs,vt)}}T.icon.dynamicLayoutVertexBuffer.updateData(vt)}T.text.dynamicLayoutVertexBuffer.updateData(ut)}function ha(T,a,g){return g.iconsInText&&a?"symbolTextAndIcon":T?"symbolSDF":"symbolIcon"}function _l(T,a,g,S,I,L,B,q,$,J,et,ut){let vt=T.context,Ft=vt.gl,bt=T.transform,Ot=q==="map",Kt=$==="map",Wt=q!=="viewport"&&g.layout.get("symbol-placement")!=="point",ie=Ot&&!Kt&&!Wt,Ht=!g.layout.get("symbol-sort-key").isConstant(),_e=!1,he=T.depthModeForSublayer(0,ei.ReadOnly),de=g.layout.get("text-variable-anchor"),Pe=[];for(let Re of S){let ve=a.getTile(Re),ar=ve.getBucket(g);if(!ar)continue;let Ye=I?ar.text:ar.icon;if(!Ye||!Ye.segments.get().length)continue;let Ar=Ye.programConfigurations.get(g.id),p=I||ar.sdfIcons,m=I?ar.textSizeData:ar.iconSizeData,d=Kt||bt.pitch!==0,x=T.useProgram(ha(p,I,ar),Ar),A=u.evaluateSizeForZoom(m,bt.zoom),k,R,j,K,tt=[0,0],ct=null;if(I){if(R=ve.glyphAtlasTexture,j=Ft.LINEAR,k=ve.glyphAtlasTexture.size,ar.iconsInText){tt=ve.imageAtlasTexture.size,ct=ve.imageAtlasTexture;let le=m.kind==="composite"||m.kind==="camera";K=d||T.options.rotating||T.options.zooming||le?Ft.LINEAR:Ft.NEAREST}}else{let le=g.layout.get("icon-size").constantOr(0)!==1||ar.iconsNeedLinear;R=ve.imageAtlasTexture,j=p||T.options.rotating||T.options.zooming||le||d?Ft.LINEAR:Ft.NEAREST,k=ve.imageAtlasTexture.size}let ft=It(ve,1,T.transform.zoom),mt=Ei(Re.posMatrix,Kt,Ot,T.transform,ft),Mt=Xn(Re.posMatrix,Kt,Ot,T.transform,ft),At=de&&ar.hasTextData(),Dt=g.layout.get("icon-text-fit")!=="none"&&At&&ar.hasIconData();if(Wt){let le=g.layout.get("text-rotation-alignment")==="map";kr(ar,Re.posMatrix,T,I,mt,Mt,Kt,J,le)}let xt=T.translatePosMatrix(Re.posMatrix,ve,L,B),Rt=Wt||I&&de||Dt?bs:mt,Nt=T.translatePosMatrix(Mt,ve,L,B,!0),Yt=p&&g.paint.get(I?"text-halo-width":"icon-halo-width").constantOr(1)!==0,ne;ne=p?ar.iconsInText?cl(m.kind,A,ie,Kt,T,xt,Rt,Nt,k,tt):ul(m.kind,A,ie,Kt,T,xt,Rt,Nt,I,k,!0):ba(m.kind,A,ie,Kt,T,xt,Rt,Nt,I,k);let ae={program:x,buffers:Ye,uniformValues:ne,atlasTexture:R,atlasTextureIcon:ct,atlasInterpolation:j,atlasInterpolationIcon:K,isSDF:p,hasHalo:Yt};if(Ht&&ar.canOverlap){_e=!0;let le=Ye.segments.get();for(let xe of le)Pe.push({segments:new u.SegmentVector([xe]),sortKey:xe.sortKey,state:ae})}else Pe.push({segments:Ye.segments,sortKey:0,state:ae})}_e&&Pe.sort((Re,ve)=>Re.sortKey-ve.sortKey);for(let Re of Pe){let ve=Re.state;if(vt.activeTexture.set(Ft.TEXTURE0),ve.atlasTexture.bind(ve.atlasInterpolation,Ft.CLAMP_TO_EDGE),ve.atlasTextureIcon&&(vt.activeTexture.set(Ft.TEXTURE1),ve.atlasTextureIcon&&ve.atlasTextureIcon.bind(ve.atlasInterpolationIcon,Ft.CLAMP_TO_EDGE)),ve.isSDF){let ar=ve.uniformValues;ve.hasHalo&&(ar.u_is_halo=1,Ha(ve.buffers,Re.segments,g,T,ve.program,he,et,ut,ar)),ar.u_is_halo=0}Ha(ve.buffers,Re.segments,g,T,ve.program,he,et,ut,ve.uniformValues)}}function Ha(T,a,g,S,I,L,B,q,$){let J=S.context;I.draw(J,J.gl.TRIANGLES,L,B,q,Qi.disabled,$,g.id,T.layoutVertexBuffer,T.indexBuffer,a,g.paint,S.transform.zoom,T.programConfigurations.get(g.id),T.dynamicLayoutVertexBuffer,T.opacityVertexBuffer)}function bi(T,a,g,S,I,L,B){let q=T.context.gl,$=g.paint.get("fill-pattern"),J=$&&$.constantOr(1),et=g.getCrossfadeParameters(),ut,vt,Ft,bt,Ot;B?(vt=J&&!g.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",ut=q.LINES):(vt=J?"fillPattern":"fill",ut=q.TRIANGLES);for(let Kt of S){let Wt=a.getTile(Kt);if(J&&!Wt.patternsLoaded())continue;let ie=Wt.getBucket(g);if(!ie)continue;let Ht=ie.programConfigurations.get(g.id),_e=T.useProgram(vt,Ht);J&&(T.context.activeTexture.set(q.TEXTURE0),Wt.imageAtlasTexture.bind(q.LINEAR,q.CLAMP_TO_EDGE),Ht.updatePaintBuffers(et));let he=$.constantOr(null);if(he&&Wt.imageAtlas){let Pe=Wt.imageAtlas,Re=Pe.patternPositions[he.to.toString()],ve=Pe.patternPositions[he.from.toString()];Re&&ve&&Ht.setConstantPatternPositions(Re,ve)}let de=T.translatePosMatrix(Kt.posMatrix,Wt,g.paint.get("fill-translate"),g.paint.get("fill-translate-anchor"));if(B){bt=ie.indexBuffer2,Ot=ie.segments2;let Pe=[q.drawingBufferWidth,q.drawingBufferHeight];Ft=vt==="fillOutlinePattern"&&J?Lo(de,T,et,Wt,Pe):Ou(de,Pe)}else bt=ie.indexBuffer,Ot=ie.segments,Ft=J?oo(de,T,et,Wt):Mo(de);_e.draw(T.context,ut,I,T.stencilModeForClipping(Kt),L,Qi.disabled,Ft,g.id,ie.layoutVertexBuffer,bt,Ot,g.paint,T.transform.zoom,Ht)}}function Ta(T,a,g,S,I,L,B){let q=T.context,$=q.gl,J=g.paint.get("fill-extrusion-pattern"),et=J.constantOr(1),ut=g.getCrossfadeParameters(),vt=g.paint.get("fill-extrusion-opacity");for(let Ft of S){let bt=a.getTile(Ft),Ot=bt.getBucket(g);if(!Ot)continue;let Kt=Ot.programConfigurations.get(g.id),Wt=T.useProgram(et?"fillExtrusionPattern":"fillExtrusion",Kt);et&&(T.context.activeTexture.set($.TEXTURE0),bt.imageAtlasTexture.bind($.LINEAR,$.CLAMP_TO_EDGE),Kt.updatePaintBuffers(ut));let ie=J.constantOr(null);if(ie&&bt.imageAtlas){let de=bt.imageAtlas,Pe=de.patternPositions[ie.to.toString()],Re=de.patternPositions[ie.from.toString()];Pe&&Re&&Kt.setConstantPatternPositions(Pe,Re)}let Ht=T.translatePosMatrix(Ft.posMatrix,bt,g.paint.get("fill-extrusion-translate"),g.paint.get("fill-extrusion-translate-anchor")),_e=g.paint.get("fill-extrusion-vertical-gradient"),he=et?Si(Ht,T,_e,vt,Ft,ut,bt):Po(Ht,T,_e,vt);Wt.draw(q,q.gl.TRIANGLES,I,L,B,Qi.backCCW,he,g.id,Ot.layoutVertexBuffer,Ot.indexBuffer,Ot.segments,g.paint,T.transform.zoom,Kt)}}function iu(T,a,g,S,I,L){let B=T.context,q=B.gl,$=a.fbo;if(!$)return;let J=T.useProgram("hillshade");B.activeTexture.set(q.TEXTURE0),q.bindTexture(q.TEXTURE_2D,$.colorAttachment.get());let et=((ut,vt,Ft)=>{let bt=Ft.paint.get("hillshade-shadow-color"),Ot=Ft.paint.get("hillshade-highlight-color"),Kt=Ft.paint.get("hillshade-accent-color"),Wt=Ft.paint.get("hillshade-illumination-direction")*(Math.PI/180);Ft.paint.get("hillshade-illumination-anchor")==="viewport"&&(Wt-=ut.transform.angle);let ie=!ut.options.moving;return{u_matrix:ut.transform.calculatePosMatrix(vt.tileID.toUnwrapped(),ie),u_image:0,u_latrange:oa(0,vt.tileID),u_light:[Ft.paint.get("hillshade-exaggeration"),Wt],u_shadow:bt,u_highlight:Ot,u_accent:Kt}})(T,a,g);J.draw(B,q.TRIANGLES,S,I,L,Qi.disabled,et,g.id,T.rasterBoundsBuffer,T.quadTriangleIndexBuffer,T.rasterBoundsSegments)}function $n(T,a,g,S,I,L){let B=T.context,q=B.gl,$=a.dem;if($&&$.data){let J=$.dim,et=$.stride,ut=$.getPixels();if(B.activeTexture.set(q.TEXTURE1),B.pixelStoreUnpackPremultiplyAlpha.set(!1),a.demTexture=a.demTexture||T.getTileTexture(et),a.demTexture){let Ft=a.demTexture;Ft.update(ut,{premultiply:!1}),Ft.bind(q.NEAREST,q.CLAMP_TO_EDGE)}else a.demTexture=new Lt(B,ut,q.RGBA,{premultiply:!1}),a.demTexture.bind(q.NEAREST,q.CLAMP_TO_EDGE);B.activeTexture.set(q.TEXTURE0);let vt=a.fbo;if(!vt){let Ft=new Lt(B,{width:J,height:J,data:null},q.RGBA);Ft.bind(q.LINEAR,q.CLAMP_TO_EDGE),vt=a.fbo=B.createFramebuffer(J,J,!0),vt.colorAttachment.set(Ft.texture)}B.bindFramebuffer.set(vt.framebuffer),B.viewport.set([0,0,J,J]),T.useProgram("hillshadePrepare").draw(B,q.TRIANGLES,S,I,L,Qi.disabled,((Ft,bt)=>{let Ot=bt.stride,Kt=u.create();return u.ortho(Kt,0,u.EXTENT,-u.EXTENT,0,0,1),u.translate(Kt,Kt,[0,-u.EXTENT,0]),{u_matrix:Kt,u_image:1,u_dimension:[Ot,Ot],u_zoom:Ft.overscaledZ,u_unpack:bt.getUnpackVector()}})(a.tileID,$),g.id,T.rasterBoundsBuffer,T.quadTriangleIndexBuffer,T.rasterBoundsSegments),a.needsHillshadePrepare=!1}}function Gu(T,a,g,S,I){let L=S.paint.get("raster-fade-duration");if(L>0){let B=u.exported.now(),q=(B-T.timeAdded)/L,$=a?(B-a.timeAdded)/L:-1,J=g.getSource(),et=I.coveringZoomLevel({tileSize:J.tileSize,roundZoom:J.roundZoom}),ut=!a||Math.abs(a.tileID.overscaledZ-et)>Math.abs(T.tileID.overscaledZ-et),vt=ut&&T.refreshedUponExpiration?1:u.clamp(ut?q:1-$,0,1);return T.refreshedUponExpiration&&q>=1&&(T.refreshedUponExpiration=!1),a?{opacity:1,mix:1-vt}:{opacity:vt,mix:0}}return{opacity:1,mix:0}}let Mc=new u.Color(1,0,0,1),ju=new u.Color(0,1,0,1),Ia=new u.Color(0,0,1,1),Ca=new u.Color(1,0,1,1),ws=new u.Color(0,1,1,1);function vl(T,a,g,S){Aa(T,0,a+g/2,T.transform.width,g,S)}function Ja(T,a,g,S){Aa(T,a-g/2,0,g,T.transform.height,S)}function Aa(T,a,g,S,I,L){let B=T.context,q=B.gl;q.enable(q.SCISSOR_TEST),q.scissor(a*T.pixelRatio,g*T.pixelRatio,S*T.pixelRatio,I*T.pixelRatio),B.clear({color:L}),q.disable(q.SCISSOR_TEST)}function qu(T,a,g){let S=T.context,I=S.gl,L=g.posMatrix,B=T.useProgram("debug"),q=ei.disabled,$=xi.disabled,J=T.colorModeForRenderPass(),et="$debug";S.activeTexture.set(I.TEXTURE0),T.emptyTexture.bind(I.LINEAR,I.CLAMP_TO_EDGE),B.draw(S,I.LINE_STRIP,q,$,J,Qi.disabled,Hi(L,u.Color.red),et,T.debugBuffer,T.tileBorderIndexBuffer,T.debugSegments);let ut=a.getTileByID(g.key).latestRawTileData,vt=Math.floor((ut&&ut.byteLength||0)/1024),Ft=a.getTile(g).tileSize,bt=512/Math.min(Ft,512)*(g.overscaledZ/T.transform.zoom)*.5,Ot=g.canonical.toString();g.overscaledZ!==g.canonical.z&&(Ot+=` => ${g.overscaledZ}`),function(Kt,Wt){Kt.initDebugOverlayCanvas();let ie=Kt.debugOverlayCanvas,Ht=Kt.context.gl,_e=Kt.debugOverlayCanvas.getContext("2d");_e.clearRect(0,0,ie.width,ie.height),_e.shadowColor="white",_e.shadowBlur=2,_e.lineWidth=1.5,_e.strokeStyle="white",_e.textBaseline="top",_e.font="bold 36px Open Sans, sans-serif",_e.fillText(Wt,5,5),_e.strokeText(Wt,5,5),Kt.debugOverlayTexture.update(ie),Kt.debugOverlayTexture.bind(Ht.LINEAR,Ht.CLAMP_TO_EDGE)}(T,`${Ot} ${vt}kb`),B.draw(S,I.TRIANGLES,q,$,Ur.alphaBlended,Qi.disabled,Hi(L,u.Color.transparent,bt),et,T.debugBuffer,T.quadTriangleIndexBuffer,T.debugSegments)}let pa={symbol:function(T,a,g,S,I){if(T.renderPass!=="translucent")return;let L=xi.disabled,B=T.colorModeForRenderPass();g.layout.get("text-variable-anchor")&&function(q,$,J,et,ut,vt,Ft){let bt=$.transform,Ot=ut==="map",Kt=vt==="map";for(let Wt of q){let ie=et.getTile(Wt),Ht=ie.getBucket(J);if(!Ht||!Ht.text||!Ht.text.segments.get().length)continue;let _e=u.evaluateSizeForZoom(Ht.textSizeData,bt.zoom),he=It(ie,1,$.transform.zoom),de=Ei(Wt.posMatrix,Kt,Ot,$.transform,he),Pe=J.layout.get("icon-text-fit")!=="none"&&Ht.hasIconData();if(_e){let Re=Math.pow(2,bt.zoom-ie.tileID.overscaledZ);ca(Ht,Ot,Kt,Ft,bt,de,Wt.posMatrix,Re,_e,Pe)}}}(S,T,g,a,g.layout.get("text-rotation-alignment"),g.layout.get("text-pitch-alignment"),I),g.paint.get("icon-opacity").constantOr(1)!==0&&_l(T,a,g,S,!1,g.paint.get("icon-translate"),g.paint.get("icon-translate-anchor"),g.layout.get("icon-rotation-alignment"),g.layout.get("icon-pitch-alignment"),g.layout.get("icon-keep-upright"),L,B),g.paint.get("text-opacity").constantOr(1)!==0&&_l(T,a,g,S,!0,g.paint.get("text-translate"),g.paint.get("text-translate-anchor"),g.layout.get("text-rotation-alignment"),g.layout.get("text-pitch-alignment"),g.layout.get("text-keep-upright"),L,B),a.map.showCollisionBoxes&&(yl(T,a,g,S,g.paint.get("text-translate"),g.paint.get("text-translate-anchor"),!0),yl(T,a,g,S,g.paint.get("icon-translate"),g.paint.get("icon-translate-anchor"),!1))},circle:function(T,a,g,S){if(T.renderPass!=="translucent")return;let I=g.paint.get("circle-opacity"),L=g.paint.get("circle-stroke-width"),B=g.paint.get("circle-stroke-opacity"),q=!g.layout.get("circle-sort-key").isConstant();if(I.constantOr(1)===0&&(L.constantOr(1)===0||B.constantOr(1)===0))return;let $=T.context,J=$.gl,et=T.depthModeForSublayer(0,ei.ReadOnly),ut=xi.disabled,vt=T.colorModeForRenderPass(),Ft=[];for(let bt=0;bt<S.length;bt++){let Ot=S[bt],Kt=a.getTile(Ot),Wt=Kt.getBucket(g);if(!Wt)continue;let ie=Wt.programConfigurations.get(g.id),Ht={programConfiguration:ie,program:T.useProgram("circle",ie),layoutVertexBuffer:Wt.layoutVertexBuffer,indexBuffer:Wt.indexBuffer,uniformValues:ys(T,Ot,Kt,g)};if(q){let _e=Wt.segments.get();for(let he of _e)Ft.push({segments:new u.SegmentVector([he]),sortKey:he.sortKey,state:Ht})}else Ft.push({segments:Wt.segments,sortKey:0,state:Ht})}q&&Ft.sort((bt,Ot)=>bt.sortKey-Ot.sortKey);for(let bt of Ft){let{programConfiguration:Ot,program:Kt,layoutVertexBuffer:Wt,indexBuffer:ie,uniformValues:Ht}=bt.state;Kt.draw($,J.TRIANGLES,et,ut,vt,Qi.disabled,Ht,g.id,Wt,ie,bt.segments,g.paint,T.transform.zoom,Ot)}},heatmap:function(T,a,g,S){if(g.paint.get("heatmap-opacity")!==0)if(T.renderPass==="offscreen"){let I=T.context,L=I.gl,B=xi.disabled,q=new Ur([L.ONE,L.ONE],u.Color.transparent,[!0,!0,!0,!0]);(function($,J,et){let ut=$.gl;$.activeTexture.set(ut.TEXTURE1),$.viewport.set([0,0,J.width/4,J.height/4]);let vt=et.heatmapFbo;if(vt)ut.bindTexture(ut.TEXTURE_2D,vt.colorAttachment.get()),$.bindFramebuffer.set(vt.framebuffer);else{let Ft=ut.createTexture();ut.bindTexture(ut.TEXTURE_2D,Ft),ut.texParameteri(ut.TEXTURE_2D,ut.TEXTURE_WRAP_S,ut.CLAMP_TO_EDGE),ut.texParameteri(ut.TEXTURE_2D,ut.TEXTURE_WRAP_T,ut.CLAMP_TO_EDGE),ut.texParameteri(ut.TEXTURE_2D,ut.TEXTURE_MIN_FILTER,ut.LINEAR),ut.texParameteri(ut.TEXTURE_2D,ut.TEXTURE_MAG_FILTER,ut.LINEAR),vt=et.heatmapFbo=$.createFramebuffer(J.width/4,J.height/4,!1),function(bt,Ot,Kt,Wt){let ie=bt.gl;ie.texImage2D(ie.TEXTURE_2D,0,ie.RGBA,Ot.width/4,Ot.height/4,0,ie.RGBA,bt.extRenderToTextureHalfFloat?bt.extTextureHalfFloat.HALF_FLOAT_OES:ie.UNSIGNED_BYTE,null),Wt.colorAttachment.set(Kt)}($,J,Ft,vt)}})(I,T,g),I.clear({color:u.Color.transparent});for(let $=0;$<S.length;$++){let J=S[$];if(a.hasRenderableParent(J))continue;let et=a.getTile(J),ut=et.getBucket(g);if(!ut)continue;let vt=ut.programConfigurations.get(g.id),Ft=T.useProgram("heatmap",vt),{zoom:bt}=T.transform;Ft.draw(I,L.TRIANGLES,ei.disabled,B,q,Qi.disabled,Sn(J.posMatrix,et,bt,g.paint.get("heatmap-intensity")),g.id,ut.layoutVertexBuffer,ut.indexBuffer,ut.segments,g.paint,T.transform.zoom,vt)}I.viewport.set([0,0,T.width,T.height])}else T.renderPass==="translucent"&&(T.context.setColorMode(T.colorModeForRenderPass()),function(I,L){let B=I.context,q=B.gl,$=L.heatmapFbo;if(!$)return;B.activeTexture.set(q.TEXTURE0),q.bindTexture(q.TEXTURE_2D,$.colorAttachment.get()),B.activeTexture.set(q.TEXTURE1);let J=L.colorRampTexture;J||(J=L.colorRampTexture=new Lt(B,L.colorRamp,q.RGBA)),J.bind(q.LINEAR,q.CLAMP_TO_EDGE),I.useProgram("heatmapTexture").draw(B,q.TRIANGLES,ei.disabled,xi.disabled,I.colorModeForRenderPass(),Qi.disabled,((et,ut,vt,Ft)=>{let bt=u.create();u.ortho(bt,0,et.width,et.height,0,0,1);let Ot=et.context.gl;return{u_matrix:bt,u_world:[Ot.drawingBufferWidth,Ot.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:ut.paint.get("heatmap-opacity")}})(I,L),L.id,I.viewportBuffer,I.quadTriangleIndexBuffer,I.viewportSegments,L.paint,I.transform.zoom)}(T,g))},line:function(T,a,g,S){if(T.renderPass!=="translucent")return;let I=g.paint.get("line-opacity"),L=g.paint.get("line-width");if(I.constantOr(1)===0||L.constantOr(1)===0)return;let B=T.depthModeForSublayer(0,ei.ReadOnly),q=T.colorModeForRenderPass(),$=g.paint.get("line-dasharray"),J=g.paint.get("line-pattern"),et=J.constantOr(1),ut=g.paint.get("line-gradient"),vt=g.getCrossfadeParameters(),Ft=et?"linePattern":$?"lineSDF":ut?"lineGradient":"line",bt=T.context,Ot=bt.gl,Kt=!0;for(let Wt of S){let ie=a.getTile(Wt);if(et&&!ie.patternsLoaded())continue;let Ht=ie.getBucket(g);if(!Ht)continue;let _e=Ht.programConfigurations.get(g.id),he=T.context.program.get(),de=T.useProgram(Ft,_e),Pe=Kt||de.program!==he,Re=J.constantOr(null);if(Re&&ie.imageAtlas){let ar=ie.imageAtlas,Ye=ar.patternPositions[Re.to.toString()],Ar=ar.patternPositions[Re.from.toString()];Ye&&Ar&&_e.setConstantPatternPositions(Ye,Ar)}let ve=et?_s(T,ie,g,vt):$?mn(T,ie,g,$,vt):ut?Kl(T,ie,g,Ht.lineClipsArray.length):ll(T,ie,g);if(et)bt.activeTexture.set(Ot.TEXTURE0),ie.imageAtlasTexture.bind(Ot.LINEAR,Ot.CLAMP_TO_EDGE),_e.updatePaintBuffers(vt);else if($&&(Pe||T.lineAtlas.dirty))bt.activeTexture.set(Ot.TEXTURE0),T.lineAtlas.bind(bt);else if(ut){let ar=Ht.gradients[g.id],Ye=ar.texture;if(g.gradientVersion!==ar.version){let Ar=256;if(g.stepInterpolant){let p=a.getSource().maxzoom,m=Wt.canonical.z===p?Math.ceil(1<<T.transform.maxZoom-Wt.canonical.z):1;Ar=u.clamp(u.nextPowerOfTwo(Ht.maxLineLength/u.EXTENT*1024*m),256,bt.maxTextureSize)}ar.gradient=u.renderColorRamp({expression:g.gradientExpression(),evaluationKey:"lineProgress",resolution:Ar,image:ar.gradient||void 0,clips:Ht.lineClipsArray}),ar.texture?ar.texture.update(ar.gradient):ar.texture=new Lt(bt,ar.gradient,Ot.RGBA),ar.version=g.gradientVersion,Ye=ar.texture}bt.activeTexture.set(Ot.TEXTURE0),Ye.bind(g.stepInterpolant?Ot.NEAREST:Ot.LINEAR,Ot.CLAMP_TO_EDGE)}de.draw(bt,Ot.TRIANGLES,B,T.stencilModeForClipping(Wt),q,Qi.disabled,ve,g.id,Ht.layoutVertexBuffer,Ht.indexBuffer,Ht.segments,g.paint,T.transform.zoom,_e,Ht.layoutVertexBuffer2),Kt=!1}},fill:function(T,a,g,S){let I=g.paint.get("fill-color"),L=g.paint.get("fill-opacity");if(L.constantOr(1)===0)return;let B=T.colorModeForRenderPass(),q=g.paint.get("fill-pattern"),$=T.opaquePassEnabledForLayer()&&!q.constantOr(1)&&I.constantOr(u.Color.transparent).a===1&&L.constantOr(0)===1?"opaque":"translucent";if(T.renderPass===$){let J=T.depthModeForSublayer(1,T.renderPass==="opaque"?ei.ReadWrite:ei.ReadOnly);bi(T,a,g,S,J,B,!1)}if(T.renderPass==="translucent"&&g.paint.get("fill-antialias")){let J=T.depthModeForSublayer(g.getPaintProperty("fill-outline-color")?2:0,ei.ReadOnly);bi(T,a,g,S,J,B,!0)}},"fill-extrusion":function(T,a,g,S){let I=g.paint.get("fill-extrusion-opacity");if(I!==0&&T.renderPass==="translucent"){let L=new ei(T.context.gl.LEQUAL,ei.ReadWrite,T.depthRangeFor3D);if(I!==1||g.paint.get("fill-extrusion-pattern").constantOr(1))Ta(T,a,g,S,L,xi.disabled,Ur.disabled),Ta(T,a,g,S,L,T.stencilModeFor3D(),T.colorModeForRenderPass());else{let B=T.colorModeForRenderPass();Ta(T,a,g,S,L,xi.disabled,B)}}},hillshade:function(T,a,g,S){if(T.renderPass!=="offscreen"&&T.renderPass!=="translucent")return;let I=T.context,L=T.depthModeForSublayer(0,ei.ReadOnly),B=T.colorModeForRenderPass(),[q,$]=T.renderPass==="translucent"?T.stencilConfigForOverlap(S):[{},S];for(let J of $){let et=a.getTile(J);et.needsHillshadePrepare&&T.renderPass==="offscreen"?$n(T,et,g,L,xi.disabled,B):T.renderPass==="translucent"&&iu(T,et,g,L,q[J.overscaledZ],B)}I.viewport.set([0,0,T.width,T.height])},raster:function(T,a,g,S){if(T.renderPass!=="translucent"||g.paint.get("raster-opacity")===0||!S.length)return;let I=T.context,L=I.gl,B=a.getSource(),q=T.useProgram("raster"),$=T.colorModeForRenderPass(),[J,et]=B instanceof $r?[{},S]:T.stencilConfigForOverlap(S),ut=et[et.length-1].overscaledZ,vt=!T.options.moving;for(let Ft of et){let bt=T.depthModeForSublayer(Ft.overscaledZ-ut,g.paint.get("raster-opacity")===1?ei.ReadWrite:ei.ReadOnly,L.LESS),Ot=a.getTile(Ft),Kt=T.transform.calculatePosMatrix(Ft.toUnwrapped(),vt);Ot.registerFadeDuration(g.paint.get("raster-fade-duration"));let Wt=a.findLoadedParent(Ft,0),ie=Gu(Ot,Wt,a,g,T.transform),Ht,_e,he=g.paint.get("raster-resampling")==="nearest"?L.NEAREST:L.LINEAR;I.activeTexture.set(L.TEXTURE0),Ot.texture.bind(he,L.CLAMP_TO_EDGE,L.LINEAR_MIPMAP_NEAREST),I.activeTexture.set(L.TEXTURE1),Wt?(Wt.texture.bind(he,L.CLAMP_TO_EDGE,L.LINEAR_MIPMAP_NEAREST),Ht=Math.pow(2,Wt.tileID.overscaledZ-Ot.tileID.overscaledZ),_e=[Ot.tileID.canonical.x*Ht%1,Ot.tileID.canonical.y*Ht%1]):Ot.texture.bind(he,L.CLAMP_TO_EDGE,L.LINEAR_MIPMAP_NEAREST);let de=Bu(Kt,_e||[0,0],Ht||1,ie,g);B instanceof $r?q.draw(I,L.TRIANGLES,bt,xi.disabled,$,Qi.disabled,de,g.id,B.boundsBuffer,T.quadTriangleIndexBuffer,B.boundsSegments):q.draw(I,L.TRIANGLES,bt,J[Ft.overscaledZ],$,Qi.disabled,de,g.id,T.rasterBoundsBuffer,T.quadTriangleIndexBuffer,T.rasterBoundsSegments)}},background:function(T,a,g){let S=g.paint.get("background-color"),I=g.paint.get("background-opacity");if(I===0)return;let L=T.context,B=L.gl,q=T.transform,$=q.tileSize,J=g.paint.get("background-pattern");if(T.isPatternMissing(J))return;let et=!J&&S.a===1&&I===1&&T.opaquePassEnabledForLayer()?"opaque":"translucent";if(T.renderPass!==et)return;let ut=xi.disabled,vt=T.depthModeForSublayer(0,et==="opaque"?ei.ReadWrite:ei.ReadOnly),Ft=T.colorModeForRenderPass(),bt=T.useProgram(J?"backgroundPattern":"background"),Ot=q.coveringTiles({tileSize:$});J&&(L.activeTexture.set(B.TEXTURE0),T.imageManager.bind(T.context));let Kt=g.getCrossfadeParameters();for(let Wt of Ot){let ie=T.transform.calculatePosMatrix(Wt.toUnwrapped()),Ht=J?Bs(ie,I,T,J,{tileID:Wt,tileSize:$},Kt):Cc(ie,I,S);bt.draw(L,B.TRIANGLES,vt,ut,Ft,Qi.disabled,Ht,g.id,T.tileExtentBuffer,T.quadTriangleIndexBuffer,T.tileExtentSegments)}},debug:function(T,a,g){for(let S=0;S<g.length;S++)qu(T,a,g[S])},custom:function(T,a,g){let S=T.context,I=g.implementation;if(T.renderPass==="offscreen"){let L=I.prerender;L&&(T.setCustomLayerDefaults(),S.setColorMode(T.colorModeForRenderPass()),L.call(I,S.gl,T.transform.customLayerMatrix()),S.setDirty(),T.setBaseState())}else if(T.renderPass==="translucent"){T.setCustomLayerDefaults(),S.setColorMode(T.colorModeForRenderPass()),S.setStencilMode(xi.disabled);let L=I.renderingMode==="3d"?new ei(T.context.gl.LEQUAL,ei.ReadWrite,T.depthRangeFor3D):T.depthModeForSublayer(0,ei.ReadOnly);S.setDepthMode(L),I.render(S.gl,T.transform.customLayerMatrix()),S.setDirty(),T.setBaseState(),S.bindFramebuffer.set(null)}}};class ko{constructor(a,g){this.context=new ml(a),this.transform=g,this._tileTextures={},this.setup(),this.numSublayers=dr.maxUnderzooming+dr.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new nr,this.gpuTimers={}}resize(a,g,S){if(this.width=a*S,this.height=g*S,this.pixelRatio=S,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let I of this.style._order)this.style._layers[I].resize()}setup(){let a=this.context,g=new u.PosArray;g.emplaceBack(0,0),g.emplaceBack(u.EXTENT,0),g.emplaceBack(0,u.EXTENT),g.emplaceBack(u.EXTENT,u.EXTENT),this.tileExtentBuffer=a.createVertexBuffer(g,Nn.members),this.tileExtentSegments=u.SegmentVector.simpleSegment(0,0,4,2);let S=new u.PosArray;S.emplaceBack(0,0),S.emplaceBack(u.EXTENT,0),S.emplaceBack(0,u.EXTENT),S.emplaceBack(u.EXTENT,u.EXTENT),this.debugBuffer=a.createVertexBuffer(S,Nn.members),this.debugSegments=u.SegmentVector.simpleSegment(0,0,4,5);let I=new u.RasterBoundsArray;I.emplaceBack(0,0,0,0),I.emplaceBack(u.EXTENT,0,u.EXTENT,0),I.emplaceBack(0,u.EXTENT,0,u.EXTENT),I.emplaceBack(u.EXTENT,u.EXTENT,u.EXTENT,u.EXTENT),this.rasterBoundsBuffer=a.createVertexBuffer(I,pr.members),this.rasterBoundsSegments=u.SegmentVector.simpleSegment(0,0,4,2);let L=new u.PosArray;L.emplaceBack(0,0),L.emplaceBack(1,0),L.emplaceBack(0,1),L.emplaceBack(1,1),this.viewportBuffer=a.createVertexBuffer(L,Nn.members),this.viewportSegments=u.SegmentVector.simpleSegment(0,0,4,2);let B=new u.LineStripIndexArray;B.emplaceBack(0),B.emplaceBack(1),B.emplaceBack(3),B.emplaceBack(2),B.emplaceBack(0),this.tileBorderIndexBuffer=a.createIndexBuffer(B);let q=new u.TriangleIndexArray;q.emplaceBack(0,1,2),q.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=a.createIndexBuffer(q),this.emptyTexture=new Lt(a,{width:1,height:1,data:new Uint8Array([0,0,0,0])},a.gl.RGBA);let $=this.context.gl;this.stencilClearMode=new xi({func:$.ALWAYS,mask:0},0,255,$.ZERO,$.ZERO,$.ZERO)}clearStencil(){let a=this.context,g=a.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let S=u.create();u.ortho(S,0,this.width,this.height,0,0,1),u.scale(S,S,[g.drawingBufferWidth,g.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(a,g.TRIANGLES,ei.disabled,this.stencilClearMode,Ur.disabled,Qi.disabled,po(S),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(a,g){if(this.currentStencilSource===a.source||!a.isTileClipped()||!g||!g.length)return;this.currentStencilSource=a.source;let S=this.context,I=S.gl;this.nextStencilID+g.length>256&&this.clearStencil(),S.setColorMode(Ur.disabled),S.setDepthMode(ei.disabled);let L=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let B of g){let q=this._tileClippingMaskIDs[B.key]=this.nextStencilID++;L.draw(S,I.TRIANGLES,ei.disabled,new xi({func:I.ALWAYS,mask:0},q,255,I.KEEP,I.KEEP,I.REPLACE),Ur.disabled,Qi.disabled,po(B.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let a=this.nextStencilID++,g=this.context.gl;return new xi({func:g.NOTEQUAL,mask:255},a,255,g.KEEP,g.KEEP,g.REPLACE)}stencilModeForClipping(a){let g=this.context.gl;return new xi({func:g.EQUAL,mask:255},this._tileClippingMaskIDs[a.key],0,g.KEEP,g.KEEP,g.REPLACE)}stencilConfigForOverlap(a){let g=this.context.gl,S=a.sort((B,q)=>q.overscaledZ-B.overscaledZ),I=S[S.length-1].overscaledZ,L=S[0].overscaledZ-I+1;if(L>1){this.currentStencilSource=void 0,this.nextStencilID+L>256&&this.clearStencil();let B={};for(let q=0;q<L;q++)B[q+I]=new xi({func:g.GEQUAL,mask:255},q+this.nextStencilID,255,g.KEEP,g.KEEP,g.REPLACE);return this.nextStencilID+=L,[B,S]}return[{[I]:xi.disabled},S]}colorModeForRenderPass(){let a=this.context.gl;return this._showOverdrawInspector?new Ur([a.CONSTANT_COLOR,a.ONE],new u.Color(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?Ur.unblended:Ur.alphaBlended}depthModeForSublayer(a,g,S){if(!this.opaquePassEnabledForLayer())return ei.disabled;let I=1-((1+this.currentLayer)*this.numSublayers+a)*this.depthEpsilon;return new ei(S||this.context.gl.LEQUAL,g,[I,I])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(a,g){this.style=a,this.options=g,this.lineAtlas=a.lineAtlas,this.imageManager=a.imageManager,this.glyphManager=a.glyphManager,this.symbolFadeChange=a.placement.symbolFadeChange(u.exported.now()),this.imageManager.beginFrame();let S=this.style._order,I=this.style.sourceCaches;for(let $ in I){let J=I[$];J.used&&J.prepare(this.context)}let L={},B={},q={};for(let $ in I){let J=I[$];L[$]=J.getVisibleCoordinates(),B[$]=L[$].slice().reverse(),q[$]=J.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let $=0;$<S.length;$++)if(this.style._layers[S[$]].is3D()){this.opaquePassCutoff=$;break}this.renderPass="offscreen";for(let $ of S){let J=this.style._layers[$];if(!J.hasOffscreenPass()||J.isHidden(this.transform.zoom))continue;let et=B[J.source];(J.type==="custom"||et.length)&&this.renderLayer(this,I[J.source],J,et)}for(this.context.bindFramebuffer.set(null),this.context.clear({color:g.showOverdrawInspector?u.Color.black:u.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=g.showOverdrawInspector,this.depthRangeFor3D=[0,1-(a._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=S.length-1;this.currentLayer>=0;this.currentLayer--){let $=this.style._layers[S[this.currentLayer]],J=I[$.source],et=L[$.source];this._renderTileClippingMasks($,et),this.renderLayer(this,J,$,et)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<S.length;this.currentLayer++){let $=this.style._layers[S[this.currentLayer]],J=I[$.source],et=($.type==="symbol"?q:B)[$.source];this._renderTileClippingMasks($,L[$.source]),this.renderLayer(this,J,$,et)}if(this.options.showTileBoundaries){let $,J;Object.values(this.style._layers).forEach(et=>{et.source&&!et.isHidden(this.transform.zoom)&&(et.source!==(J&&J.id)&&(J=this.style.sourceCaches[et.source]),(!$||$.getSource().maxzoom<J.getSource().maxzoom)&&($=J))}),$&&pa.debug(this,$,$.getVisibleCoordinates())}this.options.showPadding&&function($){let J=$.transform.padding;vl($,$.transform.height-(J.top||0),3,Mc),vl($,J.bottom||0,3,ju),Ja($,J.left||0,3,Ia),Ja($,$.transform.width-(J.right||0),3,Ca);let et=$.transform.centerPoint;(function(ut,vt,Ft,bt){Aa(ut,vt-1,Ft-10,2,20,bt),Aa(ut,vt-10,Ft-1,20,2,bt)})($,et.x,$.transform.height-et.y,ws)}(this),this.context.setDefault()}renderLayer(a,g,S,I){S.isHidden(this.transform.zoom)||(S.type==="background"||S.type==="custom"||I.length)&&(this.id=S.id,this.gpuTimingStart(S),pa[S.type](a,g,S,I,this.style.placement.variableOffsets),this.gpuTimingEnd())}gpuTimingStart(a){if(!this.options.gpuTiming)return;let g=this.context.extTimerQuery,S=this.gpuTimers[a.id];S||(S=this.gpuTimers[a.id]={calls:0,cpuTime:0,query:g.createQueryEXT()}),S.calls++,g.beginQueryEXT(g.TIME_ELAPSED_EXT,S.query)}gpuTimingEnd(){if(!this.options.gpuTiming)return;let a=this.context.extTimerQuery;a.endQueryEXT(a.TIME_ELAPSED_EXT)}collectGpuTimers(){let a=this.gpuTimers;return this.gpuTimers={},a}queryGpuTimers(a){let g={};for(let S in a){let I=a[S],L=this.context.extTimerQuery,B=L.getQueryObjectEXT(I.query,L.QUERY_RESULT_EXT)/1e6;L.deleteQueryEXT(I.query),g[S]=B}return g}translatePosMatrix(a,g,S,I,L){if(!S[0]&&!S[1])return a;let B=L?I==="map"?this.transform.angle:0:I==="viewport"?-this.transform.angle:0;if(B){let J=Math.sin(B),et=Math.cos(B);S=[S[0]*et-S[1]*J,S[0]*J+S[1]*et]}let q=[L?S[0]:It(g,S[0],this.transform.zoom),L?S[1]:It(g,S[1],this.transform.zoom),0],$=new Float32Array(16);return u.translate($,a,q),$}saveTileTexture(a){let g=this._tileTextures[a.size[0]];g?g.push(a):this._tileTextures[a.size[0]]=[a]}getTileTexture(a){let g=this._tileTextures[a];return g&&g.length>0?g.pop():null}isPatternMissing(a){if(!a)return!1;if(!a.from||!a.to)return!0;let g=this.imageManager.getPattern(a.from.toString()),S=this.imageManager.getPattern(a.to.toString());return!g||!S}useProgram(a,g){this.cache=this.cache||{};let S=`${a}${g?g.cacheKey:""}${this._showOverdrawInspector?"/overdraw":""}`;return this.cache[S]||(this.cache[S]=new Wn(this.context,a,sl[a],g,fo[a],this._showOverdrawInspector)),this.cache[S]}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 a=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(a.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new Lt(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}}class xl{constructor(a,g){this.points=a,this.planes=g}static fromInvProjectionMatrix(a,g,S){let I=Math.pow(2,S),L=[[-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(q=>u.transformMat4([],q,a)).map(q=>u.scale$1([],q,1/q[3]/g*I)),B=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(q=>{let $=function(vt,Ft){var bt=Ft[0],Ot=Ft[1],Kt=Ft[2],Wt=bt*bt+Ot*Ot+Kt*Kt;return Wt>0&&(Wt=1/Math.sqrt(Wt)),vt[0]=Ft[0]*Wt,vt[1]=Ft[1]*Wt,vt[2]=Ft[2]*Wt,vt}([],function(vt,Ft,bt){var Ot=Ft[0],Kt=Ft[1],Wt=Ft[2],ie=bt[0],Ht=bt[1],_e=bt[2];return vt[0]=Kt*_e-Wt*Ht,vt[1]=Wt*ie-Ot*_e,vt[2]=Ot*Ht-Kt*ie,vt}([],Vt([],L[q[0]],L[q[1]]),Vt([],L[q[2]],L[q[1]]))),J=-((et=$)[0]*(ut=L[q[1]])[0]+et[1]*ut[1]+et[2]*ut[2]);var et,ut;return $.concat(J)});return new xl(L,B)}}class bl{constructor(a,g){this.min=a,this.max=g,this.center=function(S,I,L){return S[0]=.5*I[0],S[1]=.5*I[1],S[2]=.5*I[2],S}([],function(S,I,L){return S[0]=I[0]+L[0],S[1]=I[1]+L[1],S[2]=I[2]+L[2],S}([],this.min,this.max))}quadrant(a){let g=[a%2==0,a<2],S=Tt(this.min),I=Tt(this.max);for(let L=0;L<g.length;L++)S[L]=g[L]?this.min[L]:this.center[L],I[L]=g[L]?this.center[L]:this.max[L];return I[2]=this.max[2],new bl(S,I)}distanceX(a){return Math.max(Math.min(this.max[0],a[0]),this.min[0])-a[0]}distanceY(a){return Math.max(Math.min(this.max[1],a[1]),this.min[1])-a[1]}intersects(a){let g=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],S=!0;for(let I=0;I<a.planes.length;I++){let L=a.planes[I],B=0;for(let q=0;q<g.length;q++)u.dot(L,g[q])>=0&&B++;if(B===0)return 0;B!==g.length&&(S=!1)}if(S)return 2;for(let I=0;I<3;I++){let L=Number.MAX_VALUE,B=-Number.MAX_VALUE;for(let q=0;q<a.points.length;q++){let $=a.points[q][I]-this.min[I];L=Math.min(L,$),B=Math.max(B,$)}if(B<0||L>this.max[I]-this.min[I])return 0}return 1}}class Es{constructor(a=0,g=0,S=0,I=0){if(isNaN(a)||a<0||isNaN(g)||g<0||isNaN(S)||S<0||isNaN(I)||I<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=a,this.bottom=g,this.left=S,this.right=I}interpolate(a,g,S){return g.top!=null&&a.top!=null&&(this.top=u.number(a.top,g.top,S)),g.bottom!=null&&a.bottom!=null&&(this.bottom=u.number(a.bottom,g.bottom,S)),g.left!=null&&a.left!=null&&(this.left=u.number(a.left,g.left,S)),g.right!=null&&a.right!=null&&(this.right=u.number(a.right,g.right,S)),this}getCenter(a,g){let S=u.clamp((this.left+a-this.right)/2,0,a),I=u.clamp((this.top+g-this.bottom)/2,0,g);return new u.pointGeometry(S,I)}equals(a){return this.top===a.top&&this.bottom===a.bottom&&this.left===a.left&&this.right===a.right}clone(){return new Es(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class $o{constructor(a,g,S,I,L){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=L===void 0||!!L,this._minZoom=a||0,this._maxZoom=g||22,this._minPitch=S??0,this._maxPitch=I??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new u.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Es,this._posMatrixCache={},this._alignedPosMatrixCache={}}clone(){let a=new $o(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return a.tileSize=this.tileSize,a.latRange=this.latRange,a.width=this.width,a.height=this.height,a._center=this._center,a.zoom=this.zoom,a.angle=this.angle,a._fov=this._fov,a._pitch=this._pitch,a._unmodified=this._unmodified,a._edgeInsets=this._edgeInsets.clone(),a._calcMatrices(),a}get minZoom(){return this._minZoom}set minZoom(a){this._minZoom!==a&&(this._minZoom=a,this.zoom=Math.max(this.zoom,a))}get maxZoom(){return this._maxZoom}set maxZoom(a){this._maxZoom!==a&&(this._maxZoom=a,this.zoom=Math.min(this.zoom,a))}get minPitch(){return this._minPitch}set minPitch(a){this._minPitch!==a&&(this._minPitch=a,this.pitch=Math.max(this.pitch,a))}get maxPitch(){return this._maxPitch}set maxPitch(a){this._maxPitch!==a&&(this._maxPitch=a,this.pitch=Math.min(this.pitch,a))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(a){a===void 0?a=!0:a===null&&(a=!1),this._renderWorldCopies=a}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new u.pointGeometry(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(a){let g=-u.wrap(a,-180,180)*Math.PI/180;this.angle!==g&&(this._unmodified=!1,this.angle=g,this._calcMatrices(),this.rotationMatrix=function(){var S=new u.ARRAY_TYPE(4);return u.ARRAY_TYPE!=Float32Array&&(S[1]=0,S[2]=0),S[0]=1,S[3]=1,S}(),function(S,I,L){var B=I[0],q=I[1],$=I[2],J=I[3],et=Math.sin(L),ut=Math.cos(L);S[0]=B*ut+$*et,S[1]=q*ut+J*et,S[2]=B*-et+$*ut,S[3]=q*-et+J*ut}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(a){let g=u.clamp(a,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==g&&(this._unmodified=!1,this._pitch=g,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(a){a=Math.max(.01,Math.min(60,a)),this._fov!==a&&(this._unmodified=!1,this._fov=a/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(a){let g=Math.min(Math.max(a,this.minZoom),this.maxZoom);this._zoom!==g&&(this._unmodified=!1,this._zoom=g,this.scale=this.zoomScale(g),this.tileZoom=Math.floor(g),this.zoomFraction=g-this.tileZoom,this._constrain(),this._calcMatrices())}get center(){return this._center}set center(a){a.lat===this._center.lat&&a.lng===this._center.lng||(this._unmodified=!1,this._center=a,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(a){this._edgeInsets.equals(a)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,a,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(a){return this._edgeInsets.equals(a)}interpolatePadding(a,g,S){this._unmodified=!1,this._edgeInsets.interpolate(a,g,S),this._constrain(),this._calcMatrices()}coveringZoomLevel(a){let g=(a.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/a.tileSize));return Math.max(0,g)}getVisibleUnwrappedCoordinates(a){let g=[new u.UnwrappedTileID(0,a)];if(this._renderWorldCopies){let S=this.pointCoordinate(new u.pointGeometry(0,0)),I=this.pointCoordinate(new u.pointGeometry(this.width,0)),L=this.pointCoordinate(new u.pointGeometry(this.width,this.height)),B=this.pointCoordinate(new u.pointGeometry(0,this.height)),q=Math.floor(Math.min(S.x,I.x,L.x,B.x)),$=Math.floor(Math.max(S.x,I.x,L.x,B.x)),J=1;for(let et=q-J;et<=$+J;et++)et!==0&&g.push(new u.UnwrappedTileID(et,a))}return g}coveringTiles(a){let g=this.coveringZoomLevel(a),S=g;if(a.minzoom!==void 0&&g<a.minzoom)return[];a.maxzoom!==void 0&&g>a.maxzoom&&(g=a.maxzoom);let I=u.MercatorCoordinate.fromLngLat(this.center),L=Math.pow(2,g),B=[L*I.x,L*I.y,0],q=xl.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,g),$=a.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&($=g);let J=bt=>({aabb:new bl([bt*L,0,0],[(bt+1)*L,L,0]),zoom:0,x:0,y:0,wrap:bt,fullyVisible:!1}),et=[],ut=[],vt=g,Ft=a.reparseOverscaled?S:g;if(this._renderWorldCopies)for(let bt=1;bt<=3;bt++)et.push(J(-bt)),et.push(J(bt));for(et.push(J(0));et.length>0;){let bt=et.pop(),Ot=bt.x,Kt=bt.y,Wt=bt.fullyVisible;if(!Wt){let de=bt.aabb.intersects(q);if(de===0)continue;Wt=de===2}let ie=bt.aabb.distanceX(B),Ht=bt.aabb.distanceY(B),_e=Math.max(Math.abs(ie),Math.abs(Ht)),he=3+(1<<vt-bt.zoom)-2;if(bt.zoom===vt||_e>he&&bt.zoom>=$)ut.push({tileID:new u.OverscaledTileID(bt.zoom===vt?Ft:bt.zoom,bt.wrap,bt.zoom,Ot,Kt),distanceSq:wt([B[0]-.5-Ot,B[1]-.5-Kt])});else for(let de=0;de<4;de++){let Pe=(Ot<<1)+de%2,Re=(Kt<<1)+(de>>1);et.push({aabb:bt.aabb.quadrant(de),zoom:bt.zoom+1,x:Pe,y:Re,wrap:bt.wrap,fullyVisible:Wt})}}return ut.sort((bt,Ot)=>bt.distanceSq-Ot.distanceSq).map(bt=>bt.tileID)}resize(a,g){this.width=a,this.height=g,this.pixelsToGLUnits=[2/a,-2/g],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(a){return Math.pow(2,a)}scaleZoom(a){return Math.log(a)/Math.LN2}project(a){let g=u.clamp(a.lat,-this.maxValidLatitude,this.maxValidLatitude);return new u.pointGeometry(u.mercatorXfromLng(a.lng)*this.worldSize,u.mercatorYfromLat(g)*this.worldSize)}unproject(a){return new u.MercatorCoordinate(a.x/this.worldSize,a.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}setLocationAtPoint(a,g){let S=this.pointCoordinate(g),I=this.pointCoordinate(this.centerPoint),L=this.locationCoordinate(a),B=new u.MercatorCoordinate(L.x-(S.x-I.x),L.y-(S.y-I.y));this.center=this.coordinateLocation(B),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(a){return this.coordinatePoint(this.locationCoordinate(a))}pointLocation(a){return this.coordinateLocation(this.pointCoordinate(a))}locationCoordinate(a){return u.MercatorCoordinate.fromLngLat(a)}coordinateLocation(a){return a.toLngLat()}pointCoordinate(a){let g=[a.x,a.y,0,1],S=[a.x,a.y,1,1];u.transformMat4(g,g,this.pixelMatrixInverse),u.transformMat4(S,S,this.pixelMatrixInverse);let I=g[3],L=S[3],B=g[1]/I,q=S[1]/L,$=g[2]/I,J=S[2]/L,et=$===J?0:(0-$)/(J-$);return new u.MercatorCoordinate(u.number(g[0]/I,S[0]/L,et)/this.worldSize,u.number(B,q,et)/this.worldSize)}coordinatePoint(a){let g=[a.x*this.worldSize,a.y*this.worldSize,0,1];return u.transformMat4(g,g,this.pixelMatrix),new u.pointGeometry(g[0]/g[3],g[1]/g[3])}getBounds(){return new u.LngLatBounds().extend(this.pointLocation(new u.pointGeometry(0,0))).extend(this.pointLocation(new u.pointGeometry(this.width,0))).extend(this.pointLocation(new u.pointGeometry(this.width,this.height))).extend(this.pointLocation(new u.pointGeometry(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new u.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}setMaxBounds(a){a?(this.lngRange=[a.getWest(),a.getEast()],this.latRange=[a.getSouth(),a.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(a,g=!1){let S=a.key,I=g?this._alignedPosMatrixCache:this._posMatrixCache;if(I[S])return I[S];let L=a.canonical,B=this.worldSize/this.zoomScale(L.z),q=L.x+Math.pow(2,L.z)*a.wrap,$=u.identity(new Float64Array(16));return u.translate($,$,[q*B,L.y*B,0]),u.scale($,$,[B/u.EXTENT,B/u.EXTENT,1]),u.multiply($,g?this.alignedProjMatrix:this.projMatrix,$),I[S]=new Float32Array($),I[S]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let a,g,S,I,L=-90,B=90,q=-180,$=180,J=this.size,et=this._unmodified;if(this.latRange){let Ft=this.latRange;L=u.mercatorYfromLat(Ft[1])*this.worldSize,B=u.mercatorYfromLat(Ft[0])*this.worldSize,a=B-L<J.y?J.y/(B-L):0}if(this.lngRange){let Ft=this.lngRange;q=u.mercatorXfromLng(Ft[0])*this.worldSize,$=u.mercatorXfromLng(Ft[1])*this.worldSize,g=$-q<J.x?J.x/($-q):0}let ut=this.point,vt=Math.max(g||0,a||0);if(vt)return this.center=this.unproject(new u.pointGeometry(g?($+q)/2:ut.x,a?(B+L)/2:ut.y)),this.zoom+=this.scaleZoom(vt),this._unmodified=et,void(this._constraining=!1);if(this.latRange){let Ft=ut.y,bt=J.y/2;Ft-bt<L&&(I=L+bt),Ft+bt>B&&(I=B-bt)}if(this.lngRange){let Ft=ut.x,bt=J.x/2;Ft-bt<q&&(S=q+bt),Ft+bt>$&&(S=$-bt)}S===void 0&&I===void 0||(this.center=this.unproject(new u.pointGeometry(S!==void 0?S:ut.x,I!==void 0?I:ut.y))),this._unmodified=et,this._constraining=!1}_calcMatrices(){if(!this.height)return;let a=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;let g=Math.PI/2+this._pitch,S=this._fov*(.5+a.y/this.height),I=Math.sin(S)*this.cameraToCenterDistance/Math.sin(u.clamp(Math.PI-g-S,.01,Math.PI-.01)),L=this.point,B=L.x,q=L.y,$=1.01*(Math.cos(Math.PI/2-this._pitch)*I+this.cameraToCenterDistance),J=this.height/50,et=new Float64Array(16);u.perspective(et,this._fov,this.width/this.height,J,$),et[8]=2*-a.x/this.width,et[9]=2*a.y/this.height,u.scale(et,et,[1,-1,1]),u.translate(et,et,[0,0,-this.cameraToCenterDistance]),u.rotateX(et,et,this._pitch),u.rotateZ(et,et,this.angle),u.translate(et,et,[-B,-q,0]),this.mercatorMatrix=u.scale([],et,[this.worldSize,this.worldSize,this.worldSize]),u.scale(et,et,[1,1,u.mercatorZfromAltitude(1,this.center.lat)*this.worldSize]),this.projMatrix=et,this.invProjMatrix=u.invert([],this.projMatrix);let ut=this.width%2/2,vt=this.height%2/2,Ft=Math.cos(this.angle),bt=Math.sin(this.angle),Ot=B-Math.round(B)+Ft*ut+bt*vt,Kt=q-Math.round(q)+Ft*vt+bt*ut,Wt=new Float64Array(et);if(u.translate(Wt,Wt,[Ot>.5?Ot-1:Ot,Kt>.5?Kt-1:Kt,0]),this.alignedProjMatrix=Wt,et=u.create(),u.scale(et,et,[this.width/2,-this.height/2,1]),u.translate(et,et,[1,-1,0]),this.labelPlaneMatrix=et,et=u.create(),u.scale(et,et,[1,-1,1]),u.translate(et,et,[-1,-1,0]),u.scale(et,et,[2/this.width,2/this.height,1]),this.glCoordMatrix=et,this.pixelMatrix=u.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),et=u.invert(new Float64Array(16),this.pixelMatrix),!et)throw new Error("failed to invert matrix");this.pixelMatrixInverse=et,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let a=this.pointCoordinate(new u.pointGeometry(0,0)),g=[a.x*this.worldSize,a.y*this.worldSize,0,1];return u.transformMat4(g,g,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let a=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new u.pointGeometry(0,a))}getCameraQueryGeometry(a){let g=this.getCameraPoint();if(a.length===1)return[a[0],g];{let S=g.x,I=g.y,L=g.x,B=g.y;for(let q of a)S=Math.min(S,q.x),I=Math.min(I,q.y),L=Math.max(L,q.x),B=Math.max(B,q.y);return[new u.pointGeometry(S,I),new u.pointGeometry(L,I),new u.pointGeometry(L,B),new u.pointGeometry(S,B),new u.pointGeometry(S,I)]}}}class Vs{constructor(a){this._hashName=a&&encodeURIComponent(a),u.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(g,S){let I=!1,L=null,B=()=>{L=null,I&&(g(),L=setTimeout(B,300),I=!1)};return()=>(I=!0,L||B(),L)}(this._updateHashUnthrottled.bind(this))}addTo(a){return this._map=a,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()),delete this._map,this}getHashString(a){let g=this._map.getCenter(),S=Math.round(100*this._map.getZoom())/100,I=Math.ceil((S*Math.LN2+Math.log(512/360/.5))/Math.LN10),L=Math.pow(10,I),B=Math.round(g.lng*L)/L,q=Math.round(g.lat*L)/L,$=this._map.getBearing(),J=this._map.getPitch(),et="";if(et+=a?`/${B}/${q}/${S}`:`${S}/${q}/${B}`,($||J)&&(et+="/"+Math.round(10*$)/10),J&&(et+=`/${Math.round(J)}`),this._hashName){let ut=this._hashName,vt=!1,Ft=window.location.hash.slice(1).split("&").map(bt=>{let Ot=bt.split("=")[0];return Ot===ut?(vt=!0,`${Ot}=${et}`):bt}).filter(bt=>bt);return vt||Ft.push(`${ut}=${et}`),`#${Ft.join("&")}`}return`#${et}`}_getCurrentHash(){let a=window.location.hash.replace("#","");if(this._hashName){let g;return a.split("&").map(S=>S.split("=")).forEach(S=>{S[0]===this._hashName&&(g=S)}),(g&&g[1]||"").split("/")}return a.split("/")}_onHashChange(){let a=this._getCurrentHash();if(a.length>=3&&!a.some(g=>isNaN(g))){let g=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(a[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+a[2],+a[1]],zoom:+a[0],bearing:g,pitch:+(a[4]||0)}),!0}return!1}_updateHashUnthrottled(){let a=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,a)}catch{}}}let Qa={linearity:.3,easing:u.bezier(0,0,.3,1)},nu=u.extend({deceleration:2500,maxSpeed:1400},Qa),wl=u.extend({deceleration:20,maxSpeed:1400},Qa),Lc=u.extend({deceleration:1e3,maxSpeed:360},Qa),Pa=u.extend({deceleration:1e3,maxSpeed:90},Qa);class ou{constructor(a){this._map=a,this.clear()}clear(){this._inertiaBuffer=[]}record(a){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:u.exported.now(),settings:a})}_drainInertiaBuffer(){let a=this._inertiaBuffer,g=u.exported.now();for(;a.length>0&&g-a[0].time>160;)a.shift()}_onMoveEnd(a){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let g={zoom:0,bearing:0,pitch:0,pan:new u.pointGeometry(0,0),pinchAround:void 0,around:void 0};for(let{settings:L}of this._inertiaBuffer)g.zoom+=L.zoomDelta||0,g.bearing+=L.bearingDelta||0,g.pitch+=L.pitchDelta||0,L.panDelta&&g.pan._add(L.panDelta),L.around&&(g.around=L.around),L.pinchAround&&(g.pinchAround=L.pinchAround);let S=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,I={};if(g.pan.mag()){let L=js(g.pan.mag(),S,u.extend({},nu,a||{}));I.offset=g.pan.mult(L.amount/g.pan.mag()),I.center=this._map.transform.center,Gs(I,L)}if(g.zoom){let L=js(g.zoom,S,wl);I.zoom=this._map.transform.zoom+L.amount,Gs(I,L)}if(g.bearing){let L=js(g.bearing,S,Lc);I.bearing=this._map.transform.bearing+u.clamp(L.amount,-179,179),Gs(I,L)}if(g.pitch){let L=js(g.pitch,S,Pa);I.pitch=this._map.transform.pitch+L.amount,Gs(I,L)}if(I.zoom||I.bearing){let L=g.pinchAround===void 0?g.around:g.pinchAround;I.around=L?this._map.unproject(L):this._map.getCenter()}return this.clear(),u.extend(I,{noMoveStart:!0})}}function Gs(T,a){(!T.duration||T.duration<a.duration)&&(T.duration=a.duration,T.easing=a.easing)}function js(T,a,g){let{maxSpeed:S,linearity:I,deceleration:L}=g,B=u.clamp(T*I/(a/1e3),-S,S),q=Math.abs(B)/(L*I);return{easing:g.easing,duration:1e3*q,amount:B*(q/2)}}class Kn extends u.Event{constructor(a,g,S,I={}){let L=N.mousePos(g.getCanvasContainer(),S),B=g.unproject(L);super(a,u.extend({point:L,lngLat:B,originalEvent:S},I)),this._defaultPrevented=!1,this.target=g}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class Yn extends u.Event{constructor(a,g,S){let I=a==="touchend"?S.changedTouches:S.touches,L=N.touchPos(g.getCanvasContainer(),I),B=L.map($=>g.unproject($)),q=L.reduce(($,J,et,ut)=>$.add(J.div(ut.length)),new u.pointGeometry(0,0));super(a,{points:L,point:q,lngLats:B,lngLat:g.unproject(q),originalEvent:S}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class Zu extends u.Event{constructor(a,g,S){super(a,{originalEvent:S}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class Ma{constructor(a,g){this._map=a,this._clickTolerance=g.clickTolerance}reset(){delete this._mousedownPos}wheel(a){return this._firePreventable(new Zu(a.type,this._map,a))}mousedown(a,g){return this._mousedownPos=g,this._firePreventable(new Kn(a.type,this._map,a))}mouseup(a){this._map.fire(new Kn(a.type,this._map,a))}click(a,g){this._mousedownPos&&this._mousedownPos.dist(g)>=this._clickTolerance||this._map.fire(new Kn(a.type,this._map,a))}dblclick(a){return this._firePreventable(new Kn(a.type,this._map,a))}mouseover(a){this._map.fire(new Kn(a.type,this._map,a))}mouseout(a){this._map.fire(new Kn(a.type,this._map,a))}touchstart(a){return this._firePreventable(new Yn(a.type,this._map,a))}touchmove(a){this._map.fire(new Yn(a.type,this._map,a))}touchend(a){this._map.fire(new Yn(a.type,this._map,a))}touchcancel(a){this._map.fire(new Yn(a.type,this._map,a))}_firePreventable(a){if(this._map.fire(a),a.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class qs{constructor(a){this._map=a}reset(){this._delayContextMenu=!1,delete this._contextMenuEvent}mousemove(a){this._map.fire(new Kn(a.type,this._map,a))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Kn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(a){this._delayContextMenu?this._contextMenuEvent=a:this._map.fire(new Kn(a.type,this._map,a)),this._map.listens("contextmenu")&&a.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ss{constructor(a,g){this._map=a,this._el=a.getCanvasContainer(),this._container=a.getContainer(),this._clickTolerance=g.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(a,g){this.isEnabled()&&a.shiftKey&&a.button===0&&(N.disableDrag(),this._startPos=this._lastPos=g,this._active=!0)}mousemoveWindow(a,g){if(!this._active)return;let S=g;if(this._lastPos.equals(S)||!this._box&&S.dist(this._startPos)<this._clickTolerance)return;let I=this._startPos;this._lastPos=S,this._box||(this._box=N.create("div","maplibregl-boxzoom mapboxgl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair","mapboxgl-crosshair"),this._fireEvent("boxzoomstart",a));let L=Math.min(I.x,S.x),B=Math.max(I.x,S.x),q=Math.min(I.y,S.y),$=Math.max(I.y,S.y);N.setTransform(this._box,`translate(${L}px,${q}px)`),this._box.style.width=B-L+"px",this._box.style.height=$-q+"px"}mouseupWindow(a,g){if(!this._active||a.button!==0)return;let S=this._startPos,I=g;if(this.reset(),N.suppressClick(),S.x!==I.x||S.y!==I.y)return this._map.fire(new u.Event("boxzoomend",{originalEvent:a})),{cameraAnimation:L=>L.fitScreenCoordinates(S,I,this._map.getBearing(),{linear:!0})};this._fireEvent("boxzoomcancel",a)}keydown(a){this._active&&a.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",a))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair","mapboxgl-crosshair"),this._box&&(N.remove(this._box),this._box=null),N.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(a,g){return this._map.fire(new u.Event(a,{originalEvent:g}))}}function zo(T,a){let g={};for(let S=0;S<T.length;S++)g[T[S].identifier]=a[S];return g}class Pi{constructor(a){this.reset(),this.numTouches=a.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(a,g,S){(this.centroid||S.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=a.timeStamp),S.length===this.numTouches&&(this.centroid=function(I){let L=new u.pointGeometry(0,0);for(let B of I)L._add(B);return L.div(I.length)}(g),this.touches=zo(S,g)))}touchmove(a,g,S){if(this.aborted||!this.centroid)return;let I=zo(S,g);for(let L in this.touches){let B=this.touches[L],q=I[L];(!q||q.dist(B)>30)&&(this.aborted=!0)}}touchend(a,g,S){if((!this.centroid||a.timeStamp-this.startTime>500)&&(this.aborted=!0),S.length===0){let I=!this.aborted&&this.centroid;if(this.reset(),I)return I}}}class Zs{constructor(a){this.singleTap=new Pi(a),this.numTaps=a.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(a,g,S){this.singleTap.touchstart(a,g,S)}touchmove(a,g,S){this.singleTap.touchmove(a,g,S)}touchend(a,g,S){let I=this.singleTap.touchend(a,g,S);if(I){let L=a.timeStamp-this.lastTime<500,B=!this.lastTap||this.lastTap.dist(I)<30;if(L&&B||this.reset(),this.count++,this.lastTime=a.timeStamp,this.lastTap=I,this.count===this.numTaps)return this.reset(),I}}}class Ts{constructor(){this._zoomIn=new Zs({numTouches:1,numTaps:2}),this._zoomOut=new Zs({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(a,g,S){this._zoomIn.touchstart(a,g,S),this._zoomOut.touchstart(a,g,S)}touchmove(a,g,S){this._zoomIn.touchmove(a,g,S),this._zoomOut.touchmove(a,g,S)}touchend(a,g,S){let I=this._zoomIn.touchend(a,g,S),L=this._zoomOut.touchend(a,g,S);return I?(this._active=!0,a.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:B=>B.easeTo({duration:300,zoom:B.getZoom()+1,around:B.unproject(I)},{originalEvent:a})}):L?(this._active=!0,a.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:B=>B.easeTo({duration:300,zoom:B.getZoom()-1,around:B.unproject(L)},{originalEvent:a})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}let La={0:1,2:2};class Gr{constructor(a){this.reset(),this._clickTolerance=a.clickTolerance||1}reset(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton}_correctButton(a,g){return!1}_move(a,g){return{}}mousedown(a,g){if(this._lastPoint)return;let S=N.mouseButton(a);this._correctButton(a,S)&&(this._lastPoint=g,this._eventButton=S)}mousemoveWindow(a,g){let S=this._lastPoint;if(S){if(a.preventDefault(),function(I,L){let B=La[L];return I.buttons===void 0||(I.buttons&B)!==B}(a,this._eventButton))this.reset();else if(this._moved||!(g.dist(S)<this._clickTolerance))return this._moved=!0,this._lastPoint=g,this._move(S,g)}}mouseupWindow(a){this._lastPoint&&N.mouseButton(a)===this._eventButton&&(this._moved&&N.suppressClick(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class pi extends Gr{mousedown(a,g){super.mousedown(a,g),this._lastPoint&&(this._active=!0)}_correctButton(a,g){return g===0&&!a.ctrlKey}_move(a,g){return{around:g,panDelta:g.sub(a)}}}class We extends Gr{_correctButton(a,g){return g===0&&a.ctrlKey||g===2}_move(a,g){let S=.8*(g.x-a.x);if(S)return this._active=!0,{bearingDelta:S}}contextmenu(a){a.preventDefault()}}class Is extends Gr{_correctButton(a,g){return g===0&&a.ctrlKey||g===2}_move(a,g){let S=-.5*(g.y-a.y);if(S)return this._active=!0,{pitchDelta:S}}contextmenu(a){a.preventDefault()}}class fa{constructor(a){this._minTouches=1,this._clickTolerance=a.clickTolerance||1,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new u.pointGeometry(0,0)}touchstart(a,g,S){return this._calculateTransform(a,g,S)}touchmove(a,g,S){if(this._active&&!(S.length<this._minTouches))return a.preventDefault(),this._calculateTransform(a,g,S)}touchend(a,g,S){this._calculateTransform(a,g,S),this._active&&S.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(a,g,S){S.length>0&&(this._active=!0);let I=zo(S,g),L=new u.pointGeometry(0,0),B=new u.pointGeometry(0,0),q=0;for(let J in I){let et=I[J],ut=this._touches[J];ut&&(L._add(et),B._add(et.sub(ut)),q++,I[J]=et)}if(this._touches=I,q<this._minTouches||!B.mag())return;let $=B.div(q);return this._sum._add($),this._sum.mag()<this._clickTolerance?void 0:{around:L.div(q),panDelta:$}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ko{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}_start(a){}_move(a,g,S){return{}}touchstart(a,g,S){this._firstTwoTouches||S.length<2||(this._firstTwoTouches=[S[0].identifier,S[1].identifier],this._start([g[0],g[1]]))}touchmove(a,g,S){if(!this._firstTwoTouches)return;a.preventDefault();let[I,L]=this._firstTwoTouches,B=El(S,g,I),q=El(S,g,L);if(!B||!q)return;let $=this._aroundCenter?null:B.add(q).div(2);return this._move([B,q],$,a)}touchend(a,g,S){if(!this._firstTwoTouches)return;let[I,L]=this._firstTwoTouches,B=El(S,g,I),q=El(S,g,L);B&&q||(this._active&&N.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(a){this._enabled=!0,this._aroundCenter=!!a&&a.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function El(T,a,g){for(let S=0;S<T.length;S++)if(T[S].identifier===g)return a[S]}function Je(T,a){return Math.log(T/a)/Math.LN2}class Cs extends Ko{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(a){this._startDistance=this._distance=a[0].dist(a[1])}_move(a,g){let S=this._distance;if(this._distance=a[0].dist(a[1]),this._active||!(Math.abs(Je(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Je(this._distance,S),pinchAround:g}}}function Xs(T,a){return 180*T.angleWith(a)/Math.PI}class ka extends Ko{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(a){this._startVector=this._vector=a[0].sub(a[1]),this._minDiameter=a[0].dist(a[1])}_move(a,g){let S=this._vector;if(this._vector=a[0].sub(a[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Xs(this._vector,S),pinchAround:g}}_isBelowThreshold(a){this._minDiameter=Math.min(this._minDiameter,a.mag());let g=25/(Math.PI*this._minDiameter)*360,S=Xs(a,this._startVector);return Math.abs(S)<g}}function Oi(T){return Math.abs(T.y)>Math.abs(T.x)}class Ws extends Ko{reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}_start(a){this._lastPoints=a,Oi(a[0].sub(a[1]))&&(this._valid=!1)}_move(a,g,S){let I=a[0].sub(this._lastPoints[0]),L=a[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(I,L,S.timeStamp),this._valid)return this._lastPoints=a,this._active=!0,{pitchDelta:(I.y+L.y)/2*-.5}}gestureBeginsVertically(a,g,S){if(this._valid!==void 0)return this._valid;let I=a.mag()>=2,L=g.mag()>=2;if(!I&&!L)return;if(!I||!L)return this._firstMove===void 0&&(this._firstMove=S),S-this._firstMove<100&&void 0;let B=a.y>0==g.y>0;return Oi(a)&&Oi(g)&&B}}let Xu={panStep:100,bearingStep:15,pitchStep:10};class nn{constructor(){let a=Xu;this._panStep=a.panStep,this._bearingStep=a.bearingStep,this._pitchStep=a.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(a){if(a.altKey||a.ctrlKey||a.metaKey)return;let g=0,S=0,I=0,L=0,B=0;switch(a.keyCode){case 61:case 107:case 171:case 187:g=1;break;case 189:case 109:case 173:g=-1;break;case 37:a.shiftKey?S=-1:(a.preventDefault(),L=-1);break;case 39:a.shiftKey?S=1:(a.preventDefault(),L=1);break;case 38:a.shiftKey?I=1:(a.preventDefault(),B=-1);break;case 40:a.shiftKey?I=-1:(a.preventDefault(),B=1);break;default:return}return this._rotationDisabled&&(S=0,I=0),{cameraAnimation:q=>{let $=q.getZoom();q.easeTo({duration:300,easeId:"keyboardHandler",easing:tr,zoom:g?Math.round($)+g*(a.shiftKey?2:1):$,bearing:q.getBearing()+S*this._bearingStep,pitch:q.getPitch()+I*this._pitchStep,offset:[-L*this._panStep,-B*this._panStep],center:q.getCenter()},{originalEvent:a})}}}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 tr(T){return T*(2-T)}let Vn=4.000244140625;class $s{constructor(a,g){this._map=a,this._el=a.getCanvasContainer(),this._handler=g,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,u.bindAll(["_onTimeout"],this)}setZoomRate(a){this._defaultZoomRate=a}setWheelZoomRate(a){this._wheelZoomRate=a}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(a){this.isEnabled()||(this._enabled=!0,this._aroundCenter=a&&a.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(a){if(!this.isEnabled())return;let g=a.deltaMode===WheelEvent.DOM_DELTA_LINE?40*a.deltaY:a.deltaY,S=u.exported.now(),I=S-(this._lastWheelEventTime||0);this._lastWheelEventTime=S,g!==0&&g%Vn==0?this._type="wheel":g!==0&&Math.abs(g)<4?this._type="trackpad":I>400?(this._type=null,this._lastValue=g,this._timeout=setTimeout(this._onTimeout,40,a)):this._type||(this._type=Math.abs(I*g)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,g+=this._lastValue)),a.shiftKey&&g&&(g/=4),this._type&&(this._lastWheelEvent=a,this._delta-=g,this._active||this._start(a)),a.preventDefault()}_onTimeout(a){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(a)}_start(a){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 g=N.mousePos(this._el,a);this._around=u.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(g)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let a=this._map.transform;if(this._delta!==0){let q=this._type==="wheel"&&Math.abs(this._delta)>Vn?this._wheelZoomRate:this._defaultZoomRate,$=2/(1+Math.exp(-Math.abs(this._delta*q)));this._delta<0&&$!==0&&($=1/$);let J=typeof this._targetZoom=="number"?a.zoomScale(this._targetZoom):a.scale;this._targetZoom=Math.min(a.maxZoom,Math.max(a.minZoom,a.scaleZoom(J*$))),this._type==="wheel"&&(this._startZoom=a.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let g=typeof this._targetZoom=="number"?this._targetZoom:a.zoom,S=this._startZoom,I=this._easing,L,B=!1;if(this._type==="wheel"&&S&&I){let q=Math.min((u.exported.now()-this._lastWheelEventTime)/200,1),$=I(q);L=u.number(S,g,$),q<1?this._frameId||(this._frameId=!0):B=!0}else L=g,B=!0;return this._active=!0,B&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!B,zoomDelta:L-a.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(a){let g=u.ease;if(this._prevEase){let S=this._prevEase,I=(u.exported.now()-S.start)/S.duration,L=S.easing(I+.01)-S.easing(I),B=.27/Math.sqrt(L*L+1e-4)*.01,q=Math.sqrt(.0729-B*B);g=u.bezier(B,q,.25,1)}return this._prevEase={start:u.exported.now(),duration:a,easing:g},g}reset(){this._active=!1}}class ts{constructor(a,g){this._clickZoom=a,this._tapZoom=g}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 Ro{constructor(){this.reset()}reset(){this._active=!1}dblclick(a,g){return a.preventDefault(),{cameraAnimation:S=>{S.easeTo({duration:300,zoom:S.getZoom()+(a.shiftKey?-1:1),around:S.unproject(g)},{originalEvent:a})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Mi{constructor(){this._tap=new Zs({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(a,g,S){this._swipePoint||(this._tapTime&&a.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?S.length>0&&(this._swipePoint=g[0],this._swipeTouch=S[0].identifier):this._tap.touchstart(a,g,S))}touchmove(a,g,S){if(this._tapTime){if(this._swipePoint){if(S[0].identifier!==this._swipeTouch)return;let I=g[0],L=I.y-this._swipePoint.y;return this._swipePoint=I,a.preventDefault(),this._active=!0,{zoomDelta:L/128}}}else this._tap.touchmove(a,g,S)}touchend(a,g,S){this._tapTime?this._swipePoint&&S.length===0&&this.reset():this._tap.touchend(a,g,S)&&(this._tapTime=a.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class da{constructor(a,g,S){this._el=a,this._mousePan=g,this._touchPan=S}enable(a){this._inertiaOptions=a||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Ne{constructor(a,g,S){this._pitchWithRotate=a.pitchWithRotate,this._mouseRotate=g,this._mousePitch=S}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Sl{constructor(a,g,S,I){this._el=a,this._touchZoom=g,this._touchRotate=S,this._tapDragZoom=I,this._rotationDisabled=!1,this._enabled=!0}enable(a){this._touchZoom.enable(a),this._rotationDisabled||this._touchRotate.enable(a),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate","mapboxgl-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()}}let za=T=>T.zoom||T.drag||T.pitch||T.rotate;class Tl extends u.Event{}function ao(T){return T.panDelta&&T.panDelta.mag()||T.zoomDelta||T.bearingDelta||T.pitchDelta}class Fi{constructor(a,g){this._map=a,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ou(a),this._bearingSnap=g.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(g),u.bindAll(["handleEvent","handleWindowEvent"],this);let S=this._el;this._listeners=[[S,"touchstart",{passive:!0}],[S,"touchmove",{passive:!1}],[S,"touchend",void 0],[S,"touchcancel",void 0],[S,"mousedown",void 0],[S,"mousemove",void 0],[S,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[S,"mouseover",void 0],[S,"mouseout",void 0],[S,"dblclick",void 0],[S,"click",void 0],[S,"keydown",{capture:!1}],[S,"keyup",void 0],[S,"wheel",{passive:!1}],[S,"contextmenu",void 0],[window,"blur",void 0]];for(let[I,L,B]of this._listeners)N.addEventListener(I,L,I===document?this.handleWindowEvent:this.handleEvent,B)}destroy(){for(let[a,g,S]of this._listeners)N.removeEventListener(a,g,a===document?this.handleWindowEvent:this.handleEvent,S)}_addDefaultHandlers(a){let g=this._map,S=g.getCanvasContainer();this._add("mapEvent",new Ma(g,a));let I=g.boxZoom=new Ss(g,a);this._add("boxZoom",I);let L=new Ts,B=new Ro;g.doubleClickZoom=new ts(B,L),this._add("tapZoom",L),this._add("clickZoom",B);let q=new Mi;this._add("tapDragZoom",q);let $=g.touchPitch=new Ws;this._add("touchPitch",$);let J=new We(a),et=new Is(a);g.dragRotate=new Ne(a,J,et),this._add("mouseRotate",J,["mousePitch"]),this._add("mousePitch",et,["mouseRotate"]);let ut=new pi(a),vt=new fa(a);g.dragPan=new da(S,ut,vt),this._add("mousePan",ut),this._add("touchPan",vt,["touchZoom","touchRotate"]);let Ft=new ka,bt=new Cs;g.touchZoomRotate=new Sl(S,bt,Ft,q),this._add("touchRotate",Ft,["touchPan","touchZoom"]),this._add("touchZoom",bt,["touchPan","touchRotate"]);let Ot=g.scrollZoom=new $s(g,this);this._add("scrollZoom",Ot,["mousePan"]);let Kt=g.keyboard=new nn;this._add("keyboard",Kt),this._add("blockableMapEvent",new qs(g));for(let Wt of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])a.interactive&&a[Wt]&&g[Wt].enable(a[Wt])}_add(a,g,S){this._handlers.push({handlerName:a,handler:g,allowed:S}),this._handlersById[a]=g}stop(a){if(!this._updatingCamera){for(let{handler:g}of this._handlers)g.reset();this._inertia.clear(),this._fireEvents({},{},a),this._changes=[]}}isActive(){for(let{handler:a}of this._handlers)if(a.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(za(this._eventsInProgress))||this.isZooming()}_blockedByActive(a,g,S){for(let I in a)if(I!==S&&(!g||g.indexOf(I)<0))return!0;return!1}handleWindowEvent(a){this.handleEvent(a,`${a.type}Window`)}_getMapTouches(a){let g=[];for(let S of a)this._el.contains(S.target)&&g.push(S);return g}handleEvent(a,g){if(a.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let S=a.type==="renderFrame"?void 0:a,I={needsRenderFrame:!1},L={},B={},q=a.touches,$=q?this._getMapTouches(q):void 0,J=$?N.touchPos(this._el,$):N.mousePos(this._el,a);for(let{handlerName:vt,handler:Ft,allowed:bt}of this._handlers){if(!Ft.isEnabled())continue;let Ot;this._blockedByActive(B,bt,vt)?Ft.reset():Ft[g||a.type]&&(Ot=Ft[g||a.type](a,J,$),this.mergeHandlerResult(I,L,Ot,vt,S),Ot&&Ot.needsRenderFrame&&this._triggerRenderFrame()),(Ot||Ft.isActive())&&(B[vt]=Ft)}let et={};for(let vt in this._previousActiveHandlers)B[vt]||(et[vt]=S);this._previousActiveHandlers=B,(Object.keys(et).length||ao(I))&&(this._changes.push([I,L,et]),this._triggerRenderFrame()),(Object.keys(B).length||ao(I))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:ut}=I;ut&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],ut(this._map))}mergeHandlerResult(a,g,S,I,L){if(!S)return;u.extend(a,S);let B={handlerName:I,originalEvent:S.originalEvent||L};S.zoomDelta!==void 0&&(g.zoom=B),S.panDelta!==void 0&&(g.drag=B),S.pitchDelta!==void 0&&(g.pitch=B),S.bearingDelta!==void 0&&(g.rotate=B)}_applyChanges(){let a={},g={},S={};for(let[I,L,B]of this._changes)I.panDelta&&(a.panDelta=(a.panDelta||new u.pointGeometry(0,0))._add(I.panDelta)),I.zoomDelta&&(a.zoomDelta=(a.zoomDelta||0)+I.zoomDelta),I.bearingDelta&&(a.bearingDelta=(a.bearingDelta||0)+I.bearingDelta),I.pitchDelta&&(a.pitchDelta=(a.pitchDelta||0)+I.pitchDelta),I.around!==void 0&&(a.around=I.around),I.pinchAround!==void 0&&(a.pinchAround=I.pinchAround),I.noInertia&&(a.noInertia=I.noInertia),u.extend(g,L),u.extend(S,B);this._updateMapTransform(a,g,S),this._changes=[]}_updateMapTransform(a,g,S){let I=this._map,L=I.transform;if(!ao(a))return this._fireEvents(g,S,!0);let{panDelta:B,zoomDelta:q,bearingDelta:$,pitchDelta:J,around:et,pinchAround:ut}=a;ut!==void 0&&(et=ut),I._stop(!0),et=et||I.transform.centerPoint;let vt=L.pointLocation(B?et.sub(B):et);$&&(L.bearing+=$),J&&(L.pitch+=J),q&&(L.zoom+=q),L.setLocationAtPoint(vt,et),this._map._update(),a.noInertia||this._inertia.record(a),this._fireEvents(g,S,!0)}_fireEvents(a,g,S){let I=za(this._eventsInProgress),L=za(a),B={};for(let et in a){let{originalEvent:ut}=a[et];this._eventsInProgress[et]||(B[`${et}start`]=ut),this._eventsInProgress[et]=a[et]}!I&&L&&this._fireEvent("movestart",L.originalEvent);for(let et in B)this._fireEvent(et,B[et]);L&&this._fireEvent("move",L.originalEvent);for(let et in a){let{originalEvent:ut}=a[et];this._fireEvent(et,ut)}let q={},$;for(let et in this._eventsInProgress){let{handlerName:ut,originalEvent:vt}=this._eventsInProgress[et];this._handlersById[ut].isActive()||(delete this._eventsInProgress[et],$=g[ut]||vt,q[`${et}end`]=$)}for(let et in q)this._fireEvent(et,q[et]);let J=za(this._eventsInProgress);if(S&&(I||L)&&!J){this._updatingCamera=!0;let et=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),ut=vt=>vt!==0&&-this._bearingSnap<vt&&vt<this._bearingSnap;et?(ut(et.bearing||this._map.getBearing())&&(et.bearing=0),this._map.easeTo(et,{originalEvent:$})):(this._map.fire(new u.Event("moveend",{originalEvent:$})),ut(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(a,g){this._map.fire(new u.Event(a,g?{originalEvent:g}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(a=>{delete this._frameId,this.handleEvent(new Tl("renderFrame",{timeStamp:a})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}let Ii={extend:(T,...a)=>u.extend(T,...a),run(T){T()},logToElement(T,a=!1,g="log"){let S=window.document.getElementById(g);S&&(a&&(S.innerHTML=""),S.innerHTML+=`<br>${T}`)}};class As extends u.Evented{constructor(a,g){super(),this._moving=!1,this._zooming=!1,this.transform=a,this._bearingSnap=g.bearingSnap,u.bindAll(["_renderFrameCallback"],this)}getCenter(){return new u.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(a,g){return this.jumpTo({center:a},g)}panBy(a,g,S){return a=u.pointGeometry.convert(a).mult(-1),this.panTo(this.transform.center,u.extend({offset:a},g),S)}panTo(a,g,S){return this.easeTo(u.extend({center:a},g),S)}getZoom(){return this.transform.zoom}setZoom(a,g){return this.jumpTo({zoom:a},g),this}zoomTo(a,g,S){return this.easeTo(u.extend({zoom:a},g),S)}zoomIn(a,g){return this.zoomTo(this.getZoom()+1,a,g),this}zoomOut(a,g){return this.zoomTo(this.getZoom()-1,a,g),this}getBearing(){return this.transform.bearing}setBearing(a,g){return this.jumpTo({bearing:a},g),this}getPadding(){return this.transform.padding}setPadding(a,g){return this.jumpTo({padding:a},g),this}rotateTo(a,g,S){return this.easeTo(u.extend({bearing:a},g),S)}resetNorth(a,g){return this.rotateTo(0,u.extend({duration:1e3},a),g),this}resetNorthPitch(a,g){return this.easeTo(u.extend({bearing:0,pitch:0,duration:1e3},a),g),this}snapToNorth(a,g){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(a,g):this}getPitch(){return this.transform.pitch}setPitch(a,g){return this.jumpTo({pitch:a},g),this}cameraForBounds(a,g){a=u.LngLatBounds.convert(a);let S=g&&g.bearing||0;return this._cameraForBoxAndBearing(a.getNorthWest(),a.getSouthEast(),S,g)}_cameraForBoxAndBearing(a,g,S,I){let L={top:0,bottom:0,right:0,left:0};if(typeof(I=u.extend({padding:L,offset:[0,0],maxZoom:this.transform.maxZoom},I)).padding=="number"){let he=I.padding;I.padding={top:he,bottom:he,right:he,left:he}}I.padding=u.extend(L,I.padding);let B=this.transform,q=B.padding,$=B.project(u.LngLat.convert(a)),J=B.project(u.LngLat.convert(g)),et=$.rotate(-S*Math.PI/180),ut=J.rotate(-S*Math.PI/180),vt=new u.pointGeometry(Math.max(et.x,ut.x),Math.max(et.y,ut.y)),Ft=new u.pointGeometry(Math.min(et.x,ut.x),Math.min(et.y,ut.y)),bt=vt.sub(Ft),Ot=(B.width-(q.left+q.right+I.padding.left+I.padding.right))/bt.x,Kt=(B.height-(q.top+q.bottom+I.padding.top+I.padding.bottom))/bt.y;if(Kt<0||Ot<0)return void u.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.");let Wt=Math.min(B.scaleZoom(B.scale*Math.min(Ot,Kt)),I.maxZoom),ie=u.pointGeometry.convert(I.offset),Ht=new u.pointGeometry((I.padding.left-I.padding.right)/2,(I.padding.top-I.padding.bottom)/2).rotate(S*Math.PI/180),_e=ie.add(Ht).mult(B.scale/B.zoomScale(Wt));return{center:B.unproject($.add(J).div(2).sub(_e)),zoom:Wt,bearing:S}}fitBounds(a,g,S){return this._fitInternal(this.cameraForBounds(a,g),g,S)}fitScreenCoordinates(a,g,S,I,L){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(u.pointGeometry.convert(a)),this.transform.pointLocation(u.pointGeometry.convert(g)),S,I),I,L)}_fitInternal(a,g,S){return a?(delete(g=u.extend(a,g)).padding,g.linear?this.easeTo(g,S):this.flyTo(g,S)):this}jumpTo(a,g){this.stop();let S=this.transform,I=!1,L=!1,B=!1;return"zoom"in a&&S.zoom!==+a.zoom&&(I=!0,S.zoom=+a.zoom),a.center!==void 0&&(S.center=u.LngLat.convert(a.center)),"bearing"in a&&S.bearing!==+a.bearing&&(L=!0,S.bearing=+a.bearing),"pitch"in a&&S.pitch!==+a.pitch&&(B=!0,S.pitch=+a.pitch),a.padding==null||S.isPaddingEqual(a.padding)||(S.padding=a.padding),this.fire(new u.Event("movestart",g)).fire(new u.Event("move",g)),I&&this.fire(new u.Event("zoomstart",g)).fire(new u.Event("zoom",g)).fire(new u.Event("zoomend",g)),L&&this.fire(new u.Event("rotatestart",g)).fire(new u.Event("rotate",g)).fire(new u.Event("rotateend",g)),B&&this.fire(new u.Event("pitchstart",g)).fire(new u.Event("pitch",g)).fire(new u.Event("pitchend",g)),this.fire(new u.Event("moveend",g))}easeTo(a,g){this._stop(!1,a.easeId),((a=u.extend({offset:[0,0],duration:500,easing:u.ease},a)).animate===!1||!a.essential&&u.exported.prefersReducedMotion)&&(a.duration=0);let S=this.transform,I=this.getZoom(),L=this.getBearing(),B=this.getPitch(),q=this.getPadding(),$="zoom"in a?+a.zoom:I,J="bearing"in a?this._normalizeBearing(a.bearing,L):L,et="pitch"in a?+a.pitch:B,ut="padding"in a?a.padding:S.padding,vt=u.pointGeometry.convert(a.offset),Ft=S.centerPoint.add(vt),bt=S.pointLocation(Ft),Ot=u.LngLat.convert(a.center||bt);this._normalizeCenter(Ot);let Kt=S.project(bt),Wt=S.project(Ot).sub(Kt),ie=S.zoomScale($-I),Ht,_e;a.around&&(Ht=u.LngLat.convert(a.around),_e=S.locationPoint(Ht));let he={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||$!==I,this._rotating=this._rotating||L!==J,this._pitching=this._pitching||et!==B,this._padding=!S.isPaddingEqual(ut),this._easeId=a.easeId,this._prepareEase(g,a.noMoveStart,he),this._ease(de=>{if(this._zooming&&(S.zoom=u.number(I,$,de)),this._rotating&&(S.bearing=u.number(L,J,de)),this._pitching&&(S.pitch=u.number(B,et,de)),this._padding&&(S.interpolatePadding(q,ut,de),Ft=S.centerPoint.add(vt)),Ht)S.setLocationAtPoint(Ht,_e);else{let Pe=S.zoomScale(S.zoom-I),Re=$>I?Math.min(2,ie):Math.max(.5,ie),ve=Math.pow(Re,1-de),ar=S.unproject(Kt.add(Wt.mult(de*ve)).mult(Pe));S.setLocationAtPoint(S.renderWorldCopies?ar.wrap():ar,Ft)}this._fireMoveEvents(g)},de=>{this._afterEase(g,de)},a),this}_prepareEase(a,g,S={}){this._moving=!0,g||S.moving||this.fire(new u.Event("movestart",a)),this._zooming&&!S.zooming&&this.fire(new u.Event("zoomstart",a)),this._rotating&&!S.rotating&&this.fire(new u.Event("rotatestart",a)),this._pitching&&!S.pitching&&this.fire(new u.Event("pitchstart",a))}_fireMoveEvents(a){this.fire(new u.Event("move",a)),this._zooming&&this.fire(new u.Event("zoom",a)),this._rotating&&this.fire(new u.Event("rotate",a)),this._pitching&&this.fire(new u.Event("pitch",a))}_afterEase(a,g){if(this._easeId&&g&&this._easeId===g)return;delete this._easeId;let S=this._zooming,I=this._rotating,L=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,S&&this.fire(new u.Event("zoomend",a)),I&&this.fire(new u.Event("rotateend",a)),L&&this.fire(new u.Event("pitchend",a)),this.fire(new u.Event("moveend",a))}flyTo(a,g){if(!a.essential&&u.exported.prefersReducedMotion){let d=u.pick(a,["center","zoom","bearing","pitch","around"]);return this.jumpTo(d,g)}this.stop(),a=u.extend({offset:[0,0],speed:1.2,curve:1.42,easing:u.ease},a);let S=this.transform,I=this.getZoom(),L=this.getBearing(),B=this.getPitch(),q=this.getPadding(),$="zoom"in a?u.clamp(+a.zoom,S.minZoom,S.maxZoom):I,J="bearing"in a?this._normalizeBearing(a.bearing,L):L,et="pitch"in a?+a.pitch:B,ut="padding"in a?a.padding:S.padding,vt=S.zoomScale($-I),Ft=u.pointGeometry.convert(a.offset),bt=S.centerPoint.add(Ft),Ot=S.pointLocation(bt),Kt=u.LngLat.convert(a.center||Ot);this._normalizeCenter(Kt);let Wt=S.project(Ot),ie=S.project(Kt).sub(Wt),Ht=a.curve,_e=Math.max(S.width,S.height),he=_e/vt,de=ie.mag();if("minZoom"in a){let d=u.clamp(Math.min(a.minZoom,I,$),S.minZoom,S.maxZoom),x=_e/S.zoomScale(d-I);Ht=Math.sqrt(x/de*2)}let Pe=Ht*Ht;function Re(d){let x=(he*he-_e*_e+(d?-1:1)*Pe*Pe*de*de)/(2*(d?he:_e)*Pe*de);return Math.log(Math.sqrt(x*x+1)-x)}function ve(d){return(Math.exp(d)-Math.exp(-d))/2}function ar(d){return(Math.exp(d)+Math.exp(-d))/2}let Ye=Re(0),Ar=function(d){return ar(Ye)/ar(Ye+Ht*d)},p=function(d){return _e*((ar(Ye)*(ve(x=Ye+Ht*d)/ar(x))-ve(Ye))/Pe)/de;var x},m=(Re(1)-Ye)/Ht;if(Math.abs(de)<1e-6||!isFinite(m)){if(Math.abs(_e-he)<1e-6)return this.easeTo(a,g);let d=he<_e?-1:1;m=Math.abs(Math.log(he/_e))/Ht,p=function(){return 0},Ar=function(x){return Math.exp(d*Ht*x)}}return a.duration="duration"in a?+a.duration:1e3*m/("screenSpeed"in a?+a.screenSpeed/Ht:+a.speed),a.maxDuration&&a.duration>a.maxDuration&&(a.duration=0),this._zooming=!0,this._rotating=L!==J,this._pitching=et!==B,this._padding=!S.isPaddingEqual(ut),this._prepareEase(g,!1),this._ease(d=>{let x=d*m,A=1/Ar(x);S.zoom=d===1?$:I+S.scaleZoom(A),this._rotating&&(S.bearing=u.number(L,J,d)),this._pitching&&(S.pitch=u.number(B,et,d)),this._padding&&(S.interpolatePadding(q,ut,d),bt=S.centerPoint.add(Ft));let k=d===1?Kt:S.unproject(Wt.add(ie.mult(p(x))).mult(A));S.setLocationAtPoint(S.renderWorldCopies?k.wrap():k,bt),this._fireMoveEvents(g)},()=>this._afterEase(g),a),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(a,g){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let S=this._onEaseEnd;delete this._onEaseEnd,S.call(this,g)}if(!a){let S=this.handlers;S&&S.stop(!1)}return this}_ease(a,g,S){S.animate===!1||S.duration===0?(a(1),g()):(this._easeStart=u.exported.now(),this._easeOptions=S,this._onEaseFrame=a,this._onEaseEnd=g,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){let a=Math.min((u.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(a)),a<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(a,g){a=u.wrap(a,-180,180);let S=Math.abs(a-g);return Math.abs(a-360-g)<S&&(a-=360),Math.abs(a+360-g)<S&&(a+=360),a}_normalizeCenter(a){let g=this.transform;if(!g.renderWorldCopies||g.lngRange)return;let S=a.lng-g.center.lng;a.lng+=S>180?-360:S<-180?360:0}}class Gn{constructor(a={}){this.options=a,u.bindAll(["_toggleAttribution","_updateData","_updateCompact","_updateCompactMinimize"],this)}getDefaultPosition(){return"bottom-right"}onAdd(a){return this._map=a,this._compact=this.options&&this.options.compact,this._container=N.create("details","maplibregl-ctrl maplibregl-ctrl-attrib mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=N.create("summary","maplibregl-ctrl-attrib-button mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=N.create("div","maplibregl-ctrl-attrib-inner mapboxgl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){N.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",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(a,g){let S=this._map._getUIString(`AttributionControl.${g}`);a.title=S,a.setAttribute("aria-label",S)}_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","mapboxgl-compact-show")):(this._container.classList.add("maplibregl-compact-show","mapboxgl-compact-show"),this._container.removeAttribute("open")))}_updateData(a){!a||a.sourceDataType!=="metadata"&&a.sourceDataType!=="visibility"&&a.dataType!=="style"||this._updateAttributions()}_updateAttributions(){if(!this._map.style)return;let a=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?a=a.concat(this.options.customAttribution.map(I=>typeof I!="string"?"":I)):typeof this.options.customAttribution=="string"&&a.push(this.options.customAttribution)),this._map.style.stylesheet){let I=this._map.style.stylesheet;this.styleOwner=I.owner,this.styleId=I.id}let g=this._map.style.sourceCaches;for(let I in g){let L=g[I];if(L.used){let B=L.getSource();B.attribution&&a.indexOf(B.attribution)<0&&a.push(B.attribution)}}a=a.filter(I=>String(I).trim()),a.sort((I,L)=>I.length-L.length),a=a.filter((I,L)=>{for(let B=L+1;B<a.length;B++)if(a[B].indexOf(I)>=0)return!1;return!0});let S=a.join(" | ");S!==this._attribHTML&&(this._attribHTML=S,a.length?(this._innerContainer.innerHTML=S,this._container.classList.remove("maplibregl-attrib-empty","mapboxgl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty","mapboxgl-attrib-empty"),this._updateCompact(),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?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","mapboxgl-compact","maplibregl-compact-show","mapboxgl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show","mapboxgl-compact","mapboxgl-compact-show"))}_updateCompactMinimize(){this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")}}class Yo{constructor(a={}){this.options=a,u.bindAll(["_updateCompact"],this)}getDefaultPosition(){return"bottom-left"}onAdd(a){this._map=a,this._compact=this.options&&this.options.compact,this._container=N.create("div","maplibregl-ctrl mapboxgl-ctrl");let g=N.create("a","maplibregl-ctrl-logo mapboxgl-ctrl-logo");return g.target="_blank",g.rel="noopener nofollow",g.href="https://maplibre.org/",g.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),g.setAttribute("rel","noopener nofollow"),this._container.appendChild(g),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){N.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}_updateCompact(){let a=this._container.children;if(a.length){let g=a[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&g.classList.add("maplibregl-compact","mapboxgl-compact"):g.classList.remove("maplibregl-compact","mapboxgl-compact")}}}class Wu{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(a){let g=++this._id;return this._queue.push({callback:a,id:g,cancelled:!1}),g}remove(a){let g=this._currentlyRunning,S=g?this._queue.concat(g):this._queue;for(let I of S)if(I.id===a)return void(I.cancelled=!0)}run(a=0){let g=this._currentlyRunning=this._queue;this._queue=[];for(let S of g)if(!S.cancelled&&(S.callback(a),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}let Ks={"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":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},$u={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,fadeDuration:300,crossSourceCollisions:!0},No={showCompass:!0,showZoom:!0,visualizePitch:!1};class mo{constructor(a,g,S=!1){this._clickTolerance=10,this.element=g,this.mouseRotate=new We({clickTolerance:a.dragRotate._mouseRotate._clickTolerance}),this.map=a,S&&(this.mousePitch=new Is({clickTolerance:a.dragRotate._mousePitch._clickTolerance})),u.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),N.addEventListener(g,"mousedown",this.mousedown),N.addEventListener(g,"touchstart",this.touchstart,{passive:!1}),N.addEventListener(g,"touchmove",this.touchmove),N.addEventListener(g,"touchend",this.touchend),N.addEventListener(g,"touchcancel",this.reset)}down(a,g){this.mouseRotate.mousedown(a,g),this.mousePitch&&this.mousePitch.mousedown(a,g),N.disableDrag()}move(a,g){let S=this.map,I=this.mouseRotate.mousemoveWindow(a,g);if(I&&I.bearingDelta&&S.setBearing(S.getBearing()+I.bearingDelta),this.mousePitch){let L=this.mousePitch.mousemoveWindow(a,g);L&&L.pitchDelta&&S.setPitch(S.getPitch()+L.pitchDelta)}}off(){let a=this.element;N.removeEventListener(a,"mousedown",this.mousedown),N.removeEventListener(a,"touchstart",this.touchstart,{passive:!1}),N.removeEventListener(a,"touchmove",this.touchmove),N.removeEventListener(a,"touchend",this.touchend),N.removeEventListener(a,"touchcancel",this.reset),this.offTemp()}offTemp(){N.enableDrag(),N.removeEventListener(window,"mousemove",this.mousemove),N.removeEventListener(window,"mouseup",this.mouseup)}mousedown(a){this.down(u.extend({},a,{ctrlKey:!0,preventDefault:()=>a.preventDefault()}),N.mousePos(this.element,a)),N.addEventListener(window,"mousemove",this.mousemove),N.addEventListener(window,"mouseup",this.mouseup)}mousemove(a){this.move(a,N.mousePos(this.element,a))}mouseup(a){this.mouseRotate.mouseupWindow(a),this.mousePitch&&this.mousePitch.mouseupWindow(a),this.offTemp()}touchstart(a){a.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=N.touchPos(this.element,a.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>a.preventDefault()},this._startPos))}touchmove(a){a.targetTouches.length!==1?this.reset():(this._lastPos=N.touchPos(this.element,a.targetTouches)[0],this.move({preventDefault:()=>a.preventDefault()},this._lastPos))}touchend(a){a.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()}reset(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()}}function er(T,a,g){if(T=new u.LngLat(T.lng,T.lat),a){let S=new u.LngLat(T.lng-360,T.lat),I=new u.LngLat(T.lng+360,T.lat),L=g.locationPoint(T).distSqr(a);g.locationPoint(S).distSqr(a)<L?T=S:g.locationPoint(I).distSqr(a)<L&&(T=I)}for(;Math.abs(T.lng-g.center.lng)>180;){let S=g.locationPoint(T);if(S.x>=0&&S.y>=0&&S.x<=g.width&&S.y<=g.height)break;T.lng>g.center.lng?T.lng-=360:T.lng+=360}return T}let Oe={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 go(T,a,g){let S=T.classList;for(let I in Oe)S.remove(`maplibregl-${g}-anchor-${I}`,`mapboxgl-${g}-anchor-${I}`);S.add(`maplibregl-${g}-anchor-${a}`,`mapboxgl-${g}-anchor-${a}`)}class Hn extends u.Evented{constructor(a,g){if(super(),(a instanceof HTMLElement||g)&&(a=u.extend({element:a},g)),u.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=a&&a.anchor||"center",this._color=a&&a.color||"#3FB1CE",this._scale=a&&a.scale||1,this._draggable=a&&a.draggable||!1,this._clickTolerance=a&&a.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=a&&a.rotation||0,this._rotationAlignment=a&&a.rotationAlignment||"auto",this._pitchAlignment=a&&a.pitchAlignment&&a.pitchAlignment!=="auto"?a.pitchAlignment:this._rotationAlignment,a&&a.element)this._element=a.element,this._offset=u.pointGeometry.convert(a&&a.offset||[0,0]);else{this._defaultMarker=!0,this._element=N.create("div"),this._element.setAttribute("aria-label","Map marker");let S=N.createNS("http://www.w3.org/2000/svg","svg"),I=41,L=27;S.setAttributeNS(null,"display","block"),S.setAttributeNS(null,"height",`${I}px`),S.setAttributeNS(null,"width",`${L}px`),S.setAttributeNS(null,"viewBox",`0 0 ${L} ${I}`);let B=N.createNS("http://www.w3.org/2000/svg","g");B.setAttributeNS(null,"stroke","none"),B.setAttributeNS(null,"stroke-width","1"),B.setAttributeNS(null,"fill","none"),B.setAttributeNS(null,"fill-rule","evenodd");let q=N.createNS("http://www.w3.org/2000/svg","g");q.setAttributeNS(null,"fill-rule","nonzero");let $=N.createNS("http://www.w3.org/2000/svg","g");$.setAttributeNS(null,"transform","translate(3.0, 29.0)"),$.setAttributeNS(null,"fill","#000000");let J=[{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"}];for(let ie of J){let Ht=N.createNS("http://www.w3.org/2000/svg","ellipse");Ht.setAttributeNS(null,"opacity","0.04"),Ht.setAttributeNS(null,"cx","10.5"),Ht.setAttributeNS(null,"cy","5.80029008"),Ht.setAttributeNS(null,"rx",ie.rx),Ht.setAttributeNS(null,"ry",ie.ry),$.appendChild(Ht)}let et=N.createNS("http://www.w3.org/2000/svg","g");et.setAttributeNS(null,"fill",this._color);let ut=N.createNS("http://www.w3.org/2000/svg","path");ut.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"),et.appendChild(ut);let vt=N.createNS("http://www.w3.org/2000/svg","g");vt.setAttributeNS(null,"opacity","0.25"),vt.setAttributeNS(null,"fill","#000000");let Ft=N.createNS("http://www.w3.org/2000/svg","path");Ft.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"),vt.appendChild(Ft);let bt=N.createNS("http://www.w3.org/2000/svg","g");bt.setAttributeNS(null,"transform","translate(6.0, 7.0)"),bt.setAttributeNS(null,"fill","#FFFFFF");let Ot=N.createNS("http://www.w3.org/2000/svg","g");Ot.setAttributeNS(null,"transform","translate(8.0, 8.0)");let Kt=N.createNS("http://www.w3.org/2000/svg","circle");Kt.setAttributeNS(null,"fill","#000000"),Kt.setAttributeNS(null,"opacity","0.25"),Kt.setAttributeNS(null,"cx","5.5"),Kt.setAttributeNS(null,"cy","5.5"),Kt.setAttributeNS(null,"r","5.4999962");let Wt=N.createNS("http://www.w3.org/2000/svg","circle");Wt.setAttributeNS(null,"fill","#FFFFFF"),Wt.setAttributeNS(null,"cx","5.5"),Wt.setAttributeNS(null,"cy","5.5"),Wt.setAttributeNS(null,"r","5.4999962"),Ot.appendChild(Kt),Ot.appendChild(Wt),q.appendChild($),q.appendChild(et),q.appendChild(vt),q.appendChild(bt),q.appendChild(Ot),S.appendChild(q),S.setAttributeNS(null,"height",I*this._scale+"px"),S.setAttributeNS(null,"width",L*this._scale+"px"),this._element.appendChild(S),this._offset=u.pointGeometry.convert(a&&a.offset||[0,-14])}this._element.classList.add("maplibregl-marker","mapboxgl-marker"),this._element.addEventListener("dragstart",S=>{S.preventDefault()}),this._element.addEventListener("mousedown",S=>{S.preventDefault()}),go(this._element,this._anchor,"marker"),this._popup=null}addTo(a){return this.remove(),this._map=a,a.getCanvasContainer().appendChild(this._element),a.on("move",this._update),a.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",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),N.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(a){return this._lngLat=u.LngLat.convert(a),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(a){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),a){if(!("offset"in a.options)){let I=Math.sqrt(Math.pow(13.5,2)/2);a.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[I,-1*(38.1-13.5+I)],"bottom-right":[-I,-1*(38.1-13.5+I)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=a,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}_onKeyPress(a){let g=a.code,S=a.charCode||a.keyCode;g!=="Space"&&g!=="Enter"&&S!==32&&S!==13||this.togglePopup()}_onMapClick(a){let g=a.originalEvent.target,S=this._element;this._popup&&(g===S||S.contains(g))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){let a=this._popup;return a?(a.isOpen()?a.remove():a.addTo(this._map),this):this}_update(a){if(!this._map)return;this._map.transform.renderWorldCopies&&(this._lngLat=er(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let g="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?g=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(g=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let S="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?S="rotateX(0deg)":this._pitchAlignment==="map"&&(S=`rotateX(${this._map.getPitch()}deg)`),a&&a.type!=="moveend"||(this._pos=this._pos.round()),N.setTransform(this._element,`${Oe[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${S} ${g}`)}getOffset(){return this._offset}setOffset(a){return this._offset=u.pointGeometry.convert(a),this._update(),this}_onMove(a){if(!this._isDragging){let g=this._clickTolerance||this._map._clickTolerance;this._isDragging=a.point.dist(this._pointerdownPos)>=g}this._isDragging&&(this._pos=a.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new u.Event("dragstart"))),this.fire(new u.Event("drag")))}_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),this._state==="active"&&this.fire(new u.Event("dragend")),this._state="inactive"}_addDragHandler(a){this._element.contains(a.originalEvent.target)&&(a.preventDefault(),this._positionDelta=a.point.sub(this._pos).add(this._offset),this._pointerdownPos=a.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))}setDraggable(a){return this._draggable=!!a,this._map&&(a?(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(a){return this._rotation=a||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(a){return this._rotationAlignment=a||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(a){return this._pitchAlignment=a&&a!=="auto"?a:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}let gn={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Bi,yo=0,Zi=!1,Jn={maxWidth:100,unit:"metric"};function Ra(T,a,g){let S=g&&g.maxWidth||100,I=T._container.clientHeight/2,L=T.unproject([0,I]),B=T.unproject([S,I]),q=L.distanceTo(B);if(g&&g.unit==="imperial"){let $=3.2808*q;$>5280?je(a,S,$/5280,T._getUIString("ScaleControl.Miles")):je(a,S,$,T._getUIString("ScaleControl.Feet"))}else g&&g.unit==="nautical"?je(a,S,q/1852,T._getUIString("ScaleControl.NauticalMiles")):q>=1e3?je(a,S,q/1e3,T._getUIString("ScaleControl.Kilometers")):je(a,S,q,T._getUIString("ScaleControl.Meters"))}function je(T,a,g,S){let I=function(L){let B=Math.pow(10,`${Math.floor(L)}`.length-1),q=L/B;return q=q>=10?10:q>=5?5:q>=3?3:q>=2?2:q>=1?1:function($){let J=Math.pow(10,Math.ceil(-Math.log($)/Math.LN10));return Math.round($*J)/J}(q),B*q}(g);T.style.width=a*(I/g)+"px",T.innerHTML=`${I}&nbsp;${S}`}let Ve={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Il=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function cn(T){if(T){if(typeof T=="number"){let a=Math.round(Math.sqrt(.5*Math.pow(T,2)));return{center:new u.pointGeometry(0,0),top:new u.pointGeometry(0,T),"top-left":new u.pointGeometry(a,a),"top-right":new u.pointGeometry(-a,a),bottom:new u.pointGeometry(0,-T),"bottom-left":new u.pointGeometry(a,-a),"bottom-right":new u.pointGeometry(-a,-a),left:new u.pointGeometry(T,0),right:new u.pointGeometry(-T,0)}}if(T instanceof u.pointGeometry||Array.isArray(T)){let a=u.pointGeometry.convert(T);return{center:a,top:a,"top-left":a,"top-right":a,bottom:a,"bottom-left":a,"bottom-right":a,left:a,right:a}}return{center:u.pointGeometry.convert(T.center||[0,0]),top:u.pointGeometry.convert(T.top||[0,0]),"top-left":u.pointGeometry.convert(T["top-left"]||[0,0]),"top-right":u.pointGeometry.convert(T["top-right"]||[0,0]),bottom:u.pointGeometry.convert(T.bottom||[0,0]),"bottom-left":u.pointGeometry.convert(T["bottom-left"]||[0,0]),"bottom-right":u.pointGeometry.convert(T["bottom-right"]||[0,0]),left:u.pointGeometry.convert(T.left||[0,0]),right:u.pointGeometry.convert(T.right||[0,0])}}return cn(new u.pointGeometry(0,0))}let so={supported:P,setRTLTextPlugin:u.setRTLTextPlugin,getRTLTextPluginStatus:u.getRTLTextPluginStatus,Map:class extends As{constructor(T){var a;if(u.PerformanceUtils.mark(u.PerformanceMarkers.create),(T=u.extend({},$u,T)).minZoom!=null&&T.maxZoom!=null&&T.minZoom>T.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(T.minPitch!=null&&T.maxPitch!=null&&T.minPitch>T.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(T.minPitch!=null&&T.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(T.maxPitch!=null&&T.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new $o(T.minZoom,T.maxZoom,T.minPitch,T.maxPitch,T.renderWorldCopies),{bearingSnap:T.bearingSnap}),this._interactive=T.interactive,this._maxTileCacheSize=T.maxTileCacheSize,this._failIfMajorPerformanceCaveat=T.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=T.preserveDrawingBuffer,this._antialias=T.antialias,this._trackResize=T.trackResize,this._bearingSnap=T.bearingSnap,this._refreshExpiredTiles=T.refreshExpiredTiles,this._fadeDuration=T.fadeDuration,this._crossSourceCollisions=T.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=T.collectResourceTiming,this._renderTaskQueue=new Wu,this._controls=[],this._mapId=u.uniqueId(),this._locale=u.extend({},Ks,T.locale),this._clickTolerance=T.clickTolerance,this._pixelRatio=(a=T.pixelRatio)!==null&&a!==void 0?a:devicePixelRatio,this._requestManager=new at(T.transformRequest),typeof T.container=="string"){if(this._container=document.getElementById(T.container),!this._container)throw new Error(`Container '${T.container}' not found.`)}else{if(!(T.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=T.container}if(T.maxBounds&&this.setMaxBounds(T.maxBounds),u.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),typeof window<"u"&&(addEventListener("online",this._onWindowOnline,!1),addEventListener("resize",this._onWindowResize,!1),addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Fi(this,T),this._hash=T.hash&&new Vs(typeof T.hash=="string"&&T.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:T.center,zoom:T.zoom,bearing:T.bearing,pitch:T.pitch}),T.bounds&&(this.resize(),this.fitBounds(T.bounds,u.extend({},T.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=T.localIdeographFontFamily,T.style&&this.setStyle(T.style,{localIdeographFontFamily:T.localIdeographFontFamily}),T.attributionControl&&this.addControl(new Gn({customAttribution:T.customAttribution})),T.maplibreLogo&&this.addControl(new Yo,T.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",g=>{this._update(g.dataType==="style"),this.fire(new u.Event(`${g.dataType}data`,g))}),this.on("dataloading",g=>{this.fire(new u.Event(`${g.dataType}dataloading`,g))}),this.on("dataabort",g=>{this.fire(new u.Event("sourcedataabort",g))})}_getMapId(){return this._mapId}addControl(T,a){if(a===void 0&&(a=T.getDefaultPosition?T.getDefaultPosition():"top-right"),!T||!T.onAdd)return this.fire(new u.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let g=T.onAdd(this);this._controls.push(T);let S=this._controlPositions[a];return a.indexOf("bottom")!==-1?S.insertBefore(g,S.firstChild):S.appendChild(g),this}removeControl(T){if(!T||!T.onRemove)return this.fire(new u.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let a=this._controls.indexOf(T);return a>-1&&this._controls.splice(a,1),T.onRemove(this),this}hasControl(T){return this._controls.indexOf(T)>-1}resize(T){let a=this._containerDimensions(),g=a[0],S=a[1];this._resizeCanvas(g,S,this.getPixelRatio()),this.transform.resize(g,S),this.painter.resize(g,S,this.getPixelRatio());let I=!this._moving;return I&&(this.stop(),this.fire(new u.Event("movestart",T)).fire(new u.Event("move",T))),this.fire(new u.Event("resize",T)),I&&this.fire(new u.Event("moveend",T)),this}getPixelRatio(){return this._pixelRatio}setPixelRatio(T){let[a,g]=this._containerDimensions();this._pixelRatio=T,this._resizeCanvas(a,g,T),this.painter.resize(a,g,T)}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(T){return this.transform.setMaxBounds(u.LngLatBounds.convert(T)),this._update()}setMinZoom(T){if((T=T??-2)>=-2&&T<=this.transform.maxZoom)return this.transform.minZoom=T,this._update(),this.getZoom()<T&&this.setZoom(T),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(T){if((T=T??22)>=this.transform.minZoom)return this.transform.maxZoom=T,this._update(),this.getZoom()>T&&this.setZoom(T),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(T){if((T=T??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(T>=0&&T<=this.transform.maxPitch)return this.transform.minPitch=T,this._update(),this.getPitch()<T&&this.setPitch(T),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(T){if((T=T??60)>85)throw new Error("maxPitch must be less than or equal to 85");if(T>=this.transform.minPitch)return this.transform.maxPitch=T,this._update(),this.getPitch()>T&&this.setPitch(T),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(T){return this.transform.renderWorldCopies=T,this._update()}project(T){return this.transform.locationPoint(u.LngLat.convert(T))}unproject(T){return this.transform.pointLocation(u.pointGeometry.convert(T))}isMoving(){return this._moving||this.handlers.isMoving()}isZooming(){return this._zooming||this.handlers.isZooming()}isRotating(){return this._rotating||this.handlers.isRotating()}_createDelegatedListener(T,a,g){if(T==="mouseenter"||T==="mouseover"){let S=!1;return{layer:a,listener:g,delegates:{mousemove:L=>{let B=this.getLayer(a)?this.queryRenderedFeatures(L.point,{layers:[a]}):[];B.length?S||(S=!0,g.call(this,new Kn(T,this,L.originalEvent,{features:B}))):S=!1},mouseout:()=>{S=!1}}}}if(T==="mouseleave"||T==="mouseout"){let S=!1;return{layer:a,listener:g,delegates:{mousemove:B=>{(this.getLayer(a)?this.queryRenderedFeatures(B.point,{layers:[a]}):[]).length?S=!0:S&&(S=!1,g.call(this,new Kn(T,this,B.originalEvent)))},mouseout:B=>{S&&(S=!1,g.call(this,new Kn(T,this,B.originalEvent)))}}}}{let S=I=>{let L=this.getLayer(a)?this.queryRenderedFeatures(I.point,{layers:[a]}):[];L.length&&(I.features=L,g.call(this,I),delete I.features)};return{layer:a,listener:g,delegates:{[T]:S}}}}on(T,a,g){if(g===void 0)return super.on(T,a);let S=this._createDelegatedListener(T,a,g);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[T]=this._delegatedListeners[T]||[],this._delegatedListeners[T].push(S);for(let I in S.delegates)this.on(I,S.delegates[I]);return this}once(T,a,g){if(g===void 0)return super.once(T,a);let S=this._createDelegatedListener(T,a,g);for(let I in S.delegates)this.once(I,S.delegates[I]);return this}off(T,a,g){return g===void 0?super.off(T,a):(this._delegatedListeners&&this._delegatedListeners[T]&&(S=>{let I=this._delegatedListeners[T];for(let L=0;L<I.length;L++){let B=I[L];if(B.layer===a&&B.listener===g){for(let q in B.delegates)this.off(q,B.delegates[q]);return I.splice(L,1),this}}})(),this)}queryRenderedFeatures(T,a){if(!this.style)return[];let g;if(a!==void 0||T===void 0||T instanceof u.pointGeometry||Array.isArray(T)||(a=T,T=void 0),a=a||{},(T=T||[[0,0],[this.transform.width,this.transform.height]])instanceof u.pointGeometry||typeof T[0]=="number")g=[u.pointGeometry.convert(T)];else{let S=u.pointGeometry.convert(T[0]),I=u.pointGeometry.convert(T[1]);g=[S,new u.pointGeometry(I.x,S.y),I,new u.pointGeometry(S.x,I.y),S]}return this.style.queryRenderedFeatures(g,a,this.transform)}querySourceFeatures(T,a){return this.style.querySourceFeatures(T,a)}setStyle(T,a){return(a=u.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},a)).diff!==!1&&a.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&T?(this._diffStyle(T,a),this):(this._localIdeographFontFamily=a.localIdeographFontFamily,this._updateStyle(T,a))}setTransformRequest(T){return this._requestManager.setTransformRequest(T),this}_getUIString(T){let a=this._locale[T];if(a==null)throw new Error(`Missing UI string '${T}'`);return a}_updateStyle(T,a){return this.style&&(this.style.setEventedParent(null),this.style._remove()),T?(this.style=new si(this,a||{}),this.style.setEventedParent(this,{style:this.style}),typeof T=="string"?this.style.loadURL(T):this.style.loadJSON(T),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new si(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(T,a){if(typeof T=="string"){let g=this._requestManager.transformRequest(T,u.ResourceType.Style);u.getJSON(g,(S,I)=>{S?this.fire(new u.ErrorEvent(S)):I&&this._updateDiff(I,a)})}else typeof T=="object"&&this._updateDiff(T,a)}_updateDiff(T,a){try{this.style.setState(T)&&this._update(!0)}catch(g){u.warnOnce(`Unable to perform style diff: ${g.message||g.error||g}. Rebuilding the style from scratch.`),this._updateStyle(T,a)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():u.warnOnce("There is no style added to the map.")}addSource(T,a){return this._lazyInitEmptyStyle(),this.style.addSource(T,a),this._update(!0)}isSourceLoaded(T){let a=this.style&&this.style.sourceCaches[T];if(a!==void 0)return a.loaded();this.fire(new u.ErrorEvent(new Error(`There is no source with ID '${T}'`)))}areTilesLoaded(){let T=this.style&&this.style.sourceCaches;for(let a in T){let g=T[a]._tiles;for(let S in g){let I=g[S];if(I.state!=="loaded"&&I.state!=="errored")return!1}}return!0}addSourceType(T,a,g){return this._lazyInitEmptyStyle(),this.style.addSourceType(T,a,g)}removeSource(T){return this.style.removeSource(T),this._update(!0)}getSource(T){return this.style.getSource(T)}addImage(T,a,{pixelRatio:g=1,sdf:S=!1,stretchX:I,stretchY:L,content:B}={}){if(this._lazyInitEmptyStyle(),a instanceof HTMLImageElement||u.isImageBitmap(a)){let{width:q,height:$,data:J}=u.exported.getImageData(a);this.style.addImage(T,{data:new u.RGBAImage({width:q,height:$},J),pixelRatio:g,stretchX:I,stretchY:L,content:B,sdf:S,version:0})}else{if(a.width===void 0||a.height===void 0)return this.fire(new u.ErrorEvent(new 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:q,height:$,data:J}=a,et=a;this.style.addImage(T,{data:new u.RGBAImage({width:q,height:$},new Uint8Array(J)),pixelRatio:g,stretchX:I,stretchY:L,content:B,sdf:S,version:0,userImage:et}),et.onAdd&&et.onAdd(this,T)}}}updateImage(T,a){let g=this.style.getImage(T);if(!g)return this.fire(new u.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let S=a instanceof HTMLImageElement||u.isImageBitmap(a)?u.exported.getImageData(a):a,{width:I,height:L,data:B}=S;if(I===void 0||L===void 0)return this.fire(new u.ErrorEvent(new 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(I!==g.data.width||L!==g.data.height)return this.fire(new u.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));let q=!(a instanceof HTMLImageElement||u.isImageBitmap(a));g.data.replace(B,q),this.style.updateImage(T,g)}hasImage(T){return T?!!this.style.getImage(T):(this.fire(new u.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(T){this.style.removeImage(T)}loadImage(T,a){u.getImage(this._requestManager.transformRequest(T,u.ResourceType.Image),a)}listImages(){return this.style.listImages()}addLayer(T,a){return this._lazyInitEmptyStyle(),this.style.addLayer(T,a),this._update(!0)}moveLayer(T,a){return this.style.moveLayer(T,a),this._update(!0)}removeLayer(T){return this.style.removeLayer(T),this._update(!0)}getLayer(T){return this.style.getLayer(T)}setLayerZoomRange(T,a,g){return this.style.setLayerZoomRange(T,a,g),this._update(!0)}setFilter(T,a,g={}){return this.style.setFilter(T,a,g),this._update(!0)}getFilter(T){return this.style.getFilter(T)}setPaintProperty(T,a,g,S={}){return this.style.setPaintProperty(T,a,g,S),this._update(!0)}getPaintProperty(T,a){return this.style.getPaintProperty(T,a)}setLayoutProperty(T,a,g,S={}){return this.style.setLayoutProperty(T,a,g,S),this._update(!0)}getLayoutProperty(T,a){return this.style.getLayoutProperty(T,a)}setLight(T,a={}){return this._lazyInitEmptyStyle(),this.style.setLight(T,a),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(T,a){return this.style.setFeatureState(T,a),this._update()}removeFeatureState(T,a){return this.style.removeFeatureState(T,a),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,a=0;return this._container&&(T=this._container.clientWidth||400,a=this._container.clientHeight||300),[T,a]}_setupContainer(){let T=this._container;T.classList.add("maplibregl-map","mapboxgl-map");let a=this._canvasContainer=N.create("div","maplibregl-canvas-container mapboxgl-canvas-container",T);this._interactive&&a.classList.add("maplibregl-interactive","mapboxgl-interactive"),this._canvas=N.create("canvas","maplibregl-canvas mapboxgl-canvas",a),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");let g=this._containerDimensions();this._resizeCanvas(g[0],g[1],this.getPixelRatio());let S=this._controlContainer=N.create("div","maplibregl-control-container mapboxgl-control-container",T),I=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(L=>{I[L]=N.create("div",`maplibregl-ctrl-${L} mapboxgl-ctrl-${L}`,S)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(T,a,g){this._canvas.width=g*T,this._canvas.height=g*a,this._canvas.style.width=`${T}px`,this._canvas.style.height=`${a}px`}_setupPainter(){let T=u.extend({},P.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),a=this._canvas.getContext("webgl",T)||this._canvas.getContext("experimental-webgl",T);a?(this.painter=new ko(a,this.transform),u.exported$1.testSupport(a)):this.fire(new u.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(T){T.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new u.Event("webglcontextlost",{originalEvent:T}))}_contextRestored(T){this._setupPainter(),this.resize(),this._update(),this.fire(new u.Event("webglcontextrestored",{originalEvent:T}))}_onMapScroll(T){if(T.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(T){return this.style?(this._styleDirty=this._styleDirty||T,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(T){return this._update(),this._renderTaskQueue.add(T)}_cancelRenderFrame(T){this._renderTaskQueue.remove(T)}_render(T){let a,g=0,S=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(a=S.createQueryEXT(),S.beginQueryEXT(S.TIME_ELAPSED_EXT,a),g=u.exported.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(T),this._removed)return;let I=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let B=this.transform.zoom,q=u.exported.now();this.style.zoomHistory.update(B,q);let $=new u.EvaluationParameters(B,{now:q,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),J=$.crossFadingFactor();J===1&&J===this._crossFadingFactor||(I=!0,this._crossFadingFactor=J),this.style.update($)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new u.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,u.PerformanceUtils.mark(u.PerformanceMarkers.load),this.fire(new u.Event("load"))),this.style&&(this.style.hasTransitions()||I)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){let B=u.exported.now()-g;S.endQueryEXT(S.TIME_ELAPSED_EXT,a),setTimeout(()=>{let q=S.getQueryObjectEXT(a,S.QUERY_RESULT_EXT)/1e6;S.deleteQueryEXT(a),this.fire(new u.Event("gpu-timing-frame",{cpuTime:B,gpuTime:q}))},50)}if(this.listens("gpu-timing-layer")){let B=this.painter.collectGpuTimers();setTimeout(()=>{let q=this.painter.queryGpuTimers(B);this.fire(new u.Event("gpu-timing-layer",{layerTimes:q}))},50)}let L=this._sourcesDirty||this._styleDirty||this._placementDirty;return L||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new u.Event("idle")),!this._loaded||this._fullyLoaded||L||(this._fullyLoaded=!0,u.PerformanceUtils.mark(u.PerformanceMarkers.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){this._hash&&this._hash.remove();for(let a of this._controls)a.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&(removeEventListener("resize",this._onWindowResize,!1),removeEventListener("orientationchange",this._onWindowResize,!1),removeEventListener("online",this._onWindowOnline,!1));let T=this.painter.context.gl.getExtension("WEBGL_lose_context");T&&T.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),N.remove(this._canvasContainer),N.remove(this._controlContainer),this._container.classList.remove("maplibregl-map","mapboxgl-map"),u.PerformanceUtils.clearMetrics(),this._removed=!0,this.fire(new u.Event("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=u.exported.frame(T=>{u.PerformanceUtils.frame(T),this._frame=null,this._render(T)}))}_onWindowOnline(){this._update()}_onWindowResize(T){this._trackResize&&this.resize({originalEvent:T})._update()}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()}_setCacheLimits(T,a){u.setCacheLimits(T,a)}},NavigationControl:class{constructor(T){this.options=u.extend({},No,T),this._container=N.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",a=>a.preventDefault()),this.options.showZoom&&(u.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in mapboxgl-ctrl-zoom-in",a=>this._map.zoomIn({},{originalEvent:a})),N.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out mapboxgl-ctrl-zoom-out",a=>this._map.zoomOut({},{originalEvent:a})),N.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(u.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("maplibregl-ctrl-compass mapboxgl-ctrl-compass",a=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:a}):this._map.resetNorth({},{originalEvent:a})}),this._compassIcon=N.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){let T=this._map.getZoom(),a=T===this._map.getMaxZoom(),g=T===this._map.getMinZoom();this._zoomInButton.disabled=a,this._zoomOutButton.disabled=g,this._zoomInButton.setAttribute("aria-disabled",a.toString()),this._zoomOutButton.setAttribute("aria-disabled",g.toString())}_rotateCompassArrow(){let T=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=T}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._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new mo(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){N.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._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(T,a){let g=N.create("button",T,this._container);return g.type="button",g.addEventListener("click",a),g}_setButtonTitle(T,a){let g=this._map._getUIString(`NavigationControl.${a}`);T.title=g,T.setAttribute("aria-label",g)}},GeolocateControl:class extends u.Evented{constructor(T){super(),this.options=u.extend({},gn,T),u.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}onAdd(T){var a;return this._map=T,this._container=N.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),a=this._setupUI,Bi!==void 0?a(Bi):window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(g=>{Bi=g.state!=="denied",a(Bi)}):(Bi=!!window.navigator.geolocation,a(Bi)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(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(),N.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,yo=0,Zi=!1}_isOutOfMapMaxBounds(T){let a=this._map.getMaxBounds(),g=T.coords;return a&&(g.longitude<a.getWest()||g.longitude>a.getEast()||g.latitude<a.getSouth()||g.latitude>a.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(T){if(this._map){if(this._isOutOfMapMaxBounds(T))return this._setErrorState(),this.fire(new u.Event("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","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(T),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(T),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new u.Event("geolocate",T)),this._finish()}}_updateCamera(T){let a=new u.LngLat(T.coords.longitude,T.coords.latitude),g=T.coords.accuracy,S=this._map.getBearing(),I=u.extend({bearing:S},this.options.fitBoundsOptions);this._map.fitBounds(a.toBounds(g),I,{geolocateSource:!0})}_updateMarker(T){if(T){let a=new u.LngLat(T.coords.longitude,T.coords.latitude);this._accuracyCircleMarker.setLngLat(a).addTo(this._map),this._userLocationDotMarker.setLngLat(a).addTo(this._map),this._accuracy=T.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){let T=this._map._container.clientHeight/2,a=this._map.unproject([0,T]),g=this._map.unproject([1,T]),S=a.distanceTo(g),I=Math.ceil(2*this._accuracy/S);this._circleElement.style.width=`${I}px`,this._circleElement.style.height=`${I}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_onError(T){if(this._map){if(this.options.trackUserLocation)if(T.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(T.code===3&&Zi)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new u.Event("error",T)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(T){if(this._container.addEventListener("contextmenu",a=>a.preventDefault()),this._geolocateButton=N.create("button","maplibregl-ctrl-geolocate mapboxgl-ctrl-geolocate",this._container),N.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",T===!1){u.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");let a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}else{let a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=N.create("div","maplibregl-user-location-dot mapboxgl-user-location-dot"),this._userLocationDotMarker=new Hn(this._dotElement),this._circleElement=N.create("div","maplibregl-user-location-accuracy-circle mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Hn({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",a=>{a.geolocateSource||this._watchState!=="ACTIVE_LOCK"||a.originalEvent&&a.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this.fire(new u.Event("trackuserlocationend")))})}trigger(){if(!this._setup)return u.warnOnce("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 u.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":yo--,Zi=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this.fire(new u.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new u.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let T;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),yo++,yo>1?(T={maximumAge:6e5,timeout:0},Zi=!0):(T=this.options.positionOptions,Zi=!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","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Gn,LogoControl:Yo,ScaleControl:class{constructor(T){this.options=u.extend({},Jn,T),u.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){Ra(this._map,this._container,this.options)}onAdd(T){return this._map=T,this._container=N.create("div","maplibregl-ctrl maplibregl-ctrl-scale mapboxgl-ctrl mapboxgl-ctrl-scale",T.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){N.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}setUnit(T){this.options.unit=T,Ra(this._map,this._container,this.options)}},FullscreenControl:class{constructor(T){this._fullscreen=!1,T&&T.container&&(T.container instanceof HTMLElement?this._container=T.container:u.warnOnce("Full screen control 'container' must be a DOM element.")),u.bindAll(["_onClickFullscreen","_changeIcon"],this),"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=N.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",u.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){N.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!!(document.fullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled)}_setupUI(){let T=this._fullscreenButton=N.create("button","maplibregl-ctrl-fullscreen mapboxgl-ctrl-fullscreen",this._controlContainer);N.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",T).setAttribute("aria-hidden","true"),T.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_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}_changeIcon(){(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen&&window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends u.Evented{constructor(T){super(),this.options=u.extend(Object.create(Ve),T),u.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}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","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new u.Event("open")),this}isOpen(){return!!this._map}remove(){return this._content&&N.remove(this._content),this._container&&(N.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),delete this._map),this.fire(new u.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(T){return this._lngLat=u.LngLat.convert(T),this._pos=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","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer","mapboxgl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=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","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")),this}getElement(){return this._container}setText(T){return this.setDOMContent(document.createTextNode(T))}setHTML(T){let a=document.createDocumentFragment(),g=document.createElement("body"),S;for(g.innerHTML=T;S=g.firstChild,S;)a.appendChild(S);return this.setDOMContent(a)}getMaxWidth(){return this._container&&this._container.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=N.create("div","maplibregl-popup-content mapboxgl-popup-content",this._container);return this._content.appendChild(T),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(T){this._container&&this._container.classList.add(T)}removeClassName(T){this._container&&this._container.classList.remove(T)}setOffset(T){return this.options.offset=T,this._update(),this}toggleClassName(T){if(this._container)return this._container.classList.toggle(T)}_createCloseButton(){this.options.closeButton&&(this._closeButton=N.create("button","maplibregl-popup-close-button mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_onMouseUp(T){this._update(T.point)}_onMouseMove(T){this._update(T.point)}_onDrag(T){this._update(T.point)}_update(T){if(!this._map||!this._lngLat&&!this._trackPointer||!this._content||(this._container||(this._container=N.create("div","maplibregl-popup mapboxgl-popup",this._map.getContainer()),this._tip=N.create("div","maplibregl-popup-tip mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(L=>this._container.classList.add(L)),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=er(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!T))return;let a=this._pos=this._trackPointer&&T?T:this._map.project(this._lngLat),g=this.options.anchor,S=cn(this.options.offset);if(!g){let L=this._container.offsetWidth,B=this._container.offsetHeight,q;q=a.y+S.bottom.y<B?["top"]:a.y>this._map.transform.height-B?["bottom"]:[],a.x<L/2?q.push("left"):a.x>this._map.transform.width-L/2&&q.push("right"),g=q.length===0?"bottom":q.join("-")}let I=a.add(S[g]).round();N.setTransform(this._container,`${Oe[g]} translate(${I.x}px,${I.y}px)`),go(this._container,g,"popup")}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let T=this._container.querySelector(Il);T&&T.focus()}_onClose(){this.remove()}},Marker:Hn,Style:si,LngLat:u.LngLat,LngLatBounds:u.LngLatBounds,Point:u.pointGeometry,MercatorCoordinate:u.MercatorCoordinate,Evented:u.Evented,AJAXError:u.AJAXError,config:u.config,CanvasSource:ti,GeoJSONSource:xr,ImageSource:$r,RasterDEMTileSource:br,RasterTileSource:yr,VectorTileSource:Lr,VideoSource:Fe,prewarm:function(){Wi().acquire(ji)},clearPrewarmedResources:function(){let T=io;T&&(T.isPreloaded()&&T.numActive()===1?(T.release(ji),io=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()"))},get workerCount(){return qn.workerCount},set workerCount(T){qn.workerCount=T},get maxParallelImageRequests(){return u.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(T){u.config.MAX_PARALLEL_IMAGE_REQUESTS=T},clearStorage(T){u.clearTileCache(T)},workerUrl:"",addProtocol(T,a){u.config.REGISTERED_PROTOCOLS[T]=a},removeProtocol(T){delete u.config.REGISTERED_PROTOCOLS[T]}};return Ii.extend(so,{isSafari:u.isSafari,getPerformanceMetrics:u.PerformanceUtils.getPerformanceMetrics}),so});var i=o;return i})});var e1=Vf((oB,t1)=>{var wE="Expected a function",J0=NaN,EE="[object Symbol]",SE=/^\s+|\s+$/g,TE=/^[-+]0x[0-9a-f]+$/i,IE=/^0b[01]+$/i,CE=/^0o[0-7]+$/i,AE=parseInt,PE=typeof global=="object"&&global&&global.Object===Object&&global,ME=typeof self=="object"&&self&&self.Object===Object&&self,LE=PE||ME||Function("return this")(),kE=Object.prototype,zE=kE.toString,RE=Math.max,DE=Math.min,I_=function(){return LE.Date.now()};function OE(v,l,o){var c,i,u,P,D,F,U=0,N=!1,at=!1,yt=!0;if(typeof v!="function")throw new TypeError(wE);l=Q0(l)||0,C_(o)&&(N=!!o.leading,at="maxWait"in o,u=at?RE(Q0(o.maxWait)||0,l):u,yt="trailing"in o?!!o.trailing:yt);function Tt(oe){var ye=c,be=i;return c=i=void 0,U=oe,P=v.apply(be,ye),P}function kt(oe){return U=oe,D=setTimeout(Lt,l),N?Tt(oe):P}function Vt(oe){var ye=oe-F,be=oe-U,Me=l-ye;return at?DE(Me,u-be):Me}function wt(oe){var ye=oe-F,be=oe-U;return F===void 0||ye>=l||ye<0||at&&be>=u}function Lt(){var oe=I_();if(wt(oe))return Zt(oe);D=setTimeout(Lt,Vt(oe))}function Zt(oe){return D=void 0,yt&&c?Tt(oe):(c=i=void 0,P)}function Jt(){D!==void 0&&clearTimeout(D),U=0,c=F=i=D=void 0}function se(){return D===void 0?P:Zt(I_())}function ce(){var oe=I_(),ye=wt(oe);if(c=arguments,i=this,F=oe,ye){if(D===void 0)return kt(F);if(at)return D=setTimeout(Lt,l),Tt(F)}return D===void 0&&(D=setTimeout(Lt,l)),P}return ce.cancel=Jt,ce.flush=se,ce}function C_(v){var l=typeof v;return!!v&&(l=="object"||l=="function")}function FE(v){return!!v&&typeof v=="object"}function BE(v){return typeof v=="symbol"||FE(v)&&zE.call(v)==EE}function Q0(v){if(typeof v=="number")return v;if(BE(v))return J0;if(C_(v)){var l=typeof v.valueOf=="function"?v.valueOf():v;v=C_(l)?l+"":l}if(typeof v!="string")return v===0?v:+v;v=v.replace(SE,"");var o=IE.test(v);return o||CE.test(v)?AE(v.slice(2),o?2:8):TE.test(v)?J0:+v}t1.exports=OE});var a1=Vf((aB,o1)=>{var n1="Expected a function",r1=NaN,UE="[object Symbol]",NE=/^\s+|\s+$/g,VE=/^[-+]0x[0-9a-f]+$/i,GE=/^0b[01]+$/i,jE=/^0o[0-7]+$/i,qE=parseInt,ZE=typeof global=="object"&&global&&global.Object===Object&&global,XE=typeof self=="object"&&self&&self.Object===Object&&self,WE=ZE||XE||Function("return this")(),$E=Object.prototype,KE=$E.toString,YE=Math.max,HE=Math.min,A_=function(){return WE.Date.now()};function JE(v,l,o){var c,i,u,P,D,F,U=0,N=!1,at=!1,yt=!0;if(typeof v!="function")throw new TypeError(n1);l=i1(l)||0,Hm(o)&&(N=!!o.leading,at="maxWait"in o,u=at?YE(i1(o.maxWait)||0,l):u,yt="trailing"in o?!!o.trailing:yt);function Tt(oe){var ye=c,be=i;return c=i=void 0,U=oe,P=v.apply(be,ye),P}function kt(oe){return U=oe,D=setTimeout(Lt,l),N?Tt(oe):P}function Vt(oe){var ye=oe-F,be=oe-U,Me=l-ye;return at?HE(Me,u-be):Me}function wt(oe){var ye=oe-F,be=oe-U;return F===void 0||ye>=l||ye<0||at&&be>=u}function Lt(){var oe=A_();if(wt(oe))return Zt(oe);D=setTimeout(Lt,Vt(oe))}function Zt(oe){return D=void 0,yt&&c?Tt(oe):(c=i=void 0,P)}function Jt(){D!==void 0&&clearTimeout(D),U=0,c=F=i=D=void 0}function se(){return D===void 0?P:Zt(A_())}function ce(){var oe=A_(),ye=wt(oe);if(c=arguments,i=this,F=oe,ye){if(D===void 0)return kt(F);if(at)return D=setTimeout(Lt,l),Tt(F)}return D===void 0&&(D=setTimeout(Lt,l)),P}return ce.cancel=Jt,ce.flush=se,ce}function QE(v,l,o){var c=!0,i=!0;if(typeof v!="function")throw new TypeError(n1);return Hm(o)&&(c="leading"in o?!!o.leading:c,i="trailing"in o?!!o.trailing:i),JE(v,l,{leading:c,maxWait:l,trailing:i})}function Hm(v){var l=typeof v;return!!v&&(l=="object"||l=="function")}function tS(v){return!!v&&typeof v=="object"}function eS(v){return typeof v=="symbol"||tS(v)&&KE.call(v)==UE}function i1(v){if(typeof v=="number")return v;if(eS(v))return r1;if(Hm(v)){var l=typeof v.valueOf=="function"?v.valueOf():v;v=Hm(l)?l+"":l}if(typeof v!="string")return v===0?v:+v;v=v.replace(NE,"");var o=GE.test(v);return o||jE.test(v)?qE(v.slice(2),o?2:8):VE.test(v)?r1:+v}o1.exports=QE});var tg={};Qg(tg,{CopyrightControl:()=>rx,Layer:()=>xa,MapboxLayer:()=>sp,MapboxStyleLayer:()=>H0,MaplibreLayer:()=>lp,RealtimeAPI:()=>qf,RealtimeLayer:()=>l1,RealtimeModes:()=>Zo,RoutingAPI:()=>Gf,RoutingControl:()=>j0,RoutingLayer:()=>$m,StopFinderControl:()=>Z0,StopsAPI:()=>jf,VectorLayer:()=>u1,WMSLayer:()=>c1,createTrackerFilters:()=>oy,fullTrajectoryDelayStyle:()=>s1,fullTrajectoryStyle:()=>Qm,getCircleCanvas:()=>Ay,getDelayBgCanvas:()=>Iy,getDelayTextCanvas:()=>Cy,getHoursAndMinutes:()=>bv,getLayersAsFlatArray:()=>Zf,getMapboxMapCopyrights:()=>fc,getMapboxRender:()=>Yp,getMaplibreRender:()=>Kp,getTextCanvas:()=>Py,getUTCDateString:()=>vv,getUTCTimeString:()=>xv,getUrlWithParams:()=>$h,pad:()=>mm,realtimeDefaultStyle:()=>Jh,realtimeDelayStyle:()=>My,realtimeSimpleStyle:()=>Ly,removeDuplicate:()=>Kh,renderTrajectories:()=>Xf,sortByDelay:()=>ay,trackerConfig:()=>Hp});var Z1=function(){function v(l){this.propagationStopped,this.defaultPrevented,this.type=l,this.target=null}return v.prototype.preventDefault=function(){this.defaultPrevented=!0},v.prototype.stopPropagation=function(){this.propagationStopped=!0},v}();var ss=Z1;var Bp={PROPERTYCHANGE:"propertychange"};var X1=function(){function v(){this.disposed=!1}return v.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},v.prototype.disposeInternal=function(){},v}(),uv=X1;function cv(v,l,o){for(var c,i,u=o||rh,P=0,D=v.length,F=!1;P<D;)c=P+(D-P>>1),i=+u(v[c],l),i<0?P=c+1:(D=c,F=!i);return F?P:~P}function rh(v,l){return v>l?1:v<l?-1:0}function hv(v,l){return v.indexOf(l)>=0}function pv(v,l,o){for(;l<o;){var c=v[l];v[l]=v[o],v[o]=c,++l,--o}}function Ua(v,l){for(var o=Array.isArray(l)?l:[l],c=o.length,i=0;i<c;i++)v[v.length]=o[i]}function ls(v,l){var o=v.length;if(o!==l.length)return!1;for(var c=0;c<o;c++)if(v[c]!==l[c])return!1;return!0}function um(){return!0}function Wh(){}function fv(v){var l=!1,o,c,i;return function(){var u=Array.prototype.slice.call(arguments);return(!l||this!==i||!ls(u,c))&&(l=!0,i=this,c=u,o=v.apply(this,arguments)),o}}var _a=typeof Object.assign=="function"?Object.assign:function(v,l){if(v==null)throw new TypeError("Cannot convert undefined or null to object");for(var o=Object(v),c=1,i=arguments.length;c<i;++c){var u=arguments[c];if(u!=null)for(var P in u)u.hasOwnProperty(P)&&(o[P]=u[P])}return o};function ih(v){for(var l in v)delete v[l]}var cm=typeof Object.values=="function"?Object.values:function(v){var l=[];for(var o in v)l.push(v[o]);return l};function Vl(v){var l;for(l in v)return!1;return!l}var W1=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),$1=function(v){W1(l,v);function l(o){var c=v.call(this)||this;return c.eventTarget_=o,c.pendingRemovals_=null,c.dispatching_=null,c.listeners_=null,c}return l.prototype.addEventListener=function(o,c){if(!(!o||!c)){var i=this.listeners_||(this.listeners_={}),u=i[o]||(i[o]=[]);u.indexOf(c)===-1&&u.push(c)}},l.prototype.dispatchEvent=function(o){var c=typeof o=="string",i=c?o:o.type,u=this.listeners_&&this.listeners_[i];if(!!u){var P=c?new ss(o):o;P.target||(P.target=this.eventTarget_||this);var D=this.dispatching_||(this.dispatching_={}),F=this.pendingRemovals_||(this.pendingRemovals_={});i in D||(D[i]=0,F[i]=0),++D[i];for(var U,N=0,at=u.length;N<at;++N)if("handleEvent"in u[N]?U=u[N].handleEvent(P):U=u[N].call(this,P),U===!1||P.propagationStopped){U=!1;break}if(--D[i]===0){var yt=F[i];for(delete F[i];yt--;)this.removeEventListener(i,Wh);delete D[i]}return U}},l.prototype.disposeInternal=function(){this.listeners_&&ih(this.listeners_)},l.prototype.getListeners=function(o){return this.listeners_&&this.listeners_[o]||void 0},l.prototype.hasListener=function(o){return this.listeners_?o?o in this.listeners_:Object.keys(this.listeners_).length>0:!1},l.prototype.removeEventListener=function(o,c){var i=this.listeners_&&this.listeners_[o];if(i){var u=i.indexOf(c);u!==-1&&(this.pendingRemovals_&&o in this.pendingRemovals_?(i[u]=Wh,++this.pendingRemovals_[o]):(i.splice(u,1),i.length===0&&delete this.listeners_[o]))}},l}(uv),nh=$1;var Vi={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function eo(v,l,o,c,i){if(c&&c!==v&&(o=o.bind(c)),i){var u=o;o=function(){v.removeEventListener(l,o),u.apply(this,arguments)}}var P={target:v,type:l,listener:o};return v.addEventListener(l,o),P}function Up(v,l,o,c){return eo(v,l,o,c,!0)}function To(v){v&&v.target&&(v.target.removeEventListener(v.type,v.listener),ih(v))}var K1=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),hm=function(v){K1(l,v);function l(){var o=v.call(this)||this;return o.on=o.onInternal,o.once=o.onceInternal,o.un=o.unInternal,o.revision_=0,o}return l.prototype.changed=function(){++this.revision_,this.dispatchEvent(Vi.CHANGE)},l.prototype.getRevision=function(){return this.revision_},l.prototype.onInternal=function(o,c){if(Array.isArray(o)){for(var i=o.length,u=new Array(i),P=0;P<i;++P)u[P]=eo(this,o[P],c);return u}else return eo(this,o,c)},l.prototype.onceInternal=function(o,c){var i;if(Array.isArray(o)){var u=o.length;i=new Array(u);for(var P=0;P<u;++P)i[P]=Up(this,o[P],c)}else i=Up(this,o,c);return c.ol_key=i,i},l.prototype.unInternal=function(o,c){var i=c.ol_key;if(i)Na(i);else if(Array.isArray(o))for(var u=0,P=o.length;u<P;++u)this.removeEventListener(o[u],c);else this.removeEventListener(o,c)},l}(nh);hm.prototype.on;hm.prototype.once;hm.prototype.un;function Na(v){if(Array.isArray(v))for(var l=0,o=v.length;l<o;++l)To(v[l]);else To(v)}var pm=hm;function Fr(){return function(){throw new Error("Unimplemented abstract method.")}()}var Y1=0;function wi(v){return v.ol_uid||(v.ol_uid=String(++Y1))}var fm="6.14.1";var mv=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),dv=function(v){mv(l,v);function l(o,c,i){var u=v.call(this,o)||this;return u.key=c,u.oldValue=i,u}return l}(ss);var H1=function(v){mv(l,v);function l(o){var c=v.call(this)||this;return c.on,c.once,c.un,wi(c),c.values_=null,o!==void 0&&c.setProperties(o),c}return l.prototype.get=function(o){var c;return this.values_&&this.values_.hasOwnProperty(o)&&(c=this.values_[o]),c},l.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},l.prototype.getProperties=function(){return this.values_&&_a({},this.values_)||{}},l.prototype.hasProperties=function(){return!!this.values_},l.prototype.notify=function(o,c){var i;i="change:".concat(o),this.hasListener(i)&&this.dispatchEvent(new dv(i,o,c)),i=Bp.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new dv(i,o,c))},l.prototype.addChangeListener=function(o,c){this.addEventListener("change:".concat(o),c)},l.prototype.removeChangeListener=function(o,c){this.removeEventListener("change:".concat(o),c)},l.prototype.set=function(o,c,i){var u=this.values_||(this.values_={});if(i)u[o]=c;else{var P=u[o];u[o]=c,P!==c&&this.notify(o,P)}},l.prototype.setProperties=function(o,c){for(var i in o)this.set(i,o[i],c)},l.prototype.applyProperties=function(o){!o.values_||_a(this.values_||(this.values_={}),o.values_)},l.prototype.unset=function(o,c){if(this.values_&&o in this.values_){var i=this.values_[o];delete this.values_[o],Vl(this.values_)&&(this.values_=null),c||this.notify(o,i)}},l}(pm),Io=H1;var J1=(v,l)=>{let o=new URL(v);return Object.entries(l||{}).forEach(([i,u])=>{u!=null&&o.searchParams.set(i,u)}),o},$h=J1;var ty=class extends Io{constructor(o){super();this.url=o.url,this.apiKey=o.apiKey}fetch(o,c,i){if(!this.apiKey&&!/key=/.test(this.url))return Promise.reject(new Error(`No apiKey defined for request to ${this.url}`));let u=c||{},P=$h(`${this.url}${o||""}`,{key:this.apiKey,...u});return fetch(P.toString(),i).then(D=>{try{return D.json().then(F=>{if(F.error)throw new Error(F.error);return F})}catch(F){return Promise.reject(new Error(F))}})}},dm=ty;var ey=class extends dm{constructor(l){super({url:"https://api.geops.io/routing/v1/",...l||{}})}route(l,o){return this.fetch("",l,o)}},Gf=ey;var ry=class extends dm{constructor(l={}){super({url:"https://api.geops.io/stops/v1/",...l})}search(l,o={}){return this.fetch("",l,{signal:o.signal})}},jf=ry;var Np=class{constructor(){this.defineProperties()}defineProperties(){Object.defineProperties(this,{closed:{get:()=>!!(this.websocket&&this.websocket.readyState===this.websocket.CLOSED)},closing:{get:()=>!!(this.websocket&&this.websocket.readyState===this.websocket.CLOSING)},connecting:{get:()=>!!(this.websocket&&this.websocket.readyState===this.websocket.CONNECTING)},open:{get:()=>!!(this.websocket&&this.websocket.readyState===this.websocket.OPEN)},messagesOnOpen:{value:[],writable:!0},subscriptions:{value:[],writable:!0},subscribed:{value:{},writable:!0}})}static getRequestString(l,o){let c=`${l} ${o.channel}`;return c+=o.args?` ${o.args}`:"",c+=o.id?` ${o.id}`:"",c.trim()}connect(l,o=()=>{}){this.websocket&&!this.closed&&this.websocket.close(),this.websocket=new WebSocket(l),this.open?(o(),this.subscribePreviousSubscriptions()):this.websocket.addEventListener("open",()=>{o(),this.subscribePreviousSubscriptions()})}close(){this.websocket&&(this.websocket.onclose=null,this.websocket.close(),this.websocket=null,this.messagesOnOpen=[])}send(l){if(!this.websocket)return;let o=()=>{this.websocket.send(l)};this.open?this.messagesOnOpen.includes(l)||o():this.messagesOnOpen.includes(l)||(this.messagesOnOpen.push(l),this.websocket.addEventListener("open",()=>{this.messagesOnOpen=[],o()}),this.websocket.addEventListener("close",()=>{this.messagesOnOpen=[]}))}listen(l,o,c){this.unlisten(l,o);let i=u=>{let P={};try{P=JSON.parse(u.data)}catch(U){console.error("WebSocket: unable to parse JSON data",U,u.data)}let D=l.channel;D+=l.args?` ${l.args}`:"",(P.source==="buffer"?P.content:[P]).forEach(U=>{U?.source===D&&(!l.id||l.id===P.client_reference)&&o(U)})};return this.websocket&&(this.websocket.addEventListener("message",i),c&&(this.websocket.addEventListener("error",c),this.websocket.addEventListener("close",c))),{onMessageCb:i,onErrorCb:c}}unlisten(l,o){!this.websocket||this.subscriptions.filter(c=>c.params.channel===l.channel&&(!o||c.cb===o)).forEach(({onMessageCb:c,onErrorCb:i})=>{this.websocket&&(this.websocket.removeEventListener("message",c),i&&(this.websocket.removeEventListener("error",i),this.websocket.removeEventListener("close",i)))})}get(l,o,c){let i=Np.getRequestString("GET",l);this.send(i),this.listen(l,o,c)}subscribe(l,o,c,i=!1){let{onMessageCb:u,onErrorCb:P}=this.listen(l,o,c),D=Np.getRequestString("",l),F=this.subscriptions.findIndex(N=>l.channel===N.params.channel&&o===N.cb),U={params:l,cb:o,errorCb:c,onMessageCb:u,onErrorCb:P,quiet:i};F>-1?this.subscriptions[F]=U:this.subscriptions.push(U),this.subscribed[D]||(U.quiet||(this.send(`GET ${D}`),this.send(`SUB ${D}`)),this.subscribed[D]=!0)}unsubscribe(l,o){let c=this.subscriptions.filter(i=>i.params.channel===l&&(!o||i.cb===o));c.forEach(({onMessageCb:i,onErrorCb:u})=>{this.websocket&&(this.websocket.removeEventListener("message",i),u&&(this.websocket.removeEventListener("error",u),this.websocket.removeEventListener("close",u)))}),this.subscriptions=this.subscriptions.filter(i=>i.params.channel!==l||o&&i.cb!==o),l&&this.subscribed[l]&&!this.subscriptions.find(i=>i.params.channel===l)&&c.find(i=>!i.quiet)&&(this.send(`DEL ${l}`),this.subscribed[l]=!1)}subscribePreviousSubscriptions(){Object.keys(this.subscribed).forEach(l=>{this.subscribed[l]=!1}),[...this.subscriptions].forEach(l=>{this.subscribe(l.params,l.cb,l.errorCb,l.quiet)})}},gv=Np;var Q1=v=>{if(!!v)return v.stations.forEach(l=>{l.arrivalTimeWithDelay=l.arrivalTime,l.departureTime&&(l.departureTimeWithDelay=l.departureTime),l.arrivalDelay&&(l.arrivalTime-=l.arrivalDelay,l.departureTime&&(l.departureTime-=l.arrivalDelay))}),v},iy=Q1;var tb=(v,l)=>v===l.SCHEMATIC?"_schematic":"",Tu=tb;var eb=(v,l,o=!1)=>{let c=["HIDDEN","LEAVING","BOARDING"],i=v.has_fzo&&c.indexOf(v.state)>-1,u=l.has_fzo&&c.indexOf(l.state)>-1;if(i||u){if(i!==u)return i?-1:1;if(v.state!==l.state)return c.indexOf(v.state)-c.indexOf(l.state)}let P=null,D=null,F=Date.now();return o?(P=new Date(v.min_arrival_time||v.time).getTime()-F,D=new Date(l.min_arrival_time||l.time).getTime()-F):(P=new Date(v.time).getTime()-F,D=new Date(l.time).getTime()-F),P-D},yv=eb;var Zo={RAW:"raw",TOPOGRAPHIC:"topographic",SCHEMATIC:"schematic"},ny=class{constructor(l={}){this.defineProperties(l),this.subscribedStationUic=null,this.departureUpdateTimeout=null,this.maxDepartureAge=30,this.extraGeoms={},this.prefix=l.prefix||"",this.onOpen=this.onOpen.bind(this)}defineProperties(l){let o=l;typeof l=="string"&&(o={url:l});let{apiKey:c}=o,{url:i,projection:u,bbox:P,buffer:D=[100,100]}=o,F=new gv;c&&(i=`${i||"wss://api.geops.io/tracker-ws/v1/"}?key=${c}`),Object.defineProperties(this,{url:{get:()=>i,set:U=>{i=U,this.open()}},projection:{get:()=>u,set:U=>{U!==u&&(u=U,this.wsApi&&this.wsApi.send(`PROJECTION ${u}`))}},bbox:{get:()=>P,set:U=>{JSON.stringify(U)!==JSON.stringify(P)&&(P=U,this.wsApi&&this.wsApi.send(`BBOX ${P.join(" ")}`))}},buffer:{get:()=>D,set:U=>{JSON.stringify(U)!==JSON.stringify(D)&&(D=U,this.wsApi&&this.wsApi.send(`BUFFER ${D.join(" ")}`))}},wsApi:{value:F,writable:!0},pingIntervalMs:{value:l.pingIntervalMs||1e4,writable:!0},reconnectTimeoutMs:{value:l.pingIntervalMs||100,writable:!0}})}open(){this.close(),this.wsApi.connect(this.url,this.onOpen),this.wsApi.websocket.onclose=()=>{this.onClose()}}close(){this.wsApi.close()}reset(){this.wsApi.send("RESET")}onOpen(){this.projection&&this.wsApi.send(`PROJECTION ${this.projection}`),this.bbox&&this.wsApi.send(`BBOX ${this.bbox.join(" ")}`),this.buffer&&this.wsApi.send(`BUFFER ${this.buffer.join(" ")}`),this.pingIntervalMs&&(window.clearInterval(this.pingInterval),this.pingInterval=setInterval(()=>{this.wsApi.send("PING")},this.pingIntervalMs))}onClose(){window.clearTimeout(this.pingInterval),window.clearTimeout(this.reconnectTimeout),this.reconnectTimeoutMs&&(this.reconnectTimeout=window.setTimeout(()=>this.open(),this.reconnectTimeoutMs))}subscribe(l,o,c,i=!1){this.wsApi.subscribe({channel:l},o,c,i)}unsubscribe(l,o,c){this.wsApi.unsubscribe(`${l}${Tu(Zo.SCHEMATIC,Zo)}${o}`,c),this.wsApi.unsubscribe(`${l}${Tu(Zo.TOPOGRAPHIC,Zo)}${o||""}`,c)}filterDepartures(l,o=!1){let c=Object.keys(l).map(U=>l[U]);c.sort((U,N)=>yv(U,N,o));let i=new Date;i.setMinutes(i.getMinutes()+this.maxDepartureAge),i=i.getTime();let u=new Date;u.setMinutes(u.getMinutes()-this.maxDepartureAge),u=u.getTime();let P=[],D=[],F=null;for(let U=c.length-1;U>=0;U-=1){let N=c[U],at=new Date(N.time).getTime();at>u&&at<i&&(N.state==="BOARDING"&&(D.indexOf(N.platform)===-1?D.push(N.platform):N.state="HIDDEN"),F&&N.to[0]===F.to[0]&&Math.abs(at-F.time)<1e3&&N.line.name===F.line.name&&(N.state="HIDDEN"),/(STOP_CANCELLED|JOURNEY_CANCELLED)/.test(N.state)&&(N.cancelled=!0),F=N,F.time=at,P.unshift(N))}return P}subscribeDepartures(l,o,c){window.clearTimeout(this.departureUpdateTimeout),this.unsubscribeDepartures(),this.subscribedStationUic=l;let i=l?`timetable_${l}`:null,u={};this.subscribe(i,P=>{if(P.source===i){let D=P.content||{},F=new Date(D.timestamp).getTime()-Date.now();D.timediff=F,u[D.call_id]=D,window.clearTimeout(this.departureUpdateTimeout),this.departureUpdateTimeout=window.setTimeout(()=>{let U=this.filterDepartures(u,o||!1);c(U)},100)}},()=>{c([])})}unsubscribeDepartures(l){this.subscribedStationUic&&(this.unsubscribe(`timetable_${this.subscribedStationUic}`,"",l),this.subscribedStationUic=null)}subscribeDisruptions(l){this.subscribe(`${this.prefix}newsticker`,o=>{l(o.content)})}unsubscribeDisruptions(l){this.unsubscribe(`${this.prefix}newsticker`,"",l)}getStation(l,o){let c={channel:`station${Tu(o,Zo)}`,args:l};return new Promise((i,u)=>{this.wsApi.get(c,P=>{P.content?i(P.content):u()})})}getStations(l){let o=[],c={channel:`station${Tu(l,Zo)}`};return window.clearTimeout(this.stationUpdateTimeout),new Promise((i,u)=>{this.wsApi.get(c,P=>{P.content?(o.push(P.content),window.clearTimeout(this.stationUpdateTimeout),this.stationUpdateTimeout=window.setTimeout(()=>{i(o)},50)):u(P.content)})})}subscribeStations(l,o){this.unsubscribeStations(),this.subscribe(`station${Tu(l,Zo)}`,c=>{c.content&&o(c.content)})}unsubscribeStations(l){window.clearTimeout(this.stationUpdateTimeout),this.unsubscribe("station","",l)}subscribeExtraGeoms(l){this.subscribe("extra_geoms",o=>{let c=o.content;if(c){let{ref:i}=c.properties;c.type==="Feature"?this.extraGeoms[i]=c:delete this.extraGeoms[i],l(Object.keys(this.extraGeoms).map(u=>this.extraGeoms[u]))}})}unsubscribeExtraGeoms(l){this.unsubscribe("extra_geoms","",l)}subscribeTrajectory(l,o,c=!1){this.unsubscribeTrajectory(o),this.subscribe(`trajectory${Tu(l,Zo)}`,o,null,c)}unsubscribeTrajectory(l){this.unsubscribe("trajectory","",l)}subscribeDeletedVehicles(l,o,c=!1){this.unsubscribeDeletedVehicles(o),this.subscribe(`deleted_vehicles${Tu(l,Zo)}`,o,null,c)}unsubscribeDeletedVehicles(l){this.unsubscribe("deleted_vehicles","",l)}getFullTrajectory(l,o,c){let i=[`full_trajectory${Tu(o,Zo)}`];l&&i.push(l),(!o||o===Zo.TOPOGRAPHIC)&&c&&i.push(`gen${c}`);let u={channel:i.join("_")};return new Promise(P=>{this.wsApi.get(u,D=>{D.content&&P(D.content)})})}getFullTrajectories(l,o,c){let i=l.map(u=>this.getFullTrajectory(u,o,c));return Promise.all(i)}subscribeFullTrajectory(l,o){this.unsubscribeFullTrajectory(l),this.subscribe(`full_trajectory${Tu(o,Zo)}_${l}`,c=>{console.log("subscribe full_trajectory",c)},c=>{console.log("subscribe full_trajectory error",c)})}unsubscribeFullTrajectory(l,o){this.unsubscribe("full_trajectory",`_${l}`,o)}getStopSequence(l){let o={channel:`stopsequence_${l}`};return new Promise((c,i)=>{this.wsApi.get(o,u=>{if(u.content&&u.content.length){let P=u.content.map(D=>iy(D));c(P)}c([])},u=>{i(u)})})}getStopSequences(l){let o=l.map(c=>this.getStopSequence(c));return Promise.all(o)}subscribeStopSequence(l,o){window.clearTimeout(this.fullTrajectoryUpdateTimeout),this.unsubscribeStopSequence(l),this.subscribe(`stopsequence_${l}`,c=>{if(c.content&&c.content.length){let i=c.content.map(u=>iy(u));o(i)}},c=>{console.log("subscribe stopsequence error",c)})}unsubscribeStopSequence(l,o){this.unsubscribe("stopsequence",`_${l}`,o)}subscribeHealthCheck(l){this.unsubscribeHealthCheck(),this.subscribe("healthcheck",l)}unsubscribeHealthCheck(){this.unsubscribe("healthcheck")}},qf=ny;var rb=v=>{let l=v.filter(u=>u!=null&&u.trim&&u.trim()),o=l.map(u=>u.toLowerCase());return[...new Set(o)].map(u=>l.find(P=>P.toLowerCase()===u))},Kh=rb;var ib=v=>{if(!v||!v.style)return[];let{sourceCaches:l}=v.style,o=[];return Object.values(l).forEach(c=>{if(c.used){let i=c.getSource(),u=i.attribution||i.options&&i.options.attribution;u&&(o=o.concat(u.replace(/&copy;/g,"\xA9").split(/(<a.*?<\/a>)/)))}}),Kh(o)},fc=ib;var nb=(v,l,o,c)=>{let i=[];if(!v&&!l&&!o&&!c)return null;if(c){let u=typeof c=="string"?[c]:c,P=D=>{let F=D.properties.name||D.properties.line&&D.properties.line.name||"";return F?u.some(U=>new RegExp(U,"i").test(F)):!1};i.push(P)}if(v){let P=(typeof v=="string"?v.split(","):v).map(F=>F.replace(/\s+/g,"").toUpperCase()),D=F=>{let{line:U,name:N}=F.properties,at=(N||U&&U.name||"").toUpperCase();return at?P.includes(at):!1};i.push(D)}if(l){let P=(typeof l=="string"?l.split(","):l).map(F=>parseInt(F,10)),D=F=>{let U=parseInt(F.properties.routeIdentifier.split(".")[0],10);return P.includes(U)};i.push(D)}if(o){let u=typeof o=="string"?[o]:o,P=D=>u.some(F=>new RegExp(F,"i").test(D.properties.operator));i.push(P)}return i.length?u=>{for(let P=0;P<i.length;P+=1)if(!i[P](u))return!1;return!0}:null},oy=nb;var _v=v=>{let l=v;Array.isArray(l)||(l=[v]);let o=[];return l.forEach(c=>{o.push(c);let{children:i}=c;o=o.concat(_v(i||[]))}),o},Zf=_v;var vv=(v=new Date)=>{let l=(v.getUTCMonth()+1).toString();l=l.length===1?`0${l}`:l;let o=v.getUTCDate().toString();return o=o.length===1?`0${o}`:o,[v.getUTCFullYear(),l,o].join("")},xv=v=>[v.getUTCHours(),v.getUTCMinutes(),`${v.getUTCSeconds()}.${v.getUTCMilliseconds()}`].join(":"),mm=v=>v<10?`0${v}`:v,bv=v=>{if(!v||v<=0)return"";let l=new Date(v);return`${mm(l.getHours())}:${mm(l.getMinutes())}`};var ob=(v,l)=>{let o=v.properties,c=l.properties;return o.delay===null&&c.delay!==null?1:c.delay===null&&o.delay!==null?-1:o.cancelled&&!c.cancelled?c.delay<18e4?-1:1:c.cancelled&&!o.cancelled?o.delay<18e4?1:-1:c.delay-o.delay},ay=ob;var oh=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",wT=oh.indexOf("firefox")!==-1,ab=oh.indexOf("safari")!==-1&&oh.indexOf("chrom")==-1,ET=ab&&!!(oh.indexOf("version/15.4")>=0||oh.match(/cpu (os|iphone os) 15_4 like mac os x/)),ST=oh.indexOf("webkit")!==-1&&oh.indexOf("edge")==-1,TT=oh.indexOf("macintosh")!==-1;var ah=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,wv=typeof Image<"u"&&Image.prototype.decode,IT=function(){var v=!1;try{var l=Object.defineProperty({},"passive",{get:function(){v=!0}});window.addEventListener("_",null,l),window.removeEventListener("_",null,l)}catch{}return v}();var sb=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),lb=function(v){sb(l,v);function l(o){var c=this,i=fm==="latest"?fm:"v"+fm.split("-")[0],u="Assertion failed. See https://openlayers.org/en/"+i+"/doc/errors/#"+o+" for details.";return c=v.call(this,u)||this,c.code=o,c.name="AssertionError",c.message=u,c}return l}(Error),gm=lb;function fn(v,l){if(!v)throw new gm(l)}var RT=new Array(6);function va(){return[1,0,0,1,0,0]}function ub(v,l,o,c,i,u,P){return v[0]=l,v[1]=o,v[2]=c,v[3]=i,v[4]=u,v[5]=P,v}function Sv(v,l){return v[0]=l[0],v[1]=l[1],v[2]=l[2],v[3]=l[3],v[4]=l[4],v[5]=l[5],v}function uo(v,l){var o=l[0],c=l[1];return l[0]=v[0]*o+v[2]*c+v[4],l[1]=v[1]*o+v[3]*c+v[5],l}function Tv(v,l,o){return ub(v,l,0,0,o,0,0)}function us(v,l,o,c,i,u,P,D){var F=Math.sin(u),U=Math.cos(u);return v[0]=c*U,v[1]=i*F,v[2]=-c*F,v[3]=i*U,v[4]=P*c*U-D*c*F+l,v[5]=P*i*F+D*i*U+o,v}function Iv(v,l,o,c,i,u,P){return sy(us(va(),v,l,o,c,i,u,P))}function Cv(v,l){var o=cb(l);fn(o!==0,32);var c=l[0],i=l[1],u=l[2],P=l[3],D=l[4],F=l[5];return v[0]=P/o,v[1]=-i/o,v[2]=-u/o,v[3]=c/o,v[4]=(u*F-P*D)/o,v[5]=-(c*F-i*D)/o,v}function cb(v){return v[0]*v[3]-v[1]*v[2]}var Ev;function sy(v){var l="matrix("+v.join(", ")+")";if(ah)return l;var o=Ev||(Ev=document.createElement("div"));return o.style.transform=l,o.style.transform}var Ie={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"};var hb=(v,l,o)=>{let{time_intervals:c,olGeometry:i,coordinate:u}=l.properties,P,D;if(o&&u)P=u;else if(i.getType()===Ie.POINT)P=i.getCoordinates();else if(i.getType()===Ie.LINE_STRING){let F=c||[[]],U=F[0],N=F[F.length-1];if(v<U[0])[,,D]=U,P=i.getFirstCoordinate();else if(v>N[0])[,,D]=N,P=i.getLastCoordinate();else for(let at=0;at<F.length-1;at+=1){let[yt,Tt]=F[at],[kt,Vt]=F[at+1];if(yt<=v&&v<=kt){let Lt=Math.min((v-yt)/(kt-yt),1)*(Vt-Tt)+Tt;P=i.getCoordinateAt(Lt),[,,D]=F[at];break}}}else console.error("This geometry type is not supported. Only Point or LineString are. Current geometry: ",i);return{coord:P,rotation:D}},Av=hb;var pb=(v,l,o,c,i)=>{if(!v)return{};let{time:u=Date.now(),size:P=[],center:D,resolution:F,rotation:U=0,pixelRatio:N}=c,{noInterpolate:at=!1,hoverVehicleId:yt,selectedVehicleId:Tt}=i,kt=v.getContext("2d");kt.clearRect(0,0,v.width,v.height);let[Vt,wt]=P;Vt&&wt&&(v.width!==Vt||v.height!==wt)&&([v.width,v.height]=[Vt*N,wt*N]);let Lt=us(va(),P[0]/2,P[1]/2,1/F,-1/F,-U,-D[0],-D[1]);v.style&&(v.style.width=`${v.width/N}px`,v.style.height=`${v.height/N}px`);let Zt,Jt,se,ce,oe,ye,be,Me,ir=[];for(let Be=l.length-1;Be>=0;Be-=1){let qe=l[Be],{train_id:rr,timeOffset:Ce}=qe.properties,{coord:Lr,rotation:yr}=Av(u-(Ce||0),qe,at);if(l[Be].properties.coordinate=Lr,l[Be].properties.rotation=yr,!Lr)continue;let _r=uo(Lt,[...Lr]);if(!_r||(_r=_r.map($r=>$r*N),_r[0]<0||_r[0]>v.width||_r[1]<0||_r[1]>v.height))continue;let br=o(qe,c,i);if(!br)continue;let xr=br.width,pr=br.height;yt!==rr&&Tt!==rr&&kt.drawImage(br,_r[0]-xr/2,_r[1]-pr/2,xr,pr),yt&&yt===rr&&(Zt=br,Jt=_r,se=xr,ce=pr),Tt&&Tt===rr&&(oe=br,ye=_r,be=xr,Me=pr),ir.push(qe)}return oe&&kt.drawImage(oe,ye[0]-be/2,ye[1]-Me/2,be,Me),Zt&&kt.drawImage(Zt,Jt[0]-se/2,Jt[1]-ce/2,se,ce),{renderedTrajectories:ir}},Xf=pb;var Gl={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},GT={9001:Gl.METERS,9002:Gl.FEET,9003:Gl.USFEET,9101:Gl.RADIANS,9102:Gl.DEGREES};var Iu={};Iu[Gl.RADIANS]=6370997/(2*Math.PI);Iu[Gl.DEGREES]=2*Math.PI*6370997/360;Iu[Gl.FEET]=.3048;Iu[Gl.METERS]=1;Iu[Gl.USFEET]=1200/3937;var dc=Gl;var fb=function(){function v(l){this.code_=l.code,this.units_=l.units,this.extent_=l.extent!==void 0?l.extent:null,this.worldExtent_=l.worldExtent!==void 0?l.worldExtent:null,this.axisOrientation_=l.axisOrientation!==void 0?l.axisOrientation:"enu",this.global_=l.global!==void 0?l.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=l.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=l.metersPerUnit}return v.prototype.canWrapX=function(){return this.canWrapX_},v.prototype.getCode=function(){return this.code_},v.prototype.getExtent=function(){return this.extent_},v.prototype.getUnits=function(){return this.units_},v.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Iu[this.units_]},v.prototype.getWorldExtent=function(){return this.worldExtent_},v.prototype.getAxisOrientation=function(){return this.axisOrientation_},v.prototype.isGlobal=function(){return this.global_},v.prototype.setGlobal=function(l){this.global_=l,this.canWrapX_=!!(l&&this.extent_)},v.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},v.prototype.setDefaultTileGrid=function(l){this.defaultTileGrid_=l},v.prototype.setExtent=function(l){this.extent_=l,this.canWrapX_=!!(this.global_&&l)},v.prototype.setWorldExtent=function(l){this.worldExtent_=l},v.prototype.setGetPointResolution=function(l){this.getPointResolutionFunc_=l},v.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},v}(),ym=fb;function jl(v,l,o){return Math.min(Math.max(v,l),o)}var Pv=function(){var v;return"cosh"in Math?v=Math.cosh:v=function(l){var o=Math.exp(l);return(o+1/o)/2},v}(),XT=function(){var v;return"log2"in Math?v=Math.log2:v=function(l){return Math.log(l)*Math.LOG2E},v}();function Mv(v,l,o,c,i,u){var P=i-o,D=u-c;if(P!==0||D!==0){var F=((v-o)*P+(l-c)*D)/(P*P+D*D);F>1?(o=i,c=u):F>0&&(o+=P*F,c+=D*F)}return ql(v,l,o,c)}function ql(v,l,o,c){var i=o-v,u=c-l;return i*i+u*u}function Lv(v){return v*180/Math.PI}function _m(v,l){var o=v%l;return o*l<0?o+l:o}function el(v,l,o){return v+o*(l-v)}var db=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),Wf=6378137,Gp=Math.PI*Wf,mb=[-Gp,-Gp,Gp,Gp],gb=[-180,-85,180,85],vm=Wf*Math.log(Math.tan(Math.PI/2)),Vp=function(v){db(l,v);function l(o){return v.call(this,{code:o,units:dc.METERS,extent:mb,global:!0,worldExtent:gb,getPointResolution:function(c,i){return c/Pv(i[1]/Wf)}})||this}return l}(ym),ly=[new Vp("EPSG:3857"),new Vp("EPSG:102100"),new Vp("EPSG:102113"),new Vp("EPSG:900913"),new Vp("http://www.opengis.net/def/crs/EPSG/0/3857"),new Vp("http://www.opengis.net/gml/srs/epsg.xml#3857")];function kv(v,l,o){var c=v.length,i=o>1?o:2,u=l;u===void 0&&(i>2?u=v.slice():u=new Array(c));for(var P=0;P<c;P+=i){u[P]=Gp*v[P]/180;var D=Wf*Math.log(Math.tan(Math.PI*(+v[P+1]+90)/360));D>vm?D=vm:D<-vm&&(D=-vm),u[P+1]=D}return u}function zv(v,l,o){var c=v.length,i=o>1?o:2,u=l;u===void 0&&(i>2?u=v.slice():u=new Array(c));for(var P=0;P<c;P+=i)u[P]=180*v[P]/Gp,u[P+1]=360*Math.atan(Math.exp(v[P+1]/Wf))/Math.PI-90;return u}var yb=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),_b=6378137,Rv=[-180,-90,180,90],vb=Math.PI*_b/180,Yh=function(v){yb(l,v);function l(o,c){return v.call(this,{code:o,units:dc.DEGREES,extent:Rv,axisOrientation:c,global:!0,metersPerUnit:vb,worldExtent:Rv})||this}return l}(ym),uy=[new Yh("CRS:84"),new Yh("EPSG:4326","neu"),new Yh("urn:ogc:def:crs:OGC:1.3:CRS84"),new Yh("urn:ogc:def:crs:OGC:2:84"),new Yh("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Yh("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Yh("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];var cy={};function Dv(v){return cy[v]||cy[v.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function Ov(v,l){cy[v]=l}var jp={};function $f(v,l,o){var c=v.getCode(),i=l.getCode();c in jp||(jp[c]={}),jp[c][i]=o}function Fv(v,l){var o;return v in jp&&l in jp[v]&&(o=jp[v][l]),o}var Co={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Cu(v){for(var l=Va(),o=0,c=v.length;o<c;++o)hy(l,v[o]);return l}function xb(v,l,o){var c=Math.min.apply(null,v),i=Math.min.apply(null,l),u=Math.max.apply(null,v),P=Math.max.apply(null,l);return sh(c,i,u,P,o)}function rl(v,l,o){return o?(o[0]=v[0]-l,o[1]=v[1]-l,o[2]=v[2]+l,o[3]=v[3]+l,o):[v[0]-l,v[1]-l,v[2]+l,v[3]+l]}function Bv(v,l){return l?(l[0]=v[0],l[1]=v[1],l[2]=v[2],l[3]=v[3],l):v.slice()}function cs(v,l,o){var c,i;return l<v[0]?c=v[0]-l:v[2]<l?c=l-v[2]:c=0,o<v[1]?i=v[1]-o:v[3]<o?i=o-v[3]:i=0,c*c+i*i}function qp(v,l){return Kf(v,l[0],l[1])}function mc(v,l){return v[0]<=l[0]&&l[2]<=v[2]&&v[1]<=l[1]&&l[3]<=v[3]}function Kf(v,l,o){return v[0]<=l&&l<=v[2]&&v[1]<=o&&o<=v[3]}function xm(v,l){var o=v[0],c=v[1],i=v[2],u=v[3],P=l[0],D=l[1],F=Co.UNKNOWN;return P<o?F=F|Co.LEFT:P>i&&(F=F|Co.RIGHT),D<c?F=F|Co.BELOW:D>u&&(F=F|Co.ABOVE),F===Co.UNKNOWN&&(F=Co.INTERSECTING),F}function Va(){return[1/0,1/0,-1/0,-1/0]}function sh(v,l,o,c,i){return i?(i[0]=v,i[1]=l,i[2]=o,i[3]=c,i):[v,l,o,c]}function Zp(v){return sh(1/0,1/0,-1/0,-1/0,v)}function Xp(v,l){var o=v[0],c=v[1];return sh(o,c,o,c,l)}function bm(v,l,o,c,i){var u=Zp(i);return py(u,v,l,o,c)}function wm(v,l){return v[0]==l[0]&&v[2]==l[2]&&v[1]==l[1]&&v[3]==l[3]}function Uv(v,l){return l[0]<v[0]&&(v[0]=l[0]),l[2]>v[2]&&(v[2]=l[2]),l[1]<v[1]&&(v[1]=l[1]),l[3]>v[3]&&(v[3]=l[3]),v}function hy(v,l){l[0]<v[0]&&(v[0]=l[0]),l[0]>v[2]&&(v[2]=l[0]),l[1]<v[1]&&(v[1]=l[1]),l[1]>v[3]&&(v[3]=l[1])}function py(v,l,o,c,i){for(;o<c;o+=i)bb(v,l[o],l[o+1]);return v}function bb(v,l,o){v[0]=Math.min(v[0],l),v[1]=Math.min(v[1],o),v[2]=Math.max(v[2],l),v[3]=Math.max(v[3],o)}function Nv(v,l){var o;return o=l(fy(v)),o||(o=l(dy(v)),o)||(o=l(gy(v)),o)||(o=l(my(v)),o)?o:!1}function fy(v){return[v[0],v[1]]}function dy(v){return[v[2],v[1]]}function Hh(v){return[(v[0]+v[2])/2,(v[1]+v[3])/2]}function Au(v){return v[3]-v[1]}function Vv(v,l,o){var c=o||Va();return Ao(v,l)?(v[0]>l[0]?c[0]=v[0]:c[0]=l[0],v[1]>l[1]?c[1]=v[1]:c[1]=l[1],v[2]<l[2]?c[2]=v[2]:c[2]=l[2],v[3]<l[3]?c[3]=v[3]:c[3]=l[3]):Zp(c),c}function my(v){return[v[0],v[3]]}function gy(v){return[v[2],v[3]]}function hs(v){return v[2]-v[0]}function Ao(v,l){return v[0]<=l[2]&&v[2]>=l[0]&&v[1]<=l[3]&&v[3]>=l[1]}function Gv(v,l){return l?(l[0]=v[0],l[1]=v[1],l[2]=v[2],l[3]=v[3],l):v}function jv(v,l,o){var c=!1,i=xm(v,l),u=xm(v,o);if(i===Co.INTERSECTING||u===Co.INTERSECTING)c=!0;else{var P=v[0],D=v[1],F=v[2],U=v[3],N=l[0],at=l[1],yt=o[0],Tt=o[1],kt=(Tt-at)/(yt-N),Vt=void 0,wt=void 0;!!(u&Co.ABOVE)&&!(i&Co.ABOVE)&&(Vt=yt-(Tt-U)/kt,c=Vt>=P&&Vt<=F),!c&&!!(u&Co.RIGHT)&&!(i&Co.RIGHT)&&(wt=Tt-(yt-F)*kt,c=wt>=D&&wt<=U),!c&&!!(u&Co.BELOW)&&!(i&Co.BELOW)&&(Vt=yt-(Tt-D)/kt,c=Vt>=P&&Vt<=F),!c&&!!(u&Co.LEFT)&&!(i&Co.LEFT)&&(wt=Tt-(yt-P)*kt,c=wt>=D&&wt<=U)}return c}function qv(v,l,o,c){var i=[];if(c>1)for(var u=v[2]-v[0],P=v[3]-v[1],D=0;D<c;++D)i.push(v[0]+u*D/c,v[1],v[2],v[1]+P*D/c,v[2]-u*D/c,v[3],v[0],v[3]-P*D/c);else i=[v[0],v[1],v[2],v[1],v[2],v[3],v[0],v[3]];l(i,i,2);for(var F=[],U=[],D=0,N=i.length;D<N;D+=2)F.push(i[D]),U.push(i[D+1]);return xb(F,U,o)}function Zv(v,l){var o=l.getExtent(),c=Hh(v);if(l.canWrapX()&&(c[0]<o[0]||c[0]>=o[2])){var i=hs(o),u=Math.floor((c[0]-o[0])/i),P=u*i;v[0]-=P,v[2]-=P}return v}function yy(v,l){var o=v[0],c=v[1],i=l[0],u=l[1],P=i[0],D=i[1],F=u[0],U=u[1],N=F-P,at=U-D,yt=N===0&&at===0?0:(N*(o-P)+at*(c-D))/(N*N+at*at||0),Tt,kt;return yt<=0?(Tt=P,kt=D):yt>=1?(Tt=F,kt=U):(Tt=P+yt*N,kt=D+yt*at),[Tt,kt]}function Pu(v,l){for(var o=!0,c=v.length-1;c>=0;--c)if(v[c]!=l[c]){o=!1;break}return o}function Wp(v,l){var o=v[0]-l[0],c=v[1]-l[1];return o*o+c*c}function _y(v,l){return Math.sqrt(Wp(v,l))}function Xv(v,l){return Wp(v,yy(v,l))}function Wv(v,l){if(l.canWrapX()){var o=hs(l.getExtent()),c=$v(v,l,o);c&&(v[0]-=c*o)}return v}function $v(v,l,o){var c=l.getExtent(),i=0;if(l.canWrapX()&&(v[0]<c[0]||v[0]>c[2])){var u=o||hs(c);i=Math.floor((v[0]-c[0])/u)}return i}var vy=!0;function wb(v){var l=v===void 0?!0:v;vy=!l}function xy(v,l,o){var c;if(l!==void 0){for(var i=0,u=v.length;i<u;++i)l[i]=v[i];c=l}else c=v.slice();return c}function Eb(v,l,o){if(l!==void 0&&v!==l){for(var c=0,i=v.length;c<i;++c)l[c]=v[c];v=l}return v}function Sb(v){Ov(v.getCode(),v),$f(v,v,xy)}function Tb(v){v.forEach(Sb)}function ta(v){return typeof v=="string"?Dv(v):v||null}function Kv(v){Tb(v),v.forEach(function(l){v.forEach(function(o){l!==o&&$f(l,o,xy)})})}function Ib(v,l,o,c){v.forEach(function(i){l.forEach(function(u){$f(i,u,o),$f(u,i,c)})})}function ro(v,l){return wb(),Sm(v,"EPSG:4326",l!==void 0?l:"EPSG:3857")}function lh(v,l){var o=Sm(v,l!==void 0?l:"EPSG:3857","EPSG:4326"),c=o[0];return(c<-180||c>180)&&(o[0]=_m(c+180,360)-180),o}function Yv(v,l){if(v===l)return!0;var o=v.getUnits()===l.getUnits();if(v.getCode()===l.getCode())return o;var c=Em(v,l);return c===xy&&o}function Em(v,l){var o=v.getCode(),c=l.getCode(),i=Fv(o,c);return i||(i=Eb),i}function Yf(v,l){var o=ta(v),c=ta(l);return Em(o,c)}function Sm(v,l,o){var c=Yf(l,o);return c(v,void 0,v.length)}function Hf(v,l,o,c){var i=Yf(l,o);return qv(v,i,void 0,c)}var Zl=null;function uh(){return Zl}function by(v,l){return Zl?Sm(v,l,Zl):v}function Xl(v,l){return Zl?Sm(v,Zl,l):(vy&&!Pu(v,[0,0])&&v[0]>=-180&&v[0]<=180&&v[1]>=-90&&v[1]<=90&&(vy=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),v)}function $p(v,l){return Zl?Hf(v,l,Zl):v}function Jf(v,l){return Zl?Hf(v,Zl,l):v}function Hv(v,l){if(!Zl)return v;var o=ta(l).getUnits(),c=Zl.getUnits();return o&&c?v*Iu[o]/Iu[c]:v}function Cb(){Kv(ly),Kv(uy),Ib(uy,ly,kv,zv)}Cb();function Kp(v){return l=>{let{map:o,mbMap:c,olLayer:i}=v;if(!o||!c)return null;let u=c.getCanvas(),{viewState:P}=l,D=i.getOpacity();return u.style.opacity=D,c.jumpTo({center:lh(P.center),zoom:P.zoom-1,bearing:Lv(-P.rotation),animate:!1}),u.isConnected?(u.width!==l.size[0]||u.height!==l.size[1])&&c.resize():o.render(),c.redraw(),c.getContainer()}}function Yp(v){return l=>{let{map:o,mbMap:c,renderState:i,olLayer:u}=v;if(!o||!c)return null;let P=!1,D=c.getCanvas(),{viewState:F}=l,U=u.getVisible();i.visible!==U&&(D.style.display=U?"block":"none",i.visible=U,D.style.position="absolute");let N=u.getOpacity();i.opacity!==N&&(D.style.opacity=N,i.opacity=N);let{rotation:at}=F;i.rotation!==at&&(c.rotateTo(-(at||0)*180/Math.PI,{animate:!1}),P=!0,i.rotation=at),(i.zoom!==F.zoom||i.center[0]!==F.center[0]||i.center[1]!==F.center[1])&&(c.jumpTo({center:lh(F.center),zoom:F.zoom-1,animate:!1}),P=!0,i.zoom=F.zoom,i.center=F.center);let yt=o.getSize();if((i.size[0]!==yt[0]||i.size[1]!==yt[1])&&(P=!0,i.size=yt),c&&c.style&&c.isStyleLoaded()&&P)try{c._frame&&(c._frame.cancel(),c._frame=null),c._render()}catch(Tt){console.warn(Tt)}return c.getContainer()}}var Hp={};Qg(Hp,{bgColors:()=>Qv,getBgColor:()=>Mb,getDelayColor:()=>zb,getDelayText:()=>Rb,getRadius:()=>Pb,getTextColor:()=>Lb,getTextSize:()=>kb,getTypeIndex:()=>Tm,textColors:()=>tx,types:()=>Jv});var Ab={0:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],1:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],2:[0,0,0,0,0,2,2,3,7,7,7,12,15,15,15,15,15],3:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],4:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],5:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],6:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],7:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],8:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],9:[0,0,0,0,0,2,2,3,7,7,7,12,15,15,15,15,15]},Jv=[/^Tram/i,/^Subway( \/ Metro \/ S-Bahn)?/i,/^Train/i,/^Bus/i,/^Ferry/i,/^Cable ?Car/i,/^Gondola/i,/^Funicular/i,/^(Long distance bus|coach)/i,/^Rail/i],Qv=["#ffb400","#ff5400","#ff8080","#ea0000","#3000ff","#ffb400","#41a27b","#00d237","#b5b5b5","#ff8080"],tx=["#000000","#ffffff","#000000","#ffffff","#ffffff","#000000","#ffffff","#000000","#000000","#000000"],Tm=v=>typeof v=="string"?Jv.findIndex(l=>l.test(v)):v,Pb=(v,l)=>{try{let o=Tm(v||0);return Ab[o][l]}catch{return 1}},Mb=(v=0)=>{try{let l=Tm(v);return Qv[l]}catch{return 1}},Lb=(v=0)=>{try{let l=Tm(v);return tx[l]}catch{return 1}},kb=(v,l,o,c)=>{v.font=`bold ${c}px Arial`;let i=v.measureText(o),u=25,P=0;for(;i.width>l-6&&P<u;)c-=.5,v.font=`bold ${c}px arial, sans-serif`,i=v.measureText(o),P+=1;return c},zb=(v,l,o)=>l?o?"#ff0000":"#a0a0a0":v>=36e5?"#ed004c":v>=5e5?"#e80000":v>=3e5?"#ff4a00":v>=18e4?"#f7bf00":v===null?"#a0a0a0":"#00a00c",Rb=(v,l)=>l?String.fromCodePoint(215):v>36e5?`+${Math.round(v/36e5)}h`:v>59e3?`+${Math.round(v/6e4)}m`:v>0?`+${v}s`:"";var Db=(v,l)=>{let o=null;return typeof window>"u"?null:(document?.createElement?(o=document.createElement("canvas"),o.width=v,o.height=l):OffscreenCanvas?o=new OffscreenCanvas(v,l):console.error("We didn't find a way to create a canvas element, document.createElement('canvas') and new OffscrenCanvas() are not supported"),o)},Jp=Db;var wy={},Iy=(v,l,o)=>{let c=`${v}, ${l}, ${o}`;if(!wy[c]){let i=Jp(v*2,v*2);if(i){let u=i.getContext("2d");u.beginPath(),u.arc(v,v,l,0,2*Math.PI,!1),u.fillStyle=o,u.filter="blur(1px)",u.fill(),wy[c]=i}}return wy[c]},Ey={},Cy=(v,l,o,c,i,u="#000",P=1)=>{let D=`${v}, ${l}, ${c}, ${i}, ${u}, ${P}`;if(!Ey[D]){let F=Jp(v,o+8*P);if(F){let U=F.getContext("2d");U.textAlign="left",U.textBaseline="middle",U.font=c,U.fillStyle=i,U.strokeStyle=u,U.lineWidth=1.5*P;let N=l;U.strokeText(N,0,o),U.fillText(N,0,o),Ey[D]=F}}return Ey[D]},Sy={},Ay=(v,l,o,c,i,u)=>{let P=`${v}, ${l}, ${o}, ${c}, ${i}, ${u}`;if(!Sy[P]){let D=Jp(v*2,v*2);if(D){let F=D.getContext("2d");F.fillStyle=o,c&&(F.lineWidth=1*u,F.strokeStyle="#000000"),F.beginPath(),F.arc(v,v,l,0,2*Math.PI,!1),F.fill(),i&&F.setLineDash([5,3]),c&&F.stroke(),Sy[P]=D}}return Sy[P]},Ty={},Py=(v,l,o,c,i,u,P)=>{let D=`${v}, ${l}, ${o}, ${c},${i}, ${u}, ${P}`;if(!Ty[D]){let F=Jp(l*2,l*2);if(F){let U=F.getContext("2d");u&&(U.save(),U.textBaseline="middle",U.textAlign="center",U.font=`bold ${o+2}px Arial`,U.strokeStyle=i,U.strokeText(v,l,l),U.restore()),U.textBaseline="middle",U.textAlign="center",U.fillStyle=c,U.font=`bold ${o}px Arial`,U.strokeStyle=i,U.strokeText(v,l,l),U.fillText(v,l,l),Ty[D]=F}}return Ty[D]},Im={},Ob=(v,l,o)=>{let{hoverVehicleId:c,selectedVehicleId:i,useDelayStyle:u,delayOutlineColor:P="#000",delayDisplay:D=3e5,getRadius:F,getBgColor:U,getDelayColor:N,getDelayText:at,getTextColor:yt,getTextSize:Tt}=o,{zoom:kt,pixelRatio:Vt}=l,{type:wt,cancelled:Lt}=v.properties,{train_id:Zt,line:Jt,delay:se,state:ce,operator_provides_realtime_journey:oe}=v.properties,{name:ye,text_color:be,color:Me}=Jt||{};Lt=Lt===!0||ce==="JOURNEY_CANCELLED",wt||(wt="Rail"),ye||(ye="I"),be||(be="#000000"),Me&&Me[0]!=="#"&&(Me=`#${Me}`),be[0]!=="#"&&(be=`#${be}`);let ir=Math.min(Math.floor(kt||1),16),Be=c&&c===Zt,qe=i&&i===Zt,rr=F(wt,ir)*Vt,Ce=rr>=7*Vt;(Be||qe)&&(rr=Ce?rr+5*Vt:14*Vt);let Lr=rr>10*Vt,yr=`${rr}${Be}${qe}${Lt}${se}`;if(u?yr+=`${oe}`:yr+=`${wt}${Me}`,Lr&&(yr+=`${ye}${be}`),!Im[yr]){if(rr===0)return Im[yr]=null,null;let _r=1*Vt,br=rr+2,xr=rr*2,pr=br*2+_r*2+100*Vt,$r=pr/2,Fe=Jp(pr,pr);if(Fe){let ti=Fe.getContext("2d");if(Ce&&se!==null){let Di=Iy($r,br,N(se,Lt));ti.drawImage(Di,0,0)}if(Ce&&(Be||se>=D||Lt)){let Di=Math.max(Lt?19:14,Math.min(Lt?19:17,rr*1.2))*Vt,vn=at(se,Lt);if(vn){let sn=vn.length*Di,dr=Cy(sn,vn,Di,`bold ${Di}px arial, sans-serif`,N(se,Lt,!0),P,Vt);ti.drawImage(dr,$r+br+_r,$r-Di)}}let oi;u?oi=N(se,Lt):oi=Me||U(wt);let Wr=Ay($r,rr,oi,Ce||Be||qe,Ce&&u&&se===null&&oe==="yes",Vt);if(ti.drawImage(Wr,0,0),Lr){let Di=Math.max(rr,10),vn=Tt(ti,xr,ye,Di),sn=u?"#000000":be||yt(wt),xn=Py(ye,$r,vn,sn,oi,u&&se===null&&oe==="yes",Vt);ti.drawImage(xn,0,0)}Im[yr]=Fe}}return Im[yr]},Jh=Ob;var Fb=(v,l,o)=>Jh(v,l,{...o,useDelayStyle:!0}),My=Fb;var Qf,Bb=()=>{if(!Qf){document.createElement("canvas"),Qf.width=15,Qf.height=15;let v=Qf.getContext("2d");v.arc(8,8,5,0,2*Math.PI,!1),v.fillStyle="#8ED6FF",v.fill(),v.lineWidth=3,v.strokeStyle="black",v.stroke(),v.lineWidth=3}return Qf},Ly=Bb;var Gi={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"};var Ub=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),Nb=function(v){Ub(l,v);function l(o){var c=v.call(this)||this;c.on,c.once,c.un,c.background_=o.background;var i=_a({},o);return typeof o.properties=="object"&&(delete i.properties,_a(i,o.properties)),i[Gi.OPACITY]=o.opacity!==void 0?o.opacity:1,fn(typeof i[Gi.OPACITY]=="number",64),i[Gi.VISIBLE]=o.visible!==void 0?o.visible:!0,i[Gi.Z_INDEX]=o.zIndex,i[Gi.MAX_RESOLUTION]=o.maxResolution!==void 0?o.maxResolution:1/0,i[Gi.MIN_RESOLUTION]=o.minResolution!==void 0?o.minResolution:0,i[Gi.MIN_ZOOM]=o.minZoom!==void 0?o.minZoom:-1/0,i[Gi.MAX_ZOOM]=o.maxZoom!==void 0?o.maxZoom:1/0,c.className_=i.className!==void 0?i.className:"ol-layer",delete i.className,c.setProperties(i),c.state_=null,c}return l.prototype.getBackground=function(){return this.background_},l.prototype.getClassName=function(){return this.className_},l.prototype.getLayerState=function(o){var c=this.state_||{layer:this,managed:o===void 0?!0:o},i=this.getZIndex();return c.opacity=jl(Math.round(this.getOpacity()*100)/100,0,1),c.visible=this.getVisible(),c.extent=this.getExtent(),c.zIndex=i===void 0&&!c.managed?1/0:i,c.maxResolution=this.getMaxResolution(),c.minResolution=Math.max(this.getMinResolution(),0),c.minZoom=this.getMinZoom(),c.maxZoom=this.getMaxZoom(),this.state_=c,c},l.prototype.getLayersArray=function(o){return Fr()},l.prototype.getLayerStatesArray=function(o){return Fr()},l.prototype.getExtent=function(){return this.get(Gi.EXTENT)},l.prototype.getMaxResolution=function(){return this.get(Gi.MAX_RESOLUTION)},l.prototype.getMinResolution=function(){return this.get(Gi.MIN_RESOLUTION)},l.prototype.getMinZoom=function(){return this.get(Gi.MIN_ZOOM)},l.prototype.getMaxZoom=function(){return this.get(Gi.MAX_ZOOM)},l.prototype.getOpacity=function(){return this.get(Gi.OPACITY)},l.prototype.getSourceState=function(){return Fr()},l.prototype.getVisible=function(){return this.get(Gi.VISIBLE)},l.prototype.getZIndex=function(){return this.get(Gi.Z_INDEX)},l.prototype.setBackground=function(o){this.background_=o,this.changed()},l.prototype.setExtent=function(o){this.set(Gi.EXTENT,o)},l.prototype.setMaxResolution=function(o){this.set(Gi.MAX_RESOLUTION,o)},l.prototype.setMinResolution=function(o){this.set(Gi.MIN_RESOLUTION,o)},l.prototype.setMaxZoom=function(o){this.set(Gi.MAX_ZOOM,o)},l.prototype.setMinZoom=function(o){this.set(Gi.MIN_ZOOM,o)},l.prototype.setOpacity=function(o){fn(typeof o=="number",64),this.set(Gi.OPACITY,o)},l.prototype.setVisible=function(o){this.set(Gi.VISIBLE,o)},l.prototype.setZIndex=function(o){this.set(Gi.Z_INDEX,o)},l.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),v.prototype.disposeInternal.call(this)},l}(Io),Cm=Nb;var td={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};var Mu={UNDEFINED:"undefined",LOADING:"loading",READY:"ready",ERROR:"error"};var Vb=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),Gb=function(v){Vb(l,v);function l(o){var c=this,i=_a({},o);delete i.source,c=v.call(this,i)||this,c.on,c.once,c.un,c.mapPrecomposeKey_=null,c.mapRenderKey_=null,c.sourceChangeKey_=null,c.renderer_=null,c.rendered=!1,o.render&&(c.render=o.render),o.map&&c.setMap(o.map),c.addChangeListener(Gi.SOURCE,c.handleSourcePropertyChange_);var u=o.source?o.source:null;return c.setSource(u),c}return l.prototype.getLayersArray=function(o){var c=o||[];return c.push(this),c},l.prototype.getLayerStatesArray=function(o){var c=o||[];return c.push(this.getLayerState()),c},l.prototype.getSource=function(){return this.get(Gi.SOURCE)||null},l.prototype.getRenderSource=function(){return this.getSource()},l.prototype.getSourceState=function(){var o=this.getSource();return o?o.getState():Mu.UNDEFINED},l.prototype.handleSourceChange_=function(){this.changed()},l.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(To(this.sourceChangeKey_),this.sourceChangeKey_=null);var o=this.getSource();o&&(this.sourceChangeKey_=eo(o,Vi.CHANGE,this.handleSourceChange_,this)),this.changed()},l.prototype.getFeatures=function(o){return this.renderer_?this.renderer_.getFeatures(o):new Promise(function(c){return c([])})},l.prototype.getData=function(o){return!this.renderer_||!this.rendered?null:this.renderer_.getData(o)},l.prototype.render=function(o,c){var i=this.getRenderer();if(i.prepareFrame(o))return this.rendered=!0,i.renderFrame(o,c)},l.prototype.unrender=function(){this.rendered=!1},l.prototype.setMapInternal=function(o){o||this.unrender(),this.set(Gi.MAP,o)},l.prototype.getMapInternal=function(){return this.get(Gi.MAP)},l.prototype.setMap=function(o){this.mapPrecomposeKey_&&(To(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),o||this.changed(),this.mapRenderKey_&&(To(this.mapRenderKey_),this.mapRenderKey_=null),o&&(this.mapPrecomposeKey_=eo(o,td.PRECOMPOSE,function(c){var i=c,u=i.frameState.layerStatesArray,P=this.getLayerState(!1);fn(!u.some(function(D){return D.layer===P.layer}),67),u.push(P)},this),this.mapRenderKey_=eo(this,Vi.CHANGE,o.render,o),this.changed())},l.prototype.setSource=function(o){this.set(Gi.SOURCE,o)},l.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},l.prototype.hasRenderer=function(){return!!this.renderer_},l.prototype.createRenderer=function(){return null},l.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),v.prototype.disposeInternal.call(this)},l}(Cm);function ex(v,l){if(!v.visible)return!1;var o=l.resolution;if(o<v.minResolution||o>=v.maxResolution)return!1;var c=l.zoom;return c>v.minZoom&&c<=v.maxZoom}var Qh=Gb;var ky=class extends Io{constructor(l={}){super(l),this.defineProperties(l);let{active:o}={active:l.active!==!1,...l};this.active=o}defineProperties(l){let{target:o,element:c,render:i}={...l};Object.defineProperties(this,{active:{get:()=>this.get("active"),set:u=>{this.set("active",u),u?this.activate():this.deactivate(),this.render()}},map:{get:()=>this.get("map"),set:u=>{if(this.map&&this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.deactivate(),this.set("map",u),this.map){let P=this.target||this.map.getTargetElement&&this.map.getTargetElement()||this.map.getContainer&&this.map.getContainer();this.element||this.createDefaultElement(),this.element&&P.appendChild(this.element),this.active&&this.activate()}this.render()}},target:{value:o},element:{value:c,writable:!0},render:{value:i||this.render,writable:!0}})}attachToMap(l){this.map=l}detachFromMap(){this.map=null}activate(){this.deactivate()}deactivate(){}render(){}createDefaultElement(){}},ch=ky;var jb=v=>class extends v{render(){!this.element||(this.element.innerHTML=this.active?this.getCopyrights().join(" | "):"")}createDefaultElement(){this.element=document.createElement("div"),this.element.id="mbt-copyright",Object.assign(this.element.style,{position:"absolute",bottom:0,right:0,fontSize:".8rem",padding:"0 10px"})}},Am=jb;var zy=class extends Am(ch){constructor(l){super(l),this.onPostRender=this.onPostRender.bind(this)}getCopyrights(){if(!this.frameState)return[];let l=[];return this.frameState.layerStatesArray.forEach(o=>{let{layer:c}=o;ex(o,this.frameState.viewState)&&c&&c.getSource&&c.getSource()&&c.getSource().getAttributions()&&(l=l.concat(c.getSource().getAttributions()(this.frameState)))}),Kh(l)}activate(){super.activate(),this.map&&this.map.on("postrender",this.onPostRender)}deactivate(){this.map&&this.map.un("postrender",this.onPostRender),super.deactivate()}onPostRender(l){this.map&&this.element&&(this.frameState=l.frameState,this.render())}},rx=zy;var ps={ADD:"add",REMOVE:"remove"};var nx=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),ix={LENGTH:"length"},Pm=function(v){nx(l,v);function l(o,c,i){var u=v.call(this,o)||this;return u.element=c,u.index=i,u}return l}(ss);var qb=function(v){nx(l,v);function l(o,c){var i=v.call(this)||this;i.on,i.once,i.un;var u=c||{};if(i.unique_=!!u.unique,i.array_=o||[],i.unique_)for(var P=0,D=i.array_.length;P<D;++P)i.assertUnique_(i.array_[P],P);return i.updateLength_(),i}return l.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},l.prototype.extend=function(o){for(var c=0,i=o.length;c<i;++c)this.push(o[c]);return this},l.prototype.forEach=function(o){for(var c=this.array_,i=0,u=c.length;i<u;++i)o(c[i],i,c)},l.prototype.getArray=function(){return this.array_},l.prototype.item=function(o){return this.array_[o]},l.prototype.getLength=function(){return this.get(ix.LENGTH)},l.prototype.insertAt=function(o,c){this.unique_&&this.assertUnique_(c),this.array_.splice(o,0,c),this.updateLength_(),this.dispatchEvent(new Pm(ps.ADD,c,o))},l.prototype.pop=function(){return this.removeAt(this.getLength()-1)},l.prototype.push=function(o){this.unique_&&this.assertUnique_(o);var c=this.getLength();return this.insertAt(c,o),this.getLength()},l.prototype.remove=function(o){for(var c=this.array_,i=0,u=c.length;i<u;++i)if(c[i]===o)return this.removeAt(i)},l.prototype.removeAt=function(o){var c=this.array_[o];return this.array_.splice(o,1),this.updateLength_(),this.dispatchEvent(new Pm(ps.REMOVE,c,o)),c},l.prototype.setAt=function(o,c){var i=this.getLength();if(o<i){this.unique_&&this.assertUnique_(c,o);var u=this.array_[o];this.array_[o]=c,this.dispatchEvent(new Pm(ps.REMOVE,u,o)),this.dispatchEvent(new Pm(ps.ADD,c,o))}else{for(var P=i;P<o;++P)this.insertAt(P,void 0);this.insertAt(o,c)}},l.prototype.updateLength_=function(){this.set(ix.LENGTH,this.array_.length)},l.prototype.assertUnique_=function(o,c){for(var i=0,u=this.array_.length;i<u;++i)if(this.array_[i]===o&&i!==c)throw new gm(58)},l}(Io),hh=qb;var Zb=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),Xb=function(v){Zb(l,v);function l(o){var c=v.call(this)||this;if(c.on,c.once,c.un,c.id_=void 0,c.geometryName_="geometry",c.style_=null,c.styleFunction_=void 0,c.geometryChangeKey_=null,c.addChangeListener(c.geometryName_,c.handleGeometryChanged_),o)if(typeof o.getSimplifiedGeometry=="function"){var i=o;c.setGeometry(i)}else{var u=o;c.setProperties(u)}return c}return l.prototype.clone=function(){var o=new l(this.hasProperties()?this.getProperties():null);o.setGeometryName(this.getGeometryName());var c=this.getGeometry();c&&o.setGeometry(c.clone());var i=this.getStyle();return i&&o.setStyle(i),o},l.prototype.getGeometry=function(){return this.get(this.geometryName_)},l.prototype.getId=function(){return this.id_},l.prototype.getGeometryName=function(){return this.geometryName_},l.prototype.getStyle=function(){return this.style_},l.prototype.getStyleFunction=function(){return this.styleFunction_},l.prototype.handleGeometryChange_=function(){this.changed()},l.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(To(this.geometryChangeKey_),this.geometryChangeKey_=null);var o=this.getGeometry();o&&(this.geometryChangeKey_=eo(o,Vi.CHANGE,this.handleGeometryChange_,this)),this.changed()},l.prototype.setGeometry=function(o){this.set(this.geometryName_,o)},l.prototype.setStyle=function(o){this.style_=o,this.styleFunction_=o?Wb(o):void 0,this.changed()},l.prototype.setId=function(o){this.id_=o,this.changed()},l.prototype.setGeometryName=function(o){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=o,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()},l}(Io);function Wb(v){if(typeof v=="function")return v;var l;if(Array.isArray(v))l=v;else{fn(typeof v.getZIndex=="function",41);var o=v;l=[o]}return function(){return l}}var gc=Xb;var _n={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};function il(v,l,o,c,i,u){for(var P=u||[],D=0,F=l;F<o;F+=c){var U=v[F],N=v[F+1];P[D++]=i[0]*U+i[2]*N+i[4],P[D++]=i[1]*U+i[3]*N+i[5]}return u&&P.length!=D&&(P.length=D),P}function Mm(v,l,o,c,i,u,P){for(var D=P||[],F=Math.cos(i),U=Math.sin(i),N=u[0],at=u[1],yt=0,Tt=l;Tt<o;Tt+=c){var kt=v[Tt]-N,Vt=v[Tt+1]-at;D[yt++]=N+kt*F-Vt*U,D[yt++]=at+kt*U+Vt*F;for(var wt=Tt+2;wt<Tt+c;++wt)D[yt++]=v[wt]}return P&&D.length!=yt&&(D.length=yt),D}function ox(v,l,o,c,i,u,P,D){for(var F=D||[],U=P[0],N=P[1],at=0,yt=l;yt<o;yt+=c){var Tt=v[yt]-U,kt=v[yt+1]-N;F[at++]=U+i*Tt,F[at++]=N+u*kt;for(var Vt=yt+2;Vt<yt+c;++Vt)F[at++]=v[Vt]}return D&&F.length!=at&&(F.length=at),F}function ax(v,l,o,c,i,u,P){for(var D=P||[],F=0,U=l;U<o;U+=c){D[F++]=v[U]+i,D[F++]=v[U+1]+u;for(var N=U+2;N<U+c;++N)D[F++]=v[N]}return P&&D.length!=F&&(D.length=F),D}var $b=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),sx=va(),Kb=function(v){$b(l,v);function l(){var o=v.call(this)||this;return o.extent_=Va(),o.extentRevision_=-1,o.simplifiedGeometryMaxMinSquaredTolerance=0,o.simplifiedGeometryRevision=0,o.simplifyTransformedInternal=fv(function(c,i,u){if(!u)return this.getSimplifiedGeometry(i);var P=this.clone();return P.applyTransform(u),P.getSimplifiedGeometry(i)}),o}return l.prototype.simplifyTransformed=function(o,c){return this.simplifyTransformedInternal(this.getRevision(),o,c)},l.prototype.clone=function(){return Fr()},l.prototype.closestPointXY=function(o,c,i,u){return Fr()},l.prototype.containsXY=function(o,c){var i=this.getClosestPoint([o,c]);return i[0]===o&&i[1]===c},l.prototype.getClosestPoint=function(o,c){var i=c||[NaN,NaN];return this.closestPointXY(o[0],o[1],i,1/0),i},l.prototype.intersectsCoordinate=function(o){return this.containsXY(o[0],o[1])},l.prototype.computeExtent=function(o){return Fr()},l.prototype.getExtent=function(o){if(this.extentRevision_!=this.getRevision()){var c=this.computeExtent(this.extent_);(isNaN(c[0])||isNaN(c[1]))&&Zp(c),this.extentRevision_=this.getRevision()}return Gv(this.extent_,o)},l.prototype.rotate=function(o,c){Fr()},l.prototype.scale=function(o,c,i){Fr()},l.prototype.simplify=function(o){return this.getSimplifiedGeometry(o*o)},l.prototype.getSimplifiedGeometry=function(o){return Fr()},l.prototype.getType=function(){return Fr()},l.prototype.applyTransform=function(o){Fr()},l.prototype.intersectsExtent=function(o){return Fr()},l.prototype.translate=function(o,c){Fr()},l.prototype.transform=function(o,c){var i=ta(o),u=i.getUnits()==dc.TILE_PIXELS?function(P,D,F){var U=i.getExtent(),N=i.getWorldExtent(),at=Au(N)/Au(U);return us(sx,N[0],N[3],at,-at,0,0,0),il(P,0,P.length,F,sx,D),Yf(i,c)(P,D,F)}:Yf(i,c);return this.applyTransform(u),this},l}(Io),Lm=Kb;var Yb=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),Hb=function(v){Yb(l,v);function l(){var o=v.call(this)||this;return o.layout=_n.XY,o.stride=2,o.flatCoordinates=null,o}return l.prototype.computeExtent=function(o){return bm(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,o)},l.prototype.getCoordinates=function(){return Fr()},l.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},l.prototype.getFlatCoordinates=function(){return this.flatCoordinates},l.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},l.prototype.getLayout=function(){return this.layout},l.prototype.getSimplifiedGeometry=function(o){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),o<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&o<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var c=this.getSimplifiedGeometryInternal(o),i=c.getFlatCoordinates();return i.length<this.flatCoordinates.length?c:(this.simplifiedGeometryMaxMinSquaredTolerance=o,this)},l.prototype.getSimplifiedGeometryInternal=function(o){return this},l.prototype.getStride=function(){return this.stride},l.prototype.setFlatCoordinates=function(o,c){this.stride=lx(o),this.layout=o,this.flatCoordinates=c},l.prototype.setCoordinates=function(o,c){Fr()},l.prototype.setLayout=function(o,c,i){var u;if(o)u=lx(o);else{for(var P=0;P<i;++P)if(c.length===0){this.layout=_n.XY,this.stride=2;return}else c=c[0];u=c.length,o=Jb(u)}this.layout=o,this.stride=u},l.prototype.applyTransform=function(o){this.flatCoordinates&&(o(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},l.prototype.rotate=function(o,c){var i=this.getFlatCoordinates();if(i){var u=this.getStride();Mm(i,0,i.length,u,o,c,i),this.changed()}},l.prototype.scale=function(o,c,i){var u=c;u===void 0&&(u=o);var P=i;P||(P=Hh(this.getExtent()));var D=this.getFlatCoordinates();if(D){var F=this.getStride();ox(D,0,D.length,F,o,u,P,D),this.changed()}},l.prototype.translate=function(o,c){var i=this.getFlatCoordinates();if(i){var u=this.getStride();ax(i,0,i.length,u,o,c,i),this.changed()}},l}(Lm);function Jb(v){var l;return v==2?l=_n.XY:v==3?l=_n.XYZ:v==4&&(l=_n.XYZM),l}function lx(v){var l;return v==_n.XY?l=2:v==_n.XYZ||v==_n.XYM?l=3:v==_n.XYZM&&(l=4),l}function ux(v,l,o){var c=v.getFlatCoordinates();if(c){var i=v.getStride();return il(c,0,c.length,i,l,o)}else return null}var fs=Hb;function cx(v,l,o,c,i,u,P){var D=v[l],F=v[l+1],U=v[o]-D,N=v[o+1]-F,at;if(U===0&&N===0)at=l;else{var yt=((i-D)*U+(u-F)*N)/(U*U+N*N);if(yt>1)at=o;else if(yt>0){for(var Tt=0;Tt<c;++Tt)P[Tt]=el(v[l+Tt],v[o+Tt],yt);P.length=c;return}else at=l}for(var Tt=0;Tt<c;++Tt)P[Tt]=v[at+Tt];P.length=c}function ed(v,l,o,c,i){var u=v[l],P=v[l+1];for(l+=c;l<o;l+=c){var D=v[l],F=v[l+1],U=ql(u,P,D,F);U>i&&(i=U),u=D,P=F}return i}function rd(v,l,o,c,i){for(var u=0,P=o.length;u<P;++u){var D=o[u];i=ed(v,l,D,c,i),l=D}return i}function hx(v,l,o,c,i){for(var u=0,P=o.length;u<P;++u){var D=o[u];i=rd(v,l,D,c,i),l=D[D.length-1]}return i}function id(v,l,o,c,i,u,P,D,F,U,N){if(l==o)return U;var at,yt;if(i===0)if(yt=ql(P,D,v[l],v[l+1]),yt<U){for(at=0;at<c;++at)F[at]=v[l+at];return F.length=c,yt}else return U;for(var Tt=N||[NaN,NaN],kt=l+c;kt<o;)if(cx(v,kt-c,kt,c,P,D,Tt),yt=ql(P,D,Tt[0],Tt[1]),yt<U){for(U=yt,at=0;at<c;++at)F[at]=Tt[at];F.length=c,kt+=c}else kt+=c*Math.max((Math.sqrt(yt)-Math.sqrt(U))/i|0,1);if(u&&(cx(v,o-c,l,c,P,D,Tt),yt=ql(P,D,Tt[0],Tt[1]),yt<U)){for(U=yt,at=0;at<c;++at)F[at]=Tt[at];F.length=c}return U}function nd(v,l,o,c,i,u,P,D,F,U,N){for(var at=N||[NaN,NaN],yt=0,Tt=o.length;yt<Tt;++yt){var kt=o[yt];U=id(v,l,kt,c,i,u,P,D,F,U,at),l=kt}return U}function px(v,l,o,c,i,u,P,D,F,U,N){for(var at=N||[NaN,NaN],yt=0,Tt=o.length;yt<Tt;++yt){var kt=o[yt];U=nd(v,l,kt,c,i,u,P,D,F,U,at),l=kt[kt.length-1]}return U}function fx(v,l,o,c){for(var i=0,u=o.length;i<u;++i)v[l++]=o[i];return l}function tp(v,l,o,c){for(var i=0,u=o.length;i<u;++i)for(var P=o[i],D=0;D<c;++D)v[l++]=P[D];return l}function od(v,l,o,c,i){for(var u=i||[],P=0,D=0,F=o.length;D<F;++D){var U=tp(v,l,o[D],c);u[P++]=U,l=U}return u.length=P,u}function dx(v,l,o,c,i){for(var u=i||[],P=0,D=0,F=o.length;D<F;++D){var U=od(v,l,o[D],c,u[P]);u[P++]=U,l=U[U.length-1]}return u.length=P,u}function ad(v,l,o,c,i,u,P){var D=(o-l)/c;if(D<3){for(;l<o;l+=c)u[P++]=v[l],u[P++]=v[l+1];return P}var F=new Array(D);F[0]=1,F[D-1]=1;for(var U=[l,o-c],N=0;U.length>0;){for(var at=U.pop(),yt=U.pop(),Tt=0,kt=v[yt],Vt=v[yt+1],wt=v[at],Lt=v[at+1],Zt=yt+c;Zt<at;Zt+=c){var Jt=v[Zt],se=v[Zt+1],ce=Mv(Jt,se,kt,Vt,wt,Lt);ce>Tt&&(N=Zt,Tt=ce)}Tt>i&&(F[(N-l)/c]=1,yt+c<N&&U.push(yt,N),N+c<at&&U.push(N,at))}for(var Zt=0;Zt<D;++Zt)F[Zt]&&(u[P++]=v[l+Zt*c],u[P++]=v[l+Zt*c+1]);return P}function mx(v,l,o,c,i,u,P,D){for(var F=0,U=o.length;F<U;++F){var N=o[F];P=ad(v,l,N,c,i,u,P),D.push(P),l=N}return P}function ph(v,l){return l*Math.round(v/l)}function Qb(v,l,o,c,i,u,P){if(l==o)return P;var D=ph(v[l],i),F=ph(v[l+1],i);l+=c,u[P++]=D,u[P++]=F;var U,N;do if(U=ph(v[l],i),N=ph(v[l+1],i),l+=c,l==o)return u[P++]=U,u[P++]=N,P;while(U==D&&N==F);for(;l<o;){var at=ph(v[l],i),yt=ph(v[l+1],i);if(l+=c,!(at==U&&yt==N)){var Tt=U-D,kt=N-F,Vt=at-D,wt=yt-F;if(Tt*wt==kt*Vt&&(Tt<0&&Vt<Tt||Tt==Vt||Tt>0&&Vt>Tt)&&(kt<0&&wt<kt||kt==wt||kt>0&&wt>kt)){U=at,N=yt;continue}u[P++]=U,u[P++]=N,D=U,F=N,U=at,N=yt}}return u[P++]=U,u[P++]=N,P}function Ry(v,l,o,c,i,u,P,D){for(var F=0,U=o.length;F<U;++F){var N=o[F];P=Qb(v,l,N,c,i,u,P),D.push(P),l=N}return P}function gx(v,l,o,c,i,u,P,D){for(var F=0,U=o.length;F<U;++F){var N=o[F],at=[];P=Ry(v,l,N,c,i,u,P,at),D.push(at),l=N[N.length-1]}return P}function nl(v,l,o,c,i){for(var u=i!==void 0?i:[],P=0,D=l;D<o;D+=c)u[P++]=v.slice(D,D+c);return u.length=P,u}function fh(v,l,o,c,i){for(var u=i!==void 0?i:[],P=0,D=0,F=o.length;D<F;++D){var U=o[D];u[P++]=nl(v,l,U,c,u[P]),l=U}return u.length=P,u}function sd(v,l,o,c,i){for(var u=i!==void 0?i:[],P=0,D=0,F=o.length;D<F;++D){var U=o[D];u[P++]=fh(v,l,U,c,u[P]),l=U[U.length-1]}return u.length=P,u}function Dy(v,l,o,c){for(var i=0,u=v[o-c],P=v[o-c+1];l<o;l+=c){var D=v[l],F=v[l+1];i+=P*D-u*F,u=D,P=F}return i/2}function Oy(v,l,o,c){for(var i=0,u=0,P=o.length;u<P;++u){var D=o[u];i+=Dy(v,l,D,c),l=D}return i}function yx(v,l,o,c){for(var i=0,u=0,P=o.length;u<P;++u){var D=o[u];i+=Oy(v,l,D,c),l=D[D.length-1]}return i}var tw=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),ew=function(v){tw(l,v);function l(o,c){var i=v.call(this)||this;return i.maxDelta_=-1,i.maxDeltaRevision_=-1,c!==void 0&&!Array.isArray(o[0])?i.setFlatCoordinates(c,o):i.setCoordinates(o,c),i}return l.prototype.clone=function(){return new l(this.flatCoordinates.slice(),this.layout)},l.prototype.closestPointXY=function(o,c,i,u){return u<cs(this.getExtent(),o,c)?u:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ed(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),id(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,o,c,i,u))},l.prototype.getArea=function(){return Dy(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},l.prototype.getCoordinates=function(){return nl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},l.prototype.getSimplifiedGeometryInternal=function(o){var c=[];return c.length=ad(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,o,c,0),new l(c,_n.XY)},l.prototype.getType=function(){return Ie.LINEAR_RING},l.prototype.intersectsExtent=function(o){return!1},l.prototype.setCoordinates=function(o,c){this.setLayout(c,o,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=tp(this.flatCoordinates,0,o,this.stride),this.changed()},l}(fs),Fy=ew;var rw=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),iw=function(v){rw(l,v);function l(o,c){var i=v.call(this)||this;return i.setCoordinates(o,c),i}return l.prototype.clone=function(){var o=new l(this.flatCoordinates.slice(),this.layout);return o.applyProperties(this),o},l.prototype.closestPointXY=function(o,c,i,u){var P=this.flatCoordinates,D=ql(o,c,P[0],P[1]);if(D<u){for(var F=this.stride,U=0;U<F;++U)i[U]=P[U];return i.length=F,D}else return u},l.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},l.prototype.computeExtent=function(o){return Xp(this.flatCoordinates,o)},l.prototype.getType=function(){return Ie.POINT},l.prototype.intersectsExtent=function(o){return Kf(o,this.flatCoordinates[0],this.flatCoordinates[1])},l.prototype.setCoordinates=function(o,c){this.setLayout(c,o,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=fx(this.flatCoordinates,0,o,this.stride),this.changed()},l}(fs),ea=iw;function _x(v,l,o,c,i){var u=Nv(i,function(P){return!dh(v,l,o,c,P[0],P[1])});return!u}function dh(v,l,o,c,i,u){for(var P=0,D=v[o-c],F=v[o-c+1];l<o;l+=c){var U=v[l],N=v[l+1];F<=u?N>u&&(U-D)*(u-F)-(i-D)*(N-F)>0&&P++:N<=u&&(U-D)*(u-F)-(i-D)*(N-F)<0&&P--,D=U,F=N}return P!==0}function ld(v,l,o,c,i,u){if(o.length===0||!dh(v,l,o[0],c,i,u))return!1;for(var P=1,D=o.length;P<D;++P)if(dh(v,o[P-1],o[P],c,i,u))return!1;return!0}function vx(v,l,o,c,i,u){if(o.length===0)return!1;for(var P=0,D=o.length;P<D;++P){var F=o[P];if(ld(v,l,F,c,i,u))return!0;l=F[F.length-1]}return!1}function By(v,l,o,c,i,u,P){for(var D,F,U,N,at,yt,Tt,kt=i[u+1],Vt=[],wt=0,Lt=o.length;wt<Lt;++wt){var Zt=o[wt];for(N=v[Zt-c],yt=v[Zt-c+1],D=l;D<Zt;D+=c)at=v[D],Tt=v[D+1],(kt<=yt&&Tt<=kt||yt<=kt&&kt<=Tt)&&(U=(kt-yt)/(Tt-yt)*(at-N)+N,Vt.push(U)),N=at,yt=Tt}var Jt=NaN,se=-1/0;for(Vt.sort(rh),N=Vt[0],D=1,F=Vt.length;D<F;++D){at=Vt[D];var ce=Math.abs(at-N);ce>se&&(U=(N+at)/2,ld(v,l,o,c,U,kt)&&(Jt=U,se=ce)),N=at}return isNaN(Jt)&&(Jt=i[u]),P?(P.push(Jt,kt,se),P):[Jt,kt,se]}function xx(v,l,o,c,i){for(var u=[],P=0,D=o.length;P<D;++P){var F=o[P];u=By(v,l,F,c,i,2*P,u),l=F[F.length-1]}return u}function km(v,l,o,c,i){var u;for(l+=c;l<o;l+=c)if(u=i(v.slice(l-c,l),v.slice(l,l+c)),u)return u;return!1}function ud(v,l,o,c,i){var u=py(Va(),v,l,o,c);return Ao(i,u)?mc(i,u)||u[0]>=i[0]&&u[2]<=i[2]||u[1]>=i[1]&&u[3]<=i[3]?!0:km(v,l,o,c,function(P,D){return jv(i,P,D)}):!1}function bx(v,l,o,c,i){for(var u=0,P=o.length;u<P;++u){if(ud(v,l,o[u],c,i))return!0;l=o[u]}return!1}function nw(v,l,o,c,i){return!!(ud(v,l,o,c,i)||dh(v,l,o,c,i[0],i[1])||dh(v,l,o,c,i[0],i[3])||dh(v,l,o,c,i[2],i[1])||dh(v,l,o,c,i[2],i[3]))}function Uy(v,l,o,c,i){if(!nw(v,l,o[0],c,i))return!1;if(o.length===1)return!0;for(var u=1,P=o.length;u<P;++u)if(_x(v,o[u-1],o[u],c,i)&&!ud(v,o[u-1],o[u],c,i))return!1;return!0}function wx(v,l,o,c,i){for(var u=0,P=o.length;u<P;++u){var D=o[u];if(Uy(v,l,D,c,i))return!0;l=D[D.length-1]}return!1}function Ex(v,l,o,c){for(;l<o-c;){for(var i=0;i<c;++i){var u=v[l+i];v[l+i]=v[o-c+i],v[o-c+i]=u}l+=c,o-=c}}function Sx(v,l,o,c){for(var i=0,u=v[o-c],P=v[o-c+1];l<o;l+=c){var D=v[l],F=v[l+1];i+=(D-u)*(F+P),u=D,P=F}return i===0?void 0:i>0}function Ny(v,l,o,c,i){for(var u=i!==void 0?i:!1,P=0,D=o.length;P<D;++P){var F=o[P],U=Sx(v,l,F,c);if(P===0){if(u&&U||!u&&!U)return!1}else if(u&&!U||!u&&U)return!1;l=F}return!0}function Tx(v,l,o,c,i){for(var u=0,P=o.length;u<P;++u){var D=o[u];if(!Ny(v,l,D,c,i))return!1;D.length&&(l=D[D.length-1])}return!0}function zm(v,l,o,c,i){for(var u=i!==void 0?i:!1,P=0,D=o.length;P<D;++P){var F=o[P],U=Sx(v,l,F,c),N=P===0?u&&U||!u&&!U:u&&!U||!u&&U;N&&Ex(v,l,F,c),l=F}return l}function Vy(v,l,o,c,i){for(var u=0,P=o.length;u<P;++u)l=zm(v,l,o[u],c,i);return l}var ow=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),Ix=function(v){ow(l,v);function l(o,c,i){var u=v.call(this)||this;return u.ends_=[],u.flatInteriorPointRevision_=-1,u.flatInteriorPoint_=null,u.maxDelta_=-1,u.maxDeltaRevision_=-1,u.orientedRevision_=-1,u.orientedFlatCoordinates_=null,c!==void 0&&i?(u.setFlatCoordinates(c,o),u.ends_=i):u.setCoordinates(o,c),u}return l.prototype.appendLinearRing=function(o){this.flatCoordinates?Ua(this.flatCoordinates,o.getFlatCoordinates()):this.flatCoordinates=o.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},l.prototype.clone=function(){var o=new l(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return o.applyProperties(this),o},l.prototype.closestPointXY=function(o,c,i,u){return u<cs(this.getExtent(),o,c)?u:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(rd(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),nd(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,o,c,i,u))},l.prototype.containsXY=function(o,c){return ld(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,o,c)},l.prototype.getArea=function(){return Oy(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},l.prototype.getCoordinates=function(o){var c;return o!==void 0?(c=this.getOrientedFlatCoordinates().slice(),zm(c,0,this.ends_,this.stride,o)):c=this.flatCoordinates,fh(c,0,this.ends_,this.stride)},l.prototype.getEnds=function(){return this.ends_},l.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var o=Hh(this.getExtent());this.flatInteriorPoint_=By(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,o,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},l.prototype.getInteriorPoint=function(){return new ea(this.getFlatInteriorPoint(),_n.XYM)},l.prototype.getLinearRingCount=function(){return this.ends_.length},l.prototype.getLinearRing=function(o){return o<0||this.ends_.length<=o?null:new Fy(this.flatCoordinates.slice(o===0?0:this.ends_[o-1],this.ends_[o]),this.layout)},l.prototype.getLinearRings=function(){for(var o=this.layout,c=this.flatCoordinates,i=this.ends_,u=[],P=0,D=0,F=i.length;D<F;++D){var U=i[D],N=new Fy(c.slice(P,U),o);u.push(N),P=U}return u},l.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var o=this.flatCoordinates;Ny(o,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=o:(this.orientedFlatCoordinates_=o.slice(),this.orientedFlatCoordinates_.length=zm(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},l.prototype.getSimplifiedGeometryInternal=function(o){var c=[],i=[];return c.length=Ry(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(o),c,0,i),new l(c,_n.XY,i)},l.prototype.getType=function(){return Ie.POLYGON},l.prototype.intersectsExtent=function(o){return Uy(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,o)},l.prototype.setCoordinates=function(o,c){this.setLayout(c,o,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=od(this.flatCoordinates,0,o,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()},l}(fs),cd=Ix;function Gy(v,l,o){for(var c=l||32,i=v.getStride(),u=v.getLayout(),P=v.getCenter(),D=i*(c+1),F=new Array(D),U=0;U<D;U+=i){F[U]=0,F[U+1]=0;for(var N=2;N<i;N++)F[U+N]=P[N]}var at=[F.length],yt=new Ix(F,u,at);return aw(yt,P,v.getRadius(),o),yt}function aw(v,l,o,c){for(var i=v.getFlatCoordinates(),u=v.getStride(),P=i.length/u-1,D=c||0,F=0;F<=P;++F){var U=F*u,N=D+_m(F,P)*2*Math.PI/P;i[U]=l[0]+o*Math.cos(N),i[U+1]=l[1]+o*Math.sin(N)}v.changed()}var sw=function(){function v(l){var o=l||{};this.color_=o.color!==void 0?o.color:null}return v.prototype.clone=function(){var l=this.getColor();return new v({color:Array.isArray(l)?l.slice():l||void 0})},v.prototype.getColor=function(){return this.color_},v.prototype.setColor=function(l){this.color_=l},v}(),Ds=sw;function Dm(v,l,o,c,i,u,P){var D,F,U=(o-l)/c;if(U===1)D=l;else if(U===2)D=l,F=i;else if(U!==0){for(var N=v[l],at=v[l+1],yt=0,Tt=[0],kt=l+c;kt<o;kt+=c){var Vt=v[kt],wt=v[kt+1];yt+=Math.sqrt((Vt-N)*(Vt-N)+(wt-at)*(wt-at)),Tt.push(yt),N=Vt,at=wt}var Lt=i*yt,Zt=cv(Tt,Lt);Zt<0?(F=(Lt-Tt[-Zt-2])/(Tt[-Zt-1]-Tt[-Zt-2]),D=l+(-Zt-2)*c):D=l+Zt*c}for(var Jt=P>1?P:2,se=u||new Array(Jt),kt=0;kt<Jt;++kt)se[kt]=D===void 0?NaN:F===void 0?v[D+kt]:el(v[D+kt],v[D+c+kt],F);return se}function Rm(v,l,o,c,i,u){if(o==l)return null;var P;if(i<v[l+c-1])return u?(P=v.slice(l,l+c),P[c-1]=i,P):null;if(v[o-1]<i)return u?(P=v.slice(o-c,o),P[c-1]=i,P):null;if(i==v[l+c-1])return v.slice(l,l+c);for(var D=l/c,F=o/c;D<F;){var U=D+F>>1;i<v[(U+1)*c-1]?F=U:D=U+1}var N=v[D*c-1];if(i==N)return v.slice((D-1)*c,(D-1)*c+c);var at=v[(D+1)*c-1],yt=(i-N)/(at-N);P=[];for(var Tt=0;Tt<c-1;++Tt)P.push(el(v[(D-1)*c+Tt],v[D*c+Tt],yt));return P.push(i),P}function Cx(v,l,o,c,i,u,P){if(P)return Rm(v,l,o[o.length-1],c,i,u);var D;if(i<v[c-1])return u?(D=v.slice(0,c),D[c-1]=i,D):null;if(v[v.length-1]<i)return u?(D=v.slice(v.length-c),D[c-1]=i,D):null;for(var F=0,U=o.length;F<U;++F){var N=o[F];if(l!=N){if(i<v[l+c-1])return null;if(i<=v[N-1])return Rm(v,l,N,c,i,!1);l=N}}return null}function Om(v,l,o,c){for(var i=v[l],u=v[l+1],P=0,D=l+c;D<o;D+=c){var F=v[D],U=v[D+1];P+=Math.sqrt((F-i)*(F-i)+(U-u)*(U-u)),i=F,u=U}return P}var lw=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),uw=function(v){lw(l,v);function l(o,c){var i=v.call(this)||this;return i.flatMidpoint_=null,i.flatMidpointRevision_=-1,i.maxDelta_=-1,i.maxDeltaRevision_=-1,c!==void 0&&!Array.isArray(o[0])?i.setFlatCoordinates(c,o):i.setCoordinates(o,c),i}return l.prototype.appendCoordinate=function(o){this.flatCoordinates?Ua(this.flatCoordinates,o):this.flatCoordinates=o.slice(),this.changed()},l.prototype.clone=function(){var o=new l(this.flatCoordinates.slice(),this.layout);return o.applyProperties(this),o},l.prototype.closestPointXY=function(o,c,i,u){return u<cs(this.getExtent(),o,c)?u:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ed(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),id(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,o,c,i,u))},l.prototype.forEachSegment=function(o){return km(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,o)},l.prototype.getCoordinateAtM=function(o,c){if(this.layout!=_n.XYM&&this.layout!=_n.XYZM)return null;var i=c!==void 0?c:!1;return Rm(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,o,i)},l.prototype.getCoordinates=function(){return nl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},l.prototype.getCoordinateAt=function(o,c){return Dm(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,o,c,this.stride)},l.prototype.getLength=function(){return Om(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},l.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},l.prototype.getSimplifiedGeometryInternal=function(o){var c=[];return c.length=ad(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,o,c,0),new l(c,_n.XY)},l.prototype.getType=function(){return Ie.LINE_STRING},l.prototype.intersectsExtent=function(o){return ud(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,o)},l.prototype.setCoordinates=function(o,c){this.setLayout(c,o,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=tp(this.flatCoordinates,0,o,this.stride),this.changed()},l}(fs),yc=uw;var cw=function(){function v(l){var o=l||{};this.color_=o.color!==void 0?o.color:null,this.lineCap_=o.lineCap,this.lineDash_=o.lineDash!==void 0?o.lineDash:null,this.lineDashOffset_=o.lineDashOffset,this.lineJoin_=o.lineJoin,this.miterLimit_=o.miterLimit,this.width_=o.width}return v.prototype.clone=function(){var l=this.getColor();return new v({color:Array.isArray(l)?l.slice():l||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},v.prototype.getColor=function(){return this.color_},v.prototype.getLineCap=function(){return this.lineCap_},v.prototype.getLineDash=function(){return this.lineDash_},v.prototype.getLineDashOffset=function(){return this.lineDashOffset_},v.prototype.getLineJoin=function(){return this.lineJoin_},v.prototype.getMiterLimit=function(){return this.miterLimit_},v.prototype.getWidth=function(){return this.width_},v.prototype.setColor=function(l){this.color_=l},v.prototype.setLineCap=function(l){this.lineCap_=l},v.prototype.setLineDash=function(l){this.lineDash_=l},v.prototype.setLineDashOffset=function(l){this.lineDashOffset_=l},v.prototype.setLineJoin=function(l){this.lineJoin_=l},v.prototype.setMiterLimit=function(l){this.miterLimit_=l},v.prototype.setWidth=function(l){this.width_=l},v}(),ra=cw;var zi={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function jy(v,l){return Array.isArray(v)?v:(l===void 0?l=[v,v]:(l[0]=v,l[1]=v),l)}var hw=function(){function v(l){this.opacity_=l.opacity,this.rotateWithView_=l.rotateWithView,this.rotation_=l.rotation,this.scale_=l.scale,this.scaleArray_=jy(l.scale),this.displacement_=l.displacement}return v.prototype.clone=function(){var l=this.getScale();return new v({opacity:this.getOpacity(),scale:Array.isArray(l)?l.slice():l,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},v.prototype.getOpacity=function(){return this.opacity_},v.prototype.getRotateWithView=function(){return this.rotateWithView_},v.prototype.getRotation=function(){return this.rotation_},v.prototype.getScale=function(){return this.scale_},v.prototype.getScaleArray=function(){return this.scaleArray_},v.prototype.getDisplacement=function(){return this.displacement_},v.prototype.getAnchor=function(){return Fr()},v.prototype.getImage=function(l){return Fr()},v.prototype.getHitDetectionImage=function(){return Fr()},v.prototype.getPixelRatio=function(l){return 1},v.prototype.getImageState=function(){return Fr()},v.prototype.getImageSize=function(){return Fr()},v.prototype.getOrigin=function(){return Fr()},v.prototype.getSize=function(){return Fr()},v.prototype.setDisplacement=function(l){this.displacement_=l},v.prototype.setOpacity=function(l){this.opacity_=l},v.prototype.setRotateWithView=function(l){this.rotateWithView_=l},v.prototype.setRotation=function(l){this.rotation_=l},v.prototype.setScale=function(l){this.scale_=l,this.scaleArray_=jy(l)},v.prototype.listenImageChange=function(l){Fr()},v.prototype.load=function(){Fr()},v.prototype.unlistenImageChange=function(l){Fr()},v}(),Fm=hw;var pw=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,fw=/^([a-z]*)$|^hsla?\(.*\)$/i;function Bm(v){return typeof v=="string"?v:qy(v)}function dw(v){var l=document.createElement("div");if(l.style.color=v,l.style.color!==""){document.body.appendChild(l);var o=getComputedStyle(l).color;return document.body.removeChild(l),o}else return""}var mw=function(){var v=1024,l={},o=0;return function(c){var i;if(l.hasOwnProperty(c))i=l[c];else{if(o>=v){var u=0;for(var P in l)(u++&3)===0&&(delete l[P],--o)}i=gw(c),l[c]=i,++o}return i}}();function ep(v){return Array.isArray(v)?v:mw(v)}function gw(v){var l,o,c,i,u;if(fw.exec(v)&&(v=dw(v)),pw.exec(v)){var P=v.length-1,D=void 0;P<=4?D=1:D=2;var F=P===4||P===8;l=parseInt(v.substr(1+0*D,D),16),o=parseInt(v.substr(1+1*D,D),16),c=parseInt(v.substr(1+2*D,D),16),F?i=parseInt(v.substr(1+3*D,D),16):i=255,D==1&&(l=(l<<4)+l,o=(o<<4)+o,c=(c<<4)+c,F&&(i=(i<<4)+i)),u=[l,o,c,i/255]}else v.indexOf("rgba(")==0?(u=v.slice(5,-1).split(",").map(Number),Ax(u)):v.indexOf("rgb(")==0?(u=v.slice(4,-1).split(",").map(Number),u.push(1),Ax(u)):fn(!1,14);return u}function Ax(v){return v[0]=jl(v[0]+.5|0,0,255),v[1]=jl(v[1]+.5|0,0,255),v[2]=jl(v[2]+.5|0,0,255),v[3]=jl(v[3],0,1),v}function qy(v){var l=v[0];l!=(l|0)&&(l=l+.5|0);var o=v[1];o!=(o|0)&&(o=o+.5|0);var c=v[2];c!=(c|0)&&(c=c+.5|0);var i=v[3]===void 0?1:Math.round(v[3]*100)/100;return"rgba("+l+","+o+","+c+","+i+")"}function ds(v){return Array.isArray(v)?qy(v):v}function Ga(v,l,o,c){var i;return o&&o.length?i=o.shift():ah?i=new OffscreenCanvas(v||300,l||300):i=document.createElement("canvas"),v&&(i.width=v),l&&(i.height=l),i.getContext("2d",c)}var yw=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),Px=["style","variant","weight","size","lineHeight","family"],Zy=function(v){var l=v.match(yw);if(!l)return null;for(var o={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},c=0,i=Px.length;c<i;++c){var u=l[c+1];u!==void 0&&(o[Px[c]]=u)}return o.families=o.family.split(/,\s?/),o};function Mx(v){return v===1?"":String(Math.round(v*100)/100)}var Nm="10px sans-serif",ms="#000",rp="round",_c=[],vc=0,Lu="round",xc=10,bc="#000",gh="center",ip="middle",wc=[0,0,0,0],Ec=1,mh=new Io,_w=new nh;_w.setSize=function(){console.warn("labelCache is deprecated.")};var Qp=null,Xy,Wy={},Lx=function(){var v=100,l="32px ",o=["monospace","serif"],c=o.length,i="wmytzilWMYTZIL@#/&?$%10\uF013",u,P;function D(U,N,at){for(var yt=!0,Tt=0;Tt<c;++Tt){var kt=o[Tt];if(P=Um(U+" "+N+" "+l+kt,i),at!=kt){var Vt=Um(U+" "+N+" "+l+at+","+kt,i);yt=yt&&Vt!=P}}return!!yt}function F(){for(var U=!0,N=mh.getKeys(),at=0,yt=N.length;at<yt;++at){var Tt=N[at];mh.get(Tt)<v&&(D.apply(this,Tt.split(`
1000
+ `),ie=q.createShader(q.FRAGMENT_SHADER);if(q.isContextLost())return void(this.failedToCreate=!0);q.shaderSource(ie,Kt),q.compileShader(ie),q.attachShader(this.program,ie);let Ht=q.createShader(q.VERTEX_SHADER);if(q.isContextLost())return void(this.failedToCreate=!0);q.shaderSource(Ht,Wt),q.compileShader(Ht),q.attachShader(this.program,Ht),this.attributes={};let _e={};this.numAttributes=et.length;for(let he=0;he<this.numAttributes;he++)et[he]&&(q.bindAttribLocation(this.program,he,et[he]),this.attributes[et[he]]=he);q.linkProgram(this.program),q.deleteShader(Ht),q.deleteShader(ie);for(let he=0;he<bt.length;he++){let de=bt[he];if(de&&!_e[de]){let Pe=q.getUniformLocation(this.program,de);Pe&&(_e[de]=Pe)}}this.fixedUniforms=L(a,_e),this.binderUniforms=I?I.getUniforms(a,_e):[]}draw(a,g,S,I,L,B,q,$,J,et,ut,vt,Ft,bt,Ot,Kt){let Wt=a.gl;if(this.failedToCreate)return;a.program.set(this.program),a.setDepthMode(S),a.setStencilMode(I),a.setColorMode(L),a.setCullFace(B);for(let Ht in this.fixedUniforms)this.fixedUniforms[Ht].set(q[Ht]);bt&&bt.setUniforms(a,this.binderUniforms,vt,{zoom:Ft});let ie={[Wt.LINES]:2,[Wt.TRIANGLES]:3,[Wt.LINE_STRIP]:1}[g];for(let Ht of ut.get()){let _e=Ht.vaos||(Ht.vaos={});(_e[$]||(_e[$]=new Yi)).bind(a,this,J,bt?bt.getPaintVertexBuffers():[],et,Ht.vertexOffset,Ot,Kt),Wt.drawElements(g,Ht.primitiveLength*ie,Wt.UNSIGNED_SHORT,Ht.primitiveOffset*ie*2)}}}function un(T,a,g){let S=1/It(g,1,a.transform.tileZoom),I=Math.pow(2,g.tileID.overscaledZ),L=g.tileSize*Math.pow(2,a.transform.tileZoom)/I,B=L*(g.tileID.canonical.x+g.tileID.wrap*I),q=L*g.tileID.canonical.y;return{u_image:0,u_texsize:g.imageAtlasTexture.size,u_scale:[S,T.fromScale,T.toScale],u_fade:T.t,u_pixel_coord_upper:[B>>16,q>>16],u_pixel_coord_lower:[65535&B,65535&q]}}let Po=(T,a,g,S)=>{let I=a.style.light,L=I.properties.get("position"),B=[L.x,L.y,L.z],q=function(){var J=new u.ARRAY_TYPE(9);return u.ARRAY_TYPE!=Float32Array&&(J[1]=0,J[2]=0,J[3]=0,J[5]=0,J[6]=0,J[7]=0),J[0]=1,J[4]=1,J[8]=1,J}();I.properties.get("anchor")==="viewport"&&function(J,et){var ut=Math.sin(et),vt=Math.cos(et);J[0]=vt,J[1]=ut,J[2]=0,J[3]=-ut,J[4]=vt,J[5]=0,J[6]=0,J[7]=0,J[8]=1}(q,-a.transform.angle),function(J,et,ut){var vt=et[0],Ft=et[1],bt=et[2];J[0]=vt*ut[0]+Ft*ut[3]+bt*ut[6],J[1]=vt*ut[1]+Ft*ut[4]+bt*ut[7],J[2]=vt*ut[2]+Ft*ut[5]+bt*ut[8]}(B,B,q);let $=I.properties.get("color");return{u_matrix:T,u_lightpos:B,u_lightintensity:I.properties.get("intensity"),u_lightcolor:[$.r,$.g,$.b],u_vertical_gradient:+g,u_opacity:S}},Si=(T,a,g,S,I,L,B)=>u.extend(Po(T,a,g,S),un(L,a,B),{u_height_factor:-Math.pow(2,I.overscaledZ)/B.tileSize/8}),Mo=T=>({u_matrix:T}),oo=(T,a,g,S)=>u.extend(Mo(T),un(g,a,S)),Ou=(T,a)=>({u_matrix:T,u_world:a}),Lo=(T,a,g,S,I)=>u.extend(oo(T,a,g,S),{u_world:I}),ys=(T,a,g,S)=>{let I=T.transform,L,B;if(S.paint.get("circle-pitch-alignment")==="map"){let q=It(g,1,I.zoom);L=!0,B=[q,q]}else L=!1,B=I.pixelsToGLUnits;return{u_camera_to_center_distance:I.cameraToCenterDistance,u_scale_with_map:+(S.paint.get("circle-pitch-scale")==="map"),u_matrix:T.translatePosMatrix(a.posMatrix,g,S.paint.get("circle-translate"),S.paint.get("circle-translate-anchor")),u_pitch_with_map:+L,u_device_pixel_ratio:T.pixelRatio,u_extrude_scale:B}},Bo=(T,a,g)=>{let S=It(g,1,a.zoom),I=Math.pow(2,a.zoom-g.tileID.overscaledZ),L=g.tileID.overscaleFactor();return{u_matrix:T,u_camera_to_center_distance:a.cameraToCenterDistance,u_pixels_to_tile_units:S,u_extrude_scale:[a.pixelsToGLUnits[0]/(S*I),a.pixelsToGLUnits[1]/(S*I)],u_overscale_factor:L}},Hi=(T,a,g=1)=>({u_matrix:T,u_color:a,u_overlay:0,u_overlay_scale:g}),po=T=>({u_matrix:T}),Sn=(T,a,g,S)=>({u_matrix:T,u_extrude_scale:It(a,1,g),u_intensity:S});function oa(T,a){let g=Math.pow(2,a.canonical.z),S=a.canonical.y;return[new u.MercatorCoordinate(0,S/g).toLngLat().lat,new u.MercatorCoordinate(0,(S+1)/g).toLngLat().lat]}let ll=(T,a,g)=>{let S=T.transform;return{u_matrix:Fu(T,a,g),u_ratio:1/It(a,1,S.zoom),u_device_pixel_ratio:T.pixelRatio,u_units_to_pixels:[1/S.pixelsToGLUnits[0],1/S.pixelsToGLUnits[1]]}},Kl=(T,a,g,S)=>u.extend(ll(T,a,g),{u_image:0,u_image_height:S}),_s=(T,a,g,S)=>{let I=T.transform,L=Fs(a,I);return{u_matrix:Fu(T,a,g),u_texsize:a.imageAtlasTexture.size,u_ratio:1/It(a,1,I.zoom),u_device_pixel_ratio:T.pixelRatio,u_image:0,u_scale:[L,S.fromScale,S.toScale],u_fade:S.t,u_units_to_pixels:[1/I.pixelsToGLUnits[0],1/I.pixelsToGLUnits[1]]}},mn=(T,a,g,S,I)=>{let L=T.lineAtlas,B=Fs(a,T.transform),q=g.layout.get("line-cap")==="round",$=L.getDash(S.from,q),J=L.getDash(S.to,q),et=$.width*I.fromScale,ut=J.width*I.toScale;return u.extend(ll(T,a,g),{u_patternscale_a:[B/et,-$.height/2],u_patternscale_b:[B/ut,-J.height/2],u_sdfgamma:L.width/(256*Math.min(et,ut)*T.pixelRatio)/2,u_image:0,u_tex_y_a:$.y,u_tex_y_b:J.y,u_mix:I.t})};function Fs(T,a){return 1/It(T,1,a.tileZoom)}function Fu(T,a,g){return T.translatePosMatrix(a.tileID.posMatrix,a,g.paint.get("line-translate"),g.paint.get("line-translate-anchor"))}let Bu=(T,a,g,S,I)=>{return{u_matrix:T,u_tl_parent:a,u_scale_parent:g,u_buffer_scale:1,u_fade_t:S.mix,u_opacity:S.opacity*I.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:I.paint.get("raster-brightness-min"),u_brightness_high:I.paint.get("raster-brightness-max"),u_saturation_factor:(B=I.paint.get("raster-saturation"),B>0?1-1/(1.001-B):-B),u_contrast_factor:(L=I.paint.get("raster-contrast"),L>0?1/(1-L):1+L),u_spin_weights:Uu(I.paint.get("raster-hue-rotate"))};var L,B};function Uu(T){T*=Math.PI/180;let a=Math.sin(T),g=Math.cos(T);return[(2*g+1)/3,(-Math.sqrt(3)*a-g+1)/3,(Math.sqrt(3)*a-g+1)/3]}let ba=(T,a,g,S,I,L,B,q,$,J)=>{let et=I.transform;return{u_is_size_zoom_constant:+(T==="constant"||T==="source"),u_is_size_feature_constant:+(T==="constant"||T==="camera"),u_size_t:a?a.uSizeT:0,u_size:a?a.uSize:0,u_camera_to_center_distance:et.cameraToCenterDistance,u_pitch:et.pitch/360*2*Math.PI,u_rotate_symbol:+g,u_aspect_ratio:et.width/et.height,u_fade_change:I.options.fadeDuration?I.symbolFadeChange:1,u_matrix:L,u_label_plane_matrix:B,u_coord_matrix:q,u_is_text:+$,u_pitch_with_map:+S,u_texsize:J,u_texture:0}},ul=(T,a,g,S,I,L,B,q,$,J,et)=>{let ut=I.transform;return u.extend(ba(T,a,g,S,I,L,B,q,$,J),{u_gamma_scale:S?Math.cos(ut._pitch)*ut.cameraToCenterDistance:1,u_device_pixel_ratio:I.pixelRatio,u_is_halo:+et})},cl=(T,a,g,S,I,L,B,q,$,J)=>u.extend(ul(T,a,g,S,I,L,B,q,!0,$,!0),{u_texsize_icon:J,u_texture_icon:1}),Cc=(T,a,g)=>({u_matrix:T,u_opacity:a,u_color:g}),Bs=(T,a,g,S,I,L)=>u.extend(function(B,q,$,J){let et=$.imageManager.getPattern(B.from.toString()),ut=$.imageManager.getPattern(B.to.toString()),{width:vt,height:Ft}=$.imageManager.getPixelSize(),bt=Math.pow(2,J.tileID.overscaledZ),Ot=J.tileSize*Math.pow(2,$.transform.tileZoom)/bt,Kt=Ot*(J.tileID.canonical.x+J.tileID.wrap*bt),Wt=Ot*J.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:et.tl,u_pattern_br_a:et.br,u_pattern_tl_b:ut.tl,u_pattern_br_b:ut.br,u_texsize:[vt,Ft],u_mix:q.t,u_pattern_size_a:et.displaySize,u_pattern_size_b:ut.displaySize,u_scale_a:q.fromScale,u_scale_b:q.toScale,u_tile_units_to_pixels:1/It(J,1,$.transform.tileZoom),u_pixel_coord_upper:[Kt>>16,Wt>>16],u_pixel_coord_lower:[65535&Kt,65535&Wt]}}(S,L,g,I),{u_matrix:T,u_opacity:a}),fo={fillExtrusion:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_lightpos:new u.Uniform3f(T,a.u_lightpos),u_lightintensity:new u.Uniform1f(T,a.u_lightintensity),u_lightcolor:new u.Uniform3f(T,a.u_lightcolor),u_vertical_gradient:new u.Uniform1f(T,a.u_vertical_gradient),u_opacity:new u.Uniform1f(T,a.u_opacity)}),fillExtrusionPattern:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_lightpos:new u.Uniform3f(T,a.u_lightpos),u_lightintensity:new u.Uniform1f(T,a.u_lightintensity),u_lightcolor:new u.Uniform3f(T,a.u_lightcolor),u_vertical_gradient:new u.Uniform1f(T,a.u_vertical_gradient),u_height_factor:new u.Uniform1f(T,a.u_height_factor),u_image:new u.Uniform1i(T,a.u_image),u_texsize:new u.Uniform2f(T,a.u_texsize),u_pixel_coord_upper:new u.Uniform2f(T,a.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(T,a.u_pixel_coord_lower),u_scale:new u.Uniform3f(T,a.u_scale),u_fade:new u.Uniform1f(T,a.u_fade),u_opacity:new u.Uniform1f(T,a.u_opacity)}),fill:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix)}),fillPattern:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_image:new u.Uniform1i(T,a.u_image),u_texsize:new u.Uniform2f(T,a.u_texsize),u_pixel_coord_upper:new u.Uniform2f(T,a.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(T,a.u_pixel_coord_lower),u_scale:new u.Uniform3f(T,a.u_scale),u_fade:new u.Uniform1f(T,a.u_fade)}),fillOutline:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_world:new u.Uniform2f(T,a.u_world)}),fillOutlinePattern:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_world:new u.Uniform2f(T,a.u_world),u_image:new u.Uniform1i(T,a.u_image),u_texsize:new u.Uniform2f(T,a.u_texsize),u_pixel_coord_upper:new u.Uniform2f(T,a.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(T,a.u_pixel_coord_lower),u_scale:new u.Uniform3f(T,a.u_scale),u_fade:new u.Uniform1f(T,a.u_fade)}),circle:(T,a)=>({u_camera_to_center_distance:new u.Uniform1f(T,a.u_camera_to_center_distance),u_scale_with_map:new u.Uniform1i(T,a.u_scale_with_map),u_pitch_with_map:new u.Uniform1i(T,a.u_pitch_with_map),u_extrude_scale:new u.Uniform2f(T,a.u_extrude_scale),u_device_pixel_ratio:new u.Uniform1f(T,a.u_device_pixel_ratio),u_matrix:new u.UniformMatrix4f(T,a.u_matrix)}),collisionBox:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_camera_to_center_distance:new u.Uniform1f(T,a.u_camera_to_center_distance),u_pixels_to_tile_units:new u.Uniform1f(T,a.u_pixels_to_tile_units),u_extrude_scale:new u.Uniform2f(T,a.u_extrude_scale),u_overscale_factor:new u.Uniform1f(T,a.u_overscale_factor)}),collisionCircle:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_inv_matrix:new u.UniformMatrix4f(T,a.u_inv_matrix),u_camera_to_center_distance:new u.Uniform1f(T,a.u_camera_to_center_distance),u_viewport_size:new u.Uniform2f(T,a.u_viewport_size)}),debug:(T,a)=>({u_color:new u.UniformColor(T,a.u_color),u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_overlay:new u.Uniform1i(T,a.u_overlay),u_overlay_scale:new u.Uniform1f(T,a.u_overlay_scale)}),clippingMask:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix)}),heatmap:(T,a)=>({u_extrude_scale:new u.Uniform1f(T,a.u_extrude_scale),u_intensity:new u.Uniform1f(T,a.u_intensity),u_matrix:new u.UniformMatrix4f(T,a.u_matrix)}),heatmapTexture:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_world:new u.Uniform2f(T,a.u_world),u_image:new u.Uniform1i(T,a.u_image),u_color_ramp:new u.Uniform1i(T,a.u_color_ramp),u_opacity:new u.Uniform1f(T,a.u_opacity)}),hillshade:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_image:new u.Uniform1i(T,a.u_image),u_latrange:new u.Uniform2f(T,a.u_latrange),u_light:new u.Uniform2f(T,a.u_light),u_shadow:new u.UniformColor(T,a.u_shadow),u_highlight:new u.UniformColor(T,a.u_highlight),u_accent:new u.UniformColor(T,a.u_accent)}),hillshadePrepare:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_image:new u.Uniform1i(T,a.u_image),u_dimension:new u.Uniform2f(T,a.u_dimension),u_zoom:new u.Uniform1f(T,a.u_zoom),u_unpack:new u.Uniform4f(T,a.u_unpack)}),line:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_ratio:new u.Uniform1f(T,a.u_ratio),u_device_pixel_ratio:new u.Uniform1f(T,a.u_device_pixel_ratio),u_units_to_pixels:new u.Uniform2f(T,a.u_units_to_pixels)}),lineGradient:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_ratio:new u.Uniform1f(T,a.u_ratio),u_device_pixel_ratio:new u.Uniform1f(T,a.u_device_pixel_ratio),u_units_to_pixels:new u.Uniform2f(T,a.u_units_to_pixels),u_image:new u.Uniform1i(T,a.u_image),u_image_height:new u.Uniform1f(T,a.u_image_height)}),linePattern:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_texsize:new u.Uniform2f(T,a.u_texsize),u_ratio:new u.Uniform1f(T,a.u_ratio),u_device_pixel_ratio:new u.Uniform1f(T,a.u_device_pixel_ratio),u_image:new u.Uniform1i(T,a.u_image),u_units_to_pixels:new u.Uniform2f(T,a.u_units_to_pixels),u_scale:new u.Uniform3f(T,a.u_scale),u_fade:new u.Uniform1f(T,a.u_fade)}),lineSDF:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_ratio:new u.Uniform1f(T,a.u_ratio),u_device_pixel_ratio:new u.Uniform1f(T,a.u_device_pixel_ratio),u_units_to_pixels:new u.Uniform2f(T,a.u_units_to_pixels),u_patternscale_a:new u.Uniform2f(T,a.u_patternscale_a),u_patternscale_b:new u.Uniform2f(T,a.u_patternscale_b),u_sdfgamma:new u.Uniform1f(T,a.u_sdfgamma),u_image:new u.Uniform1i(T,a.u_image),u_tex_y_a:new u.Uniform1f(T,a.u_tex_y_a),u_tex_y_b:new u.Uniform1f(T,a.u_tex_y_b),u_mix:new u.Uniform1f(T,a.u_mix)}),raster:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_tl_parent:new u.Uniform2f(T,a.u_tl_parent),u_scale_parent:new u.Uniform1f(T,a.u_scale_parent),u_buffer_scale:new u.Uniform1f(T,a.u_buffer_scale),u_fade_t:new u.Uniform1f(T,a.u_fade_t),u_opacity:new u.Uniform1f(T,a.u_opacity),u_image0:new u.Uniform1i(T,a.u_image0),u_image1:new u.Uniform1i(T,a.u_image1),u_brightness_low:new u.Uniform1f(T,a.u_brightness_low),u_brightness_high:new u.Uniform1f(T,a.u_brightness_high),u_saturation_factor:new u.Uniform1f(T,a.u_saturation_factor),u_contrast_factor:new u.Uniform1f(T,a.u_contrast_factor),u_spin_weights:new u.Uniform3f(T,a.u_spin_weights)}),symbolIcon:(T,a)=>({u_is_size_zoom_constant:new u.Uniform1i(T,a.u_is_size_zoom_constant),u_is_size_feature_constant:new u.Uniform1i(T,a.u_is_size_feature_constant),u_size_t:new u.Uniform1f(T,a.u_size_t),u_size:new u.Uniform1f(T,a.u_size),u_camera_to_center_distance:new u.Uniform1f(T,a.u_camera_to_center_distance),u_pitch:new u.Uniform1f(T,a.u_pitch),u_rotate_symbol:new u.Uniform1i(T,a.u_rotate_symbol),u_aspect_ratio:new u.Uniform1f(T,a.u_aspect_ratio),u_fade_change:new u.Uniform1f(T,a.u_fade_change),u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_label_plane_matrix:new u.UniformMatrix4f(T,a.u_label_plane_matrix),u_coord_matrix:new u.UniformMatrix4f(T,a.u_coord_matrix),u_is_text:new u.Uniform1i(T,a.u_is_text),u_pitch_with_map:new u.Uniform1i(T,a.u_pitch_with_map),u_texsize:new u.Uniform2f(T,a.u_texsize),u_texture:new u.Uniform1i(T,a.u_texture)}),symbolSDF:(T,a)=>({u_is_size_zoom_constant:new u.Uniform1i(T,a.u_is_size_zoom_constant),u_is_size_feature_constant:new u.Uniform1i(T,a.u_is_size_feature_constant),u_size_t:new u.Uniform1f(T,a.u_size_t),u_size:new u.Uniform1f(T,a.u_size),u_camera_to_center_distance:new u.Uniform1f(T,a.u_camera_to_center_distance),u_pitch:new u.Uniform1f(T,a.u_pitch),u_rotate_symbol:new u.Uniform1i(T,a.u_rotate_symbol),u_aspect_ratio:new u.Uniform1f(T,a.u_aspect_ratio),u_fade_change:new u.Uniform1f(T,a.u_fade_change),u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_label_plane_matrix:new u.UniformMatrix4f(T,a.u_label_plane_matrix),u_coord_matrix:new u.UniformMatrix4f(T,a.u_coord_matrix),u_is_text:new u.Uniform1i(T,a.u_is_text),u_pitch_with_map:new u.Uniform1i(T,a.u_pitch_with_map),u_texsize:new u.Uniform2f(T,a.u_texsize),u_texture:new u.Uniform1i(T,a.u_texture),u_gamma_scale:new u.Uniform1f(T,a.u_gamma_scale),u_device_pixel_ratio:new u.Uniform1f(T,a.u_device_pixel_ratio),u_is_halo:new u.Uniform1i(T,a.u_is_halo)}),symbolTextAndIcon:(T,a)=>({u_is_size_zoom_constant:new u.Uniform1i(T,a.u_is_size_zoom_constant),u_is_size_feature_constant:new u.Uniform1i(T,a.u_is_size_feature_constant),u_size_t:new u.Uniform1f(T,a.u_size_t),u_size:new u.Uniform1f(T,a.u_size),u_camera_to_center_distance:new u.Uniform1f(T,a.u_camera_to_center_distance),u_pitch:new u.Uniform1f(T,a.u_pitch),u_rotate_symbol:new u.Uniform1i(T,a.u_rotate_symbol),u_aspect_ratio:new u.Uniform1f(T,a.u_aspect_ratio),u_fade_change:new u.Uniform1f(T,a.u_fade_change),u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_label_plane_matrix:new u.UniformMatrix4f(T,a.u_label_plane_matrix),u_coord_matrix:new u.UniformMatrix4f(T,a.u_coord_matrix),u_is_text:new u.Uniform1i(T,a.u_is_text),u_pitch_with_map:new u.Uniform1i(T,a.u_pitch_with_map),u_texsize:new u.Uniform2f(T,a.u_texsize),u_texsize_icon:new u.Uniform2f(T,a.u_texsize_icon),u_texture:new u.Uniform1i(T,a.u_texture),u_texture_icon:new u.Uniform1i(T,a.u_texture_icon),u_gamma_scale:new u.Uniform1f(T,a.u_gamma_scale),u_device_pixel_ratio:new u.Uniform1f(T,a.u_device_pixel_ratio),u_is_halo:new u.Uniform1i(T,a.u_is_halo)}),background:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_opacity:new u.Uniform1f(T,a.u_opacity),u_color:new u.UniformColor(T,a.u_color)}),backgroundPattern:(T,a)=>({u_matrix:new u.UniformMatrix4f(T,a.u_matrix),u_opacity:new u.Uniform1f(T,a.u_opacity),u_image:new u.Uniform1i(T,a.u_image),u_pattern_tl_a:new u.Uniform2f(T,a.u_pattern_tl_a),u_pattern_br_a:new u.Uniform2f(T,a.u_pattern_br_a),u_pattern_tl_b:new u.Uniform2f(T,a.u_pattern_tl_b),u_pattern_br_b:new u.Uniform2f(T,a.u_pattern_br_b),u_texsize:new u.Uniform2f(T,a.u_texsize),u_mix:new u.Uniform1f(T,a.u_mix),u_pattern_size_a:new u.Uniform2f(T,a.u_pattern_size_a),u_pattern_size_b:new u.Uniform2f(T,a.u_pattern_size_b),u_scale_a:new u.Uniform1f(T,a.u_scale_a),u_scale_b:new u.Uniform1f(T,a.u_scale_b),u_pixel_coord_upper:new u.Uniform2f(T,a.u_pixel_coord_upper),u_pixel_coord_lower:new u.Uniform2f(T,a.u_pixel_coord_lower),u_tile_units_to_pixels:new u.Uniform1f(T,a.u_tile_units_to_pixels)})};class aa{constructor(a,g,S){this.context=a;let I=a.gl;this.buffer=I.createBuffer(),this.dynamicDraw=Boolean(S),this.context.unbindVAO(),a.bindElementBuffer.set(this.buffer),I.bufferData(I.ELEMENT_ARRAY_BUFFER,g.arrayBuffer,this.dynamicDraw?I.DYNAMIC_DRAW:I.STATIC_DRAW),this.dynamicDraw||delete g.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(a){let g=this.context.gl;this.context.unbindVAO(),this.bind(),g.bufferSubData(g.ELEMENT_ARRAY_BUFFER,0,a.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let sa={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class qa{constructor(a,g,S,I){this.length=g.length,this.attributes=S,this.itemSize=g.bytesPerElement,this.dynamicDraw=I,this.context=a;let L=a.gl;this.buffer=L.createBuffer(),a.bindVertexBuffer.set(this.buffer),L.bufferData(L.ARRAY_BUFFER,g.arrayBuffer,this.dynamicDraw?L.DYNAMIC_DRAW:L.STATIC_DRAW),this.dynamicDraw||delete g.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(a){let g=this.context.gl;this.bind(),g.bufferSubData(g.ARRAY_BUFFER,0,a.arrayBuffer)}enableAttributes(a,g){for(let S=0;S<this.attributes.length;S++){let I=g.attributes[this.attributes[S].name];I!==void 0&&a.enableVertexAttribArray(I)}}setVertexAttribPointers(a,g,S){for(let I=0;I<this.attributes.length;I++){let L=this.attributes[I],B=g.attributes[L.name];B!==void 0&&a.vertexAttribPointer(B,L.components,a[sa[L.type]],!1,this.itemSize,L.offset+this.itemSize*(S||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class Yr{constructor(a){this.gl=a.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(a){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Za extends Yr{getDefault(){return u.Color.transparent}set(a){let g=this.current;(a.r!==g.r||a.g!==g.g||a.b!==g.b||a.a!==g.a||this.dirty)&&(this.gl.clearColor(a.r,a.g,a.b,a.a),this.current=a,this.dirty=!1)}}class Xa extends Yr{getDefault(){return 1}set(a){(a!==this.current||this.dirty)&&(this.gl.clearDepth(a),this.current=a,this.dirty=!1)}}class Dn extends Yr{getDefault(){return 0}set(a){(a!==this.current||this.dirty)&&(this.gl.clearStencil(a),this.current=a,this.dirty=!1)}}class Ji extends Yr{getDefault(){return[!0,!0,!0,!0]}set(a){let g=this.current;(a[0]!==g[0]||a[1]!==g[1]||a[2]!==g[2]||a[3]!==g[3]||this.dirty)&&(this.gl.colorMask(a[0],a[1],a[2],a[3]),this.current=a,this.dirty=!1)}}class On extends Yr{getDefault(){return!0}set(a){(a!==this.current||this.dirty)&&(this.gl.depthMask(a),this.current=a,this.dirty=!1)}}class Yl extends Yr{getDefault(){return 255}set(a){(a!==this.current||this.dirty)&&(this.gl.stencilMask(a),this.current=a,this.dirty=!1)}}class Hl extends Yr{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(a){let g=this.current;(a.func!==g.func||a.ref!==g.ref||a.mask!==g.mask||this.dirty)&&(this.gl.stencilFunc(a.func,a.ref,a.mask),this.current=a,this.dirty=!1)}}class Jl extends Yr{getDefault(){let a=this.gl;return[a.KEEP,a.KEEP,a.KEEP]}set(a){let g=this.current;(a[0]!==g[0]||a[1]!==g[1]||a[2]!==g[2]||this.dirty)&&(this.gl.stencilOp(a[0],a[1],a[2]),this.current=a,this.dirty=!1)}}class hl extends Yr{getDefault(){return!1}set(a){if(a===this.current&&!this.dirty)return;let g=this.gl;a?g.enable(g.STENCIL_TEST):g.disable(g.STENCIL_TEST),this.current=a,this.dirty=!1}}class pl extends Yr{getDefault(){return[0,1]}set(a){let g=this.current;(a[0]!==g[0]||a[1]!==g[1]||this.dirty)&&(this.gl.depthRange(a[0],a[1]),this.current=a,this.dirty=!1)}}class Us extends Yr{getDefault(){return!1}set(a){if(a===this.current&&!this.dirty)return;let g=this.gl;a?g.enable(g.DEPTH_TEST):g.disable(g.DEPTH_TEST),this.current=a,this.dirty=!1}}class fl extends Yr{getDefault(){return this.gl.LESS}set(a){(a!==this.current||this.dirty)&&(this.gl.depthFunc(a),this.current=a,this.dirty=!1)}}class Ql extends Yr{getDefault(){return!1}set(a){if(a===this.current&&!this.dirty)return;let g=this.gl;a?g.enable(g.BLEND):g.disable(g.BLEND),this.current=a,this.dirty=!1}}class dl extends Yr{getDefault(){let a=this.gl;return[a.ONE,a.ZERO]}set(a){let g=this.current;(a[0]!==g[0]||a[1]!==g[1]||this.dirty)&&(this.gl.blendFunc(a[0],a[1]),this.current=a,this.dirty=!1)}}class Ac extends Yr{getDefault(){return u.Color.transparent}set(a){let g=this.current;(a.r!==g.r||a.g!==g.g||a.b!==g.b||a.a!==g.a||this.dirty)&&(this.gl.blendColor(a.r,a.g,a.b,a.a),this.current=a,this.dirty=!1)}}class Ns extends Yr{getDefault(){return this.gl.FUNC_ADD}set(a){(a!==this.current||this.dirty)&&(this.gl.blendEquation(a),this.current=a,this.dirty=!1)}}class la extends Yr{getDefault(){return!1}set(a){if(a===this.current&&!this.dirty)return;let g=this.gl;a?g.enable(g.CULL_FACE):g.disable(g.CULL_FACE),this.current=a,this.dirty=!1}}class Pc extends Yr{getDefault(){return this.gl.BACK}set(a){(a!==this.current||this.dirty)&&(this.gl.cullFace(a),this.current=a,this.dirty=!1)}}class Fn extends Yr{getDefault(){return this.gl.CCW}set(a){(a!==this.current||this.dirty)&&(this.gl.frontFace(a),this.current=a,this.dirty=!1)}}class Nu extends Yr{getDefault(){return null}set(a){(a!==this.current||this.dirty)&&(this.gl.useProgram(a),this.current=a,this.dirty=!1)}}class Wa extends Yr{getDefault(){return this.gl.TEXTURE0}set(a){(a!==this.current||this.dirty)&&(this.gl.activeTexture(a),this.current=a,this.dirty=!1)}}class $a extends Yr{getDefault(){let a=this.gl;return[0,0,a.drawingBufferWidth,a.drawingBufferHeight]}set(a){let g=this.current;(a[0]!==g[0]||a[1]!==g[1]||a[2]!==g[2]||a[3]!==g[3]||this.dirty)&&(this.gl.viewport(a[0],a[1],a[2],a[3]),this.current=a,this.dirty=!1)}}class vs extends Yr{getDefault(){return null}set(a){if(a===this.current&&!this.dirty)return;let g=this.gl;g.bindFramebuffer(g.FRAMEBUFFER,a),this.current=a,this.dirty=!1}}class wa extends Yr{getDefault(){return null}set(a){if(a===this.current&&!this.dirty)return;let g=this.gl;g.bindRenderbuffer(g.RENDERBUFFER,a),this.current=a,this.dirty=!1}}class ua extends Yr{getDefault(){return null}set(a){if(a===this.current&&!this.dirty)return;let g=this.gl;g.bindTexture(g.TEXTURE_2D,a),this.current=a,this.dirty=!1}}class Uo extends Yr{getDefault(){return null}set(a){if(a===this.current&&!this.dirty)return;let g=this.gl;g.bindBuffer(g.ARRAY_BUFFER,a),this.current=a,this.dirty=!1}}class Ka extends Yr{getDefault(){return null}set(a){let g=this.gl;g.bindBuffer(g.ELEMENT_ARRAY_BUFFER,a),this.current=a,this.dirty=!1}}class Ea extends Yr{constructor(a){super(a),this.vao=a.extVertexArrayObject}getDefault(){return null}set(a){this.vao&&(a!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(a),this.current=a,this.dirty=!1)}}class tu extends Yr{getDefault(){return 4}set(a){if(a===this.current&&!this.dirty)return;let g=this.gl;g.pixelStorei(g.UNPACK_ALIGNMENT,a),this.current=a,this.dirty=!1}}class Ya extends Yr{getDefault(){return!1}set(a){if(a===this.current&&!this.dirty)return;let g=this.gl;g.pixelStorei(g.UNPACK_PREMULTIPLY_ALPHA_WEBGL,a),this.current=a,this.dirty=!1}}class yi extends Yr{getDefault(){return!1}set(a){if(a===this.current&&!this.dirty)return;let g=this.gl;g.pixelStorei(g.UNPACK_FLIP_Y_WEBGL,a),this.current=a,this.dirty=!1}}class xs extends Yr{constructor(a,g){super(a),this.context=a,this.parent=g}getDefault(){return null}}class Sa extends xs{setDirty(){this.dirty=!0}set(a){if(a===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let g=this.gl;g.framebufferTexture2D(g.FRAMEBUFFER,g.COLOR_ATTACHMENT0,g.TEXTURE_2D,a,0),this.current=a,this.dirty=!1}}class Vu extends xs{set(a){if(a===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let g=this.gl;g.framebufferRenderbuffer(g.FRAMEBUFFER,g.DEPTH_ATTACHMENT,g.RENDERBUFFER,a),this.current=a,this.dirty=!1}}class eu{constructor(a,g,S,I){this.context=a,this.width=g,this.height=S;let L=this.framebuffer=a.gl.createFramebuffer();this.colorAttachment=new Sa(a,L),I&&(this.depthAttachment=new Vu(a,L))}destroy(){let a=this.context.gl,g=this.colorAttachment.get();if(g&&a.deleteTexture(g),this.depthAttachment){let S=this.depthAttachment.get();S&&a.deleteRenderbuffer(S)}a.deleteFramebuffer(this.framebuffer)}}class Ur{constructor(a,g,S){this.blendFunction=a,this.blendColor=g,this.mask=S}}Ur.Replace=[1,0],Ur.disabled=new Ur(Ur.Replace,u.Color.transparent,[!1,!1,!1,!1]),Ur.unblended=new Ur(Ur.Replace,u.Color.transparent,[!0,!0,!0,!0]),Ur.alphaBlended=new Ur([1,771],u.Color.transparent,[!0,!0,!0,!0]);class ml{constructor(a){this.gl=a,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new Za(this),this.clearDepth=new Xa(this),this.clearStencil=new Dn(this),this.colorMask=new Ji(this),this.depthMask=new On(this),this.stencilMask=new Yl(this),this.stencilFunc=new Hl(this),this.stencilOp=new Jl(this),this.stencilTest=new hl(this),this.depthRange=new pl(this),this.depthTest=new Us(this),this.depthFunc=new fl(this),this.blend=new Ql(this),this.blendFunc=new dl(this),this.blendColor=new Ac(this),this.blendEquation=new Ns(this),this.cullFace=new la(this),this.cullFaceSide=new Pc(this),this.frontFace=new Fn(this),this.program=new Nu(this),this.activeTexture=new Wa(this),this.viewport=new $a(this),this.bindFramebuffer=new vs(this),this.bindRenderbuffer=new wa(this),this.bindTexture=new ua(this),this.bindVertexBuffer=new Uo(this),this.bindElementBuffer=new Ka(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new Ea(this),this.pixelStoreUnpack=new tu(this),this.pixelStoreUnpackPremultiplyAlpha=new Ya(this),this.pixelStoreUnpackFlipY=new yi(this),this.extTextureFilterAnisotropic=a.getExtension("EXT_texture_filter_anisotropic")||a.getExtension("MOZ_EXT_texture_filter_anisotropic")||a.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=a.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=a.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(a.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=a.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=a.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=a.getParameter(a.MAX_TEXTURE_SIZE)}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.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(a,g){return new aa(this,a,g)}createVertexBuffer(a,g,S){return new qa(this,a,g,S)}createRenderbuffer(a,g,S){let I=this.gl,L=I.createRenderbuffer();return this.bindRenderbuffer.set(L),I.renderbufferStorage(I.RENDERBUFFER,a,g,S),this.bindRenderbuffer.set(null),L}createFramebuffer(a,g,S){return new eu(this,a,g,S)}clear({color:a,depth:g}){let S=this.gl,I=0;a&&(I|=S.COLOR_BUFFER_BIT,this.clearColor.set(a),this.colorMask.set([!0,!0,!0,!0])),g!==void 0&&(I|=S.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(g),this.depthMask.set(!0)),S.clear(I)}setCullFace(a){a.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(a.mode),this.frontFace.set(a.frontFace))}setDepthMode(a){a.func!==this.gl.ALWAYS||a.mask?(this.depthTest.set(!0),this.depthFunc.set(a.func),this.depthMask.set(a.mask),this.depthRange.set(a.range)):this.depthTest.set(!1)}setStencilMode(a){a.test.func!==this.gl.ALWAYS||a.mask?(this.stencilTest.set(!0),this.stencilMask.set(a.mask),this.stencilOp.set([a.fail,a.depthFail,a.pass]),this.stencilFunc.set({func:a.test.func,ref:a.ref,mask:a.test.mask})):this.stencilTest.set(!1)}setColorMode(a){U(a.blendFunction,Ur.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(a.blendFunction),this.blendColor.set(a.blendColor)),this.colorMask.set(a.mask)}unbindVAO(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)}}class ei{constructor(a,g,S){this.func=a,this.mask=g,this.range=S}}ei.ReadOnly=!1,ei.ReadWrite=!0,ei.disabled=new ei(519,ei.ReadOnly,[0,1]);let Wo=7680;class xi{constructor(a,g,S,I,L,B){this.test=a,this.ref=g,this.mask=S,this.fail=I,this.depthFail=L,this.pass=B}}xi.disabled=new xi({func:519,mask:0},0,0,Wo,Wo,Wo);class Qi{constructor(a,g,S){this.enable=a,this.mode=g,this.frontFace=S}}let gl;function yl(T,a,g,S,I,L,B){let q=T.context,$=q.gl,J=T.useProgram("collisionBox"),et=[],ut=0,vt=0;for(let Ht=0;Ht<S.length;Ht++){let _e=S[Ht],he=a.getTile(_e),de=he.getBucket(g);if(!de)continue;let Pe=_e.posMatrix;I[0]===0&&I[1]===0||(Pe=T.translatePosMatrix(_e.posMatrix,he,I,L));let Re=B?de.textCollisionBox:de.iconCollisionBox,ve=de.collisionCircleArray;if(ve.length>0){let ar=u.create(),Ye=Pe;u.mul(ar,de.placementInvProjMatrix,T.transform.glCoordMatrix),u.mul(ar,ar,de.placementViewportMatrix),et.push({circleArray:ve,circleOffset:vt,transform:Ye,invTransform:ar}),ut+=ve.length/4,vt=ut}Re&&J.draw(q,$.LINES,ei.disabled,xi.disabled,T.colorModeForRenderPass(),Qi.disabled,Bo(Pe,T.transform,he),g.id,Re.layoutVertexBuffer,Re.indexBuffer,Re.segments,null,T.transform.zoom,null,null,Re.collisionVertexBuffer)}if(!B||!et.length)return;let Ft=T.useProgram("collisionCircle"),bt=new u.CollisionCircleLayoutArray;bt.resize(4*ut),bt._trim();let Ot=0;for(let Ht of et)for(let _e=0;_e<Ht.circleArray.length/4;_e++){let he=4*_e,de=Ht.circleArray[he+0],Pe=Ht.circleArray[he+1],Re=Ht.circleArray[he+2],ve=Ht.circleArray[he+3];bt.emplace(Ot++,de,Pe,Re,ve,0),bt.emplace(Ot++,de,Pe,Re,ve,1),bt.emplace(Ot++,de,Pe,Re,ve,2),bt.emplace(Ot++,de,Pe,Re,ve,3)}(!gl||gl.length<2*ut)&&(gl=function(Ht){let _e=2*Ht,he=new u.QuadTriangleArray;he.resize(_e),he._trim();for(let de=0;de<_e;de++){let Pe=6*de;he.uint16[Pe+0]=4*de+0,he.uint16[Pe+1]=4*de+1,he.uint16[Pe+2]=4*de+2,he.uint16[Pe+3]=4*de+2,he.uint16[Pe+4]=4*de+3,he.uint16[Pe+5]=4*de+0}return he}(ut));let Kt=q.createIndexBuffer(gl,!0),Wt=q.createVertexBuffer(bt,u.collisionCircleLayout.members,!0);for(let Ht of et){let _e={u_matrix:Ht.transform,u_inv_matrix:Ht.invTransform,u_camera_to_center_distance:(ie=T.transform).cameraToCenterDistance,u_viewport_size:[ie.width,ie.height]};Ft.draw(q,$.TRIANGLES,ei.disabled,xi.disabled,T.colorModeForRenderPass(),Qi.disabled,_e,g.id,Wt,Kt,u.SegmentVector.simpleSegment(0,2*Ht.circleOffset,Ht.circleArray.length,Ht.circleArray.length/2),null,T.transform.zoom,null,null,null)}var ie;Wt.destroy(),Kt.destroy()}Qi.disabled=new Qi(!1,1029,2305),Qi.backCCW=new Qi(!0,1029,2305);let bs=u.identity(new Float32Array(16));function ru(T,a,g,S,I,L){let{horizontalAlign:B,verticalAlign:q}=u.getAnchorAlignment(T),$=-(B-.5)*a,J=-(q-.5)*g,et=u.evaluateVariableOffset(T,S);return new u.pointGeometry(($/I+et[0])*L,(J/I+et[1])*L)}function ca(T,a,g,S,I,L,B,q,$,J){let et=T.text.placedSymbolArray,ut=T.text.dynamicLayoutVertexArray,vt=T.icon.dynamicLayoutVertexArray,Ft={};ut.clear();for(let bt=0;bt<et.length;bt++){let Ot=et.get(bt),Kt=T.allowVerticalPlacement&&!Ot.placedOrientation,Wt=Ot.hidden||!Ot.crossTileID||Kt?null:S[Ot.crossTileID];if(Wt){let ie=new u.pointGeometry(Ot.anchorX,Ot.anchorY),Ht=ai(ie,g?B:L),_e=Ge(I.cameraToCenterDistance,Ht.signedDistanceFromCamera),he=u.evaluateSizeForFeature(T.textSizeData,$,Ot)*_e/u.ONE_EM;g&&(he*=T.tilePixelRatio/q);let{width:de,height:Pe,anchor:Re,textOffset:ve,textBoxScale:ar}=Wt,Ye=ru(Re,de,Pe,ve,ar,he),Ar=g?ai(ie.add(Ye),L).point:Ht.point.add(a?Ye.rotate(-I.angle):Ye),p=T.allowVerticalPlacement&&Ot.placedOrientation===u.WritingMode.vertical?Math.PI/2:0;for(let m=0;m<Ot.numGlyphs;m++)u.addDynamicAttributes(ut,Ar,p);J&&Ot.associatedIconIndex>=0&&(Ft[Ot.associatedIconIndex]={shiftedAnchor:Ar,angle:p})}else Q(Ot.numGlyphs,ut)}if(J){vt.clear();let bt=T.icon.placedSymbolArray;for(let Ot=0;Ot<bt.length;Ot++){let Kt=bt.get(Ot);if(Kt.hidden)Q(Kt.numGlyphs,vt);else{let Wt=Ft[Ot];if(Wt)for(let ie=0;ie<Kt.numGlyphs;ie++)u.addDynamicAttributes(vt,Wt.shiftedAnchor,Wt.angle);else Q(Kt.numGlyphs,vt)}}T.icon.dynamicLayoutVertexBuffer.updateData(vt)}T.text.dynamicLayoutVertexBuffer.updateData(ut)}function ha(T,a,g){return g.iconsInText&&a?"symbolTextAndIcon":T?"symbolSDF":"symbolIcon"}function _l(T,a,g,S,I,L,B,q,$,J,et,ut){let vt=T.context,Ft=vt.gl,bt=T.transform,Ot=q==="map",Kt=$==="map",Wt=q!=="viewport"&&g.layout.get("symbol-placement")!=="point",ie=Ot&&!Kt&&!Wt,Ht=!g.layout.get("symbol-sort-key").isConstant(),_e=!1,he=T.depthModeForSublayer(0,ei.ReadOnly),de=g.layout.get("text-variable-anchor"),Pe=[];for(let Re of S){let ve=a.getTile(Re),ar=ve.getBucket(g);if(!ar)continue;let Ye=I?ar.text:ar.icon;if(!Ye||!Ye.segments.get().length)continue;let Ar=Ye.programConfigurations.get(g.id),p=I||ar.sdfIcons,m=I?ar.textSizeData:ar.iconSizeData,d=Kt||bt.pitch!==0,x=T.useProgram(ha(p,I,ar),Ar),A=u.evaluateSizeForZoom(m,bt.zoom),k,R,j,K,tt=[0,0],ct=null;if(I){if(R=ve.glyphAtlasTexture,j=Ft.LINEAR,k=ve.glyphAtlasTexture.size,ar.iconsInText){tt=ve.imageAtlasTexture.size,ct=ve.imageAtlasTexture;let le=m.kind==="composite"||m.kind==="camera";K=d||T.options.rotating||T.options.zooming||le?Ft.LINEAR:Ft.NEAREST}}else{let le=g.layout.get("icon-size").constantOr(0)!==1||ar.iconsNeedLinear;R=ve.imageAtlasTexture,j=p||T.options.rotating||T.options.zooming||le||d?Ft.LINEAR:Ft.NEAREST,k=ve.imageAtlasTexture.size}let ft=It(ve,1,T.transform.zoom),mt=Ei(Re.posMatrix,Kt,Ot,T.transform,ft),Mt=Xn(Re.posMatrix,Kt,Ot,T.transform,ft),At=de&&ar.hasTextData(),Dt=g.layout.get("icon-text-fit")!=="none"&&At&&ar.hasIconData();if(Wt){let le=g.layout.get("text-rotation-alignment")==="map";kr(ar,Re.posMatrix,T,I,mt,Mt,Kt,J,le)}let xt=T.translatePosMatrix(Re.posMatrix,ve,L,B),Rt=Wt||I&&de||Dt?bs:mt,Nt=T.translatePosMatrix(Mt,ve,L,B,!0),Yt=p&&g.paint.get(I?"text-halo-width":"icon-halo-width").constantOr(1)!==0,ne;ne=p?ar.iconsInText?cl(m.kind,A,ie,Kt,T,xt,Rt,Nt,k,tt):ul(m.kind,A,ie,Kt,T,xt,Rt,Nt,I,k,!0):ba(m.kind,A,ie,Kt,T,xt,Rt,Nt,I,k);let ae={program:x,buffers:Ye,uniformValues:ne,atlasTexture:R,atlasTextureIcon:ct,atlasInterpolation:j,atlasInterpolationIcon:K,isSDF:p,hasHalo:Yt};if(Ht&&ar.canOverlap){_e=!0;let le=Ye.segments.get();for(let xe of le)Pe.push({segments:new u.SegmentVector([xe]),sortKey:xe.sortKey,state:ae})}else Pe.push({segments:Ye.segments,sortKey:0,state:ae})}_e&&Pe.sort((Re,ve)=>Re.sortKey-ve.sortKey);for(let Re of Pe){let ve=Re.state;if(vt.activeTexture.set(Ft.TEXTURE0),ve.atlasTexture.bind(ve.atlasInterpolation,Ft.CLAMP_TO_EDGE),ve.atlasTextureIcon&&(vt.activeTexture.set(Ft.TEXTURE1),ve.atlasTextureIcon&&ve.atlasTextureIcon.bind(ve.atlasInterpolationIcon,Ft.CLAMP_TO_EDGE)),ve.isSDF){let ar=ve.uniformValues;ve.hasHalo&&(ar.u_is_halo=1,Ha(ve.buffers,Re.segments,g,T,ve.program,he,et,ut,ar)),ar.u_is_halo=0}Ha(ve.buffers,Re.segments,g,T,ve.program,he,et,ut,ve.uniformValues)}}function Ha(T,a,g,S,I,L,B,q,$){let J=S.context;I.draw(J,J.gl.TRIANGLES,L,B,q,Qi.disabled,$,g.id,T.layoutVertexBuffer,T.indexBuffer,a,g.paint,S.transform.zoom,T.programConfigurations.get(g.id),T.dynamicLayoutVertexBuffer,T.opacityVertexBuffer)}function bi(T,a,g,S,I,L,B){let q=T.context.gl,$=g.paint.get("fill-pattern"),J=$&&$.constantOr(1),et=g.getCrossfadeParameters(),ut,vt,Ft,bt,Ot;B?(vt=J&&!g.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",ut=q.LINES):(vt=J?"fillPattern":"fill",ut=q.TRIANGLES);for(let Kt of S){let Wt=a.getTile(Kt);if(J&&!Wt.patternsLoaded())continue;let ie=Wt.getBucket(g);if(!ie)continue;let Ht=ie.programConfigurations.get(g.id),_e=T.useProgram(vt,Ht);J&&(T.context.activeTexture.set(q.TEXTURE0),Wt.imageAtlasTexture.bind(q.LINEAR,q.CLAMP_TO_EDGE),Ht.updatePaintBuffers(et));let he=$.constantOr(null);if(he&&Wt.imageAtlas){let Pe=Wt.imageAtlas,Re=Pe.patternPositions[he.to.toString()],ve=Pe.patternPositions[he.from.toString()];Re&&ve&&Ht.setConstantPatternPositions(Re,ve)}let de=T.translatePosMatrix(Kt.posMatrix,Wt,g.paint.get("fill-translate"),g.paint.get("fill-translate-anchor"));if(B){bt=ie.indexBuffer2,Ot=ie.segments2;let Pe=[q.drawingBufferWidth,q.drawingBufferHeight];Ft=vt==="fillOutlinePattern"&&J?Lo(de,T,et,Wt,Pe):Ou(de,Pe)}else bt=ie.indexBuffer,Ot=ie.segments,Ft=J?oo(de,T,et,Wt):Mo(de);_e.draw(T.context,ut,I,T.stencilModeForClipping(Kt),L,Qi.disabled,Ft,g.id,ie.layoutVertexBuffer,bt,Ot,g.paint,T.transform.zoom,Ht)}}function Ta(T,a,g,S,I,L,B){let q=T.context,$=q.gl,J=g.paint.get("fill-extrusion-pattern"),et=J.constantOr(1),ut=g.getCrossfadeParameters(),vt=g.paint.get("fill-extrusion-opacity");for(let Ft of S){let bt=a.getTile(Ft),Ot=bt.getBucket(g);if(!Ot)continue;let Kt=Ot.programConfigurations.get(g.id),Wt=T.useProgram(et?"fillExtrusionPattern":"fillExtrusion",Kt);et&&(T.context.activeTexture.set($.TEXTURE0),bt.imageAtlasTexture.bind($.LINEAR,$.CLAMP_TO_EDGE),Kt.updatePaintBuffers(ut));let ie=J.constantOr(null);if(ie&&bt.imageAtlas){let de=bt.imageAtlas,Pe=de.patternPositions[ie.to.toString()],Re=de.patternPositions[ie.from.toString()];Pe&&Re&&Kt.setConstantPatternPositions(Pe,Re)}let Ht=T.translatePosMatrix(Ft.posMatrix,bt,g.paint.get("fill-extrusion-translate"),g.paint.get("fill-extrusion-translate-anchor")),_e=g.paint.get("fill-extrusion-vertical-gradient"),he=et?Si(Ht,T,_e,vt,Ft,ut,bt):Po(Ht,T,_e,vt);Wt.draw(q,q.gl.TRIANGLES,I,L,B,Qi.backCCW,he,g.id,Ot.layoutVertexBuffer,Ot.indexBuffer,Ot.segments,g.paint,T.transform.zoom,Kt)}}function iu(T,a,g,S,I,L){let B=T.context,q=B.gl,$=a.fbo;if(!$)return;let J=T.useProgram("hillshade");B.activeTexture.set(q.TEXTURE0),q.bindTexture(q.TEXTURE_2D,$.colorAttachment.get());let et=((ut,vt,Ft)=>{let bt=Ft.paint.get("hillshade-shadow-color"),Ot=Ft.paint.get("hillshade-highlight-color"),Kt=Ft.paint.get("hillshade-accent-color"),Wt=Ft.paint.get("hillshade-illumination-direction")*(Math.PI/180);Ft.paint.get("hillshade-illumination-anchor")==="viewport"&&(Wt-=ut.transform.angle);let ie=!ut.options.moving;return{u_matrix:ut.transform.calculatePosMatrix(vt.tileID.toUnwrapped(),ie),u_image:0,u_latrange:oa(0,vt.tileID),u_light:[Ft.paint.get("hillshade-exaggeration"),Wt],u_shadow:bt,u_highlight:Ot,u_accent:Kt}})(T,a,g);J.draw(B,q.TRIANGLES,S,I,L,Qi.disabled,et,g.id,T.rasterBoundsBuffer,T.quadTriangleIndexBuffer,T.rasterBoundsSegments)}function $n(T,a,g,S,I,L){let B=T.context,q=B.gl,$=a.dem;if($&&$.data){let J=$.dim,et=$.stride,ut=$.getPixels();if(B.activeTexture.set(q.TEXTURE1),B.pixelStoreUnpackPremultiplyAlpha.set(!1),a.demTexture=a.demTexture||T.getTileTexture(et),a.demTexture){let Ft=a.demTexture;Ft.update(ut,{premultiply:!1}),Ft.bind(q.NEAREST,q.CLAMP_TO_EDGE)}else a.demTexture=new Lt(B,ut,q.RGBA,{premultiply:!1}),a.demTexture.bind(q.NEAREST,q.CLAMP_TO_EDGE);B.activeTexture.set(q.TEXTURE0);let vt=a.fbo;if(!vt){let Ft=new Lt(B,{width:J,height:J,data:null},q.RGBA);Ft.bind(q.LINEAR,q.CLAMP_TO_EDGE),vt=a.fbo=B.createFramebuffer(J,J,!0),vt.colorAttachment.set(Ft.texture)}B.bindFramebuffer.set(vt.framebuffer),B.viewport.set([0,0,J,J]),T.useProgram("hillshadePrepare").draw(B,q.TRIANGLES,S,I,L,Qi.disabled,((Ft,bt)=>{let Ot=bt.stride,Kt=u.create();return u.ortho(Kt,0,u.EXTENT,-u.EXTENT,0,0,1),u.translate(Kt,Kt,[0,-u.EXTENT,0]),{u_matrix:Kt,u_image:1,u_dimension:[Ot,Ot],u_zoom:Ft.overscaledZ,u_unpack:bt.getUnpackVector()}})(a.tileID,$),g.id,T.rasterBoundsBuffer,T.quadTriangleIndexBuffer,T.rasterBoundsSegments),a.needsHillshadePrepare=!1}}function Gu(T,a,g,S,I){let L=S.paint.get("raster-fade-duration");if(L>0){let B=u.exported.now(),q=(B-T.timeAdded)/L,$=a?(B-a.timeAdded)/L:-1,J=g.getSource(),et=I.coveringZoomLevel({tileSize:J.tileSize,roundZoom:J.roundZoom}),ut=!a||Math.abs(a.tileID.overscaledZ-et)>Math.abs(T.tileID.overscaledZ-et),vt=ut&&T.refreshedUponExpiration?1:u.clamp(ut?q:1-$,0,1);return T.refreshedUponExpiration&&q>=1&&(T.refreshedUponExpiration=!1),a?{opacity:1,mix:1-vt}:{opacity:vt,mix:0}}return{opacity:1,mix:0}}let Mc=new u.Color(1,0,0,1),ju=new u.Color(0,1,0,1),Ia=new u.Color(0,0,1,1),Ca=new u.Color(1,0,1,1),ws=new u.Color(0,1,1,1);function vl(T,a,g,S){Aa(T,0,a+g/2,T.transform.width,g,S)}function Ja(T,a,g,S){Aa(T,a-g/2,0,g,T.transform.height,S)}function Aa(T,a,g,S,I,L){let B=T.context,q=B.gl;q.enable(q.SCISSOR_TEST),q.scissor(a*T.pixelRatio,g*T.pixelRatio,S*T.pixelRatio,I*T.pixelRatio),B.clear({color:L}),q.disable(q.SCISSOR_TEST)}function qu(T,a,g){let S=T.context,I=S.gl,L=g.posMatrix,B=T.useProgram("debug"),q=ei.disabled,$=xi.disabled,J=T.colorModeForRenderPass(),et="$debug";S.activeTexture.set(I.TEXTURE0),T.emptyTexture.bind(I.LINEAR,I.CLAMP_TO_EDGE),B.draw(S,I.LINE_STRIP,q,$,J,Qi.disabled,Hi(L,u.Color.red),et,T.debugBuffer,T.tileBorderIndexBuffer,T.debugSegments);let ut=a.getTileByID(g.key).latestRawTileData,vt=Math.floor((ut&&ut.byteLength||0)/1024),Ft=a.getTile(g).tileSize,bt=512/Math.min(Ft,512)*(g.overscaledZ/T.transform.zoom)*.5,Ot=g.canonical.toString();g.overscaledZ!==g.canonical.z&&(Ot+=` => ${g.overscaledZ}`),function(Kt,Wt){Kt.initDebugOverlayCanvas();let ie=Kt.debugOverlayCanvas,Ht=Kt.context.gl,_e=Kt.debugOverlayCanvas.getContext("2d");_e.clearRect(0,0,ie.width,ie.height),_e.shadowColor="white",_e.shadowBlur=2,_e.lineWidth=1.5,_e.strokeStyle="white",_e.textBaseline="top",_e.font="bold 36px Open Sans, sans-serif",_e.fillText(Wt,5,5),_e.strokeText(Wt,5,5),Kt.debugOverlayTexture.update(ie),Kt.debugOverlayTexture.bind(Ht.LINEAR,Ht.CLAMP_TO_EDGE)}(T,`${Ot} ${vt}kb`),B.draw(S,I.TRIANGLES,q,$,Ur.alphaBlended,Qi.disabled,Hi(L,u.Color.transparent,bt),et,T.debugBuffer,T.quadTriangleIndexBuffer,T.debugSegments)}let pa={symbol:function(T,a,g,S,I){if(T.renderPass!=="translucent")return;let L=xi.disabled,B=T.colorModeForRenderPass();g.layout.get("text-variable-anchor")&&function(q,$,J,et,ut,vt,Ft){let bt=$.transform,Ot=ut==="map",Kt=vt==="map";for(let Wt of q){let ie=et.getTile(Wt),Ht=ie.getBucket(J);if(!Ht||!Ht.text||!Ht.text.segments.get().length)continue;let _e=u.evaluateSizeForZoom(Ht.textSizeData,bt.zoom),he=It(ie,1,$.transform.zoom),de=Ei(Wt.posMatrix,Kt,Ot,$.transform,he),Pe=J.layout.get("icon-text-fit")!=="none"&&Ht.hasIconData();if(_e){let Re=Math.pow(2,bt.zoom-ie.tileID.overscaledZ);ca(Ht,Ot,Kt,Ft,bt,de,Wt.posMatrix,Re,_e,Pe)}}}(S,T,g,a,g.layout.get("text-rotation-alignment"),g.layout.get("text-pitch-alignment"),I),g.paint.get("icon-opacity").constantOr(1)!==0&&_l(T,a,g,S,!1,g.paint.get("icon-translate"),g.paint.get("icon-translate-anchor"),g.layout.get("icon-rotation-alignment"),g.layout.get("icon-pitch-alignment"),g.layout.get("icon-keep-upright"),L,B),g.paint.get("text-opacity").constantOr(1)!==0&&_l(T,a,g,S,!0,g.paint.get("text-translate"),g.paint.get("text-translate-anchor"),g.layout.get("text-rotation-alignment"),g.layout.get("text-pitch-alignment"),g.layout.get("text-keep-upright"),L,B),a.map.showCollisionBoxes&&(yl(T,a,g,S,g.paint.get("text-translate"),g.paint.get("text-translate-anchor"),!0),yl(T,a,g,S,g.paint.get("icon-translate"),g.paint.get("icon-translate-anchor"),!1))},circle:function(T,a,g,S){if(T.renderPass!=="translucent")return;let I=g.paint.get("circle-opacity"),L=g.paint.get("circle-stroke-width"),B=g.paint.get("circle-stroke-opacity"),q=!g.layout.get("circle-sort-key").isConstant();if(I.constantOr(1)===0&&(L.constantOr(1)===0||B.constantOr(1)===0))return;let $=T.context,J=$.gl,et=T.depthModeForSublayer(0,ei.ReadOnly),ut=xi.disabled,vt=T.colorModeForRenderPass(),Ft=[];for(let bt=0;bt<S.length;bt++){let Ot=S[bt],Kt=a.getTile(Ot),Wt=Kt.getBucket(g);if(!Wt)continue;let ie=Wt.programConfigurations.get(g.id),Ht={programConfiguration:ie,program:T.useProgram("circle",ie),layoutVertexBuffer:Wt.layoutVertexBuffer,indexBuffer:Wt.indexBuffer,uniformValues:ys(T,Ot,Kt,g)};if(q){let _e=Wt.segments.get();for(let he of _e)Ft.push({segments:new u.SegmentVector([he]),sortKey:he.sortKey,state:Ht})}else Ft.push({segments:Wt.segments,sortKey:0,state:Ht})}q&&Ft.sort((bt,Ot)=>bt.sortKey-Ot.sortKey);for(let bt of Ft){let{programConfiguration:Ot,program:Kt,layoutVertexBuffer:Wt,indexBuffer:ie,uniformValues:Ht}=bt.state;Kt.draw($,J.TRIANGLES,et,ut,vt,Qi.disabled,Ht,g.id,Wt,ie,bt.segments,g.paint,T.transform.zoom,Ot)}},heatmap:function(T,a,g,S){if(g.paint.get("heatmap-opacity")!==0)if(T.renderPass==="offscreen"){let I=T.context,L=I.gl,B=xi.disabled,q=new Ur([L.ONE,L.ONE],u.Color.transparent,[!0,!0,!0,!0]);(function($,J,et){let ut=$.gl;$.activeTexture.set(ut.TEXTURE1),$.viewport.set([0,0,J.width/4,J.height/4]);let vt=et.heatmapFbo;if(vt)ut.bindTexture(ut.TEXTURE_2D,vt.colorAttachment.get()),$.bindFramebuffer.set(vt.framebuffer);else{let Ft=ut.createTexture();ut.bindTexture(ut.TEXTURE_2D,Ft),ut.texParameteri(ut.TEXTURE_2D,ut.TEXTURE_WRAP_S,ut.CLAMP_TO_EDGE),ut.texParameteri(ut.TEXTURE_2D,ut.TEXTURE_WRAP_T,ut.CLAMP_TO_EDGE),ut.texParameteri(ut.TEXTURE_2D,ut.TEXTURE_MIN_FILTER,ut.LINEAR),ut.texParameteri(ut.TEXTURE_2D,ut.TEXTURE_MAG_FILTER,ut.LINEAR),vt=et.heatmapFbo=$.createFramebuffer(J.width/4,J.height/4,!1),function(bt,Ot,Kt,Wt){let ie=bt.gl;ie.texImage2D(ie.TEXTURE_2D,0,ie.RGBA,Ot.width/4,Ot.height/4,0,ie.RGBA,bt.extRenderToTextureHalfFloat?bt.extTextureHalfFloat.HALF_FLOAT_OES:ie.UNSIGNED_BYTE,null),Wt.colorAttachment.set(Kt)}($,J,Ft,vt)}})(I,T,g),I.clear({color:u.Color.transparent});for(let $=0;$<S.length;$++){let J=S[$];if(a.hasRenderableParent(J))continue;let et=a.getTile(J),ut=et.getBucket(g);if(!ut)continue;let vt=ut.programConfigurations.get(g.id),Ft=T.useProgram("heatmap",vt),{zoom:bt}=T.transform;Ft.draw(I,L.TRIANGLES,ei.disabled,B,q,Qi.disabled,Sn(J.posMatrix,et,bt,g.paint.get("heatmap-intensity")),g.id,ut.layoutVertexBuffer,ut.indexBuffer,ut.segments,g.paint,T.transform.zoom,vt)}I.viewport.set([0,0,T.width,T.height])}else T.renderPass==="translucent"&&(T.context.setColorMode(T.colorModeForRenderPass()),function(I,L){let B=I.context,q=B.gl,$=L.heatmapFbo;if(!$)return;B.activeTexture.set(q.TEXTURE0),q.bindTexture(q.TEXTURE_2D,$.colorAttachment.get()),B.activeTexture.set(q.TEXTURE1);let J=L.colorRampTexture;J||(J=L.colorRampTexture=new Lt(B,L.colorRamp,q.RGBA)),J.bind(q.LINEAR,q.CLAMP_TO_EDGE),I.useProgram("heatmapTexture").draw(B,q.TRIANGLES,ei.disabled,xi.disabled,I.colorModeForRenderPass(),Qi.disabled,((et,ut,vt,Ft)=>{let bt=u.create();u.ortho(bt,0,et.width,et.height,0,0,1);let Ot=et.context.gl;return{u_matrix:bt,u_world:[Ot.drawingBufferWidth,Ot.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:ut.paint.get("heatmap-opacity")}})(I,L),L.id,I.viewportBuffer,I.quadTriangleIndexBuffer,I.viewportSegments,L.paint,I.transform.zoom)}(T,g))},line:function(T,a,g,S){if(T.renderPass!=="translucent")return;let I=g.paint.get("line-opacity"),L=g.paint.get("line-width");if(I.constantOr(1)===0||L.constantOr(1)===0)return;let B=T.depthModeForSublayer(0,ei.ReadOnly),q=T.colorModeForRenderPass(),$=g.paint.get("line-dasharray"),J=g.paint.get("line-pattern"),et=J.constantOr(1),ut=g.paint.get("line-gradient"),vt=g.getCrossfadeParameters(),Ft=et?"linePattern":$?"lineSDF":ut?"lineGradient":"line",bt=T.context,Ot=bt.gl,Kt=!0;for(let Wt of S){let ie=a.getTile(Wt);if(et&&!ie.patternsLoaded())continue;let Ht=ie.getBucket(g);if(!Ht)continue;let _e=Ht.programConfigurations.get(g.id),he=T.context.program.get(),de=T.useProgram(Ft,_e),Pe=Kt||de.program!==he,Re=J.constantOr(null);if(Re&&ie.imageAtlas){let ar=ie.imageAtlas,Ye=ar.patternPositions[Re.to.toString()],Ar=ar.patternPositions[Re.from.toString()];Ye&&Ar&&_e.setConstantPatternPositions(Ye,Ar)}let ve=et?_s(T,ie,g,vt):$?mn(T,ie,g,$,vt):ut?Kl(T,ie,g,Ht.lineClipsArray.length):ll(T,ie,g);if(et)bt.activeTexture.set(Ot.TEXTURE0),ie.imageAtlasTexture.bind(Ot.LINEAR,Ot.CLAMP_TO_EDGE),_e.updatePaintBuffers(vt);else if($&&(Pe||T.lineAtlas.dirty))bt.activeTexture.set(Ot.TEXTURE0),T.lineAtlas.bind(bt);else if(ut){let ar=Ht.gradients[g.id],Ye=ar.texture;if(g.gradientVersion!==ar.version){let Ar=256;if(g.stepInterpolant){let p=a.getSource().maxzoom,m=Wt.canonical.z===p?Math.ceil(1<<T.transform.maxZoom-Wt.canonical.z):1;Ar=u.clamp(u.nextPowerOfTwo(Ht.maxLineLength/u.EXTENT*1024*m),256,bt.maxTextureSize)}ar.gradient=u.renderColorRamp({expression:g.gradientExpression(),evaluationKey:"lineProgress",resolution:Ar,image:ar.gradient||void 0,clips:Ht.lineClipsArray}),ar.texture?ar.texture.update(ar.gradient):ar.texture=new Lt(bt,ar.gradient,Ot.RGBA),ar.version=g.gradientVersion,Ye=ar.texture}bt.activeTexture.set(Ot.TEXTURE0),Ye.bind(g.stepInterpolant?Ot.NEAREST:Ot.LINEAR,Ot.CLAMP_TO_EDGE)}de.draw(bt,Ot.TRIANGLES,B,T.stencilModeForClipping(Wt),q,Qi.disabled,ve,g.id,Ht.layoutVertexBuffer,Ht.indexBuffer,Ht.segments,g.paint,T.transform.zoom,_e,Ht.layoutVertexBuffer2),Kt=!1}},fill:function(T,a,g,S){let I=g.paint.get("fill-color"),L=g.paint.get("fill-opacity");if(L.constantOr(1)===0)return;let B=T.colorModeForRenderPass(),q=g.paint.get("fill-pattern"),$=T.opaquePassEnabledForLayer()&&!q.constantOr(1)&&I.constantOr(u.Color.transparent).a===1&&L.constantOr(0)===1?"opaque":"translucent";if(T.renderPass===$){let J=T.depthModeForSublayer(1,T.renderPass==="opaque"?ei.ReadWrite:ei.ReadOnly);bi(T,a,g,S,J,B,!1)}if(T.renderPass==="translucent"&&g.paint.get("fill-antialias")){let J=T.depthModeForSublayer(g.getPaintProperty("fill-outline-color")?2:0,ei.ReadOnly);bi(T,a,g,S,J,B,!0)}},"fill-extrusion":function(T,a,g,S){let I=g.paint.get("fill-extrusion-opacity");if(I!==0&&T.renderPass==="translucent"){let L=new ei(T.context.gl.LEQUAL,ei.ReadWrite,T.depthRangeFor3D);if(I!==1||g.paint.get("fill-extrusion-pattern").constantOr(1))Ta(T,a,g,S,L,xi.disabled,Ur.disabled),Ta(T,a,g,S,L,T.stencilModeFor3D(),T.colorModeForRenderPass());else{let B=T.colorModeForRenderPass();Ta(T,a,g,S,L,xi.disabled,B)}}},hillshade:function(T,a,g,S){if(T.renderPass!=="offscreen"&&T.renderPass!=="translucent")return;let I=T.context,L=T.depthModeForSublayer(0,ei.ReadOnly),B=T.colorModeForRenderPass(),[q,$]=T.renderPass==="translucent"?T.stencilConfigForOverlap(S):[{},S];for(let J of $){let et=a.getTile(J);et.needsHillshadePrepare&&T.renderPass==="offscreen"?$n(T,et,g,L,xi.disabled,B):T.renderPass==="translucent"&&iu(T,et,g,L,q[J.overscaledZ],B)}I.viewport.set([0,0,T.width,T.height])},raster:function(T,a,g,S){if(T.renderPass!=="translucent"||g.paint.get("raster-opacity")===0||!S.length)return;let I=T.context,L=I.gl,B=a.getSource(),q=T.useProgram("raster"),$=T.colorModeForRenderPass(),[J,et]=B instanceof $r?[{},S]:T.stencilConfigForOverlap(S),ut=et[et.length-1].overscaledZ,vt=!T.options.moving;for(let Ft of et){let bt=T.depthModeForSublayer(Ft.overscaledZ-ut,g.paint.get("raster-opacity")===1?ei.ReadWrite:ei.ReadOnly,L.LESS),Ot=a.getTile(Ft),Kt=T.transform.calculatePosMatrix(Ft.toUnwrapped(),vt);Ot.registerFadeDuration(g.paint.get("raster-fade-duration"));let Wt=a.findLoadedParent(Ft,0),ie=Gu(Ot,Wt,a,g,T.transform),Ht,_e,he=g.paint.get("raster-resampling")==="nearest"?L.NEAREST:L.LINEAR;I.activeTexture.set(L.TEXTURE0),Ot.texture.bind(he,L.CLAMP_TO_EDGE,L.LINEAR_MIPMAP_NEAREST),I.activeTexture.set(L.TEXTURE1),Wt?(Wt.texture.bind(he,L.CLAMP_TO_EDGE,L.LINEAR_MIPMAP_NEAREST),Ht=Math.pow(2,Wt.tileID.overscaledZ-Ot.tileID.overscaledZ),_e=[Ot.tileID.canonical.x*Ht%1,Ot.tileID.canonical.y*Ht%1]):Ot.texture.bind(he,L.CLAMP_TO_EDGE,L.LINEAR_MIPMAP_NEAREST);let de=Bu(Kt,_e||[0,0],Ht||1,ie,g);B instanceof $r?q.draw(I,L.TRIANGLES,bt,xi.disabled,$,Qi.disabled,de,g.id,B.boundsBuffer,T.quadTriangleIndexBuffer,B.boundsSegments):q.draw(I,L.TRIANGLES,bt,J[Ft.overscaledZ],$,Qi.disabled,de,g.id,T.rasterBoundsBuffer,T.quadTriangleIndexBuffer,T.rasterBoundsSegments)}},background:function(T,a,g){let S=g.paint.get("background-color"),I=g.paint.get("background-opacity");if(I===0)return;let L=T.context,B=L.gl,q=T.transform,$=q.tileSize,J=g.paint.get("background-pattern");if(T.isPatternMissing(J))return;let et=!J&&S.a===1&&I===1&&T.opaquePassEnabledForLayer()?"opaque":"translucent";if(T.renderPass!==et)return;let ut=xi.disabled,vt=T.depthModeForSublayer(0,et==="opaque"?ei.ReadWrite:ei.ReadOnly),Ft=T.colorModeForRenderPass(),bt=T.useProgram(J?"backgroundPattern":"background"),Ot=q.coveringTiles({tileSize:$});J&&(L.activeTexture.set(B.TEXTURE0),T.imageManager.bind(T.context));let Kt=g.getCrossfadeParameters();for(let Wt of Ot){let ie=T.transform.calculatePosMatrix(Wt.toUnwrapped()),Ht=J?Bs(ie,I,T,J,{tileID:Wt,tileSize:$},Kt):Cc(ie,I,S);bt.draw(L,B.TRIANGLES,vt,ut,Ft,Qi.disabled,Ht,g.id,T.tileExtentBuffer,T.quadTriangleIndexBuffer,T.tileExtentSegments)}},debug:function(T,a,g){for(let S=0;S<g.length;S++)qu(T,a,g[S])},custom:function(T,a,g){let S=T.context,I=g.implementation;if(T.renderPass==="offscreen"){let L=I.prerender;L&&(T.setCustomLayerDefaults(),S.setColorMode(T.colorModeForRenderPass()),L.call(I,S.gl,T.transform.customLayerMatrix()),S.setDirty(),T.setBaseState())}else if(T.renderPass==="translucent"){T.setCustomLayerDefaults(),S.setColorMode(T.colorModeForRenderPass()),S.setStencilMode(xi.disabled);let L=I.renderingMode==="3d"?new ei(T.context.gl.LEQUAL,ei.ReadWrite,T.depthRangeFor3D):T.depthModeForSublayer(0,ei.ReadOnly);S.setDepthMode(L),I.render(S.gl,T.transform.customLayerMatrix()),S.setDirty(),T.setBaseState(),S.bindFramebuffer.set(null)}}};class ko{constructor(a,g){this.context=new ml(a),this.transform=g,this._tileTextures={},this.setup(),this.numSublayers=dr.maxUnderzooming+dr.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new nr,this.gpuTimers={}}resize(a,g,S){if(this.width=a*S,this.height=g*S,this.pixelRatio=S,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let I of this.style._order)this.style._layers[I].resize()}setup(){let a=this.context,g=new u.PosArray;g.emplaceBack(0,0),g.emplaceBack(u.EXTENT,0),g.emplaceBack(0,u.EXTENT),g.emplaceBack(u.EXTENT,u.EXTENT),this.tileExtentBuffer=a.createVertexBuffer(g,Nn.members),this.tileExtentSegments=u.SegmentVector.simpleSegment(0,0,4,2);let S=new u.PosArray;S.emplaceBack(0,0),S.emplaceBack(u.EXTENT,0),S.emplaceBack(0,u.EXTENT),S.emplaceBack(u.EXTENT,u.EXTENT),this.debugBuffer=a.createVertexBuffer(S,Nn.members),this.debugSegments=u.SegmentVector.simpleSegment(0,0,4,5);let I=new u.RasterBoundsArray;I.emplaceBack(0,0,0,0),I.emplaceBack(u.EXTENT,0,u.EXTENT,0),I.emplaceBack(0,u.EXTENT,0,u.EXTENT),I.emplaceBack(u.EXTENT,u.EXTENT,u.EXTENT,u.EXTENT),this.rasterBoundsBuffer=a.createVertexBuffer(I,pr.members),this.rasterBoundsSegments=u.SegmentVector.simpleSegment(0,0,4,2);let L=new u.PosArray;L.emplaceBack(0,0),L.emplaceBack(1,0),L.emplaceBack(0,1),L.emplaceBack(1,1),this.viewportBuffer=a.createVertexBuffer(L,Nn.members),this.viewportSegments=u.SegmentVector.simpleSegment(0,0,4,2);let B=new u.LineStripIndexArray;B.emplaceBack(0),B.emplaceBack(1),B.emplaceBack(3),B.emplaceBack(2),B.emplaceBack(0),this.tileBorderIndexBuffer=a.createIndexBuffer(B);let q=new u.TriangleIndexArray;q.emplaceBack(0,1,2),q.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=a.createIndexBuffer(q),this.emptyTexture=new Lt(a,{width:1,height:1,data:new Uint8Array([0,0,0,0])},a.gl.RGBA);let $=this.context.gl;this.stencilClearMode=new xi({func:$.ALWAYS,mask:0},0,255,$.ZERO,$.ZERO,$.ZERO)}clearStencil(){let a=this.context,g=a.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let S=u.create();u.ortho(S,0,this.width,this.height,0,0,1),u.scale(S,S,[g.drawingBufferWidth,g.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(a,g.TRIANGLES,ei.disabled,this.stencilClearMode,Ur.disabled,Qi.disabled,po(S),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(a,g){if(this.currentStencilSource===a.source||!a.isTileClipped()||!g||!g.length)return;this.currentStencilSource=a.source;let S=this.context,I=S.gl;this.nextStencilID+g.length>256&&this.clearStencil(),S.setColorMode(Ur.disabled),S.setDepthMode(ei.disabled);let L=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(let B of g){let q=this._tileClippingMaskIDs[B.key]=this.nextStencilID++;L.draw(S,I.TRIANGLES,ei.disabled,new xi({func:I.ALWAYS,mask:0},q,255,I.KEEP,I.KEEP,I.REPLACE),Ur.disabled,Qi.disabled,po(B.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let a=this.nextStencilID++,g=this.context.gl;return new xi({func:g.NOTEQUAL,mask:255},a,255,g.KEEP,g.KEEP,g.REPLACE)}stencilModeForClipping(a){let g=this.context.gl;return new xi({func:g.EQUAL,mask:255},this._tileClippingMaskIDs[a.key],0,g.KEEP,g.KEEP,g.REPLACE)}stencilConfigForOverlap(a){let g=this.context.gl,S=a.sort((B,q)=>q.overscaledZ-B.overscaledZ),I=S[S.length-1].overscaledZ,L=S[0].overscaledZ-I+1;if(L>1){this.currentStencilSource=void 0,this.nextStencilID+L>256&&this.clearStencil();let B={};for(let q=0;q<L;q++)B[q+I]=new xi({func:g.GEQUAL,mask:255},q+this.nextStencilID,255,g.KEEP,g.KEEP,g.REPLACE);return this.nextStencilID+=L,[B,S]}return[{[I]:xi.disabled},S]}colorModeForRenderPass(){let a=this.context.gl;return this._showOverdrawInspector?new Ur([a.CONSTANT_COLOR,a.ONE],new u.Color(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?Ur.unblended:Ur.alphaBlended}depthModeForSublayer(a,g,S){if(!this.opaquePassEnabledForLayer())return ei.disabled;let I=1-((1+this.currentLayer)*this.numSublayers+a)*this.depthEpsilon;return new ei(S||this.context.gl.LEQUAL,g,[I,I])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(a,g){this.style=a,this.options=g,this.lineAtlas=a.lineAtlas,this.imageManager=a.imageManager,this.glyphManager=a.glyphManager,this.symbolFadeChange=a.placement.symbolFadeChange(u.exported.now()),this.imageManager.beginFrame();let S=this.style._order,I=this.style.sourceCaches;for(let $ in I){let J=I[$];J.used&&J.prepare(this.context)}let L={},B={},q={};for(let $ in I){let J=I[$];L[$]=J.getVisibleCoordinates(),B[$]=L[$].slice().reverse(),q[$]=J.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let $=0;$<S.length;$++)if(this.style._layers[S[$]].is3D()){this.opaquePassCutoff=$;break}this.renderPass="offscreen";for(let $ of S){let J=this.style._layers[$];if(!J.hasOffscreenPass()||J.isHidden(this.transform.zoom))continue;let et=B[J.source];(J.type==="custom"||et.length)&&this.renderLayer(this,I[J.source],J,et)}for(this.context.bindFramebuffer.set(null),this.context.clear({color:g.showOverdrawInspector?u.Color.black:u.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=g.showOverdrawInspector,this.depthRangeFor3D=[0,1-(a._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=S.length-1;this.currentLayer>=0;this.currentLayer--){let $=this.style._layers[S[this.currentLayer]],J=I[$.source],et=L[$.source];this._renderTileClippingMasks($,et),this.renderLayer(this,J,$,et)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<S.length;this.currentLayer++){let $=this.style._layers[S[this.currentLayer]],J=I[$.source],et=($.type==="symbol"?q:B)[$.source];this._renderTileClippingMasks($,L[$.source]),this.renderLayer(this,J,$,et)}if(this.options.showTileBoundaries){let $,J;Object.values(this.style._layers).forEach(et=>{et.source&&!et.isHidden(this.transform.zoom)&&(et.source!==(J&&J.id)&&(J=this.style.sourceCaches[et.source]),(!$||$.getSource().maxzoom<J.getSource().maxzoom)&&($=J))}),$&&pa.debug(this,$,$.getVisibleCoordinates())}this.options.showPadding&&function($){let J=$.transform.padding;vl($,$.transform.height-(J.top||0),3,Mc),vl($,J.bottom||0,3,ju),Ja($,J.left||0,3,Ia),Ja($,$.transform.width-(J.right||0),3,Ca);let et=$.transform.centerPoint;(function(ut,vt,Ft,bt){Aa(ut,vt-1,Ft-10,2,20,bt),Aa(ut,vt-10,Ft-1,20,2,bt)})($,et.x,$.transform.height-et.y,ws)}(this),this.context.setDefault()}renderLayer(a,g,S,I){S.isHidden(this.transform.zoom)||(S.type==="background"||S.type==="custom"||I.length)&&(this.id=S.id,this.gpuTimingStart(S),pa[S.type](a,g,S,I,this.style.placement.variableOffsets),this.gpuTimingEnd())}gpuTimingStart(a){if(!this.options.gpuTiming)return;let g=this.context.extTimerQuery,S=this.gpuTimers[a.id];S||(S=this.gpuTimers[a.id]={calls:0,cpuTime:0,query:g.createQueryEXT()}),S.calls++,g.beginQueryEXT(g.TIME_ELAPSED_EXT,S.query)}gpuTimingEnd(){if(!this.options.gpuTiming)return;let a=this.context.extTimerQuery;a.endQueryEXT(a.TIME_ELAPSED_EXT)}collectGpuTimers(){let a=this.gpuTimers;return this.gpuTimers={},a}queryGpuTimers(a){let g={};for(let S in a){let I=a[S],L=this.context.extTimerQuery,B=L.getQueryObjectEXT(I.query,L.QUERY_RESULT_EXT)/1e6;L.deleteQueryEXT(I.query),g[S]=B}return g}translatePosMatrix(a,g,S,I,L){if(!S[0]&&!S[1])return a;let B=L?I==="map"?this.transform.angle:0:I==="viewport"?-this.transform.angle:0;if(B){let J=Math.sin(B),et=Math.cos(B);S=[S[0]*et-S[1]*J,S[0]*J+S[1]*et]}let q=[L?S[0]:It(g,S[0],this.transform.zoom),L?S[1]:It(g,S[1],this.transform.zoom),0],$=new Float32Array(16);return u.translate($,a,q),$}saveTileTexture(a){let g=this._tileTextures[a.size[0]];g?g.push(a):this._tileTextures[a.size[0]]=[a]}getTileTexture(a){let g=this._tileTextures[a];return g&&g.length>0?g.pop():null}isPatternMissing(a){if(!a)return!1;if(!a.from||!a.to)return!0;let g=this.imageManager.getPattern(a.from.toString()),S=this.imageManager.getPattern(a.to.toString());return!g||!S}useProgram(a,g){this.cache=this.cache||{};let S=`${a}${g?g.cacheKey:""}${this._showOverdrawInspector?"/overdraw":""}`;return this.cache[S]||(this.cache[S]=new Wn(this.context,a,sl[a],g,fo[a],this._showOverdrawInspector)),this.cache[S]}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 a=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(a.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new Lt(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}}class xl{constructor(a,g){this.points=a,this.planes=g}static fromInvProjectionMatrix(a,g,S){let I=Math.pow(2,S),L=[[-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(q=>u.transformMat4([],q,a)).map(q=>u.scale$1([],q,1/q[3]/g*I)),B=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(q=>{let $=function(vt,Ft){var bt=Ft[0],Ot=Ft[1],Kt=Ft[2],Wt=bt*bt+Ot*Ot+Kt*Kt;return Wt>0&&(Wt=1/Math.sqrt(Wt)),vt[0]=Ft[0]*Wt,vt[1]=Ft[1]*Wt,vt[2]=Ft[2]*Wt,vt}([],function(vt,Ft,bt){var Ot=Ft[0],Kt=Ft[1],Wt=Ft[2],ie=bt[0],Ht=bt[1],_e=bt[2];return vt[0]=Kt*_e-Wt*Ht,vt[1]=Wt*ie-Ot*_e,vt[2]=Ot*Ht-Kt*ie,vt}([],Vt([],L[q[0]],L[q[1]]),Vt([],L[q[2]],L[q[1]]))),J=-((et=$)[0]*(ut=L[q[1]])[0]+et[1]*ut[1]+et[2]*ut[2]);var et,ut;return $.concat(J)});return new xl(L,B)}}class bl{constructor(a,g){this.min=a,this.max=g,this.center=function(S,I,L){return S[0]=.5*I[0],S[1]=.5*I[1],S[2]=.5*I[2],S}([],function(S,I,L){return S[0]=I[0]+L[0],S[1]=I[1]+L[1],S[2]=I[2]+L[2],S}([],this.min,this.max))}quadrant(a){let g=[a%2==0,a<2],S=Tt(this.min),I=Tt(this.max);for(let L=0;L<g.length;L++)S[L]=g[L]?this.min[L]:this.center[L],I[L]=g[L]?this.center[L]:this.max[L];return I[2]=this.max[2],new bl(S,I)}distanceX(a){return Math.max(Math.min(this.max[0],a[0]),this.min[0])-a[0]}distanceY(a){return Math.max(Math.min(this.max[1],a[1]),this.min[1])-a[1]}intersects(a){let g=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],S=!0;for(let I=0;I<a.planes.length;I++){let L=a.planes[I],B=0;for(let q=0;q<g.length;q++)u.dot(L,g[q])>=0&&B++;if(B===0)return 0;B!==g.length&&(S=!1)}if(S)return 2;for(let I=0;I<3;I++){let L=Number.MAX_VALUE,B=-Number.MAX_VALUE;for(let q=0;q<a.points.length;q++){let $=a.points[q][I]-this.min[I];L=Math.min(L,$),B=Math.max(B,$)}if(B<0||L>this.max[I]-this.min[I])return 0}return 1}}class Es{constructor(a=0,g=0,S=0,I=0){if(isNaN(a)||a<0||isNaN(g)||g<0||isNaN(S)||S<0||isNaN(I)||I<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=a,this.bottom=g,this.left=S,this.right=I}interpolate(a,g,S){return g.top!=null&&a.top!=null&&(this.top=u.number(a.top,g.top,S)),g.bottom!=null&&a.bottom!=null&&(this.bottom=u.number(a.bottom,g.bottom,S)),g.left!=null&&a.left!=null&&(this.left=u.number(a.left,g.left,S)),g.right!=null&&a.right!=null&&(this.right=u.number(a.right,g.right,S)),this}getCenter(a,g){let S=u.clamp((this.left+a-this.right)/2,0,a),I=u.clamp((this.top+g-this.bottom)/2,0,g);return new u.pointGeometry(S,I)}equals(a){return this.top===a.top&&this.bottom===a.bottom&&this.left===a.left&&this.right===a.right}clone(){return new Es(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class $o{constructor(a,g,S,I,L){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=L===void 0||!!L,this._minZoom=a||0,this._maxZoom=g||22,this._minPitch=S??0,this._maxPitch=I??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new u.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new Es,this._posMatrixCache={},this._alignedPosMatrixCache={}}clone(){let a=new $o(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return a.tileSize=this.tileSize,a.latRange=this.latRange,a.width=this.width,a.height=this.height,a._center=this._center,a.zoom=this.zoom,a.angle=this.angle,a._fov=this._fov,a._pitch=this._pitch,a._unmodified=this._unmodified,a._edgeInsets=this._edgeInsets.clone(),a._calcMatrices(),a}get minZoom(){return this._minZoom}set minZoom(a){this._minZoom!==a&&(this._minZoom=a,this.zoom=Math.max(this.zoom,a))}get maxZoom(){return this._maxZoom}set maxZoom(a){this._maxZoom!==a&&(this._maxZoom=a,this.zoom=Math.min(this.zoom,a))}get minPitch(){return this._minPitch}set minPitch(a){this._minPitch!==a&&(this._minPitch=a,this.pitch=Math.max(this.pitch,a))}get maxPitch(){return this._maxPitch}set maxPitch(a){this._maxPitch!==a&&(this._maxPitch=a,this.pitch=Math.min(this.pitch,a))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(a){a===void 0?a=!0:a===null&&(a=!1),this._renderWorldCopies=a}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new u.pointGeometry(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(a){let g=-u.wrap(a,-180,180)*Math.PI/180;this.angle!==g&&(this._unmodified=!1,this.angle=g,this._calcMatrices(),this.rotationMatrix=function(){var S=new u.ARRAY_TYPE(4);return u.ARRAY_TYPE!=Float32Array&&(S[1]=0,S[2]=0),S[0]=1,S[3]=1,S}(),function(S,I,L){var B=I[0],q=I[1],$=I[2],J=I[3],et=Math.sin(L),ut=Math.cos(L);S[0]=B*ut+$*et,S[1]=q*ut+J*et,S[2]=B*-et+$*ut,S[3]=q*-et+J*ut}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(a){let g=u.clamp(a,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==g&&(this._unmodified=!1,this._pitch=g,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(a){a=Math.max(.01,Math.min(60,a)),this._fov!==a&&(this._unmodified=!1,this._fov=a/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(a){let g=Math.min(Math.max(a,this.minZoom),this.maxZoom);this._zoom!==g&&(this._unmodified=!1,this._zoom=g,this.scale=this.zoomScale(g),this.tileZoom=Math.floor(g),this.zoomFraction=g-this.tileZoom,this._constrain(),this._calcMatrices())}get center(){return this._center}set center(a){a.lat===this._center.lat&&a.lng===this._center.lng||(this._unmodified=!1,this._center=a,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(a){this._edgeInsets.equals(a)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,a,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(a){return this._edgeInsets.equals(a)}interpolatePadding(a,g,S){this._unmodified=!1,this._edgeInsets.interpolate(a,g,S),this._constrain(),this._calcMatrices()}coveringZoomLevel(a){let g=(a.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/a.tileSize));return Math.max(0,g)}getVisibleUnwrappedCoordinates(a){let g=[new u.UnwrappedTileID(0,a)];if(this._renderWorldCopies){let S=this.pointCoordinate(new u.pointGeometry(0,0)),I=this.pointCoordinate(new u.pointGeometry(this.width,0)),L=this.pointCoordinate(new u.pointGeometry(this.width,this.height)),B=this.pointCoordinate(new u.pointGeometry(0,this.height)),q=Math.floor(Math.min(S.x,I.x,L.x,B.x)),$=Math.floor(Math.max(S.x,I.x,L.x,B.x)),J=1;for(let et=q-J;et<=$+J;et++)et!==0&&g.push(new u.UnwrappedTileID(et,a))}return g}coveringTiles(a){let g=this.coveringZoomLevel(a),S=g;if(a.minzoom!==void 0&&g<a.minzoom)return[];a.maxzoom!==void 0&&g>a.maxzoom&&(g=a.maxzoom);let I=u.MercatorCoordinate.fromLngLat(this.center),L=Math.pow(2,g),B=[L*I.x,L*I.y,0],q=xl.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,g),$=a.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&($=g);let J=bt=>({aabb:new bl([bt*L,0,0],[(bt+1)*L,L,0]),zoom:0,x:0,y:0,wrap:bt,fullyVisible:!1}),et=[],ut=[],vt=g,Ft=a.reparseOverscaled?S:g;if(this._renderWorldCopies)for(let bt=1;bt<=3;bt++)et.push(J(-bt)),et.push(J(bt));for(et.push(J(0));et.length>0;){let bt=et.pop(),Ot=bt.x,Kt=bt.y,Wt=bt.fullyVisible;if(!Wt){let de=bt.aabb.intersects(q);if(de===0)continue;Wt=de===2}let ie=bt.aabb.distanceX(B),Ht=bt.aabb.distanceY(B),_e=Math.max(Math.abs(ie),Math.abs(Ht)),he=3+(1<<vt-bt.zoom)-2;if(bt.zoom===vt||_e>he&&bt.zoom>=$)ut.push({tileID:new u.OverscaledTileID(bt.zoom===vt?Ft:bt.zoom,bt.wrap,bt.zoom,Ot,Kt),distanceSq:wt([B[0]-.5-Ot,B[1]-.5-Kt])});else for(let de=0;de<4;de++){let Pe=(Ot<<1)+de%2,Re=(Kt<<1)+(de>>1);et.push({aabb:bt.aabb.quadrant(de),zoom:bt.zoom+1,x:Pe,y:Re,wrap:bt.wrap,fullyVisible:Wt})}}return ut.sort((bt,Ot)=>bt.distanceSq-Ot.distanceSq).map(bt=>bt.tileID)}resize(a,g){this.width=a,this.height=g,this.pixelsToGLUnits=[2/a,-2/g],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(a){return Math.pow(2,a)}scaleZoom(a){return Math.log(a)/Math.LN2}project(a){let g=u.clamp(a.lat,-this.maxValidLatitude,this.maxValidLatitude);return new u.pointGeometry(u.mercatorXfromLng(a.lng)*this.worldSize,u.mercatorYfromLat(g)*this.worldSize)}unproject(a){return new u.MercatorCoordinate(a.x/this.worldSize,a.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}setLocationAtPoint(a,g){let S=this.pointCoordinate(g),I=this.pointCoordinate(this.centerPoint),L=this.locationCoordinate(a),B=new u.MercatorCoordinate(L.x-(S.x-I.x),L.y-(S.y-I.y));this.center=this.coordinateLocation(B),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(a){return this.coordinatePoint(this.locationCoordinate(a))}pointLocation(a){return this.coordinateLocation(this.pointCoordinate(a))}locationCoordinate(a){return u.MercatorCoordinate.fromLngLat(a)}coordinateLocation(a){return a.toLngLat()}pointCoordinate(a){let g=[a.x,a.y,0,1],S=[a.x,a.y,1,1];u.transformMat4(g,g,this.pixelMatrixInverse),u.transformMat4(S,S,this.pixelMatrixInverse);let I=g[3],L=S[3],B=g[1]/I,q=S[1]/L,$=g[2]/I,J=S[2]/L,et=$===J?0:(0-$)/(J-$);return new u.MercatorCoordinate(u.number(g[0]/I,S[0]/L,et)/this.worldSize,u.number(B,q,et)/this.worldSize)}coordinatePoint(a){let g=[a.x*this.worldSize,a.y*this.worldSize,0,1];return u.transformMat4(g,g,this.pixelMatrix),new u.pointGeometry(g[0]/g[3],g[1]/g[3])}getBounds(){return new u.LngLatBounds().extend(this.pointLocation(new u.pointGeometry(0,0))).extend(this.pointLocation(new u.pointGeometry(this.width,0))).extend(this.pointLocation(new u.pointGeometry(this.width,this.height))).extend(this.pointLocation(new u.pointGeometry(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new u.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}setMaxBounds(a){a?(this.lngRange=[a.getWest(),a.getEast()],this.latRange=[a.getSouth(),a.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(a,g=!1){let S=a.key,I=g?this._alignedPosMatrixCache:this._posMatrixCache;if(I[S])return I[S];let L=a.canonical,B=this.worldSize/this.zoomScale(L.z),q=L.x+Math.pow(2,L.z)*a.wrap,$=u.identity(new Float64Array(16));return u.translate($,$,[q*B,L.y*B,0]),u.scale($,$,[B/u.EXTENT,B/u.EXTENT,1]),u.multiply($,g?this.alignedProjMatrix:this.projMatrix,$),I[S]=new Float32Array($),I[S]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let a,g,S,I,L=-90,B=90,q=-180,$=180,J=this.size,et=this._unmodified;if(this.latRange){let Ft=this.latRange;L=u.mercatorYfromLat(Ft[1])*this.worldSize,B=u.mercatorYfromLat(Ft[0])*this.worldSize,a=B-L<J.y?J.y/(B-L):0}if(this.lngRange){let Ft=this.lngRange;q=u.mercatorXfromLng(Ft[0])*this.worldSize,$=u.mercatorXfromLng(Ft[1])*this.worldSize,g=$-q<J.x?J.x/($-q):0}let ut=this.point,vt=Math.max(g||0,a||0);if(vt)return this.center=this.unproject(new u.pointGeometry(g?($+q)/2:ut.x,a?(B+L)/2:ut.y)),this.zoom+=this.scaleZoom(vt),this._unmodified=et,void(this._constraining=!1);if(this.latRange){let Ft=ut.y,bt=J.y/2;Ft-bt<L&&(I=L+bt),Ft+bt>B&&(I=B-bt)}if(this.lngRange){let Ft=ut.x,bt=J.x/2;Ft-bt<q&&(S=q+bt),Ft+bt>$&&(S=$-bt)}S===void 0&&I===void 0||(this.center=this.unproject(new u.pointGeometry(S!==void 0?S:ut.x,I!==void 0?I:ut.y))),this._unmodified=et,this._constraining=!1}_calcMatrices(){if(!this.height)return;let a=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;let g=Math.PI/2+this._pitch,S=this._fov*(.5+a.y/this.height),I=Math.sin(S)*this.cameraToCenterDistance/Math.sin(u.clamp(Math.PI-g-S,.01,Math.PI-.01)),L=this.point,B=L.x,q=L.y,$=1.01*(Math.cos(Math.PI/2-this._pitch)*I+this.cameraToCenterDistance),J=this.height/50,et=new Float64Array(16);u.perspective(et,this._fov,this.width/this.height,J,$),et[8]=2*-a.x/this.width,et[9]=2*a.y/this.height,u.scale(et,et,[1,-1,1]),u.translate(et,et,[0,0,-this.cameraToCenterDistance]),u.rotateX(et,et,this._pitch),u.rotateZ(et,et,this.angle),u.translate(et,et,[-B,-q,0]),this.mercatorMatrix=u.scale([],et,[this.worldSize,this.worldSize,this.worldSize]),u.scale(et,et,[1,1,u.mercatorZfromAltitude(1,this.center.lat)*this.worldSize]),this.projMatrix=et,this.invProjMatrix=u.invert([],this.projMatrix);let ut=this.width%2/2,vt=this.height%2/2,Ft=Math.cos(this.angle),bt=Math.sin(this.angle),Ot=B-Math.round(B)+Ft*ut+bt*vt,Kt=q-Math.round(q)+Ft*vt+bt*ut,Wt=new Float64Array(et);if(u.translate(Wt,Wt,[Ot>.5?Ot-1:Ot,Kt>.5?Kt-1:Kt,0]),this.alignedProjMatrix=Wt,et=u.create(),u.scale(et,et,[this.width/2,-this.height/2,1]),u.translate(et,et,[1,-1,0]),this.labelPlaneMatrix=et,et=u.create(),u.scale(et,et,[1,-1,1]),u.translate(et,et,[-1,-1,0]),u.scale(et,et,[2/this.width,2/this.height,1]),this.glCoordMatrix=et,this.pixelMatrix=u.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),et=u.invert(new Float64Array(16),this.pixelMatrix),!et)throw new Error("failed to invert matrix");this.pixelMatrixInverse=et,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let a=this.pointCoordinate(new u.pointGeometry(0,0)),g=[a.x*this.worldSize,a.y*this.worldSize,0,1];return u.transformMat4(g,g,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let a=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new u.pointGeometry(0,a))}getCameraQueryGeometry(a){let g=this.getCameraPoint();if(a.length===1)return[a[0],g];{let S=g.x,I=g.y,L=g.x,B=g.y;for(let q of a)S=Math.min(S,q.x),I=Math.min(I,q.y),L=Math.max(L,q.x),B=Math.max(B,q.y);return[new u.pointGeometry(S,I),new u.pointGeometry(L,I),new u.pointGeometry(L,B),new u.pointGeometry(S,B),new u.pointGeometry(S,I)]}}}class Vs{constructor(a){this._hashName=a&&encodeURIComponent(a),u.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(g,S){let I=!1,L=null,B=()=>{L=null,I&&(g(),L=setTimeout(B,300),I=!1)};return()=>(I=!0,L||B(),L)}(this._updateHashUnthrottled.bind(this))}addTo(a){return this._map=a,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()),delete this._map,this}getHashString(a){let g=this._map.getCenter(),S=Math.round(100*this._map.getZoom())/100,I=Math.ceil((S*Math.LN2+Math.log(512/360/.5))/Math.LN10),L=Math.pow(10,I),B=Math.round(g.lng*L)/L,q=Math.round(g.lat*L)/L,$=this._map.getBearing(),J=this._map.getPitch(),et="";if(et+=a?`/${B}/${q}/${S}`:`${S}/${q}/${B}`,($||J)&&(et+="/"+Math.round(10*$)/10),J&&(et+=`/${Math.round(J)}`),this._hashName){let ut=this._hashName,vt=!1,Ft=window.location.hash.slice(1).split("&").map(bt=>{let Ot=bt.split("=")[0];return Ot===ut?(vt=!0,`${Ot}=${et}`):bt}).filter(bt=>bt);return vt||Ft.push(`${ut}=${et}`),`#${Ft.join("&")}`}return`#${et}`}_getCurrentHash(){let a=window.location.hash.replace("#","");if(this._hashName){let g;return a.split("&").map(S=>S.split("=")).forEach(S=>{S[0]===this._hashName&&(g=S)}),(g&&g[1]||"").split("/")}return a.split("/")}_onHashChange(){let a=this._getCurrentHash();if(a.length>=3&&!a.some(g=>isNaN(g))){let g=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(a[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+a[2],+a[1]],zoom:+a[0],bearing:g,pitch:+(a[4]||0)}),!0}return!1}_updateHashUnthrottled(){let a=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,a)}catch{}}}let Qa={linearity:.3,easing:u.bezier(0,0,.3,1)},nu=u.extend({deceleration:2500,maxSpeed:1400},Qa),wl=u.extend({deceleration:20,maxSpeed:1400},Qa),Lc=u.extend({deceleration:1e3,maxSpeed:360},Qa),Pa=u.extend({deceleration:1e3,maxSpeed:90},Qa);class ou{constructor(a){this._map=a,this.clear()}clear(){this._inertiaBuffer=[]}record(a){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:u.exported.now(),settings:a})}_drainInertiaBuffer(){let a=this._inertiaBuffer,g=u.exported.now();for(;a.length>0&&g-a[0].time>160;)a.shift()}_onMoveEnd(a){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let g={zoom:0,bearing:0,pitch:0,pan:new u.pointGeometry(0,0),pinchAround:void 0,around:void 0};for(let{settings:L}of this._inertiaBuffer)g.zoom+=L.zoomDelta||0,g.bearing+=L.bearingDelta||0,g.pitch+=L.pitchDelta||0,L.panDelta&&g.pan._add(L.panDelta),L.around&&(g.around=L.around),L.pinchAround&&(g.pinchAround=L.pinchAround);let S=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,I={};if(g.pan.mag()){let L=js(g.pan.mag(),S,u.extend({},nu,a||{}));I.offset=g.pan.mult(L.amount/g.pan.mag()),I.center=this._map.transform.center,Gs(I,L)}if(g.zoom){let L=js(g.zoom,S,wl);I.zoom=this._map.transform.zoom+L.amount,Gs(I,L)}if(g.bearing){let L=js(g.bearing,S,Lc);I.bearing=this._map.transform.bearing+u.clamp(L.amount,-179,179),Gs(I,L)}if(g.pitch){let L=js(g.pitch,S,Pa);I.pitch=this._map.transform.pitch+L.amount,Gs(I,L)}if(I.zoom||I.bearing){let L=g.pinchAround===void 0?g.around:g.pinchAround;I.around=L?this._map.unproject(L):this._map.getCenter()}return this.clear(),u.extend(I,{noMoveStart:!0})}}function Gs(T,a){(!T.duration||T.duration<a.duration)&&(T.duration=a.duration,T.easing=a.easing)}function js(T,a,g){let{maxSpeed:S,linearity:I,deceleration:L}=g,B=u.clamp(T*I/(a/1e3),-S,S),q=Math.abs(B)/(L*I);return{easing:g.easing,duration:1e3*q,amount:B*(q/2)}}class Kn extends u.Event{constructor(a,g,S,I={}){let L=N.mousePos(g.getCanvasContainer(),S),B=g.unproject(L);super(a,u.extend({point:L,lngLat:B,originalEvent:S},I)),this._defaultPrevented=!1,this.target=g}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class Yn extends u.Event{constructor(a,g,S){let I=a==="touchend"?S.changedTouches:S.touches,L=N.touchPos(g.getCanvasContainer(),I),B=L.map($=>g.unproject($)),q=L.reduce(($,J,et,ut)=>$.add(J.div(ut.length)),new u.pointGeometry(0,0));super(a,{points:L,point:q,lngLats:B,lngLat:g.unproject(q),originalEvent:S}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class Zu extends u.Event{constructor(a,g,S){super(a,{originalEvent:S}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class Ma{constructor(a,g){this._map=a,this._clickTolerance=g.clickTolerance}reset(){delete this._mousedownPos}wheel(a){return this._firePreventable(new Zu(a.type,this._map,a))}mousedown(a,g){return this._mousedownPos=g,this._firePreventable(new Kn(a.type,this._map,a))}mouseup(a){this._map.fire(new Kn(a.type,this._map,a))}click(a,g){this._mousedownPos&&this._mousedownPos.dist(g)>=this._clickTolerance||this._map.fire(new Kn(a.type,this._map,a))}dblclick(a){return this._firePreventable(new Kn(a.type,this._map,a))}mouseover(a){this._map.fire(new Kn(a.type,this._map,a))}mouseout(a){this._map.fire(new Kn(a.type,this._map,a))}touchstart(a){return this._firePreventable(new Yn(a.type,this._map,a))}touchmove(a){this._map.fire(new Yn(a.type,this._map,a))}touchend(a){this._map.fire(new Yn(a.type,this._map,a))}touchcancel(a){this._map.fire(new Yn(a.type,this._map,a))}_firePreventable(a){if(this._map.fire(a),a.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class qs{constructor(a){this._map=a}reset(){this._delayContextMenu=!1,delete this._contextMenuEvent}mousemove(a){this._map.fire(new Kn(a.type,this._map,a))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Kn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(a){this._delayContextMenu?this._contextMenuEvent=a:this._map.fire(new Kn(a.type,this._map,a)),this._map.listens("contextmenu")&&a.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ss{constructor(a,g){this._map=a,this._el=a.getCanvasContainer(),this._container=a.getContainer(),this._clickTolerance=g.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(a,g){this.isEnabled()&&a.shiftKey&&a.button===0&&(N.disableDrag(),this._startPos=this._lastPos=g,this._active=!0)}mousemoveWindow(a,g){if(!this._active)return;let S=g;if(this._lastPos.equals(S)||!this._box&&S.dist(this._startPos)<this._clickTolerance)return;let I=this._startPos;this._lastPos=S,this._box||(this._box=N.create("div","maplibregl-boxzoom mapboxgl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair","mapboxgl-crosshair"),this._fireEvent("boxzoomstart",a));let L=Math.min(I.x,S.x),B=Math.max(I.x,S.x),q=Math.min(I.y,S.y),$=Math.max(I.y,S.y);N.setTransform(this._box,`translate(${L}px,${q}px)`),this._box.style.width=B-L+"px",this._box.style.height=$-q+"px"}mouseupWindow(a,g){if(!this._active||a.button!==0)return;let S=this._startPos,I=g;if(this.reset(),N.suppressClick(),S.x!==I.x||S.y!==I.y)return this._map.fire(new u.Event("boxzoomend",{originalEvent:a})),{cameraAnimation:L=>L.fitScreenCoordinates(S,I,this._map.getBearing(),{linear:!0})};this._fireEvent("boxzoomcancel",a)}keydown(a){this._active&&a.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",a))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair","mapboxgl-crosshair"),this._box&&(N.remove(this._box),this._box=null),N.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(a,g){return this._map.fire(new u.Event(a,{originalEvent:g}))}}function zo(T,a){let g={};for(let S=0;S<T.length;S++)g[T[S].identifier]=a[S];return g}class Pi{constructor(a){this.reset(),this.numTouches=a.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(a,g,S){(this.centroid||S.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=a.timeStamp),S.length===this.numTouches&&(this.centroid=function(I){let L=new u.pointGeometry(0,0);for(let B of I)L._add(B);return L.div(I.length)}(g),this.touches=zo(S,g)))}touchmove(a,g,S){if(this.aborted||!this.centroid)return;let I=zo(S,g);for(let L in this.touches){let B=this.touches[L],q=I[L];(!q||q.dist(B)>30)&&(this.aborted=!0)}}touchend(a,g,S){if((!this.centroid||a.timeStamp-this.startTime>500)&&(this.aborted=!0),S.length===0){let I=!this.aborted&&this.centroid;if(this.reset(),I)return I}}}class Zs{constructor(a){this.singleTap=new Pi(a),this.numTaps=a.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(a,g,S){this.singleTap.touchstart(a,g,S)}touchmove(a,g,S){this.singleTap.touchmove(a,g,S)}touchend(a,g,S){let I=this.singleTap.touchend(a,g,S);if(I){let L=a.timeStamp-this.lastTime<500,B=!this.lastTap||this.lastTap.dist(I)<30;if(L&&B||this.reset(),this.count++,this.lastTime=a.timeStamp,this.lastTap=I,this.count===this.numTaps)return this.reset(),I}}}class Ts{constructor(){this._zoomIn=new Zs({numTouches:1,numTaps:2}),this._zoomOut=new Zs({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(a,g,S){this._zoomIn.touchstart(a,g,S),this._zoomOut.touchstart(a,g,S)}touchmove(a,g,S){this._zoomIn.touchmove(a,g,S),this._zoomOut.touchmove(a,g,S)}touchend(a,g,S){let I=this._zoomIn.touchend(a,g,S),L=this._zoomOut.touchend(a,g,S);return I?(this._active=!0,a.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:B=>B.easeTo({duration:300,zoom:B.getZoom()+1,around:B.unproject(I)},{originalEvent:a})}):L?(this._active=!0,a.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:B=>B.easeTo({duration:300,zoom:B.getZoom()-1,around:B.unproject(L)},{originalEvent:a})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}let La={0:1,2:2};class Gr{constructor(a){this.reset(),this._clickTolerance=a.clickTolerance||1}reset(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton}_correctButton(a,g){return!1}_move(a,g){return{}}mousedown(a,g){if(this._lastPoint)return;let S=N.mouseButton(a);this._correctButton(a,S)&&(this._lastPoint=g,this._eventButton=S)}mousemoveWindow(a,g){let S=this._lastPoint;if(S){if(a.preventDefault(),function(I,L){let B=La[L];return I.buttons===void 0||(I.buttons&B)!==B}(a,this._eventButton))this.reset();else if(this._moved||!(g.dist(S)<this._clickTolerance))return this._moved=!0,this._lastPoint=g,this._move(S,g)}}mouseupWindow(a){this._lastPoint&&N.mouseButton(a)===this._eventButton&&(this._moved&&N.suppressClick(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class pi extends Gr{mousedown(a,g){super.mousedown(a,g),this._lastPoint&&(this._active=!0)}_correctButton(a,g){return g===0&&!a.ctrlKey}_move(a,g){return{around:g,panDelta:g.sub(a)}}}class We extends Gr{_correctButton(a,g){return g===0&&a.ctrlKey||g===2}_move(a,g){let S=.8*(g.x-a.x);if(S)return this._active=!0,{bearingDelta:S}}contextmenu(a){a.preventDefault()}}class Is extends Gr{_correctButton(a,g){return g===0&&a.ctrlKey||g===2}_move(a,g){let S=-.5*(g.y-a.y);if(S)return this._active=!0,{pitchDelta:S}}contextmenu(a){a.preventDefault()}}class fa{constructor(a){this._minTouches=1,this._clickTolerance=a.clickTolerance||1,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new u.pointGeometry(0,0)}touchstart(a,g,S){return this._calculateTransform(a,g,S)}touchmove(a,g,S){if(this._active&&!(S.length<this._minTouches))return a.preventDefault(),this._calculateTransform(a,g,S)}touchend(a,g,S){this._calculateTransform(a,g,S),this._active&&S.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(a,g,S){S.length>0&&(this._active=!0);let I=zo(S,g),L=new u.pointGeometry(0,0),B=new u.pointGeometry(0,0),q=0;for(let J in I){let et=I[J],ut=this._touches[J];ut&&(L._add(et),B._add(et.sub(ut)),q++,I[J]=et)}if(this._touches=I,q<this._minTouches||!B.mag())return;let $=B.div(q);return this._sum._add($),this._sum.mag()<this._clickTolerance?void 0:{around:L.div(q),panDelta:$}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ko{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}_start(a){}_move(a,g,S){return{}}touchstart(a,g,S){this._firstTwoTouches||S.length<2||(this._firstTwoTouches=[S[0].identifier,S[1].identifier],this._start([g[0],g[1]]))}touchmove(a,g,S){if(!this._firstTwoTouches)return;a.preventDefault();let[I,L]=this._firstTwoTouches,B=El(S,g,I),q=El(S,g,L);if(!B||!q)return;let $=this._aroundCenter?null:B.add(q).div(2);return this._move([B,q],$,a)}touchend(a,g,S){if(!this._firstTwoTouches)return;let[I,L]=this._firstTwoTouches,B=El(S,g,I),q=El(S,g,L);B&&q||(this._active&&N.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(a){this._enabled=!0,this._aroundCenter=!!a&&a.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function El(T,a,g){for(let S=0;S<T.length;S++)if(T[S].identifier===g)return a[S]}function Je(T,a){return Math.log(T/a)/Math.LN2}class Cs extends Ko{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(a){this._startDistance=this._distance=a[0].dist(a[1])}_move(a,g){let S=this._distance;if(this._distance=a[0].dist(a[1]),this._active||!(Math.abs(Je(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Je(this._distance,S),pinchAround:g}}}function Xs(T,a){return 180*T.angleWith(a)/Math.PI}class ka extends Ko{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(a){this._startVector=this._vector=a[0].sub(a[1]),this._minDiameter=a[0].dist(a[1])}_move(a,g){let S=this._vector;if(this._vector=a[0].sub(a[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Xs(this._vector,S),pinchAround:g}}_isBelowThreshold(a){this._minDiameter=Math.min(this._minDiameter,a.mag());let g=25/(Math.PI*this._minDiameter)*360,S=Xs(a,this._startVector);return Math.abs(S)<g}}function Oi(T){return Math.abs(T.y)>Math.abs(T.x)}class Ws extends Ko{reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}_start(a){this._lastPoints=a,Oi(a[0].sub(a[1]))&&(this._valid=!1)}_move(a,g,S){let I=a[0].sub(this._lastPoints[0]),L=a[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(I,L,S.timeStamp),this._valid)return this._lastPoints=a,this._active=!0,{pitchDelta:(I.y+L.y)/2*-.5}}gestureBeginsVertically(a,g,S){if(this._valid!==void 0)return this._valid;let I=a.mag()>=2,L=g.mag()>=2;if(!I&&!L)return;if(!I||!L)return this._firstMove===void 0&&(this._firstMove=S),S-this._firstMove<100&&void 0;let B=a.y>0==g.y>0;return Oi(a)&&Oi(g)&&B}}let Xu={panStep:100,bearingStep:15,pitchStep:10};class nn{constructor(){let a=Xu;this._panStep=a.panStep,this._bearingStep=a.bearingStep,this._pitchStep=a.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(a){if(a.altKey||a.ctrlKey||a.metaKey)return;let g=0,S=0,I=0,L=0,B=0;switch(a.keyCode){case 61:case 107:case 171:case 187:g=1;break;case 189:case 109:case 173:g=-1;break;case 37:a.shiftKey?S=-1:(a.preventDefault(),L=-1);break;case 39:a.shiftKey?S=1:(a.preventDefault(),L=1);break;case 38:a.shiftKey?I=1:(a.preventDefault(),B=-1);break;case 40:a.shiftKey?I=-1:(a.preventDefault(),B=1);break;default:return}return this._rotationDisabled&&(S=0,I=0),{cameraAnimation:q=>{let $=q.getZoom();q.easeTo({duration:300,easeId:"keyboardHandler",easing:tr,zoom:g?Math.round($)+g*(a.shiftKey?2:1):$,bearing:q.getBearing()+S*this._bearingStep,pitch:q.getPitch()+I*this._pitchStep,offset:[-L*this._panStep,-B*this._panStep],center:q.getCenter()},{originalEvent:a})}}}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 tr(T){return T*(2-T)}let Vn=4.000244140625;class $s{constructor(a,g){this._map=a,this._el=a.getCanvasContainer(),this._handler=g,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,u.bindAll(["_onTimeout"],this)}setZoomRate(a){this._defaultZoomRate=a}setWheelZoomRate(a){this._wheelZoomRate=a}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(a){this.isEnabled()||(this._enabled=!0,this._aroundCenter=a&&a.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(a){if(!this.isEnabled())return;let g=a.deltaMode===WheelEvent.DOM_DELTA_LINE?40*a.deltaY:a.deltaY,S=u.exported.now(),I=S-(this._lastWheelEventTime||0);this._lastWheelEventTime=S,g!==0&&g%Vn==0?this._type="wheel":g!==0&&Math.abs(g)<4?this._type="trackpad":I>400?(this._type=null,this._lastValue=g,this._timeout=setTimeout(this._onTimeout,40,a)):this._type||(this._type=Math.abs(I*g)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,g+=this._lastValue)),a.shiftKey&&g&&(g/=4),this._type&&(this._lastWheelEvent=a,this._delta-=g,this._active||this._start(a)),a.preventDefault()}_onTimeout(a){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(a)}_start(a){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 g=N.mousePos(this._el,a);this._around=u.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(g)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let a=this._map.transform;if(this._delta!==0){let q=this._type==="wheel"&&Math.abs(this._delta)>Vn?this._wheelZoomRate:this._defaultZoomRate,$=2/(1+Math.exp(-Math.abs(this._delta*q)));this._delta<0&&$!==0&&($=1/$);let J=typeof this._targetZoom=="number"?a.zoomScale(this._targetZoom):a.scale;this._targetZoom=Math.min(a.maxZoom,Math.max(a.minZoom,a.scaleZoom(J*$))),this._type==="wheel"&&(this._startZoom=a.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let g=typeof this._targetZoom=="number"?this._targetZoom:a.zoom,S=this._startZoom,I=this._easing,L,B=!1;if(this._type==="wheel"&&S&&I){let q=Math.min((u.exported.now()-this._lastWheelEventTime)/200,1),$=I(q);L=u.number(S,g,$),q<1?this._frameId||(this._frameId=!0):B=!0}else L=g,B=!0;return this._active=!0,B&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!B,zoomDelta:L-a.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(a){let g=u.ease;if(this._prevEase){let S=this._prevEase,I=(u.exported.now()-S.start)/S.duration,L=S.easing(I+.01)-S.easing(I),B=.27/Math.sqrt(L*L+1e-4)*.01,q=Math.sqrt(.0729-B*B);g=u.bezier(B,q,.25,1)}return this._prevEase={start:u.exported.now(),duration:a,easing:g},g}reset(){this._active=!1}}class ts{constructor(a,g){this._clickZoom=a,this._tapZoom=g}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 Ro{constructor(){this.reset()}reset(){this._active=!1}dblclick(a,g){return a.preventDefault(),{cameraAnimation:S=>{S.easeTo({duration:300,zoom:S.getZoom()+(a.shiftKey?-1:1),around:S.unproject(g)},{originalEvent:a})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Mi{constructor(){this._tap=new Zs({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(a,g,S){this._swipePoint||(this._tapTime&&a.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?S.length>0&&(this._swipePoint=g[0],this._swipeTouch=S[0].identifier):this._tap.touchstart(a,g,S))}touchmove(a,g,S){if(this._tapTime){if(this._swipePoint){if(S[0].identifier!==this._swipeTouch)return;let I=g[0],L=I.y-this._swipePoint.y;return this._swipePoint=I,a.preventDefault(),this._active=!0,{zoomDelta:L/128}}}else this._tap.touchmove(a,g,S)}touchend(a,g,S){this._tapTime?this._swipePoint&&S.length===0&&this.reset():this._tap.touchend(a,g,S)&&(this._tapTime=a.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class da{constructor(a,g,S){this._el=a,this._mousePan=g,this._touchPan=S}enable(a){this._inertiaOptions=a||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Ne{constructor(a,g,S){this._pitchWithRotate=a.pitchWithRotate,this._mouseRotate=g,this._mousePitch=S}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Sl{constructor(a,g,S,I){this._el=a,this._touchZoom=g,this._touchRotate=S,this._tapDragZoom=I,this._rotationDisabled=!1,this._enabled=!0}enable(a){this._touchZoom.enable(a),this._rotationDisabled||this._touchRotate.enable(a),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate","mapboxgl-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()}}let za=T=>T.zoom||T.drag||T.pitch||T.rotate;class Tl extends u.Event{}function ao(T){return T.panDelta&&T.panDelta.mag()||T.zoomDelta||T.bearingDelta||T.pitchDelta}class Fi{constructor(a,g){this._map=a,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ou(a),this._bearingSnap=g.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(g),u.bindAll(["handleEvent","handleWindowEvent"],this);let S=this._el;this._listeners=[[S,"touchstart",{passive:!0}],[S,"touchmove",{passive:!1}],[S,"touchend",void 0],[S,"touchcancel",void 0],[S,"mousedown",void 0],[S,"mousemove",void 0],[S,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[S,"mouseover",void 0],[S,"mouseout",void 0],[S,"dblclick",void 0],[S,"click",void 0],[S,"keydown",{capture:!1}],[S,"keyup",void 0],[S,"wheel",{passive:!1}],[S,"contextmenu",void 0],[window,"blur",void 0]];for(let[I,L,B]of this._listeners)N.addEventListener(I,L,I===document?this.handleWindowEvent:this.handleEvent,B)}destroy(){for(let[a,g,S]of this._listeners)N.removeEventListener(a,g,a===document?this.handleWindowEvent:this.handleEvent,S)}_addDefaultHandlers(a){let g=this._map,S=g.getCanvasContainer();this._add("mapEvent",new Ma(g,a));let I=g.boxZoom=new Ss(g,a);this._add("boxZoom",I);let L=new Ts,B=new Ro;g.doubleClickZoom=new ts(B,L),this._add("tapZoom",L),this._add("clickZoom",B);let q=new Mi;this._add("tapDragZoom",q);let $=g.touchPitch=new Ws;this._add("touchPitch",$);let J=new We(a),et=new Is(a);g.dragRotate=new Ne(a,J,et),this._add("mouseRotate",J,["mousePitch"]),this._add("mousePitch",et,["mouseRotate"]);let ut=new pi(a),vt=new fa(a);g.dragPan=new da(S,ut,vt),this._add("mousePan",ut),this._add("touchPan",vt,["touchZoom","touchRotate"]);let Ft=new ka,bt=new Cs;g.touchZoomRotate=new Sl(S,bt,Ft,q),this._add("touchRotate",Ft,["touchPan","touchZoom"]),this._add("touchZoom",bt,["touchPan","touchRotate"]);let Ot=g.scrollZoom=new $s(g,this);this._add("scrollZoom",Ot,["mousePan"]);let Kt=g.keyboard=new nn;this._add("keyboard",Kt),this._add("blockableMapEvent",new qs(g));for(let Wt of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])a.interactive&&a[Wt]&&g[Wt].enable(a[Wt])}_add(a,g,S){this._handlers.push({handlerName:a,handler:g,allowed:S}),this._handlersById[a]=g}stop(a){if(!this._updatingCamera){for(let{handler:g}of this._handlers)g.reset();this._inertia.clear(),this._fireEvents({},{},a),this._changes=[]}}isActive(){for(let{handler:a}of this._handlers)if(a.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(za(this._eventsInProgress))||this.isZooming()}_blockedByActive(a,g,S){for(let I in a)if(I!==S&&(!g||g.indexOf(I)<0))return!0;return!1}handleWindowEvent(a){this.handleEvent(a,`${a.type}Window`)}_getMapTouches(a){let g=[];for(let S of a)this._el.contains(S.target)&&g.push(S);return g}handleEvent(a,g){if(a.type==="blur")return void this.stop(!0);this._updatingCamera=!0;let S=a.type==="renderFrame"?void 0:a,I={needsRenderFrame:!1},L={},B={},q=a.touches,$=q?this._getMapTouches(q):void 0,J=$?N.touchPos(this._el,$):N.mousePos(this._el,a);for(let{handlerName:vt,handler:Ft,allowed:bt}of this._handlers){if(!Ft.isEnabled())continue;let Ot;this._blockedByActive(B,bt,vt)?Ft.reset():Ft[g||a.type]&&(Ot=Ft[g||a.type](a,J,$),this.mergeHandlerResult(I,L,Ot,vt,S),Ot&&Ot.needsRenderFrame&&this._triggerRenderFrame()),(Ot||Ft.isActive())&&(B[vt]=Ft)}let et={};for(let vt in this._previousActiveHandlers)B[vt]||(et[vt]=S);this._previousActiveHandlers=B,(Object.keys(et).length||ao(I))&&(this._changes.push([I,L,et]),this._triggerRenderFrame()),(Object.keys(B).length||ao(I))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:ut}=I;ut&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],ut(this._map))}mergeHandlerResult(a,g,S,I,L){if(!S)return;u.extend(a,S);let B={handlerName:I,originalEvent:S.originalEvent||L};S.zoomDelta!==void 0&&(g.zoom=B),S.panDelta!==void 0&&(g.drag=B),S.pitchDelta!==void 0&&(g.pitch=B),S.bearingDelta!==void 0&&(g.rotate=B)}_applyChanges(){let a={},g={},S={};for(let[I,L,B]of this._changes)I.panDelta&&(a.panDelta=(a.panDelta||new u.pointGeometry(0,0))._add(I.panDelta)),I.zoomDelta&&(a.zoomDelta=(a.zoomDelta||0)+I.zoomDelta),I.bearingDelta&&(a.bearingDelta=(a.bearingDelta||0)+I.bearingDelta),I.pitchDelta&&(a.pitchDelta=(a.pitchDelta||0)+I.pitchDelta),I.around!==void 0&&(a.around=I.around),I.pinchAround!==void 0&&(a.pinchAround=I.pinchAround),I.noInertia&&(a.noInertia=I.noInertia),u.extend(g,L),u.extend(S,B);this._updateMapTransform(a,g,S),this._changes=[]}_updateMapTransform(a,g,S){let I=this._map,L=I.transform;if(!ao(a))return this._fireEvents(g,S,!0);let{panDelta:B,zoomDelta:q,bearingDelta:$,pitchDelta:J,around:et,pinchAround:ut}=a;ut!==void 0&&(et=ut),I._stop(!0),et=et||I.transform.centerPoint;let vt=L.pointLocation(B?et.sub(B):et);$&&(L.bearing+=$),J&&(L.pitch+=J),q&&(L.zoom+=q),L.setLocationAtPoint(vt,et),this._map._update(),a.noInertia||this._inertia.record(a),this._fireEvents(g,S,!0)}_fireEvents(a,g,S){let I=za(this._eventsInProgress),L=za(a),B={};for(let et in a){let{originalEvent:ut}=a[et];this._eventsInProgress[et]||(B[`${et}start`]=ut),this._eventsInProgress[et]=a[et]}!I&&L&&this._fireEvent("movestart",L.originalEvent);for(let et in B)this._fireEvent(et,B[et]);L&&this._fireEvent("move",L.originalEvent);for(let et in a){let{originalEvent:ut}=a[et];this._fireEvent(et,ut)}let q={},$;for(let et in this._eventsInProgress){let{handlerName:ut,originalEvent:vt}=this._eventsInProgress[et];this._handlersById[ut].isActive()||(delete this._eventsInProgress[et],$=g[ut]||vt,q[`${et}end`]=$)}for(let et in q)this._fireEvent(et,q[et]);let J=za(this._eventsInProgress);if(S&&(I||L)&&!J){this._updatingCamera=!0;let et=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),ut=vt=>vt!==0&&-this._bearingSnap<vt&&vt<this._bearingSnap;et?(ut(et.bearing||this._map.getBearing())&&(et.bearing=0),this._map.easeTo(et,{originalEvent:$})):(this._map.fire(new u.Event("moveend",{originalEvent:$})),ut(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(a,g){this._map.fire(new u.Event(a,g?{originalEvent:g}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(a=>{delete this._frameId,this.handleEvent(new Tl("renderFrame",{timeStamp:a})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}let Ii={extend:(T,...a)=>u.extend(T,...a),run(T){T()},logToElement(T,a=!1,g="log"){let S=window.document.getElementById(g);S&&(a&&(S.innerHTML=""),S.innerHTML+=`<br>${T}`)}};class As extends u.Evented{constructor(a,g){super(),this._moving=!1,this._zooming=!1,this.transform=a,this._bearingSnap=g.bearingSnap,u.bindAll(["_renderFrameCallback"],this)}getCenter(){return new u.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(a,g){return this.jumpTo({center:a},g)}panBy(a,g,S){return a=u.pointGeometry.convert(a).mult(-1),this.panTo(this.transform.center,u.extend({offset:a},g),S)}panTo(a,g,S){return this.easeTo(u.extend({center:a},g),S)}getZoom(){return this.transform.zoom}setZoom(a,g){return this.jumpTo({zoom:a},g),this}zoomTo(a,g,S){return this.easeTo(u.extend({zoom:a},g),S)}zoomIn(a,g){return this.zoomTo(this.getZoom()+1,a,g),this}zoomOut(a,g){return this.zoomTo(this.getZoom()-1,a,g),this}getBearing(){return this.transform.bearing}setBearing(a,g){return this.jumpTo({bearing:a},g),this}getPadding(){return this.transform.padding}setPadding(a,g){return this.jumpTo({padding:a},g),this}rotateTo(a,g,S){return this.easeTo(u.extend({bearing:a},g),S)}resetNorth(a,g){return this.rotateTo(0,u.extend({duration:1e3},a),g),this}resetNorthPitch(a,g){return this.easeTo(u.extend({bearing:0,pitch:0,duration:1e3},a),g),this}snapToNorth(a,g){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(a,g):this}getPitch(){return this.transform.pitch}setPitch(a,g){return this.jumpTo({pitch:a},g),this}cameraForBounds(a,g){a=u.LngLatBounds.convert(a);let S=g&&g.bearing||0;return this._cameraForBoxAndBearing(a.getNorthWest(),a.getSouthEast(),S,g)}_cameraForBoxAndBearing(a,g,S,I){let L={top:0,bottom:0,right:0,left:0};if(typeof(I=u.extend({padding:L,offset:[0,0],maxZoom:this.transform.maxZoom},I)).padding=="number"){let he=I.padding;I.padding={top:he,bottom:he,right:he,left:he}}I.padding=u.extend(L,I.padding);let B=this.transform,q=B.padding,$=B.project(u.LngLat.convert(a)),J=B.project(u.LngLat.convert(g)),et=$.rotate(-S*Math.PI/180),ut=J.rotate(-S*Math.PI/180),vt=new u.pointGeometry(Math.max(et.x,ut.x),Math.max(et.y,ut.y)),Ft=new u.pointGeometry(Math.min(et.x,ut.x),Math.min(et.y,ut.y)),bt=vt.sub(Ft),Ot=(B.width-(q.left+q.right+I.padding.left+I.padding.right))/bt.x,Kt=(B.height-(q.top+q.bottom+I.padding.top+I.padding.bottom))/bt.y;if(Kt<0||Ot<0)return void u.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.");let Wt=Math.min(B.scaleZoom(B.scale*Math.min(Ot,Kt)),I.maxZoom),ie=u.pointGeometry.convert(I.offset),Ht=new u.pointGeometry((I.padding.left-I.padding.right)/2,(I.padding.top-I.padding.bottom)/2).rotate(S*Math.PI/180),_e=ie.add(Ht).mult(B.scale/B.zoomScale(Wt));return{center:B.unproject($.add(J).div(2).sub(_e)),zoom:Wt,bearing:S}}fitBounds(a,g,S){return this._fitInternal(this.cameraForBounds(a,g),g,S)}fitScreenCoordinates(a,g,S,I,L){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(u.pointGeometry.convert(a)),this.transform.pointLocation(u.pointGeometry.convert(g)),S,I),I,L)}_fitInternal(a,g,S){return a?(delete(g=u.extend(a,g)).padding,g.linear?this.easeTo(g,S):this.flyTo(g,S)):this}jumpTo(a,g){this.stop();let S=this.transform,I=!1,L=!1,B=!1;return"zoom"in a&&S.zoom!==+a.zoom&&(I=!0,S.zoom=+a.zoom),a.center!==void 0&&(S.center=u.LngLat.convert(a.center)),"bearing"in a&&S.bearing!==+a.bearing&&(L=!0,S.bearing=+a.bearing),"pitch"in a&&S.pitch!==+a.pitch&&(B=!0,S.pitch=+a.pitch),a.padding==null||S.isPaddingEqual(a.padding)||(S.padding=a.padding),this.fire(new u.Event("movestart",g)).fire(new u.Event("move",g)),I&&this.fire(new u.Event("zoomstart",g)).fire(new u.Event("zoom",g)).fire(new u.Event("zoomend",g)),L&&this.fire(new u.Event("rotatestart",g)).fire(new u.Event("rotate",g)).fire(new u.Event("rotateend",g)),B&&this.fire(new u.Event("pitchstart",g)).fire(new u.Event("pitch",g)).fire(new u.Event("pitchend",g)),this.fire(new u.Event("moveend",g))}easeTo(a,g){this._stop(!1,a.easeId),((a=u.extend({offset:[0,0],duration:500,easing:u.ease},a)).animate===!1||!a.essential&&u.exported.prefersReducedMotion)&&(a.duration=0);let S=this.transform,I=this.getZoom(),L=this.getBearing(),B=this.getPitch(),q=this.getPadding(),$="zoom"in a?+a.zoom:I,J="bearing"in a?this._normalizeBearing(a.bearing,L):L,et="pitch"in a?+a.pitch:B,ut="padding"in a?a.padding:S.padding,vt=u.pointGeometry.convert(a.offset),Ft=S.centerPoint.add(vt),bt=S.pointLocation(Ft),Ot=u.LngLat.convert(a.center||bt);this._normalizeCenter(Ot);let Kt=S.project(bt),Wt=S.project(Ot).sub(Kt),ie=S.zoomScale($-I),Ht,_e;a.around&&(Ht=u.LngLat.convert(a.around),_e=S.locationPoint(Ht));let he={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||$!==I,this._rotating=this._rotating||L!==J,this._pitching=this._pitching||et!==B,this._padding=!S.isPaddingEqual(ut),this._easeId=a.easeId,this._prepareEase(g,a.noMoveStart,he),this._ease(de=>{if(this._zooming&&(S.zoom=u.number(I,$,de)),this._rotating&&(S.bearing=u.number(L,J,de)),this._pitching&&(S.pitch=u.number(B,et,de)),this._padding&&(S.interpolatePadding(q,ut,de),Ft=S.centerPoint.add(vt)),Ht)S.setLocationAtPoint(Ht,_e);else{let Pe=S.zoomScale(S.zoom-I),Re=$>I?Math.min(2,ie):Math.max(.5,ie),ve=Math.pow(Re,1-de),ar=S.unproject(Kt.add(Wt.mult(de*ve)).mult(Pe));S.setLocationAtPoint(S.renderWorldCopies?ar.wrap():ar,Ft)}this._fireMoveEvents(g)},de=>{this._afterEase(g,de)},a),this}_prepareEase(a,g,S={}){this._moving=!0,g||S.moving||this.fire(new u.Event("movestart",a)),this._zooming&&!S.zooming&&this.fire(new u.Event("zoomstart",a)),this._rotating&&!S.rotating&&this.fire(new u.Event("rotatestart",a)),this._pitching&&!S.pitching&&this.fire(new u.Event("pitchstart",a))}_fireMoveEvents(a){this.fire(new u.Event("move",a)),this._zooming&&this.fire(new u.Event("zoom",a)),this._rotating&&this.fire(new u.Event("rotate",a)),this._pitching&&this.fire(new u.Event("pitch",a))}_afterEase(a,g){if(this._easeId&&g&&this._easeId===g)return;delete this._easeId;let S=this._zooming,I=this._rotating,L=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,S&&this.fire(new u.Event("zoomend",a)),I&&this.fire(new u.Event("rotateend",a)),L&&this.fire(new u.Event("pitchend",a)),this.fire(new u.Event("moveend",a))}flyTo(a,g){if(!a.essential&&u.exported.prefersReducedMotion){let d=u.pick(a,["center","zoom","bearing","pitch","around"]);return this.jumpTo(d,g)}this.stop(),a=u.extend({offset:[0,0],speed:1.2,curve:1.42,easing:u.ease},a);let S=this.transform,I=this.getZoom(),L=this.getBearing(),B=this.getPitch(),q=this.getPadding(),$="zoom"in a?u.clamp(+a.zoom,S.minZoom,S.maxZoom):I,J="bearing"in a?this._normalizeBearing(a.bearing,L):L,et="pitch"in a?+a.pitch:B,ut="padding"in a?a.padding:S.padding,vt=S.zoomScale($-I),Ft=u.pointGeometry.convert(a.offset),bt=S.centerPoint.add(Ft),Ot=S.pointLocation(bt),Kt=u.LngLat.convert(a.center||Ot);this._normalizeCenter(Kt);let Wt=S.project(Ot),ie=S.project(Kt).sub(Wt),Ht=a.curve,_e=Math.max(S.width,S.height),he=_e/vt,de=ie.mag();if("minZoom"in a){let d=u.clamp(Math.min(a.minZoom,I,$),S.minZoom,S.maxZoom),x=_e/S.zoomScale(d-I);Ht=Math.sqrt(x/de*2)}let Pe=Ht*Ht;function Re(d){let x=(he*he-_e*_e+(d?-1:1)*Pe*Pe*de*de)/(2*(d?he:_e)*Pe*de);return Math.log(Math.sqrt(x*x+1)-x)}function ve(d){return(Math.exp(d)-Math.exp(-d))/2}function ar(d){return(Math.exp(d)+Math.exp(-d))/2}let Ye=Re(0),Ar=function(d){return ar(Ye)/ar(Ye+Ht*d)},p=function(d){return _e*((ar(Ye)*(ve(x=Ye+Ht*d)/ar(x))-ve(Ye))/Pe)/de;var x},m=(Re(1)-Ye)/Ht;if(Math.abs(de)<1e-6||!isFinite(m)){if(Math.abs(_e-he)<1e-6)return this.easeTo(a,g);let d=he<_e?-1:1;m=Math.abs(Math.log(he/_e))/Ht,p=function(){return 0},Ar=function(x){return Math.exp(d*Ht*x)}}return a.duration="duration"in a?+a.duration:1e3*m/("screenSpeed"in a?+a.screenSpeed/Ht:+a.speed),a.maxDuration&&a.duration>a.maxDuration&&(a.duration=0),this._zooming=!0,this._rotating=L!==J,this._pitching=et!==B,this._padding=!S.isPaddingEqual(ut),this._prepareEase(g,!1),this._ease(d=>{let x=d*m,A=1/Ar(x);S.zoom=d===1?$:I+S.scaleZoom(A),this._rotating&&(S.bearing=u.number(L,J,d)),this._pitching&&(S.pitch=u.number(B,et,d)),this._padding&&(S.interpolatePadding(q,ut,d),bt=S.centerPoint.add(Ft));let k=d===1?Kt:S.unproject(Wt.add(ie.mult(p(x))).mult(A));S.setLocationAtPoint(S.renderWorldCopies?k.wrap():k,bt),this._fireMoveEvents(g)},()=>this._afterEase(g),a),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(a,g){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let S=this._onEaseEnd;delete this._onEaseEnd,S.call(this,g)}if(!a){let S=this.handlers;S&&S.stop(!1)}return this}_ease(a,g,S){S.animate===!1||S.duration===0?(a(1),g()):(this._easeStart=u.exported.now(),this._easeOptions=S,this._onEaseFrame=a,this._onEaseEnd=g,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){let a=Math.min((u.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(a)),a<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(a,g){a=u.wrap(a,-180,180);let S=Math.abs(a-g);return Math.abs(a-360-g)<S&&(a-=360),Math.abs(a+360-g)<S&&(a+=360),a}_normalizeCenter(a){let g=this.transform;if(!g.renderWorldCopies||g.lngRange)return;let S=a.lng-g.center.lng;a.lng+=S>180?-360:S<-180?360:0}}class Gn{constructor(a={}){this.options=a,u.bindAll(["_toggleAttribution","_updateData","_updateCompact","_updateCompactMinimize"],this)}getDefaultPosition(){return"bottom-right"}onAdd(a){return this._map=a,this._compact=this.options&&this.options.compact,this._container=N.create("details","maplibregl-ctrl maplibregl-ctrl-attrib mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=N.create("summary","maplibregl-ctrl-attrib-button mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=N.create("div","maplibregl-ctrl-attrib-inner mapboxgl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){N.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",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(a,g){let S=this._map._getUIString(`AttributionControl.${g}`);a.title=S,a.setAttribute("aria-label",S)}_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","mapboxgl-compact-show")):(this._container.classList.add("maplibregl-compact-show","mapboxgl-compact-show"),this._container.removeAttribute("open")))}_updateData(a){!a||a.sourceDataType!=="metadata"&&a.sourceDataType!=="visibility"&&a.dataType!=="style"||this._updateAttributions()}_updateAttributions(){if(!this._map.style)return;let a=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?a=a.concat(this.options.customAttribution.map(I=>typeof I!="string"?"":I)):typeof this.options.customAttribution=="string"&&a.push(this.options.customAttribution)),this._map.style.stylesheet){let I=this._map.style.stylesheet;this.styleOwner=I.owner,this.styleId=I.id}let g=this._map.style.sourceCaches;for(let I in g){let L=g[I];if(L.used){let B=L.getSource();B.attribution&&a.indexOf(B.attribution)<0&&a.push(B.attribution)}}a=a.filter(I=>String(I).trim()),a.sort((I,L)=>I.length-L.length),a=a.filter((I,L)=>{for(let B=L+1;B<a.length;B++)if(a[B].indexOf(I)>=0)return!1;return!0});let S=a.join(" | ");S!==this._attribHTML&&(this._attribHTML=S,a.length?(this._innerContainer.innerHTML=S,this._container.classList.remove("maplibregl-attrib-empty","mapboxgl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty","mapboxgl-attrib-empty"),this._updateCompact(),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?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","mapboxgl-compact","maplibregl-compact-show","mapboxgl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show","mapboxgl-compact","mapboxgl-compact-show"))}_updateCompactMinimize(){this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")}}class Yo{constructor(a={}){this.options=a,u.bindAll(["_updateCompact"],this)}getDefaultPosition(){return"bottom-left"}onAdd(a){this._map=a,this._compact=this.options&&this.options.compact,this._container=N.create("div","maplibregl-ctrl mapboxgl-ctrl");let g=N.create("a","maplibregl-ctrl-logo mapboxgl-ctrl-logo");return g.target="_blank",g.rel="noopener nofollow",g.href="https://maplibre.org/",g.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),g.setAttribute("rel","noopener nofollow"),this._container.appendChild(g),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){N.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}_updateCompact(){let a=this._container.children;if(a.length){let g=a[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&g.classList.add("maplibregl-compact","mapboxgl-compact"):g.classList.remove("maplibregl-compact","mapboxgl-compact")}}}class Wu{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(a){let g=++this._id;return this._queue.push({callback:a,id:g,cancelled:!1}),g}remove(a){let g=this._currentlyRunning,S=g?this._queue.concat(g):this._queue;for(let I of S)if(I.id===a)return void(I.cancelled=!0)}run(a=0){let g=this._currentlyRunning=this._queue;this._queue=[];for(let S of g)if(!S.cancelled&&(S.callback(a),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}let Ks={"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":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},$u={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,fadeDuration:300,crossSourceCollisions:!0},No={showCompass:!0,showZoom:!0,visualizePitch:!1};class mo{constructor(a,g,S=!1){this._clickTolerance=10,this.element=g,this.mouseRotate=new We({clickTolerance:a.dragRotate._mouseRotate._clickTolerance}),this.map=a,S&&(this.mousePitch=new Is({clickTolerance:a.dragRotate._mousePitch._clickTolerance})),u.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),N.addEventListener(g,"mousedown",this.mousedown),N.addEventListener(g,"touchstart",this.touchstart,{passive:!1}),N.addEventListener(g,"touchmove",this.touchmove),N.addEventListener(g,"touchend",this.touchend),N.addEventListener(g,"touchcancel",this.reset)}down(a,g){this.mouseRotate.mousedown(a,g),this.mousePitch&&this.mousePitch.mousedown(a,g),N.disableDrag()}move(a,g){let S=this.map,I=this.mouseRotate.mousemoveWindow(a,g);if(I&&I.bearingDelta&&S.setBearing(S.getBearing()+I.bearingDelta),this.mousePitch){let L=this.mousePitch.mousemoveWindow(a,g);L&&L.pitchDelta&&S.setPitch(S.getPitch()+L.pitchDelta)}}off(){let a=this.element;N.removeEventListener(a,"mousedown",this.mousedown),N.removeEventListener(a,"touchstart",this.touchstart,{passive:!1}),N.removeEventListener(a,"touchmove",this.touchmove),N.removeEventListener(a,"touchend",this.touchend),N.removeEventListener(a,"touchcancel",this.reset),this.offTemp()}offTemp(){N.enableDrag(),N.removeEventListener(window,"mousemove",this.mousemove),N.removeEventListener(window,"mouseup",this.mouseup)}mousedown(a){this.down(u.extend({},a,{ctrlKey:!0,preventDefault:()=>a.preventDefault()}),N.mousePos(this.element,a)),N.addEventListener(window,"mousemove",this.mousemove),N.addEventListener(window,"mouseup",this.mouseup)}mousemove(a){this.move(a,N.mousePos(this.element,a))}mouseup(a){this.mouseRotate.mouseupWindow(a),this.mousePitch&&this.mousePitch.mouseupWindow(a),this.offTemp()}touchstart(a){a.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=N.touchPos(this.element,a.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>a.preventDefault()},this._startPos))}touchmove(a){a.targetTouches.length!==1?this.reset():(this._lastPos=N.touchPos(this.element,a.targetTouches)[0],this.move({preventDefault:()=>a.preventDefault()},this._lastPos))}touchend(a){a.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()}reset(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()}}function er(T,a,g){if(T=new u.LngLat(T.lng,T.lat),a){let S=new u.LngLat(T.lng-360,T.lat),I=new u.LngLat(T.lng+360,T.lat),L=g.locationPoint(T).distSqr(a);g.locationPoint(S).distSqr(a)<L?T=S:g.locationPoint(I).distSqr(a)<L&&(T=I)}for(;Math.abs(T.lng-g.center.lng)>180;){let S=g.locationPoint(T);if(S.x>=0&&S.y>=0&&S.x<=g.width&&S.y<=g.height)break;T.lng>g.center.lng?T.lng-=360:T.lng+=360}return T}let Oe={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 go(T,a,g){let S=T.classList;for(let I in Oe)S.remove(`maplibregl-${g}-anchor-${I}`,`mapboxgl-${g}-anchor-${I}`);S.add(`maplibregl-${g}-anchor-${a}`,`mapboxgl-${g}-anchor-${a}`)}class Hn extends u.Evented{constructor(a,g){if(super(),(a instanceof HTMLElement||g)&&(a=u.extend({element:a},g)),u.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=a&&a.anchor||"center",this._color=a&&a.color||"#3FB1CE",this._scale=a&&a.scale||1,this._draggable=a&&a.draggable||!1,this._clickTolerance=a&&a.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=a&&a.rotation||0,this._rotationAlignment=a&&a.rotationAlignment||"auto",this._pitchAlignment=a&&a.pitchAlignment&&a.pitchAlignment!=="auto"?a.pitchAlignment:this._rotationAlignment,a&&a.element)this._element=a.element,this._offset=u.pointGeometry.convert(a&&a.offset||[0,0]);else{this._defaultMarker=!0,this._element=N.create("div"),this._element.setAttribute("aria-label","Map marker");let S=N.createNS("http://www.w3.org/2000/svg","svg"),I=41,L=27;S.setAttributeNS(null,"display","block"),S.setAttributeNS(null,"height",`${I}px`),S.setAttributeNS(null,"width",`${L}px`),S.setAttributeNS(null,"viewBox",`0 0 ${L} ${I}`);let B=N.createNS("http://www.w3.org/2000/svg","g");B.setAttributeNS(null,"stroke","none"),B.setAttributeNS(null,"stroke-width","1"),B.setAttributeNS(null,"fill","none"),B.setAttributeNS(null,"fill-rule","evenodd");let q=N.createNS("http://www.w3.org/2000/svg","g");q.setAttributeNS(null,"fill-rule","nonzero");let $=N.createNS("http://www.w3.org/2000/svg","g");$.setAttributeNS(null,"transform","translate(3.0, 29.0)"),$.setAttributeNS(null,"fill","#000000");let J=[{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"}];for(let ie of J){let Ht=N.createNS("http://www.w3.org/2000/svg","ellipse");Ht.setAttributeNS(null,"opacity","0.04"),Ht.setAttributeNS(null,"cx","10.5"),Ht.setAttributeNS(null,"cy","5.80029008"),Ht.setAttributeNS(null,"rx",ie.rx),Ht.setAttributeNS(null,"ry",ie.ry),$.appendChild(Ht)}let et=N.createNS("http://www.w3.org/2000/svg","g");et.setAttributeNS(null,"fill",this._color);let ut=N.createNS("http://www.w3.org/2000/svg","path");ut.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"),et.appendChild(ut);let vt=N.createNS("http://www.w3.org/2000/svg","g");vt.setAttributeNS(null,"opacity","0.25"),vt.setAttributeNS(null,"fill","#000000");let Ft=N.createNS("http://www.w3.org/2000/svg","path");Ft.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"),vt.appendChild(Ft);let bt=N.createNS("http://www.w3.org/2000/svg","g");bt.setAttributeNS(null,"transform","translate(6.0, 7.0)"),bt.setAttributeNS(null,"fill","#FFFFFF");let Ot=N.createNS("http://www.w3.org/2000/svg","g");Ot.setAttributeNS(null,"transform","translate(8.0, 8.0)");let Kt=N.createNS("http://www.w3.org/2000/svg","circle");Kt.setAttributeNS(null,"fill","#000000"),Kt.setAttributeNS(null,"opacity","0.25"),Kt.setAttributeNS(null,"cx","5.5"),Kt.setAttributeNS(null,"cy","5.5"),Kt.setAttributeNS(null,"r","5.4999962");let Wt=N.createNS("http://www.w3.org/2000/svg","circle");Wt.setAttributeNS(null,"fill","#FFFFFF"),Wt.setAttributeNS(null,"cx","5.5"),Wt.setAttributeNS(null,"cy","5.5"),Wt.setAttributeNS(null,"r","5.4999962"),Ot.appendChild(Kt),Ot.appendChild(Wt),q.appendChild($),q.appendChild(et),q.appendChild(vt),q.appendChild(bt),q.appendChild(Ot),S.appendChild(q),S.setAttributeNS(null,"height",I*this._scale+"px"),S.setAttributeNS(null,"width",L*this._scale+"px"),this._element.appendChild(S),this._offset=u.pointGeometry.convert(a&&a.offset||[0,-14])}this._element.classList.add("maplibregl-marker","mapboxgl-marker"),this._element.addEventListener("dragstart",S=>{S.preventDefault()}),this._element.addEventListener("mousedown",S=>{S.preventDefault()}),go(this._element,this._anchor,"marker"),this._popup=null}addTo(a){return this.remove(),this._map=a,a.getCanvasContainer().appendChild(this._element),a.on("move",this._update),a.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",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),N.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(a){return this._lngLat=u.LngLat.convert(a),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(a){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),a){if(!("offset"in a.options)){let I=Math.sqrt(Math.pow(13.5,2)/2);a.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[I,-1*(38.1-13.5+I)],"bottom-right":[-I,-1*(38.1-13.5+I)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=a,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}_onKeyPress(a){let g=a.code,S=a.charCode||a.keyCode;g!=="Space"&&g!=="Enter"&&S!==32&&S!==13||this.togglePopup()}_onMapClick(a){let g=a.originalEvent.target,S=this._element;this._popup&&(g===S||S.contains(g))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){let a=this._popup;return a?(a.isOpen()?a.remove():a.addTo(this._map),this):this}_update(a){if(!this._map)return;this._map.transform.renderWorldCopies&&(this._lngLat=er(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let g="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?g=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(g=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let S="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?S="rotateX(0deg)":this._pitchAlignment==="map"&&(S=`rotateX(${this._map.getPitch()}deg)`),a&&a.type!=="moveend"||(this._pos=this._pos.round()),N.setTransform(this._element,`${Oe[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${S} ${g}`)}getOffset(){return this._offset}setOffset(a){return this._offset=u.pointGeometry.convert(a),this._update(),this}_onMove(a){if(!this._isDragging){let g=this._clickTolerance||this._map._clickTolerance;this._isDragging=a.point.dist(this._pointerdownPos)>=g}this._isDragging&&(this._pos=a.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new u.Event("dragstart"))),this.fire(new u.Event("drag")))}_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),this._state==="active"&&this.fire(new u.Event("dragend")),this._state="inactive"}_addDragHandler(a){this._element.contains(a.originalEvent.target)&&(a.preventDefault(),this._positionDelta=a.point.sub(this._pos).add(this._offset),this._pointerdownPos=a.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))}setDraggable(a){return this._draggable=!!a,this._map&&(a?(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(a){return this._rotation=a||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(a){return this._rotationAlignment=a||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(a){return this._pitchAlignment=a&&a!=="auto"?a:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}let gn={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Bi,yo=0,Zi=!1,Jn={maxWidth:100,unit:"metric"};function Ra(T,a,g){let S=g&&g.maxWidth||100,I=T._container.clientHeight/2,L=T.unproject([0,I]),B=T.unproject([S,I]),q=L.distanceTo(B);if(g&&g.unit==="imperial"){let $=3.2808*q;$>5280?je(a,S,$/5280,T._getUIString("ScaleControl.Miles")):je(a,S,$,T._getUIString("ScaleControl.Feet"))}else g&&g.unit==="nautical"?je(a,S,q/1852,T._getUIString("ScaleControl.NauticalMiles")):q>=1e3?je(a,S,q/1e3,T._getUIString("ScaleControl.Kilometers")):je(a,S,q,T._getUIString("ScaleControl.Meters"))}function je(T,a,g,S){let I=function(L){let B=Math.pow(10,`${Math.floor(L)}`.length-1),q=L/B;return q=q>=10?10:q>=5?5:q>=3?3:q>=2?2:q>=1?1:function($){let J=Math.pow(10,Math.ceil(-Math.log($)/Math.LN10));return Math.round($*J)/J}(q),B*q}(g);T.style.width=a*(I/g)+"px",T.innerHTML=`${I}&nbsp;${S}`}let Ve={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Il=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function cn(T){if(T){if(typeof T=="number"){let a=Math.round(Math.sqrt(.5*Math.pow(T,2)));return{center:new u.pointGeometry(0,0),top:new u.pointGeometry(0,T),"top-left":new u.pointGeometry(a,a),"top-right":new u.pointGeometry(-a,a),bottom:new u.pointGeometry(0,-T),"bottom-left":new u.pointGeometry(a,-a),"bottom-right":new u.pointGeometry(-a,-a),left:new u.pointGeometry(T,0),right:new u.pointGeometry(-T,0)}}if(T instanceof u.pointGeometry||Array.isArray(T)){let a=u.pointGeometry.convert(T);return{center:a,top:a,"top-left":a,"top-right":a,bottom:a,"bottom-left":a,"bottom-right":a,left:a,right:a}}return{center:u.pointGeometry.convert(T.center||[0,0]),top:u.pointGeometry.convert(T.top||[0,0]),"top-left":u.pointGeometry.convert(T["top-left"]||[0,0]),"top-right":u.pointGeometry.convert(T["top-right"]||[0,0]),bottom:u.pointGeometry.convert(T.bottom||[0,0]),"bottom-left":u.pointGeometry.convert(T["bottom-left"]||[0,0]),"bottom-right":u.pointGeometry.convert(T["bottom-right"]||[0,0]),left:u.pointGeometry.convert(T.left||[0,0]),right:u.pointGeometry.convert(T.right||[0,0])}}return cn(new u.pointGeometry(0,0))}let so={supported:P,setRTLTextPlugin:u.setRTLTextPlugin,getRTLTextPluginStatus:u.getRTLTextPluginStatus,Map:class extends As{constructor(T){var a;if(u.PerformanceUtils.mark(u.PerformanceMarkers.create),(T=u.extend({},$u,T)).minZoom!=null&&T.maxZoom!=null&&T.minZoom>T.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(T.minPitch!=null&&T.maxPitch!=null&&T.minPitch>T.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(T.minPitch!=null&&T.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(T.maxPitch!=null&&T.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new $o(T.minZoom,T.maxZoom,T.minPitch,T.maxPitch,T.renderWorldCopies),{bearingSnap:T.bearingSnap}),this._interactive=T.interactive,this._maxTileCacheSize=T.maxTileCacheSize,this._failIfMajorPerformanceCaveat=T.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=T.preserveDrawingBuffer,this._antialias=T.antialias,this._trackResize=T.trackResize,this._bearingSnap=T.bearingSnap,this._refreshExpiredTiles=T.refreshExpiredTiles,this._fadeDuration=T.fadeDuration,this._crossSourceCollisions=T.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=T.collectResourceTiming,this._renderTaskQueue=new Wu,this._controls=[],this._mapId=u.uniqueId(),this._locale=u.extend({},Ks,T.locale),this._clickTolerance=T.clickTolerance,this._pixelRatio=(a=T.pixelRatio)!==null&&a!==void 0?a:devicePixelRatio,this._requestManager=new at(T.transformRequest),typeof T.container=="string"){if(this._container=document.getElementById(T.container),!this._container)throw new Error(`Container '${T.container}' not found.`)}else{if(!(T.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=T.container}if(T.maxBounds&&this.setMaxBounds(T.maxBounds),u.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),typeof window<"u"&&(addEventListener("online",this._onWindowOnline,!1),addEventListener("resize",this._onWindowResize,!1),addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Fi(this,T),this._hash=T.hash&&new Vs(typeof T.hash=="string"&&T.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:T.center,zoom:T.zoom,bearing:T.bearing,pitch:T.pitch}),T.bounds&&(this.resize(),this.fitBounds(T.bounds,u.extend({},T.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=T.localIdeographFontFamily,T.style&&this.setStyle(T.style,{localIdeographFontFamily:T.localIdeographFontFamily}),T.attributionControl&&this.addControl(new Gn({customAttribution:T.customAttribution})),T.maplibreLogo&&this.addControl(new Yo,T.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",g=>{this._update(g.dataType==="style"),this.fire(new u.Event(`${g.dataType}data`,g))}),this.on("dataloading",g=>{this.fire(new u.Event(`${g.dataType}dataloading`,g))}),this.on("dataabort",g=>{this.fire(new u.Event("sourcedataabort",g))})}_getMapId(){return this._mapId}addControl(T,a){if(a===void 0&&(a=T.getDefaultPosition?T.getDefaultPosition():"top-right"),!T||!T.onAdd)return this.fire(new u.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let g=T.onAdd(this);this._controls.push(T);let S=this._controlPositions[a];return a.indexOf("bottom")!==-1?S.insertBefore(g,S.firstChild):S.appendChild(g),this}removeControl(T){if(!T||!T.onRemove)return this.fire(new u.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let a=this._controls.indexOf(T);return a>-1&&this._controls.splice(a,1),T.onRemove(this),this}hasControl(T){return this._controls.indexOf(T)>-1}resize(T){let a=this._containerDimensions(),g=a[0],S=a[1];this._resizeCanvas(g,S,this.getPixelRatio()),this.transform.resize(g,S),this.painter.resize(g,S,this.getPixelRatio());let I=!this._moving;return I&&(this.stop(),this.fire(new u.Event("movestart",T)).fire(new u.Event("move",T))),this.fire(new u.Event("resize",T)),I&&this.fire(new u.Event("moveend",T)),this}getPixelRatio(){return this._pixelRatio}setPixelRatio(T){let[a,g]=this._containerDimensions();this._pixelRatio=T,this._resizeCanvas(a,g,T),this.painter.resize(a,g,T)}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(T){return this.transform.setMaxBounds(u.LngLatBounds.convert(T)),this._update()}setMinZoom(T){if((T=T??-2)>=-2&&T<=this.transform.maxZoom)return this.transform.minZoom=T,this._update(),this.getZoom()<T&&this.setZoom(T),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(T){if((T=T??22)>=this.transform.minZoom)return this.transform.maxZoom=T,this._update(),this.getZoom()>T&&this.setZoom(T),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(T){if((T=T??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(T>=0&&T<=this.transform.maxPitch)return this.transform.minPitch=T,this._update(),this.getPitch()<T&&this.setPitch(T),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(T){if((T=T??60)>85)throw new Error("maxPitch must be less than or equal to 85");if(T>=this.transform.minPitch)return this.transform.maxPitch=T,this._update(),this.getPitch()>T&&this.setPitch(T),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(T){return this.transform.renderWorldCopies=T,this._update()}project(T){return this.transform.locationPoint(u.LngLat.convert(T))}unproject(T){return this.transform.pointLocation(u.pointGeometry.convert(T))}isMoving(){return this._moving||this.handlers.isMoving()}isZooming(){return this._zooming||this.handlers.isZooming()}isRotating(){return this._rotating||this.handlers.isRotating()}_createDelegatedListener(T,a,g){if(T==="mouseenter"||T==="mouseover"){let S=!1;return{layer:a,listener:g,delegates:{mousemove:L=>{let B=this.getLayer(a)?this.queryRenderedFeatures(L.point,{layers:[a]}):[];B.length?S||(S=!0,g.call(this,new Kn(T,this,L.originalEvent,{features:B}))):S=!1},mouseout:()=>{S=!1}}}}if(T==="mouseleave"||T==="mouseout"){let S=!1;return{layer:a,listener:g,delegates:{mousemove:B=>{(this.getLayer(a)?this.queryRenderedFeatures(B.point,{layers:[a]}):[]).length?S=!0:S&&(S=!1,g.call(this,new Kn(T,this,B.originalEvent)))},mouseout:B=>{S&&(S=!1,g.call(this,new Kn(T,this,B.originalEvent)))}}}}{let S=I=>{let L=this.getLayer(a)?this.queryRenderedFeatures(I.point,{layers:[a]}):[];L.length&&(I.features=L,g.call(this,I),delete I.features)};return{layer:a,listener:g,delegates:{[T]:S}}}}on(T,a,g){if(g===void 0)return super.on(T,a);let S=this._createDelegatedListener(T,a,g);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[T]=this._delegatedListeners[T]||[],this._delegatedListeners[T].push(S);for(let I in S.delegates)this.on(I,S.delegates[I]);return this}once(T,a,g){if(g===void 0)return super.once(T,a);let S=this._createDelegatedListener(T,a,g);for(let I in S.delegates)this.once(I,S.delegates[I]);return this}off(T,a,g){return g===void 0?super.off(T,a):(this._delegatedListeners&&this._delegatedListeners[T]&&(S=>{let I=this._delegatedListeners[T];for(let L=0;L<I.length;L++){let B=I[L];if(B.layer===a&&B.listener===g){for(let q in B.delegates)this.off(q,B.delegates[q]);return I.splice(L,1),this}}})(),this)}queryRenderedFeatures(T,a){if(!this.style)return[];let g;if(a!==void 0||T===void 0||T instanceof u.pointGeometry||Array.isArray(T)||(a=T,T=void 0),a=a||{},(T=T||[[0,0],[this.transform.width,this.transform.height]])instanceof u.pointGeometry||typeof T[0]=="number")g=[u.pointGeometry.convert(T)];else{let S=u.pointGeometry.convert(T[0]),I=u.pointGeometry.convert(T[1]);g=[S,new u.pointGeometry(I.x,S.y),I,new u.pointGeometry(S.x,I.y),S]}return this.style.queryRenderedFeatures(g,a,this.transform)}querySourceFeatures(T,a){return this.style.querySourceFeatures(T,a)}setStyle(T,a){return(a=u.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},a)).diff!==!1&&a.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&T?(this._diffStyle(T,a),this):(this._localIdeographFontFamily=a.localIdeographFontFamily,this._updateStyle(T,a))}setTransformRequest(T){return this._requestManager.setTransformRequest(T),this}_getUIString(T){let a=this._locale[T];if(a==null)throw new Error(`Missing UI string '${T}'`);return a}_updateStyle(T,a){return this.style&&(this.style.setEventedParent(null),this.style._remove()),T?(this.style=new si(this,a||{}),this.style.setEventedParent(this,{style:this.style}),typeof T=="string"?this.style.loadURL(T):this.style.loadJSON(T),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new si(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(T,a){if(typeof T=="string"){let g=this._requestManager.transformRequest(T,u.ResourceType.Style);u.getJSON(g,(S,I)=>{S?this.fire(new u.ErrorEvent(S)):I&&this._updateDiff(I,a)})}else typeof T=="object"&&this._updateDiff(T,a)}_updateDiff(T,a){try{this.style.setState(T)&&this._update(!0)}catch(g){u.warnOnce(`Unable to perform style diff: ${g.message||g.error||g}. Rebuilding the style from scratch.`),this._updateStyle(T,a)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():u.warnOnce("There is no style added to the map.")}addSource(T,a){return this._lazyInitEmptyStyle(),this.style.addSource(T,a),this._update(!0)}isSourceLoaded(T){let a=this.style&&this.style.sourceCaches[T];if(a!==void 0)return a.loaded();this.fire(new u.ErrorEvent(new Error(`There is no source with ID '${T}'`)))}areTilesLoaded(){let T=this.style&&this.style.sourceCaches;for(let a in T){let g=T[a]._tiles;for(let S in g){let I=g[S];if(I.state!=="loaded"&&I.state!=="errored")return!1}}return!0}addSourceType(T,a,g){return this._lazyInitEmptyStyle(),this.style.addSourceType(T,a,g)}removeSource(T){return this.style.removeSource(T),this._update(!0)}getSource(T){return this.style.getSource(T)}addImage(T,a,{pixelRatio:g=1,sdf:S=!1,stretchX:I,stretchY:L,content:B}={}){if(this._lazyInitEmptyStyle(),a instanceof HTMLImageElement||u.isImageBitmap(a)){let{width:q,height:$,data:J}=u.exported.getImageData(a);this.style.addImage(T,{data:new u.RGBAImage({width:q,height:$},J),pixelRatio:g,stretchX:I,stretchY:L,content:B,sdf:S,version:0})}else{if(a.width===void 0||a.height===void 0)return this.fire(new u.ErrorEvent(new 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:q,height:$,data:J}=a,et=a;this.style.addImage(T,{data:new u.RGBAImage({width:q,height:$},new Uint8Array(J)),pixelRatio:g,stretchX:I,stretchY:L,content:B,sdf:S,version:0,userImage:et}),et.onAdd&&et.onAdd(this,T)}}}updateImage(T,a){let g=this.style.getImage(T);if(!g)return this.fire(new u.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let S=a instanceof HTMLImageElement||u.isImageBitmap(a)?u.exported.getImageData(a):a,{width:I,height:L,data:B}=S;if(I===void 0||L===void 0)return this.fire(new u.ErrorEvent(new 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(I!==g.data.width||L!==g.data.height)return this.fire(new u.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));let q=!(a instanceof HTMLImageElement||u.isImageBitmap(a));g.data.replace(B,q),this.style.updateImage(T,g)}hasImage(T){return T?!!this.style.getImage(T):(this.fire(new u.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(T){this.style.removeImage(T)}loadImage(T,a){u.getImage(this._requestManager.transformRequest(T,u.ResourceType.Image),a)}listImages(){return this.style.listImages()}addLayer(T,a){return this._lazyInitEmptyStyle(),this.style.addLayer(T,a),this._update(!0)}moveLayer(T,a){return this.style.moveLayer(T,a),this._update(!0)}removeLayer(T){return this.style.removeLayer(T),this._update(!0)}getLayer(T){return this.style.getLayer(T)}setLayerZoomRange(T,a,g){return this.style.setLayerZoomRange(T,a,g),this._update(!0)}setFilter(T,a,g={}){return this.style.setFilter(T,a,g),this._update(!0)}getFilter(T){return this.style.getFilter(T)}setPaintProperty(T,a,g,S={}){return this.style.setPaintProperty(T,a,g,S),this._update(!0)}getPaintProperty(T,a){return this.style.getPaintProperty(T,a)}setLayoutProperty(T,a,g,S={}){return this.style.setLayoutProperty(T,a,g,S),this._update(!0)}getLayoutProperty(T,a){return this.style.getLayoutProperty(T,a)}setLight(T,a={}){return this._lazyInitEmptyStyle(),this.style.setLight(T,a),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(T,a){return this.style.setFeatureState(T,a),this._update()}removeFeatureState(T,a){return this.style.removeFeatureState(T,a),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,a=0;return this._container&&(T=this._container.clientWidth||400,a=this._container.clientHeight||300),[T,a]}_setupContainer(){let T=this._container;T.classList.add("maplibregl-map","mapboxgl-map");let a=this._canvasContainer=N.create("div","maplibregl-canvas-container mapboxgl-canvas-container",T);this._interactive&&a.classList.add("maplibregl-interactive","mapboxgl-interactive"),this._canvas=N.create("canvas","maplibregl-canvas mapboxgl-canvas",a),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");let g=this._containerDimensions();this._resizeCanvas(g[0],g[1],this.getPixelRatio());let S=this._controlContainer=N.create("div","maplibregl-control-container mapboxgl-control-container",T),I=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(L=>{I[L]=N.create("div",`maplibregl-ctrl-${L} mapboxgl-ctrl-${L}`,S)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(T,a,g){this._canvas.width=g*T,this._canvas.height=g*a,this._canvas.style.width=`${T}px`,this._canvas.style.height=`${a}px`}_setupPainter(){let T=u.extend({},P.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),a=this._canvas.getContext("webgl",T)||this._canvas.getContext("experimental-webgl",T);a?(this.painter=new ko(a,this.transform),u.exported$1.testSupport(a)):this.fire(new u.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(T){T.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new u.Event("webglcontextlost",{originalEvent:T}))}_contextRestored(T){this._setupPainter(),this.resize(),this._update(),this.fire(new u.Event("webglcontextrestored",{originalEvent:T}))}_onMapScroll(T){if(T.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(T){return this.style?(this._styleDirty=this._styleDirty||T,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(T){return this._update(),this._renderTaskQueue.add(T)}_cancelRenderFrame(T){this._renderTaskQueue.remove(T)}_render(T){let a,g=0,S=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(a=S.createQueryEXT(),S.beginQueryEXT(S.TIME_ELAPSED_EXT,a),g=u.exported.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(T),this._removed)return;let I=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let B=this.transform.zoom,q=u.exported.now();this.style.zoomHistory.update(B,q);let $=new u.EvaluationParameters(B,{now:q,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),J=$.crossFadingFactor();J===1&&J===this._crossFadingFactor||(I=!0,this._crossFadingFactor=J),this.style.update($)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new u.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,u.PerformanceUtils.mark(u.PerformanceMarkers.load),this.fire(new u.Event("load"))),this.style&&(this.style.hasTransitions()||I)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){let B=u.exported.now()-g;S.endQueryEXT(S.TIME_ELAPSED_EXT,a),setTimeout(()=>{let q=S.getQueryObjectEXT(a,S.QUERY_RESULT_EXT)/1e6;S.deleteQueryEXT(a),this.fire(new u.Event("gpu-timing-frame",{cpuTime:B,gpuTime:q}))},50)}if(this.listens("gpu-timing-layer")){let B=this.painter.collectGpuTimers();setTimeout(()=>{let q=this.painter.queryGpuTimers(B);this.fire(new u.Event("gpu-timing-layer",{layerTimes:q}))},50)}let L=this._sourcesDirty||this._styleDirty||this._placementDirty;return L||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new u.Event("idle")),!this._loaded||this._fullyLoaded||L||(this._fullyLoaded=!0,u.PerformanceUtils.mark(u.PerformanceMarkers.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){this._hash&&this._hash.remove();for(let a of this._controls)a.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&(removeEventListener("resize",this._onWindowResize,!1),removeEventListener("orientationchange",this._onWindowResize,!1),removeEventListener("online",this._onWindowOnline,!1));let T=this.painter.context.gl.getExtension("WEBGL_lose_context");T&&T.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),N.remove(this._canvasContainer),N.remove(this._controlContainer),this._container.classList.remove("maplibregl-map","mapboxgl-map"),u.PerformanceUtils.clearMetrics(),this._removed=!0,this.fire(new u.Event("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=u.exported.frame(T=>{u.PerformanceUtils.frame(T),this._frame=null,this._render(T)}))}_onWindowOnline(){this._update()}_onWindowResize(T){this._trackResize&&this.resize({originalEvent:T})._update()}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()}_setCacheLimits(T,a){u.setCacheLimits(T,a)}},NavigationControl:class{constructor(T){this.options=u.extend({},No,T),this._container=N.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",a=>a.preventDefault()),this.options.showZoom&&(u.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in mapboxgl-ctrl-zoom-in",a=>this._map.zoomIn({},{originalEvent:a})),N.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out mapboxgl-ctrl-zoom-out",a=>this._map.zoomOut({},{originalEvent:a})),N.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(u.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("maplibregl-ctrl-compass mapboxgl-ctrl-compass",a=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:a}):this._map.resetNorth({},{originalEvent:a})}),this._compassIcon=N.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){let T=this._map.getZoom(),a=T===this._map.getMaxZoom(),g=T===this._map.getMinZoom();this._zoomInButton.disabled=a,this._zoomOutButton.disabled=g,this._zoomInButton.setAttribute("aria-disabled",a.toString()),this._zoomOutButton.setAttribute("aria-disabled",g.toString())}_rotateCompassArrow(){let T=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=T}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._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new mo(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){N.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._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(T,a){let g=N.create("button",T,this._container);return g.type="button",g.addEventListener("click",a),g}_setButtonTitle(T,a){let g=this._map._getUIString(`NavigationControl.${a}`);T.title=g,T.setAttribute("aria-label",g)}},GeolocateControl:class extends u.Evented{constructor(T){super(),this.options=u.extend({},gn,T),u.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}onAdd(T){var a;return this._map=T,this._container=N.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),a=this._setupUI,Bi!==void 0?a(Bi):window.navigator.permissions!==void 0?window.navigator.permissions.query({name:"geolocation"}).then(g=>{Bi=g.state!=="denied",a(Bi)}):(Bi=!!window.navigator.geolocation,a(Bi)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(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(),N.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,yo=0,Zi=!1}_isOutOfMapMaxBounds(T){let a=this._map.getMaxBounds(),g=T.coords;return a&&(g.longitude<a.getWest()||g.longitude>a.getEast()||g.latitude<a.getSouth()||g.latitude>a.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(T){if(this._map){if(this._isOutOfMapMaxBounds(T))return this._setErrorState(),this.fire(new u.Event("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","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(T),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(T),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new u.Event("geolocate",T)),this._finish()}}_updateCamera(T){let a=new u.LngLat(T.coords.longitude,T.coords.latitude),g=T.coords.accuracy,S=this._map.getBearing(),I=u.extend({bearing:S},this.options.fitBoundsOptions);this._map.fitBounds(a.toBounds(g),I,{geolocateSource:!0})}_updateMarker(T){if(T){let a=new u.LngLat(T.coords.longitude,T.coords.latitude);this._accuracyCircleMarker.setLngLat(a).addTo(this._map),this._userLocationDotMarker.setLngLat(a).addTo(this._map),this._accuracy=T.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){let T=this._map._container.clientHeight/2,a=this._map.unproject([0,T]),g=this._map.unproject([1,T]),S=a.distanceTo(g),I=Math.ceil(2*this._accuracy/S);this._circleElement.style.width=`${I}px`,this._circleElement.style.height=`${I}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_onError(T){if(this._map){if(this.options.trackUserLocation)if(T.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(T.code===3&&Zi)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new u.Event("error",T)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(T){if(this._container.addEventListener("contextmenu",a=>a.preventDefault()),this._geolocateButton=N.create("button","maplibregl-ctrl-geolocate mapboxgl-ctrl-geolocate",this._container),N.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",T===!1){u.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");let a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}else{let a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=N.create("div","maplibregl-user-location-dot mapboxgl-user-location-dot"),this._userLocationDotMarker=new Hn(this._dotElement),this._circleElement=N.create("div","maplibregl-user-location-accuracy-circle mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Hn({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",a=>{a.geolocateSource||this._watchState!=="ACTIVE_LOCK"||a.originalEvent&&a.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this.fire(new u.Event("trackuserlocationend")))})}trigger(){if(!this._setup)return u.warnOnce("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 u.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":yo--,Zi=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this.fire(new u.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new u.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let T;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),yo++,yo>1?(T={maximumAge:6e5,timeout:0},Zi=!0):(T=this.options.positionOptions,Zi=!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","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:Gn,LogoControl:Yo,ScaleControl:class{constructor(T){this.options=u.extend({},Jn,T),u.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){Ra(this._map,this._container,this.options)}onAdd(T){return this._map=T,this._container=N.create("div","maplibregl-ctrl maplibregl-ctrl-scale mapboxgl-ctrl mapboxgl-ctrl-scale",T.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){N.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}setUnit(T){this.options.unit=T,Ra(this._map,this._container,this.options)}},FullscreenControl:class{constructor(T){this._fullscreen=!1,T&&T.container&&(T.container instanceof HTMLElement?this._container=T.container:u.warnOnce("Full screen control 'container' must be a DOM element.")),u.bindAll(["_onClickFullscreen","_changeIcon"],this),"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=N.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",u.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){N.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!!(document.fullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled)}_setupUI(){let T=this._fullscreenButton=N.create("button","maplibregl-ctrl-fullscreen mapboxgl-ctrl-fullscreen",this._controlContainer);N.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",T).setAttribute("aria-hidden","true"),T.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_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}_changeIcon(){(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen&&window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends u.Evented{constructor(T){super(),this.options=u.extend(Object.create(Ve),T),u.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}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","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new u.Event("open")),this}isOpen(){return!!this._map}remove(){return this._content&&N.remove(this._content),this._container&&(N.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),delete this._map),this.fire(new u.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(T){return this._lngLat=u.LngLat.convert(T),this._pos=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","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer","mapboxgl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=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","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")),this}getElement(){return this._container}setText(T){return this.setDOMContent(document.createTextNode(T))}setHTML(T){let a=document.createDocumentFragment(),g=document.createElement("body"),S;for(g.innerHTML=T;S=g.firstChild,S;)a.appendChild(S);return this.setDOMContent(a)}getMaxWidth(){return this._container&&this._container.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=N.create("div","maplibregl-popup-content mapboxgl-popup-content",this._container);return this._content.appendChild(T),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(T){this._container&&this._container.classList.add(T)}removeClassName(T){this._container&&this._container.classList.remove(T)}setOffset(T){return this.options.offset=T,this._update(),this}toggleClassName(T){if(this._container)return this._container.classList.toggle(T)}_createCloseButton(){this.options.closeButton&&(this._closeButton=N.create("button","maplibregl-popup-close-button mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_onMouseUp(T){this._update(T.point)}_onMouseMove(T){this._update(T.point)}_onDrag(T){this._update(T.point)}_update(T){if(!this._map||!this._lngLat&&!this._trackPointer||!this._content||(this._container||(this._container=N.create("div","maplibregl-popup mapboxgl-popup",this._map.getContainer()),this._tip=N.create("div","maplibregl-popup-tip mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(L=>this._container.classList.add(L)),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=er(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!T))return;let a=this._pos=this._trackPointer&&T?T:this._map.project(this._lngLat),g=this.options.anchor,S=cn(this.options.offset);if(!g){let L=this._container.offsetWidth,B=this._container.offsetHeight,q;q=a.y+S.bottom.y<B?["top"]:a.y>this._map.transform.height-B?["bottom"]:[],a.x<L/2?q.push("left"):a.x>this._map.transform.width-L/2&&q.push("right"),g=q.length===0?"bottom":q.join("-")}let I=a.add(S[g]).round();N.setTransform(this._container,`${Oe[g]} translate(${I.x}px,${I.y}px)`),go(this._container,g,"popup")}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let T=this._container.querySelector(Il);T&&T.focus()}_onClose(){this.remove()}},Marker:Hn,Style:si,LngLat:u.LngLat,LngLatBounds:u.LngLatBounds,Point:u.pointGeometry,MercatorCoordinate:u.MercatorCoordinate,Evented:u.Evented,AJAXError:u.AJAXError,config:u.config,CanvasSource:ti,GeoJSONSource:xr,ImageSource:$r,RasterDEMTileSource:br,RasterTileSource:yr,VectorTileSource:Lr,VideoSource:Fe,prewarm:function(){Wi().acquire(ji)},clearPrewarmedResources:function(){let T=io;T&&(T.isPreloaded()&&T.numActive()===1?(T.release(ji),io=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()"))},get workerCount(){return qn.workerCount},set workerCount(T){qn.workerCount=T},get maxParallelImageRequests(){return u.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(T){u.config.MAX_PARALLEL_IMAGE_REQUESTS=T},clearStorage(T){u.clearTileCache(T)},workerUrl:"",addProtocol(T,a){u.config.REGISTERED_PROTOCOLS[T]=a},removeProtocol(T){delete u.config.REGISTERED_PROTOCOLS[T]}};return Ii.extend(so,{isSafari:u.isSafari,getPerformanceMetrics:u.PerformanceUtils.getPerformanceMetrics}),so});var i=o;return i})});var e1=Vf((oB,t1)=>{var wE="Expected a function",J0=NaN,EE="[object Symbol]",SE=/^\s+|\s+$/g,TE=/^[-+]0x[0-9a-f]+$/i,IE=/^0b[01]+$/i,CE=/^0o[0-7]+$/i,AE=parseInt,PE=typeof global=="object"&&global&&global.Object===Object&&global,ME=typeof self=="object"&&self&&self.Object===Object&&self,LE=PE||ME||Function("return this")(),kE=Object.prototype,zE=kE.toString,RE=Math.max,DE=Math.min,I_=function(){return LE.Date.now()};function OE(v,l,o){var c,i,u,P,D,F,U=0,N=!1,at=!1,yt=!0;if(typeof v!="function")throw new TypeError(wE);l=Q0(l)||0,C_(o)&&(N=!!o.leading,at="maxWait"in o,u=at?RE(Q0(o.maxWait)||0,l):u,yt="trailing"in o?!!o.trailing:yt);function Tt(oe){var ye=c,be=i;return c=i=void 0,U=oe,P=v.apply(be,ye),P}function kt(oe){return U=oe,D=setTimeout(Lt,l),N?Tt(oe):P}function Vt(oe){var ye=oe-F,be=oe-U,Me=l-ye;return at?DE(Me,u-be):Me}function wt(oe){var ye=oe-F,be=oe-U;return F===void 0||ye>=l||ye<0||at&&be>=u}function Lt(){var oe=I_();if(wt(oe))return Zt(oe);D=setTimeout(Lt,Vt(oe))}function Zt(oe){return D=void 0,yt&&c?Tt(oe):(c=i=void 0,P)}function Jt(){D!==void 0&&clearTimeout(D),U=0,c=F=i=D=void 0}function se(){return D===void 0?P:Zt(I_())}function ce(){var oe=I_(),ye=wt(oe);if(c=arguments,i=this,F=oe,ye){if(D===void 0)return kt(F);if(at)return D=setTimeout(Lt,l),Tt(F)}return D===void 0&&(D=setTimeout(Lt,l)),P}return ce.cancel=Jt,ce.flush=se,ce}function C_(v){var l=typeof v;return!!v&&(l=="object"||l=="function")}function FE(v){return!!v&&typeof v=="object"}function BE(v){return typeof v=="symbol"||FE(v)&&zE.call(v)==EE}function Q0(v){if(typeof v=="number")return v;if(BE(v))return J0;if(C_(v)){var l=typeof v.valueOf=="function"?v.valueOf():v;v=C_(l)?l+"":l}if(typeof v!="string")return v===0?v:+v;v=v.replace(SE,"");var o=IE.test(v);return o||CE.test(v)?AE(v.slice(2),o?2:8):TE.test(v)?J0:+v}t1.exports=OE});var a1=Vf((aB,o1)=>{var n1="Expected a function",r1=NaN,UE="[object Symbol]",NE=/^\s+|\s+$/g,VE=/^[-+]0x[0-9a-f]+$/i,GE=/^0b[01]+$/i,jE=/^0o[0-7]+$/i,qE=parseInt,ZE=typeof global=="object"&&global&&global.Object===Object&&global,XE=typeof self=="object"&&self&&self.Object===Object&&self,WE=ZE||XE||Function("return this")(),$E=Object.prototype,KE=$E.toString,YE=Math.max,HE=Math.min,A_=function(){return WE.Date.now()};function JE(v,l,o){var c,i,u,P,D,F,U=0,N=!1,at=!1,yt=!0;if(typeof v!="function")throw new TypeError(n1);l=i1(l)||0,Hm(o)&&(N=!!o.leading,at="maxWait"in o,u=at?YE(i1(o.maxWait)||0,l):u,yt="trailing"in o?!!o.trailing:yt);function Tt(oe){var ye=c,be=i;return c=i=void 0,U=oe,P=v.apply(be,ye),P}function kt(oe){return U=oe,D=setTimeout(Lt,l),N?Tt(oe):P}function Vt(oe){var ye=oe-F,be=oe-U,Me=l-ye;return at?HE(Me,u-be):Me}function wt(oe){var ye=oe-F,be=oe-U;return F===void 0||ye>=l||ye<0||at&&be>=u}function Lt(){var oe=A_();if(wt(oe))return Zt(oe);D=setTimeout(Lt,Vt(oe))}function Zt(oe){return D=void 0,yt&&c?Tt(oe):(c=i=void 0,P)}function Jt(){D!==void 0&&clearTimeout(D),U=0,c=F=i=D=void 0}function se(){return D===void 0?P:Zt(A_())}function ce(){var oe=A_(),ye=wt(oe);if(c=arguments,i=this,F=oe,ye){if(D===void 0)return kt(F);if(at)return D=setTimeout(Lt,l),Tt(F)}return D===void 0&&(D=setTimeout(Lt,l)),P}return ce.cancel=Jt,ce.flush=se,ce}function QE(v,l,o){var c=!0,i=!0;if(typeof v!="function")throw new TypeError(n1);return Hm(o)&&(c="leading"in o?!!o.leading:c,i="trailing"in o?!!o.trailing:i),JE(v,l,{leading:c,maxWait:l,trailing:i})}function Hm(v){var l=typeof v;return!!v&&(l=="object"||l=="function")}function tS(v){return!!v&&typeof v=="object"}function eS(v){return typeof v=="symbol"||tS(v)&&KE.call(v)==UE}function i1(v){if(typeof v=="number")return v;if(eS(v))return r1;if(Hm(v)){var l=typeof v.valueOf=="function"?v.valueOf():v;v=Hm(l)?l+"":l}if(typeof v!="string")return v===0?v:+v;v=v.replace(NE,"");var o=GE.test(v);return o||jE.test(v)?qE(v.slice(2),o?2:8):VE.test(v)?r1:+v}o1.exports=QE});var tg={};Qg(tg,{CopyrightControl:()=>rx,Layer:()=>xa,MapboxLayer:()=>sp,MapboxStyleLayer:()=>H0,MaplibreLayer:()=>lp,RealtimeAPI:()=>qf,RealtimeLayer:()=>l1,RealtimeModes:()=>Zo,RoutingAPI:()=>Gf,RoutingControl:()=>j0,RoutingLayer:()=>$m,StopFinderControl:()=>Z0,StopsAPI:()=>jf,VectorLayer:()=>u1,WMSLayer:()=>c1,createTrackerFilters:()=>oy,fullTrajectoryDelayStyle:()=>s1,fullTrajectoryStyle:()=>Qm,getCircleCanvas:()=>Ay,getDelayBgCanvas:()=>Iy,getDelayTextCanvas:()=>Cy,getHoursAndMinutes:()=>bv,getLayersAsFlatArray:()=>Zf,getMapboxMapCopyrights:()=>fc,getMapboxRender:()=>Yp,getMaplibreRender:()=>Kp,getTextCanvas:()=>Py,getUTCDateString:()=>vv,getUTCTimeString:()=>xv,getUrlWithParams:()=>$h,pad:()=>mm,realtimeDefaultStyle:()=>Jh,realtimeDelayStyle:()=>My,realtimeSimpleStyle:()=>Ly,removeDuplicate:()=>Kh,renderTrajectories:()=>Xf,sortByDelay:()=>ay,trackerConfig:()=>Hp});var Z1=function(){function v(l){this.propagationStopped,this.defaultPrevented,this.type=l,this.target=null}return v.prototype.preventDefault=function(){this.defaultPrevented=!0},v.prototype.stopPropagation=function(){this.propagationStopped=!0},v}();var ss=Z1;var Bp={PROPERTYCHANGE:"propertychange"};var X1=function(){function v(){this.disposed=!1}return v.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},v.prototype.disposeInternal=function(){},v}(),uv=X1;function cv(v,l,o){for(var c,i,u=o||rh,P=0,D=v.length,F=!1;P<D;)c=P+(D-P>>1),i=+u(v[c],l),i<0?P=c+1:(D=c,F=!i);return F?P:~P}function rh(v,l){return v>l?1:v<l?-1:0}function hv(v,l){return v.indexOf(l)>=0}function pv(v,l,o){for(;l<o;){var c=v[l];v[l]=v[o],v[o]=c,++l,--o}}function Ua(v,l){for(var o=Array.isArray(l)?l:[l],c=o.length,i=0;i<c;i++)v[v.length]=o[i]}function ls(v,l){var o=v.length;if(o!==l.length)return!1;for(var c=0;c<o;c++)if(v[c]!==l[c])return!1;return!0}function um(){return!0}function Wh(){}function fv(v){var l=!1,o,c,i;return function(){var u=Array.prototype.slice.call(arguments);return(!l||this!==i||!ls(u,c))&&(l=!0,i=this,c=u,o=v.apply(this,arguments)),o}}var _a=typeof Object.assign=="function"?Object.assign:function(v,l){if(v==null)throw new TypeError("Cannot convert undefined or null to object");for(var o=Object(v),c=1,i=arguments.length;c<i;++c){var u=arguments[c];if(u!=null)for(var P in u)u.hasOwnProperty(P)&&(o[P]=u[P])}return o};function ih(v){for(var l in v)delete v[l]}var cm=typeof Object.values=="function"?Object.values:function(v){var l=[];for(var o in v)l.push(v[o]);return l};function Vl(v){var l;for(l in v)return!1;return!l}var W1=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),$1=function(v){W1(l,v);function l(o){var c=v.call(this)||this;return c.eventTarget_=o,c.pendingRemovals_=null,c.dispatching_=null,c.listeners_=null,c}return l.prototype.addEventListener=function(o,c){if(!(!o||!c)){var i=this.listeners_||(this.listeners_={}),u=i[o]||(i[o]=[]);u.indexOf(c)===-1&&u.push(c)}},l.prototype.dispatchEvent=function(o){var c=typeof o=="string",i=c?o:o.type,u=this.listeners_&&this.listeners_[i];if(!!u){var P=c?new ss(o):o;P.target||(P.target=this.eventTarget_||this);var D=this.dispatching_||(this.dispatching_={}),F=this.pendingRemovals_||(this.pendingRemovals_={});i in D||(D[i]=0,F[i]=0),++D[i];for(var U,N=0,at=u.length;N<at;++N)if("handleEvent"in u[N]?U=u[N].handleEvent(P):U=u[N].call(this,P),U===!1||P.propagationStopped){U=!1;break}if(--D[i]===0){var yt=F[i];for(delete F[i];yt--;)this.removeEventListener(i,Wh);delete D[i]}return U}},l.prototype.disposeInternal=function(){this.listeners_&&ih(this.listeners_)},l.prototype.getListeners=function(o){return this.listeners_&&this.listeners_[o]||void 0},l.prototype.hasListener=function(o){return this.listeners_?o?o in this.listeners_:Object.keys(this.listeners_).length>0:!1},l.prototype.removeEventListener=function(o,c){var i=this.listeners_&&this.listeners_[o];if(i){var u=i.indexOf(c);u!==-1&&(this.pendingRemovals_&&o in this.pendingRemovals_?(i[u]=Wh,++this.pendingRemovals_[o]):(i.splice(u,1),i.length===0&&delete this.listeners_[o]))}},l}(uv),nh=$1;var Vi={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function eo(v,l,o,c,i){if(c&&c!==v&&(o=o.bind(c)),i){var u=o;o=function(){v.removeEventListener(l,o),u.apply(this,arguments)}}var P={target:v,type:l,listener:o};return v.addEventListener(l,o),P}function Up(v,l,o,c){return eo(v,l,o,c,!0)}function To(v){v&&v.target&&(v.target.removeEventListener(v.type,v.listener),ih(v))}var K1=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),hm=function(v){K1(l,v);function l(){var o=v.call(this)||this;return o.on=o.onInternal,o.once=o.onceInternal,o.un=o.unInternal,o.revision_=0,o}return l.prototype.changed=function(){++this.revision_,this.dispatchEvent(Vi.CHANGE)},l.prototype.getRevision=function(){return this.revision_},l.prototype.onInternal=function(o,c){if(Array.isArray(o)){for(var i=o.length,u=new Array(i),P=0;P<i;++P)u[P]=eo(this,o[P],c);return u}else return eo(this,o,c)},l.prototype.onceInternal=function(o,c){var i;if(Array.isArray(o)){var u=o.length;i=new Array(u);for(var P=0;P<u;++P)i[P]=Up(this,o[P],c)}else i=Up(this,o,c);return c.ol_key=i,i},l.prototype.unInternal=function(o,c){var i=c.ol_key;if(i)Na(i);else if(Array.isArray(o))for(var u=0,P=o.length;u<P;++u)this.removeEventListener(o[u],c);else this.removeEventListener(o,c)},l}(nh);hm.prototype.on;hm.prototype.once;hm.prototype.un;function Na(v){if(Array.isArray(v))for(var l=0,o=v.length;l<o;++l)To(v[l]);else To(v)}var pm=hm;function Fr(){return function(){throw new Error("Unimplemented abstract method.")}()}var Y1=0;function wi(v){return v.ol_uid||(v.ol_uid=String(++Y1))}var fm="6.14.1";var mv=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),dv=function(v){mv(l,v);function l(o,c,i){var u=v.call(this,o)||this;return u.key=c,u.oldValue=i,u}return l}(ss);var H1=function(v){mv(l,v);function l(o){var c=v.call(this)||this;return c.on,c.once,c.un,wi(c),c.values_=null,o!==void 0&&c.setProperties(o),c}return l.prototype.get=function(o){var c;return this.values_&&this.values_.hasOwnProperty(o)&&(c=this.values_[o]),c},l.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},l.prototype.getProperties=function(){return this.values_&&_a({},this.values_)||{}},l.prototype.hasProperties=function(){return!!this.values_},l.prototype.notify=function(o,c){var i;i="change:".concat(o),this.hasListener(i)&&this.dispatchEvent(new dv(i,o,c)),i=Bp.PROPERTYCHANGE,this.hasListener(i)&&this.dispatchEvent(new dv(i,o,c))},l.prototype.addChangeListener=function(o,c){this.addEventListener("change:".concat(o),c)},l.prototype.removeChangeListener=function(o,c){this.removeEventListener("change:".concat(o),c)},l.prototype.set=function(o,c,i){var u=this.values_||(this.values_={});if(i)u[o]=c;else{var P=u[o];u[o]=c,P!==c&&this.notify(o,P)}},l.prototype.setProperties=function(o,c){for(var i in o)this.set(i,o[i],c)},l.prototype.applyProperties=function(o){!o.values_||_a(this.values_||(this.values_={}),o.values_)},l.prototype.unset=function(o,c){if(this.values_&&o in this.values_){var i=this.values_[o];delete this.values_[o],Vl(this.values_)&&(this.values_=null),c||this.notify(o,i)}},l}(pm),Io=H1;var J1=(v,l)=>{let o=new URL(v);return Object.entries(l||{}).forEach(([i,u])=>{u!=null&&o.searchParams.set(i,u)}),o},$h=J1;var ty=class extends Io{constructor(o){super();this.url=o.url,this.apiKey=o.apiKey}fetch(o,c,i){if(!this.url)return Promise.reject(new Error(`No url defined for request to ${this.url}/${o}`));if(!this.url&&!this.apiKey&&!/key=/.test(this.url))return Promise.reject(new Error(`No apiKey defined for request to ${this.url}`));let u=c||{},P=$h(`${this.url}${o||""}`,{key:this.apiKey,...u});return fetch(P.toString(),i).then(D=>{try{return D.json().then(F=>{if(F.error)throw new Error(F.error);return F})}catch(F){return Promise.reject(new Error(F))}})}},dm=ty;var ey=class extends dm{constructor(l){super({url:"https://api.geops.io/routing/v1/",...l})}route(l,o){return this.fetch("",l,o)}},Gf=ey;var ry=class extends dm{constructor(l={}){super({url:"https://api.geops.io/stops/v1/",...l})}search(l,o={}){return this.fetch("",l,{signal:o.signal})}},jf=ry;var Np=class{constructor(){this.defineProperties()}defineProperties(){Object.defineProperties(this,{closed:{get:()=>!!(this.websocket&&this.websocket.readyState===this.websocket.CLOSED)},closing:{get:()=>!!(this.websocket&&this.websocket.readyState===this.websocket.CLOSING)},connecting:{get:()=>!!(this.websocket&&this.websocket.readyState===this.websocket.CONNECTING)},open:{get:()=>!!(this.websocket&&this.websocket.readyState===this.websocket.OPEN)},messagesOnOpen:{value:[],writable:!0},subscriptions:{value:[],writable:!0},subscribed:{value:{},writable:!0}})}static getRequestString(l,o){let c=`${l} ${o.channel}`;return c+=o.args?` ${o.args}`:"",c+=o.id?` ${o.id}`:"",c.trim()}connect(l,o=()=>{}){this.websocket&&!this.closed&&this.websocket.close(),this.websocket=new WebSocket(l),this.open?(o(),this.subscribePreviousSubscriptions()):this.websocket.addEventListener("open",()=>{o(),this.subscribePreviousSubscriptions()})}close(){this.websocket&&(this.websocket.onclose=null,this.websocket.close(),this.websocket=null,this.messagesOnOpen=[])}send(l){if(!this.websocket)return;let o=()=>{this.websocket.send(l)};this.open?this.messagesOnOpen.includes(l)||o():this.messagesOnOpen.includes(l)||(this.messagesOnOpen.push(l),this.websocket.addEventListener("open",()=>{this.messagesOnOpen=[],o()}),this.websocket.addEventListener("close",()=>{this.messagesOnOpen=[]}))}listen(l,o,c){this.unlisten(l,o);let i=u=>{let P={};try{P=JSON.parse(u.data)}catch(U){console.error("WebSocket: unable to parse JSON data",U,u.data)}let D=l.channel;D+=l.args?` ${l.args}`:"",(P.source==="buffer"?P.content:[P]).forEach(U=>{U?.source===D&&(!l.id||l.id===P.client_reference)&&o(U)})};return this.websocket&&(this.websocket.addEventListener("message",i),c&&(this.websocket.addEventListener("error",c),this.websocket.addEventListener("close",c))),{onMessageCb:i,onErrorCb:c}}unlisten(l,o){!this.websocket||this.subscriptions.filter(c=>c.params.channel===l.channel&&(!o||c.cb===o)).forEach(({onMessageCb:c,onErrorCb:i})=>{this.websocket&&(this.websocket.removeEventListener("message",c),i&&(this.websocket.removeEventListener("error",i),this.websocket.removeEventListener("close",i)))})}get(l,o,c){let i=Np.getRequestString("GET",l);this.send(i),this.listen(l,o,c)}subscribe(l,o,c,i=!1){let{onMessageCb:u,onErrorCb:P}=this.listen(l,o,c),D=Np.getRequestString("",l),F=this.subscriptions.findIndex(N=>l.channel===N.params.channel&&o===N.cb),U={params:l,cb:o,errorCb:c,onMessageCb:u,onErrorCb:P,quiet:i};F>-1?this.subscriptions[F]=U:this.subscriptions.push(U),this.subscribed[D]||(U.quiet||(this.send(`GET ${D}`),this.send(`SUB ${D}`)),this.subscribed[D]=!0)}unsubscribe(l,o){let c=this.subscriptions.filter(i=>i.params.channel===l&&(!o||i.cb===o));c.forEach(({onMessageCb:i,onErrorCb:u})=>{this.websocket&&(this.websocket.removeEventListener("message",i),u&&(this.websocket.removeEventListener("error",u),this.websocket.removeEventListener("close",u)))}),this.subscriptions=this.subscriptions.filter(i=>i.params.channel!==l||o&&i.cb!==o),l&&this.subscribed[l]&&!this.subscriptions.find(i=>i.params.channel===l)&&c.find(i=>!i.quiet)&&(this.send(`DEL ${l}`),this.subscribed[l]=!1)}subscribePreviousSubscriptions(){Object.keys(this.subscribed).forEach(l=>{this.subscribed[l]=!1}),[...this.subscriptions].forEach(l=>{this.subscribe(l.params,l.cb,l.errorCb,l.quiet)})}},gv=Np;var Q1=v=>{if(!!v)return v.stations.forEach(l=>{l.arrivalTimeWithDelay=l.arrivalTime,l.departureTime&&(l.departureTimeWithDelay=l.departureTime),l.arrivalDelay&&(l.arrivalTime-=l.arrivalDelay,l.departureTime&&(l.departureTime-=l.arrivalDelay))}),v},iy=Q1;var tb=(v,l)=>v===l.SCHEMATIC?"_schematic":"",Tu=tb;var eb=(v,l,o=!1)=>{let c=["HIDDEN","LEAVING","BOARDING"],i=v.has_fzo&&c.indexOf(v.state)>-1,u=l.has_fzo&&c.indexOf(l.state)>-1;if(i||u){if(i!==u)return i?-1:1;if(v.state!==l.state)return c.indexOf(v.state)-c.indexOf(l.state)}let P=null,D=null,F=Date.now();return o?(P=new Date(v.min_arrival_time||v.time).getTime()-F,D=new Date(l.min_arrival_time||l.time).getTime()-F):(P=new Date(v.time).getTime()-F,D=new Date(l.time).getTime()-F),P-D},yv=eb;var Zo={RAW:"raw",TOPOGRAPHIC:"topographic",SCHEMATIC:"schematic"},ny=class{constructor(l={}){this.defineProperties(l),this.subscribedStationUic=null,this.departureUpdateTimeout=null,this.maxDepartureAge=30,this.extraGeoms={},this.prefix=l.prefix||"",this.onOpen=this.onOpen.bind(this)}defineProperties(l){let o=l;typeof l=="string"&&(o={url:l});let{apiKey:c}=o,{url:i,projection:u,bbox:P,buffer:D=[100,100]}=o,F=new gv;c&&(i=`${i||"wss://api.geops.io/tracker-ws/v1/"}?key=${c}`),Object.defineProperties(this,{url:{get:()=>i,set:U=>{i=U,this.open()}},projection:{get:()=>u,set:U=>{U!==u&&(u=U,this.wsApi&&this.wsApi.send(`PROJECTION ${u}`))}},bbox:{get:()=>P,set:U=>{JSON.stringify(U)!==JSON.stringify(P)&&(P=U,this.wsApi&&this.wsApi.send(`BBOX ${P.join(" ")}`))}},buffer:{get:()=>D,set:U=>{JSON.stringify(U)!==JSON.stringify(D)&&(D=U,this.wsApi&&this.wsApi.send(`BUFFER ${D.join(" ")}`))}},wsApi:{value:F,writable:!0},pingIntervalMs:{value:l.pingIntervalMs||1e4,writable:!0},reconnectTimeoutMs:{value:l.pingIntervalMs||100,writable:!0}})}open(){this.close(),this.wsApi.connect(this.url,this.onOpen),this.wsApi.websocket.onclose=()=>{this.onClose()}}close(){this.wsApi.close()}reset(){this.wsApi.send("RESET")}onOpen(){this.projection&&this.wsApi.send(`PROJECTION ${this.projection}`),this.bbox&&this.wsApi.send(`BBOX ${this.bbox.join(" ")}`),this.buffer&&this.wsApi.send(`BUFFER ${this.buffer.join(" ")}`),this.pingIntervalMs&&(window.clearInterval(this.pingInterval),this.pingInterval=setInterval(()=>{this.wsApi.send("PING")},this.pingIntervalMs))}onClose(){window.clearTimeout(this.pingInterval),window.clearTimeout(this.reconnectTimeout),this.reconnectTimeoutMs&&(this.reconnectTimeout=window.setTimeout(()=>this.open(),this.reconnectTimeoutMs))}subscribe(l,o,c,i=!1){this.wsApi.subscribe({channel:l},o,c,i)}unsubscribe(l,o,c){this.wsApi.unsubscribe(`${l}${Tu(Zo.SCHEMATIC,Zo)}${o}`,c),this.wsApi.unsubscribe(`${l}${Tu(Zo.TOPOGRAPHIC,Zo)}${o||""}`,c)}filterDepartures(l,o=!1){let c=Object.keys(l).map(U=>l[U]);c.sort((U,N)=>yv(U,N,o));let i=new Date;i.setMinutes(i.getMinutes()+this.maxDepartureAge),i=i.getTime();let u=new Date;u.setMinutes(u.getMinutes()-this.maxDepartureAge),u=u.getTime();let P=[],D=[],F=null;for(let U=c.length-1;U>=0;U-=1){let N=c[U],at=new Date(N.time).getTime();at>u&&at<i&&(N.state==="BOARDING"&&(D.indexOf(N.platform)===-1?D.push(N.platform):N.state="HIDDEN"),F&&N.to[0]===F.to[0]&&Math.abs(at-F.time)<1e3&&N.line.name===F.line.name&&(N.state="HIDDEN"),/(STOP_CANCELLED|JOURNEY_CANCELLED)/.test(N.state)&&(N.cancelled=!0),F=N,F.time=at,P.unshift(N))}return P}subscribeDepartures(l,o,c){window.clearTimeout(this.departureUpdateTimeout),this.unsubscribeDepartures(),this.subscribedStationUic=l;let i=l?`timetable_${l}`:null,u={};this.subscribe(i,P=>{if(P.source===i){let D=P.content||{},F=new Date(D.timestamp).getTime()-Date.now();D.timediff=F,u[D.call_id]=D,window.clearTimeout(this.departureUpdateTimeout),this.departureUpdateTimeout=window.setTimeout(()=>{let U=this.filterDepartures(u,o||!1);c(U)},100)}},()=>{c([])})}unsubscribeDepartures(l){this.subscribedStationUic&&(this.unsubscribe(`timetable_${this.subscribedStationUic}`,"",l),this.subscribedStationUic=null)}subscribeDisruptions(l){this.subscribe(`${this.prefix}newsticker`,o=>{l(o.content)})}unsubscribeDisruptions(l){this.unsubscribe(`${this.prefix}newsticker`,"",l)}getStation(l,o){let c={channel:`station${Tu(o,Zo)}`,args:l};return new Promise((i,u)=>{this.wsApi.get(c,P=>{P.content?i(P.content):u()})})}getStations(l){let o=[],c={channel:`station${Tu(l,Zo)}`};return window.clearTimeout(this.stationUpdateTimeout),new Promise((i,u)=>{this.wsApi.get(c,P=>{P.content?(o.push(P.content),window.clearTimeout(this.stationUpdateTimeout),this.stationUpdateTimeout=window.setTimeout(()=>{i(o)},50)):u(P.content)})})}subscribeStations(l,o){this.unsubscribeStations(),this.subscribe(`station${Tu(l,Zo)}`,c=>{c.content&&o(c.content)})}unsubscribeStations(l){window.clearTimeout(this.stationUpdateTimeout),this.unsubscribe("station","",l)}subscribeExtraGeoms(l){this.subscribe("extra_geoms",o=>{let c=o.content;if(c){let{ref:i}=c.properties;c.type==="Feature"?this.extraGeoms[i]=c:delete this.extraGeoms[i],l(Object.keys(this.extraGeoms).map(u=>this.extraGeoms[u]))}})}unsubscribeExtraGeoms(l){this.unsubscribe("extra_geoms","",l)}subscribeTrajectory(l,o,c=!1){this.unsubscribeTrajectory(o),this.subscribe(`trajectory${Tu(l,Zo)}`,o,null,c)}unsubscribeTrajectory(l){this.unsubscribe("trajectory","",l)}subscribeDeletedVehicles(l,o,c=!1){this.unsubscribeDeletedVehicles(o),this.subscribe(`deleted_vehicles${Tu(l,Zo)}`,o,null,c)}unsubscribeDeletedVehicles(l){this.unsubscribe("deleted_vehicles","",l)}getFullTrajectory(l,o,c){let i=[`full_trajectory${Tu(o,Zo)}`];l&&i.push(l),(!o||o===Zo.TOPOGRAPHIC)&&c&&i.push(`gen${c}`);let u={channel:i.join("_")};return new Promise(P=>{this.wsApi.get(u,D=>{D.content&&P(D.content)})})}getFullTrajectories(l,o,c){let i=l.map(u=>this.getFullTrajectory(u,o,c));return Promise.all(i)}subscribeFullTrajectory(l,o){this.unsubscribeFullTrajectory(l),this.subscribe(`full_trajectory${Tu(o,Zo)}_${l}`,c=>{console.log("subscribe full_trajectory",c)},c=>{console.log("subscribe full_trajectory error",c)})}unsubscribeFullTrajectory(l,o){this.unsubscribe("full_trajectory",`_${l}`,o)}getStopSequence(l){let o={channel:`stopsequence_${l}`};return new Promise((c,i)=>{this.wsApi.get(o,u=>{if(u.content&&u.content.length){let P=u.content.map(D=>iy(D));c(P)}c([])},u=>{i(u)})})}getStopSequences(l){let o=l.map(c=>this.getStopSequence(c));return Promise.all(o)}subscribeStopSequence(l,o){window.clearTimeout(this.fullTrajectoryUpdateTimeout),this.unsubscribeStopSequence(l),this.subscribe(`stopsequence_${l}`,c=>{if(c.content&&c.content.length){let i=c.content.map(u=>iy(u));o(i)}},c=>{console.log("subscribe stopsequence error",c)})}unsubscribeStopSequence(l,o){this.unsubscribe("stopsequence",`_${l}`,o)}subscribeHealthCheck(l){this.unsubscribeHealthCheck(),this.subscribe("healthcheck",l)}unsubscribeHealthCheck(){this.unsubscribe("healthcheck")}},qf=ny;var rb=v=>{let l=v.filter(u=>u!=null&&u.trim&&u.trim()),o=l.map(u=>u.toLowerCase());return[...new Set(o)].map(u=>l.find(P=>P.toLowerCase()===u))},Kh=rb;var ib=v=>{if(!v||!v.style)return[];let{sourceCaches:l}=v.style,o=[];return Object.values(l).forEach(c=>{if(c.used){let i=c.getSource(),u=i.attribution||i.options&&i.options.attribution;u&&(o=o.concat(u.replace(/&copy;/g,"\xA9").split(/(<a.*?<\/a>)/)))}}),Kh(o)},fc=ib;var nb=(v,l,o,c)=>{let i=[];if(!v&&!l&&!o&&!c)return null;if(c){let u=typeof c=="string"?[c]:c,P=D=>{let F=D.properties.name||D.properties.line&&D.properties.line.name||"";return F?u.some(U=>new RegExp(U,"i").test(F)):!1};i.push(P)}if(v){let P=(typeof v=="string"?v.split(","):v).map(F=>F.replace(/\s+/g,"").toUpperCase()),D=F=>{let{line:U,name:N}=F.properties,at=(N||U&&U.name||"").toUpperCase();return at?P.includes(at):!1};i.push(D)}if(l){let P=(typeof l=="string"?l.split(","):l).map(F=>parseInt(F,10)),D=F=>{let U=parseInt(F.properties.routeIdentifier.split(".")[0],10);return P.includes(U)};i.push(D)}if(o){let u=typeof o=="string"?[o]:o,P=D=>u.some(F=>new RegExp(F,"i").test(D.properties.operator));i.push(P)}return i.length?u=>{for(let P=0;P<i.length;P+=1)if(!i[P](u))return!1;return!0}:null},oy=nb;var _v=v=>{let l=v;Array.isArray(l)||(l=[v]);let o=[];return l.forEach(c=>{o.push(c);let{children:i}=c;o=o.concat(_v(i||[]))}),o},Zf=_v;var vv=(v=new Date)=>{let l=(v.getUTCMonth()+1).toString();l=l.length===1?`0${l}`:l;let o=v.getUTCDate().toString();return o=o.length===1?`0${o}`:o,[v.getUTCFullYear(),l,o].join("")},xv=v=>[v.getUTCHours(),v.getUTCMinutes(),`${v.getUTCSeconds()}.${v.getUTCMilliseconds()}`].join(":"),mm=v=>v<10?`0${v}`:v,bv=v=>{if(!v||v<=0)return"";let l=new Date(v);return`${mm(l.getHours())}:${mm(l.getMinutes())}`};var ob=(v,l)=>{let o=v.properties,c=l.properties;return o.delay===null&&c.delay!==null?1:c.delay===null&&o.delay!==null?-1:o.cancelled&&!c.cancelled?c.delay<18e4?-1:1:c.cancelled&&!o.cancelled?o.delay<18e4?1:-1:c.delay-o.delay},ay=ob;var oh=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",wT=oh.indexOf("firefox")!==-1,ab=oh.indexOf("safari")!==-1&&oh.indexOf("chrom")==-1,ET=ab&&!!(oh.indexOf("version/15.4")>=0||oh.match(/cpu (os|iphone os) 15_4 like mac os x/)),ST=oh.indexOf("webkit")!==-1&&oh.indexOf("edge")==-1,TT=oh.indexOf("macintosh")!==-1;var ah=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,wv=typeof Image<"u"&&Image.prototype.decode,IT=function(){var v=!1;try{var l=Object.defineProperty({},"passive",{get:function(){v=!0}});window.addEventListener("_",null,l),window.removeEventListener("_",null,l)}catch{}return v}();var sb=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),lb=function(v){sb(l,v);function l(o){var c=this,i=fm==="latest"?fm:"v"+fm.split("-")[0],u="Assertion failed. See https://openlayers.org/en/"+i+"/doc/errors/#"+o+" for details.";return c=v.call(this,u)||this,c.code=o,c.name="AssertionError",c.message=u,c}return l}(Error),gm=lb;function fn(v,l){if(!v)throw new gm(l)}var RT=new Array(6);function va(){return[1,0,0,1,0,0]}function ub(v,l,o,c,i,u,P){return v[0]=l,v[1]=o,v[2]=c,v[3]=i,v[4]=u,v[5]=P,v}function Sv(v,l){return v[0]=l[0],v[1]=l[1],v[2]=l[2],v[3]=l[3],v[4]=l[4],v[5]=l[5],v}function uo(v,l){var o=l[0],c=l[1];return l[0]=v[0]*o+v[2]*c+v[4],l[1]=v[1]*o+v[3]*c+v[5],l}function Tv(v,l,o){return ub(v,l,0,0,o,0,0)}function us(v,l,o,c,i,u,P,D){var F=Math.sin(u),U=Math.cos(u);return v[0]=c*U,v[1]=i*F,v[2]=-c*F,v[3]=i*U,v[4]=P*c*U-D*c*F+l,v[5]=P*i*F+D*i*U+o,v}function Iv(v,l,o,c,i,u,P){return sy(us(va(),v,l,o,c,i,u,P))}function Cv(v,l){var o=cb(l);fn(o!==0,32);var c=l[0],i=l[1],u=l[2],P=l[3],D=l[4],F=l[5];return v[0]=P/o,v[1]=-i/o,v[2]=-u/o,v[3]=c/o,v[4]=(u*F-P*D)/o,v[5]=-(c*F-i*D)/o,v}function cb(v){return v[0]*v[3]-v[1]*v[2]}var Ev;function sy(v){var l="matrix("+v.join(", ")+")";if(ah)return l;var o=Ev||(Ev=document.createElement("div"));return o.style.transform=l,o.style.transform}var Ie={POINT:"Point",LINE_STRING:"LineString",LINEAR_RING:"LinearRing",POLYGON:"Polygon",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon",GEOMETRY_COLLECTION:"GeometryCollection",CIRCLE:"Circle"};var hb=(v,l,o)=>{let{time_intervals:c,olGeometry:i,coordinate:u}=l.properties,P,D;if(o&&u)P=u;else if(i.getType()===Ie.POINT)P=i.getCoordinates();else if(i.getType()===Ie.LINE_STRING){let F=c||[[]],U=F[0],N=F[F.length-1];if(v<U[0])[,,D]=U,P=i.getFirstCoordinate();else if(v>N[0])[,,D]=N,P=i.getLastCoordinate();else for(let at=0;at<F.length-1;at+=1){let[yt,Tt]=F[at],[kt,Vt]=F[at+1];if(yt<=v&&v<=kt){let Lt=Math.min((v-yt)/(kt-yt),1)*(Vt-Tt)+Tt;P=i.getCoordinateAt(Lt),[,,D]=F[at];break}}}else console.error("This geometry type is not supported. Only Point or LineString are. Current geometry: ",i);return{coord:P,rotation:D}},Av=hb;var pb=(v,l,o,c,i)=>{if(!v)return{};let{time:u=Date.now(),size:P=[],center:D,resolution:F,rotation:U=0,pixelRatio:N}=c,{noInterpolate:at=!1,hoverVehicleId:yt,selectedVehicleId:Tt}=i,kt=v.getContext("2d");kt.clearRect(0,0,v.width,v.height);let[Vt,wt]=P;Vt&&wt&&(v.width!==Vt||v.height!==wt)&&([v.width,v.height]=[Vt*N,wt*N]);let Lt=us(va(),P[0]/2,P[1]/2,1/F,-1/F,-U,-D[0],-D[1]);v.style&&(v.style.width=`${v.width/N}px`,v.style.height=`${v.height/N}px`);let Zt,Jt,se,ce,oe,ye,be,Me,ir=[];for(let Be=l.length-1;Be>=0;Be-=1){let qe=l[Be],{train_id:rr,timeOffset:Ce}=qe.properties,{coord:Lr,rotation:yr}=Av(u-(Ce||0),qe,at);if(l[Be].properties.coordinate=Lr,l[Be].properties.rotation=yr,!Lr)continue;let _r=uo(Lt,[...Lr]);if(!_r||(_r=_r.map($r=>$r*N),_r[0]<0||_r[0]>v.width||_r[1]<0||_r[1]>v.height))continue;let br=o(qe,c,i);if(!br)continue;let xr=br.width,pr=br.height;yt!==rr&&Tt!==rr&&kt.drawImage(br,_r[0]-xr/2,_r[1]-pr/2,xr,pr),yt&&yt===rr&&(Zt=br,Jt=_r,se=xr,ce=pr),Tt&&Tt===rr&&(oe=br,ye=_r,be=xr,Me=pr),ir.push(qe)}return oe&&kt.drawImage(oe,ye[0]-be/2,ye[1]-Me/2,be,Me),Zt&&kt.drawImage(Zt,Jt[0]-se/2,Jt[1]-ce/2,se,ce),{renderedTrajectories:ir}},Xf=pb;var Gl={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},GT={9001:Gl.METERS,9002:Gl.FEET,9003:Gl.USFEET,9101:Gl.RADIANS,9102:Gl.DEGREES};var Iu={};Iu[Gl.RADIANS]=6370997/(2*Math.PI);Iu[Gl.DEGREES]=2*Math.PI*6370997/360;Iu[Gl.FEET]=.3048;Iu[Gl.METERS]=1;Iu[Gl.USFEET]=1200/3937;var dc=Gl;var fb=function(){function v(l){this.code_=l.code,this.units_=l.units,this.extent_=l.extent!==void 0?l.extent:null,this.worldExtent_=l.worldExtent!==void 0?l.worldExtent:null,this.axisOrientation_=l.axisOrientation!==void 0?l.axisOrientation:"enu",this.global_=l.global!==void 0?l.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=l.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=l.metersPerUnit}return v.prototype.canWrapX=function(){return this.canWrapX_},v.prototype.getCode=function(){return this.code_},v.prototype.getExtent=function(){return this.extent_},v.prototype.getUnits=function(){return this.units_},v.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Iu[this.units_]},v.prototype.getWorldExtent=function(){return this.worldExtent_},v.prototype.getAxisOrientation=function(){return this.axisOrientation_},v.prototype.isGlobal=function(){return this.global_},v.prototype.setGlobal=function(l){this.global_=l,this.canWrapX_=!!(l&&this.extent_)},v.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},v.prototype.setDefaultTileGrid=function(l){this.defaultTileGrid_=l},v.prototype.setExtent=function(l){this.extent_=l,this.canWrapX_=!!(this.global_&&l)},v.prototype.setWorldExtent=function(l){this.worldExtent_=l},v.prototype.setGetPointResolution=function(l){this.getPointResolutionFunc_=l},v.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},v}(),ym=fb;function jl(v,l,o){return Math.min(Math.max(v,l),o)}var Pv=function(){var v;return"cosh"in Math?v=Math.cosh:v=function(l){var o=Math.exp(l);return(o+1/o)/2},v}(),XT=function(){var v;return"log2"in Math?v=Math.log2:v=function(l){return Math.log(l)*Math.LOG2E},v}();function Mv(v,l,o,c,i,u){var P=i-o,D=u-c;if(P!==0||D!==0){var F=((v-o)*P+(l-c)*D)/(P*P+D*D);F>1?(o=i,c=u):F>0&&(o+=P*F,c+=D*F)}return ql(v,l,o,c)}function ql(v,l,o,c){var i=o-v,u=c-l;return i*i+u*u}function Lv(v){return v*180/Math.PI}function _m(v,l){var o=v%l;return o*l<0?o+l:o}function el(v,l,o){return v+o*(l-v)}var db=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),Wf=6378137,Gp=Math.PI*Wf,mb=[-Gp,-Gp,Gp,Gp],gb=[-180,-85,180,85],vm=Wf*Math.log(Math.tan(Math.PI/2)),Vp=function(v){db(l,v);function l(o){return v.call(this,{code:o,units:dc.METERS,extent:mb,global:!0,worldExtent:gb,getPointResolution:function(c,i){return c/Pv(i[1]/Wf)}})||this}return l}(ym),ly=[new Vp("EPSG:3857"),new Vp("EPSG:102100"),new Vp("EPSG:102113"),new Vp("EPSG:900913"),new Vp("http://www.opengis.net/def/crs/EPSG/0/3857"),new Vp("http://www.opengis.net/gml/srs/epsg.xml#3857")];function kv(v,l,o){var c=v.length,i=o>1?o:2,u=l;u===void 0&&(i>2?u=v.slice():u=new Array(c));for(var P=0;P<c;P+=i){u[P]=Gp*v[P]/180;var D=Wf*Math.log(Math.tan(Math.PI*(+v[P+1]+90)/360));D>vm?D=vm:D<-vm&&(D=-vm),u[P+1]=D}return u}function zv(v,l,o){var c=v.length,i=o>1?o:2,u=l;u===void 0&&(i>2?u=v.slice():u=new Array(c));for(var P=0;P<c;P+=i)u[P]=180*v[P]/Gp,u[P+1]=360*Math.atan(Math.exp(v[P+1]/Wf))/Math.PI-90;return u}var yb=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),_b=6378137,Rv=[-180,-90,180,90],vb=Math.PI*_b/180,Yh=function(v){yb(l,v);function l(o,c){return v.call(this,{code:o,units:dc.DEGREES,extent:Rv,axisOrientation:c,global:!0,metersPerUnit:vb,worldExtent:Rv})||this}return l}(ym),uy=[new Yh("CRS:84"),new Yh("EPSG:4326","neu"),new Yh("urn:ogc:def:crs:OGC:1.3:CRS84"),new Yh("urn:ogc:def:crs:OGC:2:84"),new Yh("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Yh("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Yh("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];var cy={};function Dv(v){return cy[v]||cy[v.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function Ov(v,l){cy[v]=l}var jp={};function $f(v,l,o){var c=v.getCode(),i=l.getCode();c in jp||(jp[c]={}),jp[c][i]=o}function Fv(v,l){var o;return v in jp&&l in jp[v]&&(o=jp[v][l]),o}var Co={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Cu(v){for(var l=Va(),o=0,c=v.length;o<c;++o)hy(l,v[o]);return l}function xb(v,l,o){var c=Math.min.apply(null,v),i=Math.min.apply(null,l),u=Math.max.apply(null,v),P=Math.max.apply(null,l);return sh(c,i,u,P,o)}function rl(v,l,o){return o?(o[0]=v[0]-l,o[1]=v[1]-l,o[2]=v[2]+l,o[3]=v[3]+l,o):[v[0]-l,v[1]-l,v[2]+l,v[3]+l]}function Bv(v,l){return l?(l[0]=v[0],l[1]=v[1],l[2]=v[2],l[3]=v[3],l):v.slice()}function cs(v,l,o){var c,i;return l<v[0]?c=v[0]-l:v[2]<l?c=l-v[2]:c=0,o<v[1]?i=v[1]-o:v[3]<o?i=o-v[3]:i=0,c*c+i*i}function qp(v,l){return Kf(v,l[0],l[1])}function mc(v,l){return v[0]<=l[0]&&l[2]<=v[2]&&v[1]<=l[1]&&l[3]<=v[3]}function Kf(v,l,o){return v[0]<=l&&l<=v[2]&&v[1]<=o&&o<=v[3]}function xm(v,l){var o=v[0],c=v[1],i=v[2],u=v[3],P=l[0],D=l[1],F=Co.UNKNOWN;return P<o?F=F|Co.LEFT:P>i&&(F=F|Co.RIGHT),D<c?F=F|Co.BELOW:D>u&&(F=F|Co.ABOVE),F===Co.UNKNOWN&&(F=Co.INTERSECTING),F}function Va(){return[1/0,1/0,-1/0,-1/0]}function sh(v,l,o,c,i){return i?(i[0]=v,i[1]=l,i[2]=o,i[3]=c,i):[v,l,o,c]}function Zp(v){return sh(1/0,1/0,-1/0,-1/0,v)}function Xp(v,l){var o=v[0],c=v[1];return sh(o,c,o,c,l)}function bm(v,l,o,c,i){var u=Zp(i);return py(u,v,l,o,c)}function wm(v,l){return v[0]==l[0]&&v[2]==l[2]&&v[1]==l[1]&&v[3]==l[3]}function Uv(v,l){return l[0]<v[0]&&(v[0]=l[0]),l[2]>v[2]&&(v[2]=l[2]),l[1]<v[1]&&(v[1]=l[1]),l[3]>v[3]&&(v[3]=l[3]),v}function hy(v,l){l[0]<v[0]&&(v[0]=l[0]),l[0]>v[2]&&(v[2]=l[0]),l[1]<v[1]&&(v[1]=l[1]),l[1]>v[3]&&(v[3]=l[1])}function py(v,l,o,c,i){for(;o<c;o+=i)bb(v,l[o],l[o+1]);return v}function bb(v,l,o){v[0]=Math.min(v[0],l),v[1]=Math.min(v[1],o),v[2]=Math.max(v[2],l),v[3]=Math.max(v[3],o)}function Nv(v,l){var o;return o=l(fy(v)),o||(o=l(dy(v)),o)||(o=l(gy(v)),o)||(o=l(my(v)),o)?o:!1}function fy(v){return[v[0],v[1]]}function dy(v){return[v[2],v[1]]}function Hh(v){return[(v[0]+v[2])/2,(v[1]+v[3])/2]}function Au(v){return v[3]-v[1]}function Vv(v,l,o){var c=o||Va();return Ao(v,l)?(v[0]>l[0]?c[0]=v[0]:c[0]=l[0],v[1]>l[1]?c[1]=v[1]:c[1]=l[1],v[2]<l[2]?c[2]=v[2]:c[2]=l[2],v[3]<l[3]?c[3]=v[3]:c[3]=l[3]):Zp(c),c}function my(v){return[v[0],v[3]]}function gy(v){return[v[2],v[3]]}function hs(v){return v[2]-v[0]}function Ao(v,l){return v[0]<=l[2]&&v[2]>=l[0]&&v[1]<=l[3]&&v[3]>=l[1]}function Gv(v,l){return l?(l[0]=v[0],l[1]=v[1],l[2]=v[2],l[3]=v[3],l):v}function jv(v,l,o){var c=!1,i=xm(v,l),u=xm(v,o);if(i===Co.INTERSECTING||u===Co.INTERSECTING)c=!0;else{var P=v[0],D=v[1],F=v[2],U=v[3],N=l[0],at=l[1],yt=o[0],Tt=o[1],kt=(Tt-at)/(yt-N),Vt=void 0,wt=void 0;!!(u&Co.ABOVE)&&!(i&Co.ABOVE)&&(Vt=yt-(Tt-U)/kt,c=Vt>=P&&Vt<=F),!c&&!!(u&Co.RIGHT)&&!(i&Co.RIGHT)&&(wt=Tt-(yt-F)*kt,c=wt>=D&&wt<=U),!c&&!!(u&Co.BELOW)&&!(i&Co.BELOW)&&(Vt=yt-(Tt-D)/kt,c=Vt>=P&&Vt<=F),!c&&!!(u&Co.LEFT)&&!(i&Co.LEFT)&&(wt=Tt-(yt-P)*kt,c=wt>=D&&wt<=U)}return c}function qv(v,l,o,c){var i=[];if(c>1)for(var u=v[2]-v[0],P=v[3]-v[1],D=0;D<c;++D)i.push(v[0]+u*D/c,v[1],v[2],v[1]+P*D/c,v[2]-u*D/c,v[3],v[0],v[3]-P*D/c);else i=[v[0],v[1],v[2],v[1],v[2],v[3],v[0],v[3]];l(i,i,2);for(var F=[],U=[],D=0,N=i.length;D<N;D+=2)F.push(i[D]),U.push(i[D+1]);return xb(F,U,o)}function Zv(v,l){var o=l.getExtent(),c=Hh(v);if(l.canWrapX()&&(c[0]<o[0]||c[0]>=o[2])){var i=hs(o),u=Math.floor((c[0]-o[0])/i),P=u*i;v[0]-=P,v[2]-=P}return v}function yy(v,l){var o=v[0],c=v[1],i=l[0],u=l[1],P=i[0],D=i[1],F=u[0],U=u[1],N=F-P,at=U-D,yt=N===0&&at===0?0:(N*(o-P)+at*(c-D))/(N*N+at*at||0),Tt,kt;return yt<=0?(Tt=P,kt=D):yt>=1?(Tt=F,kt=U):(Tt=P+yt*N,kt=D+yt*at),[Tt,kt]}function Pu(v,l){for(var o=!0,c=v.length-1;c>=0;--c)if(v[c]!=l[c]){o=!1;break}return o}function Wp(v,l){var o=v[0]-l[0],c=v[1]-l[1];return o*o+c*c}function _y(v,l){return Math.sqrt(Wp(v,l))}function Xv(v,l){return Wp(v,yy(v,l))}function Wv(v,l){if(l.canWrapX()){var o=hs(l.getExtent()),c=$v(v,l,o);c&&(v[0]-=c*o)}return v}function $v(v,l,o){var c=l.getExtent(),i=0;if(l.canWrapX()&&(v[0]<c[0]||v[0]>c[2])){var u=o||hs(c);i=Math.floor((v[0]-c[0])/u)}return i}var vy=!0;function wb(v){var l=v===void 0?!0:v;vy=!l}function xy(v,l,o){var c;if(l!==void 0){for(var i=0,u=v.length;i<u;++i)l[i]=v[i];c=l}else c=v.slice();return c}function Eb(v,l,o){if(l!==void 0&&v!==l){for(var c=0,i=v.length;c<i;++c)l[c]=v[c];v=l}return v}function Sb(v){Ov(v.getCode(),v),$f(v,v,xy)}function Tb(v){v.forEach(Sb)}function ta(v){return typeof v=="string"?Dv(v):v||null}function Kv(v){Tb(v),v.forEach(function(l){v.forEach(function(o){l!==o&&$f(l,o,xy)})})}function Ib(v,l,o,c){v.forEach(function(i){l.forEach(function(u){$f(i,u,o),$f(u,i,c)})})}function ro(v,l){return wb(),Sm(v,"EPSG:4326",l!==void 0?l:"EPSG:3857")}function lh(v,l){var o=Sm(v,l!==void 0?l:"EPSG:3857","EPSG:4326"),c=o[0];return(c<-180||c>180)&&(o[0]=_m(c+180,360)-180),o}function Yv(v,l){if(v===l)return!0;var o=v.getUnits()===l.getUnits();if(v.getCode()===l.getCode())return o;var c=Em(v,l);return c===xy&&o}function Em(v,l){var o=v.getCode(),c=l.getCode(),i=Fv(o,c);return i||(i=Eb),i}function Yf(v,l){var o=ta(v),c=ta(l);return Em(o,c)}function Sm(v,l,o){var c=Yf(l,o);return c(v,void 0,v.length)}function Hf(v,l,o,c){var i=Yf(l,o);return qv(v,i,void 0,c)}var Zl=null;function uh(){return Zl}function by(v,l){return Zl?Sm(v,l,Zl):v}function Xl(v,l){return Zl?Sm(v,Zl,l):(vy&&!Pu(v,[0,0])&&v[0]>=-180&&v[0]<=180&&v[1]>=-90&&v[1]<=90&&(vy=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),v)}function $p(v,l){return Zl?Hf(v,l,Zl):v}function Jf(v,l){return Zl?Hf(v,Zl,l):v}function Hv(v,l){if(!Zl)return v;var o=ta(l).getUnits(),c=Zl.getUnits();return o&&c?v*Iu[o]/Iu[c]:v}function Cb(){Kv(ly),Kv(uy),Ib(uy,ly,kv,zv)}Cb();function Kp(v){return l=>{let{map:o,mbMap:c,olLayer:i}=v;if(!o||!c)return null;let u=c.getCanvas(),{viewState:P}=l,D=i.getOpacity();return u.style.opacity=D,c.jumpTo({center:lh(P.center),zoom:P.zoom-1,bearing:Lv(-P.rotation),animate:!1}),u.isConnected?(u.width!==l.size[0]||u.height!==l.size[1])&&c.resize():o.render(),c.redraw(),c.getContainer()}}function Yp(v){return l=>{let{map:o,mbMap:c,renderState:i,olLayer:u}=v;if(!o||!c)return null;let P=!1,D=c.getCanvas(),{viewState:F}=l,U=u.getVisible();i.visible!==U&&(D.style.display=U?"block":"none",i.visible=U,D.style.position="absolute");let N=u.getOpacity();i.opacity!==N&&(D.style.opacity=N,i.opacity=N);let{rotation:at}=F;i.rotation!==at&&(c.rotateTo(-(at||0)*180/Math.PI,{animate:!1}),P=!0,i.rotation=at),(i.zoom!==F.zoom||i.center[0]!==F.center[0]||i.center[1]!==F.center[1])&&(c.jumpTo({center:lh(F.center),zoom:F.zoom-1,animate:!1}),P=!0,i.zoom=F.zoom,i.center=F.center);let yt=o.getSize();if((i.size[0]!==yt[0]||i.size[1]!==yt[1])&&(P=!0,i.size=yt),c&&c.style&&c.isStyleLoaded()&&P)try{c._frame&&(c._frame.cancel(),c._frame=null),c._render()}catch(Tt){console.warn(Tt)}return c.getContainer()}}var Hp={};Qg(Hp,{bgColors:()=>Qv,getBgColor:()=>Mb,getDelayColor:()=>zb,getDelayText:()=>Rb,getRadius:()=>Pb,getTextColor:()=>Lb,getTextSize:()=>kb,getTypeIndex:()=>Tm,textColors:()=>tx,types:()=>Jv});var Ab={0:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],1:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],2:[0,0,0,0,0,2,2,3,7,7,7,12,15,15,15,15,15],3:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],4:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],5:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],6:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],7:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],8:[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],9:[0,0,0,0,0,2,2,3,7,7,7,12,15,15,15,15,15]},Jv=[/^Tram/i,/^Subway( \/ Metro \/ S-Bahn)?/i,/^Train/i,/^Bus/i,/^Ferry/i,/^Cable ?Car/i,/^Gondola/i,/^Funicular/i,/^(Long distance bus|coach)/i,/^Rail/i],Qv=["#ffb400","#ff5400","#ff8080","#ea0000","#3000ff","#ffb400","#41a27b","#00d237","#b5b5b5","#ff8080"],tx=["#000000","#ffffff","#000000","#ffffff","#ffffff","#000000","#ffffff","#000000","#000000","#000000"],Tm=v=>typeof v=="string"?Jv.findIndex(l=>l.test(v)):v,Pb=(v,l)=>{try{let o=Tm(v||0);return Ab[o][l]}catch{return 1}},Mb=(v=0)=>{try{let l=Tm(v);return Qv[l]}catch{return 1}},Lb=(v=0)=>{try{let l=Tm(v);return tx[l]}catch{return 1}},kb=(v,l,o,c)=>{v.font=`bold ${c}px Arial`;let i=v.measureText(o),u=25,P=0;for(;i.width>l-6&&P<u;)c-=.5,v.font=`bold ${c}px arial, sans-serif`,i=v.measureText(o),P+=1;return c},zb=(v,l,o)=>l?o?"#ff0000":"#a0a0a0":v>=36e5?"#ed004c":v>=5e5?"#e80000":v>=3e5?"#ff4a00":v>=18e4?"#f7bf00":v===null?"#a0a0a0":"#00a00c",Rb=(v,l)=>l?String.fromCodePoint(215):v>36e5?`+${Math.round(v/36e5)}h`:v>59e3?`+${Math.round(v/6e4)}m`:v>0?`+${v}s`:"";var Db=(v,l)=>{let o=null;return typeof window>"u"?null:(document?.createElement?(o=document.createElement("canvas"),o.width=v,o.height=l):OffscreenCanvas?o=new OffscreenCanvas(v,l):console.error("We didn't find a way to create a canvas element, document.createElement('canvas') and new OffscrenCanvas() are not supported"),o)},Jp=Db;var wy={},Iy=(v,l,o)=>{let c=`${v}, ${l}, ${o}`;if(!wy[c]){let i=Jp(v*2,v*2);if(i){let u=i.getContext("2d");u.beginPath(),u.arc(v,v,l,0,2*Math.PI,!1),u.fillStyle=o,u.filter="blur(1px)",u.fill(),wy[c]=i}}return wy[c]},Ey={},Cy=(v,l,o,c,i,u="#000",P=1)=>{let D=`${v}, ${l}, ${c}, ${i}, ${u}, ${P}`;if(!Ey[D]){let F=Jp(v,o+8*P);if(F){let U=F.getContext("2d");U.textAlign="left",U.textBaseline="middle",U.font=c,U.fillStyle=i,U.strokeStyle=u,U.lineWidth=1.5*P;let N=l;U.strokeText(N,0,o),U.fillText(N,0,o),Ey[D]=F}}return Ey[D]},Sy={},Ay=(v,l,o,c,i,u)=>{let P=`${v}, ${l}, ${o}, ${c}, ${i}, ${u}`;if(!Sy[P]){let D=Jp(v*2,v*2);if(D){let F=D.getContext("2d");F.fillStyle=o,c&&(F.lineWidth=1*u,F.strokeStyle="#000000"),F.beginPath(),F.arc(v,v,l,0,2*Math.PI,!1),F.fill(),i&&F.setLineDash([5,3]),c&&F.stroke(),Sy[P]=D}}return Sy[P]},Ty={},Py=(v,l,o,c,i,u,P)=>{let D=`${v}, ${l}, ${o}, ${c},${i}, ${u}, ${P}`;if(!Ty[D]){let F=Jp(l*2,l*2);if(F){let U=F.getContext("2d");u&&(U.save(),U.textBaseline="middle",U.textAlign="center",U.font=`bold ${o+2}px Arial`,U.strokeStyle=i,U.strokeText(v,l,l),U.restore()),U.textBaseline="middle",U.textAlign="center",U.fillStyle=c,U.font=`bold ${o}px Arial`,U.strokeStyle=i,U.strokeText(v,l,l),U.fillText(v,l,l),Ty[D]=F}}return Ty[D]},Im={},Ob=(v,l,o)=>{let{hoverVehicleId:c,selectedVehicleId:i,useDelayStyle:u,delayOutlineColor:P="#000",delayDisplay:D=3e5,getRadius:F,getBgColor:U,getDelayColor:N,getDelayText:at,getTextColor:yt,getTextSize:Tt}=o,{zoom:kt,pixelRatio:Vt}=l,{type:wt,cancelled:Lt}=v.properties,{train_id:Zt,line:Jt,delay:se,state:ce,operator_provides_realtime_journey:oe}=v.properties,{name:ye,text_color:be,color:Me}=Jt||{};Lt=Lt===!0||ce==="JOURNEY_CANCELLED",wt||(wt="Rail"),ye||(ye="I"),be||(be="#000000"),Me&&Me[0]!=="#"&&(Me=`#${Me}`),be[0]!=="#"&&(be=`#${be}`);let ir=Math.min(Math.floor(kt||1),16),Be=c&&c===Zt,qe=i&&i===Zt,rr=F(wt,ir)*Vt,Ce=rr>=7*Vt;(Be||qe)&&(rr=Ce?rr+5*Vt:14*Vt);let Lr=rr>10*Vt,yr=`${rr}${Be}${qe}${Lt}${se}`;if(u?yr+=`${oe}`:yr+=`${wt}${Me}`,Lr&&(yr+=`${ye}${be}`),!Im[yr]){if(rr===0)return Im[yr]=null,null;let _r=1*Vt,br=rr+2,xr=rr*2,pr=br*2+_r*2+100*Vt,$r=pr/2,Fe=Jp(pr,pr);if(Fe){let ti=Fe.getContext("2d");if(Ce&&se!==null){let Di=Iy($r,br,N(se,Lt));ti.drawImage(Di,0,0)}if(Ce&&(Be||se>=D||Lt)){let Di=Math.max(Lt?19:14,Math.min(Lt?19:17,rr*1.2))*Vt,vn=at(se,Lt);if(vn){let sn=vn.length*Di,dr=Cy(sn,vn,Di,`bold ${Di}px arial, sans-serif`,N(se,Lt,!0),P,Vt);ti.drawImage(dr,$r+br+_r,$r-Di)}}let oi;u?oi=N(se,Lt):oi=Me||U(wt);let Wr=Ay($r,rr,oi,Ce||Be||qe,Ce&&u&&se===null&&oe==="yes",Vt);if(ti.drawImage(Wr,0,0),Lr){let Di=Math.max(rr,10),vn=Tt(ti,xr,ye,Di),sn=u?"#000000":be||yt(wt),xn=Py(ye,$r,vn,sn,oi,u&&se===null&&oe==="yes",Vt);ti.drawImage(xn,0,0)}Im[yr]=Fe}}return Im[yr]},Jh=Ob;var Fb=(v,l,o)=>Jh(v,l,{...o,useDelayStyle:!0}),My=Fb;var Qf,Bb=()=>{if(!Qf){document.createElement("canvas"),Qf.width=15,Qf.height=15;let v=Qf.getContext("2d");v.arc(8,8,5,0,2*Math.PI,!1),v.fillStyle="#8ED6FF",v.fill(),v.lineWidth=3,v.strokeStyle="black",v.stroke(),v.lineWidth=3}return Qf},Ly=Bb;var Gi={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"};var Ub=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),Nb=function(v){Ub(l,v);function l(o){var c=v.call(this)||this;c.on,c.once,c.un,c.background_=o.background;var i=_a({},o);return typeof o.properties=="object"&&(delete i.properties,_a(i,o.properties)),i[Gi.OPACITY]=o.opacity!==void 0?o.opacity:1,fn(typeof i[Gi.OPACITY]=="number",64),i[Gi.VISIBLE]=o.visible!==void 0?o.visible:!0,i[Gi.Z_INDEX]=o.zIndex,i[Gi.MAX_RESOLUTION]=o.maxResolution!==void 0?o.maxResolution:1/0,i[Gi.MIN_RESOLUTION]=o.minResolution!==void 0?o.minResolution:0,i[Gi.MIN_ZOOM]=o.minZoom!==void 0?o.minZoom:-1/0,i[Gi.MAX_ZOOM]=o.maxZoom!==void 0?o.maxZoom:1/0,c.className_=i.className!==void 0?i.className:"ol-layer",delete i.className,c.setProperties(i),c.state_=null,c}return l.prototype.getBackground=function(){return this.background_},l.prototype.getClassName=function(){return this.className_},l.prototype.getLayerState=function(o){var c=this.state_||{layer:this,managed:o===void 0?!0:o},i=this.getZIndex();return c.opacity=jl(Math.round(this.getOpacity()*100)/100,0,1),c.visible=this.getVisible(),c.extent=this.getExtent(),c.zIndex=i===void 0&&!c.managed?1/0:i,c.maxResolution=this.getMaxResolution(),c.minResolution=Math.max(this.getMinResolution(),0),c.minZoom=this.getMinZoom(),c.maxZoom=this.getMaxZoom(),this.state_=c,c},l.prototype.getLayersArray=function(o){return Fr()},l.prototype.getLayerStatesArray=function(o){return Fr()},l.prototype.getExtent=function(){return this.get(Gi.EXTENT)},l.prototype.getMaxResolution=function(){return this.get(Gi.MAX_RESOLUTION)},l.prototype.getMinResolution=function(){return this.get(Gi.MIN_RESOLUTION)},l.prototype.getMinZoom=function(){return this.get(Gi.MIN_ZOOM)},l.prototype.getMaxZoom=function(){return this.get(Gi.MAX_ZOOM)},l.prototype.getOpacity=function(){return this.get(Gi.OPACITY)},l.prototype.getSourceState=function(){return Fr()},l.prototype.getVisible=function(){return this.get(Gi.VISIBLE)},l.prototype.getZIndex=function(){return this.get(Gi.Z_INDEX)},l.prototype.setBackground=function(o){this.background_=o,this.changed()},l.prototype.setExtent=function(o){this.set(Gi.EXTENT,o)},l.prototype.setMaxResolution=function(o){this.set(Gi.MAX_RESOLUTION,o)},l.prototype.setMinResolution=function(o){this.set(Gi.MIN_RESOLUTION,o)},l.prototype.setMaxZoom=function(o){this.set(Gi.MAX_ZOOM,o)},l.prototype.setMinZoom=function(o){this.set(Gi.MIN_ZOOM,o)},l.prototype.setOpacity=function(o){fn(typeof o=="number",64),this.set(Gi.OPACITY,o)},l.prototype.setVisible=function(o){this.set(Gi.VISIBLE,o)},l.prototype.setZIndex=function(o){this.set(Gi.Z_INDEX,o)},l.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),v.prototype.disposeInternal.call(this)},l}(Io),Cm=Nb;var td={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};var Mu={UNDEFINED:"undefined",LOADING:"loading",READY:"ready",ERROR:"error"};var Vb=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),Gb=function(v){Vb(l,v);function l(o){var c=this,i=_a({},o);delete i.source,c=v.call(this,i)||this,c.on,c.once,c.un,c.mapPrecomposeKey_=null,c.mapRenderKey_=null,c.sourceChangeKey_=null,c.renderer_=null,c.rendered=!1,o.render&&(c.render=o.render),o.map&&c.setMap(o.map),c.addChangeListener(Gi.SOURCE,c.handleSourcePropertyChange_);var u=o.source?o.source:null;return c.setSource(u),c}return l.prototype.getLayersArray=function(o){var c=o||[];return c.push(this),c},l.prototype.getLayerStatesArray=function(o){var c=o||[];return c.push(this.getLayerState()),c},l.prototype.getSource=function(){return this.get(Gi.SOURCE)||null},l.prototype.getRenderSource=function(){return this.getSource()},l.prototype.getSourceState=function(){var o=this.getSource();return o?o.getState():Mu.UNDEFINED},l.prototype.handleSourceChange_=function(){this.changed()},l.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(To(this.sourceChangeKey_),this.sourceChangeKey_=null);var o=this.getSource();o&&(this.sourceChangeKey_=eo(o,Vi.CHANGE,this.handleSourceChange_,this)),this.changed()},l.prototype.getFeatures=function(o){return this.renderer_?this.renderer_.getFeatures(o):new Promise(function(c){return c([])})},l.prototype.getData=function(o){return!this.renderer_||!this.rendered?null:this.renderer_.getData(o)},l.prototype.render=function(o,c){var i=this.getRenderer();if(i.prepareFrame(o))return this.rendered=!0,i.renderFrame(o,c)},l.prototype.unrender=function(){this.rendered=!1},l.prototype.setMapInternal=function(o){o||this.unrender(),this.set(Gi.MAP,o)},l.prototype.getMapInternal=function(){return this.get(Gi.MAP)},l.prototype.setMap=function(o){this.mapPrecomposeKey_&&(To(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),o||this.changed(),this.mapRenderKey_&&(To(this.mapRenderKey_),this.mapRenderKey_=null),o&&(this.mapPrecomposeKey_=eo(o,td.PRECOMPOSE,function(c){var i=c,u=i.frameState.layerStatesArray,P=this.getLayerState(!1);fn(!u.some(function(D){return D.layer===P.layer}),67),u.push(P)},this),this.mapRenderKey_=eo(this,Vi.CHANGE,o.render,o),this.changed())},l.prototype.setSource=function(o){this.set(Gi.SOURCE,o)},l.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},l.prototype.hasRenderer=function(){return!!this.renderer_},l.prototype.createRenderer=function(){return null},l.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),v.prototype.disposeInternal.call(this)},l}(Cm);function ex(v,l){if(!v.visible)return!1;var o=l.resolution;if(o<v.minResolution||o>=v.maxResolution)return!1;var c=l.zoom;return c>v.minZoom&&c<=v.maxZoom}var Qh=Gb;var ky=class extends Io{constructor(l={}){super(l),this.defineProperties(l);let{active:o}={active:l.active!==!1,...l};this.active=o}defineProperties(l){let{target:o,element:c,render:i}={...l};Object.defineProperties(this,{active:{get:()=>this.get("active"),set:u=>{this.set("active",u),u?this.activate():this.deactivate(),this.render()}},map:{get:()=>this.get("map"),set:u=>{if(this.map&&this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.deactivate(),this.set("map",u),this.map){let P=this.target||this.map.getTargetElement&&this.map.getTargetElement()||this.map.getContainer&&this.map.getContainer();this.element||this.createDefaultElement(),this.element&&P.appendChild(this.element),this.active&&this.activate()}this.render()}},target:{value:o},element:{value:c,writable:!0},render:{value:i||this.render,writable:!0}})}attachToMap(l){this.map=l}detachFromMap(){this.map=null}activate(){this.deactivate()}deactivate(){}render(){}createDefaultElement(){}},ch=ky;var jb=v=>class extends v{render(){!this.element||(this.element.innerHTML=this.active?this.getCopyrights().join(" | "):"")}createDefaultElement(){this.element=document.createElement("div"),this.element.id="mbt-copyright",Object.assign(this.element.style,{position:"absolute",bottom:0,right:0,fontSize:".8rem",padding:"0 10px"})}},Am=jb;var zy=class extends Am(ch){constructor(l){super(l),this.onPostRender=this.onPostRender.bind(this)}getCopyrights(){if(!this.frameState)return[];let l=[];return this.frameState.layerStatesArray.forEach(o=>{let{layer:c}=o;ex(o,this.frameState.viewState)&&c&&c.getSource&&c.getSource()&&c.getSource().getAttributions()&&(l=l.concat(c.getSource().getAttributions()(this.frameState)))}),Kh(l)}activate(){super.activate(),this.map&&this.map.on("postrender",this.onPostRender)}deactivate(){this.map&&this.map.un("postrender",this.onPostRender),super.deactivate()}onPostRender(l){this.map&&this.element&&(this.frameState=l.frameState,this.render())}},rx=zy;var ps={ADD:"add",REMOVE:"remove"};var nx=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),ix={LENGTH:"length"},Pm=function(v){nx(l,v);function l(o,c,i){var u=v.call(this,o)||this;return u.element=c,u.index=i,u}return l}(ss);var qb=function(v){nx(l,v);function l(o,c){var i=v.call(this)||this;i.on,i.once,i.un;var u=c||{};if(i.unique_=!!u.unique,i.array_=o||[],i.unique_)for(var P=0,D=i.array_.length;P<D;++P)i.assertUnique_(i.array_[P],P);return i.updateLength_(),i}return l.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},l.prototype.extend=function(o){for(var c=0,i=o.length;c<i;++c)this.push(o[c]);return this},l.prototype.forEach=function(o){for(var c=this.array_,i=0,u=c.length;i<u;++i)o(c[i],i,c)},l.prototype.getArray=function(){return this.array_},l.prototype.item=function(o){return this.array_[o]},l.prototype.getLength=function(){return this.get(ix.LENGTH)},l.prototype.insertAt=function(o,c){this.unique_&&this.assertUnique_(c),this.array_.splice(o,0,c),this.updateLength_(),this.dispatchEvent(new Pm(ps.ADD,c,o))},l.prototype.pop=function(){return this.removeAt(this.getLength()-1)},l.prototype.push=function(o){this.unique_&&this.assertUnique_(o);var c=this.getLength();return this.insertAt(c,o),this.getLength()},l.prototype.remove=function(o){for(var c=this.array_,i=0,u=c.length;i<u;++i)if(c[i]===o)return this.removeAt(i)},l.prototype.removeAt=function(o){var c=this.array_[o];return this.array_.splice(o,1),this.updateLength_(),this.dispatchEvent(new Pm(ps.REMOVE,c,o)),c},l.prototype.setAt=function(o,c){var i=this.getLength();if(o<i){this.unique_&&this.assertUnique_(c,o);var u=this.array_[o];this.array_[o]=c,this.dispatchEvent(new Pm(ps.REMOVE,u,o)),this.dispatchEvent(new Pm(ps.ADD,c,o))}else{for(var P=i;P<o;++P)this.insertAt(P,void 0);this.insertAt(o,c)}},l.prototype.updateLength_=function(){this.set(ix.LENGTH,this.array_.length)},l.prototype.assertUnique_=function(o,c){for(var i=0,u=this.array_.length;i<u;++i)if(this.array_[i]===o&&i!==c)throw new gm(58)},l}(Io),hh=qb;var Zb=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),Xb=function(v){Zb(l,v);function l(o){var c=v.call(this)||this;if(c.on,c.once,c.un,c.id_=void 0,c.geometryName_="geometry",c.style_=null,c.styleFunction_=void 0,c.geometryChangeKey_=null,c.addChangeListener(c.geometryName_,c.handleGeometryChanged_),o)if(typeof o.getSimplifiedGeometry=="function"){var i=o;c.setGeometry(i)}else{var u=o;c.setProperties(u)}return c}return l.prototype.clone=function(){var o=new l(this.hasProperties()?this.getProperties():null);o.setGeometryName(this.getGeometryName());var c=this.getGeometry();c&&o.setGeometry(c.clone());var i=this.getStyle();return i&&o.setStyle(i),o},l.prototype.getGeometry=function(){return this.get(this.geometryName_)},l.prototype.getId=function(){return this.id_},l.prototype.getGeometryName=function(){return this.geometryName_},l.prototype.getStyle=function(){return this.style_},l.prototype.getStyleFunction=function(){return this.styleFunction_},l.prototype.handleGeometryChange_=function(){this.changed()},l.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(To(this.geometryChangeKey_),this.geometryChangeKey_=null);var o=this.getGeometry();o&&(this.geometryChangeKey_=eo(o,Vi.CHANGE,this.handleGeometryChange_,this)),this.changed()},l.prototype.setGeometry=function(o){this.set(this.geometryName_,o)},l.prototype.setStyle=function(o){this.style_=o,this.styleFunction_=o?Wb(o):void 0,this.changed()},l.prototype.setId=function(o){this.id_=o,this.changed()},l.prototype.setGeometryName=function(o){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=o,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()},l}(Io);function Wb(v){if(typeof v=="function")return v;var l;if(Array.isArray(v))l=v;else{fn(typeof v.getZIndex=="function",41);var o=v;l=[o]}return function(){return l}}var gc=Xb;var _n={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"};function il(v,l,o,c,i,u){for(var P=u||[],D=0,F=l;F<o;F+=c){var U=v[F],N=v[F+1];P[D++]=i[0]*U+i[2]*N+i[4],P[D++]=i[1]*U+i[3]*N+i[5]}return u&&P.length!=D&&(P.length=D),P}function Mm(v,l,o,c,i,u,P){for(var D=P||[],F=Math.cos(i),U=Math.sin(i),N=u[0],at=u[1],yt=0,Tt=l;Tt<o;Tt+=c){var kt=v[Tt]-N,Vt=v[Tt+1]-at;D[yt++]=N+kt*F-Vt*U,D[yt++]=at+kt*U+Vt*F;for(var wt=Tt+2;wt<Tt+c;++wt)D[yt++]=v[wt]}return P&&D.length!=yt&&(D.length=yt),D}function ox(v,l,o,c,i,u,P,D){for(var F=D||[],U=P[0],N=P[1],at=0,yt=l;yt<o;yt+=c){var Tt=v[yt]-U,kt=v[yt+1]-N;F[at++]=U+i*Tt,F[at++]=N+u*kt;for(var Vt=yt+2;Vt<yt+c;++Vt)F[at++]=v[Vt]}return D&&F.length!=at&&(F.length=at),F}function ax(v,l,o,c,i,u,P){for(var D=P||[],F=0,U=l;U<o;U+=c){D[F++]=v[U]+i,D[F++]=v[U+1]+u;for(var N=U+2;N<U+c;++N)D[F++]=v[N]}return P&&D.length!=F&&(D.length=F),D}var $b=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),sx=va(),Kb=function(v){$b(l,v);function l(){var o=v.call(this)||this;return o.extent_=Va(),o.extentRevision_=-1,o.simplifiedGeometryMaxMinSquaredTolerance=0,o.simplifiedGeometryRevision=0,o.simplifyTransformedInternal=fv(function(c,i,u){if(!u)return this.getSimplifiedGeometry(i);var P=this.clone();return P.applyTransform(u),P.getSimplifiedGeometry(i)}),o}return l.prototype.simplifyTransformed=function(o,c){return this.simplifyTransformedInternal(this.getRevision(),o,c)},l.prototype.clone=function(){return Fr()},l.prototype.closestPointXY=function(o,c,i,u){return Fr()},l.prototype.containsXY=function(o,c){var i=this.getClosestPoint([o,c]);return i[0]===o&&i[1]===c},l.prototype.getClosestPoint=function(o,c){var i=c||[NaN,NaN];return this.closestPointXY(o[0],o[1],i,1/0),i},l.prototype.intersectsCoordinate=function(o){return this.containsXY(o[0],o[1])},l.prototype.computeExtent=function(o){return Fr()},l.prototype.getExtent=function(o){if(this.extentRevision_!=this.getRevision()){var c=this.computeExtent(this.extent_);(isNaN(c[0])||isNaN(c[1]))&&Zp(c),this.extentRevision_=this.getRevision()}return Gv(this.extent_,o)},l.prototype.rotate=function(o,c){Fr()},l.prototype.scale=function(o,c,i){Fr()},l.prototype.simplify=function(o){return this.getSimplifiedGeometry(o*o)},l.prototype.getSimplifiedGeometry=function(o){return Fr()},l.prototype.getType=function(){return Fr()},l.prototype.applyTransform=function(o){Fr()},l.prototype.intersectsExtent=function(o){return Fr()},l.prototype.translate=function(o,c){Fr()},l.prototype.transform=function(o,c){var i=ta(o),u=i.getUnits()==dc.TILE_PIXELS?function(P,D,F){var U=i.getExtent(),N=i.getWorldExtent(),at=Au(N)/Au(U);return us(sx,N[0],N[3],at,-at,0,0,0),il(P,0,P.length,F,sx,D),Yf(i,c)(P,D,F)}:Yf(i,c);return this.applyTransform(u),this},l}(Io),Lm=Kb;var Yb=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),Hb=function(v){Yb(l,v);function l(){var o=v.call(this)||this;return o.layout=_n.XY,o.stride=2,o.flatCoordinates=null,o}return l.prototype.computeExtent=function(o){return bm(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,o)},l.prototype.getCoordinates=function(){return Fr()},l.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},l.prototype.getFlatCoordinates=function(){return this.flatCoordinates},l.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},l.prototype.getLayout=function(){return this.layout},l.prototype.getSimplifiedGeometry=function(o){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),o<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&o<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var c=this.getSimplifiedGeometryInternal(o),i=c.getFlatCoordinates();return i.length<this.flatCoordinates.length?c:(this.simplifiedGeometryMaxMinSquaredTolerance=o,this)},l.prototype.getSimplifiedGeometryInternal=function(o){return this},l.prototype.getStride=function(){return this.stride},l.prototype.setFlatCoordinates=function(o,c){this.stride=lx(o),this.layout=o,this.flatCoordinates=c},l.prototype.setCoordinates=function(o,c){Fr()},l.prototype.setLayout=function(o,c,i){var u;if(o)u=lx(o);else{for(var P=0;P<i;++P)if(c.length===0){this.layout=_n.XY,this.stride=2;return}else c=c[0];u=c.length,o=Jb(u)}this.layout=o,this.stride=u},l.prototype.applyTransform=function(o){this.flatCoordinates&&(o(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},l.prototype.rotate=function(o,c){var i=this.getFlatCoordinates();if(i){var u=this.getStride();Mm(i,0,i.length,u,o,c,i),this.changed()}},l.prototype.scale=function(o,c,i){var u=c;u===void 0&&(u=o);var P=i;P||(P=Hh(this.getExtent()));var D=this.getFlatCoordinates();if(D){var F=this.getStride();ox(D,0,D.length,F,o,u,P,D),this.changed()}},l.prototype.translate=function(o,c){var i=this.getFlatCoordinates();if(i){var u=this.getStride();ax(i,0,i.length,u,o,c,i),this.changed()}},l}(Lm);function Jb(v){var l;return v==2?l=_n.XY:v==3?l=_n.XYZ:v==4&&(l=_n.XYZM),l}function lx(v){var l;return v==_n.XY?l=2:v==_n.XYZ||v==_n.XYM?l=3:v==_n.XYZM&&(l=4),l}function ux(v,l,o){var c=v.getFlatCoordinates();if(c){var i=v.getStride();return il(c,0,c.length,i,l,o)}else return null}var fs=Hb;function cx(v,l,o,c,i,u,P){var D=v[l],F=v[l+1],U=v[o]-D,N=v[o+1]-F,at;if(U===0&&N===0)at=l;else{var yt=((i-D)*U+(u-F)*N)/(U*U+N*N);if(yt>1)at=o;else if(yt>0){for(var Tt=0;Tt<c;++Tt)P[Tt]=el(v[l+Tt],v[o+Tt],yt);P.length=c;return}else at=l}for(var Tt=0;Tt<c;++Tt)P[Tt]=v[at+Tt];P.length=c}function ed(v,l,o,c,i){var u=v[l],P=v[l+1];for(l+=c;l<o;l+=c){var D=v[l],F=v[l+1],U=ql(u,P,D,F);U>i&&(i=U),u=D,P=F}return i}function rd(v,l,o,c,i){for(var u=0,P=o.length;u<P;++u){var D=o[u];i=ed(v,l,D,c,i),l=D}return i}function hx(v,l,o,c,i){for(var u=0,P=o.length;u<P;++u){var D=o[u];i=rd(v,l,D,c,i),l=D[D.length-1]}return i}function id(v,l,o,c,i,u,P,D,F,U,N){if(l==o)return U;var at,yt;if(i===0)if(yt=ql(P,D,v[l],v[l+1]),yt<U){for(at=0;at<c;++at)F[at]=v[l+at];return F.length=c,yt}else return U;for(var Tt=N||[NaN,NaN],kt=l+c;kt<o;)if(cx(v,kt-c,kt,c,P,D,Tt),yt=ql(P,D,Tt[0],Tt[1]),yt<U){for(U=yt,at=0;at<c;++at)F[at]=Tt[at];F.length=c,kt+=c}else kt+=c*Math.max((Math.sqrt(yt)-Math.sqrt(U))/i|0,1);if(u&&(cx(v,o-c,l,c,P,D,Tt),yt=ql(P,D,Tt[0],Tt[1]),yt<U)){for(U=yt,at=0;at<c;++at)F[at]=Tt[at];F.length=c}return U}function nd(v,l,o,c,i,u,P,D,F,U,N){for(var at=N||[NaN,NaN],yt=0,Tt=o.length;yt<Tt;++yt){var kt=o[yt];U=id(v,l,kt,c,i,u,P,D,F,U,at),l=kt}return U}function px(v,l,o,c,i,u,P,D,F,U,N){for(var at=N||[NaN,NaN],yt=0,Tt=o.length;yt<Tt;++yt){var kt=o[yt];U=nd(v,l,kt,c,i,u,P,D,F,U,at),l=kt[kt.length-1]}return U}function fx(v,l,o,c){for(var i=0,u=o.length;i<u;++i)v[l++]=o[i];return l}function tp(v,l,o,c){for(var i=0,u=o.length;i<u;++i)for(var P=o[i],D=0;D<c;++D)v[l++]=P[D];return l}function od(v,l,o,c,i){for(var u=i||[],P=0,D=0,F=o.length;D<F;++D){var U=tp(v,l,o[D],c);u[P++]=U,l=U}return u.length=P,u}function dx(v,l,o,c,i){for(var u=i||[],P=0,D=0,F=o.length;D<F;++D){var U=od(v,l,o[D],c,u[P]);u[P++]=U,l=U[U.length-1]}return u.length=P,u}function ad(v,l,o,c,i,u,P){var D=(o-l)/c;if(D<3){for(;l<o;l+=c)u[P++]=v[l],u[P++]=v[l+1];return P}var F=new Array(D);F[0]=1,F[D-1]=1;for(var U=[l,o-c],N=0;U.length>0;){for(var at=U.pop(),yt=U.pop(),Tt=0,kt=v[yt],Vt=v[yt+1],wt=v[at],Lt=v[at+1],Zt=yt+c;Zt<at;Zt+=c){var Jt=v[Zt],se=v[Zt+1],ce=Mv(Jt,se,kt,Vt,wt,Lt);ce>Tt&&(N=Zt,Tt=ce)}Tt>i&&(F[(N-l)/c]=1,yt+c<N&&U.push(yt,N),N+c<at&&U.push(N,at))}for(var Zt=0;Zt<D;++Zt)F[Zt]&&(u[P++]=v[l+Zt*c],u[P++]=v[l+Zt*c+1]);return P}function mx(v,l,o,c,i,u,P,D){for(var F=0,U=o.length;F<U;++F){var N=o[F];P=ad(v,l,N,c,i,u,P),D.push(P),l=N}return P}function ph(v,l){return l*Math.round(v/l)}function Qb(v,l,o,c,i,u,P){if(l==o)return P;var D=ph(v[l],i),F=ph(v[l+1],i);l+=c,u[P++]=D,u[P++]=F;var U,N;do if(U=ph(v[l],i),N=ph(v[l+1],i),l+=c,l==o)return u[P++]=U,u[P++]=N,P;while(U==D&&N==F);for(;l<o;){var at=ph(v[l],i),yt=ph(v[l+1],i);if(l+=c,!(at==U&&yt==N)){var Tt=U-D,kt=N-F,Vt=at-D,wt=yt-F;if(Tt*wt==kt*Vt&&(Tt<0&&Vt<Tt||Tt==Vt||Tt>0&&Vt>Tt)&&(kt<0&&wt<kt||kt==wt||kt>0&&wt>kt)){U=at,N=yt;continue}u[P++]=U,u[P++]=N,D=U,F=N,U=at,N=yt}}return u[P++]=U,u[P++]=N,P}function Ry(v,l,o,c,i,u,P,D){for(var F=0,U=o.length;F<U;++F){var N=o[F];P=Qb(v,l,N,c,i,u,P),D.push(P),l=N}return P}function gx(v,l,o,c,i,u,P,D){for(var F=0,U=o.length;F<U;++F){var N=o[F],at=[];P=Ry(v,l,N,c,i,u,P,at),D.push(at),l=N[N.length-1]}return P}function nl(v,l,o,c,i){for(var u=i!==void 0?i:[],P=0,D=l;D<o;D+=c)u[P++]=v.slice(D,D+c);return u.length=P,u}function fh(v,l,o,c,i){for(var u=i!==void 0?i:[],P=0,D=0,F=o.length;D<F;++D){var U=o[D];u[P++]=nl(v,l,U,c,u[P]),l=U}return u.length=P,u}function sd(v,l,o,c,i){for(var u=i!==void 0?i:[],P=0,D=0,F=o.length;D<F;++D){var U=o[D];u[P++]=fh(v,l,U,c,u[P]),l=U[U.length-1]}return u.length=P,u}function Dy(v,l,o,c){for(var i=0,u=v[o-c],P=v[o-c+1];l<o;l+=c){var D=v[l],F=v[l+1];i+=P*D-u*F,u=D,P=F}return i/2}function Oy(v,l,o,c){for(var i=0,u=0,P=o.length;u<P;++u){var D=o[u];i+=Dy(v,l,D,c),l=D}return i}function yx(v,l,o,c){for(var i=0,u=0,P=o.length;u<P;++u){var D=o[u];i+=Oy(v,l,D,c),l=D[D.length-1]}return i}var tw=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),ew=function(v){tw(l,v);function l(o,c){var i=v.call(this)||this;return i.maxDelta_=-1,i.maxDeltaRevision_=-1,c!==void 0&&!Array.isArray(o[0])?i.setFlatCoordinates(c,o):i.setCoordinates(o,c),i}return l.prototype.clone=function(){return new l(this.flatCoordinates.slice(),this.layout)},l.prototype.closestPointXY=function(o,c,i,u){return u<cs(this.getExtent(),o,c)?u:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ed(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),id(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,o,c,i,u))},l.prototype.getArea=function(){return Dy(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},l.prototype.getCoordinates=function(){return nl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},l.prototype.getSimplifiedGeometryInternal=function(o){var c=[];return c.length=ad(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,o,c,0),new l(c,_n.XY)},l.prototype.getType=function(){return Ie.LINEAR_RING},l.prototype.intersectsExtent=function(o){return!1},l.prototype.setCoordinates=function(o,c){this.setLayout(c,o,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=tp(this.flatCoordinates,0,o,this.stride),this.changed()},l}(fs),Fy=ew;var rw=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),iw=function(v){rw(l,v);function l(o,c){var i=v.call(this)||this;return i.setCoordinates(o,c),i}return l.prototype.clone=function(){var o=new l(this.flatCoordinates.slice(),this.layout);return o.applyProperties(this),o},l.prototype.closestPointXY=function(o,c,i,u){var P=this.flatCoordinates,D=ql(o,c,P[0],P[1]);if(D<u){for(var F=this.stride,U=0;U<F;++U)i[U]=P[U];return i.length=F,D}else return u},l.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},l.prototype.computeExtent=function(o){return Xp(this.flatCoordinates,o)},l.prototype.getType=function(){return Ie.POINT},l.prototype.intersectsExtent=function(o){return Kf(o,this.flatCoordinates[0],this.flatCoordinates[1])},l.prototype.setCoordinates=function(o,c){this.setLayout(c,o,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=fx(this.flatCoordinates,0,o,this.stride),this.changed()},l}(fs),ea=iw;function _x(v,l,o,c,i){var u=Nv(i,function(P){return!dh(v,l,o,c,P[0],P[1])});return!u}function dh(v,l,o,c,i,u){for(var P=0,D=v[o-c],F=v[o-c+1];l<o;l+=c){var U=v[l],N=v[l+1];F<=u?N>u&&(U-D)*(u-F)-(i-D)*(N-F)>0&&P++:N<=u&&(U-D)*(u-F)-(i-D)*(N-F)<0&&P--,D=U,F=N}return P!==0}function ld(v,l,o,c,i,u){if(o.length===0||!dh(v,l,o[0],c,i,u))return!1;for(var P=1,D=o.length;P<D;++P)if(dh(v,o[P-1],o[P],c,i,u))return!1;return!0}function vx(v,l,o,c,i,u){if(o.length===0)return!1;for(var P=0,D=o.length;P<D;++P){var F=o[P];if(ld(v,l,F,c,i,u))return!0;l=F[F.length-1]}return!1}function By(v,l,o,c,i,u,P){for(var D,F,U,N,at,yt,Tt,kt=i[u+1],Vt=[],wt=0,Lt=o.length;wt<Lt;++wt){var Zt=o[wt];for(N=v[Zt-c],yt=v[Zt-c+1],D=l;D<Zt;D+=c)at=v[D],Tt=v[D+1],(kt<=yt&&Tt<=kt||yt<=kt&&kt<=Tt)&&(U=(kt-yt)/(Tt-yt)*(at-N)+N,Vt.push(U)),N=at,yt=Tt}var Jt=NaN,se=-1/0;for(Vt.sort(rh),N=Vt[0],D=1,F=Vt.length;D<F;++D){at=Vt[D];var ce=Math.abs(at-N);ce>se&&(U=(N+at)/2,ld(v,l,o,c,U,kt)&&(Jt=U,se=ce)),N=at}return isNaN(Jt)&&(Jt=i[u]),P?(P.push(Jt,kt,se),P):[Jt,kt,se]}function xx(v,l,o,c,i){for(var u=[],P=0,D=o.length;P<D;++P){var F=o[P];u=By(v,l,F,c,i,2*P,u),l=F[F.length-1]}return u}function km(v,l,o,c,i){var u;for(l+=c;l<o;l+=c)if(u=i(v.slice(l-c,l),v.slice(l,l+c)),u)return u;return!1}function ud(v,l,o,c,i){var u=py(Va(),v,l,o,c);return Ao(i,u)?mc(i,u)||u[0]>=i[0]&&u[2]<=i[2]||u[1]>=i[1]&&u[3]<=i[3]?!0:km(v,l,o,c,function(P,D){return jv(i,P,D)}):!1}function bx(v,l,o,c,i){for(var u=0,P=o.length;u<P;++u){if(ud(v,l,o[u],c,i))return!0;l=o[u]}return!1}function nw(v,l,o,c,i){return!!(ud(v,l,o,c,i)||dh(v,l,o,c,i[0],i[1])||dh(v,l,o,c,i[0],i[3])||dh(v,l,o,c,i[2],i[1])||dh(v,l,o,c,i[2],i[3]))}function Uy(v,l,o,c,i){if(!nw(v,l,o[0],c,i))return!1;if(o.length===1)return!0;for(var u=1,P=o.length;u<P;++u)if(_x(v,o[u-1],o[u],c,i)&&!ud(v,o[u-1],o[u],c,i))return!1;return!0}function wx(v,l,o,c,i){for(var u=0,P=o.length;u<P;++u){var D=o[u];if(Uy(v,l,D,c,i))return!0;l=D[D.length-1]}return!1}function Ex(v,l,o,c){for(;l<o-c;){for(var i=0;i<c;++i){var u=v[l+i];v[l+i]=v[o-c+i],v[o-c+i]=u}l+=c,o-=c}}function Sx(v,l,o,c){for(var i=0,u=v[o-c],P=v[o-c+1];l<o;l+=c){var D=v[l],F=v[l+1];i+=(D-u)*(F+P),u=D,P=F}return i===0?void 0:i>0}function Ny(v,l,o,c,i){for(var u=i!==void 0?i:!1,P=0,D=o.length;P<D;++P){var F=o[P],U=Sx(v,l,F,c);if(P===0){if(u&&U||!u&&!U)return!1}else if(u&&!U||!u&&U)return!1;l=F}return!0}function Tx(v,l,o,c,i){for(var u=0,P=o.length;u<P;++u){var D=o[u];if(!Ny(v,l,D,c,i))return!1;D.length&&(l=D[D.length-1])}return!0}function zm(v,l,o,c,i){for(var u=i!==void 0?i:!1,P=0,D=o.length;P<D;++P){var F=o[P],U=Sx(v,l,F,c),N=P===0?u&&U||!u&&!U:u&&!U||!u&&U;N&&Ex(v,l,F,c),l=F}return l}function Vy(v,l,o,c,i){for(var u=0,P=o.length;u<P;++u)l=zm(v,l,o[u],c,i);return l}var ow=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),Ix=function(v){ow(l,v);function l(o,c,i){var u=v.call(this)||this;return u.ends_=[],u.flatInteriorPointRevision_=-1,u.flatInteriorPoint_=null,u.maxDelta_=-1,u.maxDeltaRevision_=-1,u.orientedRevision_=-1,u.orientedFlatCoordinates_=null,c!==void 0&&i?(u.setFlatCoordinates(c,o),u.ends_=i):u.setCoordinates(o,c),u}return l.prototype.appendLinearRing=function(o){this.flatCoordinates?Ua(this.flatCoordinates,o.getFlatCoordinates()):this.flatCoordinates=o.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},l.prototype.clone=function(){var o=new l(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return o.applyProperties(this),o},l.prototype.closestPointXY=function(o,c,i,u){return u<cs(this.getExtent(),o,c)?u:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(rd(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),nd(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,o,c,i,u))},l.prototype.containsXY=function(o,c){return ld(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,o,c)},l.prototype.getArea=function(){return Oy(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},l.prototype.getCoordinates=function(o){var c;return o!==void 0?(c=this.getOrientedFlatCoordinates().slice(),zm(c,0,this.ends_,this.stride,o)):c=this.flatCoordinates,fh(c,0,this.ends_,this.stride)},l.prototype.getEnds=function(){return this.ends_},l.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var o=Hh(this.getExtent());this.flatInteriorPoint_=By(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,o,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},l.prototype.getInteriorPoint=function(){return new ea(this.getFlatInteriorPoint(),_n.XYM)},l.prototype.getLinearRingCount=function(){return this.ends_.length},l.prototype.getLinearRing=function(o){return o<0||this.ends_.length<=o?null:new Fy(this.flatCoordinates.slice(o===0?0:this.ends_[o-1],this.ends_[o]),this.layout)},l.prototype.getLinearRings=function(){for(var o=this.layout,c=this.flatCoordinates,i=this.ends_,u=[],P=0,D=0,F=i.length;D<F;++D){var U=i[D],N=new Fy(c.slice(P,U),o);u.push(N),P=U}return u},l.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var o=this.flatCoordinates;Ny(o,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=o:(this.orientedFlatCoordinates_=o.slice(),this.orientedFlatCoordinates_.length=zm(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},l.prototype.getSimplifiedGeometryInternal=function(o){var c=[],i=[];return c.length=Ry(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(o),c,0,i),new l(c,_n.XY,i)},l.prototype.getType=function(){return Ie.POLYGON},l.prototype.intersectsExtent=function(o){return Uy(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,o)},l.prototype.setCoordinates=function(o,c){this.setLayout(c,o,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=od(this.flatCoordinates,0,o,this.stride,this.ends_);this.flatCoordinates.length=i.length===0?0:i[i.length-1],this.changed()},l}(fs),cd=Ix;function Gy(v,l,o){for(var c=l||32,i=v.getStride(),u=v.getLayout(),P=v.getCenter(),D=i*(c+1),F=new Array(D),U=0;U<D;U+=i){F[U]=0,F[U+1]=0;for(var N=2;N<i;N++)F[U+N]=P[N]}var at=[F.length],yt=new Ix(F,u,at);return aw(yt,P,v.getRadius(),o),yt}function aw(v,l,o,c){for(var i=v.getFlatCoordinates(),u=v.getStride(),P=i.length/u-1,D=c||0,F=0;F<=P;++F){var U=F*u,N=D+_m(F,P)*2*Math.PI/P;i[U]=l[0]+o*Math.cos(N),i[U+1]=l[1]+o*Math.sin(N)}v.changed()}var sw=function(){function v(l){var o=l||{};this.color_=o.color!==void 0?o.color:null}return v.prototype.clone=function(){var l=this.getColor();return new v({color:Array.isArray(l)?l.slice():l||void 0})},v.prototype.getColor=function(){return this.color_},v.prototype.setColor=function(l){this.color_=l},v}(),Ds=sw;function Dm(v,l,o,c,i,u,P){var D,F,U=(o-l)/c;if(U===1)D=l;else if(U===2)D=l,F=i;else if(U!==0){for(var N=v[l],at=v[l+1],yt=0,Tt=[0],kt=l+c;kt<o;kt+=c){var Vt=v[kt],wt=v[kt+1];yt+=Math.sqrt((Vt-N)*(Vt-N)+(wt-at)*(wt-at)),Tt.push(yt),N=Vt,at=wt}var Lt=i*yt,Zt=cv(Tt,Lt);Zt<0?(F=(Lt-Tt[-Zt-2])/(Tt[-Zt-1]-Tt[-Zt-2]),D=l+(-Zt-2)*c):D=l+Zt*c}for(var Jt=P>1?P:2,se=u||new Array(Jt),kt=0;kt<Jt;++kt)se[kt]=D===void 0?NaN:F===void 0?v[D+kt]:el(v[D+kt],v[D+c+kt],F);return se}function Rm(v,l,o,c,i,u){if(o==l)return null;var P;if(i<v[l+c-1])return u?(P=v.slice(l,l+c),P[c-1]=i,P):null;if(v[o-1]<i)return u?(P=v.slice(o-c,o),P[c-1]=i,P):null;if(i==v[l+c-1])return v.slice(l,l+c);for(var D=l/c,F=o/c;D<F;){var U=D+F>>1;i<v[(U+1)*c-1]?F=U:D=U+1}var N=v[D*c-1];if(i==N)return v.slice((D-1)*c,(D-1)*c+c);var at=v[(D+1)*c-1],yt=(i-N)/(at-N);P=[];for(var Tt=0;Tt<c-1;++Tt)P.push(el(v[(D-1)*c+Tt],v[D*c+Tt],yt));return P.push(i),P}function Cx(v,l,o,c,i,u,P){if(P)return Rm(v,l,o[o.length-1],c,i,u);var D;if(i<v[c-1])return u?(D=v.slice(0,c),D[c-1]=i,D):null;if(v[v.length-1]<i)return u?(D=v.slice(v.length-c),D[c-1]=i,D):null;for(var F=0,U=o.length;F<U;++F){var N=o[F];if(l!=N){if(i<v[l+c-1])return null;if(i<=v[N-1])return Rm(v,l,N,c,i,!1);l=N}}return null}function Om(v,l,o,c){for(var i=v[l],u=v[l+1],P=0,D=l+c;D<o;D+=c){var F=v[D],U=v[D+1];P+=Math.sqrt((F-i)*(F-i)+(U-u)*(U-u)),i=F,u=U}return P}var lw=function(){var v=function(l,o){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,i){c.__proto__=i}||function(c,i){for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&(c[u]=i[u])},v(l,o)};return function(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");v(l,o);function c(){this.constructor=l}l.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)}}(),uw=function(v){lw(l,v);function l(o,c){var i=v.call(this)||this;return i.flatMidpoint_=null,i.flatMidpointRevision_=-1,i.maxDelta_=-1,i.maxDeltaRevision_=-1,c!==void 0&&!Array.isArray(o[0])?i.setFlatCoordinates(c,o):i.setCoordinates(o,c),i}return l.prototype.appendCoordinate=function(o){this.flatCoordinates?Ua(this.flatCoordinates,o):this.flatCoordinates=o.slice(),this.changed()},l.prototype.clone=function(){var o=new l(this.flatCoordinates.slice(),this.layout);return o.applyProperties(this),o},l.prototype.closestPointXY=function(o,c,i,u){return u<cs(this.getExtent(),o,c)?u:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ed(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),id(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,o,c,i,u))},l.prototype.forEachSegment=function(o){return km(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,o)},l.prototype.getCoordinateAtM=function(o,c){if(this.layout!=_n.XYM&&this.layout!=_n.XYZM)return null;var i=c!==void 0?c:!1;return Rm(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,o,i)},l.prototype.getCoordinates=function(){return nl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},l.prototype.getCoordinateAt=function(o,c){return Dm(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,o,c,this.stride)},l.prototype.getLength=function(){return Om(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},l.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},l.prototype.getSimplifiedGeometryInternal=function(o){var c=[];return c.length=ad(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,o,c,0),new l(c,_n.XY)},l.prototype.getType=function(){return Ie.LINE_STRING},l.prototype.intersectsExtent=function(o){return ud(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,o)},l.prototype.setCoordinates=function(o,c){this.setLayout(c,o,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=tp(this.flatCoordinates,0,o,this.stride),this.changed()},l}(fs),yc=uw;var cw=function(){function v(l){var o=l||{};this.color_=o.color!==void 0?o.color:null,this.lineCap_=o.lineCap,this.lineDash_=o.lineDash!==void 0?o.lineDash:null,this.lineDashOffset_=o.lineDashOffset,this.lineJoin_=o.lineJoin,this.miterLimit_=o.miterLimit,this.width_=o.width}return v.prototype.clone=function(){var l=this.getColor();return new v({color:Array.isArray(l)?l.slice():l||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},v.prototype.getColor=function(){return this.color_},v.prototype.getLineCap=function(){return this.lineCap_},v.prototype.getLineDash=function(){return this.lineDash_},v.prototype.getLineDashOffset=function(){return this.lineDashOffset_},v.prototype.getLineJoin=function(){return this.lineJoin_},v.prototype.getMiterLimit=function(){return this.miterLimit_},v.prototype.getWidth=function(){return this.width_},v.prototype.setColor=function(l){this.color_=l},v.prototype.setLineCap=function(l){this.lineCap_=l},v.prototype.setLineDash=function(l){this.lineDash_=l},v.prototype.setLineDashOffset=function(l){this.lineDashOffset_=l},v.prototype.setLineJoin=function(l){this.lineJoin_=l},v.prototype.setMiterLimit=function(l){this.miterLimit_=l},v.prototype.setWidth=function(l){this.width_=l},v}(),ra=cw;var zi={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function jy(v,l){return Array.isArray(v)?v:(l===void 0?l=[v,v]:(l[0]=v,l[1]=v),l)}var hw=function(){function v(l){this.opacity_=l.opacity,this.rotateWithView_=l.rotateWithView,this.rotation_=l.rotation,this.scale_=l.scale,this.scaleArray_=jy(l.scale),this.displacement_=l.displacement}return v.prototype.clone=function(){var l=this.getScale();return new v({opacity:this.getOpacity(),scale:Array.isArray(l)?l.slice():l,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},v.prototype.getOpacity=function(){return this.opacity_},v.prototype.getRotateWithView=function(){return this.rotateWithView_},v.prototype.getRotation=function(){return this.rotation_},v.prototype.getScale=function(){return this.scale_},v.prototype.getScaleArray=function(){return this.scaleArray_},v.prototype.getDisplacement=function(){return this.displacement_},v.prototype.getAnchor=function(){return Fr()},v.prototype.getImage=function(l){return Fr()},v.prototype.getHitDetectionImage=function(){return Fr()},v.prototype.getPixelRatio=function(l){return 1},v.prototype.getImageState=function(){return Fr()},v.prototype.getImageSize=function(){return Fr()},v.prototype.getOrigin=function(){return Fr()},v.prototype.getSize=function(){return Fr()},v.prototype.setDisplacement=function(l){this.displacement_=l},v.prototype.setOpacity=function(l){this.opacity_=l},v.prototype.setRotateWithView=function(l){this.rotateWithView_=l},v.prototype.setRotation=function(l){this.rotation_=l},v.prototype.setScale=function(l){this.scale_=l,this.scaleArray_=jy(l)},v.prototype.listenImageChange=function(l){Fr()},v.prototype.load=function(){Fr()},v.prototype.unlistenImageChange=function(l){Fr()},v}(),Fm=hw;var pw=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,fw=/^([a-z]*)$|^hsla?\(.*\)$/i;function Bm(v){return typeof v=="string"?v:qy(v)}function dw(v){var l=document.createElement("div");if(l.style.color=v,l.style.color!==""){document.body.appendChild(l);var o=getComputedStyle(l).color;return document.body.removeChild(l),o}else return""}var mw=function(){var v=1024,l={},o=0;return function(c){var i;if(l.hasOwnProperty(c))i=l[c];else{if(o>=v){var u=0;for(var P in l)(u++&3)===0&&(delete l[P],--o)}i=gw(c),l[c]=i,++o}return i}}();function ep(v){return Array.isArray(v)?v:mw(v)}function gw(v){var l,o,c,i,u;if(fw.exec(v)&&(v=dw(v)),pw.exec(v)){var P=v.length-1,D=void 0;P<=4?D=1:D=2;var F=P===4||P===8;l=parseInt(v.substr(1+0*D,D),16),o=parseInt(v.substr(1+1*D,D),16),c=parseInt(v.substr(1+2*D,D),16),F?i=parseInt(v.substr(1+3*D,D),16):i=255,D==1&&(l=(l<<4)+l,o=(o<<4)+o,c=(c<<4)+c,F&&(i=(i<<4)+i)),u=[l,o,c,i/255]}else v.indexOf("rgba(")==0?(u=v.slice(5,-1).split(",").map(Number),Ax(u)):v.indexOf("rgb(")==0?(u=v.slice(4,-1).split(",").map(Number),u.push(1),Ax(u)):fn(!1,14);return u}function Ax(v){return v[0]=jl(v[0]+.5|0,0,255),v[1]=jl(v[1]+.5|0,0,255),v[2]=jl(v[2]+.5|0,0,255),v[3]=jl(v[3],0,1),v}function qy(v){var l=v[0];l!=(l|0)&&(l=l+.5|0);var o=v[1];o!=(o|0)&&(o=o+.5|0);var c=v[2];c!=(c|0)&&(c=c+.5|0);var i=v[3]===void 0?1:Math.round(v[3]*100)/100;return"rgba("+l+","+o+","+c+","+i+")"}function ds(v){return Array.isArray(v)?qy(v):v}function Ga(v,l,o,c){var i;return o&&o.length?i=o.shift():ah?i=new OffscreenCanvas(v||300,l||300):i=document.createElement("canvas"),v&&(i.width=v),l&&(i.height=l),i.getContext("2d",c)}var yw=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),Px=["style","variant","weight","size","lineHeight","family"],Zy=function(v){var l=v.match(yw);if(!l)return null;for(var o={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},c=0,i=Px.length;c<i;++c){var u=l[c+1];u!==void 0&&(o[Px[c]]=u)}return o.families=o.family.split(/,\s?/),o};function Mx(v){return v===1?"":String(Math.round(v*100)/100)}var Nm="10px sans-serif",ms="#000",rp="round",_c=[],vc=0,Lu="round",xc=10,bc="#000",gh="center",ip="middle",wc=[0,0,0,0],Ec=1,mh=new Io,_w=new nh;_w.setSize=function(){console.warn("labelCache is deprecated.")};var Qp=null,Xy,Wy={},Lx=function(){var v=100,l="32px ",o=["monospace","serif"],c=o.length,i="wmytzilWMYTZIL@#/&?$%10\uF013",u,P;function D(U,N,at){for(var yt=!0,Tt=0;Tt<c;++Tt){var kt=o[Tt];if(P=Um(U+" "+N+" "+l+kt,i),at!=kt){var Vt=Um(U+" "+N+" "+l+at+","+kt,i);yt=yt&&Vt!=P}}return!!yt}function F(){for(var U=!0,N=mh.getKeys(),at=0,yt=N.length;at<yt;++at){var Tt=N[at];mh.get(Tt)<v&&(D.apply(this,Tt.split(`
1001
1001
  `))?(ih(Wy),Qp=null,Xy=void 0,mh.set(Tt,v)):(mh.set(Tt,mh.get(Tt)+1,!0),U=!1))}U&&(clearInterval(u),u=void 0)}return function(U){var N=Zy(U);if(!!N)for(var at=N.families,yt=0,Tt=at.length;yt<Tt;++yt){var kt=at[yt],Vt=N.style+`
1002
1002
  `+N.weight+`
1003
1003
  `+kt;mh.get(Vt)===void 0&&(mh.set(Vt,v,!0),D(N.style,N.weight,kt)||(mh.set(Vt,0,!0),u===void 0&&(u=setInterval(F,32))))}}}(),vw=function(){var v;return function(l){var o=Wy[l];if(o==null){if(ah){var c=Zy(l),i=kx(l,"\u017Dg"),u=isNaN(Number(c.lineHeight))?1.2:Number(c.lineHeight);o=u*(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent)}else v||(v=document.createElement("div"),v.innerHTML="M",v.style.minHeight="0",v.style.maxHeight="none",v.style.height="auto",v.style.padding="0",v.style.border="none",v.style.position="absolute",v.style.display="block",v.style.left="-99999px"),v.style.font=l,document.body.appendChild(v),o=v.offsetHeight,document.body.removeChild(v);Wy[l]=o}return o}}();function kx(v,l){return Qp||(Qp=Ga(1,1)),v!=Xy&&(Qp.font=v,Xy=Qp.font),Qp.measureText(l)}function Um(v,l){return kx(v,l).width}function $y(v,l,o){if(l in o)return o[l];var c=Um(v,l);return o[l]=c,c}function zx(v,l){for(var o=[],c=[],i=[],u=0,P=0,D=0,F=0,U=0,N=l.length;U<=N;U+=2){var at=l[U];if(at===`