UNPKG

mapbox-gl

Version:
1 lines 1.51 MB
var e,t;e=this,t=function(){var e=1e-6,t="undefined"!=typeof Float32Array?Float32Array:Array;function i(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],s=i*o-n*r;return s?(e[0]=o*(s=1/s),e[1]=-r*s,e[2]=-n*s,e[3]=i*s,e):null}function r(){var e=new t(9);return t!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function n(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function o(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],h=t[8];return e[0]=s*h-a*c,e[1]=n*c-r*h,e[2]=r*a-n*s,e[3]=a*l-o*h,e[4]=i*h-n*l,e[5]=n*o-i*a,e[6]=o*c-s*l,e[7]=r*l-i*c,e[8]=i*s-r*o,e}function s(e,t,i){var r=t[0],n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],h=t[7],u=t[8],d=i[0],p=i[1],f=i[2],m=i[3],_=i[4],g=i[5],y=i[6],x=i[7],v=i[8];return e[0]=d*r+p*s+f*c,e[1]=d*n+p*a+f*h,e[2]=d*o+p*l+f*u,e[3]=m*r+_*s+g*c,e[4]=m*n+_*a+g*h,e[5]=m*o+_*l+g*u,e[6]=y*r+x*s+v*c,e[7]=y*n+x*a+v*h,e[8]=y*o+x*l+v*u,e}function a(e,t){var i=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=i,e[2]=0,e[3]=-i,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function l(){var e=new t(16);return t!=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 c(e){var i=new t(16);return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],i[6]=e[6],i[7]=e[7],i[8]=e[8],i[9]=e[9],i[10]=e[10],i[11]=e[11],i[12]=e[12],i[13]=e[13],i[14]=e[14],i[15]=e[15],i}function h(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 u(e,t){if(e===t){var i=t[1],r=t[2],n=t[3],o=t[6],s=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=i,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=o,e[11]=t[14],e[12]=n,e[13]=s,e[14]=a}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 d(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],h=t[8],u=t[9],d=t[10],p=t[11],f=t[12],m=t[13],_=t[14],g=t[15],y=i*a-r*s,x=i*l-n*s,v=i*c-o*s,b=r*l-n*a,w=r*c-o*a,T=n*c-o*l,E=h*m-u*f,S=h*_-d*f,A=h*g-p*f,I=u*_-d*m,C=u*g-p*m,M=d*g-p*_,D=y*M-x*C+v*I+b*A-w*S+T*E;return D?(e[0]=(a*M-l*C+c*I)*(D=1/D),e[1]=(n*C-r*M-o*I)*D,e[2]=(m*T-_*w+g*b)*D,e[3]=(d*w-u*T-p*b)*D,e[4]=(l*A-s*M-c*S)*D,e[5]=(i*M-n*A+o*S)*D,e[6]=(_*v-f*T-g*x)*D,e[7]=(h*T-d*v+p*x)*D,e[8]=(s*C-a*A+c*E)*D,e[9]=(r*A-i*C-o*E)*D,e[10]=(f*w-m*v+g*y)*D,e[11]=(u*v-h*w-p*y)*D,e[12]=(a*S-s*I-l*E)*D,e[13]=(i*I-r*S+n*E)*D,e[14]=(m*x-f*b-_*y)*D,e[15]=(h*b-u*x+d*y)*D,e):null}function p(e,t,i){var r=t[0],n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],h=t[7],u=t[8],d=t[9],p=t[10],f=t[11],m=t[12],_=t[13],g=t[14],y=t[15],x=i[0],v=i[1],b=i[2],w=i[3];return e[0]=x*r+v*a+b*u+w*m,e[1]=x*n+v*l+b*d+w*_,e[2]=x*o+v*c+b*p+w*g,e[3]=x*s+v*h+b*f+w*y,e[4]=(x=i[4])*r+(v=i[5])*a+(b=i[6])*u+(w=i[7])*m,e[5]=x*n+v*l+b*d+w*_,e[6]=x*o+v*c+b*p+w*g,e[7]=x*s+v*h+b*f+w*y,e[8]=(x=i[8])*r+(v=i[9])*a+(b=i[10])*u+(w=i[11])*m,e[9]=x*n+v*l+b*d+w*_,e[10]=x*o+v*c+b*p+w*g,e[11]=x*s+v*h+b*f+w*y,e[12]=(x=i[12])*r+(v=i[13])*a+(b=i[14])*u+(w=i[15])*m,e[13]=x*n+v*l+b*d+w*_,e[14]=x*o+v*c+b*p+w*g,e[15]=x*s+v*h+b*f+w*y,e}function f(e,t,i){var r,n,o,s,a,l,c,h,u,d,p,f,m=i[0],_=i[1],g=i[2];return t===e?(e[12]=t[0]*m+t[4]*_+t[8]*g+t[12],e[13]=t[1]*m+t[5]*_+t[9]*g+t[13],e[14]=t[2]*m+t[6]*_+t[10]*g+t[14],e[15]=t[3]*m+t[7]*_+t[11]*g+t[15]):(n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],h=t[7],u=t[8],d=t[9],p=t[10],f=t[11],e[0]=r=t[0],e[1]=n,e[2]=o,e[3]=s,e[4]=a,e[5]=l,e[6]=c,e[7]=h,e[8]=u,e[9]=d,e[10]=p,e[11]=f,e[12]=r*m+a*_+u*g+t[12],e[13]=n*m+l*_+d*g+t[13],e[14]=o*m+c*_+p*g+t[14],e[15]=s*m+h*_+f*g+t[15]),e}function m(e,t,i){var r=i[0],n=i[1],o=i[2];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]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function _(e,t,i){var r=Math.sin(i),n=Math.cos(i),o=t[4],s=t[5],a=t[6],l=t[7],c=t[8],h=t[9],u=t[10],d=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]=o*n+c*r,e[5]=s*n+h*r,e[6]=a*n+u*r,e[7]=l*n+d*r,e[8]=c*n-o*r,e[9]=h*n-s*r,e[10]=u*n-a*r,e[11]=d*n-l*r,e}function g(e,t,i){var r=Math.sin(i),n=Math.cos(i),o=t[0],s=t[1],a=t[2],l=t[3],c=t[8],h=t[9],u=t[10],d=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]=o*n-c*r,e[1]=s*n-h*r,e[2]=a*n-u*r,e[3]=l*n-d*r,e[8]=o*r+c*n,e[9]=s*r+h*n,e[10]=a*r+u*n,e[11]=l*r+d*n,e}function y(e,t,i){var r=Math.sin(i),n=Math.cos(i),o=t[0],s=t[1],a=t[2],l=t[3],c=t[4],h=t[5],u=t[6],d=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]=o*n+c*r,e[1]=s*n+h*r,e[2]=a*n+u*r,e[3]=l*n+d*r,e[4]=c*n-o*r,e[5]=h*n-s*r,e[6]=u*n-a*r,e[7]=d*n-l*r,e}function x(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 v(t,i,r){var n,o,s,a=r[0],l=r[1],c=r[2],h=Math.hypot(a,l,c);return h<e?null:(a*=h=1/h,l*=h,c*=h,n=Math.sin(i),o=Math.cos(i),t[0]=a*a*(s=1-o)+o,t[1]=l*a*s+c*n,t[2]=c*a*s-l*n,t[3]=0,t[4]=a*l*s-c*n,t[5]=l*l*s+o,t[6]=c*l*s+a*n,t[7]=0,t[8]=a*c*s+l*n,t[9]=l*c*s-a*n,t[10]=c*c*s+o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function b(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],s=i+i,a=r+r,l=n+n,c=i*s,h=r*s,u=r*a,d=n*s,p=n*a,f=n*l,m=o*s,_=o*a,g=o*l;return e[0]=1-u-f,e[1]=h+g,e[2]=d-_,e[3]=0,e[4]=h-g,e[5]=1-c-f,e[6]=p+m,e[7]=0,e[8]=d+_,e[9]=p-m,e[10]=1-c-u,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var w=function(e,t,i,r,n){var o,s=1/Math.tan(t/2);return e[0]=s/i,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?(e[10]=(n+r)*(o=1/(r-n)),e[14]=2*n*r*o):(e[10]=-1,e[14]=-2*r),e},T=function(e,t,i,r,n,o,s){var a=1/(t-i),l=1/(r-n),c=1/(o-s);return e[0]=-2*a,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*c,e[11]=0,e[12]=(t+i)*a,e[13]=(n+r)*l,e[14]=(s+o)*c,e[15]=1,e},E=p;function S(){var e=new t(3);return t!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function A(e){var i=new t(3);return i[0]=e[0],i[1]=e[1],i[2]=e[2],i}function I(e){return Math.hypot(e[0],e[1],e[2])}function C(e,i,r){var n=new t(3);return n[0]=e,n[1]=i,n[2]=r,n}function M(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e}function D(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e}function P(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e[2]=t[2]*i[2],e}function L(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e[2]=Math.min(t[2],i[2]),e}function R(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e[2]=Math.max(t[2],i[2]),e}function z(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e}function F(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e[2]=t[2]+i[2]*r,e}function O(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2])}function B(e,t){var i=t[0]-e[0],r=t[1]-e[1],n=t[2]-e[2];return i*i+r*r+n*n}function k(e){var t=e[0],i=e[1],r=e[2];return t*t+i*i+r*r}function U(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function N(e,t){var i=t[0],r=t[1],n=t[2],o=i*i+r*r+n*n;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function V(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function j(e,t,i){var r=t[0],n=t[1],o=t[2],s=i[0],a=i[1],l=i[2];return e[0]=n*l-o*a,e[1]=o*s-r*l,e[2]=r*a-n*s,e}function G(e,t,i,r){var n=t[0],o=t[1],s=t[2];return e[0]=n+r*(i[0]-n),e[1]=o+r*(i[1]-o),e[2]=s+r*(i[2]-s),e}function H(e,t,i){var r=t[0],n=t[1],o=t[2],s=i[3]*r+i[7]*n+i[11]*o+i[15];return e[0]=(i[0]*r+i[4]*n+i[8]*o+i[12])/(s=s||1),e[1]=(i[1]*r+i[5]*n+i[9]*o+i[13])/s,e[2]=(i[2]*r+i[6]*n+i[10]*o+i[14])/s,e}function q(e,t,i){var r=t[0],n=t[1],o=t[2];return e[0]=r*i[0]+n*i[3]+o*i[6],e[1]=r*i[1]+n*i[4]+o*i[7],e[2]=r*i[2]+n*i[5]+o*i[8],e}function Z(e,t,i){var r=i[0],n=i[1],o=i[2],s=t[0],a=t[1],l=t[2],c=n*l-o*a,h=o*s-r*l,u=r*a-n*s,d=n*u-o*h,p=o*c-r*u,f=r*h-n*c,m=2*i[3];return h*=m,u*=m,p*=2,f*=2,e[0]=s+(c*=m)+(d*=2),e[1]=a+h+p,e[2]=l+u+f,e}function $(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}var W=D,X=P,Y=function(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e[2]=t[2]/i[2],e},K=I;function J(){var e=new t(4);return t!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Q(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e}function ee(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],s=i*i+r*r+n*n+o*o;return s>0&&(s=1/Math.sqrt(s)),e[0]=i*s,e[1]=r*s,e[2]=n*s,e[3]=o*s,e}function te(e,t,i){var r=t[0],n=t[1],o=t[2],s=t[3];return e[0]=i[0]*r+i[4]*n+i[8]*o+i[12]*s,e[1]=i[1]*r+i[5]*n+i[9]*o+i[13]*s,e[2]=i[2]*r+i[6]*n+i[10]*o+i[14]*s,e[3]=i[3]*r+i[7]*n+i[11]*o+i[15]*s,e}function ie(){var e=new t(4);return t!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function re(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function ne(e,t,i){i*=.5;var r=t[0],n=t[1],o=t[2],s=t[3],a=Math.sin(i),l=Math.cos(i);return e[0]=r*l+s*a,e[1]=n*l+o*a,e[2]=o*l-n*a,e[3]=s*l-r*a,e}function oe(e,t,i){i*=.5;var r=t[0],n=t[1],o=t[2],s=t[3],a=Math.sin(i),l=Math.cos(i);return e[0]=r*l-o*a,e[1]=n*l+s*a,e[2]=o*l+r*a,e[3]=s*l-n*a,e}function se(e,t,i){i*=.5;var r=t[0],n=t[1],o=t[2],s=t[3],a=Math.sin(i),l=Math.cos(i);return e[0]=r*l+n*a,e[1]=n*l-r*a,e[2]=o*l+s*a,e[3]=s*l-o*a,e}S(),J();var ae,le,ce,he,ue,de=ee,pe=(ae=S(),le=C(1,0,0),ce=C(0,1,0),function(e,t,i){var r=V(t,i);return r<-.999999?(j(ae,le,t),K(ae)<1e-6&&j(ae,ce,t),N(ae,ae),function(e,t,i){i*=.5;var r=Math.sin(i);e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(i)}(e,ae,Math.PI),e):r>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(j(ae,t,i),e[0]=ae[0],e[1]=ae[1],e[2]=ae[2],e[3]=1+r,de(e,e))});function fe(){var e=new t(2);return t!=Float32Array&&(e[0]=0,e[1]=0),e}function me(e,i){var r=new t(2);return r[0]=e,r[1]=i,r}function _e(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e}function ge(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e}function ye(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e}function xe(e){return Math.hypot(e[0],e[1])}function ve(e,t){var i=t[0],r=t[1],n=i*i+r*r;return n>0&&(n=1/Math.sqrt(n)),e[0]=t[0]*n,e[1]=t[1]*n,e}function be(e,t){return e[0]*t[0]+e[1]*t[1]}function we(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}ie(),ie(),r(),fe();var Te,Ee,Se=function(){if(ue)return he;function e(e,t,i,r){this.cx=3*e,this.bx=3*(i-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(r-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=i,this.p2y=r}return ue=1,he=e,e.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var i=e,r=0;r<8;r++){var n=this.sampleCurveX(i)-e;if(Math.abs(n)<t)return i;var o=this.sampleCurveDerivativeX(i);if(Math.abs(o)<1e-6)break;i-=n/o}var s=0,a=1;for(i=e,r=0;r<20&&(n=this.sampleCurveX(i),!(Math.abs(n-e)<t));r++)e>n?s=i:a=i,i=.5*(a-s)+s;return i},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},he}(),Ae=we(Se);function Ie(){if(Ee)return Te;function e(e,t){this.x=e,this.y=t}return Ee=1,Te=e,e.prototype={clone:function(){return new e(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,i=e.y-this.y;return t*t+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),i=Math.sin(e),r=i*this.x+t*this.y;return this.x=t*this.x-i*this.y,this.y=r,this},_rotateAround:function(e,t){var i=Math.cos(e),r=Math.sin(e),n=t.y+r*(this.x-t.x)+i*(this.y-t.y);return this.x=t.x+i*(this.x-t.x)-r*(this.y-t.y),this.y=n,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},e.convert=function(t){return t instanceof e?t:Array.isArray(t)?new e(t[0],t[1]):t},Te}var Ce=we(Ie());function Me(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!Me(e[i],t[i]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==t){if("object"!=typeof t)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!Me(e[i],t[i]))return!1;return!0}return e===t}const De=Math.PI/180,Pe=180/Math.PI;function Le(e){return e*De}function Re(e){return e*Pe}const ze=[[0,0],[1,0],[1,1],[0,1]];function Fe(e){if(e<=0)return 0;if(e>=1)return 1;const t=e*e,i=t*e;return 4*(e<.5?i:3*(e-t)+i-.75)}function Oe(e){let t=1/0,i=1/0,r=-1/0,n=-1/0;for(const o of e)t=Math.min(t,o.x),i=Math.min(i,o.y),r=Math.max(r,o.x),n=Math.max(n,o.y);return{min:new Ce(t,i),max:new Ce(r,n)}}function Be(e,t,i=0,r=!0){const n=new Ce(i,i),o=e.sub(n),s=t.add(n),a=[o,new Ce(s.x,o.y),s,new Ce(o.x,s.y)];return r&&a.push(o.clone()),a}function ke(e,t,i,r){const n=new Ae(e,t,i,r);return function(e){return n.solve(e)}}const Ue=ke(.25,.1,.25,1);function Ne(e,t,i){return Math.min(i,Math.max(t,e))}function Ve(e,t,i){return(i=Ne((i-e)/(t-e),0,1))*i*(3-2*i)}function je(e,t,i){const r=i-t,n=((e-t)%r+r)%r+t;return n===t?i:n}function Ge(e,t,i){if(!e.length)return i(null,[]);let r=e.length;const n=new Array(e.length);let o=null;e.forEach(((e,s)=>{t(e,((e,t)=>{e&&(o=e),n[s]=t,0==--r&&i(o,n)}))}))}function He(e,...t){for(const i of t)for(const t in i)e[t]=i[t];return e}function qe(e,t){const i={};for(let r=0;r<t.length;r++){const n=t[r];n in e&&(i[n]=e[n])}return i}let Ze=1;function $e(){return Ze++}function We(){return function e(t){return t?(t^Math.random()*(16>>t/4)).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()}function Xe(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function Ye(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function Ke(e,t){e.forEach((e=>{t[e]&&(t[e]=t[e].bind(t))}))}function Je(e,t,i){const r={};for(const i in e)r[i]=t.call(this,e[i],i,e);return r}function Qe(e,t,i){const r={};for(const i in e)t.call(this,e[i],i,e)&&(r[i]=e[i]);return r}function et(e){return Array.isArray(e)?e.map(et):"object"==typeof e&&e?Je(e,et):e}function tt(e,t){for(let i=0;i<e.length;i++)if(t.indexOf(e[i])>=0)return!0;return!1}const it={};function rt(e){it[e]||("undefined"!=typeof console&&console.warn(e),it[e]=!0)}function nt(e,t,i){return(i.y-e.y)*(t.x-e.x)>(t.y-e.y)*(i.x-e.x)}function ot(e){let t=0;for(let i,r,n=0,o=e.length,s=o-1;n<o;s=n++)i=e[n],r=e[s],t+=(r.x-i.x)*(i.y+r.y);return t}function st([e,t,i]){const r=Le(t+90),n=Le(i);return{x:e*Math.cos(r)*Math.sin(n),y:e*Math.sin(r)*Math.sin(n),z:e*Math.cos(n),azimuthal:t,polar:i}}function at(e,t,i){const r=Math.sqrt(e*e+t*t+i*i),n=r>0?Math.acos(i/r)*Pe:0;let o=0!==e||0!==t?Math.atan2(-t,-e)*Pe+90:0;return o<0&&(o+=360),[r,o,n]}function lt(e){return("undefined"!=typeof self||void 0!==e)&&"undefined"!=typeof WorkerGlobalScope&&(void 0!==e?e:self)instanceof WorkerGlobalScope}function ct(e){const t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((e,i,r,n)=>{const o=r||n;return t[i]=!o||o.toLowerCase(),""})),t["max-age"]){const e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t}let ht=null;function ut(){return!!document.fullscreenElement||!!document.webkitFullscreenElement}function dt(e){try{const t=self[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch(e){return!1}}function pt(e,t){return[e[4*t],e[4*t+1],e[4*t+2],e[4*t+3]]}function ft(e,t,i){e[4*t+0]=i[0],e[4*t+1]=i[1],e[4*t+2]=i[2],e[4*t+3]=i[3]}function mt(e,t){return[Math.pow(e[0],2.2)*t,Math.pow(e[1],2.2)*t,Math.pow(e[2],2.2)*t]}function _t(e){return[Math.pow(e[0],1/2.2),Math.pow(e[1],1/2.2),Math.pow(e[2],1/2.2)]}function gt(e,t,i,r){for(;t<i;){const n=t+i>>1;e[n]<r?t=n+1:i=n}return t}function yt(e,t,i,r){for(;t<i;){const n=t+i>>1;e[n]<=r?t=n+1:i=n}return t}function xt(e){return e>0?1/(1.001-e):1+e}function vt(e){return e>0?1-1/(1.001-e):-e}function bt(e,t,i){return(e-t.min)*(i.max-i.min)/(t.max-t.min)+i.min}function wt(e){return e*e*e*e*e}var Tt="3.13.0";const Et={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!Et.API_URL)return null;try{const e=new URL(Et.API_URL);return"api.mapbox.cn"===e.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===e.hostname?"https://events.mapbox.com/events/v2":null}catch(e){return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",RASTERARRAYS_URL_PREFIX:"rasterarrays/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,DEFAULT_STYLE:"mapbox://styles/mapbox/standard",MAX_PARALLEL_IMAGE_REQUESTS:16,DRACO_URL:"https://api.mapbox.com/mapbox-gl-js/draco_decoder_gltf_v1.5.6.wasm",MESHOPT_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_base_v0.20.wasm",MESHOPT_SIMD_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_simd_v0.20.wasm",BUILDING_GEN_URL:"https://api.mapbox.com/mapbox-gl-js/building-gen/building_gen_v0.3.0.wasm",GLYPHS_URL:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",TILES3D_URL_PREFIX:"3dtiles/v1"};function St(e){return Et.API_URL_REGEX.test(e)}function It(e){return 0===e.indexOf("mapbox:")}function Ct(e){return Et.API_CDN_URL_REGEX.test(e)}function Mt(e){return Et.API_SPRITE_REGEX.test(e)}function Dt(e){return Et.API_STYLE_REGEX.test(e)&&!Mt(e)}const Pt={create:"create",load:"load",fullLoad:"fullLoad"},Lt={mark(e){performance.mark(e)},measure(e,t,i){performance.measure(e,t,i)}};function Rt(e){const t=e.name.split("?")[0];return Ct(t)&&t.includes("mapbox-gl.js")?"javascript":Ct(t)&&t.includes("mapbox-gl.css")?"css":function(e){return Et.API_FONTS_REGEX.test(e)}(t)?"fontRange":Mt(t)?"sprite":Dt(t)?"style":function(e){return Et.API_TILEJSON_REGEX.test(e)}(t)?"tilejson":"other"}var zt,Ft={},Ot=function(){if(zt)return Ft;function e(e){return!t(e)}function t(t){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var e,t,i=new Blob([""],{type:"text/javascript"}),r=URL.createObjectURL(i);try{t=new Worker(r),e=!0}catch(t){e=!1}return t&&t.terminate(),URL.revokeObjectURL(r),e}()?function(){var e=document.createElement("canvas");e.width=e.height=1;var t=e.getContext("2d");if(!t)return!1;var i=t.getImageData(0,0,1,1);return i&&i.width===e.width}()?(void 0===i[r=t&&t.failIfMajorPerformanceCaveat]&&(i[r]=function(t){var i,r=function(t){var i=document.createElement("canvas"),r=Object.create(e.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,i.getContext("webgl2",r)}(t);if(!r)return!1;try{i=r.createShader(r.VERTEX_SHADER)}catch(e){return!1}return!(!i||r.isContextLost())&&(r.shaderSource(i,"void main() {}"),r.compileShader(i),!0===r.getShaderParameter(i,r.COMPILE_STATUS))}(r)),i[r]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL2 support"):"insufficient Canvas/getImageData support":"insufficient worker support";var r}zt=1,Ft.supported=e,Ft.notSupportedReason=t;var i={};return e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0},Ft}();let Bt,kt,Ut,Nt,Vt,jt;function Gt(){return null==Bt&&(Bt=self.OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),Bt}const Ht={now:()=>void 0!==Nt?Nt:performance.now(),setNow(e){Nt=e},restoreNow(){Nt=void 0},frame(e){const t=requestAnimationFrame(e);return{cancel:()=>cancelAnimationFrame(t)}},getImageData(e,t=0){const{width:i,height:r}=e;Vt||(Vt=document.createElement("canvas"));const n=Vt.getContext("2d",{willReadFrequently:!0});if(!n)throw new Error("failed to create canvas 2d context");return(i>Vt.width||r>Vt.height)&&(Vt.width=i,Vt.height=r),n.clearRect(-t,-t,i+2*t,r+2*t),n.drawImage(e,0,0,i,r),n.getImageData(-t,-t,i+2*t,r+2*t)},resolveURL:e=>(kt||(kt=document.createElement("a")),kt.href=e,kt.href),get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return!!window.matchMedia&&(null==Ut&&(Ut=window.matchMedia("(prefers-reduced-motion: reduce)")),Ut.matches)},hasCanvasFingerprintNoise(){if(void 0!==jt)return jt;if(!Gt())return jt=!1,!1;const e=new OffscreenCanvas(85,1),t=e.getContext("2d",{willReadFrequently:!0});let i=0;for(let r=0;r<e.width;++r)t.fillStyle=`rgba(${i++},${i++},${i++}, 255)`,t.fillRect(r,0,1,1);const r=t.getImageData(0,0,e.width,e.height);i=0;for(let e=0;e<r.data.length;++e)if(e%4!=3&&i++!==r.data[e])return jt=!0,!0;return jt=!1,!1}};function qt(e,t,i){const r=document.createElement(e);return null!=t&&(r.className=t),i&&i.appendChild(r),r}function Zt(e,t,i){const r=document.createElementNS("http://www.w3.org/2000/svg",e);for(const e of Object.keys(t))r.setAttributeNS(null,e,String(t[e]));return i&&i.appendChild(r),r}const $t="undefined"!=typeof document?document.documentElement&&document.documentElement.style:null,Wt=$t&&void 0!==$t.userSelect?"userSelect":"WebkitUserSelect";let Xt;function Yt(){$t&&Wt&&(Xt=$t[Wt],$t[Wt]="none")}function Kt(){$t&&Wt&&($t[Wt]=Xt)}function Jt(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",Jt,!0)}function Qt(){window.addEventListener("click",Jt,!0),window.setTimeout((()=>{window.removeEventListener("click",Jt,!0)}),0)}function ei(e,t){const i=e.getBoundingClientRect();return ri(e,i,t)}function ti(e,t){const i=e.getBoundingClientRect(),r=[];for(let n=0;n<t.length;n++)r.push(ri(e,i,t[n]));return r}function ii(e){return/firefox/i.test(navigator.userAgent)&&/macintosh/i.test(navigator.userAgent)&&2===e.button&&e.ctrlKey?0:e.button}function ri(e,t,i){const r=e.offsetWidth===t.width?1:e.offsetWidth/t.width;return new Ce((i.clientX-t.left)*r,(i.clientY-t.top)*r)}function ni(e,t){const i=e.indexOf("?");if(i<0)return`${e}?${new URLSearchParams(t).toString()}`;const r=new URLSearchParams(e.slice(i));for(const e in t)r.set(e,t[e]);return`${e.slice(0,i)}?${r.toString()}`}function oi(e,t={persistentParams:[]}){const i=e.indexOf("?");if(i<0)return e;const r=new URLSearchParams,n=new URLSearchParams(e.slice(i));for(const e of t.persistentParams){const t=n.get(e);t&&r.set(e,t)}const o=r.toString();return`${e.slice(0,i)}${o.length>0?`?${o}`:""}`}const si="mapbox-tiles";let ai=500,li=50;const ci=["language","worldview","jobid"];let hi,ui;function di(){try{return caches}catch(e){}}function pi(){const e=di();e&&null==hi&&(hi=e.open(si))}let fi=1/0;function mi(e){fi++,fi>li&&(e.getActor().send("enforceCacheSizeLimit",ai),fi=0)}const _i={supported:!1,testSupport:function(e){!xi&&yi&&(vi?wi(e):gi=e)}};let gi,yi,xi=!1,vi=!1;const bi="undefined"!=typeof self?self:{};function wi(e){const t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,yi),e.isContextLost())return;_i.supported=!0}catch(e){}e.deleteTexture(t),xi=!0}bi.document&&(yi=bi.document.createElement("img"),yi.onload=function(){gi&&wi(gi),gi=null,vi=!0},yi.onerror=function(){xi=!0,gi=null},yi.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const Ti={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Iconset:"Iconset",Image:"Image",Model:"Model"};"function"==typeof Object.freeze&&Object.freeze(Ti);class AJAXError extends Error{constructor(e,t,i){401===t&&St(i)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=t,this.url=i}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const Ei=lt()?()=>self.worker.referrer:()=>("blob:"===location.protocol?parent:self).location.href;const Si=function(e,t){if(!(/^file:/.test(i=e.url)||/^file:/.test(Ei())&&!/^\w+:/.test(i))){if(self.fetch&&self.Request&&self.AbortController&&Request.prototype.hasOwnProperty("signal"))return function(e,t){const i=new AbortController,r=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:Ei(),referrerPolicy:e.referrerPolicy,signal:i.signal});let n=!1,o=!1;const s=(a=r.url).indexOf("sku=")>0&&St(a);var a;"json"===e.type&&r.headers.set("Accept","application/json");const l=(i,n,a)=>{if(o)return;if(i&&"SecurityError"!==i.message&&rt(i.toString()),n&&a)return c(n);const l=Date.now();fetch(r).then((i=>{if(i.ok){const e=s?i.clone():null;return c(i,e,l)}return t(new AJAXError(i.statusText,i.status,e.url))})).catch((i=>{"AbortError"!==i.name&&t(new Error(`${i.message} ${e.url}`))}))},c=(i,s,a)=>{("arrayBuffer"===e.type?i.arrayBuffer():"json"===e.type?i.json():i.text()).then((e=>{o||(s&&a&&function(e,t,i){if(pi(),null==hi)return;const r=ct(t.headers.get("Cache-Control")||"");if(r["no-store"])return;const n={status:t.status,statusText:t.statusText,headers:new Headers};t.headers.forEach(((e,t)=>n.headers.set(t,e))),r["max-age"]&&n.headers.set("Expires",new Date(i+1e3*r["max-age"]).toUTCString());const o=n.headers.get("Expires");if(!o)return;if(new Date(o).getTime()-i<42e4)return;let s=oi(e.url,{persistentParams:ci});if(206===t.status){const t=e.headers.get("Range");if(!t)return;n.status=200,s=ni(s,{range:t})}!function(e,t){if(void 0===ui)try{new Response(new ReadableStream),ui=!0}catch(e){ui=!1}ui?t(e.body):e.blob().then(t).catch((e=>rt(e.message)))}(t,(e=>{const i=new Response(200!==(r=t.status)&&404!==r&&[101,103,204,205,304].includes(r)?null:e,n);var r;pi(),null!=hi&&hi.then((e=>e.put(s,i))).catch((e=>rt(e.message)))}))}(r,s,a),n=!0,t(null,e,i.headers.get("Cache-Control"),i.headers.get("Expires")))})).catch((e=>{o||t(new Error(e.message))}))};return s?function(e,t){if(pi(),null==hi)return t(null);hi.then((i=>{let r=oi(e.url,{persistentParams:ci});const n=e.headers.get("Range");n&&(r=ni(r,{range:n})),i.match(r).then((e=>{const n=function(e){if(!e)return!1;const t=new Date(e.headers.get("Expires")||0),i=ct(e.headers.get("Cache-Control")||"");return Number(t)>Date.now()&&!i["no-cache"]}(e);i.delete(r).catch(t),n&&i.put(r,e.clone()).catch(t),t(null,e,n)})).catch(t)})).catch(t)}(r,l):l(null,null),{cancel:()=>{o=!0,n||i.abort()}}}(e,t);if(lt(self)&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var i;return function(e,t){const i=new XMLHttpRequest;i.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(i.responseType="arraybuffer");for(const t in e.headers)i.setRequestHeader(t,e.headers[t]);return"json"===e.type&&(i.responseType="text",i.setRequestHeader("Accept","application/json")),i.withCredentials="include"===e.credentials,i.onerror=()=>{t(new Error(i.statusText))},i.onload=()=>{if((i.status>=200&&i.status<300||0===i.status)&&null!==i.response){let r=i.response;if("json"===e.type)try{r=JSON.parse(i.response)}catch(e){return t(e)}t(null,r,i.getResponseHeader("Cache-Control"),i.getResponseHeader("Expires"))}else t(new AJAXError(i.statusText,i.status,e.url))},i.send(e.body),{cancel:()=>i.abort()}}(e,t)},Ai=function(e,t){return Si(He(e,{type:"json"}),t)},Ii=function(e,t){return Si(He(e,{type:"arrayBuffer"}),t)};function Ci(e){const t=document.createElement("a");return t.href=e,t.protocol===location.protocol&&t.host===location.host}const Mi="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let Di,Pi;Di=[],Pi=0;const Li=function(e,t){if(_i.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),Pi>=Et.MAX_PARALLEL_IMAGE_REQUESTS){const i={requestParameters:e,callback:t,cancelled:!1,cancel(){this.cancelled=!0}};return Di.push(i),i}Pi++;let i=!1;const r=()=>{if(!i)for(i=!0,Pi--;Di.length&&Pi<Et.MAX_PARALLEL_IMAGE_REQUESTS;){const e=Di.shift(),{requestParameters:t,callback:i,cancelled:r}=e;r||(e.cancel=Li(t,i).cancel)}},n=Ii(e,((e,i,n,o)=>{r(),e?t(e):i&&(self.createImageBitmap?function(e,t){const i=new Blob([new Uint8Array(e)],{type:"image/png"});createImageBitmap(i).then((e=>{t(null,e)})).catch((e=>{t(new Error(`Could not load image because of ${e.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))}))}(i,((e,i)=>t(e,i,n,o))):function(e,t){const i=new Image;i.onload=()=>{t(null,i),URL.revokeObjectURL(i.src),i.onload=null,requestAnimationFrame((()=>{i.src=Mi}))},i.onerror=()=>t(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const r=new Blob([new Uint8Array(e)],{type:"image/png"});i.src=e.byteLength?URL.createObjectURL(r):Mi}(i,((e,i)=>t(e,i,n,o))))}));return{cancel:()=>{n.cancel(),r()}}},Ri="01",zi="NO_ACCESS_TOKEN";class RequestManager{constructor(e,t,i){this._transformRequestFn=e,this._customAccessToken=t,this._silenceAuthErrors=!!i,this._createSkuToken()}_createSkuToken(){const e=function(){let e="";for(let t=0;t<10;t++)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",Ri,e].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}normalizeStyleURL(e,t){if(!It(e))return e;const i=Oi(e);return i.params.push(`sdk=js-${Tt}`),i.path=`/styles/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||t)}normalizeGlyphsURL(e,t){if(!It(e))return e;const i=Oi(e);return i.path=`/fonts/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||t)}normalizeModelURL(e,t){if(!It(e))return e;const i=Oi(e);return i.path=`/models/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||t)}normalizeSourceURL(e,t,i,r){if(!It(e))return e;const n=Oi(e);return n.path=`/v4/${n.authority}.json`,n.params.push("secure"),i&&n.params.push(`language=${i}`),r&&n.params.push(`worldview=${r}`),this._makeAPIURL(n,this._customAccessToken||t)}normalizeIconsetURL(e,t){const i=Oi(e);return It(e)?(i.path=`/styles/v1${i.path}/iconset.pbf`,this._makeAPIURL(i,this._customAccessToken||t)):Bi(i)}normalizeSpriteURL(e,t,i,r){const n=Oi(e);return It(e)?(n.path=`/styles/v1${n.path}/sprite${t}${i}`,this._makeAPIURL(n,this._customAccessToken||r)):(n.path+=`${t}${i}`,Bi(n))}normalizeTileURL(e,t,i){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!It(e))return e;const r=Oi(e);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${t||i&&"raster"!==r.authority&&512===i?"@2x":""}${_i.supported?".webp":"$1"}`),"raster"===r.authority?r.path=`/${Et.RASTER_URL_PREFIX}${r.path}`:"rasterarrays"===r.authority?r.path=`/${Et.RASTERARRAYS_URL_PREFIX}${r.path}`:"3dtiles"===r.authority?r.path=`/${Et.TILES3D_URL_PREFIX}${r.path}`:(r.path=r.path.replace(/^.+\/v4\//,"/"),r.path=`/${Et.TILE_URL_VERSION}${r.path}`);const n=this._customAccessToken||function(e){for(const t of e){const e=t.match(/^access_token=(.*)$/);if(e)return e[1]}return null}(r.params)||Et.ACCESS_TOKEN;return Et.REQUIRE_ACCESS_TOKEN&&n&&this._skuToken&&r.params.push(`sku=${this._skuToken}`),this._makeAPIURL(r,n)}canonicalizeTileURL(e,t){const i=Oi(e);if(!i.path.match(/^(\/v4\/|\/(raster|rasterarrays)\/v1\/)/)||!i.path.match(/\.[\w]+$/))return e;let r="mapbox://";i.path.match(/^\/raster\/v1\//)?r+=`raster/${i.path.replace(`/${Et.RASTER_URL_PREFIX}/`,"")}`:i.path.match(/^\/rasterarrays\/v1\//)?r+=`rasterarrays/${i.path.replace(`/${Et.RASTERARRAYS_URL_PREFIX}/`,"")}`:r+=`tiles/${i.path.replace(`/${Et.TILE_URL_VERSION}/`,"")}`;let n=i.params;return t&&(n=n.filter((e=>!e.match(/^access_token=/)))),n.length&&(r+=`?${n.join("&")}`),r}canonicalizeTileset(e,t){const i=!!t&&It(t),r=[];for(const t of e.tiles||[])St(t)?r.push(this.canonicalizeTileURL(t,i)):r.push(t);return r}_makeAPIURL(e,t){const i="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",r=Oi(Et.API_URL);if(e.protocol=r.protocol,e.authority=r.authority,"http"===e.protocol){const t=e.params.indexOf("secure");t>=0&&e.params.splice(t,1)}if("/"!==r.path&&(e.path=`${r.path}${e.path}`),!Et.REQUIRE_ACCESS_TOKEN)return Bi(e);if(t=t||Et.ACCESS_TOKEN,!this._silenceAuthErrors){if(!t)throw new Error(`An API access token is required to use Mapbox GL. ${i}`);if("s"===t[0])throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${i}`)}return e.params=e.params.filter((e=>-1===e.indexOf("access_token"))),e.params.push(`access_token=${t||""}`),Bi(e)}}const Fi=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Oi(e){const t=e.match(Fi);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function Bi(e){const t=e.params.length?`?${e.params.join("&")}`:"";return`${e.protocol}://${e.authority}${e.path}${t}`}const ki="mapbox.eventData";function Ui(e){if(!e)return null;const t=e.split(".");if(!t||3!==t.length)return null;try{return JSON.parse(decodeURIComponent(atob(t[1]).split("").map((e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join("")))}catch(e){return null}}class TelemetryEvent{constructor(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(e){const t=Ui(Et.ACCESS_TOKEN);let i="";return i=t&&t.u?btoa(encodeURIComponent(t.u).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(Number("0x"+t))))):Et.ACCESS_TOKEN||"",e?`${ki}.${e}:${i}`:`${ki}:${i}`}fetchEventData(){const e=dt("localStorage"),t=this.getStorageKey(),i=this.getStorageKey("uuid");if(e)try{const e=localStorage.getItem(t);e&&(this.eventData=JSON.parse(e));const r=localStorage.getItem(i);r&&(this.anonId=r)}catch(e){rt("Unable to read from LocalStorage")}}saveEventData(){const e=dt("localStorage"),t=this.getStorageKey(),i=this.getStorageKey("uuid"),r=this.anonId;if(e&&r)try{localStorage.setItem(i,r),Object.keys(this.eventData).length>=1&&localStorage.setItem(t,JSON.stringify(this.eventData))}catch(e){rt("Unable to write to LocalStorage")}}processRequests(e){}postEvent(e,t,i,r){if(!Et.EVENTS_URL)return;const n=Oi(Et.EVENTS_URL);n.params.push(`access_token=${r||Et.ACCESS_TOKEN||""}`);const o={event:this.type,created:new Date(e).toISOString()},s=t?He(o,t):o,a={url:Bi(n),headers:{"Content-Type":"text/plain"},body:JSON.stringify([s])};this.pendingRequest=function(e,t){return Si(He(e,{method:"POST"}),t)}(a,(e=>{this.pendingRequest=null,i(e),this.saveEventData(),this.processRequests(r)}))}queueRequest(e,t){this.queue.push(e),this.processRequests(t)}}const Ni=new class TurnstileEvent extends TelemetryEvent{constructor(e){super("appUserTurnstile"),this._customAccessToken=e}postTurnstileEvent(e,t){Et.EVENTS_URL&&Et.ACCESS_TOKEN&&Array.isArray(e)&&e.some((e=>It(e)||St(e)))&&this.queueRequest(Date.now(),t)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const t=Ui(Et.ACCESS_TOKEN),i=t?t.u:Et.ACCESS_TOKEN;let r=i!==this.eventData.tokenU;Ye(this.anonId)||(this.anonId=We(),r=!0);const n=this.queue.shift();if(this.eventData.lastSuccess){const e=new Date(this.eventData.lastSuccess),t=new Date(n),i=(n-this.eventData.lastSuccess)/864e5;r=r||i>=1||i<-1||e.getDate()!==t.getDate()}else r=!0;r?this.postEvent(n,{sdkIdentifier:"mapbox-gl-js",sdkVersion:Tt,skuId:Ri,"enabled.telemetry":!1,userId:this.anonId},(e=>{e||(this.eventData.lastSuccess=n,this.eventData.tokenU=i)}),e):this.processRequests()}},Vi=Ni.postTurnstileEvent.bind(Ni),ji=new class MapLoadEvent extends TelemetryEvent{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(e,t,i,r){this.skuToken=t,this.errorCb=r,Et.EVENTS_URL&&(i||Et.ACCESS_TOKEN?this.queueRequest({id:e,timestamp:Date.now()},i):this.errorCb(new Error(zi)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{id:t,timestamp:i}=this.queue.shift();t&&this.success[t]||(this.anonId||this.fetchEventData(),Ye(this.anonId)||(this.anonId=We()),this.postEvent(i,{sdkIdentifier:"mapbox-gl-js",sdkVersion:Tt,skuId:Ri,skuToken:this.skuToken,userId:this.anonId},(e=>{e?this.errorCb(e):t&&(this.success[t]=!0)}),e))}remove(){this.errorCb=null}},Gi=ji.postMapLoadEvent.bind(ji),Hi=new class StyleLoadEvent extends TelemetryEvent{constructor(){super("style.load"),this.eventIdPerMapInstanceMap=new Map,this.mapInstanceIdMap=new WeakMap}getMapInstanceId(e){let t=this.mapInstanceIdMap.get(e);return t||(t=We(),this.mapInstanceIdMap.set(e,t)),t}getEventId(e){const t=this.eventIdPerMapInstanceMap.get(e)||0;return this.eventIdPerMapInstanceMap.set(e,t+1),t}postStyleLoadEvent(e,t){const{map:i,style:r,importedStyles:n}=t;if(!Et.EVENTS_URL||!e&&!Et.ACCESS_TOKEN)return;const o=this.getMapInstanceId(i),s={mapInstanceId:o,eventId:this.getEventId(o),style:r};n.length&&(s.importedStyles=n),this.queueRequest({timestamp:Date.now(),payload:s},e)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:t,payload:i}=this.queue.shift();this.postEvent(t,i,(()=>{}),e)}},qi=Hi.postStyleLoadEvent.bind(Hi),Zi=new class PerformanceEvent extends TelemetryEvent{constructor(){super("gljs.performance")}postPerformanceEvent(e,t){Et.EVENTS_URL&&(e||Et.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:t},e)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:t,performanceData:i}=this.queue.shift(),r=function(e){const t=performance.getEntriesByType("resource"),i=performance.getEntriesByType("mark"),r=function(e){const t={};if(e)for(const i in e)if("other"!==i)for(const r of e[i]){const e=`${i}ResolveRangeMin`,n=`${i}ResolveRangeMax`,o=`${i}RequestCount`,s=`${i}RequestCachedCount`;t[e]=Math.min(t[e]||1/0,r.startTime),t[n]=Math.max(t[n]||-1/0,r.responseEnd);const a=e=>{void 0===t[e]&&(t[e]=0),++t[e]};void 0!==r.transferSize&&0===r.transferSize&&a(s),a(o)}return t}(function(e,t){const i={};if(e)for(const r of e){const e=t(r);void 0===i[e]&&(i[e]=[]),i[e].push(r)}return i}(t,Rt)),n=window.devicePixelRatio,o=navigator.connection||navigator.mozConnection||navigator.webkitConnection,s=o?o.effectiveType:void 0,a={counters:[],metadata:[],attributes:[]},l=(e,t,i)=>{null!=i&&e.push({name:t,value:i.toString()})};for(const e in r)l(a.counters,e,r[e]);if(e.interactionRange[0]!==1/0&&e.interactionRange[1]!==-1/0&&(l(a.counters,"interactionRangeMin",e.interactionRange[0]),l(a.counters,"interactionRangeMax",e.interactionRange[1])),i)for(const e of Object.keys(Pt)){const t=Pt[e],r=i.find((e=>e.name===t));r&&l(a.counters,t,r.startTime)}return l(a.counters,"visibilityHidden",e.visibilityHidden),l(a.attributes,"style",function(e){if(e)for(const t of e){const e=t.name.split("?")[0];if(Dt(e)){const t=e.split("/").slice(-2);if(2===t.length)return`mapbox://styles/${t[0]}/${t[1]}`}}}(t)),l(a.attributes,"terrainEnabled",e.terrainEnabled?"true":"false"),l(a.attributes,"fogEnabled",e.fogEnabled?"true":"false"),l(a.attributes,"projection",e.projection),l(a.attributes,"zoom",e.zoom),l(a.metadata,"devicePixelRatio",n),l(a.metadata,"connectionEffectiveType",s),l(a.metadata,"navigatorUserAgent",navigator.userAgent),l(a.metadata,"screenWidth",window.screen.width),l(a.metadata,"screenHeight",window.screen.height),l(a.metadata,"windowWidth",window.innerWidth),l(a.metadata,"windowHeight",window.innerHeight),l(a.metadata,"mapWidth",e.width/n),l(a.metadata,"mapHeight",e.height/n),l(a.metadata,"webglRenderer",e.renderer),l(a.metadata,"webglVendor",e.vendor),l(a.metadata,"sdkVersion",Tt),l(a.metadata,"sdkIdentifier","mapbox-gl-js"),a}(i);for(const e of r.metadata);for(const e of r.counters);for(const e of r.attributes);this.postEvent(t,r,(()=>{}),e)}},$i=Zi.postPerformanceEvent.bind(Zi),Wi=new class MapSessionAPI extends TelemetryEvent{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(e,t,i,r){if(!Et.API_URL||!Et.SESSION_PATH)return;const n=Oi(Et.API_URL+Et.SESSION_PATH);n.params.push(`sku=${t||""}`),n.params.push(`access_token=${r||Et.ACCESS_TOKEN||""}`);const o={url:Bi(n),headers:{"Content-Type":"text/plain"}};this.pendingRequest=function(e,t){return Si(He(e,{method:"GET"}),t)}(o,(e=>{this.pendingRequest=null,i(e),this.saveEventData(),this.processRequests(r)}))}getSessionAPI(e,t,i,r){this.skuToken=t,this.errorCb=r,Et.SESSION_PATH&&Et.API_URL&&(i||Et.ACCESS_TOKEN?this.queueRequest({id:e,timestamp:Date.now()},i):this.errorCb(new Error(zi)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{id:t,timestamp:i}=this.queue.shift();t&&this.success[t]||this.getSession(i,this.skuToken,(e=>{e?this.errorCb(e):t&&(this.success[t]=!0)}),e)}remove(){this.errorCb=null}},Xi=Wi.getSessionAPI.bind(Wi),Yi=new Set;function Ki(e,t){t?Yi.add(e):Yi.delete(e)}var Ji,Qi,er,tr={exports:{}},ir={exports:{}},rr={exports:{}},nr=function(){if(er)return tr.exports;er=1;var e=(Ji||(Ji=1,function(e){e.exports=function(e,t){var i,r,n,o,s,a,l,c;for(r=e.length-(i=3&e.length),n=t,s=3432918353,a=461845907,c=0;c<r;)l=255&e.charCodeAt(c)|(255&e.charCodeAt(++c))<<8|(255&e.charCodeAt(++c))<<16|(255&e.charCodeAt(++c))<<24,++c,n=27492+(65535&(o=5*(65535&(n=(n^=l=(65535&(l=(l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,i){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:n^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&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}}(ir)),ir.exports),t=(Qi||(Qi=1,function(e){e.exports=function(e,t){for(var i,r=e.length,n=t^r,o=0;r>=4;)i=1540483477*(65535&(i=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(i>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),r-=4,++o;switch(r){case 3:n^=(255&e.charCodeAt(o+2))<<16;case 2:n^=(255&e.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(o)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0}}(rr)),rr.exports);return tr.exports=e,tr.exports.murmur3=e,tr.exports.murmur2=t,tr.exports}(),or=we(nr);class Event{constructor(e,...t){He(this,t[0]||{}),this.type=e}}class ErrorEvent extends Event{constructor(e,t={}){super("error",He({error:e},t))}}function sr(e,t,i){i[e]&&-1!==i[e].indexOf(t)||(i[e]=i[e]||[],i[e].push(t))}function ar(e,t,i){if(i&&i[e]){const r=i[e].indexOf(t);-1!==r&&i[e].splice(r,1)}}class Evented{on(e,t){return this._listeners=this._listeners||{},sr(e,t,this._listeners),this}off(e,t){return ar(e,t,this._listeners),ar(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},sr(e,t,this._oneTimeListeners),this):new Promise((t=>{this.once(e,t)}))}fire(e,t){const i="string"==typeof e?new Event(e,t):e,r=i.type;if(this.listens(r)){i.target=this;const e=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(const t of e)t.call(this,i);const t=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(const e of t)ar(r,e,this._oneTimeListeners),e.call(this,i);const n=this._eventedParent;n&&(He(i,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),n.fire(i))}else i instanceof ErrorEvent&&console.error(i.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}}class ImageId{constructor(e){"string"==typeof e?this.name=e:(this.name=e.name,this.iconsetId=e.iconsetId)}static from(e){return new ImageId(e)}static toString(e){return e.iconsetId?`${e.name}${e.iconsetId}`:e.name}static parse(e){const[t,i]=e.split("");return new ImageId({name:t,iconsetId:i})}static isEqual(e,t){return e.name===t.name&&e.iconsetId===t.iconsetId}toString(){return ImageId.toString(this)}serialize(){return{name:this.name,iconsetId:this.iconsetId}}}class StyleChanges{constructor(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps=new Set,this._updatedImages={}}isDirty(){return this._changed}setDirty(){this._changed=!0}getUpdatedSourceCaches(){return this._updatedSourceCaches}updateSourceCache(e,t){this._updatedSourceCaches[e]=t,this.setDirty()}discardSourceCacheUpdate(e){delete this._updatedSourceCaches[e]}updateLayer(e){const t=e.scope;this._updatedLayers[t]=this._updatedLayers[t]||new Set,this._updatedLayers[t].add(e.id),this.setDirty()}removeLayer(e){const t=e.scope;this._removedLayers[t]=this._removedLayers[t]||{},this._updatedLayers[t]=this._updatedLayers[t]||new Set,this._removedLayers[t][e.id]=e,this._updatedLayers[t].delete(e.id),this._updatedPaintProps.delete(e.fqid),this.setDirty()}getRemovedLayer(e){return this._removedLayers[e.scope]?this._removedLayers[e.scope][e.id]:null}discardLayerRemoval(e){this._removedLayers[e.scope]&&delete this._removedLayers[e.scope][e.id]}getLayerUpdatesByScope(){const e={};for(const t in this._updatedLayers)e[t]=e[t]||{},e[t].updatedIds=Array.from(this._updatedLayers[t].values());for(const t in this._removedLayers)e[t]=e[t]||{},e[t].removedIds=Object.keys(this._removedLayers[t]);return e}getUpdatedPaintProperties(){return this._updatedPaintProps}updatePaintProperties(e){this._updatedPaintProps.add(e.fqid),this.setDirty()}getUpdatedImages(e){return this._updatedImages[e]?Array.from(this._updatedImages[e].values()):[]}updateImage(e,t){this._updatedImages[t]=this._updatedImages[t]||new Set,this._updatedImages[t].add(ImageId.toString(e)),this.setDirty()}resetUpdatedImages(e){this._updatedImages[e]&&this._updatedImages[e].clear()}reset(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps.clear(),this._updatedImages={}}}var lr,cr={},hr=function(){if(lr)return cr;lr=1;var e={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenye