0)for(a=-1;++a=d[0]&&l<=d[1]&&((s=c[o.bisect(h,l,1,f)-1]).y+=m,s.push(i[a]));return c}return i.value=function(e){return arguments.length?(t=e,i):t},i.range=function(e){return arguments.length?(r=mt(e),i):r},i.bins=function(e){return arguments.length?(n="number"===typeof e?function(t){return wn(t,e)}:mt(e),i):n},i.frequency=function(t){return arguments.length?(e=!!t,i):e},i},o.layout.pack=function(){var e,t=o.layout.hierarchy().sort(Sn),r=0,n=[1,1];function i(i,o){var a=t.call(this,i,o),s=a[0],l=n[0],c=n[1],u=null==e?Math.sqrt:"function"===typeof e?e:function(){return e};if(s.x=s.y=0,on(s,(function(e){e.r=+u(e.value)})),on(s,Cn),r){var d=r*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;on(s,(function(e){e.r+=d})),on(s,Cn),on(s,(function(e){e.r-=d}))}return Pn(s,l/2,c/2,e?1:1/Math.max(2*s.r/l,2*s.r/c)),a}return i.size=function(e){return arguments.length?(n=e,i):n},i.radius=function(t){return arguments.length?(e=null==t||"function"===typeof t?t:+t,i):e},i.padding=function(e){return arguments.length?(r=+e,i):r},rn(i,t)},o.layout.tree=function(){var e=o.layout.hierarchy().sort(null).value(null),t=Rn,r=[1,1],n=null;function i(i,o){var c=e.call(this,i,o),u=c[0],d=function(e){var t,r={A:null,children:[e]},n=[r];for(;null!=(t=n.pop());)for(var i,o=t.children,a=0,s=o.length;ap.x&&(p=e),e.depth>f.depth&&(f=e)}));var m=t(h,p)/2-h.x,g=r[0]/(p.x+t(p,h)/2+m),y=r[1]/(f.depth||1);nn(u,(function(e){e.x=(e.x+m)*g,e.y=e.depth*y}))}return c}function a(e){var r=e.children,n=e.parent.children,i=e.i?n[e.i-1]:null;if(r.length){!function(e){var t,r=0,n=0,i=e.children,o=i.length;for(;--o>=0;)(t=i[o]).z+=r,t.m+=r,r+=t.s+(n+=t.c)}(e);var o=(r[0].z+r[r.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,r,n){if(r){for(var i,o=e,a=e,s=r,l=o.parent.children[0],c=o.m,u=a.m,d=s.m,h=l.m;s=Dn(s),o=Ln(o),s&&o;)l=Ln(l),(a=Dn(a)).a=e,(i=s.z+d-o.z-c+t(s._,o._))>0&&(zn(jn(s,e,n),e,i),c+=i,u+=i),d+=s.m,c+=o.m,h+=l.m,u+=a.m;s&&!Dn(a)&&(a.t=s,a.m+=d-u),o&&!Ln(l)&&(l.t=o,l.m+=c-h,n=e)}return n}(e,i,e.parent.A||n[0])}function s(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function l(e){e.x*=r[0],e.y=e.depth*r[1]}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(e){return arguments.length?(n=null==(r=e)?l:null,i):n?null:r},i.nodeSize=function(e){return arguments.length?(n=null==(r=e)?null:l,i):n?r:null},rn(i,e)},o.layout.cluster=function(){var e=o.layout.hierarchy().sort(null).value(null),t=Rn,r=[1,1],n=!1;function i(i,a){var s,l=e.call(this,i,a),c=l[0],u=0;on(c,(function(e){var r=e.children;r&&r.length?(e.x=function(e){return e.reduce((function(e,t){return e+t.x}),0)/e.length}(r),e.y=function(e){return 1+o.max(e,(function(e){return e.y}))}(r)):(e.x=s?u+=t(e,s):0,e.y=0,s=e)}));var d=Fn(c),h=Nn(c),p=d.x-t(d,h)/2,f=h.x+t(h,d)/2;return on(c,n?function(e){e.x=(e.x-c.x)*r[0],e.y=(c.y-e.y)*r[1]}:function(e){e.x=(e.x-p)/(f-p)*r[0],e.y=(1-(c.y?e.y/c.y:1))*r[1]}),l}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(e){return arguments.length?(n=null==(r=e),i):n?null:r},i.nodeSize=function(e){return arguments.length?(n=null!=(r=e),i):n?r:null},rn(i,e)},o.layout.treemap=function(){var e,t=o.layout.hierarchy(),r=Math.round,n=[1,1],i=null,a=Bn,s=!1,l="squarify",c=.5*(1+Math.sqrt(5));function u(e,t){for(var r,n,i=-1,o=e.length;++i0;)s.push(r=c[i-1]),s.area+=r.area,"squarify"!==l||(n=p(s,m))<=h?(c.pop(),h=n):(s.area-=s.pop().area,f(s,m,o,!1),m=Math.min(o.dx,o.dy),s.length=s.area=0,h=1/0);s.length&&(f(s,m,o,!0),s.length=s.area=0),t.forEach(d)}}function h(e){var t=e.children;if(t&&t.length){var r,n=a(e),i=t.slice(),o=[];for(u(i,n.dx*n.dy/e.value),o.area=0;r=i.pop();)o.push(r),o.area+=r.area,null!=r.z&&(f(o,r.z?n.dx:n.dy,n,!i.length),o.length=o.area=0);t.forEach(h)}}function p(e,t){for(var r,n=e.area,i=0,o=1/0,a=-1,s=e.length;++ai&&(i=r));return t*=t,(n*=n)?Math.max(t*i*c/n,n/(t*o*c)):1/0}function f(e,t,n,i){var o,a=-1,s=e.length,l=n.x,c=n.y,u=t?r(e.area/t):0;if(t==n.dx){for((i||u>n.dy)&&(u=n.dy);++an.dx)&&(u=n.dx);++a1);return e+t*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var e=o.random.normal.apply(o,arguments);return function(){return Math.exp(e())}},bates:function(e){var t=o.random.irwinHall(e);return function(){return t()/e}},irwinHall:function(e){return function(){for(var t=0,r=0;r2?Yn:$n,l=n?Wr:$r;return i=a(e,t,l,r),o=a(t,e,l,kr),s}function s(e){return i(e)}return s.invert=function(e){return o(e)},s.domain=function(t){return arguments.length?(e=t.map(Number),a()):e},s.range=function(e){return arguments.length?(t=e,a()):t},s.rangeRound=function(e){return s.range(e).interpolate(jr)},s.clamp=function(e){return arguments.length?(n=e,a()):n},s.interpolate=function(e){return arguments.length?(r=e,a()):r},s.ticks=function(t){return Qn(e,t)},s.tickFormat=function(t,r){return d3_scale_linearTickFormat(e,t,r)},s.nice=function(t){return Kn(e,t),a()},s.copy=function(){return Xn(e,t,r,n)},a()}function Zn(e,t){return o.rebind(e,t,"range","rangeRound","interpolate","clamp")}function Kn(e,t){return Wn(e,qn(Jn(e,t)[2])),Wn(e,qn(Jn(e,t)[2])),e}function Jn(e,t){null==t&&(t=10);var r=Un(e),n=r[1]-r[0],i=Math.pow(10,Math.floor(Math.log(n/t)/Math.LN10)),o=t/n*i;return o<=.15?i*=10:o<=.35?i*=5:o<=.75&&(i*=2),r[0]=Math.ceil(r[0]/i)*i,r[1]=Math.floor(r[1]/i)*i+.5*i,r[2]=i,r}function Qn(e,t){return o.range.apply(o,Jn(e,t))}o.scale.linear=function(){return Xn([0,1],[0,1],kr,!1)};function ei(e,t,r,n){function i(e){return(r?Math.log(e<0?0:e):-Math.log(e>0?0:-e))/Math.log(t)}function o(e){return r?Math.pow(t,e):-Math.pow(t,-e)}function a(t){return e(i(t))}return a.invert=function(t){return o(e.invert(t))},a.domain=function(t){return arguments.length?(r=t[0]>=0,e.domain((n=t.map(Number)).map(i)),a):n},a.base=function(r){return arguments.length?(t=+r,e.domain(n.map(i)),a):t},a.nice=function(){var t=Wn(n.map(i),r?Math:ti);return e.domain(t),n=t.map(o),a},a.ticks=function(){var e=Un(n),a=[],s=e[0],l=e[1],c=Math.floor(i(s)),u=Math.ceil(i(l)),d=t%1?2:t;if(isFinite(u-c)){if(r){for(;c0;h--)a.push(o(c)*h);for(c=0;a[c]l;u--);a=a.slice(c,u)}return a},a.copy=function(){return ei(e.copy(),t,r,n)},Zn(a,e)}o.scale.log=function(){return ei(o.scale.linear().domain([0,1]),10,!0,[1,10])};var ti={floor:function(e){return-Math.ceil(-e)},ceil:function(e){return-Math.floor(-e)}};function ri(e,t,r){var n=ni(t),i=ni(1/t);function o(t){return e(n(t))}return o.invert=function(t){return i(e.invert(t))},o.domain=function(t){return arguments.length?(e.domain((r=t.map(Number)).map(n)),o):r},o.ticks=function(e){return Qn(r,e)},o.tickFormat=function(e,t){return d3_scale_linearTickFormat(r,e,t)},o.nice=function(e){return o.domain(Kn(r,e))},o.exponent=function(a){return arguments.length?(n=ni(t=a),i=ni(1/t),e.domain(r.map(n)),o):t},o.copy=function(){return ri(e.copy(),t,r)},Zn(o,e)}function ni(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function ii(e,t){var r,n,i;function a(i){return n[((r.get(i)||("range"===t.t?r.set(i,e.push(i)):NaN))-1)%n.length]}function s(t,r){return o.range(e.length).map((function(e){return t+r*e}))}return a.domain=function(n){if(!arguments.length)return e;e=[],r=new S;for(var i,o=-1,s=n.length;++o0?r[n-1]:e[0],nd?0:1;if(c=Ie)return l(c,p)+(s?l(s,1-p):"")+"Z";var f,m,g,y,v,x,b,_,w,k,S,A,T=0,M=0,C=[];if((y=(+a.apply(this,arguments)||0)/2)&&(g=n===fi?Math.sqrt(s*s+c*c):+n.apply(this,arguments),p||(M*=-1),c&&(M=Le(g/c*Math.sin(y))),s&&(T=Le(g/s*Math.sin(y)))),c){v=c*Math.cos(u+M),x=c*Math.sin(u+M),b=c*Math.cos(d-M),_=c*Math.sin(d-M);var E=Math.abs(d-u-2*M)<=Ce?0:1;if(M&&bi(v,x,b,_)===p^E){var I=(u+d)/2;v=c*Math.cos(I),x=c*Math.sin(I),b=_=null}}else v=x=0;if(s){w=s*Math.cos(d-T),k=s*Math.sin(d-T),S=s*Math.cos(u+T),A=s*Math.sin(u+T);var P=Math.abs(u-d+2*T)<=Ce?0:1;if(T&&bi(w,k,S,A)===1-p^P){var O=(u+d)/2;w=s*Math.cos(O),k=s*Math.sin(O),S=A=null}}else w=k=0;if(h>Te&&(f=Math.min(Math.abs(c-s)/2,+r.apply(this,arguments)))>.001){m=s0?0:1}function _i(e,t,r,n,i){var o=e[0]-t[0],a=e[1]-t[1],s=(i?n:-n)/Math.sqrt(o*o+a*a),l=s*a,c=-s*o,u=e[0]+l,d=e[1]+c,h=t[0]+l,p=t[1]+c,f=(u+h)/2,m=(d+p)/2,g=h-u,y=p-d,v=g*g+y*y,x=r-n,b=u*p-h*d,_=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*v-b*b)),w=(b*y-g*_)/v,k=(-b*g-y*_)/v,S=(b*y+g*_)/v,A=(-b*g+y*_)/v,T=w-f,M=k-m,C=S-f,E=A-m;return T*T+M*M>C*C+E*E&&(w=S,k=A),[[w-l,k-c],[w*r/x,k*r/x]]}function wi(){return!0}function ki(e){var t=Mt,r=Ct,n=wi,i=Ai,o=i.key,a=.7;function s(o){var s,l=[],c=[],u=-1,d=o.length,h=mt(t),p=mt(r);function f(){l.push("M",i(e(c),a))}for(;++u1&&i.push("H",n[0]);return i.join("")},"step-before":Mi,"step-after":Ci,basis:Pi,"basis-open":function(e){if(e.length<4)return Ai(e);var t,r=[],n=-1,i=e.length,o=[0],a=[0];for(;++n<3;)t=e[n],o.push(t[0]),a.push(t[1]);r.push(Oi(Di,o)+","+Oi(Di,a)),--n;for(;++n9&&(i=3*t/Math.sqrt(i),a[s]=i*r,a[s+1]=i*n);s=-1;for(;++s<=l;)i=(e[Math.min(l,s+1)][0]-e[Math.max(0,s-1)][0])/(6*(1+a[s]*a[s])),o.push([i||0,a[s]*i||0]);return o}(e))}});function Ai(e){return e.length>1?e.join("L"):e+"Z"}function Ti(e){return e.join("L")+"Z"}function Mi(e){for(var t=0,r=e.length,n=e[0],i=[n[0],",",n[1]];++t1){s=t[1],o=e[l],l++,n+="C"+(i[0]+a[0])+","+(i[1]+a[1])+","+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1];for(var c=2;cCe)+",1 "+t}function l(e,t,r,n){return"Q 0,0 "+n}return o.radius=function(e){return arguments.length?(r=mt(e),o):r},o.source=function(t){return arguments.length?(e=mt(t),o):e},o.target=function(e){return arguments.length?(t=mt(e),o):t},o.startAngle=function(e){return arguments.length?(n=mt(e),o):n},o.endAngle=function(e){return arguments.length?(i=mt(e),o):i},o},o.svg.diagonal=function(){var e=Bi,t=Vi,r=Hi;function n(n,i){var o=e.call(this,n,i),a=t.call(this,n,i),s=(o.y+a.y)/2,l=[o,{x:o.x,y:s},{x:a.x,y:s},a];return"M"+(l=l.map(r))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}return n.source=function(t){return arguments.length?(e=mt(t),n):e},n.target=function(e){return arguments.length?(t=mt(e),n):t},n.projection=function(e){return arguments.length?(r=e,n):r},n},o.svg.diagonal.radial=function(){var e=o.svg.diagonal(),t=Hi,r=e.projection;return e.projection=function(e){return arguments.length?r(function(e){return function(){var t=e.apply(this,arguments),r=t[0],n=t[1]-Pe;return[r*Math.cos(n),r*Math.sin(n)]}}(t=e)):t},e},o.svg.symbol=function(){var e=Wi,t=$i;function r(r,n){return(Gi.get(e.call(this,r,n))||qi)(t.call(this,r,n))}return r.type=function(t){return arguments.length?(e=mt(t),r):e},r.size=function(e){return arguments.length?(t=mt(e),r):t},r};var Gi=o.map({circle:qi,cross:function(e){var t=Math.sqrt(e/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(e){var t=Math.sqrt(e/(2*Xi)),r=t*Xi;return"M0,"+-t+"L"+r+",0 0,"+t+" "+-r+",0Z"},square:function(e){var t=Math.sqrt(e)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(e){var t=Math.sqrt(e/Yi),r=t*Yi/2;return"M0,"+r+"L"+t+","+-r+" "+-t+","+-r+"Z"},"triangle-up":function(e){var t=Math.sqrt(e/Yi),r=t*Yi/2;return"M0,"+-r+"L"+t+","+r+" "+-t+","+r+"Z"}});o.svg.symbolTypes=Gi.keys();var Yi=Math.sqrt(3),Xi=Math.tan(30*Oe);X.transition=function(e){for(var t,r,n=Qi||++ro,i=oo(e),o=[],a=eo||{time:Date.now(),ease:Or,delay:0,duration:250},s=-1,l=this.length;++s0;)c[--h].call(e,a);if(o>=1)return d.event&&d.event.end.call(e,e.__data__,t),--u.count?delete u[n]:delete e[r],1}d||(o=i.time,a=kt((function(e){var t=d.delay;if(a.t=t+o,t<=e)return h(e-t);a.c=h}),0,o),d=u[n]={tween:new S,time:o,timer:a,delay:i.delay,duration:i.duration,ease:i.ease,index:t},i=null,++u.count)}to.call=X.call,to.empty=X.empty,to.node=X.node,to.size=X.size,o.transition=function(e,t){return e&&e.transition?Qi?e.transition(t):e:o.selection().transition(e)},o.transition.prototype=to,to.select=function(e){var t,r,n,i=this.id,o=this.namespace,a=[];e=Z(e);for(var s=-1,l=this.length;++srect,.s>rect").attr("width",a[1]-a[0])}function m(e){e.select(".extent").attr("y",s[0]),e.selectAll(".extent,.e>rect,.w>rect").attr("height",s[1]-s[0])}function g(){var d,g,y=this,v=o.select(o.event.target),x=r.of(y,arguments),b=o.select(y),_=v.datum(),w=!/^(n|s)$/.test(_)&&n,k=!/^(e|w)$/.test(_)&&i,S=v.classed("extent"),A=we(y),T=o.mouse(y),M=o.select(u(y)).on("keydown.brush",(function(){32==o.event.keyCode&&(S||(d=null,T[0]-=a[1],T[1]-=s[1],S=2),B())})).on("keyup.brush",(function(){32==o.event.keyCode&&2==S&&(T[0]+=a[1],T[1]+=s[1],S=0,B())}));if(o.event.changedTouches?M.on("touchmove.brush",I).on("touchend.brush",O):M.on("mousemove.brush",I).on("mouseup.brush",O),b.interrupt().selectAll("*").interrupt(),S)T[0]=a[0]-T[0],T[1]=s[0]-T[1];else if(_){var C=+/w$/.test(_),E=+/^n/.test(_);g=[a[1-C]-T[0],s[1-E]-T[1]],T[0]=a[C],T[1]=s[E]}else o.event.altKey&&(d=T.slice());function I(){var e=o.mouse(y),t=!1;g&&(e[0]+=g[0],e[1]+=g[1]),S||(o.event.altKey?(d||(d=[(a[0]+a[1])/2,(s[0]+s[1])/2]),T[0]=a[+(e[0](n=1))return n;for(;ro?r=i:n=i,i=.5*(n-r)+r}return i},i.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var o=a;function a(e,t){this.x=e,this.y=t}a.prototype={clone:function(){return new a(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,r=e.y-this.y;return t*t+r*r},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[0]*this.x+e[1]*this.y,r=e[2]*this.x+e[3]*this.y;return this.x=t,this.y=r,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),r=Math.sin(e),n=t*this.x-r*this.y,i=r*this.x+t*this.y;return this.x=n,this.y=i,this},_rotateAround:function(e,t){var r=Math.cos(e),n=Math.sin(e),i=t.x+r*(this.x-t.x)-n*(this.y-t.y),o=t.y+n*(this.x-t.x)+r*(this.y-t.y);return this.x=i,this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},a.convert=function(e){return e instanceof a?e:Array.isArray(e)?new a(e[0],e[1]):e};var s="undefined"!==typeof self?self:{};function l(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var r=0;r=1)return 1;var t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function d(e,t,r,i){var o=new n(e,t,r,i);return function(e){return o.solve(e)}}var h=d(.25,.1,.25,1);function p(e,t,r){return Math.min(r,Math.max(t,e))}function f(e,t,r){var n=r-t,i=((e-t)%n+n)%n+t;return i===t?r:i}function m(e,t,r){if(!e.length)return r(null,[]);var n=e.length,i=new Array(e.length),o=null;e.forEach((function(e,a){t(e,(function(e,t){e&&(o=e),i[a]=t,0===--n&&r(o,i)}))}))}function g(e){var t=[];for(var r in e)t.push(e[r]);return t}function y(e,t){var r=[];for(var n in e)n in t||r.push(n);return r}function v(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var n=0,i=t;n>t/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}return e()}function k(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function S(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 A(e,t){e.forEach((function(e){t[e]&&(t[e]=t[e].bind(t))}))}function T(e,t){return-1!==e.indexOf(t,e.length-t.length)}function M(e,t,r){var n={};for(var i in e)n[i]=t.call(r||this,e[i],i,e);return n}function C(e,t,r){var n={};for(var i in e)t.call(r||this,e[i],i,e)&&(n[i]=e[i]);return n}function E(e){return Array.isArray(e)?e.map(E):"object"===typeof e&&e?M(e,E):e}function I(e,t){for(var r=0;r=0)return!0;return!1}var P={};function O(e){P[e]||("undefined"!==typeof console&&console.warn(e),P[e]=!0)}function R(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function L(e){for(var t=0,r=0,n=e.length,i=n-1,o=void 0,a=void 0;r@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,r={};if(e.replace(t,(function(e,t,n,i){var o=n||i;return r[t]=!o||o.toLowerCase(),""})),r["max-age"]){var n=parseInt(r["max-age"],10);isNaN(n)?delete r["max-age"]:r["max-age"]=n}return r}var F=null;function N(e){if(null==F){var t=e.navigator?e.navigator.userAgent:null;F=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return F}function B(e){try{var t=s[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch(r){return!1}}function V(e){return s.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode(Number("0x"+t))})))}function U(e){return decodeURIComponent(s.atob(e).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""))}var H,$,W,q,G=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),Y=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,X=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,Z={now:G,frame:function(e){var t=Y(e);return{cancel:function(){return X(t)}}},getImageData:function(e,t){void 0===t&&(t=0);var r=s.document.createElement("canvas"),n=r.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,n.drawImage(e,0,0,e.width,e.height),n.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:function(e){return H||(H=s.document.createElement("a")),H.href=e,H.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return!!s.matchMedia&&(null==$&&($=s.matchMedia("(prefers-reduced-motion: reduce)")),$.matches)}},K={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},J={supported:!1,testSupport:te},Q=!1,ee=!1;function te(e){!Q&&q&&(ee?re(e):W=e)}function re(e){var t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,q),e.isContextLost())return;J.supported=!0}catch(r){}e.deleteTexture(t),Q=!0}s.document&&((q=s.document.createElement("img")).onload=function(){W&&re(W),W=null,ee=!0},q.onerror=function(){Q=!0,W=null},q.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var ne="01";function ie(){for(var e="1",t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",r="",n=0;n<10;n++)r+=t[Math.floor(62*Math.random())];var i=432e5;return{token:[e,ne,r].join(""),tokenExpiresAt:Date.now()+i}}var oe=function(e,t){this._transformRequestFn=e,this._customAccessToken=t,this._createSkuToken()};function ae(e){return 0===e.indexOf("mapbox:")}oe.prototype._createSkuToken=function(){var e=ie();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt},oe.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},oe.prototype.transformRequest=function(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}},oe.prototype.normalizeStyleURL=function(e,t){if(!ae(e))return e;var r=he(e);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},oe.prototype.normalizeGlyphsURL=function(e,t){if(!ae(e))return e;var r=he(e);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},oe.prototype.normalizeSourceURL=function(e,t){if(!ae(e))return e;var r=he(e);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||t)},oe.prototype.normalizeSpriteURL=function(e,t,r,n){var i=he(e);return ae(e)?(i.path="/styles/v1"+i.path+"/sprite"+t+r,this._makeAPIURL(i,this._customAccessToken||n)):(i.path+=""+t+r,pe(i))},oe.prototype.normalizeTileURL=function(e,t){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!ae(e))return e;var r=he(e),n=/(\.(png|jpg)\d*)(?=$)/,i=/^.+\/v4\//,o=Z.devicePixelRatio>=2||512===t?"@2x":"",a=J.supported?".webp":"$1";r.path=r.path.replace(n,""+o+a),r.path=r.path.replace(i,"/"),r.path="/v4"+r.path;var s=this._customAccessToken||ue(r.params)||K.ACCESS_TOKEN;return K.REQUIRE_ACCESS_TOKEN&&s&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,s)},oe.prototype.canonicalizeTileURL=function(e,t){var r="/v4/",n=/\.[\w]+$/,i=he(e);if(!i.path.match(/(^\/v4\/)/)||!i.path.match(n))return e;var o="mapbox://tiles/";o+=i.path.replace(r,"");var a=i.params;return t&&(a=a.filter((function(e){return!e.match(/^access_token=/)}))),a.length&&(o+="?"+a.join("&")),o},oe.prototype.canonicalizeTileset=function(e,t){for(var r=!!t&&ae(t),n=[],i=0,o=e.tiles||[];i=0&&e.params.splice(i,1)}if("/"!==n.path&&(e.path=""+n.path+e.path),!K.REQUIRE_ACCESS_TOKEN)return pe(e);if(!(t=t||K.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if("s"===t[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return e.params=e.params.filter((function(e){return-1===e.indexOf("access_token")})),e.params.push("access_token="+t),pe(e)};var se=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function le(e){return se.test(e)}function ce(e){return e.indexOf("sku=")>0&&le(e)}function ue(e){for(var t=0,r=e;t=1&&s.localStorage.setItem(t,JSON.stringify(this.eventData))}catch(n){O("Unable to write to LocalStorage")}},ge.prototype.processRequests=function(e){},ge.prototype.postEvent=function(e,t,n,i){var o=this;if(K.EVENTS_URL){var a=he(K.EVENTS_URL);a.params.push("access_token="+(i||K.ACCESS_TOKEN||""));var s={event:this.type,created:new Date(e).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:r,skuId:ne,userId:this.anonId},l=t?v(s,t):s,c={url:pe(a),headers:{"Content-Type":"text/plain"},body:JSON.stringify([l])};this.pendingRequest=Ke(c,(function(e){o.pendingRequest=null,n(e),o.saveEventData(),o.processRequests(i)}))}},ge.prototype.queueRequest=function(e,t){this.queue.push(e),this.processRequests(t)};var ye,ve,xe=function(e){function t(){e.call(this,"map.load"),this.success={},this.skuToken=""}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.postMapLoadEvent=function(e,t,r,n){this.skuToken=r,(K.EVENTS_URL&&n||K.ACCESS_TOKEN&&Array.isArray(e)&&e.some((function(e){return ae(e)||le(e)})))&&this.queueRequest({id:t,timestamp:Date.now()},n)},t.prototype.processRequests=function(e){var t=this;if(!this.pendingRequest&&0!==this.queue.length){var r=this.queue.shift(),n=r.id,i=r.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),S(this.anonId)||(this.anonId=w()),this.postEvent(i,{skuToken:this.skuToken},(function(e){e||n&&(t.success[n]=!0)}),e))}},t}(ge),be=function(e){function t(t){e.call(this,"appUserTurnstile"),this._customAccessToken=t}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.postTurnstileEvent=function(e,t){K.EVENTS_URL&&K.ACCESS_TOKEN&&Array.isArray(e)&&e.some((function(e){return ae(e)||le(e)}))&&this.queueRequest(Date.now(),t)},t.prototype.processRequests=function(e){var t=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=me(K.ACCESS_TOKEN),n=r?r.u:K.ACCESS_TOKEN,i=n!==this.eventData.tokenU;S(this.anonId)||(this.anonId=w(),i=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var a=new Date(this.eventData.lastSuccess),s=new Date(o),l=(o-this.eventData.lastSuccess)/864e5;i=i||l>=1||l<-1||a.getDate()!==s.getDate()}else i=!0;if(!i)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(e){e||(t.eventData.lastSuccess=o,t.eventData.tokenU=n)}),e)}},t}(ge),_e=new be,we=_e.postTurnstileEvent.bind(_e),ke=new xe,Se=ke.postMapLoadEvent.bind(ke),Ae="mapbox-tiles",Te=500,Me=50,Ce=42e4;function Ee(){s.caches&&!ye&&(ye=s.caches.open(Ae))}function Ie(e,t){if(void 0===ve)try{new Response(new ReadableStream),ve=!0}catch(r){ve=!1}ve?t(e.body):e.blob().then(t)}function Pe(e,t,r){if(Ee(),ye){var n={status:t.status,statusText:t.statusText,headers:new s.Headers};t.headers.forEach((function(e,t){return n.headers.set(t,e)}));var i=j(t.headers.get("Cache-Control")||"");i["no-store"]||(i["max-age"]&&n.headers.set("Expires",new Date(r+1e3*i["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-rDate.now()&&!r["no-cache"]}var De,ze=1/0;function je(e){++ze>Me&&(e.getActor().send("enforceCacheSizeLimit",Te),ze=0)}function Fe(e){Ee(),ye&&ye.then((function(t){t.keys().then((function(r){for(var n=0;n=200&&r.status<300||0===r.status)&&null!==r.response){var n=r.response;if("json"===e.type)try{n=JSON.parse(r.response)}catch(i){return t(i)}t(null,n,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else t(new He(r.statusText,r.status,e.url))},r.send(e.body),{cancel:function(){return r.abort()}}}var Ye=function(e,t){if(!We(e.url)){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return qe(e,t);if(z()&&self.worker&&self.worker.actor){var r=!0;return self.worker.actor.send("getResource",e,t,void 0,r)}}return Ge(e,t)},Xe=function(e,t){return Ye(v(e,{type:"json"}),t)},Ze=function(e,t){return Ye(v(e,{type:"arrayBuffer"}),t)},Ke=function(e,t){return Ye(v(e,{method:"POST"}),t)};function Je(e){var t=s.document.createElement("a");return t.href=e,t.protocol===s.document.location.protocol&&t.host===s.document.location.host}var Qe,et,tt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function rt(e,t,r,n){var i=new s.Image,o=s.URL;i.onload=function(){t(null,i),o.revokeObjectURL(i.src),i.onload=null,s.requestAnimationFrame((function(){i.src=tt}))},i.onerror=function(){return 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."))};var a=new s.Blob([new Uint8Array(e)],{type:"image/png"});i.cacheControl=r,i.expires=n,i.src=e.byteLength?o.createObjectURL(a):tt}function nt(e,t){var r=new s.Blob([new Uint8Array(e)],{type:"image/png"});s.createImageBitmap(r).then((function(e){t(null,e)})).catch((function(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."))}))}Qe=[],et=0;var it=function(e,t){if(J.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),et>=K.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:e,callback:t,cancelled:!1,cancel:function(){this.cancelled=!0}};return Qe.push(r),r}et++;var n=!1,i=function(){if(!n)for(n=!0,et--;Qe.length&&et0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)},ut.prototype.setEventedParent=function(e,t){return this._eventedParent=e,this._eventedParentData=t,this};var dt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},ht=function(e,t,r,n){this.message=(e?e+": ":"")+r,n&&(this.identifier=n),null!==t&&void 0!==t&&t.__line__&&(this.line=t.__line__)};function pt(e){var t=e.key,r=e.value;return r?[new ht(t,r,"constants have been deprecated as of v8")]:[]}function ft(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var n=0,i=t;n":"value"===e.itemType.kind?"array":"array<"+t+">"}return e.kind}var Ot=[xt,bt,_t,wt,kt,Ct,St,It(At),Et];function Rt(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!Rt(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(var r=0,n=Ot;r255?255:e}function i(e){return e<0?0:e>1?1:e}function o(e){return"%"===e[e.length-1]?n(parseFloat(e)/100*255):n(parseInt(e))}function a(e){return"%"===e[e.length-1]?i(parseFloat(e)/100):i(parseFloat(e))}function s(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}function l(e){var t,i=e.replace(/ /g,"").toLowerCase();if(i in r)return r[i].slice();if("#"===i[0])return 4===i.length?(t=parseInt(i.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===i.length&&(t=parseInt(i.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var l=i.indexOf("("),c=i.indexOf(")");if(-1!==l&&c+1===i.length){var u=i.substr(0,l),d=i.substr(l+1,c-(l+1)).split(","),h=1;switch(u){case"rgba":if(4!==d.length)return null;h=a(d.pop());case"rgb":return 3!==d.length?null:[o(d[0]),o(d[1]),o(d[2]),h];case"hsla":if(4!==d.length)return null;h=a(d.pop());case"hsl":if(3!==d.length)return null;var p=(parseFloat(d[0])%360+360)%360/360,f=a(d[1]),m=a(d[2]),g=m<=.5?m*(f+1):m+f-m*f,y=2*m-g;return[n(255*s(y,g,p+1/3)),n(255*s(y,g,p)),n(255*s(y,g,p-1/3)),h];default:return null}}return null}try{t.parseCSSColor=l}catch(c){}})),jt=zt.parseCSSColor,Ft=function(e,t,r,n){void 0===n&&(n=1),this.r=e,this.g=t,this.b=r,this.a=n};Ft.parse=function(e){if(e){if(e instanceof Ft)return e;if("string"===typeof e){var t=jt(e);if(t)return new Ft(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},Ft.prototype.toString=function(){var e=this.toArray(),t=e[0],r=e[1],n=e[2],i=e[3];return"rgba("+Math.round(t)+","+Math.round(r)+","+Math.round(n)+","+i+")"},Ft.prototype.toArray=function(){var e=this,t=e.r,r=e.g,n=e.b,i=e.a;return 0===i?[0,0,0,0]:[255*t/i,255*r/i,255*n/i,i]},Ft.black=new Ft(0,0,0,1),Ft.white=new Ft(1,1,1,1),Ft.transparent=new Ft(0,0,0,0),Ft.red=new Ft(1,0,0,1);var Nt=function(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"})};Nt.prototype.compare=function(e,t){return this.collator.compare(e,t)},Nt.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var Bt=function(e,t,r,n,i){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=i},Vt=function(e){this.sections=e};Vt.fromString=function(e){return new Vt([new Bt(e,null,null,null,null)])},Vt.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(e){return 0!==e.text.length||e.image&&0!==e.image.name.length}))},Vt.factory=function(e){return e instanceof Vt?e:Vt.fromString(e)},Vt.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(e){return e.text})).join("")},Vt.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t=0&&e<=255&&"number"===typeof t&&t>=0&&t<=255&&"number"===typeof r&&r>=0&&r<=255?"undefined"===typeof n||"number"===typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[e,t,r,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"===typeof n?[e,t,r,n]:[e,t,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function $t(e){if(null===e)return!0;if("string"===typeof e)return!0;if("boolean"===typeof e)return!0;if("number"===typeof e)return!0;if(e instanceof Ft)return!0;if(e instanceof Nt)return!0;if(e instanceof Vt)return!0;if(e instanceof Ut)return!0;if(Array.isArray(e)){for(var t=0,r=e;t2){var s=e[1];if("string"!==typeof s||!(s in Xt)||"object"===s)return t.error('The item type argument of "array" must be one of string, number, boolean',1);o=Xt[s],n++}else o=At;if(e.length>3){if(null!==e[2]&&("number"!==typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);a=e[2],n++}r=It(o,a)}else r=Xt[i];for(var l=[];n1)&&t.push(n)}}return t.concat(this.args.map((function(e){return e.serialize()})))};var Kt=function(e){this.type=Ct,this.sections=e};Kt.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[1];if(!Array.isArray(r)&&"object"===typeof r)return t.error("First argument must be an image or text section.");for(var n=[],i=!1,o=1;o<=e.length-1;++o){var a=e[o];if(i&&"object"===typeof a&&!Array.isArray(a)){i=!1;var s=null;if(a["font-scale"]&&!(s=t.parse(a["font-scale"],1,bt)))return null;var l=null;if(a["text-font"]&&!(l=t.parse(a["text-font"],1,It(_t))))return null;var c=null;if(a["text-color"]&&!(c=t.parse(a["text-color"],1,kt)))return null;var u=n[n.length-1];u.scale=s,u.font=l,u.textColor=c}else{var d=t.parse(e[o],1,At);if(!d)return null;var h=d.type.kind;if("string"!==h&&"value"!==h&&"null"!==h&&"resolvedImage"!==h)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");i=!0,n.push({content:d,scale:null,font:null,textColor:null})}}return new Kt(n)},Kt.prototype.evaluate=function(e){var t=function(t){var r=t.content.evaluate(e);return Wt(r)===Et?new Bt("",r,null,null,null):new Bt(qt(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)};return new Vt(this.sections.map(t))},Kt.prototype.eachChild=function(e){for(var t=0,r=this.sections;t-1),r},Jt.prototype.eachChild=function(e){e(this.input)},Jt.prototype.outputDefined=function(){return!1},Jt.prototype.serialize=function(){return["image",this.input.serialize()]};var Qt={"to-boolean":wt,"to-color":kt,"to-number":bt,"to-string":_t},er=function(e,t){this.type=e,this.args=t};er.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[0];if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");for(var n=Qt[r],i=[],o=1;o4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":Ht(t[0],t[1],t[2],t[3])))return new Ft(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Yt(r||"Could not parse color from value '"+("string"===typeof t?t:String(JSON.stringify(t)))+"'")}if("number"===this.type.kind){for(var a=null,s=0,l=this.args;s=t[2])&&!(e[1]<=t[1])&&!(e[3]>=t[3])}function dr(e,t){var r=lr(e[0]),n=cr(e[1]),i=Math.pow(2,t.z);return[Math.round(r*i*ar),Math.round(n*i*ar)]}function hr(e,t,r){var n=e[0]-t[0],i=e[1]-t[1],o=e[0]-r[0],a=e[1]-r[1];return n*a-o*i===0&&n*o<=0&&i*a<=0}function pr(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 fr(e,t){for(var r=!1,n=0,i=t.length;n0&&d<0||u<0&&d>0}function vr(e,t,r,n){var i=[t[0]-e[0],t[1]-e[1]];return 0!==gr([n[0]-r[0],n[1]-r[1]],i)&&!(!yr(e,t,r,n)||!yr(r,n,e,t))}function xr(e,t,r){for(var n=0,i=r;nr[2]){var i=.5*n,o=e[0]-r[0]>i?-n:r[0]-e[0]>i?n:0;0===o&&(o=e[0]-r[2]>i?-n:r[2]-e[0]>i?n:0),e[0]+=o}sr(t,e)}function Ar(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}function Tr(e,t,r,n){for(var i=Math.pow(2,n.z)*ar,o=[n.x*ar,n.y*ar],a=[],s=0,l=e;s=0)return!1;var r=!0;return e.eachChild((function(e){r&&!Rr(e,t)&&(r=!1)})),r}Ir.parse=function(e,t){if(2!==e.length)return t.error("'within' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if($t(e[1])){var r=e[1];if("FeatureCollection"===r.type)for(var n=0;nt))throw new Yt("Input is not a number.");a=s-1}return 0}Dr.prototype.parse=function(e,t,r,n,i){return void 0===i&&(i={}),t?this.concat(t,r,n)._parse(e,i):this._parse(e,i)},Dr.prototype._parse=function(e,t){function r(e,t,r){return"assert"===r?new Zt(t,[e]):"coerce"===r?new er(t,[e]):e}if(null!==e&&"string"!==typeof e&&"boolean"!==typeof e&&"number"!==typeof e||(e=["literal",e]),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", []].');var n=e[0];if("string"!==typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var i=this.registry[n];if(i){var o=i.parse(e,this);if(!o)return null;if(this.expectedType){var a=this.expectedType,s=o.type;if("string"!==a.kind&&"number"!==a.kind&&"boolean"!==a.kind&&"object"!==a.kind&&"array"!==a.kind||"value"!==s.kind)if("color"!==a.kind&&"formatted"!==a.kind&&"resolvedImage"!==a.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(a,s))return null}else o=r(o,a,t.typeAnnotation||"coerce");else o=r(o,a,t.typeAnnotation||"assert")}if(!(o instanceof Gt)&&"resolvedImage"!==o.type.kind&&zr(o)){var l=new rr;try{o=new Gt(o.type,o.evaluate(l))}catch(c){return this.error(c.message),null}}return o}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return"undefined"===typeof e?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 "+typeof e+" instead.")},Dr.prototype.concat=function(e,t,r){var n="number"===typeof e?this.path.concat(e):this.path,i=r?this.scope.concat(r):this.scope;return new Dr(this.registry,n,t||null,i,this.errors)},Dr.prototype.error=function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];var n=""+this.key+t.map((function(e){return"["+e+"]"})).join("");this.errors.push(new yt(n,e))},Dr.prototype.checkSubtype=function(e,t){var r=Rt(e,t);return r&&this.error(r),r};var Fr=function(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var n=0,i=r;n=a)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var u=t.parse(s,c,i);if(!u)return null;i=i||u.type,n.push([a,u])}return new Fr(i,r,n)},Fr.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var i=t.length;return n>=t[i-1]?r[i-1].evaluate(e):r[jr(t,n)].evaluate(e)},Fr.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var Ur=Object.freeze({__proto__:null,number:Nr,color:Br,array:Vr}),Hr=.95047,$r=1,Wr=1.08883,qr=4/29,Gr=6/29,Yr=3*Gr*Gr,Xr=Gr*Gr*Gr,Zr=Math.PI/180,Kr=180/Math.PI;function Jr(e){return e>Xr?Math.pow(e,1/3):e/Yr+qr}function Qr(e){return e>Gr?e*e*e:Yr*(e-qr)}function en(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function tn(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function rn(e){var t=tn(e.r),r=tn(e.g),n=tn(e.b),i=Jr((.4124564*t+.3575761*r+.1804375*n)/Hr),o=Jr((.2126729*t+.7151522*r+.072175*n)/$r);return{l:116*o-16,a:500*(i-o),b:200*(o-Jr((.0193339*t+.119192*r+.9503041*n)/Wr)),alpha:e.a}}function nn(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,n=isNaN(e.b)?t:t-e.b/200;return t=$r*Qr(t),r=Hr*Qr(r),n=Wr*Qr(n),new Ft(en(3.2404542*r-1.5371385*t-.4985314*n),en(-.969266*r+1.8760108*t+.041556*n),en(.0556434*r-.2040259*t+1.0572252*n),e.alpha)}function on(e,t,r){return{l:Nr(e.l,t.l,r),a:Nr(e.a,t.a,r),b:Nr(e.b,t.b,r),alpha:Nr(e.alpha,t.alpha,r)}}function an(e){var t=rn(e),r=t.l,n=t.a,i=t.b,o=Math.atan2(i,n)*Kr;return{h:o<0?o+360:o,c:Math.sqrt(n*n+i*i),l:r,alpha:e.a}}function sn(e){var t=e.h*Zr,r=e.c;return nn({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})}function ln(e,t,r){var n=t-e;return e+r*(n>180||n<-180?n-360*Math.round(n/360):n)}function cn(e,t,r){return{h:ln(e.h,t.h,r),c:Nr(e.c,t.c,r),l:Nr(e.l,t.l,r),alpha:Nr(e.alpha,t.alpha,r)}}var un={forward:rn,reverse:nn,interpolate:on},dn={forward:an,reverse:sn,interpolate:cn},hn=Object.freeze({__proto__:null,lab:un,hcl:dn}),pn=function(e,t,r,n,i){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(var o=0,a=i;o1})))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:s}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!==0)return t.error("Expected an even number of arguments.");if(!(i=t.parse(i,2,bt)))return null;var l=[],c=null;"interpolate-hcl"===r||"interpolate-lab"===r?c=kt:t.expectedType&&"value"!==t.expectedType.kind&&(c=t.expectedType);for(var u=0;u=d)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);var m=t.parse(h,f,c);if(!m)return null;c=c||m.type,l.push([d,m])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"===typeof c.N?new pn(c,r,n,i,l):t.error("Type "+Pt(c)+" is not interpolatable.")},pn.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);var n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);var i=t.length;if(n>=t[i-1])return r[i-1].evaluate(e);var o=jr(t,n),a=t[o],s=t[o+1],l=pn.interpolationFactor(this.interpolation,n,a,s),c=r[o].evaluate(e),u=r[o+1].evaluate(e);return"interpolate"===this.operator?Ur[this.type.kind.toLowerCase()](c,u,l):"interpolate-hcl"===this.operator?dn.reverse(dn.interpolate(dn.forward(c),dn.forward(u),l)):un.reverse(un.interpolate(un.forward(c),un.forward(u),l))},pn.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t=r.length)throw new Yt("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new Yt("Array index must be an integer, but found "+t+" instead.");return r[t]},yn.prototype.eachChild=function(e){e(this.index),e(this.input)},yn.prototype.outputDefined=function(){return!1},yn.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var vn=function(e,t){this.type=wt,this.needle=e,this.haystack=t};vn.parse=function(e,t){if(3!==e.length)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,At),n=t.parse(e[2],2,At);return r&&n?Lt(r.type,[wt,_t,bt,xt,At])?new vn(r,n):t.error("Expected first argument to be of type boolean, string, number or null, but found "+Pt(r.type)+" instead"):null},vn.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!Dt(t,["boolean","string","number","null"]))throw new Yt("Expected first argument to be of type boolean, string, number or null, but found "+Pt(Wt(t))+" instead.");if(!Dt(r,["string","array"]))throw new Yt("Expected second argument to be of type array or string, but found "+Pt(Wt(r))+" instead.");return r.indexOf(t)>=0},vn.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},vn.prototype.outputDefined=function(){return!0},vn.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var xn=function(e,t,r){this.type=bt,this.needle=e,this.haystack=t,this.fromIndex=r};xn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,At),n=t.parse(e[2],2,At);if(!r||!n)return null;if(!Lt(r.type,[wt,_t,bt,xt,At]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+Pt(r.type)+" instead");if(4===e.length){var i=t.parse(e[3],3,bt);return i?new xn(r,n,i):null}return new xn(r,n)},xn.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Dt(t,["boolean","string","number","null"]))throw new Yt("Expected first argument to be of type boolean, string, number or null, but found "+Pt(Wt(t))+" instead.");if(!Dt(r,["string","array"]))throw new Yt("Expected second argument to be of type array or string, but found "+Pt(Wt(r))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(e);return r.indexOf(t,n)}return r.indexOf(t)},xn.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},xn.prototype.outputDefined=function(){return!1},xn.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var bn=function(e,t,r,n,i,o){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=i,this.otherwise=o};bn.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!==1)return t.error("Expected an even number of arguments.");var r,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);for(var i={},o=[],a=2;aNumber.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"===typeof h&&Math.floor(h)!==h)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,Wt(h)))return null}else r=Wt(h);if("undefined"!==typeof i[String(h)])return c.error("Branch labels must be unique.");i[String(h)]=o.length}var p=t.parse(l,a,n);if(!p)return null;n=n||p.type,o.push(p)}var f=t.parse(e[1],1,At);if(!f)return null;var m=t.parse(e[e.length-1],e.length-1,n);return m?"value"!==f.type.kind&&t.concat(1).checkSubtype(r,f.type)?null:new bn(r,n,f,i,o,m):null},bn.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(Wt(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},bn.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},bn.prototype.outputDefined=function(){return this.outputs.every((function(e){return e.outputDefined()}))&&this.otherwise.outputDefined()},bn.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],r=[],n={},i=0,o=Object.keys(this.cases).sort();ir}function Cn(e,t,r){return t<=r}function En(e,t,r){return t>=r}function In(e,t,r,n){return 0===n.compare(t,r)}function Pn(e,t,r,n){return!In(e,t,r,n)}function On(e,t,r,n){return n.compare(t,r)<0}function Rn(e,t,r,n){return n.compare(t,r)>0}function Ln(e,t,r,n){return n.compare(t,r)<=0}function Dn(e,t,r,n){return n.compare(t,r)>=0}function zn(e,t,r){var n="=="!==e&&"!="!==e;return function(){function i(e,t,r){this.type=wt,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}return i.parse=function(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");var r=e[0],o=t.parse(e[1],1,At);if(!o)return null;if(!kn(r,o.type))return t.concat(1).error('"'+r+"\" comparisons are not supported for type '"+Pt(o.type)+"'.");var a=t.parse(e[2],2,At);if(!a)return null;if(!kn(r,a.type))return t.concat(2).error('"'+r+"\" comparisons are not supported for type '"+Pt(a.type)+"'.");if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return t.error("Cannot compare types '"+Pt(o.type)+"' and '"+Pt(a.type)+"'.");n&&("value"===o.type.kind&&"value"!==a.type.kind?o=new Zt(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new Zt(o.type,[a])));var s=null;if(4===e.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return t.error("Cannot use collator to compare non-string types.");if(!(s=t.parse(e[3],3,Mt)))return null}return new i(o,a,s)},i.prototype.evaluate=function(i){var o=this.lhs.evaluate(i),a=this.rhs.evaluate(i);if(n&&this.hasUntypedArgument){var s=Wt(o),l=Wt(a);if(s.kind!==l.kind||"string"!==s.kind&&"number"!==s.kind)throw new Yt('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+s.kind+", "+l.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var c=Wt(o),u=Wt(a);if("string"!==c.kind||"string"!==u.kind)return t(i,o,a)}return this.collator?r(i,o,a,this.collator.evaluate(i)):t(i,o,a)},i.prototype.eachChild=function(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)},i.prototype.outputDefined=function(){return!0},i.prototype.serialize=function(){var t=[e];return this.eachChild((function(e){t.push(e.serialize())})),t},i}()}wn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,At),n=t.parse(e[2],2,bt);if(!r||!n)return null;if(!Lt(r.type,[It(At),_t,At]))return t.error("Expected first argument to be of type array or string, but found "+Pt(r.type)+" instead");if(4===e.length){var i=t.parse(e[3],3,bt);return i?new wn(r.type,r,n,i):null}return new wn(r.type,r,n)},wn.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!Dt(t,["string","array"]))throw new Yt("Expected first argument to be of type array or string, but found "+Pt(Wt(t))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(e);return t.slice(r,n)}return t.slice(r)},wn.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},wn.prototype.outputDefined=function(){return!1},wn.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var jn=zn("==",Sn,In),Fn=zn("!=",An,Pn),Nn=zn("<",Tn,On),Bn=zn(">",Mn,Rn),Vn=zn("<=",Cn,Ln),Un=zn(">=",En,Dn),Hn=function(e,t,r,n,i){this.type=_t,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=n,this.maxFractionDigits=i};Hn.parse=function(e,t){if(3!==e.length)return t.error("Expected two arguments.");var r=t.parse(e[1],1,bt);if(!r)return null;var n=e[2];if("object"!==typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");var i=null;if(n.locale&&!(i=t.parse(n.locale,1,_t)))return null;var o=null;if(n.currency&&!(o=t.parse(n.currency,1,_t)))return null;var a=null;if(n["min-fraction-digits"]&&!(a=t.parse(n["min-fraction-digits"],1,bt)))return null;var s=null;return n["max-fraction-digits"]&&!(s=t.parse(n["max-fraction-digits"],1,bt))?null:new Hn(r,i,o,a,s)},Hn.prototype.evaluate=function(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))},Hn.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},Hn.prototype.outputDefined=function(){return!1},Hn.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]};var $n=function(e){this.type=bt,this.input=e};$n.parse=function(e,t){if(2!==e.length)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error("Expected argument of type string or array, but found "+Pt(r.type)+" instead."):new $n(r):null},$n.prototype.evaluate=function(e){var 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 "+Pt(Wt(t))+" instead.")},$n.prototype.eachChild=function(e){e(this.input)},$n.prototype.outputDefined=function(){return!1},$n.prototype.serialize=function(){var e=["length"];return this.eachChild((function(t){e.push(t.serialize())})),e};var Wn={"==":jn,"!=":Fn,">":Bn,"<":Nn,">=":Un,"<=":Vn,array:Zt,at:yn,boolean:Zt,case:_n,coalesce:mn,collator:or,format:Kt,image:Jt,in:vn,"index-of":xn,interpolate:pn,"interpolate-hcl":pn,"interpolate-lab":pn,length:$n,let:gn,literal:Gt,match:bn,number:Zt,"number-format":Hn,object:Zt,slice:wn,step:Fr,string:Zt,"to-boolean":er,"to-color":er,"to-number":er,"to-string":er,var:Lr,within:Ir};function qn(e,t){var r=t[0],n=t[1],i=t[2],o=t[3];r=r.evaluate(e),n=n.evaluate(e),i=i.evaluate(e);var a=o?o.evaluate(e):1,s=Ht(r,n,i,a);if(s)throw new Yt(s);return new Ft(r/255*a,n/255*a,i/255*a,a)}function Gn(e,t){return e in t}function Yn(e,t){var r=t[e];return"undefined"===typeof r?null:r}function Xn(e,t,r,n){for(;r<=n;){var i=r+n>>1;if(t[i]===e)return!0;t[i]>e?n=i-1:r=i+1}return!1}function Zn(e){return{type:e}}function Kn(e){return{result:"success",value:e}}function Jn(e){return{result:"error",value:e}}function Qn(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function ei(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function ti(e){return!!e.expression&&e.expression.interpolated}function ri(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function ni(e){return"object"===typeof e&&null!==e&&!Array.isArray(e)}function ii(e){return e}function oi(e,t){var r,n,i,o="color"===t.type,a=e.stops&&"object"===typeof e.stops[0][0],s=a||void 0!==e.property,l=a||!s,c=e.type||(ti(t)?"exponential":"interval");if(o&&((e=ft({},e)).stops&&(e.stops=e.stops.map((function(e){return[e[0],Ft.parse(e[1])]}))),e.default?e.default=Ft.parse(e.default):e.default=Ft.parse(t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!hn[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===c)r=ci;else if("interval"===c)r=li;else if("categorical"===c){r=si,n=Object.create(null);for(var u=0,d=e.stops;u=e.stops[n-1][0])return e.stops[n-1][1];var i=jr(e.stops.map((function(e){return e[0]})),r);return e.stops[i][1]}function ci(e,t,r){var n=void 0!==e.base?e.base:1;if("number"!==ri(r))return ai(e.default,t.default);var i=e.stops.length;if(1===i)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];var o=jr(e.stops.map((function(e){return e[0]})),r),a=di(r,n,e.stops[o][0],e.stops[o+1][0]),s=e.stops[o][1],l=e.stops[o+1][1],c=Ur[t.type]||ii;if(e.colorSpace&&"rgb"!==e.colorSpace){var u=hn[e.colorSpace];c=function(e,t){return u.reverse(u.interpolate(u.forward(e),u.forward(t),a))}}return"function"===typeof s.evaluate?{evaluate:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];var r=s.evaluate.apply(void 0,e),n=l.evaluate.apply(void 0,e);if(void 0!==r&&void 0!==n)return c(r,n,a)}}:c(s,l,a)}function ui(e,t,r){return"color"===t.type?r=Ft.parse(r):"formatted"===t.type?r=Vt.fromString(r.toString()):"resolvedImage"===t.type?r=Ut.fromString(r.toString()):ri(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0),ai(r,e.default,t.default)}function di(e,t,r,n){var i=n-r,o=e-r;return 0===i?0:1===t?o/i:(Math.pow(t,o)-1)/(Math.pow(t,i)-1)}nr.register(Wn,{error:[Tt,[_t],function(e,t){var r=t[0];throw new Yt(r.evaluate(e))}],typeof:[_t,[At],function(e,t){return Pt(Wt(t[0].evaluate(e)))}],"to-rgba":[It(bt,4),[kt],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[kt,[bt,bt,bt],qn],rgba:[kt,[bt,bt,bt,bt],qn],has:{type:wt,overloads:[[[_t],function(e,t){return Gn(t[0].evaluate(e),e.properties())}],[[_t,St],function(e,t){var r=t[0],n=t[1];return Gn(r.evaluate(e),n.evaluate(e))}]]},get:{type:At,overloads:[[[_t],function(e,t){return Yn(t[0].evaluate(e),e.properties())}],[[_t,St],function(e,t){var r=t[0],n=t[1];return Yn(r.evaluate(e),n.evaluate(e))}]]},"feature-state":[At,[_t],function(e,t){return Yn(t[0].evaluate(e),e.featureState||{})}],properties:[St,[],function(e){return e.properties()}],"geometry-type":[_t,[],function(e){return e.geometryType()}],id:[At,[],function(e){return e.id()}],zoom:[bt,[],function(e){return e.globals.zoom}],"heatmap-density":[bt,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[bt,[],function(e){return e.globals.lineProgress||0}],accumulated:[At,[],function(e){return void 0===e.globals.accumulated?null:e.globals.accumulated}],"+":[bt,Zn(bt),function(e,t){for(var r=0,n=0,i=t;n":[wt,[_t,At],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],o=n.value;return typeof i===typeof o&&i>o}],"filter-id->":[wt,[At],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n===typeof i&&n>i}],"filter-<=":[wt,[_t,At],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],o=n.value;return typeof i===typeof o&&i<=o}],"filter-id-<=":[wt,[At],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n===typeof i&&n<=i}],"filter->=":[wt,[_t,At],function(e,t){var r=t[0],n=t[1],i=e.properties()[r.value],o=n.value;return typeof i===typeof o&&i>=o}],"filter-id->=":[wt,[At],function(e,t){var r=t[0],n=e.id(),i=r.value;return typeof n===typeof i&&n>=i}],"filter-has":[wt,[At],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[wt,[],function(e){return null!==e.id()&&void 0!==e.id()}],"filter-type-in":[wt,[It(_t)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[wt,[It(At)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[wt,[_t,It(At)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[wt,[_t,It(At)],function(e,t){var r=t[0],n=t[1];return Xn(e.properties()[r.value],n.value,0,n.value.length-1)}],all:{type:wt,overloads:[[[wt,wt],function(e,t){var r=t[0],n=t[1];return r.evaluate(e)&&n.evaluate(e)}],[Zn(wt),function(e,t){for(var r=0,n=t;r0&&"string"===typeof e[0]&&e[0]in Wn}function fi(e,t){var r=new Dr(Wn,[],t?_i(t):void 0),n=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return n?Kn(new hi(n,t)):Jn(r.errors)}hi.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,o){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},hi.prototype.evaluate=function(e,t,r,n,i,o){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=i||null,this._evaluator.formattedSection=o||null;try{var a=this.expression.evaluate(this._evaluator);if(null===a||void 0===a||"number"===typeof a&&a!==a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new Yt("Expected value to be one of "+Object.keys(this._enumValues).map((function(e){return JSON.stringify(e)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(s){return this._warningHistory[s.message]||(this._warningHistory[s.message]=!0,"undefined"!==typeof console&&console.warn(s.message)),this._defaultValue}};var mi=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!Or(t.expression)};mi.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,o)},mi.prototype.evaluate=function(e,t,r,n,i,o){return this._styleExpression.evaluate(e,t,r,n,i,o)};var gi=function(e,t,r,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Or(t.expression),this.interpolationType=n};function yi(e,t){if("error"===(e=fi(e,t)).result)return e;var r=e.value.expression,n=Pr(r);if(!n&&!Qn(t))return Jn([new yt("","data expressions not supported")]);var i=Rr(r,["zoom"]);if(!i&&!ei(t))return Jn([new yt("","zoom expressions not supported")]);var o=bi(r);if(!o&&!i)return Jn([new yt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(o instanceof yt)return Jn([o]);if(o instanceof pn&&!ti(t))return Jn([new yt("",'"interpolate" expressions cannot be used with this property')]);if(!o)return Kn(new mi(n?"constant":"source",e.value));var a=o instanceof pn?o.interpolation:void 0;return Kn(new gi(n?"camera":"composite",e.value,o.labels,a))}gi.prototype.evaluateWithoutErrorHandling=function(e,t,r,n,i,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,i,o)},gi.prototype.evaluate=function(e,t,r,n,i,o){return this._styleExpression.evaluate(e,t,r,n,i,o)},gi.prototype.interpolationFactor=function(e,t,r){return this.interpolationType?pn.interpolationFactor(this.interpolationType,e,t,r):0};var vi=function(e,t){this._parameters=e,this._specification=t,ft(this,oi(this._parameters,this._specification))};function xi(e,t){if(ni(e))return new vi(e,t);if(pi(e)){var r=yi(e,t);if("error"===r.result)throw new Error(r.value.map((function(e){return e.key+": "+e.message})).join(", "));return r.value}var n=e;return"string"===typeof e&&"color"===t.type&&(n=Ft.parse(e)),{kind:"constant",evaluate:function(){return n}}}function bi(e){var t=null;if(e instanceof gn)t=bi(e.result);else if(e instanceof mn)for(var r=0,n=e.args;rn.maximum?[new ht(t,r,r+" is greater than the maximum value "+n.maximum)]:[]}function Ti(e){var t,r,n,i=e.valueSpec,o=mt(e.value.type),a={},s="categorical"!==o&&void 0===e.value.property,l=!s,c="array"===ri(e.value.stops)&&"array"===ri(e.value.stops[0])&&"object"===ri(e.value.stops[0][0]),u=ki({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:d,default:f}});return"identity"===o&&s&&u.push(new ht(e.key,e.value,'missing required property "property"')),"identity"===o||e.value.stops||u.push(new ht(e.key,e.value,'missing required property "stops"')),"exponential"===o&&e.valueSpec.expression&&!ti(e.valueSpec)&&u.push(new ht(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!Qn(e.valueSpec)?u.push(new ht(e.key,e.value,"property functions not supported")):s&&!ei(e.valueSpec)&&u.push(new ht(e.key,e.value,"zoom functions not supported"))),"categorical"!==o&&!c||void 0!==e.value.property||u.push(new ht(e.key,e.value,'"property" property is required')),u;function d(e){if("identity"===o)return[new ht(e.key,e.value,'identity function may not have a "stops" property')];var t=[],r=e.value;return t=t.concat(Si({key:e.key,value:r,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:h})),"array"===ri(r)&&0===r.length&&t.push(new ht(e.key,r,"array must have at least one stop")),t}function h(e){var t=[],o=e.value,s=e.key;if("array"!==ri(o))return[new ht(s,o,"array expected, "+ri(o)+" found")];if(2!==o.length)return[new ht(s,o,"array length 2 expected, length "+o.length+" found")];if(c){if("object"!==ri(o[0]))return[new ht(s,o,"object expected, "+ri(o[0])+" found")];if(void 0===o[0].zoom)return[new ht(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new ht(s,o,"object stop key must have value")];if(n&&n>mt(o[0].zoom))return[new ht(s,o[0].zoom,"stop zoom values must appear in ascending order")];mt(o[0].zoom)!==n&&(n=mt(o[0].zoom),r=void 0,a={}),t=t.concat(ki({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:Ai,value:p}}))}else t=t.concat(p({key:s+"[0]",value:o[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},o));return pi(gt(o[1]))?t.concat([new ht(s+"[1]",o[1],"expressions are not allowed in function stops.")]):t.concat(ro({key:s+"[1]",value:o[1],valueSpec:i,style:e.style,styleSpec:e.styleSpec}))}function p(e,n){var s=ri(e.value),l=mt(e.value),c=null!==e.value?e.value:n;if(t){if(s!==t)return[new ht(e.key,c,s+" stop domain type must match previous stop domain type "+t)]}else t=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new ht(e.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==o){var u="number expected, "+s+" found";return Qn(i)&&void 0===o&&(u+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ht(e.key,c,u)]}return"categorical"!==o||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==o&&"number"===s&&void 0!==r&&l=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(var t=0,r=e.slice(1);tt?1:0}function Di(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var t=1;t"===t||"<="===t||">="===t?ji(e[1],e[2],t):"any"===t?Fi(e.slice(1)):"all"===t?["all"].concat(e.slice(1).map(zi)):"none"===t?["all"].concat(e.slice(1).map(zi).map(Vi)):"in"===t?Ni(e[1],e.slice(2)):"!in"===t?Vi(Ni(e[1],e.slice(2))):"has"===t?Bi(e[1]):"!has"===t?Vi(Bi(e[1])):"within"!==t||e}function ji(e,t,r){switch(e){case"$type":return["filter-type-"+r,t];case"$id":return["filter-id-"+r,t];default:return["filter-"+r,e,t]}}function Fi(e){return["any"].concat(e.map(zi))}function Ni(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((function(e){return typeof e!==typeof t[0]}))?["filter-in-large",e,["literal",t.sort(Li)]]:["filter-in-small",e,["literal",t]]}}function Bi(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function Vi(e){return["!",e]}function Ui(e){return Pi(gt(e.value))?Mi(ft({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Hi(e)}function Hi(e){var t=e.value,r=e.key;if("array"!==ri(t))return[new ht(r,t,"array expected, "+ri(t)+" found")];var n,i=e.styleSpec,o=[];if(t.length<1)return[new ht(r,t,"filter array must have at least 1 element")];switch(o=o.concat(Ii({key:r+"[0]",value:t[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec})),mt(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===mt(t[1])&&o.push(new ht(r,t,'"$type" cannot be use with operator "'+t[0]+'"'));case"==":case"!=":3!==t.length&&o.push(new ht(r,t,'filter array for operator "'+t[0]+'" must have 3 elements'));case"in":case"!in":t.length>=2&&"string"!==(n=ri(t[1]))&&o.push(new ht(r+"[1]",t[1],"string expected, "+n+" found"));for(var a=2;a=u[p+0]&&n>=u[p+1])?(a[h]=!0,o.push(c[h])):a[h]=!1}}},mo.prototype._forEachCell=function(e,t,r,n,i,o,a,s){for(var l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),u=this._convertToCellCoord(r),d=this._convertToCellCoord(n),h=l;h<=u;h++)for(var p=c;p<=d;p++){var f=this.d*p+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(p),this._convertFromCellCoord(h+1),this._convertFromCellCoord(p+1)))&&i.call(this,e,t,r,n,f,o,a,s))return}},mo.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},mo.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},mo.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=fo+this.cells.length+1+1,r=0,n=0;n=0)){var d=e[u];c[u]=vo[l].shallow.indexOf(u)>=0?d:ko(d,t)}e instanceof Error&&(c.message=e.message)}if(c.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==l&&(c.$name=l),c}throw new Error("can't serialize object of type "+typeof e)}function So(e){if(null===e||void 0===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||_o(e)||wo(e)||ArrayBuffer.isView(e)||e instanceof go)return e;if(Array.isArray(e))return e.map(So);if("object"===typeof e){var t=e.$name||"Object",r=vo[t].klass;if(!r)throw new Error("can't deserialize unregistered class "+t);if(r.deserialize)return r.deserialize(e);for(var n=Object.create(r.prototype),i=0,o=Object.keys(e);i=0?s:So(s)}}return n}throw new Error("can't deserialize object of type "+typeof e)}var Ao=function(){this.first=!0};Ao.prototype.update=function(e,t){var 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=128&&e<=255},Arabic:function(e){return e>=1536&&e<=1791},"Arabic Supplement":function(e){return e>=1872&&e<=1919},"Arabic Extended-A":function(e){return e>=2208&&e<=2303},"Hangul Jamo":function(e){return e>=4352&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return e>=5120&&e<=5759},Khmer:function(e){return e>=6016&&e<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(e){return e>=6320&&e<=6399},"General Punctuation":function(e){return e>=8192&&e<=8303},"Letterlike Symbols":function(e){return e>=8448&&e<=8527},"Number Forms":function(e){return e>=8528&&e<=8591},"Miscellaneous Technical":function(e){return e>=8960&&e<=9215},"Control Pictures":function(e){return e>=9216&&e<=9279},"Optical Character Recognition":function(e){return e>=9280&&e<=9311},"Enclosed Alphanumerics":function(e){return e>=9312&&e<=9471},"Geometric Shapes":function(e){return e>=9632&&e<=9727},"Miscellaneous Symbols":function(e){return e>=9728&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return e>=11008&&e<=11263},"CJK Radicals Supplement":function(e){return e>=11904&&e<=12031},"Kangxi Radicals":function(e){return e>=12032&&e<=12255},"Ideographic Description Characters":function(e){return e>=12272&&e<=12287},"CJK Symbols and Punctuation":function(e){return e>=12288&&e<=12351},Hiragana:function(e){return e>=12352&&e<=12447},Katakana:function(e){return e>=12448&&e<=12543},Bopomofo:function(e){return e>=12544&&e<=12591},"Hangul Compatibility Jamo":function(e){return e>=12592&&e<=12687},Kanbun:function(e){return e>=12688&&e<=12703},"Bopomofo Extended":function(e){return e>=12704&&e<=12735},"CJK Strokes":function(e){return e>=12736&&e<=12783},"Katakana Phonetic Extensions":function(e){return e>=12784&&e<=12799},"Enclosed CJK Letters and Months":function(e){return e>=12800&&e<=13055},"CJK Compatibility":function(e){return e>=13056&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return e>=13312&&e<=19903},"Yijing Hexagram Symbols":function(e){return e>=19904&&e<=19967},"CJK Unified Ideographs":function(e){return e>=19968&&e<=40959},"Yi Syllables":function(e){return e>=40960&&e<=42127},"Yi Radicals":function(e){return e>=42128&&e<=42191},"Hangul Jamo Extended-A":function(e){return e>=43360&&e<=43391},"Hangul Syllables":function(e){return e>=44032&&e<=55215},"Hangul Jamo Extended-B":function(e){return e>=55216&&e<=55295},"Private Use Area":function(e){return e>=57344&&e<=63743},"CJK Compatibility Ideographs":function(e){return e>=63744&&e<=64255},"Arabic Presentation Forms-A":function(e){return e>=64336&&e<=65023},"Vertical Forms":function(e){return e>=65040&&e<=65055},"CJK Compatibility Forms":function(e){return e>=65072&&e<=65103},"Small Form Variants":function(e){return e>=65104&&e<=65135},"Arabic Presentation Forms-B":function(e){return e>=65136&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return e>=65280&&e<=65519}};function Mo(e){for(var t=0,r=e;t=65097&&e<=65103)||!!To["CJK Compatibility Ideographs"](e)||!!To["CJK Compatibility"](e)||!!To["CJK Radicals Supplement"](e)||!!To["CJK Strokes"](e)||!(!To["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||!!To["CJK Unified Ideographs Extension A"](e)||!!To["CJK Unified Ideographs"](e)||!!To["Enclosed CJK Letters and Months"](e)||!!To["Hangul Compatibility Jamo"](e)||!!To["Hangul Jamo Extended-A"](e)||!!To["Hangul Jamo Extended-B"](e)||!!To["Hangul Jamo"](e)||!!To["Hangul Syllables"](e)||!!To.Hiragana(e)||!!To["Ideographic Description Characters"](e)||!!To.Kanbun(e)||!!To["Kangxi Radicals"](e)||!!To["Katakana Phonetic Extensions"](e)||!(!To.Katakana(e)||12540===e)||!(!To["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)||!(!To["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||!!To["Unified Canadian Aboriginal Syllabics"](e)||!!To["Unified Canadian Aboriginal Syllabics Extended"](e)||!!To["Vertical Forms"](e)||!!To["Yijing Hexagram Symbols"](e)||!!To["Yi Syllables"](e)||!!To["Yi Radicals"](e))}function Oo(e){return!(!To["Latin-1 Supplement"](e)||167!==e&&169!==e&&174!==e&&177!==e&&188!==e&&189!==e&&190!==e&&215!==e&&247!==e)||!(!To["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)||!!To["Letterlike Symbols"](e)||!!To["Number Forms"](e)||!(!To["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))||!(!To["Control Pictures"](e)||9251===e)||!!To["Optical Character Recognition"](e)||!!To["Enclosed Alphanumerics"](e)||!!To["Geometric Shapes"](e)||!(!To["Miscellaneous Symbols"](e)||e>=9754&&e<=9759)||!(!To["Miscellaneous Symbols and Arrows"](e)||!(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243))||!!To["CJK Symbols and Punctuation"](e)||!!To.Katakana(e)||!!To["Private Use Area"](e)||!!To["CJK Compatibility Forms"](e)||!!To["Small Form Variants"](e)||!!To["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e}function Ro(e){return!(Po(e)||Oo(e))}function Lo(e){return To.Arabic(e)||To["Arabic Supplement"](e)||To["Arabic Extended-A"](e)||To["Arabic Presentation Forms-A"](e)||To["Arabic Presentation Forms-B"](e)}function Do(e){return e>=1424&&e<=2303||To["Arabic Presentation Forms-A"](e)||To["Arabic Presentation Forms-B"](e)}function zo(e,t){return!(!t&&Do(e))&&!(e>=2304&&e<=3583||e>=3840&&e<=4255||To.Khmer(e))}function jo(e){for(var t=0,r=e;t-1&&(Vo=No.error),Bo&&Bo(e)};function $o(){Wo.fire(new lt("pluginStateChange",{pluginStatus:Vo,pluginURL:Uo}))}var Wo=new ut,qo=function(){return Vo},Go=function(e){return e({pluginStatus:Vo,pluginURL:Uo}),Wo.on("pluginStateChange",e),e},Yo=function(e,t,r){if(void 0===r&&(r=!1),Vo===No.deferred||Vo===No.loading||Vo===No.loaded)throw new Error("setRTLTextPlugin cannot be called multiple times.");Uo=Z.resolveURL(e),Vo=No.deferred,Bo=t,$o(),r||Xo()},Xo=function(){if(Vo!==No.deferred||!Uo)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Vo=No.loading,$o(),Uo&&Ze({url:Uo},(function(e){e?Ho(e):(Vo=No.loaded,$o())}))},Zo={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return Vo===No.loaded||null!=Zo.applyArabicShaping},isLoading:function(){return Vo===No.loading},setState:function(e){Vo=e.pluginStatus,Uo=e.pluginURL},isParsed:function(){return null!=Zo.applyArabicShaping&&null!=Zo.processBidirectionalText&&null!=Zo.processStyledBidirectionalText},getPluginURL:function(){return Uo}},Ko=function(){Zo.isLoading()||Zo.isLoaded()||"deferred"!==qo()||Xo()},Jo=function(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 Ao,this.transition={})};Jo.prototype.isSupportedScript=function(e){return Fo(e,Zo.isLoaded())},Jo.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},Jo.prototype.getCrossfadeParameters=function(){var 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}};var Qo=function(e,t){this.property=e,this.value=t,this.expression=xi(void 0===t?e.specification.default:t,e.specification)};Qo.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},Qo.prototype.possiblyEvaluate=function(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)};var ea=function(e){this.property=e,this.value=new Qo(e,void 0)};ea.prototype.transitioned=function(e,t){return new ra(this.property,this.value,t,v({},e.transition,this.transition),e.now)},ea.prototype.untransitioned=function(){return new ra(this.property,this.value,null,{},0)};var ta=function(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)};ta.prototype.getValue=function(e){return E(this._values[e].value.value)},ta.prototype.setValue=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new ea(this._values[e].property)),this._values[e].value=new Qo(this._values[e].property,null===t?void 0:E(t))},ta.prototype.getTransition=function(e){return E(this._values[e].transition)},ta.prototype.setTransition=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new ea(this._values[e].property)),this._values[e].transition=E(t)||void 0},ta.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);tthis.end)return this.prior=null,i;if(this.value.isDataDriven())return this.prior=null,i;if(nn.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},t.prototype.interpolate=function(e){return e},t}(la),ua=function(e){this.specification=e};ua.prototype.possiblyEvaluate=function(e,t,r,n){if(void 0!==e.value){if("constant"===e.expression.kind){var i=e.expression.evaluate(t,null,{},r,n);return this._calculate(i,i,i,t)}return this._calculate(e.expression.evaluate(new Jo(Math.floor(t.zoom-1),t)),e.expression.evaluate(new Jo(Math.floor(t.zoom),t)),e.expression.evaluate(new Jo(Math.floor(t.zoom+1),t)),t)}},ua.prototype._calculate=function(e,t,r,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},ua.prototype.interpolate=function(e){return e};var da=function(e){this.specification=e};da.prototype.possiblyEvaluate=function(e,t,r,n){return!!e.expression.evaluate(t,null,{},r,n)},da.prototype.interpolate=function(){return!1};var ha=function(e){for(var t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){var r=e[t];r.specification.overridable&&this.overridableProperties.push(t);var n=this.defaultPropertyValues[t]=new Qo(r,void 0),i=this.defaultTransitionablePropertyValues[t]=new ea(r);this.defaultTransitioningPropertyValues[t]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=n.possiblyEvaluate({})}};xo("DataDrivenProperty",la),xo("DataConstantProperty",sa),xo("CrossFadedDataDrivenProperty",ca),xo("CrossFadedProperty",ua),xo("ColorRampProperty",da);var pa="-transition",fa=function(e){function t(t,r){if(e.call(this),this.id=t.id,this.type=t.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),r.layout&&(this._unevaluatedLayout=new ia(r.layout)),r.paint)){for(var n in this._transitionablePaint=new ta(r.paint),t.paint)this.setPaintProperty(n,t.paint[n],{validate:!1});for(var i in t.layout)this.setLayoutProperty(i,t.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new aa(r.paint)}}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},t.prototype.getLayoutProperty=function(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)},t.prototype.setLayoutProperty=function(e,t,r){if(void 0===r&&(r={}),null!==t&&void 0!==t){var n="layers."+this.id+".layout."+e;if(this._validate(uo,n,e,t,r))return}"visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility=t},t.prototype.getPaintProperty=function(e){return T(e,pa)?this._transitionablePaint.getTransition(e.slice(0,-pa.length)):this._transitionablePaint.getValue(e)},t.prototype.setPaintProperty=function(e,t,r){if(void 0===r&&(r={}),null!==t&&void 0!==t){var n="layers."+this.id+".paint."+e;if(this._validate(co,n,e,t,r))return!1}if(T(e,pa))return this._transitionablePaint.setTransition(e.slice(0,-pa.length),t||void 0),!1;var i=this._transitionablePaint._values[e],o="cross-faded-data-driven"===i.property.specification["property-type"],a=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);var l=this._transitionablePaint._values[e].value;return l.isDataDriven()||a||o||this._handleOverridablePaintPropertyUpdate(e,s,l)},t.prototype._handleSpecialPaintPropertyUpdate=function(e){},t.prototype._handleOverridablePaintPropertyUpdate=function(e,t,r){return!1},t.prototype.isHidden=function(e){return!!(this.minzoom&&e=this.maxzoom)||"none"===this.visibility},t.prototype.updateTransitions=function(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)},t.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},t.prototype.recalculate=function(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)},t.prototype.serialize=function(){var 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),C(e,(function(e,t){return void 0!==e&&!("layout"===t&&!Object.keys(e).length)&&!("paint"===t&&!Object.keys(e).length)}))},t.prototype._validate=function(e,t,r,n,i){return void 0===i&&(i={}),(!i||!1!==i.validate)&&ho(this,e.call(so,{key:t,layerType:this.type,objectKey:r,value:n,styleSpec:dt,style:{glyphs:!0,sprite:!0}}))},t.prototype.is3D=function(){return!1},t.prototype.isTileClipped=function(){return!1},t.prototype.hasOffscreenPass=function(){return!1},t.prototype.resize=function(){},t.prototype.isStateDependent=function(){for(var e in this.paint._values){var t=this.paint.get(e);if(t instanceof oa&&Qn(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1},t}(ut),ma={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},ga=function(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},ya=128,va=5,xa=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function ba(e,t){void 0===t&&(t=1);var r=0,n=0;return{members:e.map((function(e){var i=_a(e.type),o=r=wa(r,Math.max(t,i)),a=e.components||1;return n=Math.max(n,i),r+=i*a,{name:e.name,type:e.type,components:a,offset:o}})),size:wa(r,Math.max(n,t)),alignment:t}}function _a(e){return ma[e].BYTES_PER_ELEMENT}function wa(e,t){return Math.ceil(e/t)*t}xa.serialize=function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}},xa.deserialize=function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t},xa.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},xa.prototype.clear=function(){this.length=0},xa.prototype.resize=function(e){this.reserve(e),this.length=e},xa.prototype.reserve=function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(this.capacity*va),ya),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}},xa.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var ka=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.int16[n+0]=t,this.int16[n+1]=r,e},t}(xa);ka.prototype.bytesPerElement=4,xo("StructArrayLayout2i4",ka);var Sa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var o=4*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.int16[o+2]=n,this.int16[o+3]=i,e},t}(xa);Sa.prototype.bytesPerElement=8,xo("StructArrayLayout4i8",Sa);var Aa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i,o)},t.prototype.emplace=function(e,t,r,n,i,o,a){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,e},t}(xa);Aa.prototype.bytesPerElement=12,xo("StructArrayLayout2i4i12",Aa);var Ta=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i,o)},t.prototype.emplace=function(e,t,r,n,i,o,a){var s=4*e,l=8*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.uint8[l+4]=n,this.uint8[l+5]=i,this.uint8[l+6]=o,this.uint8[l+7]=a,e},t}(xa);Ta.prototype.bytesPerElement=8,xo("StructArrayLayout2i4ub8",Ta);var Ma=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.float32[n+0]=t,this.float32[n+1]=r,e},t}(xa);Ma.prototype.bytesPerElement=8,xo("StructArrayLayout2f8",Ma);var Ca=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,o,a,s,l,c){var u=this.length;return this.resize(u+1),this.emplace(u,e,t,r,n,i,o,a,s,l,c)},t.prototype.emplace=function(e,t,r,n,i,o,a,s,l,c,u){var d=10*e;return this.uint16[d+0]=t,this.uint16[d+1]=r,this.uint16[d+2]=n,this.uint16[d+3]=i,this.uint16[d+4]=o,this.uint16[d+5]=a,this.uint16[d+6]=s,this.uint16[d+7]=l,this.uint16[d+8]=c,this.uint16[d+9]=u,e},t}(xa);Ca.prototype.bytesPerElement=20,xo("StructArrayLayout10ui20",Ca);var Ea=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,o,a,s,l,c,u,d){var h=this.length;return this.resize(h+1),this.emplace(h,e,t,r,n,i,o,a,s,l,c,u,d)},t.prototype.emplace=function(e,t,r,n,i,o,a,s,l,c,u,d,h){var p=12*e;return this.int16[p+0]=t,this.int16[p+1]=r,this.int16[p+2]=n,this.int16[p+3]=i,this.uint16[p+4]=o,this.uint16[p+5]=a,this.uint16[p+6]=s,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=u,this.int16[p+10]=d,this.int16[p+11]=h,e},t}(xa);Ea.prototype.bytesPerElement=24,xo("StructArrayLayout4i4ui4i24",Ea);var Ia=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.float32[i+0]=t,this.float32[i+1]=r,this.float32[i+2]=n,e},t}(xa);Ia.prototype.bytesPerElement=12,xo("StructArrayLayout3f12",Ia);var Pa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.uint32[r+0]=t,e},t}(xa);Pa.prototype.bytesPerElement=4,xo("StructArrayLayout1ul4",Pa);var Oa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,o,a,s,l){var c=this.length;return this.resize(c+1),this.emplace(c,e,t,r,n,i,o,a,s,l)},t.prototype.emplace=function(e,t,r,n,i,o,a,s,l,c){var u=10*e,d=5*e;return this.int16[u+0]=t,this.int16[u+1]=r,this.int16[u+2]=n,this.int16[u+3]=i,this.int16[u+4]=o,this.int16[u+5]=a,this.uint32[d+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,e},t}(xa);Oa.prototype.bytesPerElement=20,xo("StructArrayLayout6i1ul2ui20",Oa);var Ra=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,o){var a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,n,i,o)},t.prototype.emplace=function(e,t,r,n,i,o,a){var s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=n,this.int16[s+3]=i,this.int16[s+4]=o,this.int16[s+5]=a,e},t}(xa);Ra.prototype.bytesPerElement=12,xo("StructArrayLayout2i2i2i12",Ra);var La=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i){var o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,n,i)},t.prototype.emplace=function(e,t,r,n,i,o){var a=4*e,s=8*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=n,this.int16[s+6]=i,this.int16[s+7]=o,e},t}(xa);La.prototype.bytesPerElement=16,xo("StructArrayLayout2f1f2i16",La);var Da=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var o=12*e,a=3*e;return this.uint8[o+0]=t,this.uint8[o+1]=r,this.float32[a+1]=n,this.float32[a+2]=i,e},t}(xa);Da.prototype.bytesPerElement=12,xo("StructArrayLayout2ub2f12",Da);var za=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,this.uint16[i+2]=n,e},t}(xa);za.prototype.bytesPerElement=6,xo("StructArrayLayout3ui6",za);var ja=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,o,a,s,l,c,u,d,h,p,f,m,g){var y=this.length;return this.resize(y+1),this.emplace(y,e,t,r,n,i,o,a,s,l,c,u,d,h,p,f,m,g)},t.prototype.emplace=function(e,t,r,n,i,o,a,s,l,c,u,d,h,p,f,m,g,y){var v=24*e,x=12*e,b=48*e;return this.int16[v+0]=t,this.int16[v+1]=r,this.uint16[v+2]=n,this.uint16[v+3]=i,this.uint32[x+2]=o,this.uint32[x+3]=a,this.uint32[x+4]=s,this.uint16[v+10]=l,this.uint16[v+11]=c,this.uint16[v+12]=u,this.float32[x+7]=d,this.float32[x+8]=h,this.uint8[b+36]=p,this.uint8[b+37]=f,this.uint8[b+38]=m,this.uint32[x+10]=g,this.int16[v+22]=y,e},t}(xa);ja.prototype.bytesPerElement=48,xo("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ja);var Fa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n,i,o,a,s,l,c,u,d,h,p,f,m,g,y,v,x,b,_,w,k,S,A,T,M){var C=this.length;return this.resize(C+1),this.emplace(C,e,t,r,n,i,o,a,s,l,c,u,d,h,p,f,m,g,y,v,x,b,_,w,k,S,A,T,M)},t.prototype.emplace=function(e,t,r,n,i,o,a,s,l,c,u,d,h,p,f,m,g,y,v,x,b,_,w,k,S,A,T,M,C){var E=34*e,I=17*e;return this.int16[E+0]=t,this.int16[E+1]=r,this.int16[E+2]=n,this.int16[E+3]=i,this.int16[E+4]=o,this.int16[E+5]=a,this.int16[E+6]=s,this.int16[E+7]=l,this.uint16[E+8]=c,this.uint16[E+9]=u,this.uint16[E+10]=d,this.uint16[E+11]=h,this.uint16[E+12]=p,this.uint16[E+13]=f,this.uint16[E+14]=m,this.uint16[E+15]=g,this.uint16[E+16]=y,this.uint16[E+17]=v,this.uint16[E+18]=x,this.uint16[E+19]=b,this.uint16[E+20]=_,this.uint16[E+21]=w,this.uint16[E+22]=k,this.uint32[I+12]=S,this.float32[I+13]=A,this.float32[I+14]=T,this.float32[I+15]=M,this.float32[I+16]=C,e},t}(xa);Fa.prototype.bytesPerElement=68,xo("StructArrayLayout8i15ui1ul4f68",Fa);var Na=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.float32[r+0]=t,e},t}(xa);Na.prototype.bytesPerElement=4,xo("StructArrayLayout1f4",Na);var Ba=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=3*e;return this.int16[i+0]=t,this.int16[i+1]=r,this.int16[i+2]=n,e},t}(xa);Ba.prototype.bytesPerElement=6,xo("StructArrayLayout3i6",Ba);var Va=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r){var n=this.length;return this.resize(n+1),this.emplace(n,e,t,r)},t.prototype.emplace=function(e,t,r,n){var i=2*e,o=4*e;return this.uint32[i+0]=t,this.uint16[o+2]=r,this.uint16[o+3]=n,e},t}(xa);Va.prototype.bytesPerElement=8,xo("StructArrayLayout1ul2ui8",Va);var Ua=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t){var r=this.length;return this.resize(r+1),this.emplace(r,e,t)},t.prototype.emplace=function(e,t,r){var n=2*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,e},t}(xa);Ua.prototype.bytesPerElement=4,xo("StructArrayLayout2ui4",Ua);var Ha=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e){var t=this.length;return this.resize(t+1),this.emplace(t,e)},t.prototype.emplace=function(e,t){var r=1*e;return this.uint16[r+0]=t,e},t}(xa);Ha.prototype.bytesPerElement=2,xo("StructArrayLayout1ui2",Ha);var $a=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(e,t,r,n){var i=this.length;return this.resize(i+1),this.emplace(i,e,t,r,n)},t.prototype.emplace=function(e,t,r,n,i){var o=4*e;return this.float32[o+0]=t,this.float32[o+1]=r,this.float32[o+2]=n,this.float32[o+3]=i,e},t}(xa);$a.prototype.bytesPerElement=16,xo("StructArrayLayout4f16",$a);var Wa=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new o(this.anchorPointX,this.anchorPointY)},Object.defineProperties(t.prototype,r),t}(ga);Wa.prototype.size=20;var qa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Wa(this,e)},t}(Oa);xo("CollisionBoxArray",qa);var Ga=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(e){this._structArray.uint8[this._pos1+37]=e},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(e){this._structArray.uint8[this._pos1+38]=e},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(e){this._structArray.uint32[this._pos4+10]=e},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(t.prototype,r),t}(ga);Ga.prototype.size=48;var Ya=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Ga(this,e)},t}(ja);xo("PlacedSymbolArray",Ya);var Xa=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(e){this._structArray.uint32[this._pos4+12]=e},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(t.prototype,r),t}(ga);Xa.prototype.size=68;var Za=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Xa(this,e)},t}(Fa);xo("SymbolInstanceArray",Za);var Ka=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getoffsetX=function(e){return this.float32[1*e+0]},t}(Na);xo("GlyphOffsetArray",Ka);var Ja=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.getx=function(e){return this.int16[3*e+0]},t.prototype.gety=function(e){return this.int16[3*e+1]},t.prototype.gettileUnitDistanceFromAnchor=function(e){return this.int16[3*e+2]},t}(Ba);xo("SymbolLineVertexArray",Ja);var Qa=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(t.prototype,r),t}(ga);Qa.prototype.size=8;var es=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(e){return new Qa(this,e)},t}(Va);xo("FeatureIndexArray",es);var ts=ba([{name:"a_pos",components:2,type:"Int16"}],4).members,rs=function(e){void 0===e&&(e=[]),this.segments=e};function ns(e,t){return 256*(e=p(Math.floor(e),0,255))+(t=p(Math.floor(t),0,255))}rs.prototype.prepareSegment=function(e,t,r,n){var i=this.segments[this.segments.length-1];return e>rs.MAX_VERTEX_ARRAY_LENGTH&&O("Max vertices per segment is "+rs.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+e),(!i||i.vertexLength+e>rs.MAX_VERTEX_ARRAY_LENGTH||i.sortKey!==n)&&(i={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==n&&(i.sortKey=n),this.segments.push(i)),i},rs.prototype.get=function(){return this.segments},rs.prototype.destroy=function(){for(var e=0,t=this.segments;e>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|i>>>19))+((5*(i>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:i^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return i^=e.length,i=2246822507*(65535&(i^=i>>>16))+((2246822507*(i>>>16)&65535)<<16)&4294967295,i=3266489909*(65535&(i^=i>>>13))+((3266489909*(i>>>16)&65535)<<16)&4294967295,(i^=i>>>16)>>>0}e.exports=t})),as=t((function(e){function t(e,t){for(var r,n=e.length,i=t^n,o=0;n>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),i=1540483477*(65535&i)+((1540483477*(i>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:i^=(255&e.charCodeAt(o+2))<<16;case 2:i^=(255&e.charCodeAt(o+1))<<8;case 1:i=1540483477*(65535&(i^=255&e.charCodeAt(o)))+((1540483477*(i>>>16)&65535)<<16)}return i=1540483477*(65535&(i^=i>>>13))+((1540483477*(i>>>16)&65535)<<16),(i^=i>>>15)>>>0}e.exports=t})),ss=os,ls=os,cs=as;ss.murmur3=ls,ss.murmur2=cs;var us=function(){this.ids=[],this.positions=[],this.indexed=!1};us.prototype.add=function(e,t,r,n){this.ids.push(hs(e)),this.positions.push(t,r,n)},us.prototype.getPositions=function(e){for(var t=hs(e),r=0,n=this.ids.length-1;r>1;this.ids[i]>=t?n=i:r=i+1}for(var o=[];this.ids[r]===t;){var a=this.positions[3*r],s=this.positions[3*r+1],l=this.positions[3*r+2];o.push({index:a,start:s,end:l}),r++}return o},us.serialize=function(e,t){var r=new Float64Array(e.ids),n=new Uint32Array(e.positions);return ps(r,n,0,r.length-1),t&&t.push(r.buffer,n.buffer),{ids:r,positions:n}},us.deserialize=function(e){var t=new us;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t};var ds=Math.pow(2,53)-1;function hs(e){var t=+e;return!isNaN(t)&&t<=ds?t:ss(String(e))}function ps(e,t,r,n){for(;r>1],o=r-1,a=n+1;;){do{o++}while(e[o]i);if(o>=a)break;fs(e,o,a),fs(t,3*o,3*a),fs(t,3*o+1,3*a+1),fs(t,3*o+2,3*a+2)}a-ra.x+1||la.y+1)&&O("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function Bs(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Ns(e):[]}}function Vs(e,t,r,n,i){e.emplaceBack(2*t+(n+1)/2,2*r+(i+1)/2)}var Us=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new ka,this.indexArray=new za,this.segments=new rs,this.programConfigurations=new Ps(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};function Hs(e,t){for(var r=0;r=3)for(var o=0;o1){if(Ys(e,t))return!0;for(var n=0;n1?e.distSqr(r):e.distSqr(r.sub(t)._mult(i)._add(t))}function Js(e,t){for(var r,n,i,o=!1,a=0;at.y!==i.y>t.y&&t.x<(i.x-n.x)*(t.y-n.y)/(i.y-n.y)+n.x&&(o=!o);return o}function Qs(e,t){for(var r=!1,n=0,i=e.length-1;nt.y!==a.y>t.y&&t.x<(a.x-o.x)*(t.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function el(e,t,r,n,i){for(var a=0,s=e;a=l.x&&i>=l.y)return!0}var c=[new o(t,r),new o(t,i),new o(n,i),new o(n,r)];if(e.length>2)for(var u=0,d=c;ui.x&&t.x>i.x||e.yi.y&&t.y>i.y)return!1;var o=R(e,t,r[0]);return o!==R(e,t,r[1])||o!==R(e,t,r[2])||o!==R(e,t,r[3])}function rl(e,t,r){var n=t.paint.get(e).value;return"constant"===n.kind?n.value:r.programConfigurations.get(t.id).getMaxValue(e)}function nl(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function il(e,t,r,n,i){if(!t[0]&&!t[1])return e;var a=o.convert(t)._mult(i);"viewport"===r&&a._rotate(-n);for(var s=[],l=0;l=Ds||u<0||u>=Ds)){var d=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),h=d.vertexLength;Vs(this.layoutVertexArray,c,u,-1,-1),Vs(this.layoutVertexArray,c,u,1,-1),Vs(this.layoutVertexArray,c,u,1,1),Vs(this.layoutVertexArray,c,u,-1,1),this.indexArray.emplaceBack(h,h+1,h+2),this.indexArray.emplaceBack(h,h+3,h+2),d.vertexLength+=4,d.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},n)},xo("CircleBucket",Us,{omit:["layers"]});var ol=new ha({"circle-sort-key":new la(dt.layout_circle["circle-sort-key"])}),al={paint:new ha({"circle-radius":new la(dt.paint_circle["circle-radius"]),"circle-color":new la(dt.paint_circle["circle-color"]),"circle-blur":new la(dt.paint_circle["circle-blur"]),"circle-opacity":new la(dt.paint_circle["circle-opacity"]),"circle-translate":new sa(dt.paint_circle["circle-translate"]),"circle-translate-anchor":new sa(dt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new sa(dt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new sa(dt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new la(dt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new la(dt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new la(dt.paint_circle["circle-stroke-opacity"])}),layout:ol},sl="undefined"!==typeof Float32Array?Float32Array:Array;function ll(){var e=new sl(4);return sl!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}function cl(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);return e[0]=n*l+o*s,e[1]=i*l+a*s,e[2]=n*-s+o*l,e[3]=i*-s+a*l,e}function ul(){var e=new sl(9);return sl!=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 dl(e,t){var r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=-r,e[4]=n,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function hl(){var e=new sl(16);return sl!=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 pl(e){var t=new sl(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 fl(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 ml(e,t){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],d=t[9],h=t[10],p=t[11],f=t[12],m=t[13],g=t[14],y=t[15],v=r*s-n*a,x=r*l-i*a,b=r*c-o*a,_=n*l-i*s,w=n*c-o*s,k=i*c-o*l,S=u*m-d*f,A=u*g-h*f,T=u*y-p*f,M=d*g-h*m,C=d*y-p*m,E=h*y-p*g,I=v*E-x*C+b*M+_*T-w*A+k*S;return I?(I=1/I,e[0]=(s*E-l*C+c*M)*I,e[1]=(i*C-n*E-o*M)*I,e[2]=(m*k-g*w+y*_)*I,e[3]=(h*w-d*k-p*_)*I,e[4]=(l*T-a*E-c*A)*I,e[5]=(r*E-i*T+o*A)*I,e[6]=(g*b-f*k-y*x)*I,e[7]=(u*k-h*b+p*x)*I,e[8]=(a*C-s*T+c*S)*I,e[9]=(n*T-r*C-o*S)*I,e[10]=(f*w-m*b+y*v)*I,e[11]=(d*b-u*w-p*v)*I,e[12]=(s*A-a*M-l*S)*I,e[13]=(r*M-n*A+i*S)*I,e[14]=(m*x-f*_-g*v)*I,e[15]=(u*_-d*x+h*v)*I,e):null}function gl(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=t[9],p=t[10],f=t[11],m=t[12],g=t[13],y=t[14],v=t[15],x=r[0],b=r[1],_=r[2],w=r[3];return e[0]=x*n+b*s+_*d+w*m,e[1]=x*i+b*l+_*h+w*g,e[2]=x*o+b*c+_*p+w*y,e[3]=x*a+b*u+_*f+w*v,x=r[4],b=r[5],_=r[6],w=r[7],e[4]=x*n+b*s+_*d+w*m,e[5]=x*i+b*l+_*h+w*g,e[6]=x*o+b*c+_*p+w*y,e[7]=x*a+b*u+_*f+w*v,x=r[8],b=r[9],_=r[10],w=r[11],e[8]=x*n+b*s+_*d+w*m,e[9]=x*i+b*l+_*h+w*g,e[10]=x*o+b*c+_*p+w*y,e[11]=x*a+b*u+_*f+w*v,x=r[12],b=r[13],_=r[14],w=r[15],e[12]=x*n+b*s+_*d+w*m,e[13]=x*i+b*l+_*h+w*g,e[14]=x*o+b*c+_*p+w*y,e[15]=x*a+b*u+_*f+w*v,e}function yl(e,t,r){var n,i,o,a,s,l,c,u,d,h,p,f,m=r[0],g=r[1],y=r[2];return t===e?(e[12]=t[0]*m+t[4]*g+t[8]*y+t[12],e[13]=t[1]*m+t[5]*g+t[9]*y+t[13],e[14]=t[2]*m+t[6]*g+t[10]*y+t[14],e[15]=t[3]*m+t[7]*g+t[11]*y+t[15]):(n=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],d=t[8],h=t[9],p=t[10],f=t[11],e[0]=n,e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=d,e[9]=h,e[10]=p,e[11]=f,e[12]=n*m+s*g+d*y+t[12],e[13]=i*m+l*g+h*y+t[13],e[14]=o*m+c*g+p*y+t[14],e[15]=a*m+u*g+f*y+t[15]),e}function vl(e,t,r){var n=r[0],i=r[1],o=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,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 xl(e,t,r){var n=Math.sin(r),i=Math.cos(r),o=t[4],a=t[5],s=t[6],l=t[7],c=t[8],u=t[9],d=t[10],h=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*i+c*n,e[5]=a*i+u*n,e[6]=s*i+d*n,e[7]=l*i+h*n,e[8]=c*i-o*n,e[9]=u*i-a*n,e[10]=d*i-s*n,e[11]=h*i-l*n,e}function bl(e,t,r){var n=Math.sin(r),i=Math.cos(r),o=t[0],a=t[1],s=t[2],l=t[3],c=t[4],u=t[5],d=t[6],h=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*i+c*n,e[1]=a*i+u*n,e[2]=s*i+d*n,e[3]=l*i+h*n,e[4]=c*i-o*n,e[5]=u*i-a*n,e[6]=d*i-s*n,e[7]=h*i-l*n,e}function _l(e,t,r,n,i){var o,a=1/Math.tan(t/2);return e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,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!=i&&i!==1/0?(o=1/(n-i),e[10]=(i+n)*o,e[14]=2*i*n*o):(e[10]=-1,e[14]=-2*n),e}function wl(e,t,r,n,i,o,a){var s=1/(t-r),l=1/(n-i),c=1/(o-a);return e[0]=-2*s,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+r)*s,e[13]=(i+n)*l,e[14]=(a+o)*c,e[15]=1,e}Math.hypot||(Math.hypot=function(){for(var e=arguments,t=0,r=arguments.length;r--;)t+=e[r]*e[r];return Math.sqrt(t)});var kl=gl;function Sl(){var e=new sl(3);return sl!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Al(e){var t=new sl(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Tl(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function Ml(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function Cl(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function El(e,t){var r=t[0],n=t[1],i=t[2],o=r*r+n*n+i*i;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 Il(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Pl(e,t,r){var n=t[0],i=t[1],o=t[2],a=r[0],s=r[1],l=r[2];return e[0]=i*l-o*s,e[1]=o*a-n*l,e[2]=n*s-i*a,e}function Ol(e,t,r){var n=t[0],i=t[1],o=t[2];return e[0]=n*r[0]+i*r[3]+o*r[6],e[1]=n*r[1]+i*r[4]+o*r[7],e[2]=n*r[2]+i*r[5]+o*r[8],e}var Rl=Ml;function Ll(){var e=new sl(4);return sl!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Dl(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 zl(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function jl(e,t,r){var n=t[0],i=t[1],o=t[2],a=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*o+r[12]*a,e[1]=r[1]*n+r[5]*i+r[9]*o+r[13]*a,e[2]=r[2]*n+r[6]*i+r[10]*o+r[14]*a,e[3]=r[3]*n+r[7]*i+r[11]*o+r[15]*a,e}function Fl(){var e=new sl(2);return sl!=Float32Array&&(e[0]=0,e[1]=0),e}function Nl(e){var t=e[0],r=e[1];return t*t+r*r}Sl(),Ll();var Bl=Nl,Vl=(Fl(),function(e){function t(t){e.call(this,t,al)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.createBucket=function(e){return new Us(e)},t.prototype.queryRadius=function(e){var t=e;return rl("circle-radius",this,t)+rl("circle-stroke-width",this,t)+nl(this.paint.get("circle-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,n,i,o,a,s){for(var l=il(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),c=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r),u="map"===this.paint.get("circle-pitch-alignment"),d=u?l:Hl(l,s),h=u?c*a:c,p=0,f=n;pe.width||i.height>e.height||r.x>e.width-i.width||r.y>e.height-i.height)throw new RangeError("out of range source coordinates for image copy");if(i.width>t.width||i.height>t.height||n.x>t.width-i.width||n.y>t.height-i.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=e.data,s=t.data,l=0;l80*r){n=o=e[0],i=a=e[1];for(var f=r;fo&&(o=s),l>a&&(a=l);c=0!==(c=Math.max(o-n,a-i))?1/c:0}return sc(h,p,r,n,i,c),p}function oc(e,t,r,n,i){var o,a;if(i===Dc(e,t,r,n)>0)for(o=t;o=t;o-=n)a=Oc(o,e[o],e[o+1],a);return a&&Sc(a,a.next)&&(Rc(a),a=a.next),a}function ac(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!Sc(n,n.next)&&0!==kc(n.prev,n,n.next))n=n.next;else{if(Rc(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function sc(e,t,r,n,i,o,a){if(e){!a&&o&&yc(e,n,i,o);for(var s,l,c=e;e.prev!==e.next;)if(s=e.prev,l=e.next,o?cc(e,n,i,o):lc(e))t.push(s.i/r),t.push(e.i/r),t.push(l.i/r),Rc(e),e=l.next,c=l.next;else if((e=l)===c){a?1===a?sc(e=uc(ac(e),t,r),t,r,n,i,o,2):2===a&&dc(e,t,r,n,i,o):sc(ac(e),t,r,n,i,o,1);break}}}function lc(e){var t=e.prev,r=e,n=e.next;if(kc(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(_c(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&kc(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function cc(e,t,r,n){var i=e.prev,o=e,a=e.next;if(kc(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,u=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,d=xc(s,l,t,r,n),h=xc(c,u,t,r,n),p=e.prevZ,f=e.nextZ;p&&p.z>=d&&f&&f.z<=h;){if(p!==e.prev&&p!==e.next&&_c(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&kc(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==e.prev&&f!==e.next&&_c(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&kc(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=d;){if(p!==e.prev&&p!==e.next&&_c(i.x,i.y,o.x,o.y,a.x,a.y,p.x,p.y)&&kc(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=h;){if(f!==e.prev&&f!==e.next&&_c(i.x,i.y,o.x,o.y,a.x,a.y,f.x,f.y)&&kc(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function uc(e,t,r){var n=e;do{var i=n.prev,o=n.next.next;!Sc(i,o)&&Ac(i,n,n.next,o)&&Ec(i,o)&&Ec(o,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(o.i/r),Rc(n),Rc(n.next),n=e=o),n=n.next}while(n!==e);return ac(n)}function dc(e,t,r,n,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&wc(a,s)){var l=Pc(a,s);return a=ac(a,a.next),l=ac(l,l.next),sc(a,t,r,n,i,o),void sc(l,t,r,n,i,o)}s=s.next}a=a.next}while(a!==e)}function hc(e,t,r,n){var i,o,a,s=[];for(i=0,o=t.length;i=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=u&&i!==n.x&&_c(or.x||n.x===r.x&&gc(r,n)))&&(r=n,h=l)),n=n.next}while(n!==c);return r}function gc(e,t){return kc(e.prev,e,t.prev)<0&&kc(t.next,e,e.next)<0}function yc(e,t,r,n){var i=e;do{null===i.z&&(i.z=xc(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,vc(i)}function vc(e){var t,r,n,i,o,a,s,l,c=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,n=r,s=0,t=0;t0||l>0&&n;)0!==s&&(0===l||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;r=n}o.nextZ=null,c*=2}while(a>1);return e}function xc(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function bc(e){var t=e,r=e;do{(t.x=0&&(e-a)*(n-s)-(r-a)*(t-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function wc(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!Cc(e,t)&&(Ec(e,t)&&Ec(t,e)&&Ic(e,t)&&(kc(e.prev,e,t.prev)||kc(e,t.prev,t))||Sc(e,t)&&kc(e.prev,e,e.next)>0&&kc(t.prev,t,t.next)>0)}function kc(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Sc(e,t){return e.x===t.x&&e.y===t.y}function Ac(e,t,r,n){var i=Mc(kc(e,t,r)),o=Mc(kc(e,t,n)),a=Mc(kc(r,n,e)),s=Mc(kc(r,n,t));return i!==o&&a!==s||!(0!==i||!Tc(e,r,t))||!(0!==o||!Tc(e,n,t))||!(0!==a||!Tc(r,e,n))||!(0!==s||!Tc(r,t,n))}function Tc(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 Mc(e){return e>0?1:e<0?-1:0}function Cc(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&&Ac(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}function Ec(e,t){return kc(e.prev,e,e.next)<0?kc(e,t,e.next)>=0&&kc(e,e.prev,t)>=0:kc(e,t,e.prev)<0||kc(e,e.next,t)<0}function Ic(e,t){var r=e,n=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{r.y>o!==r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}function Pc(e,t){var r=new Lc(e.i,e.x,e.y),n=new Lc(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function Oc(e,t,r,n){var i=new Lc(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Rc(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 Lc(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Dc(e,t,r,n){for(var i=0,o=t,a=r-n;or;){if(n-r>600){var o=n-r+1,a=t-r+1,s=Math.log(o),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1);jc(e,t,Math.max(r,Math.floor(t-a*l/o+c)),Math.min(n,Math.floor(t+(o-a)*l/o+c)),i)}var u=e[t],d=r,h=n;for(Fc(e,r,t),i(e[n],u)>0&&Fc(e,r,n);d0;)h--}0===i(e[r],u)?Fc(e,r,h):Fc(e,++h,n),h<=t&&(r=h+1),t<=h&&(n=h-1)}}function Fc(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function Nc(e,t){return et?1:0}function Bc(e,t){var r=e.length;if(r<=1)return[e];for(var n,i,o=[],a=0;a1)for(var l=0;l0&&(n+=e[i-1].length,r.holes.push(n))}return r},rc.default=nc;var $c=500,Wc=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new ka,this.indexArray=new za,this.indexArray2=new Ua,this.programConfigurations=new Ps(e.layers,e.zoom),this.segments=new rs,this.segments2=new rs,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};Wc.prototype.populate=function(e,t,r){this.hasPattern=Uc("fill",this.layers,t);for(var n=this.layers[0].layout.get("fill-sort-key"),i=[],o=0,a=e;o>3}if(i--,1===n||2===n)a+=e.readSVarint(),s+=e.readSVarint(),1===n&&(t&&l.push(t),t=[]),t.push(new o(a,s));else{if(7!==n)throw new Error("unknown command "+n);t&&t.push(t[0].clone())}}return t&&l.push(t),l},Kc.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,n=0,i=0,o=0,a=1/0,s=-1/0,l=1/0,c=-1/0;e.pos>3}if(n--,1===r||2===r)(i+=e.readSVarint())s&&(s=i),(o+=e.readSVarint())c&&(c=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,l,s,c]},Kc.prototype.toGeoJSON=function(e,t,r){var n,i,o=this.extent*Math.pow(2,r),a=this.extent*e,s=this.extent*t,l=this.loadGeometry(),c=Kc.types[this.type];function u(e){for(var t=0;t>3;t=1===n?e.readString():2===n?e.readFloat():3===n?e.readDouble():4===n?e.readVarint64():5===n?e.readVarint():6===n?e.readSVarint():7===n?e.readBoolean():null}return t}function au(e,t){this.layers=e.readFields(su,{},t)}function su(e,t,r){if(3===e){var n=new ru(r,r.readVarint()+r.pos);n.length&&(t[n.name]=n)}}nu.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 Zc(this._pbf,t,this.extent,this._keys,this._values)};var lu={VectorTile:au,VectorTileFeature:Zc,VectorTileLayer:ru},cu=lu.VectorTileFeature.types,uu=500,du=Math.pow(2,13);function hu(e,t,r,n,i,o,a,s){e.emplaceBack(t,r,2*Math.floor(n*du)+a,i*du*2,o*du*2,Math.round(s))}var pu=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((function(e){return e.id})),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new Aa,this.indexArray=new za,this.programConfigurations=new Ps(e.layers,e.zoom),this.segments=new rs,this.stateDependentLayerIds=this.layers.filter((function(e){return e.isStateDependent()})).map((function(e){return e.id}))};function fu(e,t){return e.x===t.x&&(e.x<0||e.x>Ds)||e.y===t.y&&(e.y<0||e.y>Ds)}function mu(e){return e.every((function(e){return e.x<0}))||e.every((function(e){return e.x>Ds}))||e.every((function(e){return e.y<0}))||e.every((function(e){return e.y>Ds}))}pu.prototype.populate=function(e,t,r){this.features=[],this.hasPattern=Uc("fill-extrusion",this.layers,t);for(var n=0,i=e;n=1){var v=f[g-1];if(!fu(y,v)){d.vertexLength+4>rs.MAX_VERTEX_ARRAY_LENGTH&&(d=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var x=y.sub(v)._perp()._unit(),b=v.dist(y);m+b>32768&&(m=0),hu(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,0,m),hu(this.layoutVertexArray,y.x,y.y,x.x,x.y,0,1,m),m+=b,hu(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,0,m),hu(this.layoutVertexArray,v.x,v.y,x.x,x.y,0,1,m);var _=d.vertexLength;this.indexArray.emplaceBack(_,_+2,_+1),this.indexArray.emplaceBack(_+1,_+2,_+3),d.vertexLength+=4,d.primitiveLength+=2}}}}if(d.vertexLength+l>rs.MAX_VERTEX_ARRAY_LENGTH&&(d=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===cu[e.type]){for(var w=[],k=[],S=d.vertexLength,A=0,T=s;A=2&&e[l-1].equals(e[l-2]);)l--;for(var c=0;c0;if(k&&y>c){var A=u.dist(p);if(A>2*d){var T=u.sub(u.sub(p)._mult(d/A)._round());this.updateDistance(p,T),this.addCurrentVertex(T,m,0,0,h),p=T}}var M=p&&f,C=M?r:s?"butt":n;if(M&&"round"===C&&(_i&&(C="bevel"),"bevel"===C&&(_>2&&(C="flipbevel"),_100)v=g.mult(-1);else{var E=_*m.add(g).mag()/m.sub(g).mag();v._perp()._mult(E*(S?-1:1))}this.addCurrentVertex(u,v,0,0,h),this.addCurrentVertex(u,v.mult(-1),0,0,h)}else if("bevel"===C||"fakeround"===C){var I=-Math.sqrt(_*_-1),P=S?I:0,O=S?0:I;if(p&&this.addCurrentVertex(u,m,P,O,h),"fakeround"===C)for(var R=Math.round(180*w/Math.PI/Eu),L=1;L2*d){var B=u.add(f.sub(u)._mult(d/N)._round());this.updateDistance(u,B),this.addCurrentVertex(B,g,0,0,h),u=B}}}}},Ru.prototype.addCurrentVertex=function(e,t,r,n,i,o){void 0===o&&(o=!1);var a=t.x+t.y*r,s=t.y-t.x*r,l=-t.x+t.y*n,c=-t.y-t.x*n;this.addHalfVertex(e,a,s,o,!1,r,i),this.addHalfVertex(e,l,c,o,!0,-n,i),this.distance>Ou/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(e,t,r,n,i,o))},Ru.prototype.addHalfVertex=function(e,t,r,n,i,o,a){var s=e.x,l=e.y,c=(this.lineClips?this.scaledDistance*(Ou-1):this.scaledDistance)*Pu;if(this.layoutVertexArray.emplaceBack((s<<1)+(n?1:0),(l<<1)+(i?1:0),Math.round(Tu*t)+128,Math.round(Tu*r)+128,1+(0===o?0:o<0?-1:1)|(63&c)<<2,c>>6),this.lineClips){var u=(this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start);this.layoutVertexArray2.emplaceBack(u,this.lineClipsArray.length)}var d=a.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,d),a.primitiveLength++),i?this.e2=d:this.e1=d},Ru.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Ru.prototype.updateDistance=function(e,t){this.distance+=e.dist(t),this.updateScaledDistance()},xo("LineBucket",Ru,{omit:["layers","patternFeatures"]});var Lu=new ha({"line-cap":new sa(dt.layout_line["line-cap"]),"line-join":new la(dt.layout_line["line-join"]),"line-miter-limit":new sa(dt.layout_line["line-miter-limit"]),"line-round-limit":new sa(dt.layout_line["line-round-limit"]),"line-sort-key":new la(dt.layout_line["line-sort-key"])}),Du={paint:new ha({"line-opacity":new la(dt.paint_line["line-opacity"]),"line-color":new la(dt.paint_line["line-color"]),"line-translate":new sa(dt.paint_line["line-translate"]),"line-translate-anchor":new sa(dt.paint_line["line-translate-anchor"]),"line-width":new la(dt.paint_line["line-width"]),"line-gap-width":new la(dt.paint_line["line-gap-width"]),"line-offset":new la(dt.paint_line["line-offset"]),"line-blur":new la(dt.paint_line["line-blur"]),"line-dasharray":new ua(dt.paint_line["line-dasharray"]),"line-pattern":new ca(dt.paint_line["line-pattern"]),"line-gradient":new da(dt.paint_line["line-gradient"])}),layout:Lu},zu=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.possiblyEvaluate=function(t,r){return r=new Jo(Math.floor(r.zoom),{now:r.now,fadeDuration:r.fadeDuration,zoomHistory:r.zoomHistory,transition:r.transition}),e.prototype.possiblyEvaluate.call(this,t,r)},t.prototype.evaluate=function(t,r,n,i){return r=v({},r,{zoom:Math.floor(r.zoom)}),e.prototype.evaluate.call(this,t,r,n,i)},t}(la),ju=new zu(Du.paint.properties["line-width"].specification);ju.useIntegerZoom=!0;var Fu=function(e){function t(t){e.call(this,t,Du),this.gradientVersion=0}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(e){if("line-gradient"===e){var t=this._transitionablePaint._values["line-gradient"].value.expression;this.stepInterpolant=t._styleExpression.expression instanceof Fr,this.gradientVersion=(this.gradientVersion+1)%c}},t.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},t.prototype.recalculate=function(t,r){e.prototype.recalculate.call(this,t,r),this.paint._values["line-floorwidth"]=ju.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)},t.prototype.createBucket=function(e){return new Ru(e)},t.prototype.queryRadius=function(e){var t=e,r=Nu(rl("line-width",this,t),rl("line-gap-width",this,t)),n=rl("line-offset",this,t);return r/2+Math.abs(n)+nl(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(e,t,r,n,i,o,a){var s=il(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,a),l=a/2*Nu(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),c=this.paint.get("line-offset").evaluate(t,r);return c&&(n=Bu(n,c*a)),qs(s,n,l)},t.prototype.isTileClipped=function(){return!0},t}(fa);function Nu(e,t){return t>0?t+2*e:e}function Bu(e,t){for(var r=[],n=new o(0,0),i=0;i":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"};function Zu(e){for(var t="",r=0;r>1,u=-7,d=r?i-1:0,h=r?-1:1,p=e[t+d];for(d+=h,o=p&(1<<-u)-1,p>>=-u,u+=s;u>0;o=256*o+e[t+d],d+=h,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=n;u>0;a=256*a+e[t+d],d+=h,u-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=c}return(p?-1:1)*a*Math.pow(2,o-n)},write:function(e,t,r,n,i,o){var a,s,l,c=8*o-i-1,u=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,f=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+d>=1?h/l:h*Math.pow(2,1-d))*l>=2&&(a++,l/=2),a+d>=u?(s=0,a=u):a+d>=1?(s=(t*l-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[r+p]=255&s,p+=f,s/=256,i-=8);for(a=a<0;e[r+p]=255&a,p+=f,a/=256,c-=8);e[r+p-f]|=128*m}},Qu=ed;function ed(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}ed.Varint=0,ed.Fixed64=1,ed.Bytes=2,ed.Fixed32=5;var td=4294967296,rd=1/td,nd=12,id="undefined"===typeof TextDecoder?null:new TextDecoder("utf8");function od(e,t,r){var n,i,o=r.buf;if(n=(112&(i=o[r.pos++]))>>4,i<128)return sd(e,n,t);if(n|=(127&(i=o[r.pos++]))<<3,i<128)return sd(e,n,t);if(n|=(127&(i=o[r.pos++]))<<10,i<128)return sd(e,n,t);if(n|=(127&(i=o[r.pos++]))<<17,i<128)return sd(e,n,t);if(n|=(127&(i=o[r.pos++]))<<24,i<128)return sd(e,n,t);if(n|=(1&(i=o[r.pos++]))<<31,i<128)return sd(e,n,t);throw new Error("Expected varint not more than 10 bytes")}function ad(e){return e.type===ed.Bytes?e.readVarint()+e.pos:e.pos+1}function sd(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function ld(e,t){var r,n;if(e>=0?(r=e%4294967296|0,n=e/4294967296|0):(n=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,n=n+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),cd(r,n,t),ud(n,t)}function cd(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 ud(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 dd(e,t,r){var n=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=e;i--)r.buf[i+n]=r.buf[i]}function hd(e,t){for(var r=0;r>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function kd(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function Sd(e,t,r){for(var n="",i=t;i239?4:l>223?3:l>191?2:1;if(i+u>r)break;1===u?l<128&&(c=l):2===u?128===(192&(o=e[i+1]))&&(c=(31&l)<<6|63&o)<=127&&(c=null):3===u?(o=e[i+1],a=e[i+2],128===(192&o)&&128===(192&a)&&((c=(15&l)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(o=e[i+1],a=e[i+2],s=e[i+3],128===(192&o)&&128===(192&a)&&128===(192&s)&&((c=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),i+=u}return n}function Ad(e,t,r){return id.decode(e.subarray(t,r))}function Td(e,t,r){for(var n,i,o=0;o55295&&n<57344){if(!i){n>56319||o+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):i=n;continue}if(n<56320){e[r++]=239,e[r++]=191,e[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(e[r++]=239,e[r++]=191,e[r++]=189,i=null);n<128?e[r++]=n:(n<2048?e[r++]=n>>6|192:(n<65536?e[r++]=n>>12|224:(e[r++]=n>>18|240,e[r++]=n>>12&63|128),e[r++]=n>>6&63|128),e[r++]=63&n|128)}return r}ed.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos>3,o=this.pos;this.type=7&n,e(i,t,this),this.pos===o&&this.skip(n)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=_d(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=kd(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=_d(this.buf,this.pos)+_d(this.buf,this.pos+4)*td;return this.pos+=8,e},readSFixed64:function(){var e=_d(this.buf,this.pos)+kd(this.buf,this.pos+4)*td;return this.pos+=8,e},readFloat:function(){var e=Ju.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=Ju.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,n=this.buf;return t=127&(r=n[this.pos++]),r<128?t:(t|=(127&(r=n[this.pos++]))<<7,r<128?t:(t|=(127&(r=n[this.pos++]))<<14,r<128?t:(t|=(127&(r=n[this.pos++]))<<21,r<128?t:od(t|=(15&(r=n[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2===1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=nd&&id?Ad(this.buf,t,e):Sd(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==ed.Bytes)return e.push(this.readVarint(t));var r=ad(this);for(e=e||[];this.pos127;);else if(t===ed.Bytes)this.pos=this.readVarint()+this.pos;else if(t===ed.Fixed32)this.pos+=4;else{if(t!==ed.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t268435455||e<0?ld(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))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=Td(this.buf,e,this.pos);var r=this.pos-t;r>=128&&dd(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),Ju.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),Ju.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r=128&&dd(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(e,t,r){this.writeTag(e,ed.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,hd,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,pd,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,gd,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,fd,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,md,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,yd,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,vd,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,xd,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,bd,t)},writeBytesField:function(e,t){this.writeTag(e,ed.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,ed.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,ed.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,ed.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,ed.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,ed.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,ed.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,ed.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,ed.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,ed.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};var Md=3;function Cd(e,t,r){1===e&&r.readMessage(Ed,t)}function Ed(e,t,r){if(3===e){var n=r.readMessage(Id,{}),i=n.id,o=n.bitmap,a=n.width,s=n.height,l=n.left,c=n.top,u=n.advance;t.push({id:i,bitmap:new Yl({width:a+2*Md,height:s+2*Md},o),metrics:{width:a,height:s,left:l,top:c,advance:u}})}}function Id(e,t,r){1===e?t.id=r.readVarint():2===e?t.bitmap=r.readBytes():3===e?t.width=r.readVarint():4===e?t.height=r.readVarint():5===e?t.left=r.readSVarint():6===e?t.top=r.readSVarint():7===e&&(t.advance=r.readVarint())}function Pd(e){return new Qu(e).readFields(Cd,[])}var Od=Md;function Rd(e){for(var t=0,r=0,n=0,i=e;n=0;h--){var p=a[h];if(!(d.w>p.w||d.h>p.h)){if(d.x=p.x,d.y=p.y,l=Math.max(l,d.y+d.h),s=Math.max(s,d.x+d.w),d.w===p.w&&d.h===p.h){var f=a.pop();h=0&&n>=e&&Gd[this.text.charCodeAt(n)];n--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)},$d.prototype.substring=function(e,t){var r=new $d;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r},$d.prototype.toString=function(){return this.text},$d.prototype.getMaxScale=function(){var e=this;return this.sectionIndex.reduce((function(t,r){return Math.max(t,e.sections[r].scale)}),0)},$d.prototype.addTextSection=function(e,t){this.text+=e.text,this.sections.push(Hd.forText(e.scale,e.fontStack||t));for(var r=this.sections.length-1,n=0;n=Ud?null:++this.imageSectionID:(this.imageSectionID=Vd,this.imageSectionID)};var Gd={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},Yd={};function Xd(e,t,r,n,i,o){if(t.imageName){var a=n[t.imageName];return a?a.displaySize[0]*t.scale*Ku/o+i:0}var s=r[t.fontStack],l=s&&s[e];return l?l.metrics.advance*t.scale+i:0}function Zd(e,t,r,n,i,o){for(var a=0,s=0;s=0,u=0,d=0;d0&&F>A&&(A=F)}else{var N=r[M.fontStack],B=N&&N[E];if(B&&B.rect)O=B.rect,P=B.metrics;else{var V=t[M.fontStack],U=V&&V[E];if(!U)continue;P=U.metrics}I=(_-M.scale)*Ku}D?(e.verticalizable=!0,S.push({glyph:E,imageName:R,x:h,y:p+I,vertical:D,scale:M.scale,fontStack:M.fontStack,sectionIndex:C,metrics:P,rect:O}),h+=L*M.scale+c):(S.push({glyph:E,imageName:R,x:h,y:p+I,vertical:D,scale:M.scale,fontStack:M.fontStack,sectionIndex:C,metrics:P,rect:O}),h+=P.advance*M.scale+c)}if(0!==S.length){var H=h-c;f=Math.max(H,f),ih(S,0,S.length-1,g,A)}h=0;var $=o*_+A;k.lineOffset=Math.max(A,w),p+=$,m=Math.max($,m),++y}else p+=o,++y}var W=p-Nd,q=rh(a),G=q.horizontalAlign,Y=q.verticalAlign;oh(e.positionedLines,g,G,Y,f,m,o,W,i.length),e.top+=-Y*W,e.bottom=e.top+W,e.left+=-G*f,e.right=e.left+f}function ih(e,t,r,n,i){if(n||i)for(var o=e[r],a=o.metrics.advance*o.scale,s=(e[r].x+a)*n,l=t;l<=r;l++)e[l].x-=s,e[l].y+=i}function oh(e,t,r,n,i,o,a,s,l){var c=(t-r)*i,u=0;u=o!==a?-s*n-Nd:(-n*l+.5)*a;for(var d=0,h=e;d-r/2;){if(--a<0)return!1;s-=e[a].dist(o),o=e[a]}s+=e[a].dist(e[a+1]),a++;for(var l=[],c=0;sn;)c-=l.shift().angleDelta;if(c>i)return!1;a++,s+=d.dist(h)}return!0}function mh(e){for(var t=0,r=0;rc){var f=(c-l)/p,m=Nr(d.x,h.x,f),g=Nr(d.y,h.y,f),y=new lh(m,g,h.angleTo(d),u);return y._round(),!a||fh(e,y,s,a,t)?y:void 0}l+=p}}function xh(e,t,r,n,i,o,a,s,l){var c=gh(n,o,a),u=yh(n,i),d=u*a,h=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-d=0&&b=0&&_=0&&h+c<=u){var w=new lh(b,_,v,f);w._round(),n&&!fh(e,w,o,n,i)||p.push(w)}}d+=y}return s||p.length||a||(p=bh(e,d/2,r,n,i,o,a,!0,l)),p}function _h(e,t,r,n,i){for(var a=[],s=0;s=n&&h.x>=n||(d.x>=n?d=new o(n,d.y+(h.y-d.y)*((n-d.x)/(h.x-d.x)))._round():h.x>=n&&(h=new o(n,d.y+(h.y-d.y)*((n-d.x)/(h.x-d.x)))._round()),d.y>=i&&h.y>=i||(d.y>=i?d=new o(d.x+(h.x-d.x)*((i-d.y)/(h.y-d.y)),i)._round():h.y>=i&&(h=new o(d.x+(h.x-d.x)*((i-d.y)/(h.y-d.y)),i)._round()),c&&d.equals(c[c.length-1])||(c=[d],a.push(c)),c.push(h)))))}return a}var wh=Ld;function kh(e,t,r,n){var i=[],a=e.image,s=a.pixelRatio,l=a.paddedRect.w-2*wh,c=a.paddedRect.h-2*wh,u=e.right-e.left,d=e.bottom-e.top,h=a.stretchX||[[0,l]],p=a.stretchY||[[0,c]],f=function(e,t){return e+t[1]-t[0]},m=h.reduce(f,0),g=p.reduce(f,0),y=l-m,v=c-g,x=0,b=m,_=0,w=g,k=0,S=y,A=0,T=v;if(a.content&&n){var M=a.content;x=Sh(h,0,M[0]),_=Sh(p,0,M[1]),b=Sh(h,M[0],M[2]),w=Sh(p,M[1],M[3]),k=M[0]-x,A=M[1]-_,S=M[2]-M[0]-b,T=M[3]-M[1]-w}var C=function(n,i,l,c){var h=Th(n.stretch-x,b,u,e.left),p=Mh(n.fixed-k,S,n.stretch,m),f=Th(i.stretch-_,w,d,e.top),y=Mh(i.fixed-A,T,i.stretch,g),v=Th(l.stretch-x,b,u,e.left),M=Mh(l.fixed-k,S,l.stretch,m),C=Th(c.stretch-_,w,d,e.top),E=Mh(c.fixed-A,T,c.stretch,g),I=new o(h,f),P=new o(v,f),O=new o(v,C),R=new o(h,C),L=new o(p/s,y/s),D=new o(M/s,E/s),z=t*Math.PI/180;if(z){var j=Math.sin(z),F=Math.cos(z),N=[F,-j,j,F];I._matMult(N),P._matMult(N),R._matMult(N),O._matMult(N)}var B=n.stretch+n.fixed,V=l.stretch+l.fixed,U=i.stretch+i.fixed,H=c.stretch+c.fixed;return{tl:I,tr:P,bl:R,br:O,tex:{x:a.paddedRect.x+wh+B,y:a.paddedRect.y+wh+U,w:V-B,h:H-U},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:L,pixelOffsetBR:D,minFontScaleX:S/s/u,minFontScaleY:T/s/d,isSDF:r}};if(n&&(a.stretchX||a.stretchY))for(var E=Ah(h,y,m),I=Ah(p,v,g),P=0;P0&&(f=Math.max(10,f),this.circleDiameter=f)}else{var m=a.top*s-l,g=a.bottom*s+l,y=a.left*s-l,v=a.right*s+l,x=a.collisionPadding;if(x&&(y-=x[0]*s,m-=x[1]*s,v+=x[2]*s,g+=x[3]*s),u){var b=new o(y,m),_=new o(v,m),w=new o(y,g),k=new o(v,g),S=u*Math.PI/180;b._rotate(S),_._rotate(S),w._rotate(S),k._rotate(S),y=Math.min(b.x,_.x,w.x,k.x),v=Math.max(b.x,_.x,w.x,k.x),m=Math.min(b.y,_.y,w.y,k.y),g=Math.max(b.y,_.y,w.y,k.y)}e.emplaceBack(t.x,t.y,y,m,v,g,r,n,i)}this.boxEndIndex=e.length},Ih=function(e,t){if(void 0===e&&(e=[]),void 0===t&&(t=Ph),this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function Ph(e,t){return et?1:0}function Oh(e,t,r){void 0===t&&(t=1),void 0===r&&(r=!1);for(var n=1/0,i=1/0,a=-1/0,s=-1/0,l=e[0],c=0;ca)&&(a=u.x),(!c||u.y>s)&&(s=u.y)}var d=a-n,h=s-i,p=Math.min(d,h),f=p/2,m=new Ih([],Rh);if(0===p)return new o(n,i);for(var g=n;gv.d||!v.d)&&(v=b,r&&console.log("found best %d after %d probes",Math.round(1e4*b.d)/1e4,x)),b.max-v.d<=t||(f=b.h/2,m.push(new Lh(b.p.x-f,b.p.y-f,f,e)),m.push(new Lh(b.p.x+f,b.p.y-f,f,e)),m.push(new Lh(b.p.x-f,b.p.y+f,f,e)),m.push(new Lh(b.p.x+f,b.p.y+f,f,e)),x+=4)}return r&&(console.log("num probes: "+x),console.log("best distance: "+v.d)),v.p}function Rh(e,t){return t.max-e.max}function Lh(e,t,r,n){this.p=new o(e,t),this.h=r,this.d=Dh(this.p,n),this.max=this.d+this.h*Math.SQRT2}function Dh(e,t){for(var r=!1,n=1/0,i=0;ie.y!==u.y>e.y&&e.x<(u.x-c.x)*(e.y-c.y)/(u.y-c.y)+c.x&&(r=!r),n=Math.min(n,Ks(e,c,u))}return(r?1:-1)*Math.sqrt(n)}function zh(e){for(var t=0,r=0,n=0,i=e[0],o=0,a=i.length,s=a-1;o0&&(this.data[0]=t,this._down(0)),e}},Ih.prototype.peek=function(){return this.data[0]},Ih.prototype._up=function(e){for(var t=this,r=t.data,n=t.compare,i=r[e];e>0;){var o=e-1>>1,a=r[o];if(n(i,a)>=0)break;r[e]=a,e=o}r[e]=i},Ih.prototype._down=function(e){for(var t=this,r=t.data,n=t.compare,i=this.length>>1,o=r[e];e=0)break;r[e]=s,e=a}r[e]=o};var jh=7,Fh=Number.POSITIVE_INFINITY;function Nh(e,t){function r(e,t){var r=0,n=0;t<0&&(t=0);var i=t/Math.sqrt(2);switch(e){case"top-right":case"top-left":n=i-jh;break;case"bottom-right":case"bottom-left":n=-i+jh;break;case"bottom":n=-t+jh;break;case"top":n=t-jh}switch(e){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=t;break;case"right":r=-t}return[r,n]}function n(e,t,r){var n=0,i=0;switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":i=r-jh;break;case"bottom-right":case"bottom-left":case"bottom":i=-r+jh}switch(e){case"top-right":case"bottom-right":case"right":n=-t;break;case"top-left":case"bottom-left":case"left":n=t}return[n,i]}return t[1]!==Fh?n(e,t[0],t[1]):r(e,t[0])}function Bh(e,t,r,n,i,o,a){e.createArrays();var s=512*e.overscaling;e.tilePixelRatio=Ds/s,e.compareText={},e.iconsNeedLinear=!1;var l=e.layers[0].layout,c=e.layers[0]._unevaluatedLayout._values,u={};if("composite"===e.textSizeData.kind){var d=e.textSizeData,h=d.minZoom,p=d.maxZoom;u.compositeTextSizes=[c["text-size"].possiblyEvaluate(new Jo(h),a),c["text-size"].possiblyEvaluate(new Jo(p),a)]}if("composite"===e.iconSizeData.kind){var f=e.iconSizeData,m=f.minZoom,g=f.maxZoom;u.compositeIconSizes=[c["icon-size"].possiblyEvaluate(new Jo(m),a),c["icon-size"].possiblyEvaluate(new Jo(g),a)]}u.layoutTextSize=c["text-size"].possiblyEvaluate(new Jo(e.zoom+1),a),u.layoutIconSize=c["icon-size"].possiblyEvaluate(new Jo(e.zoom+1),a),u.textMaxSize=c["text-size"].possiblyEvaluate(new Jo(18));for(var y=l.get("text-line-height")*Ku,v="map"===l.get("text-rotation-alignment")&&"point"!==l.get("symbol-placement"),x=l.get("text-keep-upright"),b=l.get("text-size"),_=function(){var o=k[w],s=l.get("text-font").evaluate(o,{},a).join(","),c=b.evaluate(o,{},a),d=u.layoutTextSize.evaluate(o,{},a),h=u.layoutIconSize.evaluate(o,{},a),p={horizontal:{},vertical:void 0},f=o.text,m=[0,0];if(f){var g=f.toString(),_=l.get("text-letter-spacing").evaluate(o,{},a)*Ku,S=Co(g)?_:0,A=l.get("text-anchor").evaluate(o,{},a),T=l.get("text-variable-anchor");if(!T){var M=l.get("text-radial-offset").evaluate(o,{},a);m=M?Nh(A,[M*Ku,Fh]):l.get("text-offset").evaluate(o,{},a).map((function(e){return e*Ku}))}var C=v?"center":l.get("text-justify").evaluate(o,{},a),E=l.get("symbol-placement"),I="point"===E?l.get("text-max-width").evaluate(o,{},a)*Ku:0,P=function(){e.allowVerticalPlacement&&Mo(g)&&(p.vertical=qd(f,t,r,i,s,I,y,A,"left",S,m,Fd.vertical,!0,E,d,c))};if(!v&&T){for(var R="auto"===C?T.map((function(e){return Vh(e)})):[C],L=!1,D=0;D=Ds||d.y<0||d.y>=Ds||Gh(e,d,s,r,n,i,h,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,v,w,A,l,b,k,T,f,t,o,c,u,a)};if("line"===M)for(var P=0,O=_h(t.geometry,0,0,Ds,Ds);P1){var B=vh(N,S,r.vertical||m,n,g,x);B&&I(N,B)}}else if("Polygon"===t.type)for(var V=0,U=Bc(t.geometry,0);V$h&&O(e.layerIds[0]+': Value for "text-size" is >= '+Hh+'. Reduce your "text-size".'):"composite"===g.kind&&((y=[ch*p.compositeTextSizes[0].evaluate(a,{},f),ch*p.compositeTextSizes[1].evaluate(a,{},f)])[0]>$h||y[1]>$h)&&O(e.layerIds[0]+': Value for "text-size" is >= '+Hh+'. Reduce your "text-size".'),e.addSymbols(e.text,m,y,s,o,a,c,t,l.lineStartIndex,l.lineLength,h,f);for(var v=0,x=u;v$h&&O(e.layerIds[0]+': Value for "icon-size" is >= '+Hh+'. Reduce your "icon-size".'):"composite"===Y.kind&&((X=[ch*_.compositeIconSizes[0].evaluate(b,{},k),ch*_.compositeIconSizes[1].evaluate(b,{},k)])[0]>$h||X[1]>$h)&&O(e.layerIds[0]+': Value for "icon-size" is >= '+Hh+'. Reduce your "icon-size".'),e.addSymbols(e.icon,q,X,x,v,b,!1,t,I.lineStartIndex,I.lineLength,-1,k),z=e.icon.placedSymbolArray.length-1,G&&(R=4*G.length,e.addSymbols(e.icon,G,X,x,v,b,Fd.vertical,t,I.lineStartIndex,I.lineLength,-1,k),j=e.icon.placedSymbolArray.length-1)}for(var Z in n.horizontal){var K=n.horizontal[Z];if(!T){N=ss(K.text);var J=s.layout.get("text-rotate").evaluate(b,{},k);T=new Eh(l,t,c,u,d,K,h,p,f,J)}var Q=1===K.positionedLines.length;if(L+=Wh(e,t,K,o,s,f,b,m,I,n.vertical?Fd.horizontal:Fd.horizontalOnly,Q?Object.keys(n.horizontal):[Z],F,z,_,k),Q)break}n.vertical&&(D+=Wh(e,t,n.vertical,o,s,f,b,m,I,Fd.vertical,["vertical"],F,j,_,k));var ee=T?T.boxStartIndex:e.collisionBoxArray.length,te=T?T.boxEndIndex:e.collisionBoxArray.length,re=C?C.boxStartIndex:e.collisionBoxArray.length,ne=C?C.boxEndIndex:e.collisionBoxArray.length,ie=M?M.boxStartIndex:e.collisionBoxArray.length,oe=M?M.boxEndIndex:e.collisionBoxArray.length,ae=E?E.boxStartIndex:e.collisionBoxArray.length,se=E?E.boxEndIndex:e.collisionBoxArray.length,le=-1,ce=function(e,t){return e&&e.circleDiameter?Math.max(e.circleDiameter,t):t};le=ce(T,le),le=ce(C,le),le=ce(M,le);var ue=(le=ce(E,le))>-1?1:0;ue&&(le*=S/Ku),e.glyphOffsetArray.length>=rp.MAX_GLYPHS&&O("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,b.sortKey),e.symbolInstances.emplaceBack(t.x,t.y,F.right>=0?F.right:-1,F.center>=0?F.center:-1,F.left>=0?F.left:-1,F.vertical||-1,z,j,N,ee,te,re,ne,ie,oe,ae,se,c,L,D,P,R,ue,0,h,B,V,le)}function Yh(e,t,r,n){var i=e.compareText;if(t in i){for(var o=i[t],a=o.length-1;a>=0;a--)if(n.dist(o[a])0)&&("constant"!==o.value.kind||o.value.value.length>0),c="constant"!==s.value.kind||!!s.value.value||Object.keys(s.parameters).length>0,u=i.get("symbol-sort-key");if(this.features=[],l||c){for(var d=t.iconDependencies,h=t.glyphDependencies,p=t.availableImages,f=new Jo(this.zoom),m=0,g=e;m=0;for(var R=0,L=S.sections;R=0;s--)o[s]={x:t[s].x,y:t[s].y,tileUnitDistanceFromAnchor:i},s>0&&(i+=t[s-1].dist(t[s]));for(var l=0;l0},rp.prototype.hasIconData=function(){return this.icon.segments.get().length>0},rp.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},rp.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},rp.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},rp.prototype.addIndicesForPlacedSymbol=function(e,t){for(var r=e.placedSymbolArray.get(t),n=r.vertexStartIndex+4*r.numGlyphs,i=r.vertexStartIndex;i1||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(var r=0,n=this.symbolInstanceIndexes;r=0&&n.indexOf(e)===r&&t.addIndicesForPlacedSymbol(t.text,e)})),o.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,o.verticalPlacedTextSymbolIndex),o.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.placedIconSymbolIndex),o.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,o.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},xo("SymbolBucket",rp,{omit:["layers","collisionBoxArray","features","compareText"]}),rp.MAX_GLYPHS=65535,rp.addDynamicAttributes=Jh;var ip=new ha({"symbol-placement":new sa(dt.layout_symbol["symbol-placement"]),"symbol-spacing":new sa(dt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new sa(dt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new la(dt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new sa(dt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new sa(dt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new sa(dt.layout_symbol["icon-ignore-placement"]),"icon-optional":new sa(dt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new sa(dt.layout_symbol["icon-rotation-alignment"]),"icon-size":new la(dt.layout_symbol["icon-size"]),"icon-text-fit":new sa(dt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new sa(dt.layout_symbol["icon-text-fit-padding"]),"icon-image":new la(dt.layout_symbol["icon-image"]),"icon-rotate":new la(dt.layout_symbol["icon-rotate"]),"icon-padding":new sa(dt.layout_symbol["icon-padding"]),"icon-keep-upright":new sa(dt.layout_symbol["icon-keep-upright"]),"icon-offset":new la(dt.layout_symbol["icon-offset"]),"icon-anchor":new la(dt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new sa(dt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new sa(dt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new sa(dt.layout_symbol["text-rotation-alignment"]),"text-field":new la(dt.layout_symbol["text-field"]),"text-font":new la(dt.layout_symbol["text-font"]),"text-size":new la(dt.layout_symbol["text-size"]),"text-max-width":new la(dt.layout_symbol["text-max-width"]),"text-line-height":new sa(dt.layout_symbol["text-line-height"]),"text-letter-spacing":new la(dt.layout_symbol["text-letter-spacing"]),"text-justify":new la(dt.layout_symbol["text-justify"]),"text-radial-offset":new la(dt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new sa(dt.layout_symbol["text-variable-anchor"]),"text-anchor":new la(dt.layout_symbol["text-anchor"]),"text-max-angle":new sa(dt.layout_symbol["text-max-angle"]),"text-writing-mode":new sa(dt.layout_symbol["text-writing-mode"]),"text-rotate":new la(dt.layout_symbol["text-rotate"]),"text-padding":new sa(dt.layout_symbol["text-padding"]),"text-keep-upright":new sa(dt.layout_symbol["text-keep-upright"]),"text-transform":new la(dt.layout_symbol["text-transform"]),"text-offset":new la(dt.layout_symbol["text-offset"]),"text-allow-overlap":new sa(dt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new sa(dt.layout_symbol["text-ignore-placement"]),"text-optional":new sa(dt.layout_symbol["text-optional"])}),op={paint:new ha({"icon-opacity":new la(dt.paint_symbol["icon-opacity"]),"icon-color":new la(dt.paint_symbol["icon-color"]),"icon-halo-color":new la(dt.paint_symbol["icon-halo-color"]),"icon-halo-width":new la(dt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new la(dt.paint_symbol["icon-halo-blur"]),"icon-translate":new sa(dt.paint_symbol["icon-translate"]),"icon-translate-anchor":new sa(dt.paint_symbol["icon-translate-anchor"]),"text-opacity":new la(dt.paint_symbol["text-opacity"]),"text-color":new la(dt.paint_symbol["text-color"],{runtimeType:kt,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new la(dt.paint_symbol["text-halo-color"]),"text-halo-width":new la(dt.paint_symbol["text-halo-width"]),"text-halo-blur":new la(dt.paint_symbol["text-halo-blur"]),"text-translate":new sa(dt.paint_symbol["text-translate"]),"text-translate-anchor":new sa(dt.paint_symbol["text-translate-anchor"])}),layout:ip},ap=function(e){this.type=e.property.overrides?e.property.overrides.runtimeType:xt,this.defaultValue=e};ap.prototype.evaluate=function(e){if(e.formattedSection){var 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},ap.prototype.eachChild=function(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)},ap.prototype.outputDefined=function(){return!1},ap.prototype.serialize=function(){return null},xo("FormatSectionOverride",ap,{omit:["defaultValue"]});var sp=function(e){function t(t){e.call(this,t,op)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.recalculate=function(t,r){if(e.prototype.recalculate.call(this,t,r),"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"]=this.layout.get("text-rotation-alignment")),"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")){var n=this.layout.get("text-writing-mode");if(n){for(var i=[],o=0,a=n;o",targetMapId:n,sourceMapId:o.mapId})}}},kp.prototype.receive=function(e){var t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if("