@mappedin/mappedin-js 5.51.0 → 5.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/esm/get-venue/index.d.ts +27 -3
- package/lib/esm/get-venue/index.js +1 -1
- package/lib/esm/navigator/index.d.ts +2 -1
- package/lib/esm/navigator/index.js +1 -1
- package/lib/esm/renderer/{GLTFExporter-KVV5NEYC.js → GLTFExporter-TCED5YLG.js} +1 -1
- package/lib/esm/renderer/{PerformanceController-YVNIJI6Z.js → PerformanceController-72JJ2M4J.js} +1 -1
- package/lib/esm/renderer/{browser-BZGW63NG.js → browser-T4GX5CT7.js} +1 -1
- package/lib/esm/renderer/chunk-DCWRUQBL.js +1 -0
- package/lib/esm/renderer/chunk-GSLNUYA6.js +1 -0
- package/lib/esm/renderer/index.d.ts +64 -2
- package/lib/esm/renderer/index.js +1 -1
- package/lib/esm/renderer/maplibre-worker.csp.js +1 -1
- package/lib/esm/renderer/{outdoor-context-JAORAG47.js → outdoor-context-BSDLOTS5.js} +1 -1
- package/lib/mappedin.js +1 -1
- package/lib/node/index.js +1 -1
- package/package.json +2 -2
- package/lib/esm/renderer/chunk-CJV777AH.js +0 -1
- package/lib/esm/renderer/chunk-STFZ7NKJ.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var e,t,r=Object.create,i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,l=(e,t)=>i(e,"name",{value:t,configurable:!0}),u=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})},h=(e,t,l)=>(l=null!=e?r(s(e)):{},((e,t,r,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of a(t))!o.call(e,l)&&l!==r&&i(e,l,{get:()=>t[l],enumerable:!(s=n(t,l))||s.enumerable});return e})(!t&&e&&e.__esModule?l:i(l,"default",{value:e,enumerable:!0}),e)),p=(e=()=>{},()=>(e&&(t=e(e=0)),t)),d=u(((e,t)=>{"use strict";function r(e,t){this.x=e,this.y=t}p(),t.exports=r,l(r,"Point"),r.prototype={clone:l((function(){return new r(this.x,this.y)}),"clone"),add:l((function(e){return this.clone()._add(e)}),"add"),sub:l((function(e){return this.clone()._sub(e)}),"sub"),multByPoint:l((function(e){return this.clone()._multByPoint(e)}),"multByPoint"),divByPoint:l((function(e){return this.clone()._divByPoint(e)}),"divByPoint"),mult:l((function(e){return this.clone()._mult(e)}),"mult"),div:l((function(e){return this.clone()._div(e)}),"div"),rotate:l((function(e){return this.clone()._rotate(e)}),"rotate"),rotateAround:l((function(e,t){return this.clone()._rotateAround(e,t)}),"rotateAround"),matMult:l((function(e){return this.clone()._matMult(e)}),"matMult"),unit:l((function(){return this.clone()._unit()}),"unit"),perp:l((function(){return this.clone()._perp()}),"perp"),round:l((function(){return this.clone()._round()}),"round"),mag:l((function(){return Math.sqrt(this.x*this.x+this.y*this.y)}),"mag"),equals:l((function(e){return this.x===e.x&&this.y===e.y}),"equals"),dist:l((function(e){return Math.sqrt(this.distSqr(e))}),"dist"),distSqr:l((function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r}),"distSqr"),angle:l((function(){return Math.atan2(this.y,this.x)}),"angle"),angleTo:l((function(e){return Math.atan2(this.y-e.y,this.x-e.x)}),"angleTo"),angleWith:l((function(e){return this.angleWithSep(e.x,e.y)}),"angleWith"),angleWithSep:l((function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)}),"angleWithSep"),_matMult:l((function(e){var t=e[0]*this.x+e[1]*this.y,r=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=r,this}),"_matMult"),_add:l((function(e){return this.x+=e.x,this.y+=e.y,this}),"_add"),_sub:l((function(e){return this.x-=e.x,this.y-=e.y,this}),"_sub"),_mult:l((function(e){return this.x*=e,this.y*=e,this}),"_mult"),_div:l((function(e){return this.x/=e,this.y/=e,this}),"_div"),_multByPoint:l((function(e){return this.x*=e.x,this.y*=e.y,this}),"_multByPoint"),_divByPoint:l((function(e){return this.x/=e.x,this.y/=e.y,this}),"_divByPoint"),_unit:l((function(){return this._div(this.mag()),this}),"_unit"),_perp:l((function(){var e=this.y;return this.y=this.x,this.x=-e,this}),"_perp"),_rotate:l((function(e){var t=Math.cos(e),r=Math.sin(e),i=t*this.x-r*this.y,n=r*this.x+t*this.y;return this.x=i,this.y=n,this}),"_rotate"),_rotateAround:l((function(e,t){var r=Math.cos(e),i=Math.sin(e),n=t.x+r*(this.x-t.x)-i*(this.y-t.y),a=t.y+i*(this.x-t.x)+r*(this.y-t.y);return this.x=n,this.y=a,this}),"_rotateAround"),_round:l((function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}),"_round")},r.convert=function(e){return e instanceof r?e:Array.isArray(e)?new r(e[0],e[1]):e}})),f=u(((e,t)=>{"use strict";function r(e,t,r,i){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(i-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=i}p(),t.exports=r,l(r,"UnitBezier"),r.prototype={sampleCurveX:l((function(e){return((this.ax*e+this.bx)*e+this.cx)*e}),"sampleCurveX"),sampleCurveY:l((function(e){return((this.ay*e+this.by)*e+this.cy)*e}),"sampleCurveY"),sampleCurveDerivativeX:l((function(e){return(3*this.ax*e+2*this.bx)*e+this.cx}),"sampleCurveDerivativeX"),solveCurveX:l((function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,i=0;i<8;i++){var n=this.sampleCurveX(r)-e;if(Math.abs(n)<t)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=n/a}var s=0,o=1;for(r=e,i=0;i<20&&(n=this.sampleCurveX(r),!(Math.abs(n-e)<t));i++)e>n?s=r:o=r,r=.5*(o-s)+s;return r}),"solveCurveX"),solve:l((function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}),"solve")}})),y=u(((e,t)=>{function r(e,t){var r,i,n,a,s,o,l,u;for(r=3&e.length,i=e.length-r,n=t,s=3432918353,o=461845907,u=0;u<i;)l=255&e.charCodeAt(u)|(255&e.charCodeAt(++u))<<8|(255&e.charCodeAt(++u))<<16|(255&e.charCodeAt(++u))<<24,++u,n=27492+(65535&(a=5*(65535&(n=(n^=l=(65535&(l=(l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(u+2))<<16;case 2:l^=(255&e.charCodeAt(u+1))<<8;case 1:n^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(u)))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*o+(((l>>>16)*o&65535)<<16)&4294967295}return n^=e.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0}p(),l(r,"murmurhash3_32_gc"),typeof t<"u"&&(t.exports=r)})),m=u(((e,t)=>{function r(e,t){for(var r,i=e.length,n=t^i,a=0;i>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),i-=4,++a;switch(i){case 3:n^=(255&e.charCodeAt(a+2))<<16;case 2:n^=(255&e.charCodeAt(a+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(a)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0}p(),l(r,"murmurhash2_32_gc"),void 0!==typeof t&&(t.exports=r)})),g=u(((e,t)=>{p();var r=y(),i=m();t.exports=r,t.exports.murmur3=r,t.exports.murmur2=i})),x=u(((e,t)=>{"use strict";function r(e,t,r){r=r||2;var n,s,o,l,u,c,p,d=t&&t.length,f=d?t[0]*r:e.length,y=i(e,0,f,r,!0),m=[];if(!y||y.next===y.prev)return m;if(d&&(y=h(e,t,y,r)),e.length>80*r){n=o=e[0],s=l=e[1];for(var g=r;g<f;g+=r)(u=e[g])<n&&(n=u),(c=e[g+1])<s&&(s=c),u>o&&(o=u),c>l&&(l=c);p=0!==(p=Math.max(o-n,l-s))?32767/p:0}return a(y,m,r,n,s,p,0),m}function i(e,t,r,i,n){var a,s;if(n===T(e,t,r,i)>0)for(a=t;a<r;a+=i)s=V(a,e[a],e[a+1],s);else for(a=r-i;a>=t;a-=i)s=V(a,e[a],e[a+1],s);return s&&A(s,s.next)&&(E(s),s=s.next),s}function n(e,t){if(!e)return e;t||(t=e);var r,i=e;do{if(r=!1,i.steiner||!A(i,i.next)&&0!==S(i.prev,i,i.next))i=i.next;else{if(E(i),(i=t=i.prev)===i.next)break;r=!0}}while(r||i!==t);return t}function a(e,t,r,i,l,h,p){if(e){!p&&h&&g(e,i,l,h);for(var d,f,y=e;e.prev!==e.next;)if(d=e.prev,f=e.next,h?o(e,i,l,h):s(e))t.push(d.i/r|0),t.push(e.i/r|0),t.push(f.i/r|0),E(e),e=f.next,y=f.next;else if((e=f)===y){p?1===p?a(e=u(n(e),t,r),t,r,i,l,h,2):2===p&&c(e,t,r,i,l,h):a(n(e),t,r,i,l,h,1);break}}}function s(e){var t=e.prev,r=e,i=e.next;if(S(t,r,i)>=0)return!1;for(var n=t.x,a=r.x,s=i.x,o=t.y,l=r.y,u=i.y,c=n<a?n<s?n:s:a<s?a:s,h=o<l?o<u?o:u:l<u?l:u,p=n>a?n>s?n:s:a>s?a:s,d=o>l?o>u?o:u:l>u?l:u,f=i.next;f!==t;){if(f.x>=c&&f.x<=p&&f.y>=h&&f.y<=d&&w(n,o,a,l,s,u,f.x,f.y)&&S(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function o(e,t,r,i){var n=e.prev,a=e,s=e.next;if(S(n,a,s)>=0)return!1;for(var o=n.x,l=a.x,u=s.x,c=n.y,h=a.y,p=s.y,d=o<l?o<u?o:u:l<u?l:u,f=c<h?c<p?c:p:h<p?h:p,y=o>l?o>u?o:u:l>u?l:u,m=c>h?c>p?c:p:h>p?h:p,g=v(d,f,t,r,i),x=v(y,m,t,r,i),b=e.prevZ,_=e.nextZ;b&&b.z>=g&&_&&_.z<=x;){if(b.x>=d&&b.x<=y&&b.y>=f&&b.y<=m&&b!==n&&b!==s&&w(o,c,l,h,u,p,b.x,b.y)&&S(b.prev,b,b.next)>=0||(b=b.prevZ,_.x>=d&&_.x<=y&&_.y>=f&&_.y<=m&&_!==n&&_!==s&&w(o,c,l,h,u,p,_.x,_.y)&&S(_.prev,_,_.next)>=0))return!1;_=_.nextZ}for(;b&&b.z>=g;){if(b.x>=d&&b.x<=y&&b.y>=f&&b.y<=m&&b!==n&&b!==s&&w(o,c,l,h,u,p,b.x,b.y)&&S(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;_&&_.z<=x;){if(_.x>=d&&_.x<=y&&_.y>=f&&_.y<=m&&_!==n&&_!==s&&w(o,c,l,h,u,p,_.x,_.y)&&S(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function u(e,t,r){var i=e;do{var a=i.prev,s=i.next.next;!A(a,s)&&k(a,i,i.next,s)&&C(a,s)&&C(s,a)&&(t.push(a.i/r|0),t.push(i.i/r|0),t.push(s.i/r|0),E(i),E(i.next),i=e=s),i=i.next}while(i!==e);return n(i)}function c(e,t,r,i,s,o){var l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&_(l,u)){var c=B(l,u);return l=n(l,l.next),c=n(c,c.next),a(l,t,r,i,s,o,0),void a(c,t,r,i,s,o,0)}u=u.next}l=l.next}while(l!==e)}function h(e,t,r,n){var a,s,o,l=[];for(a=0,s=t.length;a<s;a++)(o=i(e,t[a]*n,a<s-1?t[a+1]*n:e.length,n,!1))===o.next&&(o.steiner=!0),l.push(b(o));for(l.sort(d),a=0;a<l.length;a++)r=f(l[a],r);return r}function d(e,t){return e.x-t.x}function f(e,t){var r=y(e,t);if(!r)return t;var i=B(r,e);return n(i,i.next),n(r,r.next)}function y(e,t){var r,i=t,n=e.x,a=e.y,s=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var o=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(o<=n&&o>s&&(s=o,r=i.x<i.next.x?i:i.next,o===n))return r}i=i.next}while(i!==t);if(!r)return null;var l,u=r,c=r.x,h=r.y,p=1/0;i=r;do{n>=i.x&&i.x>=c&&n!==i.x&&w(a<h?n:s,a,c,h,a<h?s:n,a,i.x,i.y)&&(l=Math.abs(a-i.y)/(n-i.x),C(i,e)&&(l<p||l===p&&(i.x>r.x||i.x===r.x&&m(r,i)))&&(r=i,p=l)),i=i.next}while(i!==u);return r}function m(e,t){return S(e.prev,e,t.prev)<0&&S(t.next,e,e.next)<0}function g(e,t,r,i){var n=e;do{0===n.z&&(n.z=v(n.x,n.y,t,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,x(n)}function x(e){var t,r,i,n,a,s,o,l,u=1;do{for(r=e,e=null,a=null,s=0;r;){for(s++,i=r,o=0,t=0;t<u&&(o++,i=i.nextZ);t++);for(l=u;o>0||l>0&&i;)0!==o&&(0===l||!i||r.z<=i.z)?(n=r,r=r.nextZ,o--):(n=i,i=i.nextZ,l--),a?a.nextZ=n:e=n,n.prevZ=a,a=n;r=i}a.nextZ=null,u*=2}while(s>1);return e}function v(e,t,r,i,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function b(e){var t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function w(e,t,r,i,n,a,s,o){return(n-s)*(t-o)>=(e-s)*(a-o)&&(e-s)*(i-o)>=(r-s)*(t-o)&&(r-s)*(a-o)>=(n-s)*(i-o)}function _(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!P(e,t)&&(C(e,t)&&C(t,e)&&z(e,t)&&(S(e.prev,e,t.prev)||S(e,t.prev,t))||A(e,t)&&S(e.prev,e,e.next)>0&&S(t.prev,t,t.next)>0)}function S(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function A(e,t){return e.x===t.x&&e.y===t.y}function k(e,t,r,i){var n=M(S(e,t,r)),a=M(S(e,t,i)),s=M(S(r,i,e)),o=M(S(r,i,t));return!!(n!==a&&s!==o||0===n&&I(e,r,t)||0===a&&I(e,i,t)||0===s&&I(r,e,i)||0===o&&I(r,t,i))}function I(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function M(e){return e>0?1:e<0?-1:0}function P(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&k(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function C(e,t){return S(e.prev,e,e.next)<0?S(e,t,e.next)>=0&&S(e,e.prev,t)>=0:S(e,t,e.prev)<0||S(e,e.next,t)<0}function z(e,t){var r=e,i=!1,n=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&n<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==e);return i}function B(e,t){var r=new F(e.i,e.x,e.y),i=new F(t.i,t.x,t.y),n=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=n,n.prev=r,i.next=r,r.prev=i,a.next=i,i.prev=a,i}function V(e,t,r,i){var n=new F(e,t,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function E(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function F(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function T(e,t,r,i){for(var n=0,a=t,s=r-i;a<r;a+=i)n+=(e[s]-e[a])*(e[a+1]+e[s+1]),s=a;return n}p(),t.exports=r,t.exports.default=r,l(r,"earcut"),l(i,"linkedList"),l(n,"filterPoints"),l(a,"earcutLinked"),l(s,"isEar"),l(o,"isEarHashed"),l(u,"cureLocalIntersections"),l(c,"splitEarcut"),l(h,"eliminateHoles"),l(d,"compareX"),l(f,"eliminateHole"),l(y,"findHoleBridge"),l(m,"sectorContainsSector"),l(g,"indexCurve"),l(x,"sortLinked"),l(v,"zOrder"),l(b,"getLeftmost"),l(w,"pointInTriangle"),l(_,"isValidDiagonal"),l(S,"area"),l(A,"equals"),l(k,"intersects"),l(I,"onSegment"),l(M,"sign"),l(P,"intersectsPolygon"),l(C,"locallyInside"),l(z,"middleInside"),l(B,"splitPolygon"),l(V,"insertNode"),l(E,"removeNode"),l(F,"Node"),r.deviation=function(e,t,r,i){var n=t&&t.length,a=n?t[0]*r:e.length,s=Math.abs(T(e,0,a,r));if(n)for(var o=0,l=t.length;o<l;o++){var u=t[o]*r,c=o<l-1?t[o+1]*r:e.length;s-=Math.abs(T(e,u,c,r))}var h=0;for(o=0;o<i.length;o+=3){var p=i[o]*r,d=i[o+1]*r,f=i[o+2]*r;h+=Math.abs((e[p]-e[f])*(e[d+1]-e[p+1])-(e[p]-e[d])*(e[f+1]-e[p+1]))}return 0===s&&0===h?0:Math.abs((h-s)/s)},l(T,"signedArea"),r.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},i=0,n=0;n<e.length;n++){for(var a=0;a<e[n].length;a++)for(var s=0;s<t;s++)r.vertices.push(e[n][a][s]);n>0&&(i+=e[n-1].length,r.holes.push(i))}return r}})),v=u(((e,t)=>{"use strict";p();var r=d();function i(e,t,r,i,a){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=i,this._values=a,e.readFields(n,this,t)}function n(e,t,r){1==e?t.id=r.readVarint():2==e?a(r,t):3==e?t.type=r.readVarint():4==e&&(t._geometry=r.pos)}function a(e,t){for(var r=e.readVarint()+e.pos;e.pos<r;){var i=t._keys[e.readVarint()],n=t._values[e.readVarint()];t.properties[i]=n}}function s(e){var t=e.length;if(t<=1)return[e];for(var r,i,n=[],a=0;a<t;a++){var s=o(e[a]);0!==s&&(void 0===i&&(i=s<0),i===s<0?(r&&n.push(r),r=[e[a]]):r.push(e[a]))}return r&&n.push(r),n}function o(e){for(var t,r,i=0,n=0,a=e.length,s=a-1;n<a;s=n++)t=e[n],i+=((r=e[s]).x-t.x)*(t.y+r.y);return i}t.exports=i,l(i,"VectorTileFeature"),l(n,"readFeature"),l(a,"readTag"),i.types=["Unknown","Point","LineString","Polygon"],i.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,i=e.readVarint()+e.pos,n=1,a=0,s=0,o=0,l=[];e.pos<i;){if(a<=0){var u=e.readVarint();n=7&u,a=u>>3}if(a--,1===n||2===n)s+=e.readSVarint(),o+=e.readSVarint(),1===n&&(t&&l.push(t),t=[]),t.push(new r(s,o));else{if(7!==n)throw new Error("unknown command "+n);t&&t.push(t[0].clone())}}return t&&l.push(t),l},i.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,i=0,n=0,a=0,s=1/0,o=-1/0,l=1/0,u=-1/0;e.pos<t;){if(i<=0){var c=e.readVarint();r=7&c,i=c>>3}if(i--,1===r||2===r)(n+=e.readSVarint())<s&&(s=n),n>o&&(o=n),(a+=e.readSVarint())<l&&(l=a),a>u&&(u=a);else if(7!==r)throw new Error("unknown command "+r)}return[s,l,o,u]},i.prototype.toGeoJSON=function(e,t,r){var n,a,o=this.extent*Math.pow(2,r),u=this.extent*e,c=this.extent*t,h=this.loadGeometry(),p=i.types[this.type];function d(e){for(var t=0;t<e.length;t++){var r=e[t],i=180-360*(r.y+c)/o;e[t]=[360*(r.x+u)/o-180,360/Math.PI*Math.atan(Math.exp(i*Math.PI/180))-90]}}switch(l(d,"project"),this.type){case 1:var f=[];for(n=0;n<h.length;n++)f[n]=h[n][0];d(h=f);break;case 2:for(n=0;n<h.length;n++)d(h[n]);break;case 3:for(h=s(h),n=0;n<h.length;n++)for(a=0;a<h[n].length;a++)d(h[n][a])}1===h.length?h=h[0]:p="Multi"+p;var y={type:"Feature",geometry:{type:p,coordinates:h},properties:this.properties};return"id"in this&&(y.id=this.id),y},l(s,"classifyRings"),l(o,"signedArea")})),b=u(((e,t)=>{"use strict";p();var r=v();function i(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(n,this,t),this.length=this._features.length}function n(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(a(r))}function a(e){for(var t=null,r=e.readVarint()+e.pos;e.pos<r;){var i=e.readVarint()>>3;t=1===i?e.readString():2===i?e.readFloat():3===i?e.readDouble():4===i?e.readVarint64():5===i?e.readVarint():6===i?e.readSVarint():7===i?e.readBoolean():null}return t}t.exports=i,l(i,"VectorTileLayer"),l(n,"readLayer"),l(a,"readValueMessage"),i.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new r(this._pbf,t,this.extent,this._keys,this._values)}})),w=u(((e,t)=>{"use strict";p();var r=b();function i(e,t){this.layers=e.readFields(n,{},t)}function n(e,t,i){if(3===e){var n=new r(i,i.readVarint()+i.pos);n.length&&(t[n.name]=n)}}t.exports=i,l(i,"VectorTile"),l(n,"readTile")})),_=u(((e,t)=>{p(),t.exports.VectorTile=w(),t.exports.VectorTileFeature=v(),t.exports.VectorTileLayer=b()})),S=u((e=>{p(),e.read=function(e,t,r,i,n){var a,s,o=8*n-i-1,l=(1<<o)-1,u=l>>1,c=-7,h=r?n-1:0,p=r?-1:1,d=e[t+h];for(h+=p,a=d&(1<<-c)-1,d>>=-c,c+=o;c>0;a=256*a+e[t+h],h+=p,c-=8);for(s=a&(1<<-c)-1,a>>=-c,c+=i;c>0;s=256*s+e[t+h],h+=p,c-=8);if(0===a)a=1-u;else{if(a===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),a-=u}return(d?-1:1)*s*Math.pow(2,a-i)},e.write=function(e,t,r,i,n,a){var s,o,l,u=8*a-n-1,c=(1<<u)-1,h=c>>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:a-1,f=i?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=c?(o=0,s=c):s+h>=1?(o=(t*l-1)*Math.pow(2,n),s+=h):(o=t*Math.pow(2,h-1)*Math.pow(2,n),s=0));n>=8;e[r+d]=255&o,d+=f,o/=256,n-=8);for(s=s<<n|o,u+=n;u>0;e[r+d]=255&s,d+=f,s/=256,u-=8);e[r+d-f]|=128*y}})),A=u(((e,t)=>{"use strict";p(),t.exports=i;var r=S();function i(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}l(i,"Pbf"),i.Varint=0,i.Fixed64=1,i.Bytes=2,i.Fixed32=5;var n=4294967296,a=1/n,s=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function o(e,t,r){var i,n,a=r.buf;if(i=(112&(n=a[r.pos++]))>>4,n<128||(i|=(127&(n=a[r.pos++]))<<3,n<128)||(i|=(127&(n=a[r.pos++]))<<10,n<128)||(i|=(127&(n=a[r.pos++]))<<17,n<128)||(i|=(127&(n=a[r.pos++]))<<24,n<128)||(i|=(1&(n=a[r.pos++]))<<31,n<128))return c(e,i,t);throw new Error("Expected varint not more than 10 bytes")}function u(e){return e.type===i.Bytes?e.readVarint()+e.pos:e.pos+1}function c(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function h(e,t){var r,i;if(e>=0?(r=e%4294967296|0,i=e/4294967296|0):(i=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,i=i+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),d(r,i,t),f(i,t)}function d(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos]=127&e}function f(e,t){var r=(7&e)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}function y(e,t,r){var i=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;n>=e;n--)r.buf[n+i]=r.buf[n]}function m(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function g(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function x(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function v(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function b(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function w(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function _(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function A(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function k(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function I(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function M(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function P(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function C(e,t,r){for(var i="",n=t;n<r;){var a,s,o,l=e[n],u=null,c=l>239?4:l>223?3:l>191?2:1;if(n+c>r)break;1===c?l<128&&(u=l):2===c?128==(192&(a=e[n+1]))&&((u=(31&l)<<6|63&a)<=127&&(u=null)):3===c?(a=e[n+1],s=e[n+2],128==(192&a)&&128==(192&s)&&(((u=(15&l)<<12|(63&a)<<6|63&s)<=2047||u>=55296&&u<=57343)&&(u=null))):4===c&&(a=e[n+1],s=e[n+2],o=e[n+3],128==(192&a)&&128==(192&s)&&128==(192&o)&&(((u=(15&l)<<18|(63&a)<<12|(63&s)<<6|63&o)<=65535||u>=1114112)&&(u=null))),null===u?(u=65533,c=1):u>65535&&(u-=65536,i+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),i+=String.fromCharCode(u),n+=c}return i}function z(e,t,r){return s.decode(e.subarray(t,r))}function B(e,t,r){for(var i,n,a=0;a<t.length;a++){if((i=t.charCodeAt(a))>55295&&i<57344){if(!n){i>56319||a+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):n=i;continue}if(i<56320){e[r++]=239,e[r++]=191,e[r++]=189,n=i;continue}i=n-55296<<10|i-56320|65536,n=null}else n&&(e[r++]=239,e[r++]=191,e[r++]=189,n=null);i<128?e[r++]=i:(i<2048?e[r++]=i>>6|192:(i<65536?e[r++]=i>>12|224:(e[r++]=i>>18|240,e[r++]=i>>12&63|128),e[r++]=i>>6&63|128),e[r++]=63&i|128)}return r}i.prototype={destroy:l((function(){this.buf=null}),"destroy"),readFields:l((function(e,t,r){for(r=r||this.length;this.pos<r;){var i=this.readVarint(),n=i>>3,a=this.pos;this.type=7&i,e(n,t,this),this.pos===a&&this.skip(i)}return t}),"readFields"),readMessage:l((function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}),"readMessage"),readFixed32:l((function(){var e=I(this.buf,this.pos);return this.pos+=4,e}),"readFixed32"),readSFixed32:l((function(){var e=P(this.buf,this.pos);return this.pos+=4,e}),"readSFixed32"),readFixed64:l((function(){var e=I(this.buf,this.pos)+I(this.buf,this.pos+4)*n;return this.pos+=8,e}),"readFixed64"),readSFixed64:l((function(){var e=I(this.buf,this.pos)+P(this.buf,this.pos+4)*n;return this.pos+=8,e}),"readSFixed64"),readFloat:l((function(){var e=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e}),"readFloat"),readDouble:l((function(){var e=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e}),"readDouble"),readVarint:l((function(e){var t,r,i=this.buf;return t=127&(r=i[this.pos++]),r<128||(t|=(127&(r=i[this.pos++]))<<7,r<128)||(t|=(127&(r=i[this.pos++]))<<14,r<128)||(t|=(127&(r=i[this.pos++]))<<21,r<128)?t:o(t|=(15&(r=i[this.pos]))<<28,e,this)}),"readVarint"),readVarint64:l((function(){return this.readVarint(!0)}),"readVarint64"),readSVarint:l((function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2}),"readSVarint"),readBoolean:l((function(){return!!this.readVarint()}),"readBoolean"),readString:l((function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&s?z(this.buf,t,e):C(this.buf,t,e)}),"readString"),readBytes:l((function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}),"readBytes"),readPackedVarint:l((function(e,t){if(this.type!==i.Bytes)return e.push(this.readVarint(t));var r=u(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e}),"readPackedVarint"),readPackedSVarint:l((function(e){if(this.type!==i.Bytes)return e.push(this.readSVarint());var t=u(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e}),"readPackedSVarint"),readPackedBoolean:l((function(e){if(this.type!==i.Bytes)return e.push(this.readBoolean());var t=u(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e}),"readPackedBoolean"),readPackedFloat:l((function(e){if(this.type!==i.Bytes)return e.push(this.readFloat());var t=u(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e}),"readPackedFloat"),readPackedDouble:l((function(e){if(this.type!==i.Bytes)return e.push(this.readDouble());var t=u(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e}),"readPackedDouble"),readPackedFixed32:l((function(e){if(this.type!==i.Bytes)return e.push(this.readFixed32());var t=u(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e}),"readPackedFixed32"),readPackedSFixed32:l((function(e){if(this.type!==i.Bytes)return e.push(this.readSFixed32());var t=u(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e}),"readPackedSFixed32"),readPackedFixed64:l((function(e){if(this.type!==i.Bytes)return e.push(this.readFixed64());var t=u(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e}),"readPackedFixed64"),readPackedSFixed64:l((function(e){if(this.type!==i.Bytes)return e.push(this.readSFixed64());var t=u(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e}),"readPackedSFixed64"),skip:l((function(e){var t=7&e;if(t===i.Varint)for(;this.buf[this.pos++]>127;);else if(t===i.Bytes)this.pos=this.readVarint()+this.pos;else if(t===i.Fixed32)this.pos+=4;else{if(t!==i.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}}),"skip"),writeTag:l((function(e,t){this.writeVarint(e<<3|t)}),"writeTag"),realloc:l((function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}}),"realloc"),finish:l((function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}),"finish"),writeFixed32:l((function(e){this.realloc(4),M(this.buf,e,this.pos),this.pos+=4}),"writeFixed32"),writeSFixed32:l((function(e){this.realloc(4),M(this.buf,e,this.pos),this.pos+=4}),"writeSFixed32"),writeFixed64:l((function(e){this.realloc(8),M(this.buf,-1&e,this.pos),M(this.buf,Math.floor(e*a),this.pos+4),this.pos+=8}),"writeFixed64"),writeSFixed64:l((function(e){this.realloc(8),M(this.buf,-1&e,this.pos),M(this.buf,Math.floor(e*a),this.pos+4),this.pos+=8}),"writeSFixed64"),writeVarint:l((function(e){(e=+e||0)>268435455||e<0?h(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127))))}),"writeVarint"),writeSVarint:l((function(e){this.writeVarint(e<0?2*-e-1:2*e)}),"writeSVarint"),writeBoolean:l((function(e){this.writeVarint(!!e)}),"writeBoolean"),writeString:l((function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=B(this.buf,e,this.pos);var r=this.pos-t;r>=128&&y(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r}),"writeString"),writeFloat:l((function(e){this.realloc(4),r.write(this.buf,e,this.pos,!0,23,4),this.pos+=4}),"writeFloat"),writeDouble:l((function(e){this.realloc(8),r.write(this.buf,e,this.pos,!0,52,8),this.pos+=8}),"writeDouble"),writeBytes:l((function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]}),"writeBytes"),writeRawMessage:l((function(e,t){this.pos++;var r=this.pos;e(t,this);var i=this.pos-r;i>=128&&y(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}),"writeRawMessage"),writeMessage:l((function(e,t,r){this.writeTag(e,i.Bytes),this.writeRawMessage(t,r)}),"writeMessage"),writePackedVarint:l((function(e,t){t.length&&this.writeMessage(e,m,t)}),"writePackedVarint"),writePackedSVarint:l((function(e,t){t.length&&this.writeMessage(e,g,t)}),"writePackedSVarint"),writePackedBoolean:l((function(e,t){t.length&&this.writeMessage(e,b,t)}),"writePackedBoolean"),writePackedFloat:l((function(e,t){t.length&&this.writeMessage(e,x,t)}),"writePackedFloat"),writePackedDouble:l((function(e,t){t.length&&this.writeMessage(e,v,t)}),"writePackedDouble"),writePackedFixed32:l((function(e,t){t.length&&this.writeMessage(e,w,t)}),"writePackedFixed32"),writePackedSFixed32:l((function(e,t){t.length&&this.writeMessage(e,_,t)}),"writePackedSFixed32"),writePackedFixed64:l((function(e,t){t.length&&this.writeMessage(e,A,t)}),"writePackedFixed64"),writePackedSFixed64:l((function(e,t){t.length&&this.writeMessage(e,k,t)}),"writePackedSFixed64"),writeBytesField:l((function(e,t){this.writeTag(e,i.Bytes),this.writeBytes(t)}),"writeBytesField"),writeFixed32Field:l((function(e,t){this.writeTag(e,i.Fixed32),this.writeFixed32(t)}),"writeFixed32Field"),writeSFixed32Field:l((function(e,t){this.writeTag(e,i.Fixed32),this.writeSFixed32(t)}),"writeSFixed32Field"),writeFixed64Field:l((function(e,t){this.writeTag(e,i.Fixed64),this.writeFixed64(t)}),"writeFixed64Field"),writeSFixed64Field:l((function(e,t){this.writeTag(e,i.Fixed64),this.writeSFixed64(t)}),"writeSFixed64Field"),writeVarintField:l((function(e,t){this.writeTag(e,i.Varint),this.writeVarint(t)}),"writeVarintField"),writeSVarintField:l((function(e,t){this.writeTag(e,i.Varint),this.writeSVarint(t)}),"writeSVarintField"),writeStringField:l((function(e,t){this.writeTag(e,i.Bytes),this.writeString(t)}),"writeStringField"),writeFloatField:l((function(e,t){this.writeTag(e,i.Fixed32),this.writeFloat(t)}),"writeFloatField"),writeDoubleField:l((function(e,t){this.writeTag(e,i.Fixed64),this.writeDouble(t)}),"writeDoubleField"),writeBooleanField:l((function(e,t){this.writeVarintField(e,!!t)}),"writeBooleanField")},l(o,"readVarintRemainder"),l(u,"readPackedEnd"),l(c,"toNum"),l(h,"writeBigVarint"),l(d,"writeBigVarintLow"),l(f,"writeBigVarintHigh"),l(y,"makeRoomForExtraLength"),l(m,"writePackedVarint"),l(g,"writePackedSVarint"),l(x,"writePackedFloat"),l(v,"writePackedDouble"),l(b,"writePackedBoolean"),l(w,"writePackedFixed32"),l(_,"writePackedSFixed32"),l(A,"writePackedFixed64"),l(k,"writePackedSFixed64"),l(I,"readUInt32"),l(M,"writeInt32"),l(P,"readInt32"),l(C,"readUtf8"),l(z,"readUtf8TextDecoder"),l(B,"writeUtf8")})),k=u(((e,t)=>{function r(e,t){var n,a=e&&e.type;if("FeatureCollection"===a)for(n=0;n<e.features.length;n++)r(e.features[n],t);else if("GeometryCollection"===a)for(n=0;n<e.geometries.length;n++)r(e.geometries[n],t);else if("Feature"===a)r(e.geometry,t);else if("Polygon"===a)i(e.coordinates,t);else if("MultiPolygon"===a)for(n=0;n<e.coordinates.length;n++)i(e.coordinates[n],t);return e}function i(e,t){if(0!==e.length){n(e[0],t);for(var r=1;r<e.length;r++)n(e[r],!t)}}function n(e,t){for(var r=0,i=0,n=0,a=e.length,s=a-1;n<a;s=n++){var o=(e[n][0]-e[s][0])*(e[s][1]+e[n][1]),l=r+o;i+=Math.abs(r)>=Math.abs(o)?r-l+o:o-l+r,r=l}r+i>=0!=!!t&&e.reverse()}p(),t.exports=r,l(r,"rewind"),l(i,"rewindRings"),l(n,"rewindRing")})),I=u(((e,t)=>{"use strict";p();var r=d(),i=_().VectorTileFeature;function n(e,t){this.options=t||{},this.features=e,this.length=e.length}function a(e,t){this.id="number"==typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096}t.exports=n,l(n,"GeoJSONWrapper"),n.prototype.feature=function(e){return new a(this.features[e],this.options.extent)},l(a,"FeatureWrapper"),a.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var t=0;t<e.length;t++){for(var i=e[t],n=[],a=0;a<i.length;a++)n.push(new r(i[a][0],i[a][1]));this.geometry.push(n)}return this.geometry},a.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,r=-1/0,i=1/0,n=-1/0,a=0;a<e.length;a++)for(var s=e[a],o=0;o<s.length;o++){var l=s[o];t=Math.min(t,l.x),r=Math.max(r,l.x),i=Math.min(i,l.y),n=Math.max(n,l.y)}return[t,i,r,n]},a.prototype.toGeoJSON=i.prototype.toGeoJSON})),M=u(((e,t)=>{p();var r=A(),i=I();function n(e){var t=new r;return s(e,t),t.finish()}function a(e,t){t=t||{};var r={};for(var a in e)r[a]=new i(e[a].features,t),r[a].name=a,r[a].version=t.version,r[a].extent=t.extent;return n({layers:r})}function s(e,t){for(var r in e.layers)t.writeMessage(3,o,e.layers[r])}function o(e,t){t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);var r,i={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<e.length;r++)i.feature=e.feature(r),t.writeMessage(2,u,i);var n=i.keys;for(r=0;r<n.length;r++)t.writeStringField(3,n[r]);var a=i.values;for(r=0;r<a.length;r++)t.writeMessage(4,y,a[r])}function u(e,t){var r=e.feature;void 0!==r.id&&t.writeVarintField(1,r.id),t.writeMessage(2,c,e),t.writeVarintField(3,r.type),t.writeMessage(4,f,r)}function c(e,t){var r=e.feature,i=e.keys,n=e.values,a=e.keycache,s=e.valuecache;for(var o in r.properties){var l=r.properties[o],u=a[o];if(null!==l){typeof u>"u"&&(i.push(o),u=i.length-1,a[o]=u),t.writeVarint(u);var c=typeof l;"string"!==c&&"boolean"!==c&&"number"!==c&&(l=JSON.stringify(l));var h=c+":"+l,p=s[h];typeof p>"u"&&(n.push(l),p=n.length-1,s[h]=p),t.writeVarint(p)}}}function h(e,t){return(t<<3)+(7&e)}function d(e){return e<<1^e>>31}function f(e,t){for(var r=e.loadGeometry(),i=e.type,n=0,a=0,s=r.length,o=0;o<s;o++){var l=r[o],u=1;1===i&&(u=l.length),t.writeVarint(h(1,u));for(var c=3===i?l.length-1:l.length,p=0;p<c;p++){1===p&&1!==i&&t.writeVarint(h(2,c-1));var f=l[p].x-n,y=l[p].y-a;t.writeVarint(d(f)),t.writeVarint(d(y)),n+=f,a+=y}3===i&&t.writeVarint(h(7,1))}}function y(e,t){var r=typeof e;"string"===r?t.writeStringField(1,e):"boolean"===r?t.writeBooleanField(7,e):"number"===r&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e))}t.exports=n,t.exports.fromVectorTileJs=n,t.exports.fromGeojsonVt=a,t.exports.GeoJSONWrapper=i,l(n,"fromVectorTileJs"),l(a,"fromGeojsonVt"),l(s,"writeTile"),l(o,"writeLayer"),l(u,"writeFeature"),l(c,"writeProperties"),l(h,"command"),l(d,"zigzag"),l(f,"writeGeometry"),l(y,"writeValue")}));p(),p(),p();h(d(),1);var P=h(f(),1);function C(e){if(e<=0)return 0;if(e>=1)return 1;let t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function z(e,t,r,i){let n=new P.default(e,t,r,i);return function(e){return n.solve(e)}}l(C,"easeCubicInOut"),l(z,"bezier");z(.25,.1,.25,1);function B(e,t,r){return Math.min(r,Math.max(t,e))}function V(e,t,r){let i=r-t,n=((e-t)%i+i)%i+t;return n===t?r:n}function E(e,...t){for(let r of t)for(let t in r)e[t]=r[t];return e}function F(e){return Math.log(e)/Math.LN2%1==0}function T(e,t,r){let i={};for(let n in e)i[n]=t.call(r||this,e[n],n,e);return i}function L(e,t,r){let i={};for(let n in e)t.call(r||this,e[n],n,e)&&(i[n]=e[n]);return i}function D(e){return Array.isArray(e)?e.map(D):"object"==typeof e&&e?T(e,D):e}function O(e,t){for(let r=0;r<e.length;r++)if(t.indexOf(e[r])>=0)return!0;return!1}l(B,"clamp"),l(V,"wrap"),l(E,"extend"),l(F,"isPowerOfTwo"),l(T,"mapObject"),l(L,"filterObject"),l(D,"clone"),l(O,"arraysIntersect");var R={};function q(e){R[e]||(typeof console<"u"&&console.warn(e),R[e]=!0)}function U(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function j(e){let t=0;for(let r,i,n=0,a=e.length,s=a-1;n<a;s=n++)r=e[n],i=e[s],t+=(i.x-r.x)*(r.y+i.y);return t}function N(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}l(q,"warnOnce"),l(U,"isCounterClockwise"),l(j,"calculateSignedArea"),l(N,"isWorker");var Z=null;function J(e){if(null==Z){let t=e.navigator?e.navigator.userAgent:null;Z=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return Z}function G(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap}l(J,"isSafari"),l(G,"isImageBitmap"),p(),p();var K=class e{constructor(e,t,r){let i=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let n=new Int32Array(this.arrayBuffer);e=n[0],t=n[1],r=n[2],this.d=t+2*r;for(let e=0;e<this.d*this.d;e++){let t=n[3+e],r=n[3+e+1];i.push(t===r?null:n.subarray(t,r))}let a=n[3+i.length],s=n[3+i.length+1];this.keys=n.subarray(a,s),this.bboxes=n.subarray(s),this.insert=this._insertReadonly}else{this.d=t+2*r;for(let e=0;e<this.d*this.d;e++)i.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;let n=r/t*e;this.min=-n,this.max=e+n}insert(e,t,r,i,n){this._forEachCell(t,r,i,n,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,t,r,i,n,a){this.cells[n].push(a)}query(e,t,r,i,n){let a=this.min,s=this.max;if(e<=a&&t<=a&&s<=r&&s<=i&&!n)return Array.prototype.slice.call(this.keys);{let a=[],s={};return this._forEachCell(e,t,r,i,this._queryCell,a,s,n),a}}_queryCell(e,t,r,i,n,a,s,o){let l=this.cells[n];if(null!==l){let n=this.keys,u=this.bboxes;for(let c=0;c<l.length;c++){let h=l[c];if(void 0===s[h]){let l=4*h;(o?o(u[l+0],u[l+1],u[l+2],u[l+3]):e<=u[l+2]&&t<=u[l+3]&&r>=u[l+0]&&i>=u[l+1])?(s[h]=!0,a.push(n[h])):s[h]=!1}}}}_forEachCell(e,t,r,i,n,a,s,o){let l=this._convertToCellCoord(e),u=this._convertToCellCoord(t),c=this._convertToCellCoord(r),h=this._convertToCellCoord(i);for(let p=l;p<=c;p++)for(let l=u;l<=h;l++){let u=this.d*l+p;if((!o||o(this._convertFromCellCoord(p),this._convertFromCellCoord(l),this._convertFromCellCoord(p+1),this._convertFromCellCoord(l+1)))&&n.call(this,e,t,r,i,u,a,s,o))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,t=3+this.cells.length+1+1,r=0;for(let e=0;e<this.cells.length;e++)r+=this.cells[e].length;let i=new Int32Array(t+r+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;let n=t;for(let t=0;t<e.length;t++){let r=e[t];i[3+t]=n,i.set(r,n),n+=r.length}return i[3+e.length]=n,i.set(this.keys,n),n+=this.keys.length,i[3+e.length+1]=n,i.set(this.bboxes,n),n+=this.bboxes.length,i.buffer}static serialize(e,t){let r=e.toArrayBuffer();return t&&t.push(r),{buffer:r}}static deserialize(t){return new e(t.buffer)}};l(K,"TransferableGridIndex");var X=K;p();var Y=h(f(),1),H={$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"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},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:{required:!0,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",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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:{},"viewport-glyph":{},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-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},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"}}},W=["type","source","source-layer","minzoom","maxzoom","filter","layout"],$=class{constructor(e,t,r,i){this.message=(e?"".concat(e,": "):"")+r,i&&(this.identifier=i),null!=t&&t.__line__&&(this.line=t.__line__)}};l($,"ValidationError");var Q=$;function ee(e,...t){for(let r of t)for(let t in r)e[t]=r[t];return e}l(ee,"extendBy");var te=class extends Error{constructor(e,t){super(t),this.message=t,this.key=e}};l(te,"ExpressionParsingError");var re=te,ie=class e{constructor(e,t=[]){this.parent=e,this.bindings={};for(let[e,r]of t)this.bindings[e]=r}concat(t){return new e(this,t)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error("".concat(e," not found in scope."))}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}};l(ie,"Scope");var ne=ie,ae={kind:"null"},se={kind:"number"},oe={kind:"string"},le={kind:"boolean"},ue={kind:"color"},ce={kind:"object"},he={kind:"value"},pe={kind:"collator"},de={kind:"formatted"},fe={kind:"padding"},ye={kind:"resolvedImage"},me={kind:"variableAnchorOffsetCollection"};function ge(e,t){return{kind:"array",itemType:e,N:t}}function xe(e){if("array"===e.kind){let t=xe(e.itemType);return"number"==typeof e.N?"array<".concat(t,", ").concat(e.N,">"):"value"===e.itemType.kind?"array":"array<".concat(t,">")}return e.kind}l(ge,"array$1"),l(xe,"toString$1");var ve=[ae,se,oe,le,ue,de,ce,ge(he),fe,ye,me];function be(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!be(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(let e of ve)if(!be(e,t))return null}return"Expected ".concat(xe(e)," but found ").concat(xe(t)," instead.")}function we(e,t){return t.some((t=>t.kind===e.kind))}function _e(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}function Se(e,t){return"array"===e.kind&&"array"===t.kind?e.itemType.kind===t.itemType.kind&&"number"==typeof e.N:e.kind===t.kind}l(be,"checkSubtype"),l(we,"isValidType"),l(_e,"isValidNativeType"),l(Se,"verifyType");var Ae=.96422,ke=.82521,Ie=4/29,Me=6/29,Pe=3*Me*Me,Ce=Math.PI/180,ze=180/Math.PI;function Be(e){return(e%=360)<0&&(e+=360),e}function Ve([e,t,r,i]){let n,a,s=Fe((.2225045*(e=Ee(e))+.7168786*(t=Ee(t))+.0606169*(r=Ee(r)))/1);e===t&&t===r?n=a=s:(n=Fe((.4360747*e+.3850649*t+.1430804*r)/Ae),a=Fe((.0139322*e+.0971045*t+.7141733*r)/ke));let o=116*s-16;return[o<0?0:o,500*(n-s),200*(s-a),i]}function Ee(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Fe(e){return e>.008856451679035631?Math.pow(e,1/3):e/Pe+Ie}function Te([e,t,r,i]){let n=(e+16)/116,a=isNaN(t)?n:n+t/500,s=isNaN(r)?n:n-r/200;return n=1*De(n),a=Ae*De(a),s=ke*De(s),[Le(3.1338561*a-1.6168667*n-.4906146*s),Le(-.9787684*a+1.9161415*n+.033454*s),Le(.0719453*a-.2289914*n+1.4052427*s),i]}function Le(e){return(e=e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055)<0?0:e>1?1:e}function De(e){return e>Me?e*e*e:Pe*(e-Ie)}function Oe(e){let[t,r,i,n]=Ve(e),a=Math.sqrt(r*r+i*i);return[Math.round(1e4*a)?Be(Math.atan2(i,r)*ze):NaN,a,t,n]}function Re([e,t,r,i]){return e=isNaN(e)?0:e*Ce,Te([r,Math.cos(e)*t,Math.sin(e)*t,i])}function qe([e,t,r,i]){function n(i){let n=(i+e/30)%12,a=t*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(n-3,9-n,1))}return e=Be(e),t/=100,r/=100,l(n,"f"),[n(0),n(8),n(4),i]}function Ue(e){if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];let t=Ge[e];if(t){let[e,r,i]=t;return[e/255,r/255,i/255,1]}if(e.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){let t=e.length<6?1:2,r=1;return[je(e.slice(r,r+=t)),je(e.slice(r,r+=t)),je(e.slice(r,r+=t)),je(e.slice(r,r+t)||"ff")]}if(e.startsWith("rgb")){let t=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,r=e.match(t);if(r){let[e,t,i,n,a,s,o,l,u,c,h,p]=r,d=[n||" ",o||" ",c].join("");if(" "===d||" /"===d||",,"===d||",,,"===d){let e=[i,s,u].join(""),r="%%%"===e?100:""===e?255:0;if(r){let e=[Ze(+t/r,0,1),Ze(+a/r,0,1),Ze(+l/r,0,1),h?Ne(+h,p):1];if(Je(e))return e}}return}}let r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){let[e,t,i,n,a,s,o,l,u]=r,c=[i||" ",a||" ",o].join("");if(" "===c||" /"===c||",,"===c||",,,"===c){let e=[+t,Ze(+n,0,100),Ze(+s,0,100),l?Ne(+l,u):1];if(Je(e))return qe(e)}}}function je(e){return parseInt(e.padEnd(2,e),16)/255}function Ne(e,t){return Ze(t?e/100:e,0,1)}function Ze(e,t,r){return Math.min(Math.max(t,e),r)}function Je(e){return!e.some(Number.isNaN)}l(Be,"constrainAngle"),l(Ve,"rgbToLab"),l(Ee,"rgb2xyz"),l(Fe,"xyz2lab"),l(Te,"labToRgb"),l(Le,"xyz2rgb"),l(De,"lab2xyz"),l(Oe,"rgbToHcl"),l(Re,"hclToRgb"),l(qe,"hslToRgb"),l(Ue,"parseCssColor"),l(je,"parseHex"),l(Ne,"parseAlpha"),l(Ze,"clamp"),l(Je,"validateNumbers");var Ge={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Ke=class e{constructor(e,t,r,i=1,n=!0){this.r=e,this.g=t,this.b=r,this.a=i,n||(this.r*=i,this.g*=i,this.b*=i,i||this.overwriteGetter("rgb",[e,t,r,i]))}static parse(t){if(t instanceof e)return t;if("string"!=typeof t)return;let r=Ue(t);return r?new e(...r,!1):void 0}get rgb(){let{r:e,g:t,b:r,a:i}=this,n=i||1/0;return this.overwriteGetter("rgb",[e/n,t/n,r/n,i])}get hcl(){return this.overwriteGetter("hcl",Oe(this.rgb))}get lab(){return this.overwriteGetter("lab",Ve(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){let[e,t,r,i]=this.rgb;return"rgba(".concat([e,t,r].map((e=>Math.round(255*e))).join(","),",").concat(i,")")}};l(Ke,"Color");var Xe=Ke;Xe.black=new Xe(0,0,0,1),Xe.white=new Xe(1,1,1,1),Xe.transparent=new Xe(0,0,0,0),Xe.red=new Xe(1,0,0,1);var Ye=class{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}};l(Ye,"Collator");var He=Ye,We=class{constructor(e,t,r,i,n){this.text=e,this.image=t,this.scale=r,this.fontStack=i,this.textColor=n}};l(We,"FormattedSection");var $e=We,Qe=class e{constructor(e){this.sections=e}static fromString(t){return new e([new $e(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.name.length))}static factory(t){return t instanceof e?t:e.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}};l(Qe,"Formatted");var et=Qe,tt=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if("number"==typeof t)return new e([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(let e of t)if("number"!=typeof e)return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new e(t)}}toString(){return JSON.stringify(this.values)}};l(tt,"Padding");var rt=tt,it=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]),nt=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let e=0;e<t.length;e+=2){let r=t[e],i=t[e+1];if("string"!=typeof r||!it.has(r)||!Array.isArray(i)||2!==i.length||"number"!=typeof i[0]||"number"!=typeof i[1])return}return new e(t)}}toString(){return JSON.stringify(this.values)}};l(nt,"VariableAnchorOffsetCollection");var at=nt,st=class e{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(t){return t?new e({name:t,available:!1}):null}};l(st,"ResolvedImage");var ot=st;function lt(e,t,r,i){if(!("number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255)){return"Invalid rgba value [".concat(("number"==typeof i?[e,t,r,i]:[e,t,r]).join(", "),"]: 'r', 'g', and 'b' must be between 0 and 255.")}return typeof i>"u"||"number"==typeof i&&i>=0&&i<=1?null:"Invalid rgba value [".concat([e,t,r,i].join(", "),"]: 'a' must be between 0 and 1.")}function ut(e){if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||e instanceof Xe||e instanceof He||e instanceof et||e instanceof rt||e instanceof at||e instanceof ot)return!0;if(Array.isArray(e)){for(let t of e)if(!ut(t))return!1;return!0}if("object"==typeof e){for(let t in e)if(!ut(e[t]))return!1;return!0}return!1}function ct(e){if(null===e)return ae;if("string"==typeof e)return oe;if("boolean"==typeof e)return le;if("number"==typeof e)return se;if(e instanceof Xe)return ue;if(e instanceof He)return pe;if(e instanceof et)return de;if(e instanceof rt)return fe;if(e instanceof at)return me;if(e instanceof ot)return ye;if(Array.isArray(e)){let t,r=e.length;for(let r of e){let e=ct(r);if(t){if(t===e)continue;t=he;break}t=e}return ge(t||he,r)}return ce}function ht(e){let t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Xe||e instanceof et||e instanceof rt||e instanceof at||e instanceof ot?e.toString():JSON.stringify(e)}l(lt,"validateRGBA"),l(ut,"isValue"),l(ct,"typeOf"),l(ht,"toString");var pt=class e{constructor(e,t){this.type=e,this.value=t}static parse(t,r){if(2!==t.length)return r.error("'literal' expression requires exactly one argument, but found ".concat(t.length-1," instead."));if(!ut(t[1]))return r.error("invalid value");let i=t[1],n=ct(i),a=r.expectedType;return"array"===n.kind&&0===n.N&&a&&"array"===a.kind&&("number"!=typeof a.N||0===a.N)&&(n=a),new e(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}};l(pt,"Literal");var dt=pt,ft=class{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}};l(ft,"RuntimeError");var yt=ft,mt={string:oe,number:se,boolean:le,object:ce},gt=class e{constructor(e,t){this.type=e,this.args=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i,n=1,a=t[0];if("array"===a){let e,a;if(t.length>2){let i=t[1];if("string"!=typeof i||!(i in mt)||"object"===i)return r.error('The item type argument of "array" must be one of string, number, boolean',1);e=mt[i],n++}else e=he;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return r.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}i=ge(e,a)}else{if(!mt[a])throw new Error("Types doesn't contain name = ".concat(a));i=mt[a]}let s=[];for(;n<t.length;n++){let e=r.parse(t[n],n,he);if(!e)return null;s.push(e)}return new e(i,s)}evaluate(e){for(let t=0;t<this.args.length;t++){let r=this.args[t].evaluate(e);if(!be(this.type,ct(r)))return r;if(t===this.args.length-1)throw new yt("Expected value to be of type ".concat(xe(this.type),", but found ").concat(xe(ct(r))," instead."))}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}};l(gt,"Assertion");var xt=gt,vt={"to-boolean":le,"to-color":ue,"to-number":se,"to-string":oe},bt=class e{constructor(e,t){this.type=e,this.args=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i=t[0];if(!vt[i])throw new Error("Can't parse ".concat(i," as it is not part of the known types"));if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return r.error("Expected one argument.");let n=vt[i],a=[];for(let e=1;e<t.length;e++){let i=r.parse(t[e],e,he);if(!i)return null;a.push(i)}return new e(n,a)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let t,r;for(let i of this.args){if(t=i.evaluate(e),r=null,t instanceof Xe)return t;if("string"==typeof t){let r=e.parseColor(t);if(r)return r}else if(Array.isArray(t)&&(r=t.length<3||t.length>4?"Invalid rbga value ".concat(JSON.stringify(t),": expected an array containing either three or four numeric values."):lt(t[0],t[1],t[2],t[3]),!r))return new Xe(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new yt(r||"Could not parse color from value '".concat("string"==typeof t?t:JSON.stringify(t),"'"))}case"padding":{let t;for(let r of this.args){t=r.evaluate(e);let i=rt.parse(t);if(i)return i}throw new yt("Could not parse padding from value '".concat("string"==typeof t?t:JSON.stringify(t),"'"))}case"variableAnchorOffsetCollection":{let t;for(let r of this.args){t=r.evaluate(e);let i=at.parse(t);if(i)return i}throw new yt("Could not parse variableAnchorOffsetCollection from value '".concat("string"==typeof t?t:JSON.stringify(t),"'"))}case"number":{let t=null;for(let r of this.args){if(t=r.evaluate(e),null===t)return 0;let i=Number(t);if(!isNaN(i))return i}throw new yt("Could not convert ".concat(JSON.stringify(t)," to number."))}case"formatted":return et.fromString(ht(this.args[0].evaluate(e)));case"resolvedImage":return ot.fromString(ht(this.args[0].evaluate(e)));default:return ht(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}};l(bt,"Coercion");var wt=bt,_t=["Unknown","Point","LineString","Polygon"],St=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?_t[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=Xe.parse(e)),t}};l(St,"EvaluationContext");var At=St,kt=class e{constructor(e,t,r=[],i,n=new ne,a=[]){this.registry=e,this.path=r,this.key=r.map((e=>"[".concat(e,"]"))).join(""),this.scope=n,this.errors=a,this.expectedType=i,this._isConstant=t}parse(e,t,r,i,n={}){return t?this.concat(t,r,i)._parse(e,n):this._parse(e,n)}_parse(e,t){function r(e,t,r){return"assert"===r?new xt(t,[e]):"coerce"===r?new wt(t,[e]):e}if((null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e)&&(e=["literal",e]),l(r,"annotate"),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let i=e[0];if("string"!=typeof i)return this.error("Expression name must be a string, but found ".concat(typeof i,' instead. If you wanted a literal array, use ["literal", [...]].'),0),null;let n=this.registry[i];if(n){let i=n.parse(e,this);if(!i)return null;if(this.expectedType){let e=this.expectedType,n=i.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==n.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==n.kind&&"string"!==n.kind)if("padding"!==e.kind||"value"!==n.kind&&"number"!==n.kind&&"array"!==n.kind)if("variableAnchorOffsetCollection"!==e.kind||"value"!==n.kind&&"array"!==n.kind){if(this.checkSubtype(e,n))return null}else i=r(i,e,t.typeAnnotation||"coerce");else i=r(i,e,t.typeAnnotation||"coerce");else i=r(i,e,t.typeAnnotation||"coerce");else i=r(i,e,t.typeAnnotation||"assert")}if(!(i instanceof dt)&&"resolvedImage"!==i.type.kind&&this._isConstant(i)){let e=new At;try{i=new dt(i.type,i.evaluate(e))}catch(e){return this.error(e.message),null}}return i}return this.error('Unknown expression "'.concat(i,'". If you wanted a literal array, use ["literal", [...]].'),0)}return typeof e>"u"?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found ".concat(typeof e," instead."))}concat(t,r,i){let n="number"==typeof t?this.path.concat(t):this.path,a=i?this.scope.concat(i):this.scope;return new e(this.registry,this._isConstant,n,r||null,a,this.errors)}error(e,...t){let r="".concat(this.key).concat(t.map((e=>"[".concat(e,"]"))).join(""));this.errors.push(new re(r,e))}checkSubtype(e,t){let r=be(e,t);return r&&this.error(r),r}};l(kt,"ParsingContext");var It=kt,Mt=class e{constructor(e,t,r){this.type=pe,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(t,r){if(2!==t.length)return r.error("Expected one argument.");let i=t[1];if("object"!=typeof i||Array.isArray(i))return r.error("Collator options argument must be an object.");let n=r.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,le);if(!n)return null;let a=r.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,le);if(!a)return null;let s=null;return i.locale&&(s=r.parse(i.locale,1,oe),!s)?null:new e(n,a,s)}evaluate(e){return new He(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}};l(Mt,"CollatorExpression");var Pt=Mt,Ct=8192;function zt(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Bt(e){return(180+e)/360}function Vt(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Et(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function Ft(e,t){let r=Bt(e[0]),i=Vt(e[1]),n=Math.pow(2,t.z);return[Math.round(r*n*Ct),Math.round(i*n*Ct)]}function Tt(e,t,r){let i=e[0]-t[0],n=e[1]-t[1],a=e[0]-r[0],s=e[1]-r[1];return i*s-a*n==0&&i*a<=0&&n*s<=0}function Lt(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function Dt(e,t){let r=!1;for(let i=0,n=t.length;i<n;i++){let n=t[i];for(let t=0,i=n.length;t<i-1;t++){if(Tt(e,n[t],n[t+1]))return!1;Lt(e,n[t],n[t+1])&&(r=!r)}}return r}function Ot(e,t){for(let r=0;r<t.length;r++)if(Dt(e,t[r]))return!0;return!1}function Rt(e,t){return e[0]*t[1]-e[1]*t[0]}function qt(e,t,r,i){let n=e[0]-r[0],a=e[1]-r[1],s=t[0]-r[0],o=t[1]-r[1],l=i[0]-r[0],u=i[1]-r[1],c=n*u-l*a,h=s*u-l*o;return c>0&&h<0||c<0&&h>0}function Ut(e,t,r,i){let n=[t[0]-e[0],t[1]-e[1]];return 0!==Rt([i[0]-r[0],i[1]-r[1]],n)&&!(!qt(e,t,r,i)||!qt(r,i,e,t))}function jt(e,t,r){for(let i of r)for(let r=0;r<i.length-1;++r)if(Ut(e,t,i[r],i[r+1]))return!0;return!1}function Nt(e,t){for(let r=0;r<e.length;++r)if(!Dt(e[r],t))return!1;for(let r=0;r<e.length-1;++r)if(jt(e[r],e[r+1],t))return!1;return!0}function Zt(e,t){for(let r=0;r<t.length;r++)if(Nt(e,t[r]))return!0;return!1}function Jt(e,t,r){let i=[];for(let n=0;n<e.length;n++){let a=[];for(let i=0;i<e[n].length;i++){let s=Ft(e[n][i],r);zt(t,s),a.push(s)}i.push(a)}return i}function Gt(e,t,r){let i=[];for(let n=0;n<e.length;n++){let a=Jt(e[n],t,r);i.push(a)}return i}function Kt(e,t,r,i){if(e[0]<r[0]||e[0]>r[2]){let t=.5*i,n=e[0]-r[0]>t?-i:r[0]-e[0]>t?i:0;0===n&&(n=e[0]-r[2]>t?-i:r[2]-e[0]>t?i:0),e[0]+=n}zt(t,e)}function Xt(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}function Yt(e,t,r,i){let n=Math.pow(2,i.z)*Ct,a=[i.x*Ct,i.y*Ct],s=[];for(let i of e)for(let e of i){let i=[e.x+a[0],e.y+a[1]];Kt(i,t,r,n),s.push(i)}return s}function Ht(e,t,r,i){let n=Math.pow(2,i.z)*Ct,a=[i.x*Ct,i.y*Ct],s=[];for(let r of e){let e=[];for(let i of r){let r=[i.x+a[0],i.y+a[1]];zt(t,r),e.push(r)}s.push(e)}if(t[2]-t[0]<=n/2){Xt(t);for(let e of s)for(let i of e)Kt(i,t,r,n)}return s}function Wt(e,t){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if("Polygon"===t.type){let a=Jt(t.coordinates,i,n),s=Yt(e.geometry(),r,i,n);if(!Et(r,i))return!1;for(let e of s)if(!Dt(e,a))return!1}if("MultiPolygon"===t.type){let a=Gt(t.coordinates,i,n),s=Yt(e.geometry(),r,i,n);if(!Et(r,i))return!1;for(let e of s)if(!Ot(e,a))return!1}return!0}function $t(e,t){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if("Polygon"===t.type){let a=Jt(t.coordinates,i,n),s=Ht(e.geometry(),r,i,n);if(!Et(r,i))return!1;for(let e of s)if(!Nt(e,a))return!1}if("MultiPolygon"===t.type){let a=Gt(t.coordinates,i,n),s=Ht(e.geometry(),r,i,n);if(!Et(r,i))return!1;for(let e of s)if(!Zt(e,a))return!1}return!0}l(zt,"updateBBox"),l(Bt,"mercatorXfromLng"),l(Vt,"mercatorYfromLat"),l(Et,"boxWithinBox"),l(Ft,"getTileCoordinates"),l(Tt,"onBoundary"),l(Lt,"rayIntersect"),l(Dt,"pointWithinPolygon"),l(Ot,"pointWithinPolygons"),l(Rt,"perp"),l(qt,"twoSided"),l(Ut,"lineIntersectLine"),l(jt,"lineIntersectPolygon"),l(Nt,"lineStringWithinPolygon"),l(Zt,"lineStringWithinPolygons"),l(Jt,"getTilePolygon"),l(Gt,"getTilePolygons"),l(Kt,"updatePoint"),l(Xt,"resetBBox"),l(Yt,"getTilePoints"),l(Ht,"getTileLines"),l(Wt,"pointsWithinPolygons"),l($t,"linesWithinPolygons");var Qt=class e{constructor(e,t){this.type=le,this.geojson=e,this.geometries=t}static parse(t,r){if(2!==t.length)return r.error("'within' expression requires exactly one argument, but found ".concat(t.length-1," instead."));if(ut(t[1])){let r=t[1];if("FeatureCollection"===r.type)for(let t=0;t<r.features.length;++t){let i=r.features[t].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new e(r,r.features[t].geometry)}else if("Feature"===r.type){let t=r.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new e(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new e(r,r)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return Wt(e,this.geometries);if("LineString"===e.geometryType())return $t(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}};l(Qt,"Within");var er=Qt,tr=class e{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(t,r){if(2!==t.length||"string"!=typeof t[1])return r.error("'var' expression requires exactly one string literal argument.");let i=t[1];return r.scope.has(i)?new e(i,r.scope.get(i)):r.error('Unknown variable "'.concat(i,'". Make sure "').concat(i,'" has been bound in an enclosing "let" expression before using it.'),1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}};l(tr,"Var");var rr=tr,ir=class e{constructor(e,t,r,i){this.name=e,this.type=t,this._evaluate=r,this.args=i}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(t,r){let i=t[0],n=e.definitions[i];if(!n)return r.error('Unknown expression "'.concat(i,'". If you wanted a literal array, use ["literal", [...]].'),0);let a=Array.isArray(n)?n[0]:n.type,s=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=s.filter((([e])=>!Array.isArray(e)||e.length===t.length-1)),l=null;for(let[n,s]of o){l=new It(r.registry,sr,r.path,null,r.scope);let o=[],u=!1;for(let e=1;e<t.length;e++){let r=t[e],i=Array.isArray(n)?n[e-1]:n.type,a=l.parse(r,1+o.length,i);if(!a){u=!0;break}o.push(a)}if(!u){if(Array.isArray(n)&&n.length!==o.length){l.error("Expected ".concat(n.length," arguments, but found ").concat(o.length," instead."));continue}for(let e=0;e<o.length;e++){let t=Array.isArray(n)?n[e]:n.type,r=o[e];l.concat(e+1).checkSubtype(t,r.type)}if(0===l.errors.length)return new e(i,a,s,o)}}if(1===o.length)r.errors.push(...l.errors);else{let e=(o.length?o:s).map((([e])=>ar(e))).join(" | "),i=[];for(let e=1;e<t.length;e++){let n=r.parse(t[e],1+i.length);if(!n)return null;i.push(xe(n.type))}r.error("Expected arguments of type ".concat(e,", but found (").concat(i.join(", "),") instead."))}return null}static register(t,r){e.definitions=r;for(let i in r)t[i]=e}};l(ir,"CompoundExpression");var nr=ir;function ar(e){return Array.isArray(e)?"(".concat(e.map(xe).join(", "),")"):"(".concat(xe(e.type),"...)")}function sr(e){if(e instanceof rr)return sr(e.boundExpression);if(e instanceof nr&&"error"===e.name)return!1;if(e instanceof Pt)return!1;if(e instanceof er)return!1;let t=e instanceof wt||e instanceof xt,r=!0;return e.eachChild((e=>{r=t?r&&sr(e):r&&e instanceof dt})),!!r&&(or(e)&&ur(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]))}function or(e){if(e instanceof nr){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof er)return!1;let t=!0;return e.eachChild((e=>{t&&!or(e)&&(t=!1)})),t}function lr(e){if(e instanceof nr&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!lr(e)&&(t=!1)})),t}function ur(e,t){if(e instanceof nr&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild((e=>{r&&!ur(e,t)&&(r=!1)})),r}function cr(e,t){let r,i,n=e.length-1,a=0,s=n,o=0;for(;a<=s;)if(o=Math.floor((a+s)/2),r=e[o],i=e[o+1],r<=t){if(o===n||t<i)return o;a=o+1}else{if(!(r>t))throw new yt("Input is not a number.");s=o-1}return 0}l(ar,"stringifySignature"),l(sr,"isExpressionConstant"),l(or,"isFeatureConstant"),l(lr,"isStateConstant"),l(ur,"isGlobalPropertyConstant"),l(cr,"findStopLessThanOrEqualTo");var hr=class e{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(let[e,t]of r)this.labels.push(e),this.outputs.push(t)}static parse(t,r){if(t.length-1<4)return r.error("Expected at least 4 arguments, but found only ".concat(t.length-1,"."));if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");let i=r.parse(t[1],1,se);if(!i)return null;let n=[],a=null;r.expectedType&&"value"!==r.expectedType.kind&&(a=r.expectedType);for(let e=1;e<t.length;e+=2){let i=1===e?-1/0:t[e],s=t[e+1],o=e,l=e+1;if("number"!=typeof i)return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',o);if(n.length&&n[n.length-1][0]>=i)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',o);let u=r.parse(s,l,a);if(!u)return null;a=a||u.type,n.push([i,u])}return new e(a,i,n)}evaluate(e){let t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);let i=this.input.evaluate(e);if(i<=t[0])return r[0].evaluate(e);let n=t.length;return i>=t[n-1]?r[n-1].evaluate(e):r[cr(t,i)].evaluate(e)}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}};l(hr,"Step");var pr=hr;function dr(e){return"rgb"===e||"hcl"===e||"lab"===e}function fr(e,t,r){return e+r*(t-e)}function yr(e,t,r,i="rgb"){switch(i){case"rgb":{let[i,n,a,s]=mr(e.rgb,t.rgb,r);return new Xe(i,n,a,s,!1)}case"hcl":{let i,n,[a,s,o,l]=e.hcl,[u,c,h,p]=t.hcl;if(isNaN(a)||isNaN(u))isNaN(a)?isNaN(u)?i=NaN:(i=u,(1===o||0===o)&&(n=c)):(i=a,(1===h||0===h)&&(n=s));else{let e=u-a;u>a&&e>180?e-=360:u<a&&a-u>180&&(e+=360),i=a+r*e}let[d,f,y,m]=Re([i,null!=n?n:fr(s,c,r),fr(o,h,r),fr(l,p,r)]);return new Xe(d,f,y,m,!1)}case"lab":{let[i,n,a,s]=Te(mr(e.lab,t.lab,r));return new Xe(i,n,a,s,!1)}}}function mr(e,t,r){return e.map(((e,i)=>fr(e,t[i],r)))}function gr(e,t,r){return new rt(mr(e.values,t.values,r))}function xr(e,t,r){let i=e.values,n=t.values;if(i.length!==n.length)throw new yt("Cannot interpolate values of different length. from: ".concat(e.toString(),", to: ").concat(t.toString()));let a=[];for(let e=0;e<i.length;e+=2){if(i[e]!==n[e])throw new yt("Cannot interpolate values containing mismatched anchors. from[".concat(e,"]: ").concat(i[e],", to[").concat(e,"]: ").concat(n[e]));a.push(i[e]);let[t,s]=i[e+1],[o,l]=n[e+1];a.push([fr(t,o,r),fr(s,l,r)])}return new at(a)}l(dr,"isSupportedInterpolationColorSpace"),l(fr,"number"),l(yr,"color"),l(mr,"array"),l(gr,"padding"),l(xr,"variableAnchorOffsetCollection");var vr={number:fr,color:yr,array:mr,padding:gr,variableAnchorOffsetCollection:xr},br=class e{constructor(e,t,r,i,n){this.type=e,this.operator=t,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];for(let[e,t]of n)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,r,i){let n=0;if("exponential"===e.name)n=_r(t,e.base,r,i);else if("linear"===e.name)n=_r(t,1,r,i);else if("cubic-bezier"===e.name){let a=e.controlPoints;n=new Y.default(a[0],a[1],a[2],a[3]).solve(_r(t,1,r,i))}return n}static parse(t,r){let[i,n,a,...s]=t;if(!Array.isArray(n)||0===n.length)return r.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){let e=n[1];if("number"!=typeof e)return r.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return r.error("Unknown interpolation type ".concat(String(n[0])),1,0);{let e=n.slice(1);if(4!==e.length||e.some((e=>"number"!=typeof e||e<0||e>1)))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}}if(t.length-1<4)return r.error("Expected at least 4 arguments, but found only ".concat(t.length-1,"."));if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(a=r.parse(a,2,se),!a)return null;let o=[],l=null;"interpolate-hcl"===i||"interpolate-lab"===i?l=ue:r.expectedType&&"value"!==r.expectedType.kind&&(l=r.expectedType);for(let e=0;e<s.length;e+=2){let t=s[e],i=s[e+1],n=e+3,a=e+4;if("number"!=typeof t)return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',n);if(o.length&&o[o.length-1][0]>=t)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);let u=r.parse(i,a,l);if(!u)return null;l=l||u.type,o.push([t,u])}return Se(l,se)||Se(l,ue)||Se(l,fe)||Se(l,me)||Se(l,ge(se))?new e(l,i,n,a,o):r.error("Type ".concat(xe(l)," is not interpolatable."))}evaluate(t){let r=this.labels,i=this.outputs;if(1===r.length)return i[0].evaluate(t);let n=this.input.evaluate(t);if(n<=r[0])return i[0].evaluate(t);let a=r.length;if(n>=r[a-1])return i[a-1].evaluate(t);let s=cr(r,n),o=r[s],l=r[s+1],u=e.interpolationFactor(this.interpolation,n,o,l),c=i[s].evaluate(t),h=i[s+1].evaluate(t);switch(this.operator){case"interpolate":return vr[this.type.kind](c,h,u);case"interpolate-hcl":return vr.color(c,h,u,"hcl");case"interpolate-lab":return vr.color(c,h,u,"lab")}}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}};l(br,"Interpolate");var wr=br;function _r(e,t,r,i){let n=i-r,a=e-r;return 0===n?0:1===t?a/n:(Math.pow(t,a)-1)/(Math.pow(t,n)-1)}l(_r,"exponentialInterpolation");var Sr=class e{constructor(e,t){this.type=e,this.args=t}static parse(t,r){if(t.length<2)return r.error("Expectected at least one argument.");let i=null,n=r.expectedType;n&&"value"!==n.kind&&(i=n);let a=[];for(let e of t.slice(1)){let t=r.parse(e,1+a.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,a.push(t)}if(!i)throw new Error("No output type");return n&&a.some((e=>be(n,e.type)))?new e(he,a):new e(i,a)}evaluate(e){let t,r=null,i=0;for(let n of this.args)if(i++,r=n.evaluate(e),r&&r instanceof ot&&!r.available&&(t||(t=r.name),r=null,i===this.args.length&&(r=t)),null!==r)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}};l(Sr,"Coalesce");var Ar=Sr,kr=class e{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let t of this.bindings)e(t[1]);e(this.result)}static parse(t,r){if(t.length<4)return r.error("Expected at least 3 arguments, but found ".concat(t.length-1," instead."));let i=[];for(let e=1;e<t.length-1;e+=2){let n=t[e];if("string"!=typeof n)return r.error("Expected string, but found ".concat(typeof n," instead."),e);if(/[^a-zA-Z0-9_]/.test(n))return r.error("Variable names must contain only alphanumeric characters or '_'.",e);let a=r.parse(t[e+1],e+1);if(!a)return null;i.push([n,a])}let n=r.parse(t[t.length-1],t.length-1,r.expectedType,i);return n?new e(i,n):null}outputDefined(){return this.result.outputDefined()}};l(kr,"Let");var Ir=kr,Mr=class e{constructor(e,t,r){this.type=e,this.index=t,this.input=r}static parse(t,r){if(3!==t.length)return r.error("Expected 2 arguments, but found ".concat(t.length-1," instead."));let i=r.parse(t[1],1,se),n=r.parse(t[2],2,ge(r.expectedType||he));if(!i||!n)return null;let a=n.type;return new e(a.itemType,i,n)}evaluate(e){let t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new yt("Array index out of bounds: ".concat(t," < 0."));if(t>=r.length)throw new yt("Array index out of bounds: ".concat(t," > ").concat(r.length-1,"."));if(t!==Math.floor(t))throw new yt("Array index must be an integer, but found ".concat(t," instead."));return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}};l(Mr,"At");var Pr=Mr,Cr=class e{constructor(e,t){this.type=le,this.needle=e,this.haystack=t}static parse(t,r){if(3!==t.length)return r.error("Expected 2 arguments, but found ".concat(t.length-1," instead."));let i=r.parse(t[1],1,he),n=r.parse(t[2],2,he);return i&&n?we(i.type,[le,oe,se,ae,he])?new e(i,n):r.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(xe(i.type)," instead")):null}evaluate(e){let t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!_e(t,["boolean","string","number","null"]))throw new yt("Expected first argument to be of type boolean, string, number or null, but found ".concat(xe(ct(t))," instead."));if(!_e(r,["string","array"]))throw new yt("Expected second argument to be of type array or string, but found ".concat(xe(ct(r))," instead."));return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}};l(Cr,"In");var zr=Cr,Br=class e{constructor(e,t,r){this.type=se,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(t,r){if(t.length<=2||t.length>=5)return r.error("Expected 3 or 4 arguments, but found ".concat(t.length-1," instead."));let i=r.parse(t[1],1,he),n=r.parse(t[2],2,he);if(!i||!n)return null;if(!we(i.type,[le,oe,se,ae,he]))return r.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(xe(i.type)," instead"));if(4===t.length){let a=r.parse(t[3],3,se);return a?new e(i,n,a):null}return new e(i,n)}evaluate(e){let t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!_e(t,["boolean","string","number","null"]))throw new yt("Expected first argument to be of type boolean, string, number or null, but found ".concat(xe(ct(t))," instead."));if(!_e(r,["string","array"]))throw new yt("Expected second argument to be of type array or string, but found ".concat(xe(ct(r))," instead."));if(this.fromIndex){let i=this.fromIndex.evaluate(e);return r.indexOf(t,i)}return r.indexOf(t)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}};l(Br,"IndexOf");var Vr=Br,Er=class e{constructor(e,t,r,i,n,a){this.inputType=e,this.type=t,this.input=r,this.cases=i,this.outputs=n,this.otherwise=a}static parse(t,r){if(t.length<5)return r.error("Expected at least 4 arguments, but found only ".concat(t.length-1,"."));if(t.length%2!=1)return r.error("Expected an even number of arguments.");let i,n;r.expectedType&&"value"!==r.expectedType.kind&&(n=r.expectedType);let a={},s=[];for(let e=2;e<t.length-1;e+=2){let o=t[e],l=t[e+1];Array.isArray(o)||(o=[o]);let u=r.concat(e);if(0===o.length)return u.error("Expected at least one branch label.");for(let e of o){if("number"!=typeof e&&"string"!=typeof e)return u.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than ".concat(Number.MAX_SAFE_INTEGER,"."));if("number"==typeof e&&Math.floor(e)!==e)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,ct(e)))return null}else i=ct(e);if(typeof a[String(e)]<"u")return u.error("Branch labels must be unique.");a[String(e)]=s.length}let c=r.parse(l,e,n);if(!c)return null;n=n||c.type,s.push(c)}let o=r.parse(t[1],1,he);if(!o)return null;let l=r.parse(t[t.length-1],t.length-1,n);return!l||"value"!==o.type.kind&&r.concat(1).checkSubtype(i,o.type)?null:new e(i,n,o,a,s,l)}evaluate(e){let t=this.input.evaluate(e);return(ct(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}};l(Er,"Match");var Fr=Er,Tr=class e{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(t,r){if(t.length<4)return r.error("Expected at least 3 arguments, but found only ".concat(t.length-1,"."));if(t.length%2!=0)return r.error("Expected an odd number of arguments.");let i;r.expectedType&&"value"!==r.expectedType.kind&&(i=r.expectedType);let n=[];for(let e=1;e<t.length-1;e+=2){let a=r.parse(t[e],e,le);if(!a)return null;let s=r.parse(t[e+1],e+1,i);if(!s)return null;n.push([a,s]),i=i||s.type}let a=r.parse(t[t.length-1],t.length-1,i);if(!a)return null;if(!i)throw new Error("Can't infer output type");return new e(i,n,a)}evaluate(e){for(let[t,r]of this.branches)if(t.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[t,r]of this.branches)e(t),e(r);e(this.otherwise)}outputDefined(){return this.branches.every((([e,t])=>t.outputDefined()))&&this.otherwise.outputDefined()}};l(Tr,"Case");var Lr=Tr,Dr=class e{constructor(e,t,r,i){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=i}static parse(t,r){if(t.length<=2||t.length>=5)return r.error("Expected 3 or 4 arguments, but found ".concat(t.length-1," instead."));let i=r.parse(t[1],1,he),n=r.parse(t[2],2,se);if(!i||!n)return null;if(!we(i.type,[ge(he),oe,he]))return r.error("Expected first argument to be of type array or string, but found ".concat(xe(i.type)," instead"));if(4===t.length){let a=r.parse(t[3],3,se);return a?new e(i.type,i,n,a):null}return new e(i.type,i,n)}evaluate(e){let t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!_e(t,["string","array"]))throw new yt("Expected first argument to be of type array or string, but found ".concat(xe(ct(t))," instead."));if(this.endIndex){let i=this.endIndex.evaluate(e);return t.slice(r,i)}return t.slice(r)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};l(Dr,"Slice");var Or=Dr;function Rr(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function qr(e,t,r){return t===r}function Ur(e,t,r){return t!==r}function jr(e,t,r){return t<r}function Nr(e,t,r){return t>r}function Zr(e,t,r){return t<=r}function Jr(e,t,r){return t>=r}function Gr(e,t,r,i){return 0===i.compare(t,r)}function Kr(e,t,r,i){return!Gr(0,t,r,i)}function Xr(e,t,r,i){return i.compare(t,r)<0}function Yr(e,t,r,i){return i.compare(t,r)>0}function Hr(e,t,r,i){return i.compare(t,r)<=0}function Wr(e,t,r,i){return i.compare(t,r)>=0}function $r(e,t,r){var i;let n="=="!==e&&"!="!==e;return l(i=class{constructor(e,t,r){this.type=le,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");let r=e[0],a=t.parse(e[1],1,he);if(!a)return null;if(!Rr(r,a.type))return t.concat(1).error('"'.concat(r,"\" comparisons are not supported for type '").concat(xe(a.type),"'."));let s=t.parse(e[2],2,he);if(!s)return null;if(!Rr(r,s.type))return t.concat(2).error('"'.concat(r,"\" comparisons are not supported for type '").concat(xe(s.type),"'."));if(a.type.kind!==s.type.kind&&"value"!==a.type.kind&&"value"!==s.type.kind)return t.error("Cannot compare types '".concat(xe(a.type),"' and '").concat(xe(s.type),"'."));n&&("value"===a.type.kind&&"value"!==s.type.kind?a=new xt(s.type,[a]):"value"!==a.type.kind&&"value"===s.type.kind&&(s=new xt(a.type,[s])));let o=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==s.type.kind&&"value"!==a.type.kind&&"value"!==s.type.kind)return t.error("Cannot use collator to compare non-string types.");if(o=t.parse(e[3],3,pe),!o)return null}return new i(a,s,o)}evaluate(i){let a=this.lhs.evaluate(i),s=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){let t=ct(a),r=ct(s);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new yt('Expected arguments for "'.concat(e,'" to be (string, string) or (number, number), but found (').concat(t.kind,", ").concat(r.kind,") instead."))}if(this.collator&&!n&&this.hasUntypedArgument){let e=ct(a),r=ct(s);if("string"!==e.kind||"string"!==r.kind)return t(i,a,s)}return this.collator?r(i,a,s,this.collator.evaluate(i)):t(i,a,s)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}},"Comparison"),i}l(Rr,"isComparableType"),l(qr,"eq"),l(Ur,"neq"),l(jr,"lt"),l(Nr,"gt"),l(Zr,"lteq"),l(Jr,"gteq"),l(Gr,"eqCollate"),l(Kr,"neqCollate"),l(Xr,"ltCollate"),l(Yr,"gtCollate"),l(Hr,"lteqCollate"),l(Wr,"gteqCollate"),l($r,"makeComparison");var Qr=$r("==",qr,Gr),ei=$r("!=",Ur,Kr),ti=$r("<",jr,Xr),ri=$r(">",Nr,Yr),ii=$r("<=",Zr,Hr),ni=$r(">=",Jr,Wr),ai=class e{constructor(e,t,r,i,n){this.type=oe,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=i,this.maxFractionDigits=n}static parse(t,r){if(3!==t.length)return r.error("Expected two arguments.");let i=r.parse(t[1],1,se);if(!i)return null;let n=t[2];if("object"!=typeof n||Array.isArray(n))return r.error("NumberFormat options argument must be an object.");let a=null;if(n.locale&&(a=r.parse(n.locale,1,oe),!a))return null;let s=null;if(n.currency&&(s=r.parse(n.currency,1,oe),!s))return null;let o=null;if(n["min-fraction-digits"]&&(o=r.parse(n["min-fraction-digits"],1,se),!o))return null;let l=null;return n["max-fraction-digits"]&&(l=r.parse(n["max-fraction-digits"],1,se),!l)?null:new e(i,a,s,o,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}};l(ai,"NumberFormat");var si=ai,oi=class e{constructor(e){this.type=de,this.sections=e}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return r.error("First argument must be an image or text section.");let n=[],a=!1;for(let e=1;e<=t.length-1;++e){let i=t[e];if(a&&"object"==typeof i&&!Array.isArray(i)){a=!1;let e=null;if(i["font-scale"]&&(e=r.parse(i["font-scale"],1,se),!e))return null;let t=null;if(i["text-font"]&&(t=r.parse(i["text-font"],1,ge(oe)),!t))return null;let s=null;if(i["text-color"]&&(s=r.parse(i["text-color"],1,ue),!s))return null;let o=n[n.length-1];o.scale=e,o.font=t,o.textColor=s}else{let i=r.parse(t[e],1,he);if(!i)return null;let s=i.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");a=!0,n.push({content:i,scale:null,font:null,textColor:null})}}return new e(n)}evaluate(e){let t=l((t=>{let r=t.content.evaluate(e);return ct(r)===ye?new $e("",r,null,null,null):new $e(ht(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)}),"evaluateSection");return new et(this.sections.map(t))}eachChild(e){for(let t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}};l(oi,"FormatExpression");var li=oi,ui=class e{constructor(e){this.type=ye,this.input=e}static parse(t,r){if(2!==t.length)return r.error("Expected two arguments.");let i=r.parse(t[1],1,oe);return i?new e(i):r.error("No image name provided.")}evaluate(e){let t=this.input.evaluate(e),r=ot.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}};l(ui,"ImageExpression");var ci=ui,hi=class e{constructor(e){this.type=se,this.input=e}static parse(t,r){if(2!==t.length)return r.error("Expected 1 argument, but found ".concat(t.length-1," instead."));let i=r.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?r.error("Expected argument of type string or array, but found ".concat(xe(i.type)," instead.")):new e(i):null}evaluate(e){let t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new yt("Expected value to be of type string or array, but found ".concat(xe(ct(t))," instead."))}eachChild(e){e(this.input)}outputDefined(){return!1}};l(hi,"Length");var pi={"==":Qr,"!=":ei,">":ri,"<":ti,">=":ni,"<=":ii,array:xt,at:Pr,boolean:xt,case:Lr,coalesce:Ar,collator:Pt,format:li,image:ci,in:zr,"index-of":Vr,interpolate:wr,"interpolate-hcl":wr,"interpolate-lab":wr,length:hi,let:Ir,literal:dt,match:Fr,number:xt,"number-format":si,object:xt,slice:Or,step:pr,string:xt,"to-boolean":wt,"to-color":wt,"to-number":wt,"to-string":wt,var:rr,within:er};function di(e,[t,r,i,n]){t=t.evaluate(e),r=r.evaluate(e),i=i.evaluate(e);let a=n?n.evaluate(e):1,s=lt(t,r,i,a);if(s)throw new yt(s);return new Xe(t/255,r/255,i/255,a,!1)}function fi(e,t){return e in t}function yi(e,t){let r=t[e];return typeof r>"u"?null:r}function mi(e,t,r,i){for(;r<=i;){let n=r+i>>1;if(t[n]===e)return!0;t[n]>e?i=n-1:r=n+1}return!1}function gi(e){return{type:e}}function xi(e){return{result:"success",value:e}}function vi(e){return{result:"error",value:e}}function bi(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function wi(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function _i(e){return!!e.expression&&e.expression.interpolated}function Si(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function Ai(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function ki(e){return e}function Ii(e,t){let r,i,n,a="color"===t.type,s=e.stops&&"object"==typeof e.stops[0][0],o=s||void 0!==e.property,u=s||!o,c=e.type||(_i(t)?"exponential":"interval");if(a||"padding"===t.type){let r=a?Xe.parse:rt.parse;(e=ee({},e)).stops&&(e.stops=e.stops.map((e=>[e[0],r(e[1])]))),e.default?e.default=r(e.default):e.default=r(t.default)}if(e.colorSpace&&!dr(e.colorSpace))throw new Error('Unknown color space: "'.concat(e.colorSpace,'"'));if("exponential"===c)r=zi;else if("interval"===c)r=Ci;else if("categorical"===c){r=Pi,i=Object.create(null);for(let t of e.stops)i[t[0]]=t[1];n=typeof e.stops[0][0]}else{if("identity"!==c)throw new Error('Unknown function type "'.concat(c,'"'));r=Bi}if(s){let r={},i=[];for(let t=0;t<e.stops.length;t++){let n=e.stops[t],a=n[0].zoom;void 0===r[a]&&(r[a]={zoom:a,type:e.type,property:e.property,default:e.default,stops:[]},i.push(a)),r[a].stops.push([n[0].value,n[1]])}let n=[];for(let e of i)n.push([r[e].zoom,Ii(r[e],t)]);let a={name:"linear"};return{kind:"composite",interpolationType:a,interpolationFactor:wr.interpolationFactor.bind(void 0,a),zoomStops:n.map((e=>e[0])),evaluate:({zoom:r},i)=>zi({stops:n,base:e.base},t,r).evaluate(r,i)}}if(u){let a="exponential"===c?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:a,interpolationFactor:wr.interpolationFactor.bind(void 0,a),zoomStops:e.stops.map((e=>e[0])),evaluate:l((({zoom:a})=>r(e,t,a,i,n)),"evaluate")}}return{kind:"source",evaluate(a,s){let o=s&&s.properties?s.properties[e.property]:void 0;return void 0===o?Mi(e.default,t.default):r(e,t,o,i,n)}}}function Mi(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function Pi(e,t,r,i,n){return Mi(typeof r===n?i[r]:void 0,e.default,t.default)}function Ci(e,t,r){if("number"!==Si(r))return Mi(e.default,t.default);let i=e.stops.length;if(1===i||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];let n=cr(e.stops.map((e=>e[0])),r);return e.stops[n][1]}function zi(e,t,r){let i=void 0!==e.base?e.base:1;if("number"!==Si(r))return Mi(e.default,t.default);let n=e.stops.length;if(1===n||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];let a=cr(e.stops.map((e=>e[0])),r),s=Vi(r,i,e.stops[a][0],e.stops[a+1][0]),o=e.stops[a][1],l=e.stops[a+1][1],u=vr[t.type]||ki;return"function"==typeof o.evaluate?{evaluate(...t){let r=o.evaluate.apply(void 0,t),i=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==i)return u(r,i,s,e.colorSpace)}}:u(o,l,s,e.colorSpace)}function Bi(e,t,r){switch(t.type){case"color":r=Xe.parse(r);break;case"formatted":r=et.fromString(r.toString());break;case"resolvedImage":r=ot.fromString(r.toString());break;case"padding":r=rt.parse(r);break;default:Si(r)!==t.type&&("enum"!==t.type||!t.values[r])&&(r=void 0)}return Mi(r,e.default,t.default)}function Vi(e,t,r,i){let n=i-r,a=e-r;return 0===n?0:1===t?a/n:(Math.pow(t,a)-1)/(Math.pow(t,n)-1)}l(di,"rgba"),l(fi,"has"),l(yi,"get"),l(mi,"binarySearch"),l(gi,"varargs"),nr.register(pi,{error:[{kind:"error"},[oe],(e,[t])=>{throw new yt(t.evaluate(e))}],typeof:[oe,[he],(e,[t])=>xe(ct(t.evaluate(e)))],"to-rgba":[ge(se,4),[ue],(e,[t])=>{let[r,i,n,a]=t.evaluate(e).rgb;return[255*r,255*i,255*n,a]}],rgb:[ue,[se,se,se],di],rgba:[ue,[se,se,se,se],di],has:{type:le,overloads:[[[oe],(e,[t])=>fi(t.evaluate(e),e.properties())],[[oe,ce],(e,[t,r])=>fi(t.evaluate(e),r.evaluate(e))]]},get:{type:he,overloads:[[[oe],(e,[t])=>yi(t.evaluate(e),e.properties())],[[oe,ce],(e,[t,r])=>yi(t.evaluate(e),r.evaluate(e))]]},"feature-state":[he,[oe],(e,[t])=>yi(t.evaluate(e),e.featureState||{})],properties:[ce,[],e=>e.properties()],"geometry-type":[oe,[],e=>e.geometryType()],id:[he,[],e=>e.id()],zoom:[se,[],e=>e.globals.zoom],"heatmap-density":[se,[],e=>e.globals.heatmapDensity||0],"line-progress":[se,[],e=>e.globals.lineProgress||0],accumulated:[he,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[se,gi(se),(e,t)=>{let r=0;for(let i of t)r+=i.evaluate(e);return r}],"*":[se,gi(se),(e,t)=>{let r=1;for(let i of t)r*=i.evaluate(e);return r}],"-":{type:se,overloads:[[[se,se],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[se],(e,[t])=>-t.evaluate(e)]]},"/":[se,[se,se],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[se,[se,se],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[se,[],()=>Math.LN2],pi:[se,[],()=>Math.PI],e:[se,[],()=>Math.E],"^":[se,[se,se],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[se,[se],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[se,[se],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[se,[se],(e,[t])=>Math.log(t.evaluate(e))],log2:[se,[se],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[se,[se],(e,[t])=>Math.sin(t.evaluate(e))],cos:[se,[se],(e,[t])=>Math.cos(t.evaluate(e))],tan:[se,[se],(e,[t])=>Math.tan(t.evaluate(e))],asin:[se,[se],(e,[t])=>Math.asin(t.evaluate(e))],acos:[se,[se],(e,[t])=>Math.acos(t.evaluate(e))],atan:[se,[se],(e,[t])=>Math.atan(t.evaluate(e))],min:[se,gi(se),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[se,gi(se),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[se,[se],(e,[t])=>Math.abs(t.evaluate(e))],round:[se,[se],(e,[t])=>{let r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[se,[se],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[se,[se],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[le,[oe,he],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[le,[he],(e,[t])=>e.id()===t.value],"filter-type-==":[le,[oe],(e,[t])=>e.geometryType()===t.value],"filter-<":[le,[oe,he],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i<n}],"filter-id-<":[le,[he],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r<i}],"filter->":[le,[oe,he],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>n}],"filter-id->":[le,[he],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r>i}],"filter-<=":[le,[oe,he],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i<=n}],"filter-id-<=":[le,[he],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r<=i}],"filter->=":[le,[oe,he],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>=n}],"filter-id->=":[le,[he],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r>=i}],"filter-has":[le,[he],(e,[t])=>t.value in e.properties()],"filter-has-id":[le,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[le,[ge(oe)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[le,[ge(he)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[le,[oe,ge(he)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[le,[oe,ge(he)],(e,[t,r])=>mi(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:le,overloads:[[[le,le],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[gi(le),(e,t)=>{for(let r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:le,overloads:[[[le,le],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[gi(le),(e,t)=>{for(let r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[le,[le],(e,[t])=>!t.evaluate(e)],"is-supported-script":[le,[oe],(e,[t])=>{let r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[oe,[oe],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[oe,[oe],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[oe,gi(he),(e,t)=>t.map((t=>ht(t.evaluate(e)))).join("")],"resolved-locale":[oe,[pe],(e,[t])=>t.evaluate(e).resolvedLocale()]}),l(xi,"success"),l(vi,"error"),l(bi,"supportsPropertyExpression"),l(wi,"supportsZoomExpression"),l(_i,"supportsInterpolation"),l(Si,"getType"),l(Ai,"isFunction"),l(ki,"identityFunction"),l(Ii,"createFunction"),l(Mi,"coalesce$1"),l(Pi,"evaluateCategoricalFunction"),l(Ci,"evaluateIntervalFunction"),l(zi,"evaluateExponentialFunction"),l(Bi,"evaluateIdentityFunction"),l(Vi,"interpolationFactor");var Ei=class{constructor(e,t){this.expression=e,this._warningHistory={},this._evaluator=new At,this._defaultValue=t?Ki(t):null,this._enumValues=t&&"enum"===t.type?t.values:null}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,i,n,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||null;try{let e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new yt("Expected value to be one of ".concat(Object.keys(this._enumValues).map((e=>JSON.stringify(e))).join(", "),", but found ").concat(JSON.stringify(e)," instead."));return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,typeof console<"u"&&console.warn(e.message)),this._defaultValue}}};l(Ei,"StyleExpression");var Fi=Ei;function Ti(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in pi}function Li(e,t){let r=new It(pi,sr,[],t?Gi(t):void 0),i=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return i?xi(new Fi(i,t)):vi(r.errors)}l(Ti,"isExpression"),l(Li,"createExpression");var Di=class{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!lr(t.expression)}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,a)}evaluate(e,t,r,i,n,a){return this._styleExpression.evaluate(e,t,r,i,n,a)}};l(Di,"ZoomConstantExpression");var Oi=Di,Ri=class{constructor(e,t,r,i){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!lr(t.expression),this.interpolationType=i}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,a)}evaluate(e,t,r,i,n,a){return this._styleExpression.evaluate(e,t,r,i,n,a)}interpolationFactor(e,t,r){return this.interpolationType?wr.interpolationFactor(this.interpolationType,e,t,r):0}};l(Ri,"ZoomDependentExpression");var qi=Ri;function Ui(e,t){let r=Li(e,t);if("error"===r.result)return r;let i=r.value.expression,n=or(i);if(!n&&!bi(t))return vi([new re("","data expressions not supported")]);let a=ur(i,["zoom"]);if(!a&&!wi(t))return vi([new re("","zoom expressions not supported")]);let s=Ji(i);if(!s&&!a)return vi([new re("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(s instanceof re)return vi([s]);if(s instanceof wr&&!_i(t))return vi([new re("",'"interpolate" expressions cannot be used with this property')]);if(!s)return xi(new Oi(n?"constant":"source",r.value));let o=s instanceof wr?s.interpolation:void 0;return xi(new qi(n?"camera":"composite",r.value,s.labels,o))}l(Ui,"createPropertyExpression");var ji=class e{constructor(e,t){this._parameters=e,this._specification=t,ee(this,Ii(this._parameters,this._specification))}static deserialize(t){return new e(t._parameters,t._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}};l(ji,"StylePropertyFunction");var Ni=ji;function Zi(e,t){if(Ai(e))return new Ni(e,t);if(Ti(e)){let r=Ui(e,t);if("error"===r.result)throw new Error(r.value.map((e=>"".concat(e.key,": ").concat(e.message))).join(", "));return r.value}{let r=e;return"color"===t.type&&"string"==typeof e?r=Xe.parse(e):"padding"!==t.type||"number"!=typeof e&&!Array.isArray(e)?"variableAnchorOffsetCollection"===t.type&&Array.isArray(e)&&(r=at.parse(e)):r=rt.parse(e),{kind:"constant",evaluate:l((()=>r),"evaluate")}}}function Ji(e){let t=null;if(e instanceof Ir)t=Ji(e.result);else if(e instanceof Ar){for(let r of e.args)if(t=Ji(r),t)break}else(e instanceof pr||e instanceof wr)&&e.input instanceof nr&&"zoom"===e.input.name&&(t=e);return t instanceof re||e.eachChild((e=>{let r=Ji(e);r instanceof re?t=r:!t&&r?t=new re("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new re("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}function Gi(e){let t={color:ue,string:oe,number:se,enum:oe,boolean:le,formatted:de,padding:fe,resolvedImage:ye,variableAnchorOffsetCollection:me};return"array"===e.type?ge(t[e.value]||he,e.length):t[e.type]}function Ki(e){return"color"===e.type&&Ai(e.default)?new Xe(0,0,0,0):"color"===e.type?Xe.parse(e.default)||null:"padding"===e.type?rt.parse(e.default)||null:"variableAnchorOffsetCollection"===e.type?at.parse(e.default)||null:void 0===e.default?null:e.default}function Xi(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(let t of e.slice(1))if(!Xi(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}l(Zi,"normalizePropertyExpression"),l(Ji,"findZoomCurve"),l(Gi,"getExpectedType"),l(Ki,"getDefaultValue"),l(Xi,"isExpressionFilter");var Yi={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Hi(e){if(null==e)return{filter:l((()=>!0),"filter"),needGeometry:!1};Xi(e)||(e=Qi(e));let t=Li(e,Yi);if("error"===t.result)throw new Error(t.value.map((e=>"".concat(e.key,": ").concat(e.message))).join(", "));{let r=$i(e);return{filter:l(((e,r,i)=>t.value.evaluate(e,r,{},i)),"filter"),needGeometry:r}}}function Wi(e,t){return e<t?-1:e>t?1:0}function $i(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(let t=1;t<e.length;t++)if($i(e[t]))return!0;return!1}function Qi(e){if(!e)return!0;let t=e[0];return e.length<=1?"any"!==t:"=="===t?en(e[1],e[2],"=="):"!="===t?an(en(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?en(e[1],e[2],t):"any"===t?tn(e.slice(1)):"all"===t?["all"].concat(e.slice(1).map(Qi)):"none"===t?["all"].concat(e.slice(1).map(Qi).map(an)):"in"===t?rn(e[1],e.slice(2)):"!in"===t?an(rn(e[1],e.slice(2))):"has"===t?nn(e[1]):"!has"===t?an(nn(e[1])):"within"!==t||e}function en(e,t,r){switch(e){case"$type":return["filter-type-".concat(r),t];case"$id":return["filter-id-".concat(r),t];default:return["filter-".concat(r),e,t]}}function tn(e){return["any"].concat(e.map(Qi))}function rn(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((e=>typeof e!=typeof t[0]))?["filter-in-large",e,["literal",t.sort(Wi)]]:["filter-in-small",e,["literal",t]]}}function nn(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function an(e){return["!",e]}function sn(e){let t=typeof e;if("number"===t||"boolean"===t||"string"===t||null==e)return JSON.stringify(e);if(Array.isArray(e)){let t="[";for(let r of e)t+="".concat(sn(r),",");return"".concat(t,"]")}let r=Object.keys(e).sort(),i="{";for(let t=0;t<r.length;t++)i+="".concat(JSON.stringify(r[t]),":").concat(sn(e[r[t]]),",");return"".concat(i,"}")}function on(e){let t="";for(let r of W)t+="/".concat(sn(e[r]));return t}function ln(e,t){let r={};for(let i=0;i<e.length;i++){let n=t&&t[e[i].id]||on(e[i]);t&&(t[e[i].id]=n);let a=r[n];a||(a=r[n]=[]),a.push(e[i])}let i=[];for(let e in r)i.push(r[e]);return i}function un(e){let t=e.key,r=e.value;return r?[new Q(t,r,"constants have been deprecated as of v8")]:[]}function cn(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function hn(e){if(Array.isArray(e))return e.map(hn);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){let t={};for(let r in e)t[r]=hn(e[r]);return t}return cn(e)}function pn(e){let t=e.key,r=e.value,i=e.valueSpec||{},n=e.objectElementValidators||{},a=e.style,s=e.styleSpec,o=e.validateSpec,l=[],u=Si(r);if("object"!==u)return[new Q(t,r,"object expected, ".concat(u," found"))];for(let e in r){let u,c=e.split(".")[0],h=i[c]||i["*"];if(n[c])u=n[c];else if(i[c])u=o;else if(n["*"])u=n["*"];else{if(!i["*"]){l.push(new Q(t,r[e],'unknown property "'.concat(e,'"')));continue}u=o}l=l.concat(u({key:(t&&"".concat(t,"."))+e,value:r[e],valueSpec:h,style:a,styleSpec:s,object:r,objectKey:e,validateSpec:o},r))}for(let e in i)n[e]||i[e].required&&void 0===i[e].default&&void 0===r[e]&&l.push(new Q(t,r,'missing required property "'.concat(e,'"')));return l}function dn(e){let t=e.value,r=e.valueSpec,i=e.validateSpec,n=e.style,a=e.styleSpec,s=e.key,o=e.arrayElementValidator||i;if("array"!==Si(t))return[new Q(s,t,"array expected, ".concat(Si(t)," found"))];if(r.length&&t.length!==r.length)return[new Q(s,t,"array length ".concat(r.length," expected, length ").concat(t.length," found"))];if(r["min-length"]&&t.length<r["min-length"])return[new Q(s,t,"array length at least ".concat(r["min-length"]," expected, length ").concat(t.length," found"))];let l={type:r.value,values:r.values};a.$version<7&&(l.function=r.function),"object"===Si(r.value)&&(l=r.value);let u=[];for(let r=0;r<t.length;r++)u=u.concat(o({array:t,arrayIndex:r,value:t[r],valueSpec:l,validateSpec:e.validateSpec,style:n,styleSpec:a,key:"".concat(s,"[").concat(r,"]")}));return u}function fn(e){let t=e.key,r=e.value,i=e.valueSpec,n=Si(r);return"number"===n&&r!=r&&(n="NaN"),"number"!==n?[new Q(t,r,"number expected, ".concat(n," found"))]:"minimum"in i&&r<i.minimum?[new Q(t,r,"".concat(r," is less than the minimum value ").concat(i.minimum))]:"maximum"in i&&r>i.maximum?[new Q(t,r,"".concat(r," is greater than the maximum value ").concat(i.maximum))]:[]}function yn(e){let t,r,i,n=e.valueSpec,a=cn(e.value.type),s={},o="categorical"!==a&&void 0===e.value.property,l=!o,u="array"===Si(e.value.stops)&&"array"===Si(e.value.stops[0])&&"object"===Si(e.value.stops[0][0]),c=pn({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:h,default:f}});return"identity"===a&&o&&c.push(new Q(e.key,e.value,'missing required property "property"')),"identity"!==a&&!e.value.stops&&c.push(new Q(e.key,e.value,'missing required property "stops"')),"exponential"===a&&e.valueSpec.expression&&!_i(e.valueSpec)&&c.push(new Q(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!bi(e.valueSpec)?c.push(new Q(e.key,e.value,"property functions not supported")):o&&!wi(e.valueSpec)&&c.push(new Q(e.key,e.value,"zoom functions not supported"))),("categorical"===a||u)&&void 0===e.value.property&&c.push(new Q(e.key,e.value,'"property" property is required')),c;function h(e){if("identity"===a)return[new Q(e.key,e.value,'identity function may not have a "stops" property')];let t=[],r=e.value;return t=t.concat(dn({key:e.key,value:r,valueSpec:e.valueSpec,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:p})),"array"===Si(r)&&0===r.length&&t.push(new Q(e.key,r,"array must have at least one stop")),t}function p(e){let t=[],a=e.value,o=e.key;if("array"!==Si(a))return[new Q(o,a,"array expected, ".concat(Si(a)," found"))];if(2!==a.length)return[new Q(o,a,"array length 2 expected, length ".concat(a.length," found"))];if(u){if("object"!==Si(a[0]))return[new Q(o,a,"object expected, ".concat(Si(a[0])," found"))];if(void 0===a[0].zoom)return[new Q(o,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new Q(o,a,"object stop key must have value")];if(i&&i>cn(a[0].zoom))return[new Q(o,a[0].zoom,"stop zoom values must appear in ascending order")];cn(a[0].zoom)!==i&&(i=cn(a[0].zoom),r=void 0,s={}),t=t.concat(pn({key:"".concat(o,"[0]"),value:a[0],valueSpec:{zoom:{}},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:fn,value:d}}))}else t=t.concat(d({key:"".concat(o,"[0]"),value:a[0],valueSpec:{},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec},a));return Ti(hn(a[1]))?t.concat([new Q("".concat(o,"[1]"),a[1],"expressions are not allowed in function stops.")]):t.concat(e.validateSpec({key:"".concat(o,"[1]"),value:a[1],valueSpec:n,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec}))}function d(e,i){let o=Si(e.value),l=cn(e.value),u=null!==e.value?e.value:i;if(t){if(o!==t)return[new Q(e.key,u,"".concat(o," stop domain type must match previous stop domain type ").concat(t))]}else t=o;if("number"!==o&&"string"!==o&&"boolean"!==o)return[new Q(e.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==o&&"categorical"!==a){let t="number expected, ".concat(o," found");return bi(n)&&void 0===a&&(t+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Q(e.key,u,t)]}return"categorical"!==a||"number"!==o||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===o&&void 0!==r&&l<r?[new Q(e.key,u,"stop domain values must appear in ascending order")]:(r=l,"categorical"===a&&l in s?[new Q(e.key,u,"stop domain values must be unique")]:(s[l]=!0,[])):[new Q(e.key,u,"integer expected, found ".concat(l))]}function f(e){return e.validateSpec({key:e.key,value:e.value,valueSpec:n,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec})}}function mn(e){let t=("property"===e.expressionContext?Ui:Li)(hn(e.value),e.valueSpec);if("error"===t.result)return t.value.map((t=>new Q("".concat(e.key).concat(t.key),e.value,t.message)));let r=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!r.outputDefined())return[new Q(e.key,e.value,'Invalid data expression for "'.concat(e.propertyKey,'". Output values must be contained as literals within the expression.'))];if("property"===e.expressionContext&&"layout"===e.propertyType&&!lr(r))return[new Q(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!lr(r))return[new Q(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!ur(r,["zoom","feature-state"]))return[new Q(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!or(r))return[new Q(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function gn(e){let t=e.value,r=e.key,i=Si(t);return"boolean"!==i?[new Q(r,t,"boolean expected, ".concat(i," found"))]:[]}function xn(e){let t=e.key,r=e.value,i=Si(r);return"string"!==i?[new Q(t,r,"color expected, ".concat(i," found"))]:Xe.parse(String(r))?[]:[new Q(t,r,'color expected, "'.concat(r,'" found'))]}function vn(e){let t=e.key,r=e.value,i=e.valueSpec,n=[];return Array.isArray(i.values)?-1===i.values.indexOf(cn(r))&&n.push(new Q(t,r,"expected one of [".concat(i.values.join(", "),"], ").concat(JSON.stringify(r)," found"))):-1===Object.keys(i.values).indexOf(cn(r))&&n.push(new Q(t,r,"expected one of [".concat(Object.keys(i.values).join(", "),"], ").concat(JSON.stringify(r)," found"))),n}function bn(e){return Xi(hn(e.value))?mn(ee({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):wn(e)}function wn(e){let t=e.value,r=e.key;if("array"!==Si(t))return[new Q(r,t,"array expected, ".concat(Si(t)," found"))];let i,n=e.styleSpec,a=[];if(t.length<1)return[new Q(r,t,"filter array must have at least 1 element")];switch(a=a.concat(vn({key:"".concat(r,"[0]"),value:t[0],valueSpec:n.filter_operator,style:e.style,styleSpec:e.styleSpec})),cn(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===cn(t[1])&&a.push(new Q(r,t,'"$type" cannot be use with operator "'.concat(t[0],'"')));case"==":case"!=":3!==t.length&&a.push(new Q(r,t,'filter array for operator "'.concat(t[0],'" must have 3 elements')));case"in":case"!in":t.length>=2&&(i=Si(t[1]),"string"!==i&&a.push(new Q("".concat(r,"[1]"),t[1],"string expected, ".concat(i," found"))));for(let s=2;s<t.length;s++)i=Si(t[s]),"$type"===cn(t[1])?a=a.concat(vn({key:"".concat(r,"[").concat(s,"]"),value:t[s],valueSpec:n.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==i&&"number"!==i&&"boolean"!==i&&a.push(new Q("".concat(r,"[").concat(s,"]"),t[s],"string, number, or boolean expected, ".concat(i," found")));break;case"any":case"all":case"none":for(let i=1;i<t.length;i++)a=a.concat(wn({key:"".concat(r,"[").concat(i,"]"),value:t[i],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":i=Si(t[1]),2!==t.length?a.push(new Q(r,t,'filter array for "'.concat(t[0],'" operator must have 2 elements'))):"string"!==i&&a.push(new Q("".concat(r,"[1]"),t[1],"string expected, ".concat(i," found")));break;case"within":i=Si(t[1]),2!==t.length?a.push(new Q(r,t,'filter array for "'.concat(t[0],'" operator must have 2 elements'))):"object"!==i&&a.push(new Q("".concat(r,"[1]"),t[1],"object expected, ".concat(i," found")))}return a}function _n(e,t){let r=e.key,i=e.validateSpec,n=e.style,a=e.styleSpec,s=e.value,o=e.objectKey,l=a["".concat(t,"_").concat(e.layerType)];if(!l)return[];let u=o.match(/^(.*)-transition$/);if("paint"===t&&u&&l[u[1]]&&l[u[1]].transition)return i({key:r,value:s,valueSpec:a.transition,style:n,styleSpec:a});let c,h=e.valueSpec||l[o];if(!h)return[new Q(r,s,'unknown property "'.concat(o,'"'))];if("string"===Si(s)&&bi(h)&&!h.tokens&&(c=/^{([^}]+)}$/.exec(s)))return[new Q(r,s,'"'.concat(o,'" does not support interpolation syntax\n')+'Use an identity property function instead: `{ "type": "identity", "property": '.concat(JSON.stringify(c[1])," }`."))];let p=[];return"symbol"===e.layerType&&("text-field"===o&&n&&!n.glyphs&&p.push(new Q(r,s,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&Ai(hn(s))&&"identity"===cn(s.type)&&p.push(new Q(r,s,'"text-font" does not support identity functions'))),p.concat(i({key:e.key,value:s,valueSpec:h,style:n,styleSpec:a,expressionContext:"property",propertyType:t,propertyKey:o}))}function Sn(e){return _n(e,"paint")}function An(e){return _n(e,"layout")}function kn(e){let t=[],r=e.value,i=e.key,n=e.style,a=e.styleSpec;!r.type&&!r.ref&&t.push(new Q(i,r,'either "type" or "ref" is required'));let s=cn(r.type),o=cn(r.ref);if(r.id){let a=cn(r.id);for(let s=0;s<e.arrayIndex;s++){let e=n.layers[s];cn(e.id)===a&&t.push(new Q(i,r.id,'duplicate layer id "'.concat(r.id,'", previously used at line ').concat(e.id.__line__)))}}if("ref"in r){let e;["type","source","source-layer","filter","layout"].forEach((e=>{e in r&&t.push(new Q(i,r[e],'"'.concat(e,'" is prohibited for ref layers')))})),n.layers.forEach((t=>{cn(t.id)===o&&(e=t)})),e?e.ref?t.push(new Q(i,r.ref,"ref cannot reference another ref layer")):s=cn(e.type):t.push(new Q(i,r.ref,'ref layer "'.concat(o,'" not found')))}else if("background"!==s)if(r.source){let e=n.sources&&n.sources[r.source],a=e&&cn(e.type);e?"vector"===a&&"raster"===s?t.push(new Q(i,r.source,'layer "'.concat(r.id,'" requires a raster source'))):"raster"===a&&"raster"!==s?t.push(new Q(i,r.source,'layer "'.concat(r.id,'" requires a vector source'))):"vector"!==a||r["source-layer"]?"raster-dem"===a&&"hillshade"!==s?t.push(new Q(i,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"===s&&r.paint&&r.paint["line-gradient"]&&("geojson"!==a||!e.lineMetrics)&&t.push(new Q(i,r,'layer "'.concat(r.id,'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.'))):t.push(new Q(i,r,'layer "'.concat(r.id,'" must specify a "source-layer"'))):t.push(new Q(i,r.source,'source "'.concat(r.source,'" not found')))}else t.push(new Q(i,r,'missing required property "source"'));return t=t.concat(pn({key:i,value:r,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":()=>[],type:()=>e.validateSpec({key:"".concat(i,".type"),value:r.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:r,objectKey:"type"}),filter:bn,layout:e=>pn({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>An(ee({layerType:s},e))}}),paint:e=>pn({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>Sn(ee({layerType:s},e))}})}})),t}function In(e){let t=e.value,r=e.key,i=Si(t);return"string"!==i?[new Q(r,t,"string expected, ".concat(i," found"))]:[]}l(Hi,"createFilter"),l(Wi,"compare"),l($i,"geometryNeeded"),l(Qi,"convertFilter$1"),l(en,"convertComparisonOp$1"),l(tn,"convertDisjunctionOp"),l(rn,"convertInOp$1"),l(nn,"convertHasOp$1"),l(an,"convertNegation"),l(sn,"stringify"),l(on,"getKey"),l(ln,"groupByLayout"),l(un,"validateConstants"),l(cn,"unbundle"),l(hn,"deepUnbundle"),l(pn,"validateObject"),l(dn,"validateArray"),l(fn,"validateNumber"),l(yn,"validateFunction"),l(mn,"validateExpression"),l(gn,"validateBoolean"),l(xn,"validateColor"),l(vn,"validateEnum"),l(bn,"validateFilter"),l(wn,"validateNonExpressionFilter"),l(_n,"validateProperty"),l(Sn,"validatePaintProperty"),l(An,"validateLayoutProperty"),l(kn,"validateLayer"),l(In,"validateString");var Mn={promoteId:Cn};function Pn(e){let t=e.value,r=e.key,i=e.styleSpec,n=e.style,a=e.validateSpec;if(!t.type)return[new Q(r,t,'"type" is required')];let s,o=cn(t.type);switch(o){case"vector":case"raster":case"raster-dem":return s=pn({key:r,value:t,valueSpec:i["source_".concat(o.replace("-","_"))],style:e.style,styleSpec:i,objectElementValidators:Mn,validateSpec:a}),s;case"geojson":if(s=pn({key:r,value:t,valueSpec:i.source_geojson,style:n,styleSpec:i,validateSpec:a,objectElementValidators:Mn}),t.cluster)for(let e in t.clusterProperties){let[i,n]=t.clusterProperties[e],o="string"==typeof i?[i,["accumulated"],["get",e]]:i;s.push(...mn({key:"".concat(r,".").concat(e,".map"),value:n,validateSpec:a,expressionContext:"cluster-map"})),s.push(...mn({key:"".concat(r,".").concat(e,".reduce"),value:o,validateSpec:a,expressionContext:"cluster-reduce"}))}return s;case"video":return pn({key:r,value:t,valueSpec:i.source_video,style:n,validateSpec:a,styleSpec:i});case"image":return pn({key:r,value:t,valueSpec:i.source_image,style:n,validateSpec:a,styleSpec:i});case"canvas":return[new Q(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return vn({key:"".concat(r,".type"),value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,validateSpec:a,styleSpec:i})}}function Cn({key:e,value:t}){if("string"===Si(t))return In({key:e,value:t});{let r=[];for(let i in t)r.push(...In({key:"".concat(e,".").concat(i),value:t[i]}));return r}}function zn(e){let t=e.value,r=e.styleSpec,i=r.light,n=e.style,a=[],s=Si(t);if(void 0===t)return a;if("object"!==s)return a=a.concat([new Q("light",t,"object expected, ".concat(s," found"))]),a;for(let s in t){let o=s.match(/^(.*)-transition$/);a=o&&i[o[1]]&&i[o[1]].transition?a.concat(e.validateSpec({key:s,value:t[s],valueSpec:r.transition,validateSpec:e.validateSpec,style:n,styleSpec:r})):i[s]?a.concat(e.validateSpec({key:s,value:t[s],valueSpec:i[s],validateSpec:e.validateSpec,style:n,styleSpec:r})):a.concat([new Q(s,t[s],'unknown property "'.concat(s,'"'))])}return a}function Bn(e){let t=e.value,r=e.styleSpec,i=r.terrain,n=e.style,a=[],s=Si(t);if(void 0===t)return a;if("object"!==s)return a=a.concat([new Q("terrain",t,"object expected, ".concat(s," found"))]),a;for(let s in t)a=i[s]?a.concat(e.validateSpec({key:s,value:t[s],valueSpec:i[s],validateSpec:e.validateSpec,style:n,styleSpec:r})):a.concat([new Q(s,t[s],'unknown property "'.concat(s,'"'))]);return a}function Vn(e){return 0===In(e).length?[]:mn(e)}function En(e){return 0===In(e).length?[]:mn(e)}function Fn(e){let t=e.key,r=e.value;if("array"===Si(r)){if(r.length<1||r.length>4)return[new Q(t,r,"padding requires 1 to 4 values; ".concat(r.length," values found"))];let i={type:"number"},n=[];for(let a=0;a<r.length;a++)n=n.concat(e.validateSpec({key:"".concat(t,"[").concat(a,"]"),value:r[a],validateSpec:e.validateSpec,valueSpec:i}));return n}return fn({key:t,value:r,valueSpec:{}})}function Tn(e){let t=e.key,r=e.value,i=Si(r),n=e.styleSpec;if("array"!==i||r.length<1||r.length%2!=0)return[new Q(t,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let a=[];for(let i=0;i<r.length;i+=2)a=a.concat(vn({key:"".concat(t,"[").concat(i,"]"),value:r[i],valueSpec:n.layout_symbol["text-anchor"]})),a=a.concat(dn({key:"".concat(t,"[").concat(i+1,"]"),value:r[i+1],valueSpec:{length:2,value:"number"},validateSpec:e.validateSpec,style:e.style,styleSpec:n}));return a}function Ln(e){let t=[],r=e.value,i=e.key;if(Array.isArray(r)){let n=[],a=[];for(let s in r){r[s].id&&n.includes(r[s].id)&&t.push(new Q(i,r,"all the sprites' ids must be unique, but ".concat(r[s].id," is duplicated"))),n.push(r[s].id),r[s].url&&a.includes(r[s].url)&&t.push(new Q(i,r,"all the sprites' URLs must be unique, but ".concat(r[s].url," is duplicated"))),a.push(r[s].url);let o={id:{type:"string",required:!0},url:{type:"string",required:!0}};t=t.concat(pn({key:"".concat(i,"[").concat(s,"]"),value:r[s],valueSpec:o,validateSpec:e.validateSpec}))}return t}return In({key:i,value:r})}l(Pn,"validateSource"),l(Cn,"validatePromoteId"),l(zn,"validateLight"),l(Bn,"validateTerrain"),l(Vn,"validateFormatted"),l(En,"validateImage"),l(Fn,"validatePadding"),l(Tn,"validateVariableAnchorOffsetCollection"),l(Ln,"validateSprite");var Dn={"*":()=>[],array:dn,boolean:gn,number:fn,color:xn,constants:un,enum:vn,filter:bn,function:yn,layer:kn,object:pn,source:Pn,light:zn,terrain:Bn,string:In,formatted:Vn,resolvedImage:En,padding:Fn,variableAnchorOffsetCollection:Tn,sprite:Ln};function On(e){let t=e.value,r=e.valueSpec,i=e.styleSpec;return e.validateSpec=On,r.expression&&Ai(cn(t))?yn(e):r.expression&&Ti(hn(t))?mn(e):r.type&&Dn[r.type]?Dn[r.type](e):pn(ee({},e,{valueSpec:r.type?i[r.type]:r}))}function Rn(e){let t=e.value,r=e.key,i=In(e);return i.length||(-1===t.indexOf("{fontstack}")&&i.push(new Q(r,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&i.push(new Q(r,t,'"glyphs" url must include a "{range}" token'))),i}function qn(e,t=H){let r=[];return r=r.concat(On({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,validateSpec:On,objectElementValidators:{glyphs:Rn,"*":()=>[]}})),e.constants&&(r=r.concat(un({key:"constants",value:e.constants,style:e,styleSpec:t,validateSpec:On}))),jn(r)}function Un(e){return function(t){return e({...t,validateSpec:On})}}function jn(e){return[].concat(e).sort(((e,t)=>e.line-t.line))}function Nn(e){return function(...t){return jn(e.apply(this,t))}}l(On,"validate"),l(Rn,"validateGlyphsUrl"),l(qn,"validateStyleMin"),qn.source=Nn(Un(Pn)),qn.sprite=Nn(Un(Ln)),qn.glyphs=Nn(Un(Rn)),qn.light=Nn(Un(zn)),qn.terrain=Nn(Un(Bn)),qn.layer=Nn(Un(kn)),qn.filter=Nn(Un(bn)),qn.paintProperty=Nn(Un(Sn)),qn.layoutProperty=Nn(Un(An)),l(Un,"injectValidateSpec"),l(jn,"sortErrors"),l(Nn,"wrapCleanErrors"),p(),p();var Zn={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""},Jn=class extends Error{constructor(e,t,r,i){super("AJAXError: ".concat(t," (").concat(e,"): ").concat(r)),this.status=e,this.statusText=t,this.url=r,this.body=i}};l(Jn,"AJAXError");var Gn=Jn,Kn=N()?()=>self.worker&&self.worker.referrer:()=>("blob:"===window.location.protocol?window.parent:window).location.href,Xn=l((e=>Zn.REGISTERED_PROTOCOLS[e.substring(0,e.indexOf("://"))]),"getProtocolAction"),Yn=l((e=>/^file:/.test(e)||/^file:/.test(Kn())&&!/^\w+:/.test(e)),"isFileURL");function Hn(e,t){let r=new AbortController,i=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:Kn(),signal:r.signal}),n=!1,a=!1;"json"===e.type&&i.headers.set("Accept","application/json");let s=l(((r,n,s)=>{if(!a){if(r&&"SecurityError"!==r.message&&q(r),n&&s)return o(n);fetch(i).then((r=>r.ok?o(r):r.blob().then((i=>t(new Gn(r.status,r.statusText,e.url,i)))))).catch((e=>{20!==e.code&&t(new Error(e.message))}))}}),"validateOrFetch"),o=l((r=>{("arrayBuffer"===e.type||"image"===e.type?r.arrayBuffer():"json"===e.type?r.json():r.text()).then((e=>{a||(n=!0,t(null,e,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((e=>{a||t(new Error(e.message))}))}),"finishRequest");return s(null,null),{cancel:l((()=>{a=!0,n||r.abort()}),"cancel")}}function Wn(e,t){let r=new XMLHttpRequest;r.open(e.method||"GET",e.url,!0),("arrayBuffer"===e.type||"image"===e.type)&&(r.responseType="arraybuffer");for(let t in e.headers)r.setRequestHeader(t,e.headers[t]);return"json"===e.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===e.credentials,r.onerror=()=>{t(new Error(r.statusText))},r.onload=()=>{if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){let i=r.response;if("json"===e.type)try{i=JSON.parse(r.response)}catch(e){return t(e)}t(null,i,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else{let i=new Blob([r.response],{type:r.getResponseHeader("Content-Type")});t(new Gn(r.status,r.statusText,e.url,i))}},r.send(e.body),{cancel:l((()=>r.abort()),"cancel")}}l(Hn,"makeFetchRequest"),l(Wn,"makeXMLHttpRequest");var $n=l((function(e,t){if(/:\/\//.test(e.url)&&!/^https?:|^file:/.test(e.url)){if(N()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t);if(!N())return(Xn(e.url)||Hn)(e,t)}if(!Yn(e.url)){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return Hn(e,t);if(N()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}return Wn(e,t)}),"makeRequest"),Qn=l((function(e,t){return $n(E(e,{type:"json"}),t)}),"getJSON"),ea=l((function(e,t){return $n(E(e,{type:"arrayBuffer"}),t)}),"getArrayBuffer"),ta={};function ra(e,t,r={}){if(ta[e])throw new Error("".concat(e," is already registered."));Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),ta[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}l(ra,"register"),ra("Object",Object),ra("TransferableGridIndex",X),ra("Color",Xe),ra("Error",Error),ra("AJAXError",Gn),ra("ResolvedImage",ot),ra("StylePropertyFunction",Ni),ra("StyleExpression",Fi,{omit:["_evaluator"]}),ra("ZoomDependentExpression",qi),ra("ZoomConstantExpression",Oi),ra("CompoundExpression",nr,{omit:["_evaluate"]});for(let e in pi)pi[e]._classRegistryKey||ra("Expression_".concat(e),pi[e]);function ia(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function na(e,t){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob)return e;if(ia(e)||G(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){let r=e;return t&&t.push(r.buffer),r}if(e instanceof ImageData)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){let r=[];for(let i of e)r.push(na(i,t));return r}if("object"==typeof e){let r=e.constructor,i=r._classRegistryKey;if(!i)throw new Error("can't serialize object of unregistered class");if(!ta[i])throw new Error("".concat(i," is not registered."));let n=r.serialize?r.serialize(e,t):{};if(r.serialize){if(t&&n===t[t.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(let r in e){if(!e.hasOwnProperty(r)||ta[i].omit.indexOf(r)>=0)continue;let a=e[r];n[r]=ta[i].shallow.indexOf(r)>=0?a:na(a,t)}e instanceof Error&&(n.message=e.message)}if(n.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==i&&(n.$name=i),n}throw new Error("can't serialize object of type ".concat(typeof e))}function aa(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob||ia(e)||G(e)||ArrayBuffer.isView(e)||e instanceof ImageData)return e;if(Array.isArray(e))return e.map(aa);if("object"==typeof e){let t=e.$name||"Object";if(!ta[t])throw new Error("can't deserialize unregistered class ".concat(t));let{klass:r}=ta[t];if(!r)throw new Error("can't deserialize unregistered class ".concat(t));if(r.deserialize)return r.deserialize(e);let i=Object.create(r.prototype);for(let r of Object.keys(e)){if("$name"===r)continue;let n=e[r];i[r]=ta[t].shallow.indexOf(r)>=0?n:aa(n)}return i}throw new Error("can't deserialize object of type ".concat(typeof e))}l(ia,"isArrayBuffer"),l(na,"serialize"),l(aa,"deserialize"),p();var sa=class{constructor(e){this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._callback()}),0))}remove(){delete this._channel,this._callback=()=>{}}};l(sa,"ThrottledInvoker");var oa=sa,la=class{constructor(e,t,r){this.receive=l((e=>{let t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if("<cancel>"===t.type){delete this.tasks[r];let e=this.cancelCallbacks[r];delete this.cancelCallbacks[r],e&&e()}else N()||t.mustQueue?(this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,t)}),"receive"),this.process=l((()=>{if(!this.taskQueue.length)return;let e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t&&this.processTask(e,t)}),"process"),this.target=e,this.parent=t,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},this.invoker=new oa(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=N()?e:window}send(e,t,r,i,n=!1){let a=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[a]=r);let s=J(this.globalScope)?void 0:[];return this.target.postMessage({id:a,type:e,hasCallback:!!r,targetMapId:i,mustQueue:n,sourceMapId:this.mapId,data:na(t,s)},s),{cancel:l((()=>{r&&delete this.callbacks[a],this.target.postMessage({id:a,type:"<cancel>",targetMapId:i,sourceMapId:this.mapId})}),"cancel")}}processTask(e,t){if("<response>"===t.type){let r=this.callbacks[e];delete this.callbacks[e],r&&(t.error?r(aa(t.error)):r(null,aa(t.data)))}else{let r=!1,i=J(this.globalScope)?void 0:[],n=t.hasCallback?(t,n)=>{r=!0,delete this.cancelCallbacks[e],this.target.postMessage({id:e,type:"<response>",sourceMapId:this.mapId,error:t?na(t):null,data:na(n,i)},i)}:e=>{r=!0},a=null,s=aa(t.data);if(this.parent[t.type])a=this.parent[t.type](t.sourceMapId,s,n);else if(this.parent.getWorkerSource){let e=t.type.split(".");a=this.parent.getWorkerSource(t.sourceMapId,e[0],s.source)[e[1]](s,n)}else n(new Error("Could not find function ".concat(t.type)));!r&&a&&a.cancel&&(this.cancelCallbacks[e]=a.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}};l(la,"Actor");var ua=la;function ca(e,t,r){r[e]&&-1!==r[e].indexOf(t)||(r[e]=r[e]||[],r[e].push(t))}function ha(e,t,r){if(r&&r[e]){let i=r[e].indexOf(t);-1!==i&&r[e].splice(i,1)}}p(),p(),p(),p(),p(),p(),l(ca,"_addEventListener"),l(ha,"_removeEventListener");var pa=class{constructor(e,t={}){E(this,t),this.type=e}};l(pa,"Event");var da=pa,fa=class extends da{constructor(e,t={}){super("error",E({error:e},t))}};l(fa,"ErrorEvent");var ya=fa,ma=class{on(e,t){return this._listeners=this._listeners||{},ca(e,t,this._listeners),this}off(e,t){return ha(e,t,this._listeners),ha(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},ca(e,t,this._oneTimeListeners),this):new Promise((t=>this.once(e,t)))}fire(e,t){"string"==typeof e&&(e=new da(e,t||{}));let r=e.type;if(this.listens(r)){e.target=this;let t=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(let r of t)r.call(this,e);let i=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(let t of i)ha(r,t,this._oneTimeListeners),t.call(this,e);let n=this._eventedParent;n&&(E(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),n.fire(e))}else e instanceof ya&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}};l(ma,"Evented");var ga=ma,xa=qn,va=(xa.source,xa.light,xa.terrain,xa.filter,xa.paintProperty),ba=xa.layoutProperty;function wa(e,t){let r=!1;if(t&&t.length)for(let i of t)e.fire(new ya(new Error(i.message))),r=!0;return r}l(wa,"emitValidationErrors"),p(),p(),p();var _a=class{constructor(){this.first=!0}update(e,t){let r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))}};l(_a,"ZoomHistory");var Sa=_a;p(),p();var Aa={"Latin-1 Supplement":l((e=>e>=128&&e<=255),"Latin-1 Supplement"),Arabic:l((e=>e>=1536&&e<=1791),"Arabic"),"Arabic Supplement":l((e=>e>=1872&&e<=1919),"Arabic Supplement"),"Arabic Extended-A":l((e=>e>=2208&&e<=2303),"Arabic Extended-A"),"Hangul Jamo":l((e=>e>=4352&&e<=4607),"Hangul Jamo"),"Unified Canadian Aboriginal Syllabics":l((e=>e>=5120&&e<=5759),"Unified Canadian Aboriginal Syllabics"),Khmer:l((e=>e>=6016&&e<=6143),"Khmer"),"Unified Canadian Aboriginal Syllabics Extended":l((e=>e>=6320&&e<=6399),"Unified Canadian Aboriginal Syllabics Extended"),"General Punctuation":l((e=>e>=8192&&e<=8303),"General Punctuation"),"Letterlike Symbols":l((e=>e>=8448&&e<=8527),"Letterlike Symbols"),"Number Forms":l((e=>e>=8528&&e<=8591),"Number Forms"),"Miscellaneous Technical":l((e=>e>=8960&&e<=9215),"Miscellaneous Technical"),"Control Pictures":l((e=>e>=9216&&e<=9279),"Control Pictures"),"Optical Character Recognition":l((e=>e>=9280&&e<=9311),"Optical Character Recognition"),"Enclosed Alphanumerics":l((e=>e>=9312&&e<=9471),"Enclosed Alphanumerics"),"Geometric Shapes":l((e=>e>=9632&&e<=9727),"Geometric Shapes"),"Miscellaneous Symbols":l((e=>e>=9728&&e<=9983),"Miscellaneous Symbols"),"Miscellaneous Symbols and Arrows":l((e=>e>=11008&&e<=11263),"Miscellaneous Symbols and Arrows"),"CJK Radicals Supplement":l((e=>e>=11904&&e<=12031),"CJK Radicals Supplement"),"Kangxi Radicals":l((e=>e>=12032&&e<=12255),"Kangxi Radicals"),"Ideographic Description Characters":l((e=>e>=12272&&e<=12287),"Ideographic Description Characters"),"CJK Symbols and Punctuation":l((e=>e>=12288&&e<=12351),"CJK Symbols and Punctuation"),Hiragana:l((e=>e>=12352&&e<=12447),"Hiragana"),Katakana:l((e=>e>=12448&&e<=12543),"Katakana"),Bopomofo:l((e=>e>=12544&&e<=12591),"Bopomofo"),"Hangul Compatibility Jamo":l((e=>e>=12592&&e<=12687),"Hangul Compatibility Jamo"),Kanbun:l((e=>e>=12688&&e<=12703),"Kanbun"),"Bopomofo Extended":l((e=>e>=12704&&e<=12735),"Bopomofo Extended"),"CJK Strokes":l((e=>e>=12736&&e<=12783),"CJK Strokes"),"Katakana Phonetic Extensions":l((e=>e>=12784&&e<=12799),"Katakana Phonetic Extensions"),"Enclosed CJK Letters and Months":l((e=>e>=12800&&e<=13055),"Enclosed CJK Letters and Months"),"CJK Compatibility":l((e=>e>=13056&&e<=13311),"CJK Compatibility"),"CJK Unified Ideographs Extension A":l((e=>e>=13312&&e<=19903),"CJK Unified Ideographs Extension A"),"Yijing Hexagram Symbols":l((e=>e>=19904&&e<=19967),"Yijing Hexagram Symbols"),"CJK Unified Ideographs":l((e=>e>=19968&&e<=40959),"CJK Unified Ideographs"),"Yi Syllables":l((e=>e>=40960&&e<=42127),"Yi Syllables"),"Yi Radicals":l((e=>e>=42128&&e<=42191),"Yi Radicals"),"Hangul Jamo Extended-A":l((e=>e>=43360&&e<=43391),"Hangul Jamo Extended-A"),"Hangul Syllables":l((e=>e>=44032&&e<=55215),"Hangul Syllables"),"Hangul Jamo Extended-B":l((e=>e>=55216&&e<=55295),"Hangul Jamo Extended-B"),"Private Use Area":l((e=>e>=57344&&e<=63743),"Private Use Area"),"CJK Compatibility Ideographs":l((e=>e>=63744&&e<=64255),"CJK Compatibility Ideographs"),"Arabic Presentation Forms-A":l((e=>e>=64336&&e<=65023),"Arabic Presentation Forms-A"),"Vertical Forms":l((e=>e>=65040&&e<=65055),"Vertical Forms"),"CJK Compatibility Forms":l((e=>e>=65072&&e<=65103),"CJK Compatibility Forms"),"Small Form Variants":l((e=>e>=65104&&e<=65135),"Small Form Variants"),"Arabic Presentation Forms-B":l((e=>e>=65136&&e<=65279),"Arabic Presentation Forms-B"),"Halfwidth and Fullwidth Forms":l((e=>e>=65280&&e<=65519),"Halfwidth and Fullwidth Forms")};function ka(e){for(let t of e)if(Ca(t.charCodeAt(0)))return!0;return!1}function Ia(e){for(let t of e)if(!Ma(t.charCodeAt(0)))return!1;return!0}function Ma(e){return!(Aa.Arabic(e)||Aa["Arabic Supplement"](e)||Aa["Arabic Extended-A"](e)||Aa["Arabic Presentation Forms-A"](e)||Aa["Arabic Presentation Forms-B"](e))}function Pa(e){return!(e<11904)&&!!(Aa["Bopomofo Extended"](e)||Aa.Bopomofo(e)||Aa["CJK Compatibility Forms"](e)||Aa["CJK Compatibility Ideographs"](e)||Aa["CJK Compatibility"](e)||Aa["CJK Radicals Supplement"](e)||Aa["CJK Strokes"](e)||Aa["CJK Symbols and Punctuation"](e)||Aa["CJK Unified Ideographs Extension A"](e)||Aa["CJK Unified Ideographs"](e)||Aa["Enclosed CJK Letters and Months"](e)||Aa["Halfwidth and Fullwidth Forms"](e)||Aa.Hiragana(e)||Aa["Ideographic Description Characters"](e)||Aa["Kangxi Radicals"](e)||Aa["Katakana Phonetic Extensions"](e)||Aa.Katakana(e)||Aa["Vertical Forms"](e)||Aa["Yi Radicals"](e)||Aa["Yi Syllables"](e))}function Ca(e){return 746===e||747===e||!(e<4352)&&!(!(Aa["Bopomofo Extended"](e)||Aa.Bopomofo(e)||Aa["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||Aa["CJK Compatibility Ideographs"](e)||Aa["CJK Compatibility"](e)||Aa["CJK Radicals Supplement"](e)||Aa["CJK Strokes"](e)||Aa["CJK Symbols and Punctuation"](e)&&!(e>=12296&&e<=12305)&&!(e>=12308&&e<=12319)&&12336!==e||Aa["CJK Unified Ideographs Extension A"](e)||Aa["CJK Unified Ideographs"](e)||Aa["Enclosed CJK Letters and Months"](e)||Aa["Hangul Compatibility Jamo"](e)||Aa["Hangul Jamo Extended-A"](e)||Aa["Hangul Jamo Extended-B"](e)||Aa["Hangul Jamo"](e)||Aa["Hangul Syllables"](e)||Aa.Hiragana(e)||Aa["Ideographic Description Characters"](e)||Aa.Kanbun(e)||Aa["Kangxi Radicals"](e)||Aa["Katakana Phonetic Extensions"](e)||Aa.Katakana(e)&&12540!==e)&&(!Aa["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)&&(!Aa["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)&&!Aa["Unified Canadian Aboriginal Syllabics"](e)&&!Aa["Unified Canadian Aboriginal Syllabics Extended"](e)&&!Aa["Vertical Forms"](e)&&!Aa["Yijing Hexagram Symbols"](e)&&!Aa["Yi Syllables"](e)&&!Aa["Yi Radicals"](e))}function za(e){return!!(Aa["Latin-1 Supplement"](e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||Aa["General Punctuation"](e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||Aa["Letterlike Symbols"](e)||Aa["Number Forms"](e)||Aa["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||Aa["Control Pictures"](e)&&9251!==e||Aa["Optical Character Recognition"](e)||Aa["Enclosed Alphanumerics"](e)||Aa["Geometric Shapes"](e)||Aa["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||Aa["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Aa["CJK Symbols and Punctuation"](e)||Aa.Katakana(e)||Aa["Private Use Area"](e)||Aa["CJK Compatibility Forms"](e)||Aa["Small Form Variants"](e)||Aa["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e)}function Ba(e){return!(Ca(e)||za(e))}function Va(e){return Aa.Arabic(e)||Aa["Arabic Supplement"](e)||Aa["Arabic Extended-A"](e)||Aa["Arabic Presentation Forms-A"](e)||Aa["Arabic Presentation Forms-B"](e)}function Ea(e){return e>=1424&&e<=2303||Aa["Arabic Presentation Forms-A"](e)||Aa["Arabic Presentation Forms-B"](e)}function Fa(e,t){return!(!t&&Ea(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||Aa.Khmer(e))}function Ta(e){for(let t of e)if(Ea(t.charCodeAt(0)))return!0;return!1}function La(e,t){for(let r of e)if(!Fa(r.charCodeAt(0),t))return!1;return!0}l(ka,"allowsVerticalWritingMode"),l(Ia,"allowsLetterSpacing"),l(Ma,"charAllowsLetterSpacing"),l(Pa,"charAllowsIdeographicBreaking"),l(Ca,"charHasUprightVerticalOrientation"),l(za,"charHasNeutralVerticalOrientation"),l(Ba,"charHasRotatedVerticalOrientation"),l(Va,"charInComplexShapingScript"),l(Ea,"charInRTLScript"),l(Fa,"charInSupportedScript"),l(Ta,"stringContainsRTLText"),l(La,"isStringInSupportedScript"),p(),p();typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),typeof navigator<"u"&&navigator.hardwareConcurrency;var Da="loading",Oa="loaded",Ra="unavailable",qa=null,Ua=(new ga,l((function(){return Ra}),"getRTLTextPluginStatus")),ja={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Ra===Oa||null!=ja.applyArabicShaping,isLoading:()=>Ra===Da,setState(e){if(!N())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");Ra=e.pluginStatus,qa=e.pluginURL},isParsed(){if(!N())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return null!=ja.applyArabicShaping&&null!=ja.processBidirectionalText&&null!=ja.processStyledBidirectionalText},getPluginURL(){if(!N())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return qa}},Na=class{constructor(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Sa,this.transition={})}isSupportedScript(e){return La(e,ja.isLoaded())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}}};l(Na,"EvaluationParameters");var Za=Na,Ja=class{constructor(e,t){this.property=e,this.value=t,this.expression=Zi(void 0===t?e.specification.default:t,e.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)}};l(Ja,"PropertyValue");var Ga=Ja,Ka=class{constructor(e){this.property=e,this.value=new Ga(e,void 0)}transitioned(e,t){return new $a(this.property,this.value,t,E({},e.transition,this.transition),e.now)}untransitioned(){return new $a(this.property,this.value,null,{},0)}};l(Ka,"TransitionablePropertyValue");var Xa=Ka,Ya=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return D(this._values[e].value.value)}setValue(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Xa(this._values[e].property)),this._values[e].value=new Ga(this._values[e].property,null===t?void 0:D(t))}getTransition(e){return D(this._values[e].transition)}setTransition(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Xa(this._values[e].property)),this._values[e].transition=D(t)||void 0}serialize(){let e={};for(let t of Object.keys(this._values)){let r=this.getValue(t);void 0!==r&&(e[t]=r);let i=this.getTransition(t);void 0!==i&&(e["".concat(t,"-transition")]=i)}return e}transitioned(e,t){let r=new es(this._properties);for(let i of Object.keys(this._values))r._values[i]=this._values[i].transitioned(e,t._values[i]);return r}untransitioned(){let e=new es(this._properties);for(let t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}};l(Ya,"Transitionable");var Ha=Ya,Wa=class{constructor(e,t,r,i,n){this.property=e,this.value=t,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,e.specification.transition&&(i.delay||i.duration)&&(this.prior=r)}possiblyEvaluate(e,t,r){let i=e.now||0,n=this.value.possiblyEvaluate(e,t,r),a=this.prior;if(a){if(i>this.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(i<this.begin)return a.possiblyEvaluate(e,t,r);{let s=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(e,t,r),n,C(s))}}return n}};l(Wa,"TransitioningPropertyValue");var $a=Wa,Qa=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,r){let i=new ss(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(e,t,r);return i}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}};l(Qa,"Transitioning");var es=Qa,ts=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}getValue(e){return D(this._values[e].value)}setValue(e,t){this._values[e]=new Ga(this._values[e].property,null===t?void 0:D(t))}serialize(){let e={};for(let t of Object.keys(this._values)){let r=this.getValue(t);void 0!==r&&(e[t]=r)}return e}possiblyEvaluate(e,t,r){let i=new ss(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(e,t,r);return i}};l(ts,"Layout");var rs=ts,is=class{constructor(e,t,r){this.property=e,this.value=t,this.parameters=r}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,t,r,i){return this.property.evaluate(this.value,this.parameters,e,t,r,i)}};l(is,"PossiblyEvaluatedPropertyValue");var ns=is,as=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}};l(as,"PossiblyEvaluated");var ss=as,os=class{constructor(e){this.specification=e}possiblyEvaluate(e,t){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(t)}interpolate(e,t,r){let i=this.specification.type,n=vr[i];return n?n(e,t,r):e}};l(os,"DataConstantProperty");var ls=os,us=class{constructor(e,t){this.specification=e,this.overrides=t}possiblyEvaluate(e,t,r,i){return"constant"===e.expression.kind||"camera"===e.expression.kind?new ns(this,{kind:"constant",value:e.expression.evaluate(t,null,{},r,i)},t):new ns(this,e.expression,t)}interpolate(e,t,r){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new ns(this,{kind:"constant",value:void 0},e.parameters);let i=this.specification.type,n=vr[i];if(n){let i=n(e.value.value,t.value.value,r);return new ns(this,{kind:"constant",value:i},e.parameters)}return e}evaluate(e,t,r,i,n,a){return"constant"===e.kind?e.value:e.evaluate(t,r,i,n,a)}};l(us,"DataDrivenProperty");var cs=us,hs=class extends cs{possiblyEvaluate(e,t,r,i){if(void 0===e.value)return new ns(this,{kind:"constant",value:void 0},t);if("constant"===e.expression.kind){let n=e.expression.evaluate(t,null,{},r,i),a="resolvedImage"===e.property.specification.type&&"string"!=typeof n?n.name:n,s=this._calculate(a,a,a,t);return new ns(this,{kind:"constant",value:s},t)}if("camera"===e.expression.kind){let r=this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t);return new ns(this,{kind:"constant",value:r},t)}return new ns(this,e.expression,t)}evaluate(e,t,r,i,n,a){if("source"===e.kind){let s=e.evaluate(t,r,i,n,a);return this._calculate(s,s,s,t)}return"composite"===e.kind?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},r,i),e.evaluate({zoom:Math.floor(t.zoom)},r,i),e.evaluate({zoom:Math.floor(t.zoom)+1},r,i),t):e.value}_calculate(e,t,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}};l(hs,"CrossFadedDataDrivenProperty");var ps=hs,ds=class{constructor(e){this.specification=e}possiblyEvaluate(e,t,r,i){if(void 0!==e.value){if("constant"===e.expression.kind){let n=e.expression.evaluate(t,null,{},r,i);return this._calculate(n,n,n,t)}return this._calculate(e.expression.evaluate(new Za(Math.floor(t.zoom-1),t)),e.expression.evaluate(new Za(Math.floor(t.zoom),t)),e.expression.evaluate(new Za(Math.floor(t.zoom+1),t)),t)}}_calculate(e,t,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}};l(ds,"CrossFadedProperty");var fs=ds,ys=class{constructor(e){this.specification=e}possiblyEvaluate(e,t,r,i){return!!e.expression.evaluate(t,null,{},r,i)}interpolate(){return!1}};l(ys,"ColorRampProperty");var ms=ys,gs=class{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let t in e){let r=e[t];r.specification.overridable&&this.overridableProperties.push(t);let i=this.defaultPropertyValues[t]=new Ga(r,void 0),n=this.defaultTransitionablePropertyValues[t]=new Xa(r);this.defaultTransitioningPropertyValues[t]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=i.possiblyEvaluate({})}}};l(gs,"Properties");var xs=gs;ra("DataDrivenProperty",cs),ra("DataConstantProperty",ls),ra("CrossFadedDataDrivenProperty",ps),ra("CrossFadedProperty",fs),ra("ColorRampProperty",ms);var vs="-transition",bs=class extends ga{constructor(e,t){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:l((()=>!0),"filter"),needGeometry:!1},"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),t.layout&&(this._unevaluatedLayout=new rs(t.layout)),t.paint)){this._transitionablePaint=new Ha(t.paint);for(let t in e.paint)this.setPaintProperty(t,e.paint[t],{validate:!1});for(let t in e.layout)this.setLayoutProperty(t,e.layout[t],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ss(t.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,t,r={}){if(null!=t){let i="layers.".concat(this.id,".layout.").concat(e);if(this._validate(ba,i,e,t,r))return}"visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility=t}getPaintProperty(e){return e.endsWith(vs)?this._transitionablePaint.getTransition(e.slice(0,-vs.length)):this._transitionablePaint.getValue(e)}setPaintProperty(e,t,r={}){if(null!=t){let i="layers.".concat(this.id,".paint.").concat(e);if(this._validate(va,i,e,t,r))return!1}if(e.endsWith(vs))return this._transitionablePaint.setTransition(e.slice(0,-vs.length),t||void 0),!1;{let r=this._transitionablePaint._values[e],i="cross-faded-data-driven"===r.property.specification["property-type"],n=r.value.isDataDriven(),a=r.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);let s=this._transitionablePaint._values[e].value;return s.isDataDriven()||n||i||this._handleOverridablePaintPropertyUpdate(e,a,s)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,t,r){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom||this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){let e={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&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),L(e,((e,t)=>!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)))}_validate(e,t,r,i,n={}){return(!n||!1!==n.validate)&&wa(this,e.call(xa,{key:t,layerType:this.type,objectKey:r,value:i,styleSpec:H,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let t=this.paint.get(e);if(t instanceof ns&&bi(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}};l(bs,"StyleLayer");var ws=bs;p(),p(),p();var _s={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Ss=class{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}};l(Ss,"Struct");var As=Ss,ks=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}};l(ks,"StructArray");var Is=ks;function Ms(e,t=1){let r=0,i=0;return{members:e.map((e=>{let n=Ps(e.type),a=r=Cs(r,Math.max(t,n)),s=e.components||1;return i=Math.max(i,n),r+=n*s,{name:e.name,type:e.type,components:s,offset:a}})),size:Cs(r,Math.max(i,t)),alignment:t}}function Ps(e){return _s[e].BYTES_PER_ELEMENT}function Cs(e,t){return Math.ceil(e/t)*t}l(Ms,"createLayout"),l(Ps,"sizeOf"),l(Cs,"align");var zs=h(d(),1),Bs=class extends Is{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let i=2*e;return this.int16[i+0]=t,this.int16[i+1]=r,e}};l(Bs,"StructArrayLayout2i4");var Vs=Bs;Vs.prototype.bytesPerElement=4,ra("StructArrayLayout2i4",Vs);var Es=class extends Is{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=3*e;return this.int16[n+0]=t,this.int16[n+1]=r,this.int16[n+2]=i,e}};l(Es,"StructArrayLayout3i6");var Fs=Es;Fs.prototype.bytesPerElement=6,ra("StructArrayLayout3i6",Fs);var Ts=class extends Is{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){let a=4*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=i,this.int16[a+3]=n,e}};l(Ts,"StructArrayLayout4i8");var Ls=Ts;Ls.prototype.bytesPerElement=8,ra("StructArrayLayout4i8",Ls);var Ds=class extends Is{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,s){let o=6*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,e}};l(Ds,"StructArrayLayout2i4i12");var Os=Ds;Os.prototype.bytesPerElement=12,ra("StructArrayLayout2i4i12",Os);var Rs=class extends Is{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,s){let o=4*e,l=8*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.uint8[l+4]=i,this.uint8[l+5]=n,this.uint8[l+6]=a,this.uint8[l+7]=s,e}};l(Rs,"StructArrayLayout2i4ub8");var qs=Rs;qs.prototype.bytesPerElement=8,ra("StructArrayLayout2i4ub8",qs);var Us=class extends Is{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let i=2*e;return this.float32[i+0]=t,this.float32[i+1]=r,e}};l(Us,"StructArrayLayout2f8");var js=Us;js.prototype.bytesPerElement=8,ra("StructArrayLayout2f8",js);var Ns=class extends Is{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o,l,u){let c=this.length;return this.resize(c+1),this.emplace(c,e,t,r,i,n,a,s,o,l,u)}emplace(e,t,r,i,n,a,s,o,l,u,c){let h=10*e;return this.uint16[h+0]=t,this.uint16[h+1]=r,this.uint16[h+2]=i,this.uint16[h+3]=n,this.uint16[h+4]=a,this.uint16[h+5]=s,this.uint16[h+6]=o,this.uint16[h+7]=l,this.uint16[h+8]=u,this.uint16[h+9]=c,e}};l(Ns,"StructArrayLayout10ui20");var Zs=Ns;Zs.prototype.bytesPerElement=20,ra("StructArrayLayout10ui20",Zs);var Js=class extends Is{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o,l,u,c,h){let p=this.length;return this.resize(p+1),this.emplace(p,e,t,r,i,n,a,s,o,l,u,c,h)}emplace(e,t,r,i,n,a,s,o,l,u,c,h,p){let d=12*e;return this.int16[d+0]=t,this.int16[d+1]=r,this.int16[d+2]=i,this.int16[d+3]=n,this.uint16[d+4]=a,this.uint16[d+5]=s,this.uint16[d+6]=o,this.uint16[d+7]=l,this.int16[d+8]=u,this.int16[d+9]=c,this.int16[d+10]=h,this.int16[d+11]=p,e}};l(Js,"StructArrayLayout4i4ui4i24");var Gs=Js;Gs.prototype.bytesPerElement=24,ra("StructArrayLayout4i4ui4i24",Gs);var Ks=class extends Is{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=3*e;return this.float32[n+0]=t,this.float32[n+1]=r,this.float32[n+2]=i,e}};l(Ks,"StructArrayLayout3f12");var Xs=Ks;Xs.prototype.bytesPerElement=12,ra("StructArrayLayout3f12",Xs);var Ys=class extends Is{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){let r=1*e;return this.uint32[r+0]=t,e}};l(Ys,"StructArrayLayout1ul4");var Hs=Ys;Hs.prototype.bytesPerElement=4,ra("StructArrayLayout1ul4",Hs);var Ws=class extends Is{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o,l){let u=this.length;return this.resize(u+1),this.emplace(u,e,t,r,i,n,a,s,o,l)}emplace(e,t,r,i,n,a,s,o,l,u){let c=10*e,h=5*e;return this.int16[c+0]=t,this.int16[c+1]=r,this.int16[c+2]=i,this.int16[c+3]=n,this.int16[c+4]=a,this.int16[c+5]=s,this.uint32[h+3]=o,this.uint16[c+8]=l,this.uint16[c+9]=u,e}};l(Ws,"StructArrayLayout6i1ul2ui20");var $s=Ws;$s.prototype.bytesPerElement=20,ra("StructArrayLayout6i1ul2ui20",$s);var Qs=class extends Is{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,s){let o=6*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,e}};l(Qs,"StructArrayLayout2i2i2i12");var eo=Qs;eo.prototype.bytesPerElement=12,ra("StructArrayLayout2i2i2i12",eo);var to=class extends Is{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n){let a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,i,n)}emplace(e,t,r,i,n,a){let s=4*e,o=8*e;return this.float32[s+0]=t,this.float32[s+1]=r,this.float32[s+2]=i,this.int16[o+6]=n,this.int16[o+7]=a,e}};l(to,"StructArrayLayout2f1f2i16");var ro=to;ro.prototype.bytesPerElement=16,ra("StructArrayLayout2f1f2i16",ro);var io=class extends Is{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){let a=12*e,s=3*e;return this.uint8[a+0]=t,this.uint8[a+1]=r,this.float32[s+1]=i,this.float32[s+2]=n,e}};l(io,"StructArrayLayout2ub2f12");var no=io;no.prototype.bytesPerElement=12,ra("StructArrayLayout2ub2f12",no);var ao=class extends Is{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=3*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,this.uint16[n+2]=i,e}};l(ao,"StructArrayLayout3ui6");var so=ao;so.prototype.bytesPerElement=6,ra("StructArrayLayout3ui6",so);var oo=class extends Is{_refreshViews(){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)}emplaceBack(e,t,r,i,n,a,s,o,l,u,c,h,p,d,f,y,m){let g=this.length;return this.resize(g+1),this.emplace(g,e,t,r,i,n,a,s,o,l,u,c,h,p,d,f,y,m)}emplace(e,t,r,i,n,a,s,o,l,u,c,h,p,d,f,y,m,g){let x=24*e,v=12*e,b=48*e;return this.int16[x+0]=t,this.int16[x+1]=r,this.uint16[x+2]=i,this.uint16[x+3]=n,this.uint32[v+2]=a,this.uint32[v+3]=s,this.uint32[v+4]=o,this.uint16[x+10]=l,this.uint16[x+11]=u,this.uint16[x+12]=c,this.float32[v+7]=h,this.float32[v+8]=p,this.uint8[b+36]=d,this.uint8[b+37]=f,this.uint8[b+38]=y,this.uint32[v+10]=m,this.int16[x+22]=g,e}};l(oo,"StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48");var lo=oo;lo.prototype.bytesPerElement=48,ra("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",lo);var uo=class extends Is{_refreshViews(){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)}emplaceBack(e,t,r,i,n,a,s,o,l,u,c,h,p,d,f,y,m,g,x,v,b,w,_,S,A,k,I,M){let P=this.length;return this.resize(P+1),this.emplace(P,e,t,r,i,n,a,s,o,l,u,c,h,p,d,f,y,m,g,x,v,b,w,_,S,A,k,I,M)}emplace(e,t,r,i,n,a,s,o,l,u,c,h,p,d,f,y,m,g,x,v,b,w,_,S,A,k,I,M,P){let C=34*e,z=17*e;return this.int16[C+0]=t,this.int16[C+1]=r,this.int16[C+2]=i,this.int16[C+3]=n,this.int16[C+4]=a,this.int16[C+5]=s,this.int16[C+6]=o,this.int16[C+7]=l,this.uint16[C+8]=u,this.uint16[C+9]=c,this.uint16[C+10]=h,this.uint16[C+11]=p,this.uint16[C+12]=d,this.uint16[C+13]=f,this.uint16[C+14]=y,this.uint16[C+15]=m,this.uint16[C+16]=g,this.uint16[C+17]=x,this.uint16[C+18]=v,this.uint16[C+19]=b,this.uint16[C+20]=w,this.uint16[C+21]=_,this.uint16[C+22]=S,this.uint32[z+12]=A,this.float32[z+13]=k,this.float32[z+14]=I,this.float32[z+15]=M,this.float32[z+16]=P,e}};l(uo,"StructArrayLayout8i15ui1ul4f68");var co=uo;co.prototype.bytesPerElement=68,ra("StructArrayLayout8i15ui1ul4f68",co);var ho=class extends Is{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){let r=1*e;return this.float32[r+0]=t,e}};l(ho,"StructArrayLayout1f4");var po=ho;po.prototype.bytesPerElement=4,ra("StructArrayLayout1f4",po);var fo=class extends Is{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=2*e,a=4*e;return this.uint32[n+0]=t,this.uint16[a+2]=r,this.uint16[a+3]=i,e}};l(fo,"StructArrayLayout1ul2ui8");var yo=fo;yo.prototype.bytesPerElement=8,ra("StructArrayLayout1ul2ui8",yo);var mo=class extends Is{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let i=2*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,e}};l(mo,"StructArrayLayout2ui4");var go=mo;go.prototype.bytesPerElement=4,ra("StructArrayLayout2ui4",go);var xo=class extends Is{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){let r=1*e;return this.uint16[r+0]=t,e}};l(xo,"StructArrayLayout1ui2");var vo=xo;vo.prototype.bytesPerElement=2,ra("StructArrayLayout1ui2",vo);var bo=class extends Is{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){let a=4*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=i,this.float32[a+3]=n,e}};l(bo,"StructArrayLayout4f16");var wo=bo;wo.prototype.bytesPerElement=16,ra("StructArrayLayout4f16",wo);var _o=class extends As{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new zs.default(this.anchorPointX,this.anchorPointY)}};l(_o,"CollisionBoxStruct");var So=_o;So.prototype.size=20;var Ao=class extends $s{get(e){return new So(this,e)}};l(Ao,"CollisionBoxArray");var ko=Ao;ra("CollisionBoxArray",ko);var Io=class extends As{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}};l(Io,"PlacedSymbolStruct");var Mo=Io;Mo.prototype.size=48;var Po=class extends lo{get(e){return new Mo(this,e)}};l(Po,"PlacedSymbolArray");var Co=Po;ra("PlacedSymbolArray",Co);var zo=class extends As{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}};l(zo,"SymbolInstanceStruct");var Bo=zo;Bo.prototype.size=68;var Vo=class extends co{get(e){return new Bo(this,e)}};l(Vo,"SymbolInstanceArray");var Eo=Vo;ra("SymbolInstanceArray",Eo);var Fo=class extends po{getoffsetX(e){return this.float32[1*e+0]}};l(Fo,"GlyphOffsetArray");var To=Fo;ra("GlyphOffsetArray",To);var Lo=class extends Fs{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}};l(Lo,"SymbolLineVertexArray");var Do=Lo;ra("SymbolLineVertexArray",Do);var Oo=class extends As{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}};l(Oo,"FeatureIndexStruct");var Ro=Oo;Ro.prototype.size=8;var qo=class extends yo{get(e){return new Ro(this,e)}};l(qo,"FeatureIndexArray");var Uo=qo;ra("FeatureIndexArray",Uo);var jo=class extends Vs{};l(jo,"PosArray");var No=jo,Zo=class extends Vs{};l(Zo,"CircleLayoutArray");var Jo=Zo,Go=class extends Vs{};l(Go,"FillLayoutArray");var Ko=Go,Xo=class extends Os{};l(Xo,"FillExtrusionLayoutArray");var Yo=Xo,Ho=class extends qs{};l(Ho,"LineLayoutArray");var Wo=Ho,$o=class extends js{};l($o,"LineExtLayoutArray");var Qo=$o,el=class extends Zs{};l(el,"PatternLayoutArray");var tl=el,rl=class extends Gs{};l(rl,"SymbolLayoutArray");var il=rl,nl=class extends Xs{};l(nl,"SymbolDynamicLayoutArray");var al=nl,sl=class extends Hs{};l(sl,"SymbolOpacityArray");var ol=sl,ll=class extends eo{};l(ll,"CollisionBoxLayoutArray");var ul=ll,cl=class extends no{};l(cl,"CollisionVertexArray");var hl=cl,pl=class extends so{};l(pl,"TriangleIndexArray");var dl=pl,fl=class extends go{};l(fl,"LineIndexArray");var yl=fl;p();var ml=Ms([{name:"a_pos",components:2,type:"Int16"}],4),{members:gl,size:xl,alignment:vl}=ml;p();var bl=class e{constructor(e=[]){this.segments=e}prepareSegment(t,r,i,n){let a=this.segments[this.segments.length-1];return t>e.MAX_VERTEX_ARRAY_LENGTH&&q("Max vertices per segment is ".concat(e.MAX_VERTEX_ARRAY_LENGTH,": bucket requested ").concat(t)),(!a||a.vertexLength+t>e.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==n)&&(a={vertexOffset:r.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0},void 0!==n&&(a.sortKey=n),this.segments.push(a)),a}get(){return this.segments}destroy(){for(let e of this.segments)for(let t in e.vaos)e.vaos[t].destroy()}static simpleSegment(t,r,i,n){return new e([{vertexOffset:t,primitiveOffset:r,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}};l(bl,"SegmentVector");var wl=bl;function _l(e,t){return 256*(e=B(Math.floor(e),0,255))+(t=B(Math.floor(t),0,255))}wl.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ra("SegmentVector",wl),p(),p(),l(_l,"packUint8ToFloat"),p();var Sl=Ms([{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"}]);p();var Al=h(g(),1),kl=class e{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,t,r,i){this.ids.push(Ml(e)),this.positions.push(t,r,i)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let t=Ml(e),r=0,i=this.ids.length-1;for(;r<i;){let e=r+i>>1;this.ids[e]>=t?i=e:r=e+1}let n=[];for(;this.ids[r]===t;){let e=this.positions[3*r],t=this.positions[3*r+1],i=this.positions[3*r+2];n.push({index:e,start:t,end:i}),r++}return n}static serialize(e,t){let r=new Float64Array(e.ids),i=new Uint32Array(e.positions);return Pl(r,i,0,r.length-1),t&&t.push(r.buffer,i.buffer),{ids:r,positions:i}}static deserialize(t){let r=new e;return r.ids=t.ids,r.positions=t.positions,r.indexed=!0,r}};l(kl,"FeaturePositionMap");var Il=kl;function Ml(e){let t=+e;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:(0,Al.default)(String(e))}function Pl(e,t,r,i){for(;r<i;){let n=e[r+i>>1],a=r-1,s=i+1;for(;;){do{a++}while(e[a]<n);do{s--}while(e[s]>n);if(a>=s)break;Cl(e,a,s),Cl(t,3*a,3*s),Cl(t,3*a+1,3*s+1),Cl(t,3*a+2,3*s+2)}s-r<i-s?(Pl(e,t,r,s),r=s+1):(Pl(e,t,s+1,i),i=s)}}function Cl(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}l(Ml,"getNumericId"),l(Pl,"sort"),l(Cl,"swap"),ra("FeaturePositionMap",Il),p();var zl=class{constructor(e,t){this.gl=e.gl,this.location=t}};l(zl,"Uniform");var Bl=zl,Vl=class extends Bl{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}};l(Vl,"Uniform1f");var El=Vl,Fl=class extends Bl{constructor(e,t){super(e,t),this.current=[0,0,0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2]||e[3]!==this.current[3])&&(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}};l(Fl,"Uniform4f");var Tl=Fl,Ll=class extends Bl{constructor(e,t){super(e,t),this.current=Xe.transparent}set(e){(e.r!==this.current.r||e.g!==this.current.g||e.b!==this.current.b||e.a!==this.current.a)&&(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}};l(Ll,"UniformColor");var Dl=Ll;new Float32Array(16);function Ol(e){return[_l(255*e.r,255*e.g),_l(255*e.b,255*e.a)]}l(Ol,"packColor");var Rl=class{constructor(e,t,r){this.value=e,this.uniformNames=t.map((e=>"u_".concat(e))),this.type=r}setUniform(e,t,r){e.set(r.constantOr(this.value))}getBinding(e,t,r){return"color"===this.type?new Dl(e,t):new El(e,t)}};l(Rl,"ConstantBinder");var ql=Rl,Ul=class{constructor(e,t){this.uniformNames=t.map((e=>"u_".concat(e))),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr}setUniform(e,t,r,i){let n="u_pattern_to"===i?this.patternTo:"u_pattern_from"===i?this.patternFrom:"u_pixel_ratio_to"===i?this.pixelRatioTo:"u_pixel_ratio_from"===i?this.pixelRatioFrom:null;n&&e.set(n)}getBinding(e,t,r){return"u_pattern"===r.substr(0,9)?new Tl(e,t):new El(e,t)}};l(Ul,"CrossFadedConstantBinder");var jl=Ul,Nl=class{constructor(e,t,r,i){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:"a_".concat(e),type:"Float32",components:"color"===r?2:1,offset:0}))),this.paintVertexArray=new i}populatePaintArray(e,t,r,i,n){let a=this.paintVertexArray.length,s=this.expression.evaluate(new Za(0),t,{},i,[],n);this.paintVertexArray.resize(e),this._setPaintValue(a,e,s)}updatePaintArray(e,t,r,i){let n=this.expression.evaluate({zoom:0},r,i);this._setPaintValue(e,t,n)}_setPaintValue(e,t,r){if("color"===this.type){let i=Ol(r);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,i[0],i[1])}else{for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}};l(Nl,"SourceExpressionBinder");var Zl=Nl,Jl=class{constructor(e,t,r,i,n,a){this.expression=e,this.uniformNames=t.map((e=>"u_".concat(e,"_t"))),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:"a_".concat(e),type:"Float32",components:"color"===r?4:2,offset:0}))),this.paintVertexArray=new a}populatePaintArray(e,t,r,i,n){let a=this.expression.evaluate(new Za(this.zoom),t,{},i,[],n),s=this.expression.evaluate(new Za(this.zoom+1),t,{},i,[],n),o=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(o,e,a,s)}updatePaintArray(e,t,r,i){let n=this.expression.evaluate({zoom:this.zoom},r,i),a=this.expression.evaluate({zoom:this.zoom+1},r,i);this._setPaintValue(e,t,n,a)}_setPaintValue(e,t,r,i){if("color"===this.type){let n=Ol(r),a=Ol(i);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,n[0],n[1],a[0],a[1])}else{for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,r,i);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(i))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t){let r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,i=B(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(i)}getBinding(e,t,r){return new El(e,t)}};l(Jl,"CompositeExpressionBinder");var Gl=Jl,Kl=class{constructor(e,t,r,i,n,a){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=i,this.layerId=a,this.zoomInPaintVertexArray=new n,this.zoomOutPaintVertexArray=new n}populatePaintArray(e,t,r){let i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(i,e,t.patterns&&t.patterns[this.layerId],r)}updatePaintArray(e,t,r,i,n){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],n)}_setPaintValues(e,t,r,i){if(!i||!r)return;let{min:n,mid:a,max:s}=r,o=i[n],l=i[a],u=i[s];if(o&&l&&u)for(let r=e;r<t;r++)this.zoomInPaintVertexArray.emplace(r,l.tl[0],l.tl[1],l.br[0],l.br[1],o.tl[0],o.tl[1],o.br[0],o.br[1],l.pixelRatio,o.pixelRatio),this.zoomOutPaintVertexArray.emplace(r,l.tl[0],l.tl[1],l.br[0],l.br[1],u.tl[0],u.tl[1],u.br[0],u.br[1],l.pixelRatio,u.pixelRatio)}upload(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,Sl.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,Sl.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}};l(Kl,"CrossFadedCompositeBinder");var Xl=Kl,Yl=class{constructor(e,t,r){this.binders={},this._buffers=[];let i=[];for(let n in e.paint._values){if(!r(n))continue;let a=e.paint.get(n);if(!(a instanceof ns&&bi(a.property.specification)))continue;let s=Ql(n,e.type),o=a.value,l=a.property.specification.type,u=a.property.useIntegerZoom,c=a.property.specification["property-type"],h="cross-faded"===c||"cross-faded-data-driven"===c;if("constant"===o.kind)this.binders[n]=h?new jl(o.value,s):new ql(o.value,s,l),i.push("/u_".concat(n));else if("source"===o.kind||h){let r=tu(n,l,"source");this.binders[n]=h?new Xl(o,l,u,t,r,e.id):new Zl(o,s,l,r),i.push("/a_".concat(n))}else{let e=tu(n,l,"composite");this.binders[n]=new Gl(o,s,l,u,t,e),i.push("/z_".concat(n))}}this.cacheKey=i.sort().join("")}getMaxValue(e){let t=this.binders[e];return t instanceof Zl||t instanceof Gl?t.maxValue:0}populatePaintArrays(e,t,r,i,n){for(let a in this.binders){let s=this.binders[a];(s instanceof Zl||s instanceof Gl||s instanceof Xl)&&s.populatePaintArray(e,t,r,i,n)}}setConstantPatternPositions(e,t){for(let r in this.binders){let i=this.binders[r];i instanceof jl&&i.setConstantPatternPositions(e,t)}}updatePaintArrays(e,t,r,i,n){let a=!1;for(let s in e){let o=t.getPositions(s);for(let t of o){let o=r.feature(t.index);for(let r in this.binders){let l=this.binders[r];if((l instanceof Zl||l instanceof Gl||l instanceof Xl)&&!0===l.expression.isStateDependent){let u=i.paint.get(r);l.expression=u.value,l.updatePaintArray(t.start,t.end,o,e[s],n),a=!0}}}}return a}defines(){let e=[];for(let t in this.binders){let r=this.binders[t];(r instanceof ql||r instanceof jl)&&e.push(...r.uniformNames.map((e=>"#define HAS_UNIFORM_".concat(e))))}return e}getBinderAttributes(){let e=[];for(let t in this.binders){let r=this.binders[t];if(r instanceof Zl||r instanceof Gl)for(let t=0;t<r.paintVertexAttributes.length;t++)e.push(r.paintVertexAttributes[t].name);else if(r instanceof Xl)for(let t=0;t<Sl.members.length;t++)e.push(Sl.members[t].name)}return e}getBinderUniforms(){let e=[];for(let t in this.binders){let r=this.binders[t];if(r instanceof ql||r instanceof jl||r instanceof Gl)for(let t of r.uniformNames)e.push(t)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,t){let r=[];for(let i in this.binders){let n=this.binders[i];if(n instanceof ql||n instanceof jl||n instanceof Gl)for(let a of n.uniformNames)if(t[a]){let s=n.getBinding(e,t[a],a);r.push({name:a,property:i,binding:s})}}return r}setUniforms(e,t,r,i){for(let{name:e,property:n,binding:a}of t)this.binders[n].setUniform(a,i,r.get(n),e)}updatePaintBuffers(e){this._buffers=[];for(let t in this.binders){let r=this.binders[t];if(e&&r instanceof Xl){let t=2===e.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;t&&this._buffers.push(t)}else(r instanceof Zl||r instanceof Gl)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(e){for(let t in this.binders){let r=this.binders[t];(r instanceof Zl||r instanceof Gl||r instanceof Xl)&&r.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let t=this.binders[e];(t instanceof Zl||t instanceof Gl||t instanceof Xl)&&t.destroy()}}};l(Yl,"ProgramConfiguration");var Hl=Yl,Wl=class{constructor(e,t,r=(()=>!0)){this.programConfigurations={};for(let i of e)this.programConfigurations[i.id]=new Hl(i,t,r);this.needsUpload=!1,this._featureMap=new Il,this._bufferOffset=0}populatePaintArrays(e,t,r,i,n,a){for(let r in this.programConfigurations)this.programConfigurations[r].populatePaintArrays(e,t,i,n,a);void 0!==t.id&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,r,i){for(let n of r)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(e,this._featureMap,t,n,i)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}};l(Wl,"ProgramConfigurationSet");var $l=Wl;function Ql(e,t){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"]}[e]||[e.replace("".concat(t,"-"),"").replace(/-/g,"_")]}function eu(e){return{"line-pattern":{source:tl,composite:tl},"fill-pattern":{source:tl,composite:tl},"fill-extrusion-pattern":{source:tl,composite:tl}}[e]}function tu(e,t,r){let i={color:{source:js,composite:wo},number:{source:po,composite:js}},n=eu(e);return n&&n[r]||i[t][r]}l(Ql,"paintAttributeNames"),l(eu,"getLayoutException"),l(tu,"layoutType"),ra("ConstantBinder",ql),ra("CrossFadedConstantBinder",jl),ra("SourceExpressionBinder",Zl),ra("CrossFadedCompositeBinder",Xl),ra("CompositeExpressionBinder",Gl),ra("ProgramConfiguration",Hl,{omit:["_buffers"]}),ra("ProgramConfigurationSet",$l),p(),p(),p();var ru=Math.pow(2,14)-1,iu=-ru-1;function nu(e){let t=8192/e.extent,r=e.loadGeometry();for(let e=0;e<r.length;e++){let i=r[e];for(let e=0;e<i.length;e++){let r=i[e],n=Math.round(r.x*t),a=Math.round(r.y*t);r.x=B(n,iu,ru),r.y=B(a,iu,ru),(n<r.x||n>r.x+1||a<r.y||a>r.y+1)&&q("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function au(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?nu(e):[]}}function su(e,t,r,i,n){e.emplaceBack(2*t+(i+1)/2,2*r+(n+1)/2)}l(nu,"loadGeometry"),p(),l(au,"toEvaluationFeature"),l(su,"addCircleVertex");var ou=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Jo,this.indexArray=new dl,this.segments=new wl,this.programConfigurations=new $l(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){let i=this.layers[0],n=[],a=null,s=!1;"circle"===i.type&&(a=i.layout.get("circle-sort-key"),s=!a.isConstant());for(let{feature:t,id:i,index:o,sourceLayerIndex:l}of e){let e=this.layers[0]._featureFilter.needGeometry,u=au(t,e);if(!this.layers[0]._featureFilter.filter(new Za(this.zoom),u,r))continue;let c=s?a.evaluate(u,{},r):void 0,h={id:i,properties:t.properties,type:t.type,sourceLayerIndex:l,index:o,geometry:e?u.geometry:nu(t),patterns:{},sortKey:c};n.push(h)}s&&n.sort(((e,t)=>e.sortKey-t.sortKey));for(let i of n){let{geometry:n,index:a,sourceLayerIndex:s}=i,o=e[a].feature;this.addFeature(i,n,a,r),t.featureIndex.insert(o,n,a,s,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,gl),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,r,i){for(let r of t)for(let t of r){let r=t.x,i=t.y;if(r<0||r>=8192||i<0||i>=8192)continue;let n=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),a=n.vertexLength;su(this.layoutVertexArray,r,i,-1,-1),su(this.layoutVertexArray,r,i,1,-1),su(this.layoutVertexArray,r,i,1,1),su(this.layoutVertexArray,r,i,-1,1),this.indexArray.emplaceBack(a,a+1,a+2),this.indexArray.emplaceBack(a,a+3,a+2),n.vertexLength+=4,n.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},i)}};l(ou,"CircleBucket");var lu=ou;ra("CircleBucket",lu,{omit:["layers"]}),p();var uu=h(d(),1);function cu(e,t){for(let r=0;r<e.length;r++)if(bu(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(bu(e,t[r]))return!0;return!!yu(e,t)}function hu(e,t,r){return!(!bu(e,t)&&!gu(t,e,r))}function pu(e,t){if(1===e.length)return vu(t,e[0]);for(let r=0;r<t.length;r++){let i=t[r];for(let t=0;t<i.length;t++)if(bu(e,i[t]))return!0}for(let r=0;r<e.length;r++)if(vu(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(yu(e,t[r]))return!0;return!1}function du(e,t,r){for(let i=0;i<t.length;i++){let n=t[i];if(e.length>=3)for(let t=0;t<n.length;t++)if(bu(e,n[t]))return!0;if(fu(e,n,r))return!0}return!1}function fu(e,t,r){if(e.length>1){if(yu(e,t))return!0;for(let i=0;i<t.length;i++)if(gu(t[i],e,r))return!0}for(let i=0;i<e.length;i++)if(gu(e[i],t,r))return!0;return!1}function yu(e,t){if(0===e.length||0===t.length)return!1;for(let r=0;r<e.length-1;r++){let i=e[r],n=e[r+1];for(let e=0;e<t.length-1;e++){if(mu(i,n,t[e],t[e+1]))return!0}}return!1}function mu(e,t,r,i){return U(e,r,i)!==U(t,r,i)&&U(e,t,r)!==U(e,t,i)}function gu(e,t,r){let i=r*r;if(1===t.length)return e.distSqr(t[0])<i;for(let r=1;r<t.length;r++){if(xu(e,t[r-1],t[r])<i)return!0}return!1}function xu(e,t,r){let i=t.distSqr(r);if(0===i)return e.distSqr(t);let n=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/i;return n<0?e.distSqr(t):n>1?e.distSqr(r):e.distSqr(r.sub(t)._mult(n)._add(t))}function vu(e,t){let r,i,n,a=!1;for(let s=0;s<e.length;s++){r=e[s];for(let e=0,s=r.length-1;e<r.length;s=e++)i=r[e],n=r[s],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(a=!a)}return a}function bu(e,t){let r=!1;for(let i=0,n=e.length-1;i<e.length;n=i++){let a=e[i],s=e[n];a.y>t.y!=s.y>t.y&&t.x<(s.x-a.x)*(t.y-a.y)/(s.y-a.y)+a.x&&(r=!r)}return r}function wu(e,t,r,i,n){for(let a of e)if(t<=a.x&&r<=a.y&&i>=a.x&&n>=a.y)return!0;let a=[new uu.default(t,r),new uu.default(t,n),new uu.default(i,n),new uu.default(i,r)];if(e.length>2)for(let t of a)if(bu(e,t))return!0;for(let t=0;t<e.length-1;t++){if(_u(e[t],e[t+1],a))return!0}return!1}function _u(e,t,r){let i=r[0],n=r[2];if(e.x<i.x&&t.x<i.x||e.x>n.x&&t.x>n.x||e.y<i.y&&t.y<i.y||e.y>n.y&&t.y>n.y)return!1;let a=U(e,t,r[0]);return a!==U(e,t,r[1])||a!==U(e,t,r[2])||a!==U(e,t,r[3])}l(cu,"polygonIntersectsPolygon"),l(hu,"polygonIntersectsBufferedPoint"),l(pu,"polygonIntersectsMultiPolygon"),l(du,"polygonIntersectsBufferedMultiLine"),l(fu,"lineIntersectsBufferedLine"),l(yu,"lineIntersectsLine"),l(mu,"lineSegmentIntersectsLineSegment"),l(gu,"pointIntersectsBufferedLine"),l(xu,"distToSegmentSquared"),l(vu,"multiPolygonContainsPoint"),l(bu,"polygonContainsPoint"),l(wu,"polygonIntersectsBox"),l(_u,"edgeIntersectsBox"),p();var Su=h(d(),1);function Au(e,t,r){let i=t.paint.get(e).value;return"constant"===i.kind?i.value:r.programConfigurations.get(t.id).getMaxValue(e)}function ku(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Iu(e,t,r,i,n){if(!t[0]&&!t[1])return e;let a=Su.default.convert(t)._mult(n);"viewport"===r&&a._rotate(-i);let s=[];for(let t=0;t<e.length;t++){let r=e[t];s.push(r.sub(a))}return s}function Mu(e,t){let r=[];for(let i=0;i<e.length;i++){let n=e[i],a=[];for(let e=0;e<n.length;e++){let r=n[e-1],i=n[e],s=n[e+1],o=0===e?new Su.default(0,0):i.sub(r)._unit()._perp(),l=e===n.length-1?new Su.default(0,0):s.sub(i)._unit()._perp(),u=o._add(l)._unit(),c=u.x*l.x+u.y*l.y;0!==c&&u._mult(1/c),a.push(u._mult(t)._add(i))}r.push(a)}return r}l(Au,"getMaximumPaintValue"),l(ku,"translateDistance"),l(Iu,"translate"),l(Mu,"offsetLine"),p();var Pu,Cu,zu=l((()=>Pu=Pu||new xs({"circle-sort-key":new cs(H.layout_circle["circle-sort-key"])})),"getLayout"),Bu=l((()=>Cu=Cu||new xs({"circle-radius":new cs(H.paint_circle["circle-radius"]),"circle-color":new cs(H.paint_circle["circle-color"]),"circle-blur":new cs(H.paint_circle["circle-blur"]),"circle-opacity":new cs(H.paint_circle["circle-opacity"]),"circle-translate":new ls(H.paint_circle["circle-translate"]),"circle-translate-anchor":new ls(H.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new ls(H.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new ls(H.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new cs(H.paint_circle["circle-stroke-width"]),"circle-stroke-color":new cs(H.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new cs(H.paint_circle["circle-stroke-opacity"])})),"getPaint"),Vu={get paint(){return Bu()},get layout(){return zu()}};p(),p();var Eu=1e-6,Fu=typeof Float32Array<"u"?Float32Array:Array,Tu=Math.random;Math.PI;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var Lu={};function Du(){var e=new Fu(16);return Fu!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Ou(e){var t=new Fu(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Ru(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function qu(e,t,r,i,n,a,s,o,l,u,c,h,p,d,f,y){var m=new Fu(16);return m[0]=e,m[1]=t,m[2]=r,m[3]=i,m[4]=n,m[5]=a,m[6]=s,m[7]=o,m[8]=l,m[9]=u,m[10]=c,m[11]=h,m[12]=p,m[13]=d,m[14]=f,m[15]=y,m}function Uu(e,t,r,i,n,a,s,o,l,u,c,h,p,d,f,y,m){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e[4]=a,e[5]=s,e[6]=o,e[7]=l,e[8]=u,e[9]=c,e[10]=h,e[11]=p,e[12]=d,e[13]=f,e[14]=y,e[15]=m,e}function ju(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Nu(e,t){if(e===t){var r=t[1],i=t[2],n=t[3],a=t[6],s=t[7],o=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=i,e[9]=a,e[11]=t[14],e[12]=n,e[13]=s,e[14]=o}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function Zu(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],s=t[4],o=t[5],l=t[6],u=t[7],c=t[8],h=t[9],p=t[10],d=t[11],f=t[12],y=t[13],m=t[14],g=t[15],x=r*o-i*s,v=r*l-n*s,b=r*u-a*s,w=i*l-n*o,_=i*u-a*o,S=n*u-a*l,A=c*y-h*f,k=c*m-p*f,I=c*g-d*f,M=h*m-p*y,P=h*g-d*y,C=p*g-d*m,z=x*C-v*P+b*M+w*I-_*k+S*A;return z?(z=1/z,e[0]=(o*C-l*P+u*M)*z,e[1]=(n*P-i*C-a*M)*z,e[2]=(y*S-m*_+g*w)*z,e[3]=(p*_-h*S-d*w)*z,e[4]=(l*I-s*C-u*k)*z,e[5]=(r*C-n*I+a*k)*z,e[6]=(m*b-f*S-g*v)*z,e[7]=(c*S-p*b+d*v)*z,e[8]=(s*P-o*I+u*A)*z,e[9]=(i*I-r*P-a*A)*z,e[10]=(f*_-y*b+g*x)*z,e[11]=(h*b-c*_-d*x)*z,e[12]=(o*k-s*M-l*A)*z,e[13]=(r*M-i*k+n*A)*z,e[14]=(y*v-f*w-m*x)*z,e[15]=(c*w-h*v+p*x)*z,e):null}function Ju(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],s=t[4],o=t[5],l=t[6],u=t[7],c=t[8],h=t[9],p=t[10],d=t[11],f=t[12],y=t[13],m=t[14],g=t[15];return e[0]=o*(p*g-d*m)-h*(l*g-u*m)+y*(l*d-u*p),e[1]=-(i*(p*g-d*m)-h*(n*g-a*m)+y*(n*d-a*p)),e[2]=i*(l*g-u*m)-o*(n*g-a*m)+y*(n*u-a*l),e[3]=-(i*(l*d-u*p)-o*(n*d-a*p)+h*(n*u-a*l)),e[4]=-(s*(p*g-d*m)-c*(l*g-u*m)+f*(l*d-u*p)),e[5]=r*(p*g-d*m)-c*(n*g-a*m)+f*(n*d-a*p),e[6]=-(r*(l*g-u*m)-s*(n*g-a*m)+f*(n*u-a*l)),e[7]=r*(l*d-u*p)-s*(n*d-a*p)+c*(n*u-a*l),e[8]=s*(h*g-d*y)-c*(o*g-u*y)+f*(o*d-u*h),e[9]=-(r*(h*g-d*y)-c*(i*g-a*y)+f*(i*d-a*h)),e[10]=r*(o*g-u*y)-s*(i*g-a*y)+f*(i*u-a*o),e[11]=-(r*(o*d-u*h)-s*(i*d-a*h)+c*(i*u-a*o)),e[12]=-(s*(h*m-p*y)-c*(o*m-l*y)+f*(o*p-l*h)),e[13]=r*(h*m-p*y)-c*(i*m-n*y)+f*(i*p-n*h),e[14]=-(r*(o*m-l*y)-s*(i*m-n*y)+f*(i*l-n*o)),e[15]=r*(o*p-l*h)-s*(i*p-n*h)+c*(i*l-n*o),e}function Gu(e){var t=e[0],r=e[1],i=e[2],n=e[3],a=e[4],s=e[5],o=e[6],l=e[7],u=e[8],c=e[9],h=e[10],p=e[11],d=e[12],f=e[13],y=e[14],m=e[15];return(t*s-r*a)*(h*m-p*y)-(t*o-i*a)*(c*m-p*f)+(t*l-n*a)*(c*y-h*f)+(r*o-i*s)*(u*m-p*d)-(r*l-n*s)*(u*y-h*d)+(i*l-n*o)*(u*f-c*d)}function Ku(e,t,r){var i=t[0],n=t[1],a=t[2],s=t[3],o=t[4],l=t[5],u=t[6],c=t[7],h=t[8],p=t[9],d=t[10],f=t[11],y=t[12],m=t[13],g=t[14],x=t[15],v=r[0],b=r[1],w=r[2],_=r[3];return e[0]=v*i+b*o+w*h+_*y,e[1]=v*n+b*l+w*p+_*m,e[2]=v*a+b*u+w*d+_*g,e[3]=v*s+b*c+w*f+_*x,v=r[4],b=r[5],w=r[6],_=r[7],e[4]=v*i+b*o+w*h+_*y,e[5]=v*n+b*l+w*p+_*m,e[6]=v*a+b*u+w*d+_*g,e[7]=v*s+b*c+w*f+_*x,v=r[8],b=r[9],w=r[10],_=r[11],e[8]=v*i+b*o+w*h+_*y,e[9]=v*n+b*l+w*p+_*m,e[10]=v*a+b*u+w*d+_*g,e[11]=v*s+b*c+w*f+_*x,v=r[12],b=r[13],w=r[14],_=r[15],e[12]=v*i+b*o+w*h+_*y,e[13]=v*n+b*l+w*p+_*m,e[14]=v*a+b*u+w*d+_*g,e[15]=v*s+b*c+w*f+_*x,e}function Xu(e,t,r){var i,n,a,s,o,l,u,c,h,p,d,f,y=r[0],m=r[1],g=r[2];return t===e?(e[12]=t[0]*y+t[4]*m+t[8]*g+t[12],e[13]=t[1]*y+t[5]*m+t[9]*g+t[13],e[14]=t[2]*y+t[6]*m+t[10]*g+t[14],e[15]=t[3]*y+t[7]*m+t[11]*g+t[15]):(i=t[0],n=t[1],a=t[2],s=t[3],o=t[4],l=t[5],u=t[6],c=t[7],h=t[8],p=t[9],d=t[10],f=t[11],e[0]=i,e[1]=n,e[2]=a,e[3]=s,e[4]=o,e[5]=l,e[6]=u,e[7]=c,e[8]=h,e[9]=p,e[10]=d,e[11]=f,e[12]=i*y+o*m+h*g+t[12],e[13]=n*y+l*m+p*g+t[13],e[14]=a*y+u*m+d*g+t[14],e[15]=s*y+c*m+f*g+t[15]),e}function Yu(e,t,r){var i=r[0],n=r[1],a=r[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Hu(e,t,r,i){var n,a,s,o,l,u,c,h,p,d,f,y,m,g,x,v,b,w,_,S,A,k,I,M,P=i[0],C=i[1],z=i[2],B=Math.hypot(P,C,z);return B<Eu?null:(P*=B=1/B,C*=B,z*=B,n=Math.sin(r),s=1-(a=Math.cos(r)),o=t[0],l=t[1],u=t[2],c=t[3],h=t[4],p=t[5],d=t[6],f=t[7],y=t[8],m=t[9],g=t[10],x=t[11],v=P*P*s+a,b=C*P*s+z*n,w=z*P*s-C*n,_=P*C*s-z*n,S=C*C*s+a,A=z*C*s+P*n,k=P*z*s+C*n,I=C*z*s-P*n,M=z*z*s+a,e[0]=o*v+h*b+y*w,e[1]=l*v+p*b+m*w,e[2]=u*v+d*b+g*w,e[3]=c*v+f*b+x*w,e[4]=o*_+h*S+y*A,e[5]=l*_+p*S+m*A,e[6]=u*_+d*S+g*A,e[7]=c*_+f*S+x*A,e[8]=o*k+h*I+y*M,e[9]=l*k+p*I+m*M,e[10]=u*k+d*I+g*M,e[11]=c*k+f*I+x*M,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function Wu(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[4],s=t[5],o=t[6],l=t[7],u=t[8],c=t[9],h=t[10],p=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*n+u*i,e[5]=s*n+c*i,e[6]=o*n+h*i,e[7]=l*n+p*i,e[8]=u*n-a*i,e[9]=c*n-s*i,e[10]=h*n-o*i,e[11]=p*n-l*i,e}function $u(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[0],s=t[1],o=t[2],l=t[3],u=t[8],c=t[9],h=t[10],p=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*n-u*i,e[1]=s*n-c*i,e[2]=o*n-h*i,e[3]=l*n-p*i,e[8]=a*i+u*n,e[9]=s*i+c*n,e[10]=o*i+h*n,e[11]=l*i+p*n,e}function Qu(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[0],s=t[1],o=t[2],l=t[3],u=t[4],c=t[5],h=t[6],p=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*n+u*i,e[1]=s*n+c*i,e[2]=o*n+h*i,e[3]=l*n+p*i,e[4]=u*n-a*i,e[5]=c*n-s*i,e[6]=h*n-o*i,e[7]=p*n-l*i,e}function ec(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function tc(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function rc(e,t,r){var i,n,a,s=r[0],o=r[1],l=r[2],u=Math.hypot(s,o,l);return u<Eu?null:(s*=u=1/u,o*=u,l*=u,i=Math.sin(t),a=1-(n=Math.cos(t)),e[0]=s*s*a+n,e[1]=o*s*a+l*i,e[2]=l*s*a-o*i,e[3]=0,e[4]=s*o*a-l*i,e[5]=o*o*a+n,e[6]=l*o*a+s*i,e[7]=0,e[8]=s*l*a+o*i,e[9]=o*l*a-s*i,e[10]=l*l*a+n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function ic(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function nc(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function ac(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function sc(e,t,r){var i=t[0],n=t[1],a=t[2],s=t[3],o=i+i,l=n+n,u=a+a,c=i*o,h=i*l,p=i*u,d=n*l,f=n*u,y=a*u,m=s*o,g=s*l,x=s*u;return e[0]=1-(d+y),e[1]=h+x,e[2]=p-g,e[3]=0,e[4]=h-x,e[5]=1-(c+y),e[6]=f+m,e[7]=0,e[8]=p+g,e[9]=f-m,e[10]=1-(c+d),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function oc(e,t){var r=new Fu(3),i=-t[0],n=-t[1],a=-t[2],s=t[3],o=t[4],l=t[5],u=t[6],c=t[7],h=i*i+n*n+a*a+s*s;return h>0?(r[0]=2*(o*s+c*i+l*a-u*n)/h,r[1]=2*(l*s+c*n+u*i-o*a)/h,r[2]=2*(u*s+c*a+o*n-l*i)/h):(r[0]=2*(o*s+c*i+l*a-u*n),r[1]=2*(l*s+c*n+u*i-o*a),r[2]=2*(u*s+c*a+o*n-l*i)),sc(e,t,r),e}function lc(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function uc(e,t){var r=t[0],i=t[1],n=t[2],a=t[4],s=t[5],o=t[6],l=t[8],u=t[9],c=t[10];return e[0]=Math.hypot(r,i,n),e[1]=Math.hypot(a,s,o),e[2]=Math.hypot(l,u,c),e}function cc(e,t){var r=new Fu(3);uc(r,t);var i=1/r[0],n=1/r[1],a=1/r[2],s=t[0]*i,o=t[1]*n,l=t[2]*a,u=t[4]*i,c=t[5]*n,h=t[6]*a,p=t[8]*i,d=t[9]*n,f=t[10]*a,y=s+c+f,m=0;return y>0?(m=2*Math.sqrt(y+1),e[3]=.25*m,e[0]=(h-d)/m,e[1]=(p-l)/m,e[2]=(o-u)/m):s>c&&s>f?(m=2*Math.sqrt(1+s-c-f),e[3]=(h-d)/m,e[0]=.25*m,e[1]=(o+u)/m,e[2]=(p+l)/m):c>f?(m=2*Math.sqrt(1+c-s-f),e[3]=(p-l)/m,e[0]=(o+u)/m,e[1]=.25*m,e[2]=(h+d)/m):(m=2*Math.sqrt(1+f-s-c),e[3]=(o-u)/m,e[0]=(p+l)/m,e[1]=(h+d)/m,e[2]=.25*m),e}function hc(e,t,r,i){var n=t[0],a=t[1],s=t[2],o=t[3],l=n+n,u=a+a,c=s+s,h=n*l,p=n*u,d=n*c,f=a*u,y=a*c,m=s*c,g=o*l,x=o*u,v=o*c,b=i[0],w=i[1],_=i[2];return e[0]=(1-(f+m))*b,e[1]=(p+v)*b,e[2]=(d-x)*b,e[3]=0,e[4]=(p-v)*w,e[5]=(1-(h+m))*w,e[6]=(y+g)*w,e[7]=0,e[8]=(d+x)*_,e[9]=(y-g)*_,e[10]=(1-(h+f))*_,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function pc(e,t,r,i,n){var a=t[0],s=t[1],o=t[2],l=t[3],u=a+a,c=s+s,h=o+o,p=a*u,d=a*c,f=a*h,y=s*c,m=s*h,g=o*h,x=l*u,v=l*c,b=l*h,w=i[0],_=i[1],S=i[2],A=n[0],k=n[1],I=n[2],M=(1-(y+g))*w,P=(d+b)*w,C=(f-v)*w,z=(d-b)*_,B=(1-(p+g))*_,V=(m+x)*_,E=(f+v)*S,F=(m-x)*S,T=(1-(p+y))*S;return e[0]=M,e[1]=P,e[2]=C,e[3]=0,e[4]=z,e[5]=B,e[6]=V,e[7]=0,e[8]=E,e[9]=F,e[10]=T,e[11]=0,e[12]=r[0]+A-(M*A+z*k+E*I),e[13]=r[1]+k-(P*A+B*k+F*I),e[14]=r[2]+I-(C*A+V*k+T*I),e[15]=1,e}function dc(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],s=r+r,o=i+i,l=n+n,u=r*s,c=i*s,h=i*o,p=n*s,d=n*o,f=n*l,y=a*s,m=a*o,g=a*l;return e[0]=1-h-f,e[1]=c+g,e[2]=p-m,e[3]=0,e[4]=c-g,e[5]=1-u-f,e[6]=d+y,e[7]=0,e[8]=p+m,e[9]=d-y,e[10]=1-u-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function fc(e,t,r,i,n,a,s){var o=1/(r-t),l=1/(n-i),u=1/(a-s);return e[0]=2*a*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*l,e[6]=0,e[7]=0,e[8]=(r+t)*o,e[9]=(n+i)*l,e[10]=(s+a)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*a*2*u,e[15]=0,e}function yc(e,t,r,i,n){var a,s=1/Math.tan(t/2);return e[0]=s/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=n&&n!==1/0?(a=1/(i-n),e[10]=(n+i)*a,e[14]=2*n*i*a):(e[10]=-1,e[14]=-2*i),e}c(Lu,{add:()=>Ic,adjoint:()=>Ju,clone:()=>Ou,copy:()=>Ru,create:()=>Du,determinant:()=>Gu,equals:()=>Bc,exactEquals:()=>zc,frob:()=>kc,fromQuat:()=>dc,fromQuat2:()=>oc,fromRotation:()=>rc,fromRotationTranslation:()=>sc,fromRotationTranslationScale:()=>hc,fromRotationTranslationScaleOrigin:()=>pc,fromScaling:()=>tc,fromTranslation:()=>ec,fromValues:()=>qu,fromXRotation:()=>ic,fromYRotation:()=>nc,fromZRotation:()=>ac,frustum:()=>fc,getRotation:()=>cc,getScaling:()=>uc,getTranslation:()=>lc,identity:()=>ju,invert:()=>Zu,lookAt:()=>_c,mul:()=>Vc,multiply:()=>Ku,multiplyScalar:()=>Pc,multiplyScalarAndAdd:()=>Cc,ortho:()=>bc,orthoNO:()=>vc,orthoZO:()=>wc,perspective:()=>mc,perspectiveFromFieldOfView:()=>xc,perspectiveNO:()=>yc,perspectiveZO:()=>gc,rotate:()=>Hu,rotateX:()=>Wu,rotateY:()=>$u,rotateZ:()=>Qu,scale:()=>Yu,set:()=>Uu,str:()=>Ac,sub:()=>Ec,subtract:()=>Mc,targetTo:()=>Sc,translate:()=>Xu,transpose:()=>Nu}),p(),l(Du,"create"),l(Ou,"clone"),l(Ru,"copy"),l(qu,"fromValues"),l(Uu,"set"),l(ju,"identity"),l(Nu,"transpose"),l(Zu,"invert"),l(Ju,"adjoint"),l(Gu,"determinant"),l(Ku,"multiply"),l(Xu,"translate"),l(Yu,"scale"),l(Hu,"rotate"),l(Wu,"rotateX"),l($u,"rotateY"),l(Qu,"rotateZ"),l(ec,"fromTranslation"),l(tc,"fromScaling"),l(rc,"fromRotation"),l(ic,"fromXRotation"),l(nc,"fromYRotation"),l(ac,"fromZRotation"),l(sc,"fromRotationTranslation"),l(oc,"fromQuat2"),l(lc,"getTranslation"),l(uc,"getScaling"),l(cc,"getRotation"),l(hc,"fromRotationTranslationScale"),l(pc,"fromRotationTranslationScaleOrigin"),l(dc,"fromQuat"),l(fc,"frustum"),l(yc,"perspectiveNO");var mc=yc;function gc(e,t,r,i,n){var a,s=1/Math.tan(t/2);return e[0]=s/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=n&&n!==1/0?(a=1/(i-n),e[10]=n*a,e[14]=n*i*a):(e[10]=-1,e[14]=-i),e}function xc(e,t,r,i){var n=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),s=Math.tan(t.leftDegrees*Math.PI/180),o=Math.tan(t.rightDegrees*Math.PI/180),l=2/(s+o),u=2/(n+a);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-(s-o)*l*.5,e[9]=(n-a)*u*.5,e[10]=i/(r-i),e[11]=-1,e[12]=0,e[13]=0,e[14]=i*r/(r-i),e[15]=0,e}function vc(e,t,r,i,n,a,s){var o=1/(t-r),l=1/(i-n),u=1/(a-s);return e[0]=-2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+r)*o,e[13]=(n+i)*l,e[14]=(s+a)*u,e[15]=1,e}l(gc,"perspectiveZO"),l(xc,"perspectiveFromFieldOfView"),l(vc,"orthoNO");var bc=vc;function wc(e,t,r,i,n,a,s){var o=1/(t-r),l=1/(i-n),u=1/(a-s);return e[0]=-2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=u,e[11]=0,e[12]=(t+r)*o,e[13]=(n+i)*l,e[14]=a*u,e[15]=1,e}function _c(e,t,r,i){var n,a,s,o,l,u,c,h,p,d,f=t[0],y=t[1],m=t[2],g=i[0],x=i[1],v=i[2],b=r[0],w=r[1],_=r[2];return Math.abs(f-b)<Eu&&Math.abs(y-w)<Eu&&Math.abs(m-_)<Eu?ju(e):(c=f-b,h=y-w,p=m-_,n=x*(p*=d=1/Math.hypot(c,h,p))-v*(h*=d),a=v*(c*=d)-g*p,s=g*h-x*c,(d=Math.hypot(n,a,s))?(n*=d=1/d,a*=d,s*=d):(n=0,a=0,s=0),o=h*s-p*a,l=p*n-c*s,u=c*a-h*n,(d=Math.hypot(o,l,u))?(o*=d=1/d,l*=d,u*=d):(o=0,l=0,u=0),e[0]=n,e[1]=o,e[2]=c,e[3]=0,e[4]=a,e[5]=l,e[6]=h,e[7]=0,e[8]=s,e[9]=u,e[10]=p,e[11]=0,e[12]=-(n*f+a*y+s*m),e[13]=-(o*f+l*y+u*m),e[14]=-(c*f+h*y+p*m),e[15]=1,e)}function Sc(e,t,r,i){var n=t[0],a=t[1],s=t[2],o=i[0],l=i[1],u=i[2],c=n-r[0],h=a-r[1],p=s-r[2],d=c*c+h*h+p*p;d>0&&(c*=d=1/Math.sqrt(d),h*=d,p*=d);var f=l*p-u*h,y=u*c-o*p,m=o*h-l*c;return(d=f*f+y*y+m*m)>0&&(f*=d=1/Math.sqrt(d),y*=d,m*=d),e[0]=f,e[1]=y,e[2]=m,e[3]=0,e[4]=h*m-p*y,e[5]=p*f-c*m,e[6]=c*y-h*f,e[7]=0,e[8]=c,e[9]=h,e[10]=p,e[11]=0,e[12]=n,e[13]=a,e[14]=s,e[15]=1,e}function Ac(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function kc(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function Ic(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function Mc(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function Pc(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function Cc(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e[4]=t[4]+r[4]*i,e[5]=t[5]+r[5]*i,e[6]=t[6]+r[6]*i,e[7]=t[7]+r[7]*i,e[8]=t[8]+r[8]*i,e[9]=t[9]+r[9]*i,e[10]=t[10]+r[10]*i,e[11]=t[11]+r[11]*i,e[12]=t[12]+r[12]*i,e[13]=t[13]+r[13]*i,e[14]=t[14]+r[14]*i,e[15]=t[15]+r[15]*i,e}function zc(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function Bc(e,t){var r=e[0],i=e[1],n=e[2],a=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8],h=e[9],p=e[10],d=e[11],f=e[12],y=e[13],m=e[14],g=e[15],x=t[0],v=t[1],b=t[2],w=t[3],_=t[4],S=t[5],A=t[6],k=t[7],I=t[8],M=t[9],P=t[10],C=t[11],z=t[12],B=t[13],V=t[14],E=t[15];return Math.abs(r-x)<=Eu*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(i-v)<=Eu*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(n-b)<=Eu*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(a-w)<=Eu*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(s-_)<=Eu*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(o-S)<=Eu*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(l-A)<=Eu*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(u-k)<=Eu*Math.max(1,Math.abs(u),Math.abs(k))&&Math.abs(c-I)<=Eu*Math.max(1,Math.abs(c),Math.abs(I))&&Math.abs(h-M)<=Eu*Math.max(1,Math.abs(h),Math.abs(M))&&Math.abs(p-P)<=Eu*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(d-C)<=Eu*Math.max(1,Math.abs(d),Math.abs(C))&&Math.abs(f-z)<=Eu*Math.max(1,Math.abs(f),Math.abs(z))&&Math.abs(y-B)<=Eu*Math.max(1,Math.abs(y),Math.abs(B))&&Math.abs(m-V)<=Eu*Math.max(1,Math.abs(m),Math.abs(V))&&Math.abs(g-E)<=Eu*Math.max(1,Math.abs(g),Math.abs(E))}l(wc,"orthoZO"),l(_c,"lookAt"),l(Sc,"targetTo"),l(Ac,"str"),l(kc,"frob"),l(Ic,"add"),l(Mc,"subtract"),l(Pc,"multiplyScalar"),l(Cc,"multiplyScalarAndAdd"),l(zc,"exactEquals"),l(Bc,"equals");var Vc=Ku,Ec=Mc,Fc={};function Tc(){var e=new Fu(4);return Fu!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Lc(e){var t=new Fu(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function Dc(e,t,r,i){var n=new Fu(4);return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n}function Oc(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function Rc(e,t,r,i,n){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e}function qc(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function Uc(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}function jc(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}function Nc(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}function Zc(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}function Jc(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}function Gc(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e}function Kc(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e}function Xc(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}function Yc(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function Hc(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e}function Wc(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2],a=t[3]-e[3];return Math.hypot(r,i,n,a)}function $c(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2],a=t[3]-e[3];return r*r+i*i+n*n+a*a}function Qc(e){var t=e[0],r=e[1],i=e[2],n=e[3];return Math.hypot(t,r,i,n)}function eh(e){var t=e[0],r=e[1],i=e[2],n=e[3];return t*t+r*r+i*i+n*n}function th(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}function rh(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}function ih(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],s=r*r+i*i+n*n+a*a;return s>0&&(s=1/Math.sqrt(s)),e[0]=r*s,e[1]=i*s,e[2]=n*s,e[3]=a*s,e}function nh(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function ah(e,t,r,i){var n=r[0]*i[1]-r[1]*i[0],a=r[0]*i[2]-r[2]*i[0],s=r[0]*i[3]-r[3]*i[0],o=r[1]*i[2]-r[2]*i[1],l=r[1]*i[3]-r[3]*i[1],u=r[2]*i[3]-r[3]*i[2],c=t[0],h=t[1],p=t[2],d=t[3];return e[0]=h*u-p*l+d*o,e[1]=-c*u+p*s-d*a,e[2]=c*l-h*s+d*n,e[3]=-c*o+h*a-p*n,e}function sh(e,t,r,i){var n=t[0],a=t[1],s=t[2],o=t[3];return e[0]=n+i*(r[0]-n),e[1]=a+i*(r[1]-a),e[2]=s+i*(r[2]-s),e[3]=o+i*(r[3]-o),e}function oh(e,t){var r,i,n,a,s,o;t=t||1;do{s=(r=2*Tu()-1)*r+(i=2*Tu()-1)*i}while(s>=1);do{o=(n=2*Tu()-1)*n+(a=2*Tu()-1)*a}while(o>=1);var l=Math.sqrt((1-s)/o);return e[0]=t*r,e[1]=t*i,e[2]=t*n*l,e[3]=t*a*l,e}function lh(e,t,r){var i=t[0],n=t[1],a=t[2],s=t[3];return e[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*s,e[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*s,e[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*s,e[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*s,e}function uh(e,t,r){var i=t[0],n=t[1],a=t[2],s=r[0],o=r[1],l=r[2],u=r[3],c=u*i+o*a-l*n,h=u*n+l*i-s*a,p=u*a+s*n-o*i,d=-s*i-o*n-l*a;return e[0]=c*u+d*-s+h*-l-p*-o,e[1]=h*u+d*-o+p*-s-c*-l,e[2]=p*u+d*-l+c*-o-h*-s,e[3]=t[3],e}function ch(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}function hh(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function ph(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function dh(e,t){var r=e[0],i=e[1],n=e[2],a=e[3],s=t[0],o=t[1],l=t[2],u=t[3];return Math.abs(r-s)<=Eu*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-o)<=Eu*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(n-l)<=Eu*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(a-u)<=Eu*Math.max(1,Math.abs(a),Math.abs(u))}c(Fc,{add:()=>qc,ceil:()=>Zc,clone:()=>Lc,copy:()=>Oc,create:()=>Tc,cross:()=>ah,dist:()=>gh,distance:()=>Wc,div:()=>mh,divide:()=>Nc,dot:()=>nh,equals:()=>dh,exactEquals:()=>ph,floor:()=>Jc,forEach:()=>wh,fromValues:()=>Dc,inverse:()=>rh,len:()=>vh,length:()=>Qc,lerp:()=>sh,max:()=>Kc,min:()=>Gc,mul:()=>yh,multiply:()=>jc,negate:()=>th,normalize:()=>ih,random:()=>oh,round:()=>Xc,scale:()=>Yc,scaleAndAdd:()=>Hc,set:()=>Rc,sqrDist:()=>xh,sqrLen:()=>bh,squaredDistance:()=>$c,squaredLength:()=>eh,str:()=>hh,sub:()=>fh,subtract:()=>Uc,transformMat4:()=>lh,transformQuat:()=>uh,zero:()=>ch}),p(),l(Tc,"create"),l(Lc,"clone"),l(Dc,"fromValues"),l(Oc,"copy"),l(Rc,"set"),l(qc,"add"),l(Uc,"subtract"),l(jc,"multiply"),l(Nc,"divide"),l(Zc,"ceil"),l(Jc,"floor"),l(Gc,"min"),l(Kc,"max"),l(Xc,"round"),l(Yc,"scale"),l(Hc,"scaleAndAdd"),l(Wc,"distance"),l($c,"squaredDistance"),l(Qc,"length"),l(eh,"squaredLength"),l(th,"negate"),l(rh,"inverse"),l(ih,"normalize"),l(nh,"dot"),l(ah,"cross"),l(sh,"lerp"),l(oh,"random"),l(lh,"transformMat4"),l(uh,"transformQuat"),l(ch,"zero"),l(hh,"str"),l(ph,"exactEquals"),l(dh,"equals");var fh=Uc,yh=jc,mh=Nc,gh=Wc,xh=$c,vh=Qc,bh=eh,wh=function(){var e=Tc();return function(t,r,i,n,a,s){var o,l;for(r||(r=4),i||(i=0),l=n?Math.min(n*r+i,t.length):t.length,o=i;o<l;o+=r)e[0]=t[o],e[1]=t[o+1],e[2]=t[o+2],e[3]=t[o+3],a(e,e,s),t[o]=e[0],t[o+1]=e[1],t[o+2]=e[2],t[o+3]=e[3];return t}}(),_h=h(d(),1),Sh=class extends ws{constructor(e){super(e,Vu)}createBucket(e){return new lu(e)}queryRadius(e){let t=e;return Au("circle-radius",this,t)+Au("circle-stroke-width",this,t)+ku(this.paint.get("circle-translate"))}queryIntersectsFeature(e,t,r,i,n,a,s,o){let l=Iu(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,s),u=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r),c="map"===this.paint.get("circle-pitch-alignment"),h=c?l:Ih(l,o),p=c?u*s:u;for(let e of i)for(let t of e){let e=c?t:kh(t,o),r=p,i=Fc.transformMat4([],[t.x,t.y,0,1],o);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?r*=i[3]/a.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(r*=a.cameraToCenterDistance/i[3]),hu(h,e,r))return!0}return!1}};l(Sh,"CircleStyleLayer");var Ah=Sh;function kh(e,t){let r=Fc.transformMat4([],[e.x,e.y,0,1],t);return new _h.default(r[0]/r[3],r[1]/r[3])}function Ih(e,t){return e.map((e=>kh(e,t)))}l(kh,"projectPoint"),l(Ih,"projectQueryGeometry"),p(),p();var Mh=class extends lu{};l(Mh,"HeatmapBucket");var Ph=Mh;ra("HeatmapBucket",Ph,{omit:["layers"]}),p();var Ch,zh=l((()=>Ch=Ch||new xs({"heatmap-radius":new cs(H.paint_heatmap["heatmap-radius"]),"heatmap-weight":new cs(H.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new ls(H.paint_heatmap["heatmap-intensity"]),"heatmap-color":new ms(H.paint_heatmap["heatmap-color"]),"heatmap-opacity":new ls(H.paint_heatmap["heatmap-opacity"])})),"getPaint"),Bh={get paint(){return zh()}};function Vh(e,{width:t,height:r},i,n){if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==t*r*i)throw new RangeError("mismatched image size. expected: ".concat(n.length," but got: ").concat(t*r*i))}else n=new Uint8Array(t*r*i);return e.width=t,e.height=r,e.data=n,e}function Eh(e,{width:t,height:r},i){if(t===e.width&&r===e.height)return;let n=Vh({},{width:t,height:r},i);Fh(e,n,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,t),height:Math.min(e.height,r)},i),e.width=t,e.height=r,e.data=n.data}function Fh(e,t,r,i,n,a){if(0===n.width||0===n.height)return t;if(n.width>e.width||n.height>e.height||r.x>e.width-n.width||r.y>e.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>t.width||n.height>t.height||i.x>t.width-n.width||i.y>t.height-n.height)throw new RangeError("out of range destination coordinates for image copy");let s=e.data,o=t.data;if(s===o)throw new Error("srcData equals dstData, so image is already copied");for(let l=0;l<n.height;l++){let u=((r.y+l)*e.width+r.x)*a,c=((i.y+l)*t.width+i.x)*a;for(let e=0;e<n.width*a;e++)o[c+e]=s[u+e]}return t}p(),p(),l(Vh,"createImage"),l(Eh,"resizeImage"),l(Fh,"copyImage");var Th=class e{constructor(e,t){Vh(this,e,1,t)}resize(e){Eh(this,e,1)}clone(){return new e({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,i,n){Fh(e,t,r,i,n,1)}};l(Th,"AlphaImage");var Lh=Th,Dh=class e{constructor(e,t){Vh(this,e,4,t)}resize(e){Eh(this,e,4)}replace(e,t){t?this.data.set(e):e instanceof Uint8ClampedArray?this.data=new Uint8Array(e.buffer):this.data=e}clone(){return new e({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,i,n){Fh(e,t,r,i,n,4)}};l(Dh,"RGBAImage");var Oh=Dh;function Rh(e){let t={},r=e.resolution||256,i=e.clips?e.clips.length:1,n=e.image||new Oh({width:r,height:i});if(!F(r))throw new Error("width is not a power of 2 - ".concat(r));let a=l(((r,i,a)=>{t[e.evaluationKey]=a;let s=e.expression.evaluate(t);n.data[r+i+0]=Math.floor(255*s.r/s.a),n.data[r+i+1]=Math.floor(255*s.g/s.a),n.data[r+i+2]=Math.floor(255*s.b/s.a),n.data[r+i+3]=Math.floor(255*s.a)}),"renderPixel");if(e.clips)for(let t=0,n=0;t<i;++t,n+=4*r)for(let i=0,s=0;i<r;i++,s+=4){let o=i/(r-1),{start:l,end:u}=e.clips[t];a(n,s,l*(1-o)+u*o)}else for(let e=0,t=0;e<r;e++,t+=4){a(0,t,e/(r-1))}return n}ra("AlphaImage",Lh),ra("RGBAImage",Oh),l(Rh,"renderColorRamp");var qh=class extends ws{createBucket(e){return new Ph(e)}constructor(e){super(e,Bh),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"heatmap-color"===e&&this._updateColorRamp()}_updateColorRamp(){let e=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=Rh({expression:e,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}};l(qh,"HeatmapStyleLayer");var Uh=qh;p(),p();var jh,Nh=l((()=>jh=jh||new xs({"hillshade-illumination-direction":new ls(H.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new ls(H.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new ls(H.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new ls(H.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new ls(H.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new ls(H.paint_hillshade["hillshade-accent-color"])})),"getPaint"),Zh={get paint(){return Nh()}},Jh=class extends ws{constructor(e){super(e,Zh)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}};l(Jh,"HillshadeStyleLayer");var Gh=Jh;p(),p(),p();var Kh=Ms([{name:"a_pos",components:2,type:"Int16"}],4),{members:Xh,size:Yh,alignment:Hh}=Kh,Wh=h(x(),1);function $h(e,t,r,i,n){Qh(e,t,r||0,i||e.length-1,n||tp)}function Qh(e,t,r,i,n){for(;i>r;){if(i-r>600){var a=i-r+1,s=t-r+1,o=Math.log(a),l=.5*Math.exp(2*o/3),u=.5*Math.sqrt(o*l*(a-l)/a)*(s-a/2<0?-1:1);Qh(e,t,Math.max(r,Math.floor(t-s*l/a+u)),Math.min(i,Math.floor(t+(a-s)*l/a+u)),n)}var c=e[t],h=r,p=i;for(ep(e,r,t),n(e[i],c)>0&&ep(e,r,i);h<p;){for(ep(e,h,p),h++,p--;n(e[h],c)<0;)h++;for(;n(e[p],c)>0;)p--}0===n(e[r],c)?ep(e,r,p):ep(e,++p,i),p<=t&&(r=p+1),t<=p&&(i=p-1)}}function ep(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function tp(e,t){return e<t?-1:e>t?1:0}function rp(e,t){let r=e.length;if(r<=1)return[e];let i,n,a=[];for(let t=0;t<r;t++){let r=j(e[t]);0!==r&&(e[t].area=Math.abs(r),void 0===n&&(n=r<0),n===r<0?(i&&a.push(i),i=[e[t]]):i.push(e[t]))}if(i&&a.push(i),t>1)for(let e=0;e<a.length;e++)a[e].length<=t||($h(a[e],t,1,a[e].length-1,ip),a[e]=a[e].slice(0,t));return a}function ip(e,t){return t.area-e.area}function np(e,t,r){let i=r.patternDependencies,n=!1;for(let r of t){let t=r.paint.get("".concat(e,"-pattern"));t.isConstant()||(n=!0);let a=t.constantOr(null);a&&(n=!0,i[a.to]=!0,i[a.from]=!0)}return n}function ap(e,t,r,i,n){let a=n.patternDependencies;for(let s of t){let t=s.paint.get("".concat(e,"-pattern")).value;if("constant"!==t.kind){let e=t.evaluate({zoom:i-1},r,{},n.availableImages),o=t.evaluate({zoom:i},r,{},n.availableImages),l=t.evaluate({zoom:i+1},r,{},n.availableImages);e=e&&e.name?e.name:e,o=o&&o.name?o.name:o,l=l&&l.name?l.name:l,a[e]=!0,a[o]=!0,a[l]=!0,r.patterns[s.id]={min:e,mid:o,max:l}}}return r}p(),p(),l($h,"quickselect"),l(Qh,"quickselectStep"),l(ep,"swap"),l(tp,"defaultCompare"),l(rp,"classifyRings"),l(ip,"compareAreas"),p(),l(np,"hasPattern"),l(ap,"addPatternDependencies");var sp=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Ko,this.indexArray=new dl,this.indexArray2=new yl,this.programConfigurations=new $l(e.layers,e.zoom),this.segments=new wl,this.segments2=new wl,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.hasPattern=np("fill",this.layers,t);let i=this.layers[0].layout.get("fill-sort-key"),n=!i.isConstant(),a=[];for(let{feature:s,id:o,index:l,sourceLayerIndex:u}of e){let e=this.layers[0]._featureFilter.needGeometry,c=au(s,e);if(!this.layers[0]._featureFilter.filter(new Za(this.zoom),c,r))continue;let h=n?i.evaluate(c,{},r,t.availableImages):void 0,p={id:o,properties:s.properties,type:s.type,sourceLayerIndex:u,index:l,geometry:e?c.geometry:nu(s),patterns:{},sortKey:h};a.push(p)}n&&a.sort(((e,t)=>e.sortKey-t.sortKey));for(let i of a){let{geometry:n,index:a,sourceLayerIndex:s}=i;if(this.hasPattern){let e=ap("fill",this.layers,i,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(i,n,a,r,{});let o=e[a].feature;t.featureIndex.insert(o,n,a,s,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}addFeatures(e,t,r){for(let e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Xh),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,t,r,i,n){for(let e of rp(t,500)){let t=0;for(let r of e)t+=r.length;let r=this.segments.prepareSegment(t,this.layoutVertexArray,this.indexArray),i=r.vertexLength,n=[],a=[];for(let t of e){if(0===t.length)continue;t!==e[0]&&a.push(n.length/2);let r=this.segments2.prepareSegment(t.length,this.layoutVertexArray,this.indexArray2),i=r.vertexLength;this.layoutVertexArray.emplaceBack(t[0].x,t[0].y),this.indexArray2.emplaceBack(i+t.length-1,i),n.push(t[0].x),n.push(t[0].y);for(let e=1;e<t.length;e++)this.layoutVertexArray.emplaceBack(t[e].x,t[e].y),this.indexArray2.emplaceBack(i+e-1,i+e),n.push(t[e].x),n.push(t[e].y);r.vertexLength+=t.length,r.primitiveLength+=t.length}let s=(0,Wh.default)(n,a);for(let e=0;e<s.length;e+=3)this.indexArray.emplaceBack(i+s[e],i+s[e+1],i+s[e+2]);r.vertexLength+=t,r.primitiveLength+=s.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,n,i)}};l(sp,"FillBucket");var op=sp;ra("FillBucket",op,{omit:["layers","patternFeatures"]}),p();var lp,up,cp=l((()=>lp=lp||new xs({"fill-sort-key":new cs(H.layout_fill["fill-sort-key"])})),"getLayout"),hp=l((()=>up=up||new xs({"fill-antialias":new ls(H.paint_fill["fill-antialias"]),"fill-opacity":new cs(H.paint_fill["fill-opacity"]),"fill-color":new cs(H.paint_fill["fill-color"]),"fill-outline-color":new cs(H.paint_fill["fill-outline-color"]),"fill-translate":new ls(H.paint_fill["fill-translate"]),"fill-translate-anchor":new ls(H.paint_fill["fill-translate-anchor"]),"fill-pattern":new ps(H.paint_fill["fill-pattern"])})),"getPaint"),pp={get paint(){return hp()},get layout(){return cp()}},dp=class extends ws{constructor(e){super(e,pp)}recalculate(e,t){super.recalculate(e,t);let r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new op(e)}queryRadius(){return ku(this.paint.get("fill-translate"))}queryIntersectsFeature(e,t,r,i,n,a,s){return pu(Iu(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,s),i)}isTileClipped(){return!0}};l(dp,"FillStyleLayer");var fp=dp;p(),p(),p();var yp=Ms([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),mp=Ms([{name:"a_centroid",components:2,type:"Int16"}],4),{members:gp,size:xp,alignment:vp}=yp,bp=h(x(),1),wp=h(_(),1).default.VectorTileFeature.types,_p=Math.pow(2,13);function Sp(e,t,r,i,n,a,s,o){e.emplaceBack(t,r,2*Math.floor(i*_p)+s,n*_p*2,a*_p*2,Math.round(o))}l(Sp,"addVertex");var Ap=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Yo,this.centroidVertexArray=new No,this.indexArray=new dl,this.programConfigurations=new $l(e.layers,e.zoom),this.segments=new wl,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.features=[],this.hasPattern=np("fill-extrusion",this.layers,t);for(let{feature:i,id:n,index:a,sourceLayerIndex:s}of e){let e=this.layers[0]._featureFilter.needGeometry,o=au(i,e);if(!this.layers[0]._featureFilter.filter(new Za(this.zoom),o,r))continue;let l={id:n,sourceLayerIndex:s,index:a,geometry:e?o.geometry:nu(i),properties:i.properties,type:i.type,patterns:{}};this.hasPattern?this.features.push(ap("fill-extrusion",this.layers,l,this.zoom,t)):this.addFeature(l,l.geometry,a,r,{}),t.featureIndex.insert(i,l.geometry,a,s,this.index,!0)}}addFeatures(e,t,r){for(let e of this.features){let{geometry:i}=e;this.addFeature(e,i,e.index,t,r)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,gp),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,mp.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,t,r,i,n){let a={x:0,y:0,vertexCount:0};for(let r of rp(t,500)){let t=0;for(let e of r)t+=e.length;let i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let e of r){if(0===e.length||Mp(e))continue;let t=0;for(let r=0;r<e.length;r++){let n=e[r];if(r>=1){let s=e[r-1];if(!Ip(n,s)){i.vertexLength+4>wl.MAX_VERTEX_ARRAY_LENGTH&&(i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let e=n.sub(s)._perp()._unit(),r=s.dist(n);t+r>32768&&(t=0),Sp(this.layoutVertexArray,n.x,n.y,e.x,e.y,0,0,t),Sp(this.layoutVertexArray,n.x,n.y,e.x,e.y,0,1,t),a.x+=2*n.x,a.y+=2*n.y,a.vertexCount+=2,t+=r,Sp(this.layoutVertexArray,s.x,s.y,e.x,e.y,0,0,t),Sp(this.layoutVertexArray,s.x,s.y,e.x,e.y,0,1,t),a.x+=2*s.x,a.y+=2*s.y,a.vertexCount+=2;let o=i.vertexLength;this.indexArray.emplaceBack(o,o+2,o+1),this.indexArray.emplaceBack(o+1,o+2,o+3),i.vertexLength+=4,i.primitiveLength+=2}}}}if(i.vertexLength+t>wl.MAX_VERTEX_ARRAY_LENGTH&&(i=this.segments.prepareSegment(t,this.layoutVertexArray,this.indexArray)),"Polygon"!==wp[e.type])continue;let n=[],s=[],o=i.vertexLength;for(let e of r)if(0!==e.length){e!==r[0]&&s.push(n.length/2);for(let t=0;t<e.length;t++){let r=e[t];Sp(this.layoutVertexArray,r.x,r.y,0,0,1,1,0),a.x+=r.x,a.y+=r.y,a.vertexCount+=1,n.push(r.x),n.push(r.y)}}let l=(0,bp.default)(n,s);for(let e=0;e<l.length;e+=3)this.indexArray.emplaceBack(o+l[e],o+l[e+2],o+l[e+1]);i.primitiveLength+=l.length/3,i.vertexLength+=t}for(let e=0;e<a.vertexCount;e++)this.centroidVertexArray.emplaceBack(Math.floor(a.x/a.vertexCount),Math.floor(a.y/a.vertexCount));this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,n,i)}};l(Ap,"FillExtrusionBucket");var kp=Ap;function Ip(e,t){return e.x===t.x&&(e.x<0||e.x>8192)||e.y===t.y&&(e.y<0||e.y>8192)}function Mp(e){return e.every((e=>e.x<0))||e.every((e=>e.x>8192))||e.every((e=>e.y<0))||e.every((e=>e.y>8192))}ra("FillExtrusionBucket",kp,{omit:["layers","features"]}),l(Ip,"isBoundaryEdge"),l(Mp,"isEntirelyOutside"),p();var Pp,Cp=l((()=>Pp=Pp||new xs({"fill-extrusion-opacity":new ls(H["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new cs(H["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new ls(H["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new ls(H["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ps(H["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new cs(H["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new cs(H["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new ls(H["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})),"getPaint"),zp={get paint(){return Cp()}},Bp=h(d(),1),Vp=class extends ws{constructor(e){super(e,zp)}createBucket(e){return new kp(e)}queryRadius(){return ku(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,t,r,i,n,a,s,o){let l=Iu(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,s),u=this.paint.get("fill-extrusion-height").evaluate(t,r),c=this.paint.get("fill-extrusion-base").evaluate(t,r),h=Op(l,o,a,0),p=Dp(i,c,u,o);return Lp(p[0],p[1],h)}};l(Vp,"FillExtrusionStyleLayer");var Ep=Vp;function Fp(e,t){return e.x*t.x+e.y*t.y}function Tp(e,t){if(1===e.length){let r,i=0,n=t[i++];for(;!r||n.equals(r);)if(r=t[i++],!r)return 1/0;for(;i<t.length;i++){let a=t[i],s=e[0],o=r.sub(n),l=a.sub(n),u=s.sub(n),c=Fp(o,o),h=Fp(o,l),p=Fp(l,l),d=Fp(u,o),f=Fp(u,l),y=c*p-h*h,m=(p*d-h*f)/y,g=(c*f-h*d)/y,x=1-m-g,v=n.z*x+r.z*m+a.z*g;if(isFinite(v))return v}return 1/0}{let e=1/0;for(let r of t)e=Math.min(e,r.z);return e}}function Lp(e,t,r){let i=1/0;pu(r,t)&&(i=Tp(r,t[0]));for(let n=0;n<t.length;n++){let a=t[n],s=e[n];for(let e=0;e<a.length-1;e++){let t=a[e],n=a[e+1],o=s[e],l=[t,n,s[e+1],o,t];cu(r,l)&&(i=Math.min(i,Tp(r,l)))}}return i!==1/0&&i}function Dp(e,t,r,i){let n=[],a=[],s=i[8]*t,o=i[9]*t,l=i[10]*t,u=i[11]*t,c=i[8]*r,h=i[9]*r,p=i[10]*r,d=i[11]*r;for(let t of e){let e=[],r=[];for(let n of t){let t=n.x,a=n.y,f=i[0]*t+i[4]*a+i[12],y=i[1]*t+i[5]*a+i[13],m=i[2]*t+i[6]*a+i[14],g=i[3]*t+i[7]*a+i[15],x=f+s,v=y+o,b=m+l,w=g+u,_=f+c,S=y+h,A=m+p,k=g+d,I=new Bp.default(x/w,v/w);I.z=b/w,e.push(I);let M=new Bp.default(_/k,S/k);M.z=A/k,r.push(M)}n.push(e),a.push(r)}return[n,a]}function Op(e,t,r,i){let n=[];for(let r of e){let e=[r.x,r.y,i,1];Fc.transformMat4(e,e,t),n.push(new Bp.default(e[0]/e[3],e[1]/e[3]))}return n}l(Fp,"dot"),l(Tp,"getIntersectionDistance"),l(Lp,"checkIntersection"),l(Dp,"projectExtrusion"),l(Op,"projectQueryGeometry"),p(),p(),p();var Rp=Ms([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:qp,size:Up,alignment:jp}=Rp;p();var Np=Ms([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Zp,size:Jp,alignment:Gp}=Np,Kp=h(_(),1).default.VectorTileFeature.types,Xp=Math.cos(Math.PI/180*37.5),Yp=Math.pow(2,14)/.5,Hp=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((e=>{this.gradients[e.id]={}})),this.layoutVertexArray=new Wo,this.layoutVertexArray2=new Qo,this.indexArray=new dl,this.programConfigurations=new $l(e.layers,e.zoom),this.segments=new wl,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.hasPattern=np("line",this.layers,t);let i=this.layers[0].layout.get("line-sort-key"),n=!i.isConstant(),a=[];for(let{feature:t,id:s,index:o,sourceLayerIndex:l}of e){let e=this.layers[0]._featureFilter.needGeometry,u=au(t,e);if(!this.layers[0]._featureFilter.filter(new Za(this.zoom),u,r))continue;let c=n?i.evaluate(u,{},r):void 0,h={id:s,properties:t.properties,type:t.type,sourceLayerIndex:l,index:o,geometry:e?u.geometry:nu(t),patterns:{},sortKey:c};a.push(h)}n&&a.sort(((e,t)=>e.sortKey-t.sortKey));for(let i of a){let{geometry:n,index:a,sourceLayerIndex:s}=i;if(this.hasPattern){let e=ap("line",this.layers,i,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(i,n,a,r,{});let o=e[a].feature;t.featureIndex.insert(o,n,a,s,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}addFeatures(e,t,r){for(let e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,Zp)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,qp),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end")){return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}}addFeature(e,t,r,i,n){let a=this.layers[0].layout,s=a.get("line-join").evaluate(e,{}),o=a.get("line-cap"),l=a.get("line-miter-limit"),u=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(let r of t)this.addLine(r,e,s,o,l,u);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,n,i)}addLine(e,t,r,i,n,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;t<e.length-1;t++)this.totalDistance+=e[t].dist(e[t+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let s="Polygon"===Kp[t.type],o=e.length;for(;o>=2&&e[o-1].equals(e[o-2]);)o--;let l=0;for(;l<o-1&&e[l].equals(e[l+1]);)l++;if(o<(s?3:2))return;"bevel"===r&&(n=1.05);let u,c,h,p,d,f=this.overscaling<=16?122880/(512*this.overscaling):0,y=this.segments.prepareSegment(10*o,this.layoutVertexArray,this.indexArray);this.e1=this.e2=-1,s&&(u=e[o-2],d=e[l].sub(u)._unit()._perp());for(let t=l;t<o;t++){if(h=t===o-1?s?e[l+1]:void 0:e[t+1],h&&e[t].equals(h))continue;d&&(p=d),u&&(c=u),u=e[t],d=h?h.sub(u)._unit()._perp():p,p=p||d;let m=p.add(d);(0!==m.x||0!==m.y)&&m._unit();let g=p.x*d.x+p.y*d.y,x=m.x*d.x+m.y*d.y,v=0!==x?1/x:1/0,b=2*Math.sqrt(2-2*x),w=x<Xp&&c&&h,_=p.x*d.y-p.y*d.x>0;if(w&&t>l){let e=u.dist(c);if(e>2*f){let t=u.sub(u.sub(c)._mult(f/e)._round());this.updateDistance(c,t),this.addCurrentVertex(t,p,0,0,y),c=t}}let S=c&&h,A=S?r:s?"butt":i;if(S&&"round"===A&&(v<a?A="miter":v<=2&&(A="fakeround")),"miter"===A&&v>n&&(A="bevel"),"bevel"===A&&(v>2&&(A="flipbevel"),v<n&&(A="miter")),c&&this.updateDistance(c,u),"miter"===A)m._mult(v),this.addCurrentVertex(u,m,0,0,y);else if("flipbevel"===A){if(v>100)m=d.mult(-1);else{let e=v*p.add(d).mag()/p.sub(d).mag();m._perp()._mult(e*(_?-1:1))}this.addCurrentVertex(u,m,0,0,y),this.addCurrentVertex(u,m.mult(-1),0,0,y)}else if("bevel"===A||"fakeround"===A){let e=-Math.sqrt(v*v-1),t=_?e:0,r=_?0:e;if(c&&this.addCurrentVertex(u,p,t,r,y),"fakeround"===A){let e=Math.round(180*b/Math.PI/20);for(let t=1;t<e;t++){let r=t/e;if(.5!==r){let e=r-.5;r+=r*e*(r-1)*((1.0904+g*(g*(3.55645-1.43519*g)-3.2452))*e*e+(.848013+g*(.215638*g-1.06021)))}let i=d.sub(p)._mult(r)._add(p)._unit()._mult(_?-1:1);this.addHalfVertex(u,i.x,i.y,!1,_,0,y)}}h&&this.addCurrentVertex(u,d,-t,-r,y)}else if("butt"===A)this.addCurrentVertex(u,m,0,0,y);else if("square"===A){let e=c?1:-1;this.addCurrentVertex(u,m,e,e,y)}else"round"===A&&(c&&(this.addCurrentVertex(u,p,0,0,y),this.addCurrentVertex(u,p,1,1,y,!0)),h&&(this.addCurrentVertex(u,d,-1,-1,y,!0),this.addCurrentVertex(u,d,0,0,y)));if(w&&t<o-1){let e=u.dist(h);if(e>2*f){let t=u.add(h.sub(u)._mult(f/e)._round());this.updateDistance(u,t),this.addCurrentVertex(t,d,0,0,y),u=t}}}}addCurrentVertex(e,t,r,i,n,a=!1){let s=t.x+t.y*r,o=t.y-t.x*r,l=-t.x+t.y*i,u=-t.y-t.x*i;this.addHalfVertex(e,s,o,a,!1,r,n),this.addHalfVertex(e,l,u,a,!0,-i,n),this.distance>Yp/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,t,r,i,n,a))}addHalfVertex({x:e,y:t},r,i,n,a,s,o){let l=.5*(this.lineClips?this.scaledDistance*(Yp-1):this.scaledDistance);if(this.layoutVertexArray.emplaceBack((e<<1)+(n?1:0),(t<<1)+(a?1:0),Math.round(63*r)+128,Math.round(63*i)+128,1+(0===s?0:s<0?-1:1)|(63&l)<<2,l>>6),this.lineClips){let e=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(e,this.lineClipsArray.length)}let u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),o.primitiveLength++),a?this.e2=u:this.e1=u}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}};l(Hp,"LineBucket");var Wp=Hp;ra("LineBucket",Wp,{omit:["layers","patternFeatures"]}),p();var $p,Qp,ed=l((()=>$p=$p||new xs({"line-cap":new ls(H.layout_line["line-cap"]),"line-join":new cs(H.layout_line["line-join"]),"line-miter-limit":new ls(H.layout_line["line-miter-limit"]),"line-round-limit":new ls(H.layout_line["line-round-limit"]),"line-sort-key":new cs(H.layout_line["line-sort-key"])})),"getLayout"),td=l((()=>Qp=Qp||new xs({"line-opacity":new cs(H.paint_line["line-opacity"]),"line-color":new cs(H.paint_line["line-color"]),"line-translate":new ls(H.paint_line["line-translate"]),"line-translate-anchor":new ls(H.paint_line["line-translate-anchor"]),"line-width":new cs(H.paint_line["line-width"]),"line-gap-width":new cs(H.paint_line["line-gap-width"]),"line-offset":new cs(H.paint_line["line-offset"]),"line-blur":new cs(H.paint_line["line-blur"]),"line-dasharray":new fs(H.paint_line["line-dasharray"]),"line-pattern":new ps(H.paint_line["line-pattern"]),"line-gradient":new ms(H.paint_line["line-gradient"])})),"getPaint"),rd={get paint(){return td()},get layout(){return ed()}},id=class extends cs{possiblyEvaluate(e,t){return t=new Za(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,zoomHistory:t.zoomHistory,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,r,i){return t=E({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,r,i)}};l(id,"LineFloorwidthProperty");var nd,ad=id,sd=class extends ws{constructor(e){super(e,rd),this.gradientVersion=0,nd||((nd=new ad(rd.paint.properties["line-width"].specification)).useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if("line-gradient"===e){let e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=e._styleExpression.expression instanceof pr,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=nd.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new Wp(e)}queryRadius(e){let t=e,r=ld(Au("line-width",this,t),Au("line-gap-width",this,t)),i=Au("line-offset",this,t);return r/2+Math.abs(i)+ku(this.paint.get("line-translate"))}queryIntersectsFeature(e,t,r,i,n,a,s){let o=Iu(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),l=s/2*ld(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),u=this.paint.get("line-offset").evaluate(t,r);return u&&(i=Mu(i,u*s)),du(o,i,l)}isTileClipped(){return!0}};l(sd,"LineStyleLayer");var od=sd;function ld(e,t){return t>0?t+2*e:e}l(ld,"getLineWidth"),p(),p(),p();var ud=Ms([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),cd=Ms([{name:"a_projected_pos",components:3,type:"Float32"}],4),hd=(Ms([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Ms([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),pd=(Ms([{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"}]),Ms([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),dd=(Ms([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),Ms([{name:"triangle",components:3,type:"Uint16"}]),Ms([{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"}]),Ms([{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"}]),Ms([{type:"Float32",name:"offsetX"}]),Ms([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),h(d(),1));function fd(e,t,r){let i=t.layout.get("text-transform").evaluate(r,{});return"uppercase"===i?e=e.toLocaleUpperCase():"lowercase"===i&&(e=e.toLocaleLowerCase()),ja.applyArabicShaping&&(e=ja.applyArabicShaping(e)),e}function yd(e,t,r){return e.sections.forEach((e=>{e.text=fd(e.text,t,r)})),e}function md(e){let t={},r={},i=[],n=0;function a(t){i.push(e[t]),n++}function s(e,t,n){let a=r[e];return delete r[e],r[t]=a,i[a].geometry[0].pop(),i[a].geometry[0]=i[a].geometry[0].concat(n[0]),a}function o(e,r,n){let a=t[r];return delete t[r],t[e]=a,i[a].geometry[0].shift(),i[a].geometry[0]=n[0].concat(i[a].geometry[0]),a}function u(e,t,r){let i=r?t[0][t[0].length-1]:t[0][0];return"".concat(e,":").concat(i.x,":").concat(i.y)}l(a,"add"),l(s,"mergeFromRight"),l(o,"mergeFromLeft"),l(u,"getKey");for(let l=0;l<e.length;l++){let c=e[l],h=c.geometry,p=c.text?c.text.toString():null;if(!p){a(l);continue}let d=u(p,h),f=u(p,h,!0);if(d in r&&f in t&&r[d]!==t[f]){let e=o(d,f,h),n=s(d,f,i[e].geometry);delete t[d],delete r[f],r[u(p,i[n].geometry,!0)]=n,i[e].geometry=null}else d in r?s(d,f,h):f in t?o(d,f,h):(a(l),t[d]=n-1,r[f]=n-1)}return i.filter((e=>e.geometry))}p(),l(fd,"transformTextInternal"),l(yd,"transformText"),p(),l(md,"mergeLines"),p(),p();var gd={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function xd(e){let t="";for(let r=0;r<e.length;r++){let i=e.charCodeAt(r+1)||null,n=e.charCodeAt(r-1)||null;i&&Ba(i)&&!gd[e[r+1]]||n&&Ba(n)&&!gd[e[r-1]]||!gd[e[r]]?t+=e[r]:t+=gd[e[r]]}return t}l(xd,"verticalizePunctuation"),p();var vd=24;p();h(A(),1);function bd(e){let t=0,r=0;for(let i of e)t+=i.w*i.h,r=Math.max(r,i.w);e.sort(((e,t)=>t.h-e.h));let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],n=0,a=0;for(let t of e)for(let e=i.length-1;e>=0;e--){let r=i[e];if(!(t.w>r.w||t.h>r.h)){if(t.x=r.x,t.y=r.y,a=Math.max(a,t.y+t.h),n=Math.max(n,t.x+t.w),t.w===r.w&&t.h===r.h){let t=i.pop();e<i.length&&(i[e]=t)}else t.h===r.h?(r.x+=t.w,r.w-=t.w):t.w===r.w?(r.y+=t.h,r.h-=t.h):(i.push({x:r.x+t.w,y:r.y,w:r.w-t.w,h:t.h}),r.y+=t.h,r.h-=t.h);break}}return{w:n,h:a,fill:t/(n*a)||0}}p(),p(),l(bd,"potpack");var wd=class{constructor(e,{pixelRatio:t,version:r,stretchX:i,stretchY:n,content:a}){this.paddedRect=e,this.pixelRatio=t,this.stretchX=i,this.stretchY=n,this.content=a,this.version=r}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}};l(wd,"ImagePosition");var _d=wd,Sd=class{constructor(e,t){let r={},i={};this.haveRenderCallbacks=[];let n=[];this.addImages(e,r,n),this.addImages(t,i,n);let{w:a,h:s}=bd(n),o=new Oh({width:a||1,height:s||1});for(let t in e){let i=e[t],n=r[t].paddedRect;Oh.copy(i.data,o,{x:0,y:0},{x:n.x+1,y:n.y+1},i.data)}for(let e in t){let r=t[e],n=i[e].paddedRect,a=n.x+1,s=n.y+1,l=r.data.width,u=r.data.height;Oh.copy(r.data,o,{x:0,y:0},{x:a,y:s},r.data),Oh.copy(r.data,o,{x:0,y:u-1},{x:a,y:s-1},{width:l,height:1}),Oh.copy(r.data,o,{x:0,y:0},{x:a,y:s+u},{width:l,height:1}),Oh.copy(r.data,o,{x:l-1,y:0},{x:a-1,y:s},{width:1,height:u}),Oh.copy(r.data,o,{x:0,y:0},{x:a+l,y:s},{width:1,height:u})}this.image=o,this.iconPositions=r,this.patternPositions=i}addImages(e,t,r){for(let i in e){let n=e[i],a={x:0,y:0,w:n.data.width+2,h:n.data.height+2};r.push(a),t[i]=new _d(a,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(e,t){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let r in e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)}patchUpdatedImage(e,t,r){if(!e||!t||e.version===t.version)return;e.version=t.version;let[i,n]=e.tl;r.update(t.data,void 0,{x:i,y:n})}};l(Sd,"ImageAtlas");var Ad=Sd;ra("ImagePosition",_d),ra("ImageAtlas",Ad);var kd,Id=((kd=Id||{})[kd.none=0]="none",kd[kd.horizontal=1]="horizontal",kd[kd.vertical=2]="vertical",kd[kd.horizontalOnly=3]="horizontalOnly",kd),Md=-17;function Pd(e){for(let t of e)if(0!==t.positionedGlyphs.length)return!1;return!0}l(Pd,"isEmpty");var Cd=class e{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(t,r){let i=new e;return i.scale=t||1,i.fontStack=r,i}static forImage(t){let r=new e;return r.imageName=t,r}};l(Cd,"SectionOptions");var zd=Cd,Bd=class e{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,r){let i=new e;for(let e=0;e<t.sections.length;e++){let n=t.sections[e];n.image?i.addImageSection(n):i.addTextSection(n,r)}return i}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(){this.text=xd(this.text)}trim(){let e=0;for(let t=0;t<this.text.length&&Td[this.text.charCodeAt(t)];t++)e++;let t=this.text.length;for(let r=this.text.length-1;r>=0&&r>=e&&Td[this.text.charCodeAt(r)];r--)t--;this.text=this.text.substring(e,t),this.sectionIndex=this.sectionIndex.slice(e,t)}substring(t,r){let i=new e;return i.text=this.text.substring(t,r),i.sectionIndex=this.sectionIndex.slice(t,r),i.sections=this.sections,i}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,t)=>Math.max(e,this.sections[t].scale)),0)}addTextSection(e,t){this.text+=e.text,this.sections.push(zd.forText(e.scale,e.fontStack||t));let r=this.sections.length-1;for(let t=0;t<e.text.length;++t)this.sectionIndex.push(r)}addImageSection(e){let t=e.image?e.image.name:"";if(0===t.length)return void q("Can't add FormattedSection with an empty image.");let r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(zd.forImage(t)),this.sectionIndex.push(this.sections.length-1)):q("Reached maximum number of images ".concat(6401))}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}};l(Bd,"TaggedString");var Vd=Bd;function Ed(e,t){let r=[],i=e.text,n=0;for(let i of t)r.push(e.substring(n,i)),n=i;return n<i.length&&r.push(e.substring(n,i.length)),r}function Fd(e,t,r,i,n,a,s,o,l,u,c,h,p,d,f,y){let m=Vd.fromFeature(e,n);2===h&&m.verticalizePunctuation();let g,{processBidirectionalText:x,processStyledBidirectionalText:v}=ja;if(x&&1===m.sections.length){g=[];let e=x(m.toString(),Nd(m,u,a,t,i,d,f));for(let t of e){let e=new Vd;e.text=t,e.sections=m.sections;for(let r=0;r<t.length;r++)e.sectionIndex.push(0);g.push(e)}}else if(v){g=[];let e=v(m.text,m.sectionIndex,Nd(m,u,a,t,i,d,f));for(let t of e){let e=new Vd;e.text=t[0],e.sectionIndex=t[1],e.sections=m.sections,g.push(e)}}else g=Ed(m,Nd(m,u,a,t,i,d,f));let b=[],w={positionedLines:b,text:m.toString(),top:c[1],bottom:c[1],left:c[0],right:c[0],writingMode:h,iconsInText:!1,verticalizable:!1};return Jd(w,t,r,i,g,s,o,l,h,u,p,y),!Pd(b)&&w}l(Ed,"breakLines"),l(Fd,"shapeText");var Td={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Ld={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Dd(e,t,r,i,n,a){if(t.imageName){let e=i[t.imageName];return e?e.displaySize[0]*t.scale*vd/a+n:0}{let i=r[t.fontStack],a=i&&i[e];return a?a.metrics.advance*t.scale+n:0}}function Od(e,t,r,i,n,a){let s=0;for(let r=0;r<e.length();r++){let o=e.getSection(r);s+=Dd(e.getCharCode(r),o,i,n,t,a)}return s/Math.max(1,Math.ceil(s/r))}function Rd(e,t,r,i){let n=Math.pow(e-t,2);return i?e<t?n/2:2*n:n+Math.abs(r)*r}function qd(e,t,r){let i=0;return 10===e&&(i-=1e4),r&&(i+=150),(40===e||65288===e)&&(i+=50),(41===t||65289===t)&&(i+=50),i}function Ud(e,t,r,i,n,a){let s=null,o=Rd(t,r,n,a);for(let e of i){let i=Rd(t-e.x,r,n,a)+e.badness;i<=o&&(s=e,o=i)}return{index:e,x:t,priorBreak:s,badness:o}}function jd(e){return e?jd(e.priorBreak).concat(e.index):[]}function Nd(e,t,r,i,n,a,s){if("point"!==a)return[];if(!e)return[];let o=[],l=Od(e,t,r,i,n,s),u=e.text.indexOf("")>=0,c=0;for(let r=0;r<e.length();r++){let a=e.getSection(r),h=e.getCharCode(r);if(Td[h]||(c+=Dd(h,a,i,n,t,s)),r<e.length()-1){let t=Pa(h);(Ld[h]||t||a.imageName)&&o.push(Ud(r+1,c,l,o,qd(h,e.getCharCode(r+1),t&&u),!1))}}return jd(Ud(e.length(),c,l,o,0,!0))}function Zd(e){let t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function Jd(e,t,r,i,n,a,s,o,l,u,c,h){let p=0,d=Md,f=0,y=0,m="right"===o?1:"left"===o?0:.5,g=0;for(let s of n){s.trim();let n=s.getMaxScale(),o=(n-1)*vd,x={positionedGlyphs:[],lineOffset:0};e.positionedLines[g]=x;let v=x.positionedGlyphs,b=0;if(!s.length()){d+=a,++g;continue}for(let a=0;a<s.length();a++){let f=s.getSection(a),y=s.getSectionIndex(a),m=s.getCharCode(a),g=0,x=null,w=null,_=null,S=vd,A=!(1===l||!c&&!Ca(m)||c&&(Td[m]||Va(m)));if(f.imageName){let t=i[f.imageName];if(!t)continue;_=f.imageName,e.iconsInText=e.iconsInText||!0,w=t.paddedRect;let r=t.displaySize;f.scale=f.scale*vd/h,x={width:r[0],height:r[1],left:1,top:-3,advance:A?r[1]:r[0]},g=o+(vd-r[1]*f.scale),S=x.advance;let a=A?r[0]*f.scale-vd*n:r[1]*f.scale-vd*n;a>0&&a>b&&(b=a)}else{let e=r[f.fontStack],i=e&&e[m];if(i&&i.rect)w=i.rect,x=i.metrics;else{let e=t[f.fontStack],r=e&&e[m];if(!r)continue;x=r.metrics}g=(n-f.scale)*vd}A?(e.verticalizable=!0,v.push({glyph:m,imageName:_,x:p,y:d+g,vertical:A,scale:f.scale,fontStack:f.fontStack,sectionIndex:y,metrics:x,rect:w}),p+=S*f.scale+u):(v.push({glyph:m,imageName:_,x:p,y:d+g,vertical:A,scale:f.scale,fontStack:f.fontStack,sectionIndex:y,metrics:x,rect:w}),p+=x.advance*f.scale+u)}if(0!==v.length){let e=p-u;f=Math.max(e,f),Gd(v,0,v.length-1,m,b)}p=0;let w=a*n+b;x.lineOffset=Math.max(b,o),d+=w,y=Math.max(w,y),++g}let x=d-Md,{horizontalAlign:v,verticalAlign:b}=Zd(s);Kd(e.positionedLines,m,v,b,f,y,a,x,n.length),e.top+=-b*x,e.bottom=e.top+x,e.left+=-v*f,e.right=e.left+f}function Gd(e,t,r,i,n){if(!i&&!n)return;let a=e[r],s=a.metrics.advance*a.scale,o=(e[r].x+s)*i;for(let i=t;i<=r;i++)e[i].x-=o,e[i].y+=n}function Kd(e,t,r,i,n,a,s,o,l){let u=(t-r)*n,c=0;c=a!==s?-o*i-Md:(-i*l+.5)*s;for(let t of e)for(let e of t.positionedGlyphs)e.x+=u,e.y+=c}function Xd(e,t,r){let{horizontalAlign:i,verticalAlign:n}=Zd(r),a=t[0],s=t[1],o=a-e.displaySize[0]*i,l=o+e.displaySize[0],u=s-e.displaySize[1]*n;return{image:e,top:u,bottom:u+e.displaySize[1],left:o,right:l}}function Yd(e,t,r,i,n,a){let s,o=e.image;if(o.content){let e=o.content,t=o.pixelRatio||1;s=[e[0]/t,e[1]/t,o.displaySize[0]-e[2]/t,o.displaySize[1]-e[3]/t]}let l,u,c,h,p=t.left*a,d=t.right*a;"width"===r||"both"===r?(h=n[0]+p-i[3],u=n[0]+d+i[1]):(h=n[0]+(p+d-o.displaySize[0])/2,u=h+o.displaySize[0]);let f=t.top*a,y=t.bottom*a;return"height"===r||"both"===r?(l=n[1]+f-i[0],c=n[1]+y+i[2]):(l=n[1]+(f+y-o.displaySize[1])/2,c=l+o.displaySize[1]),{image:o,top:l,right:u,bottom:c,left:h,collisionPadding:s}}l(Dd,"getGlyphAdvance"),l(Od,"determineAverageLineWidth"),l(Rd,"calculateBadness"),l(qd,"calculatePenalty"),l(Ud,"evaluateBreak"),l(jd,"leastBadBreaks"),l(Nd,"determineLineBreaks"),l(Zd,"getAnchorAlignment"),l(Jd,"shapeLines"),l(Gd,"justifyLine"),l(Kd,"align"),l(Xd,"shapeIcon"),l(Yd,"fitIconToText");var Hd=h(_(),1);p();var Wd=255,$d=128,Qd=32640;function ef(e,t){let{expression:r}=t;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new Za(e+1))};if("source"===r.kind)return{kind:"source"};{let{zoomStops:t,interpolationType:i}=r,n=0;for(;n<t.length&&t[n]<=e;)n++;n=Math.max(0,n-1);let a=n;for(;a<t.length&&t[a]<e+1;)a++;a=Math.min(t.length-1,a);let s=t[n],o=t[a];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:o,interpolationType:i}:{kind:"camera",minZoom:s,maxZoom:o,minSize:r.evaluate(new Za(s)),maxSize:r.evaluate(new Za(o)),interpolationType:i}}}function tf(e,t,r){let i="never",n=e.get(t);return n?i=n:e.get(r)&&(i="always"),i}l(ef,"getSizeData"),p(),l(tf,"getOverlapMode");var rf=Hd.default.VectorTileFeature.types,nf=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function af(e,t,r,i,n,a,s,o,l,u,c,h,p){let d=o?Math.min(Qd,Math.round(o[0])):0,f=o?Math.min(Qd,Math.round(o[1])):0;e.emplaceBack(t,r,Math.round(32*i),Math.round(32*n),a,s,(d<<1)+(l?1:0),f,16*u,16*c,256*h,256*p)}function sf(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function of(e){for(let t of e.sections)if(Ta(t.text))return!0;return!1}l(af,"addVertex"),l(sf,"addDynamicAttributes"),l(of,"containsRTLText");var lf=class{constructor(e){this.layoutVertexArray=new il,this.indexArray=new dl,this.programConfigurations=e,this.segments=new wl,this.dynamicLayoutVertexArray=new al,this.opacityVertexArray=new ol,this.hasVisibleVertices=!1,this.placedSymbolArray=new Co}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(e,t,r,i){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,ud.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,cd.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,nf,!0),this.opacityVertexBuffer.itemSize=1),(r||i)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}};l(lf,"SymbolBuffers");var uf=lf;ra("SymbolBuffers",uf);var cf=class{constructor(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new wl,this.collisionVertexArray=new hl}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,hd.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};l(cf,"CollisionBuffers");var hf=cf;ra("CollisionBuffers",hf);var pf=class{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Lu.identity([]),this.placementViewportMatrix=Lu.identity([]);let t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=ef(this.zoom,t["text-size"]),this.iconSizeData=ef(this.zoom,t["icon-size"]);let r=this.layers[0].layout,i=r.get("symbol-sort-key"),n=r.get("symbol-z-order");this.canOverlap="never"!==tf(r,"text-overlap","text-allow-overlap")||"never"!==tf(r,"icon-overlap","icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==n&&!i.isConstant();let a="viewport-y"===n||"auto"===n&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&this.canOverlap,"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((e=>Id[e]))),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.sourceID=e.sourceID}createArrays(){this.text=new uf(new $l(this.layers,this.zoom,(e=>/^text/.test(e)))),this.icon=new uf(new $l(this.layers,this.zoom,(e=>/^icon/.test(e)))),this.glyphOffsetArray=new To,this.lineVertexArray=new Do,this.symbolInstances=new Eo}calculateGlyphDependencies(e,t,r,i,n){for(let a=0;a<e.length;a++)if(t[e.charCodeAt(a)]=!0,(r||i)&&n){let r=gd[e.charAt(a)];r&&(t[r.charCodeAt(0)]=!0)}}populate(e,t,r){let i=this.layers[0],n=i.layout,a=n.get("text-font"),s=n.get("text-field"),o=n.get("icon-image"),l=("constant"!==s.value.kind||s.value.value instanceof et&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),u="constant"!==o.value.kind||!!o.value.value||Object.keys(o.parameters).length>0,c=n.get("symbol-sort-key");if(this.features=[],!l&&!u)return;let h=t.iconDependencies,p=t.glyphDependencies,d=t.availableImages,f=new Za(this.zoom);for(let{feature:t,id:s,index:o,sourceLayerIndex:y}of e){let e,m,g=i._featureFilter.needGeometry,x=au(t,g);if(!i._featureFilter.filter(f,x,r))continue;if(g||(x.geometry=nu(t)),l){let t=i.getValueAndResolveTokens("text-field",x,r,d),n=et.factory(t);of(n)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===Ua()||this.hasRTLText&&ja.isParsed())&&(e=yd(n,i,x))}if(u){let e=i.getValueAndResolveTokens("icon-image",x,r,d);m=e instanceof ot?e:ot.fromString(e)}if(!e&&!m)continue;let v=this.sortFeaturesByKey?c.evaluate(x,{},r):void 0,b={id:s,text:e,icon:m,index:o,sourceLayerIndex:y,geometry:x.geometry,properties:t.properties,type:rf[t.type],sortKey:v};if(this.features.push(b),m&&(h[m.name]=!0),e){let t=a.evaluate(x,{},r).join(","),i="viewport"!==n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(2)>=0;for(let r of e.sections)if(r.image)h[r.image.name]=!0;else{let n=ka(e.toString()),a=r.fontStack||t,s=p[a]=p[a]||{};this.calculateGlyphDependencies(r.text,s,i,this.allowVerticalPlacement,n)}}}"line"===n.get("symbol-placement")&&(this.features=md(this.features)),this.sortFeaturesByKey&&this.features.sort(((e,t)=>e.sortKey-t.sortKey))}update(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,r),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,r))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){let r=this.lineVertexArray.length;if(void 0!==e.segment){let r=e.dist(t[e.segment+1]),i=e.dist(t[e.segment]),n={};for(let i=e.segment+1;i<t.length;i++)n[i]={x:t[i].x,y:t[i].y,tileUnitDistanceFromAnchor:r},i<t.length-1&&(r+=t[i+1].dist(t[i]));for(let r=e.segment||0;r>=0;r--)n[r]={x:t[r].x,y:t[r].y,tileUnitDistanceFromAnchor:i},r>0&&(i+=t[r-1].dist(t[r]));for(let e=0;e<t.length;e++){let t=n[e];this.lineVertexArray.emplaceBack(t.x,t.y,t.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(e,t,r,i,n,a,s,o,l,u,c,h){let p=e.indexArray,d=e.layoutVertexArray,f=e.segments.prepareSegment(4*t.length,d,p,this.canOverlap?a.sortKey:void 0),y=this.glyphOffsetArray.length,m=f.vertexLength,g=this.allowVerticalPlacement&&2===s?Math.PI/2:0,x=a.text&&a.text.sections;for(let i=0;i<t.length;i++){let{tl:n,tr:s,bl:l,br:u,tex:c,pixelOffsetTL:y,pixelOffsetBR:m,minFontScaleX:v,minFontScaleY:b,glyphOffset:w,isSDF:_,sectionIndex:S}=t[i],A=f.vertexLength,k=w[1];af(d,o.x,o.y,n.x,k+n.y,c.x,c.y,r,_,y.x,y.y,v,b),af(d,o.x,o.y,s.x,k+s.y,c.x+c.w,c.y,r,_,m.x,y.y,v,b),af(d,o.x,o.y,l.x,k+l.y,c.x,c.y+c.h,r,_,y.x,m.y,v,b),af(d,o.x,o.y,u.x,k+u.y,c.x+c.w,c.y+c.h,r,_,m.x,m.y,v,b),sf(e.dynamicLayoutVertexArray,o,g),p.emplaceBack(A,A+1,A+2),p.emplaceBack(A+1,A+2,A+3),f.vertexLength+=4,f.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(w[0]),(i===t.length-1||S!==t[i+1].sectionIndex)&&e.programConfigurations.populatePaintArrays(d.length,a,a.index,{},h,x&&x[S])}e.placedSymbolArray.emplaceBack(o.x,o.y,y,this.glyphOffsetArray.length-y,m,l,u,o.segment,r?r[0]:0,r?r[1]:0,i[0],i[1],s,0,!1,0,c)}_addCollisionDebugVertex(e,t,r,i,n,a){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,i,n,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(e,t,r,i,n,a,s){let o=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),l=o.vertexLength,u=n.layoutVertexArray,c=n.collisionVertexArray,h=s.anchorX,p=s.anchorY;this._addCollisionDebugVertex(u,c,a,h,p,new dd.default(e,t)),this._addCollisionDebugVertex(u,c,a,h,p,new dd.default(r,t)),this._addCollisionDebugVertex(u,c,a,h,p,new dd.default(r,i)),this._addCollisionDebugVertex(u,c,a,h,p,new dd.default(e,i)),o.vertexLength+=4;let d=n.indexArray;d.emplaceBack(l,l+1),d.emplaceBack(l+1,l+2),d.emplaceBack(l+2,l+3),d.emplaceBack(l+3,l),o.primitiveLength+=4}addDebugCollisionBoxes(e,t,r,i){for(let n=e;n<t;n++){let e=this.collisionBoxArray.get(n),t=e.x1,a=e.y1,s=e.x2,o=e.y2;this.addCollisionDebugVertices(t,a,s,o,i?this.textCollisionBox:this.iconCollisionBox,e.anchorPoint,r)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new hf(ul,pd.members,yl),this.iconCollisionBox=new hf(ul,pd.members,yl);for(let e=0;e<this.symbolInstances.length;e++){let t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}}_deserializeCollisionBoxesForSymbol(e,t,r,i,n,a,s,o,l){let u={};for(let i=t;i<r;i++){let t=e.get(i);u.textBox={x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,anchorPointX:t.anchorPointX,anchorPointY:t.anchorPointY},u.textFeatureIndex=t.featureIndex;break}for(let t=i;t<n;t++){let r=e.get(t);u.verticalTextBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},u.verticalTextFeatureIndex=r.featureIndex;break}for(let t=a;t<s;t++){let r=e.get(t);u.iconBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},u.iconFeatureIndex=r.featureIndex;break}for(let t=o;t<l;t++){let r=e.get(t);u.verticalIconBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},u.verticalIconFeatureIndex=r.featureIndex;break}return u}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){let r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,t){let r=e.placedSymbolArray.get(t),i=r.vertexStartIndex+4*r.numGlyphs;for(let t=r.vertexStartIndex;t<i;t+=4)e.indexArray.emplaceBack(t,t+1,t+2),e.indexArray.emplaceBack(t+1,t+2,t+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;let t=Math.sin(e),r=Math.cos(e),i=[],n=[],a=[];for(let e=0;e<this.symbolInstances.length;++e){a.push(e);let s=this.symbolInstances.get(e);i.push(0|Math.round(t*s.anchorX+r*s.anchorY)),n.push(s.featureIndex)}return a.sort(((e,t)=>i[e]-i[t]||n[t]-n[e])),a}addToSortKeyRanges(e,t){let r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let e of this.symbolInstanceIndexes){let t=this.symbolInstances.get(e);this.featureSortOrder.push(t.featureIndex),[t.rightJustifiedTextSymbolIndex,t.centerJustifiedTextSymbolIndex,t.leftJustifiedTextSymbolIndex].forEach(((e,t,r)=>{e>=0&&r.indexOf(e)===t&&this.addIndicesForPlacedSymbol(this.text,e)})),t.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,t.verticalPlacedTextSymbolIndex),t.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.placedIconSymbolIndex),t.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};l(pf,"SymbolBucket");var df=pf;function ff(e,t){return t.replace(/{([^{}]+)}/g,((t,r)=>r in e?String(e[r]):""))}ra("SymbolBucket",df,{omit:["layers","collisionBoxArray","features","compareText"]}),df.MAX_GLYPHS=65535,df.addDynamicAttributes=sf,p(),l(ff,"resolveTokens"),p();var yf,mf,gf=l((()=>yf=yf||new xs({"symbol-placement":new ls(H.layout_symbol["symbol-placement"]),"symbol-spacing":new ls(H.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ls(H.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new cs(H.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ls(H.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new ls(H.layout_symbol["icon-allow-overlap"]),"icon-overlap":new ls(H.layout_symbol["icon-overlap"]),"icon-ignore-placement":new ls(H.layout_symbol["icon-ignore-placement"]),"icon-optional":new ls(H.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ls(H.layout_symbol["icon-rotation-alignment"]),"icon-size":new cs(H.layout_symbol["icon-size"]),"icon-text-fit":new ls(H.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ls(H.layout_symbol["icon-text-fit-padding"]),"icon-image":new cs(H.layout_symbol["icon-image"]),"icon-rotate":new cs(H.layout_symbol["icon-rotate"]),"icon-padding":new cs(H.layout_symbol["icon-padding"]),"icon-keep-upright":new ls(H.layout_symbol["icon-keep-upright"]),"icon-offset":new cs(H.layout_symbol["icon-offset"]),"icon-anchor":new cs(H.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ls(H.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ls(H.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ls(H.layout_symbol["text-rotation-alignment"]),"text-field":new cs(H.layout_symbol["text-field"]),"text-font":new cs(H.layout_symbol["text-font"]),"text-size":new cs(H.layout_symbol["text-size"]),"text-max-width":new cs(H.layout_symbol["text-max-width"]),"text-line-height":new ls(H.layout_symbol["text-line-height"]),"text-letter-spacing":new cs(H.layout_symbol["text-letter-spacing"]),"text-justify":new cs(H.layout_symbol["text-justify"]),"text-radial-offset":new cs(H.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ls(H.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new cs(H.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new cs(H.layout_symbol["text-anchor"]),"text-max-angle":new ls(H.layout_symbol["text-max-angle"]),"text-writing-mode":new ls(H.layout_symbol["text-writing-mode"]),"text-rotate":new cs(H.layout_symbol["text-rotate"]),"text-padding":new ls(H.layout_symbol["text-padding"]),"text-keep-upright":new ls(H.layout_symbol["text-keep-upright"]),"text-transform":new cs(H.layout_symbol["text-transform"]),"text-offset":new cs(H.layout_symbol["text-offset"]),"text-allow-overlap":new ls(H.layout_symbol["text-allow-overlap"]),"text-overlap":new ls(H.layout_symbol["text-overlap"]),"text-ignore-placement":new ls(H.layout_symbol["text-ignore-placement"]),"text-optional":new ls(H.layout_symbol["text-optional"])})),"getLayout"),xf=l((()=>mf=mf||new xs({"icon-opacity":new cs(H.paint_symbol["icon-opacity"]),"icon-color":new cs(H.paint_symbol["icon-color"]),"icon-halo-color":new cs(H.paint_symbol["icon-halo-color"]),"icon-halo-width":new cs(H.paint_symbol["icon-halo-width"]),"icon-halo-blur":new cs(H.paint_symbol["icon-halo-blur"]),"icon-translate":new ls(H.paint_symbol["icon-translate"]),"icon-translate-anchor":new ls(H.paint_symbol["icon-translate-anchor"]),"text-opacity":new cs(H.paint_symbol["text-opacity"]),"text-color":new cs(H.paint_symbol["text-color"],{runtimeType:ue,getOverride:l((e=>e.textColor),"getOverride"),hasOverride:l((e=>!!e.textColor),"hasOverride")}),"text-halo-color":new cs(H.paint_symbol["text-halo-color"]),"text-halo-width":new cs(H.paint_symbol["text-halo-width"]),"text-halo-blur":new cs(H.paint_symbol["text-halo-blur"]),"text-translate":new ls(H.paint_symbol["text-translate"]),"text-translate-anchor":new ls(H.paint_symbol["text-translate-anchor"])})),"getPaint"),vf={get paint(){return xf()},get layout(){return gf()}};p();var bf=class{constructor(e){if(void 0===e.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:ae,this.defaultValue=e}evaluate(e){if(e.formattedSection){let t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){if(!this.defaultValue.isConstant()){e(this.defaultValue.value._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};l(bf,"FormatSectionOverride");var wf=bf;ra("FormatSectionOverride",wf,{omit:["defaultValue"]});var _f=class e extends ws{constructor(e){super(e,vf)}recalculate(e,t){if(super.recalculate(e,t),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){let e=this.layout.get("text-writing-mode");if(e){let t=[];for(let r of e)t.indexOf(r)<0&&t.push(r);this.layout._values["text-writing-mode"]=t}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,t,r,i){let n=this.layout.get(e).evaluate(t,{},r,i),a=this._unevaluatedLayout._values[e];return a.isDataDriven()||Ti(a.value)||!n?n:ff(t.properties,n)}createBucket(e){return new df(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let t of vf.paint.overridableProperties){if(!e.hasPaintOverride(this.layout,t))continue;let r=this.paint.get(t),i=new wf(r),n=new Fi(i,r.property.specification),a=null;a="constant"===r.value.kind||"source"===r.value.kind?new Oi("source",n):new qi("composite",n,r.value.zoomStops),this.paint._values[t]=new ns(r.property,a,r.parameters)}}_handleOverridablePaintPropertyUpdate(t,r,i){return!(!this.layout||r.isDataDriven()||i.isDataDriven())&&e.hasPaintOverride(this.layout,t)}static hasPaintOverride(e,t){let r=e.get("text-field"),i=vf.paint.properties[t],n=!1,a=l((e=>{for(let t of e)if(i.overrides&&i.overrides.hasOverride(t))return void(n=!0)}),"checkSections");if("constant"===r.value.kind&&r.value.value instanceof et)a(r.value.value.sections);else if("source"===r.value.kind){let e=l((t=>{if(!n)if(t instanceof dt&&ct(t.value)===de){let e=t.value;a(e.sections)}else t instanceof li?a(t.sections):t.eachChild(e)}),"checkExpression"),t=r.value;t._styleExpression&&e(t._styleExpression.expression)}return n}};l(_f,"SymbolStyleLayer");var Sf=_f;function Af(e,t,r,i=1){let n=e.get("icon-padding").evaluate(t,{},r),a=n&&n.values;return[a[0]*i,a[1]*i,a[2]*i,a[3]*i]}l(Af,"getIconPadding"),p(),p();var kf,If=l((()=>kf=kf||new xs({"background-color":new ls(H.paint_background["background-color"]),"background-pattern":new fs(H.paint_background["background-pattern"]),"background-opacity":new ls(H.paint_background["background-opacity"])})),"getPaint"),Mf={get paint(){return If()}},Pf=class extends ws{constructor(e){super(e,Mf)}};l(Pf,"BackgroundStyleLayer");var Cf=Pf;p(),p();var zf,Bf=l((()=>zf=zf||new xs({"raster-opacity":new ls(H.paint_raster["raster-opacity"]),"raster-hue-rotate":new ls(H.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new ls(H.paint_raster["raster-brightness-min"]),"raster-brightness-max":new ls(H.paint_raster["raster-brightness-max"]),"raster-saturation":new ls(H.paint_raster["raster-saturation"]),"raster-contrast":new ls(H.paint_raster["raster-contrast"]),"raster-resampling":new ls(H.paint_raster["raster-resampling"]),"raster-fade-duration":new ls(H.paint_raster["raster-fade-duration"])})),"getPaint"),Vf={get paint(){return Bf()}},Ef=class extends ws{constructor(e){super(e,Vf)}};l(Ef,"RasterStyleLayer");var Ff=Ef;p();var Tf=class extends ws{constructor(e){super(e,{}),this.onAdd=l((e=>{this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)}),"onAdd"),this.onRemove=l((e=>{this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)}),"onRemove"),this.implementation=e}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}};l(Tf,"CustomStyleLayer");var Lf=Tf;function Df(e){if("custom"===e.type)return new Lf(e);switch(e.type){case"background":return new Cf(e);case"circle":return new Ah(e);case"fill":return new fp(e);case"fill-extrusion":return new Ep(e);case"heatmap":return new Uh(e);case"hillshade":return new Gh(e);case"line":return new od(e);case"raster":return new Ff(e);case"symbol":return new Sf(e)}}l(Df,"createStyleLayer");var Of=class{constructor(e){this.keyCache={},e&&this.replace(e)}replace(e){this._layerConfigs={},this._layers={},this.update(e,[])}update(e,t){for(let t of e){this._layerConfigs[t.id]=t;let e=this._layers[t.id]=Df(t);e._featureFilter=Hi(e.filter),this.keyCache[t.id]&&delete this.keyCache[t.id]}for(let e of t)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};let r=ln(Object.values(this._layerConfigs),this.keyCache);for(let e of r){let t=e.map((e=>this._layers[e.id])),r=t[0];if("none"===r.visibility)continue;let i=r.source||"",n=this.familiesBySource[i];n||(n=this.familiesBySource[i]={});let a=r.sourceLayer||"_geojsonTileLayer",s=n[a];s||(s=n[a]=[]),s.push(t)}}};l(Of,"StyleLayerIndex");var Rf=Of;p();var qf=h(_(),1),Uf=h(A(),1);p(),p(),p();var jf=class{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){let r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error("Out of bounds. Index requested n=".concat(e," can't be >= this._numberToString.length ").concat(this._numberToString.length));return this._numberToString[e]}};l(jf,"DictionaryCoder");var Nf=jf,Zf=h(_(),1),Jf=h(A(),1);p();var Gf=class{constructor(e,t,r,i,n){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=r,e._y=i,this.properties=e.properties,this.id=n}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let t in this)"_geometry"===t||"_vectorTileFeature"===t||(e[t]=this[t]);return e}};l(Gf,"GeoJSONFeature");var Kf=Gf,Xf=class{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new X(8192,16,0),this.grid3D=new X(8192,16,0),this.featureIndexArray=new Uo,this.promoteId=t}insert(e,t,r,i,n,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);let o=a?this.grid3D:this.grid;for(let e=0;e<t.length;e++){let r=t[e],i=[1/0,1/0,-1/0,-1/0];for(let e=0;e<r.length;e++){let t=r[e];i[0]=Math.min(i[0],t.x),i[1]=Math.min(i[1],t.y),i[2]=Math.max(i[2],t.x),i[3]=Math.max(i[3],t.y)}i[0]<8192&&i[1]<8192&&i[2]>=0&&i[3]>=0&&o.insert(s,i[0],i[1],i[2],i[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Zf.default.VectorTile(new Jf.default(this.rawTileData)).layers,this.sourceLayerCoder=new Nf(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,t,r,i){this.loadVTLayers();let n=e.params||{},a=8192/e.tileSize/e.scale,s=Hi(n.filter),o=e.queryGeometry,l=e.queryPadding*a,u=Wf(o),c=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),h=Wf(e.cameraQueryGeometry),p=this.grid3D.query(h.minX-l,h.minY-l,h.maxX+l,h.maxY+l,((t,r,i,n)=>wu(e.cameraQueryGeometry,t-l,r-l,i+l,n+l)));for(let e of p)c.push(e);c.sort($f);let d,f={};for(let l=0;l<c.length;l++){let u=c[l];if(u===d)continue;d=u;let h=this.featureIndexArray.get(u),p=null;this.loadMatchingFeature(f,h.bucketIndex,h.sourceLayerIndex,h.featureIndex,s,n.layers,n.availableImages,t,r,i,((t,r,i)=>(p||(p=nu(t)),r.queryIntersectsFeature(o,t,i,p,this.z,e.transform,a,e.pixelPosMatrix))))}return f}loadMatchingFeature(e,t,r,i,n,a,s,o,l,u,c){let h=this.bucketLayerIDs[t];if(a&&!O(a,h))return;let p=this.sourceLayerCoder.decode(r),d=this.vtLayers[p].feature(i);if(n.needGeometry){let e=au(d,!0);if(!n.filter(new Za(this.tileID.overscaledZ),e,this.tileID.canonical))return}else if(!n.filter(new Za(this.tileID.overscaledZ),d))return;let f=this.getId(d,p);for(let t=0;t<h.length;t++){let r=h[t];if(a&&a.indexOf(r)<0)continue;let n=o[r];if(!n)continue;let p={};f&&u&&(p=u.getState(n.sourceLayer||"_geojsonTileLayer",f));let y=E({},l[r]);y.paint=Hf(y.paint,n.paint,d,p,s),y.layout=Hf(y.layout,n.layout,d,p,s);let m=!c||c(d,n,p);if(!m)continue;let g=new Kf(d,this.z,this.x,this.y,f);g.layer=y;let x=e[r];void 0===x&&(x=e[r]=[]),x.push({featureIndex:i,feature:g,intersectionZ:m})}}lookupSymbolFeatures(e,t,r,i,n,a,s,o){let l={};this.loadVTLayers();let u=Hi(n);for(let n of e)this.loadMatchingFeature(l,r,i,n,u,a,s,o,t);return l}hasLayer(e){for(let t of this.bucketLayerIDs)for(let r of t)if(e===r)return!0;return!1}getId(e,t){let r=e.id;if(this.promoteId){let i="string"==typeof this.promoteId?this.promoteId:this.promoteId[t];r=e.properties[i],"boolean"==typeof r&&(r=Number(r))}return r}};l(Xf,"FeatureIndex");var Yf=Xf;function Hf(e,t,r,i,n){return T(e,((e,a)=>{let s=t instanceof ss?t.get(a):null;return s&&s.evaluate?s.evaluate(r,i,n):s}))}function Wf(e){let t=1/0,r=1/0,i=-1/0,n=-1/0;for(let a of e)t=Math.min(t,a.x),r=Math.min(r,a.y),i=Math.max(i,a.x),n=Math.max(n,a.y);return{minX:t,minY:r,maxX:i,maxY:n}}function $f(e,t){return t-e}ra("FeatureIndex",Yf,{omit:["rawTileData","sourceLayerCoder"]}),l(Hf,"evaluateProperties"),l(Wf,"getBounds"),l($f,"topDownFeatureComparator"),p(),p();var Qf=h(d(),1),ey=class e extends Qf.default{constructor(e,t,r,i){super(e,t),this.angle=r,void 0!==i&&(this.segment=i)}clone(){return new e(this.x,this.y,this.angle,this.segment)}};l(ey,"Anchor");var ty=ey;function ry(e,t,r,i,n){if(void 0===t.segment||0===r)return!0;let a=t,s=t.segment+1,o=0;for(;o>-r/2;){if(s--,s<0)return!1;o-=e[s].dist(a),a=e[s]}o+=e[s].dist(e[s+1]),s++;let l=[],u=0;for(;o<r/2;){let t=e[s-1],r=e[s],a=e[s+1];if(!a)return!1;let c=t.angleTo(r)-r.angleTo(a);for(c=Math.abs((c+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:o,angleDelta:c}),u+=c;o-l[0].distance>i;)u-=l.shift().angleDelta;if(u>n)return!1;s++,o+=r.dist(a)}return!0}function iy(e){let t=0;for(let r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function ny(e,t,r){return e?.6*t*r:0}function ay(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function sy(e,t,r,i,n,a){let s=ny(r,n,a),o=ay(r,i)*a,l=0,u=iy(e)/2;for(let r=0;r<e.length-1;r++){let i=e[r],n=e[r+1],a=i.dist(n);if(l+a>u){let c=(u-l)/a,h=vr.number(i.x,n.x,c),p=vr.number(i.y,n.y,c),d=new ty(h,p,n.angleTo(i),r);return d._round(),!s||ry(e,d,o,s,t)?d:void 0}l+=a}}function oy(e,t,r,i,n,a,s,o,l){let u=ny(i,a,s),c=ay(i,n),h=c*s,p=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-h<t/4&&(t=h+t/4),ly(e,p?t/2*o%t:(c/2+2*a)*s*o%t,t,u,r,h,p,!1,l)}function ly(e,t,r,i,n,a,s,o,l){let u=a/2,c=iy(e),h=0,p=t-r,d=[];for(let t=0;t<e.length-1;t++){let s=e[t],o=e[t+1],f=s.dist(o),y=o.angleTo(s);for(;p+r<h+f;){p+=r;let m=(p-h)/f,g=vr.number(s.x,o.x,m),x=vr.number(s.y,o.y,m);if(g>=0&&g<l&&x>=0&&x<l&&p-u>=0&&p+u<=c){let r=new ty(g,x,y,t);r._round(),(!i||ry(e,r,a,i,n))&&d.push(r)}}h+=f}return!o&&!d.length&&!s&&(d=ly(e,h/2,r,i,n,a,s,!0,l)),d}ra("Anchor",ty),p(),p(),l(ry,"checkMaxAngle"),l(iy,"getLineLength"),l(ny,"getAngleWindowSize"),l(ay,"getShapedLabelLength"),l(sy,"getCenterAnchor"),l(oy,"getAnchors"),l(ly,"resample"),p();var uy=h(d(),1);function cy(e,t,r,i,n){let a=[];for(let s=0;s<e.length;s++){let o,l=e[s];for(let e=0;e<l.length-1;e++){let s=l[e],u=l[e+1];s.x<t&&u.x<t||(s.x<t?s=new uy.default(t,s.y+(u.y-s.y)*((t-s.x)/(u.x-s.x)))._round():u.x<t&&(u=new uy.default(t,s.y+(u.y-s.y)*((t-s.x)/(u.x-s.x)))._round()),!(s.y<r&&u.y<r)&&(s.y<r?s=new uy.default(s.x+(u.x-s.x)*((r-s.y)/(u.y-s.y)),r)._round():u.y<r&&(u=new uy.default(s.x+(u.x-s.x)*((r-s.y)/(u.y-s.y)),r)._round()),!(s.x>=i&&u.x>=i)&&(s.x>=i?s=new uy.default(i,s.y+(u.y-s.y)*((i-s.x)/(u.x-s.x)))._round():u.x>=i&&(u=new uy.default(i,s.y+(u.y-s.y)*((i-s.x)/(u.x-s.x)))._round()),!(s.y>=n&&u.y>=n)&&(s.y>=n?s=new uy.default(s.x+(u.x-s.x)*((n-s.y)/(u.y-s.y)),n)._round():u.y>=n&&(u=new uy.default(s.x+(u.x-s.x)*((n-s.y)/(u.y-s.y)),n)._round()),(!o||!s.equals(o[o.length-1]))&&(o=[s],a.push(o)),o.push(u)))))}}return a}l(cy,"clipLine"),p();var hy=h(d(),1);function py(e,t,r,i){let n=[],a=e.image,s=a.pixelRatio,o=a.paddedRect.w-2,u=a.paddedRect.h-2,c=e.right-e.left,h=e.bottom-e.top,p=a.stretchX||[[0,o]],d=a.stretchY||[[0,u]],f=l(((e,t)=>e+t[1]-t[0]),"reduceRanges"),y=p.reduce(f,0),m=d.reduce(f,0),g=o-y,x=u-m,v=0,b=y,w=0,_=m,S=0,A=g,k=0,I=x;if(a.content&&i){let e=a.content;v=dy(p,0,e[0]),w=dy(d,0,e[1]),b=dy(p,e[0],e[2]),_=dy(d,e[1],e[3]),S=e[0]-v,k=e[1]-w,A=e[2]-e[0]-b,I=e[3]-e[1]-_}let M=l(((i,n,o,l)=>{let u=yy(i.stretch-v,b,c,e.left),p=my(i.fixed-S,A,i.stretch,y),d=yy(n.stretch-w,_,h,e.top),f=my(n.fixed-k,I,n.stretch,m),g=yy(o.stretch-v,b,c,e.left),x=my(o.fixed-S,A,o.stretch,y),M=yy(l.stretch-w,_,h,e.top),P=my(l.fixed-k,I,l.stretch,m),C=new hy.default(u,d),z=new hy.default(g,d),B=new hy.default(g,M),V=new hy.default(u,M),E=new hy.default(p/s,f/s),F=new hy.default(x/s,P/s),T=t*Math.PI/180;if(T){let e=Math.sin(T),t=Math.cos(T),r=[t,-e,e,t];C._matMult(r),z._matMult(r),V._matMult(r),B._matMult(r)}let L=i.stretch+i.fixed,D=o.stretch+o.fixed,O=n.stretch+n.fixed,R=l.stretch+l.fixed;return{tl:C,tr:z,bl:V,br:B,tex:{x:a.paddedRect.x+1+L,y:a.paddedRect.y+1+O,w:D-L,h:R-O},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:E,pixelOffsetBR:F,minFontScaleX:A/s/c,minFontScaleY:I/s/h,isSDF:r}}),"makeBox");if(i&&(a.stretchX||a.stretchY)){let e=fy(p,g,y),t=fy(d,x,m);for(let r=0;r<e.length-1;r++){let i=e[r],a=e[r+1];for(let e=0;e<t.length-1;e++){let r=t[e],s=t[e+1];n.push(M(i,r,a,s))}}}else n.push(M({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:o+1},{fixed:0,stretch:u+1}));return n}function dy(e,t,r){let i=0;for(let n of e)i+=Math.max(t,Math.min(r,n[1]))-Math.max(t,Math.min(r,n[0]));return i}function fy(e,t,r){let i=[{fixed:-1,stretch:0}];for(let[t,r]of e){let e=i[i.length-1];i.push({fixed:t-e.stretch,stretch:e.stretch}),i.push({fixed:t-e.stretch,stretch:e.stretch+(r-t)})}return i.push({fixed:t+1,stretch:r}),i}function yy(e,t,r,i){return e/t*r+i}function my(e,t,r,i){return e-t*r/i}function gy(e,t,r,i,n,a,s,o){let l=i.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,u=[];for(let e of t.positionedLines)for(let i of e.positionedGlyphs){if(!i.rect)continue;let a=i.rect||{},c=4,h=!0,p=1,d=0,f=(n||o)&&i.vertical,y=i.metrics.advance*i.scale/2;if(o&&t.verticalizable){let t=(i.scale-1)*vd,r=(vd-i.metrics.width*i.scale)/2;d=e.lineOffset/2-(i.imageName?-r:t)}if(i.imageName){let e=s[i.imageName];h=e.sdf,p=e.pixelRatio,c=1/p}let m=n?[i.x+y,i.y]:[0,0],g=n?[0,0]:[i.x+y+r[0],i.y+r[1]-d],x=[0,0];f&&(x=g,g=[0,0]);let v=(i.metrics.left-c)*i.scale-y+g[0],b=(-i.metrics.top-c)*i.scale+g[1],w=v+a.w*i.scale/p,_=b+a.h*i.scale/p,S=new hy.default(v,b),A=new hy.default(w,b),k=new hy.default(v,_),I=new hy.default(w,_);if(f){let e=new hy.default(-y,y-Md),t=-Math.PI/2,r=12-y,n=i.imageName?r:0,a=new hy.default(22-r,-n),s=new hy.default(...x);S._rotateAround(t,e)._add(a)._add(s),A._rotateAround(t,e)._add(a)._add(s),k._rotateAround(t,e)._add(a)._add(s),I._rotateAround(t,e)._add(a)._add(s)}if(l){let e=Math.sin(l),t=Math.cos(l),r=[t,-e,e,t];S._matMult(r),A._matMult(r),k._matMult(r),I._matMult(r)}let M=new hy.default(0,0),P=new hy.default(0,0);u.push({tl:S,tr:A,bl:k,br:I,tex:a,writingMode:t.writingMode,glyphOffset:m,sectionIndex:i.sectionIndex,isSDF:h,pixelOffsetTL:M,pixelOffsetBR:P,minFontScaleX:0,minFontScaleY:0})}return u}l(py,"getIconQuads"),l(dy,"sumWithinRange"),l(fy,"stretchZonesToCuts"),l(yy,"getEmOffset"),l(my,"getPxOffset"),l(gy,"getGlyphQuads"),p();var xy=h(d(),1),vy=class{constructor(e,t,r,i,n,a,s,o,l,u){if(this.boxStartIndex=e.length,l){let e=a.top,t=a.bottom,r=a.collisionPadding;r&&(e-=r[1],t+=r[3]);let i=t-e;i>0&&(i=Math.max(10,i),this.circleDiameter=i)}else{let l=a.top*s-o[0],c=a.bottom*s+o[2],h=a.left*s-o[3],p=a.right*s+o[1],d=a.collisionPadding;if(d&&(h-=d[0]*s,l-=d[1]*s,p+=d[2]*s,c+=d[3]*s),u){let e=new xy.default(h,l),t=new xy.default(p,l),r=new xy.default(h,c),i=new xy.default(p,c),n=u*Math.PI/180;e._rotate(n),t._rotate(n),r._rotate(n),i._rotate(n),h=Math.min(e.x,t.x,r.x,i.x),p=Math.max(e.x,t.x,r.x,i.x),l=Math.min(e.y,t.y,r.y,i.y),c=Math.max(e.y,t.y,r.y,i.y)}e.emplaceBack(t.x,t.y,h,l,p,c,r,i,n)}this.boxEndIndex=e.length}};l(vy,"CollisionFeature");var by=vy;p(),p();var wy=class{constructor(e=[],t=Sy){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;let e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:r}=this,i=t[e];for(;e>0;){let n=e-1>>1,a=t[n];if(r(i,a)>=0)break;t[e]=a,e=n}t[e]=i}_down(e){let{data:t,compare:r}=this,i=this.length>>1,n=t[e];for(;e<i;){let i=1+(e<<1),a=t[i],s=i+1;if(s<this.length&&r(t[s],a)<0&&(i=s,a=t[s]),r(a,n)>=0)break;t[e]=a,e=i}t[e]=n}};l(wy,"TinyQueue");var _y=wy;function Sy(e,t){return e<t?-1:e>t?1:0}l(Sy,"defaultCompare");var Ay=h(d(),1);function ky(e,t=1,r=!1){let i=1/0,n=1/0,a=-1/0,s=-1/0,o=e[0];for(let e=0;e<o.length;e++){let t=o[e];(!e||t.x<i)&&(i=t.x),(!e||t.y<n)&&(n=t.y),(!e||t.x>a)&&(a=t.x),(!e||t.y>s)&&(s=t.y)}let l=a-i,u=s-n,c=Math.min(l,u),h=c/2,p=new _y([],Iy);if(0===c)return new Ay.default(i,n);for(let t=i;t<a;t+=c)for(let r=n;r<s;r+=c)p.push(new My(t+h,r+h,h,e));let d=Cy(e),f=p.length;for(;p.length;){let i=p.pop();(i.d>d.d||!d.d)&&(d=i,r&&console.log("found best %d after %d probes",Math.round(1e4*i.d)/1e4,f)),!(i.max-d.d<=t)&&(h=i.h/2,p.push(new My(i.p.x-h,i.p.y-h,h,e)),p.push(new My(i.p.x+h,i.p.y-h,h,e)),p.push(new My(i.p.x-h,i.p.y+h,h,e)),p.push(new My(i.p.x+h,i.p.y+h,h,e)),f+=4)}return r&&(console.log("num probes: ".concat(f)),console.log("best distance: ".concat(d.d))),d.p}function Iy(e,t){return t.max-e.max}function My(e,t,r,i){this.p=new Ay.default(e,t),this.h=r,this.d=Py(this.p,i),this.max=this.d+this.h*Math.SQRT2}function Py(e,t){let r=!1,i=1/0;for(let n=0;n<t.length;n++){let a=t[n];for(let t=0,n=a.length,s=n-1;t<n;s=t++){let n=a[t],o=a[s];n.y>e.y!=o.y>e.y&&e.x<(o.x-n.x)*(e.y-n.y)/(o.y-n.y)+n.x&&(r=!r),i=Math.min(i,xu(e,n,o))}}return(r?1:-1)*Math.sqrt(i)}function Cy(e){let t=0,r=0,i=0,n=e[0];for(let e=0,a=n.length,s=a-1;e<a;s=e++){let a=n[e],o=n[s],l=a.x*o.y-o.x*a.y;r+=(a.x+o.x)*l,i+=(a.y+o.y)*l,t+=3*l}return new My(r/t,i/t,0,e)}l(ky,"findPoleOfInaccessibility"),l(Iy,"compareMax"),l(My,"Cell"),l(Py,"pointToPolygonDist"),l(Cy,"getCentroidCell");var zy=h(g(),1),By=Number.POSITIVE_INFINITY;function Vy(e,t){function r(e,t){let r=0,i=0;t<0&&(t=0);let n=t/Math.sqrt(2);switch(e){case"top-right":case"top-left":i=n-7;break;case"bottom-right":case"bottom-left":i=7-n;break;case"bottom":i=7-t;break;case"top":i=t-7}switch(e){case"top-right":case"bottom-right":r=-n;break;case"top-left":case"bottom-left":r=n;break;case"left":r=t;break;case"right":r=-t}return[r,i]}function i(e,t,r){let i=0,n=0;switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":n=r-7;break;case"bottom-right":case"bottom-left":case"bottom":n=7-r}switch(e){case"top-right":case"bottom-right":case"right":i=-t;break;case"top-left":case"bottom-left":case"left":i=t}return[i,n]}return l(r,"fromRadialOffset"),l(i,"fromTextOffset"),t[1]!==By?i(e,t[0],t[1]):r(e,t[0])}function Ey(e){e.bucket.createArrays();let t=512*e.bucket.overscaling;e.bucket.tilePixelRatio=8192/t,e.bucket.compareText={},e.bucket.iconsNeedLinear=!1;let r=e.bucket.layers[0].layout,i=e.bucket.layers[0]._unevaluatedLayout._values,n={layoutIconSize:i["icon-size"].possiblyEvaluate(new Za(e.bucket.zoom+1),e.canonical),layoutTextSize:i["text-size"].possiblyEvaluate(new Za(e.bucket.zoom+1),e.canonical),textMaxSize:i["text-size"].possiblyEvaluate(new Za(18))};if("composite"===e.bucket.textSizeData.kind){let{minZoom:t,maxZoom:r}=e.bucket.textSizeData;n.compositeTextSizes=[i["text-size"].possiblyEvaluate(new Za(t),e.canonical),i["text-size"].possiblyEvaluate(new Za(r),e.canonical)]}if("composite"===e.bucket.iconSizeData.kind){let{minZoom:t,maxZoom:r}=e.bucket.iconSizeData;n.compositeIconSizes=[i["icon-size"].possiblyEvaluate(new Za(t),e.canonical),i["icon-size"].possiblyEvaluate(new Za(r),e.canonical)]}let a=r.get("text-line-height")*vd,s="viewport"!==r.get("text-rotation-alignment")&&"point"!==r.get("symbol-placement"),o=r.get("text-keep-upright"),u=r.get("text-size");for(let t of e.bucket.features){let i=r.get("text-font").evaluate(t,{},e.canonical).join(","),c=u.evaluate(t,{},e.canonical),h=n.layoutTextSize.evaluate(t,{},e.canonical),p=n.layoutIconSize.evaluate(t,{},e.canonical),d={horizontal:{},vertical:void 0},f=t.text,y=[0,0];if(f){let n=f.toString(),u=r.get("text-letter-spacing").evaluate(t,{},e.canonical)*vd,p=Ia(n)?u:0,m=r.get("text-anchor").evaluate(t,{},e.canonical),g=r.get("text-variable-anchor");if(!g){let i=r.get("text-radial-offset").evaluate(t,{},e.canonical);y=i?Vy(m,[i*vd,By]):r.get("text-offset").evaluate(t,{},e.canonical).map((e=>e*vd))}let x=s?"center":r.get("text-justify").evaluate(t,{},e.canonical),v=r.get("symbol-placement"),b="point"===v?r.get("text-max-width").evaluate(t,{},e.canonical)*vd:0,w=l((()=>{e.bucket.allowVerticalPlacement&&ka(n)&&(d.vertical=Fd(f,e.glyphMap,e.glyphPositions,e.imagePositions,i,b,a,m,"left",p,y,2,!0,v,h,c))}),"addVerticalShapingForPointLabelIfNeeded");if(!s&&g){let t="auto"===x?g.map((e=>Fy(e))):[x],r=!1;for(let n=0;n<t.length;n++){let s=t[n];if(!d.horizontal[s])if(r)d.horizontal[s]=d.horizontal[0];else{let t=Fd(f,e.glyphMap,e.glyphPositions,e.imagePositions,i,b,a,"center",s,p,y,1,!1,v,h,c);t&&(d.horizontal[s]=t,r=1===t.positionedLines.length)}}w()}else{"auto"===x&&(x=Fy(m));let t=Fd(f,e.glyphMap,e.glyphPositions,e.imagePositions,i,b,a,m,x,p,y,1,!1,v,h,c);t&&(d.horizontal[x]=t),w(),ka(n)&&s&&o&&(d.vertical=Fd(f,e.glyphMap,e.glyphPositions,e.imagePositions,i,b,a,m,x,p,y,2,!1,v,h,c))}}let m,g=!1;if(t.icon&&t.icon.name){let i=e.imageMap[t.icon.name];i&&(m=Xd(e.imagePositions[t.icon.name],r.get("icon-offset").evaluate(t,{},e.canonical),r.get("icon-anchor").evaluate(t,{},e.canonical)),g=!!i.sdf,void 0===e.bucket.sdfIcons?e.bucket.sdfIcons=g:e.bucket.sdfIcons!==g&&q("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(i.pixelRatio!==e.bucket.pixelRatio||0!==r.get("icon-rotate").constantOr(1))&&(e.bucket.iconsNeedLinear=!0))}let x=Dy(d.horizontal)||d.vertical;e.bucket.iconsInText=!!x&&x.iconsInText,(x||m)&&Ty(e.bucket,t,d,m,e.imageMap,n,h,p,y,g,e.canonical)}e.showCollisionBoxes&&e.bucket.generateCollisionDebugBuffers()}function Fy(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Ty(e,t,r,i,n,a,s,o,u,c,h){let p=a.textMaxSize.evaluate(t,{});void 0===p&&(p=s);let d,f=e.layers[0].layout,y=f.get("icon-offset").evaluate(t,{},h),m=Dy(r.horizontal),g=s/24,x=e.tilePixelRatio*g,v=e.tilePixelRatio*p/24,b=e.tilePixelRatio*o,w=e.tilePixelRatio*f.get("symbol-spacing"),_=f.get("text-padding")*e.tilePixelRatio,S=Af(f,t,h,e.tilePixelRatio),A=f.get("text-max-angle")/180*Math.PI,k="viewport"!==f.get("text-rotation-alignment")&&"point"!==f.get("symbol-placement"),I="map"===f.get("icon-rotation-alignment")&&"point"!==f.get("symbol-placement"),M=f.get("symbol-placement"),P=w/2,C=f.get("icon-text-fit");i&&"none"!==C&&(e.allowVerticalPlacement&&r.vertical&&(d=Yd(i,r.vertical,C,f.get("icon-text-fit-padding"),y,g)),m&&(i=Yd(i,m,C,f.get("icon-text-fit-padding"),y,g)));let z=l(((o,l)=>{l.x<0||l.x>=8192||l.y<0||l.y>=8192||Oy(e,l,o,r,i,n,d,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,x,[_,_,_,_],k,u,b,S,I,y,t,a,c,h,s)}),"addSymbolAtAnchor");if("line"===M)for(let n of cy(t.geometry,0,0,8192,8192)){let t=oy(n,w,A,r.vertical||m,i,24,v,e.overscaling,8192);for(let r of t){let t=m;(!t||!Ry(e,t.text,P,r))&&z(n,r)}}else if("line-center"===M){for(let e of t.geometry)if(e.length>1){let t=sy(e,A,r.vertical||m,i,24,v);t&&z(e,t)}}else if("Polygon"===t.type)for(let e of rp(t.geometry,0)){let t=ky(e,16);z(e[0],new ty(t.x,t.y,0))}else if("LineString"===t.type)for(let e of t.geometry)z(e,new ty(e[0].x,e[0].y,0));else if("Point"===t.type)for(let e of t.geometry)for(let t of e)z([t],new ty(t.x,t.y,0))}function Ly(e,t,r,i,n,a,s,o,l,u,c,h,p,d,f){let y=gy(0,r,o,n,a,s,i,e.allowVerticalPlacement),m=e.textSizeData,g=null;"source"===m.kind?(g=[$d*n.layout.get("text-size").evaluate(s,{})],g[0]>Qd&&q("".concat(e.layerIds[0],': Value for "text-size" is >= ').concat(Wd,'. Reduce your "text-size".'))):"composite"===m.kind&&(g=[$d*d.compositeTextSizes[0].evaluate(s,{},f),$d*d.compositeTextSizes[1].evaluate(s,{},f)],(g[0]>Qd||g[1]>Qd)&&q("".concat(e.layerIds[0],': Value for "text-size" is >= ').concat(Wd,'. Reduce your "text-size".'))),e.addSymbols(e.text,y,g,o,a,s,u,t,l.lineStartIndex,l.lineLength,p,f);for(let t of c)h[t]=e.text.placedSymbolArray.length-1;return 4*y.length}function Dy(e){for(let t in e)return e[t];return null}function Oy(e,t,r,i,n,a,s,o,u,c,h,p,d,f,y,m,g,x,v,b,w,_,S,A,k){let I,M,P,C,z=e.addToLineVertexArray(t,r),B=0,V=0,E=0,F=0,T=-1,L=-1,D={},O=(0,zy.default)(""),R=0,U=0;if(void 0===o._unevaluatedLayout.getValue("text-radial-offset")?[R,U]=o.layout.get("text-offset").evaluate(w,{},A).map((e=>e*vd)):(R=o.layout.get("text-radial-offset").evaluate(w,{},A)*vd,U=By),e.allowVerticalPlacement&&i.vertical){let e=o.layout.get("text-rotate").evaluate(w,{},A)+90,r=i.vertical;P=new by(u,t,c,h,p,r,d,f,y,e),s&&(C=new by(u,t,c,h,p,s,g,x,y,e))}if(n){let r=o.layout.get("icon-rotate").evaluate(w,{}),i="none"!==o.layout.get("icon-text-fit"),a=py(n,r,S,i),l=s?py(s,r,S,i):void 0;M=new by(u,t,c,h,p,n,g,x,!1,r),B=4*a.length;let d=e.iconSizeData,f=null;"source"===d.kind?(f=[$d*o.layout.get("icon-size").evaluate(w,{})],f[0]>Qd&&q("".concat(e.layerIds[0],': Value for "icon-size" is >= ').concat(Wd,'. Reduce your "icon-size".'))):"composite"===d.kind&&(f=[$d*_.compositeIconSizes[0].evaluate(w,{},A),$d*_.compositeIconSizes[1].evaluate(w,{},A)],(f[0]>Qd||f[1]>Qd)&&q("".concat(e.layerIds[0],': Value for "icon-size" is >= ').concat(Wd,'. Reduce your "icon-size".'))),e.addSymbols(e.icon,a,f,b,v,w,0,t,z.lineStartIndex,z.lineLength,-1,A),T=e.icon.placedSymbolArray.length-1,l&&(V=4*l.length,e.addSymbols(e.icon,l,f,b,v,w,2,t,z.lineStartIndex,z.lineLength,-1,A),L=e.icon.placedSymbolArray.length-1)}let j=Object.keys(i.horizontal);for(let r of j){let n=i.horizontal[r];if(!I){O=(0,zy.default)(n.text);let e=o.layout.get("text-rotate").evaluate(w,{},A);I=new by(u,t,c,h,p,n,d,f,y,e)}let s=1===n.positionedLines.length;if(E+=Ly(e,t,n,a,o,y,w,m,z,i.vertical?1:3,s?j:[r],D,T,_,A),s)break}i.vertical&&(F+=Ly(e,t,i.vertical,a,o,y,w,m,z,2,["vertical"],D,L,_,A));let N=I?I.boxStartIndex:e.collisionBoxArray.length,Z=I?I.boxEndIndex:e.collisionBoxArray.length,J=P?P.boxStartIndex:e.collisionBoxArray.length,G=P?P.boxEndIndex:e.collisionBoxArray.length,K=M?M.boxStartIndex:e.collisionBoxArray.length,X=M?M.boxEndIndex:e.collisionBoxArray.length,Y=C?C.boxStartIndex:e.collisionBoxArray.length,H=C?C.boxEndIndex:e.collisionBoxArray.length,W=-1,$=l(((e,t)=>e&&e.circleDiameter?Math.max(e.circleDiameter,t):t),"getCollisionCircleHeight");W=$(I,W),W=$(P,W),W=$(M,W),W=$(C,W);let Q=W>-1?1:0;Q&&(W*=k/vd),e.glyphOffsetArray.length>=df.MAX_GLYPHS&&q("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==w.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,w.sortKey),e.symbolInstances.emplaceBack(t.x,t.y,D.right>=0?D.right:-1,D.center>=0?D.center:-1,D.left>=0?D.left:-1,D.vertical||-1,T,L,O,N,Z,J,G,K,X,Y,H,c,E,F,B,V,Q,0,d,R,U,W)}function Ry(e,t,r,i){let n=e.compareText;if(t in n){let e=n[t];for(let t=e.length-1;t>=0;t--)if(i.dist(e[t])<r)return!0}else n[t]=[];return n[t].push(i),!1}l(Vy,"evaluateVariableOffset"),l(Ey,"performSymbolLayout"),l(Fy,"getAnchorJustification"),l(Ty,"addFeature"),l(Ly,"addTextVertices"),l(Dy,"getDefaultHorizontalShaping"),l(Oy,"addSymbol"),l(Ry,"anchorIsTooClose"),p();var qy=class{constructor(e){let t={},r=[];for(let i in e){let n=e[i],a=t[i]={};for(let e in n){let t=n[+e];if(!t||0===t.bitmap.width||0===t.bitmap.height)continue;let i={x:0,y:0,w:t.bitmap.width+2,h:t.bitmap.height+2};r.push(i),a[e]={rect:i,metrics:t.metrics}}}let{w:i,h:n}=bd(r),a=new Lh({width:i||1,height:n||1});for(let r in e){let i=e[r];for(let e in i){let n=i[+e];if(!n||0===n.bitmap.width||0===n.bitmap.height)continue;let s=t[r][e].rect;Lh.copy(n.bitmap,a,{x:0,y:0},{x:s.x+1,y:s.y+1},n.bitmap)}}this.image=a,this.positions=t}};l(qy,"GlyphAtlas");var Uy=qy;function jy(e,t,r){var i=Ny(256*e,256*(t=Math.pow(2,r)-t-1),r),n=Ny(256*(e+1),256*(t+1),r);return i[0]+","+i[1]+","+n[0]+","+n[1]}function Ny(e,t,r){var i=2*Math.PI*6378137/256/Math.pow(2,r);return[e*i-2*Math.PI*6378137/2,t*i-2*Math.PI*6378137/2]}ra("GlyphAtlas",Uy),p(),p(),l(jy,"getTileBBox"),l(Ny,"getMercCoords");var Zy=h(d(),1);p(),p();var Jy=6371008.8,Gy=class e{constructor(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: (".concat(e,", ").concat(t,")"));if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new e(V(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return"LngLat(".concat(this.lng,", ").concat(this.lat,")")}distanceTo(e){let t=Math.PI/180,r=this.lat*t,i=e.lat*t,n=Math.sin(r)*Math.sin(i)+Math.cos(r)*Math.cos(i)*Math.cos((e.lng-this.lng)*t);return Jy*Math.acos(Math.min(n,1))}static convert(t){if(t instanceof e)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new e(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new e(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>]")}};l(Gy,"LngLat");var Ky=Gy,Xy=2*Math.PI*Jy;function Yy(e){return Xy*Math.cos(e*Math.PI/180)}function Hy(e){return(180+e)/360}function Wy(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function $y(e,t){return e/Yy(t)}function Qy(e){return 360*e-180}function em(e){let t=180-360*e;return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90}function tm(e,t){return e*Yy(em(t))}function rm(e){return 1/Math.cos(e*Math.PI/180)}l(Yy,"circumferenceAtLatitude"),l(Hy,"mercatorXfromLng"),l(Wy,"mercatorYfromLat"),l($y,"mercatorZfromAltitude"),l(Qy,"lngFromMercatorX"),l(em,"latFromMercatorY"),l(tm,"altitudeFromMercatorZ"),l(rm,"mercatorScale");var im=class e{constructor(e,t,r=0){this.x=+e,this.y=+t,this.z=+r}static fromLngLat(t,r=0){let i=Ky.convert(t);return new e(Hy(i.lng),Wy(i.lat),$y(r,i.lat))}toLngLat(){return new Ky(Qy(this.x),em(this.y))}toAltitude(){return tm(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Xy*rm(em(this.y))}};l(im,"MercatorCoordinate");var nm=im,am=class{constructor(e,t,r){if(e<0||e>25||r<0||r>=Math.pow(2,e)||t<0||t>=Math.pow(2,e))throw new Error("x=".concat(t,", y=").concat(r,", z=").concat(e," outside of bounds. 0<=x<").concat(Math.pow(2,e),", 0<=y<").concat(Math.pow(2,e)," 0<=z<=25 "));this.z=e,this.x=t,this.y=r,this.key=hm(0,e,e,t,r)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t,r){let i=jy(this.x,this.y,this.z),n=pm(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===r?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,t>1?"@2x":"").replace(/{quadkey}/g,n).replace(/{bbox-epsg-3857}/g,i)}isChildOf(e){let t=this.z-e.z;return t>0&&e.x===this.x>>t&&e.y===this.y>>t}getTilePoint(e){let t=Math.pow(2,this.z);return new Zy.default(8192*(e.x*t-this.x),8192*(e.y*t-this.y))}toString(){return"".concat(this.z,"/").concat(this.x,"/").concat(this.y)}};l(am,"CanonicalTileID");var sm=am,om=class{constructor(e,t){this.wrap=e,this.canonical=t,this.key=hm(e,t.z,t.z,t.x,t.y)}};l(om,"UnwrappedTileID");var lm=om,um=class e{constructor(e,t,r,i,n){if(e<r)throw new Error("overscaledZ should be >= z; overscaledZ = ".concat(e,"; z = ").concat(r));this.overscaledZ=e,this.wrap=t,this.canonical=new sm(r,+i,+n),this.key=hm(t,e,r,i,n)}clone(){return new e(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error("targetZ > this.overscaledZ; targetZ = ".concat(t,"; overscaledZ = ").concat(this.overscaledZ));let r=this.canonical.z-t;return t>this.canonical.z?new e(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new e(t,this.wrap,t,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,t){if(e>this.overscaledZ)throw new Error("targetZ > this.overscaledZ; targetZ = ".concat(e,"; overscaledZ = ").concat(this.overscaledZ));let r=this.canonical.z-e;return e>this.canonical.z?hm(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):hm(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)}isChildOf(e){if(e.wrap!==this.wrap)return!1;let t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(t){if(this.overscaledZ>=t)return[new e(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,i=2*this.canonical.x,n=2*this.canonical.y;return[new e(r,this.wrap,r,i,n),new e(r,this.wrap,r,i+1,n),new e(r,this.wrap,r,i,n+1),new e(r,this.wrap,r,i+1,n+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new e(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new e(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new lm(this.wrap,this.canonical)}toString(){return"".concat(this.overscaledZ,"/").concat(this.canonical.x,"/").concat(this.canonical.y)}getTilePoint(e){return this.canonical.getTilePoint(new nm(e.x-this.wrap,e.y))}};l(um,"OverscaledTileID");var cm=um;function hm(e,t,r,i,n){(e*=2)<0&&(e=-1*e-1);let a=1<<r;return(a*a*e+a*n+i).toString(36)+r.toString(36)+t.toString(36)}function pm(e,t,r){let i,n="";for(let a=e;a>0;a--)i=1<<a-1,n+=(t&i?1:0)+(r&i?2:0);return n}l(hm,"calculateKey"),l(pm,"getQuadkey"),ra("CanonicalTileID",sm),ra("OverscaledTileID",cm,{omit:["posMatrix"]});var dm=class{constructor(e){this.tileID=new cm(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.inFlightDependencies=[],this.dependencySentinel=-1}parse(e,t,r,i,n){this.status="parsing",this.data=e,this.collisionBoxArray=new ko;let a=new Nf(Object.keys(e.layers).sort()),s=new Yf(this.tileID,this.promoteId);s.bucketLayerIDs=[];let o={},u={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:r},c=t.familiesBySource[this.source];for(let t in c){let i=e.layers[t];if(!i)continue;1===i.version&&q('Vector tile source "'.concat(this.source,'" layer "').concat(t,'" ')+"does not use vector tile spec v2 and therefore may have some rendering errors.");let n=a.encode(t),l=[];for(let e=0;e<i.length;e++){let r=i.feature(e),a=s.getId(r,t);l.push({feature:r,id:a,index:e,sourceLayerIndex:n})}for(let e of c[t]){let t=e[0];(t.source!==this.source&&q("layer.source = ".concat(t.source," does not equal this.source = ").concat(this.source)),t.minzoom&&this.zoom<Math.floor(t.minzoom)||t.maxzoom&&this.zoom>=t.maxzoom||"none"===t.visibility)||(ym(e,this.zoom,r),(o[t.id]=t.createBucket({index:s.bucketLayerIDs.length,layers:e,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:n,sourceID:this.source})).populate(l,u,this.tileID.canonical),s.bucketLayerIDs.push(e.map((e=>e.id))))}}let h,p,d,f,y=T(u.glyphDependencies,(e=>Object.keys(e).map(Number)));this.inFlightDependencies.forEach((e=>null==e?void 0:e.cancel())),this.inFlightDependencies=[];let m=++this.dependencySentinel;Object.keys(y).length?this.inFlightDependencies.push(i.send("getGlyphs",{uid:this.uid,stacks:y,source:this.source,tileID:this.tileID,type:"glyphs"},((e,t)=>{m===this.dependencySentinel&&(h||(h=e,p=t,v.call(this)))}))):p={};let g=Object.keys(u.iconDependencies);g.length?this.inFlightDependencies.push(i.send("getImages",{icons:g,source:this.source,tileID:this.tileID,type:"icons"},((e,t)=>{m===this.dependencySentinel&&(h||(h=e,d=t,v.call(this)))}))):d={};let x=Object.keys(u.patternDependencies);function v(){if(h)return n(h);if(p&&d&&f){let e=new Uy(p),t=new Ad(d,f);for(let i in o){let n=o[i];n instanceof df?(ym(n.layers,this.zoom,r),Ey({bucket:n,glyphMap:p,glyphPositions:e.positions,imageMap:d,imagePositions:t.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):n.hasPattern&&(n instanceof Wp||n instanceof op||n instanceof kp)&&(ym(n.layers,this.zoom,r),n.addFeatures(u,this.tileID.canonical,t.patternPositions))}this.status="done",n(null,{buckets:Object.values(o).filter((e=>!e.isEmpty())),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:t,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?d:null,glyphPositions:this.returnDependencies?e.positions:null})}}x.length?this.inFlightDependencies.push(i.send("getImages",{icons:x,source:this.source,tileID:this.tileID,type:"patterns"},((e,t)=>{m===this.dependencySentinel&&(h||(h=e,f=t,v.call(this)))}))):f={},v.call(this),l(v,"maybePrepare")}};l(dm,"WorkerTile");var fm=dm;function ym(e,t,r){let i=new Za(t);for(let t of e)t.recalculate(i,r)}l(ym,"recalculateLayers"),p();var mm=class{constructor(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let e=performance.getEntriesByName(this._marks.measure);return 0===e.length&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),e=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),e}};l(mm,"RequestPerformance");var gm=mm;function xm(e,t){let r=ea(e.request,((e,r,i,n)=>{e?t(e):r&&t(null,{vectorTile:new qf.default.VectorTile(new Uf.default(r)),rawData:r,cacheControl:i,expires:n})}));return()=>{r.cancel(),t()}}l(xm,"loadVectorTile");var vm=class{constructor(e,t,r,i){this.actor=e,this.layerIndex=t,this.availableImages=r,this.loadVectorData=i||xm,this.loading={},this.loaded={}}loadTile(e,t){let r=e.uid;this.loading||(this.loading={});let i=!!(e&&e.request&&e.request.collectResourceTiming)&&new gm(e.request),n=this.loading[r]=new fm(e);n.abort=this.loadVectorData(e,((e,a)=>{if(delete this.loading[r],e||!a)return n.status="done",this.loaded[r]=n,t(e);let s=a.rawData,o={};a.expires&&(o.expires=a.expires),a.cacheControl&&(o.cacheControl=a.cacheControl);let l={};if(i){let e=i.finish();e&&(l.resourceTiming=JSON.parse(JSON.stringify(e)))}n.vectorTile=a.vectorTile,n.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,((e,r)=>{if(e||!r)return t(e);t(null,E({rawTileData:s.slice(0)},r,o,l))})),this.loaded=this.loaded||{},this.loaded[r]=n}))}reloadTile(e,t){let r=this.loaded,i=e.uid;if(r&&r[i]){let n=r[i];n.showCollisionBoxes=e.showCollisionBoxes,"parsing"===n.status?n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor,t):"done"===n.status&&(n.vectorTile?n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor,t):t())}}abortTile(e,t){let r=this.loading,i=e.uid;r&&r[i]&&r[i].abort&&(r[i].abort(),delete r[i]),t()}removeTile(e,t){let r=this.loaded,i=e.uid;r&&r[i]&&delete r[i],t()}};l(vm,"VectorTileWorkerSource");var bm=vm;p(),p();var wm=class{constructor(e,t,r){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return void q('"'.concat(r,'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".'));this.stride=t.height;let i=this.dim=t.height-2;this.data=new Uint32Array(t.data.buffer),this.encoding=r||"mapbox";for(let e=0;e<i;e++)this.data[this._idx(-1,e)]=this.data[this._idx(0,e)],this.data[this._idx(i,e)]=this.data[this._idx(i-1,e)],this.data[this._idx(e,-1)]=this.data[this._idx(e,0)],this.data[this._idx(e,i)]=this.data[this._idx(e,i-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(i,-1)]=this.data[this._idx(i-1,0)],this.data[this._idx(-1,i)]=this.data[this._idx(0,i-1)],this.data[this._idx(i,i)]=this.data[this._idx(i-1,i-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let e=0;e<i;e++)for(let t=0;t<i;t++){let r=this.get(e,t);r>this.max&&(this.max=r),r<this.min&&(this.min=r)}}get(e,t){let r=new Uint8Array(this.data.buffer),i=4*this._idx(e,t);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(r[i],r[i+1],r[i+2])}getUnpackVector(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]}_idx(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}_unpackMapbox(e,t,r){return(256*e*256+256*t+r)/10-1e4}_unpackTerrarium(e,t,r){return 256*e+t+r/256-32768}getPixels(){return new Oh({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let i=t*this.dim,n=t*this.dim+this.dim,a=r*this.dim,s=r*this.dim+this.dim;switch(t){case-1:i=n-1;break;case 1:n=i+1}switch(r){case-1:a=s-1;break;case 1:s=a+1}let o=-t*this.dim,l=-r*this.dim;for(let t=a;t<s;t++)for(let r=i;r<n;r++)this.data[this._idx(r,t)]=e.data[this._idx(r+o,t+l)]}};l(wm,"DEMData");var _m=wm;ra("DEMData",_m);var Sm=class{constructor(){this.loaded={}}loadTile(e,t){let{uid:r,encoding:i,rawImageData:n}=e,a=G(n)?this.getImageData(n):n,s=new _m(r,a,i);this.loaded=this.loaded||{},this.loaded[r]=s,t(null,s)}getImageData(e){(!this.offscreenCanvas||!this.offscreenCanvasContext)&&(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);let t=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new Oh({width:t.width,height:t.height},t.data)}removeTile(e){let t=this.loaded,r=e.uid;t&&t[r]&&delete t[r]}};l(Sm,"RasterDEMTileWorkerSource");var Am=Sm;p();var km=h(k(),1);p();var Im=h(d(),1),Mm=h(_(),1).default.VectorTileFeature.prototype.toGeoJSON,Pm=class{constructor(e){this._feature=e,this.extent=8192,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))}loadGeometry(){if(1===this._feature.type){let e=[];for(let t of this._feature.geometry)e.push([new Im.default(t[0],t[1])]);return e}{let e=[];for(let t of this._feature.geometry){let r=[];for(let e of t)r.push(new Im.default(e[0],e[1]));e.push(r)}return e}}toGeoJSON(e,t,r){return Mm.call(this,e,t,r)}};l(Pm,"FeatureWrapper");var Cm=Pm,zm=class{constructor(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=8192,this.length=e.length,this._features=e}feature(e){return new Cm(this._features[e])}};l(zm,"GeoJSONWrapper");var Bm=zm,Vm=h(M(),1);p(),p();var Em=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Fm=class e{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[r,i]=new Uint8Array(t,0,2);if(219!==r)throw new Error("Data does not appear to be in a KDBush format.");let n=i>>4;if(1!==n)throw new Error("Got v".concat(n," data when expected v").concat(1,"."));let a=Em[15&i];if(!a)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[o]=new Uint32Array(t,4,1);return new e(o,s,a,t)}constructor(e,t=64,r=Float64Array,i){if(isNaN(e)||e<0)throw new Error("Unpexpected numItems value: ".concat(e,"."));this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let n=Em.indexOf(this.ArrayType),a=2*e*this.ArrayType.BYTES_PER_ELEMENT,s=e*this.IndexArrayType.BYTES_PER_ELEMENT,o=(8-s%8)%8;if(n<0)throw new Error("Unexpected typed array class: ".concat(r,"."));i&&i instanceof ArrayBuffer?(this.data=i,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+s+o,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+a+s+o),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+s+o,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+n]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){let r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){let e=this._pos>>1;if(e!==this.numItems)throw new Error("Added ".concat(e," items when expected ").concat(this.numItems,"."));return Lm(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,r,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:n,coords:a,nodeSize:s}=this,o=[0,n.length-1,0],l=[];for(;o.length;){let u=o.pop()||0,c=o.pop()||0,h=o.pop()||0;if(c-h<=s){for(let s=h;s<=c;s++){let o=a[2*s],u=a[2*s+1];o>=e&&o<=r&&u>=t&&u<=i&&l.push(n[s])}continue}let p=h+c>>1,d=a[2*p],f=a[2*p+1];d>=e&&d<=r&&f>=t&&f<=i&&l.push(n[p]),(0===u?e<=d:t<=f)&&(o.push(h),o.push(p-1),o.push(1-u)),(0===u?r>=d:i>=f)&&(o.push(p+1),o.push(c),o.push(1-u))}return l}within(e,t,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:i,coords:n,nodeSize:a}=this,s=[0,i.length-1,0],o=[],l=r*r;for(;s.length;){let u=s.pop()||0,c=s.pop()||0,h=s.pop()||0;if(c-h<=a){for(let r=h;r<=c;r++)qm(n[2*r],n[2*r+1],e,t)<=l&&o.push(i[r]);continue}let p=h+c>>1,d=n[2*p],f=n[2*p+1];qm(d,f,e,t)<=l&&o.push(i[p]),(0===u?e-r<=d:t-r<=f)&&(s.push(h),s.push(p-1),s.push(1-u)),(0===u?e+r>=d:t+r>=f)&&(s.push(p+1),s.push(c),s.push(1-u))}return o}};l(Fm,"KDBush");var Tm=Fm;function Lm(e,t,r,i,n,a){if(n-i<=r)return;let s=i+n>>1;Dm(e,t,s,i,n,a),Lm(e,t,r,i,s-1,1-a),Lm(e,t,r,s+1,n,1-a)}function Dm(e,t,r,i,n,a){for(;n>i;){if(n-i>600){let s=n-i+1,o=r-i+1,l=Math.log(s),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(s-u)/s)*(o-s/2<0?-1:1);Dm(e,t,r,Math.max(i,Math.floor(r-o*u/s+c)),Math.min(n,Math.floor(r+(s-o)*u/s+c)),a)}let s=t[2*r+a],o=i,l=n;for(Om(e,t,i,r),t[2*n+a]>s&&Om(e,t,i,n);o<l;){for(Om(e,t,o,l),o++,l--;t[2*o+a]<s;)o++;for(;t[2*l+a]>s;)l--}t[2*i+a]===s?Om(e,t,i,l):(l++,Om(e,t,l,n)),l<=r&&(i=l+1),r<=l&&(n=l-1)}}function Om(e,t,r,i){Rm(e,r,i),Rm(t,2*r,2*i),Rm(t,2*r+1,2*i+1)}function Rm(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}function qm(e,t,r,i){let n=e-r,a=t-i;return n*n+a*a}l(Lm,"sort"),l(Dm,"select"),l(Om,"swapItem"),l(Rm,"swap"),l(qm,"sqDist");var Um={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:l((e=>e),"map")},jm=Math.fround||(e=>t=>(e[0]=+t,e[0]))(new Float32Array(1)),Nm=class{constructor(e){this.options=Object.assign(Object.create(Um),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){let{log:t,minZoom:r,maxZoom:i}=this.options;t&&console.time("total time");let n="prepare ".concat(e.length," points");t&&console.time(n),this.points=e;let a=[];for(let t=0;t<e.length;t++){let r=e[t];if(!r.geometry)continue;let[i,n]=r.geometry.coordinates,s=jm(Km(i)),o=jm(Xm(n));a.push(s,o,1/0,t,-1,1),this.options.reduce&&a.push(0)}let s=this.trees[i+1]=this._createTree(a);t&&console.timeEnd(n);for(let e=i;e>=r;e--){let r=+Date.now();s=this.trees[e]=this._createTree(this._cluster(s,e)),t&&console.log("z%d: %d clusters in %dms",e,s.numItems,+Date.now()-r)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let r=((e[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,e[1])),n=180===e[2]?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,n=180;else if(r>n){let e=this.getClusters([r,i,180,a],t),s=this.getClusters([-180,i,n,a],t);return e.concat(s)}let s=this.trees[this._limitZoom(t)],o=s.range(Km(r),Xm(a),Km(n),Xm(i)),l=s.data,u=[];for(let e of o){let t=this.stride*e;u.push(l[t+5]>1?Jm(l,t,this.clusterProps):this.points[l[t+3]])}return u}getChildren(e){let t=this._getOriginId(e),r=this._getOriginZoom(e),i="No cluster with the specified id.",n=this.trees[r];if(!n)throw new Error(i);let a=n.data;if(t*this.stride>=a.length)throw new Error(i);let s=this.options.radius/(this.options.extent*Math.pow(2,r-1)),o=a[t*this.stride],l=a[t*this.stride+1],u=n.within(o,l,s),c=[];for(let t of u){let r=t*this.stride;a[r+4]===e&&c.push(a[r+5]>1?Jm(a,r,this.clusterProps):this.points[a[r+3]])}if(0===c.length)throw new Error(i);return c}getLeaves(e,t,r){t=t||10,r=r||0;let i=[];return this._appendLeaves(i,e,t,r,0),i}getTile(e,t,r){let i=this.trees[this._limitZoom(e)],n=Math.pow(2,e),{extent:a,radius:s}=this.options,o=s/a,l=(r-o)/n,u=(r+1+o)/n,c={features:[]};return this._addTileFeatures(i.range((t-o)/n,l,(t+1+o)/n,u),i.data,t,r,n,c),0===t&&this._addTileFeatures(i.range(1-o/n,l,1,u),i.data,n,r,n,c),t===n-1&&this._addTileFeatures(i.range(0,l,o/n,u),i.data,-1,r,n,c),c.features.length?c:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){let r=this.getChildren(e);if(t++,1!==r.length)break;e=r[0].properties.cluster_id}return t}_appendLeaves(e,t,r,i,n){let a=this.getChildren(t);for(let t of a){let a=t.properties;if(a&&a.cluster?n+a.point_count<=i?n+=a.point_count:n=this._appendLeaves(e,a.cluster_id,r,i,n):n<i?n++:e.push(t),e.length===r)break}return n}_createTree(e){let t=new Tm(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<e.length;r+=this.stride)t.add(e[r],e[r+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,r,i,n,a){for(let s of e){let e,o,l,u=s*this.stride,c=t[u+5]>1;if(c)e=Gm(t,u,this.clusterProps),o=t[u],l=t[u+1];else{let r=this.points[t[u+3]];e=r.properties;let[i,n]=r.geometry.coordinates;o=Km(i),l=Xm(n)}let h,p={type:1,geometry:[[Math.round(this.options.extent*(o*n-r)),Math.round(this.options.extent*(l*n-i))]],tags:e};h=c||this.options.generateId?t[u+3]:this.points[t[u+3]].id,void 0!==h&&(p.id=h),a.features.push(p)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){let{radius:r,extent:i,reduce:n,minPoints:a}=this.options,s=r/(i*Math.pow(2,t)),o=e.data,l=[],u=this.stride;for(let r=0;r<o.length;r+=u){if(o[r+2]<=t)continue;o[r+2]=t;let i=o[r],c=o[r+1],h=e.within(o[r],o[r+1],s),p=o[r+5],d=p;for(let e of h){let r=e*u;o[r+2]>t&&(d+=o[r+5])}if(d>p&&d>=a){let e,a=i*p,s=c*p,f=-1,y=((r/u|0)<<5)+(t+1)+this.points.length;for(let i of h){let l=i*u;if(o[l+2]<=t)continue;o[l+2]=t;let c=o[l+5];a+=o[l]*c,s+=o[l+1]*c,o[l+4]=y,n&&(e||(e=this._map(o,r,!0),f=this.clusterProps.length,this.clusterProps.push(e)),n(e,this._map(o,l)))}o[r+4]=y,l.push(a/d,s/d,1/0,y,-1,d),n&&l.push(f)}else{for(let e=0;e<u;e++)l.push(o[r+e]);if(d>1)for(let e of h){let r=e*u;if(!(o[r+2]<=t)){o[r+2]=t;for(let e=0;e<u;e++)l.push(o[r+e])}}}}return l}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+5]>1){let i=this.clusterProps[e[t+6]];return r?Object.assign({},i):i}let i=this.points[e[t+3]].properties,n=this.options.map(i);return r&&n===i?Object.assign({},n):n}};l(Nm,"Supercluster");var Zm=Nm;function Jm(e,t,r){return{type:"Feature",id:e[t+3],properties:Gm(e,t,r),geometry:{type:"Point",coordinates:[Ym(e[t]),Hm(e[t+1])]}}}function Gm(e,t,r){let i=e[t+5],n=i>=1e4?"".concat(Math.round(i/1e3),"k"):i>=1e3?"".concat(Math.round(i/100)/10,"k"):i,a=e[t+6],s=-1===a?{}:Object.assign({},r[a]);return Object.assign(s,{cluster:!0,cluster_id:e[t+3],point_count:i,point_count_abbreviated:n})}function Km(e){return e/360+.5}function Xm(e){let t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function Ym(e){return 360*(e-.5)}function Hm(e){let t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function Wm(e,t,r,i){for(var n,a=i,s=r-t>>1,o=r-t,l=e[t],u=e[t+1],c=e[r],h=e[r+1],p=t+3;p<r;p+=3){var d=$m(e[p],e[p+1],l,u,c,h);if(d>a)n=p,a=d;else if(d===a){var f=Math.abs(p-s);f<o&&(n=p,o=f)}}a>i&&(n-t>3&&Wm(e,t,n,i),e[n+2]=a,r-n>3&&Wm(e,n,r,i))}function $m(e,t,r,i,n,a){var s=n-r,o=a-i;if(0!==s||0!==o){var l=((e-r)*s+(t-i)*o)/(s*s+o*o);l>1?(r=n,i=a):l>0&&(r+=s*l,i+=o*l)}return(s=e-r)*s+(o=t-i)*o}function Qm(e,t,r,i){var n={id:typeof e>"u"?null:e,type:t,geometry:r,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return eg(n),n}function eg(e){var t=e.geometry,r=e.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)tg(e,t);else if("Polygon"===r||"MultiLineString"===r)for(var i=0;i<t.length;i++)tg(e,t[i]);else if("MultiPolygon"===r)for(i=0;i<t.length;i++)for(var n=0;n<t[i].length;n++)tg(e,t[i][n])}function tg(e,t){for(var r=0;r<t.length;r+=3)e.minX=Math.min(e.minX,t[r]),e.minY=Math.min(e.minY,t[r+1]),e.maxX=Math.max(e.maxX,t[r]),e.maxY=Math.max(e.maxY,t[r+1])}function rg(e,t){var r=[];if("FeatureCollection"===e.type)for(var i=0;i<e.features.length;i++)ig(r,e.features[i],t,i);else"Feature"===e.type?ig(r,e,t):ig(r,{geometry:e},t);return r}function ig(e,t,r,i){if(t.geometry){var n=t.geometry.coordinates,a=t.geometry.type,s=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),o=[],l=t.id;if(r.promoteId?l=t.properties[r.promoteId]:r.generateId&&(l=i||0),"Point"===a)ng(n,o);else if("MultiPoint"===a)for(var u=0;u<n.length;u++)ng(n[u],o);else if("LineString"===a)ag(n,o,s,!1);else if("MultiLineString"===a){if(r.lineMetrics){for(u=0;u<n.length;u++)o=[],ag(n[u],o,s,!1),e.push(Qm(l,"LineString",o,t.properties));return}sg(n,o,s,!1)}else if("Polygon"===a)sg(n,o,s,!0);else{if("MultiPolygon"!==a){if("GeometryCollection"===a){for(u=0;u<t.geometry.geometries.length;u++)ig(e,{id:l,geometry:t.geometry.geometries[u],properties:t.properties},r,i);return}throw new Error("Input data is not a valid GeoJSON object.")}for(u=0;u<n.length;u++){var c=[];sg(n[u],c,s,!0),o.push(c)}}e.push(Qm(l,a,o,t.properties))}}function ng(e,t){t.push(og(e[0])),t.push(lg(e[1])),t.push(0)}function ag(e,t,r,i){for(var n,a,s=0,o=0;o<e.length;o++){var l=og(e[o][0]),u=lg(e[o][1]);t.push(l),t.push(u),t.push(0),o>0&&(s+=i?(n*u-l*a)/2:Math.sqrt(Math.pow(l-n,2)+Math.pow(u-a,2))),n=l,a=u}var c=t.length-3;t[2]=1,Wm(t,0,c,r),t[c+2]=1,t.size=Math.abs(s),t.start=0,t.end=t.size}function sg(e,t,r,i){for(var n=0;n<e.length;n++){var a=[];ag(e[n],a,r,i),t.push(a)}}function og(e){return e/360+.5}function lg(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function ug(e,t,r,i,n,a,s,o){if(i/=t,a>=(r/=t)&&s<i)return e;if(s<r||a>=i)return null;for(var l=[],u=0;u<e.length;u++){var c=e[u],h=c.geometry,p=c.type,d=0===n?c.minX:c.minY,f=0===n?c.maxX:c.maxY;if(d>=r&&f<i)l.push(c);else if(!(f<r||d>=i)){var y=[];if("Point"===p||"MultiPoint"===p)cg(h,y,r,i,n);else if("LineString"===p)hg(h,y,r,i,n,!1,o.lineMetrics);else if("MultiLineString"===p)dg(h,y,r,i,n,!1);else if("Polygon"===p)dg(h,y,r,i,n,!0);else if("MultiPolygon"===p)for(var m=0;m<h.length;m++){var g=[];dg(h[m],g,r,i,n,!0),g.length&&y.push(g)}if(y.length){if(o.lineMetrics&&"LineString"===p){for(m=0;m<y.length;m++)l.push(Qm(c.id,p,y[m],c.tags));continue}("LineString"===p||"MultiLineString"===p)&&(1===y.length?(p="LineString",y=y[0]):p="MultiLineString"),("Point"===p||"MultiPoint"===p)&&(p=3===y.length?"Point":"MultiPoint"),l.push(Qm(c.id,p,y,c.tags))}}}return l.length?l:null}function cg(e,t,r,i,n){for(var a=0;a<e.length;a+=3){var s=e[a+n];s>=r&&s<=i&&(t.push(e[a]),t.push(e[a+1]),t.push(e[a+2]))}}function hg(e,t,r,i,n,a,s){for(var o,l,u=pg(e),c=0===n?yg:mg,h=e.start,p=0;p<e.length-3;p+=3){var d=e[p],f=e[p+1],y=e[p+2],m=e[p+3],g=e[p+4],x=0===n?d:f,v=0===n?m:g,b=!1;s&&(o=Math.sqrt(Math.pow(d-m,2)+Math.pow(f-g,2))),x<r?v>r&&(l=c(u,d,f,m,g,r),s&&(u.start=h+o*l)):x>i?v<i&&(l=c(u,d,f,m,g,i),s&&(u.start=h+o*l)):fg(u,d,f,y),v<r&&x>=r&&(l=c(u,d,f,m,g,r),b=!0),v>i&&x<=i&&(l=c(u,d,f,m,g,i),b=!0),!a&&b&&(s&&(u.end=h+o*l),t.push(u),u=pg(e)),s&&(h+=o)}var w=e.length-3;d=e[w],f=e[w+1],y=e[w+2],(x=0===n?d:f)>=r&&x<=i&&fg(u,d,f,y),w=u.length-3,a&&w>=3&&(u[w]!==u[0]||u[w+1]!==u[1])&&fg(u,u[0],u[1],u[2]),u.length&&t.push(u)}function pg(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function dg(e,t,r,i,n,a){for(var s=0;s<e.length;s++)hg(e[s],t,r,i,n,a,!1)}function fg(e,t,r,i){e.push(t),e.push(r),e.push(i)}function yg(e,t,r,i,n,a){var s=(a-t)/(i-t);return e.push(a),e.push(r+(n-r)*s),e.push(1),s}function mg(e,t,r,i,n,a){var s=(a-r)/(n-r);return e.push(t+(i-t)*s),e.push(a),e.push(1),s}function gg(e,t){var r=t.buffer/t.extent,i=e,n=ug(e,1,-1-r,r,0,-1,2,t),a=ug(e,1,1-r,2+r,0,-1,2,t);return(n||a)&&(i=ug(e,1,-r,1+r,0,-1,2,t)||[],n&&(i=xg(n,1).concat(i)),a&&(i=i.concat(xg(a,-1)))),i}function xg(e,t){for(var r=[],i=0;i<e.length;i++){var n,a=e[i],s=a.type;if("Point"===s||"MultiPoint"===s||"LineString"===s)n=vg(a.geometry,t);else if("MultiLineString"===s||"Polygon"===s){n=[];for(var o=0;o<a.geometry.length;o++)n.push(vg(a.geometry[o],t))}else if("MultiPolygon"===s)for(n=[],o=0;o<a.geometry.length;o++){for(var l=[],u=0;u<a.geometry[o].length;u++)l.push(vg(a.geometry[o][u],t));n.push(l)}r.push(Qm(a.id,s,n,a.tags))}return r}function vg(e,t){var r=[];r.size=e.size,void 0!==e.start&&(r.start=e.start,r.end=e.end);for(var i=0;i<e.length;i+=3)r.push(e[i]+t,e[i+1],e[i+2]);return r}function bg(e,t){if(e.transformed)return e;var r,i,n,a=1<<e.z,s=e.x,o=e.y;for(r=0;r<e.features.length;r++){var l=e.features[r],u=l.geometry,c=l.type;if(l.geometry=[],1===c)for(i=0;i<u.length;i+=2)l.geometry.push(wg(u[i],u[i+1],t,a,s,o));else for(i=0;i<u.length;i++){var h=[];for(n=0;n<u[i].length;n+=2)h.push(wg(u[i][n],u[i][n+1],t,a,s,o));l.geometry.push(h)}}return e.transformed=!0,e}function wg(e,t,r,i,n,a){return[Math.round(r*(e*i-n)),Math.round(r*(t*i-a))]}function _g(e,t,r,i,n){for(var a=t===n.maxZoom?0:n.tolerance/((1<<t)*n.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:i,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},o=0;o<e.length;o++){s.numFeatures++,Sg(s,e[o],a,n);var l=e[o].minX,u=e[o].minY,c=e[o].maxX,h=e[o].maxY;l<s.minX&&(s.minX=l),u<s.minY&&(s.minY=u),c>s.maxX&&(s.maxX=c),h>s.maxY&&(s.maxY=h)}return s}function Sg(e,t,r,i){var n=t.geometry,a=t.type,s=[];if("Point"===a||"MultiPoint"===a)for(var o=0;o<n.length;o+=3)s.push(n[o]),s.push(n[o+1]),e.numPoints++,e.numSimplified++;else if("LineString"===a)Ag(s,n,e,r,!1,!1);else if("MultiLineString"===a||"Polygon"===a)for(o=0;o<n.length;o++)Ag(s,n[o],e,r,"Polygon"===a,0===o);else if("MultiPolygon"===a)for(var l=0;l<n.length;l++){var u=n[l];for(o=0;o<u.length;o++)Ag(s,u[o],e,r,!0,0===o)}if(s.length){var c=t.tags||null;if("LineString"===a&&i.lineMetrics){for(var h in c={},t.tags)c[h]=t.tags[h];c.mapbox_clip_start=n.start/n.size,c.mapbox_clip_end=n.end/n.size}var p={geometry:s,type:"Polygon"===a||"MultiPolygon"===a?3:"LineString"===a||"MultiLineString"===a?2:1,tags:c};null!==t.id&&(p.id=t.id),e.features.push(p)}}function Ag(e,t,r,i,n,a){var s=i*i;if(i>0&&t.size<(n?s:i))r.numPoints+=t.length/3;else{for(var o=[],l=0;l<t.length;l+=3)(0===i||t[l+2]>s)&&(r.numSimplified++,o.push(t[l]),o.push(t[l+1])),r.numPoints++;n&&kg(o,a),e.push(o)}}function kg(e,t){for(var r=0,i=0,n=e.length,a=n-2;i<n;a=i,i+=2)r+=(e[i]-e[a])*(e[i+1]+e[a+1]);if(r>0===t)for(i=0,n=e.length;i<n/2;i+=2){var s=e[i],o=e[i+1];e[i]=e[n-2-i],e[i+1]=e[n-1-i],e[n-2-i]=s,e[n-1-i]=o}}function Ig(e,t){return new Mg(e,t)}function Mg(e,t){var r=(t=this.options=Cg(Object.create(this.options),t)).debug;if(r&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var i=rg(e,t);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(i=gg(i,t)).length&&this.splitTile(i,0,0,0),r&&(i.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 Pg(e,t,r){return 32*((1<<e)*r+t)+e}function Cg(e,t){for(var r in t)e[r]=t[r];return e}function zg(e,t){return t?e.properties[t]:e.id}function Bg(e,t){if(null==e)return!0;if("Feature"===e.type)return null!=zg(e,t);if("FeatureCollection"===e.type){let r=new Set;for(let i of e.features){let e=zg(i,t);if(null==e||r.has(e))return!1;r.add(e)}return!0}return!1}function Vg(e,t){let r=new Map;if(null!=e)if("Feature"===e.type)r.set(zg(e,t),e);else for(let i of e.features)r.set(zg(i,t),i);return r}function Eg(e,t,r){var i,n,a,s;if(t.removeAll&&e.clear(),t.remove)for(let r of t.remove)e.delete(r);if(t.add)for(let i of t.add){let t=zg(i,r);null!=t&&e.set(t,i)}if(t.update)for(let r of t.update){let t=e.get(r.id);if(null==t)continue;let o=r.newGeometry||r.removeAllProperties,l=!r.removeAllProperties&&((null==(i=r.removeProperties)?void 0:i.length)>0||(null==(n=r.addOrUpdateProperties)?void 0:n.length)>0);if((o||l)&&(t={...t},e.set(r.id,t),l&&(t.properties={...t.properties})),r.newGeometry&&(t.geometry=r.newGeometry),r.removeAllProperties)t.properties={};else if((null==(a=r.removeProperties)?void 0:a.length)>0)for(let e of r.removeProperties)Object.prototype.hasOwnProperty.call(t.properties,e)&&delete t.properties[e];if((null==(s=r.addOrUpdateProperties)?void 0:s.length)>0)for(let{key:e,value:i}of r.addOrUpdateProperties)t.properties[e]=i}}function Fg(e,t){let r=e.tileID.canonical;if(!this._geoJSONIndex)return t(null,null);let i=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!i)return t(null,null);let n=new Bm(i.features),a=(0,Vm.default)(n);(0!==a.byteOffset||a.byteLength!==a.buffer.byteLength)&&(a=new Uint8Array(a)),t(null,{vectorTile:n,rawData:a.buffer})}l(Jm,"getClusterJSON"),l(Gm,"getClusterProperties"),l(Km,"lngX"),l(Xm,"latY"),l(Ym,"xLng"),l(Hm,"yLat"),p(),p(),p(),l(Wm,"simplify"),l($m,"getSqSegDist"),p(),l(Qm,"createFeature"),l(eg,"calcBBox"),l(tg,"calcLineBBox"),l(rg,"convert"),l(ig,"convertFeature"),l(ng,"convertPoint"),l(ag,"convertLine"),l(sg,"convertLines"),l(og,"projectX"),l(lg,"projectY"),p(),l(ug,"clip"),l(cg,"clipPoints"),l(hg,"clipLine"),l(pg,"newSlice"),l(dg,"clipLines"),l(fg,"addPoint"),l(yg,"intersectX"),l(mg,"intersectY"),p(),l(gg,"wrap"),l(xg,"shiftFeatureCoords"),l(vg,"shiftCoords"),p(),l(bg,"transformTile"),l(wg,"transformPoint"),p(),l(_g,"createTile"),l(Sg,"addFeature"),l(Ag,"addLine"),l(kg,"rewind"),l(Ig,"geojsonvt"),l(Mg,"GeoJSONVT"),Mg.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Mg.prototype.splitTile=function(e,t,r,i,n,a,s){for(var o=[e,t,r,i],l=this.options,u=l.debug;o.length;){i=o.pop(),r=o.pop(),t=o.pop(),e=o.pop();var c=1<<t,h=Pg(t,r,i),p=this.tiles[h];if(!p&&(u>1&&console.time("creation"),p=this.tiles[h]=_g(e,t,r,i,l),this.tileCoords.push({z:t,x:r,y:i}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,i,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var d="z"+t;this.stats[d]=(this.stats[d]||0)+1,this.total++}if(p.source=e,n){if(t===l.maxZoom||t===n)continue;var f=1<<n-t;if(r!==Math.floor(a/f)||i!==Math.floor(s/f))continue}else if(t===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue;if(p.source=null,0!==e.length){u>1&&console.time("clipping");var y,m,g,x,v,b,w=.5*l.buffer/l.extent,_=.5-w,S=.5+w,A=1+w;y=m=g=x=null,v=ug(e,c,r-w,r+S,0,p.minX,p.maxX,l),b=ug(e,c,r+_,r+A,0,p.minX,p.maxX,l),e=null,v&&(y=ug(v,c,i-w,i+S,1,p.minY,p.maxY,l),m=ug(v,c,i+_,i+A,1,p.minY,p.maxY,l),v=null),b&&(g=ug(b,c,i-w,i+S,1,p.minY,p.maxY,l),x=ug(b,c,i+_,i+A,1,p.minY,p.maxY,l),b=null),u>1&&console.timeEnd("clipping"),o.push(y||[],t+1,2*r,2*i),o.push(m||[],t+1,2*r,2*i+1),o.push(g||[],t+1,2*r+1,2*i),o.push(x||[],t+1,2*r+1,2*i+1)}}},Mg.prototype.getTile=function(e,t,r){var i=this.options,n=i.extent,a=i.debug;if(e<0||e>24)return null;var s=1<<e,o=Pg(e,t=(t%s+s)%s,r);if(this.tiles[o])return bg(this.tiles[o],n);a>1&&console.log("drilling down to z%d-%d-%d",e,t,r);for(var l,u=e,c=t,h=r;!l&&u>0;)u--,c=Math.floor(c/2),h=Math.floor(h/2),l=this.tiles[Pg(u,c,h)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",u,c,h),a>1&&console.time("drilling down"),this.splitTile(l.source,u,c,h,e,t,r),a>1&&console.timeEnd("drilling down"),this.tiles[o]?bg(this.tiles[o],n):null):null},l(Pg,"toID"),l(Cg,"extend"),p(),l(zg,"getFeatureId"),l(Bg,"isUpdateableGeoJSON"),l(Vg,"toUpdateable"),l(Eg,"applySourceDiff"),l(Fg,"loadGeoJSONTile");var Tg=class extends bm{constructor(e,t,r,i){super(e,t,r,Fg),this._dataUpdateable=new Map,this.loadGeoJSON=l(((e,t)=>{let{promoteId:r}=e;if(e.request)return Qn(e.request,((e,i,n,a)=>{this._dataUpdateable=Bg(i,r)?Vg(i,r):void 0,t(e,i,n,a)}));if("string"==typeof e.data)try{let i=JSON.parse(e.data);this._dataUpdateable=Bg(i,r)?Vg(i,r):void 0,t(null,i)}catch{t(new Error("Input data given to '".concat(e.source,"' is not a valid GeoJSON object.")))}else e.dataDiff?this._dataUpdateable?(Eg(this._dataUpdateable,e.dataDiff,r),t(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):t(new Error("Cannot update existing geojson data in ".concat(e.source))):t(new Error("Input data given to '".concat(e.source,"' is not a valid GeoJSON object.")));return{cancel:l((()=>{}),"cancel")}}),"loadGeoJSON"),i&&(this.loadGeoJSON=i)}loadData(e,t){var r;null==(r=this._pendingRequest)||r.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});let i=!!(e&&e.request&&e.request.collectResourceTiming)&&new gm(e.request);this._pendingCallback=t,this._pendingRequest=this.loadGeoJSON(e,((r,n)=>{if(delete this._pendingCallback,delete this._pendingRequest,r||!n)return t(r);if("object"!=typeof n)return t(new Error("Input data given to '".concat(e.source,"' is not a valid GeoJSON object.")));{(0,km.default)(n,!0);try{if(e.filter){let t=Li(e.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===t.result)throw new Error(t.value.map((e=>"".concat(e.key,": ").concat(e.message))).join(", "));n={type:"FeatureCollection",features:n.features.filter((e=>t.value.evaluate({zoom:0},e)))}}this._geoJSONIndex=e.cluster?new Zm(Dg(e)).load(n.features):Ig(n,e.geojsonVtOptions)}catch(e){return t(e)}this.loaded={};let r={};if(i){let t=i.finish();t&&(r.resourceTiming={},r.resourceTiming[e.source]=JSON.parse(JSON.stringify(t)))}t(null,r)}}))}reloadTile(e,t){let r=this.loaded,i=e.uid;return r&&r[i]?super.reloadTile(e,t):this.loadTile(e,t)}removeSource(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),t()}getClusterExpansionZoom(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId))}catch(e){t(e)}}getClusterChildren(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId))}catch(e){t(e)}}getClusterLeaves(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset))}catch(e){t(e)}}};l(Tg,"GeoJSONWorkerSource");var Lg=Tg;function Dg({superclusterOptions:e,clusterProperties:t}){if(!t||!e)return e;let r={},i={},n={accumulated:null,zoom:0},a={properties:null},s=Object.keys(t);for(let e of s){let[n,a]=t[e],s=Li(a),o=Li("string"==typeof n?[n,["accumulated"],["get",e]]:n);r[e]=s.value,i[e]=o.value}return e.map=e=>{a.properties=e;let t={};for(let e of s)t[e]=r[e].evaluate(n,a);return t},e.reduce=(e,t)=>{a.properties=t;for(let t of s)n.accumulated=e[t],e[t]=i[t].evaluate(n,a)},e}l(Dg,"getSuperclusterOptions");var Og=class{constructor(e){this.self=e,this.actor=new ua(e,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:bm,geojson:Lg},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(e,t)=>{if(this.workerSourceTypes[e])throw new Error('Worker source with name "'.concat(e,'" already registered.'));this.workerSourceTypes[e]=t},this.self.registerRTLTextPlugin=e=>{if(ja.isParsed())throw new Error("RTL text plugin already registered.");ja.applyArabicShaping=e.applyArabicShaping,ja.processBidirectionalText=e.processBidirectionalText,ja.processStyledBidirectionalText=e.processStyledBidirectionalText}}setReferrer(e,t){this.referrer=t}setImages(e,t,r){this.availableImages[e]=t;for(let r in this.workerSources[e]){let i=this.workerSources[e][r];for(let e in i)i[e].availableImages=t}r()}setLayers(e,t,r){this.getLayerIndex(e).replace(t),r()}updateLayers(e,t,r){this.getLayerIndex(e).update(t.layers,t.removedIds),r()}loadTile(e,t,r){this.getWorkerSource(e,t.type,t.source).loadTile(t,r)}loadDEMTile(e,t,r){this.getDEMWorkerSource(e,t.source).loadTile(t,r)}reloadTile(e,t,r){this.getWorkerSource(e,t.type,t.source).reloadTile(t,r)}abortTile(e,t,r){this.getWorkerSource(e,t.type,t.source).abortTile(t,r)}removeTile(e,t,r){this.getWorkerSource(e,t.type,t.source).removeTile(t,r)}removeDEMTile(e,t){this.getDEMWorkerSource(e,t.source).removeTile(t)}removeSource(e,t,r){if(!this.workerSources[e]||!this.workerSources[e][t.type]||!this.workerSources[e][t.type][t.source])return;let i=this.workerSources[e][t.type][t.source];delete this.workerSources[e][t.type][t.source],void 0!==i.removeSource?i.removeSource(t,r):r()}loadWorkerSource(e,t,r){try{this.self.importScripts(t.url),r()}catch(e){r(e.toString())}}syncRTLPluginState(e,t,r){try{ja.setState(t);let e=ja.getPluginURL();if(ja.isLoaded()&&!ja.isParsed()&&null!=e){this.self.importScripts(e);let t=ja.isParsed();r(t?void 0:new Error("RTL Text Plugin failed to import scripts from ".concat(e)),t)}}catch(e){r(e.toString())}}getAvailableImages(e){let t=this.availableImages[e];return t||(t=[]),t}getLayerIndex(e){let t=this.layerIndexes[e];return t||(t=this.layerIndexes[e]=new Rf),t}getWorkerSource(e,t,r){if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][r]){let i={send:l(((t,r,i)=>{this.actor.send(t,r,i,e)}),"send")};this.workerSources[e][t][r]=new this.workerSourceTypes[t](i,this.getLayerIndex(e),this.getAvailableImages(e))}return this.workerSources[e][t][r]}getDEMWorkerSource(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new Am),this.demWorkerSources[e][t]}};l(Og,"Worker");var Rg=Og;N()&&(self.worker=new Rg(self))})();
|
|
1
|
+
(()=>{var e,t,r=Object.create,i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,s=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,l=(e,t)=>i(e,"name",{value:t,configurable:!0}),u=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,t)=>{for(var r in t)i(e,r,{get:t[r],enumerable:!0})},h=(e,t,l)=>(l=null!=e?r(s(e)):{},((e,t,r,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of a(t))!o.call(e,l)&&l!==r&&i(e,l,{get:()=>t[l],enumerable:!(s=n(t,l))||s.enumerable});return e})(!t&&e&&e.__esModule?l:i(l,"default",{value:e,enumerable:!0}),e)),p=(e=()=>{},()=>(e&&(t=e(e=0)),t)),d=u(((e,t)=>{"use strict";function r(e,t){this.x=e,this.y=t}p(),t.exports=r,l(r,"Point"),r.prototype={clone:l((function(){return new r(this.x,this.y)}),"clone"),add:l((function(e){return this.clone()._add(e)}),"add"),sub:l((function(e){return this.clone()._sub(e)}),"sub"),multByPoint:l((function(e){return this.clone()._multByPoint(e)}),"multByPoint"),divByPoint:l((function(e){return this.clone()._divByPoint(e)}),"divByPoint"),mult:l((function(e){return this.clone()._mult(e)}),"mult"),div:l((function(e){return this.clone()._div(e)}),"div"),rotate:l((function(e){return this.clone()._rotate(e)}),"rotate"),rotateAround:l((function(e,t){return this.clone()._rotateAround(e,t)}),"rotateAround"),matMult:l((function(e){return this.clone()._matMult(e)}),"matMult"),unit:l((function(){return this.clone()._unit()}),"unit"),perp:l((function(){return this.clone()._perp()}),"perp"),round:l((function(){return this.clone()._round()}),"round"),mag:l((function(){return Math.sqrt(this.x*this.x+this.y*this.y)}),"mag"),equals:l((function(e){return this.x===e.x&&this.y===e.y}),"equals"),dist:l((function(e){return Math.sqrt(this.distSqr(e))}),"dist"),distSqr:l((function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r}),"distSqr"),angle:l((function(){return Math.atan2(this.y,this.x)}),"angle"),angleTo:l((function(e){return Math.atan2(this.y-e.y,this.x-e.x)}),"angleTo"),angleWith:l((function(e){return this.angleWithSep(e.x,e.y)}),"angleWith"),angleWithSep:l((function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)}),"angleWithSep"),_matMult:l((function(e){var t=e[0]*this.x+e[1]*this.y,r=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=r,this}),"_matMult"),_add:l((function(e){return this.x+=e.x,this.y+=e.y,this}),"_add"),_sub:l((function(e){return this.x-=e.x,this.y-=e.y,this}),"_sub"),_mult:l((function(e){return this.x*=e,this.y*=e,this}),"_mult"),_div:l((function(e){return this.x/=e,this.y/=e,this}),"_div"),_multByPoint:l((function(e){return this.x*=e.x,this.y*=e.y,this}),"_multByPoint"),_divByPoint:l((function(e){return this.x/=e.x,this.y/=e.y,this}),"_divByPoint"),_unit:l((function(){return this._div(this.mag()),this}),"_unit"),_perp:l((function(){var e=this.y;return this.y=this.x,this.x=-e,this}),"_perp"),_rotate:l((function(e){var t=Math.cos(e),r=Math.sin(e),i=t*this.x-r*this.y,n=r*this.x+t*this.y;return this.x=i,this.y=n,this}),"_rotate"),_rotateAround:l((function(e,t){var r=Math.cos(e),i=Math.sin(e),n=t.x+r*(this.x-t.x)-i*(this.y-t.y),a=t.y+i*(this.x-t.x)+r*(this.y-t.y);return this.x=n,this.y=a,this}),"_rotateAround"),_round:l((function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}),"_round")},r.convert=function(e){return e instanceof r?e:Array.isArray(e)?new r(e[0],e[1]):e}})),f=u(((e,t)=>{"use strict";function r(e,t,r,i){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(i-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=i}p(),t.exports=r,l(r,"UnitBezier"),r.prototype={sampleCurveX:l((function(e){return((this.ax*e+this.bx)*e+this.cx)*e}),"sampleCurveX"),sampleCurveY:l((function(e){return((this.ay*e+this.by)*e+this.cy)*e}),"sampleCurveY"),sampleCurveDerivativeX:l((function(e){return(3*this.ax*e+2*this.bx)*e+this.cx}),"sampleCurveDerivativeX"),solveCurveX:l((function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,i=0;i<8;i++){var n=this.sampleCurveX(r)-e;if(Math.abs(n)<t)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=n/a}var s=0,o=1;for(r=e,i=0;i<20&&(n=this.sampleCurveX(r),!(Math.abs(n-e)<t));i++)e>n?s=r:o=r,r=.5*(o-s)+s;return r}),"solveCurveX"),solve:l((function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}),"solve")}})),y=u(((e,t)=>{function r(e,t){var r,i,n,a,s,o,l,u;for(r=3&e.length,i=e.length-r,n=t,s=3432918353,o=461845907,u=0;u<i;)l=255&e.charCodeAt(u)|(255&e.charCodeAt(++u))<<8|(255&e.charCodeAt(++u))<<16|(255&e.charCodeAt(++u))<<24,++u,n=27492+(65535&(a=5*(65535&(n=(n^=l=(65535&(l=(l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+(((a>>>16)+58964&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(u+2))<<16;case 2:l^=(255&e.charCodeAt(u+1))<<8;case 1:n^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(u)))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*o+(((l>>>16)*o&65535)<<16)&4294967295}return n^=e.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0}p(),l(r,"murmurhash3_32_gc"),typeof t<"u"&&(t.exports=r)})),m=u(((e,t)=>{function r(e,t){for(var r,i=e.length,n=t^i,a=0;i>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),i-=4,++a;switch(i){case 3:n^=(255&e.charCodeAt(a+2))<<16;case 2:n^=(255&e.charCodeAt(a+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(a)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0}p(),l(r,"murmurhash2_32_gc"),void 0!==typeof t&&(t.exports=r)})),g=u(((e,t)=>{p();var r=y(),i=m();t.exports=r,t.exports.murmur3=r,t.exports.murmur2=i})),x=u(((e,t)=>{"use strict";function r(e,t,r){r=r||2;var n,s,o,l,u,c,p,d=t&&t.length,f=d?t[0]*r:e.length,y=i(e,0,f,r,!0),m=[];if(!y||y.next===y.prev)return m;if(d&&(y=h(e,t,y,r)),e.length>80*r){n=o=e[0],s=l=e[1];for(var g=r;g<f;g+=r)(u=e[g])<n&&(n=u),(c=e[g+1])<s&&(s=c),u>o&&(o=u),c>l&&(l=c);p=0!==(p=Math.max(o-n,l-s))?32767/p:0}return a(y,m,r,n,s,p,0),m}function i(e,t,r,i,n){var a,s;if(n===T(e,t,r,i)>0)for(a=t;a<r;a+=i)s=V(a,e[a],e[a+1],s);else for(a=r-i;a>=t;a-=i)s=V(a,e[a],e[a+1],s);return s&&A(s,s.next)&&(E(s),s=s.next),s}function n(e,t){if(!e)return e;t||(t=e);var r,i=e;do{if(r=!1,i.steiner||!A(i,i.next)&&0!==S(i.prev,i,i.next))i=i.next;else{if(E(i),(i=t=i.prev)===i.next)break;r=!0}}while(r||i!==t);return t}function a(e,t,r,i,l,h,p){if(e){!p&&h&&g(e,i,l,h);for(var d,f,y=e;e.prev!==e.next;)if(d=e.prev,f=e.next,h?o(e,i,l,h):s(e))t.push(d.i/r|0),t.push(e.i/r|0),t.push(f.i/r|0),E(e),e=f.next,y=f.next;else if((e=f)===y){p?1===p?a(e=u(n(e),t,r),t,r,i,l,h,2):2===p&&c(e,t,r,i,l,h):a(n(e),t,r,i,l,h,1);break}}}function s(e){var t=e.prev,r=e,i=e.next;if(S(t,r,i)>=0)return!1;for(var n=t.x,a=r.x,s=i.x,o=t.y,l=r.y,u=i.y,c=n<a?n<s?n:s:a<s?a:s,h=o<l?o<u?o:u:l<u?l:u,p=n>a?n>s?n:s:a>s?a:s,d=o>l?o>u?o:u:l>u?l:u,f=i.next;f!==t;){if(f.x>=c&&f.x<=p&&f.y>=h&&f.y<=d&&w(n,o,a,l,s,u,f.x,f.y)&&S(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function o(e,t,r,i){var n=e.prev,a=e,s=e.next;if(S(n,a,s)>=0)return!1;for(var o=n.x,l=a.x,u=s.x,c=n.y,h=a.y,p=s.y,d=o<l?o<u?o:u:l<u?l:u,f=c<h?c<p?c:p:h<p?h:p,y=o>l?o>u?o:u:l>u?l:u,m=c>h?c>p?c:p:h>p?h:p,g=v(d,f,t,r,i),x=v(y,m,t,r,i),b=e.prevZ,_=e.nextZ;b&&b.z>=g&&_&&_.z<=x;){if(b.x>=d&&b.x<=y&&b.y>=f&&b.y<=m&&b!==n&&b!==s&&w(o,c,l,h,u,p,b.x,b.y)&&S(b.prev,b,b.next)>=0||(b=b.prevZ,_.x>=d&&_.x<=y&&_.y>=f&&_.y<=m&&_!==n&&_!==s&&w(o,c,l,h,u,p,_.x,_.y)&&S(_.prev,_,_.next)>=0))return!1;_=_.nextZ}for(;b&&b.z>=g;){if(b.x>=d&&b.x<=y&&b.y>=f&&b.y<=m&&b!==n&&b!==s&&w(o,c,l,h,u,p,b.x,b.y)&&S(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;_&&_.z<=x;){if(_.x>=d&&_.x<=y&&_.y>=f&&_.y<=m&&_!==n&&_!==s&&w(o,c,l,h,u,p,_.x,_.y)&&S(_.prev,_,_.next)>=0)return!1;_=_.nextZ}return!0}function u(e,t,r){var i=e;do{var a=i.prev,s=i.next.next;!A(a,s)&&k(a,i,i.next,s)&&C(a,s)&&C(s,a)&&(t.push(a.i/r|0),t.push(i.i/r|0),t.push(s.i/r|0),E(i),E(i.next),i=e=s),i=i.next}while(i!==e);return n(i)}function c(e,t,r,i,s,o){var l=e;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&_(l,u)){var c=B(l,u);return l=n(l,l.next),c=n(c,c.next),a(l,t,r,i,s,o,0),void a(c,t,r,i,s,o,0)}u=u.next}l=l.next}while(l!==e)}function h(e,t,r,n){var a,s,o,l=[];for(a=0,s=t.length;a<s;a++)(o=i(e,t[a]*n,a<s-1?t[a+1]*n:e.length,n,!1))===o.next&&(o.steiner=!0),l.push(b(o));for(l.sort(d),a=0;a<l.length;a++)r=f(l[a],r);return r}function d(e,t){return e.x-t.x}function f(e,t){var r=y(e,t);if(!r)return t;var i=B(r,e);return n(i,i.next),n(r,r.next)}function y(e,t){var r,i=t,n=e.x,a=e.y,s=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var o=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(o<=n&&o>s&&(s=o,r=i.x<i.next.x?i:i.next,o===n))return r}i=i.next}while(i!==t);if(!r)return null;var l,u=r,c=r.x,h=r.y,p=1/0;i=r;do{n>=i.x&&i.x>=c&&n!==i.x&&w(a<h?n:s,a,c,h,a<h?s:n,a,i.x,i.y)&&(l=Math.abs(a-i.y)/(n-i.x),C(i,e)&&(l<p||l===p&&(i.x>r.x||i.x===r.x&&m(r,i)))&&(r=i,p=l)),i=i.next}while(i!==u);return r}function m(e,t){return S(e.prev,e,t.prev)<0&&S(t.next,e,e.next)<0}function g(e,t,r,i){var n=e;do{0===n.z&&(n.z=v(n.x,n.y,t,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,x(n)}function x(e){var t,r,i,n,a,s,o,l,u=1;do{for(r=e,e=null,a=null,s=0;r;){for(s++,i=r,o=0,t=0;t<u&&(o++,i=i.nextZ);t++);for(l=u;o>0||l>0&&i;)0!==o&&(0===l||!i||r.z<=i.z)?(n=r,r=r.nextZ,o--):(n=i,i=i.nextZ,l--),a?a.nextZ=n:e=n,n.prevZ=a,a=n;r=i}a.nextZ=null,u*=2}while(s>1);return e}function v(e,t,r,i,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function b(e){var t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function w(e,t,r,i,n,a,s,o){return(n-s)*(t-o)>=(e-s)*(a-o)&&(e-s)*(i-o)>=(r-s)*(t-o)&&(r-s)*(a-o)>=(n-s)*(i-o)}function _(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!P(e,t)&&(C(e,t)&&C(t,e)&&z(e,t)&&(S(e.prev,e,t.prev)||S(e,t.prev,t))||A(e,t)&&S(e.prev,e,e.next)>0&&S(t.prev,t,t.next)>0)}function S(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function A(e,t){return e.x===t.x&&e.y===t.y}function k(e,t,r,i){var n=M(S(e,t,r)),a=M(S(e,t,i)),s=M(S(r,i,e)),o=M(S(r,i,t));return!!(n!==a&&s!==o||0===n&&I(e,r,t)||0===a&&I(e,i,t)||0===s&&I(r,e,i)||0===o&&I(r,t,i))}function I(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function M(e){return e>0?1:e<0?-1:0}function P(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&k(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function C(e,t){return S(e.prev,e,e.next)<0?S(e,t,e.next)>=0&&S(e,e.prev,t)>=0:S(e,t,e.prev)<0||S(e,e.next,t)<0}function z(e,t){var r=e,i=!1,n=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&n<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==e);return i}function B(e,t){var r=new F(e.i,e.x,e.y),i=new F(t.i,t.x,t.y),n=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=n,n.prev=r,i.next=r,r.prev=i,a.next=i,i.prev=a,i}function V(e,t,r,i){var n=new F(e,t,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function E(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function F(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function T(e,t,r,i){for(var n=0,a=t,s=r-i;a<r;a+=i)n+=(e[s]-e[a])*(e[a+1]+e[s+1]),s=a;return n}p(),t.exports=r,t.exports.default=r,l(r,"earcut"),l(i,"linkedList"),l(n,"filterPoints"),l(a,"earcutLinked"),l(s,"isEar"),l(o,"isEarHashed"),l(u,"cureLocalIntersections"),l(c,"splitEarcut"),l(h,"eliminateHoles"),l(d,"compareX"),l(f,"eliminateHole"),l(y,"findHoleBridge"),l(m,"sectorContainsSector"),l(g,"indexCurve"),l(x,"sortLinked"),l(v,"zOrder"),l(b,"getLeftmost"),l(w,"pointInTriangle"),l(_,"isValidDiagonal"),l(S,"area"),l(A,"equals"),l(k,"intersects"),l(I,"onSegment"),l(M,"sign"),l(P,"intersectsPolygon"),l(C,"locallyInside"),l(z,"middleInside"),l(B,"splitPolygon"),l(V,"insertNode"),l(E,"removeNode"),l(F,"Node"),r.deviation=function(e,t,r,i){var n=t&&t.length,a=n?t[0]*r:e.length,s=Math.abs(T(e,0,a,r));if(n)for(var o=0,l=t.length;o<l;o++){var u=t[o]*r,c=o<l-1?t[o+1]*r:e.length;s-=Math.abs(T(e,u,c,r))}var h=0;for(o=0;o<i.length;o+=3){var p=i[o]*r,d=i[o+1]*r,f=i[o+2]*r;h+=Math.abs((e[p]-e[f])*(e[d+1]-e[p+1])-(e[p]-e[d])*(e[f+1]-e[p+1]))}return 0===s&&0===h?0:Math.abs((h-s)/s)},l(T,"signedArea"),r.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},i=0,n=0;n<e.length;n++){for(var a=0;a<e[n].length;a++)for(var s=0;s<t;s++)r.vertices.push(e[n][a][s]);n>0&&(i+=e[n-1].length,r.holes.push(i))}return r}})),v=u(((e,t)=>{"use strict";p();var r=d();function i(e,t,r,i,a){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=i,this._values=a,e.readFields(n,this,t)}function n(e,t,r){1==e?t.id=r.readVarint():2==e?a(r,t):3==e?t.type=r.readVarint():4==e&&(t._geometry=r.pos)}function a(e,t){for(var r=e.readVarint()+e.pos;e.pos<r;){var i=t._keys[e.readVarint()],n=t._values[e.readVarint()];t.properties[i]=n}}function s(e){var t=e.length;if(t<=1)return[e];for(var r,i,n=[],a=0;a<t;a++){var s=o(e[a]);0!==s&&(void 0===i&&(i=s<0),i===s<0?(r&&n.push(r),r=[e[a]]):r.push(e[a]))}return r&&n.push(r),n}function o(e){for(var t,r,i=0,n=0,a=e.length,s=a-1;n<a;s=n++)t=e[n],i+=((r=e[s]).x-t.x)*(t.y+r.y);return i}t.exports=i,l(i,"VectorTileFeature"),l(n,"readFeature"),l(a,"readTag"),i.types=["Unknown","Point","LineString","Polygon"],i.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,i=e.readVarint()+e.pos,n=1,a=0,s=0,o=0,l=[];e.pos<i;){if(a<=0){var u=e.readVarint();n=7&u,a=u>>3}if(a--,1===n||2===n)s+=e.readSVarint(),o+=e.readSVarint(),1===n&&(t&&l.push(t),t=[]),t.push(new r(s,o));else{if(7!==n)throw new Error("unknown command "+n);t&&t.push(t[0].clone())}}return t&&l.push(t),l},i.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,i=0,n=0,a=0,s=1/0,o=-1/0,l=1/0,u=-1/0;e.pos<t;){if(i<=0){var c=e.readVarint();r=7&c,i=c>>3}if(i--,1===r||2===r)(n+=e.readSVarint())<s&&(s=n),n>o&&(o=n),(a+=e.readSVarint())<l&&(l=a),a>u&&(u=a);else if(7!==r)throw new Error("unknown command "+r)}return[s,l,o,u]},i.prototype.toGeoJSON=function(e,t,r){var n,a,o=this.extent*Math.pow(2,r),u=this.extent*e,c=this.extent*t,h=this.loadGeometry(),p=i.types[this.type];function d(e){for(var t=0;t<e.length;t++){var r=e[t],i=180-360*(r.y+c)/o;e[t]=[360*(r.x+u)/o-180,360/Math.PI*Math.atan(Math.exp(i*Math.PI/180))-90]}}switch(l(d,"project"),this.type){case 1:var f=[];for(n=0;n<h.length;n++)f[n]=h[n][0];d(h=f);break;case 2:for(n=0;n<h.length;n++)d(h[n]);break;case 3:for(h=s(h),n=0;n<h.length;n++)for(a=0;a<h[n].length;a++)d(h[n][a])}1===h.length?h=h[0]:p="Multi"+p;var y={type:"Feature",geometry:{type:p,coordinates:h},properties:this.properties};return"id"in this&&(y.id=this.id),y},l(s,"classifyRings"),l(o,"signedArea")})),b=u(((e,t)=>{"use strict";p();var r=v();function i(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(n,this,t),this.length=this._features.length}function n(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(a(r))}function a(e){for(var t=null,r=e.readVarint()+e.pos;e.pos<r;){var i=e.readVarint()>>3;t=1===i?e.readString():2===i?e.readFloat():3===i?e.readDouble():4===i?e.readVarint64():5===i?e.readVarint():6===i?e.readSVarint():7===i?e.readBoolean():null}return t}t.exports=i,l(i,"VectorTileLayer"),l(n,"readLayer"),l(a,"readValueMessage"),i.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new r(this._pbf,t,this.extent,this._keys,this._values)}})),w=u(((e,t)=>{"use strict";p();var r=b();function i(e,t){this.layers=e.readFields(n,{},t)}function n(e,t,i){if(3===e){var n=new r(i,i.readVarint()+i.pos);n.length&&(t[n.name]=n)}}t.exports=i,l(i,"VectorTile"),l(n,"readTile")})),_=u(((e,t)=>{p(),t.exports.VectorTile=w(),t.exports.VectorTileFeature=v(),t.exports.VectorTileLayer=b()})),S=u((e=>{p(),e.read=function(e,t,r,i,n){var a,s,o=8*n-i-1,l=(1<<o)-1,u=l>>1,c=-7,h=r?n-1:0,p=r?-1:1,d=e[t+h];for(h+=p,a=d&(1<<-c)-1,d>>=-c,c+=o;c>0;a=256*a+e[t+h],h+=p,c-=8);for(s=a&(1<<-c)-1,a>>=-c,c+=i;c>0;s=256*s+e[t+h],h+=p,c-=8);if(0===a)a=1-u;else{if(a===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,i),a-=u}return(d?-1:1)*s*Math.pow(2,a-i)},e.write=function(e,t,r,i,n,a){var s,o,l,u=8*a-n-1,c=(1<<u)-1,h=c>>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:a-1,f=i?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=c?(o=0,s=c):s+h>=1?(o=(t*l-1)*Math.pow(2,n),s+=h):(o=t*Math.pow(2,h-1)*Math.pow(2,n),s=0));n>=8;e[r+d]=255&o,d+=f,o/=256,n-=8);for(s=s<<n|o,u+=n;u>0;e[r+d]=255&s,d+=f,s/=256,u-=8);e[r+d-f]|=128*y}})),A=u(((e,t)=>{"use strict";p(),t.exports=i;var r=S();function i(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}l(i,"Pbf"),i.Varint=0,i.Fixed64=1,i.Bytes=2,i.Fixed32=5;var n=4294967296,a=1/n,s=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function o(e,t,r){var i,n,a=r.buf;if(i=(112&(n=a[r.pos++]))>>4,n<128||(i|=(127&(n=a[r.pos++]))<<3,n<128)||(i|=(127&(n=a[r.pos++]))<<10,n<128)||(i|=(127&(n=a[r.pos++]))<<17,n<128)||(i|=(127&(n=a[r.pos++]))<<24,n<128)||(i|=(1&(n=a[r.pos++]))<<31,n<128))return c(e,i,t);throw new Error("Expected varint not more than 10 bytes")}function u(e){return e.type===i.Bytes?e.readVarint()+e.pos:e.pos+1}function c(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function h(e,t){var r,i;if(e>=0?(r=e%4294967296|0,i=e/4294967296|0):(i=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,i=i+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),d(r,i,t),f(i,t)}function d(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos]=127&e}function f(e,t){var r=(7&e)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}function y(e,t,r){var i=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;n>=e;n--)r.buf[n+i]=r.buf[n]}function m(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function g(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function x(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function v(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function b(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function w(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function _(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function A(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function k(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function I(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function M(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function P(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function C(e,t,r){for(var i="",n=t;n<r;){var a,s,o,l=e[n],u=null,c=l>239?4:l>223?3:l>191?2:1;if(n+c>r)break;1===c?l<128&&(u=l):2===c?128==(192&(a=e[n+1]))&&((u=(31&l)<<6|63&a)<=127&&(u=null)):3===c?(a=e[n+1],s=e[n+2],128==(192&a)&&128==(192&s)&&(((u=(15&l)<<12|(63&a)<<6|63&s)<=2047||u>=55296&&u<=57343)&&(u=null))):4===c&&(a=e[n+1],s=e[n+2],o=e[n+3],128==(192&a)&&128==(192&s)&&128==(192&o)&&(((u=(15&l)<<18|(63&a)<<12|(63&s)<<6|63&o)<=65535||u>=1114112)&&(u=null))),null===u?(u=65533,c=1):u>65535&&(u-=65536,i+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),i+=String.fromCharCode(u),n+=c}return i}function z(e,t,r){return s.decode(e.subarray(t,r))}function B(e,t,r){for(var i,n,a=0;a<t.length;a++){if((i=t.charCodeAt(a))>55295&&i<57344){if(!n){i>56319||a+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):n=i;continue}if(i<56320){e[r++]=239,e[r++]=191,e[r++]=189,n=i;continue}i=n-55296<<10|i-56320|65536,n=null}else n&&(e[r++]=239,e[r++]=191,e[r++]=189,n=null);i<128?e[r++]=i:(i<2048?e[r++]=i>>6|192:(i<65536?e[r++]=i>>12|224:(e[r++]=i>>18|240,e[r++]=i>>12&63|128),e[r++]=i>>6&63|128),e[r++]=63&i|128)}return r}i.prototype={destroy:l((function(){this.buf=null}),"destroy"),readFields:l((function(e,t,r){for(r=r||this.length;this.pos<r;){var i=this.readVarint(),n=i>>3,a=this.pos;this.type=7&i,e(n,t,this),this.pos===a&&this.skip(i)}return t}),"readFields"),readMessage:l((function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}),"readMessage"),readFixed32:l((function(){var e=I(this.buf,this.pos);return this.pos+=4,e}),"readFixed32"),readSFixed32:l((function(){var e=P(this.buf,this.pos);return this.pos+=4,e}),"readSFixed32"),readFixed64:l((function(){var e=I(this.buf,this.pos)+I(this.buf,this.pos+4)*n;return this.pos+=8,e}),"readFixed64"),readSFixed64:l((function(){var e=I(this.buf,this.pos)+P(this.buf,this.pos+4)*n;return this.pos+=8,e}),"readSFixed64"),readFloat:l((function(){var e=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e}),"readFloat"),readDouble:l((function(){var e=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e}),"readDouble"),readVarint:l((function(e){var t,r,i=this.buf;return t=127&(r=i[this.pos++]),r<128||(t|=(127&(r=i[this.pos++]))<<7,r<128)||(t|=(127&(r=i[this.pos++]))<<14,r<128)||(t|=(127&(r=i[this.pos++]))<<21,r<128)?t:o(t|=(15&(r=i[this.pos]))<<28,e,this)}),"readVarint"),readVarint64:l((function(){return this.readVarint(!0)}),"readVarint64"),readSVarint:l((function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2}),"readSVarint"),readBoolean:l((function(){return!!this.readVarint()}),"readBoolean"),readString:l((function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&s?z(this.buf,t,e):C(this.buf,t,e)}),"readString"),readBytes:l((function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}),"readBytes"),readPackedVarint:l((function(e,t){if(this.type!==i.Bytes)return e.push(this.readVarint(t));var r=u(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e}),"readPackedVarint"),readPackedSVarint:l((function(e){if(this.type!==i.Bytes)return e.push(this.readSVarint());var t=u(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e}),"readPackedSVarint"),readPackedBoolean:l((function(e){if(this.type!==i.Bytes)return e.push(this.readBoolean());var t=u(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e}),"readPackedBoolean"),readPackedFloat:l((function(e){if(this.type!==i.Bytes)return e.push(this.readFloat());var t=u(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e}),"readPackedFloat"),readPackedDouble:l((function(e){if(this.type!==i.Bytes)return e.push(this.readDouble());var t=u(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e}),"readPackedDouble"),readPackedFixed32:l((function(e){if(this.type!==i.Bytes)return e.push(this.readFixed32());var t=u(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e}),"readPackedFixed32"),readPackedSFixed32:l((function(e){if(this.type!==i.Bytes)return e.push(this.readSFixed32());var t=u(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e}),"readPackedSFixed32"),readPackedFixed64:l((function(e){if(this.type!==i.Bytes)return e.push(this.readFixed64());var t=u(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e}),"readPackedFixed64"),readPackedSFixed64:l((function(e){if(this.type!==i.Bytes)return e.push(this.readSFixed64());var t=u(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e}),"readPackedSFixed64"),skip:l((function(e){var t=7&e;if(t===i.Varint)for(;this.buf[this.pos++]>127;);else if(t===i.Bytes)this.pos=this.readVarint()+this.pos;else if(t===i.Fixed32)this.pos+=4;else{if(t!==i.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}}),"skip"),writeTag:l((function(e,t){this.writeVarint(e<<3|t)}),"writeTag"),realloc:l((function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}}),"realloc"),finish:l((function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}),"finish"),writeFixed32:l((function(e){this.realloc(4),M(this.buf,e,this.pos),this.pos+=4}),"writeFixed32"),writeSFixed32:l((function(e){this.realloc(4),M(this.buf,e,this.pos),this.pos+=4}),"writeSFixed32"),writeFixed64:l((function(e){this.realloc(8),M(this.buf,-1&e,this.pos),M(this.buf,Math.floor(e*a),this.pos+4),this.pos+=8}),"writeFixed64"),writeSFixed64:l((function(e){this.realloc(8),M(this.buf,-1&e,this.pos),M(this.buf,Math.floor(e*a),this.pos+4),this.pos+=8}),"writeSFixed64"),writeVarint:l((function(e){(e=+e||0)>268435455||e<0?h(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),!(e<=127)&&(this.buf[this.pos++]=e>>>7&127))))}),"writeVarint"),writeSVarint:l((function(e){this.writeVarint(e<0?2*-e-1:2*e)}),"writeSVarint"),writeBoolean:l((function(e){this.writeVarint(!!e)}),"writeBoolean"),writeString:l((function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=B(this.buf,e,this.pos);var r=this.pos-t;r>=128&&y(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r}),"writeString"),writeFloat:l((function(e){this.realloc(4),r.write(this.buf,e,this.pos,!0,23,4),this.pos+=4}),"writeFloat"),writeDouble:l((function(e){this.realloc(8),r.write(this.buf,e,this.pos,!0,52,8),this.pos+=8}),"writeDouble"),writeBytes:l((function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]}),"writeBytes"),writeRawMessage:l((function(e,t){this.pos++;var r=this.pos;e(t,this);var i=this.pos-r;i>=128&&y(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}),"writeRawMessage"),writeMessage:l((function(e,t,r){this.writeTag(e,i.Bytes),this.writeRawMessage(t,r)}),"writeMessage"),writePackedVarint:l((function(e,t){t.length&&this.writeMessage(e,m,t)}),"writePackedVarint"),writePackedSVarint:l((function(e,t){t.length&&this.writeMessage(e,g,t)}),"writePackedSVarint"),writePackedBoolean:l((function(e,t){t.length&&this.writeMessage(e,b,t)}),"writePackedBoolean"),writePackedFloat:l((function(e,t){t.length&&this.writeMessage(e,x,t)}),"writePackedFloat"),writePackedDouble:l((function(e,t){t.length&&this.writeMessage(e,v,t)}),"writePackedDouble"),writePackedFixed32:l((function(e,t){t.length&&this.writeMessage(e,w,t)}),"writePackedFixed32"),writePackedSFixed32:l((function(e,t){t.length&&this.writeMessage(e,_,t)}),"writePackedSFixed32"),writePackedFixed64:l((function(e,t){t.length&&this.writeMessage(e,A,t)}),"writePackedFixed64"),writePackedSFixed64:l((function(e,t){t.length&&this.writeMessage(e,k,t)}),"writePackedSFixed64"),writeBytesField:l((function(e,t){this.writeTag(e,i.Bytes),this.writeBytes(t)}),"writeBytesField"),writeFixed32Field:l((function(e,t){this.writeTag(e,i.Fixed32),this.writeFixed32(t)}),"writeFixed32Field"),writeSFixed32Field:l((function(e,t){this.writeTag(e,i.Fixed32),this.writeSFixed32(t)}),"writeSFixed32Field"),writeFixed64Field:l((function(e,t){this.writeTag(e,i.Fixed64),this.writeFixed64(t)}),"writeFixed64Field"),writeSFixed64Field:l((function(e,t){this.writeTag(e,i.Fixed64),this.writeSFixed64(t)}),"writeSFixed64Field"),writeVarintField:l((function(e,t){this.writeTag(e,i.Varint),this.writeVarint(t)}),"writeVarintField"),writeSVarintField:l((function(e,t){this.writeTag(e,i.Varint),this.writeSVarint(t)}),"writeSVarintField"),writeStringField:l((function(e,t){this.writeTag(e,i.Bytes),this.writeString(t)}),"writeStringField"),writeFloatField:l((function(e,t){this.writeTag(e,i.Fixed32),this.writeFloat(t)}),"writeFloatField"),writeDoubleField:l((function(e,t){this.writeTag(e,i.Fixed64),this.writeDouble(t)}),"writeDoubleField"),writeBooleanField:l((function(e,t){this.writeVarintField(e,!!t)}),"writeBooleanField")},l(o,"readVarintRemainder"),l(u,"readPackedEnd"),l(c,"toNum"),l(h,"writeBigVarint"),l(d,"writeBigVarintLow"),l(f,"writeBigVarintHigh"),l(y,"makeRoomForExtraLength"),l(m,"writePackedVarint"),l(g,"writePackedSVarint"),l(x,"writePackedFloat"),l(v,"writePackedDouble"),l(b,"writePackedBoolean"),l(w,"writePackedFixed32"),l(_,"writePackedSFixed32"),l(A,"writePackedFixed64"),l(k,"writePackedSFixed64"),l(I,"readUInt32"),l(M,"writeInt32"),l(P,"readInt32"),l(C,"readUtf8"),l(z,"readUtf8TextDecoder"),l(B,"writeUtf8")})),k=u(((e,t)=>{function r(e,t){var n,a=e&&e.type;if("FeatureCollection"===a)for(n=0;n<e.features.length;n++)r(e.features[n],t);else if("GeometryCollection"===a)for(n=0;n<e.geometries.length;n++)r(e.geometries[n],t);else if("Feature"===a)r(e.geometry,t);else if("Polygon"===a)i(e.coordinates,t);else if("MultiPolygon"===a)for(n=0;n<e.coordinates.length;n++)i(e.coordinates[n],t);return e}function i(e,t){if(0!==e.length){n(e[0],t);for(var r=1;r<e.length;r++)n(e[r],!t)}}function n(e,t){for(var r=0,i=0,n=0,a=e.length,s=a-1;n<a;s=n++){var o=(e[n][0]-e[s][0])*(e[s][1]+e[n][1]),l=r+o;i+=Math.abs(r)>=Math.abs(o)?r-l+o:o-l+r,r=l}r+i>=0!=!!t&&e.reverse()}p(),t.exports=r,l(r,"rewind"),l(i,"rewindRings"),l(n,"rewindRing")})),I=u(((e,t)=>{"use strict";p();var r=d(),i=_().VectorTileFeature;function n(e,t){this.options=t||{},this.features=e,this.length=e.length}function a(e,t){this.id="number"==typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096}t.exports=n,l(n,"GeoJSONWrapper"),n.prototype.feature=function(e){return new a(this.features[e],this.options.extent)},l(a,"FeatureWrapper"),a.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var t=0;t<e.length;t++){for(var i=e[t],n=[],a=0;a<i.length;a++)n.push(new r(i[a][0],i[a][1]));this.geometry.push(n)}return this.geometry},a.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,r=-1/0,i=1/0,n=-1/0,a=0;a<e.length;a++)for(var s=e[a],o=0;o<s.length;o++){var l=s[o];t=Math.min(t,l.x),r=Math.max(r,l.x),i=Math.min(i,l.y),n=Math.max(n,l.y)}return[t,i,r,n]},a.prototype.toGeoJSON=i.prototype.toGeoJSON})),M=u(((e,t)=>{p();var r=A(),i=I();function n(e){var t=new r;return s(e,t),t.finish()}function a(e,t){t=t||{};var r={};for(var a in e)r[a]=new i(e[a].features,t),r[a].name=a,r[a].version=t.version,r[a].extent=t.extent;return n({layers:r})}function s(e,t){for(var r in e.layers)t.writeMessage(3,o,e.layers[r])}function o(e,t){t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);var r,i={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<e.length;r++)i.feature=e.feature(r),t.writeMessage(2,u,i);var n=i.keys;for(r=0;r<n.length;r++)t.writeStringField(3,n[r]);var a=i.values;for(r=0;r<a.length;r++)t.writeMessage(4,y,a[r])}function u(e,t){var r=e.feature;void 0!==r.id&&t.writeVarintField(1,r.id),t.writeMessage(2,c,e),t.writeVarintField(3,r.type),t.writeMessage(4,f,r)}function c(e,t){var r=e.feature,i=e.keys,n=e.values,a=e.keycache,s=e.valuecache;for(var o in r.properties){var l=r.properties[o],u=a[o];if(null!==l){typeof u>"u"&&(i.push(o),u=i.length-1,a[o]=u),t.writeVarint(u);var c=typeof l;"string"!==c&&"boolean"!==c&&"number"!==c&&(l=JSON.stringify(l));var h=c+":"+l,p=s[h];typeof p>"u"&&(n.push(l),p=n.length-1,s[h]=p),t.writeVarint(p)}}}function h(e,t){return(t<<3)+(7&e)}function d(e){return e<<1^e>>31}function f(e,t){for(var r=e.loadGeometry(),i=e.type,n=0,a=0,s=r.length,o=0;o<s;o++){var l=r[o],u=1;1===i&&(u=l.length),t.writeVarint(h(1,u));for(var c=3===i?l.length-1:l.length,p=0;p<c;p++){1===p&&1!==i&&t.writeVarint(h(2,c-1));var f=l[p].x-n,y=l[p].y-a;t.writeVarint(d(f)),t.writeVarint(d(y)),n+=f,a+=y}3===i&&t.writeVarint(h(7,1))}}function y(e,t){var r=typeof e;"string"===r?t.writeStringField(1,e):"boolean"===r?t.writeBooleanField(7,e):"number"===r&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e))}t.exports=n,t.exports.fromVectorTileJs=n,t.exports.fromGeojsonVt=a,t.exports.GeoJSONWrapper=i,l(n,"fromVectorTileJs"),l(a,"fromGeojsonVt"),l(s,"writeTile"),l(o,"writeLayer"),l(u,"writeFeature"),l(c,"writeProperties"),l(h,"command"),l(d,"zigzag"),l(f,"writeGeometry"),l(y,"writeValue")}));p(),p(),p();h(d(),1);var P=h(f(),1);function C(e){if(e<=0)return 0;if(e>=1)return 1;let t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function z(e,t,r,i){let n=new P.default(e,t,r,i);return function(e){return n.solve(e)}}l(C,"easeCubicInOut"),l(z,"bezier");z(.25,.1,.25,1);function B(e,t,r){return Math.min(r,Math.max(t,e))}function V(e,t,r){let i=r-t,n=((e-t)%i+i)%i+t;return n===t?r:n}function E(e,...t){for(let r of t)for(let t in r)e[t]=r[t];return e}function F(e){return Math.log(e)/Math.LN2%1==0}function T(e,t,r){let i={};for(let n in e)i[n]=t.call(r||this,e[n],n,e);return i}function L(e,t,r){let i={};for(let n in e)t.call(r||this,e[n],n,e)&&(i[n]=e[n]);return i}function D(e){return Array.isArray(e)?e.map(D):"object"==typeof e&&e?T(e,D):e}function O(e,t){for(let r=0;r<e.length;r++)if(t.indexOf(e[r])>=0)return!0;return!1}l(B,"clamp"),l(V,"wrap"),l(E,"extend"),l(F,"isPowerOfTwo"),l(T,"mapObject"),l(L,"filterObject"),l(D,"clone"),l(O,"arraysIntersect");var R={};function q(e){R[e]||(typeof console<"u"&&console.warn(e),R[e]=!0)}function U(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function j(e){let t=0;for(let r,i,n=0,a=e.length,s=a-1;n<a;s=n++)r=e[n],i=e[s],t+=(i.x-r.x)*(r.y+i.y);return t}function N(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}l(q,"warnOnce"),l(U,"isCounterClockwise"),l(j,"calculateSignedArea"),l(N,"isWorker");var Z=null;function J(e){if(null==Z){let t=e.navigator?e.navigator.userAgent:null;Z=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return Z}function G(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap}l(J,"isSafari"),l(G,"isImageBitmap"),p(),p();var K=class e{constructor(e,t,r){let i=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let n=new Int32Array(this.arrayBuffer);e=n[0],t=n[1],r=n[2],this.d=t+2*r;for(let e=0;e<this.d*this.d;e++){let t=n[3+e],r=n[3+e+1];i.push(t===r?null:n.subarray(t,r))}let a=n[3+i.length],s=n[3+i.length+1];this.keys=n.subarray(a,s),this.bboxes=n.subarray(s),this.insert=this._insertReadonly}else{this.d=t+2*r;for(let e=0;e<this.d*this.d;e++)i.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;let n=r/t*e;this.min=-n,this.max=e+n}insert(e,t,r,i,n){this._forEachCell(t,r,i,n,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,t,r,i,n,a){this.cells[n].push(a)}query(e,t,r,i,n){let a=this.min,s=this.max;if(e<=a&&t<=a&&s<=r&&s<=i&&!n)return Array.prototype.slice.call(this.keys);{let a=[],s={};return this._forEachCell(e,t,r,i,this._queryCell,a,s,n),a}}_queryCell(e,t,r,i,n,a,s,o){let l=this.cells[n];if(null!==l){let n=this.keys,u=this.bboxes;for(let c=0;c<l.length;c++){let h=l[c];if(void 0===s[h]){let l=4*h;(o?o(u[l+0],u[l+1],u[l+2],u[l+3]):e<=u[l+2]&&t<=u[l+3]&&r>=u[l+0]&&i>=u[l+1])?(s[h]=!0,a.push(n[h])):s[h]=!1}}}}_forEachCell(e,t,r,i,n,a,s,o){let l=this._convertToCellCoord(e),u=this._convertToCellCoord(t),c=this._convertToCellCoord(r),h=this._convertToCellCoord(i);for(let p=l;p<=c;p++)for(let l=u;l<=h;l++){let u=this.d*l+p;if((!o||o(this._convertFromCellCoord(p),this._convertFromCellCoord(l),this._convertFromCellCoord(p+1),this._convertFromCellCoord(l+1)))&&n.call(this,e,t,r,i,u,a,s,o))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,t=3+this.cells.length+1+1,r=0;for(let e=0;e<this.cells.length;e++)r+=this.cells[e].length;let i=new Int32Array(t+r+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;let n=t;for(let t=0;t<e.length;t++){let r=e[t];i[3+t]=n,i.set(r,n),n+=r.length}return i[3+e.length]=n,i.set(this.keys,n),n+=this.keys.length,i[3+e.length+1]=n,i.set(this.bboxes,n),n+=this.bboxes.length,i.buffer}static serialize(e,t){let r=e.toArrayBuffer();return t&&t.push(r),{buffer:r}}static deserialize(t){return new e(t.buffer)}};l(K,"TransferableGridIndex");var X=K;p();var Y=h(f(),1),H={$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"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},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:{required:!0,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",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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:{},"viewport-glyph":{},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-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},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"}}},W=["type","source","source-layer","minzoom","maxzoom","filter","layout"],$=class{constructor(e,t,r,i){this.message=(e?"".concat(e,": "):"")+r,i&&(this.identifier=i),null!=t&&t.__line__&&(this.line=t.__line__)}};l($,"ValidationError");var Q=$;function ee(e,...t){for(let r of t)for(let t in r)e[t]=r[t];return e}l(ee,"extendBy");var te=class extends Error{constructor(e,t){super(t),this.message=t,this.key=e}};l(te,"ExpressionParsingError");var re=te,ie=class e{constructor(e,t=[]){this.parent=e,this.bindings={};for(let[e,r]of t)this.bindings[e]=r}concat(t){return new e(this,t)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error("".concat(e," not found in scope."))}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}};l(ie,"Scope");var ne=ie,ae={kind:"null"},se={kind:"number"},oe={kind:"string"},le={kind:"boolean"},ue={kind:"color"},ce={kind:"object"},he={kind:"value"},pe={kind:"collator"},de={kind:"formatted"},fe={kind:"padding"},ye={kind:"resolvedImage"},me={kind:"variableAnchorOffsetCollection"};function ge(e,t){return{kind:"array",itemType:e,N:t}}function xe(e){if("array"===e.kind){let t=xe(e.itemType);return"number"==typeof e.N?"array<".concat(t,", ").concat(e.N,">"):"value"===e.itemType.kind?"array":"array<".concat(t,">")}return e.kind}l(ge,"array$1"),l(xe,"toString$1");var ve=[ae,se,oe,le,ue,de,ce,ge(he),fe,ye,me];function be(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!be(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(let e of ve)if(!be(e,t))return null}return"Expected ".concat(xe(e)," but found ").concat(xe(t)," instead.")}function we(e,t){return t.some((t=>t.kind===e.kind))}function _e(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}function Se(e,t){return"array"===e.kind&&"array"===t.kind?e.itemType.kind===t.itemType.kind&&"number"==typeof e.N:e.kind===t.kind}l(be,"checkSubtype"),l(we,"isValidType"),l(_e,"isValidNativeType"),l(Se,"verifyType");var Ae=.96422,ke=.82521,Ie=4/29,Me=6/29,Pe=3*Me*Me,Ce=Me*Me*Me,ze=Math.PI/180,Be=180/Math.PI;function Ve(e){return(e%=360)<0&&(e+=360),e}function Ee([e,t,r,i]){let n,a,s=Te((.2225045*(e=Fe(e))+.7168786*(t=Fe(t))+.0606169*(r=Fe(r)))/1);e===t&&t===r?n=a=s:(n=Te((.4360747*e+.3850649*t+.1430804*r)/Ae),a=Te((.0139322*e+.0971045*t+.7141733*r)/ke));let o=116*s-16;return[o<0?0:o,500*(n-s),200*(s-a),i]}function Fe(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Te(e){return e>Ce?Math.pow(e,1/3):e/Pe+Ie}function Le([e,t,r,i]){let n=(e+16)/116,a=isNaN(t)?n:n+t/500,s=isNaN(r)?n:n-r/200;return n=1*Oe(n),a=Ae*Oe(a),s=ke*Oe(s),[De(3.1338561*a-1.6168667*n-.4906146*s),De(-.9787684*a+1.9161415*n+.033454*s),De(.0719453*a-.2289914*n+1.4052427*s),i]}function De(e){return(e=e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055)<0?0:e>1?1:e}function Oe(e){return e>Me?e*e*e:Pe*(e-Ie)}function Re(e){let[t,r,i,n]=Ee(e),a=Math.sqrt(r*r+i*i);return[Math.round(1e4*a)?Ve(Math.atan2(i,r)*Be):NaN,a,t,n]}function qe([e,t,r,i]){return e=isNaN(e)?0:e*ze,Le([r,Math.cos(e)*t,Math.sin(e)*t,i])}function Ue([e,t,r,i]){function n(i){let n=(i+e/30)%12,a=t*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(n-3,9-n,1))}return e=Ve(e),t/=100,r/=100,l(n,"f"),[n(0),n(8),n(4),i]}function je(e){if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];let t=Ke[e];if(t){let[e,r,i]=t;return[e/255,r/255,i/255,1]}if(e.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){let t=e.length<6?1:2,r=1;return[Ne(e.slice(r,r+=t)),Ne(e.slice(r,r+=t)),Ne(e.slice(r,r+=t)),Ne(e.slice(r,r+t)||"ff")]}if(e.startsWith("rgb")){let t=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,r=e.match(t);if(r){let[e,t,i,n,a,s,o,l,u,c,h,p]=r,d=[n||" ",o||" ",c].join("");if(" "===d||" /"===d||",,"===d||",,,"===d){let e=[i,s,u].join(""),r="%%%"===e?100:""===e?255:0;if(r){let e=[Je(+t/r,0,1),Je(+a/r,0,1),Je(+l/r,0,1),h?Ze(+h,p):1];if(Ge(e))return e}}return}}let r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){let[e,t,i,n,a,s,o,l,u]=r,c=[i||" ",a||" ",o].join("");if(" "===c||" /"===c||",,"===c||",,,"===c){let e=[+t,Je(+n,0,100),Je(+s,0,100),l?Ze(+l,u):1];if(Ge(e))return Ue(e)}}}function Ne(e){return parseInt(e.padEnd(2,e),16)/255}function Ze(e,t){return Je(t?e/100:e,0,1)}function Je(e,t,r){return Math.min(Math.max(t,e),r)}function Ge(e){return!e.some(Number.isNaN)}l(Ve,"constrainAngle"),l(Ee,"rgbToLab"),l(Fe,"rgb2xyz"),l(Te,"xyz2lab"),l(Le,"labToRgb"),l(De,"xyz2rgb"),l(Oe,"lab2xyz"),l(Re,"rgbToHcl"),l(qe,"hclToRgb"),l(Ue,"hslToRgb"),l(je,"parseCssColor"),l(Ne,"parseHex"),l(Ze,"parseAlpha"),l(Je,"clamp"),l(Ge,"validateNumbers");var Ke={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Xe=class e{constructor(e,t,r,i=1,n=!0){this.r=e,this.g=t,this.b=r,this.a=i,n||(this.r*=i,this.g*=i,this.b*=i,i||this.overwriteGetter("rgb",[e,t,r,i]))}static parse(t){if(t instanceof e)return t;if("string"!=typeof t)return;let r=je(t);return r?new e(...r,!1):void 0}get rgb(){let{r:e,g:t,b:r,a:i}=this,n=i||1/0;return this.overwriteGetter("rgb",[e/n,t/n,r/n,i])}get hcl(){return this.overwriteGetter("hcl",Re(this.rgb))}get lab(){return this.overwriteGetter("lab",Ee(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){let[e,t,r,i]=this.rgb;return"rgba(".concat([e,t,r].map((e=>Math.round(255*e))).join(","),",").concat(i,")")}};l(Xe,"Color");var Ye=Xe;Ye.black=new Ye(0,0,0,1),Ye.white=new Ye(1,1,1,1),Ye.transparent=new Ye(0,0,0,0),Ye.red=new Ye(1,0,0,1);var He=class{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}};l(He,"Collator");var We=He,$e=class{constructor(e,t,r,i,n){this.text=e,this.image=t,this.scale=r,this.fontStack=i,this.textColor=n}};l($e,"FormattedSection");var Qe=$e,et=class e{constructor(e){this.sections=e}static fromString(t){return new e([new Qe(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.name.length))}static factory(t){return t instanceof e?t:e.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}};l(et,"Formatted");var tt=et,rt=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if("number"==typeof t)return new e([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(let e of t)if("number"!=typeof e)return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new e(t)}}toString(){return JSON.stringify(this.values)}};l(rt,"Padding");var it=rt,nt=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]),at=class e{constructor(e){this.values=e.slice()}static parse(t){if(t instanceof e)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let e=0;e<t.length;e+=2){let r=t[e],i=t[e+1];if("string"!=typeof r||!nt.has(r)||!Array.isArray(i)||2!==i.length||"number"!=typeof i[0]||"number"!=typeof i[1])return}return new e(t)}}toString(){return JSON.stringify(this.values)}};l(at,"VariableAnchorOffsetCollection");var st=at,ot=class e{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(t){return t?new e({name:t,available:!1}):null}};l(ot,"ResolvedImage");var lt=ot;function ut(e,t,r,i){if(!("number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255)){return"Invalid rgba value [".concat(("number"==typeof i?[e,t,r,i]:[e,t,r]).join(", "),"]: 'r', 'g', and 'b' must be between 0 and 255.")}return typeof i>"u"||"number"==typeof i&&i>=0&&i<=1?null:"Invalid rgba value [".concat([e,t,r,i].join(", "),"]: 'a' must be between 0 and 1.")}function ct(e){if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||e instanceof Ye||e instanceof We||e instanceof tt||e instanceof it||e instanceof st||e instanceof lt)return!0;if(Array.isArray(e)){for(let t of e)if(!ct(t))return!1;return!0}if("object"==typeof e){for(let t in e)if(!ct(e[t]))return!1;return!0}return!1}function ht(e){if(null===e)return ae;if("string"==typeof e)return oe;if("boolean"==typeof e)return le;if("number"==typeof e)return se;if(e instanceof Ye)return ue;if(e instanceof We)return pe;if(e instanceof tt)return de;if(e instanceof it)return fe;if(e instanceof st)return me;if(e instanceof lt)return ye;if(Array.isArray(e)){let t,r=e.length;for(let r of e){let e=ht(r);if(t){if(t===e)continue;t=he;break}t=e}return ge(t||he,r)}return ce}function pt(e){let t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Ye||e instanceof tt||e instanceof it||e instanceof st||e instanceof lt?e.toString():JSON.stringify(e)}l(ut,"validateRGBA"),l(ct,"isValue"),l(ht,"typeOf"),l(pt,"toString");var dt=class e{constructor(e,t){this.type=e,this.value=t}static parse(t,r){if(2!==t.length)return r.error("'literal' expression requires exactly one argument, but found ".concat(t.length-1," instead."));if(!ct(t[1]))return r.error("invalid value");let i=t[1],n=ht(i),a=r.expectedType;return"array"===n.kind&&0===n.N&&a&&"array"===a.kind&&("number"!=typeof a.N||0===a.N)&&(n=a),new e(n,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}};l(dt,"Literal");var ft=dt,yt=class{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}};l(yt,"RuntimeError");var mt=yt,gt={string:oe,number:se,boolean:le,object:ce},xt=class e{constructor(e,t){this.type=e,this.args=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i,n=1,a=t[0];if("array"===a){let e,a;if(t.length>2){let i=t[1];if("string"!=typeof i||!(i in gt)||"object"===i)return r.error('The item type argument of "array" must be one of string, number, boolean',1);e=gt[i],n++}else e=he;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return r.error('The length argument to "array" must be a positive integer literal',2);a=t[2],n++}i=ge(e,a)}else{if(!gt[a])throw new Error("Types doesn't contain name = ".concat(a));i=gt[a]}let s=[];for(;n<t.length;n++){let e=r.parse(t[n],n,he);if(!e)return null;s.push(e)}return new e(i,s)}evaluate(e){for(let t=0;t<this.args.length;t++){let r=this.args[t].evaluate(e);if(!be(this.type,ht(r)))return r;if(t===this.args.length-1)throw new mt("Expected value to be of type ".concat(xe(this.type),", but found ").concat(xe(ht(r))," instead."))}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}};l(xt,"Assertion");var vt=xt,bt={"to-boolean":le,"to-color":ue,"to-number":se,"to-string":oe},wt=class e{constructor(e,t){this.type=e,this.args=t}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i=t[0];if(!bt[i])throw new Error("Can't parse ".concat(i," as it is not part of the known types"));if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return r.error("Expected one argument.");let n=bt[i],a=[];for(let e=1;e<t.length;e++){let i=r.parse(t[e],e,he);if(!i)return null;a.push(i)}return new e(n,a)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let t,r;for(let i of this.args){if(t=i.evaluate(e),r=null,t instanceof Ye)return t;if("string"==typeof t){let r=e.parseColor(t);if(r)return r}else if(Array.isArray(t)&&(r=t.length<3||t.length>4?"Invalid rbga value ".concat(JSON.stringify(t),": expected an array containing either three or four numeric values."):ut(t[0],t[1],t[2],t[3]),!r))return new Ye(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new mt(r||"Could not parse color from value '".concat("string"==typeof t?t:JSON.stringify(t),"'"))}case"padding":{let t;for(let r of this.args){t=r.evaluate(e);let i=it.parse(t);if(i)return i}throw new mt("Could not parse padding from value '".concat("string"==typeof t?t:JSON.stringify(t),"'"))}case"variableAnchorOffsetCollection":{let t;for(let r of this.args){t=r.evaluate(e);let i=st.parse(t);if(i)return i}throw new mt("Could not parse variableAnchorOffsetCollection from value '".concat("string"==typeof t?t:JSON.stringify(t),"'"))}case"number":{let t=null;for(let r of this.args){if(t=r.evaluate(e),null===t)return 0;let i=Number(t);if(!isNaN(i))return i}throw new mt("Could not convert ".concat(JSON.stringify(t)," to number."))}case"formatted":return tt.fromString(pt(this.args[0].evaluate(e)));case"resolvedImage":return lt.fromString(pt(this.args[0].evaluate(e)));default:return pt(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}};l(wt,"Coercion");var _t=wt,St=["Unknown","Point","LineString","Polygon"],At=class{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?St[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=Ye.parse(e)),t}};l(At,"EvaluationContext");var kt=At,It=class e{constructor(e,t,r=[],i,n=new ne,a=[]){this.registry=e,this.path=r,this.key=r.map((e=>"[".concat(e,"]"))).join(""),this.scope=n,this.errors=a,this.expectedType=i,this._isConstant=t}parse(e,t,r,i,n={}){return t?this.concat(t,r,i)._parse(e,n):this._parse(e,n)}_parse(e,t){function r(e,t,r){return"assert"===r?new vt(t,[e]):"coerce"===r?new _t(t,[e]):e}if((null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e)&&(e=["literal",e]),l(r,"annotate"),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let i=e[0];if("string"!=typeof i)return this.error("Expression name must be a string, but found ".concat(typeof i,' instead. If you wanted a literal array, use ["literal", [...]].'),0),null;let n=this.registry[i];if(n){let i=n.parse(e,this);if(!i)return null;if(this.expectedType){let e=this.expectedType,n=i.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==n.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==n.kind&&"string"!==n.kind)if("padding"!==e.kind||"value"!==n.kind&&"number"!==n.kind&&"array"!==n.kind)if("variableAnchorOffsetCollection"!==e.kind||"value"!==n.kind&&"array"!==n.kind){if(this.checkSubtype(e,n))return null}else i=r(i,e,t.typeAnnotation||"coerce");else i=r(i,e,t.typeAnnotation||"coerce");else i=r(i,e,t.typeAnnotation||"coerce");else i=r(i,e,t.typeAnnotation||"assert")}if(!(i instanceof ft)&&"resolvedImage"!==i.type.kind&&this._isConstant(i)){let e=new kt;try{i=new ft(i.type,i.evaluate(e))}catch(e){return this.error(e.message),null}}return i}return this.error('Unknown expression "'.concat(i,'". If you wanted a literal array, use ["literal", [...]].'),0)}return typeof e>"u"?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error("Expected an array, but found ".concat(typeof e," instead."))}concat(t,r,i){let n="number"==typeof t?this.path.concat(t):this.path,a=i?this.scope.concat(i):this.scope;return new e(this.registry,this._isConstant,n,r||null,a,this.errors)}error(e,...t){let r="".concat(this.key).concat(t.map((e=>"[".concat(e,"]"))).join(""));this.errors.push(new re(r,e))}checkSubtype(e,t){let r=be(e,t);return r&&this.error(r),r}};l(It,"ParsingContext");var Mt=It,Pt=class e{constructor(e,t,r){this.type=pe,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(t,r){if(2!==t.length)return r.error("Expected one argument.");let i=t[1];if("object"!=typeof i||Array.isArray(i))return r.error("Collator options argument must be an object.");let n=r.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,le);if(!n)return null;let a=r.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,le);if(!a)return null;let s=null;return i.locale&&(s=r.parse(i.locale,1,oe),!s)?null:new e(n,a,s)}evaluate(e){return new We(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}};l(Pt,"CollatorExpression");var Ct=Pt,zt=8192;function Bt(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function Vt(e){return(180+e)/360}function Et(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Ft(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function Tt(e,t){let r=Vt(e[0]),i=Et(e[1]),n=Math.pow(2,t.z);return[Math.round(r*n*zt),Math.round(i*n*zt)]}function Lt(e,t,r){let i=e[0]-t[0],n=e[1]-t[1],a=e[0]-r[0],s=e[1]-r[1];return i*s-a*n===0&&i*a<=0&&n*s<=0}function Dt(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function Ot(e,t){let r=!1;for(let i=0,n=t.length;i<n;i++){let n=t[i];for(let t=0,i=n.length;t<i-1;t++){if(Lt(e,n[t],n[t+1]))return!1;Dt(e,n[t],n[t+1])&&(r=!r)}}return r}function Rt(e,t){for(let r=0;r<t.length;r++)if(Ot(e,t[r]))return!0;return!1}function qt(e,t){return e[0]*t[1]-e[1]*t[0]}function Ut(e,t,r,i){let n=e[0]-r[0],a=e[1]-r[1],s=t[0]-r[0],o=t[1]-r[1],l=i[0]-r[0],u=i[1]-r[1],c=n*u-l*a,h=s*u-l*o;return c>0&&h<0||c<0&&h>0}function jt(e,t,r,i){let n=[t[0]-e[0],t[1]-e[1]];return 0!==qt([i[0]-r[0],i[1]-r[1]],n)&&!(!Ut(e,t,r,i)||!Ut(r,i,e,t))}function Nt(e,t,r){for(let i of r)for(let r=0;r<i.length-1;++r)if(jt(e,t,i[r],i[r+1]))return!0;return!1}function Zt(e,t){for(let r=0;r<e.length;++r)if(!Ot(e[r],t))return!1;for(let r=0;r<e.length-1;++r)if(Nt(e[r],e[r+1],t))return!1;return!0}function Jt(e,t){for(let r=0;r<t.length;r++)if(Zt(e,t[r]))return!0;return!1}function Gt(e,t,r){let i=[];for(let n=0;n<e.length;n++){let a=[];for(let i=0;i<e[n].length;i++){let s=Tt(e[n][i],r);Bt(t,s),a.push(s)}i.push(a)}return i}function Kt(e,t,r){let i=[];for(let n=0;n<e.length;n++){let a=Gt(e[n],t,r);i.push(a)}return i}function Xt(e,t,r,i){if(e[0]<r[0]||e[0]>r[2]){let t=.5*i,n=e[0]-r[0]>t?-i:r[0]-e[0]>t?i:0;0===n&&(n=e[0]-r[2]>t?-i:r[2]-e[0]>t?i:0),e[0]+=n}Bt(t,e)}function Yt(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}function Ht(e,t,r,i){let n=Math.pow(2,i.z)*zt,a=[i.x*zt,i.y*zt],s=[];for(let i of e)for(let e of i){let i=[e.x+a[0],e.y+a[1]];Xt(i,t,r,n),s.push(i)}return s}function Wt(e,t,r,i){let n=Math.pow(2,i.z)*zt,a=[i.x*zt,i.y*zt],s=[];for(let r of e){let e=[];for(let i of r){let r=[i.x+a[0],i.y+a[1]];Bt(t,r),e.push(r)}s.push(e)}if(t[2]-t[0]<=n/2){Yt(t);for(let e of s)for(let i of e)Xt(i,t,r,n)}return s}function $t(e,t){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if("Polygon"===t.type){let a=Gt(t.coordinates,i,n),s=Ht(e.geometry(),r,i,n);if(!Ft(r,i))return!1;for(let e of s)if(!Ot(e,a))return!1}if("MultiPolygon"===t.type){let a=Kt(t.coordinates,i,n),s=Ht(e.geometry(),r,i,n);if(!Ft(r,i))return!1;for(let e of s)if(!Rt(e,a))return!1}return!0}function Qt(e,t){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if("Polygon"===t.type){let a=Gt(t.coordinates,i,n),s=Wt(e.geometry(),r,i,n);if(!Ft(r,i))return!1;for(let e of s)if(!Zt(e,a))return!1}if("MultiPolygon"===t.type){let a=Kt(t.coordinates,i,n),s=Wt(e.geometry(),r,i,n);if(!Ft(r,i))return!1;for(let e of s)if(!Jt(e,a))return!1}return!0}l(Bt,"updateBBox"),l(Vt,"mercatorXfromLng"),l(Et,"mercatorYfromLat"),l(Ft,"boxWithinBox"),l(Tt,"getTileCoordinates"),l(Lt,"onBoundary"),l(Dt,"rayIntersect"),l(Ot,"pointWithinPolygon"),l(Rt,"pointWithinPolygons"),l(qt,"perp"),l(Ut,"twoSided"),l(jt,"lineIntersectLine"),l(Nt,"lineIntersectPolygon"),l(Zt,"lineStringWithinPolygon"),l(Jt,"lineStringWithinPolygons"),l(Gt,"getTilePolygon"),l(Kt,"getTilePolygons"),l(Xt,"updatePoint"),l(Yt,"resetBBox"),l(Ht,"getTilePoints"),l(Wt,"getTileLines"),l($t,"pointsWithinPolygons"),l(Qt,"linesWithinPolygons");var er=class e{constructor(e,t){this.type=le,this.geojson=e,this.geometries=t}static parse(t,r){if(2!==t.length)return r.error("'within' expression requires exactly one argument, but found ".concat(t.length-1," instead."));if(ct(t[1])){let r=t[1];if("FeatureCollection"===r.type)for(let t=0;t<r.features.length;++t){let i=r.features[t].geometry.type;if("Polygon"===i||"MultiPolygon"===i)return new e(r,r.features[t].geometry)}else if("Feature"===r.type){let t=r.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new e(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new e(r,r)}return r.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return $t(e,this.geometries);if("LineString"===e.geometryType())return Qt(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}};l(er,"Within");var tr=er,rr=class e{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(t,r){if(2!==t.length||"string"!=typeof t[1])return r.error("'var' expression requires exactly one string literal argument.");let i=t[1];return r.scope.has(i)?new e(i,r.scope.get(i)):r.error('Unknown variable "'.concat(i,'". Make sure "').concat(i,'" has been bound in an enclosing "let" expression before using it.'),1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}};l(rr,"Var");var ir=rr,nr=class e{constructor(e,t,r,i){this.name=e,this.type=t,this._evaluate=r,this.args=i}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(t,r){let i=t[0],n=e.definitions[i];if(!n)return r.error('Unknown expression "'.concat(i,'". If you wanted a literal array, use ["literal", [...]].'),0);let a=Array.isArray(n)?n[0]:n.type,s=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,o=s.filter((([e])=>!Array.isArray(e)||e.length===t.length-1)),l=null;for(let[n,s]of o){l=new Mt(r.registry,or,r.path,null,r.scope);let o=[],u=!1;for(let e=1;e<t.length;e++){let r=t[e],i=Array.isArray(n)?n[e-1]:n.type,a=l.parse(r,1+o.length,i);if(!a){u=!0;break}o.push(a)}if(!u){if(Array.isArray(n)&&n.length!==o.length){l.error("Expected ".concat(n.length," arguments, but found ").concat(o.length," instead."));continue}for(let e=0;e<o.length;e++){let t=Array.isArray(n)?n[e]:n.type,r=o[e];l.concat(e+1).checkSubtype(t,r.type)}if(0===l.errors.length)return new e(i,a,s,o)}}if(1===o.length)r.errors.push(...l.errors);else{let e=(o.length?o:s).map((([e])=>sr(e))).join(" | "),i=[];for(let e=1;e<t.length;e++){let n=r.parse(t[e],1+i.length);if(!n)return null;i.push(xe(n.type))}r.error("Expected arguments of type ".concat(e,", but found (").concat(i.join(", "),") instead."))}return null}static register(t,r){e.definitions=r;for(let i in r)t[i]=e}};l(nr,"CompoundExpression");var ar=nr;function sr(e){return Array.isArray(e)?"(".concat(e.map(xe).join(", "),")"):"(".concat(xe(e.type),"...)")}function or(e){if(e instanceof ir)return or(e.boundExpression);if(e instanceof ar&&"error"===e.name)return!1;if(e instanceof Ct)return!1;if(e instanceof tr)return!1;let t=e instanceof _t||e instanceof vt,r=!0;return e.eachChild((e=>{r=t?r&&or(e):r&&e instanceof ft})),!!r&&(lr(e)&&cr(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]))}function lr(e){if(e instanceof ar){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof tr)return!1;let t=!0;return e.eachChild((e=>{t&&!lr(e)&&(t=!1)})),t}function ur(e){if(e instanceof ar&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!ur(e)&&(t=!1)})),t}function cr(e,t){if(e instanceof ar&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild((e=>{r&&!cr(e,t)&&(r=!1)})),r}function hr(e,t){let r,i,n=e.length-1,a=0,s=n,o=0;for(;a<=s;)if(o=Math.floor((a+s)/2),r=e[o],i=e[o+1],r<=t){if(o===n||t<i)return o;a=o+1}else{if(!(r>t))throw new mt("Input is not a number.");s=o-1}return 0}l(sr,"stringifySignature"),l(or,"isExpressionConstant"),l(lr,"isFeatureConstant"),l(ur,"isStateConstant"),l(cr,"isGlobalPropertyConstant"),l(hr,"findStopLessThanOrEqualTo");var pr=class e{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(let[e,t]of r)this.labels.push(e),this.outputs.push(t)}static parse(t,r){if(t.length-1<4)return r.error("Expected at least 4 arguments, but found only ".concat(t.length-1,"."));if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");let i=r.parse(t[1],1,se);if(!i)return null;let n=[],a=null;r.expectedType&&"value"!==r.expectedType.kind&&(a=r.expectedType);for(let e=1;e<t.length;e+=2){let i=1===e?-1/0:t[e],s=t[e+1],o=e,l=e+1;if("number"!=typeof i)return r.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',o);if(n.length&&n[n.length-1][0]>=i)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',o);let u=r.parse(s,l,a);if(!u)return null;a=a||u.type,n.push([i,u])}return new e(a,i,n)}evaluate(e){let t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);let i=this.input.evaluate(e);if(i<=t[0])return r[0].evaluate(e);let n=t.length;return i>=t[n-1]?r[n-1].evaluate(e):r[hr(t,i)].evaluate(e)}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}};l(pr,"Step");var dr=pr;function fr(e){return"rgb"===e||"hcl"===e||"lab"===e}function yr(e,t,r){return e+r*(t-e)}function mr(e,t,r,i="rgb"){switch(i){case"rgb":{let[i,n,a,s]=gr(e.rgb,t.rgb,r);return new Ye(i,n,a,s,!1)}case"hcl":{let i,n,[a,s,o,l]=e.hcl,[u,c,h,p]=t.hcl;if(isNaN(a)||isNaN(u))isNaN(a)?isNaN(u)?i=NaN:(i=u,(1===o||0===o)&&(n=c)):(i=a,(1===h||0===h)&&(n=s));else{let e=u-a;u>a&&e>180?e-=360:u<a&&a-u>180&&(e+=360),i=a+r*e}let[d,f,y,m]=qe([i,null!=n?n:yr(s,c,r),yr(o,h,r),yr(l,p,r)]);return new Ye(d,f,y,m,!1)}case"lab":{let[i,n,a,s]=Le(gr(e.lab,t.lab,r));return new Ye(i,n,a,s,!1)}}}function gr(e,t,r){return e.map(((e,i)=>yr(e,t[i],r)))}function xr(e,t,r){return new it(gr(e.values,t.values,r))}function vr(e,t,r){let i=e.values,n=t.values;if(i.length!==n.length)throw new mt("Cannot interpolate values of different length. from: ".concat(e.toString(),", to: ").concat(t.toString()));let a=[];for(let e=0;e<i.length;e+=2){if(i[e]!==n[e])throw new mt("Cannot interpolate values containing mismatched anchors. from[".concat(e,"]: ").concat(i[e],", to[").concat(e,"]: ").concat(n[e]));a.push(i[e]);let[t,s]=i[e+1],[o,l]=n[e+1];a.push([yr(t,o,r),yr(s,l,r)])}return new st(a)}l(fr,"isSupportedInterpolationColorSpace"),l(yr,"number"),l(mr,"color"),l(gr,"array"),l(xr,"padding"),l(vr,"variableAnchorOffsetCollection");var br={number:yr,color:mr,array:gr,padding:xr,variableAnchorOffsetCollection:vr},wr=class e{constructor(e,t,r,i,n){this.type=e,this.operator=t,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];for(let[e,t]of n)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,r,i){let n=0;if("exponential"===e.name)n=Sr(t,e.base,r,i);else if("linear"===e.name)n=Sr(t,1,r,i);else if("cubic-bezier"===e.name){let a=e.controlPoints;n=new Y.default(a[0],a[1],a[2],a[3]).solve(Sr(t,1,r,i))}return n}static parse(t,r){let[i,n,a,...s]=t;if(!Array.isArray(n)||0===n.length)return r.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){let e=n[1];if("number"!=typeof e)return r.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return r.error("Unknown interpolation type ".concat(String(n[0])),1,0);{let e=n.slice(1);if(4!==e.length||e.some((e=>"number"!=typeof e||e<0||e>1)))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:e}}}if(t.length-1<4)return r.error("Expected at least 4 arguments, but found only ".concat(t.length-1,"."));if((t.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(a=r.parse(a,2,se),!a)return null;let o=[],l=null;"interpolate-hcl"===i||"interpolate-lab"===i?l=ue:r.expectedType&&"value"!==r.expectedType.kind&&(l=r.expectedType);for(let e=0;e<s.length;e+=2){let t=s[e],i=s[e+1],n=e+3,a=e+4;if("number"!=typeof t)return r.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',n);if(o.length&&o[o.length-1][0]>=t)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);let u=r.parse(i,a,l);if(!u)return null;l=l||u.type,o.push([t,u])}return Se(l,se)||Se(l,ue)||Se(l,fe)||Se(l,me)||Se(l,ge(se))?new e(l,i,n,a,o):r.error("Type ".concat(xe(l)," is not interpolatable."))}evaluate(t){let r=this.labels,i=this.outputs;if(1===r.length)return i[0].evaluate(t);let n=this.input.evaluate(t);if(n<=r[0])return i[0].evaluate(t);let a=r.length;if(n>=r[a-1])return i[a-1].evaluate(t);let s=hr(r,n),o=r[s],l=r[s+1],u=e.interpolationFactor(this.interpolation,n,o,l),c=i[s].evaluate(t),h=i[s+1].evaluate(t);switch(this.operator){case"interpolate":return br[this.type.kind](c,h,u);case"interpolate-hcl":return br.color(c,h,u,"hcl");case"interpolate-lab":return br.color(c,h,u,"lab")}}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}};l(wr,"Interpolate");var _r=wr;function Sr(e,t,r,i){let n=i-r,a=e-r;return 0===n?0:1===t?a/n:(Math.pow(t,a)-1)/(Math.pow(t,n)-1)}l(Sr,"exponentialInterpolation");var Ar=class e{constructor(e,t){this.type=e,this.args=t}static parse(t,r){if(t.length<2)return r.error("Expectected at least one argument.");let i=null,n=r.expectedType;n&&"value"!==n.kind&&(i=n);let a=[];for(let e of t.slice(1)){let t=r.parse(e,1+a.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,a.push(t)}if(!i)throw new Error("No output type");return n&&a.some((e=>be(n,e.type)))?new e(he,a):new e(i,a)}evaluate(e){let t,r=null,i=0;for(let n of this.args)if(i++,r=n.evaluate(e),r&&r instanceof lt&&!r.available&&(t||(t=r.name),r=null,i===this.args.length&&(r=t)),null!==r)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}};l(Ar,"Coalesce");var kr=Ar,Ir=class e{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let t of this.bindings)e(t[1]);e(this.result)}static parse(t,r){if(t.length<4)return r.error("Expected at least 3 arguments, but found ".concat(t.length-1," instead."));let i=[];for(let e=1;e<t.length-1;e+=2){let n=t[e];if("string"!=typeof n)return r.error("Expected string, but found ".concat(typeof n," instead."),e);if(/[^a-zA-Z0-9_]/.test(n))return r.error("Variable names must contain only alphanumeric characters or '_'.",e);let a=r.parse(t[e+1],e+1);if(!a)return null;i.push([n,a])}let n=r.parse(t[t.length-1],t.length-1,r.expectedType,i);return n?new e(i,n):null}outputDefined(){return this.result.outputDefined()}};l(Ir,"Let");var Mr=Ir,Pr=class e{constructor(e,t,r){this.type=e,this.index=t,this.input=r}static parse(t,r){if(3!==t.length)return r.error("Expected 2 arguments, but found ".concat(t.length-1," instead."));let i=r.parse(t[1],1,se),n=r.parse(t[2],2,ge(r.expectedType||he));if(!i||!n)return null;let a=n.type;return new e(a.itemType,i,n)}evaluate(e){let t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new mt("Array index out of bounds: ".concat(t," < 0."));if(t>=r.length)throw new mt("Array index out of bounds: ".concat(t," > ").concat(r.length-1,"."));if(t!==Math.floor(t))throw new mt("Array index must be an integer, but found ".concat(t," instead."));return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}};l(Pr,"At");var Cr=Pr,zr=class e{constructor(e,t){this.type=le,this.needle=e,this.haystack=t}static parse(t,r){if(3!==t.length)return r.error("Expected 2 arguments, but found ".concat(t.length-1," instead."));let i=r.parse(t[1],1,he),n=r.parse(t[2],2,he);return i&&n?we(i.type,[le,oe,se,ae,he])?new e(i,n):r.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(xe(i.type)," instead")):null}evaluate(e){let t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!_e(t,["boolean","string","number","null"]))throw new mt("Expected first argument to be of type boolean, string, number or null, but found ".concat(xe(ht(t))," instead."));if(!_e(r,["string","array"]))throw new mt("Expected second argument to be of type array or string, but found ".concat(xe(ht(r))," instead."));return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}};l(zr,"In");var Br=zr,Vr=class e{constructor(e,t,r){this.type=se,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(t,r){if(t.length<=2||t.length>=5)return r.error("Expected 3 or 4 arguments, but found ".concat(t.length-1," instead."));let i=r.parse(t[1],1,he),n=r.parse(t[2],2,he);if(!i||!n)return null;if(!we(i.type,[le,oe,se,ae,he]))return r.error("Expected first argument to be of type boolean, string, number or null, but found ".concat(xe(i.type)," instead"));if(4===t.length){let a=r.parse(t[3],3,se);return a?new e(i,n,a):null}return new e(i,n)}evaluate(e){let t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!_e(t,["boolean","string","number","null"]))throw new mt("Expected first argument to be of type boolean, string, number or null, but found ".concat(xe(ht(t))," instead."));if(!_e(r,["string","array"]))throw new mt("Expected second argument to be of type array or string, but found ".concat(xe(ht(r))," instead."));if(this.fromIndex){let i=this.fromIndex.evaluate(e);return r.indexOf(t,i)}return r.indexOf(t)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}};l(Vr,"IndexOf");var Er=Vr,Fr=class e{constructor(e,t,r,i,n,a){this.inputType=e,this.type=t,this.input=r,this.cases=i,this.outputs=n,this.otherwise=a}static parse(t,r){if(t.length<5)return r.error("Expected at least 4 arguments, but found only ".concat(t.length-1,"."));if(t.length%2!=1)return r.error("Expected an even number of arguments.");let i,n;r.expectedType&&"value"!==r.expectedType.kind&&(n=r.expectedType);let a={},s=[];for(let e=2;e<t.length-1;e+=2){let o=t[e],l=t[e+1];Array.isArray(o)||(o=[o]);let u=r.concat(e);if(0===o.length)return u.error("Expected at least one branch label.");for(let e of o){if("number"!=typeof e&&"string"!=typeof e)return u.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return u.error("Branch labels must be integers no larger than ".concat(Number.MAX_SAFE_INTEGER,"."));if("number"==typeof e&&Math.floor(e)!==e)return u.error("Numeric branch labels must be integer values.");if(i){if(u.checkSubtype(i,ht(e)))return null}else i=ht(e);if(typeof a[String(e)]<"u")return u.error("Branch labels must be unique.");a[String(e)]=s.length}let c=r.parse(l,e,n);if(!c)return null;n=n||c.type,s.push(c)}let o=r.parse(t[1],1,he);if(!o)return null;let l=r.parse(t[t.length-1],t.length-1,n);return!l||"value"!==o.type.kind&&r.concat(1).checkSubtype(i,o.type)?null:new e(i,n,o,a,s,l)}evaluate(e){let t=this.input.evaluate(e);return(ht(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}};l(Fr,"Match");var Tr=Fr,Lr=class e{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(t,r){if(t.length<4)return r.error("Expected at least 3 arguments, but found only ".concat(t.length-1,"."));if(t.length%2!=0)return r.error("Expected an odd number of arguments.");let i;r.expectedType&&"value"!==r.expectedType.kind&&(i=r.expectedType);let n=[];for(let e=1;e<t.length-1;e+=2){let a=r.parse(t[e],e,le);if(!a)return null;let s=r.parse(t[e+1],e+1,i);if(!s)return null;n.push([a,s]),i=i||s.type}let a=r.parse(t[t.length-1],t.length-1,i);if(!a)return null;if(!i)throw new Error("Can't infer output type");return new e(i,n,a)}evaluate(e){for(let[t,r]of this.branches)if(t.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[t,r]of this.branches)e(t),e(r);e(this.otherwise)}outputDefined(){return this.branches.every((([e,t])=>t.outputDefined()))&&this.otherwise.outputDefined()}};l(Lr,"Case");var Dr=Lr,Or=class e{constructor(e,t,r,i){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=i}static parse(t,r){if(t.length<=2||t.length>=5)return r.error("Expected 3 or 4 arguments, but found ".concat(t.length-1," instead."));let i=r.parse(t[1],1,he),n=r.parse(t[2],2,se);if(!i||!n)return null;if(!we(i.type,[ge(he),oe,he]))return r.error("Expected first argument to be of type array or string, but found ".concat(xe(i.type)," instead"));if(4===t.length){let a=r.parse(t[3],3,se);return a?new e(i.type,i,n,a):null}return new e(i.type,i,n)}evaluate(e){let t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!_e(t,["string","array"]))throw new mt("Expected first argument to be of type array or string, but found ".concat(xe(ht(t))," instead."));if(this.endIndex){let i=this.endIndex.evaluate(e);return t.slice(r,i)}return t.slice(r)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}};l(Or,"Slice");var Rr=Or;function qr(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function Ur(e,t,r){return t===r}function jr(e,t,r){return t!==r}function Nr(e,t,r){return t<r}function Zr(e,t,r){return t>r}function Jr(e,t,r){return t<=r}function Gr(e,t,r){return t>=r}function Kr(e,t,r,i){return 0===i.compare(t,r)}function Xr(e,t,r,i){return!Kr(0,t,r,i)}function Yr(e,t,r,i){return i.compare(t,r)<0}function Hr(e,t,r,i){return i.compare(t,r)>0}function Wr(e,t,r,i){return i.compare(t,r)<=0}function $r(e,t,r,i){return i.compare(t,r)>=0}function Qr(e,t,r){var i;let n="=="!==e&&"!="!==e;return l(i=class{constructor(e,t,r){this.type=le,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");let r=e[0],a=t.parse(e[1],1,he);if(!a)return null;if(!qr(r,a.type))return t.concat(1).error('"'.concat(r,"\" comparisons are not supported for type '").concat(xe(a.type),"'."));let s=t.parse(e[2],2,he);if(!s)return null;if(!qr(r,s.type))return t.concat(2).error('"'.concat(r,"\" comparisons are not supported for type '").concat(xe(s.type),"'."));if(a.type.kind!==s.type.kind&&"value"!==a.type.kind&&"value"!==s.type.kind)return t.error("Cannot compare types '".concat(xe(a.type),"' and '").concat(xe(s.type),"'."));n&&("value"===a.type.kind&&"value"!==s.type.kind?a=new vt(s.type,[a]):"value"!==a.type.kind&&"value"===s.type.kind&&(s=new vt(a.type,[s])));let o=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==s.type.kind&&"value"!==a.type.kind&&"value"!==s.type.kind)return t.error("Cannot use collator to compare non-string types.");if(o=t.parse(e[3],3,pe),!o)return null}return new i(a,s,o)}evaluate(i){let a=this.lhs.evaluate(i),s=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){let t=ht(a),r=ht(s);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new mt('Expected arguments for "'.concat(e,'" to be (string, string) or (number, number), but found (').concat(t.kind,", ").concat(r.kind,") instead."))}if(this.collator&&!n&&this.hasUntypedArgument){let e=ht(a),r=ht(s);if("string"!==e.kind||"string"!==r.kind)return t(i,a,s)}return this.collator?r(i,a,s,this.collator.evaluate(i)):t(i,a,s)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}},"Comparison"),i}l(qr,"isComparableType"),l(Ur,"eq"),l(jr,"neq"),l(Nr,"lt"),l(Zr,"gt"),l(Jr,"lteq"),l(Gr,"gteq"),l(Kr,"eqCollate"),l(Xr,"neqCollate"),l(Yr,"ltCollate"),l(Hr,"gtCollate"),l(Wr,"lteqCollate"),l($r,"gteqCollate"),l(Qr,"makeComparison");var ei=Qr("==",Ur,Kr),ti=Qr("!=",jr,Xr),ri=Qr("<",Nr,Yr),ii=Qr(">",Zr,Hr),ni=Qr("<=",Jr,Wr),ai=Qr(">=",Gr,$r),si=class e{constructor(e,t,r,i,n){this.type=oe,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=i,this.maxFractionDigits=n}static parse(t,r){if(3!==t.length)return r.error("Expected two arguments.");let i=r.parse(t[1],1,se);if(!i)return null;let n=t[2];if("object"!=typeof n||Array.isArray(n))return r.error("NumberFormat options argument must be an object.");let a=null;if(n.locale&&(a=r.parse(n.locale,1,oe),!a))return null;let s=null;if(n.currency&&(s=r.parse(n.currency,1,oe),!s))return null;let o=null;if(n["min-fraction-digits"]&&(o=r.parse(n["min-fraction-digits"],1,se),!o))return null;let l=null;return n["max-fraction-digits"]&&(l=r.parse(n["max-fraction-digits"],1,se),!l)?null:new e(i,a,s,o,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}};l(si,"NumberFormat");var oi=si,li=class e{constructor(e){this.type=de,this.sections=e}static parse(t,r){if(t.length<2)return r.error("Expected at least one argument.");let i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return r.error("First argument must be an image or text section.");let n=[],a=!1;for(let e=1;e<=t.length-1;++e){let i=t[e];if(a&&"object"==typeof i&&!Array.isArray(i)){a=!1;let e=null;if(i["font-scale"]&&(e=r.parse(i["font-scale"],1,se),!e))return null;let t=null;if(i["text-font"]&&(t=r.parse(i["text-font"],1,ge(oe)),!t))return null;let s=null;if(i["text-color"]&&(s=r.parse(i["text-color"],1,ue),!s))return null;let o=n[n.length-1];o.scale=e,o.font=t,o.textColor=s}else{let i=r.parse(t[e],1,he);if(!i)return null;let s=i.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");a=!0,n.push({content:i,scale:null,font:null,textColor:null})}}return new e(n)}evaluate(e){let t=l((t=>{let r=t.content.evaluate(e);return ht(r)===ye?new Qe("",r,null,null,null):new Qe(pt(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)}),"evaluateSection");return new tt(this.sections.map(t))}eachChild(e){for(let t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}};l(li,"FormatExpression");var ui=li,ci=class e{constructor(e){this.type=ye,this.input=e}static parse(t,r){if(2!==t.length)return r.error("Expected two arguments.");let i=r.parse(t[1],1,oe);return i?new e(i):r.error("No image name provided.")}evaluate(e){let t=this.input.evaluate(e),r=lt.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}};l(ci,"ImageExpression");var hi=ci,pi=class e{constructor(e){this.type=se,this.input=e}static parse(t,r){if(2!==t.length)return r.error("Expected 1 argument, but found ".concat(t.length-1," instead."));let i=r.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?r.error("Expected argument of type string or array, but found ".concat(xe(i.type)," instead.")):new e(i):null}evaluate(e){let t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new mt("Expected value to be of type string or array, but found ".concat(xe(ht(t))," instead."))}eachChild(e){e(this.input)}outputDefined(){return!1}};l(pi,"Length");var di={"==":ei,"!=":ti,">":ii,"<":ri,">=":ai,"<=":ni,array:vt,at:Cr,boolean:vt,case:Dr,coalesce:kr,collator:Ct,format:ui,image:hi,in:Br,"index-of":Er,interpolate:_r,"interpolate-hcl":_r,"interpolate-lab":_r,length:pi,let:Mr,literal:ft,match:Tr,number:vt,"number-format":oi,object:vt,slice:Rr,step:dr,string:vt,"to-boolean":_t,"to-color":_t,"to-number":_t,"to-string":_t,var:ir,within:tr};function fi(e,[t,r,i,n]){t=t.evaluate(e),r=r.evaluate(e),i=i.evaluate(e);let a=n?n.evaluate(e):1,s=ut(t,r,i,a);if(s)throw new mt(s);return new Ye(t/255,r/255,i/255,a,!1)}function yi(e,t){return e in t}function mi(e,t){let r=t[e];return typeof r>"u"?null:r}function gi(e,t,r,i){for(;r<=i;){let n=r+i>>1;if(t[n]===e)return!0;t[n]>e?i=n-1:r=n+1}return!1}function xi(e){return{type:e}}function vi(e){return{result:"success",value:e}}function bi(e){return{result:"error",value:e}}function wi(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function _i(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function Si(e){return!!e.expression&&e.expression.interpolated}function Ai(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function ki(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Ii(e){return e}function Mi(e,t){let r,i,n,a="color"===t.type,s=e.stops&&"object"==typeof e.stops[0][0],o=s||void 0!==e.property,u=s||!o,c=e.type||(Si(t)?"exponential":"interval");if(a||"padding"===t.type){let r=a?Ye.parse:it.parse;(e=ee({},e)).stops&&(e.stops=e.stops.map((e=>[e[0],r(e[1])]))),e.default?e.default=r(e.default):e.default=r(t.default)}if(e.colorSpace&&!fr(e.colorSpace))throw new Error('Unknown color space: "'.concat(e.colorSpace,'"'));if("exponential"===c)r=Bi;else if("interval"===c)r=zi;else if("categorical"===c){r=Ci,i=Object.create(null);for(let t of e.stops)i[t[0]]=t[1];n=typeof e.stops[0][0]}else{if("identity"!==c)throw new Error('Unknown function type "'.concat(c,'"'));r=Vi}if(s){let r={},i=[];for(let t=0;t<e.stops.length;t++){let n=e.stops[t],a=n[0].zoom;void 0===r[a]&&(r[a]={zoom:a,type:e.type,property:e.property,default:e.default,stops:[]},i.push(a)),r[a].stops.push([n[0].value,n[1]])}let n=[];for(let e of i)n.push([r[e].zoom,Mi(r[e],t)]);let a={name:"linear"};return{kind:"composite",interpolationType:a,interpolationFactor:_r.interpolationFactor.bind(void 0,a),zoomStops:n.map((e=>e[0])),evaluate:({zoom:r},i)=>Bi({stops:n,base:e.base},t,r).evaluate(r,i)}}if(u){let a="exponential"===c?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:a,interpolationFactor:_r.interpolationFactor.bind(void 0,a),zoomStops:e.stops.map((e=>e[0])),evaluate:l((({zoom:a})=>r(e,t,a,i,n)),"evaluate")}}return{kind:"source",evaluate(a,s){let o=s&&s.properties?s.properties[e.property]:void 0;return void 0===o?Pi(e.default,t.default):r(e,t,o,i,n)}}}function Pi(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function Ci(e,t,r,i,n){return Pi(typeof r===n?i[r]:void 0,e.default,t.default)}function zi(e,t,r){if("number"!==Ai(r))return Pi(e.default,t.default);let i=e.stops.length;if(1===i||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];let n=hr(e.stops.map((e=>e[0])),r);return e.stops[n][1]}function Bi(e,t,r){let i=void 0!==e.base?e.base:1;if("number"!==Ai(r))return Pi(e.default,t.default);let n=e.stops.length;if(1===n||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];let a=hr(e.stops.map((e=>e[0])),r),s=Ei(r,i,e.stops[a][0],e.stops[a+1][0]),o=e.stops[a][1],l=e.stops[a+1][1],u=br[t.type]||Ii;return"function"==typeof o.evaluate?{evaluate(...t){let r=o.evaluate.apply(void 0,t),i=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==i)return u(r,i,s,e.colorSpace)}}:u(o,l,s,e.colorSpace)}function Vi(e,t,r){switch(t.type){case"color":r=Ye.parse(r);break;case"formatted":r=tt.fromString(r.toString());break;case"resolvedImage":r=lt.fromString(r.toString());break;case"padding":r=it.parse(r);break;default:Ai(r)!==t.type&&("enum"!==t.type||!t.values[r])&&(r=void 0)}return Pi(r,e.default,t.default)}function Ei(e,t,r,i){let n=i-r,a=e-r;return 0===n?0:1===t?a/n:(Math.pow(t,a)-1)/(Math.pow(t,n)-1)}l(fi,"rgba"),l(yi,"has"),l(mi,"get"),l(gi,"binarySearch"),l(xi,"varargs"),ar.register(di,{error:[{kind:"error"},[oe],(e,[t])=>{throw new mt(t.evaluate(e))}],typeof:[oe,[he],(e,[t])=>xe(ht(t.evaluate(e)))],"to-rgba":[ge(se,4),[ue],(e,[t])=>{let[r,i,n,a]=t.evaluate(e).rgb;return[255*r,255*i,255*n,a]}],rgb:[ue,[se,se,se],fi],rgba:[ue,[se,se,se,se],fi],has:{type:le,overloads:[[[oe],(e,[t])=>yi(t.evaluate(e),e.properties())],[[oe,ce],(e,[t,r])=>yi(t.evaluate(e),r.evaluate(e))]]},get:{type:he,overloads:[[[oe],(e,[t])=>mi(t.evaluate(e),e.properties())],[[oe,ce],(e,[t,r])=>mi(t.evaluate(e),r.evaluate(e))]]},"feature-state":[he,[oe],(e,[t])=>mi(t.evaluate(e),e.featureState||{})],properties:[ce,[],e=>e.properties()],"geometry-type":[oe,[],e=>e.geometryType()],id:[he,[],e=>e.id()],zoom:[se,[],e=>e.globals.zoom],"heatmap-density":[se,[],e=>e.globals.heatmapDensity||0],"line-progress":[se,[],e=>e.globals.lineProgress||0],accumulated:[he,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[se,xi(se),(e,t)=>{let r=0;for(let i of t)r+=i.evaluate(e);return r}],"*":[se,xi(se),(e,t)=>{let r=1;for(let i of t)r*=i.evaluate(e);return r}],"-":{type:se,overloads:[[[se,se],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[se],(e,[t])=>-t.evaluate(e)]]},"/":[se,[se,se],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[se,[se,se],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[se,[],()=>Math.LN2],pi:[se,[],()=>Math.PI],e:[se,[],()=>Math.E],"^":[se,[se,se],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[se,[se],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[se,[se],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[se,[se],(e,[t])=>Math.log(t.evaluate(e))],log2:[se,[se],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[se,[se],(e,[t])=>Math.sin(t.evaluate(e))],cos:[se,[se],(e,[t])=>Math.cos(t.evaluate(e))],tan:[se,[se],(e,[t])=>Math.tan(t.evaluate(e))],asin:[se,[se],(e,[t])=>Math.asin(t.evaluate(e))],acos:[se,[se],(e,[t])=>Math.acos(t.evaluate(e))],atan:[se,[se],(e,[t])=>Math.atan(t.evaluate(e))],min:[se,xi(se),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[se,xi(se),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[se,[se],(e,[t])=>Math.abs(t.evaluate(e))],round:[se,[se],(e,[t])=>{let r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[se,[se],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[se,[se],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[le,[oe,he],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[le,[he],(e,[t])=>e.id()===t.value],"filter-type-==":[le,[oe],(e,[t])=>e.geometryType()===t.value],"filter-<":[le,[oe,he],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i<n}],"filter-id-<":[le,[he],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r<i}],"filter->":[le,[oe,he],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>n}],"filter-id->":[le,[he],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r>i}],"filter-<=":[le,[oe,he],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i<=n}],"filter-id-<=":[le,[he],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r<=i}],"filter->=":[le,[oe,he],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>=n}],"filter-id->=":[le,[he],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r>=i}],"filter-has":[le,[he],(e,[t])=>t.value in e.properties()],"filter-has-id":[le,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[le,[ge(oe)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[le,[ge(he)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[le,[oe,ge(he)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[le,[oe,ge(he)],(e,[t,r])=>gi(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:le,overloads:[[[le,le],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[xi(le),(e,t)=>{for(let r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:le,overloads:[[[le,le],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[xi(le),(e,t)=>{for(let r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[le,[le],(e,[t])=>!t.evaluate(e)],"is-supported-script":[le,[oe],(e,[t])=>{let r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[oe,[oe],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[oe,[oe],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[oe,xi(he),(e,t)=>t.map((t=>pt(t.evaluate(e)))).join("")],"resolved-locale":[oe,[pe],(e,[t])=>t.evaluate(e).resolvedLocale()]}),l(vi,"success"),l(bi,"error"),l(wi,"supportsPropertyExpression"),l(_i,"supportsZoomExpression"),l(Si,"supportsInterpolation"),l(Ai,"getType"),l(ki,"isFunction"),l(Ii,"identityFunction"),l(Mi,"createFunction"),l(Pi,"coalesce$1"),l(Ci,"evaluateCategoricalFunction"),l(zi,"evaluateIntervalFunction"),l(Bi,"evaluateExponentialFunction"),l(Vi,"evaluateIdentityFunction"),l(Ei,"interpolationFactor");var Fi=class{constructor(e,t){this.expression=e,this._warningHistory={},this._evaluator=new kt,this._defaultValue=t?Xi(t):null,this._enumValues=t&&"enum"===t.type?t.values:null}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,i,n,a){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||null;try{let e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new mt("Expected value to be one of ".concat(Object.keys(this._enumValues).map((e=>JSON.stringify(e))).join(", "),", but found ").concat(JSON.stringify(e)," instead."));return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,typeof console<"u"&&console.warn(e.message)),this._defaultValue}}};l(Fi,"StyleExpression");var Ti=Fi;function Li(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in di}function Di(e,t){let r=new Mt(di,or,[],t?Ki(t):void 0),i=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return i?vi(new Ti(i,t)):bi(r.errors)}l(Li,"isExpression"),l(Di,"createExpression");var Oi=class{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!ur(t.expression)}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,a)}evaluate(e,t,r,i,n,a){return this._styleExpression.evaluate(e,t,r,i,n,a)}};l(Oi,"ZoomConstantExpression");var Ri=Oi,qi=class{constructor(e,t,r,i){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!ur(t.expression),this.interpolationType=i}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,a)}evaluate(e,t,r,i,n,a){return this._styleExpression.evaluate(e,t,r,i,n,a)}interpolationFactor(e,t,r){return this.interpolationType?_r.interpolationFactor(this.interpolationType,e,t,r):0}};l(qi,"ZoomDependentExpression");var Ui=qi;function ji(e,t){let r=Di(e,t);if("error"===r.result)return r;let i=r.value.expression,n=lr(i);if(!n&&!wi(t))return bi([new re("","data expressions not supported")]);let a=cr(i,["zoom"]);if(!a&&!_i(t))return bi([new re("","zoom expressions not supported")]);let s=Gi(i);if(!s&&!a)return bi([new re("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(s instanceof re)return bi([s]);if(s instanceof _r&&!Si(t))return bi([new re("",'"interpolate" expressions cannot be used with this property')]);if(!s)return vi(new Ri(n?"constant":"source",r.value));let o=s instanceof _r?s.interpolation:void 0;return vi(new Ui(n?"camera":"composite",r.value,s.labels,o))}l(ji,"createPropertyExpression");var Ni=class e{constructor(e,t){this._parameters=e,this._specification=t,ee(this,Mi(this._parameters,this._specification))}static deserialize(t){return new e(t._parameters,t._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}};l(Ni,"StylePropertyFunction");var Zi=Ni;function Ji(e,t){if(ki(e))return new Zi(e,t);if(Li(e)){let r=ji(e,t);if("error"===r.result)throw new Error(r.value.map((e=>"".concat(e.key,": ").concat(e.message))).join(", "));return r.value}{let r=e;return"color"===t.type&&"string"==typeof e?r=Ye.parse(e):"padding"!==t.type||"number"!=typeof e&&!Array.isArray(e)?"variableAnchorOffsetCollection"===t.type&&Array.isArray(e)&&(r=st.parse(e)):r=it.parse(e),{kind:"constant",evaluate:l((()=>r),"evaluate")}}}function Gi(e){let t=null;if(e instanceof Mr)t=Gi(e.result);else if(e instanceof kr){for(let r of e.args)if(t=Gi(r),t)break}else(e instanceof dr||e instanceof _r)&&e.input instanceof ar&&"zoom"===e.input.name&&(t=e);return t instanceof re||e.eachChild((e=>{let r=Gi(e);r instanceof re?t=r:!t&&r?t=new re("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new re("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}function Ki(e){let t={color:ue,string:oe,number:se,enum:oe,boolean:le,formatted:de,padding:fe,resolvedImage:ye,variableAnchorOffsetCollection:me};return"array"===e.type?ge(t[e.value]||he,e.length):t[e.type]}function Xi(e){return"color"===e.type&&ki(e.default)?new Ye(0,0,0,0):"color"===e.type?Ye.parse(e.default)||null:"padding"===e.type?it.parse(e.default)||null:"variableAnchorOffsetCollection"===e.type?st.parse(e.default)||null:void 0===e.default?null:e.default}function Yi(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(let t of e.slice(1))if(!Yi(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}l(Ji,"normalizePropertyExpression"),l(Gi,"findZoomCurve"),l(Ki,"getExpectedType"),l(Xi,"getDefaultValue"),l(Yi,"isExpressionFilter");var Hi={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Wi(e){if(null==e)return{filter:l((()=>!0),"filter"),needGeometry:!1};Yi(e)||(e=en(e));let t=Di(e,Hi);if("error"===t.result)throw new Error(t.value.map((e=>"".concat(e.key,": ").concat(e.message))).join(", "));{let r=Qi(e);return{filter:l(((e,r,i)=>t.value.evaluate(e,r,{},i)),"filter"),needGeometry:r}}}function $i(e,t){return e<t?-1:e>t?1:0}function Qi(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(let t=1;t<e.length;t++)if(Qi(e[t]))return!0;return!1}function en(e){if(!e)return!0;let t=e[0];return e.length<=1?"any"!==t:"=="===t?tn(e[1],e[2],"=="):"!="===t?sn(tn(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?tn(e[1],e[2],t):"any"===t?rn(e.slice(1)):"all"===t?["all"].concat(e.slice(1).map(en)):"none"===t?["all"].concat(e.slice(1).map(en).map(sn)):"in"===t?nn(e[1],e.slice(2)):"!in"===t?sn(nn(e[1],e.slice(2))):"has"===t?an(e[1]):"!has"===t?sn(an(e[1])):"within"!==t||e}function tn(e,t,r){switch(e){case"$type":return["filter-type-".concat(r),t];case"$id":return["filter-id-".concat(r),t];default:return["filter-".concat(r),e,t]}}function rn(e){return["any"].concat(e.map(en))}function nn(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((e=>typeof e!=typeof t[0]))?["filter-in-large",e,["literal",t.sort($i)]]:["filter-in-small",e,["literal",t]]}}function an(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function sn(e){return["!",e]}function on(e){let t=typeof e;if("number"===t||"boolean"===t||"string"===t||null==e)return JSON.stringify(e);if(Array.isArray(e)){let t="[";for(let r of e)t+="".concat(on(r),",");return"".concat(t,"]")}let r=Object.keys(e).sort(),i="{";for(let t=0;t<r.length;t++)i+="".concat(JSON.stringify(r[t]),":").concat(on(e[r[t]]),",");return"".concat(i,"}")}function ln(e){let t="";for(let r of W)t+="/".concat(on(e[r]));return t}function un(e,t){let r={};for(let i=0;i<e.length;i++){let n=t&&t[e[i].id]||ln(e[i]);t&&(t[e[i].id]=n);let a=r[n];a||(a=r[n]=[]),a.push(e[i])}let i=[];for(let e in r)i.push(r[e]);return i}function cn(e){let t=e.key,r=e.value;return r?[new Q(t,r,"constants have been deprecated as of v8")]:[]}function hn(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function pn(e){if(Array.isArray(e))return e.map(pn);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){let t={};for(let r in e)t[r]=pn(e[r]);return t}return hn(e)}function dn(e){let t=e.key,r=e.value,i=e.valueSpec||{},n=e.objectElementValidators||{},a=e.style,s=e.styleSpec,o=e.validateSpec,l=[],u=Ai(r);if("object"!==u)return[new Q(t,r,"object expected, ".concat(u," found"))];for(let e in r){let u,c=e.split(".")[0],h=i[c]||i["*"];if(n[c])u=n[c];else if(i[c])u=o;else if(n["*"])u=n["*"];else{if(!i["*"]){l.push(new Q(t,r[e],'unknown property "'.concat(e,'"')));continue}u=o}l=l.concat(u({key:(t&&"".concat(t,"."))+e,value:r[e],valueSpec:h,style:a,styleSpec:s,object:r,objectKey:e,validateSpec:o},r))}for(let e in i)n[e]||i[e].required&&void 0===i[e].default&&void 0===r[e]&&l.push(new Q(t,r,'missing required property "'.concat(e,'"')));return l}function fn(e){let t=e.value,r=e.valueSpec,i=e.validateSpec,n=e.style,a=e.styleSpec,s=e.key,o=e.arrayElementValidator||i;if("array"!==Ai(t))return[new Q(s,t,"array expected, ".concat(Ai(t)," found"))];if(r.length&&t.length!==r.length)return[new Q(s,t,"array length ".concat(r.length," expected, length ").concat(t.length," found"))];if(r["min-length"]&&t.length<r["min-length"])return[new Q(s,t,"array length at least ".concat(r["min-length"]," expected, length ").concat(t.length," found"))];let l={type:r.value,values:r.values};a.$version<7&&(l.function=r.function),"object"===Ai(r.value)&&(l=r.value);let u=[];for(let r=0;r<t.length;r++)u=u.concat(o({array:t,arrayIndex:r,value:t[r],valueSpec:l,validateSpec:e.validateSpec,style:n,styleSpec:a,key:"".concat(s,"[").concat(r,"]")}));return u}function yn(e){let t=e.key,r=e.value,i=e.valueSpec,n=Ai(r);return"number"===n&&r!=r&&(n="NaN"),"number"!==n?[new Q(t,r,"number expected, ".concat(n," found"))]:"minimum"in i&&r<i.minimum?[new Q(t,r,"".concat(r," is less than the minimum value ").concat(i.minimum))]:"maximum"in i&&r>i.maximum?[new Q(t,r,"".concat(r," is greater than the maximum value ").concat(i.maximum))]:[]}function mn(e){let t,r,i,n=e.valueSpec,a=hn(e.value.type),s={},o="categorical"!==a&&void 0===e.value.property,l=!o,u="array"===Ai(e.value.stops)&&"array"===Ai(e.value.stops[0])&&"object"===Ai(e.value.stops[0][0]),c=dn({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:h,default:f}});return"identity"===a&&o&&c.push(new Q(e.key,e.value,'missing required property "property"')),"identity"!==a&&!e.value.stops&&c.push(new Q(e.key,e.value,'missing required property "stops"')),"exponential"===a&&e.valueSpec.expression&&!Si(e.valueSpec)&&c.push(new Q(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!wi(e.valueSpec)?c.push(new Q(e.key,e.value,"property functions not supported")):o&&!_i(e.valueSpec)&&c.push(new Q(e.key,e.value,"zoom functions not supported"))),("categorical"===a||u)&&void 0===e.value.property&&c.push(new Q(e.key,e.value,'"property" property is required')),c;function h(e){if("identity"===a)return[new Q(e.key,e.value,'identity function may not have a "stops" property')];let t=[],r=e.value;return t=t.concat(fn({key:e.key,value:r,valueSpec:e.valueSpec,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:p})),"array"===Ai(r)&&0===r.length&&t.push(new Q(e.key,r,"array must have at least one stop")),t}function p(e){let t=[],a=e.value,o=e.key;if("array"!==Ai(a))return[new Q(o,a,"array expected, ".concat(Ai(a)," found"))];if(2!==a.length)return[new Q(o,a,"array length 2 expected, length ".concat(a.length," found"))];if(u){if("object"!==Ai(a[0]))return[new Q(o,a,"object expected, ".concat(Ai(a[0])," found"))];if(void 0===a[0].zoom)return[new Q(o,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new Q(o,a,"object stop key must have value")];if(i&&i>hn(a[0].zoom))return[new Q(o,a[0].zoom,"stop zoom values must appear in ascending order")];hn(a[0].zoom)!==i&&(i=hn(a[0].zoom),r=void 0,s={}),t=t.concat(dn({key:"".concat(o,"[0]"),value:a[0],valueSpec:{zoom:{}},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:yn,value:d}}))}else t=t.concat(d({key:"".concat(o,"[0]"),value:a[0],valueSpec:{},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec},a));return Li(pn(a[1]))?t.concat([new Q("".concat(o,"[1]"),a[1],"expressions are not allowed in function stops.")]):t.concat(e.validateSpec({key:"".concat(o,"[1]"),value:a[1],valueSpec:n,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec}))}function d(e,i){let o=Ai(e.value),l=hn(e.value),u=null!==e.value?e.value:i;if(t){if(o!==t)return[new Q(e.key,u,"".concat(o," stop domain type must match previous stop domain type ").concat(t))]}else t=o;if("number"!==o&&"string"!==o&&"boolean"!==o)return[new Q(e.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==o&&"categorical"!==a){let t="number expected, ".concat(o," found");return wi(n)&&void 0===a&&(t+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Q(e.key,u,t)]}return"categorical"!==a||"number"!==o||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===o&&void 0!==r&&l<r?[new Q(e.key,u,"stop domain values must appear in ascending order")]:(r=l,"categorical"===a&&l in s?[new Q(e.key,u,"stop domain values must be unique")]:(s[l]=!0,[])):[new Q(e.key,u,"integer expected, found ".concat(l))]}function f(e){return e.validateSpec({key:e.key,value:e.value,valueSpec:n,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec})}}function gn(e){let t=("property"===e.expressionContext?ji:Di)(pn(e.value),e.valueSpec);if("error"===t.result)return t.value.map((t=>new Q("".concat(e.key).concat(t.key),e.value,t.message)));let r=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!r.outputDefined())return[new Q(e.key,e.value,'Invalid data expression for "'.concat(e.propertyKey,'". Output values must be contained as literals within the expression.'))];if("property"===e.expressionContext&&"layout"===e.propertyType&&!ur(r))return[new Q(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!ur(r))return[new Q(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!cr(r,["zoom","feature-state"]))return[new Q(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!lr(r))return[new Q(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function xn(e){let t=e.value,r=e.key,i=Ai(t);return"boolean"!==i?[new Q(r,t,"boolean expected, ".concat(i," found"))]:[]}function vn(e){let t=e.key,r=e.value,i=Ai(r);return"string"!==i?[new Q(t,r,"color expected, ".concat(i," found"))]:Ye.parse(String(r))?[]:[new Q(t,r,'color expected, "'.concat(r,'" found'))]}function bn(e){let t=e.key,r=e.value,i=e.valueSpec,n=[];return Array.isArray(i.values)?-1===i.values.indexOf(hn(r))&&n.push(new Q(t,r,"expected one of [".concat(i.values.join(", "),"], ").concat(JSON.stringify(r)," found"))):-1===Object.keys(i.values).indexOf(hn(r))&&n.push(new Q(t,r,"expected one of [".concat(Object.keys(i.values).join(", "),"], ").concat(JSON.stringify(r)," found"))),n}function wn(e){return Yi(pn(e.value))?gn(ee({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):_n(e)}function _n(e){let t=e.value,r=e.key;if("array"!==Ai(t))return[new Q(r,t,"array expected, ".concat(Ai(t)," found"))];let i,n=e.styleSpec,a=[];if(t.length<1)return[new Q(r,t,"filter array must have at least 1 element")];switch(a=a.concat(bn({key:"".concat(r,"[0]"),value:t[0],valueSpec:n.filter_operator,style:e.style,styleSpec:e.styleSpec})),hn(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===hn(t[1])&&a.push(new Q(r,t,'"$type" cannot be use with operator "'.concat(t[0],'"')));case"==":case"!=":3!==t.length&&a.push(new Q(r,t,'filter array for operator "'.concat(t[0],'" must have 3 elements')));case"in":case"!in":t.length>=2&&(i=Ai(t[1]),"string"!==i&&a.push(new Q("".concat(r,"[1]"),t[1],"string expected, ".concat(i," found"))));for(let s=2;s<t.length;s++)i=Ai(t[s]),"$type"===hn(t[1])?a=a.concat(bn({key:"".concat(r,"[").concat(s,"]"),value:t[s],valueSpec:n.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==i&&"number"!==i&&"boolean"!==i&&a.push(new Q("".concat(r,"[").concat(s,"]"),t[s],"string, number, or boolean expected, ".concat(i," found")));break;case"any":case"all":case"none":for(let i=1;i<t.length;i++)a=a.concat(_n({key:"".concat(r,"[").concat(i,"]"),value:t[i],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":i=Ai(t[1]),2!==t.length?a.push(new Q(r,t,'filter array for "'.concat(t[0],'" operator must have 2 elements'))):"string"!==i&&a.push(new Q("".concat(r,"[1]"),t[1],"string expected, ".concat(i," found")));break;case"within":i=Ai(t[1]),2!==t.length?a.push(new Q(r,t,'filter array for "'.concat(t[0],'" operator must have 2 elements'))):"object"!==i&&a.push(new Q("".concat(r,"[1]"),t[1],"object expected, ".concat(i," found")))}return a}function Sn(e,t){let r=e.key,i=e.validateSpec,n=e.style,a=e.styleSpec,s=e.value,o=e.objectKey,l=a["".concat(t,"_").concat(e.layerType)];if(!l)return[];let u=o.match(/^(.*)-transition$/);if("paint"===t&&u&&l[u[1]]&&l[u[1]].transition)return i({key:r,value:s,valueSpec:a.transition,style:n,styleSpec:a});let c,h=e.valueSpec||l[o];if(!h)return[new Q(r,s,'unknown property "'.concat(o,'"'))];if("string"===Ai(s)&&wi(h)&&!h.tokens&&(c=/^{([^}]+)}$/.exec(s)))return[new Q(r,s,'"'.concat(o,'" does not support interpolation syntax\n')+'Use an identity property function instead: `{ "type": "identity", "property": '.concat(JSON.stringify(c[1])," }`."))];let p=[];return"symbol"===e.layerType&&("text-field"===o&&n&&!n.glyphs&&p.push(new Q(r,s,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&ki(pn(s))&&"identity"===hn(s.type)&&p.push(new Q(r,s,'"text-font" does not support identity functions'))),p.concat(i({key:e.key,value:s,valueSpec:h,style:n,styleSpec:a,expressionContext:"property",propertyType:t,propertyKey:o}))}function An(e){return Sn(e,"paint")}function kn(e){return Sn(e,"layout")}function In(e){let t=[],r=e.value,i=e.key,n=e.style,a=e.styleSpec;!r.type&&!r.ref&&t.push(new Q(i,r,'either "type" or "ref" is required'));let s=hn(r.type),o=hn(r.ref);if(r.id){let a=hn(r.id);for(let s=0;s<e.arrayIndex;s++){let e=n.layers[s];hn(e.id)===a&&t.push(new Q(i,r.id,'duplicate layer id "'.concat(r.id,'", previously used at line ').concat(e.id.__line__)))}}if("ref"in r){let e;["type","source","source-layer","filter","layout"].forEach((e=>{e in r&&t.push(new Q(i,r[e],'"'.concat(e,'" is prohibited for ref layers')))})),n.layers.forEach((t=>{hn(t.id)===o&&(e=t)})),e?e.ref?t.push(new Q(i,r.ref,"ref cannot reference another ref layer")):s=hn(e.type):t.push(new Q(i,r.ref,'ref layer "'.concat(o,'" not found')))}else if("background"!==s)if(r.source){let e=n.sources&&n.sources[r.source],a=e&&hn(e.type);e?"vector"===a&&"raster"===s?t.push(new Q(i,r.source,'layer "'.concat(r.id,'" requires a raster source'))):"raster"===a&&"raster"!==s?t.push(new Q(i,r.source,'layer "'.concat(r.id,'" requires a vector source'))):"vector"!==a||r["source-layer"]?"raster-dem"===a&&"hillshade"!==s?t.push(new Q(i,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"===s&&r.paint&&r.paint["line-gradient"]&&("geojson"!==a||!e.lineMetrics)&&t.push(new Q(i,r,'layer "'.concat(r.id,'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.'))):t.push(new Q(i,r,'layer "'.concat(r.id,'" must specify a "source-layer"'))):t.push(new Q(i,r.source,'source "'.concat(r.source,'" not found')))}else t.push(new Q(i,r,'missing required property "source"'));return t=t.concat(dn({key:i,value:r,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":()=>[],type:()=>e.validateSpec({key:"".concat(i,".type"),value:r.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:r,objectKey:"type"}),filter:wn,layout:e=>dn({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>kn(ee({layerType:s},e))}}),paint:e=>dn({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>An(ee({layerType:s},e))}})}})),t}function Mn(e){let t=e.value,r=e.key,i=Ai(t);return"string"!==i?[new Q(r,t,"string expected, ".concat(i," found"))]:[]}l(Wi,"createFilter"),l($i,"compare"),l(Qi,"geometryNeeded"),l(en,"convertFilter$1"),l(tn,"convertComparisonOp$1"),l(rn,"convertDisjunctionOp"),l(nn,"convertInOp$1"),l(an,"convertHasOp$1"),l(sn,"convertNegation"),l(on,"stringify"),l(ln,"getKey"),l(un,"groupByLayout"),l(cn,"validateConstants"),l(hn,"unbundle"),l(pn,"deepUnbundle"),l(dn,"validateObject"),l(fn,"validateArray"),l(yn,"validateNumber"),l(mn,"validateFunction"),l(gn,"validateExpression"),l(xn,"validateBoolean"),l(vn,"validateColor"),l(bn,"validateEnum"),l(wn,"validateFilter"),l(_n,"validateNonExpressionFilter"),l(Sn,"validateProperty"),l(An,"validatePaintProperty"),l(kn,"validateLayoutProperty"),l(In,"validateLayer"),l(Mn,"validateString");var Pn={promoteId:zn};function Cn(e){let t=e.value,r=e.key,i=e.styleSpec,n=e.style,a=e.validateSpec;if(!t.type)return[new Q(r,t,'"type" is required')];let s,o=hn(t.type);switch(o){case"vector":case"raster":case"raster-dem":return s=dn({key:r,value:t,valueSpec:i["source_".concat(o.replace("-","_"))],style:e.style,styleSpec:i,objectElementValidators:Pn,validateSpec:a}),s;case"geojson":if(s=dn({key:r,value:t,valueSpec:i.source_geojson,style:n,styleSpec:i,validateSpec:a,objectElementValidators:Pn}),t.cluster)for(let e in t.clusterProperties){let[i,n]=t.clusterProperties[e],o="string"==typeof i?[i,["accumulated"],["get",e]]:i;s.push(...gn({key:"".concat(r,".").concat(e,".map"),value:n,validateSpec:a,expressionContext:"cluster-map"})),s.push(...gn({key:"".concat(r,".").concat(e,".reduce"),value:o,validateSpec:a,expressionContext:"cluster-reduce"}))}return s;case"video":return dn({key:r,value:t,valueSpec:i.source_video,style:n,validateSpec:a,styleSpec:i});case"image":return dn({key:r,value:t,valueSpec:i.source_image,style:n,validateSpec:a,styleSpec:i});case"canvas":return[new Q(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return bn({key:"".concat(r,".type"),value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,validateSpec:a,styleSpec:i})}}function zn({key:e,value:t}){if("string"===Ai(t))return Mn({key:e,value:t});{let r=[];for(let i in t)r.push(...Mn({key:"".concat(e,".").concat(i),value:t[i]}));return r}}function Bn(e){let t=e.value,r=e.styleSpec,i=r.light,n=e.style,a=[],s=Ai(t);if(void 0===t)return a;if("object"!==s)return a=a.concat([new Q("light",t,"object expected, ".concat(s," found"))]),a;for(let s in t){let o=s.match(/^(.*)-transition$/);a=o&&i[o[1]]&&i[o[1]].transition?a.concat(e.validateSpec({key:s,value:t[s],valueSpec:r.transition,validateSpec:e.validateSpec,style:n,styleSpec:r})):i[s]?a.concat(e.validateSpec({key:s,value:t[s],valueSpec:i[s],validateSpec:e.validateSpec,style:n,styleSpec:r})):a.concat([new Q(s,t[s],'unknown property "'.concat(s,'"'))])}return a}function Vn(e){let t=e.value,r=e.styleSpec,i=r.terrain,n=e.style,a=[],s=Ai(t);if(void 0===t)return a;if("object"!==s)return a=a.concat([new Q("terrain",t,"object expected, ".concat(s," found"))]),a;for(let s in t)a=i[s]?a.concat(e.validateSpec({key:s,value:t[s],valueSpec:i[s],validateSpec:e.validateSpec,style:n,styleSpec:r})):a.concat([new Q(s,t[s],'unknown property "'.concat(s,'"'))]);return a}function En(e){return 0===Mn(e).length?[]:gn(e)}function Fn(e){return 0===Mn(e).length?[]:gn(e)}function Tn(e){let t=e.key,r=e.value;if("array"===Ai(r)){if(r.length<1||r.length>4)return[new Q(t,r,"padding requires 1 to 4 values; ".concat(r.length," values found"))];let i={type:"number"},n=[];for(let a=0;a<r.length;a++)n=n.concat(e.validateSpec({key:"".concat(t,"[").concat(a,"]"),value:r[a],validateSpec:e.validateSpec,valueSpec:i}));return n}return yn({key:t,value:r,valueSpec:{}})}function Ln(e){let t=e.key,r=e.value,i=Ai(r),n=e.styleSpec;if("array"!==i||r.length<1||r.length%2!=0)return[new Q(t,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let a=[];for(let i=0;i<r.length;i+=2)a=a.concat(bn({key:"".concat(t,"[").concat(i,"]"),value:r[i],valueSpec:n.layout_symbol["text-anchor"]})),a=a.concat(fn({key:"".concat(t,"[").concat(i+1,"]"),value:r[i+1],valueSpec:{length:2,value:"number"},validateSpec:e.validateSpec,style:e.style,styleSpec:n}));return a}function Dn(e){let t=[],r=e.value,i=e.key;if(Array.isArray(r)){let n=[],a=[];for(let s in r){r[s].id&&n.includes(r[s].id)&&t.push(new Q(i,r,"all the sprites' ids must be unique, but ".concat(r[s].id," is duplicated"))),n.push(r[s].id),r[s].url&&a.includes(r[s].url)&&t.push(new Q(i,r,"all the sprites' URLs must be unique, but ".concat(r[s].url," is duplicated"))),a.push(r[s].url);let o={id:{type:"string",required:!0},url:{type:"string",required:!0}};t=t.concat(dn({key:"".concat(i,"[").concat(s,"]"),value:r[s],valueSpec:o,validateSpec:e.validateSpec}))}return t}return Mn({key:i,value:r})}l(Cn,"validateSource"),l(zn,"validatePromoteId"),l(Bn,"validateLight"),l(Vn,"validateTerrain"),l(En,"validateFormatted"),l(Fn,"validateImage"),l(Tn,"validatePadding"),l(Ln,"validateVariableAnchorOffsetCollection"),l(Dn,"validateSprite");var On={"*":()=>[],array:fn,boolean:xn,number:yn,color:vn,constants:cn,enum:bn,filter:wn,function:mn,layer:In,object:dn,source:Cn,light:Bn,terrain:Vn,string:Mn,formatted:En,resolvedImage:Fn,padding:Tn,variableAnchorOffsetCollection:Ln,sprite:Dn};function Rn(e){let t=e.value,r=e.valueSpec,i=e.styleSpec;return e.validateSpec=Rn,r.expression&&ki(hn(t))?mn(e):r.expression&&Li(pn(t))?gn(e):r.type&&On[r.type]?On[r.type](e):dn(ee({},e,{valueSpec:r.type?i[r.type]:r}))}function qn(e){let t=e.value,r=e.key,i=Mn(e);return i.length||(-1===t.indexOf("{fontstack}")&&i.push(new Q(r,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&i.push(new Q(r,t,'"glyphs" url must include a "{range}" token'))),i}function Un(e,t=H){let r=[];return r=r.concat(Rn({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,validateSpec:Rn,objectElementValidators:{glyphs:qn,"*":()=>[]}})),e.constants&&(r=r.concat(cn({key:"constants",value:e.constants,style:e,styleSpec:t,validateSpec:Rn}))),Nn(r)}function jn(e){return function(t){return e({...t,validateSpec:Rn})}}function Nn(e){return[].concat(e).sort(((e,t)=>e.line-t.line))}function Zn(e){return function(...t){return Nn(e.apply(this,t))}}l(Rn,"validate"),l(qn,"validateGlyphsUrl"),l(Un,"validateStyleMin"),Un.source=Zn(jn(Cn)),Un.sprite=Zn(jn(Dn)),Un.glyphs=Zn(jn(qn)),Un.light=Zn(jn(Bn)),Un.terrain=Zn(jn(Vn)),Un.layer=Zn(jn(In)),Un.filter=Zn(jn(wn)),Un.paintProperty=Zn(jn(An)),Un.layoutProperty=Zn(jn(kn)),l(jn,"injectValidateSpec"),l(Nn,"sortErrors"),l(Zn,"wrapCleanErrors"),p(),p();var Jn={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""},Gn=class extends Error{constructor(e,t,r,i){super("AJAXError: ".concat(t," (").concat(e,"): ").concat(r)),this.status=e,this.statusText=t,this.url=r,this.body=i}};l(Gn,"AJAXError");var Kn=Gn,Xn=N()?()=>self.worker&&self.worker.referrer:()=>("blob:"===window.location.protocol?window.parent:window).location.href,Yn=l((e=>Jn.REGISTERED_PROTOCOLS[e.substring(0,e.indexOf("://"))]),"getProtocolAction"),Hn=l((e=>/^file:/.test(e)||/^file:/.test(Xn())&&!/^\w+:/.test(e)),"isFileURL");function Wn(e,t){let r=new AbortController,i=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:Xn(),signal:r.signal}),n=!1,a=!1;"json"===e.type&&i.headers.set("Accept","application/json");let s=l(((r,n,s)=>{if(!a){if(r&&"SecurityError"!==r.message&&q(r),n&&s)return o(n);fetch(i).then((r=>r.ok?o(r):r.blob().then((i=>t(new Kn(r.status,r.statusText,e.url,i)))))).catch((e=>{20!==e.code&&t(new Error(e.message))}))}}),"validateOrFetch"),o=l((r=>{("arrayBuffer"===e.type||"image"===e.type?r.arrayBuffer():"json"===e.type?r.json():r.text()).then((e=>{a||(n=!0,t(null,e,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((e=>{a||t(new Error(e.message))}))}),"finishRequest");return s(null,null),{cancel:l((()=>{a=!0,n||r.abort()}),"cancel")}}function $n(e,t){let r=new XMLHttpRequest;r.open(e.method||"GET",e.url,!0),("arrayBuffer"===e.type||"image"===e.type)&&(r.responseType="arraybuffer");for(let t in e.headers)r.setRequestHeader(t,e.headers[t]);return"json"===e.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===e.credentials,r.onerror=()=>{t(new Error(r.statusText))},r.onload=()=>{if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){let i=r.response;if("json"===e.type)try{i=JSON.parse(r.response)}catch(e){return t(e)}t(null,i,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else{let i=new Blob([r.response],{type:r.getResponseHeader("Content-Type")});t(new Kn(r.status,r.statusText,e.url,i))}},r.send(e.body),{cancel:l((()=>r.abort()),"cancel")}}l(Wn,"makeFetchRequest"),l($n,"makeXMLHttpRequest");var Qn=l((function(e,t){if(/:\/\//.test(e.url)&&!/^https?:|^file:/.test(e.url)){if(N()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t);if(!N())return(Yn(e.url)||Wn)(e,t)}if(!Hn(e.url)){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return Wn(e,t);if(N()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}return $n(e,t)}),"makeRequest"),ea=l((function(e,t){return Qn(E(e,{type:"json"}),t)}),"getJSON"),ta=l((function(e,t){return Qn(E(e,{type:"arrayBuffer"}),t)}),"getArrayBuffer"),ra={};function ia(e,t,r={}){if(ra[e])throw new Error("".concat(e," is already registered."));Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),ra[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}l(ia,"register"),ia("Object",Object),ia("TransferableGridIndex",X),ia("Color",Ye),ia("Error",Error),ia("AJAXError",Kn),ia("ResolvedImage",lt),ia("StylePropertyFunction",Zi),ia("StyleExpression",Ti,{omit:["_evaluator"]}),ia("ZoomDependentExpression",Ui),ia("ZoomConstantExpression",Ri),ia("CompoundExpression",ar,{omit:["_evaluate"]});for(let e in di)di[e]._classRegistryKey||ia("Expression_".concat(e),di[e]);function na(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function aa(e,t){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob)return e;if(na(e)||G(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){let r=e;return t&&t.push(r.buffer),r}if(e instanceof ImageData)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){let r=[];for(let i of e)r.push(aa(i,t));return r}if("object"==typeof e){let r=e.constructor,i=r._classRegistryKey;if(!i)throw new Error("can't serialize object of unregistered class");if(!ra[i])throw new Error("".concat(i," is not registered."));let n=r.serialize?r.serialize(e,t):{};if(r.serialize){if(t&&n===t[t.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(let r in e){if(!e.hasOwnProperty(r)||ra[i].omit.indexOf(r)>=0)continue;let a=e[r];n[r]=ra[i].shallow.indexOf(r)>=0?a:aa(a,t)}e instanceof Error&&(n.message=e.message)}if(n.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==i&&(n.$name=i),n}throw new Error("can't serialize object of type ".concat(typeof e))}function sa(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob||na(e)||G(e)||ArrayBuffer.isView(e)||e instanceof ImageData)return e;if(Array.isArray(e))return e.map(sa);if("object"==typeof e){let t=e.$name||"Object";if(!ra[t])throw new Error("can't deserialize unregistered class ".concat(t));let{klass:r}=ra[t];if(!r)throw new Error("can't deserialize unregistered class ".concat(t));if(r.deserialize)return r.deserialize(e);let i=Object.create(r.prototype);for(let r of Object.keys(e)){if("$name"===r)continue;let n=e[r];i[r]=ra[t].shallow.indexOf(r)>=0?n:sa(n)}return i}throw new Error("can't deserialize object of type ".concat(typeof e))}l(na,"isArrayBuffer"),l(aa,"serialize"),l(sa,"deserialize"),p();var oa=class{constructor(e){this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._callback()}),0))}remove(){delete this._channel,this._callback=()=>{}}};l(oa,"ThrottledInvoker");var la=oa,ua=class{constructor(e,t,r){this.receive=l((e=>{let t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if("<cancel>"===t.type){delete this.tasks[r];let e=this.cancelCallbacks[r];delete this.cancelCallbacks[r],e&&e()}else N()||t.mustQueue?(this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,t)}),"receive"),this.process=l((()=>{if(!this.taskQueue.length)return;let e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t&&this.processTask(e,t)}),"process"),this.target=e,this.parent=t,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},this.invoker=new la(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=N()?e:window}send(e,t,r,i,n=!1){let a=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[a]=r);let s=J(this.globalScope)?void 0:[];return this.target.postMessage({id:a,type:e,hasCallback:!!r,targetMapId:i,mustQueue:n,sourceMapId:this.mapId,data:aa(t,s)},s),{cancel:l((()=>{r&&delete this.callbacks[a],this.target.postMessage({id:a,type:"<cancel>",targetMapId:i,sourceMapId:this.mapId})}),"cancel")}}processTask(e,t){if("<response>"===t.type){let r=this.callbacks[e];delete this.callbacks[e],r&&(t.error?r(sa(t.error)):r(null,sa(t.data)))}else{let r=!1,i=J(this.globalScope)?void 0:[],n=t.hasCallback?(t,n)=>{r=!0,delete this.cancelCallbacks[e],this.target.postMessage({id:e,type:"<response>",sourceMapId:this.mapId,error:t?aa(t):null,data:aa(n,i)},i)}:e=>{r=!0},a=null,s=sa(t.data);if(this.parent[t.type])a=this.parent[t.type](t.sourceMapId,s,n);else if(this.parent.getWorkerSource){let e=t.type.split(".");a=this.parent.getWorkerSource(t.sourceMapId,e[0],s.source)[e[1]](s,n)}else n(new Error("Could not find function ".concat(t.type)));!r&&a&&a.cancel&&(this.cancelCallbacks[e]=a.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}};l(ua,"Actor");var ca=ua;function ha(e,t,r){r[e]&&-1!==r[e].indexOf(t)||(r[e]=r[e]||[],r[e].push(t))}function pa(e,t,r){if(r&&r[e]){let i=r[e].indexOf(t);-1!==i&&r[e].splice(i,1)}}p(),p(),p(),p(),p(),p(),l(ha,"_addEventListener"),l(pa,"_removeEventListener");var da=class{constructor(e,t={}){E(this,t),this.type=e}};l(da,"Event");var fa=da,ya=class extends fa{constructor(e,t={}){super("error",E({error:e},t))}};l(ya,"ErrorEvent");var ma=ya,ga=class{on(e,t){return this._listeners=this._listeners||{},ha(e,t,this._listeners),this}off(e,t){return pa(e,t,this._listeners),pa(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},ha(e,t,this._oneTimeListeners),this):new Promise((t=>this.once(e,t)))}fire(e,t){"string"==typeof e&&(e=new fa(e,t||{}));let r=e.type;if(this.listens(r)){e.target=this;let t=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(let r of t)r.call(this,e);let i=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(let t of i)pa(r,t,this._oneTimeListeners),t.call(this,e);let n=this._eventedParent;n&&(E(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),n.fire(e))}else e instanceof ma&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}};l(ga,"Evented");var xa=ga,va=Un,ba=(va.source,va.light,va.terrain,va.filter,va.paintProperty),wa=va.layoutProperty;function _a(e,t){let r=!1;if(t&&t.length)for(let i of t)e.fire(new ma(new Error(i.message))),r=!0;return r}l(_a,"emitValidationErrors"),p(),p(),p();var Sa=class{constructor(){this.first=!0}update(e,t){let r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))}};l(Sa,"ZoomHistory");var Aa=Sa;p(),p();var ka={"Latin-1 Supplement":l((e=>e>=128&&e<=255),"Latin-1 Supplement"),Arabic:l((e=>e>=1536&&e<=1791),"Arabic"),"Arabic Supplement":l((e=>e>=1872&&e<=1919),"Arabic Supplement"),"Arabic Extended-A":l((e=>e>=2208&&e<=2303),"Arabic Extended-A"),"Hangul Jamo":l((e=>e>=4352&&e<=4607),"Hangul Jamo"),"Unified Canadian Aboriginal Syllabics":l((e=>e>=5120&&e<=5759),"Unified Canadian Aboriginal Syllabics"),Khmer:l((e=>e>=6016&&e<=6143),"Khmer"),"Unified Canadian Aboriginal Syllabics Extended":l((e=>e>=6320&&e<=6399),"Unified Canadian Aboriginal Syllabics Extended"),"General Punctuation":l((e=>e>=8192&&e<=8303),"General Punctuation"),"Letterlike Symbols":l((e=>e>=8448&&e<=8527),"Letterlike Symbols"),"Number Forms":l((e=>e>=8528&&e<=8591),"Number Forms"),"Miscellaneous Technical":l((e=>e>=8960&&e<=9215),"Miscellaneous Technical"),"Control Pictures":l((e=>e>=9216&&e<=9279),"Control Pictures"),"Optical Character Recognition":l((e=>e>=9280&&e<=9311),"Optical Character Recognition"),"Enclosed Alphanumerics":l((e=>e>=9312&&e<=9471),"Enclosed Alphanumerics"),"Geometric Shapes":l((e=>e>=9632&&e<=9727),"Geometric Shapes"),"Miscellaneous Symbols":l((e=>e>=9728&&e<=9983),"Miscellaneous Symbols"),"Miscellaneous Symbols and Arrows":l((e=>e>=11008&&e<=11263),"Miscellaneous Symbols and Arrows"),"CJK Radicals Supplement":l((e=>e>=11904&&e<=12031),"CJK Radicals Supplement"),"Kangxi Radicals":l((e=>e>=12032&&e<=12255),"Kangxi Radicals"),"Ideographic Description Characters":l((e=>e>=12272&&e<=12287),"Ideographic Description Characters"),"CJK Symbols and Punctuation":l((e=>e>=12288&&e<=12351),"CJK Symbols and Punctuation"),Hiragana:l((e=>e>=12352&&e<=12447),"Hiragana"),Katakana:l((e=>e>=12448&&e<=12543),"Katakana"),Bopomofo:l((e=>e>=12544&&e<=12591),"Bopomofo"),"Hangul Compatibility Jamo":l((e=>e>=12592&&e<=12687),"Hangul Compatibility Jamo"),Kanbun:l((e=>e>=12688&&e<=12703),"Kanbun"),"Bopomofo Extended":l((e=>e>=12704&&e<=12735),"Bopomofo Extended"),"CJK Strokes":l((e=>e>=12736&&e<=12783),"CJK Strokes"),"Katakana Phonetic Extensions":l((e=>e>=12784&&e<=12799),"Katakana Phonetic Extensions"),"Enclosed CJK Letters and Months":l((e=>e>=12800&&e<=13055),"Enclosed CJK Letters and Months"),"CJK Compatibility":l((e=>e>=13056&&e<=13311),"CJK Compatibility"),"CJK Unified Ideographs Extension A":l((e=>e>=13312&&e<=19903),"CJK Unified Ideographs Extension A"),"Yijing Hexagram Symbols":l((e=>e>=19904&&e<=19967),"Yijing Hexagram Symbols"),"CJK Unified Ideographs":l((e=>e>=19968&&e<=40959),"CJK Unified Ideographs"),"Yi Syllables":l((e=>e>=40960&&e<=42127),"Yi Syllables"),"Yi Radicals":l((e=>e>=42128&&e<=42191),"Yi Radicals"),"Hangul Jamo Extended-A":l((e=>e>=43360&&e<=43391),"Hangul Jamo Extended-A"),"Hangul Syllables":l((e=>e>=44032&&e<=55215),"Hangul Syllables"),"Hangul Jamo Extended-B":l((e=>e>=55216&&e<=55295),"Hangul Jamo Extended-B"),"Private Use Area":l((e=>e>=57344&&e<=63743),"Private Use Area"),"CJK Compatibility Ideographs":l((e=>e>=63744&&e<=64255),"CJK Compatibility Ideographs"),"Arabic Presentation Forms-A":l((e=>e>=64336&&e<=65023),"Arabic Presentation Forms-A"),"Vertical Forms":l((e=>e>=65040&&e<=65055),"Vertical Forms"),"CJK Compatibility Forms":l((e=>e>=65072&&e<=65103),"CJK Compatibility Forms"),"Small Form Variants":l((e=>e>=65104&&e<=65135),"Small Form Variants"),"Arabic Presentation Forms-B":l((e=>e>=65136&&e<=65279),"Arabic Presentation Forms-B"),"Halfwidth and Fullwidth Forms":l((e=>e>=65280&&e<=65519),"Halfwidth and Fullwidth Forms")};function Ia(e){for(let t of e)if(za(t.charCodeAt(0)))return!0;return!1}function Ma(e){for(let t of e)if(!Pa(t.charCodeAt(0)))return!1;return!0}function Pa(e){return!(ka.Arabic(e)||ka["Arabic Supplement"](e)||ka["Arabic Extended-A"](e)||ka["Arabic Presentation Forms-A"](e)||ka["Arabic Presentation Forms-B"](e))}function Ca(e){return!(e<11904)&&!!(ka["Bopomofo Extended"](e)||ka.Bopomofo(e)||ka["CJK Compatibility Forms"](e)||ka["CJK Compatibility Ideographs"](e)||ka["CJK Compatibility"](e)||ka["CJK Radicals Supplement"](e)||ka["CJK Strokes"](e)||ka["CJK Symbols and Punctuation"](e)||ka["CJK Unified Ideographs Extension A"](e)||ka["CJK Unified Ideographs"](e)||ka["Enclosed CJK Letters and Months"](e)||ka["Halfwidth and Fullwidth Forms"](e)||ka.Hiragana(e)||ka["Ideographic Description Characters"](e)||ka["Kangxi Radicals"](e)||ka["Katakana Phonetic Extensions"](e)||ka.Katakana(e)||ka["Vertical Forms"](e)||ka["Yi Radicals"](e)||ka["Yi Syllables"](e))}function za(e){return 746===e||747===e||!(e<4352)&&!(!(ka["Bopomofo Extended"](e)||ka.Bopomofo(e)||ka["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||ka["CJK Compatibility Ideographs"](e)||ka["CJK Compatibility"](e)||ka["CJK Radicals Supplement"](e)||ka["CJK Strokes"](e)||ka["CJK Symbols and Punctuation"](e)&&!(e>=12296&&e<=12305)&&!(e>=12308&&e<=12319)&&12336!==e||ka["CJK Unified Ideographs Extension A"](e)||ka["CJK Unified Ideographs"](e)||ka["Enclosed CJK Letters and Months"](e)||ka["Hangul Compatibility Jamo"](e)||ka["Hangul Jamo Extended-A"](e)||ka["Hangul Jamo Extended-B"](e)||ka["Hangul Jamo"](e)||ka["Hangul Syllables"](e)||ka.Hiragana(e)||ka["Ideographic Description Characters"](e)||ka.Kanbun(e)||ka["Kangxi Radicals"](e)||ka["Katakana Phonetic Extensions"](e)||ka.Katakana(e)&&12540!==e)&&(!ka["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)&&(!ka["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)&&!ka["Unified Canadian Aboriginal Syllabics"](e)&&!ka["Unified Canadian Aboriginal Syllabics Extended"](e)&&!ka["Vertical Forms"](e)&&!ka["Yijing Hexagram Symbols"](e)&&!ka["Yi Syllables"](e)&&!ka["Yi Radicals"](e))}function Ba(e){return!!(ka["Latin-1 Supplement"](e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||ka["General Punctuation"](e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||ka["Letterlike Symbols"](e)||ka["Number Forms"](e)||ka["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||ka["Control Pictures"](e)&&9251!==e||ka["Optical Character Recognition"](e)||ka["Enclosed Alphanumerics"](e)||ka["Geometric Shapes"](e)||ka["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||ka["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||ka["CJK Symbols and Punctuation"](e)||ka.Katakana(e)||ka["Private Use Area"](e)||ka["CJK Compatibility Forms"](e)||ka["Small Form Variants"](e)||ka["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e)}function Va(e){return!(za(e)||Ba(e))}function Ea(e){return ka.Arabic(e)||ka["Arabic Supplement"](e)||ka["Arabic Extended-A"](e)||ka["Arabic Presentation Forms-A"](e)||ka["Arabic Presentation Forms-B"](e)}function Fa(e){return e>=1424&&e<=2303||ka["Arabic Presentation Forms-A"](e)||ka["Arabic Presentation Forms-B"](e)}function Ta(e,t){return!(!t&&Fa(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||ka.Khmer(e))}function La(e){for(let t of e)if(Fa(t.charCodeAt(0)))return!0;return!1}function Da(e,t){for(let r of e)if(!Ta(r.charCodeAt(0),t))return!1;return!0}l(Ia,"allowsVerticalWritingMode"),l(Ma,"allowsLetterSpacing"),l(Pa,"charAllowsLetterSpacing"),l(Ca,"charAllowsIdeographicBreaking"),l(za,"charHasUprightVerticalOrientation"),l(Ba,"charHasNeutralVerticalOrientation"),l(Va,"charHasRotatedVerticalOrientation"),l(Ea,"charInComplexShapingScript"),l(Fa,"charInRTLScript"),l(Ta,"charInSupportedScript"),l(La,"stringContainsRTLText"),l(Da,"isStringInSupportedScript"),p(),p();typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),typeof navigator<"u"&&navigator.hardwareConcurrency;var Oa="loading",Ra="loaded",qa="unavailable",Ua=null,ja=(new xa,l((function(){return qa}),"getRTLTextPluginStatus")),Na={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>qa===Ra||null!=Na.applyArabicShaping,isLoading:()=>qa===Oa,setState(e){if(!N())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");qa=e.pluginStatus,Ua=e.pluginURL},isParsed(){if(!N())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return null!=Na.applyArabicShaping&&null!=Na.processBidirectionalText&&null!=Na.processStyledBidirectionalText},getPluginURL(){if(!N())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return Ua}},Za=class{constructor(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Aa,this.transition={})}isSupportedScript(e){return Da(e,Na.isLoaded())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}}};l(Za,"EvaluationParameters");var Ja=Za,Ga=class{constructor(e,t){this.property=e,this.value=t,this.expression=Ji(void 0===t?e.specification.default:t,e.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)}};l(Ga,"PropertyValue");var Ka=Ga,Xa=class{constructor(e){this.property=e,this.value=new Ka(e,void 0)}transitioned(e,t){return new Qa(this.property,this.value,t,E({},e.transition,this.transition),e.now)}untransitioned(){return new Qa(this.property,this.value,null,{},0)}};l(Xa,"TransitionablePropertyValue");var Ya=Xa,Ha=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return D(this._values[e].value.value)}setValue(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Ya(this._values[e].property)),this._values[e].value=new Ka(this._values[e].property,null===t?void 0:D(t))}getTransition(e){return D(this._values[e].transition)}setTransition(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Ya(this._values[e].property)),this._values[e].transition=D(t)||void 0}serialize(){let e={};for(let t of Object.keys(this._values)){let r=this.getValue(t);void 0!==r&&(e[t]=r);let i=this.getTransition(t);void 0!==i&&(e["".concat(t,"-transition")]=i)}return e}transitioned(e,t){let r=new ts(this._properties);for(let i of Object.keys(this._values))r._values[i]=this._values[i].transitioned(e,t._values[i]);return r}untransitioned(){let e=new ts(this._properties);for(let t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}};l(Ha,"Transitionable");var Wa=Ha,$a=class{constructor(e,t,r,i,n){this.property=e,this.value=t,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,e.specification.transition&&(i.delay||i.duration)&&(this.prior=r)}possiblyEvaluate(e,t,r){let i=e.now||0,n=this.value.possiblyEvaluate(e,t,r),a=this.prior;if(a){if(i>this.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(i<this.begin)return a.possiblyEvaluate(e,t,r);{let s=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(e,t,r),n,C(s))}}return n}};l($a,"TransitioningPropertyValue");var Qa=$a,es=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,r){let i=new os(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(e,t,r);return i}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}};l(es,"Transitioning");var ts=es,rs=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}getValue(e){return D(this._values[e].value)}setValue(e,t){this._values[e]=new Ka(this._values[e].property,null===t?void 0:D(t))}serialize(){let e={};for(let t of Object.keys(this._values)){let r=this.getValue(t);void 0!==r&&(e[t]=r)}return e}possiblyEvaluate(e,t,r){let i=new os(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(e,t,r);return i}};l(rs,"Layout");var is=rs,ns=class{constructor(e,t,r){this.property=e,this.value=t,this.parameters=r}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,t,r,i){return this.property.evaluate(this.value,this.parameters,e,t,r,i)}};l(ns,"PossiblyEvaluatedPropertyValue");var as=ns,ss=class{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}};l(ss,"PossiblyEvaluated");var os=ss,ls=class{constructor(e){this.specification=e}possiblyEvaluate(e,t){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(t)}interpolate(e,t,r){let i=this.specification.type,n=br[i];return n?n(e,t,r):e}};l(ls,"DataConstantProperty");var us=ls,cs=class{constructor(e,t){this.specification=e,this.overrides=t}possiblyEvaluate(e,t,r,i){return"constant"===e.expression.kind||"camera"===e.expression.kind?new as(this,{kind:"constant",value:e.expression.evaluate(t,null,{},r,i)},t):new as(this,e.expression,t)}interpolate(e,t,r){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new as(this,{kind:"constant",value:void 0},e.parameters);let i=this.specification.type,n=br[i];if(n){let i=n(e.value.value,t.value.value,r);return new as(this,{kind:"constant",value:i},e.parameters)}return e}evaluate(e,t,r,i,n,a){return"constant"===e.kind?e.value:e.evaluate(t,r,i,n,a)}};l(cs,"DataDrivenProperty");var hs=cs,ps=class extends hs{possiblyEvaluate(e,t,r,i){if(void 0===e.value)return new as(this,{kind:"constant",value:void 0},t);if("constant"===e.expression.kind){let n=e.expression.evaluate(t,null,{},r,i),a="resolvedImage"===e.property.specification.type&&"string"!=typeof n?n.name:n,s=this._calculate(a,a,a,t);return new as(this,{kind:"constant",value:s},t)}if("camera"===e.expression.kind){let r=this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t);return new as(this,{kind:"constant",value:r},t)}return new as(this,e.expression,t)}evaluate(e,t,r,i,n,a){if("source"===e.kind){let s=e.evaluate(t,r,i,n,a);return this._calculate(s,s,s,t)}return"composite"===e.kind?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},r,i),e.evaluate({zoom:Math.floor(t.zoom)},r,i),e.evaluate({zoom:Math.floor(t.zoom)+1},r,i),t):e.value}_calculate(e,t,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}};l(ps,"CrossFadedDataDrivenProperty");var ds=ps,fs=class{constructor(e){this.specification=e}possiblyEvaluate(e,t,r,i){if(void 0!==e.value){if("constant"===e.expression.kind){let n=e.expression.evaluate(t,null,{},r,i);return this._calculate(n,n,n,t)}return this._calculate(e.expression.evaluate(new Ja(Math.floor(t.zoom-1),t)),e.expression.evaluate(new Ja(Math.floor(t.zoom),t)),e.expression.evaluate(new Ja(Math.floor(t.zoom+1),t)),t)}}_calculate(e,t,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}};l(fs,"CrossFadedProperty");var ys=fs,ms=class{constructor(e){this.specification=e}possiblyEvaluate(e,t,r,i){return!!e.expression.evaluate(t,null,{},r,i)}interpolate(){return!1}};l(ms,"ColorRampProperty");var gs=ms,xs=class{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let t in e){let r=e[t];r.specification.overridable&&this.overridableProperties.push(t);let i=this.defaultPropertyValues[t]=new Ka(r,void 0),n=this.defaultTransitionablePropertyValues[t]=new Ya(r);this.defaultTransitioningPropertyValues[t]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=i.possiblyEvaluate({})}}};l(xs,"Properties");var vs=xs;ia("DataDrivenProperty",hs),ia("DataConstantProperty",us),ia("CrossFadedDataDrivenProperty",ds),ia("CrossFadedProperty",ys),ia("ColorRampProperty",gs);var bs="-transition",ws=class extends xa{constructor(e,t){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:l((()=>!0),"filter"),needGeometry:!1},"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),t.layout&&(this._unevaluatedLayout=new is(t.layout)),t.paint)){this._transitionablePaint=new Wa(t.paint);for(let t in e.paint)this.setPaintProperty(t,e.paint[t],{validate:!1});for(let t in e.layout)this.setLayoutProperty(t,e.layout[t],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new os(t.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,t,r={}){if(null!=t){let i="layers.".concat(this.id,".layout.").concat(e);if(this._validate(wa,i,e,t,r))return}"visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility=t}getPaintProperty(e){return e.endsWith(bs)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,t,r={}){if(null!=t){let i="layers.".concat(this.id,".paint.").concat(e);if(this._validate(ba,i,e,t,r))return!1}if(e.endsWith(bs))return this._transitionablePaint.setTransition(e.slice(0,-11),t||void 0),!1;{let r=this._transitionablePaint._values[e],i="cross-faded-data-driven"===r.property.specification["property-type"],n=r.value.isDataDriven(),a=r.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);let s=this._transitionablePaint._values[e].value;return s.isDataDriven()||n||i||this._handleOverridablePaintPropertyUpdate(e,a,s)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,t,r){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom||this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){let e={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&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),L(e,((e,t)=>!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)))}_validate(e,t,r,i,n={}){return(!n||!1!==n.validate)&&_a(this,e.call(va,{key:t,layerType:this.type,objectKey:r,value:i,styleSpec:H,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let t=this.paint.get(e);if(t instanceof as&&wi(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}};l(ws,"StyleLayer");var _s=ws;p(),p(),p();var Ss={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},As=class{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}};l(As,"Struct");var ks=As,Is=class{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}};l(Is,"StructArray");var Ms=Is;function Ps(e,t=1){let r=0,i=0;return{members:e.map((e=>{let n=Cs(e.type),a=r=zs(r,Math.max(t,n)),s=e.components||1;return i=Math.max(i,n),r+=n*s,{name:e.name,type:e.type,components:s,offset:a}})),size:zs(r,Math.max(i,t)),alignment:t}}function Cs(e){return Ss[e].BYTES_PER_ELEMENT}function zs(e,t){return Math.ceil(e/t)*t}l(Ps,"createLayout"),l(Cs,"sizeOf"),l(zs,"align");var Bs=h(d(),1),Vs=class extends Ms{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let i=2*e;return this.int16[i+0]=t,this.int16[i+1]=r,e}};l(Vs,"StructArrayLayout2i4");var Es=Vs;Es.prototype.bytesPerElement=4,ia("StructArrayLayout2i4",Es);var Fs=class extends Ms{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=3*e;return this.int16[n+0]=t,this.int16[n+1]=r,this.int16[n+2]=i,e}};l(Fs,"StructArrayLayout3i6");var Ts=Fs;Ts.prototype.bytesPerElement=6,ia("StructArrayLayout3i6",Ts);var Ls=class extends Ms{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){let a=4*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=i,this.int16[a+3]=n,e}};l(Ls,"StructArrayLayout4i8");var Ds=Ls;Ds.prototype.bytesPerElement=8,ia("StructArrayLayout4i8",Ds);var Os=class extends Ms{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,s){let o=6*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,e}};l(Os,"StructArrayLayout2i4i12");var Rs=Os;Rs.prototype.bytesPerElement=12,ia("StructArrayLayout2i4i12",Rs);var qs=class extends Ms{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,s){let o=4*e,l=8*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.uint8[l+4]=i,this.uint8[l+5]=n,this.uint8[l+6]=a,this.uint8[l+7]=s,e}};l(qs,"StructArrayLayout2i4ub8");var Us=qs;Us.prototype.bytesPerElement=8,ia("StructArrayLayout2i4ub8",Us);var js=class extends Ms{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let i=2*e;return this.float32[i+0]=t,this.float32[i+1]=r,e}};l(js,"StructArrayLayout2f8");var Ns=js;Ns.prototype.bytesPerElement=8,ia("StructArrayLayout2f8",Ns);var Zs=class extends Ms{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o,l,u){let c=this.length;return this.resize(c+1),this.emplace(c,e,t,r,i,n,a,s,o,l,u)}emplace(e,t,r,i,n,a,s,o,l,u,c){let h=10*e;return this.uint16[h+0]=t,this.uint16[h+1]=r,this.uint16[h+2]=i,this.uint16[h+3]=n,this.uint16[h+4]=a,this.uint16[h+5]=s,this.uint16[h+6]=o,this.uint16[h+7]=l,this.uint16[h+8]=u,this.uint16[h+9]=c,e}};l(Zs,"StructArrayLayout10ui20");var Js=Zs;Js.prototype.bytesPerElement=20,ia("StructArrayLayout10ui20",Js);var Gs=class extends Ms{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o,l,u,c,h){let p=this.length;return this.resize(p+1),this.emplace(p,e,t,r,i,n,a,s,o,l,u,c,h)}emplace(e,t,r,i,n,a,s,o,l,u,c,h,p){let d=12*e;return this.int16[d+0]=t,this.int16[d+1]=r,this.int16[d+2]=i,this.int16[d+3]=n,this.uint16[d+4]=a,this.uint16[d+5]=s,this.uint16[d+6]=o,this.uint16[d+7]=l,this.int16[d+8]=u,this.int16[d+9]=c,this.int16[d+10]=h,this.int16[d+11]=p,e}};l(Gs,"StructArrayLayout4i4ui4i24");var Ks=Gs;Ks.prototype.bytesPerElement=24,ia("StructArrayLayout4i4ui4i24",Ks);var Xs=class extends Ms{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=3*e;return this.float32[n+0]=t,this.float32[n+1]=r,this.float32[n+2]=i,e}};l(Xs,"StructArrayLayout3f12");var Ys=Xs;Ys.prototype.bytesPerElement=12,ia("StructArrayLayout3f12",Ys);var Hs=class extends Ms{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){let r=1*e;return this.uint32[r+0]=t,e}};l(Hs,"StructArrayLayout1ul4");var Ws=Hs;Ws.prototype.bytesPerElement=4,ia("StructArrayLayout1ul4",Ws);var $s=class extends Ms{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o,l){let u=this.length;return this.resize(u+1),this.emplace(u,e,t,r,i,n,a,s,o,l)}emplace(e,t,r,i,n,a,s,o,l,u){let c=10*e,h=5*e;return this.int16[c+0]=t,this.int16[c+1]=r,this.int16[c+2]=i,this.int16[c+3]=n,this.int16[c+4]=a,this.int16[c+5]=s,this.uint32[h+3]=o,this.uint16[c+8]=l,this.uint16[c+9]=u,e}};l($s,"StructArrayLayout6i1ul2ui20");var Qs=$s;Qs.prototype.bytesPerElement=20,ia("StructArrayLayout6i1ul2ui20",Qs);var eo=class extends Ms{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,s){let o=6*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,e}};l(eo,"StructArrayLayout2i2i2i12");var to=eo;to.prototype.bytesPerElement=12,ia("StructArrayLayout2i2i2i12",to);var ro=class extends Ms{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n){let a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,i,n)}emplace(e,t,r,i,n,a){let s=4*e,o=8*e;return this.float32[s+0]=t,this.float32[s+1]=r,this.float32[s+2]=i,this.int16[o+6]=n,this.int16[o+7]=a,e}};l(ro,"StructArrayLayout2f1f2i16");var io=ro;io.prototype.bytesPerElement=16,ia("StructArrayLayout2f1f2i16",io);var no=class extends Ms{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){let a=12*e,s=3*e;return this.uint8[a+0]=t,this.uint8[a+1]=r,this.float32[s+1]=i,this.float32[s+2]=n,e}};l(no,"StructArrayLayout2ub2f12");var ao=no;ao.prototype.bytesPerElement=12,ia("StructArrayLayout2ub2f12",ao);var so=class extends Ms{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=3*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,this.uint16[n+2]=i,e}};l(so,"StructArrayLayout3ui6");var oo=so;oo.prototype.bytesPerElement=6,ia("StructArrayLayout3ui6",oo);var lo=class extends Ms{_refreshViews(){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)}emplaceBack(e,t,r,i,n,a,s,o,l,u,c,h,p,d,f,y,m){let g=this.length;return this.resize(g+1),this.emplace(g,e,t,r,i,n,a,s,o,l,u,c,h,p,d,f,y,m)}emplace(e,t,r,i,n,a,s,o,l,u,c,h,p,d,f,y,m,g){let x=24*e,v=12*e,b=48*e;return this.int16[x+0]=t,this.int16[x+1]=r,this.uint16[x+2]=i,this.uint16[x+3]=n,this.uint32[v+2]=a,this.uint32[v+3]=s,this.uint32[v+4]=o,this.uint16[x+10]=l,this.uint16[x+11]=u,this.uint16[x+12]=c,this.float32[v+7]=h,this.float32[v+8]=p,this.uint8[b+36]=d,this.uint8[b+37]=f,this.uint8[b+38]=y,this.uint32[v+10]=m,this.int16[x+22]=g,e}};l(lo,"StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48");var uo=lo;uo.prototype.bytesPerElement=48,ia("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",uo);var co=class extends Ms{_refreshViews(){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)}emplaceBack(e,t,r,i,n,a,s,o,l,u,c,h,p,d,f,y,m,g,x,v,b,w,_,S,A,k,I,M){let P=this.length;return this.resize(P+1),this.emplace(P,e,t,r,i,n,a,s,o,l,u,c,h,p,d,f,y,m,g,x,v,b,w,_,S,A,k,I,M)}emplace(e,t,r,i,n,a,s,o,l,u,c,h,p,d,f,y,m,g,x,v,b,w,_,S,A,k,I,M,P){let C=34*e,z=17*e;return this.int16[C+0]=t,this.int16[C+1]=r,this.int16[C+2]=i,this.int16[C+3]=n,this.int16[C+4]=a,this.int16[C+5]=s,this.int16[C+6]=o,this.int16[C+7]=l,this.uint16[C+8]=u,this.uint16[C+9]=c,this.uint16[C+10]=h,this.uint16[C+11]=p,this.uint16[C+12]=d,this.uint16[C+13]=f,this.uint16[C+14]=y,this.uint16[C+15]=m,this.uint16[C+16]=g,this.uint16[C+17]=x,this.uint16[C+18]=v,this.uint16[C+19]=b,this.uint16[C+20]=w,this.uint16[C+21]=_,this.uint16[C+22]=S,this.uint32[z+12]=A,this.float32[z+13]=k,this.float32[z+14]=I,this.float32[z+15]=M,this.float32[z+16]=P,e}};l(co,"StructArrayLayout8i15ui1ul4f68");var ho=co;ho.prototype.bytesPerElement=68,ia("StructArrayLayout8i15ui1ul4f68",ho);var po=class extends Ms{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){let r=1*e;return this.float32[r+0]=t,e}};l(po,"StructArrayLayout1f4");var fo=po;fo.prototype.bytesPerElement=4,ia("StructArrayLayout1f4",fo);var yo=class extends Ms{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=2*e,a=4*e;return this.uint32[n+0]=t,this.uint16[a+2]=r,this.uint16[a+3]=i,e}};l(yo,"StructArrayLayout1ul2ui8");var mo=yo;mo.prototype.bytesPerElement=8,ia("StructArrayLayout1ul2ui8",mo);var go=class extends Ms{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let i=2*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,e}};l(go,"StructArrayLayout2ui4");var xo=go;xo.prototype.bytesPerElement=4,ia("StructArrayLayout2ui4",xo);var vo=class extends Ms{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){let r=1*e;return this.uint16[r+0]=t,e}};l(vo,"StructArrayLayout1ui2");var bo=vo;bo.prototype.bytesPerElement=2,ia("StructArrayLayout1ui2",bo);var wo=class extends Ms{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){let a=4*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=i,this.float32[a+3]=n,e}};l(wo,"StructArrayLayout4f16");var _o=wo;_o.prototype.bytesPerElement=16,ia("StructArrayLayout4f16",_o);var So=class extends ks{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new Bs.default(this.anchorPointX,this.anchorPointY)}};l(So,"CollisionBoxStruct");var Ao=So;Ao.prototype.size=20;var ko=class extends Qs{get(e){return new Ao(this,e)}};l(ko,"CollisionBoxArray");var Io=ko;ia("CollisionBoxArray",Io);var Mo=class extends ks{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}};l(Mo,"PlacedSymbolStruct");var Po=Mo;Po.prototype.size=48;var Co=class extends uo{get(e){return new Po(this,e)}};l(Co,"PlacedSymbolArray");var zo=Co;ia("PlacedSymbolArray",zo);var Bo=class extends ks{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}};l(Bo,"SymbolInstanceStruct");var Vo=Bo;Vo.prototype.size=68;var Eo=class extends ho{get(e){return new Vo(this,e)}};l(Eo,"SymbolInstanceArray");var Fo=Eo;ia("SymbolInstanceArray",Fo);var To=class extends fo{getoffsetX(e){return this.float32[1*e+0]}};l(To,"GlyphOffsetArray");var Lo=To;ia("GlyphOffsetArray",Lo);var Do=class extends Ts{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}};l(Do,"SymbolLineVertexArray");var Oo=Do;ia("SymbolLineVertexArray",Oo);var Ro=class extends ks{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}};l(Ro,"FeatureIndexStruct");var qo=Ro;qo.prototype.size=8;var Uo=class extends mo{get(e){return new qo(this,e)}};l(Uo,"FeatureIndexArray");var jo=Uo;ia("FeatureIndexArray",jo);var No=class extends Es{};l(No,"PosArray");var Zo=No,Jo=class extends Es{};l(Jo,"CircleLayoutArray");var Go=Jo,Ko=class extends Es{};l(Ko,"FillLayoutArray");var Xo=Ko,Yo=class extends Rs{};l(Yo,"FillExtrusionLayoutArray");var Ho=Yo,Wo=class extends Us{};l(Wo,"LineLayoutArray");var $o=Wo,Qo=class extends Ns{};l(Qo,"LineExtLayoutArray");var el=Qo,tl=class extends Js{};l(tl,"PatternLayoutArray");var rl=tl,il=class extends Ks{};l(il,"SymbolLayoutArray");var nl=il,al=class extends Ys{};l(al,"SymbolDynamicLayoutArray");var sl=al,ol=class extends Ws{};l(ol,"SymbolOpacityArray");var ll=ol,ul=class extends to{};l(ul,"CollisionBoxLayoutArray");var cl=ul,hl=class extends ao{};l(hl,"CollisionVertexArray");var pl=hl,dl=class extends oo{};l(dl,"TriangleIndexArray");var fl=dl,yl=class extends xo{};l(yl,"LineIndexArray");var ml=yl;p();var gl=Ps([{name:"a_pos",components:2,type:"Int16"}],4),{members:xl,size:vl,alignment:bl}=gl;p();var wl=class e{constructor(e=[]){this.segments=e}prepareSegment(t,r,i,n){let a=this.segments[this.segments.length-1];return t>e.MAX_VERTEX_ARRAY_LENGTH&&q("Max vertices per segment is ".concat(e.MAX_VERTEX_ARRAY_LENGTH,": bucket requested ").concat(t)),(!a||a.vertexLength+t>e.MAX_VERTEX_ARRAY_LENGTH||a.sortKey!==n)&&(a={vertexOffset:r.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0},void 0!==n&&(a.sortKey=n),this.segments.push(a)),a}get(){return this.segments}destroy(){for(let e of this.segments)for(let t in e.vaos)e.vaos[t].destroy()}static simpleSegment(t,r,i,n){return new e([{vertexOffset:t,primitiveOffset:r,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])}};l(wl,"SegmentVector");var _l=wl;function Sl(e,t){return 256*(e=B(Math.floor(e),0,255))+(t=B(Math.floor(t),0,255))}_l.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ia("SegmentVector",_l),p(),p(),l(Sl,"packUint8ToFloat"),p();var Al=Ps([{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"}]);p();var kl=h(g(),1),Il=class e{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,t,r,i){this.ids.push(Pl(e)),this.positions.push(t,r,i)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let t=Pl(e),r=0,i=this.ids.length-1;for(;r<i;){let e=r+i>>1;this.ids[e]>=t?i=e:r=e+1}let n=[];for(;this.ids[r]===t;){let e=this.positions[3*r],t=this.positions[3*r+1],i=this.positions[3*r+2];n.push({index:e,start:t,end:i}),r++}return n}static serialize(e,t){let r=new Float64Array(e.ids),i=new Uint32Array(e.positions);return Cl(r,i,0,r.length-1),t&&t.push(r.buffer,i.buffer),{ids:r,positions:i}}static deserialize(t){let r=new e;return r.ids=t.ids,r.positions=t.positions,r.indexed=!0,r}};l(Il,"FeaturePositionMap");var Ml=Il;function Pl(e){let t=+e;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:(0,kl.default)(String(e))}function Cl(e,t,r,i){for(;r<i;){let n=e[r+i>>1],a=r-1,s=i+1;for(;;){do{a++}while(e[a]<n);do{s--}while(e[s]>n);if(a>=s)break;zl(e,a,s),zl(t,3*a,3*s),zl(t,3*a+1,3*s+1),zl(t,3*a+2,3*s+2)}s-r<i-s?(Cl(e,t,r,s),r=s+1):(Cl(e,t,s+1,i),i=s)}}function zl(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}l(Pl,"getNumericId"),l(Cl,"sort"),l(zl,"swap"),ia("FeaturePositionMap",Ml),p();var Bl=class{constructor(e,t){this.gl=e.gl,this.location=t}};l(Bl,"Uniform");var Vl=Bl,El=class extends Vl{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}};l(El,"Uniform1f");var Fl=El,Tl=class extends Vl{constructor(e,t){super(e,t),this.current=[0,0,0,0]}set(e){(e[0]!==this.current[0]||e[1]!==this.current[1]||e[2]!==this.current[2]||e[3]!==this.current[3])&&(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}};l(Tl,"Uniform4f");var Ll=Tl,Dl=class extends Vl{constructor(e,t){super(e,t),this.current=Ye.transparent}set(e){(e.r!==this.current.r||e.g!==this.current.g||e.b!==this.current.b||e.a!==this.current.a)&&(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}};l(Dl,"UniformColor");var Ol=Dl;new Float32Array(16);function Rl(e){return[Sl(255*e.r,255*e.g),Sl(255*e.b,255*e.a)]}l(Rl,"packColor");var ql=class{constructor(e,t,r){this.value=e,this.uniformNames=t.map((e=>"u_".concat(e))),this.type=r}setUniform(e,t,r){e.set(r.constantOr(this.value))}getBinding(e,t,r){return"color"===this.type?new Ol(e,t):new Fl(e,t)}};l(ql,"ConstantBinder");var Ul=ql,jl=class{constructor(e,t){this.uniformNames=t.map((e=>"u_".concat(e))),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr}setUniform(e,t,r,i){let n="u_pattern_to"===i?this.patternTo:"u_pattern_from"===i?this.patternFrom:"u_pixel_ratio_to"===i?this.pixelRatioTo:"u_pixel_ratio_from"===i?this.pixelRatioFrom:null;n&&e.set(n)}getBinding(e,t,r){return"u_pattern"===r.substr(0,9)?new Ll(e,t):new Fl(e,t)}};l(jl,"CrossFadedConstantBinder");var Nl=jl,Zl=class{constructor(e,t,r,i){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:"a_".concat(e),type:"Float32",components:"color"===r?2:1,offset:0}))),this.paintVertexArray=new i}populatePaintArray(e,t,r,i,n){let a=this.paintVertexArray.length,s=this.expression.evaluate(new Ja(0),t,{},i,[],n);this.paintVertexArray.resize(e),this._setPaintValue(a,e,s)}updatePaintArray(e,t,r,i){let n=this.expression.evaluate({zoom:0},r,i);this._setPaintValue(e,t,n)}_setPaintValue(e,t,r){if("color"===this.type){let i=Rl(r);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,i[0],i[1])}else{for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}};l(Zl,"SourceExpressionBinder");var Jl=Zl,Gl=class{constructor(e,t,r,i,n,a){this.expression=e,this.uniformNames=t.map((e=>"u_".concat(e,"_t"))),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:"a_".concat(e),type:"Float32",components:"color"===r?4:2,offset:0}))),this.paintVertexArray=new a}populatePaintArray(e,t,r,i,n){let a=this.expression.evaluate(new Ja(this.zoom),t,{},i,[],n),s=this.expression.evaluate(new Ja(this.zoom+1),t,{},i,[],n),o=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(o,e,a,s)}updatePaintArray(e,t,r,i){let n=this.expression.evaluate({zoom:this.zoom},r,i),a=this.expression.evaluate({zoom:this.zoom+1},r,i);this._setPaintValue(e,t,n,a)}_setPaintValue(e,t,r,i){if("color"===this.type){let n=Rl(r),a=Rl(i);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,n[0],n[1],a[0],a[1])}else{for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,r,i);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(i))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t){let r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,i=B(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(i)}getBinding(e,t,r){return new Fl(e,t)}};l(Gl,"CompositeExpressionBinder");var Kl=Gl,Xl=class{constructor(e,t,r,i,n,a){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=i,this.layerId=a,this.zoomInPaintVertexArray=new n,this.zoomOutPaintVertexArray=new n}populatePaintArray(e,t,r){let i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(i,e,t.patterns&&t.patterns[this.layerId],r)}updatePaintArray(e,t,r,i,n){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],n)}_setPaintValues(e,t,r,i){if(!i||!r)return;let{min:n,mid:a,max:s}=r,o=i[n],l=i[a],u=i[s];if(o&&l&&u)for(let r=e;r<t;r++)this.zoomInPaintVertexArray.emplace(r,l.tl[0],l.tl[1],l.br[0],l.br[1],o.tl[0],o.tl[1],o.br[0],o.br[1],l.pixelRatio,o.pixelRatio),this.zoomOutPaintVertexArray.emplace(r,l.tl[0],l.tl[1],l.br[0],l.br[1],u.tl[0],u.tl[1],u.br[0],u.br[1],l.pixelRatio,u.pixelRatio)}upload(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,Al.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,Al.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}};l(Xl,"CrossFadedCompositeBinder");var Yl=Xl,Hl=class{constructor(e,t,r){this.binders={},this._buffers=[];let i=[];for(let n in e.paint._values){if(!r(n))continue;let a=e.paint.get(n);if(!(a instanceof as&&wi(a.property.specification)))continue;let s=eu(n,e.type),o=a.value,l=a.property.specification.type,u=a.property.useIntegerZoom,c=a.property.specification["property-type"],h="cross-faded"===c||"cross-faded-data-driven"===c;if("constant"===o.kind)this.binders[n]=h?new Nl(o.value,s):new Ul(o.value,s,l),i.push("/u_".concat(n));else if("source"===o.kind||h){let r=ru(n,l,"source");this.binders[n]=h?new Yl(o,l,u,t,r,e.id):new Jl(o,s,l,r),i.push("/a_".concat(n))}else{let e=ru(n,l,"composite");this.binders[n]=new Kl(o,s,l,u,t,e),i.push("/z_".concat(n))}}this.cacheKey=i.sort().join("")}getMaxValue(e){let t=this.binders[e];return t instanceof Jl||t instanceof Kl?t.maxValue:0}populatePaintArrays(e,t,r,i,n){for(let a in this.binders){let s=this.binders[a];(s instanceof Jl||s instanceof Kl||s instanceof Yl)&&s.populatePaintArray(e,t,r,i,n)}}setConstantPatternPositions(e,t){for(let r in this.binders){let i=this.binders[r];i instanceof Nl&&i.setConstantPatternPositions(e,t)}}updatePaintArrays(e,t,r,i,n){let a=!1;for(let s in e){let o=t.getPositions(s);for(let t of o){let o=r.feature(t.index);for(let r in this.binders){let l=this.binders[r];if((l instanceof Jl||l instanceof Kl||l instanceof Yl)&&!0===l.expression.isStateDependent){let u=i.paint.get(r);l.expression=u.value,l.updatePaintArray(t.start,t.end,o,e[s],n),a=!0}}}}return a}defines(){let e=[];for(let t in this.binders){let r=this.binders[t];(r instanceof Ul||r instanceof Nl)&&e.push(...r.uniformNames.map((e=>"#define HAS_UNIFORM_".concat(e))))}return e}getBinderAttributes(){let e=[];for(let t in this.binders){let r=this.binders[t];if(r instanceof Jl||r instanceof Kl)for(let t=0;t<r.paintVertexAttributes.length;t++)e.push(r.paintVertexAttributes[t].name);else if(r instanceof Yl)for(let t=0;t<Al.members.length;t++)e.push(Al.members[t].name)}return e}getBinderUniforms(){let e=[];for(let t in this.binders){let r=this.binders[t];if(r instanceof Ul||r instanceof Nl||r instanceof Kl)for(let t of r.uniformNames)e.push(t)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,t){let r=[];for(let i in this.binders){let n=this.binders[i];if(n instanceof Ul||n instanceof Nl||n instanceof Kl)for(let a of n.uniformNames)if(t[a]){let s=n.getBinding(e,t[a],a);r.push({name:a,property:i,binding:s})}}return r}setUniforms(e,t,r,i){for(let{name:e,property:n,binding:a}of t)this.binders[n].setUniform(a,i,r.get(n),e)}updatePaintBuffers(e){this._buffers=[];for(let t in this.binders){let r=this.binders[t];if(e&&r instanceof Yl){let t=2===e.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;t&&this._buffers.push(t)}else(r instanceof Jl||r instanceof Kl)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(e){for(let t in this.binders){let r=this.binders[t];(r instanceof Jl||r instanceof Kl||r instanceof Yl)&&r.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let t=this.binders[e];(t instanceof Jl||t instanceof Kl||t instanceof Yl)&&t.destroy()}}};l(Hl,"ProgramConfiguration");var Wl=Hl,$l=class{constructor(e,t,r=()=>!0){this.programConfigurations={};for(let i of e)this.programConfigurations[i.id]=new Wl(i,t,r);this.needsUpload=!1,this._featureMap=new Ml,this._bufferOffset=0}populatePaintArrays(e,t,r,i,n,a){for(let r in this.programConfigurations)this.programConfigurations[r].populatePaintArrays(e,t,i,n,a);void 0!==t.id&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,r,i){for(let n of r)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(e,this._featureMap,t,n,i)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}};l($l,"ProgramConfigurationSet");var Ql=$l;function eu(e,t){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"]}[e]||[e.replace("".concat(t,"-"),"").replace(/-/g,"_")]}function tu(e){return{"line-pattern":{source:rl,composite:rl},"fill-pattern":{source:rl,composite:rl},"fill-extrusion-pattern":{source:rl,composite:rl}}[e]}function ru(e,t,r){let i={color:{source:Ns,composite:_o},number:{source:fo,composite:Ns}},n=tu(e);return n&&n[r]||i[t][r]}l(eu,"paintAttributeNames"),l(tu,"getLayoutException"),l(ru,"layoutType"),ia("ConstantBinder",Ul),ia("CrossFadedConstantBinder",Nl),ia("SourceExpressionBinder",Jl),ia("CrossFadedCompositeBinder",Yl),ia("CompositeExpressionBinder",Kl),ia("ProgramConfiguration",Wl,{omit:["_buffers"]}),ia("ProgramConfigurationSet",Ql),p(),p(),p();var iu=Math.pow(2,14)-1,nu=-iu-1;function au(e){let t=8192/e.extent,r=e.loadGeometry();for(let e=0;e<r.length;e++){let i=r[e];for(let e=0;e<i.length;e++){let r=i[e],n=Math.round(r.x*t),a=Math.round(r.y*t);r.x=B(n,nu,iu),r.y=B(a,nu,iu),(n<r.x||n>r.x+1||a<r.y||a>r.y+1)&&q("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function su(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?au(e):[]}}function ou(e,t,r,i,n){e.emplaceBack(2*t+(i+1)/2,2*r+(n+1)/2)}l(au,"loadGeometry"),p(),l(su,"toEvaluationFeature"),l(ou,"addCircleVertex");var lu=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Go,this.indexArray=new fl,this.segments=new _l,this.programConfigurations=new Ql(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){let i=this.layers[0],n=[],a=null,s=!1;"circle"===i.type&&(a=i.layout.get("circle-sort-key"),s=!a.isConstant());for(let{feature:t,id:i,index:o,sourceLayerIndex:l}of e){let e=this.layers[0]._featureFilter.needGeometry,u=su(t,e);if(!this.layers[0]._featureFilter.filter(new Ja(this.zoom),u,r))continue;let c=s?a.evaluate(u,{},r):void 0,h={id:i,properties:t.properties,type:t.type,sourceLayerIndex:l,index:o,geometry:e?u.geometry:au(t),patterns:{},sortKey:c};n.push(h)}s&&n.sort(((e,t)=>e.sortKey-t.sortKey));for(let i of n){let{geometry:n,index:a,sourceLayerIndex:s}=i,o=e[a].feature;this.addFeature(i,n,a,r),t.featureIndex.insert(o,n,a,s,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,xl),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,r,i){for(let r of t)for(let t of r){let r=t.x,i=t.y;if(r<0||r>=8192||i<0||i>=8192)continue;let n=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),a=n.vertexLength;ou(this.layoutVertexArray,r,i,-1,-1),ou(this.layoutVertexArray,r,i,1,-1),ou(this.layoutVertexArray,r,i,1,1),ou(this.layoutVertexArray,r,i,-1,1),this.indexArray.emplaceBack(a,a+1,a+2),this.indexArray.emplaceBack(a,a+3,a+2),n.vertexLength+=4,n.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},i)}};l(lu,"CircleBucket");var uu=lu;ia("CircleBucket",uu,{omit:["layers"]}),p();var cu=h(d(),1);function hu(e,t){for(let r=0;r<e.length;r++)if(wu(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(wu(e,t[r]))return!0;return!!mu(e,t)}function pu(e,t,r){return!(!wu(e,t)&&!xu(t,e,r))}function du(e,t){if(1===e.length)return bu(t,e[0]);for(let r=0;r<t.length;r++){let i=t[r];for(let t=0;t<i.length;t++)if(wu(e,i[t]))return!0}for(let r=0;r<e.length;r++)if(bu(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(mu(e,t[r]))return!0;return!1}function fu(e,t,r){for(let i=0;i<t.length;i++){let n=t[i];if(e.length>=3)for(let t=0;t<n.length;t++)if(wu(e,n[t]))return!0;if(yu(e,n,r))return!0}return!1}function yu(e,t,r){if(e.length>1){if(mu(e,t))return!0;for(let i=0;i<t.length;i++)if(xu(t[i],e,r))return!0}for(let i=0;i<e.length;i++)if(xu(e[i],t,r))return!0;return!1}function mu(e,t){if(0===e.length||0===t.length)return!1;for(let r=0;r<e.length-1;r++){let i=e[r],n=e[r+1];for(let e=0;e<t.length-1;e++){if(gu(i,n,t[e],t[e+1]))return!0}}return!1}function gu(e,t,r,i){return U(e,r,i)!==U(t,r,i)&&U(e,t,r)!==U(e,t,i)}function xu(e,t,r){let i=r*r;if(1===t.length)return e.distSqr(t[0])<i;for(let r=1;r<t.length;r++){if(vu(e,t[r-1],t[r])<i)return!0}return!1}function vu(e,t,r){let i=t.distSqr(r);if(0===i)return e.distSqr(t);let n=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/i;return n<0?e.distSqr(t):n>1?e.distSqr(r):e.distSqr(r.sub(t)._mult(n)._add(t))}function bu(e,t){let r,i,n,a=!1;for(let s=0;s<e.length;s++){r=e[s];for(let e=0,s=r.length-1;e<r.length;s=e++)i=r[e],n=r[s],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(a=!a)}return a}function wu(e,t){let r=!1;for(let i=0,n=e.length-1;i<e.length;n=i++){let a=e[i],s=e[n];a.y>t.y!=s.y>t.y&&t.x<(s.x-a.x)*(t.y-a.y)/(s.y-a.y)+a.x&&(r=!r)}return r}function _u(e,t,r,i,n){for(let a of e)if(t<=a.x&&r<=a.y&&i>=a.x&&n>=a.y)return!0;let a=[new cu.default(t,r),new cu.default(t,n),new cu.default(i,n),new cu.default(i,r)];if(e.length>2)for(let t of a)if(wu(e,t))return!0;for(let t=0;t<e.length-1;t++){if(Su(e[t],e[t+1],a))return!0}return!1}function Su(e,t,r){let i=r[0],n=r[2];if(e.x<i.x&&t.x<i.x||e.x>n.x&&t.x>n.x||e.y<i.y&&t.y<i.y||e.y>n.y&&t.y>n.y)return!1;let a=U(e,t,r[0]);return a!==U(e,t,r[1])||a!==U(e,t,r[2])||a!==U(e,t,r[3])}l(hu,"polygonIntersectsPolygon"),l(pu,"polygonIntersectsBufferedPoint"),l(du,"polygonIntersectsMultiPolygon"),l(fu,"polygonIntersectsBufferedMultiLine"),l(yu,"lineIntersectsBufferedLine"),l(mu,"lineIntersectsLine"),l(gu,"lineSegmentIntersectsLineSegment"),l(xu,"pointIntersectsBufferedLine"),l(vu,"distToSegmentSquared"),l(bu,"multiPolygonContainsPoint"),l(wu,"polygonContainsPoint"),l(_u,"polygonIntersectsBox"),l(Su,"edgeIntersectsBox"),p();var Au=h(d(),1);function ku(e,t,r){let i=t.paint.get(e).value;return"constant"===i.kind?i.value:r.programConfigurations.get(t.id).getMaxValue(e)}function Iu(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Mu(e,t,r,i,n){if(!t[0]&&!t[1])return e;let a=Au.default.convert(t)._mult(n);"viewport"===r&&a._rotate(-i);let s=[];for(let t=0;t<e.length;t++){let r=e[t];s.push(r.sub(a))}return s}function Pu(e,t){let r=[];for(let i=0;i<e.length;i++){let n=e[i],a=[];for(let e=0;e<n.length;e++){let r=n[e-1],i=n[e],s=n[e+1],o=0===e?new Au.default(0,0):i.sub(r)._unit()._perp(),l=e===n.length-1?new Au.default(0,0):s.sub(i)._unit()._perp(),u=o._add(l)._unit(),c=u.x*l.x+u.y*l.y;0!==c&&u._mult(1/c),a.push(u._mult(t)._add(i))}r.push(a)}return r}l(ku,"getMaximumPaintValue"),l(Iu,"translateDistance"),l(Mu,"translate"),l(Pu,"offsetLine"),p();var Cu,zu,Bu=l((()=>Cu=Cu||new vs({"circle-sort-key":new hs(H.layout_circle["circle-sort-key"])})),"getLayout"),Vu=l((()=>zu=zu||new vs({"circle-radius":new hs(H.paint_circle["circle-radius"]),"circle-color":new hs(H.paint_circle["circle-color"]),"circle-blur":new hs(H.paint_circle["circle-blur"]),"circle-opacity":new hs(H.paint_circle["circle-opacity"]),"circle-translate":new us(H.paint_circle["circle-translate"]),"circle-translate-anchor":new us(H.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new us(H.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new us(H.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new hs(H.paint_circle["circle-stroke-width"]),"circle-stroke-color":new hs(H.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new hs(H.paint_circle["circle-stroke-opacity"])})),"getPaint"),Eu={get paint(){return Vu()},get layout(){return Bu()}};p(),p();var Fu=1e-6,Tu=typeof Float32Array<"u"?Float32Array:Array,Lu=Math.random;Math.PI;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var Du={};function Ou(){var e=new Tu(16);return Tu!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Ru(e){var t=new Tu(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function qu(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Uu(e,t,r,i,n,a,s,o,l,u,c,h,p,d,f,y){var m=new Tu(16);return m[0]=e,m[1]=t,m[2]=r,m[3]=i,m[4]=n,m[5]=a,m[6]=s,m[7]=o,m[8]=l,m[9]=u,m[10]=c,m[11]=h,m[12]=p,m[13]=d,m[14]=f,m[15]=y,m}function ju(e,t,r,i,n,a,s,o,l,u,c,h,p,d,f,y,m){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e[4]=a,e[5]=s,e[6]=o,e[7]=l,e[8]=u,e[9]=c,e[10]=h,e[11]=p,e[12]=d,e[13]=f,e[14]=y,e[15]=m,e}function Nu(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Zu(e,t){if(e===t){var r=t[1],i=t[2],n=t[3],a=t[6],s=t[7],o=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=i,e[9]=a,e[11]=t[14],e[12]=n,e[13]=s,e[14]=o}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function Ju(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],s=t[4],o=t[5],l=t[6],u=t[7],c=t[8],h=t[9],p=t[10],d=t[11],f=t[12],y=t[13],m=t[14],g=t[15],x=r*o-i*s,v=r*l-n*s,b=r*u-a*s,w=i*l-n*o,_=i*u-a*o,S=n*u-a*l,A=c*y-h*f,k=c*m-p*f,I=c*g-d*f,M=h*m-p*y,P=h*g-d*y,C=p*g-d*m,z=x*C-v*P+b*M+w*I-_*k+S*A;return z?(z=1/z,e[0]=(o*C-l*P+u*M)*z,e[1]=(n*P-i*C-a*M)*z,e[2]=(y*S-m*_+g*w)*z,e[3]=(p*_-h*S-d*w)*z,e[4]=(l*I-s*C-u*k)*z,e[5]=(r*C-n*I+a*k)*z,e[6]=(m*b-f*S-g*v)*z,e[7]=(c*S-p*b+d*v)*z,e[8]=(s*P-o*I+u*A)*z,e[9]=(i*I-r*P-a*A)*z,e[10]=(f*_-y*b+g*x)*z,e[11]=(h*b-c*_-d*x)*z,e[12]=(o*k-s*M-l*A)*z,e[13]=(r*M-i*k+n*A)*z,e[14]=(y*v-f*w-m*x)*z,e[15]=(c*w-h*v+p*x)*z,e):null}function Gu(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],s=t[4],o=t[5],l=t[6],u=t[7],c=t[8],h=t[9],p=t[10],d=t[11],f=t[12],y=t[13],m=t[14],g=t[15];return e[0]=o*(p*g-d*m)-h*(l*g-u*m)+y*(l*d-u*p),e[1]=-(i*(p*g-d*m)-h*(n*g-a*m)+y*(n*d-a*p)),e[2]=i*(l*g-u*m)-o*(n*g-a*m)+y*(n*u-a*l),e[3]=-(i*(l*d-u*p)-o*(n*d-a*p)+h*(n*u-a*l)),e[4]=-(s*(p*g-d*m)-c*(l*g-u*m)+f*(l*d-u*p)),e[5]=r*(p*g-d*m)-c*(n*g-a*m)+f*(n*d-a*p),e[6]=-(r*(l*g-u*m)-s*(n*g-a*m)+f*(n*u-a*l)),e[7]=r*(l*d-u*p)-s*(n*d-a*p)+c*(n*u-a*l),e[8]=s*(h*g-d*y)-c*(o*g-u*y)+f*(o*d-u*h),e[9]=-(r*(h*g-d*y)-c*(i*g-a*y)+f*(i*d-a*h)),e[10]=r*(o*g-u*y)-s*(i*g-a*y)+f*(i*u-a*o),e[11]=-(r*(o*d-u*h)-s*(i*d-a*h)+c*(i*u-a*o)),e[12]=-(s*(h*m-p*y)-c*(o*m-l*y)+f*(o*p-l*h)),e[13]=r*(h*m-p*y)-c*(i*m-n*y)+f*(i*p-n*h),e[14]=-(r*(o*m-l*y)-s*(i*m-n*y)+f*(i*l-n*o)),e[15]=r*(o*p-l*h)-s*(i*p-n*h)+c*(i*l-n*o),e}function Ku(e){var t=e[0],r=e[1],i=e[2],n=e[3],a=e[4],s=e[5],o=e[6],l=e[7],u=e[8],c=e[9],h=e[10],p=e[11],d=e[12],f=e[13],y=e[14],m=e[15];return(t*s-r*a)*(h*m-p*y)-(t*o-i*a)*(c*m-p*f)+(t*l-n*a)*(c*y-h*f)+(r*o-i*s)*(u*m-p*d)-(r*l-n*s)*(u*y-h*d)+(i*l-n*o)*(u*f-c*d)}function Xu(e,t,r){var i=t[0],n=t[1],a=t[2],s=t[3],o=t[4],l=t[5],u=t[6],c=t[7],h=t[8],p=t[9],d=t[10],f=t[11],y=t[12],m=t[13],g=t[14],x=t[15],v=r[0],b=r[1],w=r[2],_=r[3];return e[0]=v*i+b*o+w*h+_*y,e[1]=v*n+b*l+w*p+_*m,e[2]=v*a+b*u+w*d+_*g,e[3]=v*s+b*c+w*f+_*x,v=r[4],b=r[5],w=r[6],_=r[7],e[4]=v*i+b*o+w*h+_*y,e[5]=v*n+b*l+w*p+_*m,e[6]=v*a+b*u+w*d+_*g,e[7]=v*s+b*c+w*f+_*x,v=r[8],b=r[9],w=r[10],_=r[11],e[8]=v*i+b*o+w*h+_*y,e[9]=v*n+b*l+w*p+_*m,e[10]=v*a+b*u+w*d+_*g,e[11]=v*s+b*c+w*f+_*x,v=r[12],b=r[13],w=r[14],_=r[15],e[12]=v*i+b*o+w*h+_*y,e[13]=v*n+b*l+w*p+_*m,e[14]=v*a+b*u+w*d+_*g,e[15]=v*s+b*c+w*f+_*x,e}function Yu(e,t,r){var i,n,a,s,o,l,u,c,h,p,d,f,y=r[0],m=r[1],g=r[2];return t===e?(e[12]=t[0]*y+t[4]*m+t[8]*g+t[12],e[13]=t[1]*y+t[5]*m+t[9]*g+t[13],e[14]=t[2]*y+t[6]*m+t[10]*g+t[14],e[15]=t[3]*y+t[7]*m+t[11]*g+t[15]):(i=t[0],n=t[1],a=t[2],s=t[3],o=t[4],l=t[5],u=t[6],c=t[7],h=t[8],p=t[9],d=t[10],f=t[11],e[0]=i,e[1]=n,e[2]=a,e[3]=s,e[4]=o,e[5]=l,e[6]=u,e[7]=c,e[8]=h,e[9]=p,e[10]=d,e[11]=f,e[12]=i*y+o*m+h*g+t[12],e[13]=n*y+l*m+p*g+t[13],e[14]=a*y+u*m+d*g+t[14],e[15]=s*y+c*m+f*g+t[15]),e}function Hu(e,t,r){var i=r[0],n=r[1],a=r[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Wu(e,t,r,i){var n,a,s,o,l,u,c,h,p,d,f,y,m,g,x,v,b,w,_,S,A,k,I,M,P=i[0],C=i[1],z=i[2],B=Math.hypot(P,C,z);return B<Fu?null:(P*=B=1/B,C*=B,z*=B,n=Math.sin(r),s=1-(a=Math.cos(r)),o=t[0],l=t[1],u=t[2],c=t[3],h=t[4],p=t[5],d=t[6],f=t[7],y=t[8],m=t[9],g=t[10],x=t[11],v=P*P*s+a,b=C*P*s+z*n,w=z*P*s-C*n,_=P*C*s-z*n,S=C*C*s+a,A=z*C*s+P*n,k=P*z*s+C*n,I=C*z*s-P*n,M=z*z*s+a,e[0]=o*v+h*b+y*w,e[1]=l*v+p*b+m*w,e[2]=u*v+d*b+g*w,e[3]=c*v+f*b+x*w,e[4]=o*_+h*S+y*A,e[5]=l*_+p*S+m*A,e[6]=u*_+d*S+g*A,e[7]=c*_+f*S+x*A,e[8]=o*k+h*I+y*M,e[9]=l*k+p*I+m*M,e[10]=u*k+d*I+g*M,e[11]=c*k+f*I+x*M,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function $u(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[4],s=t[5],o=t[6],l=t[7],u=t[8],c=t[9],h=t[10],p=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*n+u*i,e[5]=s*n+c*i,e[6]=o*n+h*i,e[7]=l*n+p*i,e[8]=u*n-a*i,e[9]=c*n-s*i,e[10]=h*n-o*i,e[11]=p*n-l*i,e}function Qu(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[0],s=t[1],o=t[2],l=t[3],u=t[8],c=t[9],h=t[10],p=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*n-u*i,e[1]=s*n-c*i,e[2]=o*n-h*i,e[3]=l*n-p*i,e[8]=a*i+u*n,e[9]=s*i+c*n,e[10]=o*i+h*n,e[11]=l*i+p*n,e}function ec(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[0],s=t[1],o=t[2],l=t[3],u=t[4],c=t[5],h=t[6],p=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*n+u*i,e[1]=s*n+c*i,e[2]=o*n+h*i,e[3]=l*n+p*i,e[4]=u*n-a*i,e[5]=c*n-s*i,e[6]=h*n-o*i,e[7]=p*n-l*i,e}function tc(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function rc(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function ic(e,t,r){var i,n,a,s=r[0],o=r[1],l=r[2],u=Math.hypot(s,o,l);return u<Fu?null:(s*=u=1/u,o*=u,l*=u,i=Math.sin(t),a=1-(n=Math.cos(t)),e[0]=s*s*a+n,e[1]=o*s*a+l*i,e[2]=l*s*a-o*i,e[3]=0,e[4]=s*o*a-l*i,e[5]=o*o*a+n,e[6]=l*o*a+s*i,e[7]=0,e[8]=s*l*a+o*i,e[9]=o*l*a-s*i,e[10]=l*l*a+n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function nc(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=i,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function ac(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function sc(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=i,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function oc(e,t,r){var i=t[0],n=t[1],a=t[2],s=t[3],o=i+i,l=n+n,u=a+a,c=i*o,h=i*l,p=i*u,d=n*l,f=n*u,y=a*u,m=s*o,g=s*l,x=s*u;return e[0]=1-(d+y),e[1]=h+x,e[2]=p-g,e[3]=0,e[4]=h-x,e[5]=1-(c+y),e[6]=f+m,e[7]=0,e[8]=p+g,e[9]=f-m,e[10]=1-(c+d),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function lc(e,t){var r=new Tu(3),i=-t[0],n=-t[1],a=-t[2],s=t[3],o=t[4],l=t[5],u=t[6],c=t[7],h=i*i+n*n+a*a+s*s;return h>0?(r[0]=2*(o*s+c*i+l*a-u*n)/h,r[1]=2*(l*s+c*n+u*i-o*a)/h,r[2]=2*(u*s+c*a+o*n-l*i)/h):(r[0]=2*(o*s+c*i+l*a-u*n),r[1]=2*(l*s+c*n+u*i-o*a),r[2]=2*(u*s+c*a+o*n-l*i)),oc(e,t,r),e}function uc(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function cc(e,t){var r=t[0],i=t[1],n=t[2],a=t[4],s=t[5],o=t[6],l=t[8],u=t[9],c=t[10];return e[0]=Math.hypot(r,i,n),e[1]=Math.hypot(a,s,o),e[2]=Math.hypot(l,u,c),e}function hc(e,t){var r=new Tu(3);cc(r,t);var i=1/r[0],n=1/r[1],a=1/r[2],s=t[0]*i,o=t[1]*n,l=t[2]*a,u=t[4]*i,c=t[5]*n,h=t[6]*a,p=t[8]*i,d=t[9]*n,f=t[10]*a,y=s+c+f,m=0;return y>0?(m=2*Math.sqrt(y+1),e[3]=.25*m,e[0]=(h-d)/m,e[1]=(p-l)/m,e[2]=(o-u)/m):s>c&&s>f?(m=2*Math.sqrt(1+s-c-f),e[3]=(h-d)/m,e[0]=.25*m,e[1]=(o+u)/m,e[2]=(p+l)/m):c>f?(m=2*Math.sqrt(1+c-s-f),e[3]=(p-l)/m,e[0]=(o+u)/m,e[1]=.25*m,e[2]=(h+d)/m):(m=2*Math.sqrt(1+f-s-c),e[3]=(o-u)/m,e[0]=(p+l)/m,e[1]=(h+d)/m,e[2]=.25*m),e}function pc(e,t,r,i){var n=t[0],a=t[1],s=t[2],o=t[3],l=n+n,u=a+a,c=s+s,h=n*l,p=n*u,d=n*c,f=a*u,y=a*c,m=s*c,g=o*l,x=o*u,v=o*c,b=i[0],w=i[1],_=i[2];return e[0]=(1-(f+m))*b,e[1]=(p+v)*b,e[2]=(d-x)*b,e[3]=0,e[4]=(p-v)*w,e[5]=(1-(h+m))*w,e[6]=(y+g)*w,e[7]=0,e[8]=(d+x)*_,e[9]=(y-g)*_,e[10]=(1-(h+f))*_,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function dc(e,t,r,i,n){var a=t[0],s=t[1],o=t[2],l=t[3],u=a+a,c=s+s,h=o+o,p=a*u,d=a*c,f=a*h,y=s*c,m=s*h,g=o*h,x=l*u,v=l*c,b=l*h,w=i[0],_=i[1],S=i[2],A=n[0],k=n[1],I=n[2],M=(1-(y+g))*w,P=(d+b)*w,C=(f-v)*w,z=(d-b)*_,B=(1-(p+g))*_,V=(m+x)*_,E=(f+v)*S,F=(m-x)*S,T=(1-(p+y))*S;return e[0]=M,e[1]=P,e[2]=C,e[3]=0,e[4]=z,e[5]=B,e[6]=V,e[7]=0,e[8]=E,e[9]=F,e[10]=T,e[11]=0,e[12]=r[0]+A-(M*A+z*k+E*I),e[13]=r[1]+k-(P*A+B*k+F*I),e[14]=r[2]+I-(C*A+V*k+T*I),e[15]=1,e}function fc(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],s=r+r,o=i+i,l=n+n,u=r*s,c=i*s,h=i*o,p=n*s,d=n*o,f=n*l,y=a*s,m=a*o,g=a*l;return e[0]=1-h-f,e[1]=c+g,e[2]=p-m,e[3]=0,e[4]=c-g,e[5]=1-u-f,e[6]=d+y,e[7]=0,e[8]=p+m,e[9]=d-y,e[10]=1-u-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function yc(e,t,r,i,n,a,s){var o=1/(r-t),l=1/(n-i),u=1/(a-s);return e[0]=2*a*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*a*l,e[6]=0,e[7]=0,e[8]=(r+t)*o,e[9]=(n+i)*l,e[10]=(s+a)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*a*2*u,e[15]=0,e}function mc(e,t,r,i,n){var a,s=1/Math.tan(t/2);return e[0]=s/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=n&&n!==1/0?(a=1/(i-n),e[10]=(n+i)*a,e[14]=2*n*i*a):(e[10]=-1,e[14]=-2*i),e}c(Du,{add:()=>Mc,adjoint:()=>Gu,clone:()=>Ru,copy:()=>qu,create:()=>Ou,determinant:()=>Ku,equals:()=>Vc,exactEquals:()=>Bc,frob:()=>Ic,fromQuat:()=>fc,fromQuat2:()=>lc,fromRotation:()=>ic,fromRotationTranslation:()=>oc,fromRotationTranslationScale:()=>pc,fromRotationTranslationScaleOrigin:()=>dc,fromScaling:()=>rc,fromTranslation:()=>tc,fromValues:()=>Uu,fromXRotation:()=>nc,fromYRotation:()=>ac,fromZRotation:()=>sc,frustum:()=>yc,getRotation:()=>hc,getScaling:()=>cc,getTranslation:()=>uc,identity:()=>Nu,invert:()=>Ju,lookAt:()=>Sc,mul:()=>Ec,multiply:()=>Xu,multiplyScalar:()=>Cc,multiplyScalarAndAdd:()=>zc,ortho:()=>wc,orthoNO:()=>bc,orthoZO:()=>_c,perspective:()=>gc,perspectiveFromFieldOfView:()=>vc,perspectiveNO:()=>mc,perspectiveZO:()=>xc,rotate:()=>Wu,rotateX:()=>$u,rotateY:()=>Qu,rotateZ:()=>ec,scale:()=>Hu,set:()=>ju,str:()=>kc,sub:()=>Fc,subtract:()=>Pc,targetTo:()=>Ac,translate:()=>Yu,transpose:()=>Zu}),p(),l(Ou,"create"),l(Ru,"clone"),l(qu,"copy"),l(Uu,"fromValues"),l(ju,"set"),l(Nu,"identity"),l(Zu,"transpose"),l(Ju,"invert"),l(Gu,"adjoint"),l(Ku,"determinant"),l(Xu,"multiply"),l(Yu,"translate"),l(Hu,"scale"),l(Wu,"rotate"),l($u,"rotateX"),l(Qu,"rotateY"),l(ec,"rotateZ"),l(tc,"fromTranslation"),l(rc,"fromScaling"),l(ic,"fromRotation"),l(nc,"fromXRotation"),l(ac,"fromYRotation"),l(sc,"fromZRotation"),l(oc,"fromRotationTranslation"),l(lc,"fromQuat2"),l(uc,"getTranslation"),l(cc,"getScaling"),l(hc,"getRotation"),l(pc,"fromRotationTranslationScale"),l(dc,"fromRotationTranslationScaleOrigin"),l(fc,"fromQuat"),l(yc,"frustum"),l(mc,"perspectiveNO");var gc=mc;function xc(e,t,r,i,n){var a,s=1/Math.tan(t/2);return e[0]=s/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=n&&n!==1/0?(a=1/(i-n),e[10]=n*a,e[14]=n*i*a):(e[10]=-1,e[14]=-i),e}function vc(e,t,r,i){var n=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),s=Math.tan(t.leftDegrees*Math.PI/180),o=Math.tan(t.rightDegrees*Math.PI/180),l=2/(s+o),u=2/(n+a);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-(s-o)*l*.5,e[9]=(n-a)*u*.5,e[10]=i/(r-i),e[11]=-1,e[12]=0,e[13]=0,e[14]=i*r/(r-i),e[15]=0,e}function bc(e,t,r,i,n,a,s){var o=1/(t-r),l=1/(i-n),u=1/(a-s);return e[0]=-2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+r)*o,e[13]=(n+i)*l,e[14]=(s+a)*u,e[15]=1,e}l(xc,"perspectiveZO"),l(vc,"perspectiveFromFieldOfView"),l(bc,"orthoNO");var wc=bc;function _c(e,t,r,i,n,a,s){var o=1/(t-r),l=1/(i-n),u=1/(a-s);return e[0]=-2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=u,e[11]=0,e[12]=(t+r)*o,e[13]=(n+i)*l,e[14]=a*u,e[15]=1,e}function Sc(e,t,r,i){var n,a,s,o,l,u,c,h,p,d,f=t[0],y=t[1],m=t[2],g=i[0],x=i[1],v=i[2],b=r[0],w=r[1],_=r[2];return Math.abs(f-b)<Fu&&Math.abs(y-w)<Fu&&Math.abs(m-_)<Fu?Nu(e):(c=f-b,h=y-w,p=m-_,n=x*(p*=d=1/Math.hypot(c,h,p))-v*(h*=d),a=v*(c*=d)-g*p,s=g*h-x*c,(d=Math.hypot(n,a,s))?(n*=d=1/d,a*=d,s*=d):(n=0,a=0,s=0),o=h*s-p*a,l=p*n-c*s,u=c*a-h*n,(d=Math.hypot(o,l,u))?(o*=d=1/d,l*=d,u*=d):(o=0,l=0,u=0),e[0]=n,e[1]=o,e[2]=c,e[3]=0,e[4]=a,e[5]=l,e[6]=h,e[7]=0,e[8]=s,e[9]=u,e[10]=p,e[11]=0,e[12]=-(n*f+a*y+s*m),e[13]=-(o*f+l*y+u*m),e[14]=-(c*f+h*y+p*m),e[15]=1,e)}function Ac(e,t,r,i){var n=t[0],a=t[1],s=t[2],o=i[0],l=i[1],u=i[2],c=n-r[0],h=a-r[1],p=s-r[2],d=c*c+h*h+p*p;d>0&&(c*=d=1/Math.sqrt(d),h*=d,p*=d);var f=l*p-u*h,y=u*c-o*p,m=o*h-l*c;return(d=f*f+y*y+m*m)>0&&(f*=d=1/Math.sqrt(d),y*=d,m*=d),e[0]=f,e[1]=y,e[2]=m,e[3]=0,e[4]=h*m-p*y,e[5]=p*f-c*m,e[6]=c*y-h*f,e[7]=0,e[8]=c,e[9]=h,e[10]=p,e[11]=0,e[12]=n,e[13]=a,e[14]=s,e[15]=1,e}function kc(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function Ic(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function Mc(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function Pc(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function Cc(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function zc(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e[4]=t[4]+r[4]*i,e[5]=t[5]+r[5]*i,e[6]=t[6]+r[6]*i,e[7]=t[7]+r[7]*i,e[8]=t[8]+r[8]*i,e[9]=t[9]+r[9]*i,e[10]=t[10]+r[10]*i,e[11]=t[11]+r[11]*i,e[12]=t[12]+r[12]*i,e[13]=t[13]+r[13]*i,e[14]=t[14]+r[14]*i,e[15]=t[15]+r[15]*i,e}function Bc(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function Vc(e,t){var r=e[0],i=e[1],n=e[2],a=e[3],s=e[4],o=e[5],l=e[6],u=e[7],c=e[8],h=e[9],p=e[10],d=e[11],f=e[12],y=e[13],m=e[14],g=e[15],x=t[0],v=t[1],b=t[2],w=t[3],_=t[4],S=t[5],A=t[6],k=t[7],I=t[8],M=t[9],P=t[10],C=t[11],z=t[12],B=t[13],V=t[14],E=t[15];return Math.abs(r-x)<=Fu*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(i-v)<=Fu*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(n-b)<=Fu*Math.max(1,Math.abs(n),Math.abs(b))&&Math.abs(a-w)<=Fu*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(s-_)<=Fu*Math.max(1,Math.abs(s),Math.abs(_))&&Math.abs(o-S)<=Fu*Math.max(1,Math.abs(o),Math.abs(S))&&Math.abs(l-A)<=Fu*Math.max(1,Math.abs(l),Math.abs(A))&&Math.abs(u-k)<=Fu*Math.max(1,Math.abs(u),Math.abs(k))&&Math.abs(c-I)<=Fu*Math.max(1,Math.abs(c),Math.abs(I))&&Math.abs(h-M)<=Fu*Math.max(1,Math.abs(h),Math.abs(M))&&Math.abs(p-P)<=Fu*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(d-C)<=Fu*Math.max(1,Math.abs(d),Math.abs(C))&&Math.abs(f-z)<=Fu*Math.max(1,Math.abs(f),Math.abs(z))&&Math.abs(y-B)<=Fu*Math.max(1,Math.abs(y),Math.abs(B))&&Math.abs(m-V)<=Fu*Math.max(1,Math.abs(m),Math.abs(V))&&Math.abs(g-E)<=Fu*Math.max(1,Math.abs(g),Math.abs(E))}l(_c,"orthoZO"),l(Sc,"lookAt"),l(Ac,"targetTo"),l(kc,"str"),l(Ic,"frob"),l(Mc,"add"),l(Pc,"subtract"),l(Cc,"multiplyScalar"),l(zc,"multiplyScalarAndAdd"),l(Bc,"exactEquals"),l(Vc,"equals");var Ec=Xu,Fc=Pc,Tc={};function Lc(){var e=new Tu(4);return Tu!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Dc(e){var t=new Tu(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function Oc(e,t,r,i){var n=new Tu(4);return n[0]=e,n[1]=t,n[2]=r,n[3]=i,n}function Rc(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function qc(e,t,r,i,n){return e[0]=t,e[1]=r,e[2]=i,e[3]=n,e}function Uc(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function jc(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e}function Nc(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e}function Zc(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e[3]=t[3]/r[3],e}function Jc(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e[3]=Math.ceil(t[3]),e}function Gc(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e[3]=Math.floor(t[3]),e}function Kc(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e[3]=Math.min(t[3],r[3]),e}function Xc(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e[3]=Math.max(t[3],r[3]),e}function Yc(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e[3]=Math.round(t[3]),e}function Hc(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function Wc(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e[3]=t[3]+r[3]*i,e}function $c(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2],a=t[3]-e[3];return Math.hypot(r,i,n,a)}function Qc(e,t){var r=t[0]-e[0],i=t[1]-e[1],n=t[2]-e[2],a=t[3]-e[3];return r*r+i*i+n*n+a*a}function eh(e){var t=e[0],r=e[1],i=e[2],n=e[3];return Math.hypot(t,r,i,n)}function th(e){var t=e[0],r=e[1],i=e[2],n=e[3];return t*t+r*r+i*i+n*n}function rh(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=-t[3],e}function ih(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e[3]=1/t[3],e}function nh(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],s=r*r+i*i+n*n+a*a;return s>0&&(s=1/Math.sqrt(s)),e[0]=r*s,e[1]=i*s,e[2]=n*s,e[3]=a*s,e}function ah(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function sh(e,t,r,i){var n=r[0]*i[1]-r[1]*i[0],a=r[0]*i[2]-r[2]*i[0],s=r[0]*i[3]-r[3]*i[0],o=r[1]*i[2]-r[2]*i[1],l=r[1]*i[3]-r[3]*i[1],u=r[2]*i[3]-r[3]*i[2],c=t[0],h=t[1],p=t[2],d=t[3];return e[0]=h*u-p*l+d*o,e[1]=-c*u+p*s-d*a,e[2]=c*l-h*s+d*n,e[3]=-c*o+h*a-p*n,e}function oh(e,t,r,i){var n=t[0],a=t[1],s=t[2],o=t[3];return e[0]=n+i*(r[0]-n),e[1]=a+i*(r[1]-a),e[2]=s+i*(r[2]-s),e[3]=o+i*(r[3]-o),e}function lh(e,t){var r,i,n,a,s,o;t=t||1;do{s=(r=2*Lu()-1)*r+(i=2*Lu()-1)*i}while(s>=1);do{o=(n=2*Lu()-1)*n+(a=2*Lu()-1)*a}while(o>=1);var l=Math.sqrt((1-s)/o);return e[0]=t*r,e[1]=t*i,e[2]=t*n*l,e[3]=t*a*l,e}function uh(e,t,r){var i=t[0],n=t[1],a=t[2],s=t[3];return e[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*s,e[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*s,e[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*s,e[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*s,e}function ch(e,t,r){var i=t[0],n=t[1],a=t[2],s=r[0],o=r[1],l=r[2],u=r[3],c=u*i+o*a-l*n,h=u*n+l*i-s*a,p=u*a+s*n-o*i,d=-s*i-o*n-l*a;return e[0]=c*u+d*-s+h*-l-p*-o,e[1]=h*u+d*-o+p*-s-c*-l,e[2]=p*u+d*-l+c*-o-h*-s,e[3]=t[3],e}function hh(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e}function ph(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"}function dh(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]}function fh(e,t){var r=e[0],i=e[1],n=e[2],a=e[3],s=t[0],o=t[1],l=t[2],u=t[3];return Math.abs(r-s)<=Fu*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(i-o)<=Fu*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(n-l)<=Fu*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(a-u)<=Fu*Math.max(1,Math.abs(a),Math.abs(u))}c(Tc,{add:()=>Uc,ceil:()=>Jc,clone:()=>Dc,copy:()=>Rc,create:()=>Lc,cross:()=>sh,dist:()=>xh,distance:()=>$c,div:()=>gh,divide:()=>Zc,dot:()=>ah,equals:()=>fh,exactEquals:()=>dh,floor:()=>Gc,forEach:()=>_h,fromValues:()=>Oc,inverse:()=>ih,len:()=>bh,length:()=>eh,lerp:()=>oh,max:()=>Xc,min:()=>Kc,mul:()=>mh,multiply:()=>Nc,negate:()=>rh,normalize:()=>nh,random:()=>lh,round:()=>Yc,scale:()=>Hc,scaleAndAdd:()=>Wc,set:()=>qc,sqrDist:()=>vh,sqrLen:()=>wh,squaredDistance:()=>Qc,squaredLength:()=>th,str:()=>ph,sub:()=>yh,subtract:()=>jc,transformMat4:()=>uh,transformQuat:()=>ch,zero:()=>hh}),p(),l(Lc,"create"),l(Dc,"clone"),l(Oc,"fromValues"),l(Rc,"copy"),l(qc,"set"),l(Uc,"add"),l(jc,"subtract"),l(Nc,"multiply"),l(Zc,"divide"),l(Jc,"ceil"),l(Gc,"floor"),l(Kc,"min"),l(Xc,"max"),l(Yc,"round"),l(Hc,"scale"),l(Wc,"scaleAndAdd"),l($c,"distance"),l(Qc,"squaredDistance"),l(eh,"length"),l(th,"squaredLength"),l(rh,"negate"),l(ih,"inverse"),l(nh,"normalize"),l(ah,"dot"),l(sh,"cross"),l(oh,"lerp"),l(lh,"random"),l(uh,"transformMat4"),l(ch,"transformQuat"),l(hh,"zero"),l(ph,"str"),l(dh,"exactEquals"),l(fh,"equals");var yh=jc,mh=Nc,gh=Zc,xh=$c,vh=Qc,bh=eh,wh=th,_h=function(){var e=Lc();return function(t,r,i,n,a,s){var o,l;for(r||(r=4),i||(i=0),l=n?Math.min(n*r+i,t.length):t.length,o=i;o<l;o+=r)e[0]=t[o],e[1]=t[o+1],e[2]=t[o+2],e[3]=t[o+3],a(e,e,s),t[o]=e[0],t[o+1]=e[1],t[o+2]=e[2],t[o+3]=e[3];return t}}(),Sh=h(d(),1),Ah=class extends _s{constructor(e){super(e,Eu)}createBucket(e){return new uu(e)}queryRadius(e){let t=e;return ku("circle-radius",this,t)+ku("circle-stroke-width",this,t)+Iu(this.paint.get("circle-translate"))}queryIntersectsFeature(e,t,r,i,n,a,s,o){let l=Mu(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),a.angle,s),u=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r),c="map"===this.paint.get("circle-pitch-alignment"),h=c?l:Mh(l,o),p=c?u*s:u;for(let e of i)for(let t of e){let e=c?t:Ih(t,o),r=p,i=Tc.transformMat4([],[t.x,t.y,0,1],o);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?r*=i[3]/a.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(r*=a.cameraToCenterDistance/i[3]),pu(h,e,r))return!0}return!1}};l(Ah,"CircleStyleLayer");var kh=Ah;function Ih(e,t){let r=Tc.transformMat4([],[e.x,e.y,0,1],t);return new Sh.default(r[0]/r[3],r[1]/r[3])}function Mh(e,t){return e.map((e=>Ih(e,t)))}l(Ih,"projectPoint"),l(Mh,"projectQueryGeometry"),p(),p();var Ph=class extends uu{};l(Ph,"HeatmapBucket");var Ch=Ph;ia("HeatmapBucket",Ch,{omit:["layers"]}),p();var zh,Bh=l((()=>zh=zh||new vs({"heatmap-radius":new hs(H.paint_heatmap["heatmap-radius"]),"heatmap-weight":new hs(H.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new us(H.paint_heatmap["heatmap-intensity"]),"heatmap-color":new gs(H.paint_heatmap["heatmap-color"]),"heatmap-opacity":new us(H.paint_heatmap["heatmap-opacity"])})),"getPaint"),Vh={get paint(){return Bh()}};function Eh(e,{width:t,height:r},i,n){if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==t*r*i)throw new RangeError("mismatched image size. expected: ".concat(n.length," but got: ").concat(t*r*i))}else n=new Uint8Array(t*r*i);return e.width=t,e.height=r,e.data=n,e}function Fh(e,{width:t,height:r},i){if(t===e.width&&r===e.height)return;let n=Eh({},{width:t,height:r},i);Th(e,n,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,t),height:Math.min(e.height,r)},i),e.width=t,e.height=r,e.data=n.data}function Th(e,t,r,i,n,a){if(0===n.width||0===n.height)return t;if(n.width>e.width||n.height>e.height||r.x>e.width-n.width||r.y>e.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>t.width||n.height>t.height||i.x>t.width-n.width||i.y>t.height-n.height)throw new RangeError("out of range destination coordinates for image copy");let s=e.data,o=t.data;if(s===o)throw new Error("srcData equals dstData, so image is already copied");for(let l=0;l<n.height;l++){let u=((r.y+l)*e.width+r.x)*a,c=((i.y+l)*t.width+i.x)*a;for(let e=0;e<n.width*a;e++)o[c+e]=s[u+e]}return t}p(),p(),l(Eh,"createImage"),l(Fh,"resizeImage"),l(Th,"copyImage");var Lh=class e{constructor(e,t){Eh(this,e,1,t)}resize(e){Fh(this,e,1)}clone(){return new e({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,i,n){Th(e,t,r,i,n,1)}};l(Lh,"AlphaImage");var Dh=Lh,Oh=class e{constructor(e,t){Eh(this,e,4,t)}resize(e){Fh(this,e,4)}replace(e,t){t?this.data.set(e):e instanceof Uint8ClampedArray?this.data=new Uint8Array(e.buffer):this.data=e}clone(){return new e({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,i,n){Th(e,t,r,i,n,4)}};l(Oh,"RGBAImage");var Rh=Oh;function qh(e){let t={},r=e.resolution||256,i=e.clips?e.clips.length:1,n=e.image||new Rh({width:r,height:i});if(!F(r))throw new Error("width is not a power of 2 - ".concat(r));let a=l(((r,i,a)=>{t[e.evaluationKey]=a;let s=e.expression.evaluate(t);n.data[r+i+0]=Math.floor(255*s.r/s.a),n.data[r+i+1]=Math.floor(255*s.g/s.a),n.data[r+i+2]=Math.floor(255*s.b/s.a),n.data[r+i+3]=Math.floor(255*s.a)}),"renderPixel");if(e.clips)for(let t=0,n=0;t<i;++t,n+=4*r)for(let i=0,s=0;i<r;i++,s+=4){let o=i/(r-1),{start:l,end:u}=e.clips[t];a(n,s,l*(1-o)+u*o)}else for(let e=0,t=0;e<r;e++,t+=4){a(0,t,e/(r-1))}return n}ia("AlphaImage",Dh),ia("RGBAImage",Rh),l(qh,"renderColorRamp");var Uh=class extends _s{createBucket(e){return new Ch(e)}constructor(e){super(e,Vh),this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"heatmap-color"===e&&this._updateColorRamp()}_updateColorRamp(){let e=this._transitionablePaint._values["heatmap-color"].value.expression;this.colorRamp=qh({expression:e,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}};l(Uh,"HeatmapStyleLayer");var jh=Uh;p(),p();var Nh,Zh=l((()=>Nh=Nh||new vs({"hillshade-illumination-direction":new us(H.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new us(H.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new us(H.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new us(H.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new us(H.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new us(H.paint_hillshade["hillshade-accent-color"])})),"getPaint"),Jh={get paint(){return Zh()}},Gh=class extends _s{constructor(e){super(e,Jh)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}};l(Gh,"HillshadeStyleLayer");var Kh=Gh;p(),p(),p();var Xh=Ps([{name:"a_pos",components:2,type:"Int16"}],4),{members:Yh,size:Hh,alignment:Wh}=Xh,$h=h(x(),1);function Qh(e,t,r,i,n){ep(e,t,r||0,i||e.length-1,n||rp)}function ep(e,t,r,i,n){for(;i>r;){if(i-r>600){var a=i-r+1,s=t-r+1,o=Math.log(a),l=.5*Math.exp(2*o/3),u=.5*Math.sqrt(o*l*(a-l)/a)*(s-a/2<0?-1:1);ep(e,t,Math.max(r,Math.floor(t-s*l/a+u)),Math.min(i,Math.floor(t+(a-s)*l/a+u)),n)}var c=e[t],h=r,p=i;for(tp(e,r,t),n(e[i],c)>0&&tp(e,r,i);h<p;){for(tp(e,h,p),h++,p--;n(e[h],c)<0;)h++;for(;n(e[p],c)>0;)p--}0===n(e[r],c)?tp(e,r,p):tp(e,++p,i),p<=t&&(r=p+1),t<=p&&(i=p-1)}}function tp(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function rp(e,t){return e<t?-1:e>t?1:0}function ip(e,t){let r=e.length;if(r<=1)return[e];let i,n,a=[];for(let t=0;t<r;t++){let r=j(e[t]);0!==r&&(e[t].area=Math.abs(r),void 0===n&&(n=r<0),n===r<0?(i&&a.push(i),i=[e[t]]):i.push(e[t]))}if(i&&a.push(i),t>1)for(let e=0;e<a.length;e++)a[e].length<=t||(Qh(a[e],t,1,a[e].length-1,np),a[e]=a[e].slice(0,t));return a}function np(e,t){return t.area-e.area}function ap(e,t,r){let i=r.patternDependencies,n=!1;for(let r of t){let t=r.paint.get("".concat(e,"-pattern"));t.isConstant()||(n=!0);let a=t.constantOr(null);a&&(n=!0,i[a.to]=!0,i[a.from]=!0)}return n}function sp(e,t,r,i,n){let a=n.patternDependencies;for(let s of t){let t=s.paint.get("".concat(e,"-pattern")).value;if("constant"!==t.kind){let e=t.evaluate({zoom:i-1},r,{},n.availableImages),o=t.evaluate({zoom:i},r,{},n.availableImages),l=t.evaluate({zoom:i+1},r,{},n.availableImages);e=e&&e.name?e.name:e,o=o&&o.name?o.name:o,l=l&&l.name?l.name:l,a[e]=!0,a[o]=!0,a[l]=!0,r.patterns[s.id]={min:e,mid:o,max:l}}}return r}p(),p(),l(Qh,"quickselect"),l(ep,"quickselectStep"),l(tp,"swap"),l(rp,"defaultCompare"),l(ip,"classifyRings"),l(np,"compareAreas"),p(),l(ap,"hasPattern"),l(sp,"addPatternDependencies");var op=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Xo,this.indexArray=new fl,this.indexArray2=new ml,this.programConfigurations=new Ql(e.layers,e.zoom),this.segments=new _l,this.segments2=new _l,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.hasPattern=ap("fill",this.layers,t);let i=this.layers[0].layout.get("fill-sort-key"),n=!i.isConstant(),a=[];for(let{feature:s,id:o,index:l,sourceLayerIndex:u}of e){let e=this.layers[0]._featureFilter.needGeometry,c=su(s,e);if(!this.layers[0]._featureFilter.filter(new Ja(this.zoom),c,r))continue;let h=n?i.evaluate(c,{},r,t.availableImages):void 0,p={id:o,properties:s.properties,type:s.type,sourceLayerIndex:u,index:l,geometry:e?c.geometry:au(s),patterns:{},sortKey:h};a.push(p)}n&&a.sort(((e,t)=>e.sortKey-t.sortKey));for(let i of a){let{geometry:n,index:a,sourceLayerIndex:s}=i;if(this.hasPattern){let e=sp("fill",this.layers,i,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(i,n,a,r,{});let o=e[a].feature;t.featureIndex.insert(o,n,a,s,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}addFeatures(e,t,r){for(let e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Yh),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,t,r,i,n){for(let e of ip(t,500)){let t=0;for(let r of e)t+=r.length;let r=this.segments.prepareSegment(t,this.layoutVertexArray,this.indexArray),i=r.vertexLength,n=[],a=[];for(let t of e){if(0===t.length)continue;t!==e[0]&&a.push(n.length/2);let r=this.segments2.prepareSegment(t.length,this.layoutVertexArray,this.indexArray2),i=r.vertexLength;this.layoutVertexArray.emplaceBack(t[0].x,t[0].y),this.indexArray2.emplaceBack(i+t.length-1,i),n.push(t[0].x),n.push(t[0].y);for(let e=1;e<t.length;e++)this.layoutVertexArray.emplaceBack(t[e].x,t[e].y),this.indexArray2.emplaceBack(i+e-1,i+e),n.push(t[e].x),n.push(t[e].y);r.vertexLength+=t.length,r.primitiveLength+=t.length}let s=(0,$h.default)(n,a);for(let e=0;e<s.length;e+=3)this.indexArray.emplaceBack(i+s[e],i+s[e+1],i+s[e+2]);r.vertexLength+=t,r.primitiveLength+=s.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,n,i)}};l(op,"FillBucket");var lp=op;ia("FillBucket",lp,{omit:["layers","patternFeatures"]}),p();var up,cp,hp=l((()=>up=up||new vs({"fill-sort-key":new hs(H.layout_fill["fill-sort-key"])})),"getLayout"),pp=l((()=>cp=cp||new vs({"fill-antialias":new us(H.paint_fill["fill-antialias"]),"fill-opacity":new hs(H.paint_fill["fill-opacity"]),"fill-color":new hs(H.paint_fill["fill-color"]),"fill-outline-color":new hs(H.paint_fill["fill-outline-color"]),"fill-translate":new us(H.paint_fill["fill-translate"]),"fill-translate-anchor":new us(H.paint_fill["fill-translate-anchor"]),"fill-pattern":new ds(H.paint_fill["fill-pattern"])})),"getPaint"),dp={get paint(){return pp()},get layout(){return hp()}},fp=class extends _s{constructor(e){super(e,dp)}recalculate(e,t){super.recalculate(e,t);let r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new lp(e)}queryRadius(){return Iu(this.paint.get("fill-translate"))}queryIntersectsFeature(e,t,r,i,n,a,s){return du(Mu(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),a.angle,s),i)}isTileClipped(){return!0}};l(fp,"FillStyleLayer");var yp=fp;p(),p(),p();var mp=Ps([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),gp=Ps([{name:"a_centroid",components:2,type:"Int16"}],4),{members:xp,size:vp,alignment:bp}=mp,wp=h(x(),1),_p=h(_(),1).default.VectorTileFeature.types,Sp=Math.pow(2,13);function Ap(e,t,r,i,n,a,s,o){e.emplaceBack(t,r,2*Math.floor(i*Sp)+s,n*Sp*2,a*Sp*2,Math.round(o))}l(Ap,"addVertex");var kp=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Ho,this.centroidVertexArray=new Zo,this.indexArray=new fl,this.programConfigurations=new Ql(e.layers,e.zoom),this.segments=new _l,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.features=[],this.hasPattern=ap("fill-extrusion",this.layers,t);for(let{feature:i,id:n,index:a,sourceLayerIndex:s}of e){let e=this.layers[0]._featureFilter.needGeometry,o=su(i,e);if(!this.layers[0]._featureFilter.filter(new Ja(this.zoom),o,r))continue;let l={id:n,sourceLayerIndex:s,index:a,geometry:e?o.geometry:au(i),properties:i.properties,type:i.type,patterns:{}};this.hasPattern?this.features.push(sp("fill-extrusion",this.layers,l,this.zoom,t)):this.addFeature(l,l.geometry,a,r,{}),t.featureIndex.insert(i,l.geometry,a,s,this.index,!0)}}addFeatures(e,t,r){for(let e of this.features){let{geometry:i}=e;this.addFeature(e,i,e.index,t,r)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,xp),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,gp.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,t,r,i,n){let a={x:0,y:0,vertexCount:0};for(let r of ip(t,500)){let t=0;for(let e of r)t+=e.length;let i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(let e of r){if(0===e.length||Pp(e))continue;let t=0;for(let r=0;r<e.length;r++){let n=e[r];if(r>=1){let s=e[r-1];if(!Mp(n,s)){i.vertexLength+4>_l.MAX_VERTEX_ARRAY_LENGTH&&(i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let e=n.sub(s)._perp()._unit(),r=s.dist(n);t+r>32768&&(t=0),Ap(this.layoutVertexArray,n.x,n.y,e.x,e.y,0,0,t),Ap(this.layoutVertexArray,n.x,n.y,e.x,e.y,0,1,t),a.x+=2*n.x,a.y+=2*n.y,a.vertexCount+=2,t+=r,Ap(this.layoutVertexArray,s.x,s.y,e.x,e.y,0,0,t),Ap(this.layoutVertexArray,s.x,s.y,e.x,e.y,0,1,t),a.x+=2*s.x,a.y+=2*s.y,a.vertexCount+=2;let o=i.vertexLength;this.indexArray.emplaceBack(o,o+2,o+1),this.indexArray.emplaceBack(o+1,o+2,o+3),i.vertexLength+=4,i.primitiveLength+=2}}}}if(i.vertexLength+t>_l.MAX_VERTEX_ARRAY_LENGTH&&(i=this.segments.prepareSegment(t,this.layoutVertexArray,this.indexArray)),"Polygon"!==_p[e.type])continue;let n=[],s=[],o=i.vertexLength;for(let e of r)if(0!==e.length){e!==r[0]&&s.push(n.length/2);for(let t=0;t<e.length;t++){let r=e[t];Ap(this.layoutVertexArray,r.x,r.y,0,0,1,1,0),a.x+=r.x,a.y+=r.y,a.vertexCount+=1,n.push(r.x),n.push(r.y)}}let l=(0,wp.default)(n,s);for(let e=0;e<l.length;e+=3)this.indexArray.emplaceBack(o+l[e],o+l[e+2],o+l[e+1]);i.primitiveLength+=l.length/3,i.vertexLength+=t}for(let e=0;e<a.vertexCount;e++)this.centroidVertexArray.emplaceBack(Math.floor(a.x/a.vertexCount),Math.floor(a.y/a.vertexCount));this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,n,i)}};l(kp,"FillExtrusionBucket");var Ip=kp;function Mp(e,t){return e.x===t.x&&(e.x<0||e.x>8192)||e.y===t.y&&(e.y<0||e.y>8192)}function Pp(e){return e.every((e=>e.x<0))||e.every((e=>e.x>8192))||e.every((e=>e.y<0))||e.every((e=>e.y>8192))}ia("FillExtrusionBucket",Ip,{omit:["layers","features"]}),l(Mp,"isBoundaryEdge"),l(Pp,"isEntirelyOutside"),p();var Cp,zp=l((()=>Cp=Cp||new vs({"fill-extrusion-opacity":new us(H["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new hs(H["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new us(H["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new us(H["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ds(H["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new hs(H["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new hs(H["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new us(H["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})),"getPaint"),Bp={get paint(){return zp()}},Vp=h(d(),1),Ep=class extends _s{constructor(e){super(e,Bp)}createBucket(e){return new Ip(e)}queryRadius(){return Iu(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,t,r,i,n,a,s,o){let l=Mu(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,s),u=this.paint.get("fill-extrusion-height").evaluate(t,r),c=this.paint.get("fill-extrusion-base").evaluate(t,r),h=Rp(l,o,a,0),p=Op(i,c,u,o);return Dp(p[0],p[1],h)}};l(Ep,"FillExtrusionStyleLayer");var Fp=Ep;function Tp(e,t){return e.x*t.x+e.y*t.y}function Lp(e,t){if(1===e.length){let r,i=0,n=t[i++];for(;!r||n.equals(r);)if(r=t[i++],!r)return 1/0;for(;i<t.length;i++){let a=t[i],s=e[0],o=r.sub(n),l=a.sub(n),u=s.sub(n),c=Tp(o,o),h=Tp(o,l),p=Tp(l,l),d=Tp(u,o),f=Tp(u,l),y=c*p-h*h,m=(p*d-h*f)/y,g=(c*f-h*d)/y,x=1-m-g,v=n.z*x+r.z*m+a.z*g;if(isFinite(v))return v}return 1/0}{let e=1/0;for(let r of t)e=Math.min(e,r.z);return e}}function Dp(e,t,r){let i=1/0;du(r,t)&&(i=Lp(r,t[0]));for(let n=0;n<t.length;n++){let a=t[n],s=e[n];for(let e=0;e<a.length-1;e++){let t=a[e],n=a[e+1],o=s[e],l=[t,n,s[e+1],o,t];hu(r,l)&&(i=Math.min(i,Lp(r,l)))}}return i!==1/0&&i}function Op(e,t,r,i){let n=[],a=[],s=i[8]*t,o=i[9]*t,l=i[10]*t,u=i[11]*t,c=i[8]*r,h=i[9]*r,p=i[10]*r,d=i[11]*r;for(let t of e){let e=[],r=[];for(let n of t){let t=n.x,a=n.y,f=i[0]*t+i[4]*a+i[12],y=i[1]*t+i[5]*a+i[13],m=i[2]*t+i[6]*a+i[14],g=i[3]*t+i[7]*a+i[15],x=f+s,v=y+o,b=m+l,w=g+u,_=f+c,S=y+h,A=m+p,k=g+d,I=new Vp.default(x/w,v/w);I.z=b/w,e.push(I);let M=new Vp.default(_/k,S/k);M.z=A/k,r.push(M)}n.push(e),a.push(r)}return[n,a]}function Rp(e,t,r,i){let n=[];for(let r of e){let e=[r.x,r.y,i,1];Tc.transformMat4(e,e,t),n.push(new Vp.default(e[0]/e[3],e[1]/e[3]))}return n}l(Tp,"dot"),l(Lp,"getIntersectionDistance"),l(Dp,"checkIntersection"),l(Op,"projectExtrusion"),l(Rp,"projectQueryGeometry"),p(),p(),p();var qp=Ps([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:Up,size:jp,alignment:Np}=qp;p();var Zp=Ps([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Jp,size:Gp,alignment:Kp}=Zp,Xp=h(_(),1).default.VectorTileFeature.types,Yp=Math.cos(Math.PI/180*37.5),Hp=Math.pow(2,14)/.5,Wp=class{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((e=>{this.gradients[e.id]={}})),this.layoutVertexArray=new $o,this.layoutVertexArray2=new el,this.indexArray=new fl,this.programConfigurations=new Ql(e.layers,e.zoom),this.segments=new _l,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.hasPattern=ap("line",this.layers,t);let i=this.layers[0].layout.get("line-sort-key"),n=!i.isConstant(),a=[];for(let{feature:t,id:s,index:o,sourceLayerIndex:l}of e){let e=this.layers[0]._featureFilter.needGeometry,u=su(t,e);if(!this.layers[0]._featureFilter.filter(new Ja(this.zoom),u,r))continue;let c=n?i.evaluate(u,{},r):void 0,h={id:s,properties:t.properties,type:t.type,sourceLayerIndex:l,index:o,geometry:e?u.geometry:au(t),patterns:{},sortKey:c};a.push(h)}n&&a.sort(((e,t)=>e.sortKey-t.sortKey));for(let i of a){let{geometry:n,index:a,sourceLayerIndex:s}=i;if(this.hasPattern){let e=sp("line",this.layers,i,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(i,n,a,r,{});let o=e[a].feature;t.featureIndex.insert(o,n,a,s,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}addFeatures(e,t,r){for(let e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,Jp)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Up),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end")){return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}}addFeature(e,t,r,i,n){let a=this.layers[0].layout,s=a.get("line-join").evaluate(e,{}),o=a.get("line-cap"),l=a.get("line-miter-limit"),u=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(let r of t)this.addLine(r,e,s,o,l,u);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,n,i)}addLine(e,t,r,i,n,a){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;t<e.length-1;t++)this.totalDistance+=e[t].dist(e[t+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let s="Polygon"===Xp[t.type],o=e.length;for(;o>=2&&e[o-1].equals(e[o-2]);)o--;let l=0;for(;l<o-1&&e[l].equals(e[l+1]);)l++;if(o<(s?3:2))return;"bevel"===r&&(n=1.05);let u,c,h,p,d,f=this.overscaling<=16?122880/(512*this.overscaling):0,y=this.segments.prepareSegment(10*o,this.layoutVertexArray,this.indexArray);this.e1=this.e2=-1,s&&(u=e[o-2],d=e[l].sub(u)._unit()._perp());for(let t=l;t<o;t++){if(h=t===o-1?s?e[l+1]:void 0:e[t+1],h&&e[t].equals(h))continue;d&&(p=d),u&&(c=u),u=e[t],d=h?h.sub(u)._unit()._perp():p,p=p||d;let m=p.add(d);(0!==m.x||0!==m.y)&&m._unit();let g=p.x*d.x+p.y*d.y,x=m.x*d.x+m.y*d.y,v=0!==x?1/x:1/0,b=2*Math.sqrt(2-2*x),w=x<Yp&&c&&h,_=p.x*d.y-p.y*d.x>0;if(w&&t>l){let e=u.dist(c);if(e>2*f){let t=u.sub(u.sub(c)._mult(f/e)._round());this.updateDistance(c,t),this.addCurrentVertex(t,p,0,0,y),c=t}}let S=c&&h,A=S?r:s?"butt":i;if(S&&"round"===A&&(v<a?A="miter":v<=2&&(A="fakeround")),"miter"===A&&v>n&&(A="bevel"),"bevel"===A&&(v>2&&(A="flipbevel"),v<n&&(A="miter")),c&&this.updateDistance(c,u),"miter"===A)m._mult(v),this.addCurrentVertex(u,m,0,0,y);else if("flipbevel"===A){if(v>100)m=d.mult(-1);else{let e=v*p.add(d).mag()/p.sub(d).mag();m._perp()._mult(e*(_?-1:1))}this.addCurrentVertex(u,m,0,0,y),this.addCurrentVertex(u,m.mult(-1),0,0,y)}else if("bevel"===A||"fakeround"===A){let e=-Math.sqrt(v*v-1),t=_?e:0,r=_?0:e;if(c&&this.addCurrentVertex(u,p,t,r,y),"fakeround"===A){let e=Math.round(180*b/Math.PI/20);for(let t=1;t<e;t++){let r=t/e;if(.5!==r){let e=r-.5;r+=r*e*(r-1)*((1.0904+g*(g*(3.55645-1.43519*g)-3.2452))*e*e+(.848013+g*(.215638*g-1.06021)))}let i=d.sub(p)._mult(r)._add(p)._unit()._mult(_?-1:1);this.addHalfVertex(u,i.x,i.y,!1,_,0,y)}}h&&this.addCurrentVertex(u,d,-t,-r,y)}else if("butt"===A)this.addCurrentVertex(u,m,0,0,y);else if("square"===A){let e=c?1:-1;this.addCurrentVertex(u,m,e,e,y)}else"round"===A&&(c&&(this.addCurrentVertex(u,p,0,0,y),this.addCurrentVertex(u,p,1,1,y,!0)),h&&(this.addCurrentVertex(u,d,-1,-1,y,!0),this.addCurrentVertex(u,d,0,0,y)));if(w&&t<o-1){let e=u.dist(h);if(e>2*f){let t=u.add(h.sub(u)._mult(f/e)._round());this.updateDistance(u,t),this.addCurrentVertex(t,d,0,0,y),u=t}}}}addCurrentVertex(e,t,r,i,n,a=!1){let s=t.x+t.y*r,o=t.y-t.x*r,l=-t.x+t.y*i,u=-t.y-t.x*i;this.addHalfVertex(e,s,o,a,!1,r,n),this.addHalfVertex(e,l,u,a,!0,-i,n),this.distance>Hp/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,t,r,i,n,a))}addHalfVertex({x:e,y:t},r,i,n,a,s,o){let l=.5*(this.lineClips?this.scaledDistance*(Hp-1):this.scaledDistance);if(this.layoutVertexArray.emplaceBack((e<<1)+(n?1:0),(t<<1)+(a?1:0),Math.round(63*r)+128,Math.round(63*i)+128,1+(0===s?0:s<0?-1:1)|(63&l)<<2,l>>6),this.lineClips){let e=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(e,this.lineClipsArray.length)}let u=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,u),o.primitiveLength++),a?this.e2=u:this.e1=u}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}};l(Wp,"LineBucket");var $p=Wp;ia("LineBucket",$p,{omit:["layers","patternFeatures"]}),p();var Qp,ed,td=l((()=>Qp=Qp||new vs({"line-cap":new us(H.layout_line["line-cap"]),"line-join":new hs(H.layout_line["line-join"]),"line-miter-limit":new us(H.layout_line["line-miter-limit"]),"line-round-limit":new us(H.layout_line["line-round-limit"]),"line-sort-key":new hs(H.layout_line["line-sort-key"])})),"getLayout"),rd=l((()=>ed=ed||new vs({"line-opacity":new hs(H.paint_line["line-opacity"]),"line-color":new hs(H.paint_line["line-color"]),"line-translate":new us(H.paint_line["line-translate"]),"line-translate-anchor":new us(H.paint_line["line-translate-anchor"]),"line-width":new hs(H.paint_line["line-width"]),"line-gap-width":new hs(H.paint_line["line-gap-width"]),"line-offset":new hs(H.paint_line["line-offset"]),"line-blur":new hs(H.paint_line["line-blur"]),"line-dasharray":new ys(H.paint_line["line-dasharray"]),"line-pattern":new ds(H.paint_line["line-pattern"]),"line-gradient":new gs(H.paint_line["line-gradient"])})),"getPaint"),id={get paint(){return rd()},get layout(){return td()}},nd=class extends hs{possiblyEvaluate(e,t){return t=new Ja(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,zoomHistory:t.zoomHistory,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,r,i){return t=E({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,r,i)}};l(nd,"LineFloorwidthProperty");var ad,sd=nd,od=class extends _s{constructor(e){super(e,id),this.gradientVersion=0,ad||((ad=new sd(id.paint.properties["line-width"].specification)).useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if("line-gradient"===e){let e=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=e._styleExpression.expression instanceof dr,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=ad.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new $p(e)}queryRadius(e){let t=e,r=ud(ku("line-width",this,t),ku("line-gap-width",this,t)),i=ku("line-offset",this,t);return r/2+Math.abs(i)+Iu(this.paint.get("line-translate"))}queryIntersectsFeature(e,t,r,i,n,a,s){let o=Mu(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),l=s/2*ud(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),u=this.paint.get("line-offset").evaluate(t,r);return u&&(i=Pu(i,u*s)),fu(o,i,l)}isTileClipped(){return!0}};l(od,"LineStyleLayer");var ld=od;function ud(e,t){return t>0?t+2*e:e}l(ud,"getLineWidth"),p(),p(),p();var cd=Ps([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),hd=Ps([{name:"a_projected_pos",components:3,type:"Float32"}],4),pd=(Ps([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Ps([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),dd=(Ps([{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"}]),Ps([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),fd=(Ps([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4),Ps([{name:"triangle",components:3,type:"Uint16"}]),Ps([{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"}]),Ps([{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"}]),Ps([{type:"Float32",name:"offsetX"}]),Ps([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),h(d(),1));function yd(e,t,r){let i=t.layout.get("text-transform").evaluate(r,{});return"uppercase"===i?e=e.toLocaleUpperCase():"lowercase"===i&&(e=e.toLocaleLowerCase()),Na.applyArabicShaping&&(e=Na.applyArabicShaping(e)),e}function md(e,t,r){return e.sections.forEach((e=>{e.text=yd(e.text,t,r)})),e}function gd(e){let t={},r={},i=[],n=0;function a(t){i.push(e[t]),n++}function s(e,t,n){let a=r[e];return delete r[e],r[t]=a,i[a].geometry[0].pop(),i[a].geometry[0]=i[a].geometry[0].concat(n[0]),a}function o(e,r,n){let a=t[r];return delete t[r],t[e]=a,i[a].geometry[0].shift(),i[a].geometry[0]=n[0].concat(i[a].geometry[0]),a}function u(e,t,r){let i=r?t[0][t[0].length-1]:t[0][0];return"".concat(e,":").concat(i.x,":").concat(i.y)}l(a,"add"),l(s,"mergeFromRight"),l(o,"mergeFromLeft"),l(u,"getKey");for(let l=0;l<e.length;l++){let c=e[l],h=c.geometry,p=c.text?c.text.toString():null;if(!p){a(l);continue}let d=u(p,h),f=u(p,h,!0);if(d in r&&f in t&&r[d]!==t[f]){let e=o(d,f,h),n=s(d,f,i[e].geometry);delete t[d],delete r[f],r[u(p,i[n].geometry,!0)]=n,i[e].geometry=null}else d in r?s(d,f,h):f in t?o(d,f,h):(a(l),t[d]=n-1,r[f]=n-1)}return i.filter((e=>e.geometry))}p(),l(yd,"transformTextInternal"),l(md,"transformText"),p(),l(gd,"mergeLines"),p(),p();var xd={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};function vd(e){let t="";for(let r=0;r<e.length;r++){let i=e.charCodeAt(r+1)||null,n=e.charCodeAt(r-1)||null;i&&Va(i)&&!xd[e[r+1]]||n&&Va(n)&&!xd[e[r-1]]||!xd[e[r]]?t+=e[r]:t+=xd[e[r]]}return t}l(vd,"verticalizePunctuation"),p();var bd=24;p();h(A(),1);function wd(e){let t=0,r=0;for(let i of e)t+=i.w*i.h,r=Math.max(r,i.w);e.sort(((e,t)=>t.h-e.h));let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],n=0,a=0;for(let t of e)for(let e=i.length-1;e>=0;e--){let r=i[e];if(!(t.w>r.w||t.h>r.h)){if(t.x=r.x,t.y=r.y,a=Math.max(a,t.y+t.h),n=Math.max(n,t.x+t.w),t.w===r.w&&t.h===r.h){let t=i.pop();e<i.length&&(i[e]=t)}else t.h===r.h?(r.x+=t.w,r.w-=t.w):t.w===r.w?(r.y+=t.h,r.h-=t.h):(i.push({x:r.x+t.w,y:r.y,w:r.w-t.w,h:t.h}),r.y+=t.h,r.h-=t.h);break}}return{w:n,h:a,fill:t/(n*a)||0}}p(),p(),l(wd,"potpack");var _d=class{constructor(e,{pixelRatio:t,version:r,stretchX:i,stretchY:n,content:a}){this.paddedRect=e,this.pixelRatio=t,this.stretchX=i,this.stretchY=n,this.content=a,this.version=r}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}};l(_d,"ImagePosition");var Sd=_d,Ad=class{constructor(e,t){let r={},i={};this.haveRenderCallbacks=[];let n=[];this.addImages(e,r,n),this.addImages(t,i,n);let{w:a,h:s}=wd(n),o=new Rh({width:a||1,height:s||1});for(let t in e){let i=e[t],n=r[t].paddedRect;Rh.copy(i.data,o,{x:0,y:0},{x:n.x+1,y:n.y+1},i.data)}for(let e in t){let r=t[e],n=i[e].paddedRect,a=n.x+1,s=n.y+1,l=r.data.width,u=r.data.height;Rh.copy(r.data,o,{x:0,y:0},{x:a,y:s},r.data),Rh.copy(r.data,o,{x:0,y:u-1},{x:a,y:s-1},{width:l,height:1}),Rh.copy(r.data,o,{x:0,y:0},{x:a,y:s+u},{width:l,height:1}),Rh.copy(r.data,o,{x:l-1,y:0},{x:a-1,y:s},{width:1,height:u}),Rh.copy(r.data,o,{x:0,y:0},{x:a+l,y:s},{width:1,height:u})}this.image=o,this.iconPositions=r,this.patternPositions=i}addImages(e,t,r){for(let i in e){let n=e[i],a={x:0,y:0,w:n.data.width+2,h:n.data.height+2};r.push(a),t[i]=new Sd(a,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(e,t){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let r in e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)}patchUpdatedImage(e,t,r){if(!e||!t||e.version===t.version)return;e.version=t.version;let[i,n]=e.tl;r.update(t.data,void 0,{x:i,y:n})}};l(Ad,"ImageAtlas");var kd=Ad;ia("ImagePosition",Sd),ia("ImageAtlas",kd);var Id,Md=((Id=Md||{})[Id.none=0]="none",Id[Id.horizontal=1]="horizontal",Id[Id.vertical=2]="vertical",Id[Id.horizontalOnly=3]="horizontalOnly",Id),Pd=-17;function Cd(e){for(let t of e)if(0!==t.positionedGlyphs.length)return!1;return!0}l(Cd,"isEmpty");var zd=class e{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(t,r){let i=new e;return i.scale=t||1,i.fontStack=r,i}static forImage(t){let r=new e;return r.imageName=t,r}};l(zd,"SectionOptions");var Bd=zd,Vd=class e{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,r){let i=new e;for(let e=0;e<t.sections.length;e++){let n=t.sections[e];n.image?i.addImageSection(n):i.addTextSection(n,r)}return i}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(){this.text=vd(this.text)}trim(){let e=0;for(let t=0;t<this.text.length&&Ld[this.text.charCodeAt(t)];t++)e++;let t=this.text.length;for(let r=this.text.length-1;r>=0&&r>=e&&Ld[this.text.charCodeAt(r)];r--)t--;this.text=this.text.substring(e,t),this.sectionIndex=this.sectionIndex.slice(e,t)}substring(t,r){let i=new e;return i.text=this.text.substring(t,r),i.sectionIndex=this.sectionIndex.slice(t,r),i.sections=this.sections,i}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,t)=>Math.max(e,this.sections[t].scale)),0)}addTextSection(e,t){this.text+=e.text,this.sections.push(Bd.forText(e.scale,e.fontStack||t));let r=this.sections.length-1;for(let t=0;t<e.text.length;++t)this.sectionIndex.push(r)}addImageSection(e){let t=e.image?e.image.name:"";if(0===t.length)return void q("Can't add FormattedSection with an empty image.");let r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(Bd.forImage(t)),this.sectionIndex.push(this.sections.length-1)):q("Reached maximum number of images ".concat(6401))}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}};l(Vd,"TaggedString");var Ed=Vd;function Fd(e,t){let r=[],i=e.text,n=0;for(let i of t)r.push(e.substring(n,i)),n=i;return n<i.length&&r.push(e.substring(n,i.length)),r}function Td(e,t,r,i,n,a,s,o,l,u,c,h,p,d,f,y){let m=Ed.fromFeature(e,n);2===h&&m.verticalizePunctuation();let g,{processBidirectionalText:x,processStyledBidirectionalText:v}=Na;if(x&&1===m.sections.length){g=[];let e=x(m.toString(),Zd(m,u,a,t,i,d,f));for(let t of e){let e=new Ed;e.text=t,e.sections=m.sections;for(let r=0;r<t.length;r++)e.sectionIndex.push(0);g.push(e)}}else if(v){g=[];let e=v(m.text,m.sectionIndex,Zd(m,u,a,t,i,d,f));for(let t of e){let e=new Ed;e.text=t[0],e.sectionIndex=t[1],e.sections=m.sections,g.push(e)}}else g=Fd(m,Zd(m,u,a,t,i,d,f));let b=[],w={positionedLines:b,text:m.toString(),top:c[1],bottom:c[1],left:c[0],right:c[0],writingMode:h,iconsInText:!1,verticalizable:!1};return Gd(w,t,r,i,g,s,o,l,h,u,p,y),!Cd(b)&&w}l(Fd,"breakLines"),l(Td,"shapeText");var Ld={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Dd={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function Od(e,t,r,i,n,a){if(t.imageName){let e=i[t.imageName];return e?e.displaySize[0]*t.scale*bd/a+n:0}{let i=r[t.fontStack],a=i&&i[e];return a?a.metrics.advance*t.scale+n:0}}function Rd(e,t,r,i,n,a){let s=0;for(let r=0;r<e.length();r++){let o=e.getSection(r);s+=Od(e.getCharCode(r),o,i,n,t,a)}return s/Math.max(1,Math.ceil(s/r))}function qd(e,t,r,i){let n=Math.pow(e-t,2);return i?e<t?n/2:2*n:n+Math.abs(r)*r}function Ud(e,t,r){let i=0;return 10===e&&(i-=1e4),r&&(i+=150),(40===e||65288===e)&&(i+=50),(41===t||65289===t)&&(i+=50),i}function jd(e,t,r,i,n,a){let s=null,o=qd(t,r,n,a);for(let e of i){let i=qd(t-e.x,r,n,a)+e.badness;i<=o&&(s=e,o=i)}return{index:e,x:t,priorBreak:s,badness:o}}function Nd(e){return e?Nd(e.priorBreak).concat(e.index):[]}function Zd(e,t,r,i,n,a,s){if("point"!==a)return[];if(!e)return[];let o=[],l=Rd(e,t,r,i,n,s),u=e.text.indexOf("")>=0,c=0;for(let r=0;r<e.length();r++){let a=e.getSection(r),h=e.getCharCode(r);if(Ld[h]||(c+=Od(h,a,i,n,t,s)),r<e.length()-1){let t=Ca(h);(Dd[h]||t||a.imageName)&&o.push(jd(r+1,c,l,o,Ud(h,e.getCharCode(r+1),t&&u),!1))}}return Nd(jd(e.length(),c,l,o,0,!0))}function Jd(e){let t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function Gd(e,t,r,i,n,a,s,o,l,u,c,h){let p=0,d=Pd,f=0,y=0,m="right"===o?1:"left"===o?0:.5,g=0;for(let s of n){s.trim();let n=s.getMaxScale(),o=(n-1)*bd,x={positionedGlyphs:[],lineOffset:0};e.positionedLines[g]=x;let v=x.positionedGlyphs,b=0;if(!s.length()){d+=a,++g;continue}for(let a=0;a<s.length();a++){let f=s.getSection(a),y=s.getSectionIndex(a),m=s.getCharCode(a),g=0,x=null,w=null,_=null,S=bd,A=!(1===l||!c&&!za(m)||c&&(Ld[m]||Ea(m)));if(f.imageName){let t=i[f.imageName];if(!t)continue;_=f.imageName,e.iconsInText=e.iconsInText||!0,w=t.paddedRect;let r=t.displaySize;f.scale=f.scale*bd/h,x={width:r[0],height:r[1],left:1,top:-3,advance:A?r[1]:r[0]},g=o+(bd-r[1]*f.scale),S=x.advance;let a=A?r[0]*f.scale-bd*n:r[1]*f.scale-bd*n;a>0&&a>b&&(b=a)}else{let e=r[f.fontStack],i=e&&e[m];if(i&&i.rect)w=i.rect,x=i.metrics;else{let e=t[f.fontStack],r=e&&e[m];if(!r)continue;x=r.metrics}g=(n-f.scale)*bd}A?(e.verticalizable=!0,v.push({glyph:m,imageName:_,x:p,y:d+g,vertical:A,scale:f.scale,fontStack:f.fontStack,sectionIndex:y,metrics:x,rect:w}),p+=S*f.scale+u):(v.push({glyph:m,imageName:_,x:p,y:d+g,vertical:A,scale:f.scale,fontStack:f.fontStack,sectionIndex:y,metrics:x,rect:w}),p+=x.advance*f.scale+u)}if(0!==v.length){let e=p-u;f=Math.max(e,f),Kd(v,0,v.length-1,m,b)}p=0;let w=a*n+b;x.lineOffset=Math.max(b,o),d+=w,y=Math.max(w,y),++g}let x=d-Pd,{horizontalAlign:v,verticalAlign:b}=Jd(s);Xd(e.positionedLines,m,v,b,f,y,a,x,n.length),e.top+=-b*x,e.bottom=e.top+x,e.left+=-v*f,e.right=e.left+f}function Kd(e,t,r,i,n){if(!i&&!n)return;let a=e[r],s=a.metrics.advance*a.scale,o=(e[r].x+s)*i;for(let i=t;i<=r;i++)e[i].x-=o,e[i].y+=n}function Xd(e,t,r,i,n,a,s,o,l){let u=(t-r)*n,c=0;c=a!==s?-o*i-Pd:(-i*l+.5)*s;for(let t of e)for(let e of t.positionedGlyphs)e.x+=u,e.y+=c}function Yd(e,t,r){let{horizontalAlign:i,verticalAlign:n}=Jd(r),a=t[0],s=t[1],o=a-e.displaySize[0]*i,l=o+e.displaySize[0],u=s-e.displaySize[1]*n;return{image:e,top:u,bottom:u+e.displaySize[1],left:o,right:l}}function Hd(e,t,r,i,n,a){let s,o=e.image;if(o.content){let e=o.content,t=o.pixelRatio||1;s=[e[0]/t,e[1]/t,o.displaySize[0]-e[2]/t,o.displaySize[1]-e[3]/t]}let l,u,c,h,p=t.left*a,d=t.right*a;"width"===r||"both"===r?(h=n[0]+p-i[3],u=n[0]+d+i[1]):(h=n[0]+(p+d-o.displaySize[0])/2,u=h+o.displaySize[0]);let f=t.top*a,y=t.bottom*a;return"height"===r||"both"===r?(l=n[1]+f-i[0],c=n[1]+y+i[2]):(l=n[1]+(f+y-o.displaySize[1])/2,c=l+o.displaySize[1]),{image:o,top:l,right:u,bottom:c,left:h,collisionPadding:s}}l(Od,"getGlyphAdvance"),l(Rd,"determineAverageLineWidth"),l(qd,"calculateBadness"),l(Ud,"calculatePenalty"),l(jd,"evaluateBreak"),l(Nd,"leastBadBreaks"),l(Zd,"determineLineBreaks"),l(Jd,"getAnchorAlignment"),l(Gd,"shapeLines"),l(Kd,"justifyLine"),l(Xd,"align"),l(Yd,"shapeIcon"),l(Hd,"fitIconToText");var Wd=h(_(),1);p();var $d=255,Qd=128,ef=32640;function tf(e,t){let{expression:r}=t;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new Ja(e+1))};if("source"===r.kind)return{kind:"source"};{let{zoomStops:t,interpolationType:i}=r,n=0;for(;n<t.length&&t[n]<=e;)n++;n=Math.max(0,n-1);let a=n;for(;a<t.length&&t[a]<e+1;)a++;a=Math.min(t.length-1,a);let s=t[n],o=t[a];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:o,interpolationType:i}:{kind:"camera",minZoom:s,maxZoom:o,minSize:r.evaluate(new Ja(s)),maxSize:r.evaluate(new Ja(o)),interpolationType:i}}}function rf(e,t,r){let i="never",n=e.get(t);return n?i=n:e.get(r)&&(i="always"),i}l(tf,"getSizeData"),p(),l(rf,"getOverlapMode");var nf=Wd.default.VectorTileFeature.types,af=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function sf(e,t,r,i,n,a,s,o,l,u,c,h,p){let d=o?Math.min(ef,Math.round(o[0])):0,f=o?Math.min(ef,Math.round(o[1])):0;e.emplaceBack(t,r,Math.round(32*i),Math.round(32*n),a,s,(d<<1)+(l?1:0),f,16*u,16*c,256*h,256*p)}function of(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function lf(e){for(let t of e.sections)if(La(t.text))return!0;return!1}l(sf,"addVertex"),l(of,"addDynamicAttributes"),l(lf,"containsRTLText");var uf=class{constructor(e){this.layoutVertexArray=new nl,this.indexArray=new fl,this.programConfigurations=e,this.segments=new _l,this.dynamicLayoutVertexArray=new sl,this.opacityVertexArray=new ll,this.hasVisibleVertices=!1,this.placedSymbolArray=new zo}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(e,t,r,i){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,cd.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,hd.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,af,!0),this.opacityVertexBuffer.itemSize=1),(r||i)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}};l(uf,"SymbolBuffers");var cf=uf;ia("SymbolBuffers",cf);var hf=class{constructor(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new _l,this.collisionVertexArray=new pl}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,pd.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}};l(hf,"CollisionBuffers");var pf=hf;ia("CollisionBuffers",pf);var df=class{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Du.identity([]),this.placementViewportMatrix=Du.identity([]);let t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=tf(this.zoom,t["text-size"]),this.iconSizeData=tf(this.zoom,t["icon-size"]);let r=this.layers[0].layout,i=r.get("symbol-sort-key"),n=r.get("symbol-z-order");this.canOverlap="never"!==rf(r,"text-overlap","text-allow-overlap")||"never"!==rf(r,"icon-overlap","icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==n&&!i.isConstant();let a="viewport-y"===n||"auto"===n&&!this.sortFeaturesByKey;this.sortFeaturesByY=a&&this.canOverlap,"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((e=>Md[e]))),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.sourceID=e.sourceID}createArrays(){this.text=new cf(new Ql(this.layers,this.zoom,(e=>/^text/.test(e)))),this.icon=new cf(new Ql(this.layers,this.zoom,(e=>/^icon/.test(e)))),this.glyphOffsetArray=new Lo,this.lineVertexArray=new Oo,this.symbolInstances=new Fo}calculateGlyphDependencies(e,t,r,i,n){for(let a=0;a<e.length;a++)if(t[e.charCodeAt(a)]=!0,(r||i)&&n){let r=xd[e.charAt(a)];r&&(t[r.charCodeAt(0)]=!0)}}populate(e,t,r){let i=this.layers[0],n=i.layout,a=n.get("text-font"),s=n.get("text-field"),o=n.get("icon-image"),l=("constant"!==s.value.kind||s.value.value instanceof tt&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),u="constant"!==o.value.kind||!!o.value.value||Object.keys(o.parameters).length>0,c=n.get("symbol-sort-key");if(this.features=[],!l&&!u)return;let h=t.iconDependencies,p=t.glyphDependencies,d=t.availableImages,f=new Ja(this.zoom);for(let{feature:t,id:s,index:o,sourceLayerIndex:y}of e){let e,m,g=i._featureFilter.needGeometry,x=su(t,g);if(!i._featureFilter.filter(f,x,r))continue;if(g||(x.geometry=au(t)),l){let t=i.getValueAndResolveTokens("text-field",x,r,d),n=tt.factory(t);lf(n)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===ja()||this.hasRTLText&&Na.isParsed())&&(e=md(n,i,x))}if(u){let e=i.getValueAndResolveTokens("icon-image",x,r,d);m=e instanceof lt?e:lt.fromString(e)}if(!e&&!m)continue;let v=this.sortFeaturesByKey?c.evaluate(x,{},r):void 0,b={id:s,text:e,icon:m,index:o,sourceLayerIndex:y,geometry:x.geometry,properties:t.properties,type:nf[t.type],sortKey:v};if(this.features.push(b),m&&(h[m.name]=!0),e){let t=a.evaluate(x,{},r).join(","),i="viewport"!==n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(2)>=0;for(let r of e.sections)if(r.image)h[r.image.name]=!0;else{let n=Ia(e.toString()),a=r.fontStack||t,s=p[a]=p[a]||{};this.calculateGlyphDependencies(r.text,s,i,this.allowVerticalPlacement,n)}}}"line"===n.get("symbol-placement")&&(this.features=gd(this.features)),this.sortFeaturesByKey&&this.features.sort(((e,t)=>e.sortKey-t.sortKey))}update(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,r),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,r))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){let r=this.lineVertexArray.length;if(void 0!==e.segment){let r=e.dist(t[e.segment+1]),i=e.dist(t[e.segment]),n={};for(let i=e.segment+1;i<t.length;i++)n[i]={x:t[i].x,y:t[i].y,tileUnitDistanceFromAnchor:r},i<t.length-1&&(r+=t[i+1].dist(t[i]));for(let r=e.segment||0;r>=0;r--)n[r]={x:t[r].x,y:t[r].y,tileUnitDistanceFromAnchor:i},r>0&&(i+=t[r-1].dist(t[r]));for(let e=0;e<t.length;e++){let t=n[e];this.lineVertexArray.emplaceBack(t.x,t.y,t.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(e,t,r,i,n,a,s,o,l,u,c,h){let p=e.indexArray,d=e.layoutVertexArray,f=e.segments.prepareSegment(4*t.length,d,p,this.canOverlap?a.sortKey:void 0),y=this.glyphOffsetArray.length,m=f.vertexLength,g=this.allowVerticalPlacement&&2===s?Math.PI/2:0,x=a.text&&a.text.sections;for(let i=0;i<t.length;i++){let{tl:n,tr:s,bl:l,br:u,tex:c,pixelOffsetTL:y,pixelOffsetBR:m,minFontScaleX:v,minFontScaleY:b,glyphOffset:w,isSDF:_,sectionIndex:S}=t[i],A=f.vertexLength,k=w[1];sf(d,o.x,o.y,n.x,k+n.y,c.x,c.y,r,_,y.x,y.y,v,b),sf(d,o.x,o.y,s.x,k+s.y,c.x+c.w,c.y,r,_,m.x,y.y,v,b),sf(d,o.x,o.y,l.x,k+l.y,c.x,c.y+c.h,r,_,y.x,m.y,v,b),sf(d,o.x,o.y,u.x,k+u.y,c.x+c.w,c.y+c.h,r,_,m.x,m.y,v,b),of(e.dynamicLayoutVertexArray,o,g),p.emplaceBack(A,A+1,A+2),p.emplaceBack(A+1,A+2,A+3),f.vertexLength+=4,f.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(w[0]),(i===t.length-1||S!==t[i+1].sectionIndex)&&e.programConfigurations.populatePaintArrays(d.length,a,a.index,{},h,x&&x[S])}e.placedSymbolArray.emplaceBack(o.x,o.y,y,this.glyphOffsetArray.length-y,m,l,u,o.segment,r?r[0]:0,r?r[1]:0,i[0],i[1],s,0,!1,0,c)}_addCollisionDebugVertex(e,t,r,i,n,a){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,i,n,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(e,t,r,i,n,a,s){let o=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),l=o.vertexLength,u=n.layoutVertexArray,c=n.collisionVertexArray,h=s.anchorX,p=s.anchorY;this._addCollisionDebugVertex(u,c,a,h,p,new fd.default(e,t)),this._addCollisionDebugVertex(u,c,a,h,p,new fd.default(r,t)),this._addCollisionDebugVertex(u,c,a,h,p,new fd.default(r,i)),this._addCollisionDebugVertex(u,c,a,h,p,new fd.default(e,i)),o.vertexLength+=4;let d=n.indexArray;d.emplaceBack(l,l+1),d.emplaceBack(l+1,l+2),d.emplaceBack(l+2,l+3),d.emplaceBack(l+3,l),o.primitiveLength+=4}addDebugCollisionBoxes(e,t,r,i){for(let n=e;n<t;n++){let e=this.collisionBoxArray.get(n),t=e.x1,a=e.y1,s=e.x2,o=e.y2;this.addCollisionDebugVertices(t,a,s,o,i?this.textCollisionBox:this.iconCollisionBox,e.anchorPoint,r)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new pf(cl,dd.members,ml),this.iconCollisionBox=new pf(cl,dd.members,ml);for(let e=0;e<this.symbolInstances.length;e++){let t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}}_deserializeCollisionBoxesForSymbol(e,t,r,i,n,a,s,o,l){let u={};for(let i=t;i<r;i++){let t=e.get(i);u.textBox={x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,anchorPointX:t.anchorPointX,anchorPointY:t.anchorPointY},u.textFeatureIndex=t.featureIndex;break}for(let t=i;t<n;t++){let r=e.get(t);u.verticalTextBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},u.verticalTextFeatureIndex=r.featureIndex;break}for(let t=a;t<s;t++){let r=e.get(t);u.iconBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},u.iconFeatureIndex=r.featureIndex;break}for(let t=o;t<l;t++){let r=e.get(t);u.verticalIconBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},u.verticalIconFeatureIndex=r.featureIndex;break}return u}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){let r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,t){let r=e.placedSymbolArray.get(t),i=r.vertexStartIndex+4*r.numGlyphs;for(let t=r.vertexStartIndex;t<i;t+=4)e.indexArray.emplaceBack(t,t+1,t+2),e.indexArray.emplaceBack(t+1,t+2,t+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;let t=Math.sin(e),r=Math.cos(e),i=[],n=[],a=[];for(let e=0;e<this.symbolInstances.length;++e){a.push(e);let s=this.symbolInstances.get(e);i.push(0|Math.round(t*s.anchorX+r*s.anchorY)),n.push(s.featureIndex)}return a.sort(((e,t)=>i[e]-i[t]||n[t]-n[e])),a}addToSortKeyRanges(e,t){let r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let e of this.symbolInstanceIndexes){let t=this.symbolInstances.get(e);this.featureSortOrder.push(t.featureIndex),[t.rightJustifiedTextSymbolIndex,t.centerJustifiedTextSymbolIndex,t.leftJustifiedTextSymbolIndex].forEach(((e,t,r)=>{e>=0&&r.indexOf(e)===t&&this.addIndicesForPlacedSymbol(this.text,e)})),t.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,t.verticalPlacedTextSymbolIndex),t.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.placedIconSymbolIndex),t.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}};l(df,"SymbolBucket");var ff=df;function yf(e,t){return t.replace(/{([^{}]+)}/g,((t,r)=>r in e?String(e[r]):""))}ia("SymbolBucket",ff,{omit:["layers","collisionBoxArray","features","compareText"]}),ff.MAX_GLYPHS=65535,ff.addDynamicAttributes=of,p(),l(yf,"resolveTokens"),p();var mf,gf,xf=l((()=>mf=mf||new vs({"symbol-placement":new us(H.layout_symbol["symbol-placement"]),"symbol-spacing":new us(H.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new us(H.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new hs(H.layout_symbol["symbol-sort-key"]),"symbol-z-order":new us(H.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new us(H.layout_symbol["icon-allow-overlap"]),"icon-overlap":new us(H.layout_symbol["icon-overlap"]),"icon-ignore-placement":new us(H.layout_symbol["icon-ignore-placement"]),"icon-optional":new us(H.layout_symbol["icon-optional"]),"icon-rotation-alignment":new us(H.layout_symbol["icon-rotation-alignment"]),"icon-size":new hs(H.layout_symbol["icon-size"]),"icon-text-fit":new us(H.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new us(H.layout_symbol["icon-text-fit-padding"]),"icon-image":new hs(H.layout_symbol["icon-image"]),"icon-rotate":new hs(H.layout_symbol["icon-rotate"]),"icon-padding":new hs(H.layout_symbol["icon-padding"]),"icon-keep-upright":new us(H.layout_symbol["icon-keep-upright"]),"icon-offset":new hs(H.layout_symbol["icon-offset"]),"icon-anchor":new hs(H.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new us(H.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new us(H.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new us(H.layout_symbol["text-rotation-alignment"]),"text-field":new hs(H.layout_symbol["text-field"]),"text-font":new hs(H.layout_symbol["text-font"]),"text-size":new hs(H.layout_symbol["text-size"]),"text-max-width":new hs(H.layout_symbol["text-max-width"]),"text-line-height":new us(H.layout_symbol["text-line-height"]),"text-letter-spacing":new hs(H.layout_symbol["text-letter-spacing"]),"text-justify":new hs(H.layout_symbol["text-justify"]),"text-radial-offset":new hs(H.layout_symbol["text-radial-offset"]),"text-variable-anchor":new us(H.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new hs(H.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new hs(H.layout_symbol["text-anchor"]),"text-max-angle":new us(H.layout_symbol["text-max-angle"]),"text-writing-mode":new us(H.layout_symbol["text-writing-mode"]),"text-rotate":new hs(H.layout_symbol["text-rotate"]),"text-padding":new us(H.layout_symbol["text-padding"]),"text-keep-upright":new us(H.layout_symbol["text-keep-upright"]),"text-transform":new hs(H.layout_symbol["text-transform"]),"text-offset":new hs(H.layout_symbol["text-offset"]),"text-allow-overlap":new us(H.layout_symbol["text-allow-overlap"]),"text-overlap":new us(H.layout_symbol["text-overlap"]),"text-ignore-placement":new us(H.layout_symbol["text-ignore-placement"]),"text-optional":new us(H.layout_symbol["text-optional"])})),"getLayout"),vf=l((()=>gf=gf||new vs({"icon-opacity":new hs(H.paint_symbol["icon-opacity"]),"icon-color":new hs(H.paint_symbol["icon-color"]),"icon-halo-color":new hs(H.paint_symbol["icon-halo-color"]),"icon-halo-width":new hs(H.paint_symbol["icon-halo-width"]),"icon-halo-blur":new hs(H.paint_symbol["icon-halo-blur"]),"icon-translate":new us(H.paint_symbol["icon-translate"]),"icon-translate-anchor":new us(H.paint_symbol["icon-translate-anchor"]),"text-opacity":new hs(H.paint_symbol["text-opacity"]),"text-color":new hs(H.paint_symbol["text-color"],{runtimeType:ue,getOverride:l((e=>e.textColor),"getOverride"),hasOverride:l((e=>!!e.textColor),"hasOverride")}),"text-halo-color":new hs(H.paint_symbol["text-halo-color"]),"text-halo-width":new hs(H.paint_symbol["text-halo-width"]),"text-halo-blur":new hs(H.paint_symbol["text-halo-blur"]),"text-translate":new us(H.paint_symbol["text-translate"]),"text-translate-anchor":new us(H.paint_symbol["text-translate-anchor"])})),"getPaint"),bf={get paint(){return vf()},get layout(){return xf()}};p();var wf=class{constructor(e){if(void 0===e.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:ae,this.defaultValue=e}evaluate(e){if(e.formattedSection){let t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){if(!this.defaultValue.isConstant()){e(this.defaultValue.value._styleExpression.expression)}}outputDefined(){return!1}serialize(){return null}};l(wf,"FormatSectionOverride");var _f=wf;ia("FormatSectionOverride",_f,{omit:["defaultValue"]});var Sf=class e extends _s{constructor(e){super(e,bf)}recalculate(e,t){if(super.recalculate(e,t),"auto"===this.layout.get("icon-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["icon-rotation-alignment"]="map":this.layout._values["icon-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-rotation-alignment")&&("point"!==this.layout.get("symbol-placement")?this.layout._values["text-rotation-alignment"]="map":this.layout._values["text-rotation-alignment"]="viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){let e=this.layout.get("text-writing-mode");if(e){let t=[];for(let r of e)t.indexOf(r)<0&&t.push(r);this.layout._values["text-writing-mode"]=t}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,t,r,i){let n=this.layout.get(e).evaluate(t,{},r,i),a=this._unevaluatedLayout._values[e];return a.isDataDriven()||Li(a.value)||!n?n:yf(t.properties,n)}createBucket(e){return new ff(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let t of bf.paint.overridableProperties){if(!e.hasPaintOverride(this.layout,t))continue;let r=this.paint.get(t),i=new _f(r),n=new Ti(i,r.property.specification),a=null;a="constant"===r.value.kind||"source"===r.value.kind?new Ri("source",n):new Ui("composite",n,r.value.zoomStops),this.paint._values[t]=new as(r.property,a,r.parameters)}}_handleOverridablePaintPropertyUpdate(t,r,i){return!(!this.layout||r.isDataDriven()||i.isDataDriven())&&e.hasPaintOverride(this.layout,t)}static hasPaintOverride(e,t){let r=e.get("text-field"),i=bf.paint.properties[t],n=!1,a=l((e=>{for(let t of e)if(i.overrides&&i.overrides.hasOverride(t))return void(n=!0)}),"checkSections");if("constant"===r.value.kind&&r.value.value instanceof tt)a(r.value.value.sections);else if("source"===r.value.kind){let e=l((t=>{if(!n)if(t instanceof ft&&ht(t.value)===de){let e=t.value;a(e.sections)}else t instanceof ui?a(t.sections):t.eachChild(e)}),"checkExpression"),t=r.value;t._styleExpression&&e(t._styleExpression.expression)}return n}};l(Sf,"SymbolStyleLayer");var Af=Sf;function kf(e,t,r,i=1){let n=e.get("icon-padding").evaluate(t,{},r),a=n&&n.values;return[a[0]*i,a[1]*i,a[2]*i,a[3]*i]}l(kf,"getIconPadding"),p(),p();var If,Mf=l((()=>If=If||new vs({"background-color":new us(H.paint_background["background-color"]),"background-pattern":new ys(H.paint_background["background-pattern"]),"background-opacity":new us(H.paint_background["background-opacity"])})),"getPaint"),Pf={get paint(){return Mf()}},Cf=class extends _s{constructor(e){super(e,Pf)}};l(Cf,"BackgroundStyleLayer");var zf=Cf;p(),p();var Bf,Vf=l((()=>Bf=Bf||new vs({"raster-opacity":new us(H.paint_raster["raster-opacity"]),"raster-hue-rotate":new us(H.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new us(H.paint_raster["raster-brightness-min"]),"raster-brightness-max":new us(H.paint_raster["raster-brightness-max"]),"raster-saturation":new us(H.paint_raster["raster-saturation"]),"raster-contrast":new us(H.paint_raster["raster-contrast"]),"raster-resampling":new us(H.paint_raster["raster-resampling"]),"raster-fade-duration":new us(H.paint_raster["raster-fade-duration"])})),"getPaint"),Ef={get paint(){return Vf()}},Ff=class extends _s{constructor(e){super(e,Ef)}};l(Ff,"RasterStyleLayer");var Tf=Ff;p();var Lf=class extends _s{constructor(e){super(e,{}),this.onAdd=l((e=>{this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)}),"onAdd"),this.onRemove=l((e=>{this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)}),"onRemove"),this.implementation=e}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}};l(Lf,"CustomStyleLayer");var Df=Lf;function Of(e){if("custom"===e.type)return new Df(e);switch(e.type){case"background":return new zf(e);case"circle":return new kh(e);case"fill":return new yp(e);case"fill-extrusion":return new Fp(e);case"heatmap":return new jh(e);case"hillshade":return new Kh(e);case"line":return new ld(e);case"raster":return new Tf(e);case"symbol":return new Af(e)}}l(Of,"createStyleLayer");var Rf=class{constructor(e){this.keyCache={},e&&this.replace(e)}replace(e){this._layerConfigs={},this._layers={},this.update(e,[])}update(e,t){for(let t of e){this._layerConfigs[t.id]=t;let e=this._layers[t.id]=Of(t);e._featureFilter=Wi(e.filter),this.keyCache[t.id]&&delete this.keyCache[t.id]}for(let e of t)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};let r=un(Object.values(this._layerConfigs),this.keyCache);for(let e of r){let t=e.map((e=>this._layers[e.id])),r=t[0];if("none"===r.visibility)continue;let i=r.source||"",n=this.familiesBySource[i];n||(n=this.familiesBySource[i]={});let a=r.sourceLayer||"_geojsonTileLayer",s=n[a];s||(s=n[a]=[]),s.push(t)}}};l(Rf,"StyleLayerIndex");var qf=Rf;p();var Uf=h(_(),1),jf=h(A(),1);p(),p(),p();var Nf=class{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){let r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error("Out of bounds. Index requested n=".concat(e," can't be >= this._numberToString.length ").concat(this._numberToString.length));return this._numberToString[e]}};l(Nf,"DictionaryCoder");var Zf=Nf,Jf=h(_(),1),Gf=h(A(),1);p();var Kf=class{constructor(e,t,r,i,n){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=r,e._y=i,this.properties=e.properties,this.id=n}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let t in this)"_geometry"===t||"_vectorTileFeature"===t||(e[t]=this[t]);return e}};l(Kf,"GeoJSONFeature");var Xf=Kf,Yf=class{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new X(8192,16,0),this.grid3D=new X(8192,16,0),this.featureIndexArray=new jo,this.promoteId=t}insert(e,t,r,i,n,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);let o=a?this.grid3D:this.grid;for(let e=0;e<t.length;e++){let r=t[e],i=[1/0,1/0,-1/0,-1/0];for(let e=0;e<r.length;e++){let t=r[e];i[0]=Math.min(i[0],t.x),i[1]=Math.min(i[1],t.y),i[2]=Math.max(i[2],t.x),i[3]=Math.max(i[3],t.y)}i[0]<8192&&i[1]<8192&&i[2]>=0&&i[3]>=0&&o.insert(s,i[0],i[1],i[2],i[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Jf.default.VectorTile(new Gf.default(this.rawTileData)).layers,this.sourceLayerCoder=new Zf(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,t,r,i){this.loadVTLayers();let n=e.params||{},a=8192/e.tileSize/e.scale,s=Wi(n.filter),o=e.queryGeometry,l=e.queryPadding*a,u=$f(o),c=this.grid.query(u.minX-l,u.minY-l,u.maxX+l,u.maxY+l),h=$f(e.cameraQueryGeometry),p=this.grid3D.query(h.minX-l,h.minY-l,h.maxX+l,h.maxY+l,((t,r,i,n)=>_u(e.cameraQueryGeometry,t-l,r-l,i+l,n+l)));for(let e of p)c.push(e);c.sort(Qf);let d,f={};for(let l=0;l<c.length;l++){let u=c[l];if(u===d)continue;d=u;let h=this.featureIndexArray.get(u),p=null;this.loadMatchingFeature(f,h.bucketIndex,h.sourceLayerIndex,h.featureIndex,s,n.layers,n.availableImages,t,r,i,((t,r,i)=>(p||(p=au(t)),r.queryIntersectsFeature(o,t,i,p,this.z,e.transform,a,e.pixelPosMatrix))))}return f}loadMatchingFeature(e,t,r,i,n,a,s,o,l,u,c){let h=this.bucketLayerIDs[t];if(a&&!O(a,h))return;let p=this.sourceLayerCoder.decode(r),d=this.vtLayers[p].feature(i);if(n.needGeometry){let e=su(d,!0);if(!n.filter(new Ja(this.tileID.overscaledZ),e,this.tileID.canonical))return}else if(!n.filter(new Ja(this.tileID.overscaledZ),d))return;let f=this.getId(d,p);for(let t=0;t<h.length;t++){let r=h[t];if(a&&a.indexOf(r)<0)continue;let n=o[r];if(!n)continue;let p={};f&&u&&(p=u.getState(n.sourceLayer||"_geojsonTileLayer",f));let y=E({},l[r]);y.paint=Wf(y.paint,n.paint,d,p,s),y.layout=Wf(y.layout,n.layout,d,p,s);let m=!c||c(d,n,p);if(!m)continue;let g=new Xf(d,this.z,this.x,this.y,f);g.layer=y;let x=e[r];void 0===x&&(x=e[r]=[]),x.push({featureIndex:i,feature:g,intersectionZ:m})}}lookupSymbolFeatures(e,t,r,i,n,a,s,o){let l={};this.loadVTLayers();let u=Wi(n);for(let n of e)this.loadMatchingFeature(l,r,i,n,u,a,s,o,t);return l}hasLayer(e){for(let t of this.bucketLayerIDs)for(let r of t)if(e===r)return!0;return!1}getId(e,t){let r=e.id;if(this.promoteId){let i="string"==typeof this.promoteId?this.promoteId:this.promoteId[t];r=e.properties[i],"boolean"==typeof r&&(r=Number(r))}return r}};l(Yf,"FeatureIndex");var Hf=Yf;function Wf(e,t,r,i,n){return T(e,((e,a)=>{let s=t instanceof os?t.get(a):null;return s&&s.evaluate?s.evaluate(r,i,n):s}))}function $f(e){let t=1/0,r=1/0,i=-1/0,n=-1/0;for(let a of e)t=Math.min(t,a.x),r=Math.min(r,a.y),i=Math.max(i,a.x),n=Math.max(n,a.y);return{minX:t,minY:r,maxX:i,maxY:n}}function Qf(e,t){return t-e}ia("FeatureIndex",Hf,{omit:["rawTileData","sourceLayerCoder"]}),l(Wf,"evaluateProperties"),l($f,"getBounds"),l(Qf,"topDownFeatureComparator"),p(),p();var ey=h(d(),1),ty=class e extends ey.default{constructor(e,t,r,i){super(e,t),this.angle=r,void 0!==i&&(this.segment=i)}clone(){return new e(this.x,this.y,this.angle,this.segment)}};l(ty,"Anchor");var ry=ty;function iy(e,t,r,i,n){if(void 0===t.segment||0===r)return!0;let a=t,s=t.segment+1,o=0;for(;o>-r/2;){if(s--,s<0)return!1;o-=e[s].dist(a),a=e[s]}o+=e[s].dist(e[s+1]),s++;let l=[],u=0;for(;o<r/2;){let t=e[s-1],r=e[s],a=e[s+1];if(!a)return!1;let c=t.angleTo(r)-r.angleTo(a);for(c=Math.abs((c+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:o,angleDelta:c}),u+=c;o-l[0].distance>i;)u-=l.shift().angleDelta;if(u>n)return!1;s++,o+=r.dist(a)}return!0}function ny(e){let t=0;for(let r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function ay(e,t,r){return e?.6*t*r:0}function sy(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function oy(e,t,r,i,n,a){let s=ay(r,n,a),o=sy(r,i)*a,l=0,u=ny(e)/2;for(let r=0;r<e.length-1;r++){let i=e[r],n=e[r+1],a=i.dist(n);if(l+a>u){let c=(u-l)/a,h=br.number(i.x,n.x,c),p=br.number(i.y,n.y,c),d=new ry(h,p,n.angleTo(i),r);return d._round(),!s||iy(e,d,o,s,t)?d:void 0}l+=a}}function ly(e,t,r,i,n,a,s,o,l){let u=ay(i,a,s),c=sy(i,n),h=c*s,p=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-h<t/4&&(t=h+t/4),uy(e,p?t/2*o%t:(c/2+2*a)*s*o%t,t,u,r,h,p,!1,l)}function uy(e,t,r,i,n,a,s,o,l){let u=a/2,c=ny(e),h=0,p=t-r,d=[];for(let t=0;t<e.length-1;t++){let s=e[t],o=e[t+1],f=s.dist(o),y=o.angleTo(s);for(;p+r<h+f;){p+=r;let m=(p-h)/f,g=br.number(s.x,o.x,m),x=br.number(s.y,o.y,m);if(g>=0&&g<l&&x>=0&&x<l&&p-u>=0&&p+u<=c){let r=new ry(g,x,y,t);r._round(),(!i||iy(e,r,a,i,n))&&d.push(r)}}h+=f}return!o&&!d.length&&!s&&(d=uy(e,h/2,r,i,n,a,s,!0,l)),d}ia("Anchor",ry),p(),p(),l(iy,"checkMaxAngle"),l(ny,"getLineLength"),l(ay,"getAngleWindowSize"),l(sy,"getShapedLabelLength"),l(oy,"getCenterAnchor"),l(ly,"getAnchors"),l(uy,"resample"),p();var cy=h(d(),1);function hy(e,t,r,i,n){let a=[];for(let s=0;s<e.length;s++){let o,l=e[s];for(let e=0;e<l.length-1;e++){let s=l[e],u=l[e+1];s.x<t&&u.x<t||(s.x<t?s=new cy.default(t,s.y+(u.y-s.y)*((t-s.x)/(u.x-s.x)))._round():u.x<t&&(u=new cy.default(t,s.y+(u.y-s.y)*((t-s.x)/(u.x-s.x)))._round()),!(s.y<r&&u.y<r)&&(s.y<r?s=new cy.default(s.x+(u.x-s.x)*((r-s.y)/(u.y-s.y)),r)._round():u.y<r&&(u=new cy.default(s.x+(u.x-s.x)*((r-s.y)/(u.y-s.y)),r)._round()),!(s.x>=i&&u.x>=i)&&(s.x>=i?s=new cy.default(i,s.y+(u.y-s.y)*((i-s.x)/(u.x-s.x)))._round():u.x>=i&&(u=new cy.default(i,s.y+(u.y-s.y)*((i-s.x)/(u.x-s.x)))._round()),!(s.y>=n&&u.y>=n)&&(s.y>=n?s=new cy.default(s.x+(u.x-s.x)*((n-s.y)/(u.y-s.y)),n)._round():u.y>=n&&(u=new cy.default(s.x+(u.x-s.x)*((n-s.y)/(u.y-s.y)),n)._round()),(!o||!s.equals(o[o.length-1]))&&(o=[s],a.push(o)),o.push(u)))))}}return a}l(hy,"clipLine"),p();var py=h(d(),1);function dy(e,t,r,i){let n=[],a=e.image,s=a.pixelRatio,o=a.paddedRect.w-2,u=a.paddedRect.h-2,c=e.right-e.left,h=e.bottom-e.top,p=a.stretchX||[[0,o]],d=a.stretchY||[[0,u]],f=l(((e,t)=>e+t[1]-t[0]),"reduceRanges"),y=p.reduce(f,0),m=d.reduce(f,0),g=o-y,x=u-m,v=0,b=y,w=0,_=m,S=0,A=g,k=0,I=x;if(a.content&&i){let e=a.content;v=fy(p,0,e[0]),w=fy(d,0,e[1]),b=fy(p,e[0],e[2]),_=fy(d,e[1],e[3]),S=e[0]-v,k=e[1]-w,A=e[2]-e[0]-b,I=e[3]-e[1]-_}let M=l(((i,n,o,l)=>{let u=my(i.stretch-v,b,c,e.left),p=gy(i.fixed-S,A,i.stretch,y),d=my(n.stretch-w,_,h,e.top),f=gy(n.fixed-k,I,n.stretch,m),g=my(o.stretch-v,b,c,e.left),x=gy(o.fixed-S,A,o.stretch,y),M=my(l.stretch-w,_,h,e.top),P=gy(l.fixed-k,I,l.stretch,m),C=new py.default(u,d),z=new py.default(g,d),B=new py.default(g,M),V=new py.default(u,M),E=new py.default(p/s,f/s),F=new py.default(x/s,P/s),T=t*Math.PI/180;if(T){let e=Math.sin(T),t=Math.cos(T),r=[t,-e,e,t];C._matMult(r),z._matMult(r),V._matMult(r),B._matMult(r)}let L=i.stretch+i.fixed,D=o.stretch+o.fixed,O=n.stretch+n.fixed,R=l.stretch+l.fixed;return{tl:C,tr:z,bl:V,br:B,tex:{x:a.paddedRect.x+1+L,y:a.paddedRect.y+1+O,w:D-L,h:R-O},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:E,pixelOffsetBR:F,minFontScaleX:A/s/c,minFontScaleY:I/s/h,isSDF:r}}),"makeBox");if(i&&(a.stretchX||a.stretchY)){let e=yy(p,g,y),t=yy(d,x,m);for(let r=0;r<e.length-1;r++){let i=e[r],a=e[r+1];for(let e=0;e<t.length-1;e++){let r=t[e],s=t[e+1];n.push(M(i,r,a,s))}}}else n.push(M({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:o+1},{fixed:0,stretch:u+1}));return n}function fy(e,t,r){let i=0;for(let n of e)i+=Math.max(t,Math.min(r,n[1]))-Math.max(t,Math.min(r,n[0]));return i}function yy(e,t,r){let i=[{fixed:-1,stretch:0}];for(let[t,r]of e){let e=i[i.length-1];i.push({fixed:t-e.stretch,stretch:e.stretch}),i.push({fixed:t-e.stretch,stretch:e.stretch+(r-t)})}return i.push({fixed:t+1,stretch:r}),i}function my(e,t,r,i){return e/t*r+i}function gy(e,t,r,i){return e-t*r/i}function xy(e,t,r,i,n,a,s,o){let l=i.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,u=[];for(let e of t.positionedLines)for(let i of e.positionedGlyphs){if(!i.rect)continue;let a=i.rect||{},c=4,h=!0,p=1,d=0,f=(n||o)&&i.vertical,y=i.metrics.advance*i.scale/2;if(o&&t.verticalizable){let t=(i.scale-1)*bd,r=(bd-i.metrics.width*i.scale)/2;d=e.lineOffset/2-(i.imageName?-r:t)}if(i.imageName){let e=s[i.imageName];h=e.sdf,p=e.pixelRatio,c=1/p}let m=n?[i.x+y,i.y]:[0,0],g=n?[0,0]:[i.x+y+r[0],i.y+r[1]-d],x=[0,0];f&&(x=g,g=[0,0]);let v=(i.metrics.left-c)*i.scale-y+g[0],b=(-i.metrics.top-c)*i.scale+g[1],w=v+a.w*i.scale/p,_=b+a.h*i.scale/p,S=new py.default(v,b),A=new py.default(w,b),k=new py.default(v,_),I=new py.default(w,_);if(f){let e=new py.default(-y,y-Pd),t=-Math.PI/2,r=12-y,n=i.imageName?r:0,a=new py.default(22-r,-n),s=new py.default(...x);S._rotateAround(t,e)._add(a)._add(s),A._rotateAround(t,e)._add(a)._add(s),k._rotateAround(t,e)._add(a)._add(s),I._rotateAround(t,e)._add(a)._add(s)}if(l){let e=Math.sin(l),t=Math.cos(l),r=[t,-e,e,t];S._matMult(r),A._matMult(r),k._matMult(r),I._matMult(r)}let M=new py.default(0,0),P=new py.default(0,0);u.push({tl:S,tr:A,bl:k,br:I,tex:a,writingMode:t.writingMode,glyphOffset:m,sectionIndex:i.sectionIndex,isSDF:h,pixelOffsetTL:M,pixelOffsetBR:P,minFontScaleX:0,minFontScaleY:0})}return u}l(dy,"getIconQuads"),l(fy,"sumWithinRange"),l(yy,"stretchZonesToCuts"),l(my,"getEmOffset"),l(gy,"getPxOffset"),l(xy,"getGlyphQuads"),p();var vy=h(d(),1),by=class{constructor(e,t,r,i,n,a,s,o,l,u){if(this.boxStartIndex=e.length,l){let e=a.top,t=a.bottom,r=a.collisionPadding;r&&(e-=r[1],t+=r[3]);let i=t-e;i>0&&(i=Math.max(10,i),this.circleDiameter=i)}else{let l=a.top*s-o[0],c=a.bottom*s+o[2],h=a.left*s-o[3],p=a.right*s+o[1],d=a.collisionPadding;if(d&&(h-=d[0]*s,l-=d[1]*s,p+=d[2]*s,c+=d[3]*s),u){let e=new vy.default(h,l),t=new vy.default(p,l),r=new vy.default(h,c),i=new vy.default(p,c),n=u*Math.PI/180;e._rotate(n),t._rotate(n),r._rotate(n),i._rotate(n),h=Math.min(e.x,t.x,r.x,i.x),p=Math.max(e.x,t.x,r.x,i.x),l=Math.min(e.y,t.y,r.y,i.y),c=Math.max(e.y,t.y,r.y,i.y)}e.emplaceBack(t.x,t.y,h,l,p,c,r,i,n)}this.boxEndIndex=e.length}};l(by,"CollisionFeature");var wy=by;p(),p();var _y=class{constructor(e=[],t=Ay){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;let e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:r}=this,i=t[e];for(;e>0;){let n=e-1>>1,a=t[n];if(r(i,a)>=0)break;t[e]=a,e=n}t[e]=i}_down(e){let{data:t,compare:r}=this,i=this.length>>1,n=t[e];for(;e<i;){let i=1+(e<<1),a=t[i],s=i+1;if(s<this.length&&r(t[s],a)<0&&(i=s,a=t[s]),r(a,n)>=0)break;t[e]=a,e=i}t[e]=n}};l(_y,"TinyQueue");var Sy=_y;function Ay(e,t){return e<t?-1:e>t?1:0}l(Ay,"defaultCompare");var ky=h(d(),1);function Iy(e,t=1,r=!1){let i=1/0,n=1/0,a=-1/0,s=-1/0,o=e[0];for(let e=0;e<o.length;e++){let t=o[e];(!e||t.x<i)&&(i=t.x),(!e||t.y<n)&&(n=t.y),(!e||t.x>a)&&(a=t.x),(!e||t.y>s)&&(s=t.y)}let l=a-i,u=s-n,c=Math.min(l,u),h=c/2,p=new Sy([],My);if(0===c)return new ky.default(i,n);for(let t=i;t<a;t+=c)for(let r=n;r<s;r+=c)p.push(new Py(t+h,r+h,h,e));let d=zy(e),f=p.length;for(;p.length;){let i=p.pop();(i.d>d.d||!d.d)&&(d=i,r&&console.log("found best %d after %d probes",Math.round(1e4*i.d)/1e4,f)),!(i.max-d.d<=t)&&(h=i.h/2,p.push(new Py(i.p.x-h,i.p.y-h,h,e)),p.push(new Py(i.p.x+h,i.p.y-h,h,e)),p.push(new Py(i.p.x-h,i.p.y+h,h,e)),p.push(new Py(i.p.x+h,i.p.y+h,h,e)),f+=4)}return r&&(console.log("num probes: ".concat(f)),console.log("best distance: ".concat(d.d))),d.p}function My(e,t){return t.max-e.max}function Py(e,t,r,i){this.p=new ky.default(e,t),this.h=r,this.d=Cy(this.p,i),this.max=this.d+this.h*Math.SQRT2}function Cy(e,t){let r=!1,i=1/0;for(let n=0;n<t.length;n++){let a=t[n];for(let t=0,n=a.length,s=n-1;t<n;s=t++){let n=a[t],o=a[s];n.y>e.y!=o.y>e.y&&e.x<(o.x-n.x)*(e.y-n.y)/(o.y-n.y)+n.x&&(r=!r),i=Math.min(i,vu(e,n,o))}}return(r?1:-1)*Math.sqrt(i)}function zy(e){let t=0,r=0,i=0,n=e[0];for(let e=0,a=n.length,s=a-1;e<a;s=e++){let a=n[e],o=n[s],l=a.x*o.y-o.x*a.y;r+=(a.x+o.x)*l,i+=(a.y+o.y)*l,t+=3*l}return new Py(r/t,i/t,0,e)}l(Iy,"findPoleOfInaccessibility"),l(My,"compareMax"),l(Py,"Cell"),l(Cy,"pointToPolygonDist"),l(zy,"getCentroidCell");var By=h(g(),1),Vy=Number.POSITIVE_INFINITY;function Ey(e,t){function r(e,t){let r=0,i=0;t<0&&(t=0);let n=t/Math.sqrt(2);switch(e){case"top-right":case"top-left":i=n-7;break;case"bottom-right":case"bottom-left":i=7-n;break;case"bottom":i=7-t;break;case"top":i=t-7}switch(e){case"top-right":case"bottom-right":r=-n;break;case"top-left":case"bottom-left":r=n;break;case"left":r=t;break;case"right":r=-t}return[r,i]}function i(e,t,r){let i=0,n=0;switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":n=r-7;break;case"bottom-right":case"bottom-left":case"bottom":n=7-r}switch(e){case"top-right":case"bottom-right":case"right":i=-t;break;case"top-left":case"bottom-left":case"left":i=t}return[i,n]}return l(r,"fromRadialOffset"),l(i,"fromTextOffset"),t[1]!==Vy?i(e,t[0],t[1]):r(e,t[0])}function Fy(e){e.bucket.createArrays();let t=512*e.bucket.overscaling;e.bucket.tilePixelRatio=8192/t,e.bucket.compareText={},e.bucket.iconsNeedLinear=!1;let r=e.bucket.layers[0].layout,i=e.bucket.layers[0]._unevaluatedLayout._values,n={layoutIconSize:i["icon-size"].possiblyEvaluate(new Ja(e.bucket.zoom+1),e.canonical),layoutTextSize:i["text-size"].possiblyEvaluate(new Ja(e.bucket.zoom+1),e.canonical),textMaxSize:i["text-size"].possiblyEvaluate(new Ja(18))};if("composite"===e.bucket.textSizeData.kind){let{minZoom:t,maxZoom:r}=e.bucket.textSizeData;n.compositeTextSizes=[i["text-size"].possiblyEvaluate(new Ja(t),e.canonical),i["text-size"].possiblyEvaluate(new Ja(r),e.canonical)]}if("composite"===e.bucket.iconSizeData.kind){let{minZoom:t,maxZoom:r}=e.bucket.iconSizeData;n.compositeIconSizes=[i["icon-size"].possiblyEvaluate(new Ja(t),e.canonical),i["icon-size"].possiblyEvaluate(new Ja(r),e.canonical)]}let a=r.get("text-line-height")*bd,s="viewport"!==r.get("text-rotation-alignment")&&"point"!==r.get("symbol-placement"),o=r.get("text-keep-upright"),u=r.get("text-size");for(let t of e.bucket.features){let i=r.get("text-font").evaluate(t,{},e.canonical).join(","),c=u.evaluate(t,{},e.canonical),h=n.layoutTextSize.evaluate(t,{},e.canonical),p=n.layoutIconSize.evaluate(t,{},e.canonical),d={horizontal:{},vertical:void 0},f=t.text,y=[0,0];if(f){let n=f.toString(),u=r.get("text-letter-spacing").evaluate(t,{},e.canonical)*bd,p=Ma(n)?u:0,m=r.get("text-anchor").evaluate(t,{},e.canonical),g=r.get("text-variable-anchor");if(!g){let i=r.get("text-radial-offset").evaluate(t,{},e.canonical);y=i?Ey(m,[i*bd,Vy]):r.get("text-offset").evaluate(t,{},e.canonical).map((e=>e*bd))}let x=s?"center":r.get("text-justify").evaluate(t,{},e.canonical),v=r.get("symbol-placement"),b="point"===v?r.get("text-max-width").evaluate(t,{},e.canonical)*bd:0,w=l((()=>{e.bucket.allowVerticalPlacement&&Ia(n)&&(d.vertical=Td(f,e.glyphMap,e.glyphPositions,e.imagePositions,i,b,a,m,"left",p,y,2,!0,v,h,c))}),"addVerticalShapingForPointLabelIfNeeded");if(!s&&g){let t="auto"===x?g.map((e=>Ty(e))):[x],r=!1;for(let n=0;n<t.length;n++){let s=t[n];if(!d.horizontal[s])if(r)d.horizontal[s]=d.horizontal[0];else{let t=Td(f,e.glyphMap,e.glyphPositions,e.imagePositions,i,b,a,"center",s,p,y,1,!1,v,h,c);t&&(d.horizontal[s]=t,r=1===t.positionedLines.length)}}w()}else{"auto"===x&&(x=Ty(m));let t=Td(f,e.glyphMap,e.glyphPositions,e.imagePositions,i,b,a,m,x,p,y,1,!1,v,h,c);t&&(d.horizontal[x]=t),w(),Ia(n)&&s&&o&&(d.vertical=Td(f,e.glyphMap,e.glyphPositions,e.imagePositions,i,b,a,m,x,p,y,2,!1,v,h,c))}}let m,g=!1;if(t.icon&&t.icon.name){let i=e.imageMap[t.icon.name];i&&(m=Yd(e.imagePositions[t.icon.name],r.get("icon-offset").evaluate(t,{},e.canonical),r.get("icon-anchor").evaluate(t,{},e.canonical)),g=!!i.sdf,void 0===e.bucket.sdfIcons?e.bucket.sdfIcons=g:e.bucket.sdfIcons!==g&&q("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(i.pixelRatio!==e.bucket.pixelRatio||0!==r.get("icon-rotate").constantOr(1))&&(e.bucket.iconsNeedLinear=!0))}let x=Oy(d.horizontal)||d.vertical;e.bucket.iconsInText=!!x&&x.iconsInText,(x||m)&&Ly(e.bucket,t,d,m,e.imageMap,n,h,p,y,g,e.canonical)}e.showCollisionBoxes&&e.bucket.generateCollisionDebugBuffers()}function Ty(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Ly(e,t,r,i,n,a,s,o,u,c,h){let p=a.textMaxSize.evaluate(t,{});void 0===p&&(p=s);let d,f=e.layers[0].layout,y=f.get("icon-offset").evaluate(t,{},h),m=Oy(r.horizontal),g=s/24,x=e.tilePixelRatio*g,v=e.tilePixelRatio*p/24,b=e.tilePixelRatio*o,w=e.tilePixelRatio*f.get("symbol-spacing"),_=f.get("text-padding")*e.tilePixelRatio,S=kf(f,t,h,e.tilePixelRatio),A=f.get("text-max-angle")/180*Math.PI,k="viewport"!==f.get("text-rotation-alignment")&&"point"!==f.get("symbol-placement"),I="map"===f.get("icon-rotation-alignment")&&"point"!==f.get("symbol-placement"),M=f.get("symbol-placement"),P=w/2,C=f.get("icon-text-fit");i&&"none"!==C&&(e.allowVerticalPlacement&&r.vertical&&(d=Hd(i,r.vertical,C,f.get("icon-text-fit-padding"),y,g)),m&&(i=Hd(i,m,C,f.get("icon-text-fit-padding"),y,g)));let z=l(((o,l)=>{l.x<0||l.x>=8192||l.y<0||l.y>=8192||Ry(e,l,o,r,i,n,d,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,x,[_,_,_,_],k,u,b,S,I,y,t,a,c,h,s)}),"addSymbolAtAnchor");if("line"===M)for(let n of hy(t.geometry,0,0,8192,8192)){let t=ly(n,w,A,r.vertical||m,i,24,v,e.overscaling,8192);for(let r of t){(!m||!qy(e,m.text,P,r))&&z(n,r)}}else if("line-center"===M){for(let e of t.geometry)if(e.length>1){let t=oy(e,A,r.vertical||m,i,24,v);t&&z(e,t)}}else if("Polygon"===t.type)for(let e of ip(t.geometry,0)){let t=Iy(e,16);z(e[0],new ry(t.x,t.y,0))}else if("LineString"===t.type)for(let e of t.geometry)z(e,new ry(e[0].x,e[0].y,0));else if("Point"===t.type)for(let e of t.geometry)for(let t of e)z([t],new ry(t.x,t.y,0))}function Dy(e,t,r,i,n,a,s,o,l,u,c,h,p,d,f){let y=xy(0,r,o,n,a,s,i,e.allowVerticalPlacement),m=e.textSizeData,g=null;"source"===m.kind?(g=[Qd*n.layout.get("text-size").evaluate(s,{})],g[0]>ef&&q("".concat(e.layerIds[0],': Value for "text-size" is >= ').concat($d,'. Reduce your "text-size".'))):"composite"===m.kind&&(g=[Qd*d.compositeTextSizes[0].evaluate(s,{},f),Qd*d.compositeTextSizes[1].evaluate(s,{},f)],(g[0]>ef||g[1]>ef)&&q("".concat(e.layerIds[0],': Value for "text-size" is >= ').concat($d,'. Reduce your "text-size".'))),e.addSymbols(e.text,y,g,o,a,s,u,t,l.lineStartIndex,l.lineLength,p,f);for(let t of c)h[t]=e.text.placedSymbolArray.length-1;return 4*y.length}function Oy(e){for(let t in e)return e[t];return null}function Ry(e,t,r,i,n,a,s,o,u,c,h,p,d,f,y,m,g,x,v,b,w,_,S,A,k){let I,M,P,C,z=e.addToLineVertexArray(t,r),B=0,V=0,E=0,F=0,T=-1,L=-1,D={},O=(0,By.default)(""),R=0,U=0;if(void 0===o._unevaluatedLayout.getValue("text-radial-offset")?[R,U]=o.layout.get("text-offset").evaluate(w,{},A).map((e=>e*bd)):(R=o.layout.get("text-radial-offset").evaluate(w,{},A)*bd,U=Vy),e.allowVerticalPlacement&&i.vertical){let e=o.layout.get("text-rotate").evaluate(w,{},A)+90,r=i.vertical;P=new wy(u,t,c,h,p,r,d,f,y,e),s&&(C=new wy(u,t,c,h,p,s,g,x,y,e))}if(n){let r=o.layout.get("icon-rotate").evaluate(w,{}),i="none"!==o.layout.get("icon-text-fit"),a=dy(n,r,S,i),l=s?dy(s,r,S,i):void 0;M=new wy(u,t,c,h,p,n,g,x,!1,r),B=4*a.length;let d=e.iconSizeData,f=null;"source"===d.kind?(f=[Qd*o.layout.get("icon-size").evaluate(w,{})],f[0]>ef&&q("".concat(e.layerIds[0],': Value for "icon-size" is >= ').concat($d,'. Reduce your "icon-size".'))):"composite"===d.kind&&(f=[Qd*_.compositeIconSizes[0].evaluate(w,{},A),Qd*_.compositeIconSizes[1].evaluate(w,{},A)],(f[0]>ef||f[1]>ef)&&q("".concat(e.layerIds[0],': Value for "icon-size" is >= ').concat($d,'. Reduce your "icon-size".'))),e.addSymbols(e.icon,a,f,b,v,w,0,t,z.lineStartIndex,z.lineLength,-1,A),T=e.icon.placedSymbolArray.length-1,l&&(V=4*l.length,e.addSymbols(e.icon,l,f,b,v,w,2,t,z.lineStartIndex,z.lineLength,-1,A),L=e.icon.placedSymbolArray.length-1)}let j=Object.keys(i.horizontal);for(let r of j){let n=i.horizontal[r];if(!I){O=(0,By.default)(n.text);let e=o.layout.get("text-rotate").evaluate(w,{},A);I=new wy(u,t,c,h,p,n,d,f,y,e)}let s=1===n.positionedLines.length;if(E+=Dy(e,t,n,a,o,y,w,m,z,i.vertical?1:3,s?j:[r],D,T,_,A),s)break}i.vertical&&(F+=Dy(e,t,i.vertical,a,o,y,w,m,z,2,["vertical"],D,L,_,A));let N=I?I.boxStartIndex:e.collisionBoxArray.length,Z=I?I.boxEndIndex:e.collisionBoxArray.length,J=P?P.boxStartIndex:e.collisionBoxArray.length,G=P?P.boxEndIndex:e.collisionBoxArray.length,K=M?M.boxStartIndex:e.collisionBoxArray.length,X=M?M.boxEndIndex:e.collisionBoxArray.length,Y=C?C.boxStartIndex:e.collisionBoxArray.length,H=C?C.boxEndIndex:e.collisionBoxArray.length,W=-1,$=l(((e,t)=>e&&e.circleDiameter?Math.max(e.circleDiameter,t):t),"getCollisionCircleHeight");W=$(I,W),W=$(P,W),W=$(M,W),W=$(C,W);let Q=W>-1?1:0;Q&&(W*=k/bd),e.glyphOffsetArray.length>=ff.MAX_GLYPHS&&q("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==w.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,w.sortKey),e.symbolInstances.emplaceBack(t.x,t.y,D.right>=0?D.right:-1,D.center>=0?D.center:-1,D.left>=0?D.left:-1,D.vertical||-1,T,L,O,N,Z,J,G,K,X,Y,H,c,E,F,B,V,Q,0,d,R,U,W)}function qy(e,t,r,i){let n=e.compareText;if(t in n){let e=n[t];for(let t=e.length-1;t>=0;t--)if(i.dist(e[t])<r)return!0}else n[t]=[];return n[t].push(i),!1}l(Ey,"evaluateVariableOffset"),l(Fy,"performSymbolLayout"),l(Ty,"getAnchorJustification"),l(Ly,"addFeature"),l(Dy,"addTextVertices"),l(Oy,"getDefaultHorizontalShaping"),l(Ry,"addSymbol"),l(qy,"anchorIsTooClose"),p();var Uy=class{constructor(e){let t={},r=[];for(let i in e){let n=e[i],a=t[i]={};for(let e in n){let t=n[+e];if(!t||0===t.bitmap.width||0===t.bitmap.height)continue;let i={x:0,y:0,w:t.bitmap.width+2,h:t.bitmap.height+2};r.push(i),a[e]={rect:i,metrics:t.metrics}}}let{w:i,h:n}=wd(r),a=new Dh({width:i||1,height:n||1});for(let r in e){let i=e[r];for(let e in i){let n=i[+e];if(!n||0===n.bitmap.width||0===n.bitmap.height)continue;let s=t[r][e].rect;Dh.copy(n.bitmap,a,{x:0,y:0},{x:s.x+1,y:s.y+1},n.bitmap)}}this.image=a,this.positions=t}};l(Uy,"GlyphAtlas");var jy=Uy;function Ny(e,t,r){var i=Zy(256*e,256*(t=Math.pow(2,r)-t-1),r),n=Zy(256*(e+1),256*(t+1),r);return i[0]+","+i[1]+","+n[0]+","+n[1]}function Zy(e,t,r){var i=2*Math.PI*6378137/256/Math.pow(2,r);return[e*i-2*Math.PI*6378137/2,t*i-2*Math.PI*6378137/2]}ia("GlyphAtlas",jy),p(),p(),l(Ny,"getTileBBox"),l(Zy,"getMercCoords");var Jy=h(d(),1);p(),p();var Gy=6371008.8,Ky=class e{constructor(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: (".concat(e,", ").concat(t,")"));if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new e(V(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return"LngLat(".concat(this.lng,", ").concat(this.lat,")")}distanceTo(e){let t=Math.PI/180,r=this.lat*t,i=e.lat*t,n=Math.sin(r)*Math.sin(i)+Math.cos(r)*Math.cos(i)*Math.cos((e.lng-this.lng)*t);return Gy*Math.acos(Math.min(n,1))}static convert(t){if(t instanceof e)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new e(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new e(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>]")}};l(Ky,"LngLat");var Xy=Ky,Yy=2*Math.PI*Gy;function Hy(e){return Yy*Math.cos(e*Math.PI/180)}function Wy(e){return(180+e)/360}function $y(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Qy(e,t){return e/Hy(t)}function em(e){return 360*e-180}function tm(e){let t=180-360*e;return 360/Math.PI*Math.atan(Math.exp(t*Math.PI/180))-90}function rm(e,t){return e*Hy(tm(t))}function im(e){return 1/Math.cos(e*Math.PI/180)}l(Hy,"circumferenceAtLatitude"),l(Wy,"mercatorXfromLng"),l($y,"mercatorYfromLat"),l(Qy,"mercatorZfromAltitude"),l(em,"lngFromMercatorX"),l(tm,"latFromMercatorY"),l(rm,"altitudeFromMercatorZ"),l(im,"mercatorScale");var nm=class e{constructor(e,t,r=0){this.x=+e,this.y=+t,this.z=+r}static fromLngLat(t,r=0){let i=Xy.convert(t);return new e(Wy(i.lng),$y(i.lat),Qy(r,i.lat))}toLngLat(){return new Xy(em(this.x),tm(this.y))}toAltitude(){return rm(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/Yy*im(tm(this.y))}};l(nm,"MercatorCoordinate");var am=nm,sm=class{constructor(e,t,r){if(e<0||e>25||r<0||r>=Math.pow(2,e)||t<0||t>=Math.pow(2,e))throw new Error("x=".concat(t,", y=").concat(r,", z=").concat(e," outside of bounds. 0<=x<").concat(Math.pow(2,e),", 0<=y<").concat(Math.pow(2,e)," 0<=z<=25 "));this.z=e,this.x=t,this.y=r,this.key=pm(0,e,e,t,r)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t,r){let i=Ny(this.x,this.y,this.z),n=dm(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===r?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,t>1?"@2x":"").replace(/{quadkey}/g,n).replace(/{bbox-epsg-3857}/g,i)}isChildOf(e){let t=this.z-e.z;return t>0&&e.x===this.x>>t&&e.y===this.y>>t}getTilePoint(e){let t=Math.pow(2,this.z);return new Jy.default(8192*(e.x*t-this.x),8192*(e.y*t-this.y))}toString(){return"".concat(this.z,"/").concat(this.x,"/").concat(this.y)}};l(sm,"CanonicalTileID");var om=sm,lm=class{constructor(e,t){this.wrap=e,this.canonical=t,this.key=pm(e,t.z,t.z,t.x,t.y)}};l(lm,"UnwrappedTileID");var um=lm,cm=class e{constructor(e,t,r,i,n){if(e<r)throw new Error("overscaledZ should be >= z; overscaledZ = ".concat(e,"; z = ").concat(r));this.overscaledZ=e,this.wrap=t,this.canonical=new om(r,+i,+n),this.key=pm(t,e,r,i,n)}clone(){return new e(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error("targetZ > this.overscaledZ; targetZ = ".concat(t,"; overscaledZ = ").concat(this.overscaledZ));let r=this.canonical.z-t;return t>this.canonical.z?new e(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new e(t,this.wrap,t,this.canonical.x>>r,this.canonical.y>>r)}calculateScaledKey(e,t){if(e>this.overscaledZ)throw new Error("targetZ > this.overscaledZ; targetZ = ".concat(e,"; overscaledZ = ").concat(this.overscaledZ));let r=this.canonical.z-e;return e>this.canonical.z?pm(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):pm(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)}isChildOf(e){if(e.wrap!==this.wrap)return!1;let t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(t){if(this.overscaledZ>=t)return[new e(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let r=this.canonical.z+1,i=2*this.canonical.x,n=2*this.canonical.y;return[new e(r,this.wrap,r,i,n),new e(r,this.wrap,r,i+1,n),new e(r,this.wrap,r,i,n+1),new e(r,this.wrap,r,i+1,n+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new e(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new e(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new um(this.wrap,this.canonical)}toString(){return"".concat(this.overscaledZ,"/").concat(this.canonical.x,"/").concat(this.canonical.y)}getTilePoint(e){return this.canonical.getTilePoint(new am(e.x-this.wrap,e.y))}};l(cm,"OverscaledTileID");var hm=cm;function pm(e,t,r,i,n){(e*=2)<0&&(e=-1*e-1);let a=1<<r;return(a*a*e+a*n+i).toString(36)+r.toString(36)+t.toString(36)}function dm(e,t,r){let i,n="";for(let a=e;a>0;a--)i=1<<a-1,n+=(t&i?1:0)+(r&i?2:0);return n}l(pm,"calculateKey"),l(dm,"getQuadkey"),ia("CanonicalTileID",om),ia("OverscaledTileID",hm,{omit:["posMatrix"]});var fm=class{constructor(e){this.tileID=new hm(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.inFlightDependencies=[],this.dependencySentinel=-1}parse(e,t,r,i,n){this.status="parsing",this.data=e,this.collisionBoxArray=new Io;let a=new Zf(Object.keys(e.layers).sort()),s=new Hf(this.tileID,this.promoteId);s.bucketLayerIDs=[];let o={},u={featureIndex:s,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:r},c=t.familiesBySource[this.source];for(let t in c){let i=e.layers[t];if(!i)continue;1===i.version&&q('Vector tile source "'.concat(this.source,'" layer "').concat(t,'" ')+"does not use vector tile spec v2 and therefore may have some rendering errors.");let n=a.encode(t),l=[];for(let e=0;e<i.length;e++){let r=i.feature(e),a=s.getId(r,t);l.push({feature:r,id:a,index:e,sourceLayerIndex:n})}for(let e of c[t]){let t=e[0];(t.source!==this.source&&q("layer.source = ".concat(t.source," does not equal this.source = ").concat(this.source)),t.minzoom&&this.zoom<Math.floor(t.minzoom)||t.maxzoom&&this.zoom>=t.maxzoom||"none"===t.visibility)||(mm(e,this.zoom,r),(o[t.id]=t.createBucket({index:s.bucketLayerIDs.length,layers:e,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:n,sourceID:this.source})).populate(l,u,this.tileID.canonical),s.bucketLayerIDs.push(e.map((e=>e.id))))}}let h,p,d,f,y=T(u.glyphDependencies,(e=>Object.keys(e).map(Number)));this.inFlightDependencies.forEach((e=>null==e?void 0:e.cancel())),this.inFlightDependencies=[];let m=++this.dependencySentinel;Object.keys(y).length?this.inFlightDependencies.push(i.send("getGlyphs",{uid:this.uid,stacks:y,source:this.source,tileID:this.tileID,type:"glyphs"},((e,t)=>{m===this.dependencySentinel&&(h||(h=e,p=t,v.call(this)))}))):p={};let g=Object.keys(u.iconDependencies);g.length?this.inFlightDependencies.push(i.send("getImages",{icons:g,source:this.source,tileID:this.tileID,type:"icons"},((e,t)=>{m===this.dependencySentinel&&(h||(h=e,d=t,v.call(this)))}))):d={};let x=Object.keys(u.patternDependencies);function v(){if(h)return n(h);if(p&&d&&f){let e=new jy(p),t=new kd(d,f);for(let i in o){let n=o[i];n instanceof ff?(mm(n.layers,this.zoom,r),Fy({bucket:n,glyphMap:p,glyphPositions:e.positions,imageMap:d,imagePositions:t.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):n.hasPattern&&(n instanceof $p||n instanceof lp||n instanceof Ip)&&(mm(n.layers,this.zoom,r),n.addFeatures(u,this.tileID.canonical,t.patternPositions))}this.status="done",n(null,{buckets:Object.values(o).filter((e=>!e.isEmpty())),featureIndex:s,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:t,glyphMap:this.returnDependencies?p:null,iconMap:this.returnDependencies?d:null,glyphPositions:this.returnDependencies?e.positions:null})}}x.length?this.inFlightDependencies.push(i.send("getImages",{icons:x,source:this.source,tileID:this.tileID,type:"patterns"},((e,t)=>{m===this.dependencySentinel&&(h||(h=e,f=t,v.call(this)))}))):f={},v.call(this),l(v,"maybePrepare")}};l(fm,"WorkerTile");var ym=fm;function mm(e,t,r){let i=new Ja(t);for(let t of e)t.recalculate(i,r)}l(mm,"recalculateLayers"),p();var gm=class{constructor(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let e=performance.getEntriesByName(this._marks.measure);return 0===e.length&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),e=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),e}};l(gm,"RequestPerformance");var xm=gm;function vm(e,t){let r=ta(e.request,((e,r,i,n)=>{e?t(e):r&&t(null,{vectorTile:new Uf.default.VectorTile(new jf.default(r)),rawData:r,cacheControl:i,expires:n})}));return()=>{r.cancel(),t()}}l(vm,"loadVectorTile");var bm=class{constructor(e,t,r,i){this.actor=e,this.layerIndex=t,this.availableImages=r,this.loadVectorData=i||vm,this.loading={},this.loaded={}}loadTile(e,t){let r=e.uid;this.loading||(this.loading={});let i=!!(e&&e.request&&e.request.collectResourceTiming)&&new xm(e.request),n=this.loading[r]=new ym(e);n.abort=this.loadVectorData(e,((e,a)=>{if(delete this.loading[r],e||!a)return n.status="done",this.loaded[r]=n,t(e);let s=a.rawData,o={};a.expires&&(o.expires=a.expires),a.cacheControl&&(o.cacheControl=a.cacheControl);let l={};if(i){let e=i.finish();e&&(l.resourceTiming=JSON.parse(JSON.stringify(e)))}n.vectorTile=a.vectorTile,n.parse(a.vectorTile,this.layerIndex,this.availableImages,this.actor,((e,r)=>{if(e||!r)return t(e);t(null,E({rawTileData:s.slice(0)},r,o,l))})),this.loaded=this.loaded||{},this.loaded[r]=n}))}reloadTile(e,t){let r=this.loaded,i=e.uid;if(r&&r[i]){let n=r[i];n.showCollisionBoxes=e.showCollisionBoxes,"parsing"===n.status?n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor,t):"done"===n.status&&(n.vectorTile?n.parse(n.vectorTile,this.layerIndex,this.availableImages,this.actor,t):t())}}abortTile(e,t){let r=this.loading,i=e.uid;r&&r[i]&&r[i].abort&&(r[i].abort(),delete r[i]),t()}removeTile(e,t){let r=this.loaded,i=e.uid;r&&r[i]&&delete r[i],t()}};l(bm,"VectorTileWorkerSource");var wm=bm;p(),p();var _m=class{constructor(e,t,r){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return void q('"'.concat(r,'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".'));this.stride=t.height;let i=this.dim=t.height-2;this.data=new Uint32Array(t.data.buffer),this.encoding=r||"mapbox";for(let e=0;e<i;e++)this.data[this._idx(-1,e)]=this.data[this._idx(0,e)],this.data[this._idx(i,e)]=this.data[this._idx(i-1,e)],this.data[this._idx(e,-1)]=this.data[this._idx(e,0)],this.data[this._idx(e,i)]=this.data[this._idx(e,i-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(i,-1)]=this.data[this._idx(i-1,0)],this.data[this._idx(-1,i)]=this.data[this._idx(0,i-1)],this.data[this._idx(i,i)]=this.data[this._idx(i-1,i-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let e=0;e<i;e++)for(let t=0;t<i;t++){let r=this.get(e,t);r>this.max&&(this.max=r),r<this.min&&(this.min=r)}}get(e,t){let r=new Uint8Array(this.data.buffer),i=4*this._idx(e,t);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(r[i],r[i+1],r[i+2])}getUnpackVector(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]}_idx(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}_unpackMapbox(e,t,r){return(256*e*256+256*t+r)/10-1e4}_unpackTerrarium(e,t,r){return 256*e+t+r/256-32768}getPixels(){return new Rh({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let i=t*this.dim,n=t*this.dim+this.dim,a=r*this.dim,s=r*this.dim+this.dim;switch(t){case-1:i=n-1;break;case 1:n=i+1}switch(r){case-1:a=s-1;break;case 1:s=a+1}let o=-t*this.dim,l=-r*this.dim;for(let t=a;t<s;t++)for(let r=i;r<n;r++)this.data[this._idx(r,t)]=e.data[this._idx(r+o,t+l)]}};l(_m,"DEMData");var Sm=_m;ia("DEMData",Sm);var Am=class{constructor(){this.loaded={}}loadTile(e,t){let{uid:r,encoding:i,rawImageData:n}=e,a=G(n)?this.getImageData(n):n,s=new Sm(r,a,i);this.loaded=this.loaded||{},this.loaded[r]=s,t(null,s)}getImageData(e){(!this.offscreenCanvas||!this.offscreenCanvasContext)&&(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);let t=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new Rh({width:t.width,height:t.height},t.data)}removeTile(e){let t=this.loaded,r=e.uid;t&&t[r]&&delete t[r]}};l(Am,"RasterDEMTileWorkerSource");var km=Am;p();var Im=h(k(),1);p();var Mm=h(d(),1),Pm=h(_(),1).default.VectorTileFeature.prototype.toGeoJSON,Cm=class{constructor(e){this._feature=e,this.extent=8192,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))}loadGeometry(){if(1===this._feature.type){let e=[];for(let t of this._feature.geometry)e.push([new Mm.default(t[0],t[1])]);return e}{let e=[];for(let t of this._feature.geometry){let r=[];for(let e of t)r.push(new Mm.default(e[0],e[1]));e.push(r)}return e}}toGeoJSON(e,t,r){return Pm.call(this,e,t,r)}};l(Cm,"FeatureWrapper");var zm=Cm,Bm=class{constructor(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=8192,this.length=e.length,this._features=e}feature(e){return new zm(this._features[e])}};l(Bm,"GeoJSONWrapper");var Vm=Bm,Em=h(M(),1);p(),p();var Fm=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Tm=class e{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[r,i]=new Uint8Array(t,0,2);if(219!==r)throw new Error("Data does not appear to be in a KDBush format.");let n=i>>4;if(1!==n)throw new Error("Got v".concat(n," data when expected v").concat(1,"."));let a=Fm[15&i];if(!a)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[o]=new Uint32Array(t,4,1);return new e(o,s,a,t)}constructor(e,t=64,r=Float64Array,i){if(isNaN(e)||e<0)throw new Error("Unpexpected numItems value: ".concat(e,"."));this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let n=Fm.indexOf(this.ArrayType),a=2*e*this.ArrayType.BYTES_PER_ELEMENT,s=e*this.IndexArrayType.BYTES_PER_ELEMENT,o=(8-s%8)%8;if(n<0)throw new Error("Unexpected typed array class: ".concat(r,"."));i&&i instanceof ArrayBuffer?(this.data=i,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+s+o,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+a+s+o),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+s+o,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+n]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){let r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){let e=this._pos>>1;if(e!==this.numItems)throw new Error("Added ".concat(e," items when expected ").concat(this.numItems,"."));return Dm(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,r,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:n,coords:a,nodeSize:s}=this,o=[0,n.length-1,0],l=[];for(;o.length;){let u=o.pop()||0,c=o.pop()||0,h=o.pop()||0;if(c-h<=s){for(let s=h;s<=c;s++){let o=a[2*s],u=a[2*s+1];o>=e&&o<=r&&u>=t&&u<=i&&l.push(n[s])}continue}let p=h+c>>1,d=a[2*p],f=a[2*p+1];d>=e&&d<=r&&f>=t&&f<=i&&l.push(n[p]),(0===u?e<=d:t<=f)&&(o.push(h),o.push(p-1),o.push(1-u)),(0===u?r>=d:i>=f)&&(o.push(p+1),o.push(c),o.push(1-u))}return l}within(e,t,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:i,coords:n,nodeSize:a}=this,s=[0,i.length-1,0],o=[],l=r*r;for(;s.length;){let u=s.pop()||0,c=s.pop()||0,h=s.pop()||0;if(c-h<=a){for(let r=h;r<=c;r++)Um(n[2*r],n[2*r+1],e,t)<=l&&o.push(i[r]);continue}let p=h+c>>1,d=n[2*p],f=n[2*p+1];Um(d,f,e,t)<=l&&o.push(i[p]),(0===u?e-r<=d:t-r<=f)&&(s.push(h),s.push(p-1),s.push(1-u)),(0===u?e+r>=d:t+r>=f)&&(s.push(p+1),s.push(c),s.push(1-u))}return o}};l(Tm,"KDBush");var Lm=Tm;function Dm(e,t,r,i,n,a){if(n-i<=r)return;let s=i+n>>1;Om(e,t,s,i,n,a),Dm(e,t,r,i,s-1,1-a),Dm(e,t,r,s+1,n,1-a)}function Om(e,t,r,i,n,a){for(;n>i;){if(n-i>600){let s=n-i+1,o=r-i+1,l=Math.log(s),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(s-u)/s)*(o-s/2<0?-1:1);Om(e,t,r,Math.max(i,Math.floor(r-o*u/s+c)),Math.min(n,Math.floor(r+(s-o)*u/s+c)),a)}let s=t[2*r+a],o=i,l=n;for(Rm(e,t,i,r),t[2*n+a]>s&&Rm(e,t,i,n);o<l;){for(Rm(e,t,o,l),o++,l--;t[2*o+a]<s;)o++;for(;t[2*l+a]>s;)l--}t[2*i+a]===s?Rm(e,t,i,l):(l++,Rm(e,t,l,n)),l<=r&&(i=l+1),r<=l&&(n=l-1)}}function Rm(e,t,r,i){qm(e,r,i),qm(t,2*r,2*i),qm(t,2*r+1,2*i+1)}function qm(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}function Um(e,t,r,i){let n=e-r,a=t-i;return n*n+a*a}l(Dm,"sort"),l(Om,"select"),l(Rm,"swapItem"),l(qm,"swap"),l(Um,"sqDist");var jm={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:l((e=>e),"map")},Nm=Math.fround||(e=>t=>(e[0]=+t,e[0]))(new Float32Array(1)),Zm=class{constructor(e){this.options=Object.assign(Object.create(jm),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){let{log:t,minZoom:r,maxZoom:i}=this.options;t&&console.time("total time");let n="prepare ".concat(e.length," points");t&&console.time(n),this.points=e;let a=[];for(let t=0;t<e.length;t++){let r=e[t];if(!r.geometry)continue;let[i,n]=r.geometry.coordinates,s=Nm(Xm(i)),o=Nm(Ym(n));a.push(s,o,1/0,t,-1,1),this.options.reduce&&a.push(0)}let s=this.trees[i+1]=this._createTree(a);t&&console.timeEnd(n);for(let e=i;e>=r;e--){let r=+Date.now();s=this.trees[e]=this._createTree(this._cluster(s,e)),t&&console.log("z%d: %d clusters in %dms",e,s.numItems,+Date.now()-r)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let r=((e[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,e[1])),n=180===e[2]?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,n=180;else if(r>n){let e=this.getClusters([r,i,180,a],t),s=this.getClusters([-180,i,n,a],t);return e.concat(s)}let s=this.trees[this._limitZoom(t)],o=s.range(Xm(r),Ym(a),Xm(n),Ym(i)),l=s.data,u=[];for(let e of o){let t=this.stride*e;u.push(l[t+5]>1?Gm(l,t,this.clusterProps):this.points[l[t+3]])}return u}getChildren(e){let t=this._getOriginId(e),r=this._getOriginZoom(e),i="No cluster with the specified id.",n=this.trees[r];if(!n)throw new Error(i);let a=n.data;if(t*this.stride>=a.length)throw new Error(i);let s=this.options.radius/(this.options.extent*Math.pow(2,r-1)),o=a[t*this.stride],l=a[t*this.stride+1],u=n.within(o,l,s),c=[];for(let t of u){let r=t*this.stride;a[r+4]===e&&c.push(a[r+5]>1?Gm(a,r,this.clusterProps):this.points[a[r+3]])}if(0===c.length)throw new Error(i);return c}getLeaves(e,t,r){t=t||10,r=r||0;let i=[];return this._appendLeaves(i,e,t,r,0),i}getTile(e,t,r){let i=this.trees[this._limitZoom(e)],n=Math.pow(2,e),{extent:a,radius:s}=this.options,o=s/a,l=(r-o)/n,u=(r+1+o)/n,c={features:[]};return this._addTileFeatures(i.range((t-o)/n,l,(t+1+o)/n,u),i.data,t,r,n,c),0===t&&this._addTileFeatures(i.range(1-o/n,l,1,u),i.data,n,r,n,c),t===n-1&&this._addTileFeatures(i.range(0,l,o/n,u),i.data,-1,r,n,c),c.features.length?c:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){let r=this.getChildren(e);if(t++,1!==r.length)break;e=r[0].properties.cluster_id}return t}_appendLeaves(e,t,r,i,n){let a=this.getChildren(t);for(let t of a){let a=t.properties;if(a&&a.cluster?n+a.point_count<=i?n+=a.point_count:n=this._appendLeaves(e,a.cluster_id,r,i,n):n<i?n++:e.push(t),e.length===r)break}return n}_createTree(e){let t=new Lm(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let r=0;r<e.length;r+=this.stride)t.add(e[r],e[r+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,r,i,n,a){for(let s of e){let e,o,l,u=s*this.stride,c=t[u+5]>1;if(c)e=Km(t,u,this.clusterProps),o=t[u],l=t[u+1];else{let r=this.points[t[u+3]];e=r.properties;let[i,n]=r.geometry.coordinates;o=Xm(i),l=Ym(n)}let h,p={type:1,geometry:[[Math.round(this.options.extent*(o*n-r)),Math.round(this.options.extent*(l*n-i))]],tags:e};h=c||this.options.generateId?t[u+3]:this.points[t[u+3]].id,void 0!==h&&(p.id=h),a.features.push(p)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){let{radius:r,extent:i,reduce:n,minPoints:a}=this.options,s=r/(i*Math.pow(2,t)),o=e.data,l=[],u=this.stride;for(let r=0;r<o.length;r+=u){if(o[r+2]<=t)continue;o[r+2]=t;let i=o[r],c=o[r+1],h=e.within(o[r],o[r+1],s),p=o[r+5],d=p;for(let e of h){let r=e*u;o[r+2]>t&&(d+=o[r+5])}if(d>p&&d>=a){let e,a=i*p,s=c*p,f=-1,y=(r/u<<5)+(t+1)+this.points.length;for(let i of h){let l=i*u;if(o[l+2]<=t)continue;o[l+2]=t;let c=o[l+5];a+=o[l]*c,s+=o[l+1]*c,o[l+4]=y,n&&(e||(e=this._map(o,r,!0),f=this.clusterProps.length,this.clusterProps.push(e)),n(e,this._map(o,l)))}o[r+4]=y,l.push(a/d,s/d,1/0,y,-1,d),n&&l.push(f)}else{for(let e=0;e<u;e++)l.push(o[r+e]);if(d>1)for(let e of h){let r=e*u;if(!(o[r+2]<=t)){o[r+2]=t;for(let e=0;e<u;e++)l.push(o[r+e])}}}}return l}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+5]>1){let i=this.clusterProps[e[t+6]];return r?Object.assign({},i):i}let i=this.points[e[t+3]].properties,n=this.options.map(i);return r&&n===i?Object.assign({},n):n}};l(Zm,"Supercluster");var Jm=Zm;function Gm(e,t,r){return{type:"Feature",id:e[t+3],properties:Km(e,t,r),geometry:{type:"Point",coordinates:[Hm(e[t]),Wm(e[t+1])]}}}function Km(e,t,r){let i=e[t+5],n=i>=1e4?"".concat(Math.round(i/1e3),"k"):i>=1e3?"".concat(Math.round(i/100)/10,"k"):i,a=e[t+6],s=-1===a?{}:Object.assign({},r[a]);return Object.assign(s,{cluster:!0,cluster_id:e[t+3],point_count:i,point_count_abbreviated:n})}function Xm(e){return e/360+.5}function Ym(e){let t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function Hm(e){return 360*(e-.5)}function Wm(e){let t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function $m(e,t,r,i){for(var n,a=i,s=r-t>>1,o=r-t,l=e[t],u=e[t+1],c=e[r],h=e[r+1],p=t+3;p<r;p+=3){var d=Qm(e[p],e[p+1],l,u,c,h);if(d>a)n=p,a=d;else if(d===a){var f=Math.abs(p-s);f<o&&(n=p,o=f)}}a>i&&(n-t>3&&$m(e,t,n,i),e[n+2]=a,r-n>3&&$m(e,n,r,i))}function Qm(e,t,r,i,n,a){var s=n-r,o=a-i;if(0!==s||0!==o){var l=((e-r)*s+(t-i)*o)/(s*s+o*o);l>1?(r=n,i=a):l>0&&(r+=s*l,i+=o*l)}return(s=e-r)*s+(o=t-i)*o}function eg(e,t,r,i){var n={id:typeof e>"u"?null:e,type:t,geometry:r,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return tg(n),n}function tg(e){var t=e.geometry,r=e.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)rg(e,t);else if("Polygon"===r||"MultiLineString"===r)for(var i=0;i<t.length;i++)rg(e,t[i]);else if("MultiPolygon"===r)for(i=0;i<t.length;i++)for(var n=0;n<t[i].length;n++)rg(e,t[i][n])}function rg(e,t){for(var r=0;r<t.length;r+=3)e.minX=Math.min(e.minX,t[r]),e.minY=Math.min(e.minY,t[r+1]),e.maxX=Math.max(e.maxX,t[r]),e.maxY=Math.max(e.maxY,t[r+1])}function ig(e,t){var r=[];if("FeatureCollection"===e.type)for(var i=0;i<e.features.length;i++)ng(r,e.features[i],t,i);else"Feature"===e.type?ng(r,e,t):ng(r,{geometry:e},t);return r}function ng(e,t,r,i){if(t.geometry){var n=t.geometry.coordinates,a=t.geometry.type,s=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),o=[],l=t.id;if(r.promoteId?l=t.properties[r.promoteId]:r.generateId&&(l=i||0),"Point"===a)ag(n,o);else if("MultiPoint"===a)for(var u=0;u<n.length;u++)ag(n[u],o);else if("LineString"===a)sg(n,o,s,!1);else if("MultiLineString"===a){if(r.lineMetrics){for(u=0;u<n.length;u++)o=[],sg(n[u],o,s,!1),e.push(eg(l,"LineString",o,t.properties));return}og(n,o,s,!1)}else if("Polygon"===a)og(n,o,s,!0);else{if("MultiPolygon"!==a){if("GeometryCollection"===a){for(u=0;u<t.geometry.geometries.length;u++)ng(e,{id:l,geometry:t.geometry.geometries[u],properties:t.properties},r,i);return}throw new Error("Input data is not a valid GeoJSON object.")}for(u=0;u<n.length;u++){var c=[];og(n[u],c,s,!0),o.push(c)}}e.push(eg(l,a,o,t.properties))}}function ag(e,t){t.push(lg(e[0])),t.push(ug(e[1])),t.push(0)}function sg(e,t,r,i){for(var n,a,s=0,o=0;o<e.length;o++){var l=lg(e[o][0]),u=ug(e[o][1]);t.push(l),t.push(u),t.push(0),o>0&&(s+=i?(n*u-l*a)/2:Math.sqrt(Math.pow(l-n,2)+Math.pow(u-a,2))),n=l,a=u}var c=t.length-3;t[2]=1,$m(t,0,c,r),t[c+2]=1,t.size=Math.abs(s),t.start=0,t.end=t.size}function og(e,t,r,i){for(var n=0;n<e.length;n++){var a=[];sg(e[n],a,r,i),t.push(a)}}function lg(e){return e/360+.5}function ug(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function cg(e,t,r,i,n,a,s,o){if(i/=t,a>=(r/=t)&&s<i)return e;if(s<r||a>=i)return null;for(var l=[],u=0;u<e.length;u++){var c=e[u],h=c.geometry,p=c.type,d=0===n?c.minX:c.minY,f=0===n?c.maxX:c.maxY;if(d>=r&&f<i)l.push(c);else if(!(f<r||d>=i)){var y=[];if("Point"===p||"MultiPoint"===p)hg(h,y,r,i,n);else if("LineString"===p)pg(h,y,r,i,n,!1,o.lineMetrics);else if("MultiLineString"===p)fg(h,y,r,i,n,!1);else if("Polygon"===p)fg(h,y,r,i,n,!0);else if("MultiPolygon"===p)for(var m=0;m<h.length;m++){var g=[];fg(h[m],g,r,i,n,!0),g.length&&y.push(g)}if(y.length){if(o.lineMetrics&&"LineString"===p){for(m=0;m<y.length;m++)l.push(eg(c.id,p,y[m],c.tags));continue}("LineString"===p||"MultiLineString"===p)&&(1===y.length?(p="LineString",y=y[0]):p="MultiLineString"),("Point"===p||"MultiPoint"===p)&&(p=3===y.length?"Point":"MultiPoint"),l.push(eg(c.id,p,y,c.tags))}}}return l.length?l:null}function hg(e,t,r,i,n){for(var a=0;a<e.length;a+=3){var s=e[a+n];s>=r&&s<=i&&(t.push(e[a]),t.push(e[a+1]),t.push(e[a+2]))}}function pg(e,t,r,i,n,a,s){for(var o,l,u=dg(e),c=0===n?mg:gg,h=e.start,p=0;p<e.length-3;p+=3){var d=e[p],f=e[p+1],y=e[p+2],m=e[p+3],g=e[p+4],x=0===n?d:f,v=0===n?m:g,b=!1;s&&(o=Math.sqrt(Math.pow(d-m,2)+Math.pow(f-g,2))),x<r?v>r&&(l=c(u,d,f,m,g,r),s&&(u.start=h+o*l)):x>i?v<i&&(l=c(u,d,f,m,g,i),s&&(u.start=h+o*l)):yg(u,d,f,y),v<r&&x>=r&&(l=c(u,d,f,m,g,r),b=!0),v>i&&x<=i&&(l=c(u,d,f,m,g,i),b=!0),!a&&b&&(s&&(u.end=h+o*l),t.push(u),u=dg(e)),s&&(h+=o)}var w=e.length-3;d=e[w],f=e[w+1],y=e[w+2],(x=0===n?d:f)>=r&&x<=i&&yg(u,d,f,y),w=u.length-3,a&&w>=3&&(u[w]!==u[0]||u[w+1]!==u[1])&&yg(u,u[0],u[1],u[2]),u.length&&t.push(u)}function dg(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function fg(e,t,r,i,n,a){for(var s=0;s<e.length;s++)pg(e[s],t,r,i,n,a,!1)}function yg(e,t,r,i){e.push(t),e.push(r),e.push(i)}function mg(e,t,r,i,n,a){var s=(a-t)/(i-t);return e.push(a),e.push(r+(n-r)*s),e.push(1),s}function gg(e,t,r,i,n,a){var s=(a-r)/(n-r);return e.push(t+(i-t)*s),e.push(a),e.push(1),s}function xg(e,t){var r=t.buffer/t.extent,i=e,n=cg(e,1,-1-r,r,0,-1,2,t),a=cg(e,1,1-r,2+r,0,-1,2,t);return(n||a)&&(i=cg(e,1,-r,1+r,0,-1,2,t)||[],n&&(i=vg(n,1).concat(i)),a&&(i=i.concat(vg(a,-1)))),i}function vg(e,t){for(var r=[],i=0;i<e.length;i++){var n,a=e[i],s=a.type;if("Point"===s||"MultiPoint"===s||"LineString"===s)n=bg(a.geometry,t);else if("MultiLineString"===s||"Polygon"===s){n=[];for(var o=0;o<a.geometry.length;o++)n.push(bg(a.geometry[o],t))}else if("MultiPolygon"===s)for(n=[],o=0;o<a.geometry.length;o++){for(var l=[],u=0;u<a.geometry[o].length;u++)l.push(bg(a.geometry[o][u],t));n.push(l)}r.push(eg(a.id,s,n,a.tags))}return r}function bg(e,t){var r=[];r.size=e.size,void 0!==e.start&&(r.start=e.start,r.end=e.end);for(var i=0;i<e.length;i+=3)r.push(e[i]+t,e[i+1],e[i+2]);return r}function wg(e,t){if(e.transformed)return e;var r,i,n,a=1<<e.z,s=e.x,o=e.y;for(r=0;r<e.features.length;r++){var l=e.features[r],u=l.geometry,c=l.type;if(l.geometry=[],1===c)for(i=0;i<u.length;i+=2)l.geometry.push(_g(u[i],u[i+1],t,a,s,o));else for(i=0;i<u.length;i++){var h=[];for(n=0;n<u[i].length;n+=2)h.push(_g(u[i][n],u[i][n+1],t,a,s,o));l.geometry.push(h)}}return e.transformed=!0,e}function _g(e,t,r,i,n,a){return[Math.round(r*(e*i-n)),Math.round(r*(t*i-a))]}function Sg(e,t,r,i,n){for(var a=t===n.maxZoom?0:n.tolerance/((1<<t)*n.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:i,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},o=0;o<e.length;o++){s.numFeatures++,Ag(s,e[o],a,n);var l=e[o].minX,u=e[o].minY,c=e[o].maxX,h=e[o].maxY;l<s.minX&&(s.minX=l),u<s.minY&&(s.minY=u),c>s.maxX&&(s.maxX=c),h>s.maxY&&(s.maxY=h)}return s}function Ag(e,t,r,i){var n=t.geometry,a=t.type,s=[];if("Point"===a||"MultiPoint"===a)for(var o=0;o<n.length;o+=3)s.push(n[o]),s.push(n[o+1]),e.numPoints++,e.numSimplified++;else if("LineString"===a)kg(s,n,e,r,!1,!1);else if("MultiLineString"===a||"Polygon"===a)for(o=0;o<n.length;o++)kg(s,n[o],e,r,"Polygon"===a,0===o);else if("MultiPolygon"===a)for(var l=0;l<n.length;l++){var u=n[l];for(o=0;o<u.length;o++)kg(s,u[o],e,r,!0,0===o)}if(s.length){var c=t.tags||null;if("LineString"===a&&i.lineMetrics){for(var h in c={},t.tags)c[h]=t.tags[h];c.mapbox_clip_start=n.start/n.size,c.mapbox_clip_end=n.end/n.size}var p={geometry:s,type:"Polygon"===a||"MultiPolygon"===a?3:"LineString"===a||"MultiLineString"===a?2:1,tags:c};null!==t.id&&(p.id=t.id),e.features.push(p)}}function kg(e,t,r,i,n,a){var s=i*i;if(i>0&&t.size<(n?s:i))r.numPoints+=t.length/3;else{for(var o=[],l=0;l<t.length;l+=3)(0===i||t[l+2]>s)&&(r.numSimplified++,o.push(t[l]),o.push(t[l+1])),r.numPoints++;n&&Ig(o,a),e.push(o)}}function Ig(e,t){for(var r=0,i=0,n=e.length,a=n-2;i<n;a=i,i+=2)r+=(e[i]-e[a])*(e[i+1]+e[a+1]);if(r>0===t)for(i=0,n=e.length;i<n/2;i+=2){var s=e[i],o=e[i+1];e[i]=e[n-2-i],e[i+1]=e[n-1-i],e[n-2-i]=s,e[n-1-i]=o}}function Mg(e,t){return new Pg(e,t)}function Pg(e,t){var r=(t=this.options=zg(Object.create(this.options),t)).debug;if(r&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var i=ig(e,t);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(i=xg(i,t)).length&&this.splitTile(i,0,0,0),r&&(i.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 Cg(e,t,r){return 32*((1<<e)*r+t)+e}function zg(e,t){for(var r in t)e[r]=t[r];return e}function Bg(e,t){return t?e.properties[t]:e.id}function Vg(e,t){if(null==e)return!0;if("Feature"===e.type)return null!=Bg(e,t);if("FeatureCollection"===e.type){let r=new Set;for(let i of e.features){let e=Bg(i,t);if(null==e||r.has(e))return!1;r.add(e)}return!0}return!1}function Eg(e,t){let r=new Map;if(null!=e)if("Feature"===e.type)r.set(Bg(e,t),e);else for(let i of e.features)r.set(Bg(i,t),i);return r}function Fg(e,t,r){var i,n,a,s;if(t.removeAll&&e.clear(),t.remove)for(let r of t.remove)e.delete(r);if(t.add)for(let i of t.add){let t=Bg(i,r);null!=t&&e.set(t,i)}if(t.update)for(let r of t.update){let t=e.get(r.id);if(null==t)continue;let o=r.newGeometry||r.removeAllProperties,l=!r.removeAllProperties&&((null==(i=r.removeProperties)?void 0:i.length)>0||(null==(n=r.addOrUpdateProperties)?void 0:n.length)>0);if((o||l)&&(t={...t},e.set(r.id,t),l&&(t.properties={...t.properties})),r.newGeometry&&(t.geometry=r.newGeometry),r.removeAllProperties)t.properties={};else if((null==(a=r.removeProperties)?void 0:a.length)>0)for(let e of r.removeProperties)Object.prototype.hasOwnProperty.call(t.properties,e)&&delete t.properties[e];if((null==(s=r.addOrUpdateProperties)?void 0:s.length)>0)for(let{key:e,value:i}of r.addOrUpdateProperties)t.properties[e]=i}}function Tg(e,t){let r=e.tileID.canonical;if(!this._geoJSONIndex)return t(null,null);let i=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!i)return t(null,null);let n=new Vm(i.features),a=(0,Em.default)(n);(0!==a.byteOffset||a.byteLength!==a.buffer.byteLength)&&(a=new Uint8Array(a)),t(null,{vectorTile:n,rawData:a.buffer})}l(Gm,"getClusterJSON"),l(Km,"getClusterProperties"),l(Xm,"lngX"),l(Ym,"latY"),l(Hm,"xLng"),l(Wm,"yLat"),p(),p(),p(),l($m,"simplify"),l(Qm,"getSqSegDist"),p(),l(eg,"createFeature"),l(tg,"calcBBox"),l(rg,"calcLineBBox"),l(ig,"convert"),l(ng,"convertFeature"),l(ag,"convertPoint"),l(sg,"convertLine"),l(og,"convertLines"),l(lg,"projectX"),l(ug,"projectY"),p(),l(cg,"clip"),l(hg,"clipPoints"),l(pg,"clipLine"),l(dg,"newSlice"),l(fg,"clipLines"),l(yg,"addPoint"),l(mg,"intersectX"),l(gg,"intersectY"),p(),l(xg,"wrap"),l(vg,"shiftFeatureCoords"),l(bg,"shiftCoords"),p(),l(wg,"transformTile"),l(_g,"transformPoint"),p(),l(Sg,"createTile"),l(Ag,"addFeature"),l(kg,"addLine"),l(Ig,"rewind"),l(Mg,"geojsonvt"),l(Pg,"GeoJSONVT"),Pg.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Pg.prototype.splitTile=function(e,t,r,i,n,a,s){for(var o=[e,t,r,i],l=this.options,u=l.debug;o.length;){i=o.pop(),r=o.pop(),t=o.pop(),e=o.pop();var c=1<<t,h=Cg(t,r,i),p=this.tiles[h];if(!p&&(u>1&&console.time("creation"),p=this.tiles[h]=Sg(e,t,r,i,l),this.tileCoords.push({z:t,x:r,y:i}),u)){u>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,i,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var d="z"+t;this.stats[d]=(this.stats[d]||0)+1,this.total++}if(p.source=e,n){if(t===l.maxZoom||t===n)continue;var f=1<<n-t;if(r!==Math.floor(a/f)||i!==Math.floor(s/f))continue}else if(t===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue;if(p.source=null,0!==e.length){u>1&&console.time("clipping");var y,m,g,x,v,b,w=.5*l.buffer/l.extent,_=.5-w,S=.5+w,A=1+w;y=m=g=x=null,v=cg(e,c,r-w,r+S,0,p.minX,p.maxX,l),b=cg(e,c,r+_,r+A,0,p.minX,p.maxX,l),e=null,v&&(y=cg(v,c,i-w,i+S,1,p.minY,p.maxY,l),m=cg(v,c,i+_,i+A,1,p.minY,p.maxY,l),v=null),b&&(g=cg(b,c,i-w,i+S,1,p.minY,p.maxY,l),x=cg(b,c,i+_,i+A,1,p.minY,p.maxY,l),b=null),u>1&&console.timeEnd("clipping"),o.push(y||[],t+1,2*r,2*i),o.push(m||[],t+1,2*r,2*i+1),o.push(g||[],t+1,2*r+1,2*i),o.push(x||[],t+1,2*r+1,2*i+1)}}},Pg.prototype.getTile=function(e,t,r){var i=this.options,n=i.extent,a=i.debug;if(e<0||e>24)return null;var s=1<<e,o=Cg(e,t=(t%s+s)%s,r);if(this.tiles[o])return wg(this.tiles[o],n);a>1&&console.log("drilling down to z%d-%d-%d",e,t,r);for(var l,u=e,c=t,h=r;!l&&u>0;)u--,c=Math.floor(c/2),h=Math.floor(h/2),l=this.tiles[Cg(u,c,h)];return l&&l.source?(a>1&&console.log("found parent tile z%d-%d-%d",u,c,h),a>1&&console.time("drilling down"),this.splitTile(l.source,u,c,h,e,t,r),a>1&&console.timeEnd("drilling down"),this.tiles[o]?wg(this.tiles[o],n):null):null},l(Cg,"toID"),l(zg,"extend"),p(),l(Bg,"getFeatureId"),l(Vg,"isUpdateableGeoJSON"),l(Eg,"toUpdateable"),l(Fg,"applySourceDiff"),l(Tg,"loadGeoJSONTile");var Lg=class extends wm{constructor(e,t,r,i){super(e,t,r,Tg),this._dataUpdateable=new Map,this.loadGeoJSON=l(((e,t)=>{let{promoteId:r}=e;if(e.request)return ea(e.request,((e,i,n,a)=>{this._dataUpdateable=Vg(i,r)?Eg(i,r):void 0,t(e,i,n,a)}));if("string"==typeof e.data)try{let i=JSON.parse(e.data);this._dataUpdateable=Vg(i,r)?Eg(i,r):void 0,t(null,i)}catch{t(new Error("Input data given to '".concat(e.source,"' is not a valid GeoJSON object.")))}else e.dataDiff?this._dataUpdateable?(Fg(this._dataUpdateable,e.dataDiff,r),t(null,{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())})):t(new Error("Cannot update existing geojson data in ".concat(e.source))):t(new Error("Input data given to '".concat(e.source,"' is not a valid GeoJSON object.")));return{cancel:l((()=>{}),"cancel")}}),"loadGeoJSON"),i&&(this.loadGeoJSON=i)}loadData(e,t){var r;null==(r=this._pendingRequest)||r.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});let i=!!(e&&e.request&&e.request.collectResourceTiming)&&new xm(e.request);this._pendingCallback=t,this._pendingRequest=this.loadGeoJSON(e,((r,n)=>{if(delete this._pendingCallback,delete this._pendingRequest,r||!n)return t(r);if("object"!=typeof n)return t(new Error("Input data given to '".concat(e.source,"' is not a valid GeoJSON object.")));{(0,Im.default)(n,!0);try{if(e.filter){let t=Di(e.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===t.result)throw new Error(t.value.map((e=>"".concat(e.key,": ").concat(e.message))).join(", "));n={type:"FeatureCollection",features:n.features.filter((e=>t.value.evaluate({zoom:0},e)))}}this._geoJSONIndex=e.cluster?new Jm(Og(e)).load(n.features):Mg(n,e.geojsonVtOptions)}catch(e){return t(e)}this.loaded={};let r={};if(i){let t=i.finish();t&&(r.resourceTiming={},r.resourceTiming[e.source]=JSON.parse(JSON.stringify(t)))}t(null,r)}}))}reloadTile(e,t){let r=this.loaded,i=e.uid;return r&&r[i]?super.reloadTile(e,t):this.loadTile(e,t)}removeSource(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),t()}getClusterExpansionZoom(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId))}catch(e){t(e)}}getClusterChildren(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId))}catch(e){t(e)}}getClusterLeaves(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset))}catch(e){t(e)}}};l(Lg,"GeoJSONWorkerSource");var Dg=Lg;function Og({superclusterOptions:e,clusterProperties:t}){if(!t||!e)return e;let r={},i={},n={accumulated:null,zoom:0},a={properties:null},s=Object.keys(t);for(let e of s){let[n,a]=t[e],s=Di(a),o=Di("string"==typeof n?[n,["accumulated"],["get",e]]:n);r[e]=s.value,i[e]=o.value}return e.map=e=>{a.properties=e;let t={};for(let e of s)t[e]=r[e].evaluate(n,a);return t},e.reduce=(e,t)=>{a.properties=t;for(let t of s)n.accumulated=e[t],e[t]=i[t].evaluate(n,a)},e}l(Og,"getSuperclusterOptions");var Rg=class{constructor(e){this.self=e,this.actor=new ca(e,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:wm,geojson:Dg},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(e,t)=>{if(this.workerSourceTypes[e])throw new Error('Worker source with name "'.concat(e,'" already registered.'));this.workerSourceTypes[e]=t},this.self.registerRTLTextPlugin=e=>{if(Na.isParsed())throw new Error("RTL text plugin already registered.");Na.applyArabicShaping=e.applyArabicShaping,Na.processBidirectionalText=e.processBidirectionalText,Na.processStyledBidirectionalText=e.processStyledBidirectionalText}}setReferrer(e,t){this.referrer=t}setImages(e,t,r){this.availableImages[e]=t;for(let r in this.workerSources[e]){let i=this.workerSources[e][r];for(let e in i)i[e].availableImages=t}r()}setLayers(e,t,r){this.getLayerIndex(e).replace(t),r()}updateLayers(e,t,r){this.getLayerIndex(e).update(t.layers,t.removedIds),r()}loadTile(e,t,r){this.getWorkerSource(e,t.type,t.source).loadTile(t,r)}loadDEMTile(e,t,r){this.getDEMWorkerSource(e,t.source).loadTile(t,r)}reloadTile(e,t,r){this.getWorkerSource(e,t.type,t.source).reloadTile(t,r)}abortTile(e,t,r){this.getWorkerSource(e,t.type,t.source).abortTile(t,r)}removeTile(e,t,r){this.getWorkerSource(e,t.type,t.source).removeTile(t,r)}removeDEMTile(e,t){this.getDEMWorkerSource(e,t.source).removeTile(t)}removeSource(e,t,r){if(!this.workerSources[e]||!this.workerSources[e][t.type]||!this.workerSources[e][t.type][t.source])return;let i=this.workerSources[e][t.type][t.source];delete this.workerSources[e][t.type][t.source],void 0!==i.removeSource?i.removeSource(t,r):r()}loadWorkerSource(e,t,r){try{this.self.importScripts(t.url),r()}catch(e){r(e.toString())}}syncRTLPluginState(e,t,r){try{Na.setState(t);let e=Na.getPluginURL();if(Na.isLoaded()&&!Na.isParsed()&&null!=e){this.self.importScripts(e);let t=Na.isParsed();r(t?void 0:new Error("RTL Text Plugin failed to import scripts from ".concat(e)),t)}}catch(e){r(e.toString())}}getAvailableImages(e){let t=this.availableImages[e];return t||(t=[]),t}getLayerIndex(e){let t=this.layerIndexes[e];return t||(t=this.layerIndexes[e]=new qf),t}getWorkerSource(e,t,r){if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][r]){let i={send:l(((t,r,i)=>{this.actor.send(t,r,i,e)}),"send")};this.workerSources[e][t][r]=new this.workerSourceTypes[t](i,this.getLayerIndex(e),this.getAvailableImages(e))}return this.workerSources[e][t][r]}getDEMWorkerSource(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new km),this.demWorkerSources[e][t]}};l(Rg,"Worker");var qg=Rg;N()&&(self.worker=new qg(self))})();
|